Okay Raster, don't shoot me. I've cleaned up the whole thing. I've
authorcpk <cpk>
Mon, 30 Jul 2001 16:59:37 +0000 (16:59 +0000)
committercpk <cpk@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 30 Jul 2001 16:59:37 +0000 (16:59 +0000)
added header files for most of the logical units, which greatly
reduces the size of e.h. The dependencies are probably still a bit
too dense, I'll look at that next. Things don't get rebuilt completely
any more when efsd is updated. I've also started command line options.
Only version info and the display variable are recognized so far.
I see no warnings here on my machine. Hope I didn't break anything.

SVN revision: 5014

38 files changed:
AUTHORS
acconfig.h
configure.in
src/Makefile.am
src/actions.c
src/actions.h [new file with mode: 0644]
src/background.c
src/background.h [new file with mode: 0644]
src/border.c
src/border.h [new file with mode: 0644]
src/config.c
src/config.h [new file with mode: 0644]
src/desktops.c
src/desktops.h [new file with mode: 0644]
src/e.h
src/entry.c
src/entry.h [new file with mode: 0644]
src/exec.c
src/exec.h [new file with mode: 0644]
src/fs.c
src/fs.h [new file with mode: 0644]
src/icccm.c
src/icccm.h [new file with mode: 0644]
src/ipc.c
src/ipc.h [new file with mode: 0644]
src/keys.c
src/keys.h [new file with mode: 0644]
src/main.c
src/menu.c
src/menu.h [new file with mode: 0644]
src/menubuild.c
src/menubuild.h [new file with mode: 0644]
src/resist.c
src/resist.h [new file with mode: 0644]
src/util.c
src/util.h [new file with mode: 0644]
src/view.c
src/view.h [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
index cd73268..2b3a239 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,3 @@
 The Rasterman <raster@rasterman.com>
-Christian Kreibich <cK@whoop.org>, <kreibich@aciri.org>
+Christian Kreibich <cK@whoop.org>
 Burra <burra@colorado.edu>
index ae5c7e8..8618cca 100644 (file)
@@ -1,3 +1,7 @@
+#undef ENLIGHTENMENT_VERSION
+#undef ENLIGHTENMENT_MAJOR
+#undef ENLIGHTENMENT_MINOR
+#undef ENLIGHTENMENT_MICRO
 #undef ENABLE_NLS
 #undef HAVE_CATGETS
 #undef HAVE_GETTEXT
index 803ad9e..7944f8b 100644 (file)
@@ -1,9 +1,26 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(enlightenment, 0.17.pre_0)
+
+ENLIGHTENMENT_MAJOR=0
+ENLIGHTENMENT_MINOR=17
+ENLIGHTENMENT_MICRO=pre_0
+ENLIGHTENMENT_VERSION=$ENLIGHTENMENT_MAJOR.$ENLIGHTENMENT_MINOR.$ENLIGHTENMENT_MICRO
+
+VERSION=$ENLIGHTENMENT_VERSION
+
+AM_INIT_AUTOMAKE(enlightenment, $VERSION)
 AM_CONFIG_HEADER(config.h)
 
+AC_DEFINE_UNQUOTED(ENLIGHTENMENT_VERSION, "$ENLIGHTENMENT_VERSION")
+AC_SUBST(ENLIGHTENMENT_VERSION)
+AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MAJOR, "$ENLIGHTENMENT_MAJOR")
+AC_SUBST(ENLIGHTENMENT_MAJOR)
+AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MINOR, "$ENLIGHTENMENT_MINOR")
+AC_SUBST(ENLIGHTENMENT_MINOR)
+AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MICRO, "$ENLIGHTENMENT_MICRO")
+AC_SUBST(ENLIGHTENMENT_MICRO)
+
 AC_ISC_POSIX
 AC_PROG_CC
 AM_PROG_CC_STDC
index a8c6584..2803fa8 100644 (file)
@@ -7,27 +7,27 @@ INCLUDES = \
 bin_PROGRAMS = enlightenment
 
 enlightenment_SOURCES = \
-actions.c \
-background.c \
-border.c \
-config.c \
-desktops.c \
-entry.c \
-exec.c \
-fs.c \
-icccm.c \
-icons.c \
-ipc.c \
-keys.c \
-main.c \
-menu.c \
-menubuild.c \
-pack.c \
-resist.c \
-shelf.c \
-util.c \
-view.c \
-e.h
+       actions.h actions.c \
+       background.h background.c \
+       border.h border.c \
+       config.h config.c \
+       destops.h desktops.c \
+       entry.h entry.c \
+       exec.h exec.c \
+       fs.h fs.c \
+       icccm.h icccm.c \
+       icons.h icons.c \
+       ipc.h ipc.c \
+       keys.h keys.c \
+       main.c \
+       menu.h menu.c \
+       menubuild.h menubuild.c \
+       pack.c \
+       resist.h resist.c \
+       shelf.c \
+       util.h util.c \
+       view.h view.c \
+       e.h
 
 enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ -lm -lc $(INTLLIBS)
 
index 7ec638a..8b6a1c3 100644 (file)
@@ -1,4 +1,11 @@
-#include "e.h"
+#include "actions.h"
+#include "config.h"
+#include "border.h"
+#include "desktops.h"
+#include "exec.h"
+#include "icccm.h"
+#include "keys.h"
+#include "view.h"
 
 static Evas_List action_protos = NULL;
 static Evas_List current_actions = NULL;
@@ -57,6 +64,14 @@ static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, in
 
 static void e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
 
+#define SET_BORDER_GRAVITY(_b, _grav) \
+e_window_gravity_set(_b->win.container, _grav); \
+e_window_gravity_set(_b->win.input, _grav); \
+e_window_gravity_set(_b->win.l, _grav); \
+e_window_gravity_set(_b->win.r, _grav); \
+e_window_gravity_set(_b->win.t, _grav); \
+e_window_gravity_set(_b->win.b, _grav);
+
 static void
 _e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o)
 {
@@ -343,7 +358,7 @@ e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry)
 {
    Evas_List l;
 
-   e_actions_del_timer_object(o);
+   e_action_del_timer_object(o);
    again:
    for (l = current_actions; l; l = l->next)
      {
@@ -389,7 +404,7 @@ e_action_add_proto(char *action,
 }
 
 void
-e_actions_del_timer(void *o, char *name)
+e_action_del_timer(void *o, char *name)
 {
    Evas_List l;
    
@@ -414,7 +429,7 @@ e_actions_del_timer(void *o, char *name)
 }
 
 void
-e_actions_add_timer(void *o, char *name)
+e_action_add_timer(void *o, char *name)
 {
    E_Active_Action_Timer *at;
    
@@ -425,7 +440,7 @@ e_actions_add_timer(void *o, char *name)
 }
 
 void
-e_actions_del_timer_object(void *o)
+e_action_del_timer_object(void *o)
 {
    Evas_List l;
    
@@ -447,7 +462,7 @@ e_actions_del_timer_object(void *o)
 }
 
 void
-e_actions_init(void)
+e_action_init(void)
 {
    e_action_add_proto("Window_Move", e_act_move_start, e_act_move_stop, e_act_move_go);
    e_action_add_proto("Window_Resize", e_act_resize_start, e_act_resize_stop, e_act_resize_go);
@@ -473,13 +488,12 @@ e_actions_init(void)
 }
 
 
-
-
-
-
 /* FIXME: these REALLY need to go into other file(s) but it's not worht it */
 /* yet at this point. it can be done later */
 
+/* Erm is that really true? They're all static, all called through the
+   above functions -- so it's good to have them encapsulated here? --cK */
+
 static void 
 e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
 {
@@ -923,8 +937,8 @@ e_act_cb_shade(int val, void *data)
        OBJ_REF(b);
        t = e_get_time();
        e_window_gravity_set(b->win.client, SouthWestGravity);
-       e_actions_del_timer(b, "shader");
-       e_actions_add_timer(b, "shader");
+       e_action_del_timer(b, "shader");
+       e_action_add_timer(b, "shader");
      }
    
    dif = e_get_time() - t;   
@@ -939,7 +953,7 @@ e_act_cb_shade(int val, void *data)
      e_add_event_timer("shader", 0.01, e_act_cb_shade, 1, data);
    else
      {
-       e_actions_del_timer(b, "shader");
+       e_action_del_timer(b, "shader");
        e_window_gravity_reset(b->win.client);
        OBJ_UNREF(b);
      }
@@ -963,8 +977,8 @@ e_act_cb_unshade(int val, void *data)
        OBJ_REF(b);
        t = e_get_time();
        e_window_gravity_set(b->win.client, SouthWestGravity);
-       e_actions_del_timer(b, "shader");
-       e_actions_add_timer(b, "shader");
+       e_action_del_timer(b, "shader");
+       e_action_add_timer(b, "shader");
      }
    
    dif = e_get_time() - t;   
@@ -980,7 +994,7 @@ e_act_cb_unshade(int val, void *data)
      e_add_event_timer("shader", 0.01, e_act_cb_unshade, 1, data);
    else
      {
-       e_actions_del_timer(b, "shader");
+       e_action_del_timer(b, "shader");
        e_window_gravity_reset(b->win.client);
        OBJ_UNREF(b);
      }
diff --git a/src/actions.h b/src/actions.h
new file mode 100644 (file)
index 0000000..e37bf57
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef E_ACTIONS_H
+#define E_ACTIONS_H
+
+#include "e.h"
+
+struct _E_Active_Action_Timer
+{
+   void *object;
+   char *name;
+};
+
+struct _E_Action
+{
+   OBJ_PROPERTIES;
+   
+   char           *name;
+   char           *action;
+   char           *params;
+   int             event;
+   int             button;
+   char           *key;
+   int             modifiers;
+   E_Action_Proto *action_proto;
+   void           *object;
+   int             started;
+   int             grabbed;
+};
+
+struct _E_Action_Proto
+{
+   OBJ_PROPERTIES;
+   
+   char  *action;
+   void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+   void (*func_stop)  (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+   void (*func_go)    (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
+};
+
+
+void e_action_start(char *action, int act, int button, char *key,
+                   Ev_Key_Modifiers mods, void *o, void *data,
+                   int x, int y, int rx, int ry);
+void e_action_stop(char *action, int act, int button, char *key,
+                  Ev_Key_Modifiers mods, void *o, void *data,
+                  int x, int y, int rx, int ry);
+void e_action_go(char *action, int act, int button, char *key,
+                Ev_Key_Modifiers mods, void *o, void *data,
+                int x, int y, int rx, int ry, int dx, int dy);
+void e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry);
+void e_action_add_proto(char *action, 
+                       void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
+                       void (*func_stop)  (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
+                       void (*func_go)    (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy));
+void e_action_del_timer(void *o, char *name);
+void e_action_add_timer(void *o, char *name);
+void e_action_del_timer_object(void *o);
+void e_action_init(void);
+
+#endif
index e7475fb..c9732cc 100644 (file)
@@ -1,4 +1,35 @@
-#include "e.h"
+#include "background.h"
+
+typedef struct _E_Background_Layer
+{
+   int mode;
+   int type;
+   int inlined;
+   struct {
+      float x, y;
+   } scroll;
+   struct {
+      float x, y;
+   } pos;
+   struct {
+      float w, h;
+      struct {
+        int w, h;
+      } orig;
+   } size, fill;
+   char *color_class;
+   char *file;
+   double angle;
+   struct {
+      int r, g, b, a;
+   } fg, bg;
+   
+   double x, y, w, h, fw, fh;
+   
+   Evas_Object obj;
+}
+E_Background_Layer;
+
 
 void
 e_background_free(E_Background *bg)
@@ -89,7 +120,7 @@ e_background_load(char *file)
        sprintf(buf, "/layers/%i/fill.h", i);  e_db_float_get(db, buf, &(bl->fill.h));
        sprintf(buf, "/layers/%i/fill.orig.w", i); e_db_int_get(db, buf, &(bl->fill.orig.w));
        sprintf(buf, "/layers/%i/fill.orig.h", i); e_db_int_get(db, buf, &(bl->fill.orig.h));
-       sprintf(buf, "/layers/%i/angle", i);  e_db_float_get(db, buf, &(bl->angle));
+       sprintf(buf, "/layers/%i/angle", i);  e_db_float_get(db, buf, (float*)&(bl->angle));
        sprintf(buf, "/layers/%i/fg.r", i); e_db_int_get(db, buf, &(bl->fg.r));
        sprintf(buf, "/layers/%i/fg.g", i); e_db_int_get(db, buf, &(bl->fg.g));
        sprintf(buf, "/layers/%i/fg.b", i); e_db_int_get(db, buf, &(bl->fg.b));
diff --git a/src/background.h b/src/background.h
new file mode 100644 (file)
index 0000000..18a9779
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef E_BACKGROUND_H
+#define E_BACKGROUND_H
+
+#include "e.h"
+
+struct _E_Background
+{
+   OBJ_PROPERTIES;
+   
+   Evas  evas;
+   char *file;
+   
+   struct {
+      int sx, sy;
+      int w, h;
+   } geom;
+   
+   Evas_List layers;
+   
+   Evas_Object base_obj;
+};
+
+void           e_background_free(E_Background *bg);
+E_Background  *e_background_new(void);
+E_Background  *e_background_load(char *file);
+void           e_background_realize(E_Background *bg, Evas evas);
+void           e_background_set_scroll(E_Background *bg, int sx, int sy);
+void           e_background_set_size(E_Background *bg, int w, int h);
+void           e_background_set_color_class(E_Background *bg, char *cc, int r, int g, int b, int a);
+
+#endif 
index d7c8b3d..06c2a0c 100644 (file)
@@ -1,4 +1,10 @@
-#include "e.h"
+#include "border.h"
+#include "config.h"
+#include "actions.h"
+#include "desktops.h"
+#include "resist.h"
+#include "icccm.h"
+#include "util.h"
 
 /* Window border rendering, querying, setting  & modification code */
 
@@ -1196,7 +1202,7 @@ e_border_adopt(Window win, int use_client_pos)
        b->changed = 1;
      }
      {
-       int x, y, w, h;
+       int x, y;
         int pl, pr, pt, pb;
        
        pl = pr = pt = pb = 0;
diff --git a/src/border.h b/src/border.h
new file mode 100644 (file)
index 0000000..70cb634
--- /dev/null
@@ -0,0 +1,140 @@
+#ifndef E_BORDER_H
+#define E_BORDER_H
+
+#include "e.h"
+
+struct _E_Grab
+{
+   int              button;
+   Ev_Key_Modifiers mods;
+   int              any_mod;
+   int              remove_after;
+   int              allow;
+};
+
+struct _E_Border
+{
+   OBJ_PROPERTIES;
+
+   struct {
+      Window main;
+      Window l, r, t, b;
+      Window input;
+      Window container;
+      Window client;
+   } win;
+   struct {
+      Evas l, r, t, b;
+   } evas;
+   struct {
+      struct {
+        Evas_Object l, r, t, b;
+      } title;
+      struct {
+        Evas_Object l, r, t, b;
+      } title_clip;
+   } obj;   
+   struct {
+      Pixmap l, r, t, b;
+   } pixmap;
+   struct {
+      int new;
+      Ebits_Object l, r, t, b;
+   } bits;
+   
+   struct {
+      struct {
+        int x, y, w, h;
+        int visible;
+        int dx, dy;
+      } requested;
+      int   x, y, w, h;
+      int   visible;
+      int   selected;
+      int   select_lost_from_grab;
+      int   shaded;
+      int   has_shape;
+      int   shape_changes;
+      int   shaped_client;
+   } current, previous;
+   
+   struct {
+      struct {
+        int w, h;
+        double aspect;
+      } base, min, max, step;
+      int layer;
+      char *title;
+      char *name;
+      char *class;
+      char *command;
+      Window group;
+      int takes_focus;
+      int sticky;
+      Colormap colormap;
+      int fixed;
+      int arrange_ignore;
+      int hidden;
+      int iconified;
+      int titlebar;
+      int border;
+      int handles;
+      int w, h;
+      struct {
+        int requested;
+        int x, y;
+        int gravity;
+      } pos;
+   } client;
+   
+   struct {
+      int move, resize;
+   } mode;
+   
+   struct {
+      int x, y, w, h;
+      int is;
+   } max;
+   
+   int ignore_unmap;
+   int shape_changed;
+   int placed;
+   
+   Evas_List grabs;
+   E_Desktop *desk;
+   
+   char *border_file;
+
+   int first_expose;
+   
+   int changed;
+};
+
+
+void      e_border_apply_border(E_Border *b);
+void      e_border_reshape(E_Border *b);
+E_Border *e_border_adopt(Window win, int use_client_pos);
+E_Border *e_border_new(void);
+void      e_border_free(E_Border *b);
+void      e_border_remove_mouse_grabs(E_Border *b);
+void      e_border_attach_mouse_grabs(E_Border *b);
+void      e_border_remove_all_mouse_grabs(void);
+void      e_border_attach_all_mouse_grabs(void);
+void      e_border_redo_grabs(void);
+E_Border *e_border_find_by_window(Window win);
+void      e_border_set_bits(E_Border *b, char *file);
+void      e_border_set_color_class(E_Border *b, char *class, int rr, int gg, int bb, int aa);
+void      e_border_adjust_limits(E_Border *b);
+void      e_border_update(E_Border *b);
+void      e_border_set_layer(E_Border *b, int layer);
+void      e_border_raise(E_Border *b);
+void      e_border_lower(E_Border *b);
+void      e_border_raise_above(E_Border *b, E_Border *above);
+void      e_border_lower_below(E_Border *b, E_Border *below);
+void      e_border_init(void);
+void      e_border_adopt_children(Window win);
+E_Border *e_border_current_focused(void);
+void      e_border_focus_grab_ended(void);
+
+
+#endif
index f433856..e0e3b96 100644 (file)
@@ -1,4 +1,5 @@
-#include "e.h"
+#include "config.h"
+#include "util.h"
 
 static char cfg_root[] = "";
 
diff --git a/src/config.h b/src/config.h
new file mode 100644 (file)
index 0000000..ad33fc8
--- /dev/null
@@ -0,0 +1,148 @@
+#ifndef E_CONFIG_H
+#define E_CONFIG_H
+
+#include "e.h"
+
+/* something to check validity of config files where we get data from */
+/* for now its just a 5 second timout so it will only invalidate */
+/* if we havent looked for 5 seconds... BUT later when efsd is more solid */
+/* we should use that to tell us when its invalid */
+struct _E_Config_File
+{
+   char   *src;
+   double  last_fetch;
+};
+
+struct _E_Config_Element 
+{
+   char   *src;
+   char   *key;
+   double  last_fetch;
+   int     type;
+   int     def_int_val;
+   float   def_float_val;
+   char   *def_str_val;
+   void   *def_data_val;
+   int     def_data_val_size;
+   int     cur_int_val;
+   float   cur_float_val;
+   char   *cur_str_val;
+   void   *cur_data_val;
+   int     cur_data_val_size;
+};
+
+#define E_CFG_FILE(_var, _src) \
+static E_Config_File _var = {_src, 0.0}
+#define E_CONFIG_CHECK_VALIDITY(_var, _src) \
+{ \
+double __time; \
+__time = e_get_time(); \
+if (_var.last_fetch < (__time - 5.0)) { \
+_var.last_fetch = __time;
+#define E_CONFIG_CHECK_VALIDITY_END \
+} \
+}
+
+#define E_CFG_INT_T   123
+#define E_CFG_FLOAT_T 1234
+#define E_CFG_STR_T   12345
+#define E_CFG_DATA_T  123456
+
+#define E_CFG_INT(_var, _src, _key, _default) \
+static E_Config_Element _var = { _src, _key, 0.0, E_CFG_INT_T, \
+_default, 0.0, NULL, NULL, 0, \
+0, 0.0, NULL, NULL, 0, \
+}
+
+#define E_CFG_FLOAT(_var, _src, _key, _default) \
+static E_Config_Element _var = { _src, _key, 0.0, E_CFG_FLOAT_T, \
+0, _default, NULL, NULL, 0, \
+0, 0.0, NULL, NULL, 0, \
+}
+
+#define E_CFG_STR(_var, _src, _key, _default) \
+static E_Config_Element _var = { _src, _key, 0.0, E_CFG_STR_T, \
+0, 0.0, _default, NULL, 0, \
+0, 0.0, NULL, NULL, 0, \
+}
+
+#define E_CFG_DATA(_var, _src, _key, _default, _default_size) \
+static E_Config_Element _var = { _src, _key, 0.0, E_CFG_DATAT_T, \
+0, 0.0, NULL, _default, _default_size, \
+0, 0.0, NULL, NULL, 0, \
+}
+
+/* yes for now it only fetches them every 5 seconds - in the end i need a */
+/* validity flag for the database file to know if it changed and only then */
+/* get the value again. this is waiting for efsd to become more solid */
+#define E_CFG_VALIDITY_CHECK(_var) \
+{ \
+double __time; \
+__time = e_get_time(); \
+if (_var.last_fetch < (__time - 5.0)) { \
+int __cfg_ok = 0; \
+_var.last_fetch = __time;
+
+#define E_CFG_END_VALIDITY_CHECK \
+} \
+}
+
+#define E_CONFIG_INT_GET(_var, _val) \
+{{ \
+E_CFG_VALIDITY_CHECK(_var) \
+E_DB_INT_GET(e_config_get(_var.src), _var.key, _var.cur_int_val, __cfg_ok); \
+if (!__cfg_ok) _var.cur_int_val = _var.def_int_val; \
+E_CFG_END_VALIDITY_CHECK \
+} \
+_val = _var.cur_int_val;}
+
+#define E_CONFIG_FLOAT_GET(_var, _val) \
+{{ \
+E_CFG_VALIDITY_CHECK(_var) \
+E_DB_FLOAT_GET(e_config_get(_var.src), _var.key, _var.cur_float_val, __cfg_ok); \
+if (!__cfg_ok) _var.cur_float_val = _var.def_float_val; \
+E_CFG_END_VALIDITY_CHECK \
+} \
+_val = _var.cur_float_val;}
+
+#define E_CONFIG_STR_GET(_var, _val) \
+{{ \
+E_CFG_VALIDITY_CHECK(_var) \
+if (_var.cur_str_val) free(_var.cur_str_val); \
+_var.cur_str_val = NULL; \
+E_DB_STR_GET(e_config_get(_var.src), _var.key, _var.cur_str_val, __cfg_ok); \
+if (!__cfg_ok) _var.cur_str_val = _var.def_str_val \
+E_CFG_END_VALIDITY_CHECK \
+} \
+_val = _var.cur_str_val;}
+
+#define E_CONFIG_DATA_GET(_var, _val, _size) \
+{{ \
+E_CFG_VALIDITY_CHECK(_var) \
+if (_var.cur_data_val) free(_var.cur_data_val); \
+_var.cur_data_val = NULL; \
+_var.cur_data_size = 0; \
+{ E_DB_File *__db; \
+__db = e_db_open_read(e_config_get(_var.src)); \
+if (__db) { \
+_var.cur_data_val = e_db_data_get(__db, _var.key, &(_var.cur_data_size)); \
+if (_var.cur_data_val) __cfg_ok = 1; \
+e_db_close(__db); \
+} \
+} \
+if (!__cfg_ok) { \
+_var.cur_data_val = e_memdup(_var.def_data_val, _var.def_data_size); \
+_var.cur_data_size = _var.def_data_size; \
+} \
+E_CFG_END_VALIDITY_CHECK \
+} \
+_val = _var.cur_data_val; \
+_size = _var.cur_data_size;}
+
+
+char *e_config_get(char *type);
+void  e_config_init(void);
+void  e_config_set_user_dir(char *dir);
+char *e_config_user_dir(void);
+
+#endif
index b3f099f..f4d330e 100644 (file)
@@ -1,4 +1,11 @@
-#include "e.h"
+#include "desktops.h"
+#include "config.h"
+#include "actions.h"
+#include "border.h"
+#include "background.h"
+#include "view.h"
+#include "icccm.h"
+#include "util.h"
 
 static Evas_List desktops = NULL;
 static Window    e_base_win = 0;
@@ -164,20 +171,25 @@ e_desktops_init_file_display(E_Desktop *desk)
    desk->view->size.w = desk->real.w;
    desk->view->size.h = desk->real.h;
    desk->view->is_desktop = 1;
+
    /* FIXME: load bg here */
-     {
-       char buf[4096];
-       
-       sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
-       desk->view->bg = e_background_load(buf);
-       printf("**** load %s = %p\n", buf, desk->view->bg);
-     }
+   {
+     char buf[4096];
+     
+     sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
+     desk->view->bg = e_background_load(buf);
+     printf("**** load %s = %p\n", buf, desk->view->bg);
+   }
+
    /* fixme: later */
    /* uncomment this and comment out the next line for some tress testing */
-/*   desk->view->dir = strdup("/dev"); */
-   desk->view->dir = strdup(e_file_home());
+   /* desk->view->dir = strdup("/dev");  */
+   desk->view->dir = strdup(e_file_home()); 
    e_view_realize(desk->view);
-   if (desk->view->options.back_pixmap) e_view_update(desk->view);
+
+   if (desk->view->options.back_pixmap)
+     e_view_update(desk->view);
+
    desk->win.desk = desk->view->win.base;
    e_window_reparent(desk->win.desk, desk->win.container, 0, 0);
    e_window_show(desk->win.desk);
diff --git a/src/desktops.h b/src/desktops.h
new file mode 100644 (file)
index 0000000..23cc42c
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef E_DESKTOPS_H
+#define E_DESKTOPS_H
+
+#include "e.h"
+
+struct _E_Desktop
+{
+   OBJ_PROPERTIES;
+   
+   char *name;
+   char *dir;
+   struct {
+      Window main;
+      Window container;
+      Window desk;
+   } win;
+   E_View *view;
+   int x, y;
+   struct {
+      int w, h;
+   } real, virt;
+   Evas_List windows;
+   int changed;
+};
+
+void         e_desktops_init(void);
+void         e_desktops_scroll(E_Desktop *desk, int dx, int dy);
+void         e_desktops_free(E_Desktop *desk);
+void         e_desktops_init_file_display(E_Desktop *desk);
+E_Desktop   *e_desktops_new(void);
+void         e_desktops_add_border(E_Desktop *d, E_Border *b);
+void         e_desktops_del_border(E_Desktop *d, E_Border *b);
+void         e_desktops_delete(E_Desktop *d);
+void         e_desktops_show(E_Desktop *d);
+void         e_desktops_hide(E_Desktop *d);
+int          e_desktops_get_num(void);
+E_Desktop   *e_desktops_get(int d);
+int          e_desktops_get_current(void);
+void         e_desktops_goto(int d);
+
+#endif
diff --git a/src/e.h b/src/e.h
index 74bf472..c2679bc 100644 (file)
--- a/src/e.h
+++ b/src/e.h
@@ -1,3 +1,6 @@
+#ifndef ENLIGHTENMENT_H
+#define ENLIGHTENMENT_H
+
 #include "../config.h"
 #include <X11/Xlib.h>
 #include <stdio.h>
@@ -21,7 +24,6 @@
 #include <Ebits.h>
 #include <Ecore.h>
 #include <Edb.h>
-#include <libefsd.h>
 
 /* macros for allowing sections of code to be runtime profiled */
 #define E_PROF 1
@@ -112,108 +114,6 @@ _e_obj->e_obj_free = (void *) _e_obj_free_func; \
 #define ACT_KEY_DOWN      8
 #define ACT_KEY_UP        9
 
-/* config macros */
-/* something to check validity of config files where we get data from */
-/* for now its just a 5 second timout so it will only invalidate */
-/* if we havent looked for 5 seconds... BUT later when efsd is more solid */
-/* we should use that to tell us when its invalid */
-#define E_CFG_FILE(_var, _src) \
-static E_Config_File _var = {_src, 0.0}
-#define E_CONFIG_CHECK_VALIDITY(_var, _src) \
-{ \
-double __time; \
-__time = e_get_time(); \
-if (_var.last_fetch < (__time - 5.0)) { \
-_var.last_fetch = __time;
-#define E_CONFIG_CHECK_VALIDITY_END \
-} \
-}
-#define E_CFG_INT_T   123
-#define E_CFG_FLOAT_T 1234
-#define E_CFG_STR_T   12345
-#define E_CFG_DATA_T  123456
-#define E_CFG_INT(_var, _src, _key, _default) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_INT_T, \
-_default, 0.0, NULL, NULL, 0, \
-0, 0.0, NULL, NULL, 0, \
-}
-#define E_CFG_FLOAT(_var, _src, _key, _default) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_FLOAT_T, \
-0, _default, NULL, NULL, 0, \
-0, 0.0, NULL, NULL, 0, \
-}
-#define E_CFG_STR(_var, _src, _key, _default) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_STR_T, \
-0, 0.0, _default, NULL, 0, \
-0, 0.0, NULL, NULL, 0, \
-}
-#define E_CFG_DATA(_var, _src, _key, _default, _default_size) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_DATAT_T, \
-0, 0.0, NULL, _default, _default_size, \
-0, 0.0, NULL, NULL, 0, \
-}
-/* yes for now it only fetches them every 5 seconds - in the end i need a */
-/* validity flag for the database file to know if it changed and only then */
-/* get the value again. this is waiting for efsd to become more solid */
-#define E_CFG_VALIDITY_CHECK(_var) \
-{ \
-double __time; \
-__time = e_get_time(); \
-if (_var.last_fetch < (__time - 5.0)) { \
-int __cfg_ok = 0; \
-_var.last_fetch = __time;
-#define E_CFG_END_VALIDITY_CHECK \
-} \
-}
-#define E_CONFIG_INT_GET(_var, _val) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-E_DB_INT_GET(e_config_get(_var.src), _var.key, _var.cur_int_val, __cfg_ok); \
-if (!__cfg_ok) _var.cur_int_val = _var.def_int_val; \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_int_val;}
-#define E_CONFIG_FLOAT_GET(_var, _val) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-E_DB_FLOAT_GET(e_config_get(_var.src), _var.key, _var.cur_float_val, __cfg_ok); \
-if (!__cfg_ok) _var.cur_float_val = _var.def_float_val; \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_float_val;}
-#define E_CONFIG_STR_GET(_var, _val) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-if (_var.cur_str_val) free(_var.cur_str_val); \
-_var.cur_str_val = NULL; \
-E_DB_STR_GET(e_config_get(_var.src), _var.key, _var.cur_str_val, __cfg_ok); \
-if (!__cfg_ok) _var.cur_str_val = _var.def_str_val \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_str_val;}
-#define E_CONFIG_DATA_GET(_var, _val, _size) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-if (_var.cur_data_val) free(_var.cur_data_val); \
-_var.cur_data_val = NULL; \
-_var.cur_data_size = 0; \
-{ E_DB_File *__db; \
-__db = e_db_open_read(e_config_get(_var.src)); \
-if (__db) { \
-_var.cur_data_val = e_db_data_get(__db, _var.key, &(_var.cur_data_size)); \
-if (_var.cur_data_val) __cfg_ok = 1; \
-e_db_close(__db); \
-} \
-} \
-if (!__cfg_ok) { \
-_var.cur_data_val = e_memdup(_var.def_data_val, _var.def_data_size); \
-_var.cur_data_size = _var.def_data_size; \
-} \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_data_val; \
-_size = _var.cur_data_size;}
-
 /* misc util macros */
 #define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
 ((x < (xx + ww)) && \
@@ -223,34 +123,26 @@ _size = _var.cur_data_size;}
 #define SPANS_COMMON(x1, w1, x2, w2) \
 (!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
 #define UN(_blah) _blah = 0
-#define SET_BORDER_GRAVITY(_b, _grav) \
-e_window_gravity_set(_b->win.container, _grav); \
-e_window_gravity_set(_b->win.input, _grav); \
-e_window_gravity_set(_b->win.l, _grav); \
-e_window_gravity_set(_b->win.r, _grav); \
-e_window_gravity_set(_b->win.t, _grav); \
-e_window_gravity_set(_b->win.b, _grav);
 
 /* data types */
-typedef struct _E_Object              E_Object;
-typedef struct _E_Border              E_Border;
-typedef struct _E_Grab                E_Grab;
 typedef struct _E_Action              E_Action;
 typedef struct _E_Action_Proto        E_Action_Proto;
-typedef struct _E_Desktop             E_Desktop;
-typedef struct _E_Rect                E_Rect;
 typedef struct _E_Active_Action_Timer E_Active_Action_Timer;
-typedef struct _E_View                E_View;
-typedef struct _E_Icon                E_Icon;
 typedef struct _E_Background          E_Background;
-typedef struct _E_Background_Layer    E_Background_Layer;
-typedef struct _E_Menu                E_Menu;
-typedef struct _E_Menu_Item           E_Menu_Item;
+typedef struct _E_Border              E_Border;
 typedef struct _E_Build_Menu          E_Build_Menu;
+typedef struct _E_Config_File         E_Config_File;
+typedef struct _E_Config_Element      E_Config_Element;
+typedef struct _E_Desktop             E_Desktop;
 typedef struct _E_Entry               E_Entry;
 typedef struct _E_FS_Restarter        E_FS_Restarter;
-typedef struct _E_Config_File E_Config_File;
-typedef struct _E_Config_Element E_Config_Element;
+typedef struct _E_Grab                E_Grab;
+typedef struct _E_Icon                E_Icon;
+typedef struct _E_Menu                E_Menu;
+typedef struct _E_Menu_Item           E_Menu_Item;
+typedef struct _E_Object              E_Object;
+typedef struct _E_Rect                E_Rect;
+typedef struct _E_View                E_View;
 
 /* actual fdata struct members */
 struct _E_Object
@@ -258,744 +150,4 @@ struct _E_Object
    OBJ_PROPERTIES;
 };
 
-struct _E_Border
-{
-   OBJ_PROPERTIES;
-
-   struct {
-      Window main;
-      Window l, r, t, b;
-      Window input;
-      Window container;
-      Window client;
-   } win;
-   struct {
-      Evas l, r, t, b;
-   } evas;
-   struct {
-      struct {
-        Evas_Object l, r, t, b;
-      } title;
-      struct {
-        Evas_Object l, r, t, b;
-      } title_clip;
-   } obj;   
-   struct {
-      Pixmap l, r, t, b;
-   } pixmap;
-   struct {
-      int new;
-      Ebits_Object l, r, t, b;
-   } bits;
-   
-   struct {
-      struct {
-        int x, y, w, h;
-        int visible;
-        int dx, dy;
-      } requested;
-      int   x, y, w, h;
-      int   visible;
-      int   selected;
-      int   select_lost_from_grab;
-      int   shaded;
-      int   has_shape;
-      int   shape_changes;
-      int   shaped_client;
-   } current, previous;
-   
-   struct {
-      struct {
-        int w, h;
-        double aspect;
-      } base, min, max, step;
-      int layer;
-      char *title;
-      char *name;
-      char *class;
-      char *command;
-      Window group;
-      int takes_focus;
-      int sticky;
-      Colormap colormap;
-      int fixed;
-      int arrange_ignore;
-      int hidden;
-      int iconified;
-      int titlebar;
-      int border;
-      int handles;
-      int w, h;
-      struct {
-        int requested;
-        int x, y;
-        int gravity;
-      } pos;
-   } client;
-   
-   struct {
-      int move, resize;
-   } mode;
-   
-   struct {
-      int x, y, w, h;
-      int is;
-   } max;
-   
-   int ignore_unmap;
-   int shape_changed;
-   int placed;
-   
-   Evas_List grabs;
-   E_Desktop *desk;
-   
-   char *border_file;
-
-   int first_expose;
-   
-   int changed;
-};
-
-struct _E_Grab
-{
-   int              button;
-   Ev_Key_Modifiers mods;
-   int              any_mod;
-   int              remove_after;
-   int              allow;
-};
-
-struct _E_Action
-{
-   OBJ_PROPERTIES;
-   
-   char           *name;
-   char           *action;
-   char           *params;
-   int             event;
-   int             button;
-   char           *key;
-   int             modifiers;
-   E_Action_Proto *action_proto;
-   void           *object;
-   int             started;
-   int             grabbed;
-};
-
-struct _E_Action_Proto
-{
-   OBJ_PROPERTIES;
-   
-   char  *action;
-   void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-   void (*func_stop)  (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-   void (*func_go)    (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
-};
-
-struct _E_Desktop
-{
-   OBJ_PROPERTIES;
-   
-   char *name;
-   char *dir;
-   struct {
-      Window main;
-      Window container;
-      Window desk;
-   } win;
-   E_View *view;
-   int x, y;
-   struct {
-      int w, h;
-   } real, virt;
-   Evas_List windows;
-   int changed;
-};
-
-struct _E_Rect
-{
-   int x, y, w, h;
-   int v1, v2, v3, v4;
-};
-
-struct _E_Active_Action_Timer
-{
-   void *object;
-   char *name;
-};
-
-struct _E_View
-{
-   OBJ_PROPERTIES;
-   
-   char                  *dir;
-   
-   struct {
-      Evas_Render_Method  render_method;
-      int                 back_pixmap;
-   } options;
-   
-   Evas                   evas;
-   struct {
-      Window              base;
-      Window              main;
-   } win;
-   Pixmap                 pmap;
-   struct {
-      int                 w, h;
-   } size;
-   struct {
-      int                 x, y;
-   } location;
-   struct {
-      /* +-----------------+
-       * |        Wt       |
-       * |  +-----------+  |
-       * |Wl|           |Wr|
-       * |  |    [I] Is |  |
-       * |  |    Ig     |  |
-       * |  |   [txt]   |  |
-       * |  |     Ib    |  |
-       * |  +-----------+  |
-       * |       Wb        |
-       * +-----------------+
-       */
-      struct {
-        int l, r, t, b;
-      } window;
-      struct {
-        int s, g, b;
-      } icon;
-   } spacing;
-   struct {
-      int on;
-      int x, y, w, h;
-      struct {
-        int x, y;
-      } down;
-      struct {
-        struct {
-           int r, g, b, a;
-        } 
-        edge_l, edge_r, edge_t, edge_b, 
-        middle, 
-        grad_l, grad_r, grad_t, grad_b;
-        struct {
-           int l, r, t, b;
-        } grad_size;
-      } config;
-      struct {
-        Evas_Object clip;
-        Evas_Object edge_l;
-        Evas_Object edge_r;
-        Evas_Object edge_t;
-        Evas_Object edge_b;
-        Evas_Object middle;
-        Evas_Object grad_l;
-        Evas_Object grad_r;
-        Evas_Object grad_t;
-        Evas_Object grad_b;
-      } obj;
-   } select;
-   struct {
-      int started;
-      Window win;
-      int x, y;
-      struct {
-        int x, y;
-      } offset;
-      int update;
-   } drag;
-   
-   Evas_Object            obj_bg;
-   
-   E_Background          *bg;
-   
-   int                    is_listing;
-   int                    monitor_id;
-   
-   E_FS_Restarter        *restarter;
-   
-   Evas_List              icons;
-   
-   int                    is_desktop;
-   int                    have_resort_queued;
-   int                    sel_count;
-   
-   int                    changed;
-};
-
-struct _E_Icon
-{
-   OBJ_PROPERTIES;
-   
-   char   *file;
-   
-   E_View *view;
-   
-   struct {
-      char *icon;
-      char *custom_icon;
-      char *link;
-      struct {
-        char *base;
-        char *type;
-      } mime;
-   } info;
-   
-   struct {
-      Evas_Object icon;
-      Evas_Object text;
-      Evas_Object event1;
-      Evas_Object event2;
-      struct {
-        struct {
-           Ebits_Object icon;
-           Ebits_Object text;
-        } over, under;
-      } sel;
-   } obj;
-   
-   struct {
-      int hilited;
-      int clicked;
-      int selected;
-      int running;
-      int disabled;
-      int visible;
-      int just_selected;
-      int just_executed;
-   } state;
-   
-   struct {
-      int x, y, w, h;
-      struct {
-        int w, h;
-      } icon;
-      struct {
-        int w, h;
-      } text;
-   } geom;
-   
-   int     changed;   
-};
-
-struct _E_Background_Layer
-{
-   int mode;
-   int type;
-   int inlined;
-   struct {
-      float x, y;
-   } scroll;
-   struct {
-      float x, y;
-   } pos;
-   struct {
-      float w, h;
-      struct {
-        int w, h;
-      } orig;
-   } size, fill;
-   char *color_class;
-   char *file;
-   double angle;
-   struct {
-      int r, g, b, a;
-   } fg, bg;
-   
-   double x, y, w, h, fw, fh;
-   
-   Evas_Object obj;
-};
-
-struct _E_Background
-{
-   OBJ_PROPERTIES;
-   
-   Evas  evas;
-   char *file;
-   
-   struct {
-      int sx, sy;
-      int w, h;
-   } geom;
-   
-   Evas_List layers;
-   
-   Evas_Object base_obj;
-};
-
-struct _E_Menu
-{
-   OBJ_PROPERTIES;
-   
-   struct {
-      int       x, y, w, h;
-      int       visible;
-   } current, previous;
-   struct {
-      int l, r, t, b;
-   } border, sel_border;
-   struct {
-      Window       main, evas;
-   } win;
-   Evas         evas;
-   Ebits_Object bg;
-   Evas_List    entries;
-   char        *bg_file;
-   
-   int       first_expose;
-
-   int       recalc_entries;
-   int       redo_sel;
-   int       changed;
-   
-   struct {
-      int state, icon, text;
-   } size;
-   struct {
-      int icon, state;
-   } pad;
-   
-   E_Menu_Item *selected;
-   
-   Time      time;
-};
-
-struct _E_Menu_Item
-{
-   OBJ_PROPERTIES;
-   
-   int x, y;
-   struct {
-      struct {
-        int w, h;
-      } min;
-      int w, h;
-   } size;
-   
-   Ebits_Object  bg;
-   char         *bg_file;
-   int           selected;
-
-   Evas_Object   obj_entry;
-   
-   char         *str;
-   Evas_Object   obj_text;
-   
-   char         *icon;
-   Evas_Object   obj_icon;
-   int           scale_icon;
-   
-   Ebits_Object  state;
-   char         *state_file;
-   
-   Ebits_Object  sep;
-   char         *sep_file;
-   
-   int           separator;
-   int           radio_group;
-   int           radio;
-   int           check;
-   int           on;
-   
-   E_Menu       *menu;
-   E_Menu       *submenu;
-   
-   void        (*func_select) (E_Menu *m, E_Menu_Item *mi, void *data);
-   void         *func_select_data;
-};
-
-struct _E_Build_Menu
-{
-   OBJ_PROPERTIES;
-
-   char      *file;
-   time_t     mod_time;
-   
-   E_Menu    *menu;
-   
-   Evas_List  menus;
-   Evas_List  commands;
-};
-
-struct _E_Entry
-{
-   Evas  evas;
-   char *buffer;
-   int   cursor_pos;
-   struct {
-      int start, length, down;
-   } select;
-   int   mouse_down;
-   int   visible;
-   int   focused;
-   int   scroll_pos;
-   int   x, y, w, h;
-   int   min_size;
-   Ebits_Object obj_base;
-   Ebits_Object obj_cursor;
-   Ebits_Object obj_selection;
-   Evas_Object event_box;
-   Evas_Object clip_box;
-   Evas_Object text;
-   Window paste_win;
-   Window selection_win;
-   int end_width;
-   void (*func_changed) (E_Entry *entry, void *data);
-   void *data_changed;
-   void (*func_enter) (E_Entry *entry, void *data);
-   void *data_enter;
-   void (*func_focus_in) (E_Entry *entry, void *data);
-   void *data_focus_in;
-   void (*func_focus_out) (E_Entry *entry, void *data);
-   void *data_focus_out;
-};
-
-struct _E_FS_Restarter
-{
-   void (*func) (void *data);
-   void *data;
-};
-
-struct _E_Config_File
-{
-   char   *src;
-   double  last_fetch;
-};
-
-struct _E_Config_Element 
-{
-   char   *src;
-   char   *key;
-   double  last_fetch;
-   int     type;
-   int     def_int_val;
-   float   def_float_val;
-   char   *def_str_val;
-   void   *def_data_val;
-   int     def_data_val_size;
-   int     cur_int_val;
-   float   cur_float_val;
-   char   *cur_str_val;
-   void   *cur_data_val;
-   int     cur_data_val_size;
-};
-
-void e_entry_init(void);
-void e_entry_free(E_Entry *entry);
-E_Entry *e_entry_new(void);
-void e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e);
-void e_entry_set_evas(E_Entry *entry, Evas evas);
-void e_entry_show(E_Entry *entry);
-void e_entry_hide(E_Entry *entry);
-void e_entry_raise(E_Entry *entry);
-void e_entry_lower(E_Entry *entry);
-void e_entry_set_layer(E_Entry *entry, int l);
-void e_entry_set_clip(E_Entry *entry, Evas_Object clip);
-void e_entry_unset_clip(E_Entry *entry);
-void e_entry_move(E_Entry *entry, int x, int y);
-void e_entry_resize(E_Entry *entry, int w, int h);
-void e_entry_query_max_size(E_Entry *entry, int *w, int *h);
-void e_entry_max_size(E_Entry *entry, int *w, int *h);
-void e_entry_min_size(E_Entry *entry, int *w, int *h);
-void e_entry_set_size(E_Entry *entry, int w, int h);
-void e_entry_set_focus(E_Entry *entry, int focused);
-void e_entry_set_text(E_Entry *entry, const char *text);
-const char *e_entry_get_text(E_Entry *entry);
-void e_entry_set_cursor(E_Entry *entry, int cursor_pos);
-int e_entry_get_cursor(E_Entry *entry);
-void e_entry_set_changed_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
-void e_entry_set_enter_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
-void e_entry_set_focus_in_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
-void e_entry_set_focus_out_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
-void e_entry_insert_text(E_Entry *entry, char *text);
-void e_entry_clear_selection(E_Entry *entry);
-void e_entry_delete_to_left(E_Entry *entry);
-void e_entry_delete_to_right(E_Entry *entry);
-char *e_entry_get_selection(E_Entry *entry);
-
-
-void e_action_add_proto(char *action,
-                       void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
-                       void (*func_stop)  (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
-                       void (*func_go)    (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy));
-void e_actions_init(void);
-void e_action_start(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry);
-void e_action_stop(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry);
-void e_action_go(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry, int dx, int dy);
-void e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry);
-void e_actions_del_timer(void *o, char *name);
-void e_actions_add_timer(void *o, char *name);
-void e_actions_del_timer_object(void *o);
-  
-void e_border_apply_border(E_Border *b);
-E_Border * e_border_new(void);
-E_Border * e_border_adopt(Window win, int use_client_pos);
-void e_border_reshape(E_Border *b);  
-void e_border_free(E_Border *b);
-void e_border_remove_mouse_grabs(E_Border *b);
-void e_border_attach_mouse_grabs(E_Border *b);
-void e_border_remove_all_mouse_grabs(void);
-void e_border_attach_all_mouse_grabs(void);
-void e_border_redo_grabs(void);
-E_Border * e_border_find_by_window(Window win);
-void e_border_set_bits(E_Border *b, char *file);
-void e_border_set_color_class(E_Border *b, char *class, int rr, int gg, int bb, int aa);
-void e_border_adjust_limits(E_Border *b);
-void e_border_update(E_Border *b);
-void e_border_set_layer(E_Border *b, int layer);
-void e_border_raise(E_Border *b);
-void e_border_lower(E_Border *b);
-void e_border_raise_above(E_Border *b, E_Border *above);
-void e_border_lower_below(E_Border *b, E_Border *below);
-void e_border_init(void);
-void e_border_adopt_children(Window win);
-E_Border *e_border_current_focused(void);
-void e_border_focus_grab_ended(void);
-
-void e_icccm_move_resize(Window win, int x, int y, int w, int h);
-void e_icccm_delete(Window win);
-void e_icccm_state_mapped(Window win);
-void e_icccm_state_iconified(Window win);
-void e_icccm_state_withdrawn(Window win);
-void e_icccm_adopt(Window win);
-void e_icccm_release(Window win);
-void e_icccm_get_size_info(Window win, E_Border *b);
-void e_icccm_get_mwm_hints(Window win, E_Border *b);
-void e_icccm_get_layer(Window win, E_Border *b);
-void e_icccm_get_title(Window win, E_Border *b);
-void e_icccm_set_frame_size(Window win, int l, int r, int t, int b);
-void e_icccm_set_desk_area(Window win, int ax, int ay);
-void e_icccm_set_desk_area_size(Window win, int ax, int ay);
-void e_icccm_set_desk(Window win, int d);
-int  e_icccm_is_shaped(Window win);
-void e_icccm_handle_property_change(Atom a, E_Border *b);
-void e_icccm_handle_client_message(Ev_Message *e);
-void e_icccm_advertise_e_compat(void);
-void e_icccm_advertise_mwm_compat(void);
-void e_icccm_advertise_gnome_compat(void);
-void e_icccm_advertise_kde_compat(void);
-void e_icccm_advertise_net_compat(void);
-
-void e_desktops_init(void);    
-void e_desktops_scroll(E_Desktop *desk, int dx, int dy);
-void e_desktops_free(E_Desktop *desk);
-void e_desktops_init_file_display(E_Desktop *desk);
-E_Desktop * e_desktops_new(void);
-void e_desktops_add_border(E_Desktop *d, E_Border *b);
-void e_desktops_del_border(E_Desktop *d, E_Border *b);
-void e_desktops_delete(E_Desktop *d);
-void e_desktops_show(E_Desktop *d);
-void e_desktops_hide(E_Desktop *d);
-int e_desktops_get_num(void);
-E_Desktop * e_desktops_get(int d);
-int e_desktops_get_current(void);
-void e_desktops_goto(int num);
-void e_desktops_update(E_Desktop *desk);
-
-void e_resist_border(E_Border *b);
-    
-time_t e_file_modified_time(char *file);
-void e_set_env(char *variable, char *content);
-int e_file_exists(char *file);
-int e_file_is_dir(char *file);
-char *e_file_home(void);
-int e_file_mkdir(char *dir);
-int e_file_cp(char *src, char *dst);
-char *e_file_real(char *file);
-char *e_file_get_file(char *file);
-char *e_file_get_dir(char *file);
-void *e_memdup(void *data, int size);
-int e_glob_matches(char *str, char *glob);
-int e_file_can_exec(struct stat *st);
-char *e_file_link(char *link);
-Evas_List e_file_list_dir(char *dir);
-
-void e_exec_set_args(int argc, char **argv);
-void e_exec_restart(void);
-pid_t e_exec_run(char *exe);
-pid_t e_exec_run_in_dir(char *exe, char *dir);
-pid_t e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path);
-
-char *e_config_get(char *type);
-void  e_config_init(void);
-void  e_config_set_user_dir(char *dir);
-char *e_config_user_dir(void);
-
-void e_view_free(E_View *v);
-E_View *e_view_new(void);
-void e_view_init(void);
-
-void e_menu_callback_item(E_Menu *m, E_Menu_Item *mi);
-void e_menu_item_set_callback(E_Menu_Item *mi, void (*func) (E_Menu *m, E_Menu_Item *mi, void *data), void *data);
-void e_menu_hide_submenus(E_Menu *menus_after);
-void e_menu_select(int dx, int dy);
-void e_menu_init(void);
-void e_menu_event_win_show(void);
-void e_menu_event_win_hide(void);
-void e_menu_set_background(E_Menu *m);
-void e_menu_set_sel(E_Menu *m, E_Menu_Item *mi);
-void e_menu_set_sep(E_Menu *m, E_Menu_Item *mi);
-void e_menu_set_state(E_Menu *m, E_Menu_Item *mi);
-void e_menu_free(E_Menu *m);
-E_Menu *e_menu_new(void);
-void e_menu_hide(E_Menu *m);
-void e_menu_show(E_Menu *m);
-void e_menu_move_to(E_Menu *m, int x, int y);
-void e_menu_show_at_mouse(E_Menu *m, int x, int y, Time t);
-void e_menu_add_item(E_Menu *m, E_Menu_Item *mi);
-void e_menu_del_item(E_Menu *m, E_Menu_Item *mi);
-void e_menu_item_update(E_Menu *m, E_Menu_Item *mi);
-void e_menu_item_unrealize(E_Menu *m, E_Menu_Item *mi);
-void e_menu_item_realize(E_Menu *m, E_Menu_Item *mi);
-E_Menu_Item *e_menu_item_new(char *str);
-void e_menu_obscure_outside_screen(E_Menu *m);
-void e_menu_scroll_all_by(int dx, int dy);
-void e_menu_update_visibility(E_Menu *m);
-void e_menu_update_base(E_Menu *m);
-void e_menu_update_finish(E_Menu *m);
-void e_menu_update_shows(E_Menu *m);
-void e_menu_update_hides(E_Menu *m);
-void e_menu_update(E_Menu *m);
-void e_menu_item_set_icon(E_Menu_Item *mi, char *icon);
-void e_menu_item_set_text(E_Menu_Item *mi, char *text);
-void e_menu_item_set_separator(E_Menu_Item *mi, int sep);
-void e_menu_item_set_radio(E_Menu_Item *mi, int radio);
-void e_menu_item_set_check(E_Menu_Item *mi, int check);
-void e_menu_item_set_state(E_Menu_Item *mi, int state);
-void e_menu_item_set_submenu(E_Menu_Item *mi, E_Menu *submenu);
-void e_menu_item_set_scale_icon(E_Menu_Item *mi, int scale);
-void e_menu_set_padding_icon(E_Menu *m, int pad);
-void e_menu_set_padding_state(E_Menu *m, int pad);
-
-void          e_build_menu_free(E_Build_Menu *bm);
-E_Build_Menu *e_build_menu_new_from_db(char *file);
-E_Build_Menu *e_build_menu_new_from_gnome_apps(char *dir);
-
-E_FS_Restarter *e_fs_add_restart_handler(void (*func) (void *data), void *data);
-void e_fs_del_restart_handler(E_FS_Restarter *rs);
-void e_fs_add_event_handler(void (*func) (EfsdEvent *ev));
-void e_fs_init(void);
-EfsdConnection *e_fs_get_connection(void);
-    
-void e_keys_grab(char *key, Ev_Key_Modifiers mods, int anymod);
-void e_keys_ungrab(char *key, Ev_Key_Modifiers mods, int anymod);
-void e_keys_init(void);
-
-E_Background *e_background_new(void);
-void e_background_realize(E_Background *bg, Evas evas);
-void e_background_free(E_Background *bg);
-
-void e_view_realize(E_View *v);
-void e_view_update(E_View *v);
-void e_view_update_selection(E_View *v, int x, int y);
-void e_view_update(E_View *v);
-void e_view_scroll(E_View *v, int dx, int dy);
-E_View *e_view_find_by_monitor_id(int id);
-void e_view_add_icon(E_View *v, E_Icon *icon);
-E_Icon *e_view_find_icon_by_file(E_View *v, char *file);
-void e_view_del_icon(E_View *v, E_Icon *icon);
-
-void e_ipc_init(void);
+#endif
index de973c2..c7b1a8e 100644 (file)
@@ -1,4 +1,7 @@
-#include "e.h"
+#include "entry.h"
+#include "background.h"
+#include "config.h"
+#include "util.h"
 
 static Evas_List entries;
 
@@ -273,7 +276,7 @@ e_entry_configure(E_Entry *entry)
    evas_resize(entry->evas, entry->event_box, entry->w - p1l - p1r - p2l - p2r, entry->h - p1t - p1b - p2t - p2b);
    if ((entry->buffer) && (entry->buffer[0] != 0) && (entry->focused))
      {
-       int tx, ty, tw, th;
+       double tx, ty, tw, th;
        
        if (entry->cursor_pos < strlen(entry->buffer))
          {
@@ -321,7 +324,7 @@ e_entry_configure(E_Entry *entry)
    evas_move(entry->evas, entry->text, entry->x + entry->scroll_pos + p1l + p2l, entry->y + p1t + p2t);
    if (entry->select.start >= 0)
      {
-       int x1, y1, x2, tw, th;
+       double x1, y1, x2, tw, th;
        
        evas_text_at(entry->evas, entry->text, entry->select.start, &x1, &y1, NULL, NULL);
        if (entry->select.start + entry->select.length <= strlen(entry->buffer))
diff --git a/src/entry.h b/src/entry.h
new file mode 100644 (file)
index 0000000..f4f55a2
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef E_ENTRY_H
+#define E_ENTRY_H
+
+#include "e.h"
+
+struct _E_Entry
+{
+   Evas  evas;
+   char *buffer;
+   int   cursor_pos;
+   struct {
+      int start, length, down;
+   } select;
+   int   mouse_down;
+   int   visible;
+   int   focused;
+   int   scroll_pos;
+   int   x, y, w, h;
+   int   min_size;
+   Ebits_Object obj_base;
+   Ebits_Object obj_cursor;
+   Ebits_Object obj_selection;
+   Evas_Object event_box;
+   Evas_Object clip_box;
+   Evas_Object text;
+   Window paste_win;
+   Window selection_win;
+   int end_width;
+   void (*func_changed) (E_Entry *entry, void *data);
+   void *data_changed;
+   void (*func_enter) (E_Entry *entry, void *data);
+   void *data_enter;
+   void (*func_focus_in) (E_Entry *entry, void *data);
+   void *data_focus_in;
+   void (*func_focus_out) (E_Entry *entry, void *data);
+   void *data_focus_out;
+};
+
+
+void        e_entry_init(void);
+void        e_entry_free(E_Entry *entry);
+E_Entry    *e_entry_new(void);
+void        e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e);
+void        e_entry_set_evas(E_Entry *entry, Evas evas);
+void        e_entry_show(E_Entry *entry);
+void        e_entry_hide(E_Entry *entry);
+void        e_entry_raise(E_Entry *entry);
+void        e_entry_lower(E_Entry *entry);
+void        e_entry_set_layer(E_Entry *entry, int l);
+void        e_entry_set_clip(E_Entry *entry, Evas_Object clip);
+void        e_entry_unset_clip(E_Entry *entry);
+void        e_entry_move(E_Entry *entry, int x, int y);
+void        e_entry_resize(E_Entry *entry, int w, int h);
+void        e_entry_query_max_size(E_Entry *entry, int *w, int *h);
+void        e_entry_max_size(E_Entry *entry, int *w, int *h);
+void        e_entry_min_size(E_Entry *entry, int *w, int *h);
+void        e_entry_set_size(E_Entry *entry, int w, int h);
+void        e_entry_set_focus(E_Entry *entry, int focused);
+void        e_entry_set_text(E_Entry *entry, const char *text);
+const char *e_entry_get_text(E_Entry *entry);
+void        e_entry_set_cursor(E_Entry *entry, int cursor_pos);
+int         e_entry_get_cursor(E_Entry *entry);
+void        e_entry_set_changed_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
+void        e_entry_set_enter_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
+void        e_entry_set_focus_in_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
+void        e_entry_set_focus_out_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
+void        e_entry_insert_text(E_Entry *entry, char *text);
+void        e_entry_clear_selection(E_Entry *entry);
+void        e_entry_delete_to_left(E_Entry *entry);
+void        e_entry_delete_to_right(E_Entry *entry);
+char       *e_entry_get_selection(E_Entry *entry);
+
+#endif
index e4d318f..964d8a8 100644 (file)
@@ -1,4 +1,6 @@
-#include "e.h"
+#include "exec.h"
+#include "desktops.h"
+#include "util.h"
 
 static int e_argc = 0;
 static char **e_argv = NULL;
@@ -70,7 +72,7 @@ e_exec_run_in_dir(char *exe, char *dir)
 }
 
 pid_t
-e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path)
+e_exec_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path)
 {
    static int launch_id = 0;
    char preload_paths[4096];
diff --git a/src/exec.h b/src/exec.h
new file mode 100644 (file)
index 0000000..d010d2b
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef E_EXEC_H
+#define E_EXEC_H
+
+#include "e.h"
+
+void  e_exec_set_args(int argc, char **argv);
+void  e_exec_restart(void);
+pid_t e_exec_run(char *exe);
+pid_t e_exec_run_in_dir(char *exe, char *dir);
+pid_t e_exec_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path);
+
+#endif
index c79fbc7..7ce53cc 100644 (file)
--- a/src/fs.c
+++ b/src/fs.c
@@ -1,4 +1,5 @@
-#include "e.h"
+#include "fs.h"
+#include "exec.h"
 
 static EfsdConnection     *ec = NULL;
 static Evas_List           fs_handlers = NULL;
