Title: [98378] trunk/Source/WebKit/efl
Revision
98378
Author
[email protected]
Date
2011-10-25 12:45:27 -0700 (Tue, 25 Oct 2011)

Log Message

[EFL] Add function to get geometry of focused element
https://bugs.webkit.org/show_bug.cgi?id=70728

Patch by Ivan Briano <[email protected]> on 2011-10-25
Reviewed by Antonio Gomes.

Added function to ewk_frame to get the geometry of the focused
element within the frame object.

* ewk/ewk_frame.cpp:
(ewk_frame_focused_element_geometry_get): Retrieves the geometry of
the focused element within the given frame object.
* ewk/ewk_frame.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (98377 => 98378)


--- trunk/Source/WebKit/efl/ChangeLog	2011-10-25 19:37:13 UTC (rev 98377)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-10-25 19:45:27 UTC (rev 98378)
@@ -1,5 +1,20 @@
 2011-10-25  Ivan Briano  <[email protected]>
 
+        [EFL] Add function to get geometry of focused element
+        https://bugs.webkit.org/show_bug.cgi?id=70728
+
+        Reviewed by Antonio Gomes.
+
+        Added function to ewk_frame to get the geometry of the focused
+        element within the frame object.
+
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_focused_element_geometry_get): Retrieves the geometry of
+        the focused element within the given frame object.
+        * ewk/ewk_frame.h:
+
+2011-10-25  Ivan Briano  <[email protected]>
+
         [EFL] Add necessary information for callback instropection
         https://bugs.webkit.org/show_bug.cgi?id=70735
 

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (98377 => 98378)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2011-10-25 19:37:13 UTC (rev 98377)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2011-10-25 19:45:27 UTC (rev 98378)
@@ -826,6 +826,27 @@
     return EINA_FALSE;
 }
 
+Eina_Bool ewk_frame_focused_element_geometry_get(const Evas_Object *ewkFrame, int *x, int *y, int *w, int *h)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, EINA_FALSE);
+    WebCore::Document* document = smartData->frame->document();
+    if (!document)
+        return EINA_FALSE;
+    WebCore::Node* focusedNode = document->focusedNode();
+    if (!focusedNode)
+        return EINA_FALSE;
+    WebCore::IntRect nodeRect = focusedNode->getRect();
+    if (x)
+        *x = nodeRect.x();
+    if (y)
+        *y = nodeRect.y();
+    if (w)
+        *w = nodeRect.width();
+    if (h)
+        *h = nodeRect.height();
+    return EINA_TRUE;
+}
+
 Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object* ewkFrame, const Evas_Event_Mouse_Wheel* wheelEvent)
 {
     EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, EINA_FALSE);

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.h (98377 => 98378)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.h	2011-10-25 19:37:13 UTC (rev 98377)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.h	2011-10-25 19:45:27 UTC (rev 98378)
@@ -701,6 +701,21 @@
 EAPI Eina_Bool    ewk_frame_feed_focus_out(Evas_Object *o);
 
 /**
+ * Gets the geometry, relative to the frame, of the focused element in the
+ * document.
+ *
+ * @param o frame object containing the focused element
+ * @param x pointer where to store the X value of the geometry, may be @c 0
+ * @param x pointer where to store the Y value of the geometry, may be @c 0
+ * @param x pointer where to store width of the geometry, may be @c 0
+ * @param x pointer where to store height of the geometry, may be @c 0
+ *
+ * @return @c EINA_TRUE if the frame contains the currently focused element and
+ * its geometry was correctly fetched, @c EINA_FALSE in any other case
+ */
+EAPI Eina_Bool ewk_frame_focused_element_geometry_get(const Evas_Object *o, int *x, int *y, int *w, int *h);
+
+/**
  * Feeds the mouse wheel event to the frame.
  *
  * @param o frame object to feed the mouse wheel event
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to