Enlightenment CVS committal
Author : jeoparde
Project : e17
Module : apps/ebindings
Dir : e17/apps/ebindings/src
Modified Files:
Makefile.am action_extra.c callbacks.c eaction_item.c
eaction_item.h ebindings.h emenu_item.c emenu_item.h
focus_interface.c interface.c interface.h keybind_interface.c
menu_interface.c util.c util.h
Added Files:
desktops.c desktops.h
Log Message:
Poor ebindings got left out during the great merge.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Makefile.am 19 Oct 2001 21:00:37 -0000 1.3
+++ Makefile.am 7 Feb 2003 20:39:05 -0000 1.4
@@ -3,7 +3,7 @@
INCLUDES = \
@BONUS_INCS@ \
@GTK_CFLAGS@ \
- @ewd_cflags@ \
+ @evas_cflags@ \
@edb_cflags@
bin_PROGRAMS = ebindings
@@ -15,13 +15,13 @@
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 \
+ desktops.c desktops.h \
main.c
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.5
diff -u -3 -r1.4 -r1.5
--- action_extra.c 9 Feb 2002 18:01:08 -0000 1.4
+++ action_extra.c 7 Feb 2003 20:39:06 -0000 1.5
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- callbacks.c 3 Nov 2001 16:54:03 -0000 1.3
+++ callbacks.c 7 Feb 2003 20:39:07 -0000 1.4
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- eaction_item.c 3 Nov 2001 16:54:04 -0000 1.3
+++ eaction_item.c 7 Feb 2003 20:39:11 -0000 1.4
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- eaction_item.h 3 Nov 2001 16:54:04 -0000 1.3
+++ eaction_item.h 7 Feb 2003 20:39:11 -0000 1.4
@@ -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.3
diff -u -3 -r1.2 -r1.3
--- ebindings.h 20 Oct 2001 18:06:19 -0000 1.2
+++ ebindings.h 7 Feb 2003 20:39:12 -0000 1.3
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- emenu_item.c 3 Nov 2001 16:54:04 -0000 1.3
+++ emenu_item.c 7 Feb 2003 20:39:12 -0000 1.4
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- emenu_item.h 3 Nov 2001 16:54:04 -0000 1.3
+++ emenu_item.h 7 Feb 2003 20:39:12 -0000 1.4
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- focus_interface.c 3 Nov 2001 16:54:04 -0000 1.3
+++ focus_interface.c 7 Feb 2003 20:39:12 -0000 1.4
@@ -14,12 +14,12 @@
static void
focus_mouse_focus_type_cb(GtkWidget * w, gpointer data)
{
- char buf[4096];
+ char buf[PATH_MAX];
gchar *button;
if (!w)
return;
- snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME"));
+ snprintf(buf, PATH_MAX, "%s/.e/behavior/behavior.db", getenv("HOME"));
button = gtk_widget_get_name(GTK_WIDGET(w));
@@ -27,14 +27,14 @@
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
{
- E_DB_INT_SET(buf, "/focus/mode", 0) e_db_flush();
+ E_DB_INT_SET(buf, "/window/focus/mode", 0) e_db_flush();
}
}
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();
+ E_DB_INT_SET(buf, "/window/focus/mode", 2) e_db_flush();
}
}
else
@@ -49,11 +49,11 @@
static void
focus_mouse_autoraise_window(GtkWidget * w, gpointer data)
{
- char buf[4096];
+ char buf[PATH_MAX];
if (!w)
return;
- snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME"));
+ snprintf(buf, PATH_MAX, "%s/.e/behavior/behavior.db", getenv("HOME"));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
{
@@ -71,14 +71,14 @@
static void
focus_autoraise_timeout_cb(GtkWidget * w, gpointer data)
{
- char buf[4096];
+ char buf[PATH_MAX];
float f = 0.000;
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"));
+ snprintf(buf, PATH_MAX, "%s/.e/behavior/behavior.db", getenv("HOME"));
E_DB_FLOAT_SET(buf, "/window/raise/delay", f) e_db_flush();
return;
@@ -88,7 +88,7 @@
static void
focus_guides_location_change_cb(GtkWidget * w, gpointer data)
{
- char buf[4096];
+ char buf[PATH_MAX];
float _f = 0.000, f = 0.000;
float scale = 100.00;
char *wname;
@@ -100,7 +100,7 @@
_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"));
+ snprintf(buf, PATH_MAX, "%s/.e/behavior/behavior.db", getenv("HOME"));
if (!strcmp(wname, "horiz_guide"))
{
E_DB_FLOAT_SET(buf, "/guides/display/x", f) e_db_flush();
@@ -140,11 +140,11 @@
GtkObject *guide_x_adj, *guide_y_adj;
GtkWidget *guide_x, *guide_y, *guide_x_label, *guide_y_label;
- char buf[4096];
+ char buf[PATH_MAX];
int current_val = 0, ok = 0;
float flot = 0.00, _flot = 0.00;
- snprintf(buf, 4096, "%s/.e/behavior/settings.db", getenv("HOME"));
+ snprintf(buf, PATH_MAX, "%s/.e/behavior/behavior.db", getenv("HOME"));
tab_label = gtk_label_new("Focus");
@@ -179,7 +179,7 @@
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)
+ E_DB_INT_GET(buf, "/window/focus/mode", current_val, ok) if (ok)
{
switch (current_val)
{
@@ -225,15 +225,15 @@
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);
/* */
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, 0, 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, 0, 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/interface.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- interface.c 3 Nov 2001 16:54:04 -0000 1.3
+++ interface.c 7 Feb 2003 20:39:13 -0000 1.4
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- interface.h 3 Nov 2001 16:54:04 -0000 1.3
+++ interface.h 7 Feb 2003 20:39:13 -0000 1.4
@@ -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);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/ebindings/src/keybind_interface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- keybind_interface.c 28 Apr 2002 20:58:35 -0000 1.6
+++ keybind_interface.c 7 Feb 2003 20:39:13 -0000 1.7
@@ -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.6
diff -u -3 -r1.5 -r1.6
--- menu_interface.c 9 Feb 2002 18:01:08 -0000 1.5
+++ menu_interface.c 7 Feb 2003 20:39:14 -0000 1.6
@@ -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.5
diff -u -3 -r1.4 -r1.5
--- util.c 4 Nov 2001 21:39:34 -0000 1.4
+++ util.c 7 Feb 2003 20:39:15 -0000 1.5
@@ -3,9 +3,9 @@
* Project: Ebindings
* Programmer: Corey Donohoe<[EMAIL PROTECTED]>
* 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.
*************************************************************************/
@@ -29,13 +29,13 @@
parse_user_actions_db(void)
{
E_DB_File *db;
- char dbname[1024];
+ char dbname[PATH_MAX];
int num, i;
eaction_item *item;
action_container_init();
/* setup the two lists and their cbs */
- snprintf(dbname, 1024, "%s/.e/behavior/actions.db", getenv("HOME"));
+ snprintf(dbname, PATH_MAX, "%s/.e/behavior/behavior.db", getenv("HOME"));
/* This could be back if user export HOME wrong, snprintf it */
db = e_db_open_read(dbname);
if (!db)
@@ -50,30 +50,32 @@
e_db_int_get(db, "/actions/count", &num);
for (i = 0; i < num; i++)
{
- char buf[1024];
+ char buf[PATH_MAX];
item = eaction_item_new();
- sprintf(buf, "/actions/%i/name", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/name", i);
item->name = e_db_str_get(db, buf);
- sprintf(buf, "/actions/%i/action", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/action", i);
item->action = e_db_str_get(db, buf);
- sprintf(buf, "/actions/%i/params", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/params", i);
item->params = e_db_str_get(db, buf);
- sprintf(buf, "/actions/%i/key", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/key", i);
item->key = e_db_str_get(db, buf);
- sprintf(buf, "/actions/%i/modifiers", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/modifiers", i);
e_db_int_get(db, buf, &item->modifiers);
- sprintf(buf, "/actions/%i/button", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/button", i);
e_db_int_get(db, buf, &item->button);
- sprintf(buf, "/actions/%i/event", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/event", i);
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;
- char dbname[1024];
- char buf[4096];
- char **keys;
- int i, key_count;
+ Evas_List *l;
+ char dbname[PATH_MAX];
+ char buf[PATH_MAX];
+ int i = 0;
eaction_item *item;
- snprintf(dbname, 4096, "%s/.e/behavior/actions.db", getenv("HOME"));
+ snprintf(dbname, PATH_MAX, "%s/.e/behavior/behavior.db", getenv("HOME"));
+ /* unlink(dbname); */
db = e_db_open(dbname);
-
if (!db)
{
fprintf(stderr,
@@ -103,64 +105,49 @@
"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++)
{
- sprintf(buf, "/actions/%i/name", i);
+ item = (eaction_item *) l->data;
+ snprintf(buf, PATH_MAX, "/actions/%i/name", i);
e_db_str_set(db, buf, item->name);
- sprintf(buf, "/actions/%i/action", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/action", i);
e_db_str_set(db, buf, item->action);
- sprintf(buf, "/actions/%i/params", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/params", i);
if (item->params)
e_db_str_set(db, buf, item->params);
- sprintf(buf, "/actions/%i/key", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/key", i);
if (item->key)
e_db_str_set(db, buf, item->key);
- sprintf(buf, "/actions/%i/modifiers", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/modifiers", i);
e_db_int_set(db, buf, item->modifiers);
- sprintf(buf, "/actions/%i/button", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/button", i);
e_db_int_set(db, buf, item->button);
- sprintf(buf, "/actions/%i/event", i);
+ snprintf(buf, PATH_MAX, "/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 */
- sprintf(buf, "/actions/%i/name", i);
+ item = (eaction_item *) l->data;
+ snprintf(buf, PATH_MAX, "/actions/%i/name", i);
e_db_str_set(db, buf, item->name);
- sprintf(buf, "/actions/%i/action", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/action", i);
e_db_str_set(db, buf, item->action);
- sprintf(buf, "/actions/%i/params", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/params", i);
if (item->params)
e_db_str_set(db, buf, item->params);
- sprintf(buf, "/actions/%i/key", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/key", i);
if (item->key)
e_db_str_set(db, buf, item->key);
- sprintf(buf, "/actions/%i/modifiers", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/modifiers", i);
e_db_int_set(db, buf, item->modifiers);
- sprintf(buf, "/actions/%i/button", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/button", i);
e_db_int_set(db, buf, item->button);
- sprintf(buf, "/actions/%i/event", i);
+ snprintf(buf, PATH_MAX, "/actions/%i/event", i);
e_db_int_set(db, buf, item->event);
}
e_db_int_set(db, "/actions/count", i);
@@ -177,18 +164,18 @@
/* 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];
+ char buf[PATH_MAX];
emenu_item *current = NULL;
int j = 0, max, ok, submenu, seperator;
- sprintf(buf, "/menu/%d/count", menu_count);
+ snprintf(buf, PATH_MAX, "/menu/%d/count", menu_count);
e_db_int_get(db, buf, &max);
for (j = 0; j < max; j++)
@@ -196,7 +183,7 @@
submenu = seperator = ok = 0;
current = emenu_item_new();
- sprintf(buf, "/menu/%i/%i/separator", menu_count, j);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/separator", menu_count, j);
ok = e_db_int_get(db, buf, &seperator);
if (ok)
{
@@ -205,49 +192,53 @@
/* if it's a seperator we just append it */
else
{
- sprintf(buf, "/menu/%i/%i/command", menu_count, j);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/command", menu_count, j);
current->exec = e_db_str_get(db, buf);
- sprintf(buf, "/menu/%i/%i/icon", menu_count, j);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/icon", menu_count, j);
current->icon = e_db_str_get(db, buf);
- sprintf(buf, "/menu/%i/%i/text", menu_count, j);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/text", menu_count, j);
current->text = e_db_str_get(db, buf);
- sprintf(buf, "/menu/%i/%i/submenu", menu_count, j);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/submenu", menu_count, j);
ok = e_db_int_get(db, buf, &submenu);
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 */
- sprintf(buf, "/menu/%i/%i/script", menu_count, j);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/script", menu_count, j);
ok = e_db_int_get(db, buf, &submenu);
if (ok)
{
current->type = E_MENU_SCRIPT;
- sprintf(buf, "/menu/%i/%i/script", menu_count, j);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/script", menu_count, j);
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];
+ char buf[PATH_MAX];
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)
@@ -258,63 +249,63 @@
switch (e->type)
{
case E_MENU_SCRIPT:
- sprintf(buf, "/menu/%i/%i/script", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/script", menu_level, i);
e_db_str_set(db, buf, e->exec);
- sprintf(buf, "/menu/%i/%i/text", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/text", menu_level, i);
e_db_str_set(db, buf, e->text);
if (e->icon && (strlen(e->icon) > 0))
{
- sprintf(buf, "/menu/%i/%i/icon", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/icon", menu_level, i);
e_db_str_set(db, buf, e->icon);
}
break;
case E_MENU_SEPARATOR:
- sprintf(buf, "/menu/%i/%i/separator", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/separator", menu_level, i);
e_db_int_set(db, buf, 1);
break;
case E_MENU_SUBMENU:
- sprintf(buf, "/menu/%i/%i/submenu", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/submenu", menu_level, i);
e_db_int_set(db, buf, ++menu_count);
if (e->icon && (strlen(e->icon) > 0))
{
- sprintf(buf, "/menu/%i/%i/icon", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/icon", menu_level, i);
e_db_str_set(db, buf, e->icon);
}
if (e->text)
{
- sprintf(buf, "/menu/%i/%i/text", menu_level, i);
+ snprintf(buf, PATH_MAX, "/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);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/command", menu_level, i);
e_db_str_set(db, buf, e->exec);
- sprintf(buf, "/menu/%i/%i/text", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/text", menu_level, i);
e_db_str_set(db, buf, e->text);
if (e->icon && (strlen(e->icon) > 0))
{
- sprintf(buf, "/menu/%i/%i/icon", menu_level, i);
+ snprintf(buf, PATH_MAX, "/menu/%i/%i/icon", menu_level, i);
e_db_str_set(db, buf, e->icon);
}
break;
}
e = NULL;
}
- sprintf(buf, "/menu/%i/count", menu_level);
+ snprintf(buf, PATH_MAX, "/menu/%i/count", menu_level);
e_db_int_set(db, buf, i);
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];
+ char dbname[PATH_MAX];
- snprintf(dbname, 1024, "%s/.e/behavior/apps_menu.db", getenv("HOME"));
+ snprintf(dbname, PATH_MAX, "%s/.e/behavior/apps_menu.db", getenv("HOME"));
/* This could be back if user export HOME wrong, snprintf it */
db = e_db_open_read(dbname);
@@ -324,22 +315,22 @@
"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];
+ char dbname[PATH_MAX];
- sprintf(dbname, "%s/.e/behavior/apps_menu.db", getenv("HOME"));
+ snprintf(dbname, PATH_MAX, "%s/.e/behavior/apps_menu.db", getenv("HOME"));
db = e_db_open(dbname);
if (!db)
@@ -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.4
diff -u -3 -r1.3 -r1.4
--- util.h 3 Nov 2001 16:54:04 -0000 1.3
+++ util.h 7 Feb 2003 20:39:16 -0000 1.4
@@ -3,9 +3,9 @@
* Project: Ebindings
* Programmer: Corey Donohoe<[EMAIL PROTECTED]>
* 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 */
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs