comparison finch/libgnt/gntwm.c @ 18367:1648cd94dddf

Add a callback that gets triggered by SIGWINCH.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 30 Jun 2007 01:45:21 +0000
parents d359e5f3ee87
children 93c5c785a811
comparison
equal deleted inserted replaced
18366:1aa08373442f 18367:1648cd94dddf
59 SIG_MOVED, 59 SIG_MOVED,
60 SIG_UPDATE_WIN, 60 SIG_UPDATE_WIN,
61 SIG_GIVE_FOCUS, 61 SIG_GIVE_FOCUS,
62 SIG_KEY_PRESS, 62 SIG_KEY_PRESS,
63 SIG_MOUSE_CLICK, 63 SIG_MOUSE_CLICK,
64 SIG_TERMINAL_REFRESH,
64 SIGS 65 SIGS
65 }; 66 };
66 67
67 static guint signals[SIGS] = { 0 }; 68 static guint signals[SIGS] = { 0 };
68 static void gnt_wm_new_window_real(GntWM *wm, GntWidget *widget); 69 static void gnt_wm_new_window_real(GntWM *wm, GntWidget *widget);
1029 GntWM *wm = GNT_WM(bindable); 1030 GntWM *wm = GNT_WM(bindable);
1030 1031
1031 endwin(); 1032 endwin();
1032 1033
1033 g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, NULL); 1034 g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, NULL);
1035 refresh();
1036 g_signal_emit(wm, signals[SIG_TERMINAL_REFRESH], 0);
1034 update_screen(wm); 1037 update_screen(wm);
1035 gnt_ws_draw_taskbar(wm->cws, TRUE); 1038 gnt_ws_draw_taskbar(wm->cws, TRUE);
1036 curs_set(0); /* endwin resets the cursor to normal */ 1039 curs_set(0); /* endwin resets the cursor to normal */
1037 1040
1038 return FALSE; 1041 return FALSE;
1235 G_SIGNAL_RUN_LAST, 1238 G_SIGNAL_RUN_LAST,
1236 G_STRUCT_OFFSET(GntWMClass, mouse_clicked), 1239 G_STRUCT_OFFSET(GntWMClass, mouse_clicked),
1237 gnt_boolean_handled_accumulator, NULL, 1240 gnt_boolean_handled_accumulator, NULL,
1238 gnt_closure_marshal_BOOLEAN__INT_INT_INT_POINTER, 1241 gnt_closure_marshal_BOOLEAN__INT_INT_INT_POINTER,
1239 G_TYPE_BOOLEAN, 4, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER); 1242 G_TYPE_BOOLEAN, 4, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_POINTER);
1243
1244 signals[SIG_TERMINAL_REFRESH] =
1245 g_signal_new("terminal-refresh",
1246 G_TYPE_FROM_CLASS(klass),
1247 G_SIGNAL_RUN_LAST,
1248 G_STRUCT_OFFSET(GntWMClass, terminal_refresh),
1249 NULL, NULL,
1250 g_cclosure_marshal_VOID__VOID,
1251 G_TYPE_NONE, 0);
1240 1252
1241 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-next", window_next, 1253 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-next", window_next,
1242 "\033" "n", NULL); 1254 "\033" "n", NULL);
1243 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-prev", window_prev, 1255 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-prev", window_prev,
1244 "\033" "p", NULL); 1256 "\033" "p", NULL);