понедельник, 11 мая 2009 г.

Scrolling in GTK+ and WebKit/GTK+

Original: Scrolling in GTK+ and WebKit/GTK+


  • Model/View GtkAdjustment and GtkScrollbar


    The GtkAdjustment is probably best described as a model for scrolling. It has several properties, e.g. the current position (value), the lower and upper possibilities, and the size increments. The GtkScrollbar is operating on top of a GtkAdjustment. It is responsible for taking user events and painting. When scrolling it will look at the lower and upper properties, it will update the value in case of something is happening.


  • WebCore::Scrollbar in WebCore


    The Scrollbar is created by the Scrollbar::createNativeScrollbar "factory". For ml#gtk-widget-set-scroll-adjustments">gtk_widget_set_scroll_adjustments. In case of WebKitWebView in WebKit/GTK+ we do want to support scrolling so we need to return TRUE... but how. If you take a look at the class structure of GtkWidget there is a GObject signal identifier you will have to set with the signal you have created. This is done in the WebKitWebView class init and we will remember and use the GtkAdjustment, e.g. set by a GtkScrolledWindow, in the WebCore::ScrollView (base of WebCore::FrameView class). The usage of GtkAdjustment allows to have different means of scrolling, e.g. by fingers on a touchscreen, or by a wheel... the representation of the scroll concept will change, the implementation not...


  • The problem of mainFrame and subframes


    So far we will most of the times only have external GtkAdjustment set on the mainFrame that is embedded in something like a GtkScrolledWindow but there are pages that will create a frameset and y to a GtkScrolledWindow or a Moko

Комментариев нет: