summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpk <cpk>2001-07-30 16:59:37 +0000
committercpk <cpk@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2001-07-30 16:59:37 +0000
commit637e5ce74bb7c9b6ee0e4d2b3c7c094d0d7c36cf (patch)
treef4f625d2bb4183a7f22fd3ad78113c67703ca507
parentf1689e5a664269ac40fa2addf59acd7120b4cd7c (diff)
Okay Raster, don't shoot me. I've cleaned up the whole thing. I've
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
-rw-r--r--AUTHORS2
-rw-r--r--acconfig.h4
-rw-r--r--configure.in19
-rw-r--r--src/Makefile.am42
-rw-r--r--src/actions.c46
-rw-r--r--src/actions.h59
-rw-r--r--src/background.c35
-rw-r--r--src/background.h31
-rw-r--r--src/border.c10
-rw-r--r--src/border.h140
-rw-r--r--src/config.c3
-rw-r--r--src/config.h148
-rw-r--r--src/desktops.c34
-rw-r--r--src/desktops.h41
-rw-r--r--src/e.h878
-rw-r--r--src/entry.c9
-rw-r--r--src/entry.h73
-rw-r--r--src/exec.c6
-rw-r--r--src/exec.h12
-rw-r--r--src/fs.c7
-rw-r--r--src/fs.h19
-rw-r--r--src/icccm.c3
-rw-r--r--src/icccm.h31
-rw-r--r--src/ipc.c3
-rw-r--r--src/ipc.h9
-rw-r--r--src/keys.c3
-rw-r--r--src/keys.h10
-rw-r--r--src/main.c47
-rw-r--r--src/menu.c3
-rw-r--r--src/menu.h129
-rw-r--r--src/menubuild.c5
-rw-r--r--src/menubuild.h23
-rw-r--r--src/resist.c4
-rw-r--r--src/resist.h15
-rw-r--r--src/util.c2
-rw-r--r--src/util.h22
-rw-r--r--src/view.c18
-rw-r--r--src/view.h200
38 files changed, 1207 insertions, 938 deletions
diff --git a/AUTHORS b/AUTHORS
index cd73268c0..2b3a239aa 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,3 @@
1The Rasterman <raster@rasterman.com> 1The Rasterman <raster@rasterman.com>
2Christian Kreibich <cK@whoop.org>, <kreibich@aciri.org> 2Christian Kreibich <cK@whoop.org>
3Burra <burra@colorado.edu> 3Burra <burra@colorado.edu>
diff --git a/acconfig.h b/acconfig.h
index ae5c7e803..8618ccab2 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,3 +1,7 @@
1#undef ENLIGHTENMENT_VERSION
2#undef ENLIGHTENMENT_MAJOR
3#undef ENLIGHTENMENT_MINOR
4#undef ENLIGHTENMENT_MICRO
1#undef ENABLE_NLS 5#undef ENABLE_NLS
2#undef HAVE_CATGETS 6#undef HAVE_CATGETS
3#undef HAVE_GETTEXT 7#undef HAVE_GETTEXT
diff --git a/configure.in b/configure.in
index 803ad9e2b..7944f8b79 100644
--- a/configure.in
+++ b/configure.in
@@ -1,9 +1,26 @@
1dnl Process this file with autoconf to produce a configure script. 1dnl Process this file with autoconf to produce a configure script.
2 2
3AC_INIT(configure.in) 3AC_INIT(configure.in)
4AM_INIT_AUTOMAKE(enlightenment, 0.17.pre_0) 4
5ENLIGHTENMENT_MAJOR=0
6ENLIGHTENMENT_MINOR=17
7ENLIGHTENMENT_MICRO=pre_0
8ENLIGHTENMENT_VERSION=$ENLIGHTENMENT_MAJOR.$ENLIGHTENMENT_MINOR.$ENLIGHTENMENT_MICRO
9
10VERSION=$ENLIGHTENMENT_VERSION
11
12AM_INIT_AUTOMAKE(enlightenment, $VERSION)
5AM_CONFIG_HEADER(config.h) 13AM_CONFIG_HEADER(config.h)
6 14
15AC_DEFINE_UNQUOTED(ENLIGHTENMENT_VERSION, "$ENLIGHTENMENT_VERSION")
16AC_SUBST(ENLIGHTENMENT_VERSION)
17AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MAJOR, "$ENLIGHTENMENT_MAJOR")
18AC_SUBST(ENLIGHTENMENT_MAJOR)
19AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MINOR, "$ENLIGHTENMENT_MINOR")
20AC_SUBST(ENLIGHTENMENT_MINOR)
21AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MICRO, "$ENLIGHTENMENT_MICRO")
22AC_SUBST(ENLIGHTENMENT_MICRO)
23
7AC_ISC_POSIX 24AC_ISC_POSIX
8AC_PROG_CC 25AC_PROG_CC
9AM_PROG_CC_STDC 26AM_PROG_CC_STDC
diff --git a/src/Makefile.am b/src/Makefile.am
index a8c658457..2803fa83f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,27 +7,27 @@ INCLUDES = \
7bin_PROGRAMS = enlightenment 7bin_PROGRAMS = enlightenment
8 8
9enlightenment_SOURCES = \ 9enlightenment_SOURCES = \
10actions.c \ 10 actions.h actions.c \
11background.c \ 11 background.h background.c \
12border.c \ 12 border.h border.c \
13config.c \ 13 config.h config.c \
14desktops.c \ 14 destops.h desktops.c \
15entry.c \ 15 entry.h entry.c \
16exec.c \ 16 exec.h exec.c \
17fs.c \ 17 fs.h fs.c \
18icccm.c \ 18 icccm.h icccm.c \
19icons.c \ 19 icons.h icons.c \
20ipc.c \ 20 ipc.h ipc.c \
21keys.c \ 21 keys.h keys.c \
22main.c \ 22 main.c \
23menu.c \ 23 menu.h menu.c \
24menubuild.c \ 24 menubuild.h menubuild.c \
25pack.c \ 25 pack.c \
26resist.c \ 26 resist.h resist.c \
27shelf.c \ 27 shelf.c \
28util.c \ 28 util.h util.c \
29view.c \ 29 view.h view.c \
30e.h 30 e.h
31 31
32enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ -lm -lc $(INTLLIBS) 32enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ -lm -lc $(INTLLIBS)
33 33
diff --git a/src/actions.c b/src/actions.c
index 7ec638a69..8b6a1c316 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1,4 +1,11 @@
1#include "e.h" 1#include "actions.h"
2#include "config.h"
3#include "border.h"
4#include "desktops.h"
5#include "exec.h"
6#include "icccm.h"
7#include "keys.h"
8#include "view.h"
2 9
3static Evas_List action_protos = NULL; 10static Evas_List action_protos = NULL;
4static Evas_List current_actions = NULL; 11static 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
57 64
58static void e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry); 65static void e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
59 66
67#define SET_BORDER_GRAVITY(_b, _grav) \
68e_window_gravity_set(_b->win.container, _grav); \
69e_window_gravity_set(_b->win.input, _grav); \
70e_window_gravity_set(_b->win.l, _grav); \
71e_window_gravity_set(_b->win.r, _grav); \
72e_window_gravity_set(_b->win.t, _grav); \
73e_window_gravity_set(_b->win.b, _grav);
74
60static void 75static void
61_e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o) 76_e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o)
62{ 77{
@@ -343,7 +358,7 @@ e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry)
343{ 358{
344 Evas_List l; 359 Evas_List l;
345 360
346 e_actions_del_timer_object(o); 361 e_action_del_timer_object(o);
347 again: 362 again:
348 for (l = current_actions; l; l = l->next) 363 for (l = current_actions; l; l = l->next)
349 { 364 {
@@ -389,7 +404,7 @@ e_action_add_proto(char *action,
389} 404}
390 405
391void 406void
392e_actions_del_timer(void *o, char *name) 407e_action_del_timer(void *o, char *name)
393{ 408{
394 Evas_List l; 409 Evas_List l;
395 410
@@ -414,7 +429,7 @@ e_actions_del_timer(void *o, char *name)
414} 429}
415 430
416void 431void
417e_actions_add_timer(void *o, char *name) 432e_action_add_timer(void *o, char *name)
418{ 433{
419 E_Active_Action_Timer *at; 434 E_Active_Action_Timer *at;
420 435
@@ -425,7 +440,7 @@ e_actions_add_timer(void *o, char *name)
425} 440}
426 441
427void 442void
428e_actions_del_timer_object(void *o) 443e_action_del_timer_object(void *o)
429{ 444{
430 Evas_List l; 445 Evas_List l;
431 446
@@ -447,7 +462,7 @@ e_actions_del_timer_object(void *o)
447} 462}
448 463
449void 464void
450e_actions_init(void) 465e_action_init(void)
451{ 466{
452 e_action_add_proto("Window_Move", e_act_move_start, e_act_move_stop, e_act_move_go); 467 e_action_add_proto("Window_Move", e_act_move_start, e_act_move_stop, e_act_move_go);
453 e_action_add_proto("Window_Resize", e_act_resize_start, e_act_resize_stop, e_act_resize_go); 468 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)
473} 488}
474 489
475 490
476
477
478
479
480/* FIXME: these REALLY need to go into other file(s) but it's not worht it */ 491/* FIXME: these REALLY need to go into other file(s) but it's not worht it */
481/* yet at this point. it can be done later */ 492/* yet at this point. it can be done later */
482 493
494/* Erm is that really true? They're all static, all called through the
495 above functions -- so it's good to have them encapsulated here? --cK */
496
483static void 497static void
484e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry) 498e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
485{ 499{
@@ -923,8 +937,8 @@ e_act_cb_shade(int val, void *data)
923 OBJ_REF(b); 937 OBJ_REF(b);
924 t = e_get_time(); 938 t = e_get_time();
925 e_window_gravity_set(b->win.client, SouthWestGravity); 939 e_window_gravity_set(b->win.client, SouthWestGravity);
926 e_actions_del_timer(b, "shader"); 940 e_action_del_timer(b, "shader");
927 e_actions_add_timer(b, "shader"); 941 e_action_add_timer(b, "shader");
928 } 942 }
929 943
930 dif = e_get_time() - t; 944 dif = e_get_time() - t;
@@ -939,7 +953,7 @@ e_act_cb_shade(int val, void *data)
939 e_add_event_timer("shader", 0.01, e_act_cb_shade, 1, data); 953 e_add_event_timer("shader", 0.01, e_act_cb_shade, 1, data);
940 else 954 else
941 { 955 {
942 e_actions_del_timer(b, "shader"); 956 e_action_del_timer(b, "shader");
943 e_window_gravity_reset(b->win.client); 957 e_window_gravity_reset(b->win.client);
944 OBJ_UNREF(b); 958 OBJ_UNREF(b);
945 } 959 }
@@ -963,8 +977,8 @@ e_act_cb_unshade(int val, void *data)
963 OBJ_REF(b); 977 OBJ_REF(b);
964 t = e_get_time(); 978 t = e_get_time();
965 e_window_gravity_set(b->win.client, SouthWestGravity); 979 e_window_gravity_set(b->win.client, SouthWestGravity);
966 e_actions_del_timer(b, "shader"); 980 e_action_del_timer(b, "shader");
967 e_actions_add_timer(b, "shader"); 981 e_action_add_timer(b, "shader");
968 } 982 }
969 983
970 dif = e_get_time() - t; 984 dif = e_get_time() - t;
@@ -980,7 +994,7 @@ e_act_cb_unshade(int val, void *data)
980 e_add_event_timer("shader", 0.01, e_act_cb_unshade, 1, data); 994 e_add_event_timer("shader", 0.01, e_act_cb_unshade, 1, data);
981 else 995 else
982 { 996 {
983 e_actions_del_timer(b, "shader"); 997 e_action_del_timer(b, "shader");
984 e_window_gravity_reset(b->win.client); 998 e_window_gravity_reset(b->win.client);
985 OBJ_UNREF(b); 999 OBJ_UNREF(b);
986 } 1000 }
diff --git a/src/actions.h b/src/actions.h
new file mode 100644
index 000000000..e37bf57a7
--- /dev/null
+++ b/src/actions.h
@@ -0,0 +1,59 @@
1#ifndef E_ACTIONS_H
2#define E_ACTIONS_H
3
4#include "e.h"
5
6struct _E_Active_Action_Timer
7{
8 void *object;
9 char *name;
10};
11
12struct _E_Action
13{
14 OBJ_PROPERTIES;
15
16 char *name;
17 char *action;
18 char *params;
19 int event;
20 int button;
21 char *key;
22 int modifiers;
23 E_Action_Proto *action_proto;
24 void *object;
25 int started;
26 int grabbed;
27};
28
29struct _E_Action_Proto
30{
31 OBJ_PROPERTIES;
32
33 char *action;
34 void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
35 void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
36 void (*func_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
37};
38
39
40void e_action_start(char *action, int act, int button, char *key,
41 Ev_Key_Modifiers mods, void *o, void *data,
42 int x, int y, int rx, int ry);
43void e_action_stop(char *action, int act, int button, char *key,
44 Ev_Key_Modifiers mods, void *o, void *data,
45 int x, int y, int rx, int ry);
46void e_action_go(char *action, int act, int button, char *key,
47 Ev_Key_Modifiers mods, void *o, void *data,
48 int x, int y, int rx, int ry, int dx, int dy);
49void e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry);
50void e_action_add_proto(char *action,
51 void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
52 void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
53 void (*func_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy));
54void e_action_del_timer(void *o, char *name);
55void e_action_add_timer(void *o, char *name);
56void e_action_del_timer_object(void *o);
57void e_action_init(void);
58
59#endif
diff --git a/src/background.c b/src/background.c
index e7475fb94..c9732ccb9 100644
--- a/src/background.c
+++ b/src/background.c
@@ -1,4 +1,35 @@
1#include "e.h" 1#include "background.h"
2
3typedef struct _E_Background_Layer
4{
5 int mode;
6 int type;
7 int inlined;
8 struct {
9 float x, y;
10 } scroll;
11 struct {
12 float x, y;
13 } pos;
14 struct {
15 float w, h;
16 struct {
17 int w, h;
18 } orig;
19 } size, fill;
20 char *color_class;
21 char *file;
22 double angle;
23 struct {
24 int r, g, b, a;
25 } fg, bg;
26
27 double x, y, w, h, fw, fh;
28
29 Evas_Object obj;
30}
31E_Background_Layer;
32
2 33
3void 34void
4e_background_free(E_Background *bg) 35e_background_free(E_Background *bg)
@@ -89,7 +120,7 @@ e_background_load(char *file)
89 sprintf(buf, "/layers/%i/fill.h", i); e_db_float_get(db, buf, &(bl->fill.h)); 120 sprintf(buf, "/layers/%i/fill.h", i); e_db_float_get(db, buf, &(bl->fill.h));
90 sprintf(buf, "/layers/%i/fill.orig.w", i); e_db_int_get(db, buf, &(bl->fill.orig.w)); 121 sprintf(buf, "/layers/%i/fill.orig.w", i); e_db_int_get(db, buf, &(bl->fill.orig.w));
91 sprintf(buf, "/layers/%i/fill.orig.h", i); e_db_int_get(db, buf, &(bl->fill.orig.h)); 122 sprintf(buf, "/layers/%i/fill.orig.h", i); e_db_int_get(db, buf, &(bl->fill.orig.h));
92 sprintf(buf, "/layers/%i/angle", i); e_db_float_get(db, buf, &(bl->angle)); 123 sprintf(buf, "/layers/%i/angle", i); e_db_float_get(db, buf, (float*)&(bl->angle));
93 sprintf(buf, "/layers/%i/fg.r", i); e_db_int_get(db, buf, &(bl->fg.r)); 124 sprintf(buf, "/layers/%i/fg.r", i); e_db_int_get(db, buf, &(bl->fg.r));
94 sprintf(buf, "/layers/%i/fg.g", i); e_db_int_get(db, buf, &(bl->fg.g)); 125 sprintf(buf, "/layers/%i/fg.g", i); e_db_int_get(db, buf, &(bl->fg.g));
95 sprintf(buf, "/layers/%i/fg.b", i); e_db_int_get(db, buf, &(bl->fg.b)); 126 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
index 000000000..18a977980
--- /dev/null
+++ b/src/background.h
@@ -0,0 +1,31 @@
1#ifndef E_BACKGROUND_H
2#define E_BACKGROUND_H
3
4#include "e.h"
5
6struct _E_Background
7{
8 OBJ_PROPERTIES;
9
10 Evas evas;
11 char *file;
12
13 struct {
14 int sx, sy;
15 int w, h;
16 } geom;
17
18 Evas_List layers;
19
20 Evas_Object base_obj;
21};
22
23void e_background_free(E_Background *bg);
24E_Background *e_background_new(void);
25E_Background *e_background_load(char *file);
26void e_background_realize(E_Background *bg, Evas evas);
27void e_background_set_scroll(E_Background *bg, int sx, int sy);
28void e_background_set_size(E_Background *bg, int w, int h);
29void e_background_set_color_class(E_Background *bg, char *cc, int r, int g, int b, int a);
30
31#endif
diff --git a/src/border.c b/src/border.c
index d7c8b3d3d..06c2a0c8a 100644
--- a/src/border.c
+++ b/src/border.c
@@ -1,4 +1,10 @@
1#include "e.h" 1#include "border.h"
2#include "config.h"
3#include "actions.h"
4#include "desktops.h"
5#include "resist.h"
6#include "icccm.h"
7#include "util.h"
2 8
3/* Window border rendering, querying, setting & modification code */ 9/* Window border rendering, querying, setting & modification code */
4 10
@@ -1196,7 +1202,7 @@ e_border_adopt(Window win, int use_client_pos)
1196 b->changed = 1; 1202 b->changed = 1;
1197 } 1203 }
1198 { 1204 {
1199 int x, y, w, h; 1205 int x, y;
1200 int pl, pr, pt, pb; 1206 int pl, pr, pt, pb;
1201 1207
1202 pl = pr = pt = pb = 0; 1208 pl = pr = pt = pb = 0;
diff --git a/src/border.h b/src/border.h
new file mode 100644
index 000000000..70cb6342a
--- /dev/null
+++ b/src/border.h
@@ -0,0 +1,140 @@
1#ifndef E_BORDER_H
2#define E_BORDER_H
3
4#include "e.h"
5
6struct _E_Grab
7{
8 int button;
9 Ev_Key_Modifiers mods;
10 int any_mod;
11 int remove_after;
12 int allow;
13};
14
15struct _E_Border
16{
17 OBJ_PROPERTIES;
18
19 struct {
20 Window main;
21 Window l, r, t, b;
22 Window input;
23 Window container;
24 Window client;
25 } win;
26 struct {
27 Evas l, r, t, b;
28 } evas;
29 struct {
30 struct {
31 Evas_Object l, r, t, b;
32 } title;
33 struct {
34 Evas_Object l, r, t, b;
35 } title_clip;
36 } obj;
37 struct {
38 Pixmap l, r, t, b;
39 } pixmap;
40 struct {
41 int new;
42 Ebits_Object l, r, t, b;
43 } bits;
44
45 struct {
46 struct {
47 int x, y, w, h;
48 int visible;
49 int dx, dy;
50 } requested;
51 int x, y, w, h;
52 int visible;
53 int selected;
54 int select_lost_from_grab;
55 int shaded;
56 int has_shape;
57 int shape_changes;
58 int shaped_client;
59 } current, previous;
60
61 struct {
62 struct {
63 int w, h;
64 double aspect;
65 } base, min, max, step;
66 int layer;
67 char *title;
68 char *name;
69 char *class;
70 char *command;
71 Window group;
72 int takes_focus;
73 int sticky;
74 Colormap colormap;
75 int fixed;
76 int arrange_ignore;
77 int hidden;
78 int iconified;
79 int titlebar;
80 int border;
81 int handles;
82 int w, h;
83 struct {
84 int requested;
85 int x, y;
86 int gravity;
87 } pos;
88 } client;
89
90 struct {
91 int move, resize;
92 } mode;
93
94 struct {
95 int x, y, w, h;
96 int is;
97 } max;
98
99 int ignore_unmap;
100 int shape_changed;
101 int placed;
102
103 Evas_List grabs;
104 E_Desktop *desk;
105
106 char *border_file;
107
108 int first_expose;
109
110 int changed;
111};
112
113
114void e_border_apply_border(E_Border *b);
115void e_border_reshape(E_Border *b);
116E_Border *e_border_adopt(Window win, int use_client_pos);
117E_Border *e_border_new(void);
118void e_border_free(E_Border *b);
119void e_border_remove_mouse_grabs(E_Border *b);
120void e_border_attach_mouse_grabs(E_Border *b);
121void e_border_remove_all_mouse_grabs(void);
122void e_border_attach_all_mouse_grabs(void);
123void e_border_redo_grabs(void);
124E_Border *e_border_find_by_window(Window win);
125void e_border_set_bits(E_Border *b, char *file);
126void e_border_set_color_class(E_Border *b, char *class, int rr, int gg, int bb, int aa);
127void e_border_adjust_limits(E_Border *b);
128void e_border_update(E_Border *b);
129void e_border_set_layer(E_Border *b, int layer);
130void e_border_raise(E_Border *b);
131void e_border_lower(E_Border *b);
132void e_border_raise_above(E_Border *b, E_Border *above);
133void e_border_lower_below(E_Border *b, E_Border *below);
134void e_border_init(void);
135void e_border_adopt_children(Window win);
136E_Border *e_border_current_focused(void);
137void e_border_focus_grab_ended(void);
138
139
140#endif
diff --git a/src/config.c b/src/config.c
index f4338565a..e0e3b9612 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1,4 +1,5 @@
1#include "e.h" 1#include "config.h"
2#include "util.h"
2 3
3static char cfg_root[] = ""; 4static char cfg_root[] = "";
4 5
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 000000000..ad33fc859
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,148 @@
1#ifndef E_CONFIG_H
2#define E_CONFIG_H
3
4#include "e.h"
5
6/* something to check validity of config files where we get data from */
7/* for now its just a 5 second timout so it will only invalidate */
8/* if we havent looked for 5 seconds... BUT later when efsd is more solid */
9/* we should use that to tell us when its invalid */
10struct _E_Config_File
11{
12 char *src;
13 double last_fetch;
14};
15
16struct _E_Config_Element
17{
18 char *src;
19 char *key;
20 double last_fetch;
21 int type;
22 int def_int_val;
23 float def_float_val;
24 char *def_str_val;
25 void *def_data_val;
26 int def_data_val_size;
27 int cur_int_val;
28 float cur_float_val;
29 char *cur_str_val;
30 void *cur_data_val;
31 int cur_data_val_size;
32};
33
34#define E_CFG_FILE(_var, _src) \
35static E_Config_File _var = {_src, 0.0}
36#define E_CONFIG_CHECK_VALIDITY(_var, _src) \
37{ \
38double __time; \
39__time = e_get_time(); \
40if (_var.last_fetch < (__time - 5.0)) { \
41_var.last_fetch = __time;
42#define E_CONFIG_CHECK_VALIDITY_END \
43} \
44}
45
46#define E_CFG_INT_T 123
47#define E_CFG_FLOAT_T 1234
48#define E_CFG_STR_T 12345
49#define E_CFG_DATA_T 123456
50
51#define E_CFG_INT(_var, _src, _key, _default) \
52static E_Config_Element _var = { _src, _key, 0.0, E_CFG_INT_T, \
53_default, 0.0, NULL, NULL, 0, \
540, 0.0, NULL, NULL, 0, \
55}
56
57#define E_CFG_FLOAT(_var, _src, _key, _default) \
58static E_Config_Element _var = { _src, _key, 0.0, E_CFG_FLOAT_T, \
590, _default, NULL, NULL, 0, \
600, 0.0, NULL, NULL, 0, \
61}
62
63#define E_CFG_STR(_var, _src, _key, _default) \
64static E_Config_Element _var = { _src, _key, 0.0, E_CFG_STR_T, \
650, 0.0, _default, NULL, 0, \
660, 0.0, NULL, NULL, 0, \
67}
68
69#define E_CFG_DATA(_var, _src, _key, _default, _default_size) \
70static E_Config_Element _var = { _src, _key, 0.0, E_CFG_DATAT_T, \
710, 0.0, NULL, _default, _default_size, \
720, 0.0, NULL, NULL, 0, \
73}
74
75/* yes for now it only fetches them every 5 seconds - in the end i need a */
76/* validity flag for the database file to know if it changed and only then */
77/* get the value again. this is waiting for efsd to become more solid */
78#define E_CFG_VALIDITY_CHECK(_var) \
79{ \
80double __time; \
81__time = e_get_time(); \
82if (_var.last_fetch < (__time - 5.0)) { \
83int __cfg_ok = 0; \
84_var.last_fetch = __time;
85
86#define E_CFG_END_VALIDITY_CHECK \
87} \
88}
89
90#define E_CONFIG_INT_GET(_var, _val) \
91{{ \
92E_CFG_VALIDITY_CHECK(_var) \
93E_DB_INT_GET(e_config_get(_var.src), _var.key, _var.cur_int_val, __cfg_ok); \
94if (!__cfg_ok) _var.cur_int_val = _var.def_int_val; \
95E_CFG_END_VALIDITY_CHECK \
96} \
97_val = _var.cur_int_val;}
98
99#define E_CONFIG_FLOAT_GET(_var, _val) \
100{{ \
101E_CFG_VALIDITY_CHECK(_var) \
102E_DB_FLOAT_GET(e_config_get(_var.src), _var.key, _var.cur_float_val, __cfg_ok); \
103if (!__cfg_ok) _var.cur_float_val = _var.def_float_val; \
104E_CFG_END_VALIDITY_CHECK \
105} \
106_val = _var.cur_float_val;}
107
108#define E_CONFIG_STR_GET(_var, _val) \
109{{ \
110E_CFG_VALIDITY_CHECK(_var) \
111if (_var.cur_str_val) free(_var.cur_str_val); \
112_var.cur_str_val = NULL; \
113E_DB_STR_GET(e_config_get(_var.src), _var.key, _var.cur_str_val, __cfg_ok); \
114if (!__cfg_ok) _var.cur_str_val = _var.def_str_val \
115E_CFG_END_VALIDITY_CHECK \
116} \
117_val = _var.cur_str_val;}
118
119#define E_CONFIG_DATA_GET(_var, _val, _size) \
120{{ \
121E_CFG_VALIDITY_CHECK(_var) \
122if (_var.cur_data_val) free(_var.cur_data_val); \
123_var.cur_data_val = NULL; \
124_var.cur_data_size = 0; \
125{ E_DB_File *__db; \
126__db = e_db_open_read(e_config_get(_var.src)); \
127if (__db) { \
128_var.cur_data_val = e_db_data_get(__db, _var.key, &(_var.cur_data_size)); \
129if (_var.cur_data_val) __cfg_ok = 1; \
130e_db_close(__db); \
131} \
132} \
133if (!__cfg_ok) { \
134_var.cur_data_val = e_memdup(_var.def_data_val, _var.def_data_size); \
135_var.cur_data_size = _var.def_data_size; \
136} \
137E_CFG_END_VALIDITY_CHECK \
138} \
139_val = _var.cur_data_val; \
140_size = _var.cur_data_size;}
141
142
143char *e_config_get(char *type);
144void e_config_init(void);
145void e_config_set_user_dir(char *dir);
146char *e_config_user_dir(void);
147
148#endif
diff --git a/src/desktops.c b/src/desktops.c
index b3f099f8e..f4d330e33 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -1,4 +1,11 @@
1#include "e.h" 1#include "desktops.h"
2#include "config.h"
3#include "actions.h"
4#include "border.h"
5#include "background.h"
6#include "view.h"
7#include "icccm.h"
8#include "util.h"
2 9
3static Evas_List desktops = NULL; 10static Evas_List desktops = NULL;
4static Window e_base_win = 0; 11static Window e_base_win = 0;
@@ -164,20 +171,25 @@ e_desktops_init_file_display(E_Desktop *desk)
164 desk->view->size.w = desk->real.w; 171 desk->view->size.w = desk->real.w;
165 desk->view->size.h = desk->real.h; 172 desk->view->size.h = desk->real.h;
166 desk->view->is_desktop = 1; 173 desk->view->is_desktop = 1;
174
167 /* FIXME: load bg here */ 175 /* FIXME: load bg here */
168 { 176 {
169 char buf[4096]; 177 char buf[4096];
170 178
171 sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds")); 179 sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
172 desk->view->bg = e_background_load(buf); 180 desk->view->bg = e_background_load(buf);
173 printf("**** load %s = %p\n", buf, desk->view->bg); 181 printf("**** load %s = %p\n", buf, desk->view->bg);
174 } 182 }
183
175 /* fixme: later */ 184 /* fixme: later */
176 /* uncomment this and comment out the next line for some tress testing */ 185 /* uncomment this and comment out the next line for some tress testing */
177/* desk->view->dir = strdup("/dev"); */ 186 /* desk->view->dir = strdup("/dev"); */
178 desk->view->dir = strdup(e_file_home()); 187 desk->view->dir = strdup(e_file_home());
179 e_view_realize(desk->view); 188 e_view_realize(desk->view);
180 if (desk->view->options.back_pixmap) e_view_update(desk->view); 189
190 if (desk->view->options.back_pixmap)
191 e_view_update(desk->view);
192
181 desk->win.desk = desk->view->win.base; 193 desk->win.desk = desk->view->win.base;
182 e_window_reparent(desk->win.desk, desk->win.container, 0, 0); 194 e_window_reparent(desk->win.desk, desk->win.container, 0, 0);
183 e_window_show(desk->win.desk); 195 e_window_show(desk->win.desk);
diff --git a/src/desktops.h b/src/desktops.h
new file mode 100644
index 000000000..23cc42ce9
--- /dev/null
+++ b/src/desktops.h
@@ -0,0 +1,41 @@
1#ifndef E_DESKTOPS_H
2#define E_DESKTOPS_H
3
4#include "e.h"
5
6struct _E_Desktop
7{
8 OBJ_PROPERTIES;
9
10 char *name;
11 char *dir;
12 struct {
13 Window main;
14 Window container;
15 Window desk;
16 } win;
17 E_View *view;
18 int x, y;
19 struct {
20 int w, h;
21 } real, virt;
22 Evas_List windows;
23 int changed;
24};
25
26void e_desktops_init(void);
27void e_desktops_scroll(E_Desktop *desk, int dx, int dy);
28void e_desktops_free(E_Desktop *desk);
29void e_desktops_init_file_display(E_Desktop *desk);
30E_Desktop *e_desktops_new(void);
31void e_desktops_add_border(E_Desktop *d, E_Border *b);
32void e_desktops_del_border(E_Desktop *d, E_Border *b);
33void e_desktops_delete(E_Desktop *d);
34void e_desktops_show(E_Desktop *d);
35void e_desktops_hide(E_Desktop *d);
36int e_desktops_get_num(void);
37E_Desktop *e_desktops_get(int d);
38int e_desktops_get_current(void);
39void e_desktops_goto(int d);
40
41#endif
diff --git a/src/e.h b/src/e.h
index 74bf47251..c2679bc6e 100644
--- a/src/e.h
+++ b/src/e.h
@@ -1,3 +1,6 @@
1#ifndef ENLIGHTENMENT_H
2#define ENLIGHTENMENT_H
3
1#include "../config.h" 4#include "../config.h"
2#include <X11/Xlib.h> 5#include <X11/Xlib.h>
3#include <stdio.h> 6#include <stdio.h>
@@ -21,7 +24,6 @@
21#include <Ebits.h> 24#include <Ebits.h>
22#include <Ecore.h> 25#include <Ecore.h>
23#include <Edb.h> 26#include <Edb.h>
24#include <libefsd.h>
25 27
26/* macros for allowing sections of code to be runtime profiled */ 28/* macros for allowing sections of code to be runtime profiled */
27#define E_PROF 1 29#define E_PROF 1
@@ -112,108 +114,6 @@ _e_obj->e_obj_free = (void *) _e_obj_free_func; \
112#define ACT_KEY_DOWN 8 114#define ACT_KEY_DOWN 8
113#define ACT_KEY_UP 9 115#define ACT_KEY_UP 9
114 116
115/* config macros */
116/* something to check validity of config files where we get data from */
117/* for now its just a 5 second timout so it will only invalidate */
118/* if we havent looked for 5 seconds... BUT later when efsd is more solid */
119/* we should use that to tell us when its invalid */
120#define E_CFG_FILE(_var, _src) \
121static E_Config_File _var = {_src, 0.0}
122#define E_CONFIG_CHECK_VALIDITY(_var, _src) \
123{ \
124double __time; \
125__time = e_get_time(); \
126if (_var.last_fetch < (__time - 5.0)) { \
127_var.last_fetch = __time;
128#define E_CONFIG_CHECK_VALIDITY_END \
129} \
130}
131#define E_CFG_INT_T 123
132#define E_CFG_FLOAT_T 1234
133#define E_CFG_STR_T 12345
134#define E_CFG_DATA_T 123456
135#define E_CFG_INT(_var, _src, _key, _default) \
136static E_Config_Element _var = { _src, _key, 0.0, E_CFG_INT_T, \
137_default, 0.0, NULL, NULL, 0, \
1380, 0.0, NULL, NULL, 0, \
139}
140#define E_CFG_FLOAT(_var, _src, _key, _default) \
141static E_Config_Element _var = { _src, _key, 0.0, E_CFG_FLOAT_T, \
1420, _default, NULL, NULL, 0, \
1430, 0.0, NULL, NULL, 0, \
144}
145#define E_CFG_STR(_var, _src, _key, _default) \
146static E_Config_Element _var = { _src, _key, 0.0, E_CFG_STR_T, \
1470, 0.0, _default, NULL, 0, \
1480, 0.0, NULL, NULL, 0, \
149}
150#define E_CFG_DATA(_var, _src, _key, _default, _default_size) \
151static E_Config_Element _var = { _src, _key, 0.0, E_CFG_DATAT_T, \
1520, 0.0, NULL, _default, _default_size, \
1530, 0.0, NULL, NULL, 0, \
154}
155/* yes for now it only fetches them every 5 seconds - in the end i need a */
156/* validity flag for the database file to know if it changed and only then */
157/* get the value again. this is waiting for efsd to become more solid */
158#define E_CFG_VALIDITY_CHECK(_var) \
159{ \
160double __time; \
161__time = e_get_time(); \
162if (_var.last_fetch < (__time - 5.0)) { \
163int __cfg_ok = 0; \
164_var.last_fetch = __time;
165#define E_CFG_END_VALIDITY_CHECK \
166} \
167}
168#define E_CONFIG_INT_GET(_var, _val) \
169{{ \
170E_CFG_VALIDITY_CHECK(_var) \
171E_DB_INT_GET(e_config_get(_var.src), _var.key, _var.cur_int_val, __cfg_ok); \
172if (!__cfg_ok) _var.cur_int_val = _var.def_int_val; \
173E_CFG_END_VALIDITY_CHECK \
174} \
175_val = _var.cur_int_val;}
176#define E_CONFIG_FLOAT_GET(_var, _val) \
177{{ \
178E_CFG_VALIDITY_CHECK(_var) \
179E_DB_FLOAT_GET(e_config_get(_var.src), _var.key, _var.cur_float_val, __cfg_ok); \
180if (!__cfg_ok) _var.cur_float_val = _var.def_float_val; \
181E_CFG_END_VALIDITY_CHECK \
182} \
183_val = _var.cur_float_val;}
184#define E_CONFIG_STR_GET(_var, _val) \
185{{ \
186E_CFG_VALIDITY_CHECK(_var) \
187if (_var.cur_str_val) free(_var.cur_str_val); \
188_var.cur_str_val = NULL; \
189E_DB_STR_GET(e_config_get(_var.src), _var.key, _var.cur_str_val, __cfg_ok); \
190if (!__cfg_ok) _var.cur_str_val = _var.def_str_val \
191E_CFG_END_VALIDITY_CHECK \
192} \
193_val = _var.cur_str_val;}
194#define E_CONFIG_DATA_GET(_var, _val, _size) \
195{{ \
196E_CFG_VALIDITY_CHECK(_var) \
197if (_var.cur_data_val) free(_var.cur_data_val); \
198_var.cur_data_val = NULL; \
199_var.cur_data_size = 0; \
200{ E_DB_File *__db; \
201__db = e_db_open_read(e_config_get(_var.src)); \
202if (__db) { \
203_var.cur_data_val = e_db_data_get(__db, _var.key, &(_var.cur_data_size)); \
204if (_var.cur_data_val) __cfg_ok = 1; \
205e_db_close(__db); \
206} \
207} \
208if (!__cfg_ok) { \
209_var.cur_data_val = e_memdup(_var.def_data_val, _var.def_data_size); \
210_var.cur_data_size = _var.def_data_size; \
211} \
212E_CFG_END_VALIDITY_CHECK \
213} \
214_val = _var.cur_data_val; \
215_size = _var.cur_data_size;}
216
217/* misc util macros */ 117/* misc util macros */
218#define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \ 118#define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
219((x < (xx + ww)) && \ 119((x < (xx + ww)) && \
@@ -223,34 +123,26 @@ _size = _var.cur_data_size;}
223#define SPANS_COMMON(x1, w1, x2, w2) \ 123#define SPANS_COMMON(x1, w1, x2, w2) \
224(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1))))) 124(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
225#define UN(_blah) _blah = 0 125#define UN(_blah) _blah = 0
226#define SET_BORDER_GRAVITY(_b, _grav) \
227e_window_gravity_set(_b->win.container, _grav); \
228e_window_gravity_set(_b->win.input, _grav); \
229e_window_gravity_set(_b->win.l, _grav); \
230e_window_gravity_set(_b->win.r, _grav); \
231e_window_gravity_set(_b->win.t, _grav); \
232e_window_gravity_set(_b->win.b, _grav);
233 126
234/* data types */ 127/* data types */
235typedef struct _E_Object E_Object;
236typedef struct _E_Border E_Border;
237typedef struct _E_Grab E_Grab;
238typedef struct _E_Action E_Action; 128typedef struct _E_Action E_Action;
239typedef struct _E_Action_Proto E_Action_Proto; 129typedef struct _E_Action_Proto E_Action_Proto;
240typedef struct _E_Desktop E_Desktop;
241typedef struct _E_Rect E_Rect;
242typedef struct _E_Active_Action_Timer E_Active_Action_Timer; 130typedef struct _E_Active_Action_Timer E_Active_Action_Timer;
243typedef struct _E_View E_View;
244typedef struct _E_Icon E_Icon;
245typedef struct _E_Background E_Background; 131typedef struct _E_Background E_Background;
246typedef struct _E_Background_Layer E_Background_Layer; 132typedef struct _E_Border E_Border;
247typedef struct _E_Menu E_Menu;
248typedef struct _E_Menu_Item E_Menu_Item;
249typedef struct _E_Build_Menu E_Build_Menu; 133typedef struct _E_Build_Menu E_Build_Menu;
134typedef struct _E_Config_File E_Config_File;
135typedef struct _E_Config_Element E_Config_Element;
136typedef struct _E_Desktop E_Desktop;
250typedef struct _E_Entry E_Entry; 137typedef struct _E_Entry E_Entry;
251typedef struct _E_FS_Restarter E_FS_Restarter; 138typedef struct _E_FS_Restarter E_FS_Restarter;
252typedef struct _E_Config_File E_Config_File; 139typedef struct _E_Grab E_Grab;
253typedef struct _E_Config_Element E_Config_Element; 140typedef struct _E_Icon E_Icon;
141typedef struct _E_Menu E_Menu;
142typedef struct _E_Menu_Item E_Menu_Item;
143typedef struct _E_Object E_Object;
144typedef struct _E_Rect E_Rect;
145typedef struct _E_View E_View;
254 146
255/* actual fdata struct members */ 147/* actual fdata struct members */
256struct _E_Object 148struct _E_Object
@@ -258,744 +150,4 @@ struct _E_Object
258 OBJ_PROPERTIES; 150 OBJ_PROPERTIES;
259}; 151};
260 152
261struct _E_Border 153#endif
262{
263 OBJ_PROPERTIES;
264
265 struct {
266 Window main;
267 Window l, r, t, b;
268 Window input;
269 Window container;
270 Window client;
271 } win;
272 struct {
273 Evas l, r, t, b;
274 } evas;
275 struct {
276 struct {
277 Evas_Object l, r, t, b;
278 } title;
279 struct {
280 Evas_Object l, r, t, b;
281 } title_clip;
282 } obj;
283 struct {
284 Pixmap l, r, t, b;
285 } pixmap;
286 struct {
287 int new;
288 Ebits_Object l, r, t, b;
289 } bits;
290
291 struct {
292 struct {
293 int x, y, w, h;
294 int visible;
295 int dx, dy;
296 } requested;
297 int x, y, w, h;
298 int visible;
299 int selected;
300 int select_lost_from_grab;
301 int shaded;
302 int has_shape;
303 int shape_changes;
304 int shaped_client;
305 } current, previous;
306
307 struct {
308 struct {
309 int w, h;
310 double aspect;
311 } base, min, max, step;
312 int layer;
313 char *title;
314 char *name;
315 char *class;
316 char *command;
317 Window group;
318 int takes_focus;
319 int sticky;
320 Colormap colormap;
321 int fixed;
322 int arrange_ignore;
323 int hidden;
324 int iconified;
325 int titlebar;
326 int border;
327 int handles;
328 int w, h;
329 struct {
330 int requested;
331 int x, y;
332 int gravity;
333 } pos;
334 } client;
335
336 struct {
337 int move, resize;
338 } mode;
339
340 struct {
341 int x, y, w, h;
342 int is;
343 } max;
344
345 int ignore_unmap;
346 int shape_changed;
347 int placed;
348
349 Evas_List grabs;
350 E_Desktop *desk;
351
352 char *border_file;
353
354 int first_expose;
355
356 int changed;
357};
358
359struct _E_Grab
360{
361 int button;
362 Ev_Key_Modifiers mods;
363 int any_mod;
364 int remove_after;
365 int allow;
366};
367
368struct _E_Action
369{
370 OBJ_PROPERTIES;
371
372 char *name;
373 char *action;
374 char *params;
375 int event;
376 int button;
377 char *key;
378 int modifiers;
379 E_Action_Proto *action_proto;
380 void *object;
381 int started;
382 int grabbed;
383};
384
385struct _E_Action_Proto
386{
387 OBJ_PROPERTIES;
388
389 char *action;
390 void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
391 void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
392 void (*func_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
393};
394
395struct _E_Desktop
396{
397 OBJ_PROPERTIES;
398
399 char *name;
400 char *dir;
401 struct {
402 Window main;
403 Window container;
404 Window desk;
405 } win;
406 E_View *view;
407 int x, y;
408 struct {
409 int w, h;
410 } real, virt;
411 Evas_List windows;
412 int changed;
413};
414
415struct _E_Rect
416{
417 int x, y, w, h;
418 int v1, v2, v3, v4;
419};
420
421struct _E_Active_Action_Timer
422{
423 void *object;
424 char *name;
425};
426
427struct _E_View
428{
429 OBJ_PROPERTIES;
430
431 char *dir;
432
433 struct {
434 Evas_Render_Method render_method;
435 int back_pixmap;
436 } options;
437
438 Evas evas;
439 struct {
440 Window base;
441 Window main;
442 } win;
443 Pixmap pmap;
444 struct {
445 int w, h;
446 } size;
447 struct {
448 int x, y;
449 } location;
450 struct {
451 /* +-----------------+
452 * | Wt |
453 * | +-----------+ |
454 * |Wl| |Wr|
455 * | | [I] Is | |
456 * | | Ig | |
457 * | | [txt] | |
458 * | | Ib | |
459 * | +-----------+ |
460 * | Wb |
461 * +-----------------+
462 */
463 struct {
464 int l, r, t, b;
465 } window;
466 struct {
467 int s, g, b;
468 } icon;
469 } spacing;
470 struct {
471 int on;
472 int x, y, w, h;
473 struct {
474 int x, y;
475 } down;
476 struct {
477 struct {
478 int r, g, b, a;
479 }
480 edge_l, edge_r, edge_t, edge_b,
481 middle,
482 grad_l, grad_r, grad_t, grad_b;
483 struct {
484 int l, r, t, b;
485 } grad_size;
486 } config;
487 struct {
488 Evas_Object clip;
489 Evas_Object edge_l;
490 Evas_Object edge_r;
491 Evas_Object edge_t;
492 Evas_Object edge_b;
493 Evas_Object middle;
494 Evas_Object grad_l;
495 Evas_Object grad_r;
496 Evas_Object grad_t;
497 Evas_Object grad_b;
498 } obj;
499 } select;
500 struct {
501 int started;
502 Window win;
503 int x, y;
504 struct {
505 int x, y;
506 } offset;
507 int update;
508 } drag;
509
510 Evas_Object obj_bg;
511
512 E_Background *bg;
513
514 int is_listing;
515 int monitor_id;
516
517 E_FS_Restarter *restarter;
518
519 Evas_List icons;
520
521 int is_desktop;
522 int have_resort_queued;
523 int sel_count;
524
525 int changed;
526};
527
528struct _E_Icon
529{
530 OBJ_PROPERTIES;
531
532 char *file;
533
534 E_View *view;
535
536 struct {
537 char *icon;
538 char *custom_icon;
539 char *link;
540 struct {
541 char *base;
542 char *type;
543 } mime;
544 } info;
545
546 struct {
547 Evas_Object icon;
548 Evas_Object text;
549 Evas_Object event1;
550 Evas_Object event2;
551 struct {
552 struct {
553 Ebits_Object icon;
554 Ebits_Object text;
555 } over, under;
556 } sel;
557 } obj;
558
559 struct {
560 int hilited;
561 int clicked;
562 int selected;
563 int running;
564 int disabled;
565 int visible;
566 int just_selected;
567 int just_executed;
568 } state;
569
570 struct {
571 int x, y, w, h;
572 struct {
573 int w, h;
574 } icon;
575 struct {
576 int w, h;
577 } text;
578 } geom;
579
580 int changed;
581};
582
583struct _E_Background_Layer
584{
585 int mode;
586 int type;
587 int inlined;
588 struct {
589 float x, y;
590 } scroll;
591 struct {
592 float x, y;
593 } pos;
594 struct {
595 float w, h;
596 struct {
597 int w, h;
598 } orig;
599 } size, fill;
600 char *color_class;
601 char *file;
602 double angle;
603 struct {
604 int r, g, b, a;
605 } fg, bg;
606
607 double x, y, w, h, fw, fh;
608
609 Evas_Object obj;
610};
611
612struct _E_Background
613{
614 OBJ_PROPERTIES;
615
616 Evas evas;
617 char *file;
618
619 struct {
620 int sx, sy;
621 int w, h;
622 } geom;
623
624 Evas_List layers;
625
626 Evas_Object base_obj;
627};
628
629struct _E_Menu
630{
631 OBJ_PROPERTIES;
632
633 struct {
634 int x, y, w, h;
635 int visible;
636 } current, previous;
637 struct {
638 int l, r, t, b;
639 } border, sel_border;
640 struct {
641 Window main, evas;
642 } win;
643 Evas evas;
644 Ebits_Object bg;
645 Evas_List entries;
646 char *bg_file;
647
648 int first_expose;
649
650 int recalc_entries;
651 int redo_sel;
652 int changed;
653
654 struct {
655 int state, icon, text;
656 } size;
657 struct {
658 int icon, state;
659 } pad;
660
661 E_Menu_Item *selected;
662
663 Time time;
664};
665
666struct _E_Menu_Item
667{
668 OBJ_PROPERTIES;
669
670 int x, y;
671 struct {
672 struct {
673 int w, h;
674 } min;
675 int w, h;
676 } size;
677
678 Ebits_Object bg;
679 char *bg_file;
680 int selected;
681
682 Evas_Object obj_entry;
683
684 char *str;
685 Evas_Object obj_text;
686
687 char *icon;
688 Evas_Object obj_icon;
689 int scale_icon;
690
691 Ebits_Object state;
692 char *state_file;
693
694 Ebits_Object sep;
695 char *sep_file;
696
697 int separator;
698 int radio_group;
699 int radio;
700 int check;
701 int on;
702
703 E_Menu *menu;
704 E_Menu *submenu;
705
706 void (*func_select) (E_Menu *m, E_Menu_Item *mi, void *data);
707 void *func_select_data;
708};
709
710struct _E_Build_Menu
711{
712 OBJ_PROPERTIES;
713
714 char *file;
715 time_t mod_time;
716
717 E_Menu *menu;
718
719 Evas_List menus;
720 Evas_List commands;
721};
722
723struct _E_Entry
724{
725 Evas evas;
726 char *buffer;
727 int cursor_pos;
728 struct {
729 int start, length, down;
730 } select;
731 int mouse_down;
732 int visible;
733 int focused;
734 int scroll_pos;
735 int x, y, w, h;
736 int min_size;
737 Ebits_Object obj_base;
738 Ebits_Object obj_cursor;
739 Ebits_Object obj_selection;
740 Evas_Object event_box;
741 Evas_Object clip_box;
742 Evas_Object text;
743 Window paste_win;
744 Window selection_win;
745 int end_width;
746 void (*func_changed) (E_Entry *entry, void *data);
747 void *data_changed;
748 void (*func_enter) (E_Entry *entry, void *data);
749 void *data_enter;
750 void (*func_focus_in) (E_Entry *entry, void *data);
751 void *data_focus_in;
752 void (*func_focus_out) (E_Entry *entry, void *data);
753 void *data_focus_out;
754};
755
756struct _E_FS_Restarter
757{
758 void (*func) (void *data);
759 void *data;
760};
761
762struct _E_Config_File
763{
764 char *src;
765 double last_fetch;
766};
767
768struct _E_Config_Element
769{
770 char *src;
771 char *key;
772 double last_fetch;
773 int type;
774 int def_int_val;
775 float def_float_val;
776 char *def_str_val;
777 void *def_data_val;
778 int def_data_val_size;
779 int cur_int_val;
780 float cur_float_val;
781 char *cur_str_val;
782 void *cur_data_val;
783 int cur_data_val_size;
784};
785
786void e_entry_init(void);
787void e_entry_free(E_Entry *entry);
788E_Entry *e_entry_new(void);
789void e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e);
790void e_entry_set_evas(E_Entry *entry, Evas evas);
791void e_entry_show(E_Entry *entry);
792void e_entry_hide(E_Entry *entry);
793void e_entry_raise(E_Entry *entry);
794void e_entry_lower(E_Entry *entry);
795void e_entry_set_layer(E_Entry *entry, int l);
796void e_entry_set_clip(E_Entry *entry, Evas_Object clip);
797void e_entry_unset_clip(E_Entry *entry);
798void e_entry_move(E_Entry *entry, int x, int y);
799void e_entry_resize(E_Entry *entry, int w, int h);
800void e_entry_query_max_size(E_Entry *entry, int *w, int *h);
801void e_entry_max_size(E_Entry *entry, int *w, int *h);
802void e_entry_min_size(E_Entry *entry, int *w, int *h);
803void e_entry_set_size(E_Entry *entry, int w, int h);
804void e_entry_set_focus(E_Entry *entry, int focused);
805void e_entry_set_text(E_Entry *entry, const char *text);
806const char *e_entry_get_text(E_Entry *entry);
807void e_entry_set_cursor(E_Entry *entry, int cursor_pos);
808int e_entry_get_cursor(E_Entry *entry);
809void e_entry_set_changed_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
810void e_entry_set_enter_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
811void e_entry_set_focus_in_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
812void e_entry_set_focus_out_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
813void e_entry_insert_text(E_Entry *entry, char *text);
814void e_entry_clear_selection(E_Entry *entry);
815void e_entry_delete_to_left(E_Entry *entry);
816void e_entry_delete_to_right(E_Entry *entry);
817char *e_entry_get_selection(E_Entry *entry);
818
819
820void e_action_add_proto(char *action,
821 void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
822 void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
823 void (*func_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy));
824void e_actions_init(void);
825void 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);
826void 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);
827void 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);
828void e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry);
829void e_actions_del_timer(void *o, char *name);
830void e_actions_add_timer(void *o, char *name);
831void e_actions_del_timer_object(void *o);
832
833void e_border_apply_border(E_Border *b);
834E_Border * e_border_new(void);
835E_Border * e_border_adopt(Window win, int use_client_pos);
836void e_border_reshape(E_Border *b);
837void e_border_free(E_Border *b);
838void e_border_remove_mouse_grabs(E_Border *b);
839void e_border_attach_mouse_grabs(E_Border *b);
840void e_border_remove_all_mouse_grabs(void);
841void e_border_attach_all_mouse_grabs(void);
842void e_border_redo_grabs(void);
843E_Border * e_border_find_by_window(Window win);
844void e_border_set_bits(E_Border *b, char *file);
845void e_border_set_color_class(E_Border *b, char *class, int rr, int gg, int bb, int aa);
846void e_border_adjust_limits(E_Border *b);
847void e_border_update(E_Border *b);
848void e_border_set_layer(E_Border *b, int layer);
849void e_border_raise(E_Border *b);
850void e_border_lower(E_Border *b);
851void e_border_raise_above(E_Border *b, E_Border *above);
852void e_border_lower_below(E_Border *b, E_Border *below);
853void e_border_init(void);
854void e_border_adopt_children(Window win);
855E_Border *e_border_current_focused(void);
856void e_border_focus_grab_ended(void);
857
858void e_icccm_move_resize(Window win, int x, int y, int w, int h);
859void e_icccm_delete(Window win);
860void e_icccm_state_mapped(Window win);
861void e_icccm_state_iconified(Window win);
862void e_icccm_state_withdrawn(Window win);
863void e_icccm_adopt(Window win);
864void e_icccm_release(Window win);
865void e_icccm_get_size_info(Window win, E_Border *b);
866void e_icccm_get_mwm_hints(Window win, E_Border *b);
867void e_icccm_get_layer(Window win, E_Border *b);
868void e_icccm_get_title(Window win, E_Border *b);
869void e_icccm_set_frame_size(Window win, int l, int r, int t, int b);
870void e_icccm_set_desk_area(Window win, int ax, int ay);
871void e_icccm_set_desk_area_size(Window win, int ax, int ay);
872void e_icccm_set_desk(Window win, int d);
873int e_icccm_is_shaped(Window win);
874void e_icccm_handle_property_change(Atom a, E_Border *b);
875void e_icccm_handle_client_message(Ev_Message *e);
876void e_icccm_advertise_e_compat(void);
877void e_icccm_advertise_mwm_compat(void);
878void e_icccm_advertise_gnome_compat(void);
879void e_icccm_advertise_kde_compat(void);
880void e_icccm_advertise_net_compat(void);
881
882void e_desktops_init(void);
883void e_desktops_scroll(E_Desktop *desk, int dx, int dy);
884void e_desktops_free(E_Desktop *desk);
885void e_desktops_init_file_display(E_Desktop *desk);
886E_Desktop * e_desktops_new(void);
887void e_desktops_add_border(E_Desktop *d, E_Border *b);
888void e_desktops_del_border(E_Desktop *d, E_Border *b);
889void e_desktops_delete(E_Desktop *d);
890void e_desktops_show(E_Desktop *d);
891void e_desktops_hide(E_Desktop *d);
892int e_desktops_get_num(void);
893E_Desktop * e_desktops_get(int d);
894int e_desktops_get_current(void);
895void e_desktops_goto(int num);
896void e_desktops_update(E_Desktop *desk);
897
898void e_resist_border(E_Border *b);
899
900time_t e_file_modified_time(char *file);
901void e_set_env(char *variable, char *content);
902int e_file_exists(char *file);
903int e_file_is_dir(char *file);
904char *e_file_home(void);
905int e_file_mkdir(char *dir);
906int e_file_cp(char *src, char *dst);
907char *e_file_real(char *file);
908char *e_file_get_file(char *file);
909char *e_file_get_dir(char *file);
910void *e_memdup(void *data, int size);
911int e_glob_matches(char *str, char *glob);
912int e_file_can_exec(struct stat *st);
913char *e_file_link(char *link);
914Evas_List e_file_list_dir(char *dir);
915
916void e_exec_set_args(int argc, char **argv);
917void e_exec_restart(void);
918pid_t e_exec_run(char *exe);
919pid_t e_exec_run_in_dir(char *exe, char *dir);
920pid_t e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path);
921
922char *e_config_get(char *type);
923void e_config_init(void);
924void e_config_set_user_dir(char *dir);
925char *e_config_user_dir(void);
926
927void e_view_free(E_View *v);
928E_View *e_view_new(void);
929void e_view_init(void);
930
931void e_menu_callback_item(E_Menu *m, E_Menu_Item *mi);
932void e_menu_item_set_callback(E_Menu_Item *mi, void (*func) (E_Menu *m, E_Menu_Item *mi, void *data), void *data);
933void e_menu_hide_submenus(E_Menu *menus_after);
934void e_menu_select(int dx, int dy);
935void e_menu_init(void);
936void e_menu_event_win_show(void);
937void e_menu_event_win_hide(void);
938void e_menu_set_background(E_Menu *m);
939void e_menu_set_sel(E_Menu *m, E_Menu_Item *mi);
940void e_menu_set_sep(E_Menu *m, E_Menu_Item *mi);
941void e_menu_set_state(E_Menu *m, E_Menu_Item *mi);
942void e_menu_free(E_Menu *m);
943E_Menu *e_menu_new(void);
944void e_menu_hide(E_Menu *m);
945void e_menu_show(E_Menu *m);
946void e_menu_move_to(E_Menu *m, int x, int y);
947void e_menu_show_at_mouse(E_Menu *m, int x, int y, Time t);
948void e_menu_add_item(E_Menu *m, E_Menu_Item *mi);
949void e_menu_del_item(E_Menu *m, E_Menu_Item *mi);
950void e_menu_item_update(E_Menu *m, E_Menu_Item *mi);
951void e_menu_item_unrealize(E_Menu *m, E_Menu_Item *mi);
952void e_menu_item_realize(E_Menu *m, E_Menu_Item *mi);
953E_Menu_Item *e_menu_item_new(char *str);
954void e_menu_obscure_outside_screen(E_Menu *m);
955void e_menu_scroll_all_by(int dx, int dy);
956void e_menu_update_visibility(E_Menu *m);
957void e_menu_update_base(E_Menu *m);
958void e_menu_update_finish(E_Menu *m);
959void e_menu_update_shows(E_Menu *m);
960void e_menu_update_hides(E_Menu *m);
961void e_menu_update(E_Menu *m);
962void e_menu_item_set_icon(E_Menu_Item *mi, char *icon);
963void e_menu_item_set_text(E_Menu_Item *mi, char *text);
964void e_menu_item_set_separator(E_Menu_Item *mi, int sep);
965void e_menu_item_set_radio(E_Menu_Item *mi, int radio);
966void e_menu_item_set_check(E_Menu_Item *mi, int check);
967void e_menu_item_set_state(E_Menu_Item *mi, int state);
968void e_menu_item_set_submenu(E_Menu_Item *mi, E_Menu *submenu);
969void e_menu_item_set_scale_icon(E_Menu_Item *mi, int scale);
970void e_menu_set_padding_icon(E_Menu *m, int pad);
971void e_menu_set_padding_state(E_Menu *m, int pad);
972
973void e_build_menu_free(E_Build_Menu *bm);
974E_Build_Menu *e_build_menu_new_from_db(char *file);
975E_Build_Menu *e_build_menu_new_from_gnome_apps(char *dir);
976
977E_FS_Restarter *e_fs_add_restart_handler(void (*func) (void *data), void *data);
978void e_fs_del_restart_handler(E_FS_Restarter *rs);
979void e_fs_add_event_handler(void (*func) (EfsdEvent *ev));
980void e_fs_init(void);
981EfsdConnection *e_fs_get_connection(void);
982
983void e_keys_grab(char *key, Ev_Key_Modifiers mods, int anymod);
984void e_keys_ungrab(char *key, Ev_Key_Modifiers mods, int anymod);
985void e_keys_init(void);
986
987E_Background *e_background_new(void);
988void e_background_realize(E_Background *bg, Evas evas);
989void e_background_free(E_Background *bg);
990
991void e_view_realize(E_View *v);
992void e_view_update(E_View *v);
993void e_view_update_selection(E_View *v, int x, int y);
994void e_view_update(E_View *v);
995void e_view_scroll(E_View *v, int dx, int dy);
996E_View *e_view_find_by_monitor_id(int id);
997void e_view_add_icon(E_View *v, E_Icon *icon);
998E_Icon *e_view_find_icon_by_file(E_View *v, char *file);
999void e_view_del_icon(E_View *v, E_Icon *icon);
1000
1001void e_ipc_init(void);
diff --git a/src/entry.c b/src/entry.c
index de973c2fd..c7b1a8e68 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -1,4 +1,7 @@
1#include "e.h" 1#include "entry.h"
2#include "background.h"
3#include "config.h"
4#include "util.h"
2 5
3static Evas_List entries; 6static Evas_List entries;
4 7
@@ -273,7 +276,7 @@ e_entry_configure(E_Entry *entry)
273 evas_resize(entry->evas, entry->event_box, entry->w - p1l - p1r - p2l - p2r, entry->h - p1t - p1b - p2t - p2b); 276 evas_resize(entry->evas, entry->event_box, entry->w - p1l - p1r - p2l - p2r, entry->h - p1t - p1b - p2t - p2b);
274 if ((entry->buffer) && (entry->buffer[0] != 0) && (entry->focused)) 277 if ((entry->buffer) && (entry->buffer[0] != 0) && (entry->focused))
275 { 278 {
276 int tx, ty, tw, th; 279 double tx, ty, tw, th;
277 280
278 if (entry->cursor_pos < strlen(entry->buffer)) 281 if (entry->cursor_pos < strlen(entry->buffer))
279 { 282 {
@@ -321,7 +324,7 @@ e_entry_configure(E_Entry *entry)
321 evas_move(entry->evas, entry->text, entry->x + entry->scroll_pos + p1l + p2l, entry->y + p1t + p2t); 324 evas_move(entry->evas, entry->text, entry->x + entry->scroll_pos + p1l + p2l, entry->y + p1t + p2t);
322 if (entry->select.start >= 0) 325 if (entry->select.start >= 0)
323 { 326 {
324 int x1, y1, x2, tw, th; 327 double x1, y1, x2, tw, th;
325 328
326 evas_text_at(entry->evas, entry->text, entry->select.start, &x1, &y1, NULL, NULL); 329 evas_text_at(entry->evas, entry->text, entry->select.start, &x1, &y1, NULL, NULL);
327 if (entry->select.start + entry->select.length <= strlen(entry->buffer)) 330 if (entry->select.start + entry->select.length <= strlen(entry->buffer))
diff --git a/src/entry.h b/src/entry.h
new file mode 100644
index 000000000..f4f55a233
--- /dev/null
+++ b/src/entry.h
@@ -0,0 +1,73 @@
1#ifndef E_ENTRY_H
2#define E_ENTRY_H
3
4#include "e.h"
5
6struct _E_Entry
7{
8 Evas evas;
9 char *buffer;
10 int cursor_pos;
11 struct {
12 int start, length, down;
13 } select;
14 int mouse_down;
15 int visible;
16 int focused;
17 int scroll_pos;
18 int x, y, w, h;
19 int min_size;
20 Ebits_Object obj_base;
21 Ebits_Object obj_cursor;
22 Ebits_Object obj_selection;
23 Evas_Object event_box;
24 Evas_Object clip_box;
25 Evas_Object text;
26 Window paste_win;
27 Window selection_win;
28 int end_width;
29 void (*func_changed) (E_Entry *entry, void *data);
30 void *data_changed;
31 void (*func_enter) (E_Entry *entry, void *data);
32 void *data_enter;
33 void (*func_focus_in) (E_Entry *entry, void *data);
34 void *data_focus_in;
35 void (*func_focus_out) (E_Entry *entry, void *data);
36 void *data_focus_out;
37};
38
39
40void e_entry_init(void);
41void e_entry_free(E_Entry *entry);
42E_Entry *e_entry_new(void);
43void e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e);
44void e_entry_set_evas(E_Entry *entry, Evas evas);
45void e_entry_show(E_Entry *entry);
46void e_entry_hide(E_Entry *entry);
47void e_entry_raise(E_Entry *entry);
48void e_entry_lower(E_Entry *entry);
49void e_entry_set_layer(E_Entry *entry, int l);
50void e_entry_set_clip(E_Entry *entry, Evas_Object clip);
51void e_entry_unset_clip(E_Entry *entry);
52void e_entry_move(E_Entry *entry, int x, int y);
53void e_entry_resize(E_Entry *entry, int w, int h);
54void e_entry_query_max_size(E_Entry *entry, int *w, int *h);
55void e_entry_max_size(E_Entry *entry, int *w, int *h);
56void e_entry_min_size(E_Entry *entry, int *w, int *h);
57void e_entry_set_size(E_Entry *entry, int w, int h);
58void e_entry_set_focus(E_Entry *entry, int focused);
59void e_entry_set_text(E_Entry *entry, const char *text);
60const char *e_entry_get_text(E_Entry *entry);
61void e_entry_set_cursor(E_Entry *entry, int cursor_pos);
62int e_entry_get_cursor(E_Entry *entry);
63void e_entry_set_changed_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
64void e_entry_set_enter_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
65void e_entry_set_focus_in_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
66void e_entry_set_focus_out_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data);
67void e_entry_insert_text(E_Entry *entry, char *text);
68void e_entry_clear_selection(E_Entry *entry);
69void e_entry_delete_to_left(E_Entry *entry);
70void e_entry_delete_to_right(E_Entry *entry);
71char *e_entry_get_selection(E_Entry *entry);
72
73#endif
diff --git a/src/exec.c b/src/exec.c
index e4d318fa6..964d8a88d 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -1,4 +1,6 @@
1#include "e.h" 1#include "exec.h"
2#include "desktops.h"
3#include "util.h"
2 4
3static int e_argc = 0; 5static int e_argc = 0;
4static char **e_argv = NULL; 6static char **e_argv = NULL;
@@ -70,7 +72,7 @@ e_exec_run_in_dir(char *exe, char *dir)
70} 72}
71 73
72pid_t 74pid_t
73e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path) 75e_exec_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path)
74{ 76{
75 static int launch_id = 0; 77 static int launch_id = 0;
76 char preload_paths[4096]; 78 char preload_paths[4096];
diff --git a/src/exec.h b/src/exec.h
new file mode 100644
index 000000000..d010d2b06
--- /dev/null
+++ b/src/exec.h
@@ -0,0 +1,12 @@
1#ifndef E_EXEC_H
2#define E_EXEC_H
3
4#include "e.h"
5
6void e_exec_set_args(int argc, char **argv);
7void e_exec_restart(void);
8pid_t e_exec_run(char *exe);
9pid_t e_exec_run_in_dir(char *exe, char *dir);
10pid_t e_exec_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path);
11
12#endif
diff --git a/src/fs.c b/src/fs.c
index c79fbc7af..7ce53ccb8 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -1,4 +1,5 @@
1#include "e.h" 1#include "fs.h"
2#include "exec.h"
2 3
3static EfsdConnection *ec = NULL; 4static EfsdConnection *ec = NULL;
4static Evas_List fs_handlers = NULL; 5static Evas_List fs_handlers = NULL;
@@ -111,6 +112,8 @@ e_fs_add_restart_handler(void (*func) (void *data), void *data)
111 rs->func = func; 112 rs->func = func;
112 rs->data = data; 113 rs->data = data;
113 fs_restart_handlers = evas_list_append(fs_restart_handlers, rs); 114 fs_restart_handlers = evas_list_append(fs_restart_handlers, rs);
115
116 return rs;
114} 117}
115 118
116void 119void
@@ -133,8 +136,6 @@ e_fs_add_event_handler(void (*func) (EfsdEvent *ev))
133void 136void
134e_fs_init(void) 137e_fs_init(void)
135{ 138{
136 int i;
137
138 e_event_filter_handler_add(EV_CHILD, e_fs_child_handle); 139 e_event_filter_handler_add(EV_CHILD, e_fs_child_handle);
139 _e_fs_restarter(0, NULL); 140 _e_fs_restarter(0, NULL);
140} 141}
diff --git a/src/fs.h b/src/fs.h
new file mode 100644
index 000000000..3383e2ef7
--- /dev/null
+++ b/src/fs.h
@@ -0,0 +1,19 @@
1#ifndef E_FS_H
2#define E_FS_H
3
4#include <libefsd.h>
5#include "e.h"
6
7struct _E_FS_Restarter
8{
9 void (*func) (void *data);
10 void *data;
11};
12
13void e_fs_init(void);
14E_FS_Restarter *e_fs_add_restart_handler(void (*func) (void *data), void *data);
15void e_fs_del_restart_handler(E_FS_Restarter *rs);
16void e_fs_add_event_handler(void (*func) (EfsdEvent *ev));
17EfsdConnection *e_fs_get_connection(void);
18
19#endif
diff --git a/src/icccm.c b/src/icccm.c
index 3e9302133..c934c0172 100644
--- a/src/icccm.c
+++ b/src/icccm.c
@@ -1,4 +1,5 @@
1#include "e.h" 1#include "e.h"
2#include "border.h"
2 3
3/* Motif window hints */ 4/* Motif window hints */
4#define MWM_HINTS_FUNCTIONS (1L << 0) 5#define MWM_HINTS_FUNCTIONS (1L << 0)
@@ -146,7 +147,7 @@ e_icccm_get_pos_info(Window win, E_Border *b)
146 { 147 {
147 int x, y, w, h; 148 int x, y, w, h;
148 149
149 printf("%i %i\n", hint.flags & USPosition, hint.flags & PPosition); 150 printf("%li %li\n", hint.flags & USPosition, hint.flags & PPosition);
150 b->client.pos.requested = 1; 151 b->client.pos.requested = 1;
151 b->client.pos.gravity = NorthWestGravity; 152 b->client.pos.gravity = NorthWestGravity;
152 if (hint.flags & PWinGravity) 153 if (hint.flags & PWinGravity)
diff --git a/src/icccm.h b/src/icccm.h
new file mode 100644
index 000000000..21f9e7227
--- /dev/null
+++ b/src/icccm.h
@@ -0,0 +1,31 @@
1#ifndef E_ICCCM_H
2#define E_ICCCM_H
3
4#include "e.h"
5
6void e_icccm_move_resize(Window win, int x, int y, int w, int h);
7void e_icccm_delete(Window win);
8void e_icccm_state_mapped(Window win);
9void e_icccm_state_iconified(Window win);
10void e_icccm_state_withdrawn(Window win);
11void e_icccm_adopt(Window win);
12void e_icccm_release(Window win);
13void e_icccm_get_pos_info(Window win, E_Border *b);
14void e_icccm_get_size_info(Window win, E_Border *b);
15void e_icccm_get_mwm_hints(Window win, E_Border *b);
16void e_icccm_get_layer(Window win, E_Border *b);
17void e_icccm_get_title(Window win, E_Border *b);
18void e_icccm_set_frame_size(Window win, int l, int r, int t, int b);
19void e_icccm_set_desk_area(Window win, int ax, int ay);
20void e_icccm_set_desk_area_size(Window win, int ax, int ay);
21void e_icccm_set_desk(Window win, int d);
22int e_icccm_is_shaped(Window win);
23void e_icccm_handle_property_change(Atom a, E_Border *b);
24void e_icccm_handle_client_message(Ev_Message *e);
25void e_icccm_advertise_e_compat(void);
26void e_icccm_advertise_mwm_compat(void);
27void e_icccm_advertise_gnome_compat(void);
28void e_icccm_advertise_kde_compat(void);
29void e_icccm_advertise_net_compat(void);
30
31#endif
diff --git a/src/ipc.c b/src/ipc.c
index fdb10af6a..e7abe12b4 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -1,4 +1,5 @@
1#include "e.h" 1#include "ipc.h"
2#include "config.h"
2 3
3struct _coords { 4struct _coords {
4 int xid; 5 int xid;
diff --git a/src/ipc.h b/src/ipc.h
new file mode 100644
index 000000000..e0494305c
--- /dev/null
+++ b/src/ipc.h
@@ -0,0 +1,9 @@
1#ifndef E_IPC_H
2#define E_IPC_H
3
4#include "e.h"
5
6void e_ipc_init(void);
7
8#endif
9
diff --git a/src/keys.c b/src/keys.c
index 902f8dc77..2c42d8781 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -1,4 +1,5 @@
1#include "e.h" 1#include "keys.h"
2#include "actions.h"
2 3
3static void e_key_down(Eevent * ev); 4static void e_key_down(Eevent * ev);
4static void e_key_up(Eevent * ev); 5static void e_key_up(Eevent * ev);
diff --git a/src/keys.h b/src/keys.h
new file mode 100644
index 000000000..c042309eb
--- /dev/null
+++ b/src/keys.h
@@ -0,0 +1,10 @@
1#ifndef E_KEYS_H
2#define E_KEYS_H
3
4#include "e.h"
5
6void e_keys_init(void);
7void e_keys_grab(char *key, Ev_Key_Modifiers mods, int anymod);
8void e_keys_ungrab(char *key, Ev_Key_Modifiers mods, int anymod);
9
10#endif;
diff --git a/src/main.c b/src/main.c
index 36eba1501..4e0f703c5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,4 +1,14 @@
1#include "e.h" 1#include "actions.h"
2#include "border.h"
3#include "config.h"
4#include "desktops.h"
5#include "exec.h"
6#include "fs.h"
7#include "entry.h"
8#include "keys.h"
9#include "ipc.h"
10#include "menu.h"
11#include "view.h"
2#include <X11/Xproto.h> 12#include <X11/Xproto.h>
3 13
4#ifdef E_PROF 14#ifdef E_PROF
@@ -50,15 +60,46 @@ setup(void)
50int 60int
51main(int argc, char **argv) 61main(int argc, char **argv)
52{ 62{
63 char *display = "0:0";
64 int i;
65
53 atexit(cb_exit); 66 atexit(cb_exit);
54 e_exec_set_args(argc, argv); 67 e_exec_set_args(argc, argv);
55 68
56 e_config_init(); 69 e_config_init();
57 if (!e_display_init(NULL)) 70
71 /* Check command line options here: */
72 for (i = 1; i < argc; i++)
73 {
74 if ((!strcmp("-display", argv[i])) && (argc - i > 1))
75 {
76 display = argv[++i];
77 }
78 else if ((!strcmp("-help", argv[i]))
79 || (!strcmp("--help", argv[i]))
80 || (!strcmp("-h", argv[i])) || (!strcmp("-?", argv[i])))
81 {
82 printf("enlightenment options: \n"
83 "\t-display display_name \n"
84 "\t[-v | -version | --version] \n");
85 exit(0);
86 }
87 else if ((!strcmp("-v", argv[i]))
88 || (!strcmp("-version", argv[i]))
89 || (!strcmp("--version", argv[i]))
90 || (!strcmp("-v", argv[i])))
91 {
92 printf("Enlightenment Version: %s\n", ENLIGHTENMENT_VERSION);
93 exit(0);
94 }
95 }
96
97 if (!e_display_init(display))
58 { 98 {
59 fprintf(stderr, "cannot connect to display!\n"); 99 fprintf(stderr, "cannot connect to display!\n");
60 exit(1); 100 exit(1);
61 } 101 }
102
62 e_ev_signal_init(); 103 e_ev_signal_init();
63 e_event_filter_init(); 104 e_event_filter_init();
64 e_ev_x_init(); 105 e_ev_x_init();
@@ -75,7 +116,7 @@ main(int argc, char **argv)
75 e_fs_init(); 116 e_fs_init();
76 e_desktops_init(); 117 e_desktops_init();
77 e_border_init(); 118 e_border_init();
78 e_actions_init(); 119 e_action_init();
79 e_menu_init(); 120 e_menu_init();
80 e_view_init(); 121 e_view_init();
81 e_entry_init(); 122 e_entry_init();
diff --git a/src/menu.c b/src/menu.c
index ee2c5fb76..05384608f 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,4 +1,5 @@
1#include "e.h" 1#include "menu.h"
2#include "config.h"
2 3
3static Evas_List open_menus = NULL; 4static Evas_List open_menus = NULL;
4static Evas_List menus = NULL; 5static Evas_List menus = NULL;
diff --git a/src/menu.h b/src/menu.h
new file mode 100644
index 000000000..dd6200326
--- /dev/null
+++ b/src/menu.h
@@ -0,0 +1,129 @@
1#ifndef E_MENU_H
2#define E_MENU_H
3
4#include "e.h"
5
6struct _E_Menu
7{
8 OBJ_PROPERTIES;
9
10 struct {
11 int x, y, w, h;
12 int visible;
13 } current, previous;
14 struct {
15 int l, r, t, b;
16 } border, sel_border;
17 struct {
18 Window main, evas;
19 } win;
20 Evas evas;
21 Ebits_Object bg;
22 Evas_List entries;
23 char *bg_file;
24
25 int first_expose;
26
27 int recalc_entries;
28 int redo_sel;
29 int changed;
30
31 struct {
32 int state, icon, text;
33 } size;
34 struct {
35 int icon, state;
36 } pad;
37
38 E_Menu_Item *selected;
39
40 Time time;
41};
42
43struct _E_Menu_Item
44{
45 OBJ_PROPERTIES;
46
47 int x, y;
48 struct {
49 struct {
50 int w, h;
51 } min;
52 int w, h;
53 } size;
54
55 Ebits_Object bg;
56 char *bg_file;
57 int selected;
58
59 Evas_Object obj_entry;
60
61 char *str;
62 Evas_Object obj_text;
63
64 char *icon;
65 Evas_Object obj_icon;
66 int scale_icon;
67
68 Ebits_Object state;
69 char *state_file;
70
71 Ebits_Object sep;
72 char *sep_file;
73
74 int separator;
75 int radio_group;
76 int radio;
77 int check;
78 int on;
79
80 E_Menu *menu;
81 E_Menu *submenu;
82
83 void (*func_select) (E_Menu *m, E_Menu_Item *mi, void *data);
84 void *func_select_data;
85};
86
87void e_menu_callback_item(E_Menu *m, E_Menu_Item *mi);
88void e_menu_item_set_callback(E_Menu_Item *mi, void (*func) (E_Menu *m, E_Menu_Item *mi, void *data), void *data);
89void e_menu_hide_submenus(E_Menu *menus_after);
90void e_menu_select(int dx, int dy);
91void e_menu_init(void );
92void e_menu_event_win_show(void );
93void e_menu_event_win_hide(void );
94void e_menu_set_background(E_Menu *m);
95void e_menu_set_sel(E_Menu *m, E_Menu_Item *mi);
96void e_menu_set_sep(E_Menu *m, E_Menu_Item *mi);
97void e_menu_set_state(E_Menu *m, E_Menu_Item *mi);
98void e_menu_free(E_Menu *m);
99E_Menu *e_menu_new(void );
100void e_menu_hide(E_Menu *m);
101void e_menu_show(E_Menu *m);
102void e_menu_move_to(E_Menu *m, int x, int y);
103void e_menu_show_at_mouse(E_Menu *m, int x, int y, Time t);
104void e_menu_add_item(E_Menu *m, E_Menu_Item *mi);
105void e_menu_del_item(E_Menu *m, E_Menu_Item *mi);
106void e_menu_item_update(E_Menu *m, E_Menu_Item *mi);
107void e_menu_item_unrealize(E_Menu *m, E_Menu_Item *mi);
108void e_menu_item_realize(E_Menu *m, E_Menu_Item *mi);
109E_Menu_Item *e_menu_item_new(char *str);
110void e_menu_obscure_outside_screen(E_Menu *m);
111void e_menu_scroll_all_by(int dx, int dy);
112void e_menu_update_visibility(E_Menu *m);
113void e_menu_update_base(E_Menu *m);
114void e_menu_update_finish(E_Menu *m);
115void e_menu_update_shows(E_Menu *m);
116void e_menu_update_hides(E_Menu *m);
117void e_menu_update(E_Menu *m);
118void e_menu_item_set_icon(E_Menu_Item *mi, char *icon);
119void e_menu_item_set_text(E_Menu_Item *mi, char *text);
120void e_menu_item_set_separator(E_Menu_Item *mi, int sep);
121void e_menu_item_set_radio(E_Menu_Item *mi, int radio);
122void e_menu_item_set_check(E_Menu_Item *mi, int check);
123void e_menu_item_set_state(E_Menu_Item *mi, int state);
124void e_menu_item_set_submenu(E_Menu_Item *mi, E_Menu *submenu);
125void e_menu_item_set_scale_icon(E_Menu_Item *mi, int scale);
126void e_menu_set_padding_icon(E_Menu *m, int pad);
127void e_menu_set_padding_state(E_Menu *m, int pad);
128
129#endif
diff --git a/src/menubuild.c b/src/menubuild.c
index e9d21c04f..d09472474 100644
--- a/src/menubuild.c
+++ b/src/menubuild.c
@@ -1,4 +1,7 @@
1#include "e.h" 1#include "menu.h"
2#include "menubuild.h"
3#include "exec.h"
4#include "util.h"
2 5
3Evas_List build_menus = NULL; 6Evas_List build_menus = NULL;
4 7
diff --git a/src/menubuild.h b/src/menubuild.h
new file mode 100644
index 000000000..8802b5d48
--- /dev/null
+++ b/src/menubuild.h
@@ -0,0 +1,23 @@
1#ifndef E_MENU_BUILD_H
2#define E_MENU_BUILD_H
3
4#include "e.h"
5
6struct _E_Build_Menu
7{
8 OBJ_PROPERTIES;
9
10 char *file;
11 time_t mod_time;
12
13 E_Menu *menu;
14
15 Evas_List menus;
16 Evas_List commands;
17};
18
19void e_build_menu_free(E_Build_Menu *bm);
20E_Build_Menu *e_build_menu_new_from_db(char *file);
21E_Build_Menu *e_build_menu_new_from_gnome_apps(char *dir);
22
23#endif;
diff --git a/src/resist.c b/src/resist.c
index 59e90cebc..04fb798b4 100644
--- a/src/resist.c
+++ b/src/resist.c
@@ -1,4 +1,6 @@
1#include "e.h" 1#include "resist.h"
2#include "config.h"
3#include "desktops.h"
2 4
3void 5void
4e_resist_border(E_Border *b) 6e_resist_border(E_Border *b)
diff --git a/src/resist.h b/src/resist.h
new file mode 100644
index 000000000..fe9f3951b
--- /dev/null
+++ b/src/resist.h
@@ -0,0 +1,15 @@
1#ifndef E_RESIST_H
2#define E_RESIST_H
3
4#include "e.h"
5#include "border.h"
6
7struct _E_Rect
8{
9 int x, y, w, h;
10 int v1, v2, v3, v4;
11};
12
13void e_resist_border(E_Border *b);
14
15#endif
diff --git a/src/util.c b/src/util.c
index ddedf60b2..d058583a7 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,4 +1,4 @@
1#include "e.h" 1#include "util.h"
2 2
3time_t 3time_t
4e_file_modified_time(char *file) 4e_file_modified_time(char *file)
diff --git a/src/util.h b/src/util.h
new file mode 100644
index 000000000..ee51f67cd
--- /dev/null
+++ b/src/util.h
@@ -0,0 +1,22 @@
1#ifndef E_UTIL_H
2#define E_UTIL_H
3
4#include "e.h"
5
6time_t e_file_modified_time(char *file);
7void e_set_env(char *variable, char *content);
8int e_file_exists(char *file);
9int e_file_is_dir(char *file);
10char *e_file_home(void);
11int e_file_mkdir(char *dir);
12int e_file_cp(char *src, char *dst);
13char *e_file_real(char *file);
14char *e_file_get_file(char *file);
15char *e_file_get_dir(char *file);
16void *e_memdup(void *data, int size);
17int e_glob_matches(char *str, char *glob);
18int e_file_can_exec(struct stat *st);
19char *e_file_link(char *link);
20Evas_List e_file_list_dir(char *dir);
21
22#endif
diff --git a/src/view.c b/src/view.c
index 37e53a33a..a4868d7ce 100644
--- a/src/view.c
+++ b/src/view.c
@@ -1,4 +1,13 @@
1#include "e.h" 1#include <libefsd.h>
2
3#include "view.h"
4#include "background.h"
5#include "config.h"
6#include "border.h"
7#include "menu.h"
8#include "menubuild.h"
9#include "fs.h"
10#include "util.h"
2 11
3static Evas_List views = NULL; 12static Evas_List views = NULL;
4static Eevent *current_ev = NULL; 13static Eevent *current_ev = NULL;
@@ -9,6 +18,9 @@ static Ev_Key_Modifiers range_select_mod = EV_KEY_MODIFIER_CTRL;
9static void e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y); 18static void e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
10static void e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y); 19static void e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
11static void e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y); 20static void e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
21static void e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
22static void e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
23static void e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
12static void e_idle(void *data); 24static void e_idle(void *data);
13static void e_wheel(Eevent * ev); 25static void e_wheel(Eevent * ev);
14static void e_key_down(Eevent * ev); 26static void e_key_down(Eevent * ev);
@@ -28,6 +40,8 @@ static void e_focus_out(Eevent * ev);
28static void e_delete(Eevent * ev); 40static void e_delete(Eevent * ev);
29static void e_view_handle_fs(EfsdEvent *ev); 41static void e_view_handle_fs(EfsdEvent *ev);
30static void e_view_handle_fs_restart(void *data); 42static void e_view_handle_fs_restart(void *data);
43static void e_view_resort_timeout(int val, void *data);
44static int e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2);
31 45
32void 46void
33e_view_selection_update(E_View *v) 47e_view_selection_update(E_View *v)
@@ -1419,7 +1433,7 @@ e_view_icon_apply_xy(E_Icon *ic)
1419} 1433}
1420 1434
1421static int 1435static int
1422e_view_restart_alphabetical_qsort_cb(void *data1, void *data2) 1436e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2)
1423{ 1437{
1424 E_Icon *ic, *ic2; 1438 E_Icon *ic, *ic2;
1425 1439
diff --git a/src/view.h b/src/view.h
new file mode 100644
index 000000000..b40aebc5b
--- /dev/null
+++ b/src/view.h
@@ -0,0 +1,200 @@
1#ifndef E_VIEW_H
2#define E_VIEW_H
3
4#include "e.h"
5
6struct _E_View
7{
8 OBJ_PROPERTIES;
9
10 char *dir;
11
12 struct {
13 Evas_Render_Method render_method;
14 int back_pixmap;
15 } options;
16
17 Evas evas;
18 struct {
19 Window base;
20 Window main;
21 } win;
22 Pixmap pmap;
23 struct {
24 int w, h;
25 } size;
26 struct {
27 int x, y;
28 } location;
29 struct {
30 /* +-----------------+
31 * | Wt |
32 * | +-----------+ |
33 * |Wl| |Wr|
34 * | | [I] Is | |
35 * | | Ig | |
36 * | | [txt] | |
37 * | | Ib | |
38 * | +-----------+ |
39 * | Wb |
40 * +-----------------+
41 */
42 struct {
43 int l, r, t, b;
44 } window;
45 struct {
46 int s, g, b;
47 } icon;
48 } spacing;
49 struct {
50 int on;
51 int x, y, w, h;
52 struct {
53 int x, y;
54 } down;
55 struct {
56 struct {
57 int r, g, b, a;
58 }
59 edge_l, edge_r, edge_t, edge_b,
60 middle,
61 grad_l, grad_r, grad_t, grad_b;
62 struct {
63 int l, r, t, b;
64 } grad_size;
65 } config;
66 struct {
67 Evas_Object clip;
68 Evas_Object edge_l;
69 Evas_Object edge_r;
70 Evas_Object edge_t;
71 Evas_Object edge_b;
72 Evas_Object middle;
73 Evas_Object grad_l;
74 Evas_Object grad_r;
75 Evas_Object grad_t;
76 Evas_Object grad_b;
77 } obj;
78 } select;
79 struct {
80 int started;
81 Window win;
82 int x, y;
83 struct {
84 int x, y;
85 } offset;
86 int update;
87 } drag;
88
89 Evas_Object obj_bg;
90
91 E_Background *bg;
92
93 int is_listing;
94 int monitor_id;
95
96 E_FS_Restarter *restarter;
97
98 Evas_List icons;
99
100 int is_desktop;
101 int have_resort_queued;
102 int sel_count;
103
104 int changed;
105};
106
107
108struct _E_Icon
109{
110 OBJ_PROPERTIES;
111
112 char *file;
113
114 E_View *view;
115
116 struct {
117 char *icon;
118 char *custom_icon;
119 char *link;
120 struct {
121 char *base;
122 char *type;
123 } mime;
124 } info;
125
126 struct {
127 Evas_Object icon;
128 Evas_Object text;
129 Evas_Object event1;
130 Evas_Object event2;
131 struct {
132 struct {
133 Ebits_Object icon;
134 Ebits_Object text;
135 } over, under;
136 } sel;
137 } obj;
138
139 struct {
140 int hilited;
141 int clicked;
142 int selected;
143 int running;
144 int disabled;
145 int visible;
146 int just_selected;
147 int just_executed;
148 } state;
149
150 struct {
151 int x, y, w, h;
152 struct {
153 int w, h;
154 } icon;
155 struct {
156 int w, h;
157 } text;
158 } geom;
159
160 int changed;
161};
162
163
164void e_view_selection_update(E_View *v);
165void e_view_deselect_all(void);
166void e_view_deselect_all_except(E_Icon *not_ic);
167Eevent *e_view_get_current_event(void);
168int e_view_filter_file(E_View *v, char *file);
169void e_view_icon_update_state(E_Icon *ic);
170void e_view_icon_invert_selection(E_Icon *ic);
171void e_view_icon_select(E_Icon *ic);
172void e_view_icon_deselect(E_Icon *ic);
173void e_view_icon_exec(E_Icon *ic);
174void e_view_icon_free(E_Icon *ic);
175void e_view_icon_initial_show(E_Icon *ic);
176void e_view_icon_set_mime(E_Icon *ic, char *base, char *mime);
177void e_view_icon_set_link(E_Icon *ic, char *link);
178E_Icon *e_view_icon_new(void);
179E_Icon *e_view_find_icon_by_file(E_View *view, char *file);
180void e_view_icon_show(E_Icon *ic);
181void e_view_icon_hide(E_Icon *ic);
182void e_view_icon_apply_xy(E_Icon *ic);
183void e_view_resort_alphabetical(E_View *v);
184void e_view_arrange(E_View *v);
185void e_view_resort(E_View *v);
186void e_view_queue_resort(E_View *v);
187void e_view_file_added(int id, char *file);
188void e_view_file_deleted(int id, char *file);
189void e_view_file_changed(int id, char *file);
190void e_view_file_moved(int id, char *file);
191E_View *e_view_find_by_monitor_id(int id);
192void e_view_free(E_View *v);
193E_View *e_view_new(void);
194void e_view_set_background(E_View *v);
195void e_view_set_dir(E_View *v, char *dir);
196void e_view_realize(E_View *v);
197void e_view_update(E_View *v);
198void e_view_init(void);
199
200#endif