Changeset 29341 in webkit
- Timestamp:
- Jan 9, 2008 12:26:47 PM (16 years ago)
- Location:
- trunk/WebKit/gtk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r29147 r29341 1 2008-01-09 Luca Bruno <lethalman88@gmail.com> 2 3 Reviewed by Alp Toker. 4 5 http://bugs.webkit.org/show_bug.cgi?id=16802 6 [GTK] Missing gtk properties 7 8 Add missing properties to WebKitViewFrame and WebKitWebView. 9 10 * WebView/webkitprivate.h: add some useful defines for param specs 11 * WebView/webkitwebframe.cpp: 12 (webkit_web_frame_get_property): added 13 (webkit_web_frame_class_init): add name, title and uri read-only properties 14 * WebView/webkitwebview.cpp: 15 (webkit_web_view_get_property): add editable property read 16 (webkit_web_view_set_property): added for editable property write 17 (webkit_web_view_class_init): add read-write editable property 18 1 19 2008-01-03 Xan Lopez <xan@gnome.org> 2 20 -
trunk/WebKit/gtk/WebView/webkitprivate.h
r29080 r29341 51 51 extern "C" { 52 52 void webkit_init(); 53 54 #define WEBKIT_PARAM_READABLE ((GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)) 55 #define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)) 53 56 54 57 #define WEBKIT_WEB_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebViewPrivate)) -
trunk/WebKit/gtk/WebView/webkitwebframe.cpp
r28818 r29341 55 55 }; 56 56 57 enum { 58 PROP_0, 59 60 PROP_NAME, 61 PROP_TITLE, 62 PROP_URI 63 }; 64 57 65 static guint webkit_web_frame_signals[LAST_SIGNAL] = { 0, }; 58 66 59 67 G_DEFINE_TYPE(WebKitWebFrame, webkit_web_frame, G_TYPE_OBJECT) 68 69 static void webkit_web_frame_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) 70 { 71 WebKitWebFrame* frame = WEBKIT_WEB_FRAME(object); 72 73 switch(prop_id) { 74 case PROP_NAME: 75 g_value_set_string(value, webkit_web_frame_get_name(frame)); 76 break; 77 case PROP_TITLE: 78 g_value_set_string(value, webkit_web_frame_get_title(frame)); 79 break; 80 case PROP_URI: 81 g_value_set_string(value, webkit_web_frame_get_uri(frame)); 82 break; 83 default: 84 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); 85 break; 86 } 87 } 60 88 61 89 static void webkit_web_frame_finalize(GObject* object) … … 111 139 G_TYPE_FROM_CLASS(frameClass), 112 140 (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 113 0, 141 0, 114 142 NULL, 115 143 NULL, … … 131 159 * implementations of virtual methods 132 160 */ 133 G_OBJECT_CLASS(frameClass)->finalize = webkit_web_frame_finalize; 161 GObjectClass* objectClass = G_OBJECT_CLASS(frameClass); 162 objectClass->finalize = webkit_web_frame_finalize; 163 objectClass->get_property = webkit_web_frame_get_property; 164 165 /* 166 * properties 167 */ 168 g_object_class_install_property(objectClass, PROP_NAME, 169 g_param_spec_string("name", 170 "Name", 171 "The name of the frame", 172 NULL, 173 WEBKIT_PARAM_READABLE)); 174 175 g_object_class_install_property(objectClass, PROP_TITLE, 176 g_param_spec_string("title", 177 "Title", 178 "The document title of the frame", 179 NULL, 180 WEBKIT_PARAM_READABLE)); 181 182 g_object_class_install_property(objectClass, PROP_URI, 183 g_param_spec_string("uri", 184 "URI", 185 "The current URI of the contents displayed by the frame", 186 NULL, 187 WEBKIT_PARAM_READABLE)); 134 188 } 135 189 … … 191 245 } 192 246 247 /** 248 * webkit_web_frame_get_title: 249 * @frame: a #WebKitWebFrame 250 * 251 * Returns the @frame's document title 252 * 253 * Return value: the title of @frame 254 */ 193 255 const gchar* webkit_web_frame_get_title(WebKitWebFrame* frame) 194 256 { … … 199 261 } 200 262 263 /** 264 * webkit_web_frame_get_uri: 265 * @frame: a #WebKitWebFrame 266 * 267 * Returns the current URI of the contents displayed by the @frame 268 * 269 * Return value: the URI of @frame 270 */ 201 271 const gchar* webkit_web_frame_get_uri(WebKitWebFrame* frame) 202 272 { -
trunk/WebKit/gtk/WebView/webkitwebview.cpp
r29147 r29341 85 85 86 86 PROP_COPY_TARGET_LIST, 87 PROP_PASTE_TARGET_LIST 87 PROP_PASTE_TARGET_LIST, 88 PROP_EDITABLE 88 89 }; 89 90 … … 178 179 } 179 180 180 static void webkit_web_view_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { 181 static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) 182 { 181 183 WebKitWebView* webView = WEBKIT_WEB_VIEW(object); 182 184 … … 188 190 g_value_set_boxed(value, webkit_web_view_get_paste_target_list(webView)); 189 191 break; 192 case PROP_EDITABLE: 193 g_value_set_boolean(value, webkit_web_view_get_editable(webView)); 194 break; 190 195 default: 196 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); 197 break; 198 } 199 } 200 201 static void webkit_web_view_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec *pspec) 202 { 203 WebKitWebView* webView = WEBKIT_WEB_VIEW(object); 204 205 switch(prop_id) { 206 case PROP_EDITABLE: 207 webkit_web_view_set_editable(webView, g_value_get_boolean(value)); 208 break; 209 default: 210 g_assert_not_reached(); 191 211 break; 192 212 } … … 894 914 webViewClass->paste_clipboard = webkit_web_view_real_paste_clipboard; 895 915 896 G_OBJECT_CLASS(webViewClass)->finalize = webkit_web_view_finalize;897 898 916 GObjectClass* objectClass = G_OBJECT_CLASS(webViewClass); 917 objectClass->finalize = webkit_web_view_finalize; 899 918 objectClass->get_property = webkit_web_view_get_property; 919 objectClass->set_property = webkit_web_view_set_property; 900 920 901 921 GtkWidgetClass* widgetClass = GTK_WIDGET_CLASS(webViewClass); … … 954 974 "paste_clipboard", 0); 955 975 956 /* Properties */ 957 GParamFlags flags = (GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB); 976 /* 977 * properties 978 */ 958 979 g_object_class_install_property(objectClass, PROP_COPY_TARGET_LIST, 959 980 g_param_spec_boxed("copy-target-list", … … 961 982 "The list of targets this Web view supports for copying to the clipboard", 962 983 GTK_TYPE_TARGET_LIST, 963 flags));984 WEBKIT_PARAM_READABLE)); 964 985 965 986 g_object_class_install_property(objectClass, PROP_PASTE_TARGET_LIST, … … 968 989 "The list of targets this Web view supports for pasting to the clipboard", 969 990 GTK_TYPE_TARGET_LIST, 970 flags)); 991 WEBKIT_PARAM_READABLE)); 992 993 g_object_class_install_property(objectClass, PROP_EDITABLE, 994 g_param_spec_boolean("editable", 995 "Editable", 996 "Whether content can be modified by the user", 997 FALSE, 998 WEBKIT_PARAM_READWRITE)); 971 999 } 972 1000
Note: See TracChangeset
for help on using the changeset viewer.