From: <enl...@li...> - 2001-10-19 20:39:47
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Removed Files: Makefile.am menus.c menus.h viewer.c viewer.h Log Message: removing old stuff, hope my first commit goes ok |
From: <enl...@li...> - 2001-10-19 20:41:42
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings Removed Files: AUTHORS Makefile.am acconfig.h autogen.sh configure.in Log Message: removing old stuff |
From: <enl...@li...> - 2001-10-19 20:53:03
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings Added Files: AUTHORS Changelog Makefile.am README TODO acinclude.m4 autogen.sh configure.in Log Message: adding new stuff |
From: <enl...@li...> - 2001-10-19 21:00:38
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Added Files: Makefile.am action_extra.c action_extra.h callbacks.c callbacks.h eaction_item.c eaction_item.h ebindings.h emenu_item.c emenu_item.h focus_interface.c focus_interface.h interface.c interface.h keybind_interface.c keybind_interface.h main.c menu_interface.c menu_interface.h util.c util.h Log Message: more stuff |
From: <enl...@li...> - 2001-10-19 21:50:33
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: menu_interface.c Log Message: silly oversight and the dbs would sometimes get garbage written to them =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/menu_interface.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- menu_interface.c 2001/10/19 21:00:37 1.1 +++ menu_interface.c 2001/10/19 21:50:31 1.2 @@ -567,7 +567,9 @@ GtkCTreeNode *cnode, gpointer data) { emenu_item *e = NULL; - char *fields[4]; + char *fields[4] = { + "", "", "", "" + }; e = emenu_item_new(); gtk_ctree_node_get_text(GTK_CTREE(tree), GTK_CTREE_NODE(cnode), 1, @@ -584,7 +586,7 @@ e->exec = strdup(fields[2]); if(!strcmp(fields[3], "")) { - + /* shouldn't ever happen =) */ } else if(!strcmp(fields[3], "Separator")) { e->type = E_MENU_SEPARATOR; IF_FREE(e->text); @@ -600,6 +602,7 @@ IF_FREE(e->exec); e->exec = strdup(""); /* make sure this won't get written ever */ + /* now we have a nice spacer in the menu */ } else if(e->exec[0] == '\0') { fprintf(stderr, "ERROR: Tried inserting an entry with no " |
From: <enl...@li...> - 2001-10-20 18:06:21
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: action_extra.c callbacks.c eaction_item.c emenu_item.c focus_interface.c interface.c keybind_interface.c main.c menu_interface.c util.c action_extra.h callbacks.h eaction_item.h ebindings.h emenu_item.h focus_interface.h interface.h keybind_interface.h menu_interface.h util.h Log Message: used indent to fix my tabstops =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/action_extra.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- action_extra.c 2001/10/19 21:00:37 1.1 +++ action_extra.c 2001/10/20 18:06:19 1.2 @@ -8,114 +8,119 @@ *************************************************************************/ #include "action_extra.h" +static struct +{ + GtkWidget *pos; /* position option menu */ + GtkWidget *ev; /* event type option menu */ + GtkWidget *ac; /* action type option menu */ + GtkWidget *mod; /* modifier key option menu */ +} +f_menus; +static GtkWidget *button_e; /* entry widget for the button number */ +static GtkWidget *clist; /* columned list of mouse events */ +static int row_count; /* the number of rows in clist */ +static int current_row; /* the currently selected row in the clist */ -static struct { - GtkWidget *pos; /* position option menu */ - GtkWidget *ev; /* event type option menu */ - GtkWidget *ac; /* action type option menu */ - GtkWidget *mod; /* modifier key option menu */ -} f_menus; -static GtkWidget *button_e; /* entry widget for the button number */ -static GtkWidget *clist; /* columned list of mouse events */ -static int row_count; /* the number of rows in clist */ -static int current_row; /* the currently selected row in the clist */ /* global variables to the focus interface */ - -static void focus_clist_select_row(GtkWidget *w, gint row, gint column, - GdkEventButton *ev, gpointer data); +static void focus_clist_select_row(GtkWidget * w, gint row, + gint column, GdkEventButton * ev, + gpointer data); + +static void window_pos_option_menu_modified(GtkWidget *, gpointer); +static void event_option_menu_modified(GtkWidget *, gpointer); +static void action_option_menu_modified(GtkWidget *, gpointer); +static void mod_key_option_menu_modified(GtkWidget *, gpointer); + +static void event_change_button_cb(GtkWidget *, gpointer); +static void event_save_button_cb(GtkWidget *, gpointer); +static void event_add_button_cb(GtkWidget *, gpointer); +static void event_del_button_cb(GtkWidget *, gpointer); -static void window_pos_option_menu_modified(GtkWidget*, gpointer); -static void event_option_menu_modified(GtkWidget*, gpointer); -static void action_option_menu_modified(GtkWidget*, gpointer); -static void mod_key_option_menu_modified(GtkWidget*, gpointer); - -static void event_change_button_cb(GtkWidget*, gpointer); -static void event_save_button_cb(GtkWidget*, gpointer); -static void event_add_button_cb(GtkWidget*, gpointer); -static void event_del_button_cb(GtkWidget*, gpointer); /* callbacks(commented below) */ -/* option menu data */ -static gchar* mod_str[] = { - "NONE", - "SHIFT", - "CTRL", - "SHIFT+CTRL", - "ALT", - "SHIFT+ALT", - "CTRL+ALT", - "CTRL+SHIFT+ALT", - "WIN", - "WIN+SHIFT", - "WIN+CTRL", - "WIN+SHIFT+CTRL", - "WIN+ALT", - "WIN+SHIFT+ALT", - "WIN+CTRL", - "WIN+CTRL+SHIFT", - "WIN+CTRL+SHIFT+ALT" +/* option menu data */ +static gchar *mod_str[] = { + "NONE", + "SHIFT", + "CTRL", + "SHIFT+CTRL", + "ALT", + "SHIFT+ALT", + "CTRL+ALT", + "CTRL+SHIFT+ALT", + "WIN", + "WIN+SHIFT", + "WIN+CTRL", + "WIN+SHIFT+CTRL", + "WIN+ALT", + "WIN+SHIFT+ALT", + "WIN+CTRL", + "WIN+CTRL+SHIFT", + "WIN+CTRL+SHIFT+ALT" }; + /* options based on enum _ev_modifiers in Ecore.h */ -static gchar* e_action_str[] = { - "Window_Move", - "Window_Resize", - "Window_Resize_Horizontal", - "Window_Resize_Vertical", - "Window_Close", - "Window_Kill", - "Window_Shade", - "Window_Raise", - "Window_Lower", - "Window_Raise_Lower", - "Menu", - "Window_Stick", - "Sound", - "Window_Iconify", - "Window_Max_Size", - "Window_Snap", - "Window_Zoom", - "Desktop", - "Window_Next", - /* count is 19 currently */ - /* based on options in e_action_init in actions.c in e17/e/src */ +static gchar *e_action_str[] = { + "Window_Move", + "Window_Resize", + "Window_Resize_Horizontal", + "Window_Resize_Vertical", + "Window_Close", + "Window_Kill", + "Window_Shade", + "Window_Raise", + "Window_Lower", + "Window_Raise_Lower", + "Menu", + "Window_Stick", + "Sound", + "Window_Iconify", + "Window_Max_Size", + "Window_Snap", + "Window_Zoom", + "Desktop", + "Window_Next", + /* count is 19 currently */ + /* based on options in e_action_init in actions.c in e17/e/src */ }; -static gchar* ebits_hot_spots[] = { - "Decoration", - "Title_Bar", - "Close", - "Iconify", - "Raise", - "Raise_Lower", - "Max_Size", - "Full_Screen", - "Shade", - "Menu", - "Resize", - "Resize_Vertical", - "Resize_Horizontal", - "Icon", - "State", - "Load", - "Geometry", - "Scrollbar_Trough", - "Scrollbar_Bar", - "Scrollbar_Arrow1", - "Scrollber_Arrow2", - "Window_Grab", - "Window_Place" - /* parts of this came from etcher class types on the properties tag */ +static gchar *ebits_hot_spots[] = { + "Decoration", + "Title_Bar", + "Close", + "Iconify", + "Raise", + "Raise_Lower", + "Max_Size", + "Full_Screen", + "Shade", + "Menu", + "Resize", + "Resize_Vertical", + "Resize_Horizontal", + "Icon", + "State", + "Load", + "Geometry", + "Scrollbar_Trough", + "Scrollbar_Bar", + "Scrollbar_Arrow1", + "Scrollber_Arrow2", + "Window_Grab", + "Window_Place" + /* parts of this came from etcher class types on the properties tag */ }; -static gchar* e_action_type[] = { - "Mouse In On Window Position", - "Mouse Out On Window Position", - "Mouse Button Down On Window Position", - "Mouse Button Double Click On Window Position", - "Mouse Button Triple Click On Window Position", - "Mouse Button Up On Window Position", - "Mouse Click On Window Position", - "Mouse Move On Window Position" +static gchar *e_action_type[] = { + "Mouse In On Window Position", + "Mouse Out On Window Position", + "Mouse Button Down On Window Position", + "Mouse Button Double Click On Window Position", + "Mouse Button Triple Click On Window Position", + "Mouse Button Up On Window Position", + "Mouse Click On Window Position", + "Mouse Move On Window Position" }; + /* see actions.h in the e17 source tree enum _e_action_type */ /* the world can only ask for this to be added to an existing notebook, all @@ -124,301 +129,301 @@ * @param note: widget pointing to the notebook to attach to * @param sheet: what tab to insert as */ -void add_actions_extra_notebook(GtkWidget *w, GtkWidget *note, int sheet) +void +add_actions_extra_notebook(GtkWidget * w, GtkWidget * note, int sheet) { - - GtkWidget *tab_label; - GtkWidget *hpaned; - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *scroller1, *scroller2; - GtkWidget *frame; - GtkWidget *table; - int i; - eaction_item *e; - - GtkWidget *newb, *delb, *saveb, *button_b; - GtkWidget *o_menu, *menu, *option; - GtkWidget *win_pos_l, *event_l, *mod_l, *action_l, *button_l; - GtkWidget *disclaimer; - char buf[64]; - - gchar *fields[] = { - "Window Position", "Event", "Action", "Mouse Button", "Modifier Key" - }; - gchar *key_fields[5]; - - current_row = row_count = 0; - /* setup the static globals =) */ - - tab_label = gtk_label_new("Extras"); - - hpaned = gtk_hpaned_new(); - gtk_notebook_insert_page(GTK_NOTEBOOK(note), hpaned, tab_label, sheet); - - - scroller1 = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller1), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - clist = gtk_clist_new_with_titles(5, fields); - gtk_widget_ref(clist); - gtk_widget_set_name(GTK_WIDGET(clist), "focus_list"); - - /* gtk_clist_set_column_visibility(GTK_CLIST(clist), 0, FALSE); */ - gtk_clist_set_column_visibility(GTK_CLIST(clist), 1, FALSE); - gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 2, TRUE); - gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 3, TRUE); - gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 4, TRUE); - gtk_signal_connect(GTK_OBJECT(clist), "select-row", - GTK_SIGNAL_FUNC(focus_clist_select_row), NULL); - - gtk_container_add(GTK_CONTAINER(scroller1), clist); - gtk_paned_pack1(GTK_PANED(hpaned), scroller1, TRUE, FALSE); - - vbox = gtk_vbox_new(FALSE, 0); - - frame = gtk_frame_new("Edit Focus Settings"); - gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 1); - - /* Start Keybind table */ - table = gtk_table_new(5, 3, FALSE); - - /* Row 1 */ - win_pos_l = gtk_label_new("Window Position:"); - gtk_table_attach(GTK_TABLE(table), win_pos_l, 0, 1, 0, 1, GTK_FILL, 0, - 2, 2); - - o_menu = gtk_option_menu_new(); - gtk_widget_ref(o_menu); - gtk_widget_set_name(o_menu, "win_pos_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 0, 1, GTK_FILL, 0, - 2, 2); - - f_menus.pos = o_menu; - menu = gtk_menu_new(); - - for(i = 0; i < EBITS_SPOT_MAX; i++) - { - option = gtk_menu_item_new_with_label(ebits_hot_spots[i]); - gtk_widget_show(option); - gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(window_pos_option_menu_modified), - (gpointer) i); - gtk_menu_append(GTK_MENU(menu), option); - } - gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); - gtk_widget_show(menu); - gtk_widget_show(o_menu); - - /* Row 2 */ - event_l = gtk_label_new("Event Type: "); - gtk_table_attach(GTK_TABLE(table), event_l, 0, 1, 1, 2, GTK_FILL, 0, 2, 2); - - o_menu = gtk_option_menu_new(); - gtk_widget_ref(o_menu); - gtk_widget_set_name(o_menu, "event_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 1, 2, GTK_FILL, 0, - 2, 2); - - f_menus.ev = o_menu; - menu = gtk_menu_new(); - - for(i = 0; i < E_ACTION_TYPE_MAX; i++) - { - option = gtk_menu_item_new_with_label(e_action_type[i]); - gtk_widget_show(option); - gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(event_option_menu_modified), - (gpointer) i); - gtk_menu_append(GTK_MENU(menu), option); - } - gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); - gtk_widget_show(menu); - gtk_widget_show(o_menu); - - /* Row 3 */ - action_l = gtk_label_new("Action Request: "); - gtk_table_attach(GTK_TABLE(table), action_l, 0, 1, 2, 3, GTK_FILL, 0, 2, 2); - - o_menu = gtk_option_menu_new(); - gtk_widget_ref(o_menu); - gtk_widget_set_name(o_menu, "mod_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 2, 3, GTK_FILL, 0, 2, - 2); - - f_menus.ac = o_menu; - - menu = gtk_menu_new(); - - for(i = 0; i < FOCUS_ACTION_STR_MAX; i++) - { - option = gtk_menu_item_new_with_label(e_action_str[i]); - gtk_widget_show(option); - gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(action_option_menu_modified), - (gpointer) i); - gtk_menu_append(GTK_MENU(menu), option); - } - gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); - gtk_widget_show(menu); - gtk_widget_show(o_menu); - - - /* Row 4 */ - button_l = gtk_label_new("Button Pressed: "); - gtk_table_attach(GTK_TABLE(table), button_l, 0, 1, 3, 4, GTK_FILL, 0, 2, 2); - - button_e = gtk_entry_new(); - gtk_entry_set_editable(GTK_ENTRY(button_e), FALSE); - gtk_table_attach(GTK_TABLE(table), button_e, 1, 2, 3, 4, GTK_FILL, 0, 2, 2); - - button_b = gtk_button_new_with_label("Change"); - gtk_table_attach(GTK_TABLE(table), button_b, 2, 3, 3, 4, GTK_FILL, 0, 2, 2); - gtk_signal_connect(GTK_OBJECT(button_b), "clicked", - GTK_SIGNAL_FUNC(event_change_button_cb), clist); - - /* Row 5 */ - mod_l = gtk_label_new("Modifier Key: "); - gtk_table_attach(GTK_TABLE(table), mod_l, 0, 1, 4, 5, GTK_FILL, 0, 2, 2); - - o_menu = gtk_option_menu_new(); - gtk_widget_ref(o_menu); - gtk_widget_set_name(o_menu, "mod_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 4, 5, GTK_FILL, 0, - 2, 2); - - f_menus.mod = o_menu; - - menu = gtk_menu_new(); - - for(i = 0; i < MOD_STR_MAX; i++) - { - option = gtk_menu_item_new_with_label(mod_str[i]); - gtk_widget_show(option); - gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(mod_key_option_menu_modified), - (gpointer) i); - gtk_menu_append(GTK_MENU(menu), option); - } - gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); - gtk_widget_show(menu); - gtk_widget_show(o_menu); - /* Row 6 */ - - scroller2 = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller2), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - disclaimer = gtk_text_new(NULL, NULL); - gtk_text_set_editable(GTK_TEXT(disclaimer), FALSE); - gtk_text_insert(GTK_TEXT(disclaimer), NULL, NULL, NULL, - "This is only a test, you can change values here, but \n" - "this is not a good interface for handling this kind of\n" - "configuration. It does allow you to modify how the mouse\n" - "interacts with windows, but some ebits knowledge is needed \n" - "to change certain features.", 254); - - gtk_container_add(GTK_CONTAINER(scroller2), disclaimer); - gtk_table_attach(GTK_TABLE(table), scroller2, 0, 3, 5, 6, GTK_FILL | - GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); - /* end Rows */ - - /* add table to the frame */ - gtk_container_add(GTK_CONTAINER(frame), table); - - /* vbox for save button across the botom */ - hbox = gtk_hbox_new(FALSE, 0); - - newb = gtk_button_new_with_label("New Entry"); - gtk_widget_ref(newb); - gtk_widget_set_name(newb, "new_focus_button"); - gtk_signal_connect(GTK_OBJECT(newb), "clicked", - GTK_SIGNAL_FUNC(event_add_button_cb), clist); - - gtk_box_pack_start(GTK_BOX(hbox), newb, TRUE, TRUE, 2); - - delb = gtk_button_new_with_label("Delete Selected"); - gtk_widget_ref(delb); - gtk_widget_set_name(delb, "del_focus_button"); - gtk_signal_connect(GTK_OBJECT(delb), "clicked", - GTK_SIGNAL_FUNC(event_del_button_cb), clist); - gtk_box_pack_start(GTK_BOX(hbox), delb, TRUE, TRUE, 2); - - saveb = gtk_button_new_with_label("Save"); - gtk_widget_ref(saveb); - gtk_widget_set_name(saveb, "save_focus_button"); - gtk_signal_connect(GTK_OBJECT(saveb), "clicked", - GTK_SIGNAL_FUNC(event_save_button_cb), clist); - gtk_box_pack_start(GTK_BOX(hbox), saveb, TRUE, TRUE, 2); - - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - /* vbox is setup and added to the hbox, which is going to the right - * pane - */ - - gtk_paned_pack2(GTK_PANED(hpaned), vbox, FALSE, FALSE); - - /* lower right hbox */ - gtk_widget_show(newb); - gtk_widget_show(delb); - gtk_widget_show(saveb); - gtk_widget_show(hbox); - - /* upper right frame and table */ - gtk_widget_show(disclaimer); - gtk_widget_show(scroller2); - gtk_widget_show(button_b); - gtk_widget_show(button_l); - gtk_widget_show(button_e); - gtk_widget_show(action_l); - gtk_widget_show(event_l); - gtk_widget_show(mod_l); - gtk_widget_show(win_pos_l); - gtk_widget_show(table); - gtk_widget_show(frame); - - /* show right pane(consists of vbox */ - gtk_widget_show(vbox); - - /* show left side scroller and clist */ - gtk_widget_show(scroller1); - gtk_widget_show(clist); - - /* show hpaned for the notebook */ - gtk_widget_show(hpaned); - /* show notebook label */ - gtk_widget_show(tab_label); - - ewd_list_goto_first(action_container.focus); - while((e = (eaction_item*)ewd_list_next(action_container.focus))) { - snprintf(buf, 64, "Button %d", e->button); - key_fields[0] = g_strdup(e->name); - key_fields[1] = g_strdup(e_action_type[e->event]); - key_fields[2] = g_strdup(e->action); - key_fields[3] = g_strdup(buf); - key_fields[4] = g_strdup(mod_str[e->modifiers]); - - - - gtk_clist_append(GTK_CLIST(clist), key_fields); - row_count++; - - IF_FREE(key_fields[0]); - IF_FREE(key_fields[1]); - IF_FREE(key_fields[2]); - IF_FREE(key_fields[3]); - IF_FREE(key_fields[4]); - } - if(row_count) - gtk_clist_select_row(GTK_CLIST(clist), 0, 0); - - return; - UN(w); + + GtkWidget *tab_label; + GtkWidget *hpaned; + GtkWidget *hbox; + GtkWidget *vbox; + GtkWidget *scroller1, *scroller2; + GtkWidget *frame; + GtkWidget *table; + int i; + eaction_item *e; + + GtkWidget *newb, *delb, *saveb, *button_b; + GtkWidget *o_menu, *menu, *option; + GtkWidget *win_pos_l, *event_l, *mod_l, *action_l, *button_l; + GtkWidget *disclaimer; + char buf[64]; + + gchar *fields[] = { + "Window Position", "Event", "Action", "Mouse Button", "Modifier Key" + }; + gchar *key_fields[5]; + + current_row = row_count = 0; + /* setup the static globals =) */ + + tab_label = gtk_label_new("Extras"); + + hpaned = gtk_hpaned_new(); + gtk_notebook_insert_page(GTK_NOTEBOOK(note), hpaned, tab_label, sheet); + + scroller1 = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller1), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + clist = gtk_clist_new_with_titles(5, fields); + gtk_widget_ref(clist); + gtk_widget_set_name(GTK_WIDGET(clist), "focus_list"); + + /* gtk_clist_set_column_visibility(GTK_CLIST(clist), 0, FALSE); */ + gtk_clist_set_column_visibility(GTK_CLIST(clist), 1, FALSE); + gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 2, TRUE); + gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 3, TRUE); + gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 4, TRUE); + gtk_signal_connect(GTK_OBJECT(clist), "select-row", + GTK_SIGNAL_FUNC(focus_clist_select_row), NULL); + + gtk_container_add(GTK_CONTAINER(scroller1), clist); + gtk_paned_pack1(GTK_PANED(hpaned), scroller1, TRUE, FALSE); + + vbox = gtk_vbox_new(FALSE, 0); + + frame = gtk_frame_new("Edit Focus Settings"); + gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 1); + + /* Start Keybind table */ + table = gtk_table_new(5, 3, FALSE); + + /* Row 1 */ + win_pos_l = gtk_label_new("Window Position:"); + gtk_table_attach(GTK_TABLE(table), win_pos_l, 0, 1, 0, 1, GTK_FILL, 0, 2, + 2); + + o_menu = gtk_option_menu_new(); + gtk_widget_ref(o_menu); + gtk_widget_set_name(o_menu, "win_pos_menu"); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 0, 1, GTK_FILL, 0, 2, + 2); + + f_menus.pos = o_menu; + menu = gtk_menu_new(); + + for(i = 0; i < EBITS_SPOT_MAX; i++) { + option = gtk_menu_item_new_with_label(ebits_hot_spots[i]); + gtk_widget_show(option); + gtk_signal_connect(GTK_OBJECT(option), "activate", + GTK_SIGNAL_FUNC(window_pos_option_menu_modified), + (gpointer) i); + gtk_menu_append(GTK_MENU(menu), option); + } + gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); + gtk_widget_show(menu); + gtk_widget_show(o_menu); + + /* Row 2 */ + event_l = gtk_label_new("Event Type: "); + gtk_table_attach(GTK_TABLE(table), event_l, 0, 1, 1, 2, GTK_FILL, 0, 2, + 2); + + o_menu = gtk_option_menu_new(); + gtk_widget_ref(o_menu); + gtk_widget_set_name(o_menu, "event_menu"); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 1, 2, GTK_FILL, 0, 2, + 2); + + f_menus.ev = o_menu; + menu = gtk_menu_new(); + + for(i = 0; i < E_ACTION_TYPE_MAX; i++) { + option = gtk_menu_item_new_with_label(e_action_type[i]); + gtk_widget_show(option); + gtk_signal_connect(GTK_OBJECT(option), "activate", + GTK_SIGNAL_FUNC(event_option_menu_modified), + (gpointer) i); + gtk_menu_append(GTK_MENU(menu), option); + } + gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); + gtk_widget_show(menu); + gtk_widget_show(o_menu); + + /* Row 3 */ + action_l = gtk_label_new("Action Request: "); + gtk_table_attach(GTK_TABLE(table), action_l, 0, 1, 2, 3, GTK_FILL, 0, 2, + 2); + + o_menu = gtk_option_menu_new(); + gtk_widget_ref(o_menu); + gtk_widget_set_name(o_menu, "mod_menu"); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 2, 3, GTK_FILL, 0, 2, + 2); + + f_menus.ac = o_menu; + + menu = gtk_menu_new(); + + for(i = 0; i < FOCUS_ACTION_STR_MAX; i++) { + option = gtk_menu_item_new_with_label(e_action_str[i]); + gtk_widget_show(option); + gtk_signal_connect(GTK_OBJECT(option), "activate", + GTK_SIGNAL_FUNC(action_option_menu_modified), + (gpointer) i); + gtk_menu_append(GTK_MENU(menu), option); + } + gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); + gtk_widget_show(menu); + gtk_widget_show(o_menu); + + /* Row 4 */ + button_l = gtk_label_new("Button Pressed: "); + gtk_table_attach(GTK_TABLE(table), button_l, 0, 1, 3, 4, GTK_FILL, 0, 2, + 2); + + button_e = gtk_entry_new(); + gtk_entry_set_editable(GTK_ENTRY(button_e), FALSE); + gtk_table_attach(GTK_TABLE(table), button_e, 1, 2, 3, 4, GTK_FILL, 0, 2, + 2); + + button_b = gtk_button_new_with_label("Change"); + gtk_table_attach(GTK_TABLE(table), button_b, 2, 3, 3, 4, GTK_FILL, 0, 2, + 2); + gtk_signal_connect(GTK_OBJECT(button_b), "clicked", + GTK_SIGNAL_FUNC(event_change_button_cb), clist); + + /* Row 5 */ + mod_l = gtk_label_new("Modifier Key: "); + gtk_table_attach(GTK_TABLE(table), mod_l, 0, 1, 4, 5, GTK_FILL, 0, 2, 2); + + o_menu = gtk_option_menu_new(); + gtk_widget_ref(o_menu); + gtk_widget_set_name(o_menu, "mod_menu"); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 4, 5, GTK_FILL, 0, 2, + 2); + + f_menus.mod = o_menu; + + menu = gtk_menu_new(); + + for(i = 0; i < MOD_STR_MAX; i++) { + option = gtk_menu_item_new_with_label(mod_str[i]); + gtk_widget_show(option); + gtk_signal_connect(GTK_OBJECT(option), "activate", + GTK_SIGNAL_FUNC(mod_key_option_menu_modified), + (gpointer) i); + gtk_menu_append(GTK_MENU(menu), option); + } + gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(o_menu), 0); + gtk_widget_show(menu); + gtk_widget_show(o_menu); + /* Row 6 */ + + scroller2 = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller2), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + + disclaimer = gtk_text_new(NULL, NULL); + gtk_text_set_editable(GTK_TEXT(disclaimer), FALSE); + gtk_text_insert(GTK_TEXT(disclaimer), NULL, NULL, NULL, + "This is only a test, you can change values here, but \n" + "this is not a good interface for handling this kind of\n" + "configuration. It does allow you to modify how the mouse\n" + "interacts with windows, but some ebits knowledge is needed \n" + "to change certain features.", 254); + + gtk_container_add(GTK_CONTAINER(scroller2), disclaimer); + gtk_table_attach(GTK_TABLE(table), scroller2, 0, 3, 5, 6, GTK_FILL | + GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); + /* end Rows */ + + /* add table to the frame */ + gtk_container_add(GTK_CONTAINER(frame), table); + + /* vbox for save button across the botom */ + hbox = gtk_hbox_new(FALSE, 0); + + newb = gtk_button_new_with_label("New Entry"); + gtk_widget_ref(newb); + gtk_widget_set_name(newb, "new_focus_button"); + gtk_signal_connect(GTK_OBJECT(newb), "clicked", + GTK_SIGNAL_FUNC(event_add_button_cb), clist); + + gtk_box_pack_start(GTK_BOX(hbox), newb, TRUE, TRUE, 2); + + delb = gtk_button_new_with_label("Delete Selected"); + gtk_widget_ref(delb); + gtk_widget_set_name(delb, "del_focus_button"); + gtk_signal_connect(GTK_OBJECT(delb), "clicked", + GTK_SIGNAL_FUNC(event_del_button_cb), clist); + gtk_box_pack_start(GTK_BOX(hbox), delb, TRUE, TRUE, 2); + + saveb = gtk_button_new_with_label("Save"); + gtk_widget_ref(saveb); + gtk_widget_set_name(saveb, "save_focus_button"); + gtk_signal_connect(GTK_OBJECT(saveb), "clicked", + GTK_SIGNAL_FUNC(event_save_button_cb), clist); + gtk_box_pack_start(GTK_BOX(hbox), saveb, TRUE, TRUE, 2); + + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); + /* vbox is setup and added to the hbox, which is going to the right + * pane + */ + + gtk_paned_pack2(GTK_PANED(hpaned), vbox, FALSE, FALSE); + + /* lower right hbox */ + gtk_widget_show(newb); + gtk_widget_show(delb); + gtk_widget_show(saveb); + gtk_widget_show(hbox); + + /* upper right frame and table */ + gtk_widget_show(disclaimer); + gtk_widget_show(scroller2); + gtk_widget_show(button_b); + gtk_widget_show(button_l); + gtk_widget_show(button_e); + gtk_widget_show(action_l); + gtk_widget_show(event_l); + gtk_widget_show(mod_l); + gtk_widget_show(win_pos_l); + gtk_widget_show(table); + gtk_widget_show(frame); + + /* show right pane(consists of vbox */ + gtk_widget_show(vbox); + + /* show left side scroller and clist */ + gtk_widget_show(scroller1); + gtk_widget_show(clist); + + /* show hpaned for the notebook */ + gtk_widget_show(hpaned); + /* show notebook label */ + gtk_widget_show(tab_label); + + ewd_list_goto_first(action_container.focus); + while((e = (eaction_item *) ewd_list_next(action_container.focus))) { + snprintf(buf, 64, "Button %d", e->button); + key_fields[0] = g_strdup(e->name); + key_fields[1] = g_strdup(e_action_type[e->event]); + key_fields[2] = g_strdup(e->action); + key_fields[3] = g_strdup(buf); + key_fields[4] = g_strdup(mod_str[e->modifiers]); + + gtk_clist_append(GTK_CLIST(clist), key_fields); + row_count++; + + IF_FREE(key_fields[0]); + IF_FREE(key_fields[1]); + IF_FREE(key_fields[2]); + IF_FREE(key_fields[3]); + IF_FREE(key_fields[4]); + } + if(row_count) + gtk_clist_select_row(GTK_CLIST(clist), 0, 0); + + return; + UN(w); } /* focus_clist_select_row: When the focus clist has a row selected do this @@ -428,65 +433,67 @@ * @param ev: I haven't a clue * @param data: always be NULL */ -static void focus_clist_select_row(GtkWidget *w, gint row, gint column, - GdkEventButton *ev, gpointer data) +static void +focus_clist_select_row(GtkWidget * w, gint row, gint column, + GdkEventButton * ev, gpointer data) { - gchar *fields[5] = { - "", "", "", "", "" - }; - int i; - - if(!w) return; - current_row = row; - - gtk_clist_get_text(GTK_CLIST(w), row, 0, &fields[0]); - gtk_clist_get_text(GTK_CLIST(w), row, 1, &fields[1]); - gtk_clist_get_text(GTK_CLIST(w), row, 2, &fields[2]); - gtk_clist_get_text(GTK_CLIST(w), row, 3, &fields[3]); - gtk_clist_get_text(GTK_CLIST(w), row, 4, &fields[4]); - /* get text from the selected widget */ - - /* then update the option menus and button number accordingly */ - for(i = 0; i < EBITS_SPOT_MAX; i++) { - if(!strcmp(fields[0], ebits_hot_spots[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.pos),i); - break; - } - } - for(i = 0; i < E_ACTION_TYPE_MAX; i++) { - if(!strcmp(fields[1], e_action_type[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ev),i); - break; - } - } - for(i = 0; i < FOCUS_ACTION_STR_MAX; i++) { - if(!strcmp(fields[2], e_action_str[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ac),i); - break; - } - } - for(i = 0; i < MOD_STR_MAX; i++) { - if(!strcmp(fields[4], mod_str[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.mod), i); - break; - } - } - if((fields[3]) && (strlen(fields[3]) > 0)) { - gchar *s; - char buf[64]; - - s = fields[3]; - s += 7; - snprintf(buf, 64, "%s", s); - /* chop the word Button off the beginning */ - gtk_entry_set_text(GTK_ENTRY(button_e), buf); - } - - return; - UN(w); - UN(ev); - UN(data); - UN(column); + gchar *fields[5] = { + "", "", "", "", "" + }; + int i; + + if(!w) + return; + current_row = row; + + gtk_clist_get_text(GTK_CLIST(w), row, 0, &fields[0]); + gtk_clist_get_text(GTK_CLIST(w), row, 1, &fields[1]); + gtk_clist_get_text(GTK_CLIST(w), row, 2, &fields[2]); + gtk_clist_get_text(GTK_CLIST(w), row, 3, &fields[3]); + gtk_clist_get_text(GTK_CLIST(w), row, 4, &fields[4]); + /* get text from the selected widget */ + + /* then update the option menus and button number accordingly */ + for(i = 0; i < EBITS_SPOT_MAX; i++) { + if(!strcmp(fields[0], ebits_hot_spots[i])) { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.pos), i); + break; + } + } + for(i = 0; i < E_ACTION_TYPE_MAX; i++) { + if(!strcmp(fields[1], e_action_type[i])) { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ev), i); + break; + } + } + for(i = 0; i < FOCUS_ACTION_STR_MAX; i++) { + if(!strcmp(fields[2], e_action_str[i])) { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ac), i); + break; + } + } + for(i = 0; i < MOD_STR_MAX; i++) { + if(!strcmp(fields[4], mod_str[i])) { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.mod), i); + break; + } + } + if((fields[3]) && (strlen(fields[3]) > 0)) { + gchar *s; + char buf[64]; + + s = fields[3]; + s += 7; + snprintf(buf, 64, "%s", s); + /* chop the word Button off the beginning */ + gtk_entry_set_text(GTK_ENTRY(button_e), buf); + } + + return; + UN(w); + UN(ev); + UN(data); + UN(column); } /* @@ -496,26 +503,27 @@ * useless, access the pos option menu with the global f_menus->pos * @param data: is the integer value in the option menu of the item selected */ -static void -window_pos_option_menu_modified(GtkWidget *w, gpointer data) +static void +window_pos_option_menu_modified(GtkWidget * w, gpointer data) { - int i; - gchar *new_pos = NULL; + int i; + gchar *new_pos = NULL; - if(!w) return; + if(!w) + return; - i = (int)data; + i = (int)data; - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.pos), i); - /* set the option upto date */ + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.pos), i); + /* set the option upto date */ - new_pos = g_strdup(ebits_hot_spots[i]); - gtk_clist_set_text(GTK_CLIST(clist), current_row, 0, new_pos); - /* update the clist */ + new_pos = g_strdup(ebits_hot_spots[i]); + gtk_clist_set_text(GTK_CLIST(clist), current_row, 0, new_pos); + /* update the clist */ - return; - UN(w); - UN(data); + return; + UN(w); + UN(data); } /* * event_option_menu_modified: when the option menu is modified, update @@ -524,25 +532,26 @@ * useless, access the pos option menu with the global f_menus->pos * @param data: is the integer value in the option menu of the item selected */ -static void -event_option_menu_modified(GtkWidget *w, gpointer data) +static void +event_option_menu_modified(GtkWidget * w, gpointer data) { - int i; - gchar *new_ev = NULL; + int i; + gchar *new_ev = NULL; - if(!w) return; + if(!w) + return; - i = (int)data; - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ev), i); - /* update the history */ - - new_ev= g_strdup(e_action_type[i]); - gtk_clist_set_text(GTK_CLIST(clist), current_row, 1, new_ev); - /* update clist */ - - return; - UN(w); - UN(data); + i = (int)data; + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ev), i); + /* update the history */ + + new_ev = g_strdup(e_action_type[i]); + gtk_clist_set_text(GTK_CLIST(clist), current_row, 1, new_ev); + /* update clist */ + + return; + UN(w); + UN(data); } /* * mod_key_option_menu_modified: when the option menu is modified, update @@ -551,23 +560,25 @@ * useless, access the pos option menu with the global f_menus->pos * @param data: is the integer value in the option menu of the item selected */ -static void -mod_key_option_menu_modified(GtkWidget *w, gpointer data) { - int i; - gchar *new_mod = NULL; - - if(!w) return; - - i = (int)data; - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.mod), i); - /* update history */ - - new_mod= g_strdup(mod_str[i]); - gtk_clist_set_text(GTK_CLIST(clist), current_row, 4, new_mod); - /* update clist */ - return; - UN(w); - UN(data); +static void +mod_key_option_menu_modified(GtkWidget * w, gpointer data) +{ + int i; + gchar *new_mod = NULL; + + if(!w) + return; + + i = (int)data; + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.mod), i); + /* update history */ + + new_mod = g_strdup(mod_str[i]); + gtk_clist_set_text(GTK_CLIST(clist), current_row, 4, new_mod); + /* update clist */ + return; + UN(w); + UN(data); } /* * action_option_menu_modified: when the option menu is modified, update @@ -576,24 +587,26 @@ * useless, access the pos option menu with the global f_menus->pos * @param data: is the integer value in the option menu of the item selected */ -static void -action_option_menu_modified(GtkWidget *w, gpointer data) { - int i; - gchar *new_ac = NULL; - - if(!w) return; - - i = (int)data; - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ac), i); - /* update history */ - - new_ac= g_strdup(e_action_str[i]); - gtk_clist_set_text(GTK_CLIST(clist), current_row, 2, new_ac); - /* update clist */ - - return; - UN(w); - UN(data); +static void +action_option_menu_modified(GtkWidget * w, gpointer data) +{ + int i; + gchar *new_ac = NULL; + + if(!w) + return; + + i = (int)data; + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ac), i); + /* update history */ + + new_ac = g_strdup(e_action_str[i]); + gtk_clist_set_text(GTK_CLIST(clist), current_row, 2, new_ac); + /* update clist */ + + return; + UN(w); + UN(data); } /* * event_save_button_cb: when we want to save the current focus settings. @@ -609,95 +622,95 @@ * settings are called we accept that the keys list fully populated with * valid data. */ -static void -event_save_button_cb(GtkWidget *w, gpointer data) +static void +event_save_button_cb(GtkWidget * w, gpointer data) { - int i, j, written; - eaction_item *e = NULL; - Ewd_List *l; - gchar *tmp; - - action_container_focus_reinit(); - l = action_container.focus; - /* clear out the focus list, give it a local pointer val that's easier - * to read - */ - - for(i = 0; i < row_count; i++) { - e = eaction_item_new(); - - gtk_clist_get_text(GTK_CLIST(data), i, 0, &tmp); - for(j = 0; j < EBITS_SPOT_MAX; j++) { - if(!strcmp(tmp, ebits_hot_spots[j])) { - e->name = strdup(tmp); - break; - } - } - if(!e->name) { - /* no name == fatal */ - fprintf(stderr, "Unable to match your selection to any " - "available window positions\nI'm omitting this entry %s\n", - tmp); - eaction_item_free(e); - continue; - } - - gtk_clist_get_text(GTK_CLIST(data), i, 1, &tmp); - for(j = 0; j < E_ACTION_TYPE_MAX; j++) { - if(!strcmp(tmp, e_action_type[j])) { - e->event = j; - break; - } - } - tmp = NULL; - - gtk_clist_get_text(GTK_CLIST(data), i, 2, &tmp); - for(j = 0; j < FOCUS_ACTION_STR_MAX; j++) { - if(!strcmp(tmp, e_action_str[j])) { - e->action = strdup(tmp); - break; - } - } - tmp = NULL; - - gtk_clist_get_text(GTK_CLIST(data), i, 4, &tmp); - for(j = 0; j < MOD_STR_MAX; j++) { - if(!strcmp(tmp, mod_str[j])) { - e->modifiers = j; - break; - } - } - tmp = NULL; - - gtk_clist_get_text(GTK_CLIST(data), i, 3, &tmp); - if((tmp) && (strlen(tmp) > 0)) { - gchar *s; - char buf[64]; - - s = tmp; - s += 7; - snprintf(buf, 64, "%s", s); - /* chop the word Button off the beginning */ - e->button = atoi(buf); - } - tmp = NULL; - - e->key = strdup(""); - e->params = strdup(""); - - ewd_list_append(l, e); - } - written = write_user_actions_db(); - /* write, if successful pass the message */ - - if(written) - status_bar_message("Error Saving Your Focus Settings", 3000); - else - status_bar_message("Successfully Saved Your Focus Settings", 3000); - - return; - UN(w); - UN(data); + int i, j, written; + eaction_item *e = NULL; + Ewd_List *l; + gchar *tmp; + + action_container_focus_reinit(); + l = action_container.focus; + /* clear out the focus list, give it a local pointer val that's easier + * to read + */ + + for(i = 0; i < row_count; i++) { + e = eaction_item_new(); + + gtk_clist_get_text(GTK_CLIST(data), i, 0, &tmp); + for(j = 0; j < EBITS_SPOT_MAX; j++) { + if(!strcmp(tmp, ebits_hot_spots[j])) { + e->name = strdup(tmp); + break; + } + } + if(!e->name) { + /* no name == fatal */ + fprintf(stderr, "Unable to match your selection to any " + "available window positions\nI'm omitting this entry %s\n", + tmp); + eaction_item_free(e); + continue; + } + + gtk_clist_get_text(GTK_CLIST(data), i, 1, &tmp); + for(j = 0; j < E_ACTION_TYPE_MAX; j++) { + if(!strcmp(tmp, e_action_type[j])) { + e->event = j; + break; + } + } + tmp = NULL; + + gtk_clist_get_text(GTK_CLIST(data), i, 2, &tmp); + for(j = 0; j < FOCUS_ACTION_STR_MAX; j++) { + if(!strcmp(tmp, e_action_str[j])) { + e->action = strdup(tmp); + break; + } + } + tmp = NULL; + + gtk_clist_get_text(GTK_CLIST(data), i, 4, &tmp); + for(j = 0; j < MOD_STR_MAX; j++) { + if(!strcmp(tmp, mod_str[j])) { + e->modifiers = j; + break; + } + } + tmp = NULL; + + gtk_clist_get_text(GTK_CLIST(data), i, 3, &tmp); + if((tmp) && (strlen(tmp) > 0)) { + gchar *s; + char buf[64]; + + s = tmp; + s += 7; + snprintf(buf, 64, "%s", s); + /* chop the word Button off the beginning */ + e->button = atoi(buf); + } + tmp = NULL; + + e->key = strdup(""); + e->params = strdup(""); + + ewd_list_append(l, e); + } + written = write_user_actions_db(); + /* write, if successful pass the message */ + + if(written) + status_bar_message("Error Saving Your Focus Settings", 3000); + else + status_bar_message("Successfully Saved Your Focus Settings", 3000); + + return; + UN(w); + UN(data); } /* @@ -706,43 +719,42 @@ * @param w: unused * @param data: pointer to the clist */ -static void -event_add_button_cb(GtkWidget *w, gpointer data) +static void +event_add_button_cb(GtkWidget * w, gpointer data) { - gchar *fields[5]; - gint retval; + gchar *fields[5]; + gint retval; - fields[0] = g_strdup(ebits_hot_spots[0]); - fields[1] = g_strdup(e_action_type[0]); - fields[2] = g_strdup(e_action_str[0]); - fields[3] = g_strdup("Button 0"); - fields[4] = g_strdup("NONE"); - - retval = gtk_clist_insert(GTK_CLIST(data), - (current_row+1), fields); - - gtk_clist_select_row(GTK_CLIST(data), retval, 0); - row_count++; - return; - UN(w); - UN(data); + fields[0] = g_strdup(ebits_hot_spots[0]); + fields[1] = g_strdup(e_action_type[0]); + fields[2] = g_strdup(e_action_str[0]); + fields[3] = g_strdup("Button 0"); + fields[4] = g_strdup("NONE"); + + retval = gtk_clist_insert(GTK_CLIST(data), (current_row + 1), fields); + + gtk_clist_select_row(GTK_CLIST(data), retval, 0); + row_count++; + return; + UN(w); + UN(data); } /* * event_del_button_cb: delete the currently selected item from the clist * @param w: not used * @param data: pointer to the clist */ -static void -event_del_button_cb(GtkWidget *w, gpointer data) +static void +event_del_button_cb(GtkWidget * w, gpointer data) { - gtk_clist_remove(GTK_CLIST(data), current_row); - current_row = current_row == 0 ? 0 : current_row--; - gtk_clist_select_row(GTK_CLIST(data), current_row, 0); - row_count--; - - return; - UN(w); - UN(data); + gtk_clist_remove(GTK_CLIST(data), current_row); + current_row = current_row == 0 ? 0 : current_row--; + gtk_clist_select_row(GTK_CLIST(data), current_row, 0); + row_count--; + + return; + UN(w); + UN(data); } /* @@ -754,51 +766,51 @@ * @param data: the global clist */ static void -event_change_button_cb(GtkWidget *w, gpointer data) +event_change_button_cb(GtkWidget * w, gpointer data) { - GtkWidget *win, *label, *frame, *align; + GtkWidget *win, *label, *frame, *align; - if(data) - w = NULL; + if(data) + w = NULL; - win = gtk_window_new(GTK_WINDOW_POPUP); - gtk_window_set_policy(GTK_WINDOW(win), 0, 0, 1); - gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_MOUSE); - frame = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); - align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0); - gtk_container_set_border_width(GTK_CONTAINER(align), 32); - label = gtk_label_new("Please press the mouse button \n" - "you wish to modify this event to use \n" - "from now on."); - gtk_container_add(GTK_CONTAINER(win), frame); - gtk_container_add(GTK_CONTAINER(frame), align); - gtk_container_add(GTK_CONTAINER(align), label); - gtk_widget_show_all(win); - while (gtk_events_pending()) - gtk_main_iteration(); - gdk_flush(); - while (gtk_events_pending()) - gtk_main_iteration(); - - { - char buf[64], buf2[64]; - XEvent ev; - - gdk_window_set_events(win->window, GDK_BUTTON_PRESS_MASK); - XSetInputFocus(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), - RevertToPointerRoot, CurrentTime); - gdk_pointer_grab(win->window, TRUE, GDK_BUTTON_PRESS_MASK, NULL, - NULL, CurrentTime); - XWindowEvent(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), - ButtonPressMask, &ev); - gdk_pointer_ungrab(gdk_time_get()); - - snprintf(buf, 64, "Button %d", ev.xbutton.button); - gtk_clist_set_text(GTK_CLIST(data),current_row,3,buf); - - snprintf(buf2, 64, "%d", ev.xbutton.button); - gtk_entry_set_text(GTK_ENTRY(button_e), buf2); - } - gtk_widget_destroy(win); + win = gtk_window_new(GTK_WINDOW_POPUP); + gtk_window_set_policy(GTK_WINDOW(win), 0, 0, 1); + gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_MOUSE); + frame = gtk_frame_new(NULL); + gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); + align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0); + gtk_container_set_border_width(GTK_CONTAINER(align), 32); + label = gtk_label_new("Please press the mouse button \n" + "you wish to modify this event to use \n" + "from now on."); + gtk_container_add(GTK_CONTAINER(win), frame); + gtk_container_add(GTK_CONTAINER(frame), align); + gtk_container_add(GTK_CONTAINER(align), label); + gtk_widget_show_all(win); + while(gtk_events_pending()) + gtk_main_iteration(); + gdk_flush(); + while(gtk_events_pending()) + gtk_main_iteration(); + + { + char buf[64], buf2[64]; + XEvent ev; + + gdk_window_set_events(win->window, GDK_BUTTON_PRESS_MASK); + XSetInputFocus(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), + RevertToPointerRoot, CurrentTime); + gdk_pointer_grab(win->window, TRUE, GDK_BUTTON_PRESS_MASK, NULL, + NULL, CurrentTime); + XWindowEvent(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), + ButtonPressMask, &ev); + gdk_pointer_ungrab(gdk_time_get()); + + snprintf(buf, 64, "Button %d", ev.xbutton.button); + gtk_clist_set_text(GTK_CLIST(data), current_row, 3, buf); + + snprintf(buf2, 64, "%d", ev.xbutton.button); + gtk_entry_set_text(GTK_ENTRY(button_e), buf2); + } + gtk_widget_destroy(win); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/callbacks.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- callbacks.c 2001/10/19 21:00:37 1.1 +++ callbacks.c 2001/10/20 18:06:19 1.2 @@ -15,18 +15,17 @@ gint status_bar_clear(gpointer data) { - gtk_statusbar_pop(GTK_STATUSBAR(ebindings_statusbar), 1); - return FALSE; - UN(data); + gtk_statusbar_pop(GTK_STATUSBAR(ebindings_statusbar), 1); + return FALSE; + UN(data); } -void -status_bar_message(gchar *message, gint delay) +void +status_bar_message(gchar * message, gint delay) { - gtk_statusbar_push(GTK_STATUSBAR(ebindings_statusbar), 1, message); - gtk_timeout_add(delay, (GtkFunction) status_bar_clear, ebindings_statusbar); - return; - UN(delay); - UN(message); + gtk_statusbar_push(GTK_STATUSBAR(ebindings_statusbar), 1, message); + gtk_timeout_add(delay, (GtkFunction) status_bar_clear, + ebindings_statusbar); + return; + UN(delay); + UN(message); } - - =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/eaction_item.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- eaction_item.c 2001/10/19 21:00:37 1.1 +++ eaction_item.c 2001/10/20 18:06:19 1.2 @@ -7,71 +7,64 @@ *************************************************************************/ #include"eaction_item.h" -eaction_item* +eaction_item * eaction_item_new(void) { - eaction_item *result; + eaction_item *result; - result = (eaction_item*) malloc(sizeof(eaction_item)); + result = (eaction_item *) malloc(sizeof(eaction_item)); - result->name = result->action = result->params = result->key = NULL; - result->button = result->event = result->modifiers = 0; + result->name = result->action = result->params = result->key = NULL; + result->button = result->event = result->modifiers = 0; - return result; + return result; } void -eaction_item_free(eaction_item *e) +eaction_item_free(eaction_item * e) { - if(!e) return; - - IF_FREE(e->name); - IF_FREE(e->action); - IF_FREE(e->params); - IF_FREE(e->key); + if(!e) + return; - free(e); -} -void -eaction_item_print(eaction_item* e) -{ - if(!e) return; - printf("Name: %s\nAction: %s\nParams: %s\nKey: %s\nButton: %d\n" - "Event: %d\nModifiers: %d\n\n", e->name, e->action, e->params, - e->key, e->button, e->event, e->modifiers); + IF_FREE(e->name); + IF_FREE(e->action); + IF_FREE(e->params); + IF_FREE(e->key); + + free(e); } void _eaction_item_free(void *data) { - eaction_item_free((eaction_item*)data); + eaction_item_free((eaction_item *) data); } void action_container_init(void) { - action_container.keys = ewd_list_new(); - action_container.focus = ewd_list_new(); + action_container.keys = ewd_list_new(); + action_container.focus = ewd_list_new(); - ewd_list_set_free_cb(action_container.keys, _eaction_item_free); - ewd_list_set_free_cb(action_container.focus, _eaction_item_free); + ewd_list_set_free_cb(action_container.keys, _eaction_item_free); + ewd_list_set_free_cb(action_container.focus, _eaction_item_free); } void action_container_free(void) { - ewd_list_destroy(action_container.keys); - ewd_list_destroy(action_container.focus); + ewd_list_destroy(action_container.keys); + ewd_list_destroy(action_container.focus); } void action_container_keys_reinit(void) { - ewd_list_destroy(action_container.keys); - action_container.keys = ewd_list_new(); - ewd_list_set_free_cb(action_container.keys, _eaction_item_free); + ewd_list_destroy(action_container.keys); + action_container.keys = ewd_list_new(); + ewd_list_set_free_cb(action_container.keys, _eaction_item_free); } void action_container_focus_reinit(void) { - ewd_list_destroy(action_container.focus); - action_container.focus = ewd_list_new(); - ewd_list_set_free_cb(action_container.focus, _eaction_item_free); + ewd_list_destroy(action_container.focus); + action_container.focus = ewd_list_new(); + ewd_list_set_free_cb(action_container.focus, _eaction_item_free); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/emenu_item.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- emenu_item.c 2001/10/19 21:00:37 1.1 +++ emenu_item.c 2001/10/20 18:06:19 1.2 @@ -10,67 +10,40 @@ /* Creates an emenu_item: sets everything to null or 0, and initializes the * children list */ -emenu_item* -emenu_item_new(void) +emenu_item * +emenu_item_new(void) { - emenu_item *result; + emenu_item *result; - result = malloc(sizeof(emenu_item)); - result->text = result->icon = result->exec = NULL; - - result->children = ewd_list_new(); - ewd_list_set_free_cb(result->children, _emenu_item_free); - - result->type = E_MENU_EXECUTABLE; + result = malloc(sizeof(emenu_item)); + result->text = result->icon = result->exec = NULL; - return result; + result->children = ewd_list_new(); + ewd_list_set_free_cb(result->children, _emenu_item_free); + + result->type = E_MENU_EXECUTABLE; + + return result; } /* used by ewd, it wants a void pointer blah blah blah */ void -_emenu_item_free(void *data) { - emenu_item_free((emenu_item*)data); +_emenu_item_free(void *data) +{ + emenu_item_free((emenu_item *) data); } /* destroy an allocated memory if there was any. free the children list */ void -emenu_item_free(emenu_item *m) { - if(!m) return; - - IF_FREE(m->exec); - IF_FREE(m->icon); - IF_FREE(m->text); - /* we get IF_FREE from Ewd Macros =) */ - - ewd_list_destroy(m->children); - free(m); -} +emenu_item_free(emenu_item * m) +{ + if(!m) + return; -/* Lameness ! */ -void -emenu_item_print(emenu_item *e) { - emenu_item *_e; + IF_FREE(m->exec); + IF_FREE(m->icon); + IF_FREE(m->text); + /* we get IF_FREE from Ewd Macros =) */ - switch(e->type) { - case E_MENU_SCRIPT: - printf("SCRIPT:\t"); - printf("%s is the description\n\t%s is the icon\n\t%s is the - exec\n\n", e->text, e->icon, e->exec); - break; - case E_MENU_SUBMENU: - printf("SUBMENU:\t"); - printf("%s is the description\n\t%s is the icon\n\t%s is the - exec\n\n", e->text, e->icon, e->exec); - ewd_list_goto_first(e->children); - while((_e = (emenu_item*)ewd_list_next(e->children))) - emenu_item_print(_e); - break; - case E_MENU_SEPARATOR: - printf("SEPARATOR:"); - break; - default: - printf("EXECUTABLE:"); - printf("%s is the description\n\t%s is the icon\n\t%s is the - exec\n\n", e->text, e->icon, e->exec); - break; - } -} + ewd_list_destroy(m->children); + free(m); +} =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/focus_interface.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- focus_interface.c 2001/10/19 21:00:37 1.1 +++ focus_interface.c 2001/10/20 18:06:19 1.2 @@ -8,97 +8,92 @@ *************************************************************************/ #include "focus_interface.h" -static void focus_mouse_focus_type_cb(GtkWidget*, gpointer); -static void focus_mouse_autoraise_window(GtkWidget*, gpointer); +static void focus_mouse_focus_type_cb(GtkWidget *, gpointer); +static void focus_mouse_autoraise_window(GtkWidget *, gpointer); - -static void -focus_mouse_focus_type_cb(GtkWidget *w, gpointer data) +static void +focus_mouse_focus_type_cb(GtkWidget * w, gpointer data) { - char buf[4096]; - gchar *button; - - if(!w) return; - snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - - button = gtk_widget_get_name(GTK_WIDGET(w)); - - if(!strcmp(button, "follow_pointer")) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { - E_DB_INT_SET(buf, "/focus/mode", 0) - } - } else if(!strcmp(button, "follow_click")) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { - /* FIXME cvs this breaks soemthing */ - /* E_DB_INT_SET(buf, "/focus/mode", 2) */ - fprintf(stderr, "Mouse Focus Follwing clicks is broken in e\n"); - } - } else { - fprintf(stderr, "ERROR: Unknown Focus button clicked\n"); - } - - return; - UN(data); - UN(w); + char buf[4096]; + gchar *button; + + if(!w) + return; + snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); + + button = gtk_widget_get_name(GTK_WIDGET(w)); + + if(!strcmp(button, "follow_pointer")) { + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { + E_DB_INT_SET(buf, "/focus/mode", 0)} + } else if(!strcmp(button, "follow_click")) { + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { + /* FIXME cvs this breaks soemthing */ + /* E_DB_INT_SET(buf, "/focus/mode", 2) */ + fprintf(stderr, "Mouse Focus Follwing clicks is broken in e\n"); + } + } else { + fprintf(stderr, "ERROR: Unknown Focus button clicked\n"); + } + + return; + UN(data); + UN(w); } -static void -focus_mouse_autoraise_window(GtkWidget *w, gpointer data) +static void +focus_mouse_autoraise_window(GtkWidget * w, gpointer data) { - char buf[4096]; + char buf[4096]; - if(!w) return; - snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) - E_DB_INT_SET(buf, "/window/raise/auto", 1) - else - E_DB_INT_SET(buf, "/window/raise/auto", 0) - - return; - UN(data); - UN(w); + if(!w) + return; + snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); + + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) + E_DB_INT_SET(buf, "/window/raise/auto", 1) + else + E_DB_INT_SET(buf, "/window/raise/auto", 0) return; + UN(data); + UN(w); } static void -focus_autoraise_timeout_cb(GtkWidget *w, gpointer data) +focus_autoraise_timeout_cb(GtkWidget * w, gpointer data) { - char buf[4096]; - float f = 0.000; + char buf[4096]; + float f = 0.000; - if(!w) return; - f = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(w)); + if(!w) + return; + f = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(w)); + + snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); + E_DB_FLOAT_SET(buf, "/window/raise/delay", f) return; + UN(data); - snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - E_DB_FLOAT_SET(buf, "/window/raise/delay", f) - - - return; - UN(data); - } static void -focus_guides_location_change_cb(GtkWidget *w, gpointer data) +focus_guides_location_change_cb(GtkWidget * w, gpointer data) { - char buf[4096]; - float _f = 0.000, f = 0.000 ; - float scale = 100.00; - char *wname; - - if(!w) return; - - wname = gtk_widget_get_name(GTK_WIDGET(w)); - - _f = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(w)); - f = (_f/scale); - printf("%3f is the value we just changed %s to\n", f, wname); - snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - if(!strcmp(wname, "horiz_guide")) { - E_DB_FLOAT_SET(buf, "/guides/display/x", f) - } else if(!strcmp(wname, "vert_guide")) { - E_DB_FLOAT_SET(buf, "/guides/display/y", f) - } else { - fprintf(stderr, "ERROR: Unknown Guide Spinbox\n%s\n", wname); - } + char buf[4096]; + float _f = 0.000, f = 0.000; + float scale = 100.00; + char *wname; + + if(!w) + return; + + wname = gtk_widget_get_name(GTK_WIDGET(w)); + + _f = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(w)); + f = (_f / scale); + snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); + if(!strcmp(wname, "horiz_guide")) { + E_DB_FLOAT_SET(buf, "/guides/display/x", f)} + else if(!strcmp(wname, "vert_guide")) { + E_DB_FLOAT_SET(buf, "/guides/display/y", f)} else { + fprintf(stderr, "ERROR: Unknown Guide Spinbox\n%s\n", wname); + } } @@ -108,189 +103,187 @@ * @param note: widget pointing to the notebook to attach to * @param sheet: what tab to insert as */ -void add_focus_notebook(GtkWidget *w, GtkWidget *note, int sheet) +void +add_focus_notebook(GtkWidget * w, GtkWidget * note, int sheet) { - - GtkWidget *tab_label, *scale_label; - GtkWidget *vbox; - GtkWidget *frame, *frame2; - GtkWidget *table, *table2; - GtkWidget *follow_pointer; - GtkWidget *follow_clicks; - GtkWidget *autoraise; - GtkObject *raise_adj; - GtkWidget *raise_gauge; - GtkWidget *hsep, *hsep2; - GtkObject *guide_x_adj, *guide_y_adj; - GtkWidget *guide_x, *guide_y, *guide_x_label, *guide_y_label; - - char buf[4096]; - int current_val = 0, ok = 0; - float flot = 0.00, _flot = 0.00; - - snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - - - tab_label = gtk_label_new("Focus"); - - vbox = gtk_vbox_new(FALSE, 0); - - gtk_notebook_insert_page(GTK_NOTEBOOK(note),vbox, tab_label, sheet); - - frame = gtk_frame_new("Mouse Focus Settings"); - - gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, TRUE, 0); - - table = gtk_table_new(8, 2, FALSE); - - gtk_container_add(GTK_CONTAINER(frame), table); - - follow_pointer = gtk_radio_button_new_with_label(NULL, - "Mouse Focus Follows Pointer"); - gtk_widget_set_name(GTK_WIDGET(follow_pointer), "follow_pointer"); - gtk_signal_connect(GTK_OBJECT(follow_pointer), "toggled", - GTK_SIGNAL_FUNC(focus_mouse_focus_type_cb), - NULL); - gtk_table_attach(GTK_TABLE(table), follow_pointer, 0, 1, 0, 1, GTK_FILL, - 0, 2, 2); - - follow_clicks = gtk_radio_button_new_with_label_from_widget( - GTK_RADIO_BUTTON(follow_pointer), - "Mouse Focus Follows Mouse Clicks"); - gtk_widget_set_name(GTK_WIDGET(follow_clicks), "follow_click"); - gtk_signal_connect(GTK_OBJECT(follow_clicks), "toggled", - GTK_SIGNAL_FUNC(focus_mouse_focus_type_cb), - NULL); - gtk_table_attach(GTK_TABLE(table), follow_clicks, 0, 1, 1, 2, GTK_FILL, - 0, 2, 2); - - E_DB_INT_GET(buf, "/focus/mode", current_val, ok) - - if(ok) { - switch(current_val) { - case 0: - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(follow_pointer), - TRUE); - break; - case 2: - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(follow_clicks), - TRUE); - break; - default: - fprintf(stderr, "I don't know focus mode %d yet\n", - current_val); - } - } - - hsep = gtk_hseparator_new(); - gtk_table_attach(GTK_TABLE(table), hsep, 0, 2, 2, 3, GTK_FILL | - GTK_EXPAND, 0, 2, 2); - - /* */ - autoraise = gtk_check_button_new_with_label( - "Autoraise window on mouse focus switch"); - gtk_table_attach(GTK_TABLE(table), autoraise, 0, 1, 3, 4, GTK_FILL, - 0, 2, 2); - E_DB_INT_GET(buf, "/window/raise/auto", current_val, ok) - gtk_signal_connect(GTK_OBJECT(autoraise), "toggled", - GTK_SIGNAL_FUNC(focus_mouse_autoraise_window), NULL); - if(current_val) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(autoraise), TRUE); - - /* */ - - scale_label = gtk_label_new("Delay in Seconds"); - gtk_label_set_justify(GTK_LABEL(scale_label), GTK_JUSTIFY_LEFT); - gtk_table_attach(GTK_TABLE(table), scale_label, 0, 1, 4, 5, 0, 0, - 2, 2); - - /* */ - E_DB_FLOAT_GET(buf, "/window/raise/delay", flot, ok) - if(ok) - raise_adj = gtk_adjustment_new(flot, 0.00, 5.00, 0.02, 1.0, 0); - else - raise_adj = gtk_adjustment_new(0.00, 0.00, 5.00, 0.02, 1.0, 0); - raise_gauge = gtk_spin_button_new(GTK_ADJUSTMENT(raise_adj), 0.05, 3); - gtk_table_attach(GTK_TABLE(table), raise_gauge, 0, 1, 5, 6, GTK_FILL, 0, - 2, 2); - gtk_signal_connect(GTK_OBJECT(raise_gauge), "changed", - GTK_SIGNAL_FUNC(focus_autoraise_timeout_cb), NULL); - /* */ - - hsep2 = gtk_hseparator_new(); - gtk_table_attach(GTK_TABLE(table), hsep2, 0, 2, 6, 7, GTK_FILL | - GTK_EXPAND, 0, 2, 2); - /* End Mouse Focus */ - - /* Start Guide frame */ - frame2 = gtk_frame_new("Guide Settings"); - gtk_box_pack_start(GTK_BOX(vbox), frame2, FALSE, TRUE, 0); - - table2 = gtk_table_new(2,2, FALSE); - gtk_table_set_col_spacings(GTK_TABLE(table2), 3); - gtk_container_add(GTK_CONTAINER(frame2), table2); - - /* Guides_x */ - guide_x_label = gtk_label_new("Horizontal Positioning (0 left most, " - "100 right most) "); - gtk_table_attach(GTK_TABLE(table2), guide_x_label, 0, 1, 0, 1, GTK_FILL, 0, - 2, 2); - E_DB_FLOAT_GET(buf, "/guides/display/x", _flot, ok) - flot = (_flot * 100.00); - if(ok) - guide_x_adj = gtk_adjustment_new(flot, 0.00, 1... [truncated message content] |
From: <enl...@li...> - 2001-11-03 16:54:06
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: action_extra.c callbacks.c eaction_item.c emenu_item.c focus_interface.c interface.c keybind_interface.c main.c menu_interface.c util.c action_extra.h callbacks.h eaction_item.h emenu_item.h focus_interface.h interface.h keybind_interface.h menu_interface.h util.h Log Message: ran indent with much more readable style, flush dbs in the focus tab after changes, small fix in menu tab code =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/action_extra.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- action_extra.c 2001/10/20 18:06:19 1.2 +++ action_extra.c 2001/11/03 16:54:03 1.3 @@ -10,37 +10,36 @@ static struct { - GtkWidget *pos; /* position option menu */ - GtkWidget *ev; /* event type option menu */ - GtkWidget *ac; /* action type option menu */ - GtkWidget *mod; /* modifier key option menu */ + GtkWidget *pos; /* position option menu */ + GtkWidget *ev; /* event type option menu */ + GtkWidget *ac; /* action type option menu */ + GtkWidget *mod; /* modifier key option menu */ } f_menus; -static GtkWidget *button_e; /* entry widget for the button number */ -static GtkWidget *clist; /* columned list of mouse events */ -static int row_count; /* the number of rows in clist */ -static int current_row; /* the currently selected row in the clist */ +static GtkWidget *button_e; /* entry widget for the button number */ +static GtkWidget *clist; /* columned list of mouse events */ +static int row_count; /* the number of rows in clist */ +static int current_row; /* the currently selected row in the clist */ /* global variables to the focus interface */ -static void focus_clist_select_row(GtkWidget * w, gint row, - gint column, GdkEventButton * ev, - gpointer data); - -static void window_pos_option_menu_modified(GtkWidget *, gpointer); -static void event_option_menu_modified(GtkWidget *, gpointer); -static void action_option_menu_modified(GtkWidget *, gpointer); -static void mod_key_option_menu_modified(GtkWidget *, gpointer); - -static void event_change_button_cb(GtkWidget *, gpointer); -static void event_save_button_cb(GtkWidget *, gpointer); -static void event_add_button_cb(GtkWidget *, gpointer); -static void event_del_button_cb(GtkWidget *, gpointer); +static void focus_clist_select_row(GtkWidget * w, gint row, gint column, + GdkEventButton * ev, gpointer data); +static void window_pos_option_menu_modified(GtkWidget *, gpointer); +static void event_option_menu_modified(GtkWidget *, gpointer); +static void action_option_menu_modified(GtkWidget *, gpointer); +static void mod_key_option_menu_modified(GtkWidget *, gpointer); + +static void event_change_button_cb(GtkWidget *, gpointer); +static void event_save_button_cb(GtkWidget *, gpointer); +static void event_add_button_cb(GtkWidget *, gpointer); +static void event_del_button_cb(GtkWidget *, gpointer); + /* callbacks(commented below) */ /* option menu data */ -static gchar *mod_str[] = { +static gchar *mod_str[] = { "NONE", "SHIFT", "CTRL", @@ -61,7 +60,7 @@ }; /* options based on enum _ev_modifiers in Ecore.h */ -static gchar *e_action_str[] = { +static gchar *e_action_str[] = { "Window_Move", "Window_Resize", "Window_Resize_Horizontal", @@ -84,7 +83,7 @@ /* count is 19 currently */ /* based on options in e_action_init in actions.c in e17/e/src */ }; -static gchar *ebits_hot_spots[] = { +static gchar *ebits_hot_spots[] = { "Decoration", "Title_Bar", "Close", @@ -110,7 +109,7 @@ "Window_Place" /* parts of this came from etcher class types on the properties tag */ }; -static gchar *e_action_type[] = { +static gchar *e_action_type[] = { "Mouse In On Window Position", "Mouse Out On Window Position", "Mouse Button Down On Window Position", @@ -133,26 +132,26 @@ add_actions_extra_notebook(GtkWidget * w, GtkWidget * note, int sheet) { - GtkWidget *tab_label; - GtkWidget *hpaned; - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *scroller1, *scroller2; - GtkWidget *frame; - GtkWidget *table; - int i; - eaction_item *e; - - GtkWidget *newb, *delb, *saveb, *button_b; - GtkWidget *o_menu, *menu, *option; - GtkWidget *win_pos_l, *event_l, *mod_l, *action_l, *button_l; - GtkWidget *disclaimer; - char buf[64]; + GtkWidget *tab_label; + GtkWidget *hpaned; + GtkWidget *hbox; + GtkWidget *vbox; + GtkWidget *scroller1, *scroller2; + GtkWidget *frame; + GtkWidget *table; + int i; + eaction_item *e; + + GtkWidget *newb, *delb, *saveb, *button_b; + GtkWidget *o_menu, *menu, *option; + GtkWidget *win_pos_l, *event_l, *mod_l, *action_l, *button_l; + GtkWidget *disclaimer; + char buf[64]; - gchar *fields[] = { + gchar *fields[] = { "Window Position", "Event", "Action", "Mouse Button", "Modifier Key" }; - gchar *key_fields[5]; + gchar *key_fields[5]; current_row = row_count = 0; /* setup the static globals =) */ @@ -164,8 +163,7 @@ scroller1 = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller1), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); clist = gtk_clist_new_with_titles(5, fields); gtk_widget_ref(clist); @@ -177,7 +175,7 @@ gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 3, TRUE); gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 4, TRUE); gtk_signal_connect(GTK_OBJECT(clist), "select-row", - GTK_SIGNAL_FUNC(focus_clist_select_row), NULL); + GTK_SIGNAL_FUNC(focus_clist_select_row), NULL); gtk_container_add(GTK_CONTAINER(scroller1), clist); gtk_paned_pack1(GTK_PANED(hpaned), scroller1, TRUE, FALSE); @@ -193,23 +191,23 @@ /* Row 1 */ win_pos_l = gtk_label_new("Window Position:"); gtk_table_attach(GTK_TABLE(table), win_pos_l, 0, 1, 0, 1, GTK_FILL, 0, 2, - 2); + 2); o_menu = gtk_option_menu_new(); gtk_widget_ref(o_menu); gtk_widget_set_name(o_menu, "win_pos_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 0, 1, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 0, 1, GTK_FILL, 0, 2, 2); f_menus.pos = o_menu; menu = gtk_menu_new(); - for(i = 0; i < EBITS_SPOT_MAX; i++) { + for (i = 0; i < EBITS_SPOT_MAX; i++) + { option = gtk_menu_item_new_with_label(ebits_hot_spots[i]); gtk_widget_show(option); gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(window_pos_option_menu_modified), - (gpointer) i); + GTK_SIGNAL_FUNC(window_pos_option_menu_modified), + (gpointer) i); gtk_menu_append(GTK_MENU(menu), option); } gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); @@ -219,24 +217,23 @@ /* Row 2 */ event_l = gtk_label_new("Event Type: "); - gtk_table_attach(GTK_TABLE(table), event_l, 0, 1, 1, 2, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), event_l, 0, 1, 1, 2, GTK_FILL, 0, 2, 2); o_menu = gtk_option_menu_new(); gtk_widget_ref(o_menu); gtk_widget_set_name(o_menu, "event_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 1, 2, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 1, 2, GTK_FILL, 0, 2, 2); f_menus.ev = o_menu; menu = gtk_menu_new(); - for(i = 0; i < E_ACTION_TYPE_MAX; i++) { + for (i = 0; i < E_ACTION_TYPE_MAX; i++) + { option = gtk_menu_item_new_with_label(e_action_type[i]); gtk_widget_show(option); gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(event_option_menu_modified), - (gpointer) i); + GTK_SIGNAL_FUNC(event_option_menu_modified), + (gpointer) i); gtk_menu_append(GTK_MENU(menu), option); } gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); @@ -246,25 +243,24 @@ /* Row 3 */ action_l = gtk_label_new("Action Request: "); - gtk_table_attach(GTK_TABLE(table), action_l, 0, 1, 2, 3, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), action_l, 0, 1, 2, 3, GTK_FILL, 0, 2, 2); o_menu = gtk_option_menu_new(); gtk_widget_ref(o_menu); gtk_widget_set_name(o_menu, "mod_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 2, 3, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 2, 3, GTK_FILL, 0, 2, 2); f_menus.ac = o_menu; menu = gtk_menu_new(); - for(i = 0; i < FOCUS_ACTION_STR_MAX; i++) { + for (i = 0; i < FOCUS_ACTION_STR_MAX; i++) + { option = gtk_menu_item_new_with_label(e_action_str[i]); gtk_widget_show(option); gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(action_option_menu_modified), - (gpointer) i); + GTK_SIGNAL_FUNC(action_option_menu_modified), + (gpointer) i); gtk_menu_append(GTK_MENU(menu), option); } gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); @@ -274,19 +270,16 @@ /* Row 4 */ button_l = gtk_label_new("Button Pressed: "); - gtk_table_attach(GTK_TABLE(table), button_l, 0, 1, 3, 4, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), button_l, 0, 1, 3, 4, GTK_FILL, 0, 2, 2); button_e = gtk_entry_new(); gtk_entry_set_editable(GTK_ENTRY(button_e), FALSE); - gtk_table_attach(GTK_TABLE(table), button_e, 1, 2, 3, 4, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), button_e, 1, 2, 3, 4, GTK_FILL, 0, 2, 2); button_b = gtk_button_new_with_label("Change"); - gtk_table_attach(GTK_TABLE(table), button_b, 2, 3, 3, 4, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), button_b, 2, 3, 3, 4, GTK_FILL, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(button_b), "clicked", - GTK_SIGNAL_FUNC(event_change_button_cb), clist); + GTK_SIGNAL_FUNC(event_change_button_cb), clist); /* Row 5 */ mod_l = gtk_label_new("Modifier Key: "); @@ -295,19 +288,19 @@ o_menu = gtk_option_menu_new(); gtk_widget_ref(o_menu); gtk_widget_set_name(o_menu, "mod_menu"); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 4, 5, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 4, 5, GTK_FILL, 0, 2, 2); f_menus.mod = o_menu; menu = gtk_menu_new(); - for(i = 0; i < MOD_STR_MAX; i++) { + for (i = 0; i < MOD_STR_MAX; i++) + { option = gtk_menu_item_new_with_label(mod_str[i]); gtk_widget_show(option); gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(mod_key_option_menu_modified), - (gpointer) i); + GTK_SIGNAL_FUNC(mod_key_option_menu_modified), + (gpointer) i); gtk_menu_append(GTK_MENU(menu), option); } gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); @@ -318,21 +311,20 @@ scroller2 = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller2), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); disclaimer = gtk_text_new(NULL, NULL); gtk_text_set_editable(GTK_TEXT(disclaimer), FALSE); gtk_text_insert(GTK_TEXT(disclaimer), NULL, NULL, NULL, - "This is only a test, you can change values here, but \n" - "this is not a good interface for handling this kind of\n" - "configuration. It does allow you to modify how the mouse\n" - "interacts with windows, but some ebits knowledge is needed \n" - "to change certain features.", 254); + "This is only a test, you can change values here, but \n" + "this is not a good interface for handling this kind of\n" + "configuration. It does allow you to modify how the mouse\n" + "interacts with windows, but some ebits knowledge is needed \n" + "to change certain features.", 254); gtk_container_add(GTK_CONTAINER(scroller2), disclaimer); - gtk_table_attach(GTK_TABLE(table), scroller2, 0, 3, 5, 6, GTK_FILL | - GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); + gtk_table_attach(GTK_TABLE(table), scroller2, 0, 3, 5, 6, + GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); /* end Rows */ /* add table to the frame */ @@ -345,7 +337,7 @@ gtk_widget_ref(newb); gtk_widget_set_name(newb, "new_focus_button"); gtk_signal_connect(GTK_OBJECT(newb), "clicked", - GTK_SIGNAL_FUNC(event_add_button_cb), clist); + GTK_SIGNAL_FUNC(event_add_button_cb), clist); gtk_box_pack_start(GTK_BOX(hbox), newb, TRUE, TRUE, 2); @@ -353,19 +345,18 @@ gtk_widget_ref(delb); gtk_widget_set_name(delb, "del_focus_button"); gtk_signal_connect(GTK_OBJECT(delb), "clicked", - GTK_SIGNAL_FUNC(event_del_button_cb), clist); + GTK_SIGNAL_FUNC(event_del_button_cb), clist); gtk_box_pack_start(GTK_BOX(hbox), delb, TRUE, TRUE, 2); saveb = gtk_button_new_with_label("Save"); gtk_widget_ref(saveb); gtk_widget_set_name(saveb, "save_focus_button"); gtk_signal_connect(GTK_OBJECT(saveb), "clicked", - GTK_SIGNAL_FUNC(event_save_button_cb), clist); + GTK_SIGNAL_FUNC(event_save_button_cb), clist); gtk_box_pack_start(GTK_BOX(hbox), saveb, TRUE, TRUE, 2); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - /* vbox is setup and added to the hbox, which is going to the right - * pane + /* vbox is setup and added to the hbox, which is going to the right pane */ gtk_paned_pack2(GTK_PANED(hpaned), vbox, FALSE, FALSE); @@ -402,7 +393,8 @@ gtk_widget_show(tab_label); ewd_list_goto_first(action_container.focus); - while((e = (eaction_item *) ewd_list_next(action_container.focus))) { + while ((e = (eaction_item *) ewd_list_next(action_container.focus))) + { snprintf(buf, 64, "Button %d", e->button); key_fields[0] = g_strdup(e->name); key_fields[1] = g_strdup(e_action_type[e->event]); @@ -419,7 +411,7 @@ IF_FREE(key_fields[3]); IF_FREE(key_fields[4]); } - if(row_count) + if (row_count) gtk_clist_select_row(GTK_CLIST(clist), 0, 0); return; @@ -435,14 +427,14 @@ */ static void focus_clist_select_row(GtkWidget * w, gint row, gint column, - GdkEventButton * ev, gpointer data) + GdkEventButton * ev, gpointer data) { - gchar *fields[5] = { + gchar *fields[5] = { "", "", "", "", "" }; - int i; + int i; - if(!w) + if (!w) return; current_row = row; @@ -454,33 +446,42 @@ /* get text from the selected widget */ /* then update the option menus and button number accordingly */ - for(i = 0; i < EBITS_SPOT_MAX; i++) { - if(!strcmp(fields[0], ebits_hot_spots[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.pos), i); - break; + for (i = 0; i < EBITS_SPOT_MAX; i++) + { + if (!strcmp(fields[0], ebits_hot_spots[i])) + { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.pos), i); + break; } } - for(i = 0; i < E_ACTION_TYPE_MAX; i++) { - if(!strcmp(fields[1], e_action_type[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ev), i); - break; + for (i = 0; i < E_ACTION_TYPE_MAX; i++) + { + if (!strcmp(fields[1], e_action_type[i])) + { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ev), i); + break; } } - for(i = 0; i < FOCUS_ACTION_STR_MAX; i++) { - if(!strcmp(fields[2], e_action_str[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ac), i); - break; + for (i = 0; i < FOCUS_ACTION_STR_MAX; i++) + { + if (!strcmp(fields[2], e_action_str[i])) + { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ac), i); + break; } } - for(i = 0; i < MOD_STR_MAX; i++) { - if(!strcmp(fields[4], mod_str[i])) { - gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.mod), i); - break; + for (i = 0; i < MOD_STR_MAX; i++) + { + if (!strcmp(fields[4], mod_str[i])) + { + gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.mod), i); + break; } } - if((fields[3]) && (strlen(fields[3]) > 0)) { - gchar *s; - char buf[64]; + if ((fields[3]) && (strlen(fields[3]) > 0)) + { + gchar *s; + char buf[64]; s = fields[3]; s += 7; @@ -506,13 +507,13 @@ static void window_pos_option_menu_modified(GtkWidget * w, gpointer data) { - int i; - gchar *new_pos = NULL; + int i; + gchar *new_pos = NULL; - if(!w) + if (!w) return; - i = (int)data; + i = (int) data; gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.pos), i); /* set the option upto date */ @@ -525,6 +526,7 @@ UN(w); UN(data); } + /* * event_option_menu_modified: when the option menu is modified, update * the clist to reflect the latest changes @@ -535,13 +537,13 @@ static void event_option_menu_modified(GtkWidget * w, gpointer data) { - int i; - gchar *new_ev = NULL; + int i; + gchar *new_ev = NULL; - if(!w) + if (!w) return; - i = (int)data; + i = (int) data; gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ev), i); /* update the history */ @@ -553,6 +555,7 @@ UN(w); UN(data); } + /* * mod_key_option_menu_modified: when the option menu is modified, update * the clist to reflect the latest changes @@ -563,13 +566,13 @@ static void mod_key_option_menu_modified(GtkWidget * w, gpointer data) { - int i; - gchar *new_mod = NULL; + int i; + gchar *new_mod = NULL; - if(!w) + if (!w) return; - i = (int)data; + i = (int) data; gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.mod), i); /* update history */ @@ -580,6 +583,7 @@ UN(w); UN(data); } + /* * action_option_menu_modified: when the option menu is modified, update * the clist to reflect the latest changes @@ -590,13 +594,13 @@ static void action_option_menu_modified(GtkWidget * w, gpointer data) { - int i; - gchar *new_ac = NULL; + int i; + gchar *new_ac = NULL; - if(!w) + if (!w) return; - i = (int)data; + i = (int) data; gtk_option_menu_set_history(GTK_OPTION_MENU(f_menus.ac), i); /* update history */ @@ -608,6 +612,7 @@ UN(w); UN(data); } + /* * event_save_button_cb: when we want to save the current focus settings. * @param w: pointer to the widget "Save" button @@ -625,73 +630,84 @@ static void event_save_button_cb(GtkWidget * w, gpointer data) { - int i, j, written; - eaction_item *e = NULL; - Ewd_List *l; - gchar *tmp; + int i, j, written; + eaction_item *e = NULL; + Ewd_List *l; + gchar *tmp; action_container_focus_reinit(); l = action_container.focus; /* clear out the focus list, give it a local pointer val that's easier - * to read - */ + to read */ - for(i = 0; i < row_count; i++) { + for (i = 0; i < row_count; i++) + { e = eaction_item_new(); gtk_clist_get_text(GTK_CLIST(data), i, 0, &tmp); - for(j = 0; j < EBITS_SPOT_MAX; j++) { - if(!strcmp(tmp, ebits_hot_spots[j])) { - e->name = strdup(tmp); - break; - } + for (j = 0; j < EBITS_SPOT_MAX; j++) + { + if (!strcmp(tmp, ebits_hot_spots[j])) + { + e->name = strdup(tmp); + break; + } } - if(!e->name) { - /* no name == fatal */ - fprintf(stderr, "Unable to match your selection to any " - "available window positions\nI'm omitting this entry %s\n", - tmp); - eaction_item_free(e); - continue; + if (!e->name) + { + /* no name == fatal */ + fprintf(stderr, + "Unable to match your selection to any " + "available window positions\nI'm omitting this entry %s\n", + tmp); + eaction_item_free(e); + continue; } gtk_clist_get_text(GTK_CLIST(data), i, 1, &tmp); - for(j = 0; j < E_ACTION_TYPE_MAX; j++) { - if(!strcmp(tmp, e_action_type[j])) { - e->event = j; - break; - } + for (j = 0; j < E_ACTION_TYPE_MAX; j++) + { + if (!strcmp(tmp, e_action_type[j])) + { + e->event = j; + break; + } } tmp = NULL; gtk_clist_get_text(GTK_CLIST(data), i, 2, &tmp); - for(j = 0; j < FOCUS_ACTION_STR_MAX; j++) { - if(!strcmp(tmp, e_action_str[j])) { - e->action = strdup(tmp); - break; - } + for (j = 0; j < FOCUS_ACTION_STR_MAX; j++) + { + if (!strcmp(tmp, e_action_str[j])) + { + e->action = strdup(tmp); + break; + } } tmp = NULL; gtk_clist_get_text(GTK_CLIST(data), i, 4, &tmp); - for(j = 0; j < MOD_STR_MAX; j++) { - if(!strcmp(tmp, mod_str[j])) { - e->modifiers = j; - break; - } + for (j = 0; j < MOD_STR_MAX; j++) + { + if (!strcmp(tmp, mod_str[j])) + { + e->modifiers = j; + break; + } } tmp = NULL; gtk_clist_get_text(GTK_CLIST(data), i, 3, &tmp); - if((tmp) && (strlen(tmp) > 0)) { - gchar *s; - char buf[64]; - - s = tmp; - s += 7; - snprintf(buf, 64, "%s", s); - /* chop the word Button off the beginning */ - e->button = atoi(buf); + if ((tmp) && (strlen(tmp) > 0)) + { + gchar *s; + char buf[64]; + + s = tmp; + s += 7; + snprintf(buf, 64, "%s", s); + /* chop the word Button off the beginning */ + e->button = atoi(buf); } tmp = NULL; @@ -703,7 +719,7 @@ written = write_user_actions_db(); /* write, if successful pass the message */ - if(written) + if (written) status_bar_message("Error Saving Your Focus Settings", 3000); else status_bar_message("Successfully Saved Your Focus Settings", 3000); @@ -722,8 +738,8 @@ static void event_add_button_cb(GtkWidget * w, gpointer data) { - gchar *fields[5]; - gint retval; + gchar *fields[5]; + gint retval; fields[0] = g_strdup(ebits_hot_spots[0]); fields[1] = g_strdup(e_action_type[0]); @@ -739,6 +755,7 @@ UN(w); UN(data); } + /* * event_del_button_cb: delete the currently selected item from the clist * @param w: not used @@ -768,9 +785,9 @@ static void event_change_button_cb(GtkWidget * w, gpointer data) { - GtkWidget *win, *label, *frame, *align; + GtkWidget *win, *label, *frame, *align; - if(data) + if (data) w = NULL; win = gtk_window_new(GTK_WINDOW_POPUP); @@ -780,30 +797,30 @@ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0); gtk_container_set_border_width(GTK_CONTAINER(align), 32); - label = gtk_label_new("Please press the mouse button \n" - "you wish to modify this event to use \n" - "from now on."); + label = + gtk_label_new("Please press the mouse button \n" + "you wish to modify this event to use \n" "from now on."); gtk_container_add(GTK_CONTAINER(win), frame); gtk_container_add(GTK_CONTAINER(frame), align); gtk_container_add(GTK_CONTAINER(align), label); gtk_widget_show_all(win); - while(gtk_events_pending()) + while (gtk_events_pending()) gtk_main_iteration(); gdk_flush(); - while(gtk_events_pending()) + while (gtk_events_pending()) gtk_main_iteration(); { - char buf[64], buf2[64]; - XEvent ev; + char buf[64], buf2[64]; + XEvent ev; gdk_window_set_events(win->window, GDK_BUTTON_PRESS_MASK); XSetInputFocus(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), - RevertToPointerRoot, CurrentTime); - gdk_pointer_grab(win->window, TRUE, GDK_BUTTON_PRESS_MASK, NULL, - NULL, CurrentTime); + RevertToPointerRoot, CurrentTime); + gdk_pointer_grab(win->window, TRUE, GDK_BUTTON_PRESS_MASK, NULL, NULL, + CurrentTime); XWindowEvent(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), - ButtonPressMask, &ev); + ButtonPressMask, &ev); gdk_pointer_ungrab(gdk_time_get()); snprintf(buf, 64, "Button %d", ev.xbutton.button); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/callbacks.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- callbacks.c 2001/10/20 18:06:19 1.2 +++ callbacks.c 2001/11/03 16:54:03 1.3 @@ -19,12 +19,12 @@ return FALSE; UN(data); } + void status_bar_message(gchar * message, gint delay) { gtk_statusbar_push(GTK_STATUSBAR(ebindings_statusbar), 1, message); - gtk_timeout_add(delay, (GtkFunction) status_bar_clear, - ebindings_statusbar); + gtk_timeout_add(delay, (GtkFunction) status_bar_clear, ebindings_statusbar); return; UN(delay); UN(message); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/eaction_item.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- eaction_item.c 2001/10/20 18:06:19 1.2 +++ eaction_item.c 2001/11/03 16:54:04 1.3 @@ -7,10 +7,10 @@ *************************************************************************/ #include"eaction_item.h" -eaction_item * +eaction_item * eaction_item_new(void) { - eaction_item *result; + eaction_item *result; result = (eaction_item *) malloc(sizeof(eaction_item)); @@ -23,7 +23,7 @@ void eaction_item_free(eaction_item * e) { - if(!e) + if (!e) return; IF_FREE(e->name); @@ -33,6 +33,7 @@ free(e); } + void _eaction_item_free(void *data) { @@ -48,12 +49,14 @@ ewd_list_set_free_cb(action_container.keys, _eaction_item_free); ewd_list_set_free_cb(action_container.focus, _eaction_item_free); } + void action_container_free(void) { ewd_list_destroy(action_container.keys); ewd_list_destroy(action_container.focus); } + void action_container_keys_reinit(void) { @@ -61,6 +64,7 @@ action_container.keys = ewd_list_new(); ewd_list_set_free_cb(action_container.keys, _eaction_item_free); } + void action_container_focus_reinit(void) { =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/emenu_item.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- emenu_item.c 2001/10/20 18:06:19 1.2 +++ emenu_item.c 2001/11/03 16:54:04 1.3 @@ -10,10 +10,10 @@ /* Creates an emenu_item: sets everything to null or 0, and initializes the * children list */ -emenu_item * +emenu_item * emenu_item_new(void) { - emenu_item *result; + emenu_item *result; result = malloc(sizeof(emenu_item)); result->text = result->icon = result->exec = NULL; @@ -25,6 +25,7 @@ return result; } + /* used by ewd, it wants a void pointer blah blah blah */ void _emenu_item_free(void *data) @@ -36,7 +37,7 @@ void emenu_item_free(emenu_item * m) { - if(!m) + if (!m) return; IF_FREE(m->exec); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/focus_interface.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- focus_interface.c 2001/10/20 18:06:19 1.2 +++ focus_interface.c 2001/11/03 16:54:04 1.3 @@ -8,31 +8,37 @@ *************************************************************************/ #include "focus_interface.h" -static void focus_mouse_focus_type_cb(GtkWidget *, gpointer); -static void focus_mouse_autoraise_window(GtkWidget *, gpointer); +static void focus_mouse_focus_type_cb(GtkWidget *, gpointer); +static void focus_mouse_autoraise_window(GtkWidget *, gpointer); static void focus_mouse_focus_type_cb(GtkWidget * w, gpointer data) { - char buf[4096]; - gchar *button; + char buf[4096]; + gchar *button; - if(!w) + if (!w) return; snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); button = gtk_widget_get_name(GTK_WIDGET(w)); - if(!strcmp(button, "follow_pointer")) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { - E_DB_INT_SET(buf, "/focus/mode", 0)} - } else if(!strcmp(button, "follow_click")) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) { - /* FIXME cvs this breaks soemthing */ - /* E_DB_INT_SET(buf, "/focus/mode", 2) */ - fprintf(stderr, "Mouse Focus Follwing clicks is broken in e\n"); + if (!strcmp(button, "follow_pointer")) + { + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) + { + E_DB_INT_SET(buf, "/focus/mode", 0) e_db_flush(); } - } else { + } + else if (!strcmp(button, "follow_click")) + { + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) + { + E_DB_INT_SET(buf, "/focus/mode", 2) e_db_flush(); + } + } + else + { fprintf(stderr, "ERROR: Unknown Focus button clicked\n"); } @@ -43,44 +49,51 @@ static void focus_mouse_autoraise_window(GtkWidget * w, gpointer data) { - char buf[4096]; + char buf[4096]; - if(!w) + if (!w) return; snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) - E_DB_INT_SET(buf, "/window/raise/auto", 1) - else - E_DB_INT_SET(buf, "/window/raise/auto", 0) return; + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) + { + E_DB_INT_SET(buf, "/window/raise/auto", 1) e_db_flush(); + } + else + { + E_DB_INT_SET(buf, "/window/raise/auto", 0) e_db_flush(); + } + + return; UN(data); UN(w); } static void focus_autoraise_timeout_cb(GtkWidget * w, gpointer data) { - char buf[4096]; - float f = 0.000; + char buf[4096]; + float f = 0.000; - if(!w) + if (!w) return; f = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(w)); snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - E_DB_FLOAT_SET(buf, "/window/raise/delay", f) return; - UN(data); + E_DB_FLOAT_SET(buf, "/window/raise/delay", f) e_db_flush(); + return; + UN(data); } static void focus_guides_location_change_cb(GtkWidget * w, gpointer data) { - char buf[4096]; - float _f = 0.000, f = 0.000; - float scale = 100.00; - char *wname; + char buf[4096]; + float _f = 0.000, f = 0.000; + float scale = 100.00; + char *wname; - if(!w) + if (!w) return; wname = gtk_widget_get_name(GTK_WIDGET(w)); @@ -88,12 +101,19 @@ _f = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(w)); f = (_f / scale); snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); - if(!strcmp(wname, "horiz_guide")) { - E_DB_FLOAT_SET(buf, "/guides/display/x", f)} - else if(!strcmp(wname, "vert_guide")) { - E_DB_FLOAT_SET(buf, "/guides/display/y", f)} else { + if (!strcmp(wname, "horiz_guide")) + { + E_DB_FLOAT_SET(buf, "/guides/display/x", f) e_db_flush(); + } + else if (!strcmp(wname, "vert_guide")) + { + E_DB_FLOAT_SET(buf, "/guides/display/y", f) e_db_flush(); + } + else + { fprintf(stderr, "ERROR: Unknown Guide Spinbox\n%s\n", wname); } + return; } @@ -107,22 +127,22 @@ add_focus_notebook(GtkWidget * w, GtkWidget * note, int sheet) { - GtkWidget *tab_label, *scale_label; - GtkWidget *vbox; - GtkWidget *frame, *frame2; - GtkWidget *table, *table2; - GtkWidget *follow_pointer; - GtkWidget *follow_clicks; - GtkWidget *autoraise; - GtkObject *raise_adj; - GtkWidget *raise_gauge; - GtkWidget *hsep, *hsep2; - GtkObject *guide_x_adj, *guide_y_adj; - GtkWidget *guide_x, *guide_y, *guide_x_label, *guide_y_label; - - char buf[4096]; - int current_val = 0, ok = 0; - float flot = 0.00, _flot = 0.00; + GtkWidget *tab_label, *scale_label; + GtkWidget *vbox; + GtkWidget *frame, *frame2; + GtkWidget *table, *table2; + GtkWidget *follow_pointer; + GtkWidget *follow_clicks; + GtkWidget *autoraise; + GtkObject *raise_adj; + GtkWidget *raise_gauge; + GtkWidget *hsep, *hsep2; + GtkObject *guide_x_adj, *guide_y_adj; + GtkWidget *guide_x, *guide_y, *guide_x_label, *guide_y_label; + + char buf[4096]; + int current_val = 0, ok = 0; + float flot = 0.00, _flot = 0.00; snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME")); @@ -141,77 +161,79 @@ gtk_container_add(GTK_CONTAINER(frame), table); follow_pointer = - gtk_radio_button_new_with_label(NULL, "Mouse Focus Follows Pointer"); + gtk_radio_button_new_with_label(NULL, "Focus Follows Pointer"); gtk_widget_set_name(GTK_WIDGET(follow_pointer), "follow_pointer"); gtk_signal_connect(GTK_OBJECT(follow_pointer), "toggled", - GTK_SIGNAL_FUNC(focus_mouse_focus_type_cb), NULL); - gtk_table_attach(GTK_TABLE(table), follow_pointer, 0, 1, 0, 1, GTK_FILL, - 0, 2, 2); + GTK_SIGNAL_FUNC(focus_mouse_focus_type_cb), NULL); + gtk_table_attach(GTK_TABLE(table), follow_pointer, 0, 1, 0, 1, GTK_FILL, 0, + 2, 2); follow_clicks = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON - (follow_pointer), - "Mouse Focus Follows Mouse Clicks"); + (follow_pointer), + "Focus Follows Mouse Clicks"); gtk_widget_set_name(GTK_WIDGET(follow_clicks), "follow_click"); gtk_signal_connect(GTK_OBJECT(follow_clicks), "toggled", - GTK_SIGNAL_FUNC(focus_mouse_focus_type_cb), NULL); - gtk_table_attach(GTK_TABLE(table), follow_clicks, 0, 1, 1, 2, GTK_FILL, - 0, 2, 2); - - E_DB_INT_GET(buf, "/focus/mode", current_val, ok) if(ok) { - switch (current_val) { - case 0: - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(follow_pointer), - TRUE); - break; - case 2: - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(follow_clicks), - TRUE); - break; - default: - fprintf(stderr, "I don't know focus mode %d yet\n", current_val); + GTK_SIGNAL_FUNC(focus_mouse_focus_type_cb), NULL); + gtk_table_attach(GTK_TABLE(table), follow_clicks, 0, 1, 1, 2, GTK_FILL, 0, + 2, 2); + + E_DB_INT_GET(buf, "/focus/mode", current_val, ok) if (ok) + { + switch (current_val) + { + case 0: + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(follow_pointer), + TRUE); + break; + case 2: + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(follow_clicks), + TRUE); + break; + default: + fprintf(stderr, "I don't know focus mode %d yet\n", current_val); } } hsep = gtk_hseparator_new(); - gtk_table_attach(GTK_TABLE(table), hsep, 0, 2, 2, 3, GTK_FILL | - GTK_EXPAND, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table), hsep, 0, 2, 2, 3, GTK_FILL | GTK_EXPAND, + 0, 2, 2); - /* */ + /* */ autoraise = gtk_check_button_new_with_label ("Autoraise window on mouse focus switch"); gtk_table_attach(GTK_TABLE(table), autoraise, 0, 1, 3, 4, GTK_FILL, 0, 2, - 2); - E_DB_INT_GET(buf, "/window/raise/auto", current_val, ok) - gtk_signal_connect(GTK_OBJECT(autoraise), "toggled", - GTK_SIGNAL_FUNC(focus_mouse_autoraise_window), - NULL); - if(current_val) + 2); + E_DB_INT_GET(buf, "/window/raise/auto", current_val, + ok) gtk_signal_connect(GTK_OBJECT(autoraise), "toggled", + GTK_SIGNAL_FUNC + (focus_mouse_autoraise_window), NULL); + if (current_val) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(autoraise), TRUE); - /* */ + /* */ scale_label = gtk_label_new("Delay in Seconds"); gtk_label_set_justify(GTK_LABEL(scale_label), GTK_JUSTIFY_LEFT); gtk_table_attach(GTK_TABLE(table), scale_label, 0, 1, 4, 5, 0, 0, 2, 2); /* */ - E_DB_FLOAT_GET(buf, "/window/raise/delay", flot, ok) if(ok) + E_DB_FLOAT_GET(buf, "/window/raise/delay", flot, ok) if (ok) raise_adj = gtk_adjustment_new(flot, 0.00, 5.00, 0.02, 1.0, 0); else raise_adj = gtk_adjustment_new(0.00, 0.00, 5.00, 0.02, 1.0, 0); raise_gauge = gtk_spin_button_new(GTK_ADJUSTMENT(raise_adj), 0.05, 3); - gtk_table_attach(GTK_TABLE(table), raise_gauge, 0, 1, 5, 6, GTK_FILL, 0, - 2, 2); + gtk_table_attach(GTK_TABLE(table), raise_gauge, 0, 1, 5, 6, GTK_FILL, 0, 2, + 2); gtk_signal_connect(GTK_OBJECT(raise_gauge), "changed", - GTK_SIGNAL_FUNC(focus_autoraise_timeout_cb), NULL); + GTK_SIGNAL_FUNC(focus_autoraise_timeout_cb), NULL); /* */ hsep2 = gtk_hseparator_new(); - gtk_table_attach(GTK_TABLE(table), hsep2, 0, 2, 6, 7, GTK_FILL | - GTK_EXPAND, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table), hsep2, 0, 2, 6, 7, GTK_FILL | GTK_EXPAND, + 0, 2, 2); /* End Mouse Focus */ /* Start Guide frame */ @@ -223,45 +245,40 @@ gtk_container_add(GTK_CONTAINER(frame2), table2); /* Guides_x */ - guide_x_label = gtk_label_new("Horizontal Positioning (0 left most, " - "100 right most) "); - gtk_table_attach(GTK_TABLE(table2), guide_x_label, 0, 1, 0, 1, GTK_FILL, - 0, 2, 2); - E_DB_FLOAT_GET(buf, "/guides/display/x", _flot, ok) flot = - (_flot * 100.00); - if(ok) + guide_x_label = + gtk_label_new("Horizontal Positioning (0 left most, " + "100 right most) "); + gtk_table_attach(GTK_TABLE(table2), guide_x_label, 0, 1, 0, 1, GTK_FILL, 0, + 2, 2); + E_DB_FLOAT_GET(buf, "/guides/display/x", _flot, ok) flot = (_flot * 100.00); + if (ok) guide_x_adj = gtk_adjustment_new(flot, 0.00, 100.00, 0.5, 3.0, 0); else guide_x_adj = gtk_adjustment_new(50.0, 0.00, 100.00, 0.5, 3.0, 0); guide_x = gtk_spin_button_new(GTK_ADJUSTMENT(guide_x_adj), 0.50, 2); gtk_widget_set_name(GTK_WIDGET(guide_x), "horiz_guide"); - gtk_table_attach(GTK_TABLE(table2), guide_x, 0, 1, 1, 2, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table2), guide_x, 0, 1, 1, 2, GTK_FILL, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(guide_x), "changed", - GTK_SIGNAL_FUNC(focus_guides_location_change_cb), - NULL); + GTK_SIGNAL_FUNC(focus_guides_location_change_cb), NULL); /* Guides_y */ - guide_y_label = gtk_label_new("Vertical Positioning (0 top most, " - "100 bottom most) "); - gtk_table_attach(GTK_TABLE(table2), guide_y_label, 1, 2, 0, 1, GTK_FILL, - 0, 2, 2); + guide_y_label = + gtk_label_new("Vertical Positioning (0 top most, " "100 bottom most) "); + gtk_table_attach(GTK_TABLE(table2), guide_y_label, 1, 2, 0, 1, GTK_FILL, 0, + 2, 2); _flot = 0.00; - E_DB_FLOAT_GET(buf, "/guides/display/y", _flot, ok) flot = - (_flot * 100.00); - if(ok) + E_DB_FLOAT_GET(buf, "/guides/display/y", _flot, ok) flot = (_flot * 100.00); + if (ok) guide_y_adj = gtk_adjustment_new(flot, 0.00, 100.00, 0.5, 3.0, 0); else guide_y_adj = gtk_adjustment_new(50.0, 0.00, 100.00, 0.5, 3.0, 0); guide_y = gtk_spin_button_new(GTK_ADJUSTMENT(guide_y_adj), 0.05, 2); gtk_widget_set_name(GTK_WIDGET(guide_y), "vert_guide"); - gtk_table_attach(GTK_TABLE(table2), guide_y, 1, 2, 1, 2, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table2), guide_y, 1, 2, 1, 2, GTK_FILL, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(guide_y), "changed", - GTK_SIGNAL_FUNC(focus_guides_location_change_cb), - NULL); + GTK_SIGNAL_FUNC(focus_guides_location_change_cb), NULL); /* End Guide Frame */ /* Show those widgets */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/interface.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- interface.c 2001/10/20 18:06:19 1.2 +++ interface.c 2001/11/03 16:54:04 1.3 @@ -11,7 +11,7 @@ /* app_exit: * Signal can be attached to widgets to quit the gtk display */ -static gint +static gint app_exit(GtkWidget * w, gpointer data) { gtk_main_quit(); @@ -19,39 +19,40 @@ UN(w); UN(data); } + /* create_main_ebindings_window * returns a pointer to the GtkWidget that is the created. Creates a menu * and a notebook. functions to add features to the notebook can be added * at the bottom. NOTHING else needs to go in here but notebook page * addition function calls */ -GtkWidget * +GtkWidget * create_main_ebindings_window(void) { - GtkWidget *win; - GtkWidget *vbox; - GtkWidget *notebook; - GtkWidget *menu_bar; - GtkWidget *menu1; - GtkWidget *f_menu; - GtkWidget *menu_quit; - GtkWidget *status; + GtkWidget *win; + GtkWidget *vbox; + GtkWidget *notebook; + GtkWidget *menu_bar; + GtkWidget *menu1; + GtkWidget *f_menu; + GtkWidget *menu_quit; + GtkWidget *status; win = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(win), "Ebindings"); gtk_window_set_wmclass(GTK_WINDOW(win), "Ebindings", "Main"); gtk_widget_set_usize(GTK_WIDGET(win), 600, 300); gtk_signal_connect(GTK_OBJECT(win), "delete_event", - GTK_SIGNAL_FUNC(app_exit), NULL); + GTK_SIGNAL_FUNC(app_exit), NULL); gtk_widget_ref(win); gtk_object_set_data_full(GTK_OBJECT(win), "win", win, - (GtkDestroyNotify) gtk_widget_unref); + (GtkDestroyNotify) gtk_widget_unref); vbox = gtk_vbox_new(FALSE, 1); notebook = gtk_notebook_new(); gtk_object_set_data_full(GTK_OBJECT(win), "ebindings_notebook", notebook, - (GtkDestroyNotify) gtk_widget_unref); + (GtkDestroyNotify) gtk_widget_unref); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_LEFT); /* setup the status bar too */ @@ -72,7 +73,7 @@ menu_quit = gtk_menu_item_new_with_label("Quit"); gtk_menu_append(GTK_MENU(menu1), menu_quit); gtk_signal_connect(GTK_OBJECT(menu_quit), "activate", - GTK_SIGNAL_FUNC(app_exit), NULL); + GTK_SIGNAL_FUNC(app_exit), NULL); gtk_widget_show(menu_quit); /* done with boring menus blah blah */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/keybind_interface.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- keybind_interface.c 2001/10/20 18:06:19 1.2 +++ keybind_interface.c 2001/11/03 16:54:04 1.3 @@ -10,27 +10,23 @@ static struct { - GtkWidget *o, *p, *k, *a, *list; - /* o = option menu - * p = parameter entry - * k = key entry - * a = action used - */ - int count, current_row; + GtkWidget *o, *p, *k, *a, *list; + /* o = option menu p = parameter entry k = key entry a = action used */ + int count, current_row; } k_entry; -static void keybind_option_menu_modified(GtkWidget *, gpointer); -static void keybind_clist_row_select(GtkWidget *, gint, gint, - GdkEventButton *, gpointer); -static void keybind_parameter_entry_changed(GtkWidget *, gpointer); -static void keybind_capture_key_cb(GtkWidget *, gpointer); -static void keybind_save_button_clicked(GtkWidget *, gpointer); -static void keybind_add_button_clicked(GtkWidget *, gpointer); -static void keybind_del_button_clicked(GtkWidget *, gpointer); +static void keybind_option_menu_modified(GtkWidget *, gpointer); +static void keybind_clist_row_select(GtkWidget *, gint, gint, GdkEventButton *, + gpointer); +static void keybind_parameter_entry_changed(GtkWidget *, gpointer); +static void keybind_capture_key_cb(GtkWidget *, gpointer); +static void keybind_save_button_clicked(GtkWidget *, gpointer); +static void keybind_add_button_clicked(GtkWidget *, gpointer); +static void keybind_del_button_clicked(GtkWidget *, gpointer); /* stuff */ -gchar *mod_str[] = { +gchar *mod_str[] = { "NONE", "SHIFT", "CTRL", @@ -51,7 +47,7 @@ }; /* options based on enum _ev_modifiers in Ecore.h */ -gchar *action_str[] = { +gchar *action_str[] = { "Execute", "Window_Move", "Window_Resize", @@ -81,29 +77,29 @@ void add_keybinds_notebook(GtkWidget * w, GtkWidget * note, int sheet) { - GtkWidget *tab_label; - GtkWidget *hpaned; - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *clist, *clist2; - GtkWidget *scroller, *scroller1; - GtkWidget *frame; - GtkWidget *table; - int i; - eaction_item *e; - - GtkWidget *newb, *delb, *saveb, *changeb; - GtkWidget *keyl, *modl, *paraml; - GtkWidget *e_key, *e_param; - GtkWidget *o_menu, *menu, *option; + GtkWidget *tab_label; + GtkWidget *hpaned; + GtkWidget *hbox; + GtkWidget *vbox; + GtkWidget *clist, *clist2; + GtkWidget *scroller, *scroller1; + GtkWidget *frame; + GtkWidget *table; + int i; + eaction_item *e; + + GtkWidget *newb, *delb, *saveb, *changeb; + GtkWidget *keyl, *modl, *paraml; + GtkWidget *e_key, *e_param; + GtkWidget *o_menu, *menu, *option; - gchar *fields[] = { + gchar *fields[] = { "Modifier", "Key Used", "Action to Perform", "Parameters" }; - gchar *action_title[] = { + gchar *action_title[] = { "Actions Used" }; - gchar *key_fields[4]; + gchar *key_fields[4]; tab_label = gtk_label_new("Keys"); @@ -112,8 +108,7 @@ scroller1 = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller1), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); clist = gtk_clist_new_with_titles(4, fields); gtk_widget_ref(clist); @@ -123,7 +118,7 @@ gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 1, TRUE); gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 2, TRUE); gtk_signal_connect(GTK_OBJECT(clist), "select-row", - GTK_SIGNAL_FUNC(keybind_clist_row_select), NULL); + GTK_SIGNAL_FUNC(keybind_clist_row_select), NULL); gtk_container_add(GTK_CONTAINER(scroller1), clist); gtk_paned_pack1(GTK_PANED(hpaned), scroller1, TRUE, FALSE); @@ -145,27 +140,26 @@ gtk_entry_set_editable(GTK_ENTRY(e_key), FALSE); changeb = gtk_button_new_with_label("Change"); - gtk_table_attach(GTK_TABLE(table), changeb, 2, 3, 0, 1, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), changeb, 2, 3, 0, 1, GTK_FILL, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(changeb), "clicked", - GTK_SIGNAL_FUNC(keybind_capture_key_cb), clist); + GTK_SIGNAL_FUNC(keybind_capture_key_cb), clist); /* Row 2 */ modl = gtk_label_new("Modifiers"); gtk_table_attach(GTK_TABLE(table), modl, 0, 1, 1, 2, GTK_FILL, 0, 2, 2); o_menu = gtk_option_menu_new(); - gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 1, 2, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), o_menu, 1, 3, 1, 2, GTK_FILL, 0, 2, 2); menu = gtk_menu_new(); - for(i = 0; i < MOD_STR_MAX; i++) { + for (i = 0; i < MOD_STR_MAX; i++) + { option = gtk_menu_item_new_with_label(mod_str[i]); gtk_widget_show(option); gtk_signal_connect(GTK_OBJECT(option), "activate", - GTK_SIGNAL_FUNC(keybind_option_menu_modified), - (gpointer) i); + GTK_SIGNAL_FUNC(keybind_option_menu_modified), + (gpointer) i); gtk_menu_append(GTK_MENU(menu), option); } gtk_option_menu_set_menu(GTK_OPTION_MENU(o_menu), menu); @@ -173,36 +167,33 @@ /* Row 3 */ paraml = gtk_label_new("Parameters: "); - gtk_table_attach(GTK_TABLE(table), paraml, 0, 1, 2, 3, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), paraml, 0, 1, 2, 3, GTK_FILL, 0, 2, 2); e_param = gtk_entry_new(); - gtk_table_attach(GTK_TABLE(table), e_param, 1, 3, 2, 3, GTK_FILL, 0, 2, - 2); + gtk_table_attach(GTK_TABLE(table), e_param, 1, 3, 2, 3, GTK_FILL, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(e_param), "changed", - GTK_SIGNAL_FUNC(keybind_parameter_entry_changed), - clist); + GTK_SIGNAL_FUNC(keybind_parameter_entry_changed), clist); /* Row 4 */ scroller = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); clist2 = gtk_clist_new_with_titles(1, action_title); gtk_widget_ref(clist2); gtk_widget_set_name(clist2, "action_clist"); gtk_signal_connect(GTK_OBJECT(clist2), "select-row", - GTK_SIGNAL_FUNC(keybind_clist_row_select), NULL); + GTK_SIGNAL_FUNC(keybind_clist_row_select), NULL); - for(i = 0; i < ACTION_STR_MAX; i++) { + for (i = 0; i < ACTION_STR_MAX; i++) + { action_title[0] = g_strdup(action_str[i]); gtk_clist_append(GTK_CLIST(clist2), action_title); g_free(action_title[0]); } gtk_container_add(GTK_CONTAINER(scroller), clist2); gtk_table_attach(GTK_TABLE(table), scroller, 0, 3, 3, 4, GTK_FILL, - GTK_FILL | GTK_EXPAND, 2, 2); + GTK_FILL | GTK_EXPAND, 2, 2); /* add table to the frame */ gtk_container_add(GTK_CONTAINER(frame), table); @@ -223,7 +214,7 @@ gtk_widget_ref(newb); gtk_widget_set_name(newb, "new_keybind_button"); gtk_signal_connect(GTK_OBJECT(newb), "clicked", - GTK_SIGNAL_FUNC(keybind_add_button_clicked), clist); + GTK_SIGNAL_FUNC(keybind_add_button_clicked), clist); gtk_box_pack_start(GTK_BOX(hbox), newb, TRUE, TRUE, 2); @@ -231,19 +222,18 @@ gtk_widget_ref(delb); gtk_widget_set_name(delb, "del_keybind_button"); gtk_signal_connect(GTK_OBJECT(delb), "clicked", - GTK_SIGNAL_FUNC(keybind_del_button_clicked), clist); + GTK_SIGNAL_FUNC(keybind_del_button_clicked), clist); gtk_box_pack_start(GTK_BOX(hbox), delb, TRUE, TRUE, 2); saveb = gtk_button_new_with_label("Save Keybinds"); gtk_widget_ref(saveb); gtk_widget_set_name(saveb, "save_keybind_button"); gtk_signal_connect(GTK_OBJECT(saveb), "clicked", - GTK_SIGNAL_FUNC(keybind_save_button_clicked), clist); + GTK_SIGNAL_FUNC(keybind_save_button_clicked), clist); gtk_box_pack_start(GTK_BOX(hbox), saveb, TRUE, TRUE, 2); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - /* vbox is setup and added to the hbox, which is going to the right - * pane + /* vbox is setup and added to the hbox, which is going to the right pane */ gtk_paned_pack2(GTK_PANED(hpaned), vbox, FALSE, FALSE); @@ -282,7 +272,8 @@ parse_user_actions_db(); ewd_list_goto_first(action_container.keys); - while((e = (eaction_item *) ewd_list_next(action_container.keys))) { + while ((e = (eaction_item *) ewd_list_next(action_container.keys))) + { key_fields[0] = g_strdup(mod_str[e->modifiers]); key_fields[1] = g_strdup(e->key); key_fields[2] = g_strdup(e->action); @@ -295,8 +286,8 @@ FREE(key_fields[1]); FREE(key_fields[2]); FREE(key_fields[3]); - if(!e->name) - e->name = strdup("Key_Binding"); + if (!e->name) + e->name = strdup("Key_Binding"); /* this is needed later */ } gtk_clist_select_row(GTK_CLIST(clist), 0, 0); @@ -308,25 +299,25 @@ static void keybind_option_menu_modified(GtkWidget * w, gpointer data) { - int i; - gchar *new_mod = NULL; + int i; + gchar *new_mod = NULL; - if(!w) + if (!w) return; - i = (int)data; + i = (int) data; gtk_option_menu_set_history(GTK_OPTION_MENU(k_entry.o), i); new_mod = g_strdup(mod_str[i]); gtk_clist_set_text(GTK_CLIST(k_entry.list), k_entry.current_row, 0, - new_mod); + new_mod); } static void keybind_capture_key_cb(GtkWidget * w, gpointer data) { - GtkWidget *win, *label, *frame, *align; + GtkWidget *win, *label, *frame, *align; - if(data) + if (data) w = NULL; win = gtk_window_new(GTK_WINDOW_POPUP); @@ -336,32 +327,33 @@ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0); gtk_container_set_border_width(GTK_CONTAINER(align), 32); - label = gtk_label_new("Please press the key on the keyboard\n" - "you wish to modify this keyboard-shortcut\n" - "to use from now on."); + label = + gtk_label_new("Please press the key on the keyboard\n" + "you wish to modify this keyboard-shortcut\n" + "to use from now on."); gtk_container_add(GTK_CONTAINER(win), frame); gtk_container_add(GTK_CONTAINER(frame), align); gtk_container_add(GTK_CONTAINER(align), label); gtk_widget_show_all(win); - while(gtk_events_pending()) + while (gtk_events_pending()) gtk_main_iteration(); gdk_flush(); - while(gtk_events_pending()) + while (gtk_events_pending()) gtk_main_iteration(); { - char *key; - XEvent ev; + char *key; + XEvent ev; gdk_window_set_events(win->window, GDK_KEY_PRESS_MASK); XSetInputFocus(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), - RevertToPointerRoot, CurrentTime); + RevertToPointerRoot, CurrentTime); gdk_keyboard_grab(win->window, TRUE, CurrentTime); XWindowEvent(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(win->window), - KeyPressMask, &ev); + KeyPressMask, &ev); gdk_keyboard_ungrab(gdk_time_get()); - key = XKeysymToString(XKeycodeToKeysym(GDK_DISPLAY(), - ev.xkey.keycode, 0)); + key = + XKeysymToString(XKeycodeToKeysym(GDK_DISPLAY(), ev.xkey.keycode, 0)); gtk_entry_set_text(GTK_ENTRY(k_entry.k), key); gtk_clist_set_text(GTK_CLIST(data), k_entry.current_row, 1, key); } @@ -370,23 +362,25 @@ } static void keybind_clist_row_select(GtkWidget * w, gint row, gint column, - GdkEventButton * ev, gpointer data) + GdkEventButton * ev, gpointer data) { - gchar *lname = NULL; + gchar *lname = NULL; lname = gtk_widget_get_name(GTK_WIDGET(w)); - if(!strcmp(lname, "keybinds_clist")) { - gchar *temp, *temp_desc, *params; - int i; + if (!strcmp(lname, "keybinds_clist")) + { + gchar *temp, *temp_desc, *params; + int i; k_entry.current_row = row; /* keep track of which row is currently selected */ gtk_clist_get_text(GTK_CLIST(w), row, 0, &temp); gtk_option_menu_set_history(GTK_OPTION_MENU(k_entry.o), 0); - for(i = 1; i < 16; i++) { - if(!strcmp(mod_str[i], temp)) - gtk_option_menu_set_history(GTK_OPTION_MENU(k_entry.o), i); + for (i = 1; i < 16; i++) + { + if (!strcmp(mod_str[i], temp)) + gtk_option_menu_set_history(GTK_OPTION_MENU(k_entry.o), i); } /* setup the drop down menu first */ @@ -395,38 +389,50 @@ /* setup the specified key */ gtk_clist_get_text(GTK_CLIST(w), row, 2, &temp); - if((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp))) { - gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); - gtk_clist_get_text(GTK_CLIST(w), row, 3, ¶ms); - temp_desc = g_strdup(params); - gtk_entry_set_text(GTK_ENTRY(k_entry.p), temp_desc); - } else { - gtk_entry_set_editable(GTK_ENTRY(k_entry.p), FALSE); - gtk_entry_set_text(GTK_ENTRY(k_entry.p), ""); + if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp))) + { + gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); + gtk_clist_get_text(GTK_CLIST(w), row, 3, ¶ms); + temp_desc = g_strdup(params); + gtk_entry_set_text(GTK_ENTRY(k_entry.p), temp_desc); + } + else + { + gtk_entry_set_editable(GTK_ENTRY(k_entry.p), FALSE); + gtk_entry_set_text(GTK_ENTRY(k_entry.p), ""); } - for(i = 0; i < 22; i++) { - if(!strcmp(action_str[i], temp)) { - gtk_clist_select_row(GTK_CLIST(k_entry.a), i, 0); - break; - } + for (i = 0; i < 22; i++) + { + if (!strcmp(action_str[i], temp)) + { + gtk_clist_select_row(GTK_CLIST(k_entry.a), i, 0); + break; + } } /* then setup the parameters when needed */ - } else if(!strcmp(lname, "action_clist")) { - gchar *temp, *change_temp; + } + else if (!strcmp(lname, "action_clist")) + { + gchar *temp, *change_temp; gtk_clist_get_text(GTK_CLIST(w), row, 0, &temp); - if((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp))) { - gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); - } else { - gtk_entry_set_editable(GTK_ENTRY(k_entry.p), FALSE); - gtk_entry_set_text(GTK_ENTRY(k_entry.p), ""); + if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp))) + { + gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); + } + else + { + gtk_entry_set_editable(GTK_ENTRY(k_entry.p), FALSE); + gtk_entry_set_text(GTK_ENTRY(k_entry.p), ""); } change_temp = g_strdup(temp); gtk_clist_set_text(GTK_CLIST(k_entry.list), k_entry.current_row, 2, - change_temp); - } else { + change_temp); + } + else + { fprintf(stderr, "Unknown list selected\n"); } return; @@ -438,60 +444,65 @@ static void keybind_save_button_clicked(GtkWidget * w, gpointer data) { - int i, j, written; - eaction_item *e; - gchar *tmp; + int i, j, written; + eaction_item *e; + gchar *tmp; action_container_keys_reinit(); /* clear out the old keys list so we can repopulate it, non key actions - * are never touched - */ - for(i = 0; i < k_entry.count; i++) { + are never touched */ + for (i = 0; i < k_entry.count; i++) + { e = eaction_item_new(); e->name = strdup("Key_Binding"); tmp = NULL; gtk_clist_get_text(GTK_CLIST(k_entry.list), i, 2, &tmp); - if(!tmp) { - eaction_item_free(e); - printf("Act... [truncated message content] |
From: <enl...@li...> - 2001-11-04 21:39:35
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: util.c Log Message: don't set string keys of length 0 =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/util.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- util.c 2001/11/03 16:54:04 1.3 +++ util.c 2001/11/04 21:39:34 1.4 @@ -262,7 +262,7 @@ e_db_str_set(db, buf, e->exec); sprintf(buf, "/menu/%i/%i/text", menu_level, i); e_db_str_set(db, buf, e->text); - if (e->icon) + if (e->icon && (strlen(e->icon) > 0)) { sprintf(buf, "/menu/%i/%i/icon", menu_level, i); e_db_str_set(db, buf, e->icon); @@ -276,7 +276,7 @@ sprintf(buf, "/menu/%i/%i/submenu", menu_level, i); e_db_int_set(db, buf, ++menu_count); - if (e->icon) + if (e->icon && (strlen(e->icon) > 0)) { sprintf(buf, "/menu/%i/%i/icon", menu_level, i); e_db_str_set(db, buf, e->icon); @@ -293,7 +293,7 @@ e_db_str_set(db, buf, e->exec); sprintf(buf, "/menu/%i/%i/text", menu_level, i); e_db_str_set(db, buf, e->text); - if (e->icon) + if (e->icon && (strlen(e->icon) > 0)) { sprintf(buf, "/menu/%i/%i/icon", menu_level, i); e_db_str_set(db, buf, e->icon); |
From: <enl...@li...> - 2002-02-09 18:01:09
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: keybind_interface.c menu_interface.c action_extra.c Log Message: Patch from Alan Schmitt to do desktop relative. Fixed a misspelling in the menu interface =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/keybind_interface.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- keybind_interface.c 3 Nov 2001 16:54:04 -0000 1.3 +++ keybind_interface.c 9 Feb 2002 18:01:08 -0000 1.4 @@ -69,8 +69,9 @@ "Window_Snap", "Window_Zoom", "Desktop", + "Desktop_Relative", "Window_Next" - /* count is 22 currently */ + /* count is 23 currently */ /* based on options in e_action_init in actions.c in e17/e/src */ }; @@ -389,7 +390,7 @@ /* setup the specified key */ gtk_clist_get_text(GTK_CLIST(w), row, 2, &temp); - if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp))) + if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp)) || (!strcmp("Desktop_Relative",temp))) { gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); gtk_clist_get_text(GTK_CLIST(w), row, 3, ¶ms); @@ -417,7 +418,7 @@ gtk_clist_get_text(GTK_CLIST(w), row, 0, &temp); - if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp))) + if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp)) || (!strcmp("Desktop_Relative",temp))) { gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); } @@ -470,7 +471,7 @@ tmp = NULL; gtk_clist_get_text(GTK_CLIST(k_entry.list), i, 3, &tmp); - if ((!strcmp("Execute", e->action)) || (!strcmp("Desktop", e->action))) + if ((!strcmp("Execute", e->action)) || (!strcmp("Desktop", e->action)) || (!strcmp("Desktop_Relative", e->action))) { if (tmp) e->params = strdup(tmp); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/menu_interface.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- menu_interface.c 3 Nov 2001 16:54:04 -0000 1.4 +++ menu_interface.c 9 Feb 2002 18:01:08 -0000 1.5 @@ -816,7 +816,7 @@ case E_MENU_SEPARATOR: fields[3] = g_strdup("Separator"); g_free(fields[0]); - fields[0] = g_strdup("-(SEPERATOR)-"); + fields[0] = g_strdup("-(SEPARATOR)-"); break; case E_MENU_EXECUTABLE: fields[3] = g_strdup("Executable"); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/action_extra.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- action_extra.c 3 Nov 2001 16:54:03 -0000 1.3 +++ action_extra.c 9 Feb 2002 18:01:08 -0000 1.4 @@ -79,8 +79,9 @@ "Window_Snap", "Window_Zoom", "Desktop", + "Desktop_Relative", "Window_Next", - /* count is 19 currently */ + /* count is 20 currently */ /* based on options in e_action_init in actions.c in e17/e/src */ }; static gchar *ebits_hot_spots[] = { |
From: <enl...@li...> - 2002-02-09 18:40:38
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: keybind_interface.c Log Message: don't segfault if an action has no parameters from the db =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/keybind_interface.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- keybind_interface.c 9 Feb 2002 18:01:08 -0000 1.4 +++ keybind_interface.c 9 Feb 2002 18:40:37 -0000 1.5 @@ -278,7 +278,10 @@ key_fields[0] = g_strdup(mod_str[e->modifiers]); key_fields[1] = g_strdup(e->key); key_fields[2] = g_strdup(e->action); - key_fields[3] = g_strdup(e->params); + if(e->params) + key_fields[3] = g_strdup(e->params); + else + key_fields[3] = g_strdup(""); gtk_clist_append(GTK_CLIST(clist), key_fields); k_entry.count++; |
From: <enl...@li...> - 2002-04-28 20:52:34
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: Tag: SPLIT keybind_interface.c Log Message: small fix so you can use window next again =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/keybind_interface.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -3 -r1.5 -r1.5.2.1 --- keybind_interface.c 9 Feb 2002 18:40:37 -0000 1.5 +++ keybind_interface.c 28 Apr 2002 20:52:32 -0000 1.5.2.1 @@ -63,7 +63,6 @@ "Exit", "Restart", "Window_Stick", - "Sound", "Window_Iconify", "Window_Max_Size", "Window_Snap", @@ -405,7 +404,7 @@ gtk_entry_set_editable(GTK_ENTRY(k_entry.p), FALSE); gtk_entry_set_text(GTK_ENTRY(k_entry.p), ""); } - for (i = 0; i < 22; i++) + for (i = 0; i < ACTION_STR_MAX; i++) { if (!strcmp(action_str[i], temp)) { |
From: <enl...@li...> - 2002-04-28 20:58:37
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: keybind_interface.c Log Message: fixing this in HEAD too =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/keybind_interface.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- keybind_interface.c 9 Feb 2002 18:40:37 -0000 1.5 +++ keybind_interface.c 28 Apr 2002 20:58:35 -0000 1.6 @@ -63,7 +63,6 @@ "Exit", "Restart", "Window_Stick", - "Sound", "Window_Iconify", "Window_Max_Size", "Window_Snap", @@ -405,7 +404,7 @@ gtk_entry_set_editable(GTK_ENTRY(k_entry.p), FALSE); gtk_entry_set_text(GTK_ENTRY(k_entry.p), ""); } - for (i = 0; i < 22; i++) + for (i = 0; i < ACTION_STR_MAX; i++) { if (!strcmp(action_str[i], temp)) { |
From: <enl...@li...> - 2002-05-05 20:44:46
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings Modified Files: Tag: SPLIT configure.in Log Message: This doesn't need to link off of gdk-imlib =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/configure.in,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- configure.in 19 Oct 2001 20:53:02 -0000 1.3 +++ configure.in 5 May 2002 20:44:44 -0000 1.3.2.1 @@ -53,7 +53,7 @@ AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)) BONUS_INCS=" -I/usr/X11R6/include" -BONUS_LIBS="-L/usr/X11R6/lib -lgdk_imlib" +BONUS_LIBS="-L/usr/X11R6/lib" AC_SUBST(BONUS_INCS) AC_SUBST(BONUS_LIBS) |
From: <enl...@li...> - 2002-05-13 16:08:04
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings Modified Files: configure.in Log Message: No more -lgdk_imlib =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- configure.in 19 Oct 2001 20:53:02 -0000 1.3 +++ configure.in 13 May 2002 15:46:36 -0000 1.4 @@ -53,7 +53,7 @@ AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)) BONUS_INCS=" -I/usr/X11R6/include" -BONUS_LIBS="-L/usr/X11R6/lib -lgdk_imlib" +BONUS_LIBS="-L/usr/X11R6/lib" AC_SUBST(BONUS_INCS) AC_SUBST(BONUS_LIBS) |
From: <enl...@li...> - 2002-09-21 19:45:25
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings Modified Files: Tag: SPLIT configure.in Log Message: update ebindings to not require ewd anymore. i figure if you want to compile ebindings you have e installed, which means you have evas2, so it's just easier using evas lists instead of ewd lists. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/configure.in,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -3 -r1.3.2.1 -r1.3.2.2 --- configure.in 5 May 2002 20:44:44 -0000 1.3.2.1 +++ configure.in 21 Sep 2002 19:44:54 -0000 1.3.2.2 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(src/main.c) -AM_INIT_AUTOMAKE(ebindings, 0.1) +AM_INIT_AUTOMAKE(ebindings, 0.2) AM_CONFIG_HEADER(src/config.h) AC_PROG_CC @@ -21,8 +21,8 @@ fi changequote([,]) -AC_ARG_WITH(ewd, - [ --with-ewd=DIR use ewd in <DIR>], +AC_ARG_WITH(evas, + [ --with-evas=DIR use evas in <DIR>], [ CFLAGS="$CFLAGS -I$withval/include" LIBS="-L$withval/lib $LIBS"]) AC_ARG_WITH(edb, @@ -30,14 +30,14 @@ [ CFLAGS="$CFLAGS -I$withval/include" LIBS="-L$withval/lib $LIBS"]) -AC_PATH_GENERIC(ewd, 0.0.1, [ - AC_SUBST(ewd_libs) - AC_SUBST(ewd_cflags) ], - AC_MSG_ERROR(Cannot find ewd: Is ewd-config in path?)) -ewd_libs=`ewd-config --libs` -ewd_cflags=`ewd-config --cflags` -AC_SUBST(ewd_libs) -AC_SUBST(ewd_cflags) +AC_PATH_GENERIC(evas, 1.0.0, [ + AC_SUBST(evas_libs) + AC_SUBST(evas_cflags) ], + AC_MSG_ERROR(Cannot find evas: Is evas-config in path?)) +evas_libs=`evas-config --libs` +evas_cflags=`evas-config --cflags` +AC_SUBST(evas_libs) +AC_SUBST(evas_cflags) AC_PATH_GENERIC(edb, 1.0.3, [ |
From: <enl...@li...> - 2002-09-21 19:45:26
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: Tag: SPLIT Makefile.am action_extra.c callbacks.c eaction_item.c eaction_item.h ebindings.h emenu_item.c emenu_item.h focus_interface.c keybind_interface.c menu_interface.c util.c util.h Log Message: update ebindings to not require ewd anymore. i figure if you want to compile ebindings you have e installed, which means you have evas2, so it's just easier using evas lists instead of ewd lists. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/Makefile.am,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- Makefile.am 19 Oct 2001 21:00:37 -0000 1.3 +++ Makefile.am 21 Sep 2002 19:44:54 -0000 1.3.2.1 @@ -3,7 +3,7 @@ INCLUDES = \ @BONUS_INCS@ \ @GTK_CFLAGS@ \ - @ewd_cflags@ \ + @evas_cflags@ \ @edb_cflags@ bin_PROGRAMS = ebindings @@ -15,7 +15,6 @@ menu_interface.c menu_interface.h \ keybind_interface.c keybind_interface.h \ focus_interface.c focus_interface.h \ - action_extra.c action_extra.h \ callbacks.c callbacks.h \ interface.c interface.h \ main.c @@ -23,5 +22,5 @@ ebindings_LDADD = \ @BONUS_LIBS@ \ @GTK_LIBS@ \ - @ewd_libs@ \ + @evas_libs@ \ @edb_libs@ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/action_extra.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -3 -r1.4 -r1.4.2.1 --- action_extra.c 9 Feb 2002 18:01:08 -0000 1.4 +++ action_extra.c 21 Sep 2002 19:44:54 -0000 1.4.2.1 @@ -244,7 +244,8 @@ /* Row 3 */ action_l = gtk_label_new("Action Request: "); - gtk_table_attach(GTK_TABLE(table), action_l, 0, 1, 2, 3, GTK_FILL, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table), action_l, 0, 1, 2, 3, GTK_FILL, 0, 2, + 2); o_menu = gtk_option_menu_new(); gtk_widget_ref(o_menu); @@ -271,14 +272,17 @@ /* Row 4 */ button_l = gtk_label_new("Button Pressed: "); - gtk_table_attach(GTK_TABLE(table), button_l, 0, 1, 3, 4, GTK_FILL, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table), button_l, 0, 1, 3, 4, GTK_FILL, 0, 2, + 2); button_e = gtk_entry_new(); gtk_entry_set_editable(GTK_ENTRY(button_e), FALSE); - gtk_table_attach(GTK_TABLE(table), button_e, 1, 2, 3, 4, GTK_FILL, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table), button_e, 1, 2, 3, 4, GTK_FILL, 0, 2, + 2); button_b = gtk_button_new_with_label("Change"); - gtk_table_attach(GTK_TABLE(table), button_b, 2, 3, 3, 4, GTK_FILL, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table), button_b, 2, 3, 3, 4, GTK_FILL, 0, 2, + 2); gtk_signal_connect(GTK_OBJECT(button_b), "clicked", GTK_SIGNAL_FUNC(event_change_button_cb), clist); @@ -357,8 +361,7 @@ gtk_box_pack_start(GTK_BOX(hbox), saveb, TRUE, TRUE, 2); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - /* vbox is setup and added to the hbox, which is going to the right pane - */ + /* vbox is setup and added to the hbox, which is going to the right pane */ gtk_paned_pack2(GTK_PANED(hpaned), vbox, FALSE, FALSE); @@ -638,8 +641,8 @@ action_container_focus_reinit(); l = action_container.focus; - /* clear out the focus list, give it a local pointer val that's easier - to read */ + /* clear out the focus list, give it a local pointer val that's easier to + read */ for (i = 0; i < row_count; i++) { =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/callbacks.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- callbacks.c 3 Nov 2001 16:54:03 -0000 1.3 +++ callbacks.c 21 Sep 2002 19:44:54 -0000 1.3.2.1 @@ -24,7 +24,8 @@ status_bar_message(gchar * message, gint delay) { gtk_statusbar_push(GTK_STATUSBAR(ebindings_statusbar), 1, message); - gtk_timeout_add(delay, (GtkFunction) status_bar_clear, ebindings_statusbar); + gtk_timeout_add(delay, (GtkFunction) status_bar_clear, + ebindings_statusbar); return; UN(delay); UN(message); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/eaction_item.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- eaction_item.c 3 Nov 2001 16:54:04 -0000 1.3 +++ eaction_item.c 21 Sep 2002 19:44:55 -0000 1.3.2.1 @@ -13,9 +13,7 @@ eaction_item *result; result = (eaction_item *) malloc(sizeof(eaction_item)); - - result->name = result->action = result->params = result->key = NULL; - result->button = result->event = result->modifiers = 0; + memset(result, 0, sizeof(eaction_item)); return result; } @@ -43,32 +41,49 @@ void action_container_init(void) { - action_container.keys = ewd_list_new(); - action_container.focus = ewd_list_new(); - - ewd_list_set_free_cb(action_container.keys, _eaction_item_free); - ewd_list_set_free_cb(action_container.focus, _eaction_item_free); + action_container.keys = NULL; + action_container.focus = NULL; } void action_container_free(void) { - ewd_list_destroy(action_container.keys); - ewd_list_destroy(action_container.focus); + Evas_List *l; + + for (l = action_container.keys; l; l = l->next) + { + _eaction_item_free(l->data); + } + evas_list_free(action_container.keys); + for (l = action_container.focus; l; l = l->next) + { + _eaction_item_free(l->data); + } + evas_list_free(action_container.focus); } void action_container_keys_reinit(void) { - ewd_list_destroy(action_container.keys); - action_container.keys = ewd_list_new(); - ewd_list_set_free_cb(action_container.keys, _eaction_item_free); + Evas_List *l; + + for (l = action_container.keys; l; l = l->next) + { + _eaction_item_free(l->data); + } + evas_list_free(action_container.keys); + action_container.keys = NULL; } void action_container_focus_reinit(void) { - ewd_list_destroy(action_container.focus); - action_container.focus = ewd_list_new(); - ewd_list_set_free_cb(action_container.focus, _eaction_item_free); + Evas_List *l; + + for (l = action_container.focus; l; l = l->next) + { + _eaction_item_free(l->data); + } + evas_list_free(action_container.focus); + action_container.focus = NULL; } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/eaction_item.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- eaction_item.h 3 Nov 2001 16:54:04 -0000 1.3 +++ eaction_item.h 21 Sep 2002 19:44:55 -0000 1.3.2.1 @@ -8,12 +8,14 @@ * Contains: * - functions to modify the global action_container *- eaction_item modifier functions + * September 21, 2002 - Migrated away from Ewd Lists in favor of evas lists *************************************************************************/ #ifndef __E_ACTINOS_DB__ #define __E_ACTINOS_DB__ #include<Edb.h> -#include<Ewd.h> +#include<Evas.h> +#include"ebindings.h" /* data representation of what e17 needs to know for an action */ struct _eaction_item @@ -35,8 +37,8 @@ * contained at parse time so we can nuke it before we write */ struct { - Ewd_List *keys; - Ewd_List *focus; + Evas_List *keys; + Evas_List *focus; } action_container; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/ebindings.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -3 -r1.2 -r1.2.2.1 --- ebindings.h 20 Oct 2001 18:06:19 -0000 1.2 +++ ebindings.h 21 Sep 2002 19:44:55 -0000 1.2.2.1 @@ -7,13 +7,15 @@ #ifndef __EBINDINGS_H_ #define __EBINDINGS_H_ -#include <Ewd.h> -#include <gtk/gtk.h> +#include <Evas.h> +#include <stdio.h> +#include "config.h" #include <string.h> +#include <stdlib.h> +#include <gtk/gtk.h> #include "callbacks.h" -#include "config.h" #define UN(_ptr) _ptr = 0 #define MOD_STR_MAX 16 - +#define IF_FREE(_ptr) if(_ptr) free(_ptr) #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/emenu_item.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- emenu_item.c 3 Nov 2001 16:54:04 -0000 1.3 +++ emenu_item.c 21 Sep 2002 19:44:55 -0000 1.3.2.1 @@ -16,10 +16,7 @@ emenu_item *result; result = malloc(sizeof(emenu_item)); - result->text = result->icon = result->exec = NULL; - - result->children = ewd_list_new(); - ewd_list_set_free_cb(result->children, _emenu_item_free); + memset(result, 0, sizeof(emenu_item)); result->type = E_MENU_EXECUTABLE; @@ -37,14 +34,17 @@ void emenu_item_free(emenu_item * m) { + Evas_List *l; + if (!m) return; IF_FREE(m->exec); IF_FREE(m->icon); IF_FREE(m->text); - /* we get IF_FREE from Ewd Macros =) */ - ewd_list_destroy(m->children); + for (l = m->children; l; l = l->next) + emenu_item_free((emenu_item *) l->data); + free(m); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/emenu_item.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- emenu_item.h 3 Nov 2001 16:54:04 -0000 1.3 +++ emenu_item.h 21 Sep 2002 19:44:55 -0000 1.3.2.1 @@ -8,9 +8,9 @@ #ifndef __E_MENU_ITEM_ #define __E_MENU_ITEM_ -#include<Edb.h> -#include<Ewd.h> - +#include <Edb.h> +#include <Evas.h> +#include "ebindings.h" /* * enumerated type to represent the differnt types of menuitems that exist */ @@ -26,7 +26,7 @@ { char *text, *icon, *exec; enum _e_menu_type type; - Ewd_List *children; + Evas_List *children; /* submenus */ }; typedef struct __emenu_item emenu_item; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/focus_interface.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- focus_interface.c 3 Nov 2001 16:54:04 -0000 1.3 +++ focus_interface.c 21 Sep 2002 19:44:55 -0000 1.3.2.1 @@ -232,8 +232,8 @@ /* */ hsep2 = gtk_hseparator_new(); - gtk_table_attach(GTK_TABLE(table), hsep2, 0, 2, 6, 7, GTK_FILL | GTK_EXPAND, - 0, 2, 2); + gtk_table_attach(GTK_TABLE(table), hsep2, 0, 2, 6, 7, + GTK_FILL | GTK_EXPAND, 0, 2, 2); /* End Mouse Focus */ /* Start Guide frame */ @@ -250,7 +250,8 @@ "100 right most) "); gtk_table_attach(GTK_TABLE(table2), guide_x_label, 0, 1, 0, 1, GTK_FILL, 0, 2, 2); - E_DB_FLOAT_GET(buf, "/guides/display/x", _flot, ok) flot = (_flot * 100.00); + E_DB_FLOAT_GET(buf, "/guides/display/x", _flot, ok) flot = + (_flot * 100.00); if (ok) guide_x_adj = gtk_adjustment_new(flot, 0.00, 100.00, 0.5, 3.0, 0); else @@ -258,7 +259,8 @@ guide_x = gtk_spin_button_new(GTK_ADJUSTMENT(guide_x_adj), 0.50, 2); gtk_widget_set_name(GTK_WIDGET(guide_x), "horiz_guide"); - gtk_table_attach(GTK_TABLE(table2), guide_x, 0, 1, 1, 2, GTK_FILL, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table2), guide_x, 0, 1, 1, 2, GTK_FILL, 0, 2, + 2); gtk_signal_connect(GTK_OBJECT(guide_x), "changed", GTK_SIGNAL_FUNC(focus_guides_location_change_cb), NULL); @@ -269,14 +271,16 @@ 2, 2); _flot = 0.00; - E_DB_FLOAT_GET(buf, "/guides/display/y", _flot, ok) flot = (_flot * 100.00); + E_DB_FLOAT_GET(buf, "/guides/display/y", _flot, ok) flot = + (_flot * 100.00); if (ok) guide_y_adj = gtk_adjustment_new(flot, 0.00, 100.00, 0.5, 3.0, 0); else guide_y_adj = gtk_adjustment_new(50.0, 0.00, 100.00, 0.5, 3.0, 0); guide_y = gtk_spin_button_new(GTK_ADJUSTMENT(guide_y_adj), 0.05, 2); gtk_widget_set_name(GTK_WIDGET(guide_y), "vert_guide"); - gtk_table_attach(GTK_TABLE(table2), guide_y, 1, 2, 1, 2, GTK_FILL, 0, 2, 2); + gtk_table_attach(GTK_TABLE(table2), guide_y, 1, 2, 1, 2, GTK_FILL, 0, 2, + 2); gtk_signal_connect(GTK_OBJECT(guide_y), "changed", GTK_SIGNAL_FUNC(focus_guides_location_change_cb), NULL); /* End Guide Frame */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/keybind_interface.c,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -u -3 -r1.5.2.1 -r1.5.2.2 --- keybind_interface.c 28 Apr 2002 20:52:32 -0000 1.5.2.1 +++ keybind_interface.c 21 Sep 2002 19:44:55 -0000 1.5.2.2 @@ -17,8 +17,8 @@ k_entry; static void keybind_option_menu_modified(GtkWidget *, gpointer); -static void keybind_clist_row_select(GtkWidget *, gint, gint, GdkEventButton *, - gpointer); +static void keybind_clist_row_select(GtkWidget *, gint, gint, + GdkEventButton *, gpointer); static void keybind_parameter_entry_changed(GtkWidget *, gpointer); static void keybind_capture_key_cb(GtkWidget *, gpointer); static void keybind_save_button_clicked(GtkWidget *, gpointer); @@ -87,6 +87,7 @@ GtkWidget *table; int i; eaction_item *e; + Evas_List *l; GtkWidget *newb, *delb, *saveb, *changeb; GtkWidget *keyl, *modl, *paraml; @@ -173,7 +174,8 @@ gtk_table_attach(GTK_TABLE(table), e_param, 1, 3, 2, 3, GTK_FILL, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(e_param), "changed", - GTK_SIGNAL_FUNC(keybind_parameter_entry_changed), clist); + GTK_SIGNAL_FUNC(keybind_parameter_entry_changed), + clist); /* Row 4 */ scroller = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller), @@ -233,8 +235,7 @@ gtk_box_pack_start(GTK_BOX(hbox), saveb, TRUE, TRUE, 2); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - /* vbox is setup and added to the hbox, which is going to the right pane - */ + /* vbox is setup and added to the hbox, which is going to the right pane */ gtk_paned_pack2(GTK_PANED(hpaned), vbox, FALSE, FALSE); @@ -271,24 +272,26 @@ gtk_widget_show(tab_label); parse_user_actions_db(); - ewd_list_goto_first(action_container.keys); - while ((e = (eaction_item *) ewd_list_next(action_container.keys))) + + + for (l = action_container.keys; l; l = l->next) { + e = (eaction_item *) l->data; key_fields[0] = g_strdup(mod_str[e->modifiers]); key_fields[1] = g_strdup(e->key); key_fields[2] = g_strdup(e->action); - if(e->params) - key_fields[3] = g_strdup(e->params); + if (e->params) + key_fields[3] = g_strdup(e->params); else - key_fields[3] = g_strdup(""); + key_fields[3] = g_strdup(""); gtk_clist_append(GTK_CLIST(clist), key_fields); k_entry.count++; - FREE(key_fields[0]); - FREE(key_fields[1]); - FREE(key_fields[2]); - FREE(key_fields[3]); + IF_FREE(key_fields[0]); + IF_FREE(key_fields[1]); + IF_FREE(key_fields[2]); + IF_FREE(key_fields[3]); if (!e->name) e->name = strdup("Key_Binding"); /* this is needed later */ @@ -392,7 +395,8 @@ /* setup the specified key */ gtk_clist_get_text(GTK_CLIST(w), row, 2, &temp); - if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp)) || (!strcmp("Desktop_Relative",temp))) + if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp)) + || (!strcmp("Desktop_Relative", temp))) { gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); gtk_clist_get_text(GTK_CLIST(w), row, 3, ¶ms); @@ -420,7 +424,8 @@ gtk_clist_get_text(GTK_CLIST(w), row, 0, &temp); - if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp)) || (!strcmp("Desktop_Relative",temp))) + if ((!strcmp("Execute", temp)) || (!strcmp("Desktop", temp)) + || (!strcmp("Desktop_Relative", temp))) { gtk_entry_set_editable(GTK_ENTRY(k_entry.p), TRUE); } @@ -473,7 +478,8 @@ tmp = NULL; gtk_clist_get_text(GTK_CLIST(k_entry.list), i, 3, &tmp); - if ((!strcmp("Execute", e->action)) || (!strcmp("Desktop", e->action)) || (!strcmp("Desktop_Relative", e->action))) + if ((!strcmp("Execute", e->action)) || (!strcmp("Desktop", e->action)) + || (!strcmp("Desktop_Relative", e->action))) { if (tmp) e->params = strdup(tmp); @@ -501,7 +507,7 @@ e->event = 8; /* keybinds are event 8 */ - ewd_list_append(action_container.keys, (void *) e); + action_container.keys = evas_list_append(action_container.keys, e); } written = write_user_actions_db(); /* write the changes now =) */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/menu_interface.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -3 -r1.5 -r1.5.2.1 --- menu_interface.c 9 Feb 2002 18:01:08 -0000 1.5 +++ menu_interface.c 21 Sep 2002 19:44:55 -0000 1.5.2.1 @@ -25,10 +25,10 @@ /* callbacks for saving */ static void menu_ctree_dump_and_save(GtkWidget *); -static void gnode_to_menu_item_ewd_list(Ewd_List *, GNode *); +static Evas_List *gnode_to_menu_item_evas_list(Evas_List *, GNode *); static void write_emenu_from_ctree(GtkCTree *); -static void menu_ctree_recursive_check_for_submenus(GtkCTree *, GtkCTreeNode *, - gpointer); +static void menu_ctree_recursive_check_for_submenus(GtkCTree *, + GtkCTreeNode *, gpointer); /* menu ctree row callbacks */ static void menu_ctree_select_row_cb(GtkCTree *, GList *, gint, gpointer); @@ -255,8 +255,9 @@ "clicked", GTK_SIGNAL_FUNC(icon_selection_fs_cancel), (gpointer) fs); - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), "clicked", - GTK_SIGNAL_FUNC(icon_selection_fs_ok), (gpointer) fs); + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button), + "clicked", GTK_SIGNAL_FUNC(icon_selection_fs_ok), + (gpointer) fs); gtk_widget_show(fs); return; @@ -373,8 +374,8 @@ */ gchar *button_name = NULL; - /* button_name: the name of the button widget that is set when the - button is originally setup */ + /* button_name: the name of the button widget that is set when the button + is originally setup */ GtkCTreeNode *node = NULL, *node_data = NULL; if (!data) @@ -391,26 +392,26 @@ if (!strcmp(button_name, "exec_button")) { - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 3, - "Executable"); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 3, "Executable"); } else if (!strcmp(button_name, "script_button")) { - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 3, - "Script"); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 3, "Script"); } else if (!strcmp(button_name, "separator_button")) { - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 0, - "-(SEPARATOR)-"); - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 1, - ""); - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 2, - ""); - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 3, - "Separator"); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 0, "-(SEPARATOR)-"); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 1, ""); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 2, ""); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 3, "Separator"); } else { @@ -460,18 +461,18 @@ wname = gtk_widget_get_name(w); if (!strcmp(wname, "desc_entry")) { - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 0, - new_val); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 0, new_val); } else if (!strcmp(wname, "icon_entry")) { - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 1, - new_val); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 1, new_val); } else if (!strcmp(wname, "exec_entry")) { - gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), 2, - new_val); + gtk_ctree_node_set_text(GTK_CTREE(data), GTK_CTREE_NODE(node_data), + 2, new_val); } else { @@ -515,8 +516,8 @@ newp = gtk_ctree_node_nth(GTK_CTREE(w), 0); newnode = - gtk_ctree_insert_node(GTK_CTREE(w), newp, news, fields, 0, NULL, NULL, - NULL, NULL, FALSE, FALSE); + gtk_ctree_insert_node(GTK_CTREE(w), newp, news, fields, 0, NULL, + NULL, NULL, NULL, FALSE, FALSE); gtk_ctree_select(GTK_CTREE(w), newnode); for (i = 0; i < 4; i++) @@ -570,9 +571,7 @@ /* ctree_to_emenu_item_gnode: * When a save request is sent, the data must be dumped from the ctree to a - * GNode, and (currently) export the GNode to an Ewl_List. Writing - * straight from the GNode is completely possible, but I want to eventually - * move ebindings to ewl, and ewd has lots of nice things =) + * GNode, and (currently) export the GNode to an Evas_List. * description: Dumps data from a row in a ctree to ->data of a GNode * Function is never explicity called by us, gtk uses it. */ @@ -650,15 +649,15 @@ UN(data); } -/* gnode_to_menu_item_ewl_list: - * description: Takes a pointer to an already initialized ewd_list. - * Extracts the node pointer from the GNode, and populates the ewd list. +/* gnode_to_menu_item_evas_list: + * description: Extracts the node pointer from the GNode, and populates the + * evas list. * - * @param l: Ewd_List that has been created with ewd_list_new() + * @param l: Evas_List NULL is ok * @param node: GNode that is the result of a gtk_ctree_export_to_gnode */ -static void -gnode_to_menu_item_ewd_list(Ewd_List * l, GNode * node) +static Evas_List * +gnode_to_menu_item_evas_list(Evas_List * l, GNode * node) { emenu_item *e = NULL; GNode *ptr = NULL; @@ -666,10 +665,12 @@ for (ptr = node; ptr; ptr = ptr->next) { e = (emenu_item *) ptr->data; - ewd_list_append(l, e); + l = evas_list_append(l, e); if (ptr->children) - gnode_to_menu_item_ewd_list(e->children, ptr->children); + e->children = + gnode_to_menu_item_evas_list(e->children, ptr->children); } + return (l); } /* write_emenu_from_ctree: @@ -680,7 +681,7 @@ write_emenu_from_ctree(GtkCTree * tree) { GNode *items; - Ewd_List *l; + Evas_List *l = NULL; int written = 0; items = @@ -694,21 +695,16 @@ return; } items = items->children; - l = ewd_list_new(); - ewd_list_set_free_cb(l, _emenu_item_free); - gnode_to_menu_item_ewd_list(l, items); + l = gnode_to_menu_item_evas_list(l, items); g_node_destroy(items); - written = write_user_menu_db_with_ewd_list(l); + written = write_user_menu_db_with_evas_list(l); if (written) status_bar_message("Error Saving your Menus", 3000); else status_bar_message("Menus Saved Successfully ...", 3000); - /* see util.c for this function */ - - ewd_list_destroy(l); } /* - checks to make sure we don't apply filter rules to the root of the ctree. @@ -729,13 +725,14 @@ if (GTK_CTREE_ROW(node)->children) { gtk_ctree_get_node_info(GTK_CTREE(tree), GTK_CTREE_NODE(node), - &description, NULL, NULL, NULL, NULL, NULL, NULL, - NULL); + &description, NULL, NULL, NULL, NULL, NULL, + NULL, NULL); /* be sure it's not the root !!! =) */ if (strcmp(buf, description) || (!description)) { - gtk_ctree_node_set_text(GTK_CTREE(tree), GTK_CTREE_NODE(node), 2, ""); + gtk_ctree_node_set_text(GTK_CTREE(tree), GTK_CTREE_NODE(node), 2, + ""); gtk_ctree_node_set_text(GTK_CTREE(tree), GTK_CTREE_NODE(node), 3, "Submenu"); } @@ -759,16 +756,17 @@ write_emenu_from_ctree(GTK_CTREE(w)); } -/* enables recursive calls on the Ewd_List to populate a ctree with a +/* enables recursive calls on the Evas_List to populate a ctree with a * pre-established parent * @param l: a Ewl_List populated with the info from apps_menu.db * @param tree: pointer to the tree we're populating * @param parent: parent node in the tree to attach new ones to */ static void -populate_menu_ctree_recursive(Ewd_List * l, GtkWidget * tree, +populate_menu_ctree_recursive(Evas_List * l, GtkWidget * tree, GtkCTreeNode * parent) { + Evas_List *ll; emenu_item *e; GtkCTreeNode *node; gchar *fields[4] = { @@ -777,18 +775,15 @@ int i; if (!l) - { - fprintf(stderr, "No list supplied for menu ctree dump\n"); return; - } else if (!tree) return; else if (!parent) return; - ewd_list_goto_first(l); - while ((e = (emenu_item *) ewd_list_next(l))) + for (ll = l; ll; ll = ll->next) { + e = ll->data; if ((e->text) && (strlen(e->text) > 0)) fields[0] = g_strdup(e->text); @@ -848,27 +843,24 @@ static void populate_menu_ctree_with_menu_data(GtkWidget * tree) { - Ewd_List *l; + Evas_List *l = NULL; GtkCTreeNode *root; char buf[1024]; gchar *fields[4] = { "", "", "", "" }; - l = ewd_list_new(); - ewd_list_set_free_cb(l, _emenu_item_free); - - read_user_menu_db_into_ewd_list(l); - ewd_list_goto_first(l); + l = read_user_menu_db_into_evas_list(l); sprintf(buf, "%s/.e/behavior/apps_menu.db", getenv("HOME")); fields[0] = g_strdup(buf); root = - gtk_ctree_insert_node(GTK_CTREE(tree), NULL, NULL, fields, 5, NULL, NULL, - NULL, NULL, FALSE, TRUE); - gtk_ctree_node_set_selectable(GTK_CTREE(tree), GTK_CTREE_NODE(root), FALSE); + gtk_ctree_insert_node(GTK_CTREE(tree), NULL, NULL, fields, 5, NULL, + NULL, NULL, NULL, FALSE, TRUE); + gtk_ctree_node_set_selectable(GTK_CTREE(tree), GTK_CTREE_NODE(root), + FALSE); populate_menu_ctree_recursive(l, tree, root); @@ -878,6 +870,4 @@ /* select the first child of the root */ } - ewd_list_destroy(l); - /* clean up */ } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/util.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -3 -r1.4 -r1.4.2.1 --- util.c 4 Nov 2001 21:39:34 -0000 1.4 +++ util.c 21 Sep 2002 19:44:55 -0000 1.4.2.1 @@ -3,9 +3,9 @@ * Project: Ebindings * Programmer: Corey Donohoe<at...@at...> * Date: October 10, 2001 - * Description: DB Utility functions. Parsing of menu dbs to a and Ewd_List + * Description: DB Utility functions. Parsing of menu dbs to a and Evas_List * of defined structure, emenu_item, from emenu_item.h. Parsing is also - * done of the user's actions db. And an Ewd_List with nodes of a defined + * done of the user's actions db. And an Evas_List with nodes of a defined * type, eaction_item, from ekeybindings.h. Reading and writing to the * database for both actions and menus is done here. *************************************************************************/ @@ -71,9 +71,11 @@ e_db_int_get(db, buf, &item->event); if ((item->key) && (strlen(item->key) > 0)) - ewd_list_append(action_container.keys, item); + action_container.keys = + evas_list_append(action_container.keys, item); else - ewd_list_append(action_container.focus, item); + action_container.focus = + evas_list_append(action_container.focus, item); } e_db_close(db); return 0; @@ -86,15 +88,15 @@ write_user_actions_db(void) { E_DB_File *db; + Evas_List *l; char dbname[1024]; char buf[4096]; - char **keys; - int i, key_count; + int i; eaction_item *item; snprintf(dbname, 4096, "%s/.e/behavior/actions.db", getenv("HOME")); + unlink(dbname); db = e_db_open(dbname); - if (!db) { fprintf(stderr, @@ -103,27 +105,11 @@ "environmental variable HOME set wrong?.\n", dbname); return 1; } - keys = e_db_dump_key_list(dbname, &key_count); - if (keys) - { - int j; - for (j = 0; j < key_count; j++) - { - e_db_data_del(db, keys[j]); - free(keys[j]); - } - free(keys); - } - /* clear out the old stuff first */ - ewd_list_goto_first(action_container.keys); - ewd_list_goto_first(action_container.focus); - /* make sure we start at the beginning of our lists */ - - for (i = 0; (item = (eaction_item *) ewd_list_next(action_container.focus)); - i++) - /* write non keybind actions first */ + /* write non keybind actions first */ + for (i = 0, l = action_container.focus; l; l = l->next, i++) { + item = (eaction_item *) l->data; sprintf(buf, "/actions/%i/name", i); e_db_str_set(db, buf, item->name); sprintf(buf, "/actions/%i/action", i); @@ -142,9 +128,10 @@ sprintf(buf, "/actions/%i/event", i); e_db_int_set(db, buf, item->event); } - for (; (item = (eaction_item *) ewd_list_next(action_container.keys)); i++) + /* write keybinds next */ + for (l = action_container.keys; l; l = l->next, i++) { - /* write keybinds next */ + item = (eaction_item *) l->data; sprintf(buf, "/actions/%i/name", i); e_db_str_set(db, buf, item->name); sprintf(buf, "/actions/%i/action", i); @@ -177,12 +164,12 @@ /* read_emenu_from_db: recursive function to read menu dbs * db: a E_DB_File open in read only mode, it doesn't try to write to it, * but if we're only retrieving data it's no big deal anways. - * _l: an Ewd_List of emenu_items + * _l: an Evas_List of emenu_items * :menu_count: parameter used in the recursive call to specify which submenu * should be parsed. */ -static void -read_emenu_from_db(E_DB_File * db, Ewd_List * _l, int menu_count) +static Evas_List * +read_emenu_from_db(E_DB_File * db, Evas_List * _l, int menu_count) { char buf[4096]; emenu_item *current = NULL; @@ -217,7 +204,8 @@ if (ok) { current->type = E_MENU_SUBMENU; - read_emenu_from_db(db, current->children, submenu); + current->children = + read_emenu_from_db(db, current->children, submenu); } /* handle scripts */ @@ -230,24 +218,27 @@ current->exec = e_db_str_get(db, buf); } } - ewd_list_append(_l, current); + _l = evas_list_append(_l, current); } + return (_l); } /* recursive write function call */ static void -write_emenu_to_db_with_ewd_list(E_DB_File * db, Ewd_List * l, int menu_level) +write_emenu_to_db_with_evas_list(E_DB_File * db, Evas_List * l, + int menu_level) { + Evas_List *ll; emenu_item *e; char buf[4096]; int i; if (!l) return; - ewd_list_goto_first(l); - for (i = 0; (e = (emenu_item *) ewd_list_next(l)); i++) + for (i = 0, ll = l; ll; ll = ll->next, i++) { + e = (emenu_item *) ll->data; if (!e) continue; if (!e->text && e->type != E_MENU_SEPARATOR) @@ -286,7 +277,7 @@ sprintf(buf, "/menu/%i/%i/text", menu_level, i); e_db_str_set(db, buf, e->text); } - write_emenu_to_db_with_ewd_list(db, e->children, menu_count); + write_emenu_to_db_with_evas_list(db, e->children, menu_count); break; default: sprintf(buf, "/menu/%i/%i/command", menu_level, i); @@ -307,9 +298,9 @@ e_db_int_set(db, "/menu/count", menu_count + 1); } -/* Populates the user's menu db to this Ewd_List pass to it. */ -int -read_user_menu_db_into_ewd_list(Ewd_List * l) +/* Populates the user's menu db to this Evas_List pass to it. */ +Evas_List * +read_user_menu_db_into_evas_list(Evas_List * l) { E_DB_File *db; char dbname[1024]; @@ -324,17 +315,17 @@ "ERROR: Unable to read your menu database.\n" "%s is the file I'm looking for\nIs the " "environmental variable HOME set wrong?.\n", dbname); - return 1; + return (NULL); } - read_emenu_from_db(db, l, 0); + l = read_emenu_from_db(db, l, 0); e_db_close(db); - return 0; + return (l); } -/* writes the user's menu db from the Ewd_List passed to it. */ +/* writes the user's menu db from the Evas_List passed to it. */ int -write_user_menu_db_with_ewd_list(Ewd_List * l) +write_user_menu_db_with_evas_list(Evas_List * l) { E_DB_File *db; char dbname[1024]; @@ -371,7 +362,7 @@ } menu_count = 0; - write_emenu_to_db_with_ewd_list(db, l, menu_count); + write_emenu_to_db_with_evas_list(db, l, menu_count); e_db_close(db); e_db_flush(); return 0; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/util.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- util.h 3 Nov 2001 16:54:04 -0000 1.3 +++ util.h 21 Sep 2002 19:44:56 -0000 1.3.2.1 @@ -3,9 +3,9 @@ * Project: Ebindings * Programmer: Corey Donohoe<at...@at...> * Date: October 10, 2001 - * Description: Utility functions. Parsing of menu dbs to a and Ewd_List + * Description: Utility functions. Parsing of menu dbs to a and Evas_List * of defined structure, emenu_item, from emenu_item.h. Parsing is also - * done of the user's actions db. And an Ewd_List with nodes of a defined + * done of the user's actions db. And an Evas_List with nodes of a defined * type, eaction_item, from ekeybindings.h. Reading and Writing to the * actions and menu dbs is done here *************************************************************************/ @@ -13,7 +13,8 @@ #ifndef __E_DB_PARSING_ROUTINES_ #define __E_DB_PARSING_ROUTINES_ -#include <Ewd.h> +#include <Evas.h> +#include <unistd.h> #include "emenu_item.h" #include "eaction_item.h" @@ -32,8 +33,8 @@ */ int write_user_actions_db(void); -int write_user_menu_db_with_ewd_list(Ewd_List *); -int read_user_menu_db_into_ewd_list(Ewd_List *); +int write_user_menu_db_with_evas_list(Evas_List *); +Evas_List *read_user_menu_db_into_evas_list(Evas_List *); /* wrapper to open and start recursive call */ |
From: <enl...@li...> - 2002-11-06 22:45:00
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/ebindings Dir : e17/apps/ebindings/src Modified Files: Tag: SPLIT Makefile.am focus_interface.c interface.c interface.h Added Files: Tag: SPLIT desktops.c desktops.h Log Message: change your number of desktops turn on/off desktop scrolling set the size of your virtual desktops =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/Makefile.am,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -3 -r1.3.2.1 -r1.3.2.2 --- Makefile.am 21 Sep 2002 19:44:54 -0000 1.3.2.1 +++ Makefile.am 6 Nov 2002 22:44:56 -0000 1.3.2.2 @@ -17,6 +17,7 @@ focus_interface.c focus_interface.h \ callbacks.c callbacks.h \ interface.c interface.h \ + desktops.c desktops.h \ main.c ebindings_LDADD = \ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/focus_interface.c,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -u -3 -r1.3.2.3 -r1.3.2.4 --- focus_interface.c 2 Oct 2002 22:14:32 -0000 1.3.2.3 +++ focus_interface.c 6 Nov 2002 22:44:57 -0000 1.3.2.4 @@ -225,7 +225,7 @@ else raise_adj = gtk_adjustment_new(0.00, 0.00, 5.00, 0.02, 1.0, 0); raise_gauge = gtk_spin_button_new(GTK_ADJUSTMENT(raise_adj), 0.05, 3); - gtk_table_attach(GTK_TABLE(table), raise_gauge, 0, 1, 5, 6, GTK_FILL, 0, 2, + gtk_table_attach(GTK_TABLE(table), raise_gauge, 0, 1, 5, 6, 0, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(raise_gauge), "changed", GTK_SIGNAL_FUNC(focus_autoraise_timeout_cb), NULL); @@ -259,7 +259,7 @@ guide_x = gtk_spin_button_new(GTK_ADJUSTMENT(guide_x_adj), 0.50, 2); gtk_widget_set_name(GTK_WIDGET(guide_x), "horiz_guide"); - gtk_table_attach(GTK_TABLE(table2), guide_x, 0, 1, 1, 2, GTK_FILL, 0, 2, + gtk_table_attach(GTK_TABLE(table2), guide_x, 0, 1, 1, 2, 0, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(guide_x), "changed", GTK_SIGNAL_FUNC(focus_guides_location_change_cb), NULL); @@ -279,7 +279,7 @@ guide_y_adj = gtk_adjustment_new(50.0, 0.00, 100.00, 0.5, 3.0, 0); guide_y = gtk_spin_button_new(GTK_ADJUSTMENT(guide_y_adj), 0.05, 2); gtk_widget_set_name(GTK_WIDGET(guide_y), "vert_guide"); - gtk_table_attach(GTK_TABLE(table2), guide_y, 1, 2, 1, 2, GTK_FILL, 0, 2, + gtk_table_attach(GTK_TABLE(table2), guide_y, 1, 2, 1, 2, 0, 0, 2, 2); gtk_signal_connect(GTK_OBJECT(guide_y), "changed", GTK_SIGNAL_FUNC(focus_guides_location_change_cb), NULL); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/interface.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- interface.c 3 Nov 2001 16:54:04 -0000 1.3 +++ interface.c 6 Nov 2002 22:44:58 -0000 1.3.2.1 @@ -80,6 +80,7 @@ add_menu_notebook(win, notebook, 0); add_keybinds_notebook(win, notebook, 1); add_focus_notebook(win, notebook, 2); + add_desks_notebook(win, notebook, 3); gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 1); gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 1); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/interface.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -3 -r1.3 -r1.3.2.1 --- interface.h 3 Nov 2001 16:54:04 -0000 1.3 +++ interface.h 6 Nov 2002 22:44:58 -0000 1.3.2.1 @@ -13,6 +13,7 @@ #include "keybind_interface.h" #include "action_extra.h" #include "focus_interface.h" +#include "desktops.h" GtkWidget *create_main_ebindings_window(void); |