Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use new LUAKIT_WIDGET_SIGNAL_COMMON macro for focus/parent-set sigs

  • Loading branch information...
commit f1cf94965a245d4466dd99ef97f44cc1333ae53b 1 parent 8ab28ee
Mason Larobina authored March 05, 2012
5  widgets/common.h
@@ -59,6 +59,11 @@
59 59
     case L_TK_CHILDREN:                               \
60 60
       return luaH_widget_get_children(L, widget);
61 61
 
  62
+#define LUAKIT_WIDGET_SIGNAL_COMMON(w)                       \
  63
+    "signal::focus-in-event",  G_CALLBACK(focus_cb),      w, \
  64
+    "signal::focus-out-event", G_CALLBACK(focus_cb),      w, \
  65
+    "signal::parent-set",      G_CALLBACK(parent_set_cb), w,
  66
+
62 67
 gboolean button_cb(GtkWidget*, GdkEventButton*, widget_t*);
63 68
 gboolean focus_cb(GtkWidget*, GdkEventFocus*, widget_t*);
64 69
 gboolean key_press_cb(GtkWidget*, GdkEventKey*, widget_t*);
4  widgets/entry.c
@@ -175,11 +175,9 @@ widget_entry(widget_t *w, luakit_token_t UNUSED(token))
175 175
     gtk_entry_set_inner_border(GTK_ENTRY(w->widget), NULL);
176 176
 
177 177
     g_object_connect(G_OBJECT(w->widget),
  178
+      LUAKIT_WIDGET_SIGNAL_COMMON(w)
178 179
       "signal::activate",                          G_CALLBACK(activate_cb),   w,
179  
-      "signal::focus-in-event",                    G_CALLBACK(focus_cb),      w,
180  
-      "signal::focus-out-event",                   G_CALLBACK(focus_cb),      w,
181 180
       "signal::key-press-event",                   G_CALLBACK(key_press_cb),  w,
182  
-      "signal::parent-set",                        G_CALLBACK(parent_set_cb), w,
183 181
       "signal::notify::cursor-position",           G_CALLBACK(position_cb),   w,
184 182
       // The following signals replace the old "signal::changed", since that
185 183
       // does not allow for the selection to be changed in it's callback.
4  widgets/label.c
@@ -205,10 +205,8 @@ widget_label(widget_t *w, luakit_token_t UNUSED(token))
205 205
     gtk_misc_set_padding(GTK_MISC(w->widget), 2, 2);
206 206
 
207 207
     g_object_connect(G_OBJECT(w->widget),
208  
-      "signal::focus-in-event",    G_CALLBACK(focus_cb),      w,
209  
-      "signal::focus-out-event",   G_CALLBACK(focus_cb),      w,
  208
+      LUAKIT_WIDGET_SIGNAL_COMMON(w)
210 209
       "signal::key-press-event",   G_CALLBACK(key_press_cb),  w,
211  
-      "signal::parent-set",        G_CALLBACK(parent_set_cb), w,
212 210
       NULL);
213 211
 
214 212
     gtk_widget_show(w->widget);
4  widgets/notebook.c
@@ -284,13 +284,11 @@ widget_notebook(widget_t *w, luakit_token_t UNUSED(token))
284 284
     gtk_notebook_set_scrollable(GTK_NOTEBOOK(w->widget), TRUE);
285 285
 
286 286
     g_object_connect(G_OBJECT(w->widget),
287  
-      "signal::focus-in-event",    G_CALLBACK(focus_cb),        w,
288  
-      "signal::focus-out-event",   G_CALLBACK(focus_cb),        w,
  287
+      LUAKIT_WIDGET_SIGNAL_COMMON(w)
289 288
       "signal::key-press-event",   G_CALLBACK(key_press_cb),    w,
290 289
       "signal::page-added",        G_CALLBACK(page_added_cb),   w,
291 290
       "signal::page-removed",      G_CALLBACK(page_removed_cb), w,
292 291
       "signal::page-reordered",    G_CALLBACK(reorder_cb),      w,
293  
-      "signal::parent-set",        G_CALLBACK(parent_set_cb),   w,
294 292
       "signal::switch-page",       G_CALLBACK(switch_cb),       w,
295 293
       NULL);
296 294
 
1  widgets/socket.c
@@ -89,6 +89,7 @@ widget_socket(widget_t *w, luakit_token_t UNUSED(token))
89 89
     g_object_set_data(G_OBJECT(w->widget), "lua_widget", (gpointer) w);
90 90
     gtk_widget_show(w->widget);
91 91
     g_object_connect(G_OBJECT(w->widget),
  92
+      LUAKIT_WIDGET_SIGNAL_COMMON(w)
92 93
       "signal::plug-added",   G_CALLBACK(plug_added_cb),   w,
93 94
       "signal::plug-removed", G_CALLBACK(plug_removed_cb), w,
94 95
       NULL);
4  widgets/webview.c
@@ -830,14 +830,13 @@ widget_webview(widget_t *w, luakit_token_t UNUSED(token))
830 830
 
831 831
     /* connect webview signals */
832 832
     g_object_connect(G_OBJECT(d->view),
  833
+      LUAKIT_WIDGET_SIGNAL_COMMON(w)
833 834
       "signal::button-press-event",                   G_CALLBACK(webview_button_cb),            w,
834 835
       "signal::button-release-event",                 G_CALLBACK(webview_button_cb),            w,
835 836
       "signal::create-web-view",                      G_CALLBACK(create_web_view_cb),           w,
836 837
       "signal::document-load-finished",               G_CALLBACK(document_load_finished_cb),    w,
837 838
       "signal::download-requested",                   G_CALLBACK(download_request_cb),          w,
838 839
       "signal::expose-event",                         G_CALLBACK(expose_cb),                    w,
839  
-      "signal::focus-in-event",                       G_CALLBACK(focus_cb),                     w,
840  
-      "signal::focus-out-event",                      G_CALLBACK(focus_cb),                     w,
841 840
       "signal::hovering-over-link",                   G_CALLBACK(link_hover_cb),                w,
842 841
       "signal::key-press-event",                      G_CALLBACK(key_press_cb),                 w,
843 842
       "signal::mime-type-policy-decision-requested",  G_CALLBACK(mime_type_decision_cb),        w,
@@ -845,7 +844,6 @@ widget_webview(widget_t *w, luakit_token_t UNUSED(token))
845 844
       "signal::new-window-policy-decision-requested", G_CALLBACK(new_window_decision_cb),       w,
846 845
       "signal::notify",                               G_CALLBACK(notify_cb),                    w,
847 846
       "signal::notify::load-status",                  G_CALLBACK(notify_load_status_cb),        w,
848  
-      "signal::parent-set",                           G_CALLBACK(parent_set_cb),                w,
849 847
       "signal::populate-popup",                       G_CALLBACK(populate_popup_cb),            w,
850 848
       "signal::resource-request-starting",            G_CALLBACK(resource_request_starting_cb), w,
851 849
       "signal::scroll-event",                         G_CALLBACK(scroll_event_cb),              w,
3  widgets/window.c
@@ -203,10 +203,9 @@ widget_window(widget_t *w, luakit_token_t UNUSED(token))
203 203
     gtk_window_set_geometry_hints(d->win, NULL, &hints, GDK_HINT_MIN_SIZE);
204 204
 
205 205
     g_object_connect(G_OBJECT(w->widget),
  206
+      LUAKIT_WIDGET_SIGNAL_COMMON(w)
206 207
       "signal::add",                G_CALLBACK(add_cb),          w,
207 208
       "signal::destroy",            G_CALLBACK(destroy_cb),      w,
208  
-      "signal::focus-in-event",     G_CALLBACK(focus_cb),        w,
209  
-      "signal::focus-out-event",    G_CALLBACK(focus_cb),        w,
210 209
       "signal::key-press-event",    G_CALLBACK(key_press_cb),    w,
211 210
       "signal::remove",             G_CALLBACK(remove_cb),       w,
212 211
       "signal::window-state-event", G_CALLBACK(window_state_cb), w,

0 notes on commit f1cf949

Please sign in to comment.
Something went wrong with that request. Please try again.