summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README6
-rw-r--r--configure.ac16
-rw-r--r--configure.in16
-rw-r--r--data/config/behavior/default/apps_menu.dbbin20480 -> 20480 bytes
-rwxr-xr-xdata/scripts/build_app_menu_db.sh10
-rw-r--r--po/ChangeLog16
-rw-r--r--src/.cvsignore3
-rw-r--r--src/Makefile.am16
-rw-r--r--src/e_ferite.c41
-rw-r--r--src/e_ferite.fec54
-rw-r--r--src/e_ferite.h13
-rw-r--r--src/main.c4
-rw-r--r--src/menubuild.c22
-rw-r--r--src/view.c2
14 files changed, 209 insertions, 10 deletions
diff --git a/README b/README
index 5e7cfd6d7..efd27de55 100644
--- a/README
+++ b/README
@@ -62,9 +62,9 @@ worked on. Just be happy it does as much as it already does.
62 62
63Enlightenment RELIES on lots of libraires that have been written. Ecore, 63Enlightenment RELIES on lots of libraires that have been written. Ecore,
64Ebits, Evas, Edb, Imlib2, Efsd just to mention a few. Especially Ebits, 64Ebits, Evas, Edb, Imlib2, Efsd just to mention a few. Especially Ebits,
65Ecore, Efsd and Evas change in CVS often - you will need the absolute latest 65Ecore, Efsd ferite, and Evas change in CVS often - you will need the absolute
66of these if you wish Enlightenment 0.17 code to run properly or compile. If 66latest of these if you wish Enlightenment 0.17 code to run properly or compile.
67you update Enlightenment from CVS update these too to get any changes they 67If you update Enlightenment from CVS update these too to get any changes they
68have in their trees. 68have in their trees.
69 69
70If you plan on working on the code... STOP! don't rush in and work on it - 70If you plan on working on the code... STOP! don't rush in and work on it -
diff --git a/configure.ac b/configure.ac
index 1a3953563..d615e7a25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,22 @@ AC_PATH_GENERIC(efsd,, [
155efsd_libs=`efsd-config --libs` 155efsd_libs=`efsd-config --libs`
156efsd_cflags=`efsd-config --cflags` 156efsd_cflags=`efsd-config --cflags`
157 157
158dnl Check for ferite.
159AC_ARG_WITH(ferite,
160 [ --with-ferite=DIR use ferite in <DIR>],
161 [CFLAGS="$CFLAGS -I$withval/include"
162 LIBS="-L$withval/lib $LIBS"])
163
164AC_PATH_GENERIC(ferite,, [
165 AC_SUBST(ferite_libs)
166 AC_SUBST(ferite_cflags)],
167 AC_MSG_ERROR(Cannot find ferite: Is ferite-config in path?))
168ferite_libs=`ferite-config --libs`
169ferite_cflags=`ferite-config --cflags`
170
171AC_PATH_PROG(FEBUILDER, builder,,)
172AC_SUBST(FEBUILDER)
173
158AC_SUBST(CP_OPTIONS) 174AC_SUBST(CP_OPTIONS)
159 175
160AC_CONFIG_FILES([ 176AC_CONFIG_FILES([
diff --git a/configure.in b/configure.in
index bfbd5a379..21af8bbf2 100644
--- a/configure.in
+++ b/configure.in
@@ -154,6 +154,22 @@ AC_PATH_GENERIC(efsd,, [
154efsd_libs=`efsd-config --libs` 154efsd_libs=`efsd-config --libs`
155efsd_cflags=`efsd-config --cflags` 155efsd_cflags=`efsd-config --cflags`
156 156
157dnl Check for ferite.
158AC_ARG_WITH(ferite,
159 [ --with-ferite=DIR use ferite in <DIR>],
160 [CFLAGS="$CFLAGS -I$withval/include"
161 LIBS="-L$withval/lib $LIBS"])
162
163AC_PATH_GENERIC(ferite,, [
164 AC_SUBST(ferite_libs)
165 AC_SUBST(ferite_cflags)],
166 AC_MSG_ERROR(Cannot find ferite: Is ferite-config in path?))
167ferite_libs=`ferite-config --libs`
168ferite_cflags=`ferite-config --cflags`
169
170AC_PATH_PROG(FEBUILDER, builder,,)
171AC_SUBST(FEBUILDER)
172
157AC_SUBST(CP_OPTIONS) 173AC_SUBST(CP_OPTIONS)
158 174
159AC_OUTPUT([ 175AC_OUTPUT([
diff --git a/data/config/behavior/default/apps_menu.db b/data/config/behavior/default/apps_menu.db
index fbb346ec7..92c10808d 100644
--- a/data/config/behavior/default/apps_menu.db
+++ b/data/config/behavior/default/apps_menu.db
Binary files differ
diff --git a/data/scripts/build_app_menu_db.sh b/data/scripts/build_app_menu_db.sh
index 189a2db68..b7d493f30 100755
--- a/data/scripts/build_app_menu_db.sh
+++ b/data/scripts/build_app_menu_db.sh
@@ -65,9 +65,13 @@ entry ()
65 65
66 else if [ $1 = "separator" ]; then 66 else if [ $1 = "separator" ]; then
67 edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/separator" int 1 67 edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/separator" int 1
68
69
70 else if [ $1 = "script" ]; then
71 edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/text" str "$2"
72 edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/script" str "$3"
68 73
69 74 fi; fi; fi; fi; fi
70 fi; fi; fi; fi
71 ENTRYNUM=$[ $ENTRYNUM + 1 ]; 75 ENTRYNUM=$[ $ENTRYNUM + 1 ];
72} 76}
73 77
@@ -95,6 +99,7 @@ entry both 'XMag' '/usr/share/pixmaps/gnome-applets.png' 'xmag'
95entry separator 99entry separator
96entry text 'Network' 'sub' 1 100entry text 'Network' 'sub' 1
97entry text 'System' 'sub' 2 101entry text 'System' 'sub' 2
102entry script 'Exit' 'e.shutdown();'
98end_menu 103end_menu
99 104
100menu 1 105menu 1
@@ -107,4 +112,5 @@ entry text 'Shut Down' 'sudo -S /sbin/shutdown -h now'
107entry text 'Reboot' 'sudo -S /sbin/shutdown -r now' 112entry text 'Reboot' 'sudo -S /sbin/shutdown -r now'
108end_menu 113end_menu
109 114
115
110finish 116finish
diff --git a/po/ChangeLog b/po/ChangeLog
index 0bc3b794a..f13efe4b2 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,19 @@
12001-08-25 gettextize <bug-gnu-utils@gnu.org>
2
3 * Makefile.in.in: Upgrade to gettext-0.10.39.
4
52001-08-25 gettextize <bug-gnu-utils@gnu.org>
6
7 * Makefile.in.in: Upgrade to gettext-0.10.39.
8
92001-08-25 gettextize <bug-gnu-utils@gnu.org>
10
11 * Makefile.in.in: Upgrade to gettext-0.10.39.
12
132001-08-25 gettextize <bug-gnu-utils@gnu.org>
14
15 * Makefile.in.in: Upgrade to gettext-0.10.39.
16
12001-08-23 gettextize <bug-gnu-utils@gnu.org> 172001-08-23 gettextize <bug-gnu-utils@gnu.org>
2 18
3 * Makefile.in.in: Upgrade to gettext-0.10.39. 19 * Makefile.in.in: Upgrade to gettext-0.10.39.
diff --git a/src/.cvsignore b/src/.cvsignore
index aee5d8aee..ed69a9f1b 100644
--- a/src/.cvsignore
+++ b/src/.cvsignore
@@ -6,4 +6,5 @@ Makefile.in
6Makefile 6Makefile
7enlightenment 7enlightenment
8.libs 8.libs
9.deps \ No newline at end of file 9.deps
10e_ferite_gen_*
diff --git a/src/Makefile.am b/src/Makefile.am
index 3b8d53306..e6fd853e0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,10 @@
1## Process this file with automake to produce Makefile.in 1## Process this file with automake to produce Makefile.in
2 2
3CLEANFILES = e_ferite_gen_*
4
3INCLUDES = \ 5INCLUDES = \
4 -I$(top_srcdir)/intl \ 6 -I$(top_srcdir)/intl \
5 @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ 7 @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ @ferite_cflags@
6 8
7bin_PROGRAMS = enlightenment 9bin_PROGRAMS = enlightenment
8 10
@@ -14,6 +16,10 @@ enlightenment_SOURCES = \
14 desktops.h desktops.c \ 16 desktops.h desktops.c \
15 entry.h entry.c \ 17 entry.h entry.c \
16 exec.h exec.c \ 18 exec.h exec.c \
19 e_ferite.h e_ferite.c \
20 e_ferite_gen_header.h e_ferite_gen_core.c \
21 e_ferite_gen_e.c \
22 e_ferite_gen_Window.c \
17 fs.h fs.c \ 23 fs.h fs.c \
18 icccm.h icccm.c \ 24 icccm.h icccm.c \
19 icons.c \ 25 icons.c \
@@ -31,5 +37,11 @@ enlightenment_SOURCES = \
31 view.h view.c \ 37 view.h view.c \
32 e.h 38 e.h
33 39
34enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ -lm -lc -ldl $(INTLLIBS) 40enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ferite_libs@ -lm -lc -ldl $(INTLLIBS)
35 41
42e_ferite_gen_core.c: e_ferite.fec
43 rm -f e_ferite_gen_* ; \
44 @FEBUILDER@ -m e_ferite_gen e_ferite.fec ; \
45 mv e_ferite_gen_core.c e_ferite_gen_core.c.old ; \
46 cat e_ferite_gen_core.c.old | sed -e "s/module_init/e_ferite_register/g" > e_ferite_gen_core.c ; \
47 rm e_ferite_gen_core.c.old
diff --git a/src/e_ferite.c b/src/e_ferite.c
new file mode 100644
index 000000000..4adc9491f
--- /dev/null
+++ b/src/e_ferite.c
@@ -0,0 +1,41 @@
1#include "e_ferite.h"
2#include "e_ferite_gen_header.h"
3
4void e_ferite_init(void)
5{
6 printf( "Initialising ferite....\n" );
7 ferite_init( 0, NULL );
8}
9
10void e_ferite_deinit(void)
11{
12 printf( "Deinitialising ferite....\n" );
13 ferite_deinit();
14}
15
16int e_ferite_script_error( FeriteScript *script, char *errmsg, int val )
17{
18 fprintf( stderr, "e17: ferite error: %s\n", errmsg );
19 return 1;
20}
21
22int e_ferite_script_warning( FeriteScript *script, char *warnmsg )
23{
24 fprintf( stderr, "e17: ferite warning: %s\n", warnmsg );
25 return 1;
26}
27
28void e_ferite_run( char *txt )
29{
30 FeriteScript *script = NULL;
31
32 printf( "Compiling script `%s'\n", txt );
33 script = __ferite_compile_string( txt );
34 e_ferite_register( script, script->mainns );
35 script->error_cb = e_ferite_script_error;
36 script->warning_cb = e_ferite_script_warning;
37 printf( "Executing script.\n" );
38 ferite_script_execute( script );
39 printf( "Cleaning up.\n" );
40 ferite_script_delete( script );
41}
diff --git a/src/e_ferite.fec b/src/e_ferite.fec
new file mode 100644
index 000000000..2ca1c825f
--- /dev/null
+++ b/src/e_ferite.fec
@@ -0,0 +1,54 @@
1%{
2
3 #include "Ecore.h"
4
5%}
6
7class Window {
8
9 function getName();
10 function getTitle();
11 function getClass();
12 function getX();
13 function getY();
14 function getWidth();
15 function getHeight();
16
17 function move( number x, number y );
18 function resize( number width, number height );
19
20 function show();
21 function hide();
22 function isVisible();
23
24 function shade();
25 function unshade();
26 function isShaded();
27
28 function iconify();
29 function uniconify();
30 function isIconic();
31
32 function isMapped();
33 function isTransient();
34 function isShaped();
35
36 function delete();
37 function kill();
38
39}
40
41namespace e {
42
43 function flipToDesktop( number desk );
44 function getDesktopCount();
45
46 function getWidth();
47 function getHeight();
48
49 // shutdown enlightenment
50 function shutdown()
51 %{
52 e_event_loop_quit();
53 %}
54}
diff --git a/src/e_ferite.h b/src/e_ferite.h
new file mode 100644
index 000000000..2810af502
--- /dev/null
+++ b/src/e_ferite.h
@@ -0,0 +1,13 @@
1#ifndef E_FERITE_H
2#define E_FERITE_H
3
4#include <ferite.h>
5
6void e_ferite_init(void);
7void e_ferite_deinit(void);
8void e_ferite_run( char *script );
9void e_ferite_register( FeriteScript *script, FeriteNamespace *ns );
10int e_ferite_script_error( FeriteScript *script, char *errmsg, int val );
11int e_ferite_script_warning( FeriteScript *script, char *warnmsg );
12
13#endif /* E_FERITE_H */
diff --git a/src/main.c b/src/main.c
index e4965a9fb..38adb7b4c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,6 +9,7 @@
9#include "ipc.h" 9#include "ipc.h"
10#include "menu.h" 10#include "menu.h"
11#include "view.h" 11#include "view.h"
12#include "e_ferite.h"
12#include <X11/Xproto.h> 13#include <X11/Xproto.h>
13 14
14#ifdef E_PROF 15#ifdef E_PROF
@@ -122,11 +123,14 @@ main(int argc, char **argv)
122 e_view_init(); 123 e_view_init();
123 e_entry_init(); 124 e_entry_init();
124 e_keys_init(); 125 e_keys_init();
126 e_ferite_init();
125 127
126 setup(); 128 setup();
127 129
128 e_event_loop(); 130 e_event_loop();
129 131
132 e_ferite_deinit();
133
130 return 0; 134 return 0;
131 UN(argc); 135 UN(argc);
132 UN(argv); 136 UN(argv);
diff --git a/src/menubuild.c b/src/menubuild.c
index d09472474..5062a902b 100644
--- a/src/menubuild.c
+++ b/src/menubuild.c
@@ -2,6 +2,7 @@
2#include "menubuild.h" 2#include "menubuild.h"
3#include "exec.h" 3#include "exec.h"
4#include "util.h" 4#include "util.h"
5#include "e_ferite.h"
5 6
6Evas_List build_menus = NULL; 7Evas_List build_menus = NULL;
7 8
@@ -28,6 +29,18 @@ e_build_menu_cb_exec(E_Menu *m, E_Menu_Item *mi, void *data)
28 UN(mi); 29 UN(mi);
29} 30}
30 31
32static void
33e_build_menu_cb_script(E_Menu *m, E_Menu_Item *mi, void *data)
34{
35 char *script;
36
37 script = data;
38 e_ferite_run(script);
39 return;
40 UN(m);
41 UN(mi);
42}
43
31static void 44static void
32e_build_menu_unbuild(E_Build_Menu *bm) 45e_build_menu_unbuild(E_Build_Menu *bm)
33{ 46{
@@ -126,7 +139,7 @@ e_build_menu_db_build_number(E_Build_Menu *bm, E_DB_File *db, int num)
126 for (i2 = 0; i2 < num2; i2++) 139 for (i2 = 0; i2 < num2; i2++)
127 { 140 {
128 E_Menu_Item *menuitem; 141 E_Menu_Item *menuitem;
129 char *text, *icon, *exe; 142 char *text, *icon, *exe, *script;
130 int ok, sub, sep; 143 int ok, sub, sep;
131 144
132 sprintf(buf, "/menu/%i/%i/text", num, i2); 145 sprintf(buf, "/menu/%i/%i/text", num, i2);
@@ -135,6 +148,8 @@ e_build_menu_db_build_number(E_Build_Menu *bm, E_DB_File *db, int num)
135 icon = e_db_str_get(db, buf); 148 icon = e_db_str_get(db, buf);
136 sprintf(buf, "/menu/%i/%i/command", num, i2); 149 sprintf(buf, "/menu/%i/%i/command", num, i2);
137 exe = e_db_str_get(db, buf); 150 exe = e_db_str_get(db, buf);
151 sprintf(buf, "/menu/%i/%i/script", num, i2);
152 script = e_db_str_get(db, buf);
138 sprintf(buf, "/menu/%i/%i/submenu", num, i2); 153 sprintf(buf, "/menu/%i/%i/submenu", num, i2);
139 ok = e_db_int_get(db, buf, &sub); 154 ok = e_db_int_get(db, buf, &sub);
140 sep = 0; 155 sep = 0;
@@ -161,6 +176,11 @@ e_build_menu_db_build_number(E_Build_Menu *bm, E_DB_File *db, int num)
161 e_menu_item_set_callback(menuitem, e_build_menu_cb_exec, exe); 176 e_menu_item_set_callback(menuitem, e_build_menu_cb_exec, exe);
162 bm->commands = evas_list_prepend(bm->commands, exe); 177 bm->commands = evas_list_prepend(bm->commands, exe);
163 } 178 }
179 if( script )
180 {
181 e_menu_item_set_callback(menuitem, e_build_menu_cb_script, script);
182 bm->commands = evas_list_prepend(bm->commands, script);
183 }
164 e_menu_add_item(menu, menuitem); 184 e_menu_add_item(menu, menuitem);
165 } 185 }
166 bm->menus = evas_list_prepend(bm->menus, menu); 186 bm->menus = evas_list_prepend(bm->menus, menu);
diff --git a/src/view.c b/src/view.c
index d2d36d93c..82dc23d8a 100644
--- a/src/view.c
+++ b/src/view.c
@@ -273,7 +273,7 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
273 e_view_selection_update(v); 273 e_view_selection_update(v);
274 } 274 }
275 if( _b == 2 && ev->double_click ) 275 if( _b == 2 && ev->double_click )
276 exit(0); 276 e_event_loop_quit();
277 277
278 UN(_e); 278 UN(_e);
279 UN(_o); 279 UN(_o);