Changeset 48505 in webkit


Ignore:
Timestamp:
Sep 18, 2009 6:53:10 AM (15 years ago)
Author:
xan@webkit.org
Message:

2009-09-14 Xan Lopez <xlopez@igalia.com>

Reviewed by Gustavo Noronha and Jan Alonzo.

[GTK] context menu overriding API is very limited
https://bugs.webkit.org/show_bug.cgi?id=27546

Add WebKitHitTestResult to the build.

  • GNUmakefile.am:

WebKit/gtk:

2009-09-18 Xan Lopez <xlopez@igalia.com>

Reviewed by Gustavo Noronha and Jan Alonzo.

[GTK] context menu overriding API is very limited
https://bugs.webkit.org/show_bug.cgi?id=27546

Add WebKitHitTestResult, a wrapper over HitTestResult. It contains
context information about a point in the web page.

  • webkit/webkit.h:
  • webkit/webkitdefines.h:
  • webkit/webkithittestresult.cpp: Added. (webkit_hit_test_result_finalize): (webkit_hit_test_result_get_property): (webkit_hit_test_result_set_property): (webkit_hit_test_result_class_init): (webkit_hit_test_result_init):
  • webkit/webkithittestresult.h: Added.
  • webkit/webkitprivate.cpp: (WebKit::kit):
  • webkit/webkitprivate.h:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r48250 r48505  
     12009-09-14  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Gustavo Noronha and Jan Alonzo.
     4
     5        [GTK] context menu overriding API is very limited
     6        https://bugs.webkit.org/show_bug.cgi?id=27546
     7
     8        Add WebKitHitTestResult to the build.
     9
     10        * GNUmakefile.am:
     11
    1122009-09-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
    213
  • trunk/GNUmakefile.am

    r48118 r48505  
    319319        $(srcdir)/WebKit/gtk/webkit/webkitdownload.h \
    320320        $(srcdir)/WebKit/gtk/webkit/webkiterror.h \
     321        $(srcdir)/WebKit/gtk/webkit/webkithittestresult.h \
    321322        $(srcdir)/WebKit/gtk/webkit/webkitnetworkrequest.h \
    322323        $(srcdir)/WebKit/gtk/webkit/webkitnetworkresponse.h \
     
    363364        WebKit/gtk/webkit/webkitdownload.cpp \
    364365        WebKit/gtk/webkit/webkiterror.cpp \
     366        WebKit/gtk/webkit/webkithittestresult.cpp \
    365367        WebKit/gtk/webkit/webkitnetworkrequest.cpp \
    366368        WebKit/gtk/webkit/webkitnetworkresponse.cpp \
  • trunk/WebKit/gtk/ChangeLog

    r48382 r48505  
     12009-09-18  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Gustavo Noronha and Jan Alonzo.
     4
     5        [GTK] context menu overriding API is very limited
     6        https://bugs.webkit.org/show_bug.cgi?id=27546
     7
     8        Add WebKitHitTestResult, a wrapper over HitTestResult. It contains
     9        context information about a point in the web page.
     10
     11        * webkit/webkit.h:
     12        * webkit/webkitdefines.h:
     13        * webkit/webkithittestresult.cpp: Added.
     14        (webkit_hit_test_result_finalize):
     15        (webkit_hit_test_result_get_property):
     16        (webkit_hit_test_result_set_property):
     17        (webkit_hit_test_result_class_init):
     18        (webkit_hit_test_result_init):
     19        * webkit/webkithittestresult.h: Added.
     20        * webkit/webkitprivate.cpp:
     21        (WebKit::kit):
     22        * webkit/webkitprivate.h:
     23
    1242009-09-14  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    225
  • trunk/WebKit/gtk/webkit/webkit.h

    r48118 r48505  
    2525#include <webkit/webkitdefines.h>
    2626#include <webkit/webkitdownload.h>
     27#include <webkit/webkithittestresult.h>
    2728#include <webkit/webkitnetworkrequest.h>
    2829#include <webkit/webkitnetworkresponse.h>
  • trunk/WebKit/gtk/webkit/webkitdefines.h

    r48118 r48505  
    8787typedef struct _WebKitSecurityOriginClass WebKitSecurityOriginClass;
    8888
     89typedef struct _WebKitHitTestResult WebKitHitTestResult;
     90typedef struct _WebKitHitTestResultClass WebKitHitTestResultClass;
     91
    8992G_END_DECLS
    9093
  • trunk/WebKit/gtk/webkit/webkitprivate.cpp

    r48118 r48505  
    2828#include "FrameLoader.h"
    2929#include "FrameLoaderClientGtk.h"
     30#include "HitTestResult.h"
    3031#include <libintl.h>
    3132#include "Logging.h"
     
    117118}
    118119
     120WebKitHitTestResult* kit(const WebCore::HitTestResult& result)
     121{
     122    guint context = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
     123    GOwnPtr<char> linkURI(0);
     124    GOwnPtr<char> imageURI(0);
     125    GOwnPtr<char> mediaURI(0);
     126
     127    if (!result.absoluteLinkURL().isEmpty()) {
     128        context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;
     129        linkURI.set(g_strdup(result.absoluteLinkURL().string().utf8().data()));
     130    }
     131
     132    if (!result.absoluteImageURL().isEmpty()) {
     133        context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
     134        imageURI.set(g_strdup(result.absoluteImageURL().string().utf8().data()));
     135    }
     136
     137    if (!result.absoluteMediaURL().isEmpty()) {
     138        context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;
     139        mediaURI.set(g_strdup(result.absoluteMediaURL().string().utf8().data()));
     140    }
     141
     142    if (result.isSelected())
     143        context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION;
     144
     145    if (result.isContentEditable())
     146        context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
     147
     148    return WEBKIT_HIT_TEST_RESULT(g_object_new(WEBKIT_TYPE_HIT_TEST_RESULT,
     149                                           "link-uri", linkURI.get(),
     150                                           "image-uri", imageURI.get(),
     151                                           "media-uri", mediaURI.get(),
     152                                           "context", context,
     153                                           NULL));
     154}
     155
    119156} /** end namespace WebKit */
    120157
  • trunk/WebKit/gtk/webkit/webkitprivate.h

    r48382 r48505  
    3131#include <webkit/webkitdefines.h>
    3232#include <webkit/webkitdownload.h>
     33#include <webkit/webkithittestresult.h>
    3334#include <webkit/webkitnetworkrequest.h>
    3435#include <webkit/webkitwebview.h>
     
    9596    WebKitSecurityOrigin* kit(WebCore::SecurityOrigin*);
    9697    WebCore::SecurityOrigin* core(WebKitSecurityOrigin*);
     98
     99    WebKitHitTestResult* kit(const WebCore::HitTestResult&);
    97100}
    98101
Note: See TracChangeset for help on using the changeset viewer.