@@ -111,6 +112,8 @@ e_fs_add_restart_handler(void (*func) (void *data), void *data)
    rs->func = func;
    rs->data = data;
    fs_restart_handlers = evas_list_append(fs_restart_handlers, rs);
+
+   return rs;
 }
 
 void
@@ -133,8 +136,6 @@ e_fs_add_event_handler(void (*func) (EfsdEvent *ev))
 void
 e_fs_init(void)
 {
-   int i;
-
    e_event_filter_handler_add(EV_CHILD, e_fs_child_handle);   
    _e_fs_restarter(0, NULL);
 }
diff --git a/src/fs.h b/src/fs.h
new file mode 100644 (file)
index 0000000..3383e2e
--- /dev/null
+++ b/src/fs.h
@@ -0,0 +1,19 @@
+#ifndef E_FS_H
+#define E_FS_H
+
+#include <libefsd.h>
+#include "e.h"
+
+struct _E_FS_Restarter
+{
+   void (*func) (void *data);
+   void *data;
+};
+
+void            e_fs_init(void);
+E_FS_Restarter *e_fs_add_restart_handler(void (*func) (void *data), void *data);
+void            e_fs_del_restart_handler(E_FS_Restarter *rs);
+void            e_fs_add_event_handler(void (*func) (EfsdEvent *ev));
+EfsdConnection *e_fs_get_connection(void);
+
+#endif
index 3e93021..c934c01 100644 (file)
@@ -1,4 +1,5 @@
 #include "e.h"
+#include "border.h"
 
 /* Motif window hints */
 #define MWM_HINTS_FUNCTIONS           (1L << 0)
@@ -146,7 +147,7 @@ e_icccm_get_pos_info(Window win, E_Border *b)
          {
             int x, y, w, h;
             
-            printf("%i %i\n", hint.flags & USPosition, hint.flags & PPosition);
+            printf("%li %li\n", hint.flags & USPosition, hint.flags & PPosition);
             b->client.pos.requested = 1;
             b->client.pos.gravity = NorthWestGravity;
             if (hint.flags & PWinGravity) 
diff --git a/src/icccm.h b/src/icccm.h
new file mode 100644 (file)
index 0000000..21f9e72
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef E_ICCCM_H
+#define E_ICCCM_H
+
+#include "e.h"
+
+void e_icccm_move_resize(Window win, int x, int y, int w, int h);
+void e_icccm_delete(Window win);
+void e_icccm_state_mapped(Window win);
+void e_icccm_state_iconified(Window win);
+void e_icccm_state_withdrawn(Window win);
+void e_icccm_adopt(Window win);
+void e_icccm_release(Window win);
+void e_icccm_get_pos_info(Window win, E_Border *b);
+void e_icccm_get_size_info(Window win, E_Border *b);
+void e_icccm_get_mwm_hints(Window win, E_Border *b);
+void e_icccm_get_layer(Window win, E_Border *b);
+void e_icccm_get_title(Window win, E_Border *b);
+void e_icccm_set_frame_size(Window win, int l, int r, int t, int b);
+void e_icccm_set_desk_area(Window win, int ax, int ay);
+void e_icccm_set_desk_area_size(Window win, int ax, int ay);
+void e_icccm_set_desk(Window win, int d);
+int  e_icccm_is_shaped(Window win);
+void e_icccm_handle_property_change(Atom a, E_Border *b);
+void e_icccm_handle_client_message(Ev_Message *e);
+void e_icccm_advertise_e_compat(void);
+void e_icccm_advertise_mwm_compat(void);
+void e_icccm_advertise_gnome_compat(void);
+void e_icccm_advertise_kde_compat(void);
+void e_icccm_advertise_net_compat(void);
+
+#endif
index fdb10af..e7abe12 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -1,4 +1,5 @@
-#include "e.h"
+#include "ipc.h"
+#include "config.h"
 
 struct _coords {
   int xid;
diff --git a/src/ipc.h b/src/ipc.h
new file mode 100644 (file)
index 0000000..e049430
--- /dev/null
+++ b/src/ipc.h
@@ -0,0 +1,9 @@
+#ifndef E_IPC_H
+#define E_IPC_H
+
+#include "e.h"
+
+void e_ipc_init(void);
+
+#endif
+
index 902f8dc..2c42d87 100644 (file)
@@ -1,4 +1,5 @@
-#include "e.h"
+#include "keys.h"
+#include "actions.h"
 
 static void e_key_down(Eevent * ev);
 static void e_key_up(Eevent * ev);
diff --git a/src/keys.h b/src/keys.h
new file mode 100644 (file)
index 0000000..c042309
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef E_KEYS_H
+#define E_KEYS_H
+
+#include "e.h"
+
+void     e_keys_init(void);
+void     e_keys_grab(char *key, Ev_Key_Modifiers mods, int anymod);
+void     e_keys_ungrab(char *key, Ev_Key_Modifiers mods, int anymod);
+
+#endif;
index 36eba15..4e0f703 100644 (file)
@@ -1,4 +1,14 @@
-#include "e.h"
+#include "actions.h"
+#include "border.h"
+#include "config.h"
+#include "desktops.h"
+#include "exec.h"
+#include "fs.h"
+#include "entry.h"
+#include "keys.h"
+#include "ipc.h"
+#include "menu.h"
+#include "view.h"
 #include <X11/Xproto.h>
 
 #ifdef E_PROF
@@ -50,15 +60,46 @@ setup(void)
 int
 main(int argc, char **argv)
 {
+   char *display = "0:0";
+   int   i;
+
    atexit(cb_exit);
    e_exec_set_args(argc, argv);
    
    e_config_init();
-   if (!e_display_init(NULL))
+
+   /* Check command line options here: */
+   for (i = 1; i < argc; i++)
+     {
+       if ((!strcmp("-display", argv[i])) && (argc - i > 1))
+        {
+          display = argv[++i];
+        }
+       else if ((!strcmp("-help", argv[i]))
+               || (!strcmp("--help", argv[i]))
+               || (!strcmp("-h", argv[i])) || (!strcmp("-?", argv[i])))
+        {
+          printf("enlightenment options:                      \n"
+                 "\t-display display_name                     \n"
+                 "\t[-v | -version | --version]               \n");
+          exit(0);
+        }
+       else if ((!strcmp("-v", argv[i]))
+               || (!strcmp("-version", argv[i]))
+               || (!strcmp("--version", argv[i]))
+               || (!strcmp("-v", argv[i])))
+        {
+          printf("Enlightenment Version: %s\n", ENLIGHTENMENT_VERSION);
+          exit(0);
+        }
+     }
+
+   if (!e_display_init(display))
      {
        fprintf(stderr, "cannot connect to display!\n");
        exit(1);
      }
+
    e_ev_signal_init();
    e_event_filter_init();
    e_ev_x_init();
@@ -75,7 +116,7 @@ main(int argc, char **argv)
    e_fs_init();
    e_desktops_init();
    e_border_init();
-   e_actions_init();
+   e_action_init();
    e_menu_init();
    e_view_init();
    e_entry_init();
index ee2c5fb..0538460 100644 (file)
@@ -1,4 +1,5 @@
-#include "e.h"
+#include "menu.h"
+#include "config.h"
 
 static Evas_List open_menus = NULL;
 static Evas_List menus = NULL;
diff --git a/src/menu.h b/src/menu.h
new file mode 100644 (file)
index 0000000..dd62003
--- /dev/null
@@ -0,0 +1,129 @@
+#ifndef E_MENU_H
+#define E_MENU_H
+
+#include "e.h"
+
+struct _E_Menu
+{
+   OBJ_PROPERTIES;
+   
+   struct {
+      int       x, y, w, h;
+      int       visible;
+   } current, previous;
+   struct {
+      int l, r, t, b;
+   } border, sel_border;
+   struct {
+      Window       main, evas;
+   } win;
+   Evas         evas;
+   Ebits_Object bg;
+   Evas_List    entries;
+   char        *bg_file;
+   
+   int       first_expose;
+
+   int       recalc_entries;
+   int       redo_sel;
+   int       changed;
+   
+   struct {
+      int state, icon, text;
+   } size;
+   struct {
+      int icon, state;
+   } pad;
+   
+   E_Menu_Item *selected;
+   
+   Time      time;
+};
+
+struct _E_Menu_Item
+{
+   OBJ_PROPERTIES;
+   
+   int x, y;
+   struct {
+      struct {
+        int w, h;
+      } min;
+      int w, h;
+   } size;
+   
+   Ebits_Object  bg;
+   char         *bg_file;
+   int           selected;
+
+   Evas_Object   obj_entry;
+   
+   char         *str;
+   Evas_Object   obj_text;
+   
+   char         *icon;
+   Evas_Object   obj_icon;
+   int           scale_icon;
+   
+   Ebits_Object  state;
+   char         *state_file;
+   
+   Ebits_Object  sep;
+   char         *sep_file;
+   
+   int           separator;
+   int           radio_group;
+   int           radio;
+   int           check;
+   int           on;
+   
+   E_Menu       *menu;
+   E_Menu       *submenu;
+   
+   void        (*func_select) (E_Menu *m, E_Menu_Item *mi, void *data);
+   void         *func_select_data;
+};
+
+void         e_menu_callback_item(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_item_set_callback(E_Menu_Item *mi, void  (*func) (E_Menu *m, E_Menu_Item *mi, void  *data), void  *data);
+void         e_menu_hide_submenus(E_Menu *menus_after);
+void         e_menu_select(int dx, int dy);
+void         e_menu_init(void );
+void         e_menu_event_win_show(void );
+void         e_menu_event_win_hide(void );
+void         e_menu_set_background(E_Menu *m);
+void         e_menu_set_sel(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_set_sep(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_set_state(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_free(E_Menu *m);
+E_Menu      *e_menu_new(void );
+void         e_menu_hide(E_Menu *m);
+void         e_menu_show(E_Menu *m);
+void         e_menu_move_to(E_Menu *m, int x, int y);
+void         e_menu_show_at_mouse(E_Menu *m, int x, int y, Time t);
+void         e_menu_add_item(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_del_item(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_item_update(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_item_unrealize(E_Menu *m, E_Menu_Item *mi);
+void         e_menu_item_realize(E_Menu *m, E_Menu_Item *mi);
+E_Menu_Item *e_menu_item_new(char *str);
+void         e_menu_obscure_outside_screen(E_Menu *m);
+void         e_menu_scroll_all_by(int dx, int dy);
+void         e_menu_update_visibility(E_Menu *m);
+void         e_menu_update_base(E_Menu *m);
+void         e_menu_update_finish(E_Menu *m);
+void         e_menu_update_shows(E_Menu *m);
+void         e_menu_update_hides(E_Menu *m);
+void         e_menu_update(E_Menu *m);
+void         e_menu_item_set_icon(E_Menu_Item *mi, char *icon);
+void         e_menu_item_set_text(E_Menu_Item *mi, char *text);
+void         e_menu_item_set_separator(E_Menu_Item *mi, int sep);
+void         e_menu_item_set_radio(E_Menu_Item *mi, int radio);
+void         e_menu_item_set_check(E_Menu_Item *mi, int check);
+void         e_menu_item_set_state(E_Menu_Item *mi, int state);
+void         e_menu_item_set_submenu(E_Menu_Item *mi, E_Menu *submenu);
+void         e_menu_item_set_scale_icon(E_Menu_Item *mi, int scale);
+void         e_menu_set_padding_icon(E_Menu *m, int pad);
+void         e_menu_set_padding_state(E_Menu *m, int pad);
+
+#endif
index e9d21c0..d094724 100644 (file)
@@ -1,4 +1,7 @@
-#include "e.h"
+#include "menu.h"
+#include "menubuild.h"
+#include "exec.h"
+#include "util.h"
 
 Evas_List build_menus = NULL;
 
diff --git a/src/menubuild.h b/src/menubuild.h
new file mode 100644 (file)
index 0000000..8802b5d
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef E_MENU_BUILD_H
+#define E_MENU_BUILD_H
+
+#include "e.h"
+
+struct _E_Build_Menu
+{
+   OBJ_PROPERTIES;
+
+   char      *file;
+   time_t     mod_time;
+   
+   E_Menu    *menu;
+   
+   Evas_List  menus;
+   Evas_List  commands;
+};
+
+void          e_build_menu_free(E_Build_Menu *bm);
+E_Build_Menu *e_build_menu_new_from_db(char *file);
+E_Build_Menu *e_build_menu_new_from_gnome_apps(char *dir);
+
+#endif;
index 59e90ce..04fb798 100644 (file)
@@ -1,4 +1,6 @@
-#include "e.h"
+#include "resist.h"
+#include "config.h"
+#include "desktops.h"
 
 void
 e_resist_border(E_Border *b)
diff --git a/src/resist.h b/src/resist.h
new file mode 100644 (file)
index 0000000..fe9f395
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef E_RESIST_H
+#define E_RESIST_H
+
+#include "e.h"
+#include "border.h"
+
+struct _E_Rect
+{
+   int x, y, w, h;
+   int v1, v2, v3, v4;
+};
+
+void e_resist_border(E_Border *b);
+
+#endif
index ddedf60..d058583 100644 (file)
@@ -1,4 +1,4 @@
-#include "e.h"
+#include "util.h"
 
 time_t
 e_file_modified_time(char *file)
diff --git a/src/util.h b/src/util.h
new file mode 100644 (file)
index 0000000..ee51f67
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef E_UTIL_H
+#define E_UTIL_H
+
+#include "e.h"
+
+time_t     e_file_modified_time(char *file);
+void       e_set_env(char *variable, char *content);
+int        e_file_exists(char *file);
+int        e_file_is_dir(char *file);
+char      *e_file_home(void);
+int        e_file_mkdir(char *dir);
+int        e_file_cp(char *src, char *dst);
+char      *e_file_real(char *file);
+char      *e_file_get_file(char *file);
+char      *e_file_get_dir(char *file);
+void      *e_memdup(void *data, int size);
+int        e_glob_matches(char *str, char *glob);
+int        e_file_can_exec(struct stat *st);
+char      *e_file_link(char *link);
+Evas_List  e_file_list_dir(char *dir);
+
+#endif
index 37e53a3..a4868d7 100644 (file)
@@ -1,4 +1,13 @@
-#include "e.h"
+#include <libefsd.h>
+
+#include "view.h"
+#include "background.h"
+#include "config.h"
+#include "border.h"
+#include "menu.h"
+#include "menubuild.h"
+#include "fs.h"
+#include "util.h"
 
 static Evas_List views = NULL;
 static Eevent *current_ev = NULL;
@@ -9,6 +18,9 @@ static Ev_Key_Modifiers range_select_mod = EV_KEY_MODIFIER_CTRL;
 static void e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
 static void e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
 static void e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
+static void e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
+static void e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
+static void e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
 static void e_idle(void *data);
 static void e_wheel(Eevent * ev);
 static void e_key_down(Eevent * ev);
@@ -28,6 +40,8 @@ static void e_focus_out(Eevent * ev);
 static void e_delete(Eevent * ev);
 static void e_view_handle_fs(EfsdEvent *ev);
 static void e_view_handle_fs_restart(void *data);
+static void e_view_resort_timeout(int val, void *data);
+static int  e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2);
 
 void
 e_view_selection_update(E_View *v)
@@ -1419,7 +1433,7 @@ e_view_icon_apply_xy(E_Icon *ic)
 }
 
 static int
-e_view_restart_alphabetical_qsort_cb(void *data1, void *data2)
+e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2)
 {
    E_Icon *ic, *ic2;
    
diff --git a/src/view.h b/src/view.h
new file mode 100644 (file)
index 0000000..b40aebc
--- /dev/null
@@ -0,0 +1,200 @@
+#ifndef E_VIEW_H
+#define E_VIEW_H
+
+#include "e.h"
+
+struct _E_View
+{
+   OBJ_PROPERTIES;
+   
+   char                  *dir;
+   
+   struct {
+      Evas_Render_Method  render_method;
+      int                 back_pixmap;
+   } options;
+   
+   Evas                   evas;
+   struct {
+      Window              base;
+      Window              main;
+   } win;
+   Pixmap                 pmap;
+   struct {
+      int                 w, h;
+   } size;
+   struct {
+      int                 x, y;
+   } location;
+   struct {
+      /* +-----------------+
+       * |        Wt       |
+       * |  +-----------+  |
+       * |Wl|           |Wr|
+       * |  |    [I] Is |  |
+       * |  |    Ig     |  |
+       * |  |   [txt]   |  |
+       * |  |     Ib    |  |
+       * |  +-----------+  |
+       * |       Wb        |
+       * +-----------------+
+       */
+      struct {
+        int l, r, t, b;
+      } window;
+      struct {
+        int s, g, b;
+      } icon;
+   } spacing;
+   struct {
+      int on;
+      int x, y, w, h;
+      struct {
+        int x, y;
+      } down;
+      struct {
+        struct {
+           int r, g, b, a;
+        } 
+        edge_l, edge_r, edge_t, edge_b, 
+        middle, 
+        grad_l, grad_r, grad_t, grad_b;
+        struct {
+           int l, r, t, b;
+        } grad_size;
+      } config;
+      struct {
+        Evas_Object clip;
+        Evas_Object edge_l;
+        Evas_Object edge_r;
+        Evas_Object edge_t;
+        Evas_Object edge_b;
+        Evas_Object middle;
+        Evas_Object grad_l;
+        Evas_Object grad_r;
+        Evas_Object grad_t;
+        Evas_Object grad_b;
+      } obj;
+   } select;
+   struct {
+      int started;
+      Window win;
+      int x, y;
+      struct {
+        int x, y;
+      } offset;
+      int update;
+   } drag;
+   
+   Evas_Object            obj_bg;
+   
+   E_Background          *bg;
+   
+   int                    is_listing;
+   int                    monitor_id;
+   
+   E_FS_Restarter        *restarter;
+   
+   Evas_List              icons;
+   
+   int                    is_desktop;
+   int                    have_resort_queued;
+   int                    sel_count;
+   
+   int                    changed;
+};
+
+
+struct _E_Icon
+{
+   OBJ_PROPERTIES;
+   
+   char   *file;
+   
+   E_View *view;
+   
+   struct {
+      char *icon;
+      char *custom_icon;
+      char *link;
+      struct {
+        char *base;
+        char *type;
+      } mime;
+   } info;
+   
+   struct {
+      Evas_Object icon;
+      Evas_Object text;
+      Evas_Object event1;
+      Evas_Object event2;
+      struct {
+        struct {
+           Ebits_Object icon;
+           Ebits_Object text;
+        } over, under;
+      } sel;
+   } obj;
+   
+   struct {
+      int hilited;
+      int clicked;
+      int selected;
+      int running;
+      int disabled;
+      int visible;
+      int just_selected;
+      int just_executed;
+   } state;
+   
+   struct {
+      int x, y, w, h;
+      struct {
+        int w, h;
+      } icon;
+      struct {
+        int w, h;
+      } text;
+   } geom;
+   
+   int     changed;   
+};
+
+
+void      e_view_selection_update(E_View *v);
+void      e_view_deselect_all(void);
+void      e_view_deselect_all_except(E_Icon *not_ic);
+Eevent   *e_view_get_current_event(void);
+int       e_view_filter_file(E_View *v, char *file);
+void      e_view_icon_update_state(E_Icon *ic);
+void      e_view_icon_invert_selection(E_Icon *ic);
+void      e_view_icon_select(E_Icon *ic);
+void      e_view_icon_deselect(E_Icon *ic);
+void      e_view_icon_exec(E_Icon *ic);
+void      e_view_icon_free(E_Icon *ic);
+void      e_view_icon_initial_show(E_Icon *ic);
+void      e_view_icon_set_mime(E_Icon *ic, char *base, char *mime);
+void      e_view_icon_set_link(E_Icon *ic, char *link);
+E_Icon   *e_view_icon_new(void);
+E_Icon   *e_view_find_icon_by_file(E_View *view, char *file);
+void      e_view_icon_show(E_Icon *ic);
+void      e_view_icon_hide(E_Icon *ic);
+void      e_view_icon_apply_xy(E_Icon *ic);
+void      e_view_resort_alphabetical(E_View *v);
+void      e_view_arrange(E_View *v);
+void      e_view_resort(E_View *v);
+void      e_view_queue_resort(E_View *v);
+void      e_view_file_added(int id, char *file);
+void      e_view_file_deleted(int id, char *file);
+void      e_view_file_changed(int id, char *file);
+void      e_view_file_moved(int id, char *file);
+E_View   *e_view_find_by_monitor_id(int id);
+void      e_view_free(E_View *v);
+E_View   *e_view_new(void);
+void      e_view_set_background(E_View *v);
+void      e_view_set_dir(E_View *v, char *dir);
+void      e_view_realize(E_View *v);
+void      e_view_update(E_View *v);
+void      e_view_init(void);
+
+#endif