From c43022a9b3101b6d0eb3680799a9828d85575f64 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Wed, 10 Nov 1999 23:51:50 +0000 Subject: [PATCH] Wed Nov 10 15:49:40 PST 1999 (KainX) E-Mountbox is now size-matched with everything else, and the help/config/close buttons appear and disappear just like the other epplets. Consistency is a good thing. :-) Also, E-Xss won't show/hide the drawing area any more when it gains/loses focus. SVN revision: 1243 --- ChangeLog | 10 ++++++++++ epplets/E-Mountbox.c | 40 +++++++++++++++++++++++++++++----------- epplets/E-Mountbox.h | 4 +++- epplets/E-Xss.c | 8 ++++---- 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a4b650..59f9df0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -337,3 +337,13 @@ Wed Nov 10 14:54:28 PST 1999 removed EppletTest and EppletConfigTest from install procedure. no need for those to be automagically installed. + +------------------------------------------------------------------------------- + +Wed Nov 10 15:49:40 PST 1999 +(KainX) + +E-Mountbox is now size-matched with everything else, and the help/config/close +buttons appear and disappear just like the other epplets. Consistency is a +good thing. :-) Also, E-Xss won't show/hide the drawing area any more when +it gains/loses focus. diff --git a/epplets/E-Mountbox.c b/epplets/E-Mountbox.c index 988fabe..4ce6da7 100644 --- a/epplets/E-Mountbox.c +++ b/epplets/E-Mountbox.c @@ -655,6 +655,28 @@ CallbackExpose(void *data, Window win, int x, int y, int w, int h) win = x = y = w = h = 0; } +static void +in_cb(void *data, Window w) { + + Epplet_gadget_show(button_help); + Epplet_gadget_show(button_config); + Epplet_gadget_show(button_close); + return; + data = NULL; + w = (Window) 0; +} + +static void +out_cb(void *data, Window w) { + + Epplet_gadget_hide(button_help); + Epplet_gadget_hide(button_config); + Epplet_gadget_hide(button_close); + return; + data = NULL; + w = (Window) 0; +} + void SetupDefaults(void) @@ -677,7 +699,7 @@ SetupGraphx(void) ImlibBorder border; Tile *tile; - id = Imlib_init(Epplet_get_display()); + id = Epplet_get_imlib_data(); /* load all images, scaled appropriately */ memset(images, 0, MAXTYPE * sizeof(ImlibImage*)); @@ -799,17 +821,13 @@ SetupGraphx(void) Epplet_gadget_show((button_right = Epplet_create_button(NULL, NULL, 33, 34, 0, 0, "ARROW_RIGHT", 0, NULL, CallbackSlideRight, NULL))); - Epplet_gadget_show((button_right = Epplet_create_button(NULL, NULL, - 2, 48, 0, 0, "HELP", 0, NULL, - CallbackHelp, NULL))); - Epplet_gadget_show((button_right = Epplet_create_button(NULL, NULL, - 33, 48, 0, 0, "CLOSE", 0, NULL, - CallbackExit, NULL))); - Epplet_gadget_show((button_right = Epplet_create_button(NULL, NULL, - 17, 48, 0, 0, "CONFIGURE", 0, NULL, - CallbackConfigure, NULL))); Epplet_gadget_show((action_area = Epplet_create_drawingarea(2, 2, 44, 32))); + button_help = Epplet_create_button(NULL, NULL, 3, 3, 0, 0, "HELP", 0, NULL, CallbackHelp, NULL); + button_close = Epplet_create_button(NULL, NULL, 33, 3, 0, 0, "CLOSE", 0, NULL, CallbackExit, NULL); + button_config = Epplet_create_button(NULL, NULL, 18, 3, 0, 0, "CONFIGURE", 0, NULL, CallbackConfigure, NULL); + Epplet_register_focus_in_handler(in_cb, NULL); + Epplet_register_focus_out_handler(out_cb, NULL); Epplet_register_expose_handler(CallbackExpose, NULL); Epplet_register_button_release_handler(CallbackButtonUp, NULL); @@ -823,7 +841,7 @@ int main(int argc, char** argv) { Epplet_Init("E-Mountbox", "0.1", "Enlightenment Mount Epplet", - 3, 4, argc, argv, 0); + 3, 3, argc, argv, 0); Epplet_load_config(); SetupDefaults(); diff --git a/epplets/E-Mountbox.h b/epplets/E-Mountbox.h index 8b856b1..310cca3 100644 --- a/epplets/E-Mountbox.h +++ b/epplets/E-Mountbox.h @@ -51,7 +51,7 @@ int current_tile_index = 0; int num_tiles = 0; ImlibData *id = NULL; ImlibImage *images[5]; -Epplet_gadget action_area, button_left, button_right; +Epplet_gadget action_area, button_left, button_right, button_close, button_config, button_help; RGB_buf window_buf; RGB_buf widescreen_buf; RGB_buf widescreen_canvas_buf; @@ -77,6 +77,8 @@ void VisitMountPoints(void); MountPoint *FindMountPointByClick(int x, int y); /* callbacks/ handlers */ +static void in_cb(void *data, Window w); +static void out_cb(void *data, Window w); static void CallbackExpose(void *data, Window win, int x, int y, int w, int h); static void CallbackButtonUp(void *data, Window win, int x, int y, int b); static void CallbackExit(void *data); diff --git a/epplets/E-Xss.c b/epplets/E-Xss.c index 3291bce..c2bef56 100644 --- a/epplets/E-Xss.c +++ b/epplets/E-Xss.c @@ -123,7 +123,7 @@ play_cb(void *data) { static void in_cb(void *data, Window w) { - Epplet_gadget_hide(draw_area); + /*Epplet_gadget_hide(draw_area);*/ Epplet_gadget_show(close_button); Epplet_gadget_show(zoom_button); Epplet_gadget_show(prev_button); @@ -136,7 +136,7 @@ in_cb(void *data, Window w) { static void out_cb(void *data, Window w) { - Epplet_gadget_show(draw_area); + /*Epplet_gadget_show(draw_area);*/ Epplet_gadget_hide(close_button); Epplet_gadget_hide(zoom_button); Epplet_gadget_hide(prev_button); @@ -202,14 +202,14 @@ main(int argc, char **argv) { Epplet_load_config(); parse_config(); + draw_area = Epplet_create_drawingarea(3, 3, 43, 43); + Epplet_gadget_show(draw_area); close_button = Epplet_create_button(NULL, NULL, 3, 3, 0, 0, "CLOSE", 0, NULL, close_cb, NULL); zoom_button = Epplet_create_button(NULL, NULL, 33, 3, 0, 0, "EJECT", 0, NULL, zoom_cb, NULL); prev_button = Epplet_create_button(NULL, NULL, 3, 33, 0, 0, "PREVIOUS", 0, NULL, play_cb, (void *) (-1)); next_button = Epplet_create_button(NULL, NULL, 33, 33, 0, 0, "NEXT", 0, NULL, play_cb, (void *) (1)); Epplet_gadget_show(prev_button); Epplet_gadget_show(next_button); - draw_area = Epplet_create_drawingarea(3, 3, 43, 43); - Epplet_gadget_show(draw_area); Epplet_show(); Epplet_register_focus_in_handler(in_cb, NULL);