Enlightenment CVS committal Author : fletch3k Project : misc Module : enotes
Dir : misc/enotes/src Modified Files: Makefile.am allocmem.c argsparser.c confparse.c main.c main.h notecmds.c notenum.c setdefconf.c variables.c Added Files: evasfuncs.c funcs_cmds.h funcs_evas.h funcs_usage_conf.h launchbar.c menubar.c notengui.c titlewin.c usage.h var_conf.h var_eprog_evas.h var_ewl.h var_structs.h Log Message: More Code Management (56k grrr) =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- Makefile.am 28 Feb 2003 20:27:39 -0000 1.3 +++ Makefile.am 1 Mar 2003 10:34:52 -0000 1.4 @@ -6,15 +6,28 @@ bin_PROGRAMS = enotes enotes_SOURCES = \ +allocmem.c \ +funcs_cmds.h \ main.c \ -main.h \ -newentry.c \ notecmds.c \ -notenum.c \ -allocmem.c \ +titlewin.c \ +var_ewl.h \ argsparser.c \ +funcs_evas.h \ +main.h \ +notengui.c \ +usage.h \ +variables.c \ confparse.c \ +funcs_usage_conf.h \ +menubar.c \ +notenum.c \ +var_conf.h \ +var_structs.h \ +evasfuncs.c \ +launchbar.c \ +newentry.c \ setdefconf.c \ -variables.c +var_eprog_evas.h enotes_LDADD = @ewl_libs@ @eprog_libs@ =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/allocmem.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- allocmem.c 28 Feb 2003 20:27:40 -0000 1.1 +++ allocmem.c 1 Mar 2003 10:34:52 -0000 1.2 @@ -1,11 +1,27 @@ +/* +----------------------------------------------------------- +| ###### # # #### ##### ###### #### | +| # ## # # # # # # | +| ##### ##### # # # # # # ##### #### | +| # # # # # # # # # | +| # # ## # # # # # # | +| ###### # # #### # ###### #### | +----------------------------------------------------------- +| E-Notes is released under: | +| The GNU General Public License (GPL) | +| | +| Owner: Thomas Fletcher | +|_________________________________________________________| +*/ + #include "main.h" void -allocatemem () +allocatemem (void) { tmp = malloc (str_size); str = malloc (str_size); - fn = malloc (100); + fn = malloc (str_size); fontdir = malloc (str_size); bgfile = malloc (str_size); font = malloc (str_size); @@ -30,7 +46,7 @@ } void -deallocatemem () +deallocatemem (void) { if (tmp) free (tmp); @@ -50,4 +66,28 @@ free (xbtnfn); if (barimg) free (barimg); + if (openwinimg) + free (openwinimg); + if (lastbtn) + free (lastbtn); + if (firstbtn) + free (firstbtn); + if (nubtn) + free (nubtn); + if (newbtn) + free (newbtn); + if (bgimg) + free (bgimg); + if (firstbtnimg) + free (firstbtnimg); + if (lastbtnimg) + free (lastbtnimg); + if (nubtnimg) + free (nubtnimg); + if (newbtnimg) + free (newbtnimg); + if (exitbtnimg) + free (exitbtnimg); + + return; } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/argsparser.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- argsparser.c 28 Feb 2003 20:27:40 -0000 1.1 +++ argsparser.c 1 Mar 2003 10:34:52 -0000 1.2 @@ -1,3 +1,19 @@ +/* +----------------------------------------------------------- +| ###### # # #### ##### ###### #### | +| # ## # # # # # # | +| ##### ##### # # # # # # ##### #### | +| # # # # # # # # # | +| # # ## # # # # # # | +| ###### # # #### # ###### #### | +----------------------------------------------------------- +| E-Notes is released under: | +| The GNU General Public License (GPL) | +| | +| Owner: Thomas Fletcher | +|_________________________________________________________| +*/ + #include "main.h" void @@ -7,7 +23,8 @@ int actionbool = 0; char *mtmp = malloc (str_size); - if (argc < 2) + if (argc < 2) /* Lets check whether there are any arguments + if not, lets just run the title screen :-) */ { openwin (); eprog_event_loop (); @@ -15,7 +32,10 @@ } - while (argv[a] != NULL) + while (argv[a] != NULL) /* Check each part of the array for an + argument match, set configuration and + continue to the command loop, now all + of the configuration arguments are set/ */ { if (!strcmp (argv[a], "-d") || !strcmp (argv[a], "--db")) { @@ -61,6 +81,7 @@ exit (-1); } strcpy (configfn, argv[a + 1]); + setconfig (); a++; } @@ -507,7 +528,8 @@ a = 1; - while (argv[a] != NULL) + while (argv[a] != NULL) /* Lets check the command arguments now and + execute the function required. */ { if (!strcmp (argv[a], "-o") || !strcmp (argv[a], "--first")) { @@ -561,14 +583,17 @@ a = 0; - if (actionbool == 0) + if (actionbool == 0) /* If no action variables have been set + and so it was just a little configuring + then run the title window now that the + options are set again :-) */ { openwin (); eprog_event_loop (); exit (-1); } - free (mtmp); + free (mtmp); /* Free the little string used */ return; } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/confparse.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- confparse.c 28 Feb 2003 20:27:40 -0000 1.1 +++ confparse.c 1 Mar 2003 10:34:52 -0000 1.2 @@ -1,3 +1,19 @@ +/* +----------------------------------------------------------- +| ###### # # #### ##### ###### #### | +| # ## # # # # # # | +| ##### ##### # # # # # # ##### #### | +| # # # # # # # # # | +| # # ## # # # # # # | +| ###### # # #### # ###### #### | +----------------------------------------------------------- +| E-Notes is released under: | +| The GNU General Public License (GPL) | +| | +| Owner: Thomas Fletcher | +|_________________________________________________________| +*/ + #include "main.h" =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/main.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- main.c 28 Feb 2003 20:27:40 -0000 1.15 +++ main.c 1 Mar 2003 10:34:52 -0000 1.16 @@ -19,19 +19,26 @@ int main (int argc, char *argv[]) { - int a = 1; - int actionbool = 0; - char *mtmp = malloc (str_size); + allocatemem (); /* Malloc the Variables. */ + setdefaults (); /* Set all of the default values + to the variables. */ - allocatemem (); - setdefaults (); + eprog_init (); /* Initialise E-Prog */ - eprog_init (); + setconfig (); /* Read the configuration file + and set the configuration. */ - setconfig (); - parseusage (argc, argv); + parseusage (argc, argv); /* Parse the command line + arguments and both set + options if needed and + execute the commands + specified. */ - deallocatemem (); + deallocatemem (); /* free the variables from memory + when all objects have been set + so the strings no longer need + to hold any data. */ - eprog_event_loop (); + eprog_event_loop (); /* Enter the event loop */ + return (0); /* Lets Get Out of Here! */ } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/main.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- main.h 28 Feb 2003 20:27:40 -0000 1.19 +++ main.h 1 Mar 2003 10:34:52 -0000 1.20 @@ -24,313 +24,22 @@ #include <Ewl.h> #include <Ecore.h> -#define str_size 100 -#define version "pre 0.1\n" - -#define usage "E-Notes Usage:\n\ - enotes [options] [command]\n\ - enotes [command] [options]\n\ - enotes [options]\n\ - enotes\n\n\ - Commands:\n\ -POSIX GNU Description\n\ --o --first Display First Note.\n\ --n <n> --num <n> Display the n'th Note.\n\ - --nu Display the GUI for the\n\ - above feature.\n\ --l --last Display the Last Note.\n\n\ --c --clear Clear all notes.\n\ --N --new Create a new note\n\ --a --consolenew Use console based note\n\ - creation system.\n\n\ --C --count Display Number of notes\n\ - stored.\n\ - --bar Display the E-Notes\n\ - Execution Bar.\n\n\ - Options:\n\ -POSIX GNU Description\n\ --d <d> --db <d> Use <d> as the enotes\n\ - data source.\n\ --s <s> --config <s> Use <s> as the configuration\n\ - file.\n\ --f <f> --font <f> Use <f> as the font.\n\ --b <b> --bg <b> Use a different\n\ - background for\n\ - note file.\n\ --x <x> --xbtnimg <x> Use a different image\n\ - for the X Button\n\ --t <i> --titleimg <i> Use a different image\n\ - for the title page\n\ - --lastbtn <b> Use a different image\n\ - for the Last Entry Button.\n\ - --firstbtn <b> Use a different image\n\ - for the First Entry Button.\n\ - --nubtn <b> Use a different image for\n\ - the Number Button.\n\ - --newbtn <b> Use a different image for\n\ - the new entry button.\n\ --B <b> --barimg <b> Use a different image for\n\ - the menubar background.\n\ --S <s> --fontsize <s> Use a different font size.\n\ --T <s> --tsize <s> Use a different font size\n\ - for the title.\n\n\ - E-Notes Execution Bar - Options:\n\ -GNU Description\n\ ---barwin_x <n> Use N as the X co-ordinate for\n\ - the E-Notes Bar window.\n\ ---barwin_y <n> Use N as the Y co-ordinate for\n\ - the E-Notes Bar window.\n\ ---barwin_width <n> Use N as the width for the\n\ - E-Notes Bar Window.\n\ ---barwin_height <n> Use N as the height for the\n\ - E-Notes Bar Window.\n\ ---barwin_bg <i> Use I as the background image\n\ - use on the E-Notes Bar Window.\n\n\ ---firstbtn_x <n> Use N for the X co-ordinate on\n\ - the \"Display First Note\" button.\n\ ---firstbtn_y <n> Use N for the Y co-ordinate on\n\ - the \"Display First Note\" button.\n\ ---lastbtn_x <n> Use N for the X co-ordinate on\n\ - the \"Display Last Note\" button.\n\ ---lastbtn_y <n> Use N for the Y co-ordinate on\n\ - the \"Display Last Note\" button.\n\ ---nubtn_x <n> Use N for the X co-ordinate on\n\ - the \"Display Note Number\" button.\n\ ---nubtn_y <n> Use N for the Y co-ordinate on\n\ - the \"Display Note Number\" button.\n\ ---newbtn_x <n> Use N for the X co-ordinate on\n\ - the \"Append New Note\" button.\n\ ---newbtn_y <n> Use N for the Y co-ordinate on\n\ - the \"Append New Note\" button.\n\ ---exitbtn_x <n> Use N for the X co-ordinate on\n\ - the \"Exit E-Notes Bar\" button.\n\ ---exitbtn_y <n> Use N for the X co-ordinate on\n\ - the \"Exit E-Notes Bar\" button.\n\n\ ---firstbtn_width <n> Use N for the width of the\n\ - \"Display First Note\" button.\n\ ---firstbtn_height <n> Use N for the height of the\n\ - \"Display First Note\" button.\n\ ---lastbtn_width <n> Use N for the width of the\n\ - \"Display Last Note\" button.\n\ ---lastbtn_height <n> Use N for the height of the\n\ - \"Display Last Note\" button.\n\ ---nubtn_width <n> Use N for the width of the\n\ - \"Display Note Number\" button.\n\ ---nubtn_height <n> Use N for the height of the\n\ - \"Display Note Number\" button.\n\ ---newbtn_width <n> Use N for the width of the\n\ - \"Append New Note\" button.\n\ ---newbtn_height <n> Use N for the height of the\n\ - \"Append New Note\" button.\n\ ---exitbtn_width <n> Use N for the width of the\n\ - \"Exit E-Notes Bar\" button.\n\ ---exitbtn_height <n> Use N for the height of the\n\ - \"Exit E-Notes Bar\" button.\n\ ---firstbtn_img <i> Use I for the image displayed as\n\ - the \"Display First Note\" button.\n\ ---lastbtn_img <i> Use I for the image displayed as\n\ - the \"Display Last Note\" button.\n\ ---nubtn_img <i> Use I for the image displayed as\n\ - the \"Display Note Number\" button.\n\ ---newbtn_img <i> Use I for the image displayed as\n\ - the \"Append New Note\" button.\n\ ---exitbtn_img <i> Use I for the image displayed as\n\ - the \"Exit E-Notes Bar\" button.\n\n\ - E-Notes can be run with or without both\n\ - options and commands. If you run it with\n\ - neither it will simply open E-Notes at the\n\ - title window, and you will be given\n\ - instructions on how to access the menu and\n\ - use it from there. Unless the theme doesn't\n\ - contain the instructions, the default themes do.\n\ - If you run it without options it will get its\n\ - settings from either the configuration file or\n\ - the default settings which are built in to E-Notes.\n\n\ - If you run it with commands however, it will\n\ - just execute that one command, but the window that\n\ - comes up, will have the menu on it, so you can easily\n\ - use enotes from there also. How you run E-Notes is\n\ - up to you of course, so configure it and run it to\n\ - suite your personal needs.\n\n\ -Please Enjoy E-Notes :-)\n\ -Thomas Fletcher.\n\n\ -Any Bugs, Please E-Mail to [EMAIL PROTECTED] .\n" - - - -extern char *tmp; -extern char *str; - -extern char *fn; -extern char *fontdir; -extern char *bgfile; -extern char *font; -extern char *configfn; -extern char *xbtnfn; -extern char *openwinimg; -extern char *lastbtn; -extern char *firstbtn; -extern char *nubtn; -extern char *newbtn; -extern char *barimg; - -extern FILE *file; - -extern unsigned int r; -extern unsigned int g; -extern unsigned int b; - -extern unsigned int w; -extern unsigned int h; - -extern unsigned int font_size; -extern unsigned int title_font_size; - - -extern unsigned int win_x; -extern unsigned int win_y; -extern unsigned int win_width; -extern unsigned int win_height; - -extern unsigned int firstbtn_x; -extern unsigned int firstbtn_y; -extern unsigned int firstbtn_width; -extern unsigned int firstbtn_height; - -extern unsigned int lastbtn_x; -extern unsigned int lastbtn_y; -extern unsigned int lastbtn_width; -extern unsigned int lastbtn_height; - -extern unsigned int nubtn_x; -extern unsigned int nubtn_y; -extern unsigned int nubtn_width; -extern unsigned int nubtn_height; - -extern unsigned int newbtn_x; -extern unsigned int newbtn_y; -extern unsigned int newbtn_width; -extern unsigned int newbtn_height; - -extern unsigned int exitbtn_x; -extern unsigned int exitbtn_y; -extern unsigned int exitbtn_width; -extern unsigned int exitbtn_height; - -extern char *bgimg; -extern char *firstbtnimg; -extern char *lastbtnimg; -extern char *newbtnimg; -extern char *nubtnimg; -extern char *exitbtnimg; - -extern E_Prog *bar; -extern Evas_Object *bar_bg; -extern Evas_Object *bar_firstbtn; -extern Evas_Object *bar_lastbtn; -extern Evas_Object *bar_nubtn; -extern Evas_Object *bar_newbtn; -extern Evas_Object *bar_exitbtn; - +#include "usage.h" /* Define Usage */ -extern E_Prog *root; -extern Evas_Object *bg; -extern Evas_Object *title; -extern Evas_Object *txt[11]; -extern Evas_Object *exitbtn; -extern Evas_Object *rectbar; + /* Variables */ -extern Evas_Object *lastbtnob; -extern Evas_Object *firstbtnob; -extern Evas_Object *nubtnob; -extern Evas_Object *newbtnob; +#include "var_conf.h" /* Configuration Variables */ +#include "var_eprog_evas.h" /* EProg and Evas Variables */ +#include "var_ewl.h" /* Ewl Variables */ +#include "var_structs.h" /* Structures */ -extern Ewl_Widget *main_win; -extern Ewl_Widget *main_box; -extern Ewl_Widget *ewltitle; -extern Ewl_Widget *note[11]; -extern Ewl_Widget *okbtn; -extern Ewl_Widget *cancelbtn; + /* Functions */ -typedef struct _fadeinfo fadeinfo; +#include "funcs_cmds.h" +#include "funcs_evas.h" +#include "funcs_usage_conf.h" -struct _fadeinfo -{ - Evas_Object *ob; - int a1; - int a2; - int freq; - double speed; - int loop; -}; + /* A Little Defining */ - -void fadein_loop (int val, fadeinfo * fi); -void fadeobin (Evas_Object * ob, int a1, int a2, int freq, double speed); -void change_alpha (Evas_Object * ob, int alpha); - -Evas_Object *new_line (Evas * evas, int x1, int y1, int x2, int y2, int r, - int g, int b, int alpha, int layer); -Evas_Object *new_image (Evas * evas, char *imagefile, int layer, int fill_x, - int fill_y, int width, int height, int x, int y); -Evas_Object *new_rectangle (Evas * evas, int r, int g, int b, int alpha, - int width_x, int width_y, int x, int y, - int layer); -Evas_Object *new_text (Evas * evas, char *font, int size, char *text, int r, - int g, int b, int alpha, int x, int y, int layer); -E_Prog *new_window (int width, int height); - -void move_object (Evas_Object * ob, int x, int y); -void resize_object (Evas_Object * ob, int width, int height); -void init (void); -void floop (void); -void onclick (Evas_Object * ob, void (*func), const void *data); -void addtimer (char *name, double interval, void (*func), - int initloopval /*Optional For Use */ , const void *data); -void mousemoveforward (Ecore_Event * event); -void onmousemove (E_Prog * eprog, void (*func)); -void movemouseimg (Ecore_Event * event); -void changemouse (E_Prog * eprog, char *img, int width, int height); -/* Should I do this or not? */ - -void parseconfig (int argc, char **argv[]); -void setdefaultvalues (void); - -void openwin (void); -void makebar (void); - -void fnotenum (int num); -void fileopen (char *mode); - -void displayall (void); -void dislast (void); -void clear (void); -void newnote (int argc, char *argv[]); -void count (void); - -void notengui (void); - -void getncmd (Ewl_Widget * w, void *ev_data, void *user_data); - -void setconfig (void); - -void kill_main_window (Ewl_Widget * main_win, void *ev_data, void *user_data); - -void fadein (int fadeloop, char *tmpstr); -void fadeout (int fadeloop); - -void slideout (int slideloop); -void slidein (int slideloop); - -void mousemoveevent (Ecore_Event * event); - -void okbtnclicked (void); - -void runbar (void); - -void parseusage (int argc, char *argv[]); -void setconfig (void); -void setdefaults (void); - -void allocatemem (void); -void deallocatemem (void); +#define str_size 100 +#define version "pre 0.1\n" =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/notecmds.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- notecmds.c 26 Feb 2003 20:38:04 -0000 1.10 +++ notecmds.c 1 Mar 2003 10:34:52 -0000 1.11 @@ -16,11 +16,6 @@ #include "main.h" -Ewl_Widget *ewlwin; -Ewl_Widget *ewlbox; -Ewl_Widget *ewlentry; -Ewl_Widget *ewlbtn; - void fileopen (char *mode) @@ -76,379 +71,4 @@ printf ("Count: %d\n", a / 13); free (c); exit (-1); -} - -void -notengui () -{ - ewl_init (1, NULL); - - ewlwin = ewl_window_new (); - ewl_window_set_title (EWL_WINDOW (ewlwin), "View Note Number?"); - ewl_callback_append (ewlwin, EWL_CALLBACK_DELETE_WINDOW, - kill_main_window, NULL); - ewl_window_set_auto_size (EWL_WINDOW (ewlwin), TRUE); - ewl_widget_show (ewlwin); - - ewlbox = ewl_vbox_new (); - ewl_container_append_child (EWL_CONTAINER (ewlwin), ewlbox); - ewl_widget_show (ewlbox); - - ewlbtn = ewl_button_new ("View It!"); - ewlentry = ewl_entry_new (""); - - ewl_container_append_child (EWL_CONTAINER (ewlbox), ewlentry); - ewl_container_append_child (EWL_CONTAINER (ewlbox), ewlbtn); - - ewl_callback_append (ewlbtn, EWL_CALLBACK_CLICKED, getncmd, - (Ewl_Entry *) ewlentry); - - ewl_widget_show (ewlentry); - ewl_widget_show (ewlbtn); - - ewl_main (); -} - -void -getncmd (Ewl_Widget * w, void *ev_data, void *user_data) -{ - char *cmdstr = malloc (60); - char *number = malloc (20); - if (ewlentry == NULL) - { - printf ("WHAT?!?! The EWL Entry is NULL!"); - return; - } - number = ewl_entry_get_text (EWL_ENTRY (ewlentry)); - if (number == NULL) - { - printf ("Why is <number> NULL ?\n"); - return; - } - - strncpy (number, number, strlen (number) - 1); - strcpy (cmdstr, "enotes -n "); - strcat (cmdstr, number); - strcat (cmdstr, "&"); - - system (cmdstr); - - free (cmdstr); - free (number); - ev_data = NULL; - user_data = NULL; - w = NULL; - - exit (-1); -} - -int keepaddin = 0; - -E_Prog *tmpeprog; -void *tmpfunc; -Evas_Object *mouse; -E_Prog *tmpmouseeprog; - -void -fadein_loop (int val, fadeinfo * fi) -{ - int r, g, b, a; - char *tmp = malloc (50); - Evas_Object *ob; - int a1, a2, loop; - double speed; - int freq; - - if (fi->ob == NULL) - { - printf ("Object is NULL.\n"); - exit (-1); - } - - ob = fi->ob; - a1 = fi->a1; - a2 = fi->a2; - speed = fi->speed; - loop = fi->loop; - freq = fi->freq; - - loop = loop + freq; - fi->loop = fi->loop + freq; - - if (loop == a2 || loop > a2) - { - printf ("Ending.\n"); - return; - } - - evas_object_color_get (ob, &r, &g, &b, &a); - evas_object_color_set (ob, r, g, b, loop); - - evas_object_show (ob); - - keepaddin++; - - sprintf (tmp, "%dloop", keepaddin); - - ecore_add_event_timer (tmp, speed, (void *) fadein_loop, 0, fi); - free (tmp); - return; -} - -void -fadeobin (Evas_Object * ob, int a1, int a2, int freq, double speed) -{ - fadeinfo *fi = malloc (20); - - fi->ob = ob; - fi->a1 = a1; - fi->a2 = a2; - fi->speed = speed; - fi->freq = freq; - fi->loop = a1; - - printf ("a1 first passed: %d\na2 first passed: %d\n", a1, a2); - - ecore_add_event_timer ("quickly", 0, (void *) fadein_loop, 0, fi); - - return; -} - -void -change_alpha (Evas_Object * ob, int alpha) -{ - int r, g, b, a; - evas_object_color_get (ob, &r, &g, &b, &a); - evas_object_color_set (ob, r, g, b, alpha); - return; -} - -Evas_Object * -new_line (Evas * evas, int x1, int y1, int x2, int y2, int r, int g, - int b, int alpha, int layer) -{ - Evas_Object *tmp; - - tmp = evas_object_line_add (evas); - evas_object_line_xy_set (tmp, (double) x1, (double) y1, (double) x2, - (double) x2); - evas_object_color_set (tmp, r, g, b, alpha); - evas_object_layer_set (tmp, layer); - - return (tmp); -} - -Evas_Object * -new_image (Evas * evas, char *imagefile, int layer, int fill_x, - int fill_y, int width, int height, int x, int y) -{ - Evas_Object *tmp; - - tmp = evas_object_image_add (evas); - evas_object_image_file_set (tmp, imagefile, NULL); - evas_object_image_fill_set (tmp, 0, 0, fill_x, fill_y); - evas_object_layer_set (tmp, layer); - evas_object_resize (tmp, width, height); - evas_object_move (tmp, x, y); - - return (tmp); -} - -Evas_Object * -new_rectangle (Evas * evas, int r, int g, int b, int alpha, - int width_x, int width_y, int x, int y, int layer) -{ - Evas_Object *tmp; - - tmp = evas_object_rectangle_add (evas); - evas_object_color_set (tmp, r, g, b, alpha); - evas_object_move (tmp, x, y); - evas_object_resize (tmp, width_x, width_y); - evas_object_layer_set (tmp, layer); - - return (tmp); -} - -Evas_Object * -new_text (Evas * evas, char *font, int size, char *text, int r, - int g, int b, int alpha, int x, int y, int layer) -{ - Evas_Object *tmp; - - tmp = evas_object_text_add (evas); - evas_object_text_font_set (tmp, font, size); - evas_object_text_text_set (tmp, text); - evas_object_color_set (tmp, r, g, b, alpha); - evas_object_layer_set (tmp, layer); - evas_object_move (tmp, x, y); - - return (tmp); -} - -E_Prog * -new_window (int width, int height) -{ - E_Prog *tmp; - tmp = eprog_new (); - eprog_resize (tmp, width, height); - - return (tmp); -} - -void -move_object (Evas_Object * ob, int x, int y) -{ - evas_object_move (ob, x, y); - return; -} - -void -resize_object (Evas_Object * ob, int width, int height) -{ - evas_object_resize (ob, width, height); - return; -} - -void -init () -{ - eprog_init (); - return; -} - -void -floop () -{ - eprog_event_loop (); - return; -} - -void -onclick (Evas_Object * ob, void (*func), const void *data) -{ - evas_object_event_callback_add (ob, EVAS_CALLBACK_MOUSE_DOWN, func, - data); - return; -} - -void -addtimer (char *name, double interval, void (*func), - int initloopval /*Optional For Use */ , const void *data) -{ - ecore_add_event_timer (name, interval, func, initloopval, - (void *) data); - return; -} - -void -mousemoveforward (Ecore_Event * event) -{ - Ecore_Event_Mouse_Move *eemm; - - eemm = (Ecore_Event_Mouse_Move *) event->event; - - if (eemm->win == tmpeprog->win) - { - return; - } - - addtimer ("tmpquick", 0, tmpfunc, eemm->x, &eemm->y); - return; -} - -void -onmousemove (E_Prog * eprog, void (*func)) -{ - tmpfunc = func; - tmpeprog = eprog; - ecore_event_filter_handler_add (ECORE_EVENT_MOUSE_MOVE, - mousemoveforward); - return; -} - -/****Template for Mousemove function to be passed to onmousemove(...)****| - * - * void funcname (int *x, int *y) - * -**/ - -void -movemouseimg (Ecore_Event * event) -{ - Ecore_Event_Mouse_Move *eemm; - - eemm = (Ecore_Event_Mouse_Move *) event->event; - - if (eemm->win != tmpmouseeprog->win) - { - return; - } - - if (eemm->x < 501 && eemm->y < 501) - move_object (mouse, eemm->x, eemm->y); -} - -void -changemouse (E_Prog * eprog, char *img, int width, int height) -{ - ecore_set_blank_pointer (eprog->win); - mouse = new_image (eprog->evas, img, 4, width, height, width, height, - 0, 0); - evas_object_show (mouse); - - tmpmouseeprog = eprog; - - ecore_event_filter_handler_add (ECORE_EVENT_MOUSE_MOVE, movemouseimg); -} - - - -/* BAR CODE BEGINS HERE */ - - -void -runbar () -{ - bar = new_window (win_width, win_height); - eprog_borderless_set (bar, 1); - - eprog_move (bar, win_x, win_y); - - bar_bg = new_image (bar->evas, bgimg, 0, win_width, win_height, - win_width, win_height, 0, 0); - bar_firstbtn = - new_image (bar->evas, firstbtnimg, 1, firstbtn_width, - firstbtn_height, firstbtn_width, firstbtn_height, - firstbtn_x, firstbtn_y); - bar_lastbtn = - new_image (bar->evas, lastbtnimg, 1, lastbtn_width, - lastbtn_height, lastbtn_width, - lastbtn_height, lastbtn_x, lastbtn_y); - bar_nubtn = - new_image (bar->evas, nubtnimg, 1, nubtn_width, nubtn_height, - nubtn_width, nubtn_height, nubtn_x, nubtn_y); - bar_newbtn = - new_image (bar->evas, newbtnimg, 1, newbtn_width, - newbtn_height, newbtn_width, newbtn_height, - newbtn_x, newbtn_y); - bar_exitbtn = - new_image (bar->evas, exitbtnimg, 1, exitbtn_width, - exitbtn_height, exitbtn_width, exitbtn_height, - exitbtn_x, exitbtn_y); - - - onclick (bar_exitbtn, exit, "-1"); - onclick (bar_firstbtn, system, "enotes -o&"); - onclick (bar_lastbtn, system, "enotes -l&"); - onclick (bar_nubtn, system, "enotes --nu&"); - onclick (bar_newbtn, system, "enotes -N&"); - - - eprog_show (bar); - evas_object_show (bar_bg); - evas_object_show (bar_firstbtn); - evas_object_show (bar_lastbtn); - evas_object_show (bar_nubtn); - evas_object_show (bar_newbtn); - evas_object_show (bar_exitbtn); } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/notenum.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- notenum.c 26 Feb 2003 20:38:04 -0000 1.16 +++ notenum.c 1 Mar 2003 10:34:52 -0000 1.17 @@ -16,42 +16,7 @@ #include "main.h" -#define fade_interval 10 #define fadespeed 0.01 -#define slidespeed 0.05 - -int slidebool = 0; -int fadeval = 0; -int bar_b_backup = 100; - - -void -openwin () -{ - - root = new_window (w, h); - eprog_title_set (root, "E-Notes"); - eprog_name_class_set (root, "enotes", "Eprog"); - eprog_borderless_set (root, 1); - eprog_min_size_set (root, w, h); - eprog_max_size_set (root, w, h); - - bg = new_image (root->evas, openwinimg, 1, w, h, w, h, 0, 0); - - exitbtn = - new_image (root->evas, xbtnfn, 3, 15, 15, 15, 15, w - 15, 0); - - makebar (); - - ecore_event_filter_handler_add (ECORE_EVENT_MOUSE_MOVE, - mousemoveevent); - - onclick (exitbtn, exit, (void *) "-1"); - - eprog_show (root); - evas_object_show (bg); - evas_object_show (exitbtn); -} void fnotenum (int num) @@ -121,132 +86,6 @@ fclose (file); } -void -makebar () -{ - rectbar = new_image (root->evas, barimg, 4, 50, h, 50, h, -50, 0); - - lastbtnob = - new_image (root->evas, lastbtn, 4, 40, 40, 40, 40, -15, 10); - - firstbtnob = - new_image (root->evas, firstbtn, 4, 40, 40, 40, 40, -15, 60); - - nubtnob = new_image (root->evas, nubtn, 4, 40, 40, 40, 40, -15, 110); - - newbtnob = - new_image (root->evas, newbtn, 4, 40, 40, 40, 40, -15, 160); - - onclick (lastbtnob, system, "enotes -l&"); - onclick (firstbtnob, system, "enotes -o&"); - onclick (nubtnob, system, "enotes --nu&"); - onclick (newbtnob, system, "enotes -N&"); -} - -void -mousemoveevent (Ecore_Event * event) -{ - Ecore_Event_Mouse_Move *eemm; - - eemm = (Ecore_Event_Mouse_Move *) event->event; - - if (eemm->win != root->win) - { - return; - } - if (slidebool == 0) - { - if (eemm->x < 10 || eemm->x == 10) - { - slideout (0); - slidebool = 1; - } - return; - } - if (slidebool == 1) - { - if (eemm->x > 50) - { - slidein (50); - slidebool = 0; - } - return; - } - -} - -void -slideout (int slideloop) -{ - slideloop = slideloop + 5; - fadeval = fadeval + 25.5; - - evas_object_move (rectbar, slideloop - 50, 0); - change_alpha (rectbar, fadeval); - evas_object_show (rectbar); - evas_object_move (lastbtnob, slideloop - 47, 10); - change_alpha (lastbtnob, fadeval); - evas_object_show (lastbtnob); - evas_object_move (firstbtnob, slideloop - 47, 60); - change_alpha (firstbtnob, fadeval); - evas_object_show (firstbtnob); - evas_object_move (nubtnob, slideloop - 47, 110); - change_alpha (nubtnob, fadeval); - evas_object_show (nubtnob); - evas_object_move (newbtnob, slideloop - 47, 160); - change_alpha (newbtnob, fadeval); - evas_object_show (newbtnob); - - - if (slideloop > 49) - { - ecore_del_event_timer ("slideout"); - slideloop = 0; - return; - } - if (slideloop < 50) - { - ecore_add_event_timer ("slideout", slidespeed, - (void *) slideout, slideloop, NULL); - } -} - -void -slidein (int slideloop) -{ - slideloop = slideloop - 5; - fadeval = fadeval - 25.5; - - evas_object_move (rectbar, slideloop - 50, 0); - change_alpha (rectbar, fadeval); - evas_object_show (rectbar); - evas_object_move (lastbtnob, slideloop - 47, 10); - change_alpha (lastbtnob, fadeval); - evas_object_show (lastbtnob); - evas_object_move (firstbtnob, slideloop - 47, 60); - change_alpha (firstbtnob, fadeval); - evas_object_show (firstbtnob); - evas_object_move (nubtnob, slideloop - 47, 110); - change_alpha (nubtnob, fadeval); - evas_object_show (nubtnob); - evas_object_move (newbtnob, slideloop - 47, 160); - change_alpha (newbtnob, fadeval); - evas_object_show (newbtnob); - - - if (slideloop > 0) - { - ecore_add_event_timer ("slidein", slidespeed, - (void *) slidein, slideloop, NULL); - } - if (slideloop == 0) - { - ecore_del_event_timer ("slidein"); - slideloop = 0; - fadeval = 0; - return; - } -} void fadein (int fadeloop, char *tmpstr) =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/setdefconf.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- setdefconf.c 28 Feb 2003 20:27:41 -0000 1.1 +++ setdefconf.c 1 Mar 2003 10:34:52 -0000 1.2 @@ -1,3 +1,19 @@ +/* +----------------------------------------------------------- +| ###### # # #### ##### ###### #### | +| # ## # # # # # # | +| ##### ##### # # # # # # ##### #### | +| # # # # # # # # # | +| # # ## # # # # # # | +| ###### # # #### # ###### #### | +----------------------------------------------------------- +| E-Notes is released under: | +| The GNU General Public License (GPL) | +| | +| Owner: Thomas Fletcher | +|_________________________________________________________| +*/ + #include "main.h" =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/variables.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- variables.c 28 Feb 2003 20:27:41 -0000 1.1 +++ variables.c 1 Mar 2003 10:34:52 -0000 1.2 @@ -1,3 +1,19 @@ +/* +----------------------------------------------------------- +| ###### # # #### ##### ###### #### | +| # ## # # # # # # | +| ##### ##### # # # # # # ##### #### | +| # # # # # # # # # | +| # # ## # # # # # # | +| ###### # # #### # ###### #### | +----------------------------------------------------------- +| E-Notes is released under: | +| The GNU General Public License (GPL) | +| | +| Owner: Thomas Fletcher | +|_________________________________________________________| +*/ + #include "main.h" @@ -92,6 +108,10 @@ Evas_Object *nubtnob; Evas_Object *newbtnob; +Ewl_Widget *ewlwin; +Ewl_Widget *ewlbox; +Ewl_Widget *ewlentry; +Ewl_Widget *ewlbtn; Ewl_Widget *main_win; Ewl_Widget *main_box; Ewl_Widget *ewltitle; ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs