⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98378 in webkit


Ignore:
Timestamp:
Oct 25, 2011, 12:45:27 PM (15 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Ivan Briano <ivan@profusion.mobi> 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:
Location:
trunk/Source/WebKit/efl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r98376 r98378  
     12011-10-25  Ivan Briano  <ivan@profusion.mobi>
     2
     3        [EFL] Add function to get geometry of focused element
     4        https://bugs.webkit.org/show_bug.cgi?id=70728
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Added function to ewk_frame to get the geometry of the focused
     9        element within the frame object.
     10
     11        * ewk/ewk_frame.cpp:
     12        (ewk_frame_focused_element_geometry_get): Retrieves the geometry of
     13        the focused element within the given frame object.
     14        * ewk/ewk_frame.h:
     15
    1162011-10-25  Ivan Briano  <ivan@profusion.mobi>
    217
  • trunk/Source/WebKit/efl/ewk/ewk_frame.cpp

    r98190 r98378  
    827827}
    828828
     829Eina_Bool ewk_frame_focused_element_geometry_get(const Evas_Object *ewkFrame, int *x, int *y, int *w, int *h)
     830{
     831    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, EINA_FALSE);
     832    WebCore::Document* document = smartData->frame->document();
     833    if (!document)
     834        return EINA_FALSE;
     835    WebCore::Node* focusedNode = document->focusedNode();
     836    if (!focusedNode)
     837        return EINA_FALSE;
     838    WebCore::IntRect nodeRect = focusedNode->getRect();
     839    if (x)
     840        *x = nodeRect.x();
     841    if (y)
     842        *y = nodeRect.y();
     843    if (w)
     844        *w = nodeRect.width();
     845    if (h)
     846        *h = nodeRect.height();
     847    return EINA_TRUE;
     848}
     849
    829850Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object* ewkFrame, const Evas_Event_Mouse_Wheel* wheelEvent)
    830851{
  • trunk/Source/WebKit/efl/ewk/ewk_frame.h

    r97043 r98378  
    702702
    703703/**
     704 * Gets the geometry, relative to the frame, of the focused element in the
     705 * document.
     706 *
     707 * @param o frame object containing the focused element
     708 * @param x pointer where to store the X value of the geometry, may be @c 0
     709 * @param x pointer where to store the Y value of the geometry, may be @c 0
     710 * @param x pointer where to store width of the geometry, may be @c 0
     711 * @param x pointer where to store height of the geometry, may be @c 0
     712 *
     713 * @return @c EINA_TRUE if the frame contains the currently focused element and
     714 * its geometry was correctly fetched, @c EINA_FALSE in any other case
     715 */
     716EAPI Eina_Bool ewk_frame_focused_element_geometry_get(const Evas_Object *o, int *x, int *y, int *w, int *h);
     717
     718/**
    704719 * Feeds the mouse wheel event to the frame.
    705720 *
Note: See TracChangeset for help on using the changeset viewer.