Enlightenment CVS committal Author : handyande Project : misc Module : enotes
Dir : misc/enotes/src Modified Files: config.c config.h controlcentre.c ipc.c main.c main.h note.c note.h saveload.c saveload.h storage.c welcome.c Log Message: Indent and update credits =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/config.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- config.c 6 Mar 2006 20:53:18 -0000 1.19 +++ config.c 16 Mar 2006 00:13:17 -0000 1.20 @@ -18,9 +18,11 @@ * 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; @@ -39,31 +41,41 @@ * @param p: The MainConfig variable to free. * @brief: Free's an allocated MainConfig variable. */ -void mainconfig_free(MainConfig * p){ +void +mainconfig_free(MainConfig * p) +{ if (p) { - if (p->render_method)free(p->render_method); - if (p->theme)free(p->theme); + if (p->render_method) + free(p->render_method); + if (p->theme) + free(p->theme); free(p); - } + } } /* LISTENERS */ -void theme_listener(const char *key, const Ecore_Config_Type type, - const int tag,void *data){ +void +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(); } -void autosave_listener(const char *key, const Ecore_Config_Type type, - const int tag,void *data){ - main_config->autosave = ecore_config_boolean_get(key); - update_autosave(); +void +autosave_listener(const char *key, const Ecore_Config_Type type, + const int tag, void *data) +{ + main_config->autosave = ecore_config_boolean_get(key); + update_autosave(); } -void remotearg(char *val,void *data){ - remotecmd=val; +void +remotearg(char *val, void *data) +{ + remotecmd = val; } /** @@ -72,8 +84,11 @@ * @brief: Reads the configuration file pointed to by fn, and stores the * settings into p. */ -int read_configuration(MainConfig * p){ - int retv; +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"); @@ -101,11 +116,13 @@ ecore_config_theme_preview_group_set("enotes.theme", "Main"); ecore_config_theme_search_path_append(PACKAGE_DATA_DIR "/themes/"); - ecore_config_args_callback_str_add('R',"remote","Send a remote command or message.",&remotearg,NULL); + ecore_config_args_callback_str_add('R', "remote", + "Send a remote command or message.", + &remotearg, NULL); ecore_config_load(); - retv=ecore_config_args_parse(); + retv = ecore_config_args_parse(); p->render_method = ecore_config_string_get("enotes.engine"); p->theme = ecore_config_theme_get("enotes.theme"); @@ -116,9 +133,10 @@ p->ontop = ecore_config_boolean_get("enotes.ontop"); p->sticky = ecore_config_boolean_get("enotes.sticky"); - ecore_config_listen("theme", "enotes.theme", (void*)&theme_listener, 0, NULL); - ecore_config_listen("autosave", "enotes.autosave", (void*)&autosave_listener, - 0, NULL); + ecore_config_listen("theme", "enotes.theme", (void *) &theme_listener, + 0, NULL); + ecore_config_listen("autosave", "enotes.autosave", + (void *) &autosave_listener, 0, NULL); return (retv); } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/config.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- config.h 25 Oct 2005 01:07:53 -0000 1.12 +++ config.h 16 Mar 2006 00:13:17 -0000 1.13 @@ -37,13 +37,14 @@ } MainConfig; extern MainConfig *main_config; -extern char *remotecmd; +extern char *remotecmd; MainConfig *mainconfig_new(void); void mainconfig_free(MainConfig * p); int read_configuration(MainConfig * p); -void remotearg(char *val,void *data); -void theme_listener(const char *key, const Ecore_Config_Type type, const int tag,void *data); +void remotearg(char *val, void *data); +void theme_listener(const char *key, const Ecore_Config_Type type, + const int tag, void *data); #endif =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/controlcentre.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- controlcentre.c 25 Oct 2005 01:07:53 -0000 1.23 +++ controlcentre.c 16 Mar 2006 00:13:17 -0000 1.24 @@ -68,11 +68,11 @@ ecore_evas_title_set(cc->win, "Enotes"); ecore_evas_name_class_set(cc->win, "Enotes", "Enotes"); - if (main_config->ontop == 1) + if (main_config->ontop == 1) ecore_evas_layer_set(cc->win, 7); else ecore_evas_layer_set(cc->win, 2); - + if (main_config->sticky == 1) ecore_evas_sticky_set(cc->win, 1); else @@ -279,14 +279,18 @@ } /* Theme Change */ -void cc_update_theme(){ +void +cc_update_theme() +{ int w, h; char *edjefn; - if (!controlcentre)return; + if (!controlcentre) + return; edjefn = malloc(PATH_MAX); - snprintf(edjefn, PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.edj", main_config->theme); + snprintf(edjefn, PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.edj", + main_config->theme); edje_object_file_set(controlcentre->edje, edjefn, CC_PART); free(edjefn); @@ -297,4 +301,5 @@ 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);} + evas_object_resize(controlcentre->dragger, w, h); +} =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/ipc.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ipc.c 25 Oct 2005 01:07:53 -0000 1.13 +++ ipc.c 16 Mar 2006 00:13:17 -0000 1.14 @@ -23,29 +23,40 @@ * 1 = Theres already a running server. * @brief: Checks whether an enotes ipc server is running. */ -int find_server(){ +int +find_server() +{ Ecore_Ipc_Server *p; p = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, IPC_NAME, IPC_PORT, NULL); - if (!p) 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 +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, mysvr);}}} + ipc_svr_data_recv, mysvr); + } + } +} /** * @param msg: The message to be sent. @@ -59,7 +70,9 @@ ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, IPC_NAME, IPC_PORT, NULL)) != NULL) { ipc_send_message_with_mysvr(msg); - ecore_ipc_server_del(mysvr);}} + ecore_ipc_server_del(mysvr); + } +} /** * @param data: Not used, supplied by the ecore callback, can be @@ -70,42 +83,47 @@ * 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; - Ecore_Ipc_Server *server; + Ecore_Ipc_Server *server; - e = (Ecore_Ipc_Event_Client_Data *) event; - server = (Ecore_Ipc_Server *) data; - if (server != ecore_ipc_client_server_get(e->client)) - return(1); - if(e) - handle_ipc_message((void*)e->data); - return(1);} + e = (Ecore_Ipc_Event_Client_Data *) event; + server = (Ecore_Ipc_Server *) data; + if (server != ecore_ipc_client_server_get(e->client)) + return (1); + if (e) + handle_ipc_message((void *) e->data); + return (1); +} -void handle_ipc_message(void *data){ +void +handle_ipc_message(void *data) +{ RecvMsg *p; NoteStor *note; char *content; - p = parse_message((char *)data); + + p = parse_message((char *) data); if (p) { if (p->cmd == NOTE) { if (p->data) { note = (NoteStor *) get_notestor_from_value((char *) - p-> - data); + p->data); content = fix_newlines(note->content); new_note_with_values(note->x, note->y, note->width, - note->height, - content); + 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){ + } 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; @@ -113,7 +131,7 @@ 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) { + } else if (p->cmd == CONTROLCENTREOPEN) { if (controlcentre == NULL) { setup_cc(); } else { @@ -121,16 +139,22 @@ "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();}}} + 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);} + strlen(msg) + 1); +} /** @@ -141,7 +165,9 @@ * 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; @@ -193,7 +219,8 @@ } free(one); - return (p);} + return (p); +} /** * @param data: Not used, but can be set during the setting of the callback. @@ -201,9 +228,12 @@ * 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". @@ -213,7 +243,9 @@ * 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; @@ -221,4 +253,5 @@ memmove(p, p + 1, strlen(p)); *p = '\n'; } - return a;} + return a; +} =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/main.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- main.c 16 Mar 2006 00:05:55 -0000 1.27 +++ main.c 16 Mar 2006 00:13:17 -0000 1.28 @@ -14,24 +14,27 @@ #include "main.h" MainConfig *main_config; -char *remotecmd; -Ecore_Timer *autosave_timer = NULL; +char *remotecmd; +Ecore_Timer *autosave_timer = NULL; static int -_autosave_timer_tick(void *data) { - autosave(); +_autosave_timer_tick(void *data) +{ + autosave(); - return 1; + return 1; } void -update_autosave(void) { - if (main_config->autosave == 1 && autosave_timer == NULL) - autosave_timer = ecore_timer_add(30, _autosave_timer_tick, NULL); - if (main_config->autosave == 0 && autosave_timer != NULL) { - ecore_timer_del(autosave_timer); - autosave_timer = NULL; - } +update_autosave(void) +{ + if (main_config->autosave == 1 && autosave_timer == NULL) + autosave_timer = + ecore_timer_add(30, _autosave_timer_tick, NULL); + if (main_config->autosave == 0 && autosave_timer != NULL) { + ecore_timer_del(autosave_timer); + autosave_timer = NULL; + } } /* The Main Function */ @@ -43,15 +46,16 @@ * @brief: The first function once enotes is called. */ int -main(int argc, char *argv[]) { +main(int argc, char *argv[]) +{ int note_count; /* IPC Check */ ecore_ipc_init(); dml("IPC Initiated Successfully", 1); - + /* loading will increment this if there are notes if not we may need to - * create a blank one */ + * create a blank one */ note_count = 0; if ((ecore_config_init("enotes")) == ECORE_CONFIG_ERR_FAIL) { @@ -79,9 +83,10 @@ process_note_storage_locations(); if (find_server() != 0) { - if(remotecmd!=NULL) + if (remotecmd != NULL) send_to_server(remotecmd); - else send_to_server("DEFNOTE"); + else + send_to_server("DEFNOTE"); } else { dml("Server wasn't found.. Creating one", 1); /* Setup Server */ @@ -100,11 +105,12 @@ dml("Efl Successfully Initiated", 1); - autoload(); - /* create autosave timer */ - update_autosave(); + autoload(); + /* create autosave timer */ + update_autosave(); - if(remotecmd!=NULL)handle_ipc_message(remotecmd); + if (remotecmd != NULL) + handle_ipc_message(remotecmd); /* Begin the Control Centre */ if (main_config->controlcentre == 1) { @@ -129,9 +135,9 @@ /* Save Controlcentre Settings */ set_cc_pos(); - autosave(); - if (autosave_timer) - ecore_timer_del(autosave_timer); + autosave(); + if (autosave_timer) + ecore_timer_del(autosave_timer); /* Shutdown the E-Libs */ edje_shutdown(); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/main.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- main.h 6 Mar 2006 20:53:18 -0000 1.12 +++ main.h 16 Mar 2006 00:13:17 -0000 1.13 @@ -35,9 +35,10 @@ #define MAX_TEMPLATE_SIZE 999 #define TEMPLATE_LOC "%s/.e/notes/defnote" -extern char *remotecmd; +extern char *remotecmd; void update_autosave(void); + /* The Main Function */ int main(int argc, char *argv[]); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/note.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -3 -r1.59 -r1.60 --- note.c 16 Mar 2006 00:05:56 -0000 1.59 +++ note.c 16 Mar 2006 00:13:17 -0000 1.60 @@ -13,9 +13,12 @@ #include "note.h" -static void note_close_dialog_close_cb(Ewl_Widget *w, void *ev, void *data); -static void note_close_dialog_delete_cb(Ewl_Widget *w, void *ev, void *data); -static void note_close_dialog_unload_cb(Ewl_Widget *w, void *ev, void *data); +static void note_close_dialog_close_cb(Ewl_Widget * w, void *ev, + void *data); +static void note_close_dialog_delete_cb(Ewl_Widget * w, void *ev, + void *data); +static void note_close_dialog_unload_cb(Ewl_Widget * w, void *ev, + void *data); extern MainConfig *main_config; @@ -38,12 +41,14 @@ return; } -void new_note_with_values(int x,int y,int width,int height,char *content){ +void +new_note_with_values(int x, int y, int width, int height, char *content) +{ /*Note *p = */ - new_note_with_values_return(x,y,width,height,content); + new_note_with_values_return(x, y, width, height, content); } -Note* +Note * new_note_with_values_return(int x, int y, int width, int height, char *content) { Evas_List *new; @@ -52,7 +57,7 @@ new = append_note(); setup_note(&new, x, y, width, height, content); - return(evas_list_data(new)); + return (evas_list_data(new)); } /* Lists and Allocation */ @@ -80,89 +85,96 @@ void remove_note(Evas_List * note) { - Ewl_Widget *w; + Ewl_Widget *w; Note *p; - + dml("Closing a Note", 2); - p = evas_list_data(note); - if (p->timcomp) - { - ecore_timer_del(p->timcomp); - p->timcomp = NULL; - } - - if (p->dialog) - return; - - p->dialog = ewl_dialog_new(); - ewl_window_title_set(EWL_WINDOW(p->dialog), "Enotes Delete"); - ewl_window_name_set(EWL_WINDOW(p->dialog), "Enotes"); - ewl_window_class_set(EWL_WINDOW(p->dialog), "Enotes"); - ewl_callback_append(p->dialog, EWL_CALLBACK_DELETE_WINDOW, note_close_dialog_close_cb, p); - - ewl_dialog_active_area_set(EWL_DIALOG(p->dialog), EWL_POSITION_TOP); - w = ewl_text_new(); - ewl_text_text_set(EWL_TEXT(w), "Do you want to perminantly delete this note or just unload it?"); - ewl_container_child_append(EWL_CONTAINER(p->dialog), w); - ewl_widget_show(w); - - ewl_dialog_active_area_set(EWL_DIALOG(p->dialog), EWL_POSITION_BOTTOM); - w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "Delete"); - ewl_container_child_append(EWL_CONTAINER(p->dialog), w); - ewl_callback_append(w, EWL_CALLBACK_CLICKED, note_close_dialog_delete_cb, p); - ewl_widget_show(w); - - w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "Unload"); - ewl_container_child_append(EWL_CONTAINER(p->dialog), w); - ewl_callback_append(w, EWL_CALLBACK_CLICKED, note_close_dialog_unload_cb, p); - ewl_widget_show(w); - - w = ewl_button_new(); - ewl_button_label_set(EWL_BUTTON(w), "Cancel"); - ewl_container_child_append(EWL_CONTAINER(p->dialog), w); - ewl_callback_append(w, EWL_CALLBACK_CLICKED, note_close_dialog_close_cb, p); - ewl_widget_show(w); + p = evas_list_data(note); + if (p->timcomp) { + ecore_timer_del(p->timcomp); + p->timcomp = NULL; + } + + if (p->dialog) + return; - ewl_dialog_active_area_set(EWL_DIALOG(p->dialog), EWL_POSITION_TOP); - ewl_widget_show(p->dialog); + p->dialog = ewl_dialog_new(); + ewl_window_title_set(EWL_WINDOW(p->dialog), "Enotes Delete"); + ewl_window_name_set(EWL_WINDOW(p->dialog), "Enotes"); + ewl_window_class_set(EWL_WINDOW(p->dialog), "Enotes"); + ewl_callback_append(p->dialog, EWL_CALLBACK_DELETE_WINDOW, + note_close_dialog_close_cb, p); + + ewl_dialog_active_area_set(EWL_DIALOG(p->dialog), EWL_POSITION_TOP); + w = ewl_text_new(); + ewl_text_text_set(EWL_TEXT(w), + "Do you want to perminantly delete this note or just unload it?"); + ewl_container_child_append(EWL_CONTAINER(p->dialog), w); + ewl_widget_show(w); + + ewl_dialog_active_area_set(EWL_DIALOG(p->dialog), EWL_POSITION_BOTTOM); + w = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(w), "Delete"); + ewl_container_child_append(EWL_CONTAINER(p->dialog), w); + ewl_callback_append(w, EWL_CALLBACK_CLICKED, + note_close_dialog_delete_cb, p); + ewl_widget_show(w); + + w = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(w), "Unload"); + ewl_container_child_append(EWL_CONTAINER(p->dialog), w); + ewl_callback_append(w, EWL_CALLBACK_CLICKED, + note_close_dialog_unload_cb, p); + ewl_widget_show(w); + + w = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(w), "Cancel"); + ewl_container_child_append(EWL_CONTAINER(p->dialog), w); + ewl_callback_append(w, EWL_CALLBACK_CLICKED, note_close_dialog_close_cb, + p); + ewl_widget_show(w); + + ewl_dialog_active_area_set(EWL_DIALOG(p->dialog), EWL_POSITION_TOP); + ewl_widget_show(p->dialog); } static void -note_close_dialog_close_cb(Ewl_Widget *w, void *ev, void *data) { - Note *p; +note_close_dialog_close_cb(Ewl_Widget * w, void *ev, void *data) +{ + Note *p; - p = (Note *) data; - ewl_widget_destroy(p->dialog); - p->dialog = NULL; + p = (Note *) data; + ewl_widget_destroy(p->dialog); + p->dialog = NULL; } static void -note_close_dialog_delete_cb(Ewl_Widget *w, void *ev, void *data) { - Note *p; - char *path = malloc(PATH_MAX); - - note_close_dialog_unload_cb(w, ev, data); - - dml("Deleting Saved Note", 2); - sprintf(path, "%s/.e/apps/enotes/notes/%s", getenv("HOME"), - get_title_by_content(ewl_text_text_get(EWL_TEXT(p->content)))); - unlink(path); - - /* FIXME more intelligent things once we have sorted - * saveload */ - ewl_saveload_revert(NULL, NULL, NULL); +note_close_dialog_delete_cb(Ewl_Widget * w, void *ev, void *data) +{ + Note *p; + char *path = malloc(PATH_MAX); + + note_close_dialog_unload_cb(w, ev, data); + + dml("Deleting Saved Note", 2); + sprintf(path, "%s/.e/apps/enotes/notes/%s", getenv("HOME"), + get_title_by_content(ewl_text_text_get(EWL_TEXT(p->content)))); + unlink(path); + + /* FIXME more intelligent things once we have sorted + * saveload */ + ewl_saveload_revert(NULL, NULL, NULL); } static void -note_close_dialog_unload_cb(Ewl_Widget *w, void *ev, void *data) { - Note *p; +note_close_dialog_unload_cb(Ewl_Widget * w, void *ev, void *data) +{ + Note *p; - note_close_dialog_close_cb(w, ev, data); + note_close_dialog_close_cb(w, ev, data); - p = (Note *) data; + p = (Note *) data; edje_object_part_unswallow(p->edje, p->eo); ewl_widget_destroy(p->emb); evas_object_del(p->edje); @@ -171,8 +183,8 @@ free(p); gbl_notes = evas_list_remove(gbl_notes, p); - /* FIXME more intelligent things once we have sorted saveload */ - ewl_saveload_revert(NULL, NULL, NULL); + /* FIXME more intelligent things once we have sorted saveload */ + ewl_saveload_revert(NULL, NULL, NULL); /* Check if it was the last note */ if (evas_list_next(gbl_notes) == NULL && controlcentre == NULL) @@ -281,7 +293,8 @@ /* Setup the Edje */ p->edje = edje_object_add(p->evas); snprintf(edjefn, - PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.edj", main_config->theme); + PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.edj", + 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); @@ -369,7 +382,8 @@ edje_object_signal_callback_add(p->edje, EDJE_SIGNAL_NOTE_MINIMISE, "", (void *) note_edje_minimise, *note); - edje_object_signal_callback_add(p->edje,EDJE_SIGNAL_NOTE_SAVE,"",(void*)note_edje_save,*note); + edje_object_signal_callback_add(p->edje, EDJE_SIGNAL_NOTE_SAVE, "", + (void *) note_edje_save, *note); /* Free Temporarily used Variables */ if (datestr != NULL) @@ -383,10 +397,11 @@ p->timcomp = ecore_timer_add(COMPARE_INTERVAL, &timer_val_compare, p); if (saveload != NULL) { - char *title; + char *title; + title = get_title_by_note(*note); - /* FIXME more intelligent things once we have sorted saveload */ + /* FIXME more intelligent things once we have sorted saveload */ ewl_saveload_revert(NULL, NULL, NULL); dml("Added new note to saveload list", 2); @@ -394,7 +409,7 @@ free(title); } - p->dialog = NULL; + p->dialog = NULL; return; } @@ -409,7 +424,7 @@ ewl_theme_data_str_set(pane, "/hscrollbar/decrement/file", NULL); ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/file", NULL); ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/hbutton/file", NULL); - ewl_theme_data_str_set(pane, "/scrollpane/file", NULL); + ewl_theme_data_str_set(pane, "/scrollpane/file", NULL); ewl_theme_data_str_set(pane, "/vscrollbar/increment/group", NULL); ewl_theme_data_str_set(pane, "/vscrollbar/decrement/group", NULL); @@ -424,7 +439,7 @@ ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/group", NULL); ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/hbutton/group", NULL); - ewl_theme_data_str_set(pane, "/scrollpane/group", NULL); + ewl_theme_data_str_set(pane, "/scrollpane/group", NULL); return; } @@ -432,16 +447,17 @@ void configure_scrollbars(Ewl_Widget * pane, char *edjefn) { - ewl_theme_data_str_set(pane, - "/vscrollbar/increment/file", edjefn); + ewl_theme_data_str_set(pane, "/vscrollbar/increment/file", edjefn); ewl_theme_data_str_set(pane, "/vscrollbar/decrement/file", edjefn); ewl_theme_data_str_set(pane, "/vscrollbar/vseeker/file", edjefn); - ewl_theme_data_str_set(pane, "/vscrollbar/vseeker/vbutton/file", edjefn); + ewl_theme_data_str_set(pane, "/vscrollbar/vseeker/vbutton/file", + edjefn); ewl_theme_data_str_set(pane, "/hscrollbar/increment/file", edjefn); ewl_theme_data_str_set(pane, "/hscrollbar/decrement/file", edjefn); ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/file", edjefn); - ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/hbutton/file", edjefn); - ewl_theme_data_str_set(pane, "/scrollpane/file", edjefn); + ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/hbutton/file", + edjefn); + ewl_theme_data_str_set(pane, "/scrollpane/file", edjefn); ewl_theme_data_str_set(pane, "/vscrollbar/increment/group", EDJE_VSCROLLBAR_BTN_INCR); @@ -459,7 +475,7 @@ EDJE_HSCROLLBAR_SEEKER); ewl_theme_data_str_set(pane, "/hscrollbar/hseeker/hbutton/group", EDJE_SCROLLBAR_BUTTON); - ewl_theme_data_str_set(pane, "/scrollpane/group", EDJE_SCROLLPANE); + ewl_theme_data_str_set(pane, "/scrollpane/group", EDJE_SCROLLPANE); return; } @@ -577,16 +593,18 @@ void note_edje_save(Evas_List * note, Evas_Object * o, -const char *emission, const char *source){ - Note *p; - char *title; + const char *emission, const char *source) +{ + Note *p; + char *title; - dml("Saving a Note",2); - p=evas_list_data(note); + dml("Saving a Note", 2); + p = evas_list_data(note); - title = get_title_by_content(ewl_text_text_get((Ewl_Text*)p->content)); + title = get_title_by_content(ewl_text_text_get + ((Ewl_Text *) p->content)); ewl_saveload_save_by_name(title); - + if (title) free(title); return; @@ -639,7 +657,7 @@ { Note *p; char *tmp; - + p = (Note *) data; if (!p->timcomp) return (0); @@ -694,7 +712,8 @@ char *edjefn = malloc(PATH_MAX); snprintf(edjefn, - PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.edj", main_config->theme); + PATH_MAX, PACKAGE_DATA_DIR "/themes/%s.edj", + main_config->theme); working = get_cycle_begin(); if (working != NULL) { @@ -741,7 +760,7 @@ get_note_by_title(char *title) { Evas_List *a; - char *note_title; + char *note_title; a = get_cycle_begin(); note_title = get_title_by_note(a); @@ -784,7 +803,7 @@ char * get_title_by_note_struct(Note * note) { - char *content, *title; + char *content, *title; content = get_content_by_note_struct(note); title = get_title_by_content(content); @@ -834,15 +853,15 @@ return NULL; newlength = i = 0; - start = content; + start = content; while (newlength < TITLE_LENGTH && content[i] != '\0') { if (content[i++] == '\n') { - if (newlength == 0) { - start++; - continue; - } else { - break; - } + if (newlength == 0) { + start++; + continue; + } else { + break; + } } newlength++; } @@ -906,7 +925,7 @@ void update_enote_title(Evas_Object * edje, char *content) { - char *title; + char *title; title = get_title_by_content(content); edje_object_part_text_set(edje, EDJE_TEXT_TITLE, title); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/note.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- note.h 16 Mar 2006 00:05:56 -0000 1.26 +++ note.h 16 Mar 2006 00:13:17 -0000 1.27 @@ -79,7 +79,7 @@ Ewl_Widget *content; Ewl_Widget *pane; - Ewl_Widget *dialog; + Ewl_Widget *dialog; Menu *menu; /* Comparison Strings and Timer */ @@ -87,7 +87,7 @@ char *txt_title; /* Animation Vars */ - int stage; + int stage; } _note; typedef struct { @@ -101,7 +101,8 @@ void new_note(void); void new_note_with_values(int x, int y, int width, int height, char *content); -Note *new_note_with_values_return(int x, int y, int width, int height,char *content); +Note *new_note_with_values_return(int x, int y, int width, int height, + char *content); /* Lists and Allocation */ Evas_List *append_note(void); @@ -127,7 +128,8 @@ const char *emission, const char *source); void note_edje_minimise(Evas_List * note, Evas_Object * o, const char *emission, const char *source); -void note_edje_save(Evas_List*note,Evas_Object*o,const char*emission,const char*source); +void note_edje_save(Evas_List * note, Evas_Object * o, + const char *emission, const char *source); /* Misc */ char *get_date_string(void); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/saveload.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- saveload.c 16 Mar 2006 00:05:56 -0000 1.25 +++ saveload.c 16 Mar 2006 00:13:17 -0000 1.26 @@ -32,7 +32,7 @@ setup_saveload_win(); fill_saveload_tree(); } else { - ewl_window_raise((Ewl_Window*)saveload->win); + ewl_window_raise((Ewl_Window *) saveload->win); } return; } @@ -98,20 +98,17 @@ /* EWL Callbacks */ ewl_callback_append(saveload->refreshbtn, EWL_CALLBACK_CLICKED, - ewl_saveload_revert, - saveload->tree); + ewl_saveload_revert, saveload->tree); ewl_callback_append(saveload->closebtn, EWL_CALLBACK_CLICKED, - ewl_saveload_close, - saveload->win); + ewl_saveload_close, saveload->win); ewl_callback_append(saveload->win, EWL_CALLBACK_DELETE_WINDOW, - ewl_saveload_close, - saveload->win); + ewl_saveload_close, saveload->win); ewl_callback_append(saveload->savebtn, EWL_CALLBACK_CLICKED, - ewl_saveload_save, NULL); + ewl_saveload_save, NULL); ewl_callback_append(saveload->loadbtn, EWL_CALLBACK_CLICKED, - ewl_load_load, NULL); + ewl_load_load, NULL); ewl_callback_append(saveload->deletebtn, EWL_CALLBACK_CLICKED, - ewl_load_delete, NULL); + ewl_load_delete, NULL); return; } @@ -155,7 +152,7 @@ } } - fill_load_tree(); + fill_load_tree(); return; } @@ -177,7 +174,7 @@ capt = (Ewl_Widget *) ewl_text_new(); ewl_text_text_set(EWL_TEXT(capt), caption); ewl_callback_append(capt, EWL_CALLBACK_CLICKED, - ewl_saveload_listitem_click, NULL); + ewl_saveload_listitem_click, NULL); ewl_object_fill_policy_set((Ewl_Object *) capt, EWL_FLAG_FILL_ALL); ewl_widget_show(capt); row = (Ewl_Row *) ewl_tree_row_add((Ewl_Tree *) tree, 0, &capt); @@ -196,22 +193,22 @@ * rebuild it from scratch. :) */ void -ewl_saveload_revert(Ewl_Widget * widget, void *ev_data, void * ud) +ewl_saveload_revert(Ewl_Widget * widget, void *ev_data, void *ud) { dml("Refreshing the Saveload List", 2); - if (!saveload) - return; + if (!saveload) + return; ewl_container_reset((Ewl_Container *) saveload->tree); - ewl_widget_enable(saveload->savebtn); - ewl_widget_state_set(saveload->savebtn, "enabled"); - ewl_widget_enable(saveload->loadbtn); - ewl_widget_state_set(saveload->loadbtn, "enabled"); - - saveload_selected = NULL; - ewl_text_text_set((Ewl_Text *) saveload->txt_selected, "Selected: N/A"); - ewl_tree_selected_clear((Ewl_Tree *) saveload->tree); + ewl_widget_enable(saveload->savebtn); + ewl_widget_state_set(saveload->savebtn, "enabled"); + ewl_widget_enable(saveload->loadbtn); + ewl_widget_state_set(saveload->loadbtn, "enabled"); + + saveload_selected = NULL; + ewl_text_text_set((Ewl_Text *) saveload->txt_selected, "Selected: N/A"); + ewl_tree_selected_clear((Ewl_Tree *) saveload->tree); fill_saveload_tree(); return; @@ -246,10 +243,10 @@ { char *tmp = malloc(MAX_TITLE); - ewl_widget_enable(saveload->savebtn); - ewl_widget_state_set(saveload->savebtn, "enabled"); - ewl_widget_disable(saveload->loadbtn); - ewl_widget_state_set(saveload->loadbtn, "disabled"); + ewl_widget_enable(saveload->savebtn); + ewl_widget_state_set(saveload->savebtn, "enabled"); + ewl_widget_disable(saveload->loadbtn); + ewl_widget_state_set(saveload->loadbtn, "disabled"); saveload_selected = ewl_text_text_get((Ewl_Text *) o); snprintf(tmp, MAX_TITLE, "Selected: %s", saveload_selected); @@ -261,8 +258,8 @@ void ewl_saveload_save_by_name(char *p) { - saveload_selected=p; - ewl_saveload_save(NULL,NULL,NULL); + saveload_selected = p; + ewl_saveload_save(NULL, NULL, NULL); } /** @@ -299,9 +296,9 @@ n->y = y; n->content = strdup(get_content_by_note(p)); - if(append_note_stor(n)==1){ + if (append_note_stor(n) == 1) { /* Animation or something */ - edje_object_signal_emit(note->edje,NOTE_SAVED_SIGNAL,""); + edje_object_signal_emit(note->edje, NOTE_SAVED_SIGNAL, ""); } free_note_stor(n); @@ -350,16 +347,16 @@ setup_load_opt(Ewl_Widget * tree, char *caption) { Ewl_Widget *capt; - Ewl_Row *row; + Ewl_Row *row; capt = ewl_text_new(); ewl_text_text_set(EWL_TEXT(capt), caption); ewl_callback_append(capt, EWL_CALLBACK_CLICKED, - ewl_load_listitem_click, NULL); - ewl_object_fill_policy_set((Ewl_Object *) capt, EWL_FLAG_FILL_ALL); + ewl_load_listitem_click, NULL); + ewl_object_fill_policy_set((Ewl_Object *) capt, EWL_FLAG_FILL_ALL); ewl_widget_show(capt); - row = (Ewl_Row *) ewl_tree_row_add((Ewl_Tree *) tree, 0, &capt); - ewl_object_fill_policy_set((Ewl_Object *) row, EWL_FLAG_FILL_ALL); + row = (Ewl_Row *) ewl_tree_row_add((Ewl_Tree *) tree, 0, &capt); + ewl_object_fill_policy_set((Ewl_Object *) row, EWL_FLAG_FILL_ALL); return; } @@ -381,8 +378,9 @@ free(p); return; } - sprintf(p, "%s/.e/apps/enotes/notes/%s", getenv("HOME"), saveload_selected); - note_load(p); /* This function calls the animation */ + sprintf(p, "%s/.e/apps/enotes/notes/%s", getenv("HOME"), + saveload_selected); + note_load(p); /* This function calls the animation */ free(p); return; } @@ -399,10 +397,10 @@ { char *tmp = malloc(MAX_TITLE); - ewl_widget_disable(saveload->savebtn); - ewl_widget_state_set(saveload->savebtn, "disabled"); - ewl_widget_enable(saveload->loadbtn); - ewl_widget_state_set(saveload->loadbtn, "enabled"); + ewl_widget_disable(saveload->savebtn); + ewl_widget_state_set(saveload->savebtn, "disabled"); + ewl_widget_enable(saveload->loadbtn); + ewl_widget_state_set(saveload->loadbtn, "enabled"); saveload_selected = ewl_text_text_get((Ewl_Text *) o); snprintf(tmp, MAX_TITLE, "Selected: %s", saveload_selected); @@ -423,7 +421,8 @@ char *p = malloc(PATH_MAX); dml("Deleting Saved Note", 2); - sprintf(p, "%s/.e/apps/enotes/notes/%s", getenv("HOME"), saveload_selected); + sprintf(p, "%s/.e/apps/enotes/notes/%s", getenv("HOME"), + saveload_selected); unlink(p); ewl_saveload_revert(NULL, NULL, NULL); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/saveload.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- saveload.h 15 Mar 2006 01:25:28 -0000 1.12 +++ saveload.h 16 Mar 2006 00:13:17 -0000 1.13 @@ -43,7 +43,7 @@ Ewl_Widget *hbox; Ewl_Widget *savebtn; Ewl_Widget *loadbtn; - Ewl_Widget *deletebtn; + Ewl_Widget *deletebtn; Ewl_Widget *refreshbtn; Ewl_Widget *closebtn; } SaveLoad; @@ -62,8 +62,7 @@ Evas_List * p); void ewl_saveload_revert(Ewl_Widget * widget, void *ev_data, void *ud); -void ewl_saveload_close(Ewl_Widget * o, void *ev_data, - void *ud); +void ewl_saveload_close(Ewl_Widget * o, void *ev_data, void *ud); void ewl_saveload_save(Ewl_Widget * o, void *ev_data, void *null); void ewl_saveload_save_by_name(char *p); void ewl_saveload_listitem_click(Ewl_Widget * o, void *ev_data, =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/storage.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- storage.c 16 Mar 2006 00:05:56 -0000 1.16 +++ storage.c 16 Mar 2006 00:13:17 -0000 1.17 @@ -58,7 +58,7 @@ char *title; char *string = get_value_from_notestor(p); FILE *fp; - int retval=0; + int retval = 0; title = get_title_by_content(p->content); sprintf(target, "%s/.e/apps/enotes/notes/%s", getenv("HOME"), title); @@ -67,12 +67,12 @@ if ((fp = fopen(target, "w")) != NULL) { fputs(string, fp); fclose(fp); - retval=1; - } + retval = 1; + } free(string); free(target); - return(retval); + return (retval); } /** @@ -103,7 +103,7 @@ NoteStor *p; char *str = malloc(NOTE_LIMIT); char *fullstr = malloc(NOTE_LIMIT * 2); - Note *note; + Note *note; p = NULL; fullstr[0] = '\0'; @@ -112,9 +112,13 @@ sprintf(fullstr, "%s%s", fullstr, str); } if (strcmp("", fullstr)) - if ((p = get_notestor_from_value(fullstr)) != NULL){ - note=new_note_with_values_return(p->x, p->y, p->width, p->height, p->content); - edje_object_signal_emit(note->edje,NOTE_LOADED_SIGNAL,""); + if ((p = get_notestor_from_value(fullstr)) != NULL) { + note = new_note_with_values_return(p->x, p->y, + p->width, + p->height, + p->content); + edje_object_signal_emit(note->edje, + NOTE_LOADED_SIGNAL, ""); } } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/welcome.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- welcome.c 3 Oct 2005 14:48:55 -0000 1.5 +++ welcome.c 16 Mar 2006 00:13:17 -0000 1.6 @@ -24,22 +24,24 @@ ewl_widget_show(welcome->wvbox); welcome->title = ewl_text_new(); -// ewl_text_font_set((Ewl_Text *) welcome->title, "vera"); //, 18); +// ewl_text_font_set((Ewl_Text *) welcome->title, "vera"); //, 18); ewl_text_color_set((Ewl_Text *) welcome->title, 255, 255, 255, 255); ewl_text_styles_set((Ewl_Text *) welcome->title, EWL_TEXT_STYLE_OUTLINE); ewl_text_color_set((Ewl_Text *) welcome->title, 200, 200, 200, 255); - ewl_text_text_insert((Ewl_Text *) welcome->title, "Welcome to E-Notes", 0); + ewl_text_text_insert((Ewl_Text *) welcome->title, "Welcome to E-Notes", + 0); ewl_object_padding_set((Ewl_Object *) welcome->title, 5, 5, 5, 5); ewl_container_child_append((Ewl_Container *) welcome->wvbox, welcome->title); ewl_widget_show(welcome->title); welcome->label = ewl_text_new(); -// ewl_text_font_set((Ewl_Text *) welcome->label, "vera"); //, 12); +// ewl_text_font_set((Ewl_Text *) welcome->label, "vera"); //, 12); ewl_text_color_set((Ewl_Text *) welcome->label, 0, 0, 0, 255); ewl_text_text_insert((Ewl_Text *) welcome->label, - "E-Notes is a sticky notes system\nbased on the enlightenment\nfoundation libraries. Please\nview the credits and report\nany bugs to:\n", 0); + "E-Notes is a sticky notes system\nbased on the enlightenment\nfoundation libraries. Please\nview the credits and report\nany bugs to:\n", + 0); ewl_text_color_set((Ewl_Text *) welcome->label, 69, 98, 224, 255); ewl_text_text_append((Ewl_Text *) welcome->label, "[EMAIL PROTECTED]"); @@ -117,10 +119,11 @@ credits->credits = ewl_text_new(); ewl_object_padding_set((Ewl_Object *) credits->credits, 5, 5, 5, 5); -// ewl_text_font_set((Ewl_Text *) credits->credits, "vera"); //, 12); +// ewl_text_font_set((Ewl_Text *) credits->credits, "vera"); //, 12); ewl_text_color_set((Ewl_Text *) credits->credits, 0, 0, 0, 255); ewl_text_text_insert((Ewl_Text *) credits->credits, - "Credits:\n\nDeveloper: Thomas [Fletch]er\nArtwork: Corey Donohoe (Atmos)\nArtwork: Andrew Elcock (HandyAndE)\n", 0); + "Credits:\n\nDeveloper: Thomas [Fletch]er\nMaintainer: Andrew Williams (HandyandE)\nArtwork: Corey Donohoe (Atmos)\nArtwork: Andrew Williams (HandyAndE)\n", + 0); ewl_container_child_append((Ewl_Container *) credits->win, credits->credits); ewl_widget_show(credits->credits); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs