summaryrefslogtreecommitdiff
path: root/src/controls/FWebCtrl_Utility.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/controls/FWebCtrl_Utility.cpp')
-rwxr-xr-xsrc/controls/FWebCtrl_Utility.cpp120
1 files changed, 120 insertions, 0 deletions
diff --git a/src/controls/FWebCtrl_Utility.cpp b/src/controls/FWebCtrl_Utility.cpp
new file mode 100755
index 0000000..7d86339
--- /dev/null
+++ b/src/controls/FWebCtrl_Utility.cpp
@@ -0,0 +1,120 @@
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebCtrl_Utility.cpp
+ * @brief The file contains the definition of _Utility class.
+ *
+ * The file contains the definition of _Utility class.
+ */
+
+#include <Ecore.h>
+#include <FBaseSysLog.h>
+#include "FWebCtrl_Utility.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+
+namespace Tizen { namespace Web { namespace Controls
+{
+
+
+const char CERTIFICATE_FILE_PATH[] = "/opt/osp/system/internal/security/certmgr/certificates.crt";
+const char PLUGIN_DIRECTORY_PATH[] = "/usr/lib/osp/browser-plugin/";
+
+
+const wchar_t GEOLOCATION_DIRECTORY_PATH[] = L"data/.webkit/locationDatabase/";
+const wchar_t GEOLOCATION_DB_NAME[] = L".location.db";
+const wchar_t GEOLOCATION_TABLE_NAME[] = L"geolocationPermission";
+
+
+_Utility::_Utility(void)
+{
+}
+
+_Utility::~_Utility(void)
+{
+}
+
+result
+_Utility::GetPixelBufferFromEvasObject(const Evas_Object* source, Tizen::Graphics::BufferInfo& bufferInfo)
+{
+ bufferInfo.pPixels = evas_object_image_data_get(source, EINA_FALSE);
+ SysTryReturnResult(NID_WEB_CTRL, bufferInfo.pPixels, E_INVALID_DATA, "Failed to get pixel data from evas object.");
+
+ evas_object_image_size_get(source, &bufferInfo.width, &bufferInfo.height);
+
+ Evas_Colorspace colorSpace = evas_object_image_colorspace_get(source);
+
+ switch (colorSpace)
+ {
+ case EVAS_COLORSPACE_ARGB8888:
+ bufferInfo.bitsPerPixel = 32;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_ARGB8888;
+ break;
+
+ case EVAS_COLORSPACE_YCBCR422P601_PL:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+
+ case EVAS_COLORSPACE_YCBCR422P709_PL:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+
+ case EVAS_COLORSPACE_RGB565_A5P:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+
+ case EVAS_COLORSPACE_GRY8:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+
+ default:
+ bufferInfo.bitsPerPixel = 0;
+ bufferInfo.pixelFormat = PIXEL_FORMAT_MIN;
+ break;
+ }
+
+ bufferInfo.pitch = bufferInfo.width * bufferInfo.bitsPerPixel / 8;
+
+ SysLog(NID_WEB_CTRL, "color space : %d, pitch (%d), w-h (%d, %d)", colorSpace, bufferInfo.pitch, bufferInfo.width, bufferInfo.height);
+
+// evas_object_image_data_set(const_cast<Evas_Object*>(source), null);
+
+ return E_SUCCESS;
+
+}
+}}}