Enlightenment CVS committal

Author  : fletch3k
Project : misc
Module  : enotes

Dir     : misc/enotes/src


Modified Files:
        config.c controlcentre.c debug.c debug.h ipc.c ipc.h main.c 
        main.h note.c note.h storage.c storage.h 


Log Message:
Slight Tidyup

===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/config.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- config.c    9 Oct 2004 16:04:04 -0000       1.15
+++ config.c    27 Nov 2004 22:48:01 -0000      1.16
@@ -18,16 +18,13 @@
  *          set.
  * @brief: Allocate and initialize a new MainConfig variable.
  */
-MainConfig     *
-mainconfig_new(void)
+MainConfig *mainconfig_new(void)
 {
        MainConfig     *p;
-
        p = malloc(sizeof(MainConfig));
 
        p->render_method = NULL;
        p->theme = NULL;
-
        p->debug = 0;
        p->controlcentre = 1;
        p->autosave = 0;
@@ -35,37 +32,24 @@
        p->ontop = 0;
        p->sticky = 0;
 
-       return (p);
-}
+       return (p);}
 
 /**
  * @param p: The MainConfig variable to free.
  * @brief: Free's an allocated MainConfig variable.
  */
-void
-mainconfig_free(MainConfig * p)
-{
-       if (!p) {
-               if (p->render_method != NULL)
-                       free(p->render_method);
-               if (p->theme != NULL)
-                       free(p->theme);
-
-               free(p);
-       }
-       return;
-}
+void mainconfig_free(MainConfig * p){
+       if (p) {
+               if (p->render_method)free(p->render_method);
+               if (p->theme)free(p->theme);
+               free(p);}}
 
 /* LISTENERS */
 
-theme_listener(const char *key, const Ecore_Config_Type type, const int tag,
-              void *data)
-{
+theme_listener(const char *key, const Ecore_Config_Type type, const int 
tag,void *data){
        main_config->theme = ecore_config_theme_get(key);
        cc_update_theme();
-       notes_update_themes();
-       return;
-}
+       notes_update_themes();}
 
 /**
  * @param p:  The MainConfig variable to store the read settings into.
@@ -73,15 +57,13 @@
  * @brief: Reads the configuration file pointed to by fn, and stores the
  *         settings into p.
  */
-int
-read_configuration(MainConfig * p)
-{
+int read_configuration(MainConfig * p){
+       int retv;
        ecore_config_int_create("controlcentre.x", 0, 0, NULL, "CC x pos");
        ecore_config_int_create("controlcentre.y", 0, 0, NULL, "CC y pos");
        ecore_config_int_create("controlcentre.w", 0, 0, NULL, "CC w pos");
        ecore_config_int_create("controlcentre.h", 0, 0, NULL, "CC h pos");
 
-
        ecore_config_int_create("enotes.debug", 0, 'd', "debug",
                                "Debugging Level [0-2]");
        ecore_config_string_create("enotes.engine", "software", 'r',
@@ -106,9 +88,9 @@
 
        ecore_config_load();
 
-       if (ecore_config_args_parse() != ECORE_CONFIG_PARSE_CONTINUE) {
-               return (-1);
-       }
+       ecore_config_app_describe("Enotes - The Enlightened Sticky Notes 
System");
+
+       retv=ecore_config_args_parse();
 
        p->render_method = ecore_config_string_get("enotes.engine");
        p->theme = ecore_config_theme_get("enotes.theme");
@@ -119,9 +101,6 @@
        p->ontop = ecore_config_boolean_get("enotes.ontop");
        p->sticky = ecore_config_boolean_get("enotes.sticky");
 
-       printf("Welcome: %d\n", p->welcome);
-
        ecore_config_listen("theme", "enotes.theme", theme_listener, 0, NULL);
 
-       return (0);
-}
+       return (retv);}
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/controlcentre.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- controlcentre.c     9 Oct 2004 16:04:04 -0000       1.18
+++ controlcentre.c     27 Nov 2004 22:48:01 -0000      1.19
@@ -290,29 +290,22 @@
 }
 
 /*  Theme Change  */
-void
-cc_update_theme()
-{
-       int             edje_w, edje_h;
+void cc_update_theme(){
+       int             w, h;
        char           *edjefn;
 
-       if (controlcentre == NULL)
-               return;
+       if (!controlcentre)return;
 
        edjefn = malloc(PATH_MAX);
-       snprintf(edjefn,
-                PATH_MAX, NOTE_EDJE, PACKAGE_DATA_DIR, main_config->theme);
+       snprintf(edjefn, PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.eet", 
main_config->theme);
        edje_object_file_set(controlcentre->edje, edjefn, CC_PART);
        free(edjefn);
 
        /* EDJE and ECORE min, max and resizing */
-       edje_object_size_max_get(controlcentre->edje, &edje_w, &edje_h);
-       ecore_evas_size_max_set(controlcentre->win, edje_w, edje_h);
-       edje_object_size_min_get(controlcentre->edje, &edje_w, &edje_h);
-       ecore_evas_size_min_set(controlcentre->win, edje_w, edje_h);
-       ecore_evas_resize(controlcentre->win, (int) edje_w, (int) edje_h);
-       evas_object_resize(controlcentre->edje, edje_w, edje_h);
-       evas_object_resize(controlcentre->dragger, edje_w, edje_h);
-
-       return;
-}
+       edje_object_size_max_get(controlcentre->edje, &w, &h);
+       ecore_evas_size_max_set(controlcentre->win, w, h);
+       edje_object_size_min_get(controlcentre->edje, &w, &h);
+       ecore_evas_size_min_set(controlcentre->win, w, h);
+       ecore_evas_resize(controlcentre->win, w, h);
+       evas_object_resize(controlcentre->edje, w, h);
+       evas_object_resize(controlcentre->dragger, w, h);}
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/debug.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- debug.c     11 Mar 2004 17:28:58 -0000      1.5
+++ debug.c     27 Nov 2004 22:48:01 -0000      1.6
@@ -15,142 +15,6 @@
 
 extern MainConfig *main_config;
 
-DebugFuncLst    func_list[] = {
-       /* Main */
-       {"main", 0},
-
-       /* config */
-       {"mainconfig_new", 1},
-       {"mainconfig_free", 1},
-       {"read_global_configuration", 1},
-       {"read_local_configuration", 1},
-       {"read_configuration", 1},
-       {"check_local_configuration", 1},
-       {"processopt", 1},
-
-       /* controlcentre */
-       {"setup_cc", 1},
-       {"cc_resize", 2},
-       {"cc_close", 2},
-       {"cc_saveload", 2},
-       {"cc_newnote", 2},
-       {"cc_settings", 2},
-
-       /* ipc */
-       {"find_server", 1},
-       {"setup_server", 1},
-       {"send_to_server", 1},
-       {"ipc_svr_data_recv", 2},
-       {"parse_message", 1},
-       {"ipc_close_enotes", 1},
-       {"fix_newlines", 1},
-
-       /* msgbox */
-       {"msgbox", 1},
-       {"msgbox_okbtn_clicked", 1},
-       {"msgbox_resize", 1},
-       {"msgbox_close", 1},
-
-       /* note */
-       {"new_note", 1},
-       {"new_note_with_values", 1},
-       {"append_note", 1},
-       {"remove_note", 1},
-       {"setup_note", 1},
-       {"note_ecore_close", 2},
-       {"note_ecore_resize", 2},
-       {"note_edje_close", 2},
-       {"note_edje_minimise", 2},
-       {"get_date_string", 1},
-       {"note_edje_close_timer", 2},
-       {"timer_val_compare", 2},
-       {"get_note_by_title", 1},
-       {"get_note_by_content", 1},
-       {"get_title_by_note", 1},
-       {"get_content_by_note", 1},
-       {"get_cycle_begin", 1},
-       {"get_cycle_next_note", 1},
-       {"get_cycle_previous_note", 1},
-
-       /* saveload  -  saveload */
-       {"setup_saveload", 1},
-       {"setup_saveload_win", 1},
-       {"saveload_setup_button", 1},
-       {"fill_saveload_tree", 1},
-       {"setup_saveload_opt", 1},
-       {"ecore_saveload_resize", 2},
-       {"ecore_saveload_close", 2},
-       {"ewl_saveload_revert", 2},
-       {"ewl_saveload_close", 2},
-       {"ewl_saveload_load", 2},
-       {"ewl_saveload_save", 2},
-       {"ewl_saveload_listitem_click", 2},
-
-       /* saveload  -  load */
-       {"setup_load", 1},
-       {"setup_load_win", 1},
-       {"load_setup_button", 1},
-       {"fill_load_tree", 1},
-       {"setup_load_opt", 1},
-       {"ecore_load_resize", 2},
-       {"ecore_load_close", 2},
-       {"ewl_load_revert", 2},
-       {"ewl_load_close", 2},
-       {"ewl_load_load", 2},
-       {"ewl_load_delete", 2},
-       {"ewl_load_listitem_click", 2},
-
-       /* settings */
-       {"setup_settings", 1},
-       {"setup_settings_win", 1},
-       {"fill_tree", 1},
-       {"settings_setup_button", 1},
-       {"setup_settings_opt", 1},
-       {"setup_settings_opt_int", 1},
-       {"ecore_settings_resize", 2},
-       {"ecore_settings_close", 2},
-       {"ewl_settings_revert", 2},
-       {"ewl_settings_close", 2},
-       {"ewl_settings_save", 2},
-       {"save_settings", 1},
-
-       /* storage */
-       {"alloc_note_stor", 1},
-       {"free_note_stor", 1},
-       {"append_note_stor", 1},
-       {"append_autosave_note_stor", 1},
-       {"remove_note_stor", 1},
-       {"stor_cycle_begin", 1},
-       {"stor_cycle_begin_autosave", 1},
-       {"stor_cycle_end", 1},
-       {"stor_cycle_next", 1},
-       {"stor_cycle_prev", 1},
-       {"stor_cycle_get_notestor", 1},
-       {"autoload", 1},
-       {"autosave", 1},
-       {"make_storage_fn", 1},
-       {"make_autosave_fn", 1},
-       {"get_notestor_from_value", 1},
-       {"get_value_from_notestor", 1},
-
-       /* usage */
-       {"read_usage_configuration", 1},
-       {"read_usage_for_configuration_fn", 1},
-       {"print_usage", 1},
-
-       /* xml */
-       {"free_xmlentry", 1},
-       {"xml_read", 1},
-       {"xml_read_end", 1},
-       {"xml_read_next_entry", 1},
-       {"xml_read_prev_entry", 1},
-       {"xml_read_entry_get_entry", 1},
-       {"xml_write", 1},
-       {"xml_write_end", 1},
-       {"xml_write_append_entry", 1}
-};
-
-
 /**
  * @param msg: The error/warning message to display.
  * @param level: The level at which the error message should be displayed.
@@ -205,59 +69,3 @@
                printf(DEBUG_MSG, msg);
        return;
 }
-
-/**
- * @param msg: The function being entered.
- * @brief: Reports that a function has been entered.
- *         For heavy debugging purposes, not normally
- *         used.
- */
-void
-debug_func_in(char *function)
-{
-       int             a = 0;
-
-       if (main_config == NULL) {
-               return;
-       }
-       while (&func_list[a] != NULL) {
-               if (!strcmp(func_list[a].name, function)) {
-                       if (main_config->debug == func_list[a].level ||
-                           main_config->debug > func_list[a].level)
-                               printf(DEBUG_FUNC_IN, func_list[a].level,
-                                      function);
-                       return;
-               }
-               a++;
-       }
-
-       printf("E-Notes: DEBUGGING ERROR.  Asked to debug missing function.\n");
-}
-
-/**
- * @param msg: The function that is being exited.
- * @brief: Reports that a function has completed its job
- *         and it exiting.  For heavy debugging only.
- */
-void
-debug_func_out(char *function)
-{
-       int             a = 0;
-
-       if (main_config == NULL) {
-               return;
-       }
-
-       while (&func_list[a] != NULL) {
-               if (!strcmp(func_list[a].name, function)) {
-                       if (main_config->debug == func_list[a].level ||
-                           main_config->debug > func_list[a].level)
-                               printf(DEBUG_FUNC_OUT, func_list[a].level,
-                                      function);
-                       return;
-               }
-               a++;
-       }
-
-       printf("E-Notes: DEBUGGING ERROR.  Asked to debug missing function.\n");
-}
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/debug.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- debug.h     11 Mar 2004 17:28:58 -0000      1.3
+++ debug.h     27 Nov 2004 22:48:01 -0000      1.4
@@ -25,8 +25,6 @@
 #define DEBUG_ERROR_MSG "E-Notes: ERROR - %s.\n"
 #define DEBUG_WARNING_MSG "E-Notes: WARNING - %s.\n"
 #define DEBUG_NOTICE_MSG "E-Notes: NOTICE - %s.\n"
-#define DEBUG_FUNC_IN "E-Notes [%d]: Entered Function %s.\n"
-#define DEBUG_FUNC_OUT "E-Notes [%d]: Exited Function %s.\n"
 
 #define debug_func_in(foo) dfi(foo)
 #define debug_func_out(foo) dfo(foo)
@@ -49,10 +47,4 @@
 void            debug_msg_lvl(char *msg, int level);
 void            debug_msg(char *msg);
 
-/* These are only really used when manually debugging and programming enotes.
- * We don't use this normally because it won't print messages before the 
configuration
- * and usage has been parsed.. it needs the debug level. */
-void            debug_func_in(char *function);
-void            debug_func_out(char *function);
-
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/ipc.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ipc.c       24 Sep 2004 13:59:56 -0000      1.9
+++ ipc.c       27 Nov 2004 22:48:01 -0000      1.10
@@ -23,42 +23,29 @@
  *           1 = Theres already a running server.
  * @brief: Checks whether an enotes ipc server is running.
  */
-int
-find_server(void)
-{
+int find_server(){
        Ecore_Ipc_Server *p;
 
        p = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, IPC_NAME, IPC_PORT,
                                     NULL);
-       if (p == NULL) {
-               return (0);
-       } else {
+       if (!p) return (0);
+       else{
                ecore_ipc_server_del(p);
-               return (1);
-       }
-       return (-1);
-}
+               return(1);}
+       return (-1);}
 
 /**
  * @brief: Sets up the enotes server and gets it listening
  *         for IPC signals.
  */
-void
-setup_server(void)
-{
-       if (find_server() == 0) {
+void setup_server(){
+       if (find_server() == 0)
                if (mysvr == NULL) {
-                       mysvr = ecore_ipc_server_add(ECORE_IPC_LOCAL_USER,
-                                                    IPC_NAME, IPC_PORT, NULL);
-                       if (mysvr != NULL) {
+                       mysvr = 
ecore_ipc_server_add(ECORE_IPC_LOCAL_USER,IPC_NAME,IPC_PORT,NULL);
+                       if(mysvr != NULL){
                                listenev = ecore_event_handler_add
                                        (ECORE_IPC_EVENT_CLIENT_DATA,
-                                        ipc_svr_data_recv, NULL);
-                       }
-               }
-       }
-       return;
-}
+                                        ipc_svr_data_recv, NULL);}}}
 
 /**
  * @param msg: The message to be sent.
@@ -71,15 +58,8 @@
        if ((mysvr =
             ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, IPC_NAME, IPC_PORT,
                                      NULL)) != NULL) {
-
-               ipc_send_message_with_mysvr(msg);       /*  To server  */
-
-               ecore_ipc_server_del(mysvr);
-       } else {
-               return;
-       }
-       return;
-}
+               ipc_send_message_with_mysvr(msg);
+               ecore_ipc_server_del(mysvr);}}
 
 /**
  * @param data: Not used, supplied by the ecore callback, can be
@@ -90,75 +70,62 @@
  *         from "event", unwraps it with the parsing function
  *         so it can be used for whatever purpose is required.
  */
-int
-ipc_svr_data_recv(void *data, int type, void *event)
-{
+int ipc_svr_data_recv(void *data, int type, void *event){
        Ecore_Ipc_Event_Client_Data *e;
-       RecvMsg        *p;
+       if((e=(Ecore_Ipc_Event_Client_Data*)event))
+               handle_ipc_message((void*)e->data);
+       return(1);}
 
+void handle_ipc_message(void *data){
+       RecvMsg        *p=parse_message((char*)data);
        NoteStor       *note;
        Ecore_Timer    *close;
-
        char           *msg;
        char           *content;
 
-       if ((e = (Ecore_Ipc_Event_Client_Data *) event)) {
-               p = parse_message(e->data);     /* e->data is freed by the elibs
-                                                * thus p->data (being part of 
e->data)
-                                                * should be freed too, so 
leave it! */
-               if (p != NULL) {
-                       if (p->cmd == NOTE) {
-                               if (p->data != NULL) {
-                                       note = (NoteStor *)
-                                               get_notestor_from_value((char *)
-                                                                       p->
-                                                                       data);
-                                       content = fix_newlines(note->content);
-                                       new_note_with_values(note->x, note->y,
-                                                            note->width,
-                                                            note->height,
-                                                            content);
-                                       free(content);
-                                       free_note_stor(note);
-                               }
-                       } else if (p->cmd == CLOSE) {
-                               ecore_main_loop_quit();
-                       } else if (p->cmd == CONTROLCENTRECLOSE) {
-                               if (controlcentre != NULL) {
-                                       ecore_evas_free(controlcentre->win);
-                                       free(controlcentre);
-                                       controlcentre = NULL;
-                               } else {
-                                       new_note_with_values(0, 0, 325, 0,
-                                                            "An IPC command 
was recieved which\nwants to close the controlcentre.\n\nSince the control 
centre isn't currently\nopen, it wasn't possible to do so!");
-                               }
-                       } else if (p->cmd == CONTROLCENTREOPEN) {
-                               if (controlcentre == NULL) {
-                                       setup_cc();
-                               } else {
-                                       new_note_with_values(0, 0, 325, 0,
-                                                            "An IPC command 
was recieved which\nwants to open the control centre, but the\ncontrol centre 
is already open!");
-                               }
-                       } else if (p->cmd == DEFNOTE) {
-                               new_note();
+       if (p) {
+               if (p->cmd == NOTE) {
+                       if (p->data) {
+                               note = (NoteStor *)
+                                       get_notestor_from_value((char *)
+                                                               p->
+                                                               data);
+                               content = fix_newlines(note->content);
+                               new_note_with_values(note->x, note->y,
+                                                    note->width,
+                                                    note->height,
+                                                    content);
+                               free(content);
+                               free_note_stor(note);
                        }
-               }
-       }
-       return (1);
-}
+               } else if (p->cmd == CLOSE){ecore_main_loop_quit();
+       }else if (p->cmd == CONTROLCENTRECLOSE){
+                       if (controlcentre != NULL){
+                               ecore_evas_free(controlcentre->win);
+                               free(controlcentre);
+                               controlcentre = NULL;
+                       } else {
+                               new_note_with_values(0, 0, 325, 0,
+                                                    "An IPC command was 
recieved which\nwants to close the controlcentre.\n\nSince the control centre 
isn't currently\nopen, it wasn't possible to do so!");
+                       }
+       }else if (p->cmd == CONTROLCENTREOPEN) {
+                       if (controlcentre == NULL) {
+                               setup_cc();
+                       } else {
+                               new_note_with_values(0, 0, 325, 0,
+                                                    "An IPC command was 
recieved which\nwants to open the control centre, but the\ncontrol centre is 
already open!");
+                       }
+               } else if (p->cmd == DEFNOTE) {
+                       new_note();}}}
 
 /**
  * @param msg: The message to be sent to the connected host.
  * @brief:     Send a char message to the host.
  */
-void
-ipc_send_message_with_mysvr(char *msg)
-{
+void ipc_send_message_with_mysvr(char *msg){
        if (msg != NULL && mysvr != NULL)
                ecore_ipc_server_send(mysvr, 0, 0, 0, 0, 0, msg,
-                                     strlen(msg) + 1);
-       return;
-}
+                                     strlen(msg) + 1);}
 
 
 /**
@@ -169,9 +136,7 @@
  *         the command ("NOTE", "CLOSE" or whatever) and the information
  *         supplied.
  */
-RecvMsg        *
-parse_message(char *msg)
-{
+RecvMsg *parse_message(char *msg){
        RecvMsg        *p = malloc(sizeof(RecvMsg));
        char           *tst;
        char           *ts;
@@ -223,8 +188,7 @@
        }
 
        free(one);
-       return (p);
-}
+       return (p);}
 
 /**
  * @param data: Not used, but can be set during the setting of the callback.
@@ -232,12 +196,9 @@
  *          when the main loop is ended there can be trouble.
  * @brief: Closes enotes.
  */
-int
-ipc_close_enotes(void *data)
-{
+int ipc_close_enotes(void *data){
        ecore_main_loop_quit();
-       return (0);
-}
+       return (0);}
 
 /**
  * @param b: The original string to "fix".
@@ -247,9 +208,7 @@
  *         The compiler never sees the "\n" when supplied via IPC so its never
  *         converted into a newline, so we do it ourselves.
  */
-char           *
-fix_newlines(char *b)
-{
+char *fix_newlines(char *b){
        char           *a = strdup(b);
        char           *p = a;
 
@@ -257,5 +216,4 @@
                memmove(p, p + 1, strlen(p));
                *p = '\n';
        }
-       return a;
-}
+       return a;}
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/ipc.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ipc.h       6 Oct 2004 17:12:34 -0000       1.7
+++ ipc.h       27 Nov 2004 22:48:01 -0000      1.8
@@ -53,6 +53,7 @@
 
 /* Low Level */
 int             ipc_svr_data_recv(void *data, int type, void *event);
+void            handle_ipc_message(void *data);
 int             ipc_response_data_recv(void *data, int type, void *event);
 RecvMsg        *parse_message(char *msg);
 int             ipc_close_enotes(void *data);
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/main.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- main.c      9 Oct 2004 16:04:04 -0000       1.19
+++ main.c      27 Nov 2004 22:48:01 -0000      1.20
@@ -26,13 +26,19 @@
 int
 main(int argc, char *argv[])
 {
-       char           *spec_conf;
+       char           *spec_conf,*remotecmd=NULL;
        int             note_count;
        DIR            *dir;
+       int a;
 
        /* IPC Check */
        ecore_ipc_init();
        dml("IPC Initiated Successfully", 1);
+       /* Check for -R option
+        * FIXME: Ecore-Config should do this stuff really!
+        * FIXME: Also, make ecore_config ignore -R, or deal with it! */
+       
if(argc>1)for(a=0;a<=argc-1;a++)if(!strcmp(argv[a],"-R"))if(argv[a+1]!=NULL)remotecmd=argv[a+1];
+
        /* autoload (if on) will increment this if there are notes
         * if not we may need to create a blank one */
        note_count = 0;
@@ -45,22 +51,27 @@
 
        /* Read the Usage and Configurations */
        main_config = mainconfig_new();
-       if (read_configuration(main_config) == -1) {
+/*     if (read_configuration(main_config) != ECORE_CONFIG_PARSE_CONTINUE) {
                ecore_config_shutdown();
                ecore_ipc_shutdown();
                ecore_shutdown();
                mainconfig_free(main_config);
                return (-1);
-       }
+       }*/
+       read_configuration(main_config);
 
        dml("Successfully Read Configurations and Usage", 1);
 
        process_note_storage_locations();
 
-       if (find_server() == 0) {
+       if (find_server() != 0) {
+               if(remotecmd!=NULL)
+                       send_to_server(remotecmd);
+               else send_to_server("DEFNOTE");
+       } else {
                dml("Server wasn't found.. Creating one", 1);
                /* Setup Server */
-//              setup_server();
+               setup_server();
 
                /* Initialise the E-Libs */
                ecore_init();
@@ -76,9 +87,9 @@
                dml("Efl Successfully Initiated", 1);
 
                /* Autoloading */
-               if (main_config->autosave == 1) {
-                       note_count = autoload();
-               }
+               if (main_config->autosave == 1)autoload();
+
+               if(remotecmd!=NULL)handle_ipc_message(remotecmd);
 
                /* Begin the Control Centre */
                if (main_config->controlcentre == 1) {
@@ -86,7 +97,7 @@
                        dml("Control Centre Setup", 1);
                } else {
                        dml("No Control Centre - Displaying Notice", 1);
-                       if (note_count == 0)
+                       if (get_note_count() == 0)
                                new_note();
                }
 
@@ -113,9 +124,6 @@
                ecore_x_shutdown();
                ecore_shutdown();
                dml("Efl Shutdown", 1);
-       } else {
-               /* Open a note */
-               send_to_server("DEFNOTE");
        }
 
        /* End IPC */
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/main.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- main.h      6 Oct 2004 17:12:34 -0000       1.9
+++ main.h      27 Nov 2004 22:48:01 -0000      1.10
@@ -29,6 +29,7 @@
 #include "storage.h"
 #include "debug.h"
 #include "welcome.h"
+#include "ipc.h"
 
 
 #define MAX_TEMPLATE_SIZE 999
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/note.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- note.c      9 Oct 2004 16:04:04 -0000       1.40
+++ note.c      27 Nov 2004 22:48:01 -0000      1.41
@@ -133,7 +133,6 @@
        Evas_List      *pl;
        Note           *p;
 
-       char           *fontpath = malloc(PATH_MAX);
        char           *edjefn = malloc(PATH_MAX);
        char           *datestr;
        char           *fcontent;
@@ -201,8 +200,7 @@
        evas_output_method_set(p->evas,
                               evas_render_method_lookup(main_config->
                                                         render_method));
-       snprintf(fontpath, PATH_MAX, "%s/fonts", PACKAGE_DATA_DIR);
-       evas_font_path_append(p->evas, fontpath);
+       evas_font_path_append(p->evas, PACKAGE_DATA_DIR "/fonts");
 
        /* Draggable Setup */
        p->dragger = (Evas_Object *) esmart_draggies_new(p->win);
@@ -228,7 +226,7 @@
        /* Setup the Edje */
        p->edje = edje_object_add(p->evas);
        snprintf(edjefn,
-                PATH_MAX, NOTE_EDJE, PACKAGE_DATA_DIR, main_config->theme);
+                PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.eet", 
main_config->theme);
        edje_object_file_set(p->edje, edjefn, NOTE_PART);
        evas_object_name_set(p->edje, "edje");
        evas_object_move(p->edje, 0, 0);
@@ -321,8 +319,6 @@
                free(datestr);
        if (edjefn != NULL)
                free(edjefn);
-       if (fontpath != NULL)
-               free(fontpath);
        if (fcontent != NULL)
                free(fcontent);
 
@@ -625,7 +621,7 @@
        char           *edjefn = malloc(PATH_MAX);
 
        snprintf(edjefn,
-                PATH_MAX, NOTE_EDJE, PACKAGE_DATA_DIR, main_config->theme);
+                PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.eet", 
main_config->theme);
 
        working = get_cycle_begin();
        if (working != NULL) {
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/note.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- note.h      9 Oct 2004 16:04:05 -0000       1.19
+++ note.h      27 Nov 2004 22:48:01 -0000      1.20
@@ -29,7 +29,6 @@
 #include "../config.h"
 
 
-#define NOTE_EDJE "%s/themes/%s.eet"
 #define NOTE_PART "Main"
 
 #define EDJE_SIGNAL_NOTE_CLOSE "ENOTES_QUIT"
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/storage.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- storage.c   9 Oct 2004 16:04:05 -0000       1.11
+++ storage.c   27 Nov 2004 22:48:01 -0000      1.12
@@ -190,7 +190,7 @@
 /**
  * @brief: Automatically loads all of the "autosave" notes.
  */
-int
+void
 autoload(void)
 {                              /* FIXME: Rewrite using dirents  */
        DIR            *dir;
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/storage.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- storage.h   9 Oct 2004 16:04:05 -0000       1.6
+++ storage.h   27 Nov 2004 22:48:01 -0000      1.7
@@ -54,7 +54,7 @@
 
 /* Autosave Functions */
 void            note_load(char *target);
-int             autoload(void);
+void            autoload(void);
 void            autosave(void);
 
 /* Internal Functions */




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to