Enlightenment CVS committal Author : fletch3k Project : misc Module : enotes
Dir : misc/enotes/src Modified Files: config.c config.h controlcentre.c controlcentre.h main.c note.c note.h settings.c settings.h usage.c usage.h Log Message: Sticky and Ontop Added/Fixed + TODO Update =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/config.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- config.c 26 Aug 2004 20:50:24 -0000 1.8 +++ config.c 12 Sep 2004 15:33:57 -0000 1.9 @@ -33,6 +33,8 @@ p->controlcentre = 1; p->autosave = 0; p->welcome = 0; + p->ontop = 0; + p->sticky = 0; return (p); } @@ -126,15 +128,26 @@ free(p->theme); p->theme = strdup(info->value); } else if (!strcmp(info->name, "controlcentre")) { - p->controlcentre = atoi(info->value); + if (info->value != NULL) + p->controlcentre = atoi(info->value); } else if (!strcmp(info->name, "intro")) { - p->intro = atoi(info->value); + if (info->value != NULL) + p->intro = atoi(info->value); } else if (!strcmp(info->name, "debug")) { - p->debug = atoi(info->value); + if (info->value != NULL) + p->debug = atoi(info->value); } else if (!strcmp(info->name, "autosave")) { - p->autosave = atoi(info->value); + if (info->value != NULL) + p->autosave = atoi(info->value); } else if (!strcmp(info->name, "welcome")) { - p->welcome = atoi(info->value); + if (info->value != NULL) + p->welcome = atoi(info->value); + } else if (!strcmp(info->name, "sticky")) { + if (info->value != NULL) + p->sticky = atoi(info->value); + } else if (!strcmp(info->name, "ontop")) { + if (info->value != NULL) + p->ontop = atoi(info->value); } return; =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/config.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- config.h 26 Aug 2004 20:50:24 -0000 1.6 +++ config.h 12 Sep 2004 15:33:57 -0000 1.7 @@ -34,6 +34,8 @@ int debug; int autosave; int welcome; + int ontop; + int sticky; } MainConfig; #ifndef XMLENTRY_DEF =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/controlcentre.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- controlcentre.c 9 Sep 2004 11:57:30 -0000 1.12 +++ controlcentre.c 12 Sep 2004 15:33:57 -0000 1.13 @@ -34,20 +34,59 @@ pos = get_cc_pos(); /* Setup the Window */ - cc->win = - ecore_evas_software_x11_new(NULL, 0, pos->x, pos->y, pos->width, - pos->height); + if (!strcmp(main_config->render_method, "gl")) { +#ifdef HAVE_ECORE_EVAS_GL + cc->win = + ecore_evas_gl_x11_new(NULL, 0, pos->x, pos->y, + pos->width, pos->height); +#else + dml("GL not in Ecore_Evas module. Falling back on software!", + 1); + free(main_config->render_method); + main_config->render_method = strdup("software"); + cc->win = + ecore_evas_software_x11_new(NULL, 0, pos->x, pos->y, + pos->width, pos->height); +#endif + } else + cc->win = + ecore_evas_software_x11_new(NULL, 0, pos->x, pos->y, + pos->width, pos->height); + ecore_evas_title_set(cc->win, "Enotes"); ecore_evas_name_class_set(cc->win, "Enotes", "Enotes"); + + if (main_config->ontop == 1) + if (!strcmp(main_config->render_method, "gl")) { + ecore_x_window_prop_layer_set + (ecore_evas_gl_x11_window_get(cc->win), + ECORE_X_WINDOW_LAYER_ABOVE); + } else { + ecore_x_window_prop_layer_set + (ecore_evas_software_x11_window_get(cc->win), + ECORE_X_WINDOW_LAYER_ABOVE); + } + + if (main_config->sticky == 1) + ecore_evas_sticky_set(cc->win, 1); + else + ecore_evas_sticky_set(cc->win, 0); + ecore_evas_borderless_set(cc->win, 1); ecore_evas_shaped_set(cc->win, 1); if (pos->x != 0 && pos->y != 0) ecore_evas_resize(cc->win, pos->x, pos->y); ecore_evas_show(cc->win); +// if(main_config->ontop==1) + /* Moving the damn thing */ - ecore_x_window_prop_xy_set(ecore_evas_software_x11_window_get(cc->win), - pos->x, pos->y); + if (!strcmp(main_config->render_method, "gl")) + ecore_x_window_prop_xy_set(ecore_evas_gl_x11_window_get + (cc->win), pos->x, pos->y); + else + ecore_x_window_prop_xy_set(ecore_evas_software_x11_window_get + (cc->win), pos->x, pos->y); /* Setup the Canvas, Render-Method and Font Path */ cc->evas = ecore_evas_get(cc->win); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/controlcentre.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- controlcentre.h 9 Sep 2004 11:57:30 -0000 1.7 +++ controlcentre.h 12 Sep 2004 15:33:57 -0000 1.8 @@ -21,6 +21,7 @@ #include <Ecore.h> #include <Ecore_Evas.h> +#include <Ecore_X.h> #include <Edje.h> #include <Esmart/Esmart_Container.h> #include <Esmart/Esmart_Draggies.h> =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- main.c 9 Sep 2004 11:57:30 -0000 1.13 +++ main.c 12 Sep 2004 15:33:57 -0000 1.14 @@ -57,6 +57,7 @@ /* Initialise the E-Libs */ ecore_init(); + ecore_x_init(NULL); ecore_app_args_set(argc, (const char **) argv); if (!ecore_evas_init()) { /* Initialises Evas.. I hope. :) */ mainconfig_free(main_config); @@ -138,6 +139,7 @@ /* Shutdown the E-Libs */ edje_shutdown(); ecore_evas_shutdown(); + ecore_x_shutdown(); ecore_shutdown(); dml("Efl Shutdown", 1); } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/note.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- note.c 11 Sep 2004 17:17:01 -0000 1.26 +++ note.c 12 Sep 2004 15:33:57 -0000 1.27 @@ -144,16 +144,52 @@ /* Setup the Window */ - p->win = ecore_evas_software_x11_new(NULL, 0, x, y, width, height); + if (!strcmp(main_config->render_method, "gl")) { +#ifdef HAVE_ECORE_EVAS_GL + p->win = ecore_evas_gl_x11_new(NULL, 0, x, y, width, height); +#else + dml("GL not in Ecore_Evas module. Falling back on software!", + 1); + free(main_config->render_method); + main_config->render_method = strdup("software"); + p->win = ecore_evas_software_x11_new(NULL, 0, x, y, width, + height); +#endif + } else + p->win = ecore_evas_software_x11_new(NULL, 0, x, y, width, + height); + ecore_evas_title_set(p->win, "An E-Note"); ecore_evas_name_class_set(p->win, "Enotes", "Enotes"); + + if (main_config->ontop == 1) + if (!strcmp(main_config->render_method, "gl")) { + ecore_x_window_prop_layer_set + (ecore_evas_gl_x11_window_get(p->win), + ECORE_X_WINDOW_LAYER_ABOVE); + } else { + ecore_x_window_prop_layer_set + (ecore_evas_software_x11_window_get(p->win), + ECORE_X_WINDOW_LAYER_ABOVE); + } + + if (main_config->sticky == 1) + ecore_evas_sticky_set(p->win, 1); + else + ecore_evas_sticky_set(p->win, 0); + ecore_evas_borderless_set(p->win, 1); ecore_evas_shaped_set(p->win, 1); ecore_evas_show(p->win); - /* Move the damn window */ - ecore_x_window_prop_xy_set(ecore_evas_software_x11_window_get(p->win), - x, y); + + /* Move the damn thing */ + if (!strcmp(main_config->render_method, "gl")) + ecore_x_window_prop_xy_set(ecore_evas_gl_x11_window_get(p->win), + x, y); + else + ecore_x_window_prop_xy_set(ecore_evas_software_x11_window_get + (p->win), x, y); /* Setup the Canvas, fonts, etc... */ p->evas = ecore_evas_get(p->win); @@ -201,7 +237,7 @@ edje_object_part_text_set(p->edje, EDJE_TEXT_USER, getenv("USER")); datestr = get_date_string(); edje_object_part_text_set(p->edje, EDJE_TEXT_DATE, datestr); - update_enote_title (p->edje,content); + update_enote_title(p->edje, content); /* Ewl */ p->emb = ewl_embed_new(); @@ -217,16 +253,17 @@ evas_object_focus_set(p->eo, TRUE); ewl_embed_focus_set((Ewl_Embed *) p->emb, TRUE); - p->pane=ewl_scrollpane_new(); - ewl_container_child_append((Ewl_Container*)p->emb,p->pane); + p->pane = ewl_scrollpane_new(); + ewl_container_child_append((Ewl_Container *) p->emb, p->pane); ewl_widget_show(p->pane); p->content = ewl_text_new(fcontent); ewl_container_child_append((Ewl_Container *) p->pane, p->content); - ewl_object_fill_policy_set((Ewl_Object *) p->content, EWL_FLAG_FILL_FILL); + ewl_object_fill_policy_set((Ewl_Object *) p->content, + EWL_FLAG_FILL_FILL); ewl_callback_append(p->emb, EWL_CALLBACK_CONFIGURE, note_move_embed, - p->pane); - + p->pane); + ewl_widget_show(p->content); /* Ecore Callbacks */ @@ -284,6 +321,7 @@ (ecore_evas_get(ee), "edje"), w, h); evas_object_resize(evas_object_name_find(ecore_evas_get(ee), "dragger"), w, h); + return; } @@ -592,8 +630,9 @@ * @brief: Sets the title in the edje. */ void -update_enote_title(Evas_Object *edje,char *content) +update_enote_title(Evas_Object * edje, char *content) { - edje_object_part_text_set(edje, EDJE_TEXT_TITLE,get_title_by_content(content)); - return; + edje_object_part_text_set(edje, EDJE_TEXT_TITLE, + get_title_by_content(content)); + return; } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/note.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- note.h 11 Sep 2004 17:17:01 -0000 1.10 +++ note.h 12 Sep 2004 15:33:57 -0000 1.11 @@ -16,6 +16,7 @@ #include <Ecore.h> #include <Ecore_Evas.h> +#include <Ecore_X.h> #include <Edje.h> #include <Ewl.h> @@ -108,6 +109,6 @@ Evas_List *get_cycle_next_note(Evas_List * note); Evas_List *get_cycle_previous_note(Evas_List * note); -void update_enote_title(Evas_Object *edje,char *content); +void update_enote_title(Evas_Object * edje, char *content); #endif =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/settings.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- settings.c 5 Sep 2004 15:06:56 -0000 1.13 +++ settings.c 12 Sep 2004 15:33:57 -0000 1.14 @@ -134,6 +134,16 @@ "Welcome Screen [0=No 1=Yes]:", main_config->welcome); + settings->sticky = + setup_settings_opt_int(settings->tree, + "\"Sticky\" Notes (WM) [0=No 1=Yes]:", + main_config->sticky); + + settings->ontop = + setup_settings_opt_int(settings->tree, + "Notes Ontop (WM) [0=No 1=Yes]:", + main_config->ontop); + return; } @@ -294,6 +304,12 @@ xml_write_append_entry(p, "welcome", ewl_entry_text_get((Ewl_Entry *) settings-> welcome.entry)); + xml_write_append_entry(p, "sticky", + ewl_entry_text_get((Ewl_Entry *) settings-> + sticky.entry)); + xml_write_append_entry(p, "ontop", + ewl_entry_text_get((Ewl_Entry *) settings-> + ontop.entry)); xml_write_end(p); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/settings.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- settings.h 26 Aug 2004 20:50:24 -0000 1.8 +++ settings.h 12 Sep 2004 15:33:57 -0000 1.9 @@ -40,7 +40,7 @@ Ewl_Widget *revertbtn; Ewl_Widget *closebtn; Settings_Opt render_method, theme, intro, debug, cc, autosave, - welcome; + welcome, sticky, ontop; } Settings; extern MainConfig *main_config; =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/usage.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- usage.c 11 Mar 2004 17:28:58 -0000 1.7 +++ usage.c 12 Sep 2004 15:33:57 -0000 1.8 @@ -93,6 +93,14 @@ if (atoi(optarg) == 0 || atoi(optarg) == 1) main_config->intro = atoi(optarg); break; + case 's': + if (atoi(optarg) == 0 || atoi(optarg) == 1) + main_config->sticky = atoi(optarg); + break; + case 'o': + if (atoi(optarg) == 0 || atoi(optarg) == 1) + main_config->ontop = atoi(optarg); + break; case 'v': printf(USAGE_VERSION, VERSION); dispusage = 1; =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/usage.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- usage.h 28 Aug 2004 13:09:08 -0000 1.8 +++ usage.h 12 Sep 2004 15:33:57 -0000 1.9 @@ -47,6 +47,8 @@ | | | Centre.\n\ -A | --auto-save | INT | Enable the autosaving and\n\ | | | loading of notes.\n\ +-s | --sticky | INT | Make the notes sticky?\n\ +-o | --ontop | INT | Keep the note ontop?\n\n\ -i | --intro | INT | Display the Intro.\n\ -w | --welcome | INT | Welcome You?\n\ \ @@ -54,7 +56,7 @@ #define USAGE_VERSION "E-Notes Version:\n%s\n" -#define OPTSTR "v?hc:r:t:i:R:d:A:w:C:" +#define OPTSTR "v?hc:r:t:i:R:d:A:w:C:s:o:" static struct option long_options[] = { {"help", 0, 0, '?'}, @@ -68,6 +70,8 @@ {"debug", 1, 0, 'd'}, {"auto-save", 1, 0, 'A'}, {"welcome", 1, 0, 'w'}, + {"sticky", 1, 0, 's'}, + {"ontop", 1, 0, 'o'}, {NULL, 0, 0, 0} }; ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs