Enlightenment CVS committal
Author : dj2
Project : misc
Module : eke
Dir : misc/eke/src
Modified Files:
Eke.h Makefile.am eke_gui.c main.c
Log Message:
- it should now be possibly to compile out the different interfaces.
--disable-ewl-gui and --disable-edje-gui at compile time.
- if ewl is compiled out it will default to the edje gui so you don't need
the cmd line switch anymore
===================================================================
RCS file: /cvsroot/enlightenment/misc/eke/src/Eke.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Eke.h 30 Dec 2004 06:19:09 -0000 1.2
+++ Eke.h 31 Dec 2004 05:17:53 -0000 1.3
@@ -5,14 +5,27 @@
#include <stdlib.h>
#include <Ecore.h>
+
+#if BUILD_EDJE_GUI
#include <Ecore_Evas.h>
#include <Evas.h>
+#endif
+
+#if BUILD_EWL_GUI
#include <Ewl.h>
+#endif
typedef enum Eke_Gui_Type Eke_Gui_Type;
enum Eke_Gui_Type {
+#if BUILD_EWL_GUI
EKE_GUI_TYPE_EWL = 0,
- EKE_GUI_TYPE_EDJE
+#endif
+
+#if BUILD_EDJE_GUI
+ EKE_GUI_TYPE_EDJE,
+#endif
+
+ EKE_GUI_TYPE_NULL
};
typedef struct Eke Eke;
@@ -20,18 +33,22 @@
struct {
Eke_Gui_Type type;
+#if BUILD_EWL_GUI
struct {
Ewl_Widget *win;
Ewl_Widget *menubar;
Ewl_Widget *notebook;
Ewl_Widget *statusbar;
} ewl;
+#endif
+#if BUILD_EDJE_GUI
struct {
char *theme;
Ecore_Evas *ee;
Evas_Object *edje;
} edje;
+#endif
} gui;
Ecore_Hash *feeds;
===================================================================
RCS file: /cvsroot/enlightenment/misc/eke/src/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- Makefile.am 27 Dec 2004 22:45:01 -0000 1.1
+++ Makefile.am 31 Dec 2004 05:17:53 -0000 1.2
@@ -1,36 +1,60 @@
MAINTAINERCLEANFILES = Makefile.in config.h.in stamp-h.in
-AM_CFLAGS = \
- @XML2_CFLAGS@ \
- @EWL_CFLAGS@ \
+if BUILD_EWL_GUI
+EWLCFLAGS = \
+ @EWL_CFLAGS@
+endif
+
+if BUILD_EDJE_GUI
+EDJECFLAGS = \
@EDJE_CFLAGS@ \
@ETOX_CFLAGS@ \
- @ESMART_CFLAGS@ \
+ @ESMART_CFLAGS@
+endif
+
+AM_CFLAGS = \
+ @XML2_CFLAGS@ \
@ECORE_CFLAGS@ \
- -g -O0 -Wall -W
+ -g -O0 -Wall -W \
+ $(EDJECFLAGS) $(EWLCFLAGS)
bin_PROGRAMS = eke
+if BUILD_EWL_GUI
+EWLSOURCES = \
+ eke_gui_ewl.c
+endif
+
+if BUILD_EDJE_GUI
+EDJESOURCES = \
+ eke_gui_edje.c \
+ eke_gui_edje_item.c
+endif
+
eke_SOURCES = \
eke_crypt.c \
eke_file.c \
eke_feed_item.c \
eke_parse.c \
eke_feed.c\
- eke_gui_ewl.c \
- eke_gui_edje.c \
- eke_gui_edje_item.c \
eke_gui.c \
- main.c
+ main.c \
+ $(EWLSOURCES) $(EDJESOURCES)
-eke_LDADD = \
- @XML2_LIBS@ \
- @EWL_LIBS@ \
+EWLLDADD = \
+ @EWL_LIBS@
+
+EDJELDADD = \
@EDJE_LIBS@ \
@ETOX_LIBS@ \
@ESMART_LIBS@ \
+ -lesmart_container
+
+eke_LDADD = \
+ @XML2_LIBS@ \
@ECORE_LIBS@ \
- -lesmart_container -lcrypto
+ -lcrypto \
+ $(EWLLDADD) $(EDJELDADD)
===================================================================
RCS file: /cvsroot/enlightenment/misc/eke/src/eke_gui.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- eke_gui.c 27 Dec 2004 22:45:01 -0000 1.1
+++ eke_gui.c 31 Dec 2004 05:17:53 -0000 1.2
@@ -1,8 +1,15 @@
+#include "config.h"
#include "eke_macros.h"
#include "eke_feed.h"
#include "eke_gui.h"
+
+#if BUILD_EDJE_GUI
#include "eke_gui_edje.h"
+#endif
+
+#if BUILD_EWL_GUI
#include "eke_gui_ewl.h"
+#endif
static int init_count = 0;
@@ -10,16 +17,28 @@
eke_gui_init(Eke *eke, int *argc, char ** argv)
{
init_count ++;
+
+#if BUILD_EDJE_GUI
if (eke->gui.type == EKE_GUI_TYPE_EDJE) {
if (!eke_gui_edje_init()) return 0;
- } else if (eke->gui.type == EKE_GUI_TYPE_EWL) {
+ }
+#endif
+
+#if BUILD_EWL_GUI
+#if BUILD_EDJE_GUI
+ else
+#endif
+ if (eke->gui.type == EKE_GUI_TYPE_EWL) {
if (!eke_gui_ewl_init(argc, argv)) return 0;
}
+#endif
eke->feeds = ecore_hash_new(ecore_direct_hash, ecore_direct_compare);
return init_count;
+ argc = NULL;
+ argv = NULL;
}
int
@@ -29,11 +48,18 @@
init_count --;
if (init_count > 0) return init_count;
+#if BUILD_EDJE_GUI
if (eke->gui.type == EKE_GUI_TYPE_EDJE)
eke_gui_edje_shutdown();
+#endif
- else if (eke->gui.type == EKE_GUI_TYPE_EWL)
+#if BUILD_EWL_GUI
+#if BUILD_EDJE_GUI
+ else
+#endif
+ if (eke->gui.type == EKE_GUI_TYPE_EWL)
eke_gui_ewl_shutdown();
+#endif
ecore_hash_destroy(eke->feeds);
}
@@ -43,21 +69,35 @@
void
eke_gui_create(Eke *eke)
{
+#if BUILD_EDJE_GUI
if (eke->gui.type == EKE_GUI_TYPE_EDJE)
eke_gui_edje_create(eke);
+#endif
- else if (eke->gui.type == EKE_GUI_TYPE_EWL)
+#if BUILD_EWL_GUI
+#if BUILD_EDJE_GUI
+ else
+#endif
+ if (eke->gui.type == EKE_GUI_TYPE_EWL)
eke_gui_ewl_create(eke);
+#endif
}
void
eke_gui_feed_register(Eke *eke, Eke_Feed *feed)
{
+#if BUILD_EDJE_GUI
if (eke->gui.type == EKE_GUI_TYPE_EDJE)
eke_gui_edje_feed_register(eke, feed);
+#endif
- else if (eke->gui.type == EKE_GUI_TYPE_EWL)
+#if BUILD_EWL_GUI
+#if BUILD_EDJE_GUI
+ else
+#endif
+ if (eke->gui.type == EKE_GUI_TYPE_EWL)
eke_gui_ewl_feed_register(eke, feed);
+#endif
}
int
@@ -73,18 +113,32 @@
feed = feed_ev->feed;
if (feed->data.type == EKE_FEED_DATA_RESPONSE_ERROR) {
+#if BUILD_EDJE_GUI
if (eke->gui.type == EKE_GUI_TYPE_EDJE)
eke_gui_edje_feed_error(eke, feed);
+#endif
- else if (eke->gui.type == EKE_GUI_TYPE_EWL)
+#if BUILD_EWL_GUI
+#if BUILD_EDJE_GUI
+ else
+#endif
+ if (eke->gui.type == EKE_GUI_TYPE_EWL)
eke_gui_ewl_feed_error(eke, feed);
+#endif
} else {
+#if BUILD_EDJE_GUI
if (eke->gui.type == EKE_GUI_TYPE_EDJE)
eke_gui_edje_feed_change(eke, feed);
+#endif
- else if (eke->gui.type == EKE_GUI_TYPE_EWL)
+#if BUILD_EWL_GUI
+#if BUILD_EDJE_GUI
+ else
+#endif
+ if (eke->gui.type == EKE_GUI_TYPE_EWL)
eke_gui_ewl_feed_change(eke, feed);
+#endif
}
return 1;
@@ -94,11 +148,18 @@
void
eke_gui_begin(Eke *eke)
{
+#if BUILD_EDJE_GUI
if (eke->gui.type == EKE_GUI_TYPE_EDJE)
eke_gui_edje_begin();
+#endif
- else if (eke->gui.type == EKE_GUI_TYPE_EWL)
+#if BUILD_EWL_GUI
+#if BUILD_EDJE_GUI
+ else
+#endif
+ if (eke->gui.type == EKE_GUI_TYPE_EWL)
eke_gui_ewl_begin();
+#endif
}
===================================================================
RCS file: /cvsroot/enlightenment/misc/eke/src/main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- main.c 30 Dec 2004 05:22:48 -0000 1.3
+++ main.c 31 Dec 2004 05:17:53 -0000 1.4
@@ -6,18 +6,32 @@
#define CACHE_DIR "~/.e/apps/eke/cache"
static int eke_exit_cb(void *data, int type, void *ev);
-static int eke_find_theme(Eke *eke, const char *thm);
static void usage(void);
+#if BUILD_EDJE_GUI
+static int eke_find_theme(Eke *eke, const char *thm);
+#endif
+
+
int
main(int argc, char ** argv)
{
Eke eke;
- char *thm = NULL;
int i, last_arg = 0;
+#if BUILD_EDJE_GUI
+ char *thm = NULL;
+#endif
+#if BUILD_EWL_GUI
eke.gui.type = EKE_GUI_TYPE_EWL;
+#else
+#if BUILD_EDJE_GUI
+ eke.gui.type = EKE_GUI_TYPE_EDJE;
+#endif
+#endif
+
for (i = 1; i < argc; i++) {
+#if BUILD_EDJE_GUI
if (!strncmp(argv[i], "--edje-theme", 12)) {
if (argc > (i + 1)) {
i++;
@@ -29,23 +43,33 @@
eke.gui.type = EKE_GUI_TYPE_EDJE;
last_arg = i;
- } else if (!strncmp(argv[i], "--gui-ewl", 9)) {
+ }
+#endif
+
+#if BUILD_EWL_GUI
+ if (!strncmp(argv[i], "--gui-ewl", 9)) {
eke.gui.type = EKE_GUI_TYPE_EWL;
last_arg = i;
+ }
+#endif
- } else if (!strncmp(argv[i], "--help", 6)
+ if (!strncmp(argv[i], "--help", 6)
|| (!strncmp(argv[i], "-h", 2))) {
usage();
return 0;
}
}
- if (!thm) thm = strdup("default");
- if (!eke_find_theme(&eke, thm)) {
- printf("Unable to locate theme (%s)\n", thm);
- return 0;
+#if BUILD_EDJE_GUI
+ if (eke.gui.type == EKE_GUI_TYPE_EDJE) {
+ if (!thm) thm = strdup("default");
+ if (!eke_find_theme(&eke, thm)) {
+ printf("Unable to locate theme (%s)\n", thm);
+ return 0;
+ }
+ FREE(thm);
}
- FREE(thm);
+#endif
if (!eke_feed_init(CACHE_DIR)) {
printf("Cannot setup eke\n");
@@ -73,7 +97,8 @@
feed = eke_feed_new_from_uri(argv[last_arg]);
} else {
- printf("incorrect format for URI\n");
+ printf("incorrect format for URI (%s)\n", argv[last_arg]);
+ last_arg ++;
continue;
}
eke_gui_feed_register(&eke, feed);
@@ -101,6 +126,7 @@
ev = NULL;
}
+#if BUILD_EDJE_GUI
static int
eke_find_theme(Eke *eke, const char *thm)
{
@@ -123,6 +149,7 @@
}
return 0;
}
+#endif
static void
usage(void)
@@ -130,9 +157,14 @@
printf("\n%s %s\n"
"Usage: %s [options] [feed] [feed] ...\n\n"
" options\n"
+#if BUILD_EWL_GUI
" --gui-ewl \t\t -- use the EWL gui\n"
+#endif
+
+#if BUILD_EDJE_GUI
" --gui-edje \t\t -- use the Edje gui\n"
" --edje-theme <theme> -- set the theme to use with the Edje gui\n"
+#endif
" --help \t\t -- this help\n\n",
PACKAGE, VERSION, PACKAGE);
}
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs