Fix compilation warnings, so that desktop build works
authorWojciech Wiśniewski <w.wisniewski@samsung.com>
Thu, 12 Jun 2014 17:18:41 +0000 (10:18 -0700)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Patch fixed compilation warnings.

Change-Id: I63bba4a5b727d3c6acbb43beb6e2479ac034a418

tizen_src/impl/browser/renderer_host/backing_store_efl.h
tizen_src/impl/browser/renderer_host/render_widget_host_view_efl.h
tizen_src/impl/browser/renderer_host/web_event_factory_efl.cc
tizen_src/impl/browser/renderer_host/web_event_factory_efl.h
tizen_src/impl/context_menu_controller_efl.cc
tizen_src/impl/selection_controller_efl.cc

index d7628d2..8fdad23 100644 (file)
@@ -9,7 +9,7 @@
 #include "content/browser/renderer_host/backing_store.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 
-typedef struct _Evas_Object Evas_Object;
+#include <Evas.h>
 
 namespace gfx {
 class Point;
index c41a3ef..8e32b84 100755 (executable)
@@ -322,8 +322,8 @@ class RenderWidgetHostViewEfl
   GLuint position_attrib_;
   GLuint texcoord_attrib_;
   void* egl_image_;
-  unsigned int current_pixmap_id_;
-  unsigned int next_pixmap_id_;
+  unsigned long current_pixmap_id_;
+  unsigned long next_pixmap_id_;
   GLuint texture_id_;
 
   DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewEfl);
index b1c4ced..6d57c55 100644 (file)
 #include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/events/keycodes/keyboard_code_conversion_x.h"
 
-#include <Eina.h>
 #include <Ecore.h>
-#include <Ecore_Input.h>
 #include <Ecore_X.h>
-#include <Evas.h>
 
 // TODO: Figure out how to avoid this includes.
 #include <X11/Xutil.h>
@@ -40,7 +37,7 @@ using namespace blink;
 
 namespace {
 
-inline void TranslateEvasCoordToWebKitCoord(Evas_Object *web_view, int& x, int& y) {
+static void TranslateEvasCoordToWebKitCoord(Evas_Object *web_view, int& x, int& y) {
   Evas_Coord tmpX, tmpY;
   evas_object_geometry_get(web_view, &tmpX, &tmpY, 0, 0);
   x -= tmpX;
@@ -48,104 +45,16 @@ inline void TranslateEvasCoordToWebKitCoord(Evas_Object *web_view, int& x, int&
 }
 
 }
-namespace content {
-
-static WebMouseEvent::Button EflToWebMouseButton(unsigned int eflButton) {
-  switch(eflButton) {
-    case 1:
-      return WebMouseEvent::ButtonLeft;
-    case 2:
-      return WebMouseEvent::ButtonMiddle;
-    case 3:
-      return WebMouseEvent::ButtonRight;
-  }
-
-  return WebMouseEvent::ButtonNone;
-}
-
-static int EflToWebModifiers(unsigned int eflmodifiers, unsigned int eflbuttons) {
-  int flags = 0;
-  if (eflmodifiers & ECORE_EVENT_MODIFIER_CTRL)
-    flags |= WebInputEvent::ControlKey;
-
-  if (eflmodifiers & ECORE_EVENT_MODIFIER_SHIFT)
-    flags |= WebInputEvent::ShiftKey;
-
-  if (eflmodifiers & ECORE_EVENT_MODIFIER_ALT)
-    flags |= WebInputEvent::AltKey;
-
-  if (eflbuttons == 1)
-    flags |= WebInputEvent::LeftButtonDown;
-
-  if (eflbuttons == 2)
-    flags |= WebInputEvent::MiddleButtonDown;
-
-  if (eflbuttons == 3)
-    flags |= WebInputEvent::RightButtonDown;
-
-  return flags;
-}
-
-WebMouseEvent WebEventFactoryEfl::toWebMouseEvent(const Ecore_Event_Mouse_Button* ev, bool pressed) {
-  WebMouseEvent webKitEvent;
-  webKitEvent.timeStampSeconds = (double)ev->timestamp / 1000;
-  webKitEvent.button = EflToWebMouseButton(ev->buttons);
-  webKitEvent.modifiers = EflToWebModifiers(ev->modifiers, pressed ? ev->buttons : 0);
-
-  webKitEvent.x = webKitEvent.windowX = ev->x;
-  webKitEvent.y = webKitEvent.windowY = ev->y;
-  webKitEvent.globalX = ev->root.x;
-  webKitEvent.globalY = ev->root.y;
-  webKitEvent.type = pressed ? WebInputEvent::MouseDown : WebInputEvent::MouseUp;
 
-  webKitEvent.clickCount = 1;
-
-  return webKitEvent;
-}
+namespace content {
 
 static const float cDefaultScrollStep = 20;
 
-WebMouseWheelEvent WebEventFactoryEfl::toWebMouseEvent(const Ecore_Event_Mouse_Wheel* ev) {
-  WebMouseWheelEvent webKitEvent;
-  webKitEvent.timeStampSeconds = (double)ev->timestamp / 1000;
-  webKitEvent.modifiers = EflToWebModifiers(ev->modifiers, 0);
-
-  webKitEvent.x = webKitEvent.windowX = ev->x;
-  webKitEvent.y = webKitEvent.windowY = ev->y;
-  webKitEvent.globalX = ev->root.x;
-  webKitEvent.globalY = ev->root.y;
-  webKitEvent.type = WebInputEvent::MouseWheel;
-
-  if (ev->direction) {
-    webKitEvent.wheelTicksX = ev->z;
-    webKitEvent.deltaX = ev->z * cDefaultScrollStep;
-  } else {
-    webKitEvent.wheelTicksY = -(ev->z);
-    webKitEvent.deltaY = -(ev->z * cDefaultScrollStep);
-  }
-
-  return webKitEvent;
-}
-
-WebMouseEvent WebEventFactoryEfl::toWebMouseEvent(const Ecore_Event_Mouse_Move* ev) {
-  WebMouseEvent webKitEvent;
-  webKitEvent.timeStampSeconds = (double)ev->timestamp / 1000;
-  webKitEvent.modifiers = EflToWebModifiers(ev->modifiers, 0);
-
-  webKitEvent.x = webKitEvent.windowX = ev->x;
-  webKitEvent.y = webKitEvent.windowY = ev->y;
-  webKitEvent.globalX = ev->root.x;
-  webKitEvent.globalY = ev->root.y;
-  webKitEvent.type = WebInputEvent::MouseMove;
-
-  return webKitEvent;
-}
-
-ui::KeyboardCode KeyboardCodeFromEflKey(const char* key) {
+static ui::KeyboardCode KeyboardCodeFromEflKey(const char* key) {
   return ui::KeyboardCodeFromXKeysym(XStringToKeysym(key));
 }
 
-int WindowsKeyCodeFromEflKey(const char* key) {
+static int WindowsKeyCodeFromEflKey(const char* key) {
   int windows_key_code = KeyboardCodeFromEflKey(key);
   if (windows_key_code == ui::VKEY_SHIFT ||
       windows_key_code == ui::VKEY_CONTROL ||
@@ -173,12 +82,12 @@ int WindowsKeyCodeFromEflKey(const char* key) {
   return windows_key_code;
 }
 
-int NativeKeyCodeFromEflKey(const char* key) {
+static int NativeKeyCodeFromEflKey(const char* key) {
   //return ecore_x_keysym_keycode_get(ev->key);
   return XKeysymToKeycode((Display*)ecore_x_display_get(), XStringToKeysym(key));
 }
 
-int CharacterFromEflString(const char* string) {
+static int CharacterFromEflString(const char* string) {
   if (string) {
     base::string16 result;
     base::UTF8ToUTF16(string, strlen(string), &result);
@@ -234,34 +143,6 @@ static blink::WebUChar GetControlCharacter(int windows_key_code, bool shift) {
   return 0;
 }
 
-content::NativeWebKeyboardEvent WebEventFactoryEfl::toWebKeyboardEvent(const Ecore_Event_Key* ev, bool pressed) {
-  content::NativeWebKeyboardEvent webKitEvent;
-  webKitEvent.timeStampSeconds =  (double)ev->timestamp / 1000;
-  webKitEvent.modifiers = EflToWebModifiers(ev->modifiers, 0);
-  webKitEvent.type = pressed ? WebInputEvent::KeyDown : WebInputEvent::KeyUp;
-
-  webKitEvent.nativeKeyCode = NativeKeyCodeFromEflKey(ev->key);
-  webKitEvent.windowsKeyCode = WindowsKeyCodeFromEflKey(ev->key);
-
-  if (webKitEvent.windowsKeyCode == ui::VKEY_RETURN)
-      webKitEvent.unmodifiedText[0] = '\r';
-  else
-    webKitEvent.unmodifiedText[0] = CharacterFromEflString(ev->string);
-
-  if (webKitEvent.modifiers & blink::WebInputEvent::ControlKey) {
-    webKitEvent.text[0] =
-        GetControlCharacter(
-            webKitEvent.windowsKeyCode,
-            webKitEvent.modifiers & blink::WebInputEvent::ShiftKey);
-  } else {
-    webKitEvent.text[0] = webKitEvent.unmodifiedText[0];
-  }
-
-  webKitEvent.setKeyIdentifierFromWindowsKeyCode();
-
-  return webKitEvent;
-}
-
 enum {
   LeftButton = 1,
   MiddleButton = 2,
@@ -279,7 +160,7 @@ static  WebMouseEvent::Button EvasToWebMouseButton(int button) {
   return WebMouseEvent::ButtonNone;
 }
 
-static inline WebInputEvent::Modifiers EvasToWebModifiers(const Evas_Modifier* modifiers) {
+static WebInputEvent::Modifiers EvasToWebModifiers(const Evas_Modifier* modifiers) {
   unsigned result = 0;
 
   if (evas_key_modifier_is_set(modifiers, "Shift"))
index 8880616..7e15eb0 100644 (file)
 #include "third_party/WebKit/public/web/WebInputEvent.h"
 #include "ui/events/event.h"
 
-typedef struct _Ecore_Event_Mouse_Button Ecore_Event_Mouse_Button;
-typedef struct _Ecore_Event_Mouse_Wheel  Ecore_Event_Mouse_Wheel;
-typedef struct _Ecore_Event_Mouse_Move   Ecore_Event_Mouse_Move;
-typedef struct _Ecore_Event_Key          Ecore_Event_Key;
-typedef struct _Evas Evas;
-typedef struct _Evas_Event_Mouse_Down    Evas_Event_Mouse_Down;
-typedef struct _Evas_Event_Mouse_Up      Evas_Event_Mouse_Up;
-typedef struct _Evas_Event_Mouse_Move    Evas_Event_Mouse_Move;
-typedef struct _Evas_Event_Mouse_Wheel   Evas_Event_Mouse_Wheel;
-typedef struct _Evas_Event_Key_Down      Evas_Event_Key_Down;
-typedef struct _Evas_Event_Key_Up        Evas_Event_Key_Up;
+#include <Evas.h>
+
 typedef struct _Ewk_Touch_Point          Ewk_Touch_Point;
-typedef struct _Evas_Object Evas_Object;
 
 namespace content {
 
 class WebEventFactoryEfl {
  public:
-  static blink::WebMouseEvent toWebMouseEvent(const Ecore_Event_Mouse_Button*, bool pressed);
-  static blink::WebMouseWheelEvent toWebMouseEvent(const Ecore_Event_Mouse_Wheel*);
-  static blink::WebMouseEvent toWebMouseEvent(const Ecore_Event_Mouse_Move*);
-
-  static content::NativeWebKeyboardEvent toWebKeyboardEvent(const Ecore_Event_Key*, bool pressed);
-
   static blink::WebMouseEvent toWebMouseEvent(Evas*, Evas_Object*, const Evas_Event_Mouse_Down*, float scale_factor);
   static blink::WebMouseEvent toWebMouseEvent(Evas*, Evas_Object*,  const Evas_Event_Mouse_Up*, float scale_factor);
   static blink::WebMouseEvent toWebMouseEvent(Evas*,  Evas_Object*, const Evas_Event_Mouse_Move*, float scale_factor);
index af1c201..ba5d0de 100644 (file)
@@ -314,7 +314,7 @@ void ContextMenuControllerEfl::MenuItemSelected(ContextMenuItemEfl *menu_item) {
       if (params_.is_editable) {
         HideSelectionHandle();
         Eina_Rectangle left_rect, right_rect;
-        Eina_Bool result = view->GetSelectionRange(&left_rect, &right_rect);
+        view->GetSelectionRange(&left_rect, &right_rect);
         Evas_Coord x, y;
         evas_object_geometry_get(view->evas_object(), &x, &y, 0, 0);
         right_rect.x += x;
index ce0acca..4f5eb3f 100644 (file)
 
 namespace content {
 
-const int menuHeight = 140;// The Height fo the context menu.
-const int menuPadding = 60;// This is padding for deciding when to modify context menu position.
-//const int spacePadding = 24;// This is for making context menu closer to the handles.
-const int spacePadding = 0;// This is for making context menu closer to the handles.
-const int textSelectionScrollSize = 50;// Scroll step when selection handler is moving out of viewport.
-static int s_magnifierMaxYOffsetDelta = 50;// Magnifier should not show the image below the viewport
-static int s_textSelectionMargin = 5;
+static const int menuHeight = 140;// The Height fo the context menu.
+static const int menuPadding = 60;// This is padding for deciding when to modify context menu position.
+static const int spacePadding = 0; // 24;// This is for making context menu closer to the handles.
+static const int textSelectionScrollSize = 50;// Scroll step when selection handler is moving out of viewport.
 
 static bool IsRectEmpty(const gfx::Rect& rect) {
   if (rect.x() == 0 && rect.y() == 0 && rect.height() == 0 && rect.width() == 0) {
@@ -46,8 +43,8 @@ static bool IsRectEmpty(const gfx::Rect& rect) {
 SelectionControllerEfl::SelectionControllerEfl(EWebView* parent_view)
     :  parent_view_(parent_view),
        mouse_press_(false),
-       long_mouse_press_(false),
        scrolling_(false),
+       long_mouse_press_(false),
        selection_data_(new SelectionBoxEfl(parent_view)),
        start_handle_(new SelectionHandleEfl(this, SelectionHandleEfl::HANDLE_TYPE_LEFT, parent_view->evas_object())),
        end_handle_(new SelectionHandleEfl(this, SelectionHandleEfl::HANDLE_TYPE_RIGHT, parent_view->evas_object())),