Me again. Missed 4 lines in the settings patch. Sorry, this one works
now.
-Tim
# This patch adds some config options
# With it, one can toggle fullscreen,
# and change between x11 and xrender (for now)
# It adds a function to restart rage
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -35,7 +35,9 @@ e_table.h \
e_layout.c \
e_layout.h \
e_flowlayout.c \
-e_flowlayout.h
+e_flowlayout.h \
+conf_options.c \
+conf_options.h
rage_LDADD = @my_libs@ @EVAS_LIBS@ @ECORE_LIBS@ @EDJE_LIBS@ @EMOTION_LIBS@
--- /dev/null
+++ b/src/bin/conf_options.c
@@ -0,0 +1,61 @@
+#include "conf_options.h"
+#include "main.h"
+
+void
+config_option_fullscreen(void *data)
+{
+ Ecore_Evas *ee = (Ecore_Evas *)data;
+
+ if (ecore_evas_fullscreen_get(ee))
+ {
+ ecore_evas_fullscreen_set(ee, 0);
+ ecore_evas_cursor_set(ee, NULL, 0, 0, 0);
+ }
+ else
+ {
+ ecore_evas_fullscreen_set(ee, 1);
+ ecore_evas_cursor_set(ee, "", 999, 0, 0);
+ }
+}
+
+void
+config_option_themes(void *data)
+{
+}
+
+void
+config_option_modes_switch(void* data)
+{
+ char* engine = (char*)data;
+ if (!strcmp(engine, "software_x11"))
+ main_reset("-x11");
+ else if (!strcmp(engine, "xrender_x11"))
+ main_reset("-xr");
+}
+
+void
+config_option_modes(void *data)
+{
+ Eina_List *el, *l;
+
+ el = ecore_evas_engines_get();
+
+ menu_push("menu", "Modes", NULL, NULL);
+ for (l = el; l; l=l->next)
+ {
+ menu_item_add("icon/modes", l->data,
+ NULL, NULL, config_option_modes_switch,
+ l->data, NULL, NULL, NULL);
+ }
+
+ menu_go();
+ menu_item_select(el->data);
+
+ ecore_evas_engines_free(el);
+}
+
+void
+config_option_volumes(void *data)
+{
+}
+
--- /dev/null
+++ b/src/bin/conf_options.h
@@ -0,0 +1,10 @@
+#ifndef conf_options_h
+#define conf_options_h
+
+void config_option_fullscreen(void *data);
+void config_option_themes(void *data);
+void config_option_modes(void *data);
+void config_option_volumes(void *data);
+
+#endif
+
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -342,24 +342,24 @@ static void
main_menu_config(void *data)
{
menu_push("menu", "Settings", NULL, NULL);
- menu_item_add("icon/config", "Option 1",
- "Option 1", NULL,
- NULL, NULL, NULL, NULL, NULL);
- menu_item_add("icon/config", "Option 2",
- "Option 2", NULL,
- NULL, NULL, NULL, NULL, NULL);
- menu_item_add("icon/config", "Option 3",
- "Option 3", NULL,
- NULL, NULL, NULL, NULL, NULL);
- menu_item_add("icon/config", "Option 4",
- "Option 4", NULL,
- NULL, NULL, NULL, NULL, NULL);
- menu_item_enabled_set("Settings", "Option 1", 1);
- menu_item_enabled_set("Settings", "Option 2", 1);
- menu_item_enabled_set("Settings", "Option 3", 1);
- menu_item_enabled_set("Settings", "Option 4", 1);
+ menu_item_add("icon/fullscreen", "Fullscreen",
+ "Fullscreen On/Off", NULL,
+ config_option_fullscreen, ecore_evas, NULL, NULL, NULL);
+ menu_item_add("icon/themes", "Themes",
+ "Select your theme", NULL,
+ config_option_themes, NULL, NULL, NULL, NULL);
+ menu_item_add("icon/modes", "Modes",
+ "Change the engine Rage uses", NULL,
+ config_option_modes, ecore_evas, NULL, NULL, NULL);
+ menu_item_add("icon/volumes", "Volumes",
+ "Edit your Volumes", NULL,
+ config_option_volumes, NULL, NULL, NULL, NULL);
+ menu_item_enabled_set("Settings", "Fullscreen", 1);
+ menu_item_enabled_set("Settings", "Themes", 1);
+ menu_item_enabled_set("Settings", "Modes", 1);
+ menu_item_enabled_set("Settings", "Volumes", 1);
menu_go();
- menu_item_select("Option 1");
+ menu_item_select("Fullscreen");
}
typedef struct _Genre Genre;
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -9,6 +9,7 @@
#include "mini.h"
#include "minivid.h"
#include "sha1.h"
+#include "conf_options.h"
extern Evas *evas;
extern char *theme;
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -271,6 +271,12 @@ main_usage(void)
exit(-1);
}
+void
+main_reset(char *arg)
+{
+ execlp("rage", "rage", arg, NULL);
+}
+
static int
main_volume_add(void *data, int type, void *ev)
{
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -20,3 +20,4 @@ extern char *config;
void main_mode_push(int mode);
void main_mode_pop(void);
+void main_reset(char* arg);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel