diff --git a/client/client.c b/client/client.c index aae301414..3d5870007 100644 --- a/client/client.c +++ b/client/client.c @@ -1,76 +1,5 @@ -#include -#include -#include -#include -#include -#include #include -#include - -struct _coords { - int xid; - int x; - int y; -}; - -typedef struct _coords coords; - int main(void) { - struct sockaddr_un cli_sun; - int fd, opcode, retval, size; - char buf[100]; - coords p; - - if((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { - perror("socket() error"); - exit(1); - } - - bzero(&cli_sun, sizeof(cli_sun)); - cli_sun.sun_family = AF_UNIX; - strncpy(cli_sun.sun_path, ".e/ecom", sizeof(cli_sun.sun_path)); - - if (connect(fd, (struct sockaddr*)&cli_sun, sizeof(cli_sun)) < 0) - { - fprintf(stderr, "EIPC Connect Error.\n"); exit(1); - } - - /* move a window */ - opcode = 1; - p.xid = 5; - p.x = 100; - p.y = 300; - - if(write(fd, &opcode, sizeof(opcode)) == -1) - perror("Cannot write data"); - - size = sizeof(p); - - if(write(fd, &size, sizeof(size)) == -1) - perror("Cannot write data"); - - if(write(fd, &p, sizeof(p)) == -1) - perror("Cannot write data"); - - read(fd, &size, sizeof(size)); - read(fd, &retval, size); - - printf("Window move successful? %d\n", retval); - - /* get e version */ - opcode = 0; - - if(write(fd, &opcode, sizeof(opcode)) == -1) - perror("Cannot write data"); - - read(fd, &size, sizeof(size)); - read(fd, &buf, size); - - printf("Enlightenment Version: %s\n", buf); - - printf("Closing socket.\n"); - close(fd); - return(0); } diff --git a/src/actions.h b/src/actions.h index e37bf57a7..08854096d 100644 --- a/src/actions.h +++ b/src/actions.h @@ -3,6 +3,10 @@ #include "e.h" +typedef struct _E_Action E_Action; +typedef struct _E_Action_Proto E_Action_Proto; +typedef struct _E_Active_Action_Timer E_Active_Action_Timer; + struct _E_Active_Action_Timer { void *object; @@ -37,6 +41,18 @@ struct _E_Action_Proto }; +/* action type macros */ +#define ACT_MOUSE_IN 0 +#define ACT_MOUSE_OUT 1 +#define ACT_MOUSE_CLICK 2 +#define ACT_MOUSE_DOUBLE 3 +#define ACT_MOUSE_TRIPLE 4 +#define ACT_MOUSE_UP 5 +#define ACT_MOUSE_CLICKED 6 +#define ACT_MOUSE_MOVE 7 +#define ACT_KEY_DOWN 8 +#define ACT_KEY_UP 9 + 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); diff --git a/src/background.c b/src/background.c index c9732ccb9..1f37bded2 100644 --- a/src/background.c +++ b/src/background.c @@ -1,36 +1,5 @@ #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) { diff --git a/src/background.h b/src/background.h index 18a977980..541db40e8 100644 --- a/src/background.h +++ b/src/background.h @@ -3,6 +3,9 @@ #include "e.h" +typedef struct _E_Background E_Background; +typedef struct _E_Background_Layer E_Background_Layer; + struct _E_Background { OBJ_PROPERTIES; @@ -20,6 +23,37 @@ struct _E_Background Evas_Object base_obj; }; + +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; +}; + + void e_background_free(E_Background *bg); E_Background *e_background_new(void); E_Background *e_background_load(char *file); diff --git a/src/border.h b/src/border.h index 70cb6342a..6b7e6c9de 100644 --- a/src/border.h +++ b/src/border.h @@ -3,6 +3,14 @@ #include "e.h" +#ifndef E_DESKTOPS_TYPEDEF +#define E_DESKTOPS_TYPEDEF +typedef struct _E_Desktop E_Desktop; +#endif + +typedef struct _E_Grab E_Grab; +typedef struct _E_Border E_Border; + struct _E_Grab { int button; diff --git a/src/config.h b/src/config.h index ad33fc859..b881aeb13 100644 --- a/src/config.h +++ b/src/config.h @@ -3,6 +3,9 @@ #include "e.h" +typedef struct _E_Config_File E_Config_File; +typedef struct _E_Config_Element E_Config_Element; + /* 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 */ diff --git a/src/desktops.h b/src/desktops.h index 23cc42ce9..fa0c26c55 100644 --- a/src/desktops.h +++ b/src/desktops.h @@ -2,6 +2,13 @@ #define E_DESKTOPS_H #include "e.h" +#include "view.h" +#include "border.h" + +#ifndef E_DESKTOPS_TYPEDEF +#define E_DESKTOPS_TYPEDEF +typedef struct _E_Desktop E_Desktop; +#endif struct _E_Desktop { diff --git a/src/e.h b/src/e.h index c2679bc6e..aba435589 100644 --- a/src/e.h +++ b/src/e.h @@ -102,18 +102,6 @@ _e_obj->references = 1; \ _e_obj->e_obj_free = (void *) _e_obj_free_func; \ } -/* action type macros */ -#define ACT_MOUSE_IN 0 -#define ACT_MOUSE_OUT 1 -#define ACT_MOUSE_CLICK 2 -#define ACT_MOUSE_DOUBLE 3 -#define ACT_MOUSE_TRIPLE 4 -#define ACT_MOUSE_UP 5 -#define ACT_MOUSE_CLICKED 6 -#define ACT_MOUSE_MOVE 7 -#define ACT_KEY_DOWN 8 -#define ACT_KEY_UP 9 - /* misc util macros */ #define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \ ((x < (xx + ww)) && \ @@ -124,27 +112,10 @@ _e_obj->e_obj_free = (void *) _e_obj_free_func; \ (!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1))))) #define UN(_blah) _blah = 0 -/* data types */ -typedef struct _E_Action E_Action; -typedef struct _E_Action_Proto E_Action_Proto; -typedef struct _E_Active_Action_Timer E_Active_Action_Timer; -typedef struct _E_Background E_Background; -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_Grab E_Grab; -typedef struct _E_Icon E_Icon; -typedef struct _E_Menu E_Menu; -typedef struct _E_Menu_Item E_Menu_Item; +/* data type prototypes... not actually used */ typedef struct _E_Object E_Object; -typedef struct _E_Rect E_Rect; -typedef struct _E_View E_View; -/* actual fdata struct members */ +/* actual data struct members */ struct _E_Object { OBJ_PROPERTIES; diff --git a/src/entry.c b/src/entry.c index c7b1a8e68..ec06be09e 100644 --- a/src/entry.c +++ b/src/entry.c @@ -1,5 +1,4 @@ #include "entry.h" -#include "background.h" #include "config.h" #include "util.h" @@ -100,6 +99,7 @@ e_entry_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) entry->select.start = -1; e_entry_configure(entry); } + UN(_o); } static void @@ -111,6 +111,10 @@ e_entry_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) entry = _data; if (_b == entry->mouse_down) entry->mouse_down = 0; e_entry_configure(entry); + UN(_e); + UN(_o); + UN(_x); + UN(_y); } static void @@ -188,6 +192,9 @@ e_entry_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) } e_entry_configure(entry); } + UN(_o); + UN(_b); + UN(_y); } static void @@ -278,7 +285,7 @@ e_entry_configure(E_Entry *entry) { double tx, ty, tw, th; - if (entry->cursor_pos < strlen(entry->buffer)) + if (entry->cursor_pos < (int)strlen(entry->buffer)) { evas_text_at(entry->evas, entry->text, entry->cursor_pos, &tx, &ty, &tw, &th); } @@ -327,7 +334,7 @@ e_entry_configure(E_Entry *entry) 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)) + if (entry->select.start + entry->select.length <= (int)strlen(entry->buffer)) evas_text_at(entry->evas, entry->text, entry->select.start + entry->select.length - 1, &x2, NULL, &tw, &th); else { @@ -398,7 +405,7 @@ e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e) else if (!strcmp(e->key, "Right")) { entry->cursor_pos++; - if (entry->cursor_pos > strlen(entry->buffer)) + if (entry->cursor_pos > (int)strlen(entry->buffer)) entry->cursor_pos = strlen(entry->buffer); } else if (!strcmp(e->key, "Escape")) @@ -417,7 +424,7 @@ e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e) /* char *str2; */ if (entry->select.start >= 0) e_entry_clear_selection(entry); - else if (entry->cursor_pos < strlen(entry->buffer)) e_entry_delete_to_right(entry); + else if (entry->cursor_pos < (int)strlen(entry->buffer)) e_entry_delete_to_right(entry); } else if (!strcmp(e->key, "Insert")) { @@ -474,7 +481,7 @@ e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e) else if ((strlen(type) == 1) && (type[0] == 0x06)) /* ctrl+f */ { entry->cursor_pos++; - if (entry->cursor_pos > strlen(entry->buffer)) + if (entry->cursor_pos > (int)strlen(entry->buffer)) entry->cursor_pos = strlen(entry->buffer); } else if ((strlen(type) == 1) && (type[0] == 0x02)) /* ctrl+b */ @@ -657,6 +664,7 @@ e_entry_set_size(E_Entry *entry, int w, int h) entry->min_size = w; e_entry_configure(entry); } + UN(h); } void @@ -683,7 +691,7 @@ e_entry_set_text(E_Entry *entry, const char *text) IF_FREE(entry->buffer); entry->buffer = strdup(text); evas_set_text(entry->evas, entry->text, entry->buffer); - if (entry->cursor_pos > strlen(entry->buffer)) + if (entry->cursor_pos > (int)strlen(entry->buffer)) entry->cursor_pos = strlen(entry->buffer); e_entry_configure(entry); if (entry->func_changed) @@ -762,7 +770,7 @@ e_entry_clear_selection(E_Entry *entry) if (entry->select.start >= 0) { str2 = strdup(e_entry_get_text(entry)); - if (entry->select.start + entry->select.length > strlen(entry->buffer)) + if (entry->select.start + entry->select.length > (int)strlen(entry->buffer)) entry->select.length = strlen(entry->buffer) - entry->select.start; strcpy(&(str2[entry->select.start]), &(entry->buffer[entry->select.start + entry->select.length])); e_entry_set_text(entry, str2); @@ -806,7 +814,7 @@ e_entry_get_selection(E_Entry *entry) int len; len = entry->select.length; - if (entry->select.start + entry->select.length >= strlen(entry->buffer)) + if (entry->select.start + entry->select.length >= (int)strlen(entry->buffer)) len = strlen(entry->buffer) - entry->select.start; str2 = e_memdup(&(entry->buffer[entry->select.start]), len + 1); str2[len] = 0; diff --git a/src/entry.h b/src/entry.h index f4f55a233..c33d12189 100644 --- a/src/entry.h +++ b/src/entry.h @@ -3,6 +3,8 @@ #include "e.h" +typedef struct _E_Entry E_Entry; + struct _E_Entry { Evas evas; diff --git a/src/fs.c b/src/fs.c index 7ce53ccb8..12abc8c71 100644 --- a/src/fs.c +++ b/src/fs.c @@ -100,6 +100,7 @@ _e_fs_restarter(int val, void *data) if (gap > 10.0) gap = 10.0; e_add_event_timer("e_fs_restarter", gap, _e_fs_restarter, val + 1, NULL); } + UN(data); } E_FS_Restarter * diff --git a/src/fs.h b/src/fs.h index 3383e2ef7..de6c0e496 100644 --- a/src/fs.h +++ b/src/fs.h @@ -4,6 +4,8 @@ #include #include "e.h" +typedef struct _E_FS_Restarter E_FS_Restarter; + struct _E_FS_Restarter { void (*func) (void *data); diff --git a/src/icccm.c b/src/icccm.c index c934c0172..3b1037dd9 100644 --- a/src/icccm.c +++ b/src/icccm.c @@ -1,5 +1,6 @@ #include "e.h" #include "border.h" +#include "icccm.h" /* Motif window hints */ #define MWM_HINTS_FUNCTIONS (1L << 0) diff --git a/src/ipc.c b/src/ipc.c index e7abe12b4..3bc39498f 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1,51 +1 @@ #include "ipc.h" -#include "config.h" - -struct _coords { - int xid; - int x; - int y; -}; - -typedef struct _coords coords; - -/* void e_ipc_init(void); */ -static void e_ipc_get_version(int fd); -static void e_ipc_move_window(int fd); - -void -e_ipc_init(void) -{ - char buf[4096]; - - /* unix domain socket file path */ - sprintf(buf, "%secom", e_config_user_dir()); - - /* init ecore ipc */ - e_ev_ipc_init(buf); - - /* add ipc services or functions clients can use */ - e_add_ipc_service(0, e_ipc_get_version); - e_add_ipc_service(1, e_ipc_move_window); -} - -static void -e_ipc_get_version(int fd) -{ - e_ipc_send_data(fd, &VERSION, strlen(VERSION)); -} - -static void -e_ipc_move_window(int fd) -{ - coords test; - int retval = 0; - - /* get window id and coords to move to */ - e_ipc_get_data(fd, &test); - - /* move window here */ - - /* return failure or success */ - e_ipc_send_data(fd, &retval, sizeof(retval)); -} diff --git a/src/main.c b/src/main.c index db77cd061..e4965a9fb 100644 --- a/src/main.c +++ b/src/main.c @@ -121,7 +121,6 @@ main(int argc, char **argv) e_menu_init(); e_view_init(); e_entry_init(); - e_ipc_init(); e_keys_init(); setup(); diff --git a/src/menu.h b/src/menu.h index dd6200326..7199261d8 100644 --- a/src/menu.h +++ b/src/menu.h @@ -3,6 +3,9 @@ #include "e.h" +typedef struct _E_Menu E_Menu; +typedef struct _E_Menu_Item E_Menu_Item; + struct _E_Menu { OBJ_PROPERTIES; diff --git a/src/menubuild.h b/src/menubuild.h index 8802b5d48..47ab48e0d 100644 --- a/src/menubuild.h +++ b/src/menubuild.h @@ -3,6 +3,8 @@ #include "e.h" +typedef struct _E_Build_Menu E_Build_Menu; + struct _E_Build_Menu { OBJ_PROPERTIES; @@ -20,4 +22,4 @@ 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; +#endif diff --git a/src/resist.h b/src/resist.h index fe9f3951b..0a51ca4d6 100644 --- a/src/resist.h +++ b/src/resist.h @@ -4,6 +4,8 @@ #include "e.h" #include "border.h" +typedef struct _E_Rect E_Rect; + struct _E_Rect { int x, y, w, h; diff --git a/src/view.c b/src/view.c index a4868d7ce..8bc7ebf0d 100644 --- a/src/view.c +++ b/src/view.c @@ -247,6 +247,8 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) } e_view_selection_update(v); } + UN(_e); + UN(_o); } static void @@ -336,6 +338,8 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) v->select.x = _x; v->select.y = _y; } + UN(_e); + UN(_o); } static void @@ -370,6 +374,9 @@ e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) } e_view_selection_update(v); } + UN(_e); + UN(_o); + UN(_b); } void @@ -577,6 +584,8 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) else if (_b == 3) { } + UN(_e); + UN(_o); } static void @@ -622,6 +631,10 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) } ic->state.clicked = 0; e_view_icon_update_state(ic); + UN(_e); + UN(_o); + UN(_x); + UN(_y); } static void @@ -865,6 +878,9 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) ic->view->drag.update = 1; ic->view->changed = 1; } + UN(_e); + UN(_o); + UN(_b); } static void @@ -1304,6 +1320,7 @@ e_view_filter_file(E_View *v, char *file) { if (file[0] == '.') return 0; return 1; + UN(v); } void @@ -1505,6 +1522,7 @@ e_view_resort_timeout(int val, void *data) v = data; e_view_resort(v); v->have_resort_queued = 0; + UN(val); } void diff --git a/src/view.h b/src/view.h index b40aebc5b..fa804bab3 100644 --- a/src/view.h +++ b/src/view.h @@ -2,6 +2,11 @@ #define E_VIEW_H #include "e.h" +#include "background.h" +#include "fs.h" + +typedef struct _E_View E_View; +typedef struct _E_Icon E_Icon; struct _E_View {