Changeset 70983 in webkit


Ignore:
Timestamp:
Oct 30, 2010 8:17:06 AM (13 years ago)
Author:
xan@webkit.org
Message:

2010-10-30 Xan Lopez <xlopez@igalia.com>

Reviewed by Martin Robinson.

[GTK] Use new width for height APIs in GTK+ 3.x
https://bugs.webkit.org/show_bug.cgi?id=48709

Use the new width for height APIs in GTK+ 3.x, since size-request
is deprecated.

For now we just return the same value for preferred and minimum
width/height, which should match the 2.x behavior. Probably we
could do something smarter for the minimum values.

  • webkit/webkitwebview.cpp: (webkit_web_view_get_preferred_width): return our preferred width. (webkit_web_view_get_preferred_height): return our preferred height. (webkit_web_view_class_init): hook the new default handlers.
Location:
trunk/WebKit/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/gtk/ChangeLog

    r70976 r70983  
     12010-10-30  Xan Lopez  <xlopez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] Use new width for height APIs in GTK+ 3.x
     6        https://bugs.webkit.org/show_bug.cgi?id=48709
     7
     8        Use the new width for height APIs in GTK+ 3.x, since size-request
     9        is deprecated.
     10
     11        For now we just return the same value for preferred and minimum
     12        width/height, which should match the 2.x behavior. Probably we
     13        could do something smarter for the minimum values.
     14
     15        * webkit/webkitwebview.cpp:
     16        (webkit_web_view_get_preferred_width): return our preferred width.
     17        (webkit_web_view_get_preferred_height): return our preferred height.
     18        (webkit_web_view_class_init): hook the new default handlers.
     19
    1202010-10-29  Daniel Bates  <dbates@rim.com>
    221
  • trunk/WebKit/gtk/webkit/webkitwebview.cpp

    r70931 r70983  
    869869}
    870870
     871#ifdef GTK_API_VERSION_2
    871872static void webkit_web_view_size_request(GtkWidget* widget, GtkRequisition* requisition)
    872873{
     
    883884    requisition->height = view->contentsHeight();
    884885}
     886#else
     887static void webkit_web_view_get_preferred_width(GtkWidget* widget, gint* minimum, gint* natural)
     888{
     889    WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget);
     890    Frame* coreFrame = core(webkit_web_view_get_main_frame(web_view));
     891    if (!coreFrame)
     892        return;
     893
     894    FrameView* view = coreFrame->view();
     895    if (!view)
     896        return;
     897
     898    *minimum = *natural = view->contentsWidth();
     899}
     900
     901static void webkit_web_view_get_preferred_height(GtkWidget* widget, gint* minimum, gint* natural)
     902{
     903    WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget);
     904    Frame* coreFrame = core(webkit_web_view_get_main_frame(web_view));
     905    if (!coreFrame)
     906        return;
     907
     908    FrameView* view = coreFrame->view();
     909    if (!view)
     910        return;
     911
     912    *minimum = *natural = view->contentsHeight();
     913}
     914#endif
    885915
    886916static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
     
    26032633    widgetClass->scroll_event = webkit_web_view_scroll_event;
    26042634    widgetClass->size_allocate = webkit_web_view_size_allocate;
     2635#ifdef GTK_API_VERSION_2
    26052636    widgetClass->size_request = webkit_web_view_size_request;
     2637#else
     2638    widgetClass->get_preferred_width = webkit_web_view_get_preferred_width;
     2639    widgetClass->get_preferred_height = webkit_web_view_get_preferred_height;
     2640#endif
    26062641    widgetClass->popup_menu = webkit_web_view_popup_menu_handler;
    26072642    widgetClass->grab_focus = webkit_web_view_grab_focus;
Note: See TracChangeset for help on using the changeset viewer.