Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin/tests/window Modified Files: ewl_window_test.c Log Message: - add a gui test for the borderless flipping - looks like we need to unrealize/realize the window for the setting to change. currently this causes an error from evas (so, don't try to flip your borderless settings at the moment, you'll need to set it before the ewl_widget_show of the window): EVAS: compat error. viewport x,y != 0,0 not supported =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/window/ewl_window_test.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_window_test.c 20 Mar 2008 02:45:47 -0000 1.4 +++ ewl_window_test.c 20 Mar 2008 03:05:35 -0000 1.5 @@ -2,11 +2,17 @@ #include "Ewl_Test.h" #include "ewl_test_private.h" #include "ewl_window.h" +#include "ewl_button.h" #include <stdio.h> #include <string.h> #include <stdlib.h> +static int create_test(Ewl_Container *box); +static void run_window(Ewl_Widget *w, void *ev, void *data); +static void del_window_cb(Ewl_Widget *w, void *ev, void *data); +static void flip_border_cb(Ewl_Widget *w, void *ev, void *data); + static int title_set_get(char *buf, int len); static int name_set_get(char *buf, int len); static int class_set_get(char *buf, int len); @@ -49,8 +55,57 @@ test->name = "Window"; test->tip = "The window system."; test->filename = __FILE__; + test->func = create_test; test->type = EWL_TEST_TYPE_MISC; test->unit_tests = window_unit_tests; +} + +static int +create_test(Ewl_Container *box) +{ + Ewl_Widget *o; + + o = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(o), "Launch window"); + ewl_container_child_append(box, o); + ewl_callback_append(o, EWL_CALLBACK_CLICKED, run_window, NULL); + ewl_widget_show(o); + + return 1; +} + +static void +run_window(Ewl_Widget *w, void *ev, void *data) +{ + Ewl_Widget *win, *b, *o; + + win = ewl_window_new(); + ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, del_window_cb, NULL); + ewl_window_borderless_set(EWL_WINDOW(win), TRUE); + ewl_widget_show(win); + + b = ewl_hbox_new(); + ewl_container_child_append(EWL_CONTAINER(win), b); + ewl_widget_show(b); + + o = ewl_button_new(); + ewl_button_label_set(EWL_BUTTON(o), "Flip borderless"); + ewl_callback_append(o, EWL_CALLBACK_CLICKED, flip_border_cb, win); + ewl_container_child_append(EWL_CONTAINER(b), o); + ewl_widget_show(o); +} + +static void +del_window_cb(Ewl_Widget *w, void *ev, void *data) +{ + ewl_widget_destroy(w); +} + +static void +flip_border_cb(Ewl_Widget *w, void *ev, void *data) +{ + ewl_window_borderless_set(EWL_WINDOW(data), + !ewl_window_borderless_get(EWL_WINDOW(data))); } /* ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs