diff options
author | boris <boris> | 2001-08-25 19:51:48 +0000 |
---|---|---|
committer | boris <boris@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33> | 2001-08-25 19:51:48 +0000 |
commit | bad5da3d33faf0ab35259e6e6f4120872cab921a (patch) | |
tree | 392b8403f35e986cbe80eff8d77311239cda1930 | |
parent | 69561bd136053fe9ec3fca2ff210ee5bc564376e (diff) | |
download | enlightenment-bad5da3d33faf0ab35259e6e6f4120872cab921a.tar.gz |
Ok this has got some initial support with ferite, currently you can only
assign ferite scripts to menus see data/scripts/build_app_menu_db.sh and look
at the exit menu item as an example. you will need ferite - i suggest that
you use cvs ferite as this is what I am developing this against. This, my
friends, is the first step of many :)
SVN revision: 5280
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | configure.ac | 16 | ||||
-rw-r--r-- | configure.in | 16 | ||||
-rw-r--r-- | data/config/behavior/default/apps_menu.db | bin | 20480 -> 20480 bytes | |||
-rwxr-xr-x | data/scripts/build_app_menu_db.sh | 10 | ||||
-rw-r--r-- | po/ChangeLog | 16 | ||||
-rw-r--r-- | src/.cvsignore | 3 | ||||
-rw-r--r-- | src/Makefile.am | 16 | ||||
-rw-r--r-- | src/e_ferite.c | 41 | ||||
-rw-r--r-- | src/e_ferite.fec | 54 | ||||
-rw-r--r-- | src/e_ferite.h | 13 | ||||
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/menubuild.c | 22 | ||||
-rw-r--r-- | src/view.c | 2 |
14 files changed, 209 insertions, 10 deletions
@@ -62,9 +62,9 @@ worked on. Just be happy it does as much as it already does. Enlightenment RELIES on lots of libraires that have been written. Ecore, Ebits, Evas, Edb, Imlib2, Efsd just to mention a few. Especially Ebits, -Ecore, Efsd and Evas change in CVS often - you will need the absolute latest -of these if you wish Enlightenment 0.17 code to run properly or compile. If -you update Enlightenment from CVS update these too to get any changes they +Ecore, Efsd ferite, and Evas change in CVS often - you will need the absolute +latest of these if you wish Enlightenment 0.17 code to run properly or compile. +If you update Enlightenment from CVS update these too to get any changes they have in their trees. If 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 1a39535631..d615e7a252 100644 --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,22 @@ AC_PATH_GENERIC(efsd,, [ efsd_libs=`efsd-config --libs` efsd_cflags=`efsd-config --cflags` +dnl Check for ferite. +AC_ARG_WITH(ferite, + [ --with-ferite=DIR use ferite in <DIR>], + [CFLAGS="$CFLAGS -I$withval/include" + LIBS="-L$withval/lib $LIBS"]) + +AC_PATH_GENERIC(ferite,, [ + AC_SUBST(ferite_libs) + AC_SUBST(ferite_cflags)], + AC_MSG_ERROR(Cannot find ferite: Is ferite-config in path?)) +ferite_libs=`ferite-config --libs` +ferite_cflags=`ferite-config --cflags` + +AC_PATH_PROG(FEBUILDER, builder,,) +AC_SUBST(FEBUILDER) + AC_SUBST(CP_OPTIONS) AC_CONFIG_FILES([ diff --git a/configure.in b/configure.in index bfbd5a379f..21af8bbf2d 100644 --- a/configure.in +++ b/configure.in @@ -154,6 +154,22 @@ AC_PATH_GENERIC(efsd,, [ efsd_libs=`efsd-config --libs` efsd_cflags=`efsd-config --cflags` +dnl Check for ferite. +AC_ARG_WITH(ferite, + [ --with-ferite=DIR use ferite in <DIR>], + [CFLAGS="$CFLAGS -I$withval/include" + LIBS="-L$withval/lib $LIBS"]) + +AC_PATH_GENERIC(ferite,, [ + AC_SUBST(ferite_libs) + AC_SUBST(ferite_cflags)], + AC_MSG_ERROR(Cannot find ferite: Is ferite-config in path?)) +ferite_libs=`ferite-config --libs` +ferite_cflags=`ferite-config --cflags` + +AC_PATH_PROG(FEBUILDER, builder,,) +AC_SUBST(FEBUILDER) + AC_SUBST(CP_OPTIONS) AC_OUTPUT([ diff --git a/data/config/behavior/default/apps_menu.db b/data/config/behavior/default/apps_menu.db Binary files differindex fbb346ec7e..92c10808d3 100644 --- a/data/config/behavior/default/apps_menu.db +++ b/data/config/behavior/default/apps_menu.db diff --git a/data/scripts/build_app_menu_db.sh b/data/scripts/build_app_menu_db.sh index 189a2db685..b7d493f308 100755 --- a/data/scripts/build_app_menu_db.sh +++ b/data/scripts/build_app_menu_db.sh @@ -65,9 +65,13 @@ entry () else if [ $1 = "separator" ]; then edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/separator" int 1 + + + else if [ $1 = "script" ]; then + edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/text" str "$2" + edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/script" str "$3" - - fi; fi; fi; fi + fi; fi; fi; fi; fi ENTRYNUM=$[ $ENTRYNUM + 1 ]; } @@ -95,6 +99,7 @@ entry both 'XMag' '/usr/share/pixmaps/gnome-applets.png' 'xmag' entry separator entry text 'Network' 'sub' 1 entry text 'System' 'sub' 2 +entry script 'Exit' 'e.shutdown();' end_menu menu 1 @@ -107,4 +112,5 @@ entry text 'Shut Down' 'sudo -S /sbin/shutdown -h now' entry text 'Reboot' 'sudo -S /sbin/shutdown -r now' end_menu + finish diff --git a/po/ChangeLog b/po/ChangeLog index 0bc3b794af..f13efe4b21 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,19 @@ +2001-08-25 gettextize <bug-gnu-utils@gnu.org> + + * Makefile.in.in: Upgrade to gettext-0.10.39. + +2001-08-25 gettextize <bug-gnu-utils@gnu.org> + + * Makefile.in.in: Upgrade to gettext-0.10.39. + +2001-08-25 gettextize <bug-gnu-utils@gnu.org> + + * Makefile.in.in: Upgrade to gettext-0.10.39. + +2001-08-25 gettextize <bug-gnu-utils@gnu.org> + + * Makefile.in.in: Upgrade to gettext-0.10.39. + 2001-08-23 gettextize <bug-gnu-utils@gnu.org> * Makefile.in.in: Upgrade to gettext-0.10.39. diff --git a/src/.cvsignore b/src/.cvsignore index aee5d8aee0..ed69a9f1be 100644 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -6,4 +6,5 @@ Makefile.in Makefile enlightenment .libs -.deps
\ No newline at end of file +.deps +e_ferite_gen_* diff --git a/src/Makefile.am b/src/Makefile.am index 3b8d533061..e6fd853e05 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,10 @@ ## Process this file with automake to produce Makefile.in +CLEANFILES = e_ferite_gen_* + INCLUDES = \ -I$(top_srcdir)/intl \ - @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ + @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ @ferite_cflags@ bin_PROGRAMS = enlightenment @@ -14,6 +16,10 @@ enlightenment_SOURCES = \ desktops.h desktops.c \ entry.h entry.c \ exec.h exec.c \ + e_ferite.h e_ferite.c \ + e_ferite_gen_header.h e_ferite_gen_core.c \ + e_ferite_gen_e.c \ + e_ferite_gen_Window.c \ fs.h fs.c \ icccm.h icccm.c \ icons.c \ @@ -31,5 +37,11 @@ enlightenment_SOURCES = \ view.h view.c \ e.h -enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ -lm -lc -ldl $(INTLLIBS) +enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ferite_libs@ -lm -lc -ldl $(INTLLIBS) +e_ferite_gen_core.c: e_ferite.fec + rm -f e_ferite_gen_* ; \ + @FEBUILDER@ -m e_ferite_gen e_ferite.fec ; \ + mv e_ferite_gen_core.c e_ferite_gen_core.c.old ; \ + cat e_ferite_gen_core.c.old | sed -e "s/module_init/e_ferite_register/g" > e_ferite_gen_core.c ; \ + rm e_ferite_gen_core.c.old diff --git a/src/e_ferite.c b/src/e_ferite.c new file mode 100644 index 0000000000..4adc9491f1 --- /dev/null +++ b/src/e_ferite.c @@ -0,0 +1,41 @@ +#include "e_ferite.h" +#include "e_ferite_gen_header.h" + +void e_ferite_init(void) +{ + printf( "Initialising ferite....\n" ); + ferite_init( 0, NULL ); +} + +void e_ferite_deinit(void) +{ + printf( "Deinitialising ferite....\n" ); + ferite_deinit(); +} + +int e_ferite_script_error( FeriteScript *script, char *errmsg, int val ) +{ + fprintf( stderr, "e17: ferite error: %s\n", errmsg ); + return 1; +} + +int e_ferite_script_warning( FeriteScript *script, char *warnmsg ) +{ + fprintf( stderr, "e17: ferite warning: %s\n", warnmsg ); + return 1; +} + +void e_ferite_run( char *txt ) +{ + FeriteScript *script = NULL; + + printf( "Compiling script `%s'\n", txt ); + script = __ferite_compile_string( txt ); + e_ferite_register( script, script->mainns ); + script->error_cb = e_ferite_script_error; + script->warning_cb = e_ferite_script_warning; + printf( "Executing script.\n" ); + ferite_script_execute( script ); + printf( "Cleaning up.\n" ); + ferite_script_delete( script ); +} diff --git a/src/e_ferite.fec b/src/e_ferite.fec new file mode 100644 index 0000000000..2ca1c825f9 --- /dev/null +++ b/src/e_ferite.fec @@ -0,0 +1,54 @@ +%{ + + #include "Ecore.h" + +%} + +class Window { + + function getName(); + function getTitle(); + function getClass(); + function getX(); + function getY(); + function getWidth(); + function getHeight(); + + function move( number x, number y ); + function resize( number width, number height ); + + function show(); + function hide(); + function isVisible(); + + function shade(); + function unshade(); + function isShaded(); + + function iconify(); + function uniconify(); + function isIconic(); + + function isMapped(); + function isTransient(); + function isShaped(); + + function delete(); + function kill(); + +} + +namespace e { + + function flipToDesktop( number desk ); + function getDesktopCount(); + + function getWidth(); + function getHeight(); + + // shutdown enlightenment + function shutdown() + %{ + e_event_loop_quit(); + %} +} diff --git a/src/e_ferite.h b/src/e_ferite.h new file mode 100644 index 0000000000..2810af5020 --- /dev/null +++ b/src/e_ferite.h @@ -0,0 +1,13 @@ +#ifndef E_FERITE_H +#define E_FERITE_H + +#include <ferite.h> + +void e_ferite_init(void); +void e_ferite_deinit(void); +void e_ferite_run( char *script ); +void e_ferite_register( FeriteScript *script, FeriteNamespace *ns ); +int e_ferite_script_error( FeriteScript *script, char *errmsg, int val ); +int e_ferite_script_warning( FeriteScript *script, char *warnmsg ); + +#endif /* E_FERITE_H */ diff --git a/src/main.c b/src/main.c index e4965a9fb2..38adb7b4c1 100644 --- a/src/main.c +++ b/src/main.c @@ -9,6 +9,7 @@ #include "ipc.h" #include "menu.h" #include "view.h" +#include "e_ferite.h" #include <X11/Xproto.h> #ifdef E_PROF @@ -122,11 +123,14 @@ main(int argc, char **argv) e_view_init(); e_entry_init(); e_keys_init(); + e_ferite_init(); setup(); e_event_loop(); + e_ferite_deinit(); + return 0; UN(argc); UN(argv); diff --git a/src/menubuild.c b/src/menubuild.c index d09472474a..5062a902b1 100644 --- a/src/menubuild.c +++ b/src/menubuild.c @@ -2,6 +2,7 @@ #include "menubuild.h" #include "exec.h" #include "util.h" +#include "e_ferite.h" Evas_List build_menus = NULL; @@ -28,6 +29,18 @@ e_build_menu_cb_exec(E_Menu *m, E_Menu_Item *mi, void *data) UN(mi); } +static void +e_build_menu_cb_script(E_Menu *m, E_Menu_Item *mi, void *data) +{ + char *script; + + script = data; + e_ferite_run(script); + return; + UN(m); + UN(mi); +} + static void e_build_menu_unbuild(E_Build_Menu *bm) { @@ -126,7 +139,7 @@ e_build_menu_db_build_number(E_Build_Menu *bm, E_DB_File *db, int num) for (i2 = 0; i2 < num2; i2++) { E_Menu_Item *menuitem; - char *text, *icon, *exe; + char *text, *icon, *exe, *script; int ok, sub, sep; 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) icon = e_db_str_get(db, buf); sprintf(buf, "/menu/%i/%i/command", num, i2); exe = e_db_str_get(db, buf); + sprintf(buf, "/menu/%i/%i/script", num, i2); + script = e_db_str_get(db, buf); sprintf(buf, "/menu/%i/%i/submenu", num, i2); ok = e_db_int_get(db, buf, &sub); sep = 0; @@ -161,6 +176,11 @@ e_build_menu_db_build_number(E_Build_Menu *bm, E_DB_File *db, int num) e_menu_item_set_callback(menuitem, e_build_menu_cb_exec, exe); bm->commands = evas_list_prepend(bm->commands, exe); } + if( script ) + { + e_menu_item_set_callback(menuitem, e_build_menu_cb_script, script); + bm->commands = evas_list_prepend(bm->commands, script); + } e_menu_add_item(menu, menuitem); } bm->menus = evas_list_prepend(bm->menus, menu); diff --git a/src/view.c b/src/view.c index d2d36d93c1..82dc23d8a7 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) e_view_selection_update(v); } if( _b == 2 && ev->double_click ) - exit(0); + e_event_loop_quit(); UN(_e); UN(_o); |