Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (131649 => 131650)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-10-17 21:57:40 UTC (rev 131649)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-10-17 22:04:47 UTC (rev 131650)
@@ -25,6 +25,7 @@
#include "NativeWebMouseEvent.h"
#include "NativeWebWheelEvent.h"
#include "PageClientImpl.h"
+#include "RefPtrEfl.h"
#include "WKAPICast.h"
#include "WKColorPickerResultListener.h"
#include "WKEinaSharedString.h"
@@ -124,12 +125,12 @@
WKEinaSharedString customEncoding;
WKEinaSharedString cursorGroup;
WKEinaSharedString faviconURL;
- Evas_Object* cursorObject;
+ RefPtr<Evas_Object> cursorObject;
LoadingResourcesMap loadingResourcesMap;
OwnPtr<Ewk_Back_Forward_List> backForwardList;
OwnPtr<Ewk_Settings> settings;
bool areMouseEventsEnabled;
- WKColorPickerResultListenerRef colorPickerResultListener;
+ WKRetainPtr<WKColorPickerResultListenerRef> colorPickerResultListener;
Ewk_Context* context;
#if ENABLE(TOUCH_EVENTS)
bool areTouchEventsEnabled;
@@ -149,9 +150,7 @@
#endif
_Ewk_View_Private_Data()
- : cursorObject(0)
- , areMouseEventsEnabled(false)
- , colorPickerResultListener(0)
+ : areMouseEventsEnabled(false)
, context(0)
#if ENABLE(TOUCH_EVENTS)
, areTouchEventsEnabled(false)
@@ -174,9 +173,6 @@
Ewk_Favicon_Database* iconDatabase = ewk_context_favicon_database_get(context);
ewk_favicon_database_icon_change_callback_del(iconDatabase, _ewk_view_on_favicon_changed);
- if (cursorObject)
- evas_object_del(cursorObject);
-
void* item;
EINA_LIST_FREE(popupMenuItems, item)
delete static_cast<Ewk_Popup_Menu_Item*>(item);
@@ -1248,15 +1244,11 @@
return;
priv->cursorGroup = group;
+ priv->cursorObject = adoptRef(edje_object_add(smartData->base.evas));
- if (priv->cursorObject)
- evas_object_del(priv->cursorObject);
- priv->cursorObject = edje_object_add(smartData->base.evas);
-
Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(smartData->base.evas);
- if (!priv->theme || !edje_object_file_set(priv->cursorObject, priv->theme, group)) {
- evas_object_del(priv->cursorObject);
- priv->cursorObject = 0;
+ if (!priv->theme || !edje_object_file_set(priv->cursorObject.get(), priv->theme, group)) {
+ priv->cursorObject.clear();
ecore_evas_object_cursor_set(ecoreEvas, 0, 0, 0, 0);
#ifdef HAVE_ECORE_X
@@ -1267,27 +1259,27 @@
}
Evas_Coord width, height;
- edje_object_size_min_get(priv->cursorObject, &width, &height);
+ edje_object_size_min_get(priv->cursorObject.get(), &width, &height);
if (width <= 0 || height <= 0)
- edje_object_size_min_calc(priv->cursorObject, &width, &height);
+ edje_object_size_min_calc(priv->cursorObject.get(), &width, &height);
if (width <= 0 || height <= 0) {
width = defaultCursorSize;
height = defaultCursorSize;
}
- evas_object_resize(priv->cursorObject, width, height);
+ evas_object_resize(priv->cursorObject.get(), width, height);
const char* data;
int hotspotX = 0;
- data = "" "hot.x");
+ data = "" "hot.x");
if (data)
hotspotX = atoi(data);
int hotspotY = 0;
- data = "" "hot.y");
+ data = "" "hot.y");
if (data)
hotspotY = atoi(data);
- ecore_evas_object_cursor_set(ecoreEvas, priv->cursorObject, EVAS_LAYER_MAX, hotspotX, hotspotY);
+ ecore_evas_object_cursor_set(ecoreEvas, priv->cursorObject.get(), EVAS_LAYER_MAX, hotspotX, hotspotY);
}
void ewk_view_display(Evas_Object* ewkView, const IntRect& rect)
@@ -1909,7 +1901,7 @@
#if ENABLE(INPUT_TYPE_COLOR)
/**
* @internal
- * Reqeusts to show external color picker.
+ * Requests to show external color picker.
*/
void ewk_view_color_picker_request(Evas_Object* ewkView, int r, int g, int b, int a, WKColorPickerResultListenerRef listener)
{
@@ -1924,7 +1916,7 @@
/**
* @internal
- * Reqeusts to hide external color picker.
+ * Requests to hide external color picker.
*/
void ewk_view_color_picker_dismiss(Evas_Object* ewkView)
{
@@ -1932,7 +1924,7 @@
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
EINA_SAFETY_ON_NULL_RETURN(smartData->api->input_picker_color_dismiss);
- priv->colorPickerResultListener = 0;
+ priv->colorPickerResultListener.clear();
smartData->api->input_picker_color_dismiss(smartData);
}
@@ -1947,8 +1939,8 @@
WebCore::Color color = WebCore::Color(r, g, b, a);
const WKStringRef colorString = WKStringCreateWithUTF8CString(color.serialized().utf8().data());
- WKColorPickerResultListenerSetColor(priv->colorPickerResultListener, colorString);
- priv->colorPickerResultListener = 0;
+ WKColorPickerResultListenerSetColor(priv->colorPickerResultListener.get(), colorString);
+ priv->colorPickerResultListener.clear();
return true;
#else