[Pkg-e-commits] [SCM] Enlightenment DR17 toolkit based (based on the EFL) branch, upstream-vcs, updated. 447de88121d145a078f1754a0cfebb704d363821
dj2
dj2 at alioth.debian.org
Sat Jun 7 18:34:29 UTC 2008
The following commit has been merged in the upstream-vcs branch:
commit e2f8cff2c7f7b2047be4648f456e99c20651764e
Author: dj2 <dj2>
Date: Wed May 7 13:38:14 2008 +0000
- tabs are a tricky beast. looks like I missed some.
diff --git a/src/bin/Ewl_Test.h b/src/bin/Ewl_Test.h
index a57ad20..efd0600 100644
--- a/src/bin/Ewl_Test.h
+++ b/src/bin/Ewl_Test.h
@@ -28,12 +28,12 @@ typedef struct Ewl_Unit_Test Ewl_Unit_Test;
*/
struct Ewl_Unit_Test
{
- const char *name; /**< The test name */
+ const char *name; /**< The test name */
int (*func)(char *buf, int len); /**< The test function */
- char *failure_reason; /**< Test failure reason */
- short status; /**< Test status */
- unsigned int quiet: 1; /**< Boolean to disable stderr */
+ char *failure_reason; /**< Test failure reason */
+ short status; /**< Test status */
+ unsigned int quiet: 1; /**< Boolean to disable stderr */
};
/**
@@ -46,14 +46,14 @@ typedef struct Ewl_Test Ewl_Test;
*/
struct Ewl_Test
{
- const char *name; /**< The test name */
- const char *filename; /**< Filename of the test */
- const char *tip; /**< Tooltip for the test */
+ const char *name; /**< The test name */
+ const char *filename; /**< Filename of the test */
+ const char *tip; /**< Tooltip for the test */
- Ecore_Plugin *plugin; /**< Dynamic file handle for test */
- Ewl_Test_Type type; /**< The type of test */
+ Ecore_Plugin *plugin; /**< Dynamic file handle for test */
+ Ewl_Test_Type type; /**< The type of test */
int (*func)(Ewl_Container *con); /**< The test function */
- Ewl_Unit_Test *unit_tests; /**< The test unit tests */
+ Ewl_Unit_Test *unit_tests; /**< The test unit tests */
};
#endif
diff --git a/src/bin/ewl_embed_test.c b/src/bin/ewl_embed_test.c
index aa9ac57..70191d0 100644
--- a/src/bin/ewl_embed_test.c
+++ b/src/bin/ewl_embed_test.c
@@ -60,9 +60,9 @@ insert(Ewl_Widget *w __UNUSED__, void *e __UNUSED__, void *d __UNUSED__)
t = ewl_text_text_get(EWL_TEXT(entry));
if (t) {
- ewl_text_text_append(EWL_TEXT(text), "\n");
- ewl_text_text_append(EWL_TEXT(text), t);
- ewl_text_clear(EWL_TEXT(entry));
+ ewl_text_text_append(EWL_TEXT(text), "\n");
+ ewl_text_text_append(EWL_TEXT(text), t);
+ ewl_text_clear(EWL_TEXT(entry));
}
}
@@ -100,12 +100,12 @@ main(int argc, char **argv)
edje = edje_object_add(evas);
if (!edje_object_file_set(edje,
- PACKAGE_DATA_DIR "/ewl/themes/ewl_embed_test.edj",
- "main"))
+ PACKAGE_DATA_DIR "/ewl/themes/ewl_embed_test.edj",
+ "main"))
{
- fprintf(stderr, "Error in: %s\n",
- PACKAGE_DATA_DIR "/ewl/themes/ewl_embed_test.edj");
- return 1;
+ fprintf(stderr, "Error in: %s\n",
+ PACKAGE_DATA_DIR "/ewl/themes/ewl_embed_test.edj");
+ return 1;
}
evas_object_move(edje, 0, 0);
@@ -118,7 +118,7 @@ main(int argc, char **argv)
emb = ewl_embed_new();
ewl_object_fill_policy_set(EWL_OBJECT(emb), EWL_FLAG_FILL_ALL);
eo = ewl_embed_canvas_set(EWL_EMBED(emb), evas,
- (void *) ecore_evas_software_x11_window_get(ee));
+ (void *) ecore_evas_software_x11_window_get(ee));
ewl_embed_focus_set(EWL_EMBED(emb), TRUE);
ewl_widget_show(emb);
@@ -146,17 +146,17 @@ main(int argc, char **argv)
text = ewl_text_new();
ewl_container_child_append(EWL_CONTAINER(wg), text);
ewl_text_text_append(EWL_TEXT(text),
- "You can use EWL in side a evas/edje only app.\n"
- "It can actually behave like a normal evas object\n"
- "So forget to figure out how to write an entry object,\n"
- "simply use the ewl widget! :)\n\n");
+ "You can use EWL in side a evas/edje only app.\n"
+ "It can actually behave like a normal evas object\n"
+ "So forget to figure out how to write an entry object,\n"
+ "simply use the ewl widget! :)\n\n");
ewl_object_fill_policy_set(EWL_OBJECT(text), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_VFILL);
+ EWL_FLAG_FILL_VFILL);
ewl_widget_show(text);
c = ewl_hbox_new();
ewl_object_fill_policy_set(EWL_OBJECT(c), EWL_FLAG_FILL_NONE |
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
ewl_container_child_append(EWL_CONTAINER(vbox), c);
ewl_widget_show(c);
@@ -180,7 +180,7 @@ main(int argc, char **argv)
emb = ewl_embed_new();
ewl_object_fill_policy_set(EWL_OBJECT(emb), EWL_FLAG_FILL_ALL);
eo = ewl_embed_canvas_set(EWL_EMBED(emb), evas,
- (void *) ecore_evas_software_x11_window_get(ee));
+ (void *) ecore_evas_software_x11_window_get(ee));
ewl_widget_show(emb);
/*
@@ -194,7 +194,7 @@ main(int argc, char **argv)
c = ewl_hbox_new();
ewl_object_fill_policy_set(EWL_OBJECT(c), EWL_FLAG_FILL_NONE |
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
ewl_container_child_append(EWL_CONTAINER(emb), c);
ewl_widget_show(c);
@@ -221,7 +221,7 @@ main(int argc, char **argv)
emb = ewl_embed_new();
ewl_object_fill_policy_set(EWL_OBJECT(emb), EWL_FLAG_FILL_ALL);
eo = ewl_embed_canvas_set(EWL_EMBED(emb), evas,
- (void *) ecore_evas_software_x11_window_get(ee));
+ (void *) ecore_evas_software_x11_window_get(ee));
ewl_embed_focus_set(EWL_EMBED(emb), TRUE);
ewl_widget_show(emb);
diff --git a/src/bin/ewl_simple_test.c b/src/bin/ewl_simple_test.c
index e5a636c..5300692 100644
--- a/src/bin/ewl_simple_test.c
+++ b/src/bin/ewl_simple_test.c
@@ -19,7 +19,7 @@
static void
edje_text(void *data, Evas_Object *obj __UNUSED__,
- const char *emission, const char *source)
+ const char *emission, const char *source)
{
char *buf;
char *text;
@@ -27,7 +27,7 @@ edje_text(void *data, Evas_Object *obj __UNUSED__,
Ewl_Widget *label = data;
if (strstr(emission, "Present") != emission)
- return;
+ return;
text = (char *)emission + strlen("Present");
len = strlen(text);
@@ -52,7 +52,7 @@ edje_text(void *data, Evas_Object *obj __UNUSED__,
static void
start_text(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Widget *label = user_data;
@@ -65,7 +65,7 @@ start_text(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
ewl_text_font_set(EWL_TEXT(label), "ewl/default");
ewl_text_font_size_set(EWL_TEXT(label), 7);
ewl_text_text_append(EWL_TEXT(label), "We hope you enjoy your stay.\n"
- "Please visit us at:\n");
+ "Please visit us at:\n");
ewl_text_color_set(EWL_TEXT(label), 0, 0, 255, 190);
ewl_text_text_append(EWL_TEXT(label), "http://www.enlightenment.org/");
ewl_text_color_set(EWL_TEXT(label), 0, 0, 0, 255);
@@ -75,27 +75,27 @@ static void
reveal_logo_cb(Ewl_Widget *w, void *ev_data __UNUSED__, void *user_data)
{
edje_object_signal_callback_add(w->theme_object, "Present*", "*",
- edje_text, user_data);
+ edje_text, user_data);
}
static void
obscure_logo_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
edje_object_signal_callback_del(w->theme_object, "Present*", "*",
- edje_text);
+ edje_text);
}
static void
close_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
ewl_main_quit();
}
static void
button_down(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Widget *logo = user_data;
ewl_widget_state_set(logo, "start_tour", EWL_STATE_PERSISTENT);
@@ -105,7 +105,7 @@ button_down(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
static void
quit_demo(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
ewl_main_quit();
}
diff --git a/src/bin/main.c b/src/bin/main.c
index 7e0f8a2..494e909 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -36,26 +36,26 @@
static Ewl_Model *expansion_model = NULL;
static char *ewl_test_about_body =
- "The EWL Test application serves two purposes. "
- "The first is to allow us to test the different "
- "components of EWL as we develop them.\n\n"
- "The second is to allow deveopers to view "
- "tutorials and source listings for the different "
- "widgets in the system.\n\n"
- "If you develop your own EWL widget you can add "
- "a test to the test widget without needing to "
- "recompile or edit the test application.";
+ "The EWL Test application serves two purposes. "
+ "The first is to allow us to test the different "
+ "components of EWL as we develop them.\n\n"
+ "The second is to allow deveopers to view "
+ "tutorials and source listings for the different "
+ "widgets in the system.\n\n"
+ "If you develop your own EWL widget you can add "
+ "a test to the test widget without needing to "
+ "recompile or edit the test application.";
static char *ewl_test_help_body =
- "Select the test you want from the test tree under the "
- "'Tests' tab. You can then use the 'UI Tests' tab "
- "to view the UI test for that widget. The 'Unit Tests' "
- "tab will let you execute the available unit tests.\n\n"
- "To view the source for the current test click on the "
- "'Source' tab. A short tutorial on the widget will be "
- "available under the 'Tutorial' tab.\n\n"
- "If you encounter any bugs in the test application "
- "please report them to http://bugs.enlightenment.org.";
+ "Select the test you want from the test tree under the "
+ "'Tests' tab. You can then use the 'UI Tests' tab "
+ "to view the UI test for that widget. The 'Unit Tests' "
+ "tab will let you execute the available unit tests.\n\n"
+ "To view the source for the current test click on the "
+ "'Source' tab. A short tutorial on the widget will be "
+ "available under the 'Tutorial' tab.\n\n"
+ "If you encounter any bugs in the test application "
+ "please report them to http://bugs.enlightenment.org.";
static int ewl_test_setup_tests(void);
static void ewl_test_free(Ewl_Test *test);
@@ -88,13 +88,13 @@ static void ewl_test_cb_help(Ewl_Widget *w, void *ev, void *data);
static void ewl_test_cb_about(Ewl_Widget *w, void *ev, void *data);
static void *ewl_test_cb_category_fetch(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
static int ewl_test_cb_category_expandable(void *data, unsigned int row);
static void *ewl_test_cb_category_expansion_fetch(void *data, unsigned int row);
static Ewl_Model *ewl_test_cb_category_expansion_model_fetch(void *data,
- unsigned int row);
+ unsigned int row);
static void *ewl_test_cb_expansion_fetch(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
static void ewl_test_cb_test_selected(Ewl_Widget *w, void *ev, void *data);
static Ewl_Widget *cb_unit_test_header_fetch(void *data, unsigned int column);
@@ -129,52 +129,52 @@ main(int argc, char **argv)
/* check for any flags before ewl_init to avoid opening the display */
for (i = 0; i < argc; i++)
{
- if (!strncmp(argv[i], "-list", 5))
- {
- ewl_test_print_tests();
- exit(0);
- }
- else if (!strncmp(argv[i], "-h", 2) ||
- !strncmp(argv[i], "-help", 5) ||
- !strncmp(argv[i], "--help", 6))
- {
- printf("Usage: %s [options] [test name]\n"
- "\t-all\tRun tests for all widgets\n"
- "\t-help\tDisplay this help text\n"
- "\t-list\tPrint available tests\n"
- "\t-profile\tTime test results\n"
- "\t-p\tHide passed test information\n"
- "\t-d\tEnable all debugging output\n"
- "\t-unit\tRun unit tests\n",
- argv[0]);
- exit(0);
- }
- else if (!strncmp(argv[i], "-profile", 8))
- profile_tests = 1;
- else if (!strncmp(argv[i], "-p", 2))
- hide_passed = 1;
- else if (!strncmp(argv[i], "-d", 2))
- show_debug = 1;
- else if (!strncmp(argv[i], "-all", 4))
- all_tests = 1;
- else if (!strncmp(argv[i], "-unit", 5))
- {
- unit_test = 1;
- setenv("EWL_ENGINE_NAME", "evas_buffer", 1);
- }
+ if (!strncmp(argv[i], "-list", 5))
+ {
+ ewl_test_print_tests();
+ exit(0);
+ }
+ else if (!strncmp(argv[i], "-h", 2) ||
+ !strncmp(argv[i], "-help", 5) ||
+ !strncmp(argv[i], "--help", 6))
+ {
+ printf("Usage: %s [options] [test name]\n"
+ "\t-all\tRun tests for all widgets\n"
+ "\t-help\tDisplay this help text\n"
+ "\t-list\tPrint available tests\n"
+ "\t-profile\tTime test results\n"
+ "\t-p\tHide passed test information\n"
+ "\t-d\tEnable all debugging output\n"
+ "\t-unit\tRun unit tests\n",
+ argv[0]);
+ exit(0);
+ }
+ else if (!strncmp(argv[i], "-profile", 8))
+ profile_tests = 1;
+ else if (!strncmp(argv[i], "-p", 2))
+ hide_passed = 1;
+ else if (!strncmp(argv[i], "-d", 2))
+ show_debug = 1;
+ else if (!strncmp(argv[i], "-all", 4))
+ all_tests = 1;
+ else if (!strncmp(argv[i], "-unit", 5))
+ {
+ unit_test = 1;
+ setenv("EWL_ENGINE_NAME", "evas_buffer", 1);
+ }
}
/* initialize the ewl library */
if (!ewl_init(&argc, argv))
{
- printf("Unable to init Ewl.\n");
- return 1;
+ printf("Unable to init Ewl.\n");
+ return 1;
}
if (!ewl_test_setup_tests())
{
- printf("Unable to setup tests.\n");
- return 1;
+ printf("Unable to setup tests.\n");
+ return 1;
}
if (profile_tests) start_time = ecore_time_get();
@@ -182,53 +182,53 @@ main(int argc, char **argv)
/* check for any flags */
for (i = 0; i < argc || all_tests; i++)
{
- Ewl_Test *t;
-
- /* see if this thing was a test to run */
- ecore_list_first_goto(tests);
- while ((t = ecore_list_next(tests)))
- {
- if (all_tests || !strcasecmp(argv[i], t->name))
- {
- if (unit_test)
- ret = run_unit_tests(t);
- else
- run_window_test(t, MAIN_WIDTH, MAIN_HEIGHT);
-
- ran_test ++;
- if (!all_tests) break;
- }
- }
- if (all_tests) break;
+ Ewl_Test *t;
+
+ /* see if this thing was a test to run */
+ ecore_list_first_goto(tests);
+ while ((t = ecore_list_next(tests)))
+ {
+ if (all_tests || !strcasecmp(argv[i], t->name))
+ {
+ if (unit_test)
+ ret = run_unit_tests(t);
+ else
+ run_window_test(t, MAIN_WIDTH, MAIN_HEIGHT);
+
+ ran_test ++;
+ if (!all_tests) break;
+ }
+ }
+ if (all_tests) break;
}
if (profile_tests)
{
- end_time = ecore_time_get();
- printf("Tests completed in %.03fs\n", end_time - start_time);
+ end_time = ecore_time_get();
+ printf("Tests completed in %.03fs\n", end_time - start_time);
}
/* no passed in tests, run the main test app */
if (!ran_test)
{
- Ewl_Test test;
+ Ewl_Test test;
- test.name = "The Enlightened Widget Library Test App";
- test.func = create_main_test_window;
- test.filename = NULL;
- test.tip = NULL;
+ test.name = "The Enlightened Widget Library Test App";
+ test.func = create_main_test_window;
+ test.filename = NULL;
+ test.tip = NULL;
- run_window_test(&test, MAIN_WIDTH, MAIN_HEIGHT);
+ run_window_test(&test, MAIN_WIDTH, MAIN_HEIGHT);
}
if (!unit_test)
- ewl_main();
+ ewl_main();
else
- ewl_shutdown();
+ ewl_shutdown();
if (unit_test && !ran_test)
- fprintf(stderr, "Must supply either -all parameter or test "
- "name when running unit tests.\n");
+ fprintf(stderr, "Must supply either -all parameter or test "
+ "name when running unit tests.\n");
if (tests) ecore_list_destroy(tests);
if (tests_path_group) ecore_path_group_del(tests_path_group);
@@ -245,24 +245,24 @@ ewl_test_stderr_disable(void)
* If stderr is already disabled, bail out early.
*/
if (show_debug || saved_stderr >= 0)
- return;
+ return;
/*
* Open /dev/null the first time it's necessary, and maintain a
* reference to it for the lifetime of the test app.
*/
if (null_fd < 0)
- null_fd = open(NULL_PATH, O_RDONLY);
+ null_fd = open(NULL_PATH, O_RDONLY);
if (null_fd >= 0)
{
- saved_stderr = dup(fileno(stderr));
+ saved_stderr = dup(fileno(stderr));
- if (dup2(null_fd, fileno(stderr)) < 0)
- {
- close(saved_stderr);
- saved_stderr = -1;
- }
+ if (dup2(null_fd, fileno(stderr)) < 0)
+ {
+ close(saved_stderr);
+ saved_stderr = -1;
+ }
}
}
@@ -273,7 +273,7 @@ ewl_test_stderr_enable(void)
* Return early if stderr is not disabled.
*/
if (show_debug || saved_stderr < 0)
- return;
+ return;
dup2(saved_stderr, fileno(stderr));
saved_stderr = -1;
@@ -289,35 +289,35 @@ ewl_test_cb_unit_test_timer(void *data)
unit_tests = data;
if (unit_tests[current_unit_test].func)
{
- int val;
- Ewl_Widget *tree, *progress, *stat;
+ int val;
+ Ewl_Widget *tree, *progress, *stat;
- stat = ewl_widget_name_find("statusbar");
- ewl_statusbar_push(EWL_STATUSBAR(stat),
- (char *)unit_tests[current_unit_test].name);
- if (unit_tests[current_unit_test].quiet)
- ewl_test_stderr_disable();
- val = unit_tests[current_unit_test].func(buf, sizeof(buf));
- if (unit_tests[current_unit_test].quiet)
- ewl_test_stderr_enable();
- ewl_statusbar_pop(EWL_STATUSBAR(stat));
+ stat = ewl_widget_name_find("statusbar");
+ ewl_statusbar_push(EWL_STATUSBAR(stat),
+ (char *)unit_tests[current_unit_test].name);
+ if (unit_tests[current_unit_test].quiet)
+ ewl_test_stderr_disable();
+ val = unit_tests[current_unit_test].func(buf, sizeof(buf));
+ if (unit_tests[current_unit_test].quiet)
+ ewl_test_stderr_enable();
+ ewl_statusbar_pop(EWL_STATUSBAR(stat));
- tree = ewl_widget_name_find("unit_test_tree");
- progress = ewl_widget_name_find("unit_test_progress");
+ tree = ewl_widget_name_find("unit_test_tree");
+ progress = ewl_widget_name_find("unit_test_progress");
- unit_tests[current_unit_test].status = val;
- unit_tests[current_unit_test].failure_reason = (val ? NULL : strdup(buf));
+ unit_tests[current_unit_test].status = val;
+ unit_tests[current_unit_test].failure_reason = (val ? NULL : strdup(buf));
- ewl_mvc_dirty_set(EWL_MVC(tree), TRUE);
+ ewl_mvc_dirty_set(EWL_MVC(tree), TRUE);
- ewl_range_value_set(EWL_RANGE(progress),
- (double)(++current_unit_test));
+ ewl_range_value_set(EWL_RANGE(progress),
+ (double)(++current_unit_test));
}
else
{
- unit_test_timer = NULL;
- current_unit_test = 0;
- ret = 0;
+ unit_test_timer = NULL;
+ current_unit_test = 0;
+ ret = 0;
}
return ret;
@@ -325,17 +325,17 @@ ewl_test_cb_unit_test_timer(void *data)
static void
ewl_test_cb_delete_window(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_widget_destroy(w);
if ((--window_count) < 1)
- ewl_main_quit();
+ ewl_main_quit();
}
static void
ewl_test_cb_exit(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_main_quit();
}
@@ -348,7 +348,7 @@ ewl_test_print_tests(void)
printf("Ewl_Test Test List:\n");
ecore_list_first_goto(tests);
while ((t = ecore_list_next(tests)))
- printf(" %s\n", t->name);
+ printf(" %s\n", t->name);
}
static void
@@ -364,9 +364,9 @@ run_window_test(Ewl_Test *test, int width, int height)
ewl_window_name_set(EWL_WINDOW(win), test->name);
ewl_window_class_set(EWL_WINDOW(win), "Ewl Test Window");
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
- ewl_test_cb_delete_window, NULL);
+ ewl_test_cb_delete_window, NULL);
if ((width > 0) && (height > 0))
- ewl_object_size_request(EWL_OBJECT(win), width, height);
+ ewl_object_size_request(EWL_OBJECT(win), width, height);
ewl_widget_show(win);
@@ -391,24 +391,24 @@ run_unit_tests(Ewl_Test *test)
for (i = 0; test->unit_tests[i].func; i++)
{
- int ret;
+ int ret;
- if (test->unit_tests[i].quiet)
- ewl_test_stderr_disable();
+ if (test->unit_tests[i].quiet)
+ ewl_test_stderr_disable();
- ret = test->unit_tests[i].func(buf, sizeof(buf));
- if (!ret || !hide_passed)
- {
- printf("Running %s: ", test->unit_tests[i].name);
- printf("%s %s\n", (ret ? "PASSED" : "FAILED"),
- (ret ? "" : buf));
- }
- buf[0] = '\0';
+ ret = test->unit_tests[i].func(buf, sizeof(buf));
+ if (!ret || !hide_passed)
+ {
+ printf("Running %s: ", test->unit_tests[i].name);
+ printf("%s %s\n", (ret ? "PASSED" : "FAILED"),
+ (ret ? "" : buf));
+ }
+ buf[0] = '\0';
- if (!ret) failures++;
+ if (!ret) failures++;
- if (test->unit_tests[i].quiet)
- ewl_test_stderr_enable();
+ if (test->unit_tests[i].quiet)
+ ewl_test_stderr_enable();
}
return failures;
@@ -459,9 +459,9 @@ run_test_boxed(Ewl_Test *t)
/* make sure we have a function if we aren't a straight unit test */
if ((t->type != EWL_TEST_TYPE_UNIT) && (!t->func))
{
- printf("WARNING: No UI test function defined for (%s).\n",
- t->name);
- return;
+ printf("WARNING: No UI test function defined for (%s).\n",
+ t->name);
+ return;
}
c = ewl_widget_name_find("execute_box");
@@ -495,27 +495,27 @@ ewl_test_setup_tests(void)
while ((name = ecore_list_first_goto(list)))
{
- Ecore_Plugin *plugin;
- void (*func_info)(Ewl_Test *test);
+ Ecore_Plugin *plugin;
+ void (*func_info)(Ewl_Test *test);
- plugin = ecore_plugin_load(tests_path_group, name, NULL);
- if (!plugin)
- continue;
+ plugin = ecore_plugin_load(tests_path_group, name, NULL);
+ if (!plugin)
+ continue;
- /* the UI test info */
- func_info = ecore_plugin_symbol_get(plugin, "test_info");
- if (func_info)
- {
- Ewl_Test *t;
+ /* the UI test info */
+ func_info = ecore_plugin_symbol_get(plugin, "test_info");
+ if (func_info)
+ {
+ Ewl_Test *t;
- t = calloc(1, sizeof(Ewl_Test));
- func_info(t);
- t->plugin = plugin;
- ecore_list_append(tests, t);
- }
+ t = calloc(1, sizeof(Ewl_Test));
+ func_info(t);
+ t->plugin = plugin;
+ ecore_list_append(tests, t);
+ }
- ecore_list_remove_destroy(list);
+ ecore_list_remove_destroy(list);
}
ecore_list_destroy(list);
@@ -524,7 +524,7 @@ ewl_test_setup_tests(void)
/* sort the tests in alphabetical order */
ecore_list_sort(tests, ECORE_COMPARE_CB(ewl_test_compare),
- ECORE_SORT_MIN);
+ ECORE_SORT_MIN);
return 1;
}
@@ -553,28 +553,28 @@ create_main_test_window(Ewl_Container *box)
Ewl_View *view;
Ewl_Menu_Info file_menu[] = {
- {"Exit", NULL, ewl_test_cb_exit},
- {NULL, NULL, NULL}
+ {"Exit", NULL, ewl_test_cb_exit},
+ {NULL, NULL, NULL}
};
Ewl_Menu_Info help_menu[] = {
- {"About Ewl_Test ...", NULL, ewl_test_cb_about},
- {"Ewl Test Help ...", NULL, ewl_test_cb_help},
- {NULL, NULL, NULL}
+ {"About Ewl_Test ...", NULL, ewl_test_cb_about},
+ {"Ewl Test Help ...", NULL, ewl_test_cb_help},
+ {NULL, NULL, NULL}
};
Ewl_Menubar_Info menubar_info[] = {
- {"File", file_menu},
- {"Help", help_menu},
- {NULL, NULL}
+ {"File", file_menu},
+ {"Help", help_menu},
+ {NULL, NULL}
};
file_menu[0].img = ewl_icon_theme_icon_path_get(EWL_ICON_APPLICATION_EXIT,
- EWL_ICON_SIZE_SMALL);
+ EWL_ICON_SIZE_SMALL);
help_menu[0].img = ewl_icon_theme_icon_path_get(EWL_ICON_HELP_ABOUT,
- EWL_ICON_SIZE_SMALL);
+ EWL_ICON_SIZE_SMALL);
help_menu[1].img = ewl_icon_theme_icon_path_get(EWL_ICON_HELP_FAQ,
- EWL_ICON_SIZE_SMALL);
+ EWL_ICON_SIZE_SMALL);
menubar = ewl_hmenubar_new();
ewl_container_child_append(EWL_CONTAINER(box), menubar);
@@ -585,7 +585,7 @@ create_main_test_window(Ewl_Container *box)
ewl_container_child_append(box, note);
ewl_widget_name_set(note, "test_notebook");
ewl_notebook_tabbar_alignment_set(EWL_NOTEBOOK(note),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_widget_show(note);
/* our data will be a list of lists. each of the child lists will
@@ -613,11 +613,11 @@ create_main_test_window(Ewl_Container *box)
ewl_model_data_count_set(model, ewl_model_cb_ecore_list_count);
ewl_model_data_expandable_set(model, ewl_test_cb_category_expandable);
ewl_model_data_unref_set(model,
- EWL_MODEL_DATA_UNREF(ecore_list_destroy));
+ EWL_MODEL_DATA_UNREF(ecore_list_destroy));
ewl_model_expansion_data_fetch_set(model,
- ewl_test_cb_category_expansion_fetch);
+ ewl_test_cb_category_expansion_fetch);
ewl_model_expansion_model_fetch_set(model,
- ewl_test_cb_category_expansion_model_fetch);
+ ewl_test_cb_category_expansion_model_fetch);
tree = ewl_tree_new();
ewl_container_child_append(EWL_CONTAINER(note), tree);
@@ -629,9 +629,9 @@ create_main_test_window(Ewl_Container *box)
ewl_mvc_view_set(EWL_MVC(tree), ewl_label_view_get());
ewl_mvc_data_set(EWL_MVC(tree), categories);
ewl_callback_append(tree, EWL_CALLBACK_VALUE_CHANGED,
- ewl_test_cb_test_selected, NULL);
+ ewl_test_cb_test_selected, NULL);
ewl_callback_append(tree, EWL_CALLBACK_DESTROY, ewl_cb_mvc_free,
- NULL);
+ NULL);
ewl_widget_show(tree);
@@ -639,25 +639,25 @@ create_main_test_window(Ewl_Container *box)
ecore_list_first_goto(tests);
while ((t = ecore_list_next(tests)))
{
- Ecore_List *parent = NULL;
-
- if (t->type == EWL_TEST_TYPE_SIMPLE)
- parent = simple;
- else if (t->type == EWL_TEST_TYPE_ADVANCED)
- parent = adv;
- else if (t->type == EWL_TEST_TYPE_CONTAINER)
- parent = container;
- else if (t->type == EWL_TEST_TYPE_MISC)
- parent = misc;
- else if (t->type == EWL_TEST_TYPE_UNIT)
- parent = unit;
-
- ecore_list_append(parent, t);
-
- /* if we've got unit tests add to the unit category */
- if ((parent != unit) &&
- (t->unit_tests && t->unit_tests[0].func))
- ecore_list_append(unit, t);
+ Ecore_List *parent = NULL;
+
+ if (t->type == EWL_TEST_TYPE_SIMPLE)
+ parent = simple;
+ else if (t->type == EWL_TEST_TYPE_ADVANCED)
+ parent = adv;
+ else if (t->type == EWL_TEST_TYPE_CONTAINER)
+ parent = container;
+ else if (t->type == EWL_TEST_TYPE_MISC)
+ parent = misc;
+ else if (t->type == EWL_TEST_TYPE_UNIT)
+ parent = unit;
+
+ ecore_list_append(parent, t);
+
+ /* if we've got unit tests add to the unit category */
+ if ((parent != unit) &&
+ (t->unit_tests && t->unit_tests[0].func))
+ ecore_list_append(unit, t);
}
o = ewl_vbox_new();
@@ -688,7 +688,7 @@ create_main_test_window(Ewl_Container *box)
ewl_mvc_view_set(EWL_MVC(o2), view);
ewl_widget_name_set(o2, "unit_test_tree");
ewl_callback_append(o2, EWL_CALLBACK_DESTROY, ewl_cb_mvc_free,
- NULL);
+ NULL);
ewl_widget_show(o2);
o2 = ewl_hbox_new();
@@ -740,7 +740,7 @@ create_main_test_window(Ewl_Container *box)
o2 = ewl_label_new();
ewl_container_child_append(EWL_CONTAINER(o), o2);
ewl_callback_append(EWL_WIDGET(box), EWL_CALLBACK_MOUSE_MOVE,
- statusbar_label_update, o2);
+ statusbar_label_update, o2);
ewl_widget_show(o2);
return 1;
@@ -765,7 +765,7 @@ fill_source_text(Ewl_Test *test)
char filename[PATH_MAX];
snprintf(filename, sizeof(filename),
- PACKAGE_DATA_DIR "/ewl/examples/%s", test->filename);
+ PACKAGE_DATA_DIR "/ewl/examples/%s", test->filename);
txt = read_file(filename);
text_parse(txt);
@@ -783,7 +783,7 @@ fill_tutorial_text(Ewl_Test *test)
if ((p != NULL) && (*p != '\0')) *p = '\0';
snprintf(filename, sizeof(filename),
- PACKAGE_DATA_DIR "/ewl/tutorials/%s.dox", file);
+ PACKAGE_DATA_DIR "/ewl/tutorials/%s.dox", file);
txt = read_file(filename);
tutorial_parse(txt);
@@ -798,52 +798,52 @@ read_file(const char *filename)
if (ecore_file_exists(filename))
{
- FILE *file;
+ FILE *file;
- file = fopen(filename, "r");
- if (!file) return NULL;
+ file = fopen(filename, "r");
+ if (!file) return NULL;
- stat(filename, &buf);
+ stat(filename, &buf);
- str = malloc(sizeof(char) * (buf.st_size + 1));
- fread(str, buf.st_size, 1, file);
- str[buf.st_size] = '\0';
- fclose(file);
+ str = malloc(sizeof(char) * (buf.st_size + 1));
+ fread(str, buf.st_size, 1, file);
+ str[buf.st_size] = '\0';
+ fclose(file);
}
else
{
- gzFile file;
- unsigned int size, step, len = 0;
- char path[PATH_MAX];
- int ret;
-
- /* let see if a compressed version exists */
- snprintf(path, sizeof(path), "%s.gz", filename);
- if (!ecore_file_exists(path)) return NULL;
-
- file = gzopen(path, "rb");
- if (!file) return NULL;
-
- stat(filename, &buf);
-
- step = buf.st_size;
- size = step * 4;
- str = malloc(sizeof(char) * (size + 1));
- while ((ret = gzread(file, str + (size - 4 * step), step)))
- {
- if (ret < 0)
- {
- fprintf(stderr, "Could not open gzipped file\n");
- gzclose(file);
- free(str);
- return NULL;
- }
- size += step;
- str = realloc(str, sizeof(char) * (size + 1));
- len += ret;
- }
- str[len] = '\0';
- gzclose(file);
+ gzFile file;
+ unsigned int size, step, len = 0;
+ char path[PATH_MAX];
+ int ret;
+
+ /* let see if a compressed version exists */
+ snprintf(path, sizeof(path), "%s.gz", filename);
+ if (!ecore_file_exists(path)) return NULL;
+
+ file = gzopen(path, "rb");
+ if (!file) return NULL;
+
+ stat(filename, &buf);
+
+ step = buf.st_size;
+ size = step * 4;
+ str = malloc(sizeof(char) * (size + 1));
+ while ((ret = gzread(file, str + (size - 4 * step), step)))
+ {
+ if (ret < 0)
+ {
+ fprintf(stderr, "Could not open gzipped file\n");
+ gzclose(file);
+ free(str);
+ return NULL;
+ }
+ size += step;
+ str = realloc(str, sizeof(char) * (size + 1));
+ len += ret;
+ }
+ str[len] = '\0';
+ gzclose(file);
}
return str;
}
@@ -866,11 +866,11 @@ setup_unit_tests(Ewl_Test *test)
ewl_mvc_data_set(EWL_MVC(tree), current_test);
for (i = 0; test->unit_tests[i].func; i++)
{
- if (test->unit_tests[i].failure_reason)
- free(test->unit_tests[i].failure_reason);
- test->unit_tests[i].failure_reason = NULL;
+ if (test->unit_tests[i].failure_reason)
+ free(test->unit_tests[i].failure_reason);
+ test->unit_tests[i].failure_reason = NULL;
- test->unit_tests[i].status = -1;
+ test->unit_tests[i].status = -1;
}
ewl_mvc_dirty_set(EWL_MVC(tree), TRUE);
@@ -882,7 +882,7 @@ setup_unit_tests(Ewl_Test *test)
static void
cb_run_unit_tests(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
int i;
Ewl_Test *test;
@@ -894,7 +894,7 @@ cb_run_unit_tests(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
if ((!test) || (!test->unit_tests)) return;
for (i = 0; test->unit_tests[i].func; i++)
- ;
+ ;
progress = ewl_widget_name_find("unit_test_progress");
ewl_range_maximum_value_set(EWL_RANGE(progress), (double)(i));
@@ -902,13 +902,13 @@ cb_run_unit_tests(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
if (unit_test_timer)
{
- ecore_timer_del(unit_test_timer);
- unit_test_timer = NULL;
- current_unit_test = 0;
+ ecore_timer_del(unit_test_timer);
+ unit_test_timer = NULL;
+ current_unit_test = 0;
}
unit_test_timer = ecore_timer_add(0.1, ewl_test_cb_unit_test_timer,
- test->unit_tests);
+ test->unit_tests);
}
static void
@@ -925,10 +925,10 @@ text_parse(char *str)
txt = ewl_io_manager_string_read(str, "text/c");
if (txt)
{
- ewl_text_wrap_set(EWL_TEXT(txt), EWL_TEXT_WRAP_WORD);
- ewl_text_selectable_set(EWL_TEXT(txt), TRUE);
- ewl_widget_show(txt);
- ewl_container_child_append(EWL_CONTAINER(txtpane), txt);
+ ewl_text_wrap_set(EWL_TEXT(txt), EWL_TEXT_WRAP_WORD);
+ ewl_text_selectable_set(EWL_TEXT(txt), TRUE);
+ ewl_widget_show(txt);
+ ewl_container_child_append(EWL_CONTAINER(txtpane), txt);
}
}
@@ -953,198 +953,198 @@ tutorial_parse(char *str)
while (start && (*start != '\0'))
{
- int did_newline = 0;
-
- /* we strip out newlines so the text will wrap nicely */
- if (*end == '\n')
- {
- /* we just handled a \n and got a second one so this is a new
- * paragraph so actually insert the two \n's */
- if (handled_newline)
- {
- if (in_codeblock || not_double)
- ewl_text_text_append(tutorial, "\n");
- else
- ewl_text_text_append(tutorial, "\n\n");
- }
-
- /* append the text before and skip the newline */
- else
- {
- char tmp;
-
- tmp = *(end + 1);
- *(end + 1) = '\0';
-
- if (!in_codeblock)
- *end = ' ';
-
- ewl_text_text_append(tutorial, start);
-
- *(end + 1) = tmp;
- }
- start = ++end;
- did_newline = 1;
- not_double = 0;
- }
-
- /* The * is only special after a newline character */
- else if ((*end == '*' || *end == ' ' || *end == '/') && handled_newline)
- {
- if (*end == ' ') end++;
- while (*end == '*') end++;
-
- /* we only want to skip "* " if in a code block */
- if (in_codeblock)
- {
- if (*end == ' ') end ++;
- }
- /* otherwise skip the * and all spaces */
- else
- {
- while ((*end == '*') || (*end == ' ') ||
- (*end == '/') || (*end == '\t'))
- end++;
- }
-
- if (*end == '\n')
- /* don't let the *'s at the begining of lines effect the \n
- * handling */
- did_newline = handled_newline;
-
- start = end;
- }
- else if (*end == '@')
- {
- /* stick on everything before the @ symbol. If we don't have a
- * keyword here we'll just end up sticking the next chunk onto
- * this node so shouldn't be a big deal */
- *end = '\0';
-
- ewl_text_text_append(tutorial, start);
- *end = '@';
- start = end;
-
- if ((!strncasecmp(end, "@addtogroup ", 12))
- || (!strncasecmp(end, "@section ", 9)))
- {
- char tmp, key;
- int size = 14;
-
- key = *(end + 1);
- end += 9;
-
- /* we increment end so that we can skip over the keyword and
- * the space after it */
- if (key == 'a')
- {
- size = 22;
- end += 3;
- }
-
- while (*end == ' ') end ++;
- start = end;
-
- /* skip to the end of the line */
- end = strchr(end, '\n');
-
- /* if this is the section header we need to skip
- * the section name */
- if (key == 's')
- {
- while (!isspace(*start)) start ++;
- while (*start == ' ') start ++;
- }
-
- not_double = 1;
-
- tmp = *(end + 1);
- *(end + 1) = '\0';
-
- ewl_text_font_size_set(tutorial, size);
- ewl_text_text_append(tutorial, start);
- ewl_text_font_size_set(tutorial, 12);
-
- *(end + 1) = tmp;
- start = ++end;
-
- did_newline = 1;
- }
- else if (!strncasecmp(end, "@code", 5))
- {
- in_codeblock = 1;
- end += 5;
- while (*end == ' ') end ++;
-
- /* if there is nothing after the @code we want to skip the
- * \n or we'll end up with too much space before the block */
- if (*end == '\n')
- {
- end ++;
- did_newline = 1;
- }
-
- ewl_text_color_set(tutorial, 32, 71, 109, 255);
- ewl_text_font_set(tutorial, "ewl/monospace");
- start = end;
- }
- else if (!strncasecmp(end, "@endcode", 8))
- {
- *end = '\0';
-
- ewl_text_text_append(tutorial, start);
- ewl_text_color_set(tutorial, 0, 0, 0, 255);
- in_codeblock = 0;
-
- end += 8;
- while (*end == ' ') end ++;
-
- /* if there is nothing after the @code we want to skip the
- * \n or we'll end up with too much space before the block */
- if (*end == '\n')
- {
- end ++;
- did_newline = 1;
- }
- not_double = 1;
- start = end;
- }
+ int did_newline = 0;
+
+ /* we strip out newlines so the text will wrap nicely */
+ if (*end == '\n')
+ {
+ /* we just handled a \n and got a second one so this is a new
+ * paragraph so actually insert the two \n's */
+ if (handled_newline)
+ {
+ if (in_codeblock || not_double)
+ ewl_text_text_append(tutorial, "\n");
+ else
+ ewl_text_text_append(tutorial, "\n\n");
+ }
+
+ /* append the text before and skip the newline */
+ else
+ {
+ char tmp;
+
+ tmp = *(end + 1);
+ *(end + 1) = '\0';
+
+ if (!in_codeblock)
+ *end = ' ';
+
+ ewl_text_text_append(tutorial, start);
+
+ *(end + 1) = tmp;
+ }
+ start = ++end;
+ did_newline = 1;
+ not_double = 0;
+ }
+
+ /* The * is only special after a newline character */
+ else if ((*end == '*' || *end == ' ' || *end == '/') && handled_newline)
+ {
+ if (*end == ' ') end++;
+ while (*end == '*') end++;
+
+ /* we only want to skip "* " if in a code block */
+ if (in_codeblock)
+ {
+ if (*end == ' ') end ++;
+ }
+ /* otherwise skip the * and all spaces */
+ else
+ {
+ while ((*end == '*') || (*end == ' ') ||
+ (*end == '/') || (*end == '\t'))
+ end++;
+ }
+
+ if (*end == '\n')
+ /* don't let the *'s at the begining of lines effect the \n
+ * handling */
+ did_newline = handled_newline;
+
+ start = end;
+ }
+ else if (*end == '@')
+ {
+ /* stick on everything before the @ symbol. If we don't have a
+ * keyword here we'll just end up sticking the next chunk onto
+ * this node so shouldn't be a big deal */
+ *end = '\0';
+
+ ewl_text_text_append(tutorial, start);
+ *end = '@';
+ start = end;
+
+ if ((!strncasecmp(end, "@addtogroup ", 12))
+ || (!strncasecmp(end, "@section ", 9)))
+ {
+ char tmp, key;
+ int size = 14;
+
+ key = *(end + 1);
+ end += 9;
+
+ /* we increment end so that we can skip over the keyword and
+ * the space after it */
+ if (key == 'a')
+ {
+ size = 22;
+ end += 3;
+ }
+
+ while (*end == ' ') end ++;
+ start = end;
+
+ /* skip to the end of the line */
+ end = strchr(end, '\n');
+
+ /* if this is the section header we need to skip
+ * the section name */
+ if (key == 's')
+ {
+ while (!isspace(*start)) start ++;
+ while (*start == ' ') start ++;
+ }
+
+ not_double = 1;
+
+ tmp = *(end + 1);
+ *(end + 1) = '\0';
+
+ ewl_text_font_size_set(tutorial, size);
+ ewl_text_text_append(tutorial, start);
+ ewl_text_font_size_set(tutorial, 12);
+
+ *(end + 1) = tmp;
+ start = ++end;
+
+ did_newline = 1;
+ }
+ else if (!strncasecmp(end, "@code", 5))
+ {
+ in_codeblock = 1;
+ end += 5;
+ while (*end == ' ') end ++;
+
+ /* if there is nothing after the @code we want to skip the
+ * \n or we'll end up with too much space before the block */
+ if (*end == '\n')
+ {
+ end ++;
+ did_newline = 1;
+ }
+
+ ewl_text_color_set(tutorial, 32, 71, 109, 255);
+ ewl_text_font_set(tutorial, "ewl/monospace");
+ start = end;
+ }
+ else if (!strncasecmp(end, "@endcode", 8))
+ {
+ *end = '\0';
+
+ ewl_text_text_append(tutorial, start);
+ ewl_text_color_set(tutorial, 0, 0, 0, 255);
+ in_codeblock = 0;
+
+ end += 8;
+ while (*end == ' ') end ++;
+
+ /* if there is nothing after the @code we want to skip the
+ * \n or we'll end up with too much space before the block */
+ if (*end == '\n')
+ {
+ end ++;
+ did_newline = 1;
+ }
+ not_double = 1;
+ start = end;
+ }
#if 0
- else if (!strncasecmp(end, "@note", 5))
- {
-
- }
- /* make next word bold */
- else if (!strncasecmp(end, "@b ", 3))
- {
- }
- /* supost to be typewriter font, make next word italic */
- else if (!strncasecmp(end, "@c ", 3))
- {
- }
+ else if (!strncasecmp(end, "@note", 5))
+ {
+
+ }
+ /* make next word bold */
+ else if (!strncasecmp(end, "@b ", 3))
+ {
+ }
+ /* supost to be typewriter font, make next word italic */
+ else if (!strncasecmp(end, "@c ", 3))
+ {
+ }
#endif
- /* if we don't know what it is just write it into the text */
- else
- end ++;
- }
- else if (*end == '<')
- {
- if (0)
- {
- }
- /* skip it if we don't know what it is */
- else
- end ++;
- }
- else
- end ++;
-
- handled_newline = did_newline;
- if (!end || (*end == '\0'))
- {
- ewl_text_text_append(tutorial, start);
- start = end;
- }
+ /* if we don't know what it is just write it into the text */
+ else
+ end ++;
+ }
+ else if (*end == '<')
+ {
+ if (0)
+ {
+ }
+ /* skip it if we don't know what it is */
+ else
+ end ++;
+ }
+ else
+ end ++;
+
+ handled_newline = did_newline;
+ if (!end || (*end == '\0'))
+ {
+ ewl_text_text_append(tutorial, start);
+ start = end;
+ }
}
}
@@ -1160,7 +1160,7 @@ ewl_test_create_info_window(const char *title, const char *text)
ewl_window_class_set(EWL_WINDOW(win), "ewl_test");
ewl_window_name_set(EWL_WINDOW(win), "ewl_test");
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
- ewl_test_cb_delete_window, NULL);
+ ewl_test_cb_delete_window, NULL);
ewl_object_size_request(EWL_OBJECT(win), 400, 400);
ewl_widget_show(win);
@@ -1187,36 +1187,36 @@ ewl_test_create_info_window(const char *title, const char *text)
static void
ewl_test_cb_help(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_test_create_info_window("Ewl Test Help", ewl_test_help_body);
}
static void
ewl_test_cb_about(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_test_create_info_window("Ewl Test About", ewl_test_about_body);
}
static void *
ewl_test_cb_category_fetch(void *data __UNUSED__, unsigned int row,
- unsigned int column __UNUSED__)
+ unsigned int column __UNUSED__)
{
switch(row)
{
- case 0: return "Simple";
- case 1: return "Advanced";
- case 2: return "Container";
- case 3: return "Misc";
- case 4: return "Unit";
+ case 0: return "Simple";
+ case 1: return "Advanced";
+ case 2: return "Container";
+ case 3: return "Misc";
+ case 4: return "Unit";
}
return "ERROR";
}
static int
ewl_test_cb_category_expandable(void *data __UNUSED__,
- unsigned int row __UNUSED__)
+ unsigned int row __UNUSED__)
{
return 1;
}
@@ -1230,7 +1230,7 @@ ewl_test_cb_category_expansion_fetch(void *data, unsigned int row)
static Ewl_Model *
ewl_test_cb_category_expansion_model_fetch(void *data __UNUSED__,
- unsigned int row __UNUSED__)
+ unsigned int row __UNUSED__)
{
if (expansion_model) return expansion_model;
@@ -1243,7 +1243,7 @@ ewl_test_cb_category_expansion_model_fetch(void *data __UNUSED__,
static void *
ewl_test_cb_expansion_fetch(void *data, unsigned int row,
- unsigned int column __UNUSED__)
+ unsigned int column __UNUSED__)
{
Ewl_Test *test;
@@ -1255,7 +1255,7 @@ ewl_test_cb_expansion_fetch(void *data, unsigned int row,
static void
ewl_test_cb_test_selected(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ecore_List *tree_data, *unit;
Ewl_Selection_Idx *sel;
@@ -1264,26 +1264,26 @@ ewl_test_cb_test_selected(Ewl_Widget *w, void *ev __UNUSED__,
tree_data = ewl_mvc_data_get(EWL_MVC(w));
sel = ewl_mvc_selected_get(EWL_MVC(w));
if (!sel)
- goto EXIT_CALLBACK;
+ goto EXIT_CALLBACK;
/* don't care about the top level rows */
if (tree_data == sel->sel.data)
- goto CLEAR_SELECTION;
+ goto CLEAR_SELECTION;
/* get the test */
ecore_list_index_goto(sel->sel.data, sel->row);
test = ecore_list_current(sel->sel.data);
if (!test)
- goto FREE_SELECTION;
+ goto FREE_SELECTION;
/* we need to determine if this is the unit test case. if it is we
* need to treat it specially */
ecore_list_last_goto(tree_data);
unit = ecore_list_current(tree_data);
if (unit == sel->sel.data)
- run_unit_test_boxed(test);
+ run_unit_test_boxed(test);
else
- run_test_boxed(test);
+ run_test_boxed(test);
CLEAR_SELECTION:
ewl_mvc_selected_clear(EWL_MVC(w));
@@ -1297,10 +1297,10 @@ static void *
cb_unit_test_header_data_fetch(void *data __UNUSED__, unsigned int column)
{
if (column == 0)
- return "Test";
+ return "Test";
if (column == 1)
- return "Status";
+ return "Status";
return "Failure Reason";
}
@@ -1324,14 +1324,14 @@ cb_unit_test_fetch(void *data, unsigned int row, unsigned int column)
t = data;
if (column == 0)
- return (void *)t->unit_tests[row].name;
+ return (void *)t->unit_tests[row].name;
else if (column == 1)
- return ((t->unit_tests[row].status < 0) ? "" :
- (t->unit_tests[row].status == 0) ? "FAIL" : "PASS");
+ return ((t->unit_tests[row].status < 0) ? "" :
+ (t->unit_tests[row].status == 0) ? "FAIL" : "PASS");
else
- return t->unit_tests[row].failure_reason;
+ return t->unit_tests[row].failure_reason;
}
static unsigned int
@@ -1344,7 +1344,7 @@ cb_unit_test_count(void *data)
if (!data) return 0;
for (i = 0; t->unit_tests[i].func; i++)
- ;
+ ;
return i;
}
diff --git a/src/bin/tests/border/ewl_border_test.c b/src/bin/tests/border/ewl_border_test.c
index 96cd362..5d87b14 100644
--- a/src/bin/tests/border/ewl_border_test.c
+++ b/src/bin/tests/border/ewl_border_test.c
@@ -24,11 +24,11 @@ static int label_position_set_get_test(char *buf, int len);
static int label_alignment_set_get_test(char *buf, int len);
static Ewl_Unit_Test border_unit_tests[] = {
- {"Border is", border_is_test, NULL, -1, 0},
- {"Border label set/get", label_set_get_test, NULL, -1, 0},
- {"Border label position set/get", label_position_set_get_test, NULL, -1, 0},
- {"Border label alignment set/get", label_alignment_set_get_test, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"Border is", border_is_test, NULL, -1, 0},
+ {"Border label set/get", label_set_get_test, NULL, -1, 0},
+ {"Border label position set/get", label_position_set_get_test, NULL, -1, 0},
+ {"Border label alignment set/get", label_alignment_set_get_test, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -36,7 +36,7 @@ test_info(Ewl_Test *test)
{
test->name = "Border";
test->tip = "Defines the Ewl_Border class for displaying\n"
- "a container with a label.";
+ "a container with a label.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -75,7 +75,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button_atop), "Top");
ewl_container_child_append(EWL_CONTAINER(avbox), button_atop);
ewl_callback_append(button_atop, EWL_CALLBACK_VALUE_CHANGED,
- border_change_alignment, border);
+ border_change_alignment, border);
ewl_widget_show(button_atop);
button_aleft = ewl_radiobutton_new();
@@ -83,36 +83,36 @@ create_test(Ewl_Container *box)
ewl_checkbutton_checked_set(EWL_CHECKBUTTON(button_aleft), TRUE);
ewl_container_child_append(EWL_CONTAINER(avbox), button_aleft);
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(button_aleft),
- EWL_RADIOBUTTON(button_atop));
+ EWL_RADIOBUTTON(button_atop));
ewl_callback_append(button_aleft, EWL_CALLBACK_VALUE_CHANGED,
- border_change_alignment, border);
+ border_change_alignment, border);
ewl_widget_show(button_aleft);
button_acenter = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(button_acenter), "Center");
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(button_acenter),
- EWL_RADIOBUTTON(button_aleft));
+ EWL_RADIOBUTTON(button_aleft));
ewl_container_child_append(EWL_CONTAINER(avbox), button_acenter);
ewl_callback_append(button_acenter, EWL_CALLBACK_VALUE_CHANGED,
- border_change_alignment, border);
+ border_change_alignment, border);
ewl_widget_show(button_acenter);
button_aright = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(button_aright), "Right");
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(button_aright),
- EWL_RADIOBUTTON(button_acenter));
+ EWL_RADIOBUTTON(button_acenter));
ewl_container_child_append(EWL_CONTAINER(avbox), button_aright);
ewl_callback_append(button_aright, EWL_CALLBACK_VALUE_CHANGED,
- border_change_alignment, border);
+ border_change_alignment, border);
ewl_widget_show(button_aright);
button_abottom = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(button_abottom), "Bottom");
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(button_abottom),
- EWL_RADIOBUTTON(button_aright));
+ EWL_RADIOBUTTON(button_aright));
ewl_container_child_append(EWL_CONTAINER(avbox), button_abottom);
ewl_callback_append(button_abottom, EWL_CALLBACK_VALUE_CHANGED,
- border_change_alignment, border);
+ border_change_alignment, border);
ewl_widget_show(button_abottom);
separator = ewl_vseparator_new();
@@ -133,35 +133,35 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button_pleft), "Left");
ewl_container_child_append(EWL_CONTAINER(pvbox), button_pleft);
ewl_callback_append(button_pleft, EWL_CALLBACK_VALUE_CHANGED,
- border_change_position, border);
+ border_change_position, border);
ewl_widget_show(button_pleft);
button_pright = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(button_pright), "Right");
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(button_pright),
- EWL_RADIOBUTTON(button_pleft));
+ EWL_RADIOBUTTON(button_pleft));
ewl_container_child_append(EWL_CONTAINER(pvbox), button_pright);
ewl_callback_append(button_pright, EWL_CALLBACK_VALUE_CHANGED,
- border_change_position, border);
+ border_change_position, border);
ewl_widget_show(button_pright);
button_ptop = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(button_ptop), "Top");
ewl_checkbutton_checked_set(EWL_CHECKBUTTON(button_ptop), TRUE);
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(button_ptop),
- EWL_RADIOBUTTON(button_pright));
+ EWL_RADIOBUTTON(button_pright));
ewl_container_child_append(EWL_CONTAINER(pvbox), button_ptop);
ewl_callback_append(button_ptop, EWL_CALLBACK_VALUE_CHANGED,
- border_change_position, border);
+ border_change_position, border);
ewl_widget_show(button_ptop);
button_pbottom = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(button_pbottom), "Bottom");
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(button_pbottom),
- EWL_RADIOBUTTON(button_ptop));
+ EWL_RADIOBUTTON(button_ptop));
ewl_container_child_append(EWL_CONTAINER(pvbox), button_pbottom);
ewl_callback_append(button_pbottom, EWL_CALLBACK_VALUE_CHANGED,
- border_change_position, border);
+ border_change_position, border);
ewl_widget_show(button_pbottom);
cvbox = ewl_vbox_new();
@@ -178,7 +178,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button_check), "Disable");
ewl_container_child_append(EWL_CONTAINER(cvbox), button_check);
ewl_callback_append(button_check, EWL_CALLBACK_CLICKED,
- checkbutton_cb, border);
+ checkbutton_cb, border);
ewl_widget_show(button_check);
return 1;
@@ -186,47 +186,47 @@ create_test(Ewl_Container *box)
static void
border_change_alignment(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
if (!ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w)))
- return;
+ return;
if (w == button_aleft)
- ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_LEFT);
+ ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_LEFT);
else if (w == button_acenter)
- ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_CENTER);
+ ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_CENTER);
else if (w == button_aright)
- ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_RIGHT);
+ ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_RIGHT);
else if (w == button_atop)
- ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_TOP);
+ ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_TOP);
else if (w == button_abottom)
- ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_BOTTOM);
+ ewl_border_label_alignment_set(data, EWL_FLAG_ALIGN_BOTTOM);
return;
}
static void
border_change_position(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
if (!ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w)))
- return;
+ return;
if (w == button_pleft)
- ewl_border_label_position_set(data, EWL_POSITION_LEFT);
+ ewl_border_label_position_set(data, EWL_POSITION_LEFT);
else if (w == button_pright)
- ewl_border_label_position_set(data, EWL_POSITION_RIGHT);
+ ewl_border_label_position_set(data, EWL_POSITION_RIGHT);
else if (w == button_ptop)
- ewl_border_label_position_set(data, EWL_POSITION_TOP);
+ ewl_border_label_position_set(data, EWL_POSITION_TOP);
else if (w == button_pbottom)
- ewl_border_label_position_set(data, EWL_POSITION_BOTTOM);
+ ewl_border_label_position_set(data, EWL_POSITION_BOTTOM);
}
static void
@@ -234,13 +234,13 @@ checkbutton_cb(Ewl_Widget *w, void *ev __UNUSED__, void *data)
{
if (ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w)))
{
- ewl_widget_disable(EWL_WIDGET(data));
- ewl_button_label_set(EWL_BUTTON(w), "Enable");
+ ewl_widget_disable(EWL_WIDGET(data));
+ ewl_button_label_set(EWL_BUTTON(w), "Enable");
}
else if (!ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w)))
{
- ewl_widget_enable(EWL_WIDGET(data));
- ewl_button_label_set(EWL_BUTTON(w), "Disable");
+ ewl_widget_enable(EWL_WIDGET(data));
+ ewl_button_label_set(EWL_BUTTON(w), "Disable");
}
}
@@ -251,9 +251,9 @@ static int border_is_test(char *buf, int len)
border = ewl_border_new();
if (ewl_widget_type_is(border, EWL_BORDER_TYPE))
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "border type doesn't match");
+ LOG_FAILURE(buf, len, "border type doesn't match");
ewl_widget_destroy(border);
@@ -267,17 +267,17 @@ static int label_set_get_test(char *buf, int len)
border = ewl_border_new();
if (ewl_border_label_get(EWL_BORDER(border)))
- LOG_FAILURE(buf, len, "default border label set");
+ LOG_FAILURE(buf, len, "default border label set");
else {
- const char *label;
+ const char *label;
- ewl_border_label_set(EWL_BORDER(border), "label value");
+ ewl_border_label_set(EWL_BORDER(border), "label value");
- label = ewl_border_label_get(EWL_BORDER(border));
- if (label && !strcmp(label, "label value"))
- ret = 1;
- else
- LOG_FAILURE(buf, len, "border label doesn't match");
+ label = ewl_border_label_get(EWL_BORDER(border));
+ if (label && !strcmp(label, "label value"))
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "border label doesn't match");
}
ewl_widget_destroy(border);
@@ -294,36 +294,36 @@ static int label_position_set_get_test(char *buf, int len)
border = ewl_border_new();
pos = ewl_border_label_position_get(EWL_BORDER(border));
if (pos != EWL_POSITION_TOP) {
- LOG_FAILURE(buf, len, "default border label position wrong");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "default border label position wrong");
+ goto POSITION_ERROR;
}
ewl_border_label_position_set(EWL_BORDER(border), EWL_POSITION_LEFT);
pos = ewl_border_label_position_get(EWL_BORDER(border));
if (pos != EWL_POSITION_LEFT) {
- LOG_FAILURE(buf, len, "border label position not left");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "border label position not left");
+ goto POSITION_ERROR;
}
ewl_border_label_position_set(EWL_BORDER(border), EWL_POSITION_RIGHT);
pos = ewl_border_label_position_get(EWL_BORDER(border));
if (pos != EWL_POSITION_RIGHT) {
- LOG_FAILURE(buf, len, "border label position not right");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "border label position not right");
+ goto POSITION_ERROR;
}
ewl_border_label_position_set(EWL_BORDER(border), EWL_POSITION_BOTTOM);
pos = ewl_border_label_position_get(EWL_BORDER(border));
if (pos != EWL_POSITION_BOTTOM) {
- LOG_FAILURE(buf, len, "border label position not bottom");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "border label position not bottom");
+ goto POSITION_ERROR;
}
ewl_border_label_position_set(EWL_BORDER(border), EWL_POSITION_TOP);
pos = ewl_border_label_position_get(EWL_BORDER(border));
if (pos != EWL_POSITION_TOP) {
- LOG_FAILURE(buf, len, "border label position not top");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "border label position not top");
+ goto POSITION_ERROR;
}
ret = 1;
@@ -344,50 +344,50 @@ static int label_alignment_set_get_test(char *buf, int len)
border = ewl_border_new();
align = ewl_border_label_alignment_get(EWL_BORDER(border));
if (align != EWL_FLAG_ALIGN_LEFT) {
- LOG_FAILURE(buf, len, "default border label alignment wrong");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "default border label alignment wrong");
+ goto POSITION_ERROR;
}
req_align = (EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_RIGHT |
- EWL_FLAG_ALIGN_BOTTOM | EWL_FLAG_ALIGN_TOP |
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_BOTTOM | EWL_FLAG_ALIGN_TOP |
+ EWL_FLAG_ALIGN_CENTER);
while (req_align >= 0) {
- ewl_border_label_alignment_set(EWL_BORDER(border), req_align);
- align = ewl_border_label_alignment_get(EWL_BORDER(border));
- if (align != req_align) {
- LOG_FAILURE(buf, len,
- "border label alignment %x does not "
- "match requested %x", align, req_align);
- goto POSITION_ERROR;
- }
+ ewl_border_label_alignment_set(EWL_BORDER(border), req_align);
+ align = ewl_border_label_alignment_get(EWL_BORDER(border));
+ if (align != req_align) {
+ LOG_FAILURE(buf, len,
+ "border label alignment %x does not "
+ "match requested %x", align, req_align);
+ goto POSITION_ERROR;
+ }
- --req_align;
+ --req_align;
}
ewl_border_label_alignment_set(EWL_BORDER(border),
- EWL_FLAG_ALIGN_RIGHT);
+ EWL_FLAG_ALIGN_RIGHT);
align = ewl_border_label_alignment_get(EWL_BORDER(border));
if (align != EWL_FLAG_ALIGN_RIGHT) {
- LOG_FAILURE(buf, len, "border label alignment not right");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "border label alignment not right");
+ goto POSITION_ERROR;
}
ewl_border_label_alignment_set(EWL_BORDER(border),
- EWL_FLAG_ALIGN_BOTTOM);
+ EWL_FLAG_ALIGN_BOTTOM);
align = ewl_border_label_alignment_get(EWL_BORDER(border));
if (align != EWL_FLAG_ALIGN_BOTTOM) {
- LOG_FAILURE(buf, len, "border label alignment not bottom");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "border label alignment not bottom");
+ goto POSITION_ERROR;
}
ewl_border_label_alignment_set(EWL_BORDER(border),
- EWL_FLAG_ALIGN_TOP);
+ EWL_FLAG_ALIGN_TOP);
align = ewl_border_label_alignment_get(EWL_BORDER(border));
if (align != EWL_FLAG_ALIGN_TOP) {
- LOG_FAILURE(buf, len, "border label alignment not top");
- goto POSITION_ERROR;
+ LOG_FAILURE(buf, len, "border label alignment not top");
+ goto POSITION_ERROR;
}
ret = 1;
diff --git a/src/bin/tests/box/ewl_box_test.c b/src/bin/tests/box/ewl_box_test.c
index e34a4b3..c8a4a0a 100644
--- a/src/bin/tests/box/ewl_box_test.c
+++ b/src/bin/tests/box/ewl_box_test.c
@@ -16,8 +16,8 @@ test_info(Ewl_Test *test)
{
test->name = "Box";
test->tip = "Defines the Ewl_Box class used for\n"
- "laying out Ewl_Widget's in a horizontal\n"
- "or vertical line.";
+ "laying out Ewl_Widget's in a horizontal\n"
+ "or vertical line.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -52,11 +52,11 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(vbox_button[0][0]), "Left");
ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][0]);
ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][0]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][0]),
- EWL_FLAG_ALIGN_LEFT);
+ EWL_FLAG_ALIGN_LEFT);
ewl_callback_append(vbox_button[0][0], EWL_CALLBACK_CLICKED,
- toggle_child_horizontal_align, NULL);
+ toggle_child_horizontal_align, NULL);
ewl_widget_show(vbox_button[0][0]);
/*
@@ -66,11 +66,11 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(vbox_button[0][1]), "Center");
ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][1]);
ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][1]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][1]),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_callback_append(vbox_button[0][1], EWL_CALLBACK_CLICKED,
- toggle_child_horizontal_align, NULL);
+ toggle_child_horizontal_align, NULL);
ewl_widget_show(vbox_button[0][1]);
/*
@@ -80,15 +80,15 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(vbox_button[0][2]), "Right");
ewl_container_child_append(EWL_CONTAINER(vbox[0]), vbox_button[0][2]);
ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[0][2]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(vbox_button[0][2]),
- EWL_FLAG_ALIGN_RIGHT);
+ EWL_FLAG_ALIGN_RIGHT);
ewl_callback_append(vbox_button[0][2], EWL_CALLBACK_CLICKED,
- toggle_child_horizontal_align, NULL);
+ toggle_child_horizontal_align, NULL);
ewl_widget_show(vbox_button[0][2]);
/****************************************************************/
- /* Create a box for holding the Fill test buttons */
+ /* Create a box for holding the Fill test buttons */
/****************************************************************/
vbox[1] = ewl_vbox_new();
ewl_container_child_append(EWL_CONTAINER(hbox[0]), vbox[1]);
@@ -101,13 +101,13 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(vbox_button[1][0]), "None");
ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][0]);
ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][0]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_box_orientation_set(EWL_BOX(vbox_button[1][0]),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][0])->label_object),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_callback_append(vbox_button[1][0], EWL_CALLBACK_CLICKED,
- toggle_child_fill, NULL);
+ toggle_child_fill, NULL);
ewl_widget_show(vbox_button[1][0]);
/*
@@ -117,13 +117,13 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(vbox_button[1][1]), "Fill");
ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][1]);
ewl_box_orientation_set(EWL_BOX(vbox_button[1][1]),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][1]),
- EWL_FLAG_FILL_FILL);
+ EWL_FLAG_FILL_FILL);
ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][1])->label_object),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_callback_append(vbox_button[1][1], EWL_CALLBACK_CLICKED,
- toggle_child_fill, NULL);
+ toggle_child_fill, NULL);
ewl_widget_show(vbox_button[1][1]);
/*
@@ -133,13 +133,13 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(vbox_button[1][2]), "None");
ewl_container_child_append(EWL_CONTAINER(vbox[1]), vbox_button[1][2]);
ewl_box_orientation_set(EWL_BOX(vbox_button[1][2]),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
ewl_object_fill_policy_set(EWL_OBJECT(vbox_button[1][2]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(EWL_BUTTON(vbox_button[1][2])->label_object),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_callback_append(vbox_button[1][2], EWL_CALLBACK_CLICKED,
- toggle_child_fill, NULL);
+ toggle_child_fill, NULL);
ewl_widget_show(vbox_button[1][2]);
/****************************************************************/
@@ -156,11 +156,11 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(hbox_button[0][0]), "Top");
ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][0]);
ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][0]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][0]),
- EWL_FLAG_ALIGN_TOP);
+ EWL_FLAG_ALIGN_TOP);
ewl_callback_append(hbox_button[0][0], EWL_CALLBACK_CLICKED,
- toggle_child_vertical_align, NULL);
+ toggle_child_vertical_align, NULL);
ewl_widget_show(hbox_button[0][0]);
/*
@@ -170,11 +170,11 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(hbox_button[0][1]), "Center");
ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][1]);
ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][1]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][1]),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_callback_append(hbox_button[0][1], EWL_CALLBACK_CLICKED,
- toggle_child_vertical_align, NULL);
+ toggle_child_vertical_align, NULL);
ewl_widget_show(hbox_button[0][1]);
/*
@@ -184,15 +184,15 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(hbox_button[0][2]), "Bottom");
ewl_container_child_append(EWL_CONTAINER(hbox[1]), hbox_button[0][2]);
ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[0][2]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(hbox_button[0][2]),
- EWL_FLAG_ALIGN_BOTTOM);
+ EWL_FLAG_ALIGN_BOTTOM);
ewl_callback_append(hbox_button[0][2], EWL_CALLBACK_CLICKED,
- toggle_child_vertical_align, NULL);
+ toggle_child_vertical_align, NULL);
ewl_widget_show(hbox_button[0][2]);
/****************************************************************/
- /* Create a box for holding the Shrink test buttons */
+ /* Create a box for holding the Shrink test buttons */
/****************************************************************/
hbox[2] = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(box), hbox[2]);
@@ -204,12 +204,12 @@ create_test(Ewl_Container *box)
*/
hbox_button[1][0] = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(hbox_button[1][0]),
- "Shrink This Box To Fit It's Parent");
+ "Shrink This Box To Fit It's Parent");
ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][0]),
- EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HSHRINK);
ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][0]);
ewl_callback_append(hbox_button[1][0], EWL_CALLBACK_CLICKED,
- toggle_child_shrink, NULL);
+ toggle_child_shrink, NULL);
ewl_widget_show(hbox_button[1][0]);
/*
@@ -217,12 +217,12 @@ create_test(Ewl_Container *box)
*/
hbox_button[1][1] = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(hbox_button[1][1]),
- "Shrink This Box To Fit It's Parent");
+ "Shrink This Box To Fit It's Parent");
ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][1]),
- EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HSHRINK);
ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][1]);
ewl_callback_append(hbox_button[1][1], EWL_CALLBACK_CLICKED,
- toggle_child_shrink, NULL);
+ toggle_child_shrink, NULL);
ewl_widget_show(hbox_button[1][1]);
/*
@@ -230,12 +230,12 @@ create_test(Ewl_Container *box)
*/
hbox_button[1][2] = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(hbox_button[1][2]),
- "Don't shrink this box at all");
+ "Don't shrink this box at all");
ewl_object_fill_policy_set(EWL_OBJECT(hbox_button[1][2]),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_container_child_append(EWL_CONTAINER(hbox[2]), hbox_button[1][2]);
ewl_callback_append(hbox_button[1][2], EWL_CALLBACK_CLICKED,
- toggle_child_shrink, NULL);
+ toggle_child_shrink, NULL);
ewl_widget_show(hbox_button[1][2]);
return 1;
@@ -243,59 +243,59 @@ create_test(Ewl_Container *box)
static void
toggle_child_fill(Ewl_Widget * w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
unsigned int f;
f = ewl_object_fill_policy_get(EWL_OBJECT(w));
if (f == EWL_FLAG_FILL_NONE) {
- ewl_button_label_set(EWL_BUTTON(w), "Fill");
- ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
+ ewl_button_label_set(EWL_BUTTON(w), "Fill");
+ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
} else {
- ewl_button_label_set(EWL_BUTTON(w), "None");
- ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
+ ewl_button_label_set(EWL_BUTTON(w), "None");
+ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
}
}
static void
toggle_child_shrink(Ewl_Widget * w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
unsigned int f;
f = ewl_object_fill_policy_get(EWL_OBJECT(w));
if (f == EWL_FLAG_FILL_NONE) {
- ewl_object_fill_policy_set(EWL_OBJECT(w),
- EWL_FLAG_FILL_HSHRINK);
- ewl_button_label_set(EWL_BUTTON(w),
- "Shrink This Box To Fit It's Parent");
+ ewl_object_fill_policy_set(EWL_OBJECT(w),
+ EWL_FLAG_FILL_HSHRINK);
+ ewl_button_label_set(EWL_BUTTON(w),
+ "Shrink This Box To Fit It's Parent");
} else {
- ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
- ewl_button_label_set(EWL_BUTTON(w),
- "Don't shrink this box at all");
+ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
+ ewl_button_label_set(EWL_BUTTON(w),
+ "Don't shrink this box at all");
}
}
static void
toggle_child_horizontal_align(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
unsigned int a;
- char l[10];
+ char l[10];
a = ewl_object_alignment_get(EWL_OBJECT(w));
if (a == EWL_FLAG_ALIGN_LEFT) {
- a = EWL_FLAG_ALIGN_CENTER;
- snprintf(l, 10, "Center");
+ a = EWL_FLAG_ALIGN_CENTER;
+ snprintf(l, 10, "Center");
} else if (a == EWL_FLAG_ALIGN_CENTER) {
- a = EWL_FLAG_ALIGN_RIGHT;
- snprintf(l, 10, "Right");
+ a = EWL_FLAG_ALIGN_RIGHT;
+ snprintf(l, 10, "Right");
} else if (a == EWL_FLAG_ALIGN_RIGHT) {
- a = EWL_FLAG_ALIGN_LEFT;
- snprintf(l, 10, "Left");
+ a = EWL_FLAG_ALIGN_LEFT;
+ snprintf(l, 10, "Left");
}
ewl_button_label_set(EWL_BUTTON(w), l);
@@ -304,22 +304,22 @@ toggle_child_horizontal_align(Ewl_Widget *w, void *ev __UNUSED__,
static void
toggle_child_vertical_align(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
unsigned int a;
- char l[10];
+ char l[10];
a = ewl_object_alignment_get(EWL_OBJECT(w));
if (a == EWL_FLAG_ALIGN_TOP) {
- a = EWL_FLAG_ALIGN_CENTER;
- snprintf(l, 10, "Center");
+ a = EWL_FLAG_ALIGN_CENTER;
+ snprintf(l, 10, "Center");
} else if (a == EWL_FLAG_ALIGN_CENTER) {
- a = EWL_FLAG_ALIGN_BOTTOM;
- snprintf(l, 10, "Bottom");
+ a = EWL_FLAG_ALIGN_BOTTOM;
+ snprintf(l, 10, "Bottom");
} else if (a == EWL_FLAG_ALIGN_BOTTOM) {
- a = EWL_FLAG_ALIGN_TOP;
- snprintf(l, 10, "Top");
+ a = EWL_FLAG_ALIGN_TOP;
+ snprintf(l, 10, "Top");
}
ewl_button_label_set(EWL_BUTTON(w), l);
diff --git a/src/bin/tests/button/ewl_button_test.c b/src/bin/tests/button/ewl_button_test.c
index 14235bf..149a298 100644
--- a/src/bin/tests/button/ewl_button_test.c
+++ b/src/bin/tests/button/ewl_button_test.c
@@ -25,18 +25,18 @@ static int image_alignment_test_set_get(char *buf, int len);
static int image_fill_policy_test_set_get(char *buf, int len);
static Ewl_Unit_Test button_unit_tests[] = {
- {"label set/get", label_test_set_get, NULL, -1, 0},
- {"image null get", image_null_test_get, NULL, -1, 0},
- {"image null set/get", image_null_test_set_get, NULL, -1, 0},
- {"image nonexistent set/get", image_nonexist_relative_test_set_get, NULL, -1, 0},
- {"image size null height set/get", image_size_null_height_test_set_get, NULL, -1 , 0},
- {"image size null width set/get", image_size_null_width_test_set_get, NULL, -1, 0},
- {"image size match set/get", image_size_match_test_set_get, NULL, -1, 0},
- {"image size differ set/get", image_size_differ_test_set_get, NULL, -1, 0},
- {"image size max int set/get", image_size_max_int_test_set_get, NULL, -1, 0},
- {"image alignment set/get", image_alignment_test_set_get, NULL, -1, 0},
- {"image fill policy set/get", image_fill_policy_test_set_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"label set/get", label_test_set_get, NULL, -1, 0},
+ {"image null get", image_null_test_get, NULL, -1, 0},
+ {"image null set/get", image_null_test_set_get, NULL, -1, 0},
+ {"image nonexistent set/get", image_nonexist_relative_test_set_get, NULL, -1, 0},
+ {"image size null height set/get", image_size_null_height_test_set_get, NULL, -1 , 0},
+ {"image size null width set/get", image_size_null_width_test_set_get, NULL, -1, 0},
+ {"image size match set/get", image_size_match_test_set_get, NULL, -1, 0},
+ {"image size differ set/get", image_size_differ_test_set_get, NULL, -1, 0},
+ {"image size max int set/get", image_size_max_int_test_set_get, NULL, -1, 0},
+ {"image alignment set/get", image_alignment_test_set_get, NULL, -1, 0},
+ {"image fill policy set/get", image_fill_policy_test_set_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -44,9 +44,9 @@ test_info(Ewl_Test *test)
{
test->name = "Button";
test->tip = "The button class is a basic button\n"
- "with a label. This class inherits from\n"
- "the Ewl_Box to allow for placing any\n"
- "other widgets inside the button.";
+ "with a label. This class inherits from\n"
+ "the Ewl_Box to allow for placing any\n"
+ "other widgets inside the button.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -131,7 +131,7 @@ create_test(Ewl_Container *box)
*/
check_button[1] = ewl_checkbutton_new();
ewl_button_label_set(EWL_BUTTON(check_button[1] ),
- "With Label and checked");
+ "With Label and checked");
ewl_checkbutton_checked_set(EWL_CHECKBUTTON(check_button[1]), TRUE);
ewl_container_child_append(EWL_CONTAINER(vbox), check_button[1]);
ewl_widget_show(check_button[1]);
@@ -178,7 +178,7 @@ create_test(Ewl_Container *box)
radio_button[1] = ewl_radiobutton_new();
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(radio_button[1]),
- EWL_RADIOBUTTON(radio_button[0]));
+ EWL_RADIOBUTTON(radio_button[0]));
ewl_container_child_append(EWL_CONTAINER(vbox), radio_button[1]);
ewl_widget_show(radio_button[1]);
@@ -202,14 +202,14 @@ label_test_set_get(char *buf, int len)
ewl_button_label_set(EWL_BUTTON(button), "my_label");
if (!strcmp("my_label", ewl_button_label_get(EWL_BUTTON(button)))) {
- ewl_button_label_set(EWL_BUTTON(button), NULL);
- if (ewl_button_label_get(EWL_BUTTON(button)))
- LOG_FAILURE(buf, len, "label_get not NULL");
- else
- ret = 1;
+ ewl_button_label_set(EWL_BUTTON(button), NULL);
+ if (ewl_button_label_get(EWL_BUTTON(button)))
+ LOG_FAILURE(buf, len, "label_get not NULL");
+ else
+ ret = 1;
}
else
- LOG_FAILURE(buf, len, "label_get doesn't match label_set");
+ LOG_FAILURE(buf, len, "label_get doesn't match label_set");
ewl_widget_destroy(button);
@@ -225,9 +225,9 @@ image_null_test_get(char *buf, int len)
button = ewl_button_new();
if (ewl_button_image_get(EWL_BUTTON(button)))
- LOG_FAILURE(buf, len, "image_get not NULL");
+ LOG_FAILURE(buf, len, "image_get not NULL");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -246,9 +246,9 @@ image_null_test_set_get(char *buf, int len)
ewl_button_image_set(EWL_BUTTON(button), NULL, NULL);
val = ewl_button_image_get(EWL_BUTTON(button));
if (val)
- LOG_FAILURE(buf, len, "image_get %s when set to NULL", val);
+ LOG_FAILURE(buf, len, "image_get %s when set to NULL", val);
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -265,9 +265,9 @@ image_nonexist_relative_test_set_get(char *buf, int len)
ewl_button_image_set(EWL_BUTTON(button), "my_image", NULL);
if (strcmp("my_image", ewl_button_image_get(EWL_BUTTON(button))))
- LOG_FAILURE(buf, len, "image_get dosen't match image_set");
+ LOG_FAILURE(buf, len, "image_get dosen't match image_set");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -285,9 +285,9 @@ image_size_null_height_test_set_get(char *buf, int len)
ewl_button_image_size_get(EWL_BUTTON(button), &w, NULL);
if (w != 0)
- LOG_FAILURE(buf, len, "image_size_get width not 0");
+ LOG_FAILURE(buf, len, "image_size_get width not 0");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -305,9 +305,9 @@ image_size_null_width_test_set_get(char *buf, int len)
ewl_button_image_size_get(EWL_BUTTON(button), NULL, &h);
if (h != 0)
- LOG_FAILURE(buf, len, "image_size_get height not 0");
+ LOG_FAILURE(buf, len, "image_size_get height not 0");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -326,9 +326,9 @@ image_size_match_test_set_get(char *buf, int len)
ewl_button_image_size_set(EWL_BUTTON(button), 32, 32);
ewl_button_image_size_get(EWL_BUTTON(button), &w, &h);
if (w != 32 || h != 32)
- LOG_FAILURE(buf, len, "image_size_get width and height don't match");
+ LOG_FAILURE(buf, len, "image_size_get width and height don't match");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -346,9 +346,9 @@ image_size_differ_test_set_get(char *buf, int len)
ewl_button_image_size_set(EWL_BUTTON(button), 30, 24);
ewl_button_image_size_get(EWL_BUTTON(button), &w, &h);
if (w != 30 || h != 24)
- LOG_FAILURE(buf, len, "image_size_get width and height don't differ");
+ LOG_FAILURE(buf, len, "image_size_get width and height don't differ");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -366,9 +366,9 @@ image_size_max_int_test_set_get(char *buf, int len)
ewl_button_image_size_set(EWL_BUTTON(button), INT_MAX, INT_MAX);
ewl_button_image_size_get(EWL_BUTTON(button), &w, &h);
if (w != INT_MAX|| h != INT_MAX)
- LOG_FAILURE(buf, len, "image_size_get width and height not INT_MAX");
+ LOG_FAILURE(buf, len, "image_size_get width and height not INT_MAX");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(button);
@@ -387,16 +387,16 @@ image_alignment_test_set_get(char *buf, int len)
align = ewl_button_alignment_get(EWL_BUTTON(button));
if (align == EWL_FLAG_ALIGN_RIGHT) {
- ewl_button_alignment_set(EWL_BUTTON(button),
- EWL_FLAG_ALIGN_TOP);
- align = ewl_button_alignment_get(EWL_BUTTON(button));
- if (align == EWL_FLAG_ALIGN_TOP)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "image alignment not top");
+ ewl_button_alignment_set(EWL_BUTTON(button),
+ EWL_FLAG_ALIGN_TOP);
+ align = ewl_button_alignment_get(EWL_BUTTON(button));
+ if (align == EWL_FLAG_ALIGN_TOP)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "image alignment not top");
}
else
- LOG_FAILURE(buf, len, "image alignment not right");
+ LOG_FAILURE(buf, len, "image alignment not right");
ewl_widget_destroy(button);
@@ -415,16 +415,16 @@ image_fill_policy_test_set_get(char *buf, int len)
align = ewl_button_fill_policy_get(EWL_BUTTON(button));
if (align == EWL_FLAG_FILL_NONE) {
- ewl_button_fill_policy_set(EWL_BUTTON(button),
- EWL_FLAG_FILL_FILL);
- align = ewl_button_fill_policy_get(EWL_BUTTON(button));
- if (align == EWL_FLAG_FILL_FILL)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "image fill policy not fill");
+ ewl_button_fill_policy_set(EWL_BUTTON(button),
+ EWL_FLAG_FILL_FILL);
+ align = ewl_button_fill_policy_get(EWL_BUTTON(button));
+ if (align == EWL_FLAG_FILL_FILL)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "image fill policy not fill");
}
else
- LOG_FAILURE(buf, len, "image fill policy not none");
+ LOG_FAILURE(buf, len, "image fill policy not none");
ewl_widget_destroy(button);
diff --git a/src/bin/tests/calendar/ewl_calendar_test.c b/src/bin/tests/calendar/ewl_calendar_test.c
index c98e1a9..9ea55bc 100644
--- a/src/bin/tests/calendar/ewl_calendar_test.c
+++ b/src/bin/tests/calendar/ewl_calendar_test.c
@@ -26,8 +26,8 @@ create_test(Ewl_Container *box)
cal = ewl_calendar_new();
ewl_container_child_append(EWL_CONTAINER(box), cal);
ewl_callback_append(EWL_WIDGET(cal),
- EWL_CALLBACK_VALUE_CHANGED, ewl_calendar_test,
- cal);
+ EWL_CALLBACK_VALUE_CHANGED, ewl_calendar_test,
+ cal);
ewl_widget_show(cal);
return 1;
diff --git a/src/bin/tests/callback/ewl_callback_test.c b/src/bin/tests/callback/ewl_callback_test.c
index f4a9aa5..e0a5241 100644
--- a/src/bin/tests/callback/ewl_callback_test.c
+++ b/src/bin/tests/callback/ewl_callback_test.c
@@ -53,39 +53,39 @@ static void insert_before_callback(Ewl_Widget *w, void *event, void *data);
static void delete_callback(Ewl_Widget *w, void *event, void *data);
static Ewl_Unit_Test callback_unit_tests[] = {
- {"append/get id", append_test_id, NULL, -1, 0},
- {"prepend/get id", prepend_test_id, NULL, -1, 0},
- {"insert after/get id", insert_after_test_id, NULL, -1, 0},
- {"shared id", shared_test_id, NULL, -1, 0},
- {"unique id", unique_test_id, NULL, -1, 0},
- {"del/call", del_test_call, NULL, -1, 0},
- {"del_id/call", del_id_test_call, NULL, -1, 0},
- {"del_data/call", del_data_test_call, NULL, -1, 0},
- {"del_type/call", del_type_test_call, NULL, -1, 0},
- {"del from empty", del_empty_test_call, NULL, -1, 0},
- {"clear/call", clear_test_call, NULL, -1, 0},
- {"append/call", append_test_call, NULL, -1, 0},
- {"prepend/call", prepend_test_call, NULL, -1, 0},
- {"parent notify", notify_test_call, NULL, -1, 0},
- {"parent intercept", intercept_test_call, NULL, -1, 0},
- {"append during call", append_in_chain_test_call, NULL, -1, 0},
- {"prepend during call", prepend_in_chain_test_call, NULL, -1, 0},
- {"insert after during call", insert_after_in_chain_test_call, NULL, -1, 0},
- {"insert before during call", insert_before_in_chain_test_call, NULL, -1, 0},
- {"delete after during call", delete_after_in_chain_test_call, NULL, -1, 0},
- {"delete before during call", delete_before_in_chain_test_call, NULL, -1, 0},
- {"delete nothing during call", delete_nothing_in_chain_test_call, NULL, -1, 0},
- {"create custom callback", custom_callback_test_add, NULL, -1, 0},
- {"unique custom callback", custom_callback_test_unique, NULL, -1, 0},
- {"append custom callback", custom_callback_test_append, NULL, -1, 0},
- {"prepend custom callback", custom_callback_test_prepend, NULL, -1, 0},
- {"insert after custom callback", custom_callback_test_insert_after, NULL, -1, 0},
- {"delete single custom callback", custom_callback_test_del_single, NULL, -1, 0},
- {"delete custom callback of multiple", custom_callback_test_del_multiple, NULL, -1, 0},
- {"delete custom callback type", custom_callback_test_del_type_single, NULL, -1, 0},
- {"delete custom callback type of multiple", custom_callback_test_del_type_multiple, NULL, -1, 0},
- {"clear with custom callback", custom_callback_test_clear, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"append/get id", append_test_id, NULL, -1, 0},
+ {"prepend/get id", prepend_test_id, NULL, -1, 0},
+ {"insert after/get id", insert_after_test_id, NULL, -1, 0},
+ {"shared id", shared_test_id, NULL, -1, 0},
+ {"unique id", unique_test_id, NULL, -1, 0},
+ {"del/call", del_test_call, NULL, -1, 0},
+ {"del_id/call", del_id_test_call, NULL, -1, 0},
+ {"del_data/call", del_data_test_call, NULL, -1, 0},
+ {"del_type/call", del_type_test_call, NULL, -1, 0},
+ {"del from empty", del_empty_test_call, NULL, -1, 0},
+ {"clear/call", clear_test_call, NULL, -1, 0},
+ {"append/call", append_test_call, NULL, -1, 0},
+ {"prepend/call", prepend_test_call, NULL, -1, 0},
+ {"parent notify", notify_test_call, NULL, -1, 0},
+ {"parent intercept", intercept_test_call, NULL, -1, 0},
+ {"append during call", append_in_chain_test_call, NULL, -1, 0},
+ {"prepend during call", prepend_in_chain_test_call, NULL, -1, 0},
+ {"insert after during call", insert_after_in_chain_test_call, NULL, -1, 0},
+ {"insert before during call", insert_before_in_chain_test_call, NULL, -1, 0},
+ {"delete after during call", delete_after_in_chain_test_call, NULL, -1, 0},
+ {"delete before during call", delete_before_in_chain_test_call, NULL, -1, 0},
+ {"delete nothing during call", delete_nothing_in_chain_test_call, NULL, -1, 0},
+ {"create custom callback", custom_callback_test_add, NULL, -1, 0},
+ {"unique custom callback", custom_callback_test_unique, NULL, -1, 0},
+ {"append custom callback", custom_callback_test_append, NULL, -1, 0},
+ {"prepend custom callback", custom_callback_test_prepend, NULL, -1, 0},
+ {"insert after custom callback", custom_callback_test_insert_after, NULL, -1, 0},
+ {"delete single custom callback", custom_callback_test_del_single, NULL, -1, 0},
+ {"delete custom callback of multiple", custom_callback_test_del_multiple, NULL, -1, 0},
+ {"delete custom callback type", custom_callback_test_del_type_single, NULL, -1, 0},
+ {"delete custom callback type of multiple", custom_callback_test_del_type_multiple, NULL, -1, 0},
+ {"clear with custom callback", custom_callback_test_clear, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
static unsigned int CALLBACK_CUSTOM_TYPE = 0;
@@ -113,12 +113,12 @@ append_test_id(char *buf, int len)
w = ewl_widget_new();
id = ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
if (id)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "invalid callback id returned");
+ LOG_FAILURE(buf, len, "invalid callback id returned");
ewl_widget_destroy(w);
@@ -137,12 +137,12 @@ prepend_test_id(char *buf, int len)
w = ewl_widget_new();
id = ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
if (id)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "invalid callback id returned");
+ LOG_FAILURE(buf, len, "invalid callback id returned");
ewl_widget_destroy(w);
@@ -161,14 +161,14 @@ insert_after_test_id(char *buf, int len)
w = ewl_widget_new();
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
id = ewl_callback_insert_after(w, EWL_CALLBACK_CONFIGURE, base_callback,
- w, base_callback, NULL);
+ w, base_callback, NULL);
if (id)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "invalid callback id returned");
+ LOG_FAILURE(buf, len, "invalid callback id returned");
ewl_widget_destroy(w);
@@ -187,14 +187,14 @@ shared_test_id(char *buf, int len)
w = ewl_widget_new();
id = ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
id2 = ewl_callback_append(w, EWL_CALLBACK_REALIZE, base_callback,
- NULL);
+ NULL);
if (id == id2)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback id's don't match");
+ LOG_FAILURE(buf, len, "callback id's don't match");
ewl_widget_destroy(w);
@@ -214,21 +214,21 @@ unique_test_id(char *buf, int len)
w = ewl_widget_new();
id = ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
id2 = ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, base_callback,
- w);
+ w);
if (id != id2) {
- id = ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- differing_callback, w);
- if (id != id2)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "callback with different functions"
- " id's match");
+ id = ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
+ differing_callback, w);
+ if (id != id2)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "callback with different functions"
+ " id's match");
}
else
- LOG_FAILURE(buf, len, "callback with different data id's match");
+ LOG_FAILURE(buf, len, "callback with different data id's match");
ewl_widget_destroy(w);
@@ -250,9 +250,9 @@ del_test_call(char *buf, int len)
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) != 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "del failed to remove callback");
+ LOG_FAILURE(buf, len, "del failed to remove callback");
ewl_widget_destroy(w);
@@ -271,14 +271,14 @@ del_id_test_call(char *buf, int len)
w = ewl_widget_new();
id = ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
ewl_callback_del_cb_id(w, EWL_CALLBACK_CONFIGURE, id);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) != 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "del failed to remove callback");
+ LOG_FAILURE(buf, len, "del failed to remove callback");
ewl_widget_destroy(w);
@@ -301,22 +301,22 @@ del_data_test_call(char *buf, int len)
if ((long)ewl_widget_data_get(w, w) != 1) {
- /*
- * Check that the data actually matches.
- */
- ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, base_callback,
- w);
- ewl_callback_del_with_data(w, EWL_CALLBACK_CONFIGURE,
- base_callback, NULL);
- ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
-
- if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "del_data removed callback");
+ /*
+ * Check that the data actually matches.
+ */
+ ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, base_callback,
+ w);
+ ewl_callback_del_with_data(w, EWL_CALLBACK_CONFIGURE,
+ base_callback, NULL);
+ ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
+
+ if ((long)ewl_widget_data_get(w, w) == 1)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "del_data removed callback");
}
else
- LOG_FAILURE(buf, len, "del_data failed to remove callback");
+ LOG_FAILURE(buf, len, "del_data failed to remove callback");
ewl_widget_destroy(w);
@@ -339,9 +339,9 @@ del_type_test_call(char *buf, int len)
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) != 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "del_type failed to remove callback");
+ LOG_FAILURE(buf, len, "del_type failed to remove callback");
ewl_widget_destroy(w);
@@ -388,9 +388,9 @@ clear_test_call(char *buf, int len)
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) != 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "clear failed to remove callback");
+ LOG_FAILURE(buf, len, "clear failed to remove callback");
ewl_widget_destroy(w);
@@ -412,9 +412,9 @@ append_test_call(char *buf, int len)
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -436,9 +436,9 @@ prepend_test_call(char *buf, int len)
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -458,7 +458,7 @@ notify_test_call(char *buf, int len)
parent = ewl_cell_new();
ewl_callback_del_type(parent, EWL_CALLBACK_CONFIGURE);
ewl_container_callback_notify(EWL_CONTAINER(parent),
- EWL_CALLBACK_CONFIGURE);
+ EWL_CALLBACK_CONFIGURE);
w = ewl_widget_new();
ewl_container_child_append(EWL_CONTAINER(parent), w);
@@ -467,23 +467,23 @@ notify_test_call(char *buf, int len)
* Add parent callback
*/
ewl_callback_prepend(parent, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
/*
* Add child callbacks.
*/
ewl_callback_del_type(w, EWL_CALLBACK_CONFIGURE);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, differing_callback,
- NULL);
+ NULL);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(parent, parent) == 1)
- if ((long)ewl_widget_data_get(w, w) == 2)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "callback function not called");
+ if ((long)ewl_widget_data_get(w, w) == 2)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "callback function not called");
else
- LOG_FAILURE(buf, len, "notify function not called");
+ LOG_FAILURE(buf, len, "notify function not called");
ewl_widget_destroy(w);
ewl_widget_destroy(parent);
@@ -504,7 +504,7 @@ intercept_test_call(char *buf, int len)
parent = ewl_cell_new();
ewl_callback_del_type(parent, EWL_CALLBACK_CONFIGURE);
ewl_container_callback_intercept(EWL_CONTAINER(parent),
- EWL_CALLBACK_CONFIGURE);
+ EWL_CALLBACK_CONFIGURE);
w = ewl_widget_new();
ewl_container_child_append(EWL_CONTAINER(parent), w);
@@ -513,24 +513,24 @@ intercept_test_call(char *buf, int len)
* Add parent callback
*/
ewl_callback_prepend(parent, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
/*
* Add child callbacks.
*/
ewl_callback_del_type(w, EWL_CALLBACK_CONFIGURE);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, differing_callback,
- NULL);
+ NULL);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(parent, parent) == 1) {
- if ((long)ewl_widget_data_get(w, w) == 2)
- LOG_FAILURE(buf, len, "callback function called");
- else
- ret = 1;
+ if ((long)ewl_widget_data_get(w, w) == 2)
+ LOG_FAILURE(buf, len, "callback function called");
+ else
+ ret = 1;
}
else
- LOG_FAILURE(buf, len, "intercept function not called");
+ LOG_FAILURE(buf, len, "intercept function not called");
ewl_widget_destroy(w);
ewl_widget_destroy(parent);
@@ -554,9 +554,9 @@ append_in_chain_test_call(char *buf, int len)
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -579,9 +579,9 @@ prepend_in_chain_test_call(char *buf, int len)
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) != 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function called");
+ LOG_FAILURE(buf, len, "callback function called");
ewl_widget_destroy(w);
@@ -601,15 +601,15 @@ insert_after_in_chain_test_call(char *buf, int len)
w = ewl_widget_new();
ewl_callback_del_type(w, EWL_CALLBACK_CONFIGURE);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, insert_after_callback,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, differing_callback,
- NULL);
+ NULL);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -629,15 +629,15 @@ insert_before_in_chain_test_call(char *buf, int len)
w = ewl_widget_new();
ewl_callback_del_type(w, EWL_CALLBACK_CONFIGURE);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, insert_before_callback,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, differing_callback,
- NULL);
+ NULL);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 2)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function called");
+ LOG_FAILURE(buf, len, "callback function called");
ewl_widget_destroy(w);
@@ -657,17 +657,17 @@ delete_before_in_chain_test_call(char *buf, int len)
w = ewl_widget_new();
ewl_callback_del_type(w, EWL_CALLBACK_CONFIGURE);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, differing_callback,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, delete_callback,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 2)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -687,17 +687,17 @@ delete_after_in_chain_test_call(char *buf, int len)
w = ewl_widget_new();
ewl_callback_del_type(w, EWL_CALLBACK_CONFIGURE);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, delete_callback,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, differing_callback,
- NULL);
+ NULL);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 2)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function called");
+ LOG_FAILURE(buf, len, "callback function called");
ewl_widget_destroy(w);
@@ -717,15 +717,15 @@ delete_nothing_in_chain_test_call(char *buf, int len)
w = ewl_widget_new();
ewl_callback_del_type(w, EWL_CALLBACK_CONFIGURE);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE, delete_callback,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, differing_callback,
- NULL);
+ NULL);
ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
if ((long)ewl_widget_data_get(w, w) == 2)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -742,9 +742,9 @@ custom_callback_test_add(char *buf, int len)
CALLBACK_CUSTOM_TYPE = ewl_callback_type_add();
if (CALLBACK_CUSTOM_TYPE > EWL_CALLBACK_MAX)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback type registration failed");
+ LOG_FAILURE(buf, len, "callback type registration failed");
return ret;
}
@@ -759,9 +759,9 @@ custom_callback_test_unique(char *buf, int len)
CALLBACK_CUSTOM_TYPE2 = ewl_callback_type_add();
if (CALLBACK_CUSTOM_TYPE != CALLBACK_CUSTOM_TYPE2)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback type not unique");
+ LOG_FAILURE(buf, len, "callback type not unique");
return ret;
}
@@ -780,9 +780,9 @@ custom_callback_test_append(char *buf, int len)
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -803,9 +803,9 @@ custom_callback_test_prepend(char *buf, int len)
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -824,13 +824,13 @@ custom_callback_test_insert_after(char *buf, int len)
w = ewl_widget_new();
ewl_callback_prepend(w, CALLBACK_CUSTOM_TYPE, base_callback, NULL);
ewl_callback_insert_after(w, CALLBACK_CUSTOM_TYPE, differing_callback,
- NULL, base_callback, NULL);
+ NULL, base_callback, NULL);
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
if ((long)ewl_widget_data_get(w, w) == 2)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -852,9 +852,9 @@ custom_callback_test_del_single(char *buf, int len)
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
if ((long)ewl_widget_data_get(w, w) == 0)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function called");
+ LOG_FAILURE(buf, len, "callback function called");
ewl_widget_destroy(w);
@@ -878,18 +878,18 @@ custom_callback_test_del_multiple(char *buf, int len)
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
if ((long)ewl_widget_data_get(w, w) == 2) {
- ewl_callback_append(w, CALLBACK_CUSTOM_TYPE, base_callback,
- NULL);
- ewl_callback_del(w, CALLBACK_CUSTOM_TYPE, differing_callback);
- ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
-
- if ((long)ewl_widget_data_get(w, w) == 1)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "first callback function called");
+ ewl_callback_append(w, CALLBACK_CUSTOM_TYPE, base_callback,
+ NULL);
+ ewl_callback_del(w, CALLBACK_CUSTOM_TYPE, differing_callback);
+ ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
+
+ if ((long)ewl_widget_data_get(w, w) == 1)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "first callback function called");
}
else
- LOG_FAILURE(buf, len, "second callback function called");
+ LOG_FAILURE(buf, len, "second callback function called");
ewl_widget_destroy(w);
@@ -911,9 +911,9 @@ custom_callback_test_del_type_single(char *buf, int len)
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
if ((long)ewl_widget_data_get(w, w) == 0)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function called");
+ LOG_FAILURE(buf, len, "callback function called");
ewl_widget_destroy(w);
@@ -937,14 +937,14 @@ custom_callback_test_del_type_multiple(char *buf, int len)
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE2);
if ((long)ewl_widget_data_get(w, w) == 2) {
- ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
- if ((long)ewl_widget_data_get(w, w) == 2)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "callback function called");
+ ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
+ if ((long)ewl_widget_data_get(w, w) == 2)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "callback function called");
}
else
- LOG_FAILURE(buf, len, "callback function not called");
+ LOG_FAILURE(buf, len, "callback function not called");
ewl_widget_destroy(w);
@@ -966,9 +966,9 @@ custom_callback_test_clear(char *buf, int len)
ewl_callback_call(w, CALLBACK_CUSTOM_TYPE);
if ((long)ewl_widget_data_get(w, w) == 0)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "callback function called");
+ LOG_FAILURE(buf, len, "callback function called");
ewl_widget_destroy(w);
@@ -1013,7 +1013,7 @@ static void
insert_after_callback(Ewl_Widget *w, void *event, void *data)
{
ewl_callback_insert_after(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL, insert_after_callback, NULL);
+ NULL, insert_after_callback, NULL);
event = data = NULL;
return;
@@ -1023,7 +1023,7 @@ static void
insert_before_callback(Ewl_Widget *w, void *event, void *data)
{
ewl_callback_insert_after(w, EWL_CALLBACK_CONFIGURE, base_callback,
- NULL, differing_callback, NULL);
+ NULL, differing_callback, NULL);
event = data = NULL;
return;
diff --git a/src/bin/tests/check/ewl_check_test.c b/src/bin/tests/check/ewl_check_test.c
index b839ca3..88f841e 100644
--- a/src/bin/tests/check/ewl_check_test.c
+++ b/src/bin/tests/check/ewl_check_test.c
@@ -10,8 +10,8 @@
static int check_test_new(char *buf, int len);
static Ewl_Unit_Test check_unit_tests[] = {
- {"check new", check_test_new, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"check new", check_test_new, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -19,7 +19,7 @@ test_info(Ewl_Test *test)
{
test->name = "Check";
test->tip = "The check class is a basic check\n"
- "for an undecorated checkbutton.";
+ "for an undecorated checkbutton.";
test->filename = __FILE__;
test->type = EWL_TEST_TYPE_UNIT;
test->unit_tests = check_unit_tests;
@@ -34,18 +34,18 @@ check_test_new(char *buf, int len)
check = ewl_check_new();
if (ewl_check_is_checked(EWL_CHECK(check)))
- LOG_FAILURE(buf, len, "default check state TRUE");
+ LOG_FAILURE(buf, len, "default check state TRUE");
else {
- ewl_check_checked_set(EWL_CHECK(check), TRUE);
- if (ewl_check_is_checked(EWL_CHECK(check))) {
- ewl_check_checked_set(EWL_CHECK(check), FALSE);
- if (!ewl_check_is_checked(EWL_CHECK(check)))
- ret = 1;
- else
- LOG_FAILURE(buf, len, "check state TRUE");
- }
- else
- LOG_FAILURE(buf, len, "check state FALSE");
+ ewl_check_checked_set(EWL_CHECK(check), TRUE);
+ if (ewl_check_is_checked(EWL_CHECK(check))) {
+ ewl_check_checked_set(EWL_CHECK(check), FALSE);
+ if (!ewl_check_is_checked(EWL_CHECK(check)))
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "check state TRUE");
+ }
+ else
+ LOG_FAILURE(buf, len, "check state FALSE");
}
ewl_widget_destroy(check);
diff --git a/src/bin/tests/colordialog/ewl_colordialog_test.c b/src/bin/tests/colordialog/ewl_colordialog_test.c
index cdcfbec..c1a60a9 100644
--- a/src/bin/tests/colordialog/ewl_colordialog_test.c
+++ b/src/bin/tests/colordialog/ewl_colordialog_test.c
@@ -8,7 +8,7 @@
static int create_test(Ewl_Container *win);
static void colordialog_cb_launch(Ewl_Widget *w, void *ev, void *data);
static void colordialog_cb_value_changed(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
void
test_info(Ewl_Test *test)
@@ -50,22 +50,22 @@ colordialog_cb_value_changed(Ewl_Widget *w, void *ev, void *data __UNUSED__)
cd_ev = ev;
if (cd_ev->response == EWL_STOCK_OK)
{
- Ewl_Widget *o;
- unsigned int r, g, b, a;
+ Ewl_Widget *o;
+ unsigned int r, g, b, a;
- o = ewl_widget_name_find("colour_preview");
+ o = ewl_widget_name_find("colour_preview");
- ewl_colordialog_current_rgb_get(EWL_COLORDIALOG(w), &r, &g, &b);
- a = ewl_colordialog_alpha_get(EWL_COLORDIALOG(w));
+ ewl_colordialog_current_rgb_get(EWL_COLORDIALOG(w), &r, &g, &b);
+ a = ewl_colordialog_alpha_get(EWL_COLORDIALOG(w));
- ewl_widget_color_set(o, r, g, b, a);
+ ewl_widget_color_set(o, r, g, b, a);
}
ewl_widget_destroy(w);
}
static void
colordialog_cb_launch(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *o;
unsigned int r, g, b, a;
@@ -76,7 +76,7 @@ colordialog_cb_launch(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
o = ewl_colordialog_new();
ewl_colordialog_previous_rgba_set(EWL_COLORDIALOG(o), r, g, b, a);
ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- colordialog_cb_value_changed, NULL);
+ colordialog_cb_value_changed, NULL);
ewl_widget_show(o);
}
diff --git a/src/bin/tests/colorpicker/ewl_colorpicker_test.c b/src/bin/tests/colorpicker/ewl_colorpicker_test.c
index f38ec1d..121dc5c 100644
--- a/src/bin/tests/colorpicker/ewl_colorpicker_test.c
+++ b/src/bin/tests/colorpicker/ewl_colorpicker_test.c
@@ -26,7 +26,7 @@ create_test(Ewl_Container *box)
colorpicker = ewl_colorpicker_new();
ewl_container_child_append(EWL_CONTAINER(box), colorpicker);
ewl_callback_append(colorpicker, EWL_CALLBACK_VALUE_CHANGED,
- color_value_changed, NULL);
+ color_value_changed, NULL);
ewl_widget_show(colorpicker);
return 1;
diff --git a/src/bin/tests/combo/ewl_combo_test.c b/src/bin/tests/combo/ewl_combo_test.c
index d97045e..87df89c 100644
--- a/src/bin/tests/combo/ewl_combo_test.c
+++ b/src/bin/tests/combo/ewl_combo_test.c
@@ -23,25 +23,25 @@ static int create_test(Ewl_Container *win);
static void combo_value_changed(Ewl_Widget *w, void *ev, void *data);
static Ewl_Widget *combo_test_data_header_fetch(void *data, unsigned int col);
static void *combo_test_data_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
static unsigned int combo_test_data_count_get(void *data);
static void combo_cb_add(Ewl_Widget *w, void *ev, void *data);
static void combo_cb_clear(Ewl_Widget *w, void *ev, void *data);
static void combo_cb_entry_changed(Ewl_Widget *w, void *ev, void *data);
static Ewl_Widget *combo_test_editable_cb_header_fetch(void *data,
- unsigned int col);
+ unsigned int col);
static Ewl_Widget *combo_test_editable_cb_widget_fetch(void *data,
- unsigned int row,
- unsigned int col);
+ unsigned int row,
+ unsigned int col);
void
test_info(Ewl_Test *test)
{
test->name = "Combo";
test->tip = "Defines a combo box used internally.\n"
- "The contents of the box are not drawn\n"
- "outside of the evas.";
+ "The contents of the box are not drawn\n"
+ "outside of the evas.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_MISC;
@@ -75,7 +75,7 @@ create_test(Ewl_Container *box)
ewl_widget_name_set(combo, "combo_label");
ewl_container_child_append(EWL_CONTAINER(hbox), combo);
ewl_callback_append(combo, EWL_CALLBACK_VALUE_CHANGED,
- combo_value_changed, NULL);
+ combo_value_changed, NULL);
ewl_mvc_model_set(EWL_MVC(combo), model);
ewl_mvc_view_set(EWL_MVC(combo), view);
ewl_mvc_data_set(EWL_MVC(combo), data);
@@ -95,7 +95,7 @@ create_test(Ewl_Container *box)
ewl_combo_popup_container_set(EWL_COMBO(combo), EWL_CONTAINER(grid));
ewl_container_child_append(EWL_CONTAINER(hbox), combo);
ewl_callback_append(combo, EWL_CALLBACK_VALUE_CHANGED,
- combo_value_changed, NULL);
+ combo_value_changed, NULL);
ewl_mvc_model_set(EWL_MVC(combo), model);
ewl_mvc_view_set(EWL_MVC(combo), view);
ewl_mvc_data_set(EWL_MVC(combo), data);
@@ -110,13 +110,13 @@ create_test(Ewl_Container *box)
view = ewl_view_new();
ewl_view_widget_fetch_set(view, combo_test_editable_cb_widget_fetch);
ewl_view_header_fetch_set(view,
- combo_test_editable_cb_header_fetch);
+ combo_test_editable_cb_header_fetch);
combo = ewl_combo_new();
ewl_widget_name_set(combo, "combo_custom");
ewl_container_child_append(EWL_CONTAINER(hbox), combo);
ewl_callback_append(combo, EWL_CALLBACK_VALUE_CHANGED,
- combo_value_changed, NULL);
+ combo_value_changed, NULL);
ewl_mvc_model_set(EWL_MVC(combo), model);
ewl_mvc_view_set(EWL_MVC(combo), view);
ewl_mvc_data_set(EWL_MVC(combo), data);
@@ -152,21 +152,21 @@ combo_test_data_setup(void)
unsigned int i;
const char *icons[] = {
- EWL_ICON_EDIT_COPY,
- EWL_ICON_EDIT_CUT,
- EWL_ICON_EDIT_DELETE,
- EWL_ICON_EDIT_FIND,
- EWL_ICON_EDIT_FIND_REPLACE,
- EWL_ICON_EDIT_PASTE,
- EWL_ICON_EDIT_REDO,
- EWL_ICON_EDIT_SELECT_ALL,
- EWL_ICON_EDIT_UNDO,
- EWL_ICON_FORMAT_INDENT_LESS,
- EWL_ICON_FORMAT_INDENT_MORE,
- EWL_ICON_FORMAT_JUSTIFY_CENTER,
- EWL_ICON_FORMAT_JUSTIFY_FILL,
- EWL_ICON_FORMAT_JUSTIFY_LEFT,
- EWL_ICON_FORMAT_JUSTIFY_RIGHT,
+ EWL_ICON_EDIT_COPY,
+ EWL_ICON_EDIT_CUT,
+ EWL_ICON_EDIT_DELETE,
+ EWL_ICON_EDIT_FIND,
+ EWL_ICON_EDIT_FIND_REPLACE,
+ EWL_ICON_EDIT_PASTE,
+ EWL_ICON_EDIT_REDO,
+ EWL_ICON_EDIT_SELECT_ALL,
+ EWL_ICON_EDIT_UNDO,
+ EWL_ICON_FORMAT_INDENT_LESS,
+ EWL_ICON_FORMAT_INDENT_MORE,
+ EWL_ICON_FORMAT_JUSTIFY_CENTER,
+ EWL_ICON_FORMAT_JUSTIFY_FILL,
+ EWL_ICON_FORMAT_JUSTIFY_LEFT,
+ EWL_ICON_FORMAT_JUSTIFY_RIGHT,
};
data = calloc(1, sizeof(Ewl_Combo_Test_Data));
@@ -176,10 +176,10 @@ combo_test_data_setup(void)
for (i = 0; i < data->count; i++)
{
- const char *icon;
+ const char *icon;
- icon = ewl_icon_theme_icon_path_get(icons[i], EWL_ICON_SIZE_MEDIUM);
- data->data[i] = strdup((icon ? icon : icons[i]));
+ icon = ewl_icon_theme_icon_path_get(icons[i], EWL_ICON_SIZE_MEDIUM);
+ data->data[i] = strdup((icon ? icon : icons[i]));
}
return data;
@@ -199,15 +199,15 @@ combo_test_data_header_fetch(void *data __UNUSED__, unsigned int col __UNUSED__)
static void *
combo_test_data_fetch(void *data, unsigned int row,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Combo_Test_Data *d;
d = data;
if (row < d->count)
- return d->data[row];
+ return d->data[row];
else
- return NULL;
+ return NULL;
}
static unsigned int
@@ -221,7 +221,7 @@ combo_test_data_count_get(void *data)
static void
combo_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Combo_Test_Data *d;
Ewl_Selection_Idx *idx;
@@ -231,13 +231,13 @@ combo_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
/*
printf("value changed to %d %p)\n",
- idx->row, d->data[idx->row]);
+ idx->row, d->data[idx->row]);
*/
}
static void
combo_cb_add(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *c;
Ewl_Combo_Test_Data *d;
@@ -261,7 +261,7 @@ combo_cb_add(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
combo_cb_clear(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *c;
Ewl_Combo_Test_Data *d;
@@ -298,22 +298,22 @@ combo_test_editable_cb_header_fetch(void *data, unsigned int col __UNUSED__)
if (idx)
{
- val = strrchr(d->data[idx->row], '/');
- ewl_text_text_set(EWL_TEXT(o),
- (val ? val + 1 : d->data[idx->row]));
-
- o2 = ewl_image_new();
- ewl_image_file_path_set(EWL_IMAGE(o2), d->data[idx->row]);
- ewl_container_child_append(EWL_CONTAINER(w), o2);
- ewl_widget_show(o2);
+ val = strrchr(d->data[idx->row], '/');
+ ewl_text_text_set(EWL_TEXT(o),
+ (val ? val + 1 : d->data[idx->row]));
+
+ o2 = ewl_image_new();
+ ewl_image_file_path_set(EWL_IMAGE(o2), d->data[idx->row]);
+ ewl_container_child_append(EWL_CONTAINER(w), o2);
+ ewl_widget_show(o2);
}
else
- ewl_text_text_set(EWL_TEXT(o), val);
+ ewl_text_text_set(EWL_TEXT(o), val);
ewl_container_child_append(EWL_CONTAINER(w), o);
ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- combo_cb_entry_changed, NULL);
+ combo_cb_entry_changed, NULL);
ewl_widget_show(o);
return w;
@@ -321,7 +321,7 @@ combo_test_editable_cb_header_fetch(void *data, unsigned int col __UNUSED__)
static Ewl_Widget *
combo_test_editable_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Widget *w;
Ewl_Widget *o;
@@ -346,7 +346,7 @@ combo_test_editable_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
static void
combo_cb_entry_changed(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
printf("value changed to (%s)\n", ewl_text_text_get(EWL_TEXT(w)));
}
diff --git a/src/bin/tests/config/ewl_config_test.c b/src/bin/tests/config/ewl_config_test.c
index 192c468..66b284e 100644
--- a/src/bin/tests/config/ewl_config_test.c
+++ b/src/bin/tests/config/ewl_config_test.c
@@ -27,16 +27,16 @@ static int remove_key(char *buf, int len);
*/
static Ewl_Unit_Test config_unit_tests[] = {
- {"string get/set", string_get_set, NULL, -1, 0},
- {"int get/set", int_get_set, NULL, -1, 0},
- {"float get/set", float_get_set, NULL, -1, 0},
- {"color get/set", color_get_set, NULL, -1, 0},
- {"string overwrite", string_overwrite, NULL, -1, 0},
- {"int overwrite", int_overwrite, NULL, -1, 0},
- {"float overwrite", float_overwrite, NULL, -1, 0},
- {"color overwrite", color_overwrite, NULL, -1, 0},
- {"remove key", remove_key, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"string get/set", string_get_set, NULL, -1, 0},
+ {"int get/set", int_get_set, NULL, -1, 0},
+ {"float get/set", float_get_set, NULL, -1, 0},
+ {"color get/set", color_get_set, NULL, -1, 0},
+ {"string overwrite", string_overwrite, NULL, -1, 0},
+ {"int overwrite", int_overwrite, NULL, -1, 0},
+ {"float overwrite", float_overwrite, NULL, -1, 0},
+ {"color overwrite", color_overwrite, NULL, -1, 0},
+ {"remove key", remove_key, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -67,28 +67,28 @@ string_get_set(char *buf, int len)
/* first try to get a string that cannot exist */
value = ewl_config_string_get(conf, "climate");
if (value) {
- LOG_FAILURE(buf, len, "config finds an string for"
- "non-existing key");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config finds an string for"
+ "non-existing key");
+ goto CLEANUP;
}
/* now try to get the weather report */
value = ewl_config_string_get(conf, "weather");
if (!value) {
- LOG_FAILURE(buf, len, "config does not find the string we set");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config does not find the string we set");
+ goto CLEANUP;
}
if (strcmp(value, string)) {
- LOG_FAILURE(buf, len, "config returned a different string");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returned a different string");
+ goto CLEANUP;
}
/* the config must not save our address */
if (value == string) {
- LOG_FAILURE(buf, len, "config returned the address of the set "
- "string");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returned the address of the set "
+ "string");
+ goto CLEANUP;
}
/* everything went fine */
@@ -120,16 +120,16 @@ int_get_set(char *buf, int len)
/* on error it should return 0 */
if (value != 0) {
- LOG_FAILURE(buf, len, "config returns a number unequal zero for"
- "non-existing key");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returns a number unequal zero for"
+ "non-existing key");
+ goto CLEANUP;
}
/* now try to get the set number */
value = ewl_config_int_get(conf, "number");
if (value != number) {
- LOG_FAILURE(buf, len, "config returns wrong number");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returns wrong number");
+ goto CLEANUP;
}
/* everything went fine */
@@ -161,16 +161,16 @@ float_get_set(char *buf, int len)
/* on error it should return 0.0, according to the docs */
if (value != 0.0) {
- LOG_FAILURE(buf, len, "config returns a number unequal zero for"
- "non-existing key");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returns a number unequal zero for"
+ "non-existing key");
+ goto CLEANUP;
}
/* now try to get the set velocity */
value = ewl_config_float_get(conf, "velocity");
if (value != number) {
- LOG_FAILURE(buf, len, "config returns wrong number");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returns wrong number");
+ goto CLEANUP;
}
/* everything went fine */
@@ -195,23 +195,23 @@ color_get_set(char *buf, int len)
conf = ewl_config_new("unit test");
ewl_config_color_set(conf, "bg_color", 0, 100, 200, 255,
- EWL_STATE_TRANSIENT);
+ EWL_STATE_TRANSIENT);
/* first try to get a value that cannot exist */
ewl_config_color_get(conf, "fg_color", &r, &g, &b, &a);
/* on error it should return 0 */
if (r != 0 || g != 0 || b != 0 || a != 0) {
- LOG_FAILURE(buf, len, "config returns not (0,0,0,0) for "
- "non-existing key");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returns not (0,0,0,0) for "
+ "non-existing key");
+ goto CLEANUP;
}
/* now try to get the set number */
ewl_config_color_get(conf, "bg_color", &r, &g, &b, &a);
if (r != 0 || g != 100 || b != 200 || a != 255) {
- LOG_FAILURE(buf, len, "config returns wrong color");
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "config returns wrong color");
+ goto CLEANUP;
}
/* everything went fine */
@@ -232,30 +232,30 @@ string_overwrite(char *buf, int len)
int ret = 1;
Ewl_Config *conf;
const char *strings[] = {
- "First Value",
- "Second Value",
- "Yet another",
- "The last one",
- NULL
+ "First Value",
+ "Second Value",
+ "Yet another",
+ "The last one",
+ NULL
};
const char **string = strings;
conf = ewl_config_new("unit test");
while (*string == NULL) {
- const char *value;
-
- ewl_config_string_set(conf, "test key", *string,
- EWL_STATE_TRANSIENT);
- value = ewl_config_string_get(conf, "test key");
-
- if (strcmp(value, *string)) {
- LOG_FAILURE(buf, len, "The returned string is different"
- " from the set string");
- ret = 0;
- break;
- }
- string++;
+ const char *value;
+
+ ewl_config_string_set(conf, "test key", *string,
+ EWL_STATE_TRANSIENT);
+ value = ewl_config_string_get(conf, "test key");
+
+ if (strcmp(value, *string)) {
+ LOG_FAILURE(buf, len, "The returned string is different"
+ " from the set string");
+ ret = 0;
+ break;
+ }
+ string++;
}
ewl_config_destroy(conf);
@@ -276,18 +276,18 @@ int_overwrite(char *buf, int len)
conf = ewl_config_new("unit test");
for (i = 0; i < 12; i++) {
- int v = RAND_RANGE(-1000, 1000);
- int v_r;
-
- ewl_config_int_set(conf, "test key", v, EWL_STATE_TRANSIENT);
- v_r = ewl_config_int_get(conf, "test key");
-
- if (v_r != v) {
- LOG_FAILURE(buf, len, "The returned int is different"
- " from the set int");
- ret = 0;
- break;
- }
+ int v = RAND_RANGE(-1000, 1000);
+ int v_r;
+
+ ewl_config_int_set(conf, "test key", v, EWL_STATE_TRANSIENT);
+ v_r = ewl_config_int_get(conf, "test key");
+
+ if (v_r != v) {
+ LOG_FAILURE(buf, len, "The returned int is different"
+ " from the set int");
+ ret = 0;
+ break;
+ }
}
ewl_config_destroy(conf);
@@ -308,18 +308,18 @@ float_overwrite(char *buf, int len)
conf = ewl_config_new("unit test");
for (i = 0; i < 12; i++) {
- float v = rand();
- float v_r;
-
- ewl_config_int_set(conf, "test key", v, EWL_STATE_TRANSIENT);
- v_r = ewl_config_int_get(conf, "test key");
-
- if (v_r != v) {
- LOG_FAILURE(buf, len, "The returned float is different"
- " from the set float");
- ret = 0;
- break;
- }
+ float v = rand();
+ float v_r;
+
+ ewl_config_int_set(conf, "test key", v, EWL_STATE_TRANSIENT);
+ v_r = ewl_config_int_get(conf, "test key");
+
+ if (v_r != v) {
+ LOG_FAILURE(buf, len, "The returned float is different"
+ " from the set float");
+ ret = 0;
+ break;
+ }
}
ewl_config_destroy(conf);
@@ -340,22 +340,22 @@ color_overwrite(char *buf, int len)
conf = ewl_config_new("unit test");
for (i = 0; i < 12; i++) {
- int r = RAND_RANGE(0, 255);
- int g = RAND_RANGE(0, 255);
- int b = RAND_RANGE(0, 255);
- int a = RAND_RANGE(0, 255);
- int r_r, g_r, b_r, a_r;
-
- ewl_config_color_set(conf, "test key", r, g, b, a,
- EWL_STATE_TRANSIENT);
- ewl_config_color_get(conf, "test key", &r_r, &g_r, &b_r, &a_r);
-
- if (r_r != r || g_r != g || b_r != b || a_r != a) {
- LOG_FAILURE(buf, len, "The returned color is different"
- " from the set color");
- ret = 0;
- break;
- }
+ int r = RAND_RANGE(0, 255);
+ int g = RAND_RANGE(0, 255);
+ int b = RAND_RANGE(0, 255);
+ int a = RAND_RANGE(0, 255);
+ int r_r, g_r, b_r, a_r;
+
+ ewl_config_color_set(conf, "test key", r, g, b, a,
+ EWL_STATE_TRANSIENT);
+ ewl_config_color_get(conf, "test key", &r_r, &g_r, &b_r, &a_r);
+
+ if (r_r != r || g_r != g || b_r != b || a_r != a) {
+ LOG_FAILURE(buf, len, "The returned color is different"
+ " from the set color");
+ ret = 0;
+ break;
+ }
}
ewl_config_destroy(conf);
@@ -405,81 +405,81 @@ remove_key(char *buf, int len)
ewl_config_key_remove(cfg, "/test/key");
if (ecore_hash_get(cfg->data.system, "/test/key") != NULL)
{
- LOG_FAILURE(buf, len, "System hash contains key after key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "System hash contains key after key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.user, "/test/key") != NULL)
{
- LOG_FAILURE(buf, len, "User hash contains key after key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "User hash contains key after key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.instance, "/test/key") != NULL)
{
- LOG_FAILURE(buf, len, "Instance hash contains key after key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "Instance hash contains key after key remove");
+ ret = 0;
+ goto EXIT;
}
ewl_config_system_key_remove(cfg, "/system/remove");
if (ecore_hash_get(cfg->data.system, "/system/remove") != NULL)
{
- LOG_FAILURE(buf, len, "System hash contains key after system key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "System hash contains key after system key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.user, "/system/remove") == NULL)
{
- LOG_FAILURE(buf, len, "User hash missing key after system key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "User hash missing key after system key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.instance, "/system/remove") == NULL)
{
- LOG_FAILURE(buf, len, "Instance hash missing key after system key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "Instance hash missing key after system key remove");
+ ret = 0;
+ goto EXIT;
}
ewl_config_user_key_remove(cfg, "/user/remove");
if (ecore_hash_get(cfg->data.system, "/user/remove") == NULL)
{
- LOG_FAILURE(buf, len, "System hash missing key after user key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "System hash missing key after user key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.user, "/user/remove") != NULL)
{
- LOG_FAILURE(buf, len, "User hash contains key after user key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "User hash contains key after user key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.instance, "/user/remove") == NULL)
{
- LOG_FAILURE(buf, len, "Instance hash missing key after user key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "Instance hash missing key after user key remove");
+ ret = 0;
+ goto EXIT;
}
ewl_config_instance_key_remove(cfg, "/instance/remove");
if (ecore_hash_get(cfg->data.system, "/instance/remove") == NULL)
{
- LOG_FAILURE(buf, len, "System hash missing key after instance key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "System hash missing key after instance key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.user, "/instance/remove") == NULL)
{
- LOG_FAILURE(buf, len, "User hash missing key after instance key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "User hash missing key after instance key remove");
+ ret = 0;
+ goto EXIT;
}
else if (ecore_hash_get(cfg->data.instance, "/instance/remove") != NULL)
{
- LOG_FAILURE(buf, len, "Instance hash contains key after instance key remove");
- ret = 0;
- goto EXIT;
+ LOG_FAILURE(buf, len, "Instance hash contains key after instance key remove");
+ ret = 0;
+ goto EXIT;
}
EXIT:
diff --git a/src/bin/tests/container/ewl_container_test.c b/src/bin/tests/container/ewl_container_test.c
index d1d6805..8f06909 100644
--- a/src/bin/tests/container/ewl_container_test.c
+++ b/src/bin/tests/container/ewl_container_test.c
@@ -9,8 +9,8 @@
static int switch_parents(char *buf, int len);
static Ewl_Unit_Test container_unit_tests[] = {
- {"switch parents", switch_parents, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"switch parents", switch_parents, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -37,8 +37,8 @@ switch_parents(char *buf, int len)
if (!(w->parent == p1))
{
- snprintf(buf, len, "initial parent incorrect (%p vs %p)", w->parent, p1);
- return FALSE;
+ snprintf(buf, len, "initial parent incorrect (%p vs %p)", w->parent, p1);
+ return FALSE;
}
p2 = ewl_vbox_new();
@@ -47,8 +47,8 @@ switch_parents(char *buf, int len)
ewl_container_child_append(EWL_CONTAINER(p2), w);
if (!(w->parent == p2))
{
- snprintf(buf, len, "reparent incorrect (%p vs %p)", w->parent, p2);
- return FALSE;
+ snprintf(buf, len, "reparent incorrect (%p vs %p)", w->parent, p2);
+ return FALSE;
}
return TRUE;
diff --git a/src/bin/tests/dialog/ewl_dialog_test.c b/src/bin/tests/dialog/ewl_dialog_test.c
index 19f6371..b1c69a0 100644
--- a/src/bin/tests/dialog/ewl_dialog_test.c
+++ b/src/bin/tests/dialog/ewl_dialog_test.c
@@ -47,14 +47,14 @@ create_test(Ewl_Container *box)
chain = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(chain), "Top");
ewl_radiobutton_value_set(EWL_RADIOBUTTON(chain),
- (void *)EWL_POSITION_TOP);
+ (void *)EWL_POSITION_TOP);
ewl_container_child_append(EWL_CONTAINER(border), chain);
ewl_widget_show(chain);
o = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(o), "Right");
ewl_radiobutton_value_set(EWL_RADIOBUTTON(o),
- (void *)EWL_POSITION_RIGHT);
+ (void *)EWL_POSITION_RIGHT);
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o), EWL_RADIOBUTTON(chain));
ewl_container_child_append(EWL_CONTAINER(border), o);
ewl_widget_show(o);
@@ -62,7 +62,7 @@ create_test(Ewl_Container *box)
o = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(o), "Left");
ewl_radiobutton_value_set(EWL_RADIOBUTTON(o),
- (void *)EWL_POSITION_LEFT);
+ (void *)EWL_POSITION_LEFT);
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o), EWL_RADIOBUTTON(chain));
ewl_container_child_append(EWL_CONTAINER(border), o);
ewl_widget_show(o);
@@ -70,7 +70,7 @@ create_test(Ewl_Container *box)
o = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(o), "Bottom");
ewl_radiobutton_value_set(EWL_RADIOBUTTON(o),
- (void *)EWL_POSITION_BOTTOM);
+ (void *)EWL_POSITION_BOTTOM);
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o), EWL_RADIOBUTTON(chain));
ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), TRUE);
ewl_container_child_append(EWL_CONTAINER(border), o);
@@ -95,7 +95,7 @@ run_dialog(Ewl_Widget *w, void *ev __UNUSED__, void *data)
radio = EWL_RADIOBUTTON(data);
pos = (Ewl_Position)ewl_radiobutton_value_get(
- ewl_radiobutton_chain_selected_get(radio));
+ ewl_radiobutton_chain_selected_get(radio));
/* this is a bad cast, but the ewl_test will ever be a standalone app */
win = EWL_WINDOW(ewl_embed_widget_find(w));
@@ -105,21 +105,21 @@ run_dialog(Ewl_Widget *w, void *ev __UNUSED__, void *data)
ewl_window_class_set(EWL_WINDOW(dialog), "EFL Test Application");
ewl_window_transient_for(EWL_WINDOW(dialog), win);
ewl_callback_append(dialog, EWL_CALLBACK_DELETE_WINDOW,
- dialog_delete_cb, NULL);
+ dialog_delete_cb, NULL);
ewl_dialog_action_position_set(EWL_DIALOG(dialog), pos);
ewl_widget_show(dialog);
if (pos == EWL_POSITION_TOP)
- ewl_dialog_active_area_set(EWL_DIALOG(dialog),
- EWL_POSITION_BOTTOM);
+ ewl_dialog_active_area_set(EWL_DIALOG(dialog),
+ EWL_POSITION_BOTTOM);
else if (pos == EWL_POSITION_BOTTOM)
- ewl_dialog_active_area_set(EWL_DIALOG(dialog),
- EWL_POSITION_TOP);
+ ewl_dialog_active_area_set(EWL_DIALOG(dialog),
+ EWL_POSITION_TOP);
else if (pos == EWL_POSITION_LEFT)
- ewl_dialog_active_area_set(EWL_DIALOG(dialog),
- EWL_POSITION_RIGHT);
+ ewl_dialog_active_area_set(EWL_DIALOG(dialog),
+ EWL_POSITION_RIGHT);
else if (pos == EWL_POSITION_RIGHT)
- ewl_dialog_active_area_set(EWL_DIALOG(dialog),
- EWL_POSITION_LEFT);
+ ewl_dialog_active_area_set(EWL_DIALOG(dialog),
+ EWL_POSITION_LEFT);
hbox = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(dialog), hbox);
@@ -128,8 +128,8 @@ run_dialog(Ewl_Widget *w, void *ev __UNUSED__, void *data)
o = ewl_image_new();
ewl_image_file_set(EWL_IMAGE(o),
- ewl_icon_theme_icon_path_get(EWL_ICON_DIALOG_INFORMATION, 46),
- EWL_ICON_DIALOG_INFORMATION);
+ ewl_icon_theme_icon_path_get(EWL_ICON_DIALOG_INFORMATION, 46),
+ EWL_ICON_DIALOG_INFORMATION);
ewl_container_child_append(EWL_CONTAINER(hbox), o);
ewl_object_padding_set(EWL_OBJECT(o), 0, 20, 0, 0);
ewl_widget_show(o);
@@ -147,14 +147,14 @@ run_dialog(Ewl_Widget *w, void *ev __UNUSED__, void *data)
ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_OK);
ewl_container_child_append(EWL_CONTAINER(dialog), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- dialog_response_cb, dialog);
+ dialog_response_cb, dialog);
ewl_widget_show(o);
o = ewl_button_new();
ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_CANCEL);
ewl_container_child_append(EWL_CONTAINER(dialog), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- dialog_response_cb, dialog);
+ dialog_response_cb, dialog);
ewl_widget_show(o);
ewl_dialog_active_area_set(EWL_DIALOG(dialog), EWL_POSITION_TOP);
@@ -170,9 +170,9 @@ dialog_response_cb(Ewl_Widget *w, void *ev __UNUSED__, void *data)
o = ewl_widget_name_find("dialog_label");
response = ewl_stock_type_get(EWL_STOCK(w));
if (response == EWL_STOCK_OK)
- ewl_label_text_set(EWL_LABEL(o), "OK button clicked.");
+ ewl_label_text_set(EWL_LABEL(o), "OK button clicked.");
else
- ewl_label_text_set(EWL_LABEL(o), "Cancel button clicked.");
+ ewl_label_text_set(EWL_LABEL(o), "Cancel button clicked.");
/* get rid of the dialog box */
ewl_widget_destroy(EWL_WIDGET(data));
diff --git a/src/bin/tests/dnd_snoop/ewl_dnd_snoop_test.c b/src/bin/tests/dnd_snoop/ewl_dnd_snoop_test.c
index a05e6e7..53bdaae 100644
--- a/src/bin/tests/dnd_snoop/ewl_dnd_snoop_test.c
+++ b/src/bin/tests/dnd_snoop/ewl_dnd_snoop_test.c
@@ -56,7 +56,7 @@ test_info(Ewl_Test *test)
{
test->name = "DND Snoop";
test->tip = "Watches for Xdnd events and prints information "
- "to the console.";
+ "to the console.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_ADVANCED;
@@ -71,35 +71,35 @@ create_test(Ewl_Container *box)
/* Register DND handlers */
#ifdef ENABLE_EWL_SOFTWARE_X11
ewl_dnd_enter_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_ENTER,
- ewl_dnd_snoop_cb_enter, NULL);
+ ECORE_X_EVENT_XDND_ENTER,
+ ewl_dnd_snoop_cb_enter, NULL);
ewl_dnd_position_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_POSITION,
- ewl_dnd_snoop_cb_position, NULL);
+ ECORE_X_EVENT_XDND_POSITION,
+ ewl_dnd_snoop_cb_position, NULL);
ewl_dnd_status_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_STATUS,
- ewl_dnd_snoop_cb_status, NULL);
+ ECORE_X_EVENT_XDND_STATUS,
+ ewl_dnd_snoop_cb_status, NULL);
ewl_dnd_leave_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_LEAVE,
- ewl_dnd_snoop_cb_leave, NULL);
+ ECORE_X_EVENT_XDND_LEAVE,
+ ewl_dnd_snoop_cb_leave, NULL);
ewl_dnd_drop_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_DROP,
- ewl_dnd_snoop_cb_drop, NULL);
+ ECORE_X_EVENT_XDND_DROP,
+ ewl_dnd_snoop_cb_drop, NULL);
ewl_dnd_finished_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_FINISHED,
- ewl_dnd_snoop_cb_finished, NULL);
+ ECORE_X_EVENT_XDND_FINISHED,
+ ewl_dnd_snoop_cb_finished, NULL);
ewl_dnd_selection_clear_handler = ecore_event_handler_add(
- ECORE_X_EVENT_SELECTION_CLEAR,
- ewl_dnd_snoop_cb_selection_clear, NULL);
+ ECORE_X_EVENT_SELECTION_CLEAR,
+ ewl_dnd_snoop_cb_selection_clear, NULL);
ewl_dnd_selection_request_handler = ecore_event_handler_add(
- ECORE_X_EVENT_SELECTION_REQUEST,
- ewl_dnd_snoop_cb_selection_request, NULL);
+ ECORE_X_EVENT_SELECTION_REQUEST,
+ ewl_dnd_snoop_cb_selection_request, NULL);
ewl_dnd_selection_notify_handler = ecore_event_handler_add(
- ECORE_X_EVENT_SELECTION_NOTIFY,
- ewl_dnd_snoop_cb_selection_notify, NULL);
+ ECORE_X_EVENT_SELECTION_NOTIFY,
+ ewl_dnd_snoop_cb_selection_notify, NULL);
ewl_dnd_client_message_handler = ecore_event_handler_add(
- ECORE_X_EVENT_CLIENT_MESSAGE,
- ewl_dnd_snoop_cb_client_message, NULL);
+ ECORE_X_EVENT_CLIENT_MESSAGE,
+ ewl_dnd_snoop_cb_client_message, NULL);
#endif
o = ewl_entry_new();
@@ -122,7 +122,7 @@ create_test(Ewl_Container *box)
ewl_text_glow_color_set(EWL_TEXT(o), 0, 255, 0, 128);
ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_widget_show(o);
scroll = ewl_scrollpane_new();
@@ -144,7 +144,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o), "Clear");
ewl_container_child_append(EWL_CONTAINER(box), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_dnd_snoop_cb_clear, NULL);
+ ewl_dnd_snoop_cb_clear, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
ewl_widget_show(o);
@@ -168,7 +168,7 @@ ewl_dnd_snoop_output(char *buf)
static void
ewl_dnd_snoop_cb_dnd_position(Ewl_Widget *w, void *event,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
char buf[PATH_MAX];
Ewl_Event_Mouse *ev = event;
@@ -178,7 +178,7 @@ ewl_dnd_snoop_cb_dnd_position(Ewl_Widget *w, void *event,
static void
ewl_dnd_snoop_cb_dnd_drop(Ewl_Widget *w, void *event,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
char buf[PATH_MAX];
Ewl_Event_Dnd_Drop *ev = event;
@@ -188,7 +188,7 @@ ewl_dnd_snoop_cb_dnd_drop(Ewl_Widget *w, void *event,
static void
ewl_dnd_snoop_cb_dnd_data(Ewl_Widget *w, void *event,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
char buf[PATH_MAX];
Ewl_Event_Dnd_Data_Received *ev = event;
@@ -198,7 +198,7 @@ ewl_dnd_snoop_cb_dnd_data(Ewl_Widget *w, void *event,
static void
ewl_dnd_snoop_cb_dnd_data_request(Ewl_Widget *w, void *event,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
char buf[PATH_MAX];
Ewl_Embed *emb;
@@ -211,9 +211,9 @@ ewl_dnd_snoop_cb_dnd_data_request(Ewl_Widget *w, void *event,
ewl_dnd_snoop_output(buf);
emb = ewl_embed_widget_find(w);
if (emb)
- ewl_engine_embed_dnd_drag_data_send(emb, ev->handle,
- (void *)w->inheritance,
- strlen(w->inheritance) + 1);
+ ewl_engine_embed_dnd_drag_data_send(emb, ev->handle,
+ (void *)w->inheritance,
+ strlen(w->inheritance) + 1);
}
#ifdef ENABLE_EWL_SOFTWARE_X11
@@ -228,12 +228,12 @@ ewl_dnd_snoop_cb_enter(void *data __UNUSED__, int type __UNUSED__, void *ev)
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n",
- event->win, event->source);
+ event->win, event->source);
ewl_dnd_snoop_output(buf);
for (i = 0; i < event->num_types; i++) {
- snprintf(buf, sizeof(buf), "\tType: %s\n", event->types[i]);
- ewl_dnd_snoop_output(buf);
+ snprintf(buf, sizeof(buf), "\tType: %s\n", event->types[i]);
+ ewl_dnd_snoop_output(buf);
}
return 1;
}
@@ -249,11 +249,11 @@ ewl_dnd_snoop_cb_position(void *data __UNUSED__, int type __UNUSED__, void *ev)
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n", event->win,
- event->source);
+ event->source);
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tPosition: %d,%d\n", event->position.x,
- event->position.y);
+ event->position.y);
ewl_dnd_snoop_output(buf);
name = XGetAtomName(ecore_x_display_get(), event->action);
@@ -275,17 +275,17 @@ ewl_dnd_snoop_cb_status(void *data __UNUSED__, int type __UNUSED__, void *ev)
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tTarget: %d\n",
- event->win, event->target);
+ event->win, event->target);
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tAccepts: %d\n", event->will_accept);
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tRegion: %d,%d %dx%d\n",
- event->rectangle.x,
- event->rectangle.y,
- event->rectangle.width,
- event->rectangle.height);
+ event->rectangle.x,
+ event->rectangle.y,
+ event->rectangle.width,
+ event->rectangle.height);
ewl_dnd_snoop_output(buf);
name = XGetAtomName(ecore_x_display_get(), event->action);
@@ -306,7 +306,7 @@ ewl_dnd_snoop_cb_leave(void *data __UNUSED__, int type __UNUSED__, void *ev)
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n",
- event->win, event->source);
+ event->win, event->source);
ewl_dnd_snoop_output(buf);
return 1;
@@ -323,7 +323,7 @@ ewl_dnd_snoop_cb_drop(void *data __UNUSED__, int type __UNUSED__, void *ev)
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSource: %d\n",
- event->win, event->source);
+ event->win, event->source);
ewl_dnd_snoop_output(buf);
name = XGetAtomName(ecore_x_display_get(), event->action);
@@ -332,7 +332,7 @@ ewl_dnd_snoop_cb_drop(void *data __UNUSED__, int type __UNUSED__, void *ev)
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tPosition: %d,%d\n",
- event->position.x, event->position.y);
+ event->position.x, event->position.y);
ewl_dnd_snoop_output(buf);
return 1;
@@ -349,7 +349,7 @@ ewl_dnd_snoop_cb_finished(void *data __UNUSED__, int type __UNUSED__, void *ev)
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tTarget: %d\n",
- event->win, event->target);
+ event->win, event->target);
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tCompleted: %d\n", event->completed);
@@ -365,7 +365,7 @@ ewl_dnd_snoop_cb_finished(void *data __UNUSED__, int type __UNUSED__, void *ev)
static int
ewl_dnd_snoop_cb_selection_clear(void *data __UNUSED__, int type __UNUSED__,
- void *ev)
+ void *ev)
{
char buf[1024];
Ecore_X_Event_Selection_Clear *event = ev;
@@ -374,7 +374,7 @@ ewl_dnd_snoop_cb_selection_clear(void *data __UNUSED__, int type __UNUSED__,
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSelection%d\n",
- event->win, event->selection);
+ event->win, event->selection);
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tTime: %d\n", event->time);
@@ -386,7 +386,7 @@ ewl_dnd_snoop_cb_selection_clear(void *data __UNUSED__, int type __UNUSED__,
static int
ewl_dnd_snoop_cb_selection_request(void *data __UNUSED__, int type __UNUSED__,
- void *ev)
+ void *ev)
{
char buf[1024];
Ecore_X_Event_Selection_Request *event = ev;
@@ -425,7 +425,7 @@ ewl_dnd_snoop_cb_selection_request(void *data __UNUSED__, int type __UNUSED__,
static int
ewl_dnd_snoop_cb_selection_notify(void *data __UNUSED__, int type __UNUSED__,
- void *ev)
+ void *ev)
{
char buf[1024];
Ecore_X_Event_Selection_Notify *event = ev;
@@ -434,7 +434,7 @@ ewl_dnd_snoop_cb_selection_notify(void *data __UNUSED__, int type __UNUSED__,
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tSelection%d\n",
- event->win, event->selection);
+ event->win, event->selection);
ewl_dnd_snoop_output(buf);
snprintf(buf, sizeof(buf), "\tTime: %d\n", event->time);
@@ -452,7 +452,7 @@ ewl_dnd_snoop_cb_selection_notify(void *data __UNUSED__, int type __UNUSED__,
static int
ewl_dnd_snoop_cb_client_message(void *data __UNUSED__, int type __UNUSED__,
- void *ev)
+ void *ev)
{
char buf[1024];
Ecore_X_Event_Client_Message *event = ev;
@@ -463,8 +463,8 @@ ewl_dnd_snoop_cb_client_message(void *data __UNUSED__, int type __UNUSED__,
name = XGetAtomName(ecore_x_display_get(), event->message_type);
snprintf(buf, sizeof(buf), "\tWindow: %d\n\tType: %s\n",
- event->win,
- name);
+ event->win,
+ name);
XFree(name);
ewl_dnd_snoop_output(buf);
@@ -478,7 +478,7 @@ ewl_dnd_snoop_cb_client_message(void *data __UNUSED__, int type __UNUSED__,
static void
ewl_dnd_snoop_cb_clear(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_text_clear(EWL_TEXT(text));
}
diff --git a/src/bin/tests/engine/ewl_engine_test.c b/src/bin/tests/engine/ewl_engine_test.c
index a66a4d5..57cdc79 100644
--- a/src/bin/tests/engine/ewl_engine_test.c
+++ b/src/bin/tests/engine/ewl_engine_test.c
@@ -21,8 +21,8 @@ static int engine_test_set_get(char *buf, int len);
#define WIN_NAME "buffer_engine_window"
static Ewl_Unit_Test engine_unit_tests[] = {
- {"engine set/get", engine_test_set_get, NULL, -1, 1},
- {NULL, NULL, NULL, -1, 0}
+ {"engine set/get", engine_test_set_get, NULL, -1, 1},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -45,8 +45,8 @@ create_test(Ewl_Container *box)
o = ewl_entry_new();
ewl_text_text_set(EWL_TEXT(o), "The image below is copied from an\n"
- "evas buffer engine, and reacts because of events\n"
- "fed to it from the image widget.");
+ "evas buffer engine, and reacts because of events\n"
+ "fed to it from the image widget.");
ewl_entry_editable_set(EWL_ENTRY(o), FALSE);
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_HFILL);
ewl_container_child_append(EWL_CONTAINER(box), o);
@@ -66,9 +66,9 @@ create_test(Ewl_Container *box)
ewl_object_size_request(EWL_OBJECT(pointer_win), 64, 64);
ewl_embed_engine_name_set(EWL_EMBED(pointer_win), "evas_buffer");
ewl_callback_append(pointer_win, EWL_CALLBACK_CONFIGURE, cb_configure,
- img);
+ img);
ewl_callback_append(pointer_win, EWL_CALLBACK_VALUE_CHANGED,
- cb_configure, img);
+ cb_configure, img);
ewl_widget_show(pointer_win);
o = ewl_button_new();
@@ -105,12 +105,12 @@ cb_mouse_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
pointer_win = ewl_widget_name_find(WIN_NAME);
x = (int)((double)(event->base.x - CURRENT_X(w)) *
- ((double)CURRENT_W(pointer_win) / (double)CURRENT_W(w)));
+ ((double)CURRENT_W(pointer_win) / (double)CURRENT_W(w)));
y = (int)((double)(event->base.y - CURRENT_Y(w)) *
- ((double)CURRENT_H(pointer_win) / (double)CURRENT_H(w)));
+ ((double)CURRENT_H(pointer_win) / (double)CURRENT_H(w)));
ewl_embed_mouse_down_feed(EWL_EMBED(pointer_win), event->button,
- event->clicks, x, y, event->base.modifiers);
+ event->clicks, x, y, event->base.modifiers);
}
static void
@@ -123,12 +123,12 @@ cb_mouse_up(Ewl_Widget *w, void *ev, void *data __UNUSED__)
pointer_win = ewl_widget_name_find(WIN_NAME);
x = (int)((double)(event->base.x - CURRENT_X(w)) *
- ((double)CURRENT_W(pointer_win) / (double)CURRENT_W(w)));
+ ((double)CURRENT_W(pointer_win) / (double)CURRENT_W(w)));
y = (int)((double)(event->base.y - CURRENT_Y(w)) *
- ((double)CURRENT_H(pointer_win) / (double)CURRENT_H(w)));
+ ((double)CURRENT_H(pointer_win) / (double)CURRENT_H(w)));
ewl_embed_mouse_up_feed(EWL_EMBED(pointer_win), event->button, x, y,
- event->base.modifiers);
+ event->base.modifiers);
}
static void
@@ -141,9 +141,9 @@ cb_mouse_move(Ewl_Widget *w, void *ev, void *data __UNUSED__)
pointer_win = ewl_widget_name_find(WIN_NAME);
x = (int)((double)(event->x - CURRENT_X(w)) *
- ((double)CURRENT_W(pointer_win) / (double)CURRENT_W(w)));
+ ((double)CURRENT_W(pointer_win) / (double)CURRENT_W(w)));
y = (int)((double)(event->y - CURRENT_Y(w)) *
- ((double)CURRENT_H(pointer_win) / (double)CURRENT_H(w)));
+ ((double)CURRENT_H(pointer_win) / (double)CURRENT_H(w)));
ewl_embed_mouse_move_feed(EWL_EMBED(pointer_win), x, y, event->modifiers);
}
@@ -151,43 +151,43 @@ cb_mouse_move(Ewl_Widget *w, void *ev, void *data __UNUSED__)
/*
static void *window_funcs[EWL_ENGINE_WINDOW_MAX] =
{
- engine_window_new,
- engine_window_destroy,
- engine_window_move,
- engine_window_resize,
- engine_window_min_max_size_set,
- engine_window_show,
- engine_window_hide,
- engine_window_title_set,
- engine_window_name_class_set,
- engine_window_borderless_set,
- engine_window_dialog_set,
- engine_window_states_set,
- engine_window_hints_set,
- engine_window_transient_for,
- engine_window_leader_set,
- engine_window_raise,
- engine_window_lower,
- engine_keyboard_grab,
- engine_keyboard_ungrab,
- engine_pointer_grab,
- engine_pointer_ungrab,
- engine_window_selection_text_set,
- engine_window_geometry_set,
- engine_dnd_aware_set,
- engine_desktop_size_get,
- engine_dnd_drag_types_set,
- engine_dnd_drag_begin,
- engine_dnd_drag_drop,
- engine_dnd_drag_data_send,
+ engine_window_new,
+ engine_window_destroy,
+ engine_window_move,
+ engine_window_resize,
+ engine_window_min_max_size_set,
+ engine_window_show,
+ engine_window_hide,
+ engine_window_title_set,
+ engine_window_name_class_set,
+ engine_window_borderless_set,
+ engine_window_dialog_set,
+ engine_window_states_set,
+ engine_window_hints_set,
+ engine_window_transient_for,
+ engine_window_leader_set,
+ engine_window_raise,
+ engine_window_lower,
+ engine_keyboard_grab,
+ engine_keyboard_ungrab,
+ engine_pointer_grab,
+ engine_pointer_ungrab,
+ engine_window_selection_text_set,
+ engine_window_geometry_set,
+ engine_dnd_aware_set,
+ engine_desktop_size_get,
+ engine_dnd_drag_types_set,
+ engine_dnd_drag_begin,
+ engine_dnd_drag_drop,
+ engine_dnd_drag_data_send,
};
static void *pointer_funcs[EWL_ENGINE_POINTER_MAX] =
{
- engine_pointer_data_new,
- engine_pointer_free,
- engine_pointer_get,
- engine_pointer_set,
+ engine_pointer_data_new,
+ engine_pointer_free,
+ engine_pointer_get,
+ engine_pointer_set,
};
*/
@@ -216,9 +216,9 @@ engine_test_set_get(char *buf, int len)
engine_name = ewl_embed_engine_name_get(EWL_EMBED(window));
if (strcmp(engine_name, "ewl_engine"))
- LOG_FAILURE(buf, len, "engine name doesn't match");
+ LOG_FAILURE(buf, len, "engine name doesn't match");
else
- ret = 1;
+ ret = 1;
return ret;
}
diff --git a/src/bin/tests/entry/ewl_entry_test.c b/src/bin/tests/entry/ewl_entry_test.c
index 2a527fd..0c85b10 100644
--- a/src/bin/tests/entry/ewl_entry_test.c
+++ b/src/bin/tests/entry/ewl_entry_test.c
@@ -17,7 +17,7 @@ test_info(Ewl_Test *test)
{
test->name = "Entry";
test->tip = "Defines the Ewl_Entry class to allow\n"
- "for single line editable text.";
+ "for single line editable text.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -25,32 +25,32 @@ test_info(Ewl_Test *test)
static void
fetch_entry_text(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
char *s;
s = ewl_text_text_get(EWL_TEXT(entry[0]));
if (s) {
- printf("First entry covers: %s\n", s);
- free(s);
+ printf("First entry covers: %s\n", s);
+ free(s);
}
s = ewl_text_text_get(EWL_TEXT(entry[1]));
if (s) {
- printf("Second entry covers: %s\n", s);
- free(s);
+ printf("Second entry covers: %s\n", s);
+ free(s);
}
s = ewl_text_text_get(EWL_TEXT(entry[2]));
if (s) {
- printf("Third entry covers: %s\n", s);
- free(s);
+ printf("Third entry covers: %s\n", s);
+ free(s);
}
}
static void
set_entry_text(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
ewl_text_text_set(EWL_TEXT(entry[0]), "Play with me ?");
ewl_text_clear(EWL_TEXT(entry[1]));
@@ -108,14 +108,14 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button[0]), "Fetch text");
ewl_container_child_append(EWL_CONTAINER(button_hbox), button[0]);
ewl_callback_append(button[0], EWL_CALLBACK_CLICKED,
- fetch_entry_text, NULL);
+ fetch_entry_text, NULL);
ewl_widget_show(button[0]);
button[1] = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(button[1]), "Set Text");
ewl_container_child_append(EWL_CONTAINER(button_hbox), button[1]);
ewl_callback_append(button[1], EWL_CALLBACK_CLICKED,
- set_entry_text, NULL);
+ set_entry_text, NULL);
ewl_widget_show(button[1]);
o = ewl_label_new();
diff --git a/src/bin/tests/filedialog/ewl_filedialog_test.c b/src/bin/tests/filedialog/ewl_filedialog_test.c
index c8c760f..52135ff 100644
--- a/src/bin/tests/filedialog/ewl_filedialog_test.c
+++ b/src/bin/tests/filedialog/ewl_filedialog_test.c
@@ -19,7 +19,7 @@ test_info(Ewl_Test *test)
{
test->name = "Filedialog";
test->tip = "The filedialog is intended to be used for a\n"
- "single or multi-file chooser.";
+ "single or multi-file chooser.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_ADVANCED;
@@ -49,14 +49,14 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o2), "Single select");
ewl_container_child_append(EWL_CONTAINER(o), o2);
ewl_callback_append(o2, EWL_CALLBACK_CLICKED,
- dialog_cb_single_clicked, NULL);
+ dialog_cb_single_clicked, NULL);
ewl_widget_show(o2);
o2 = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o2), "Multi select");
ewl_container_child_append(EWL_CONTAINER(o), o2);
ewl_callback_append(o2, EWL_CALLBACK_CLICKED,
- dialog_cb_multi_clicked, NULL);
+ dialog_cb_multi_clicked, NULL);
ewl_widget_show(o2);
return 1;
@@ -64,7 +64,7 @@ create_test(Ewl_Container *box)
static void
dialog_cb_single_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *fd;
Ecore_List *list;
@@ -77,23 +77,23 @@ dialog_cb_single_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
ewl_filedialog_filter_add(EWL_FILEDIALOG(fd), "C Files", "*.c", NULL);
ewl_filedialog_filter_add(EWL_FILEDIALOG(fd), "D Files", "*.d", NULL);
ewl_callback_append(fd, EWL_CALLBACK_DELETE_WINDOW,
- fd_cb_delete, NULL);
+ fd_cb_delete, NULL);
ewl_callback_append(fd, EWL_CALLBACK_VALUE_CHANGED,
- fd_cb_value_changed, NULL);
+ fd_cb_value_changed, NULL);
ewl_widget_show(fd);
}
static void
dialog_cb_multi_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *fd;
fd = ewl_filedialog_multiselect_new();
ewl_callback_append(fd, EWL_CALLBACK_DELETE_WINDOW,
- fd_cb_delete, NULL);
+ fd_cb_delete, NULL);
ewl_callback_append(fd, EWL_CALLBACK_VALUE_CHANGED,
- fd_cb_value_changed, NULL);
+ fd_cb_value_changed, NULL);
ewl_widget_show(fd);
}
@@ -118,8 +118,8 @@ fd_cb_value_changed(Ewl_Widget *w, void *ev, void *data __UNUSED__)
/* nothing to do on a cancel */
if (e->response == EWL_STOCK_CANCEL)
{
- ewl_widget_destroy(w);
- return;
+ ewl_widget_destroy(w);
+ return;
}
fd = EWL_FILEDIALOG(w);
diff --git a/src/bin/tests/filepicker/ewl_filepicker_test.c b/src/bin/tests/filepicker/ewl_filepicker_test.c
index 90f48c3..9107b02 100644
--- a/src/bin/tests/filepicker/ewl_filepicker_test.c
+++ b/src/bin/tests/filepicker/ewl_filepicker_test.c
@@ -9,14 +9,14 @@
static int create_test(Ewl_Container *box);
static void ewl_filepicker_cb_value_changed(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static int directory_test_set_get(char *buf, int len);
static int directory_test_path_split(char *buf, int len);
static Ewl_Unit_Test filepicker_unit_tests[] = {
- {"directory set/get", directory_test_set_get, NULL, -1, 1},
- {"directory path split", directory_test_path_split, NULL, -1, 1},
- {NULL, NULL, NULL, -1, 0}
+ {"directory set/get", directory_test_set_get, NULL, -1, 1},
+ {"directory path split", directory_test_path_split, NULL, -1, 1},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -38,12 +38,12 @@ create_test(Ewl_Container *box)
w = ewl_filepicker_new();
f = ewl_filepicker_filter_add(EWL_FILEPICKER(w), "C Files",
- "*.c", NULL);
+ "*.c", NULL);
ewl_filepicker_filter_add(EWL_FILEPICKER(w), "D Files", "*.d", NULL);
ewl_filepicker_filter_set(EWL_FILEPICKER(w), f);
ewl_container_child_append(box, w);
ewl_callback_append(w, EWL_CALLBACK_VALUE_CHANGED,
- ewl_filepicker_cb_value_changed, NULL);
+ ewl_filepicker_cb_value_changed, NULL);
ewl_widget_show(w);
return 1;
@@ -51,7 +51,7 @@ create_test(Ewl_Container *box)
static void
ewl_filepicker_cb_value_changed(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Filepicker *fp;
Ewl_Event_Action_Response *e;
@@ -62,25 +62,25 @@ ewl_filepicker_cb_value_changed(Ewl_Widget *w, void *ev,
/* need to deal with multiselect in here */
switch (e->response)
{
- case EWL_STOCK_OPEN:
- {
- char *file;
-
- file = ewl_filepicker_selected_file_get(fp);
-
- if (!file)
- printf("No file selected.\n");
- else
- {
- printf("%s\n", file);
- free(file);
- }
- break;
- }
- default:
- case EWL_STOCK_CANCEL:
- printf("Cancelled\n");
- break;
+ case EWL_STOCK_OPEN:
+ {
+ char *file;
+
+ file = ewl_filepicker_selected_file_get(fp);
+
+ if (!file)
+ printf("No file selected.\n");
+ else
+ {
+ printf("%s\n", file);
+ free(file);
+ }
+ break;
+ }
+ default:
+ case EWL_STOCK_CANCEL:
+ printf("Cancelled\n");
+ break;
}
}
@@ -93,14 +93,14 @@ directory_test_set_get(char *buf, int len)
fp = ewl_filepicker_new();
ewl_filepicker_directory_set(EWL_FILEPICKER(fp),
- "/tmp");
+ "/tmp");
t = ewl_filepicker_directory_get(EWL_FILEPICKER(fp));
if (strcmp(t, "/tmp"))
- LOG_FAILURE(buf, len, "directory_get did not match "
- "directory_set %s", t);
+ LOG_FAILURE(buf, len, "directory_get did not match "
+ "directory_set %s", t);
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -115,19 +115,19 @@ directory_test_path_split(char *buf, int len)
fp = ewl_filepicker_new();
ewl_filepicker_directory_set(EWL_FILEPICKER(fp),
- "/usr/local/bin/");
+ "/usr/local/bin/");
ecore_list_first_goto(EWL_FILEPICKER(fp)->path);
while ((t = ecore_list_next(EWL_FILEPICKER(fp)->path)))
{
- if (strcmp(rez[i], t))
- {
- LOG_FAILURE(buf, len, "path list not setup correctly. "
- "[%s didn't match %s]", t, rez[i]);
- ret = 0;
- break;
- }
- i++;
+ if (strcmp(rez[i], t))
+ {
+ LOG_FAILURE(buf, len, "path list not setup correctly. "
+ "[%s didn't match %s]", t, rez[i]);
+ ret = 0;
+ break;
+ }
+ i++;
}
return ret;
diff --git a/src/bin/tests/floater/ewl_floater_test.c b/src/bin/tests/floater/ewl_floater_test.c
index b33ac95..c906b51 100644
--- a/src/bin/tests/floater/ewl_floater_test.c
+++ b/src/bin/tests/floater/ewl_floater_test.c
@@ -13,9 +13,9 @@ test_info(Ewl_Test *test)
{
test->name = "Floater";
test->tip = "Defines a widget for layering above other\n "
- "widgets in EWL's drawing area, with\n"
- "the ability to follow the movement of\n"
- "another widget.";
+ "widgets in EWL's drawing area, with\n"
+ "the ability to follow the movement of\n"
+ "another widget.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -31,16 +31,16 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(radio_button[0]), "With Label");
ewl_container_child_append(EWL_CONTAINER(box), radio_button[0]);
ewl_object_alignment_set(EWL_OBJECT(radio_button[0]),
- EWL_FLAG_ALIGN_LEFT);
+ EWL_FLAG_ALIGN_LEFT);
ewl_widget_show(radio_button[0]);
radio_button[1] = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(radio_button[1]), NULL);
ewl_radiobutton_chain_set(EWL_RADIOBUTTON(radio_button[1]),
- EWL_RADIOBUTTON(radio_button[0]));
+ EWL_RADIOBUTTON(radio_button[0]));
ewl_container_child_append(EWL_CONTAINER(box), radio_button[1]);
ewl_object_alignment_set(EWL_OBJECT(radio_button[1]),
- EWL_FLAG_ALIGN_LEFT);
+ EWL_FLAG_ALIGN_LEFT);
ewl_widget_show(radio_button[1]);
floater = ewl_floater_new();
@@ -73,14 +73,14 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(check_button[0]), "With Label");
ewl_container_child_append(EWL_CONTAINER(floater), check_button[0]);
ewl_object_alignment_set(EWL_OBJECT(check_button[0]),
- EWL_FLAG_ALIGN_LEFT);
+ EWL_FLAG_ALIGN_LEFT);
ewl_widget_show(check_button[0]);
check_button[1] = ewl_checkbutton_new();
ewl_button_label_set(EWL_BUTTON(check_button[1]), NULL);
ewl_container_child_append(EWL_CONTAINER(floater), check_button[1]);
ewl_object_alignment_set(EWL_OBJECT(check_button[1]),
- EWL_FLAG_ALIGN_LEFT);
+ EWL_FLAG_ALIGN_LEFT);
ewl_widget_show(check_button[1]);
return 1;
diff --git a/src/bin/tests/freebox/ewl_freebox_test.c b/src/bin/tests/freebox/ewl_freebox_test.c
index 7d3e4a1..3d4d129 100644
--- a/src/bin/tests/freebox/ewl_freebox_test.c
+++ b/src/bin/tests/freebox/ewl_freebox_test.c
@@ -33,7 +33,7 @@ test_info(Ewl_Test *test)
{
test->name = "Freebox";
test->tip = "The freebox is used for a more free layout system\n"
- "then the other containers",
+ "then the other containers",
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -44,22 +44,22 @@ create_test(Ewl_Container *box)
{
int i;
const Freebox_Test fbtests[] = {
- {
- "Manual Placement",
- EWL_FREEBOX_LAYOUT_MANUAL,
- NULL
- },
- {
- "Auto Placement",
- EWL_FREEBOX_LAYOUT_AUTO,
- NULL
- },
- {
- "Comparator Placement (by name)",
- EWL_FREEBOX_LAYOUT_COMPARATOR,
- ewl_freebox_cb_compare
- },
- { NULL, EWL_FREEBOX_LAYOUT_AUTO, NULL }
+ {
+ "Manual Placement",
+ EWL_FREEBOX_LAYOUT_MANUAL,
+ NULL
+ },
+ {
+ "Auto Placement",
+ EWL_FREEBOX_LAYOUT_AUTO,
+ NULL
+ },
+ {
+ "Comparator Placement (by name)",
+ EWL_FREEBOX_LAYOUT_COMPARATOR,
+ ewl_freebox_cb_compare
+ },
+ { NULL, EWL_FREEBOX_LAYOUT_AUTO, NULL }
};
srand(time(NULL));
@@ -67,56 +67,56 @@ create_test(Ewl_Container *box)
ewl_object_fill_policy_set(EWL_OBJECT(box), EWL_FLAG_FILL_ALL);
for (i = 0; fbtests[i].name != NULL; i++) {
- Ewl_Widget *border, *hbox, *fb, *pane, *o;
-
- border = ewl_border_new();
- ewl_border_label_set(EWL_BORDER(border),
- (char *)fbtests[i].name);
- ewl_object_fill_policy_set(EWL_OBJECT(border), EWL_FLAG_FILL_FILL);
- ewl_container_child_append(EWL_CONTAINER(box), border);
- ewl_widget_show(border);
-
- /* nest the freebox in a scrollpane */
- pane = ewl_scrollpane_new();
- ewl_container_child_append(EWL_CONTAINER(border), pane);
- ewl_widget_show(pane);
-
- /* create a freebox of the type for this test */
- fb = ewl_freebox_new();
- ewl_freebox_layout_type_set(EWL_FREEBOX(fb), fbtests[i].type);
- if (fbtests[i].compare) {
- ewl_freebox_comparator_set(EWL_FREEBOX(fb),
- fbtests[i].compare);
- sort_fb = fb;
- }
- ewl_container_child_append(EWL_CONTAINER(pane), fb);
- ewl_widget_show(fb);
-
- /* pack controls for the freebox */
- hbox = ewl_hbox_new();
- ewl_container_child_append(EWL_CONTAINER(border), hbox);
- ewl_object_fill_policy_set(EWL_OBJECT(hbox),
- EWL_FLAG_FILL_NONE);
- ewl_object_alignment_set(EWL_OBJECT(hbox), EWL_FLAG_ALIGN_TOP);
- ewl_widget_show(hbox);
-
- o = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(o), "Add items");
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
- ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_freebox_cb_add, fb);
- ewl_widget_show(o);
-
- o = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(o), "Clear items");
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
- ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_freebox_cb_clear, fb);
- ewl_widget_show(o);
+ Ewl_Widget *border, *hbox, *fb, *pane, *o;
+
+ border = ewl_border_new();
+ ewl_border_label_set(EWL_BORDER(border),
+ (char *)fbtests[i].name);
+ ewl_object_fill_policy_set(EWL_OBJECT(border), EWL_FLAG_FILL_FILL);
+ ewl_container_child_append(EWL_CONTAINER(box), border);
+ ewl_widget_show(border);
+
+ /* nest the freebox in a scrollpane */
+ pane = ewl_scrollpane_new();
+ ewl_container_child_append(EWL_CONTAINER(border), pane);
+ ewl_widget_show(pane);
+
+ /* create a freebox of the type for this test */
+ fb = ewl_freebox_new();
+ ewl_freebox_layout_type_set(EWL_FREEBOX(fb), fbtests[i].type);
+ if (fbtests[i].compare) {
+ ewl_freebox_comparator_set(EWL_FREEBOX(fb),
+ fbtests[i].compare);
+ sort_fb = fb;
+ }
+ ewl_container_child_append(EWL_CONTAINER(pane), fb);
+ ewl_widget_show(fb);
+
+ /* pack controls for the freebox */
+ hbox = ewl_hbox_new();
+ ewl_container_child_append(EWL_CONTAINER(border), hbox);
+ ewl_object_fill_policy_set(EWL_OBJECT(hbox),
+ EWL_FLAG_FILL_NONE);
+ ewl_object_alignment_set(EWL_OBJECT(hbox), EWL_FLAG_ALIGN_TOP);
+ ewl_widget_show(hbox);
+
+ o = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(o), "Add items");
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
+ ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED,
+ ewl_freebox_cb_add, fb);
+ ewl_widget_show(o);
+
+ o = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(o), "Clear items");
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
+ ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_TOP);
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED,
+ ewl_freebox_cb_clear, fb);
+ ewl_widget_show(o);
}
return 1;
@@ -124,7 +124,7 @@ create_test(Ewl_Container *box)
static void
ewl_freebox_cb_icon_change(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Freebox *fb;
@@ -145,7 +145,7 @@ ewl_freebox_cb_compare(Ewl_Widget *a, Ewl_Widget *b)
static void
ewl_freebox_cb_add(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Freebox *fb;
Ewl_Widget *i;
@@ -153,48 +153,48 @@ ewl_freebox_cb_add(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
struct
{
- char *name;
- char *path;
+ char *name;
+ char *path;
} files[] = {
- {"Draw", PACKAGE_DATA_DIR "/ewl/images/Draw.png"},
- {"End", PACKAGE_DATA_DIR "/ewl/images/End.png"},
- {"Card", PACKAGE_DATA_DIR "/ewl/images/NewBCard.png"},
- {"Open", PACKAGE_DATA_DIR "/ewl/images/Open.png"},
- {"Package", PACKAGE_DATA_DIR "/ewl/images/Package.png"},
- {"World", PACKAGE_DATA_DIR "/ewl/images/World.png"},
- {NULL, NULL}
+ {"Draw", PACKAGE_DATA_DIR "/ewl/images/Draw.png"},
+ {"End", PACKAGE_DATA_DIR "/ewl/images/End.png"},
+ {"Card", PACKAGE_DATA_DIR "/ewl/images/NewBCard.png"},
+ {"Open", PACKAGE_DATA_DIR "/ewl/images/Open.png"},
+ {"Package", PACKAGE_DATA_DIR "/ewl/images/Package.png"},
+ {"World", PACKAGE_DATA_DIR "/ewl/images/World.png"},
+ {NULL, NULL}
};
fb = data;
for (t = 0; files[t].name != NULL; t++)
{
- long width, height;
-
- width = (rand() % 30) + 30;
- height = (rand() % 30) + 30;
-
- i = ewl_icon_new();
- ewl_container_child_append(EWL_CONTAINER(fb), i);
- ewl_icon_label_set(EWL_ICON(i), files[t].name);
- ewl_icon_image_set(EWL_ICON(i), files[t].path, NULL);
- ewl_object_fill_policy_set(EWL_OBJECT(i),
- EWL_FLAG_FILL_FILL);
- ewl_object_minimum_size_set(EWL_OBJECT(i), (int)width,
- (int)height);
- if (fb == EWL_FREEBOX(sort_fb))
- {
- ewl_icon_editable_set(EWL_ICON(i), TRUE);
- ewl_callback_append(i, EWL_CALLBACK_VALUE_CHANGED,
- ewl_freebox_cb_icon_change, fb);
- }
- ewl_widget_show(i);
+ long width, height;
+
+ width = (rand() % 30) + 30;
+ height = (rand() % 30) + 30;
+
+ i = ewl_icon_new();
+ ewl_container_child_append(EWL_CONTAINER(fb), i);
+ ewl_icon_label_set(EWL_ICON(i), files[t].name);
+ ewl_icon_image_set(EWL_ICON(i), files[t].path, NULL);
+ ewl_object_fill_policy_set(EWL_OBJECT(i),
+ EWL_FLAG_FILL_FILL);
+ ewl_object_minimum_size_set(EWL_OBJECT(i), (int)width,
+ (int)height);
+ if (fb == EWL_FREEBOX(sort_fb))
+ {
+ ewl_icon_editable_set(EWL_ICON(i), TRUE);
+ ewl_callback_append(i, EWL_CALLBACK_VALUE_CHANGED,
+ ewl_freebox_cb_icon_change, fb);
+ }
+ ewl_widget_show(i);
}
}
static void
ewl_freebox_cb_clear(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Freebox *fb;
diff --git a/src/bin/tests/fullscreen/ewl_fullscreen_test.c b/src/bin/tests/fullscreen/ewl_fullscreen_test.c
index 905109c..fa0dd00 100644
--- a/src/bin/tests/fullscreen/ewl_fullscreen_test.c
+++ b/src/bin/tests/fullscreen/ewl_fullscreen_test.c
@@ -49,8 +49,8 @@ ewl_widget_cb_click(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
emb = ewl_embed_widget_find(w);
if (ewl_window_fullscreen_get(EWL_WINDOW(emb)))
- ewl_window_fullscreen_set(EWL_WINDOW(emb), FALSE);
+ ewl_window_fullscreen_set(EWL_WINDOW(emb), FALSE);
else
- ewl_window_fullscreen_set(EWL_WINDOW(emb), TRUE);
+ ewl_window_fullscreen_set(EWL_WINDOW(emb), TRUE);
}
diff --git a/src/bin/tests/grid/ewl_grid_test.c b/src/bin/tests/grid/ewl_grid_test.c
index 2ddbcac..8ed468a 100644
--- a/src/bin/tests/grid/ewl_grid_test.c
+++ b/src/bin/tests/grid/ewl_grid_test.c
@@ -30,21 +30,21 @@ static int dimensions_auto_resize(char *buf, int len);
static int orientation_set_get(char *buf, int len);
static Ewl_Unit_Test grid_unit_tests[] = {
- {"set and get dimensions", dimensions_set_get, NULL, -1, 0},
- {"set and get fixed column size", column_fixed_set_get, NULL, -1, 0},
- {"set and get fixed row size", row_fixed_set_get, NULL, -1, 0},
- {"set and get relative column size", column_relative_set_get, NULL, -1, 0},
- {"set and get relative row size", row_relative_set_get, NULL, -1, 0},
- {"remove fixed column size", column_size_remove, NULL, -1, 0},
- {"remove row column size", row_size_remove, NULL, -1, 0},
- {"set and get vertiacal homogeneous", vhomogeneous_set_get, NULL, -1, 0},
- {"set and get horizontal homogeneous", hhomogeneous_set_get, NULL, -1, 0},
- {"set and get homogeneous", homogeneous_set_get, NULL, -1, 0},
- {"set and get position", position_set_get, NULL, -1, 0},
- {"get position of floating widgets", floating_position_get, NULL, -1, 0},
- {"auto resize dimensions", dimensions_auto_resize, NULL, -1, 0},
- {"set and get the orientation", orientation_set_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"set and get dimensions", dimensions_set_get, NULL, -1, 0},
+ {"set and get fixed column size", column_fixed_set_get, NULL, -1, 0},
+ {"set and get fixed row size", row_fixed_set_get, NULL, -1, 0},
+ {"set and get relative column size", column_relative_set_get, NULL, -1, 0},
+ {"set and get relative row size", row_relative_set_get, NULL, -1, 0},
+ {"remove fixed column size", column_size_remove, NULL, -1, 0},
+ {"remove row column size", row_size_remove, NULL, -1, 0},
+ {"set and get vertiacal homogeneous", vhomogeneous_set_get, NULL, -1, 0},
+ {"set and get horizontal homogeneous", hhomogeneous_set_get, NULL, -1, 0},
+ {"set and get homogeneous", homogeneous_set_get, NULL, -1, 0},
+ {"set and get position", position_set_get, NULL, -1, 0},
+ {"get position of floating widgets", floating_position_get, NULL, -1, 0},
+ {"auto resize dimensions", dimensions_auto_resize, NULL, -1, 0},
+ {"set and get the orientation", orientation_set_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -55,7 +55,7 @@ test_info(Ewl_Test *test)
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
- test->unit_tests = grid_unit_tests;
+ test->unit_tests = grid_unit_tests;
}
static int
@@ -92,7 +92,7 @@ create_test(Ewl_Container *box)
hbox = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(vbox), hbox);
ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_HFILL
- | EWL_FLAG_FILL_VSHRINK);
+ | EWL_FLAG_FILL_VSHRINK);
ewl_box_homogeneous_set(EWL_BOX(hbox), TRUE);
ewl_widget_show(hbox);
@@ -128,7 +128,7 @@ create_test(Ewl_Container *box)
w = ewl_entry_new();
ewl_text_text_set(EWL_TEXT(w), "This row use the\n"
- "preferred height");
+ "preferred height");
ewl_container_child_append(EWL_CONTAINER(grid), w);
ewl_grid_child_position_set(EWL_GRID(grid), w, 3, 4, 2, 2);
ewl_widget_show(w);
@@ -145,7 +145,7 @@ child_append_cb(Ewl_Widget *w __UNUSED__, void *e __UNUSED__, void *d)
ewl_button_label_set(EWL_BUTTON(button), "Append");
ewl_container_child_append(EWL_CONTAINER(d), button);
ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_clicked_cb,
- NULL);
+ NULL);
ewl_widget_show(button);
}
@@ -158,7 +158,7 @@ child_prepend_cb(Ewl_Widget *w __UNUSED__, void *e __UNUSED__, void *d)
ewl_button_label_set(EWL_BUTTON(button), "Prepend");
ewl_container_child_prepend(EWL_CONTAINER(d), button);
ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_clicked_cb,
- NULL);
+ NULL);
ewl_widget_show(button);
}
@@ -170,10 +170,10 @@ button_clicked_cb(Ewl_Widget *w, void *e __UNUSED__, void *d __UNUSED__)
g = w->parent;
ewl_grid_child_position_get(EWL_GRID(g), w, &start_col, &end_col,
- &start_row, &end_row);
+ &start_row, &end_row);
printf("child position:\n\t\tstart\tend\n"
- " column:\t%i\t%i\n"
- " row:\t\t%i\t%i\n\n", start_col, end_col, start_row, end_row);
+ " column:\t%i\t%i\n"
+ " row:\t\t%i\t%i\n\n", start_col, end_col, start_row, end_row);
}
/* unit tests */
@@ -189,9 +189,9 @@ dimensions_set_get(char *buf, int len)
ewl_grid_dimensions_get(EWL_GRID(grid), &col, &row);
if (col != 5 || row != 6) {
- snprintf(buf, len, "dimensions are %dx%d, but should be 5x6",
- col, row);
- ret = 0;
+ snprintf(buf, len, "dimensions are %dx%d, but should be 5x6",
+ col, row);
+ ret = 0;
}
ewl_widget_destroy(grid);
@@ -209,20 +209,20 @@ column_fixed_set_get(char *buf, int len)
grid = ewl_grid_new();
fixed = ewl_grid_column_fixed_w_get(EWL_GRID(grid), 1);
if (fixed != 0) {
- snprintf(buf, len, "the column has a fixed size (%d), where"
- " it shouldn't", fixed);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the column has a fixed size (%d), where"
+ " it shouldn't", fixed);
+ ret = 0;
+ goto CLEANUP;
}
/* now set a fixed size and see if we get it back */
ewl_grid_column_fixed_w_set(EWL_GRID(grid), 1, 123);
fixed = ewl_grid_column_fixed_w_get(EWL_GRID(grid), 1);
if (fixed != 123) {
- snprintf(buf, len, "the column has a wrong fixed size (%d)!",
- fixed);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the column has a wrong fixed size (%d)!",
+ fixed);
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
@@ -241,20 +241,20 @@ row_fixed_set_get(char *buf, int len)
grid = ewl_grid_new();
fixed = ewl_grid_row_fixed_h_get(EWL_GRID(grid), 1);
if (fixed != 0) {
- snprintf(buf, len, "the row has a fixed size (%d), where"
- " it shouldn't", fixed);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the row has a fixed size (%d), where"
+ " it shouldn't", fixed);
+ ret = 0;
+ goto CLEANUP;
}
/* now set a fixed size and see if we get it back */
ewl_grid_row_fixed_h_set(EWL_GRID(grid), 1, 123);
fixed = ewl_grid_row_fixed_h_get(EWL_GRID(grid), 1);
if (fixed != 123) {
- snprintf(buf, len, "the row has a wrong fixed size (%d)!",
- fixed);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the row has a wrong fixed size (%d)!",
+ fixed);
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
@@ -274,20 +274,20 @@ column_relative_set_get(char *buf, int len)
grid = ewl_grid_new();
rel = ewl_grid_column_relative_w_get(EWL_GRID(grid), 1);
if (rel != 0.0) {
- snprintf(buf, len, "the column has a relative size (%f), where"
- " it shouldn't", rel);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the column has a relative size (%f), where"
+ " it shouldn't", rel);
+ ret = 0;
+ goto CLEANUP;
}
/* now set a relative size and see if we get it back */
ewl_grid_column_relative_w_set(EWL_GRID(grid), 1, 0.5);
rel = ewl_grid_column_relative_w_get(EWL_GRID(grid), 1);
if (rel != 0.5) {
- snprintf(buf, len, "the column has a wrong relative size (%f)!",
- rel);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the column has a wrong relative size (%f)!",
+ rel);
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
@@ -306,20 +306,20 @@ row_relative_set_get(char *buf, int len)
grid = ewl_grid_new();
rel = ewl_grid_row_relative_h_get(EWL_GRID(grid), 1);
if (rel != 0) {
- snprintf(buf, len, "the row has a rel size (%f), where"
- " it shouldn't", rel);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the row has a rel size (%f), where"
+ " it shouldn't", rel);
+ ret = 0;
+ goto CLEANUP;
}
/* now set a rel size and see if we get it back */
ewl_grid_row_relative_h_set(EWL_GRID(grid), 1, 0.5);
rel = ewl_grid_row_relative_h_get(EWL_GRID(grid), 1);
if (rel != 0.5) {
- snprintf(buf, len, "the row has a wrong relative size (%f)!",
- rel);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the row has a wrong relative size (%f)!",
+ rel);
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
@@ -340,10 +340,10 @@ column_size_remove(char *buf, int len)
ewl_grid_column_w_remove(EWL_GRID(grid), 1);
fixed = ewl_grid_column_fixed_w_get(EWL_GRID(grid), 1);
if (fixed != 0) {
- snprintf(buf, len, "the column has a fixed size (%d), where"
- " it shouldn't", fixed);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the column has a fixed size (%d), where"
+ " it shouldn't", fixed);
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
@@ -364,10 +364,10 @@ row_size_remove(char *buf, int len)
ewl_grid_row_h_remove(EWL_GRID(grid), 1);
fixed = ewl_grid_row_fixed_h_get(EWL_GRID(grid), 1);
if (fixed != 0) {
- snprintf(buf, len, "the row has a fixed size (%d), where"
- " it shouldn't", fixed);
- ret = 0;
- goto CLEANUP;
+ snprintf(buf, len, "the row has a fixed size (%d), where"
+ " it shouldn't", fixed);
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
@@ -387,17 +387,17 @@ vhomogeneous_set_get(char *buf, int len)
/* test true */
ewl_grid_vhomogeneous_set(EWL_GRID(grid), TRUE);
if (!ewl_grid_vhomogeneous_get(EWL_GRID(grid))) {
- LOG_FAILURE(buf, len, "grid is not vhomogeneous");
- ret = 0;
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "grid is not vhomogeneous");
+ ret = 0;
+ goto CLEANUP;
}
/* test false */
ewl_grid_vhomogeneous_set(EWL_GRID(grid), FALSE);
if (ewl_grid_vhomogeneous_get(EWL_GRID(grid))) {
- LOG_FAILURE(buf, len, "grid is vhomogeneous");
- ret = 0;
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "grid is vhomogeneous");
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
ewl_widget_destroy(grid);
@@ -416,17 +416,17 @@ hhomogeneous_set_get(char *buf, int len)
/* test true */
ewl_grid_hhomogeneous_set(EWL_GRID(grid), TRUE);
if (!ewl_grid_hhomogeneous_get(EWL_GRID(grid))) {
- LOG_FAILURE(buf, len, "grid is not hhomogeneous");
- ret = 0;
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "grid is not hhomogeneous");
+ ret = 0;
+ goto CLEANUP;
}
/* test false */
ewl_grid_hhomogeneous_set(EWL_GRID(grid), FALSE);
if (ewl_grid_hhomogeneous_get(EWL_GRID(grid))) {
- LOG_FAILURE(buf, len, "grid is hhomogeneous");
- ret = 0;
- goto CLEANUP;
+ LOG_FAILURE(buf, len, "grid is hhomogeneous");
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
ewl_widget_destroy(grid);
@@ -445,19 +445,19 @@ homogeneous_set_get(char *buf, int len)
/* test true */
ewl_grid_homogeneous_set(EWL_GRID(grid), TRUE);
if (!(ewl_grid_hhomogeneous_get(EWL_GRID(grid))
- || ewl_grid_vhomogeneous_get(EWL_GRID(grid)))) {
- LOG_FAILURE(buf, len, "grid is not homogeneous");
- ret = 0;
- goto CLEANUP;
+ || ewl_grid_vhomogeneous_get(EWL_GRID(grid)))) {
+ LOG_FAILURE(buf, len, "grid is not homogeneous");
+ ret = 0;
+ goto CLEANUP;
}
/* test false */
ewl_grid_homogeneous_set(EWL_GRID(grid), FALSE);
if (ewl_grid_hhomogeneous_get(EWL_GRID(grid))
- || ewl_grid_vhomogeneous_get(EWL_GRID(grid))) {
- LOG_FAILURE(buf, len, "grid is homogeneous");
- ret = 0;
- goto CLEANUP;
+ || ewl_grid_vhomogeneous_get(EWL_GRID(grid))) {
+ LOG_FAILURE(buf, len, "grid is homogeneous");
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
@@ -484,11 +484,11 @@ position_set_get(char *buf, int len)
ewl_widget_show(child);
ewl_grid_child_position_get(EWL_GRID(grid), child, &col_start, &col_end,
- &row_start, &row_end);
+ &row_start, &row_end);
if (col_start != 0 || col_end != 2 || row_start != 1 || row_end != 3) {
- LOG_FAILURE(buf, len, "child has wrong position");
- ret = 0;
+ LOG_FAILURE(buf, len, "child has wrong position");
+ ret = 0;
}
ewl_widget_destroy(grid);
@@ -517,31 +517,31 @@ floating_position_get(char *buf, int len)
/* first add the children to the grid */
for (i = 0; i < 5; i++) {
- w[i] = ewl_cell_new();
- ewl_container_child_append(EWL_CONTAINER(grid), w[i]);
- ewl_widget_show(w[i]);
+ w[i] = ewl_cell_new();
+ ewl_container_child_append(EWL_CONTAINER(grid), w[i]);
+ ewl_widget_show(w[i]);
}
/* now check the positions */
for (i = 0; i < 5; i++) {
- int r, c;
-
- ewl_grid_child_position_get(EWL_GRID(grid), w[i], &c, NULL, &r,
- NULL);
- if (c != col || r != row) {
- LOG_FAILURE(buf, len, "child isn't placed right");
- ret = 0;
- break;
- }
- col++;
- if (col > 1) {
- col = 0;
- row++;
- }
- /* here is our placed widget we don't want to check this
- * position */
- if (col == 0 && row == 1)
- col = 1;
+ int r, c;
+
+ ewl_grid_child_position_get(EWL_GRID(grid), w[i], &c, NULL, &r,
+ NULL);
+ if (c != col || r != row) {
+ LOG_FAILURE(buf, len, "child isn't placed right");
+ ret = 0;
+ break;
+ }
+ col++;
+ if (col > 1) {
+ col = 0;
+ row++;
+ }
+ /* here is our placed widget we don't want to check this
+ * position */
+ if (col == 0 && row == 1)
+ col = 1;
}
ewl_widget_destroy(grid);
@@ -560,19 +560,19 @@ dimensions_auto_resize(char *buf, int len)
ewl_widget_show(grid);
for (i = 0; i < number; i++) {
- Ewl_Widget *child;
+ Ewl_Widget *child;
- child = ewl_cell_new();
- ewl_container_child_append(EWL_CONTAINER(grid), child);
- ewl_widget_show(child);
+ child = ewl_cell_new();
+ ewl_container_child_append(EWL_CONTAINER(grid), child);
+ ewl_widget_show(child);
}
i = 0;
ewl_grid_dimensions_get(EWL_GRID(grid), NULL, &i);
if (i != number / 2) {
- LOG_FAILURE(buf, len, "the grid doesn't have the expected dimensions");
- ret = 0;
+ LOG_FAILURE(buf, len, "the grid doesn't have the expected dimensions");
+ ret = 0;
}
ewl_widget_destroy(grid);
@@ -590,18 +590,18 @@ orientation_set_get(char *buf, int len)
ewl_grid_orientation_set(EWL_GRID(grid), EWL_ORIENTATION_HORIZONTAL);
if (ewl_grid_orientation_get(EWL_GRID(grid))
- != EWL_ORIENTATION_HORIZONTAL) {
- LOG_FAILURE(buf, len, "orientation is not horizontal");
- ret = 0;
- goto CLEANUP;
+ != EWL_ORIENTATION_HORIZONTAL) {
+ LOG_FAILURE(buf, len, "orientation is not horizontal");
+ ret = 0;
+ goto CLEANUP;
}
ewl_grid_orientation_set(EWL_GRID(grid), EWL_ORIENTATION_VERTICAL);
if (ewl_grid_orientation_get(EWL_GRID(grid))
- != EWL_ORIENTATION_VERTICAL) {
- LOG_FAILURE(buf, len, "orientation is not vertiacal");
- ret = 0;
- goto CLEANUP;
+ != EWL_ORIENTATION_VERTICAL) {
+ LOG_FAILURE(buf, len, "orientation is not vertiacal");
+ ret = 0;
+ goto CLEANUP;
}
CLEANUP:
diff --git a/src/bin/tests/histogram/ewl_histogram_test.c b/src/bin/tests/histogram/ewl_histogram_test.c
index 70cd3ef..c3dd620 100644
--- a/src/bin/tests/histogram/ewl_histogram_test.c
+++ b/src/bin/tests/histogram/ewl_histogram_test.c
@@ -31,12 +31,12 @@ create_test(Ewl_Container *box)
ewl_container_child_append(EWL_CONTAINER(box), overlay);
ewl_object_fill_policy_set(EWL_OBJECT(overlay), EWL_FLAG_FILL_ALL);
ewl_callback_append(EWL_WIDGET(overlay), EWL_CALLBACK_CONFIGURE,
- ewl_histogram_test_cb_configure, NULL);
+ ewl_histogram_test_cb_configure, NULL);
ewl_widget_show(overlay);
img = ewl_image_new();
ewl_image_file_path_set(EWL_IMAGE(img),
- PACKAGE_DATA_DIR "/ewl/images/entrance.png");
+ PACKAGE_DATA_DIR "/ewl/images/entrance.png");
ewl_image_proportional_set(EWL_IMAGE(img), TRUE);
ewl_container_child_append(EWL_CONTAINER(overlay), img);
ewl_object_fill_policy_set(EWL_OBJECT(img), EWL_FLAG_FILL_ALL);
@@ -75,15 +75,15 @@ create_test(Ewl_Container *box)
static void
ewl_histogram_test_cb_configure(Ewl_Widget *w, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *child;
Ewl_Container *c = EWL_CONTAINER(w);
ewl_container_child_iterate_begin(c);
while ((child = ewl_container_child_next(c))) {
- ewl_object_place(EWL_OBJECT(child), CURRENT_X(c), CURRENT_Y(c),
- CURRENT_W(c), CURRENT_H(c));
+ ewl_object_place(EWL_OBJECT(child), CURRENT_X(c), CURRENT_Y(c),
+ CURRENT_W(c), CURRENT_H(c));
}
}
diff --git a/src/bin/tests/icon/ewl_icon_test.c b/src/bin/tests/icon/ewl_icon_test.c
index e4150bb..b38a947 100644
--- a/src/bin/tests/icon/ewl_icon_test.c
+++ b/src/bin/tests/icon/ewl_icon_test.c
@@ -31,7 +31,7 @@ create_test(Ewl_Container *box)
o = ewl_icon_new();
ewl_box_orientation_set(EWL_BOX(o), EWL_ORIENTATION_HORIZONTAL);
ewl_icon_image_set(EWL_ICON(o),
- PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
ewl_icon_label_set(EWL_ICON(o), "Draw");
ewl_container_child_append(EWL_CONTAINER(hbox), o);
ewl_widget_show(o);
@@ -39,14 +39,14 @@ create_test(Ewl_Container *box)
o = ewl_icon_new();
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
ewl_icon_image_set(EWL_ICON(o),
- PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
ewl_icon_label_set(EWL_ICON(o), "Fill None");
ewl_container_child_append(EWL_CONTAINER(hbox), o);
ewl_widget_show(o);
o = ewl_icon_new();
ewl_icon_image_set(EWL_ICON(o),
- PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
ewl_icon_label_set(EWL_ICON(o), "Draw");
ewl_container_child_append(EWL_CONTAINER(hbox), o);
ewl_widget_show(o);
@@ -57,7 +57,7 @@ create_test(Ewl_Container *box)
o = ewl_icon_new();
ewl_icon_image_set(EWL_ICON(o),
- PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
ewl_icon_label_set(EWL_ICON(o), "Draw (Editable)");
ewl_icon_editable_set(EWL_ICON(o), TRUE);
ewl_container_child_append(EWL_CONTAINER(box), o);
@@ -69,13 +69,13 @@ create_test(Ewl_Container *box)
o2 = ewl_text_new();
ewl_text_text_set(EWL_TEXT(o2), "This icon has\nextended data\n set "
- "on it.\n\n That data is just \n"
- "text, but could\nbe any widget.");
+ "on it.\n\n That data is just \n"
+ "text, but could\nbe any widget.");
ewl_widget_show(o2);
o = ewl_icon_new();
ewl_icon_image_set(EWL_ICON(o),
- PACKAGE_DATA_DIR "/ewl/images/World.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/World.png", NULL);
ewl_icon_extended_data_set(EWL_ICON(o), o2);
ewl_icon_label_set(EWL_ICON(o), "World");
ewl_icon_type_set(EWL_ICON(o), EWL_ICON_TYPE_LONG);
@@ -88,7 +88,7 @@ create_test(Ewl_Container *box)
o = ewl_icon_new();
ewl_icon_image_set(EWL_ICON(o),
- PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
ewl_icon_label_set(EWL_ICON(o), "This is a long title that is compressed.");
ewl_icon_label_compressed_set(EWL_ICON(o), TRUE);
ewl_container_child_append(EWL_CONTAINER(box), o);
@@ -100,7 +100,7 @@ create_test(Ewl_Container *box)
o = ewl_icon_new();
ewl_icon_image_set(EWL_ICON(o),
- PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
ewl_icon_label_set(EWL_ICON(o), "This is a long title that is compressed.");
ewl_icon_label_compressed_set(EWL_ICON(o), TRUE);
ewl_icon_editable_set(EWL_ICON(o), TRUE);
diff --git a/src/bin/tests/icon_theme/ewl_icon_theme_test.c b/src/bin/tests/icon_theme/ewl_icon_theme_test.c
index e1bf694..2faccf1 100644
--- a/src/bin/tests/icon_theme/ewl_icon_theme_test.c
+++ b/src/bin/tests/icon_theme/ewl_icon_theme_test.c
@@ -12,260 +12,260 @@
static int ewl_icon_theme_pos = 0;
const char *icons[] = {
- EWL_ICON_ADDRESS_BOOK_NEW,
- EWL_ICON_APPLICATION_EXIT,
- EWL_ICON_APPOINTMENT_NEW,
- EWL_ICON_CONTACT_NEW,
- EWL_ICON_DIALOG_APPLY,
- EWL_ICON_DIALOG_CANCEL,
- EWL_ICON_DIALOG_CLOSE,
- EWL_ICON_DIALOG_OK,
- EWL_ICON_DOCUMENT_NEW,
- EWL_ICON_DOCUMENT_OPEN,
- EWL_ICON_DOCUMENT_OPEN_RECENT,
- EWL_ICON_DOCUMENT_PAGE_SETUP,
- EWL_ICON_DOCUMENT_PRINT,
- EWL_ICON_DOCUMENT_PRINT_PREVIEW,
- EWL_ICON_DOCUMENT_PROPERTIES,
- EWL_ICON_DOCUMENT_REVERT,
- EWL_ICON_DOCUMENT_SAVE,
- EWL_ICON_DOCUMENT_SAVE_AS,
- EWL_ICON_EDIT_COPY,
- EWL_ICON_EDIT_CUT,
- EWL_ICON_EDIT_DELETE,
- EWL_ICON_EDIT_FIND,
- EWL_ICON_EDIT_FIND_REPLACE,
- EWL_ICON_EDIT_PASTE,
- EWL_ICON_EDIT_REDO,
- EWL_ICON_EDIT_SELECT_ALL,
- EWL_ICON_EDIT_UNDO,
- EWL_ICON_FORMAT_INDENT_LESS,
- EWL_ICON_FORMAT_INDENT_MORE,
- EWL_ICON_FORMAT_JUSTIFY_CENTER,
- EWL_ICON_FORMAT_JUSTIFY_FILL,
- EWL_ICON_FORMAT_JUSTIFY_LEFT,
- EWL_ICON_FORMAT_JUSTIFY_RIGHT,
- EWL_ICON_FORMAT_TEXT_DIRECTION_LTR,
- EWL_ICON_FORMAT_TEXT_DIRECTION_RTL,
- EWL_ICON_FORMAT_TEXT_BOLD,
- EWL_ICON_FORMAT_TEXT_ITALIC,
- EWL_ICON_FORMAT_TEXT_UNDERLINE,
- EWL_ICON_FORMAT_TEXT_STRIKETHROUGH,
- EWL_ICON_GO_BOTTOM,
- EWL_ICON_GO_DOWN,
- EWL_ICON_GO_FIRST,
- EWL_ICON_GO_HOME,
- EWL_ICON_GO_JUMP,
- EWL_ICON_GO_LAST,
- EWL_ICON_GO_NEXT,
- EWL_ICON_GO_PREVIOUS,
- EWL_ICON_GO_TOP,
- EWL_ICON_GO_UP,
- EWL_ICON_HELP_ABOUT,
- EWL_ICON_HELP_CONTENTS,
- EWL_ICON_HELP_FAQ,
- EWL_ICON_INSERT_IMAGE,
- EWL_ICON_INSERT_LINK,
- EWL_ICON_INSERT_OBJECT,
- EWL_ICON_INSERT_TEXT,
- EWL_ICON_LIST_ADD,
- EWL_ICON_LIST_REMOVE,
- EWL_ICON_MAIL_FORWARD,
- EWL_ICON_MAIL_MARK_IMPORTANT,
- EWL_ICON_MAIL_MARK_JUNK,
- EWL_ICON_MAIL_MARK_NOTJUNK,
- EWL_ICON_MAIL_MARK_READ,
- EWL_ICON_MAIL_MARK_UNREAD,
- EWL_ICON_MAIL_MESSAGE_NEW,
- EWL_ICON_MAIL_REPLY_ALL,
- EWL_ICON_MAIL_REPLY_SENDER,
- EWL_ICON_MAIL_SEND_RECEIVE,
- EWL_ICON_MEDIA_EJECT,
- EWL_ICON_MEDIA_PLAYBACK_PAUSE,
- EWL_ICON_MEDIA_PLAYBACK_START,
- EWL_ICON_MEDIA_PLAYBACK_STOP,
- EWL_ICON_MEDIA_RECORD,
- EWL_ICON_MEDIA_SEEK_BACKWARD,
- EWL_ICON_MEDIA_SEEK_FORWARD,
- EWL_ICON_MEDIA_SKIP_BACKWARD,
- EWL_ICON_MEDIA_SKIP_FORWARD,
- EWL_ICON_SYSTEM_LOCK_SCREEN,
- EWL_ICON_SYSTEM_LOG_OUT,
- EWL_ICON_SYSTEM_RUN,
- EWL_ICON_SYSTEM_SEARCH,
- EWL_ICON_TOOLS_CHECK_SPELLING,
- EWL_ICON_VIEW_FULLSCREEN,
- EWL_ICON_VIEW_REFRESH,
- EWL_ICON_VIEW_SORT_ASCENDING,
- EWL_ICON_VIEW_SORT_DESCENDING,
- EWL_ICON_WINDOW_CLOSE,
- EWL_ICON_WINDOW_NEW,
- EWL_ICON_ZOOM_BEST_FIT,
- EWL_ICON_ZOOM_IN,
- EWL_ICON_ZOOM_ORIGINAL,
- EWL_ICON_ZOOM_OUT,
- EWL_ICON_PROCESS_WORKING,
- EWL_ICON_ACCESSORIES_CALCULATOR,
- EWL_ICON_ACCESSORIES_CHARACTER_MAP,
- EWL_ICON_ACCESSORIES_DICTIONARY,
- EWL_ICON_ACCESSORIES_TEXT_EDITOR,
- EWL_ICON_HELP_BROWSER,
- EWL_ICON_MULTIMEDIA_VOLUME_CONTROL,
- EWL_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY,
- EWL_ICON_PREFERENCES_DESKTOP_FONT,
- EWL_ICON_PREFERENCES_DESKTOP_KEYBOARD,
- EWL_ICON_PREFERENCES_DESKTOP_LOCALE,
- EWL_ICON_PREFERENCES_DESKTOP_MULTIMEDIA,
- EWL_ICON_PREFERENCES_DESKTOP_SCREENSAVER,
- EWL_ICON_PREFERENCES_DESKTOP_THEME,
- EWL_ICON_PREFERENCES_DESKTOP_WALLPAPER,
- EWL_ICON_SYSTEM_FILE_MANAGER,
- EWL_ICON_SYSTEM_SOFTWARE_UPDATE,
- EWL_ICON_UTILITIES_TERMINAL,
- EWL_ICON_APPLICATIONS_ACCESSORIES,
- EWL_ICON_APPLICATIONS_DEVELOPMENT,
- EWL_ICON_APPLICATIONS_GAMES,
- EWL_ICON_APPLICATIONS_GRAPHICS,
- EWL_ICON_APPLICATIONS_INTERNET,
- EWL_ICON_APPLICATIONS_MULTIMEDIA,
- EWL_ICON_APPLICATIONS_OFFICE,
- EWL_ICON_APPLICATIONS_OTHER,
- EWL_ICON_APPLICATIONS_SYSTEM,
- EWL_ICON_APPLICATIONS_UTILITIES,
- EWL_ICON_PREFERENCES_DESKTOP,
- EWL_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY,
- EWL_ICON_PREFERENCES_DESKTOP_PERIPHERALS,
- EWL_ICON_PREFERENCES_DESKTOP_PERSONAL,
- EWL_ICON_PREFERENCES_OTHER,
- EWL_ICON_PREFERENCES_SYSTEM,
- EWL_ICON_PREFERENCES_SYSTEM_NETWORK,
- EWL_ICON_SYSTEM_HELP,
- EWL_ICON_AUDIO_CARD,
- EWL_ICON_AUDIO_INPUT_MICROPHONE,
- EWL_ICON_BATTERY,
- EWL_ICON_CAMERA_PHOTO,
- EWL_ICON_CAMERA_VIDEO,
- EWL_ICON_COMPUTER,
- EWL_ICON_DRIVE_CDROM,
- EWL_ICON_DRIVE_HARDDISK,
- EWL_ICON_DRIVE_REMOVABLE_MEDIA,
- EWL_ICON_INPUT_GAMING,
- EWL_ICON_INPUT_KEYBOARD,
- EWL_ICON_INPUT_MOUSE,
- EWL_ICON_MEDIA_CDROM,
- EWL_ICON_MEDIA_FLOPPY,
- EWL_ICON_MULTIMEDIA_PLAYER,
- EWL_ICON_NETWORK_WIRED,
- EWL_ICON_NETWORK_WIRELESS,
- EWL_ICON_PRINTER,
- EWL_ICON_EMBLEM_DEFAULT,
- EWL_ICON_EMBLEM_DOCUMENTS,
- EWL_ICON_EMBLEM_DOWNLOADS,
- EWL_ICON_EMBLEM_FAVORITE,
- EWL_ICON_EMBLEM_IMPORTANT,
- EWL_ICON_EMBLEM_MAIL,
- EWL_ICON_EMBLEM_PHOTOS,
- EWL_ICON_EMBLEM_READONLY,
- EWL_ICON_EMBLEM_SHARED,
- EWL_ICON_EMBLEM_SYMBOLIC_LINK,
- EWL_ICON_EMBLEM_SYNCHRONIZED,
- EWL_ICON_EMBLEM_SYSTEM,
- EWL_ICON_EMBLEM_UNREADABLE,
- EWL_ICON_FACE_ANGEL,
- EWL_ICON_FACE_CRYING,
- EWL_ICON_FACE_DEVIL_GRIN,
- EWL_ICON_FACE_DEVIL_SAD,
- EWL_ICON_FACE_GLASSES,
- EWL_ICON_FACE_KISS,
- EWL_ICON_FACE_MONKEY,
- EWL_ICON_FACE_PLAIN,
- EWL_ICON_FACE_SAD,
- EWL_ICON_FACE_SMILE,
- EWL_ICON_FACE_SMILE_BIG,
- EWL_ICON_FACE_SMIRK,
- EWL_ICON_FACE_SURPRISE,
- EWL_ICON_FACE_WINK,
- EWL_ICON_APPLICATION_X_EXECUTABLE,
- EWL_ICON_AUDIO_X_GENERIC,
- EWL_ICON_FONT_X_GENERIC,
- EWL_ICON_IMAGE_X_GENERIC,
- EWL_ICON_PACKAGE_X_GENERIC,
- EWL_ICON_TEXT_HTML,
- EWL_ICON_TEXT_X_GENERIC,
- EWL_ICON_TEXT_X_GENERIC_TEMPLATE,
- EWL_ICON_TEXT_X_SCRIPT,
- EWL_ICON_VIDEO_X_GENERIC,
- EWL_ICON_X_OFFICE_ADDRESS_BOOK,
- EWL_ICON_X_OFFICE_CALENDAR,
- EWL_ICON_X_OFFICE_DOCUMENT,
- EWL_ICON_X_OFFICE_PRESENTATION,
- EWL_ICON_X_OFFICE_SPREADSHEET,
- EWL_ICON_FOLDER,
- EWL_ICON_FOLDER_NEW,
- EWL_ICON_FOLDER_REMOTE,
- EWL_ICON_NETWORK_SERVER,
- EWL_ICON_NETWORK_WORKGROUP,
- EWL_ICON_START_HERE,
- EWL_ICON_USER_DESKTOP,
- EWL_ICON_USER_HOME,
- EWL_ICON_USER_TRASH,
- EWL_ICON_APPOINTMENT_MISSED,
- EWL_ICON_APPOINTMENT_SOON,
- EWL_ICON_AUDIO_VOLUME_HIGH,
- EWL_ICON_AUDIO_VOLUME_LOW,
- EWL_ICON_AUDIO_VOLUME_MEDIUM,
- EWL_ICON_AUDIO_VOLUME_MUTED,
- EWL_ICON_BATTERY_CAUTION,
- EWL_ICON_BATTERY_LOW,
- EWL_ICON_DIALOG_ERROR,
- EWL_ICON_DIALOG_INFORMATION,
- EWL_ICON_DIALOG_PASSWORD,
- EWL_ICON_DIALOG_QUESTION,
- EWL_ICON_DIALOG_WARNING,
- EWL_ICON_FOLDER_DRAG_ACCEPT,
- EWL_ICON_FOLDER_OPEN,
- EWL_ICON_FOLDER_VISITING,
- EWL_ICON_IMAGE_LOADING,
- EWL_ICON_IMAGE_MISSING,
- EWL_ICON_MAIL_ATTACHMENT,
- EWL_ICON_MAIL_UNREAD,
- EWL_ICON_MAIL_READ,
- EWL_ICON_MAIL_REPLIED,
- EWL_ICON_MAIL_SIGNED,
- EWL_ICON_MAIL_SIGNED_VERIFIED,
- EWL_ICON_MEDIA_PLAYLIST_REPEAT,
- EWL_ICON_MEDIA_PLAYLIST_SHUFFLE,
- EWL_ICON_NETWORK_ERROR,
- EWL_ICON_NETWORK_IDLE,
- EWL_ICON_NETWORK_OFFLINE,
- EWL_ICON_NETWORK_RECEIVE,
- EWL_ICON_NETWORK_TRANSMIT,
- EWL_ICON_NETWORK_TRANSMIT_RECEIVE,
- EWL_ICON_PRINTER_ERROR,
- EWL_ICON_PRINTER_PRINTING,
- EWL_ICON_SOFTWARE_UPDATE_AVAILABLE,
- EWL_ICON_SOFTWARE_UPDATE_URGENT,
- EWL_ICON_SYNC_ERROR,
- EWL_ICON_SYNC_SYNCHRONIZING,
- EWL_ICON_TASK_DUE,
- EWL_ICON_TASK_PASSED_DUE,
- EWL_ICON_USER_AWAY,
- EWL_ICON_USER_IDLE,
- EWL_ICON_USER_OFFLINE,
- EWL_ICON_USER_ONLINE,
- EWL_ICON_USER_TRASH_FULL,
- EWL_ICON_WEATHER_CLEAR,
- EWL_ICON_WEATHER_CLEAR_NIGHT,
- EWL_ICON_WEATHER_FEW_CLOUDS,
- EWL_ICON_WEATHER_FEW_CLOUDS_NIGHT,
- EWL_ICON_WEATHER_FOG,
- EWL_ICON_WEATHER_OVERCAST,
- EWL_ICON_WEATHER_SEVERE_ALERT,
- EWL_ICON_WEATHER_SHOWERS,
- EWL_ICON_WEATHER_SHOWERS_SCATTERED,
- EWL_ICON_WEATHER_SNOW,
- EWL_ICON_WEATHER_STORM,
- NULL
+ EWL_ICON_ADDRESS_BOOK_NEW,
+ EWL_ICON_APPLICATION_EXIT,
+ EWL_ICON_APPOINTMENT_NEW,
+ EWL_ICON_CONTACT_NEW,
+ EWL_ICON_DIALOG_APPLY,
+ EWL_ICON_DIALOG_CANCEL,
+ EWL_ICON_DIALOG_CLOSE,
+ EWL_ICON_DIALOG_OK,
+ EWL_ICON_DOCUMENT_NEW,
+ EWL_ICON_DOCUMENT_OPEN,
+ EWL_ICON_DOCUMENT_OPEN_RECENT,
+ EWL_ICON_DOCUMENT_PAGE_SETUP,
+ EWL_ICON_DOCUMENT_PRINT,
+ EWL_ICON_DOCUMENT_PRINT_PREVIEW,
+ EWL_ICON_DOCUMENT_PROPERTIES,
+ EWL_ICON_DOCUMENT_REVERT,
+ EWL_ICON_DOCUMENT_SAVE,
+ EWL_ICON_DOCUMENT_SAVE_AS,
+ EWL_ICON_EDIT_COPY,
+ EWL_ICON_EDIT_CUT,
+ EWL_ICON_EDIT_DELETE,
+ EWL_ICON_EDIT_FIND,
+ EWL_ICON_EDIT_FIND_REPLACE,
+ EWL_ICON_EDIT_PASTE,
+ EWL_ICON_EDIT_REDO,
+ EWL_ICON_EDIT_SELECT_ALL,
+ EWL_ICON_EDIT_UNDO,
+ EWL_ICON_FORMAT_INDENT_LESS,
+ EWL_ICON_FORMAT_INDENT_MORE,
+ EWL_ICON_FORMAT_JUSTIFY_CENTER,
+ EWL_ICON_FORMAT_JUSTIFY_FILL,
+ EWL_ICON_FORMAT_JUSTIFY_LEFT,
+ EWL_ICON_FORMAT_JUSTIFY_RIGHT,
+ EWL_ICON_FORMAT_TEXT_DIRECTION_LTR,
+ EWL_ICON_FORMAT_TEXT_DIRECTION_RTL,
+ EWL_ICON_FORMAT_TEXT_BOLD,
+ EWL_ICON_FORMAT_TEXT_ITALIC,
+ EWL_ICON_FORMAT_TEXT_UNDERLINE,
+ EWL_ICON_FORMAT_TEXT_STRIKETHROUGH,
+ EWL_ICON_GO_BOTTOM,
+ EWL_ICON_GO_DOWN,
+ EWL_ICON_GO_FIRST,
+ EWL_ICON_GO_HOME,
+ EWL_ICON_GO_JUMP,
+ EWL_ICON_GO_LAST,
+ EWL_ICON_GO_NEXT,
+ EWL_ICON_GO_PREVIOUS,
+ EWL_ICON_GO_TOP,
+ EWL_ICON_GO_UP,
+ EWL_ICON_HELP_ABOUT,
+ EWL_ICON_HELP_CONTENTS,
+ EWL_ICON_HELP_FAQ,
+ EWL_ICON_INSERT_IMAGE,
+ EWL_ICON_INSERT_LINK,
+ EWL_ICON_INSERT_OBJECT,
+ EWL_ICON_INSERT_TEXT,
+ EWL_ICON_LIST_ADD,
+ EWL_ICON_LIST_REMOVE,
+ EWL_ICON_MAIL_FORWARD,
+ EWL_ICON_MAIL_MARK_IMPORTANT,
+ EWL_ICON_MAIL_MARK_JUNK,
+ EWL_ICON_MAIL_MARK_NOTJUNK,
+ EWL_ICON_MAIL_MARK_READ,
+ EWL_ICON_MAIL_MARK_UNREAD,
+ EWL_ICON_MAIL_MESSAGE_NEW,
+ EWL_ICON_MAIL_REPLY_ALL,
+ EWL_ICON_MAIL_REPLY_SENDER,
+ EWL_ICON_MAIL_SEND_RECEIVE,
+ EWL_ICON_MEDIA_EJECT,
+ EWL_ICON_MEDIA_PLAYBACK_PAUSE,
+ EWL_ICON_MEDIA_PLAYBACK_START,
+ EWL_ICON_MEDIA_PLAYBACK_STOP,
+ EWL_ICON_MEDIA_RECORD,
+ EWL_ICON_MEDIA_SEEK_BACKWARD,
+ EWL_ICON_MEDIA_SEEK_FORWARD,
+ EWL_ICON_MEDIA_SKIP_BACKWARD,
+ EWL_ICON_MEDIA_SKIP_FORWARD,
+ EWL_ICON_SYSTEM_LOCK_SCREEN,
+ EWL_ICON_SYSTEM_LOG_OUT,
+ EWL_ICON_SYSTEM_RUN,
+ EWL_ICON_SYSTEM_SEARCH,
+ EWL_ICON_TOOLS_CHECK_SPELLING,
+ EWL_ICON_VIEW_FULLSCREEN,
+ EWL_ICON_VIEW_REFRESH,
+ EWL_ICON_VIEW_SORT_ASCENDING,
+ EWL_ICON_VIEW_SORT_DESCENDING,
+ EWL_ICON_WINDOW_CLOSE,
+ EWL_ICON_WINDOW_NEW,
+ EWL_ICON_ZOOM_BEST_FIT,
+ EWL_ICON_ZOOM_IN,
+ EWL_ICON_ZOOM_ORIGINAL,
+ EWL_ICON_ZOOM_OUT,
+ EWL_ICON_PROCESS_WORKING,
+ EWL_ICON_ACCESSORIES_CALCULATOR,
+ EWL_ICON_ACCESSORIES_CHARACTER_MAP,
+ EWL_ICON_ACCESSORIES_DICTIONARY,
+ EWL_ICON_ACCESSORIES_TEXT_EDITOR,
+ EWL_ICON_HELP_BROWSER,
+ EWL_ICON_MULTIMEDIA_VOLUME_CONTROL,
+ EWL_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY,
+ EWL_ICON_PREFERENCES_DESKTOP_FONT,
+ EWL_ICON_PREFERENCES_DESKTOP_KEYBOARD,
+ EWL_ICON_PREFERENCES_DESKTOP_LOCALE,
+ EWL_ICON_PREFERENCES_DESKTOP_MULTIMEDIA,
+ EWL_ICON_PREFERENCES_DESKTOP_SCREENSAVER,
+ EWL_ICON_PREFERENCES_DESKTOP_THEME,
+ EWL_ICON_PREFERENCES_DESKTOP_WALLPAPER,
+ EWL_ICON_SYSTEM_FILE_MANAGER,
+ EWL_ICON_SYSTEM_SOFTWARE_UPDATE,
+ EWL_ICON_UTILITIES_TERMINAL,
+ EWL_ICON_APPLICATIONS_ACCESSORIES,
+ EWL_ICON_APPLICATIONS_DEVELOPMENT,
+ EWL_ICON_APPLICATIONS_GAMES,
+ EWL_ICON_APPLICATIONS_GRAPHICS,
+ EWL_ICON_APPLICATIONS_INTERNET,
+ EWL_ICON_APPLICATIONS_MULTIMEDIA,
+ EWL_ICON_APPLICATIONS_OFFICE,
+ EWL_ICON_APPLICATIONS_OTHER,
+ EWL_ICON_APPLICATIONS_SYSTEM,
+ EWL_ICON_APPLICATIONS_UTILITIES,
+ EWL_ICON_PREFERENCES_DESKTOP,
+ EWL_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY,
+ EWL_ICON_PREFERENCES_DESKTOP_PERIPHERALS,
+ EWL_ICON_PREFERENCES_DESKTOP_PERSONAL,
+ EWL_ICON_PREFERENCES_OTHER,
+ EWL_ICON_PREFERENCES_SYSTEM,
+ EWL_ICON_PREFERENCES_SYSTEM_NETWORK,
+ EWL_ICON_SYSTEM_HELP,
+ EWL_ICON_AUDIO_CARD,
+ EWL_ICON_AUDIO_INPUT_MICROPHONE,
+ EWL_ICON_BATTERY,
+ EWL_ICON_CAMERA_PHOTO,
+ EWL_ICON_CAMERA_VIDEO,
+ EWL_ICON_COMPUTER,
+ EWL_ICON_DRIVE_CDROM,
+ EWL_ICON_DRIVE_HARDDISK,
+ EWL_ICON_DRIVE_REMOVABLE_MEDIA,
+ EWL_ICON_INPUT_GAMING,
+ EWL_ICON_INPUT_KEYBOARD,
+ EWL_ICON_INPUT_MOUSE,
+ EWL_ICON_MEDIA_CDROM,
+ EWL_ICON_MEDIA_FLOPPY,
+ EWL_ICON_MULTIMEDIA_PLAYER,
+ EWL_ICON_NETWORK_WIRED,
+ EWL_ICON_NETWORK_WIRELESS,
+ EWL_ICON_PRINTER,
+ EWL_ICON_EMBLEM_DEFAULT,
+ EWL_ICON_EMBLEM_DOCUMENTS,
+ EWL_ICON_EMBLEM_DOWNLOADS,
+ EWL_ICON_EMBLEM_FAVORITE,
+ EWL_ICON_EMBLEM_IMPORTANT,
+ EWL_ICON_EMBLEM_MAIL,
+ EWL_ICON_EMBLEM_PHOTOS,
+ EWL_ICON_EMBLEM_READONLY,
+ EWL_ICON_EMBLEM_SHARED,
+ EWL_ICON_EMBLEM_SYMBOLIC_LINK,
+ EWL_ICON_EMBLEM_SYNCHRONIZED,
+ EWL_ICON_EMBLEM_SYSTEM,
+ EWL_ICON_EMBLEM_UNREADABLE,
+ EWL_ICON_FACE_ANGEL,
+ EWL_ICON_FACE_CRYING,
+ EWL_ICON_FACE_DEVIL_GRIN,
+ EWL_ICON_FACE_DEVIL_SAD,
+ EWL_ICON_FACE_GLASSES,
+ EWL_ICON_FACE_KISS,
+ EWL_ICON_FACE_MONKEY,
+ EWL_ICON_FACE_PLAIN,
+ EWL_ICON_FACE_SAD,
+ EWL_ICON_FACE_SMILE,
+ EWL_ICON_FACE_SMILE_BIG,
+ EWL_ICON_FACE_SMIRK,
+ EWL_ICON_FACE_SURPRISE,
+ EWL_ICON_FACE_WINK,
+ EWL_ICON_APPLICATION_X_EXECUTABLE,
+ EWL_ICON_AUDIO_X_GENERIC,
+ EWL_ICON_FONT_X_GENERIC,
+ EWL_ICON_IMAGE_X_GENERIC,
+ EWL_ICON_PACKAGE_X_GENERIC,
+ EWL_ICON_TEXT_HTML,
+ EWL_ICON_TEXT_X_GENERIC,
+ EWL_ICON_TEXT_X_GENERIC_TEMPLATE,
+ EWL_ICON_TEXT_X_SCRIPT,
+ EWL_ICON_VIDEO_X_GENERIC,
+ EWL_ICON_X_OFFICE_ADDRESS_BOOK,
+ EWL_ICON_X_OFFICE_CALENDAR,
+ EWL_ICON_X_OFFICE_DOCUMENT,
+ EWL_ICON_X_OFFICE_PRESENTATION,
+ EWL_ICON_X_OFFICE_SPREADSHEET,
+ EWL_ICON_FOLDER,
+ EWL_ICON_FOLDER_NEW,
+ EWL_ICON_FOLDER_REMOTE,
+ EWL_ICON_NETWORK_SERVER,
+ EWL_ICON_NETWORK_WORKGROUP,
+ EWL_ICON_START_HERE,
+ EWL_ICON_USER_DESKTOP,
+ EWL_ICON_USER_HOME,
+ EWL_ICON_USER_TRASH,
+ EWL_ICON_APPOINTMENT_MISSED,
+ EWL_ICON_APPOINTMENT_SOON,
+ EWL_ICON_AUDIO_VOLUME_HIGH,
+ EWL_ICON_AUDIO_VOLUME_LOW,
+ EWL_ICON_AUDIO_VOLUME_MEDIUM,
+ EWL_ICON_AUDIO_VOLUME_MUTED,
+ EWL_ICON_BATTERY_CAUTION,
+ EWL_ICON_BATTERY_LOW,
+ EWL_ICON_DIALOG_ERROR,
+ EWL_ICON_DIALOG_INFORMATION,
+ EWL_ICON_DIALOG_PASSWORD,
+ EWL_ICON_DIALOG_QUESTION,
+ EWL_ICON_DIALOG_WARNING,
+ EWL_ICON_FOLDER_DRAG_ACCEPT,
+ EWL_ICON_FOLDER_OPEN,
+ EWL_ICON_FOLDER_VISITING,
+ EWL_ICON_IMAGE_LOADING,
+ EWL_ICON_IMAGE_MISSING,
+ EWL_ICON_MAIL_ATTACHMENT,
+ EWL_ICON_MAIL_UNREAD,
+ EWL_ICON_MAIL_READ,
+ EWL_ICON_MAIL_REPLIED,
+ EWL_ICON_MAIL_SIGNED,
+ EWL_ICON_MAIL_SIGNED_VERIFIED,
+ EWL_ICON_MEDIA_PLAYLIST_REPEAT,
+ EWL_ICON_MEDIA_PLAYLIST_SHUFFLE,
+ EWL_ICON_NETWORK_ERROR,
+ EWL_ICON_NETWORK_IDLE,
+ EWL_ICON_NETWORK_OFFLINE,
+ EWL_ICON_NETWORK_RECEIVE,
+ EWL_ICON_NETWORK_TRANSMIT,
+ EWL_ICON_NETWORK_TRANSMIT_RECEIVE,
+ EWL_ICON_PRINTER_ERROR,
+ EWL_ICON_PRINTER_PRINTING,
+ EWL_ICON_SOFTWARE_UPDATE_AVAILABLE,
+ EWL_ICON_SOFTWARE_UPDATE_URGENT,
+ EWL_ICON_SYNC_ERROR,
+ EWL_ICON_SYNC_SYNCHRONIZING,
+ EWL_ICON_TASK_DUE,
+ EWL_ICON_TASK_PASSED_DUE,
+ EWL_ICON_USER_AWAY,
+ EWL_ICON_USER_IDLE,
+ EWL_ICON_USER_OFFLINE,
+ EWL_ICON_USER_ONLINE,
+ EWL_ICON_USER_TRASH_FULL,
+ EWL_ICON_WEATHER_CLEAR,
+ EWL_ICON_WEATHER_CLEAR_NIGHT,
+ EWL_ICON_WEATHER_FEW_CLOUDS,
+ EWL_ICON_WEATHER_FEW_CLOUDS_NIGHT,
+ EWL_ICON_WEATHER_FOG,
+ EWL_ICON_WEATHER_OVERCAST,
+ EWL_ICON_WEATHER_SEVERE_ALERT,
+ EWL_ICON_WEATHER_SHOWERS,
+ EWL_ICON_WEATHER_SHOWERS_SCATTERED,
+ EWL_ICON_WEATHER_SNOW,
+ EWL_ICON_WEATHER_STORM,
+ NULL
};
static int create_test(Ewl_Container *box);
@@ -310,24 +310,24 @@ ewl_icon_theme_idle(void *data)
fbox = data;
for ( ; icons[ewl_icon_theme_pos] != NULL;
- ewl_icon_theme_pos++, count ++)
+ ewl_icon_theme_pos++, count ++)
{
- const char *path;
+ const char *path;
- if (count >= EWL_ICON_THEME_PER_LOOP)
- {
- ret = 1;
- break;
- }
+ if (count >= EWL_ICON_THEME_PER_LOOP)
+ {
+ ret = 1;
+ break;
+ }
- path = ewl_icon_theme_icon_path_get(icons[ewl_icon_theme_pos],
- EWL_ICON_SIZE_MEDIUM);
- o = ewl_icon_simple_new();
- if (path) ewl_icon_image_set(EWL_ICON(o), path,
- icons[ewl_icon_theme_pos]);
- ewl_icon_label_set(EWL_ICON(o), icons[ewl_icon_theme_pos]);
- ewl_container_child_append(EWL_CONTAINER(fbox), o);
- ewl_widget_show(o);
+ path = ewl_icon_theme_icon_path_get(icons[ewl_icon_theme_pos],
+ EWL_ICON_SIZE_MEDIUM);
+ o = ewl_icon_simple_new();
+ if (path) ewl_icon_image_set(EWL_ICON(o), path,
+ icons[ewl_icon_theme_pos]);
+ ewl_icon_label_set(EWL_ICON(o), icons[ewl_icon_theme_pos]);
+ ewl_container_child_append(EWL_CONTAINER(fbox), o);
+ ewl_widget_show(o);
}
return ret;
diff --git a/src/bin/tests/image/ewl_image_test.c b/src/bin/tests/image/ewl_image_test.c
index 273380a..23d67e1 100644
--- a/src/bin/tests/image/ewl_image_test.c
+++ b/src/bin/tests/image/ewl_image_test.c
@@ -33,12 +33,12 @@ static int constrain_test_set_get(char *buf, int len);
static int proportional_test_set_get(char *buf, int len);
static Ewl_Unit_Test image_unit_tests[] = {
- {"image path set/get", path_test_set_get, NULL, -1, 0},
- {"image scale set/get", scale_test_set_get, NULL, -1, 0},
- {"image size set/get", size_test_set_get, NULL, -1, 0},
- {"image constrain set/get", constrain_test_set_get, NULL, -1, 0},
- {"image proportional set/get", proportional_test_set_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"image path set/get", path_test_set_get, NULL, -1, 0},
+ {"image scale set/get", scale_test_set_get, NULL, -1, 0},
+ {"image size set/get", size_test_set_get, NULL, -1, 0},
+ {"image constrain set/get", constrain_test_set_get, NULL, -1, 0},
+ {"image proportional set/get", proportional_test_set_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -46,7 +46,7 @@ test_info(Ewl_Test *test)
{
test->name = "Image";
test->tip = "Provides a widget for displaying evas\n"
- "loadable images, and edjes.";
+ "loadable images, and edjes.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -55,16 +55,16 @@ test_info(Ewl_Test *test)
static void
destroy_image_test(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
ecore_dlist_destroy(images);
if (last_dir)
- free(last_dir);
+ free(last_dir);
}
static void
image_goto_prev_cb(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
char *img = NULL;
@@ -79,7 +79,7 @@ image_goto_prev_cb(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
static void
image_remove_cb(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
char *img = NULL;
@@ -97,16 +97,16 @@ static void
image_load(const char *img)
{
if (img && ecore_file_exists(img)) {
- ecore_dlist_append(images, strdup(img));
- ecore_dlist_last_goto(images);
- ewl_image_file_set(EWL_IMAGE(image), img, NULL);
+ ecore_dlist_append(images, strdup(img));
+ ecore_dlist_last_goto(images);
+ ewl_image_file_set(EWL_IMAGE(image), img, NULL);
} else
- printf("ERROR: %s does not exist\n", img);
+ printf("ERROR: %s does not exist\n", img);
}
static void
image_goto_next_cb(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
char *img = NULL;
@@ -114,7 +114,7 @@ image_goto_next_cb(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
img = ecore_dlist_current(images);
if (!img)
- img = ecore_dlist_first_goto(images);
+ img = ecore_dlist_first_goto(images);
ewl_text_text_set(EWL_TEXT(entry_path), img);
ewl_image_file_set(EWL_IMAGE(image), img, NULL);
@@ -122,7 +122,7 @@ image_goto_next_cb(Ewl_Widget * w __UNUSED__, void *ev_data __UNUSED__,
void
entry_path_cb_value_changed(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
char *img;
@@ -145,18 +145,18 @@ create_test(Ewl_Container *image_box)
scrollpane = ewl_scrollpane_new();
ewl_callback_append(scrollpane, EWL_CALLBACK_DELETE_WINDOW,
- destroy_image_test, NULL);
+ destroy_image_test, NULL);
ewl_container_child_append(image_box, scrollpane);
ewl_widget_show(scrollpane);
if ((ecore_file_exists(PACKAGE_DATA_DIR "/ewl/images/e-logo.png")))
- image_file = strdup(PACKAGE_DATA_DIR "/ewl/images/e-logo.png");
+ image_file = strdup(PACKAGE_DATA_DIR "/ewl/images/e-logo.png");
else if ((ecore_file_exists(PACKAGE_SOURCE_DIR "/data/images/e-logo.png")))
- image_file = strdup(PACKAGE_SOURCE_DIR "/data/images/e-logo.png");
+ image_file = strdup(PACKAGE_SOURCE_DIR "/data/images/e-logo.png");
else if ((ecore_file_exists("./data/images/e-logo.png")))
- image_file = strdup("./data/images/e-logo.png");
+ image_file = strdup("./data/images/e-logo.png");
else if ((ecore_file_exists("../data/images/e-logo.png")))
- image_file = strdup("../data/images/e-logo.png");
+ image_file = strdup("../data/images/e-logo.png");
image = ewl_image_new();
ewl_image_file_set(EWL_IMAGE(image), image_file, NULL);
@@ -166,29 +166,29 @@ create_test(Ewl_Container *image_box)
ewl_widget_show(image);
if (image_file)
- ecore_dlist_append(images, image_file);
+ ecore_dlist_append(images, image_file);
box = ewl_hbox_new();
ewl_box_spacing_set(EWL_BOX(box), 5);
ewl_object_fill_policy_set(EWL_OBJECT(box),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
ewl_container_child_append(image_box, box);
ewl_widget_show(box);
entry_path = ewl_entry_new();
ewl_text_text_set(EWL_TEXT(entry_path), image_file);
ewl_object_fill_policy_set(EWL_OBJECT(entry_path),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
ewl_object_alignment_set(EWL_OBJECT(entry_path), EWL_FLAG_ALIGN_CENTER);
ewl_container_child_append(EWL_CONTAINER(box), entry_path);
ewl_callback_append(entry_path, EWL_CALLBACK_VALUE_CHANGED,
- entry_path_cb_value_changed, NULL);
+ entry_path_cb_value_changed, NULL);
ewl_widget_show(entry_path);
button = ewl_button_new();
ewl_stock_type_set(EWL_STOCK(button), EWL_STOCK_OPEN);
ewl_callback_append(button, EWL_CALLBACK_CLICKED,
- create_image_fd_cb, entry_path);
+ create_image_fd_cb, entry_path);
ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_NONE);
ewl_container_child_append(EWL_CONTAINER(box), button);
ewl_widget_show(button);
@@ -196,9 +196,9 @@ create_test(Ewl_Container *image_box)
box = ewl_hbox_new();
ewl_box_spacing_set(EWL_BOX(box), 5);
ewl_object_fill_policy_set(EWL_OBJECT(box),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(box),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_container_child_append(image_box, box);
ewl_widget_show(box);
@@ -207,7 +207,7 @@ create_test(Ewl_Container *image_box)
ewl_button_label_set(EWL_BUTTON(button), "Previous");
ewl_container_child_append(EWL_CONTAINER(box), button);
ewl_callback_append(button, EWL_CALLBACK_CLICKED,
- image_goto_prev_cb, NULL);
+ image_goto_prev_cb, NULL);
ewl_widget_show(button);
/* the remove button */
@@ -215,7 +215,7 @@ create_test(Ewl_Container *image_box)
ewl_button_label_set(EWL_BUTTON(button), "Remove");
ewl_container_child_append(EWL_CONTAINER(box), button);
ewl_callback_append(button, EWL_CALLBACK_CLICKED,
- image_remove_cb, NULL);
+ image_remove_cb, NULL);
ewl_widget_show(button);
/* the next button */
@@ -223,7 +223,7 @@ create_test(Ewl_Container *image_box)
ewl_button_label_set(EWL_BUTTON(button), "Next");
ewl_container_child_append(EWL_CONTAINER(box), button);
ewl_callback_append(button, EWL_CALLBACK_CLICKED,
- image_goto_next_cb, NULL);
+ image_goto_next_cb, NULL);
ewl_widget_show(button);
box = ewl_hbox_new();
@@ -244,19 +244,19 @@ create_test(Ewl_Container *image_box)
static void
create_image_fd_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
if (fd)
- return;
+ return;
fd = ewl_filedialog_new();
ewl_window_title_set(EWL_WINDOW(fd), "Select an Image...");
ewl_window_name_set(EWL_WINDOW(fd), "EWL Image Test");
ewl_window_class_set(EWL_WINDOW(fd), "EWL Filedialog");
ewl_callback_append(fd, EWL_CALLBACK_VALUE_CHANGED,
- create_image_fd_window_response, user_data);
+ create_image_fd_window_response, user_data);
if (last_dir)
- ewl_filedialog_directory_set(EWL_FILEDIALOG(fd), last_dir);
+ ewl_filedialog_directory_set(EWL_FILEDIALOG(fd), last_dir);
ewl_widget_show(fd);
}
@@ -269,27 +269,27 @@ create_image_fd_window_response(Ewl_Widget *w, void *ev, void *data)
e = ev;
if (e->response == EWL_STOCK_OK) {
- char *filename;
- const char *dir;
-
- filename = ewl_filedialog_selected_file_get(EWL_FILEDIALOG (w));
- printf("File open from image test: %s\n", filename);
- if (filename) {
- ewl_text_text_set(EWL_TEXT(entry), filename);
- image_load(filename);
- free (filename);
- }
- if (last_dir) {
- free(last_dir);
- last_dir = NULL;
- }
-
- dir = ewl_filedialog_directory_get(EWL_FILEDIALOG(fd));
- if (dir)
- last_dir = strdup(dir);
+ char *filename;
+ const char *dir;
+
+ filename = ewl_filedialog_selected_file_get(EWL_FILEDIALOG (w));
+ printf("File open from image test: %s\n", filename);
+ if (filename) {
+ ewl_text_text_set(EWL_TEXT(entry), filename);
+ image_load(filename);
+ free (filename);
+ }
+ if (last_dir) {
+ free(last_dir);
+ last_dir = NULL;
+ }
+
+ dir = ewl_filedialog_directory_get(EWL_FILEDIALOG(fd));
+ if (dir)
+ last_dir = strdup(dir);
}
else {
- printf("Test program says bugger off.\n");
+ printf("Test program says bugger off.\n");
}
ewl_widget_destroy(fd);
@@ -311,9 +311,9 @@ path_test_set_get(char *buf, int len)
t = ewl_image_file_path_get(EWL_IMAGE(o));
if (strcmp(t, "/invalid/path"))
- LOG_FAILURE(buf, len, "path_get did not match path_set.");
+ LOG_FAILURE(buf, len, "path_get did not match path_set.");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -330,9 +330,9 @@ scale_test_set_get(char *buf, int len)
ewl_image_scale_get(EWL_IMAGE(o), &sw, &sh);
if (sw != 2.0 || sh != 2.0)
- LOG_FAILURE(buf, len, "scale_get did not match scale_set.");
+ LOG_FAILURE(buf, len, "scale_get did not match scale_set.");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -349,9 +349,9 @@ size_test_set_get(char *buf, int len)
ewl_image_size_get(EWL_IMAGE(o), &sw, &sh);
if (sw != 2 || sh != 2)
- LOG_FAILURE(buf, len, "size_get did not match size_set.");
+ LOG_FAILURE(buf, len, "size_get did not match size_set.");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -368,9 +368,9 @@ constrain_test_set_get(char *buf, int len)
sw = ewl_image_constrain_get(EWL_IMAGE(o));
if (sw != 2)
- LOG_FAILURE(buf, len, "scale_get did not match scale_set.");
+ LOG_FAILURE(buf, len, "scale_get did not match scale_set.");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -387,9 +387,9 @@ proportional_test_set_get(char *buf, int len)
p = ewl_image_proportional_get(EWL_IMAGE(o));
if (p != TRUE)
- LOG_FAILURE(buf, len, "proportional_get did not match set.");
+ LOG_FAILURE(buf, len, "proportional_get did not match set.");
else
- ret = 1;
+ ret = 1;
return ret;
}
diff --git a/src/bin/tests/image_thumbnail/ewl_image_thumbnail_test.c b/src/bin/tests/image_thumbnail/ewl_image_thumbnail_test.c
index cf8c6f1..9571867 100644
--- a/src/bin/tests/image_thumbnail/ewl_image_thumbnail_test.c
+++ b/src/bin/tests/image_thumbnail/ewl_image_thumbnail_test.c
@@ -18,7 +18,7 @@ test_info(Ewl_Test *test)
{
test->name = "Image Thumbnail";
test->tip = "Provides a widget for displaying\n"
- "thumbnails of images.";
+ "thumbnails of images.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -36,13 +36,13 @@ create_test(Ewl_Container *box)
image_box = EWL_WIDGET(box);
if ((ecore_file_exists(PACKAGE_DATA_DIR "/ewl/images/e-logo.png")) != -1)
- image_file = strdup(PACKAGE_DATA_DIR "/ewl/images/e-logo.png");
+ image_file = strdup(PACKAGE_DATA_DIR "/ewl/images/e-logo.png");
else if ((ecore_file_exists(PACKAGE_SOURCE_DIR "/data/images/e-logo.png")) != -1)
- image_file = strdup(PACKAGE_SOURCE_DIR "/data/images/e-logo.png");
+ image_file = strdup(PACKAGE_SOURCE_DIR "/data/images/e-logo.png");
else if ((ecore_file_exists("./data/images/e-logo.png")) != -1)
- image_file = strdup("./data/images/e-logo.png");
+ image_file = strdup("./data/images/e-logo.png");
else if ((ecore_file_exists("../data/images/e-logo.png")) != -1)
- image_file = strdup("../data/images/e-logo.png");
+ image_file = strdup("../data/images/e-logo.png");
image = ewl_image_new();
ewl_image_file_set(EWL_IMAGE(image), image_file, NULL);
@@ -52,19 +52,19 @@ create_test(Ewl_Container *box)
ewl_widget_show(image);
if ((ecore_file_exists(PACKAGE_DATA_DIR "/ewl/images/Draw.png")) != -1)
- icon_file = strdup(PACKAGE_DATA_DIR "/ewl/images/Draw.png");
+ icon_file = strdup(PACKAGE_DATA_DIR "/ewl/images/Draw.png");
else if ((ecore_file_exists(PACKAGE_SOURCE_DIR "/data/images/Draw.png")) != -1)
- icon_file = strdup(PACKAGE_SOURCE_DIR "/data/images/Draw.png");
+ icon_file = strdup(PACKAGE_SOURCE_DIR "/data/images/Draw.png");
else if ((ecore_file_exists("./data/images/Draw.png")) != -1)
- icon_file = strdup("./data/images/Draw.png");
+ icon_file = strdup("./data/images/Draw.png");
else if ((ecore_file_exists("../data/images/Draw.png")) != -1)
- icon_file = strdup("../data/images/Draw.png");
+ icon_file = strdup("../data/images/Draw.png");
thumb = ewl_image_thumbnail_get(EWL_IMAGE(image));
ewl_image_constrain_set(EWL_IMAGE(thumb), 32);
if (icon_file)
- ewl_image_file_path_set(EWL_IMAGE(thumb), icon_file);
+ ewl_image_file_path_set(EWL_IMAGE(thumb), icon_file);
ewl_container_child_append(EWL_CONTAINER(image_box), thumb);
ewl_widget_show(thumb);
diff --git a/src/bin/tests/io_manager/ewl_io_manager_test.c b/src/bin/tests/io_manager/ewl_io_manager_test.c
index 48e0aef..c09e65f 100644
--- a/src/bin/tests/io_manager/ewl_io_manager_test.c
+++ b/src/bin/tests/io_manager/ewl_io_manager_test.c
@@ -49,7 +49,7 @@ create_test(Ewl_Container *box)
static void
cb_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *fd;
Ecore_List *filters;
@@ -84,7 +84,7 @@ cb_open(Ewl_Widget *w, void *ev, void *data __UNUSED__)
e = ev;
if (e->response == EWL_STOCK_CANCEL)
- return;
+ return;
fd = EWL_FILEDIALOG(w);
s = ewl_filedialog_selected_file_get(fd);
@@ -96,8 +96,8 @@ cb_open(Ewl_Widget *w, void *ev, void *data __UNUSED__)
t = ewl_io_manager_uri_read(s);
if (!t)
{
- printf("Unable to create widget from file (%s)\n", s);
- return;
+ printf("Unable to create widget from file (%s)\n", s);
+ return;
}
ewl_container_child_append(EWL_CONTAINER(scroll), t);
ewl_widget_show(t);
diff --git a/src/bin/tests/kinetic_scrollpane/ewl_kinetic_scrollpane_test.c b/src/bin/tests/kinetic_scrollpane/ewl_kinetic_scrollpane_test.c
index bc283e1..15255f0 100644
--- a/src/bin/tests/kinetic_scrollpane/ewl_kinetic_scrollpane_test.c
+++ b/src/bin/tests/kinetic_scrollpane/ewl_kinetic_scrollpane_test.c
@@ -59,10 +59,10 @@ create_test(Ewl_Container *box)
ewl_callback_append(EWL_WIDGET(box), EWL_CALLBACK_DESTROY, destroy_test, data);
for (i = 0; i < 500; i++)
{
- char text[10];
+ char text[10];
- snprintf(text, sizeof(text), "Row: %d", i);
- ecore_list_append(data, strdup(text));
+ snprintf(text, sizeof(text), "Row: %d", i);
+ ecore_list_append(data, strdup(text));
}
c = ewl_vpaned_new();
@@ -119,13 +119,13 @@ scroll_type_get(char *buf, int len)
tree = ewl_tree_new();
ewl_tree_kinetic_scrolling_set(EWL_TREE(tree),
- EWL_KINETIC_SCROLL_NORMAL);
+ EWL_KINETIC_SCROLL_NORMAL);
type = ewl_tree_kinetic_scrolling_get(EWL_TREE(tree));
if (type != EWL_KINETIC_SCROLL_NORMAL)
{
- LOG_FAILURE(buf, len, "get type is different from the set one");
- ret = 0;
+ LOG_FAILURE(buf, len, "get type is different from the set one");
+ ret = 0;
}
ewl_widget_destroy(tree);
@@ -147,8 +147,8 @@ kinetic_dampen_get(char *buf, int len)
if (val != set)
{
- LOG_FAILURE(buf, len, "get dampen is different from the set dampen");
- ret = 0;
+ LOG_FAILURE(buf, len, "get dampen is different from the set dampen");
+ ret = 0;
}
ewl_widget_destroy(tree);
@@ -170,8 +170,8 @@ kinetic_vmax_get(char *buf, int len)
if (val != set)
{
- LOG_FAILURE(buf, len, "get vmax is different from the set vmax");
- ret = 0;
+ LOG_FAILURE(buf, len, "get vmax is different from the set vmax");
+ ret = 0;
}
ewl_widget_destroy(tree);
@@ -193,8 +193,8 @@ kinetic_vmin_get(char *buf, int len)
if (val != set)
{
- LOG_FAILURE(buf, len, "get vmin is different from the set vmin");
- ret = 0;
+ LOG_FAILURE(buf, len, "get vmin is different from the set vmin");
+ ret = 0;
}
ewl_widget_destroy(tree);
@@ -215,8 +215,8 @@ kinetic_fps_get(char *buf, int len)
if (val != 3)
{
- LOG_FAILURE(buf, len, "get fps is different from the set fps");
- ret = 0;
+ LOG_FAILURE(buf, len, "get fps is different from the set fps");
+ ret = 0;
}
ewl_widget_destroy(tree);
diff --git a/src/bin/tests/label/ewl_label_test.c b/src/bin/tests/label/ewl_label_test.c
index a94748b..437f435 100644
--- a/src/bin/tests/label/ewl_label_test.c
+++ b/src/bin/tests/label/ewl_label_test.c
@@ -16,10 +16,10 @@ static int label_null_test_set_get(char *buf, int len);
static int label_test_set_get(char *buf, int len);
static Ewl_Unit_Test label_unit_tests[] = {
- {"label null get", label_null_test_get, NULL, -1, 0},
- {"label null set/get", label_null_test_set_get, NULL, -1, 0},
- {"label set/get", label_test_set_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"label null get", label_null_test_get, NULL, -1, 0},
+ {"label null set/get", label_null_test_set_get, NULL, -1, 0},
+ {"label set/get", label_test_set_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -61,9 +61,9 @@ void
cb_click(Ewl_Widget *w __UNUSED__, void *e __UNUSED__, void *data)
{
if ((counter % 2) == 0)
- ewl_label_text_set(EWL_LABEL(data), "Second Label");
+ ewl_label_text_set(EWL_LABEL(data), "Second Label");
else
- ewl_label_text_set(EWL_LABEL(data), "First label");
+ ewl_label_text_set(EWL_LABEL(data), "First label");
counter ++;
}
@@ -77,9 +77,9 @@ label_null_test_get(char *buf, int len)
label = ewl_label_new();
if (ewl_label_text_get(EWL_LABEL(label)))
- LOG_FAILURE(buf, len, "text_get not NULL");
+ LOG_FAILURE(buf, len, "text_get not NULL");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(label);
@@ -100,9 +100,9 @@ label_null_test_set_get(char *buf, int len)
val = ewl_label_text_get(EWL_LABEL(label));
if (val)
- LOG_FAILURE(buf, len, "text_set_get %s instead of NULL", val);
+ LOG_FAILURE(buf, len, "text_set_get %s instead of NULL", val);
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(label);
@@ -122,9 +122,9 @@ label_test_set_get(char *buf, int len)
val = ewl_label_text_get(EWL_LABEL(label));
if (strcmp(val, "some text"))
- LOG_FAILURE(buf, len, "%s is not 'some text'", val);
+ LOG_FAILURE(buf, len, "%s is not 'some text'", val);
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(label);
diff --git a/src/bin/tests/layer/ewl_layer_test.c b/src/bin/tests/layer/ewl_layer_test.c
index 8e1b2e2..5c0a90d 100644
--- a/src/bin/tests/layer/ewl_layer_test.c
+++ b/src/bin/tests/layer/ewl_layer_test.c
@@ -53,32 +53,32 @@ create_test(Ewl_Container *box)
* And now create the first row of buttons
*/
for (i = 0; i < 20; i++) {
- w = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(w), "Hide");
- ewl_container_child_append(EWL_CONTAINER(c), w);
- ewl_widget_layer_priority_set(w, i - 10);
- ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
- ewl_callback_append(w, EWL_CALLBACK_CLICKED,
- spectrum_hide, spec);
- ewl_widget_show(w);
-
- button_row1[i] = w;
+ w = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(w), "Hide");
+ ewl_container_child_append(EWL_CONTAINER(c), w);
+ ewl_widget_layer_priority_set(w, i - 10);
+ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
+ ewl_callback_append(w, EWL_CALLBACK_CLICKED,
+ spectrum_hide, spec);
+ ewl_widget_show(w);
+
+ button_row1[i] = w;
}
/*
* Create the second row
*/
for (i = 0; i < 20; i++) {
- w = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(w), "Show");
- ewl_container_child_append(EWL_CONTAINER(c), w);
- ewl_widget_layer_priority_set(w, 10 - i);
- ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
- ewl_callback_append(w, EWL_CALLBACK_CLICKED,
- spectrum_show, spec);
- ewl_widget_show(w);
-
- button_row2[i] = w;
+ w = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(w), "Show");
+ ewl_container_child_append(EWL_CONTAINER(c), w);
+ ewl_widget_layer_priority_set(w, 10 - i);
+ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
+ ewl_callback_append(w, EWL_CALLBACK_CLICKED,
+ spectrum_show, spec);
+ ewl_widget_show(w);
+
+ button_row2[i] = w;
}
/*
@@ -90,7 +90,7 @@ create_test(Ewl_Container *box)
ewl_widget_layer_priority_set(w, 3);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
ewl_callback_append(w, EWL_CALLBACK_CLICKED,
- layer_change, NULL);
+ layer_change, NULL);
ewl_widget_show(w);
dbutton[0] = w;
@@ -113,7 +113,7 @@ create_test(Ewl_Container *box)
static void
spectrum_show(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Widget *spec;
@@ -124,7 +124,7 @@ spectrum_show(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
static void
spectrum_hide(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Widget *spec;
@@ -135,17 +135,17 @@ spectrum_hide(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
static void
layer_change(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
if (ewl_widget_layer_priority_get(w) == 3)
- ewl_widget_layer_priority_set(w, 1);
+ ewl_widget_layer_priority_set(w, 1);
else
- ewl_widget_layer_priority_set(w, 3);
+ ewl_widget_layer_priority_set(w, 3);
}
static void
configure_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
int x, y;
int i;
@@ -156,14 +156,14 @@ configure_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
* place the first row of buttons
*/
for (i = 0; i < 20; i++)
- ewl_object_position_request(EWL_OBJECT(button_row1[i]),
- i * 5 + x, i * 5 + y);
+ ewl_object_position_request(EWL_OBJECT(button_row1[i]),
+ i * 5 + x, i * 5 + y);
/*
* place the second row
*/
for (i = 0; i < 20; i++)
- ewl_object_position_request(EWL_OBJECT(button_row2[i]),
- i * 5 + 40 + x, i * 5 + y);
+ ewl_object_position_request(EWL_OBJECT(button_row2[i]),
+ i * 5 + 40 + x, i * 5 + y);
ewl_object_position_request(EWL_OBJECT(dbutton[0]), 180 + x, 0 + y);
ewl_object_position_request(EWL_OBJECT(dbutton[1]), 220 + x, 20 + y);
diff --git a/src/bin/tests/list/ewl_list_test.c b/src/bin/tests/list/ewl_list_test.c
index aeda98b..5987888 100644
--- a/src/bin/tests/list/ewl_list_test.c
+++ b/src/bin/tests/list/ewl_list_test.c
@@ -31,9 +31,9 @@ static void list_cb_value_changed(Ewl_Widget *w, void *ev, void *data);
static void list_cb_multi_value_changed(Ewl_Widget *w, void *ev, void *data);
static Ewl_Widget *list_test_cb_widget_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
static void *list_test_data_fetch(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
static unsigned int list_test_data_count_get(void *data);
static void list_cb_select_none(Ewl_Widget *w, void *ev, void *data);
@@ -42,7 +42,7 @@ test_info(Ewl_Test *test)
{
test->name = "List";
test->tip = "Defines a widget for laying out other\n"
- "widgets in a list like manner.";
+ "widgets in a list like manner.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -80,7 +80,7 @@ create_test(Ewl_Container *box)
ewl_mvc_view_set(EWL_MVC(list), view);
ewl_mvc_data_set(EWL_MVC(list), str_data);
ewl_callback_append(list, EWL_CALLBACK_VALUE_CHANGED,
- list_cb_value_changed, NULL);
+ list_cb_value_changed, NULL);
ewl_widget_show(list);
/* create a list using an ecore_list of strings of labels */
@@ -98,7 +98,7 @@ create_test(Ewl_Container *box)
ewl_mvc_data_set(EWL_MVC(list), str_data);
ewl_mvc_selection_mode_set(EWL_MVC(list), EWL_SELECTION_MODE_MULTI);
ewl_callback_append(list, EWL_CALLBACK_VALUE_CHANGED,
- list_cb_multi_value_changed, NULL);
+ list_cb_multi_value_changed, NULL);
ewl_widget_show(list);
/* Create a list from a custom array with a custom assign on the
@@ -125,7 +125,7 @@ create_test(Ewl_Container *box)
ewl_mvc_data_set(EWL_MVC(list), data);
ewl_mvc_selection_mode_set(EWL_MVC(list), EWL_SELECTION_MODE_NONE);
ewl_callback_append(list, EWL_CALLBACK_VALUE_CHANGED,
- list_cb_select_none, NULL);
+ list_cb_select_none, NULL);
ewl_widget_show(list);
@@ -159,7 +159,7 @@ list_test_data_setup(void)
static Ewl_Widget *
list_test_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Widget *w;
List_Test_Row_Data *d;
@@ -177,7 +177,7 @@ list_test_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
static void *
list_test_data_fetch(void *data, unsigned int row,
- unsigned int column __UNUSED__)
+ unsigned int column __UNUSED__)
{
List_Test_Data *d;
@@ -187,8 +187,8 @@ list_test_data_fetch(void *data, unsigned int row,
* normal app */
if (row >= d->count)
{
- printf("Asking for too many rows\n");
- return NULL;
+ printf("Asking for too many rows\n");
+ return NULL;
}
return d->rows[row];
@@ -206,7 +206,7 @@ list_test_data_count_get(void *data)
static void
list_cb_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_List *list;
Ecore_List *el;
@@ -218,12 +218,12 @@ list_cb_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
ecore_list_index_goto(el, idx->row);
printf("Selected (%d) (%s)\n", idx->row,
- (char *)ecore_list_current(el));
+ (char *)ecore_list_current(el));
}
static void
list_cb_multi_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ecore_List *selected, *el;
Ewl_Selection *sel;
@@ -236,34 +236,34 @@ list_cb_multi_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
ecore_list_first_goto(selected);
while ((sel = ecore_list_next(selected)))
{
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- Ewl_Selection_Idx *idx;
-
- idx = EWL_SELECTION_IDX(sel);
- ecore_list_index_goto(el, idx->row);
- printf(" %d (%s)\n", idx->row,
- (char *)ecore_list_current(el));
- }
- else
- {
- Ewl_Selection_Range *idx;
- unsigned int i;
-
- idx = EWL_SELECTION_RANGE(sel);
- for (i = idx->start.row; i <= idx->end.row; i++)
- {
- ecore_list_index_goto(el, i);
- printf(" %d (%s)\n", i,
- (char *)ecore_list_current(el));
- }
- }
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ Ewl_Selection_Idx *idx;
+
+ idx = EWL_SELECTION_IDX(sel);
+ ecore_list_index_goto(el, idx->row);
+ printf(" %d (%s)\n", idx->row,
+ (char *)ecore_list_current(el));
+ }
+ else
+ {
+ Ewl_Selection_Range *idx;
+ unsigned int i;
+
+ idx = EWL_SELECTION_RANGE(sel);
+ for (i = idx->start.row; i <= idx->end.row; i++)
+ {
+ ecore_list_index_goto(el, i);
+ printf(" %d (%s)\n", i,
+ (char *)ecore_list_current(el));
+ }
+ }
}
}
static void
list_cb_select_none(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
printf("ERROR, shouldn't get selection changed callbacks.\n");
}
diff --git a/src/bin/tests/media/ewl_media_test.c b/src/bin/tests/media/ewl_media_test.c
index 8cf5d2d..6520b89 100644
--- a/src/bin/tests/media/ewl_media_test.c
+++ b/src/bin/tests/media/ewl_media_test.c
@@ -57,22 +57,22 @@ create_test(Ewl_Container *box)
if (!ewl_media_is_available())
{
- o = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(o),
- "Ewl_Media is not available. "
- "Please install Emotion "
- "and rebuild Ewl.");
- ewl_container_child_append(box, o);
- ewl_widget_show(o);
-
- return 1;
+ o = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(o),
+ "Ewl_Media is not available. "
+ "Please install Emotion "
+ "and rebuild Ewl.");
+ ewl_container_child_append(box, o);
+ ewl_widget_show(o);
+
+ return 1;
}
o = ewl_radiobutton_new();
ewl_button_label_set(EWL_BUTTON(o), "Gstreamer");
ewl_container_child_append(box, o);
ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- cb_gstreamer_change, NULL);
+ cb_gstreamer_change, NULL);
ewl_widget_show(o);
o2 = ewl_radiobutton_new();
@@ -81,7 +81,7 @@ create_test(Ewl_Container *box)
ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o2), TRUE);
ewl_container_child_append(box, o2);
ewl_callback_append(o2, EWL_CALLBACK_VALUE_CHANGED,
- cb_xine_change, NULL);
+ cb_xine_change, NULL);
ewl_widget_show(o2);
module_type = EWL_MEDIA_MODULE_XINE;
@@ -97,14 +97,14 @@ create_test(Ewl_Container *box)
static void
cb_gstreamer_change(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
module_type = EWL_MEDIA_MODULE_GSTREAMER;
}
static void
cb_xine_change(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
module_type = EWL_MEDIA_MODULE_XINE;
}
@@ -123,21 +123,21 @@ del_cb(Ewl_Widget *w, void *event __UNUSED__, void *data __UNUSED__)
static void
play_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_media_play_set(EWL_MEDIA(video), 1);
}
static void
stop_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_media_play_set(EWL_MEDIA(video), 0);
}
static void
ff_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
double p;
@@ -147,7 +147,7 @@ ff_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
static void
rew_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
double p;
@@ -175,13 +175,13 @@ video_change_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__, void *data)
static void
seeker_move_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
double val;
val = ewl_range_value_get(EWL_RANGE(seeker));
if (ewl_media_seekable_get(EWL_MEDIA(video)))
- ewl_media_position_set(EWL_MEDIA(video), val);
+ ewl_media_position_set(EWL_MEDIA(video), val);
}
static void
@@ -194,26 +194,26 @@ open_file_cb(Ewl_Widget *w, void *event, void *data __UNUSED__)
e = event;
if (e->response == EWL_STOCK_OK)
{
- int len;
- char *file = NULL;
+ int len;
+ char *file = NULL;
- file = ewl_filedialog_selected_file_get(EWL_FILEDIALOG(w));
- ewl_media_media_set(EWL_MEDIA(video), file);
- if (file) free(file);
+ file = ewl_filedialog_selected_file_get(EWL_FILEDIALOG(w));
+ ewl_media_media_set(EWL_MEDIA(video), file);
+ if (file) free(file);
- len = ewl_media_length_get(EWL_MEDIA(video));
- ewl_range_maximum_value_set(EWL_RANGE(seeker), len);
+ len = ewl_media_length_get(EWL_MEDIA(video));
+ ewl_range_maximum_value_set(EWL_RANGE(seeker), len);
}
}
static void
open_cb(Ewl_Widget *w __UNUSED__, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
if (!fd_win)
{
- fd_win = ewl_filedialog_new();
- ewl_callback_append(fd_win, EWL_CALLBACK_VALUE_CHANGED, open_file_cb, NULL);
+ fd_win = ewl_filedialog_new();
+ ewl_callback_append(fd_win, EWL_CALLBACK_VALUE_CHANGED, open_file_cb, NULL);
}
ewl_widget_show(fd_win);
@@ -225,13 +225,13 @@ key_up_cb(Ewl_Widget *w, void *event, void *data)
Ewl_Event_Key *e = event;
if (!strcmp(e->keyname, "p"))
- ewl_media_play_set(EWL_MEDIA(video), 1);
+ ewl_media_play_set(EWL_MEDIA(video), 1);
else if (!strcmp(e->keyname, "s"))
- ewl_media_play_set(EWL_MEDIA(video), 0);
+ ewl_media_play_set(EWL_MEDIA(video), 0);
else if (!strcmp(e->keyname, "q"))
- del_cb(w, event, data);
+ del_cb(w, event, data);
}
static void
@@ -271,7 +271,7 @@ create_media_window(Ewl_Media_Module_Type type)
/* box to contain contols and scrollers */
controls = ewl_vbox_new();
ewl_object_fill_policy_set(EWL_OBJECT(controls),
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
ewl_container_child_append(EWL_CONTAINER(b), controls);
ewl_widget_show(controls);
@@ -281,24 +281,24 @@ create_media_window(Ewl_Media_Module_Type type)
ewl_widget_show(b);
{
- Ewl_Media_Test_Control controls [] = {
- { EWL_STOCK_PLAY, play_cb },
- { EWL_STOCK_STOP, stop_cb },
- { EWL_STOCK_REWIND, rew_cb },
- { EWL_STOCK_FASTFORWARD, ff_cb },
- { EWL_STOCK_OPEN, open_cb },
- { EWL_STOCK_NONE, NULL }
- };
- int i;
-
- for(i = 0; controls[i].name != EWL_STOCK_NONE; i++) {
- o = ewl_button_new();
- ewl_stock_type_set(EWL_STOCK(o), controls[i].name);
- ewl_container_child_append(EWL_CONTAINER(b), o);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- controls[i].func, NULL);
- ewl_widget_show(o);
- }
+ Ewl_Media_Test_Control controls [] = {
+ { EWL_STOCK_PLAY, play_cb },
+ { EWL_STOCK_STOP, stop_cb },
+ { EWL_STOCK_REWIND, rew_cb },
+ { EWL_STOCK_FASTFORWARD, ff_cb },
+ { EWL_STOCK_OPEN, open_cb },
+ { EWL_STOCK_NONE, NULL }
+ };
+ int i;
+
+ for(i = 0; controls[i].name != EWL_STOCK_NONE; i++) {
+ o = ewl_button_new();
+ ewl_stock_type_set(EWL_STOCK(o), controls[i].name);
+ ewl_container_child_append(EWL_CONTAINER(b), o);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED,
+ controls[i].func, NULL);
+ ewl_widget_show(o);
+ }
}
b = ewl_hbox_new();
@@ -309,7 +309,7 @@ create_media_window(Ewl_Media_Module_Type type)
seeker = ewl_hseeker_new();
ewl_container_child_append(EWL_CONTAINER(b), seeker);
ewl_object_fill_policy_set(EWL_OBJECT(seeker),
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
ewl_range_value_set(EWL_RANGE(seeker), 0.0);
ewl_range_maximum_value_set(EWL_RANGE(seeker), 0.0);
ewl_range_step_set(EWL_RANGE(seeker), 1.0);
diff --git a/src/bin/tests/menu/ewl_menu_test.c b/src/bin/tests/menu/ewl_menu_test.c
index b2011ad..e9ff594 100644
--- a/src/bin/tests/menu/ewl_menu_test.c
+++ b/src/bin/tests/menu/ewl_menu_test.c
@@ -14,9 +14,9 @@ test_info(Ewl_Test *test)
{
test->name = "Menu";
test->tip = "Defines the basic menu classes that\n"
- "are extended to an actual menu\n"
- "implementation by inheriting classes\n"
- "such as Ewl_Menu and Ewl_IMenu.";
+ "are extended to an actual menu\n"
+ "implementation by inheriting classes\n"
+ "such as Ewl_Menu and Ewl_IMenu.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -35,7 +35,7 @@ create_test(Ewl_Container *box)
menu1 = ewl_menu_new();
ewl_button_image_set(EWL_BUTTON(menu1),
- PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Draw.png", NULL);
ewl_button_label_set(EWL_BUTTON(menu1), "Test Menu");
ewl_container_child_append(EWL_CONTAINER(box), menu1);
ewl_object_fill_policy_set(EWL_OBJECT(menu1), EWL_FLAG_FILL_SHRINK);
@@ -43,7 +43,7 @@ create_test(Ewl_Container *box)
item = ewl_menu_item_new();
ewl_button_image_set(EWL_BUTTON(item),
- PACKAGE_DATA_DIR "/ewl/images/Open.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Open.png", NULL);
ewl_button_label_set(EWL_BUTTON(item), "Dia");
ewl_container_child_append(EWL_CONTAINER(menu1), item);
ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
@@ -51,7 +51,7 @@ create_test(Ewl_Container *box)
item = ewl_menu_item_new();
ewl_button_image_set(EWL_BUTTON(item),
- PACKAGE_DATA_DIR "/ewl/images/Package.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/Package.png", NULL);
ewl_button_label_set(EWL_BUTTON(item), "Gimp");
ewl_container_child_append(EWL_CONTAINER(menu1), item);
ewl_callback_append(item, EWL_CALLBACK_CLICKED, cb_menu_clicked, NULL);
diff --git a/src/bin/tests/menubar/ewl_menubar_test.c b/src/bin/tests/menubar/ewl_menubar_test.c
index 673e5e5..bbe96ba 100644
--- a/src/bin/tests/menubar/ewl_menubar_test.c
+++ b/src/bin/tests/menubar/ewl_menubar_test.c
@@ -26,100 +26,100 @@ create_test(Ewl_Container *box)
h_menubar = ewl_hmenubar_new();
{
- int i;
- Ewl_Widget *item;
- Ewl_Widget *foo;
- char *m_items[] = {"File",
- "Test",
- "About",
- NULL};
- for(i = 0; m_items[i] != NULL; i++) {
-
- if (i != 0) {
- Ewl_Widget *sep;
-
- sep = ewl_vseparator_new();
- ewl_container_child_append(EWL_CONTAINER(h_menubar), sep);
- ewl_widget_show(sep);
- }
-
- item = ewl_menu_new();
- ewl_button_label_set(EWL_BUTTON(item), m_items[i]);
- ewl_container_child_append(EWL_CONTAINER(h_menubar), item);
- ewl_widget_show(item);
-
- foo = ewl_menu_item_new();
- ewl_button_label_set(EWL_BUTTON(foo), "foo");
- ewl_container_child_append(EWL_CONTAINER(item), foo);
- ewl_widget_show(foo);
-
- foo = ewl_menu_item_new();
- ewl_button_label_set(EWL_BUTTON(foo), "foobar");
- ewl_container_child_append(EWL_CONTAINER(item), foo);
- ewl_widget_show(foo);
-
- }
-
- item = ewl_spacer_new();
- ewl_object_fill_policy_set(EWL_OBJECT(item), EWL_FLAG_FILL_ALL);
- ewl_container_child_append(EWL_CONTAINER(h_menubar), item);
- ewl_widget_show(item);
-
- item = ewl_menu_new();
- ewl_button_label_set(EWL_BUTTON(item), "Help");
- ewl_container_child_append(EWL_CONTAINER(h_menubar), item);
- ewl_widget_show(item);
-
- foo = ewl_menu_item_new();
- ewl_button_label_set(EWL_BUTTON(foo), "foo");
- ewl_container_child_append(EWL_CONTAINER(item), foo);
- ewl_widget_show(foo);
-
- foo = ewl_menu_item_new();
- ewl_button_label_set(EWL_BUTTON(foo), "foobar");
- ewl_container_child_append(EWL_CONTAINER(item), foo);
- ewl_widget_show(foo);
+ int i;
+ Ewl_Widget *item;
+ Ewl_Widget *foo;
+ char *m_items[] = {"File",
+ "Test",
+ "About",
+ NULL};
+ for(i = 0; m_items[i] != NULL; i++) {
+
+ if (i != 0) {
+ Ewl_Widget *sep;
+
+ sep = ewl_vseparator_new();
+ ewl_container_child_append(EWL_CONTAINER(h_menubar), sep);
+ ewl_widget_show(sep);
+ }
+
+ item = ewl_menu_new();
+ ewl_button_label_set(EWL_BUTTON(item), m_items[i]);
+ ewl_container_child_append(EWL_CONTAINER(h_menubar), item);
+ ewl_widget_show(item);
+
+ foo = ewl_menu_item_new();
+ ewl_button_label_set(EWL_BUTTON(foo), "foo");
+ ewl_container_child_append(EWL_CONTAINER(item), foo);
+ ewl_widget_show(foo);
+
+ foo = ewl_menu_item_new();
+ ewl_button_label_set(EWL_BUTTON(foo), "foobar");
+ ewl_container_child_append(EWL_CONTAINER(item), foo);
+ ewl_widget_show(foo);
+
+ }
+
+ item = ewl_spacer_new();
+ ewl_object_fill_policy_set(EWL_OBJECT(item), EWL_FLAG_FILL_ALL);
+ ewl_container_child_append(EWL_CONTAINER(h_menubar), item);
+ ewl_widget_show(item);
+
+ item = ewl_menu_new();
+ ewl_button_label_set(EWL_BUTTON(item), "Help");
+ ewl_container_child_append(EWL_CONTAINER(h_menubar), item);
+ ewl_widget_show(item);
+
+ foo = ewl_menu_item_new();
+ ewl_button_label_set(EWL_BUTTON(foo), "foo");
+ ewl_container_child_append(EWL_CONTAINER(item), foo);
+ ewl_widget_show(foo);
+
+ foo = ewl_menu_item_new();
+ ewl_button_label_set(EWL_BUTTON(foo), "foobar");
+ ewl_container_child_append(EWL_CONTAINER(item), foo);
+ ewl_widget_show(foo);
}
ewl_container_child_append(EWL_CONTAINER(box), h_menubar);
ewl_widget_show(h_menubar);
v_menubar = ewl_vmenubar_new();
{
- int i;
- Ewl_Widget *item;
- char *m_items[] = {"About",
- "Left",
- "Right",
- "foo",
- NULL};
- for(i = 0; m_items[i] != NULL; i++) {
- Ewl_Widget *foo;
-
- if (i != 0 && (i & 1))
- {
- Ewl_Widget *sep;
-
- sep = ewl_hseparator_new();
- ewl_container_child_append(EWL_CONTAINER(v_menubar), sep);
- ewl_widget_show(sep);
- }
-
- item = ewl_menu_new();
- ewl_button_label_set(EWL_BUTTON(item), m_items[i]);
- ewl_container_child_append(EWL_CONTAINER(v_menubar), item);
- ewl_widget_show(item);
-
- foo = ewl_menu_item_new();
- ewl_button_label_set(EWL_BUTTON(foo), "foo");
- ewl_container_child_append(EWL_CONTAINER(item), foo);
- ewl_widget_show(foo);
-
- foo = ewl_menu_item_new();
- ewl_button_label_set(EWL_BUTTON(foo), "foobar");
- ewl_container_child_append(EWL_CONTAINER(item), foo);
- ewl_widget_show(foo);
-
- }
+ int i;
+ Ewl_Widget *item;
+ char *m_items[] = {"About",
+ "Left",
+ "Right",
+ "foo",
+ NULL};
+ for(i = 0; m_items[i] != NULL; i++) {
+ Ewl_Widget *foo;
+
+ if (i != 0 && (i & 1))
+ {
+ Ewl_Widget *sep;
+
+ sep = ewl_hseparator_new();
+ ewl_container_child_append(EWL_CONTAINER(v_menubar), sep);
+ ewl_widget_show(sep);
+ }
+
+ item = ewl_menu_new();
+ ewl_button_label_set(EWL_BUTTON(item), m_items[i]);
+ ewl_container_child_append(EWL_CONTAINER(v_menubar), item);
+ ewl_widget_show(item);
+
+ foo = ewl_menu_item_new();
+ ewl_button_label_set(EWL_BUTTON(foo), "foo");
+ ewl_container_child_append(EWL_CONTAINER(item), foo);
+ ewl_widget_show(foo);
+
+ foo = ewl_menu_item_new();
+ ewl_button_label_set(EWL_BUTTON(foo), "foobar");
+ ewl_container_child_append(EWL_CONTAINER(item), foo);
+ ewl_widget_show(foo);
+
+ }
}
ewl_container_child_append(EWL_CONTAINER(box), v_menubar);
ewl_object_alignment_set(EWL_OBJECT(v_menubar), EWL_FLAG_ALIGN_LEFT);
diff --git a/src/bin/tests/modal/ewl_modal_test.c b/src/bin/tests/modal/ewl_modal_test.c
index 35e0887..72b03c4 100644
--- a/src/bin/tests/modal/ewl_modal_test.c
+++ b/src/bin/tests/modal/ewl_modal_test.c
@@ -51,7 +51,7 @@ ewl_widget_cb_click(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
win = ewl_window_new();
ewl_window_title_set(EWL_WINDOW(win), "MODAL");
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
- ewl_widget_cb_close_click, NULL);
+ ewl_widget_cb_close_click, NULL);
ewl_widget_show(win);
vbox = ewl_vbox_new();
@@ -61,21 +61,21 @@ ewl_widget_cb_click(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "Go modal");
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_widget_cb_go_modal, emb);
+ ewl_widget_cb_go_modal, emb);
ewl_container_child_append(EWL_CONTAINER(vbox), o);
ewl_widget_show(o);
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "Close");
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_widget_cb_close_click, NULL);
+ ewl_widget_cb_close_click, NULL);
ewl_container_child_append(EWL_CONTAINER(vbox), o);
ewl_widget_show(o);
}
static void
ewl_widget_cb_close_click(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Embed *emb;
diff --git a/src/bin/tests/mvc/ewl_mvc_test.c b/src/bin/tests/mvc/ewl_mvc_test.c
index 4a84695..1dfa9a5 100644
--- a/src/bin/tests/mvc/ewl_mvc_test.c
+++ b/src/bin/tests/mvc/ewl_mvc_test.c
@@ -48,72 +48,72 @@ static int insert_range_overlap_new_covers_old(char *buf, int len);
static int insert_range_overlap_old_covers_new(char *buf, int len);
static int ewl_mvc_is_index(char *buf, int len, Ewl_Selection *sel,
- int row, int column);
+ int row, int column);
static int ewl_mvc_is_range(char *buf, int len, Ewl_Selection *sel,
- int srow, int scolumn,
- int erow, int ecolumn);
+ int srow, int scolumn,
+ int erow, int ecolumn);
static Ewl_Unit_Test mvc_unit_tests[] = {
- {"Set selected", selected_set, NULL, -1, 0},
- {"Get selected", selected_get, NULL, -1, 0},
- {"Range (single select) add", selected_range_single_add, NULL, -1, 0},
- {"Range (multi select) add", selected_range_multi_add, NULL, -1, 0},
- {"Count get", selected_count_get, NULL, -1, 0},
- {"Is selected (index)", selected_is_index, NULL, -1, 0},
- {"Is not selected (index)", selected_is_not_index, NULL, -1, 0},
- {"Is selected (range)", selected_is_range, NULL, -1, 0},
- {"Is not selected (range)", selected_is_not_range, NULL, -1, 0},
- {"Selected clear", selected_clear, NULL, -1, 0},
-
- {"Remove index", selected_rm_idx, NULL, -1, 0},
- {"Remove non-selected index", selected_rm_unselected_idx, NULL, -1, 0},
- {"Remove bottom from 2x1", selected_rm_2x1_bottom, NULL, -1, 0},
- {"Remove top from 2x1", selected_rm_2x1_top, NULL, -1, 0},
- {"Remove left from 1x2", selected_rm_1x2_left, NULL, -1, 0},
- {"Remove right from 1x2", selected_rm_1x2_right, NULL, -1, 0},
- {"Remove from range, top left point",
- selected_rm_from_range_top_left_point, NULL, -1, 0},
- {"Remove from range, bottom right point",
- selected_rm_from_range_bottom_right_point, NULL, -1, 0},
- {"Remove from range, middle point",
- selected_rm_from_range_middle_point, NULL, -1, 0},
- {"Remove from range, left edge",
- selected_rm_from_range_left_edge_point, NULL, -1, 0},
- {"Remove from range, right edge",
- selected_rm_from_range_right_edge_point, NULL, -1, 0},
- {"Remove from range, top edge",
- selected_rm_from_range_top_edge_point, NULL, -1, 0},
- {"Remove from range, bottom edge",
- selected_rm_from_range_bottom_edge_point, NULL, -1, 0},
-
- {"Insert range no intersection",
- insert_range_no_intersection, NULL, -1, 0},
- {"Insert range top intersection",
- insert_range_top_intersection, NULL, -1, 0},
- {"Insert range bottom intersection",
- insert_range_bottom_intersection, NULL, -1, 0},
- {"Insert range left intersection",
- insert_range_left_intersection, NULL, -1, 0},
- {"Insert range right intersection",
- insert_range_right_intersection, NULL, -1, 0},
- {"Insert range intersect, top left corner",
- insert_range_top_left_intersection, NULL, -1, 0},
- {"Insert range intersect, top right corner",
- insert_range_top_right_intersection, NULL, -1, 0},
- {"Insert range intersect, bottom left corner",
- insert_range_bottom_left_intersection, NULL, -1, 0},
- {"Insert range intersect, bottom right corner",
- insert_range_bottom_right_intersection, NULL, -1, 0},
- {"Insert range intersect, overlap horizontal",
- insert_range_overlap_horizontal, NULL, -1, 0},
- {"Insert range intersect, overlap vertical",
- insert_range_overlap_vertical, NULL, -1, 0},
- {"Insert range intersect, new covers old",
- insert_range_overlap_new_covers_old, NULL, -1, 0},
- {"Insert range intersect, old covers new",
- insert_range_overlap_old_covers_new, NULL, -1, 0},
-
- {NULL, NULL, NULL, -1, 0}
+ {"Set selected", selected_set, NULL, -1, 0},
+ {"Get selected", selected_get, NULL, -1, 0},
+ {"Range (single select) add", selected_range_single_add, NULL, -1, 0},
+ {"Range (multi select) add", selected_range_multi_add, NULL, -1, 0},
+ {"Count get", selected_count_get, NULL, -1, 0},
+ {"Is selected (index)", selected_is_index, NULL, -1, 0},
+ {"Is not selected (index)", selected_is_not_index, NULL, -1, 0},
+ {"Is selected (range)", selected_is_range, NULL, -1, 0},
+ {"Is not selected (range)", selected_is_not_range, NULL, -1, 0},
+ {"Selected clear", selected_clear, NULL, -1, 0},
+
+ {"Remove index", selected_rm_idx, NULL, -1, 0},
+ {"Remove non-selected index", selected_rm_unselected_idx, NULL, -1, 0},
+ {"Remove bottom from 2x1", selected_rm_2x1_bottom, NULL, -1, 0},
+ {"Remove top from 2x1", selected_rm_2x1_top, NULL, -1, 0},
+ {"Remove left from 1x2", selected_rm_1x2_left, NULL, -1, 0},
+ {"Remove right from 1x2", selected_rm_1x2_right, NULL, -1, 0},
+ {"Remove from range, top left point",
+ selected_rm_from_range_top_left_point, NULL, -1, 0},
+ {"Remove from range, bottom right point",
+ selected_rm_from_range_bottom_right_point, NULL, -1, 0},
+ {"Remove from range, middle point",
+ selected_rm_from_range_middle_point, NULL, -1, 0},
+ {"Remove from range, left edge",
+ selected_rm_from_range_left_edge_point, NULL, -1, 0},
+ {"Remove from range, right edge",
+ selected_rm_from_range_right_edge_point, NULL, -1, 0},
+ {"Remove from range, top edge",
+ selected_rm_from_range_top_edge_point, NULL, -1, 0},
+ {"Remove from range, bottom edge",
+ selected_rm_from_range_bottom_edge_point, NULL, -1, 0},
+
+ {"Insert range no intersection",
+ insert_range_no_intersection, NULL, -1, 0},
+ {"Insert range top intersection",
+ insert_range_top_intersection, NULL, -1, 0},
+ {"Insert range bottom intersection",
+ insert_range_bottom_intersection, NULL, -1, 0},
+ {"Insert range left intersection",
+ insert_range_left_intersection, NULL, -1, 0},
+ {"Insert range right intersection",
+ insert_range_right_intersection, NULL, -1, 0},
+ {"Insert range intersect, top left corner",
+ insert_range_top_left_intersection, NULL, -1, 0},
+ {"Insert range intersect, top right corner",
+ insert_range_top_right_intersection, NULL, -1, 0},
+ {"Insert range intersect, bottom left corner",
+ insert_range_bottom_left_intersection, NULL, -1, 0},
+ {"Insert range intersect, bottom right corner",
+ insert_range_bottom_right_intersection, NULL, -1, 0},
+ {"Insert range intersect, overlap horizontal",
+ insert_range_overlap_horizontal, NULL, -1, 0},
+ {"Insert range intersect, overlap vertical",
+ insert_range_overlap_vertical, NULL, -1, 0},
+ {"Insert range intersect, new covers old",
+ insert_range_overlap_new_covers_old, NULL, -1, 0},
+ {"Insert range intersect, old covers new",
+ insert_range_overlap_old_covers_new, NULL, -1, 0},
+
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -141,15 +141,15 @@ selected_set(char *buf, int len)
if (idx->sel.type != EWL_SELECTION_TYPE_INDEX)
{
- LOG_FAILURE(buf, len, "Incorrect selection type");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect selection type");
+ return FALSE;
}
if ((idx->row != 1) || (idx->column != 2))
{
- LOG_FAILURE(buf, len, "Incorrect row/column setting: "
- "(%d %d) vs (1, 2)", idx->row, idx->column);
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect row/column setting: "
+ "(%d %d) vs (1, 2)", idx->row, idx->column);
+ return FALSE;
}
return TRUE;
@@ -173,15 +173,15 @@ selected_get(char *buf, int len)
if (idx->sel.type != EWL_SELECTION_TYPE_INDEX)
{
- LOG_FAILURE(buf, len, "Incorrect selection type");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect selection type");
+ return FALSE;
}
if ((idx->row != 1) || (idx->column != 2))
{
- LOG_FAILURE(buf, len, "Incorrect row/column setting "
- "(%d %d) instead of (1, 2)", idx->row, idx->column);
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect row/column setting "
+ "(%d %d) instead of (1, 2)", idx->row, idx->column);
+ return FALSE;
}
return TRUE;
@@ -202,14 +202,14 @@ selected_range_single_add(char *buf, int len)
if (idx->sel.type != EWL_SELECTION_TYPE_INDEX)
{
- LOG_FAILURE(buf, len, "Incorrect selection type");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect selection type");
+ return FALSE;
}
if ((idx->row != 1) || (idx->column != 2))
{
- LOG_FAILURE(buf, len, "Incorrect start row/column setting");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect start row/column setting");
+ return FALSE;
}
return TRUE;
@@ -231,26 +231,26 @@ selected_range_multi_add(char *buf, int len)
if (!idx)
{
- LOG_FAILURE(buf, len, "Returned idx is NULL");
- return FALSE;
+ LOG_FAILURE(buf, len, "Returned idx is NULL");
+ return FALSE;
}
if (idx->sel.type != EWL_SELECTION_TYPE_RANGE)
{
- LOG_FAILURE(buf, len, "Incorrect selection type");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect selection type");
+ return FALSE;
}
if ((idx->start.row != 1) || (idx->start.column != 2))
{
- LOG_FAILURE(buf, len, "Incorrect start row/column setting");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect start row/column setting");
+ return FALSE;
}
if ((idx->end.row != 6) || (idx->end.column != 8))
{
- LOG_FAILURE(buf, len, "Incorrect end row/column setting");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect end row/column setting");
+ return FALSE;
}
return TRUE;
@@ -276,9 +276,9 @@ selected_count_get(char *buf, int len)
count = ewl_mvc_selected_count_get(m);
if (count != expected)
{
- LOG_FAILURE(buf, len, "Incorrect count (%d instead of %d)",
- count, expected);
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect count (%d instead of %d)",
+ count, expected);
+ return FALSE;
}
return TRUE;
@@ -297,8 +297,8 @@ selected_is_index(char *buf, int len)
if (!ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 6, 8))
{
- LOG_FAILURE(buf, len, "Not selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Not selected");
+ return FALSE;
}
return TRUE;
@@ -317,8 +317,8 @@ selected_is_not_index(char *buf, int len)
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 7, 7))
{
- LOG_FAILURE(buf, len, "Item selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Item selected");
+ return FALSE;
}
return TRUE;
@@ -338,8 +338,8 @@ selected_is_range(char *buf, int len)
if (!ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 4, 5))
{
- LOG_FAILURE(buf, len, "Not selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Not selected");
+ return FALSE;
}
return TRUE;
@@ -359,8 +359,8 @@ selected_is_not_range(char *buf, int len)
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 1, 1))
{
- LOG_FAILURE(buf, len, "Item selected selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Item selected selected");
+ return FALSE;
}
return TRUE;
@@ -385,8 +385,8 @@ selected_clear(char *buf, int len)
if (ewl_mvc_selected_count_get(m) != 0)
{
- LOG_FAILURE(buf, len, "Selected list not empty.");
- return FALSE;
+ LOG_FAILURE(buf, len, "Selected list not empty.");
+ return FALSE;
}
return TRUE;
@@ -411,8 +411,8 @@ selected_rm_idx(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 9, 1);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 9, 1))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
return TRUE;
@@ -437,8 +437,8 @@ selected_rm_unselected_idx(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 10, 2);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 10, 2))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
return TRUE;
@@ -473,21 +473,21 @@ selected_rm_2x1_bottom(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 2, 1);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 2, 1))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
count = ewl_mvc_selected_count_get(m);
if (count != 1)
{
- LOG_FAILURE(buf, len, "Selected items is %d instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "Selected items is %d instead of 1", count);
+ return FALSE;
}
sel = ecore_list_first_goto(m->selected);
if (!ewl_mvc_is_index(buf, len, sel, 1, 1))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -516,21 +516,21 @@ selected_rm_2x1_top(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 1, 1);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 1, 1))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
count = ewl_mvc_selected_count_get(m);
if (count != 1)
{
- LOG_FAILURE(buf, len, "Selected items is %d instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "Selected items is %d instead of 1", count);
+ return FALSE;
}
sel = ecore_list_first_goto(m->selected);
if (!ewl_mvc_is_index(buf, len, sel, 2, 1))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -556,20 +556,20 @@ selected_rm_1x2_left(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 1, 1);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 1, 1))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 1)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items");
+ return FALSE;
}
sel = ecore_list_first_goto(m->selected);
if (!ewl_mvc_is_index(buf, len, sel, 1, 2))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -595,20 +595,20 @@ selected_rm_1x2_right(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 1, 2);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 1, 2))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 1)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items");
+ return FALSE;
}
sel = ecore_list_first_goto(m->selected);
if (!ewl_mvc_is_index(buf, len, sel, 1, 1))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -635,24 +635,24 @@ selected_rm_from_range_top_left_point(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 1, 2);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 1, 2))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 41)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
- ewl_mvc_selected_count_get(m));
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
+ ewl_mvc_selected_count_get(m));
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 2, 2, 6, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 1, 3, 1, 8))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -679,24 +679,24 @@ selected_rm_from_range_bottom_right_point(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 6, 8);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 6, 8))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 41)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
- ewl_mvc_selected_count_get(m));
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
+ ewl_mvc_selected_count_get(m));
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 5, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 6, 2, 6, 7))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -724,32 +724,32 @@ selected_rm_from_range_middle_point(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 4, 5);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 4, 5))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 41)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
- ewl_mvc_selected_count_get(m));
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
+ ewl_mvc_selected_count_get(m));
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 3, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 4, 2, 6, 4))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 5, 5, 6, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 3);
if (!ewl_mvc_is_range(buf, len, sel, 4, 6, 4, 8))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -777,28 +777,28 @@ selected_rm_from_range_left_edge_point(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 4, 2);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 4, 2))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 41)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
- ewl_mvc_selected_count_get(m));
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
+ ewl_mvc_selected_count_get(m));
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 3, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 5, 2, 6, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 4, 3, 4, 8))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -826,28 +826,28 @@ selected_rm_from_range_right_edge_point(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 3, 8);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 3, 8))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 41)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
- ewl_mvc_selected_count_get(m));
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
+ ewl_mvc_selected_count_get(m));
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 2, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 3, 2, 6, 7))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 4, 8, 6, 8))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -875,28 +875,28 @@ selected_rm_from_range_top_edge_point(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 1, 5);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 1, 5))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 41)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
- ewl_mvc_selected_count_get(m));
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
+ ewl_mvc_selected_count_get(m));
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 6, 4))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 2, 5, 6, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 1, 6, 1, 8))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -924,31 +924,31 @@ selected_rm_from_range_bottom_edge_point(char *buf, int len)
ewl_mvc_selected_rm(m, ewl_mvc_data_get(m), 6, 3);
if (ewl_mvc_selected_is(m, ewl_mvc_data_get(m), 6, 3))
{
- LOG_FAILURE(buf, len, "Index still selected");
- return FALSE;
+ LOG_FAILURE(buf, len, "Index still selected");
+ return FALSE;
}
if (ewl_mvc_selected_count_get(m) != 41)
{
- LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
- ewl_mvc_selected_count_get(m));
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect number of selected items: %d",
+ ewl_mvc_selected_count_get(m));
+ return FALSE;
}
/* should have 3 ranges: [(1,2)(5,8)]
- [(2,6)]
- [(6,4)(6,8)] */
+ [(2,6)]
+ [(6,4)(6,8)] */
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 5, 8))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_index(buf, len, sel, 6, 2))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 6, 4, 6, 8))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -980,11 +980,11 @@ insert_range_no_intersection(char *buf, int len)
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 3, 3))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 4, 4, 6, 6))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1014,13 +1014,13 @@ insert_range_top_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 1)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 7, 3))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1050,13 +1050,13 @@ insert_range_bottom_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 1)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 7, 3))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1084,13 +1084,13 @@ insert_range_left_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 1)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 3, 5))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1118,13 +1118,13 @@ insert_range_right_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 1)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 3, 5))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1155,21 +1155,21 @@ insert_range_top_left_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 3)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 6, 3, 7, 7))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 3, 6, 5, 7))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 5, 5))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1200,21 +1200,21 @@ insert_range_top_right_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 3)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 3, 1, 5, 1))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 5, 2, 5, 3))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 4, 5))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1245,21 +1245,21 @@ insert_range_bottom_left_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 3)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 2, 2, 5))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 3, 4, 4, 5))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 3, 1, 5, 3))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1290,21 +1290,21 @@ insert_range_bottom_right_intersection(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 3)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 2, 5))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 3, 1, 5, 2))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 3, 3, 7, 7))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1337,21 +1337,21 @@ insert_range_overlap_horizontal(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 3)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 3, 1, 5, 2))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 3, 6, 5, 9))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 1, 3, 7, 5))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1384,21 +1384,21 @@ insert_range_overlap_vertical(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 3)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 3", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 3, 2, 5))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 1);
if (!ewl_mvc_is_range(buf, len, sel, 6, 3, 7, 5))
- return FALSE;
+ return FALSE;
sel = ecore_list_index_goto(m->selected, 2);
if (!ewl_mvc_is_range(buf, len, sel, 3, 1, 5, 9))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1429,13 +1429,13 @@ insert_range_overlap_new_covers_old(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 1)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 9, 9))
- return FALSE;
+ return FALSE;
return TRUE;
}
@@ -1466,37 +1466,37 @@ insert_range_overlap_old_covers_new(char *buf, int len)
count = ecore_list_count(m->selected);
if (count != 1)
{
- LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
- return FALSE;
+ LOG_FAILURE(buf, len, "%d items in list instead of 1", count);
+ return FALSE;
}
sel = ecore_list_index_goto(m->selected, 0);
if (!ewl_mvc_is_range(buf, len, sel, 1, 1, 9, 9))
- return FALSE;
+ return FALSE;
return TRUE;
}
static int
ewl_mvc_is_index(char *buf, int len, Ewl_Selection *sel,
- int row, int column)
+ int row, int column)
{
Ewl_Selection_Idx *idx;
if (sel->type != EWL_SELECTION_TYPE_INDEX)
{
- LOG_FAILURE(buf, len, "Incorrect selection type");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect selection type");
+ return FALSE;
}
idx = EWL_SELECTION_IDX(sel);
if (((int)idx->row != row) || ((int)idx->column != column))
{
- LOG_FAILURE(buf, len, "Incorrect indices in index "
- "([%d %d] vs [%d %d])",
- idx->row, idx->column,
- row, column);
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect indices in index "
+ "([%d %d] vs [%d %d])",
+ idx->row, idx->column,
+ row, column);
+ return FALSE;
}
return TRUE;
@@ -1504,34 +1504,34 @@ ewl_mvc_is_index(char *buf, int len, Ewl_Selection *sel,
static int
ewl_mvc_is_range(char *buf, int len, Ewl_Selection *sel,
- int srow, int scolumn,
- int erow, int ecolumn)
+ int srow, int scolumn,
+ int erow, int ecolumn)
{
Ewl_Selection_Range *rng;
if (sel->type != EWL_SELECTION_TYPE_RANGE)
{
- LOG_FAILURE(buf, len, "Incorrect selection type");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect selection type");
+ return FALSE;
}
rng = EWL_SELECTION_RANGE(sel);
if (((int)rng->start.row != srow) || ((int)rng->start.column != scolumn))
{
- LOG_FAILURE(buf, len, "Start row/column incorrect "
- "([%d %d] vs [%d %d])",
- rng->start.row, rng->start.column,
- srow, scolumn);
- return FALSE;
+ LOG_FAILURE(buf, len, "Start row/column incorrect "
+ "([%d %d] vs [%d %d])",
+ rng->start.row, rng->start.column,
+ srow, scolumn);
+ return FALSE;
}
if (((int)rng->end.row != erow) || ((int)rng->end.column != ecolumn))
{
- LOG_FAILURE(buf, len, "End row/column incorrect "
- "([%d %d] vs [%d %d])",
- rng->end.row, rng->end.column,
- erow, ecolumn);
- return FALSE;
+ LOG_FAILURE(buf, len, "End row/column incorrect "
+ "([%d %d] vs [%d %d])",
+ rng->end.row, rng->end.column,
+ erow, ecolumn);
+ return FALSE;
}
return TRUE;
diff --git a/src/bin/tests/notebook/ewl_notebook_test.c b/src/bin/tests/notebook/ewl_notebook_test.c
index 0551dc6..79f623b 100644
--- a/src/bin/tests/notebook/ewl_notebook_test.c
+++ b/src/bin/tests/notebook/ewl_notebook_test.c
@@ -26,8 +26,8 @@ test_info(Ewl_Test *test)
{
test->name = "Notebook";
test->tip = "Provides a container whose children\n"
- "are pages that can be switched\n"
- "between using tab labels along one\nedge";
+ "are pages that can be switched\n"
+ "between using tab labels along one\nedge";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -47,15 +47,15 @@ create_test(Ewl_Container *box)
/* append 3 pages */
for (count = 1; count < 4; count++)
{
- o2 = ewl_label_new();
- snprintf(buf, sizeof(buf), "Page %d", count);
- ewl_label_text_set(EWL_LABEL(o2), buf);
- ewl_widget_show(o2);
-
- o = create_page(buf);
- ewl_container_child_append(EWL_CONTAINER(n), o);
- ewl_notebook_page_tab_widget_set(EWL_NOTEBOOK(n), o, o2);
- ewl_widget_show(o);
+ o2 = ewl_label_new();
+ snprintf(buf, sizeof(buf), "Page %d", count);
+ ewl_label_text_set(EWL_LABEL(o2), buf);
+ ewl_widget_show(o2);
+
+ o = create_page(buf);
+ ewl_container_child_append(EWL_CONTAINER(n), o);
+ ewl_notebook_page_tab_widget_set(EWL_NOTEBOOK(n), o, o2);
+ ewl_widget_show(o);
}
/* insert a page after the first */
@@ -81,29 +81,29 @@ create_test(Ewl_Container *box)
static void
notebook_cb_toggle_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *n;
n = ewl_widget_name_find("notebook");
ewl_notebook_tabbar_visible_set(EWL_NOTEBOOK(n),
- !ewl_notebook_tabbar_visible_get(EWL_NOTEBOOK(n)));
+ !ewl_notebook_tabbar_visible_get(EWL_NOTEBOOK(n)));
}
static void
notebook_cb_homogeneous_toggle_clicked(Ewl_Widget *w __UNUSED__,
- void *ev __UNUSED__, void *data __UNUSED__)
+ void *ev __UNUSED__, void *data __UNUSED__)
{
Ewl_Widget *n;
n = ewl_widget_name_find("notebook");
ewl_notebook_tabbar_homogeneous_set(EWL_NOTEBOOK(n),
- !ewl_notebook_tabbar_homogeneous_get(EWL_NOTEBOOK(n)));
+ !ewl_notebook_tabbar_homogeneous_get(EWL_NOTEBOOK(n)));
}
static void
notebook_change_align(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Widget *n;
unsigned int align = EWL_FLAG_ALIGN_CENTER;
@@ -111,15 +111,15 @@ notebook_change_align(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
pos = data;
if (!strcmp(pos, "Top"))
- align = EWL_FLAG_ALIGN_TOP;
+ align = EWL_FLAG_ALIGN_TOP;
else if (!strcmp(pos, "Bottom"))
- align = EWL_FLAG_ALIGN_BOTTOM;
+ align = EWL_FLAG_ALIGN_BOTTOM;
else if (!strcmp(pos, "Left"))
- align = EWL_FLAG_ALIGN_LEFT;
+ align = EWL_FLAG_ALIGN_LEFT;
else if (!strcmp(pos, "Right"))
- align = EWL_FLAG_ALIGN_RIGHT;
+ align = EWL_FLAG_ALIGN_RIGHT;
else if (!strcmp(pos, "Center"))
- align = EWL_FLAG_ALIGN_CENTER;
+ align = EWL_FLAG_ALIGN_CENTER;
n = ewl_widget_name_find("notebook");
ewl_notebook_tabbar_alignment_set(EWL_NOTEBOOK(n), align);
@@ -127,7 +127,7 @@ notebook_change_align(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
notebook_change_position(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Widget *n;
unsigned int align = EWL_POSITION_TOP;
@@ -135,13 +135,13 @@ notebook_change_position(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
pos = data;
if (!strcmp(pos, "Top"))
- align = EWL_POSITION_TOP;
+ align = EWL_POSITION_TOP;
else if (!strcmp(pos, "Bottom"))
- align = EWL_POSITION_BOTTOM;
+ align = EWL_POSITION_BOTTOM;
else if (!strcmp(pos, "Left"))
- align = EWL_POSITION_LEFT;
+ align = EWL_POSITION_LEFT;
else if (!strcmp(pos, "Right"))
- align = EWL_POSITION_RIGHT;
+ align = EWL_POSITION_RIGHT;
n = ewl_widget_name_find("notebook");
ewl_notebook_tabbar_position_set(EWL_NOTEBOOK(n), align);
@@ -149,7 +149,7 @@ notebook_change_position(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
notebook_append_page(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *o2, *o, *vis, *n;
char buf[10];
@@ -173,7 +173,7 @@ notebook_append_page(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
notebook_prepend_page(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *n, *o2, *o, *vis;
char buf[10];
@@ -197,7 +197,7 @@ notebook_prepend_page(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
notebook_delete_page(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Widget *n;
@@ -237,22 +237,22 @@ create_main_page(void)
for (i = 0; i < (sizeof(alignment) / sizeof(char *)); i++)
{
- o = ewl_radiobutton_new();
- ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
- ewl_button_label_set(EWL_BUTTON(o), alignment[i]);
- ewl_container_child_append(EWL_CONTAINER(border), o);
- ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- notebook_change_align, alignment[i]);
+ o = ewl_radiobutton_new();
+ ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
+ ewl_button_label_set(EWL_BUTTON(o), alignment[i]);
+ ewl_container_child_append(EWL_CONTAINER(border), o);
+ ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
+ notebook_change_align, alignment[i]);
- if (o2) ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o),
- EWL_RADIOBUTTON(o2));
+ if (o2) ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o),
+ EWL_RADIOBUTTON(o2));
- if (!strcmp(alignment[i], "Center"))
- ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), TRUE);
+ if (!strcmp(alignment[i], "Center"))
+ ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), TRUE);
- ewl_widget_show(o);
+ ewl_widget_show(o);
- o2 = o;
+ o2 = o;
}
/* box to hold position list */
@@ -264,22 +264,22 @@ create_main_page(void)
o2 = NULL;
for (i = 0; i < (sizeof(position) / sizeof(char *)); i++)
{
- o = ewl_radiobutton_new();
- ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
- ewl_button_label_set(EWL_BUTTON(o), position[i]);
- ewl_container_child_append(EWL_CONTAINER(border), o);
- ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- notebook_change_position, position[i]);
+ o = ewl_radiobutton_new();
+ ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
+ ewl_button_label_set(EWL_BUTTON(o), position[i]);
+ ewl_container_child_append(EWL_CONTAINER(border), o);
+ ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
+ notebook_change_position, position[i]);
- if (o2) ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o),
- EWL_RADIOBUTTON(o2));
+ if (o2) ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o),
+ EWL_RADIOBUTTON(o2));
- if (!strcmp(alignment[i], "Top"))
- ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), TRUE);
+ if (!strcmp(alignment[i], "Top"))
+ ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), TRUE);
- ewl_widget_show(o);
+ ewl_widget_show(o);
- o2 = o;
+ o2 = o;
}
o = ewl_checkbutton_new();
@@ -289,7 +289,7 @@ create_main_page(void)
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- notebook_cb_toggle_clicked, NULL);
+ notebook_cb_toggle_clicked, NULL);
ewl_widget_show(o);
o = ewl_checkbutton_new();
@@ -297,7 +297,7 @@ create_main_page(void)
ewl_container_child_append(EWL_CONTAINER(body), o);
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- notebook_cb_homogeneous_toggle_clicked, NULL);
+ notebook_cb_homogeneous_toggle_clicked, NULL);
ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
ewl_widget_show(o);
@@ -329,21 +329,21 @@ create_page(const char *name)
ewl_button_label_set(EWL_BUTTON(o), "Prepend Page");
ewl_container_child_append(EWL_CONTAINER(box2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- notebook_prepend_page, box);
+ notebook_prepend_page, box);
ewl_widget_show(o);
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "Append Page");
ewl_container_child_append(EWL_CONTAINER(box2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- notebook_append_page, box);
+ notebook_append_page, box);
ewl_widget_show(o);
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "Remove This Page");
ewl_container_child_append(EWL_CONTAINER(box), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- notebook_delete_page, box);
+ notebook_delete_page, box);
ewl_widget_show(o);
return box;
diff --git a/src/bin/tests/object/ewl_object_test.c b/src/bin/tests/object/ewl_object_test.c
index 60b9c38..f052c93 100644
--- a/src/bin/tests/object/ewl_object_test.c
+++ b/src/bin/tests/object/ewl_object_test.c
@@ -40,28 +40,28 @@ static int fill_policy_test_set_get(char *buf, int len);
static int alignment_test_set_get(char *buf, int len);
static Ewl_Unit_Test object_unit_tests[] = {
- {"default properties", default_property_test, NULL, -1, 0},
- {"place center/get", place_test_center_get, NULL, -1, 0},
- {"place top/get", place_test_top_get, NULL, -1, 0},
- {"place bottom/get", place_test_bottom_get, NULL, -1, 0},
- {"place left/get", place_test_left_get, NULL, -1, 0},
- {"place right/get", place_test_right_get, NULL, -1, 0},
- {"position set/get", position_test_set_get, NULL, -1, 0},
- {"position size set/get", position_size_test_set_get, NULL, -1, 0},
- {"preferred inner size set/get", preferred_inner_size_test_set_get, NULL, -1, 0},
- {"preferred size set/get", preferred_size_test_set_get, NULL, -1, 0},
- {"minimum size set/get", minimum_size_test_set_get, NULL, -1, 0},
- {"maximum size set/get", maximum_size_test_set_get, NULL, -1, 0},
- {"minimum size set/request", minimum_size_test_set_request, NULL, -1, 0},
- {"maximum size set/request", maximum_size_test_set_request, NULL, -1, 0},
- {"padding set/get", padding_test_set_get, NULL, -1, 0},
- {"insets set/get", insets_test_set_get, NULL, -1, 0},
- {"padding set/size get", padding_test_set_size_get, NULL, -1, 0},
- {"insets set/size get", insets_test_set_size_get, NULL, -1, 0},
- {"insets padding set/size get", insets_padding_test_set_size_get, NULL, -1, 0},
- {"fill policy set/get", fill_policy_test_set_get, NULL, -1, 0},
- {"alignment set/get", alignment_test_set_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"default properties", default_property_test, NULL, -1, 0},
+ {"place center/get", place_test_center_get, NULL, -1, 0},
+ {"place top/get", place_test_top_get, NULL, -1, 0},
+ {"place bottom/get", place_test_bottom_get, NULL, -1, 0},
+ {"place left/get", place_test_left_get, NULL, -1, 0},
+ {"place right/get", place_test_right_get, NULL, -1, 0},
+ {"position set/get", position_test_set_get, NULL, -1, 0},
+ {"position size set/get", position_size_test_set_get, NULL, -1, 0},
+ {"preferred inner size set/get", preferred_inner_size_test_set_get, NULL, -1, 0},
+ {"preferred size set/get", preferred_size_test_set_get, NULL, -1, 0},
+ {"minimum size set/get", minimum_size_test_set_get, NULL, -1, 0},
+ {"maximum size set/get", maximum_size_test_set_get, NULL, -1, 0},
+ {"minimum size set/request", minimum_size_test_set_request, NULL, -1, 0},
+ {"maximum size set/request", maximum_size_test_set_request, NULL, -1, 0},
+ {"padding set/get", padding_test_set_get, NULL, -1, 0},
+ {"insets set/get", insets_test_set_get, NULL, -1, 0},
+ {"padding set/size get", padding_test_set_size_get, NULL, -1, 0},
+ {"insets set/size get", insets_test_set_size_get, NULL, -1, 0},
+ {"insets padding set/size get", insets_padding_test_set_size_get, NULL, -1, 0},
+ {"fill policy set/get", fill_policy_test_set_get, NULL, -1, 0},
+ {"alignment set/get", alignment_test_set_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -87,85 +87,85 @@ default_property_test(char *buf, int len)
w = ewl_widget_new();
if (ewl_object_current_x_get(EWL_OBJECT(w))) {
- LOG_FAILURE(buf, len, "x coordinate incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "x coordinate incorrect");
+ goto DONE;
}
if (ewl_object_current_y_get(EWL_OBJECT(w))) {
- LOG_FAILURE(buf, len, "y coordinate incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "y coordinate incorrect");
+ goto DONE;
}
if (ewl_object_current_w_get(EWL_OBJECT(w)) != EWL_OBJECT_MIN_SIZE) {
- LOG_FAILURE(buf, len, "current width incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "current width incorrect");
+ goto DONE;
}
if (ewl_object_current_h_get(EWL_OBJECT(w)) != EWL_OBJECT_MIN_SIZE) {
- LOG_FAILURE(buf, len, "current height incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "current height incorrect");
+ goto DONE;
}
if (ewl_object_minimum_w_get(EWL_OBJECT(w)) != EWL_OBJECT_MIN_SIZE) {
- LOG_FAILURE(buf, len, "minimum width incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "minimum width incorrect");
+ goto DONE;
}
if (ewl_object_minimum_h_get(EWL_OBJECT(w)) != EWL_OBJECT_MIN_SIZE) {
- LOG_FAILURE(buf, len, "minimum height incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "minimum height incorrect");
+ goto DONE;
}
if (ewl_object_maximum_w_get(EWL_OBJECT(w)) != EWL_OBJECT_MAX_SIZE) {
- LOG_FAILURE(buf, len, "maximum width incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "maximum width incorrect");
+ goto DONE;
}
if (ewl_object_maximum_h_get(EWL_OBJECT(w)) != EWL_OBJECT_MAX_SIZE) {
- LOG_FAILURE(buf, len, "maximum height incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "maximum height incorrect");
+ goto DONE;
}
if (ewl_object_preferred_inner_w_get(EWL_OBJECT(w))) {
- LOG_FAILURE(buf, len, "preferred inner width incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "preferred inner width incorrect");
+ goto DONE;
}
if (ewl_object_preferred_inner_h_get(EWL_OBJECT(w))) {
- LOG_FAILURE(buf, len, "preferred inner height incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "preferred inner height incorrect");
+ goto DONE;
}
if (ewl_object_preferred_w_get(EWL_OBJECT(w)) != EWL_OBJECT_MIN_SIZE) {
- LOG_FAILURE(buf, len, "preferred width incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "preferred width incorrect");
+ goto DONE;
}
if (ewl_object_preferred_h_get(EWL_OBJECT(w)) != EWL_OBJECT_MIN_SIZE) {
- LOG_FAILURE(buf, len, "preferred height incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "preferred height incorrect");
+ goto DONE;
}
ewl_object_insets_get(EWL_OBJECT(w), &l, &r, &t, &b);
if (l || r || t || b) {
- LOG_FAILURE(buf, len, "insets incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "insets incorrect");
+ goto DONE;
}
ewl_object_padding_get(EWL_OBJECT(w), &l, &r, &t, &b);
if (l || r || t || b) {
- LOG_FAILURE(buf, len, "padding incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "padding incorrect");
+ goto DONE;
}
if (ewl_object_fill_policy_get(EWL_OBJECT(w)) != EWL_FLAG_FILL_NORMAL) {
- LOG_FAILURE(buf, len, "fill policy incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "fill policy incorrect");
+ goto DONE;
}
if (ewl_object_alignment_get(EWL_OBJECT(w)) != EWL_FLAG_ALIGN_CENTER) {
- LOG_FAILURE(buf, len, "alignment incorrect");
- goto DONE;
+ LOG_FAILURE(buf, len, "alignment incorrect");
+ goto DONE;
}
ret = 1;
@@ -195,9 +195,9 @@ place_test_center_get(char *buf, int len)
ewl_object_current_geometry_get(EWL_OBJECT(w), &x, &y, &width, &height);
if (x == 5 && y == 10 && width == 10 && height == 20)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect center align placement");
+ LOG_FAILURE(buf, len, "incorrect center align placement");
ewl_widget_destroy(w);
@@ -225,9 +225,9 @@ place_test_top_get(char *buf, int len)
ewl_object_current_geometry_get(EWL_OBJECT(w), &x, &y, &width, &height);
if (x == 5 && y == 0 && width == 10 && height == 20)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect top align placement");
+ LOG_FAILURE(buf, len, "incorrect top align placement");
ewl_widget_destroy(w);
@@ -255,9 +255,9 @@ place_test_bottom_get(char *buf, int len)
ewl_object_current_geometry_get(EWL_OBJECT(w), &x, &y, &width, &height);
if (x == 5 && y == 20 && width == 10 && height == 20)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect bottom align placement");
+ LOG_FAILURE(buf, len, "incorrect bottom align placement");
ewl_widget_destroy(w);
@@ -285,9 +285,9 @@ place_test_left_get(char *buf, int len)
ewl_object_current_geometry_get(EWL_OBJECT(w), &x, &y, &width, &height);
if (x == 0 && y == 10 && width == 10 && height == 20)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect left align placement");
+ LOG_FAILURE(buf, len, "incorrect left align placement");
ewl_widget_destroy(w);
@@ -315,9 +315,9 @@ place_test_right_get(char *buf, int len)
ewl_object_current_geometry_get(EWL_OBJECT(w), &x, &y, &width, &height);
if (x == 10 && y == 10 && width == 10 && height == 20)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect right align placement");
+ LOG_FAILURE(buf, len, "incorrect right align placement");
ewl_widget_destroy(w);
@@ -342,9 +342,9 @@ position_test_set_get(char *buf, int len)
y = ewl_object_current_y_get(EWL_OBJECT(w));
if (x == 11 && y == 23)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect positions returned");
+ LOG_FAILURE(buf, len, "incorrect positions returned");
ewl_widget_destroy(w);
@@ -368,9 +368,9 @@ position_size_test_set_get(char *buf, int len)
ewl_object_current_geometry_get(EWL_OBJECT(w), &x, &y, &width, &height);
if (x == 11 && y == 23 && width == 58 && height == 13)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect position or size returned");
+ LOG_FAILURE(buf, len, "incorrect position or size returned");
ewl_widget_destroy(w);
@@ -392,28 +392,28 @@ preferred_inner_size_test_set_get(char *buf, int len)
ewl_object_preferred_inner_size_get(EWL_OBJECT(w), &width, &height);
if (width == 0 && height == 0) {
- ewl_object_preferred_inner_size_set(EWL_OBJECT(w), MATCH_SIZE,
- MATCH_SIZE);
- ewl_object_preferred_inner_size_get(EWL_OBJECT(w), &width,
- &height);
- if (width == MATCH_SIZE && height == MATCH_SIZE) {
- ewl_object_preferred_inner_size_set(EWL_OBJECT(w),
- DIFFER_WIDTH,
- DIFFER_HEIGHT);
- ewl_object_preferred_inner_size_get(EWL_OBJECT(w),
- &width,
- &height);
- if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "preferred inner sizes match");
- }
- else
- LOG_FAILURE(buf, len, "preferred inner sizes differ");
+ ewl_object_preferred_inner_size_set(EWL_OBJECT(w), MATCH_SIZE,
+ MATCH_SIZE);
+ ewl_object_preferred_inner_size_get(EWL_OBJECT(w), &width,
+ &height);
+ if (width == MATCH_SIZE && height == MATCH_SIZE) {
+ ewl_object_preferred_inner_size_set(EWL_OBJECT(w),
+ DIFFER_WIDTH,
+ DIFFER_HEIGHT);
+ ewl_object_preferred_inner_size_get(EWL_OBJECT(w),
+ &width,
+ &height);
+ if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "preferred inner sizes match");
+ }
+ else
+ LOG_FAILURE(buf, len, "preferred inner sizes differ");
}
else
- LOG_FAILURE(buf, len, "default preferred inner size %dx%d",
- width, height);
+ LOG_FAILURE(buf, len, "default preferred inner size %dx%d",
+ width, height);
ewl_widget_destroy(w);
@@ -435,28 +435,28 @@ preferred_size_test_set_get(char *buf, int len)
ewl_object_preferred_size_get(EWL_OBJECT(w), &width, &height);
if (width == EWL_OBJECT_MIN_SIZE && height == EWL_OBJECT_MIN_SIZE) {
- ewl_object_preferred_inner_size_set(EWL_OBJECT(w), MATCH_SIZE,
- MATCH_SIZE);
- ewl_object_preferred_inner_size_get(EWL_OBJECT(w), &width,
- &height);
- if (width == MATCH_SIZE && height == MATCH_SIZE) {
- ewl_object_preferred_inner_size_set(EWL_OBJECT(w),
- DIFFER_WIDTH,
- DIFFER_HEIGHT);
- ewl_object_preferred_inner_size_get(EWL_OBJECT(w),
- &width,
- &height);
- if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "preferred sizes match");
- }
- else
- LOG_FAILURE(buf, len, "preferred sizes differ");
+ ewl_object_preferred_inner_size_set(EWL_OBJECT(w), MATCH_SIZE,
+ MATCH_SIZE);
+ ewl_object_preferred_inner_size_get(EWL_OBJECT(w), &width,
+ &height);
+ if (width == MATCH_SIZE && height == MATCH_SIZE) {
+ ewl_object_preferred_inner_size_set(EWL_OBJECT(w),
+ DIFFER_WIDTH,
+ DIFFER_HEIGHT);
+ ewl_object_preferred_inner_size_get(EWL_OBJECT(w),
+ &width,
+ &height);
+ if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "preferred sizes match");
+ }
+ else
+ LOG_FAILURE(buf, len, "preferred sizes differ");
}
else
- LOG_FAILURE(buf, len, "default preferred size %dx%d",
- width, height);
+ LOG_FAILURE(buf, len, "default preferred size %dx%d",
+ width, height);
ewl_widget_destroy(w);
@@ -476,37 +476,37 @@ minimum_size_test_set_get(char *buf, int len)
w = ewl_widget_new();
ewl_object_size_request(EWL_OBJECT(w), MATCH_SIZE - 1,
- MATCH_SIZE - 1);
+ MATCH_SIZE - 1);
ewl_object_minimum_size_get(EWL_OBJECT(w), &width, &height);
if (width == EWL_OBJECT_MIN_SIZE && height == EWL_OBJECT_MIN_SIZE) {
- ewl_object_minimum_size_set(EWL_OBJECT(w), DIFFER_WIDTH,
- DIFFER_HEIGHT);
- ewl_object_minimum_size_get(EWL_OBJECT(w), &width, &height);
- if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT) {
- ewl_object_minimum_size_set(EWL_OBJECT(w),
- MATCH_SIZE,
- MATCH_SIZE);
- ewl_object_minimum_size_get(EWL_OBJECT(w), &width,
- &height);
- if (width == MATCH_SIZE && height == MATCH_SIZE) {
- ewl_object_current_size_get(EWL_OBJECT(w),
- &width, &height);
- if (width == MATCH_SIZE && height == MATCH_SIZE)
- ret = 1;
- else
- LOG_FAILURE(buf, len,
- "current size wrong");
- }
- else
- LOG_FAILURE(buf, len, "minimum sizes match");
- }
- else
- LOG_FAILURE(buf, len, "minimum sizes differ");
+ ewl_object_minimum_size_set(EWL_OBJECT(w), DIFFER_WIDTH,
+ DIFFER_HEIGHT);
+ ewl_object_minimum_size_get(EWL_OBJECT(w), &width, &height);
+ if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT) {
+ ewl_object_minimum_size_set(EWL_OBJECT(w),
+ MATCH_SIZE,
+ MATCH_SIZE);
+ ewl_object_minimum_size_get(EWL_OBJECT(w), &width,
+ &height);
+ if (width == MATCH_SIZE && height == MATCH_SIZE) {
+ ewl_object_current_size_get(EWL_OBJECT(w),
+ &width, &height);
+ if (width == MATCH_SIZE && height == MATCH_SIZE)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len,
+ "current size wrong");
+ }
+ else
+ LOG_FAILURE(buf, len, "minimum sizes match");
+ }
+ else
+ LOG_FAILURE(buf, len, "minimum sizes differ");
}
else
- LOG_FAILURE(buf, len, "default minimum size %dx%d",
- width, height);
+ LOG_FAILURE(buf, len, "default minimum size %dx%d",
+ width, height);
ewl_widget_destroy(w);
@@ -526,38 +526,38 @@ maximum_size_test_set_get(char *buf, int len)
w = ewl_widget_new();
ewl_object_size_request(EWL_OBJECT(w), DIFFER_WIDTH + 1,
- DIFFER_HEIGHT + 1);
+ DIFFER_HEIGHT + 1);
ewl_object_maximum_size_get(EWL_OBJECT(w), &width, &height);
if (width == EWL_OBJECT_MAX_SIZE && height == EWL_OBJECT_MAX_SIZE) {
- ewl_object_maximum_size_set(EWL_OBJECT(w), MATCH_SIZE,
- MATCH_SIZE);
- ewl_object_maximum_size_get(EWL_OBJECT(w), &width, &height);
- if (width == MATCH_SIZE && height == MATCH_SIZE) {
- ewl_object_maximum_size_set(EWL_OBJECT(w),
- DIFFER_WIDTH,
- DIFFER_HEIGHT);
- ewl_object_maximum_size_get(EWL_OBJECT(w), &width,
- &height);
- if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT) {
- ewl_object_current_size_get(EWL_OBJECT(w),
- &width, &height);
- if (width == DIFFER_WIDTH &&
- height == DIFFER_HEIGHT)
- ret = 1;
- else
- LOG_FAILURE(buf, len,
- "current size wrong");
- }
- else
- LOG_FAILURE(buf, len, "maximum sizes match");
- }
- else
- LOG_FAILURE(buf, len, "maximum sizes differ");
+ ewl_object_maximum_size_set(EWL_OBJECT(w), MATCH_SIZE,
+ MATCH_SIZE);
+ ewl_object_maximum_size_get(EWL_OBJECT(w), &width, &height);
+ if (width == MATCH_SIZE && height == MATCH_SIZE) {
+ ewl_object_maximum_size_set(EWL_OBJECT(w),
+ DIFFER_WIDTH,
+ DIFFER_HEIGHT);
+ ewl_object_maximum_size_get(EWL_OBJECT(w), &width,
+ &height);
+ if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT) {
+ ewl_object_current_size_get(EWL_OBJECT(w),
+ &width, &height);
+ if (width == DIFFER_WIDTH &&
+ height == DIFFER_HEIGHT)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len,
+ "current size wrong");
+ }
+ else
+ LOG_FAILURE(buf, len, "maximum sizes match");
+ }
+ else
+ LOG_FAILURE(buf, len, "maximum sizes differ");
}
else
- LOG_FAILURE(buf, len, "default maximum size %dx%d",
- width, height);
+ LOG_FAILURE(buf, len, "default maximum size %dx%d",
+ width, height);
ewl_widget_destroy(w);
@@ -586,35 +586,35 @@ minimum_size_test_set_request(char *buf, int len)
if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT) {
- /*
- * Verify a valid size not equal to the boundary.
- */
- ewl_object_size_request(EWL_OBJECT(w), DIFFER_WIDTH + 1,
- DIFFER_HEIGHT + 1);
- ewl_object_current_size_get(EWL_OBJECT(w), &width, &height);
-
- if (width == DIFFER_WIDTH + 1 && height == DIFFER_HEIGHT + 1) {
-
- /*
- * Verify an invalid size is forced to the boundary.
- */
- ewl_object_size_request(EWL_OBJECT(w),
- DIFFER_WIDTH - 1,
- DIFFER_HEIGHT - 1);
- ewl_object_current_size_get(EWL_OBJECT(w), &width,
- &height);
- if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "min size ignored %dx%d",
- width, height);
- }
- else
- LOG_FAILURE(buf, len, "differing sizes wrong %dx%d",
- width, height);
+ /*
+ * Verify a valid size not equal to the boundary.
+ */
+ ewl_object_size_request(EWL_OBJECT(w), DIFFER_WIDTH + 1,
+ DIFFER_HEIGHT + 1);
+ ewl_object_current_size_get(EWL_OBJECT(w), &width, &height);
+
+ if (width == DIFFER_WIDTH + 1 && height == DIFFER_HEIGHT + 1) {
+
+ /*
+ * Verify an invalid size is forced to the boundary.
+ */
+ ewl_object_size_request(EWL_OBJECT(w),
+ DIFFER_WIDTH - 1,
+ DIFFER_HEIGHT - 1);
+ ewl_object_current_size_get(EWL_OBJECT(w), &width,
+ &height);
+ if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "min size ignored %dx%d",
+ width, height);
+ }
+ else
+ LOG_FAILURE(buf, len, "differing sizes wrong %dx%d",
+ width, height);
}
else
- LOG_FAILURE(buf, len, "same sizes wrong %dx%d", width, height);
+ LOG_FAILURE(buf, len, "same sizes wrong %dx%d", width, height);
ewl_widget_destroy(w);
@@ -643,35 +643,35 @@ maximum_size_test_set_request(char *buf, int len)
if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT) {
- /*
- * Verify a valid size not equal to the boundary.
- */
- ewl_object_size_request(EWL_OBJECT(w), DIFFER_WIDTH - 1,
- DIFFER_HEIGHT - 1);
- ewl_object_current_size_get(EWL_OBJECT(w), &width, &height);
-
- if (width == DIFFER_WIDTH - 1 && height == DIFFER_HEIGHT - 1) {
-
- /*
- * Verify an invalid size is forced to the boundary.
- */
- ewl_object_size_request(EWL_OBJECT(w),
- DIFFER_WIDTH + 1,
- DIFFER_HEIGHT + 1);
- ewl_object_current_size_get(EWL_OBJECT(w), &width,
- &height);
- if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "max size ignored %dx%d",
- width, height);
- }
- else
- LOG_FAILURE(buf, len, "differing sizes wrong %dx%d",
- width, height);
+ /*
+ * Verify a valid size not equal to the boundary.
+ */
+ ewl_object_size_request(EWL_OBJECT(w), DIFFER_WIDTH - 1,
+ DIFFER_HEIGHT - 1);
+ ewl_object_current_size_get(EWL_OBJECT(w), &width, &height);
+
+ if (width == DIFFER_WIDTH - 1 && height == DIFFER_HEIGHT - 1) {
+
+ /*
+ * Verify an invalid size is forced to the boundary.
+ */
+ ewl_object_size_request(EWL_OBJECT(w),
+ DIFFER_WIDTH + 1,
+ DIFFER_HEIGHT + 1);
+ ewl_object_current_size_get(EWL_OBJECT(w), &width,
+ &height);
+ if (width == DIFFER_WIDTH && height == DIFFER_HEIGHT)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "max size ignored %dx%d",
+ width, height);
+ }
+ else
+ LOG_FAILURE(buf, len, "differing sizes wrong %dx%d",
+ width, height);
}
else
- LOG_FAILURE(buf, len, "same sizes wrong %dx%d", width, height);
+ LOG_FAILURE(buf, len, "same sizes wrong %dx%d", width, height);
ewl_widget_destroy(w);
@@ -692,22 +692,22 @@ padding_test_set_get(char *buf, int len)
ewl_object_padding_get(EWL_OBJECT(w), &l, &r, &t, &b);
if (l || r || t || b)
- LOG_FAILURE(buf, len, "initial padding not 0");
+ LOG_FAILURE(buf, len, "initial padding not 0");
else {
- ewl_object_padding_set(EWL_OBJECT(w), 1, 2, 3, 4);
- ewl_object_padding_get(EWL_OBJECT(w), &l, &r, &t, &b);
- if (l == 1 && r == 2 && t == 3 && b == 4) {
- l = ewl_object_padding_left_get(EWL_OBJECT(w));
- r = ewl_object_padding_right_get(EWL_OBJECT(w));
- t = ewl_object_padding_top_get(EWL_OBJECT(w));
- b = ewl_object_padding_bottom_get(EWL_OBJECT(w));
- if (l == 1 && r == 2 && t == 3 && b == 4)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "incorrect individual");
- }
- else
- LOG_FAILURE(buf, len, "incorrect returned padding");
+ ewl_object_padding_set(EWL_OBJECT(w), 1, 2, 3, 4);
+ ewl_object_padding_get(EWL_OBJECT(w), &l, &r, &t, &b);
+ if (l == 1 && r == 2 && t == 3 && b == 4) {
+ l = ewl_object_padding_left_get(EWL_OBJECT(w));
+ r = ewl_object_padding_right_get(EWL_OBJECT(w));
+ t = ewl_object_padding_top_get(EWL_OBJECT(w));
+ b = ewl_object_padding_bottom_get(EWL_OBJECT(w));
+ if (l == 1 && r == 2 && t == 3 && b == 4)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "incorrect individual");
+ }
+ else
+ LOG_FAILURE(buf, len, "incorrect returned padding");
}
ewl_widget_destroy(w);
@@ -729,22 +729,22 @@ insets_test_set_get(char *buf, int len)
ewl_object_insets_get(EWL_OBJECT(w), &l, &r, &t, &b);
if (l || r || t || b)
- LOG_FAILURE(buf, len, "initial insets not 0");
+ LOG_FAILURE(buf, len, "initial insets not 0");
else {
- ewl_object_insets_set(EWL_OBJECT(w), 1, 2, 3, 4);
- ewl_object_insets_get(EWL_OBJECT(w), &l, &r, &t, &b);
- if (l == 1 && r == 2 && t == 3 && b == 4) {
- l = ewl_object_insets_left_get(EWL_OBJECT(w));
- r = ewl_object_insets_right_get(EWL_OBJECT(w));
- t = ewl_object_insets_top_get(EWL_OBJECT(w));
- b = ewl_object_insets_bottom_get(EWL_OBJECT(w));
- if (l == 1 && r == 2 && t == 3 && b == 4)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "incorrect individual");
- }
- else
- LOG_FAILURE(buf, len, "incorrect returned insets");
+ ewl_object_insets_set(EWL_OBJECT(w), 1, 2, 3, 4);
+ ewl_object_insets_get(EWL_OBJECT(w), &l, &r, &t, &b);
+ if (l == 1 && r == 2 && t == 3 && b == 4) {
+ l = ewl_object_insets_left_get(EWL_OBJECT(w));
+ r = ewl_object_insets_right_get(EWL_OBJECT(w));
+ t = ewl_object_insets_top_get(EWL_OBJECT(w));
+ b = ewl_object_insets_bottom_get(EWL_OBJECT(w));
+ if (l == 1 && r == 2 && t == 3 && b == 4)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "incorrect individual");
+ }
+ else
+ LOG_FAILURE(buf, len, "incorrect returned insets");
}
ewl_widget_destroy(w);
@@ -769,11 +769,11 @@ padding_test_set_size_get(char *buf, int len)
ewl_object_current_size_get(EWL_OBJECT(w), &width, &height);
if (width == (3 + EWL_OBJECT_MIN_SIZE) &&
- height == (7 + EWL_OBJECT_MIN_SIZE))
- ret = 1;
+ height == (7 + EWL_OBJECT_MIN_SIZE))
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect returned size %dx%d", width,
- height);
+ LOG_FAILURE(buf, len, "incorrect returned size %dx%d", width,
+ height);
ewl_widget_destroy(w);
@@ -797,10 +797,10 @@ insets_test_set_size_get(char *buf, int len)
ewl_object_current_size_get(EWL_OBJECT(w), &width, &height);
if (width == 4 && height == 8)
- ret = 1;
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect returned size %dx%d", width,
- height);
+ LOG_FAILURE(buf, len, "incorrect returned size %dx%d", width,
+ height);
ewl_widget_destroy(w);
@@ -825,11 +825,11 @@ insets_padding_test_set_size_get(char *buf, int len)
ewl_object_current_size_get(EWL_OBJECT(w), &width, &height);
if (width == (10 + EWL_OBJECT_MIN_SIZE) &&
- height == (10 + EWL_OBJECT_MIN_SIZE))
- ret = 1;
+ height == (10 + EWL_OBJECT_MIN_SIZE))
+ ret = 1;
else
- LOG_FAILURE(buf, len, "incorrect returned size %dx%d", width,
- height);
+ LOG_FAILURE(buf, len, "incorrect returned size %dx%d", width,
+ height);
ewl_widget_destroy(w);
@@ -858,15 +858,15 @@ fill_policy_test_set_get(char *buf, int len)
if ((fill & EWL_FLAG_FILL_HSHRINK) && (fill & EWL_FLAG_FILL_VSHRINK) &&
(fill & EWL_FLAG_FILL_HFILL) && (fill & EWL_FLAG_FILL_VFILL)) {
- ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
- fill = ewl_object_fill_policy_get(EWL_OBJECT(w));
- if (!fill)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "fill none incorrect");
+ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
+ fill = ewl_object_fill_policy_get(EWL_OBJECT(w));
+ if (!fill)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "fill none incorrect");
}
else
- LOG_FAILURE(buf, len, "fill all missing flags");
+ LOG_FAILURE(buf, len, "fill all missing flags");
ewl_widget_destroy(w);
@@ -887,21 +887,21 @@ alignment_test_set_get(char *buf, int len)
w = ewl_widget_new();
ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_LEFT |
- EWL_FLAG_ALIGN_RIGHT | EWL_FLAG_ALIGN_TOP |
- EWL_FLAG_ALIGN_BOTTOM);
+ EWL_FLAG_ALIGN_RIGHT | EWL_FLAG_ALIGN_TOP |
+ EWL_FLAG_ALIGN_BOTTOM);
align = ewl_object_alignment_get(EWL_OBJECT(w));
if ((align & EWL_FLAG_ALIGN_LEFT) && (align & EWL_FLAG_ALIGN_RIGHT) &&
(align & EWL_FLAG_ALIGN_TOP) && (align & EWL_FLAG_ALIGN_BOTTOM)) {
- ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_CENTER);
- align = ewl_object_alignment_get(EWL_OBJECT(w));
- if (!align)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "align none incorrect");
+ ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_CENTER);
+ align = ewl_object_alignment_get(EWL_OBJECT(w));
+ if (!align)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "align none incorrect");
}
else
- LOG_FAILURE(buf, len, "alignment missing flags");
+ LOG_FAILURE(buf, len, "alignment missing flags");
ewl_widget_destroy(w);
diff --git a/src/bin/tests/paned/ewl_paned_test.c b/src/bin/tests/paned/ewl_paned_test.c
index c8eb645..4baa1de 100644
--- a/src/bin/tests/paned/ewl_paned_test.c
+++ b/src/bin/tests/paned/ewl_paned_test.c
@@ -8,7 +8,7 @@
static int create_test(Ewl_Container *box);
static void ewl_paned_test_cb_clicked_destroy(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_paned_test_cb_clicked(Ewl_Widget *w, void *ev, void *data);
static void ewl_paned_test_cb_add(Ewl_Widget *w, void *ev, void *data);
@@ -21,13 +21,13 @@ static int fixed_size_get(char *buf, int len);
static int fixed_size_unset_get(char *buf, int len);
static Ewl_Unit_Test paned_unit_tests[] = {
- {"get initial size", initial_size_get, NULL, -1, 0},
- {"get unset initial size", initial_size_unset_get, NULL, -1, 0},
- {"get initial size after remove", initial_size_after_remove_get, NULL, -1, 0},
- {"get initial size for many widgets", initial_size_many_get, NULL, -1, 0},
- {"get the fixed size flag", fixed_size_get, NULL, -1, 0},
- {"get the unset fixed size flag", fixed_size_unset_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"get initial size", initial_size_get, NULL, -1, 0},
+ {"get unset initial size", initial_size_unset_get, NULL, -1, 0},
+ {"get initial size after remove", initial_size_after_remove_get, NULL, -1, 0},
+ {"get initial size for many widgets", initial_size_many_get, NULL, -1, 0},
+ {"get the fixed size flag", fixed_size_get, NULL, -1, 0},
+ {"get the unset fixed size flag", fixed_size_unset_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -59,25 +59,25 @@ create_test(Ewl_Container *box)
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_FILL);
ewl_container_child_append(EWL_CONTAINER(pane2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked, "Fill");
+ ewl_paned_test_cb_clicked, "Fill");
ewl_widget_show(o);
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "HFill | VShrink");
ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_container_child_append(EWL_CONTAINER(pane2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked, "HFill | VShrink");
+ ewl_paned_test_cb_clicked, "HFill | VShrink");
ewl_widget_show(o);
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "HShrink | VFill");
ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
+ EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
ewl_container_child_append(EWL_CONTAINER(pane2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked, "HShrink | VFill");
+ ewl_paned_test_cb_clicked, "HShrink | VFill");
ewl_widget_show(o);
o = ewl_button_new();
@@ -85,7 +85,7 @@ create_test(Ewl_Container *box)
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
ewl_container_child_append(EWL_CONTAINER(pane2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked, "Shrink");
+ ewl_paned_test_cb_clicked, "Shrink");
ewl_widget_show(o);
pane3 = ewl_hpaned_new();
@@ -96,10 +96,10 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o), "Left Top");
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(o),
- EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
+ EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
ewl_container_child_append(EWL_CONTAINER(pane3), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked, "Left Top");
+ ewl_paned_test_cb_clicked, "Left Top");
ewl_widget_show(o);
o = ewl_button_new();
@@ -108,23 +108,23 @@ create_test(Ewl_Container *box)
ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
ewl_container_child_append(EWL_CONTAINER(pane3), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked, "Center");
+ ewl_paned_test_cb_clicked, "Center");
ewl_widget_show(o);
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "Right Bottom");
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(o),
- EWL_FLAG_ALIGN_RIGHT | EWL_FLAG_ALIGN_BOTTOM);
+ EWL_FLAG_ALIGN_RIGHT | EWL_FLAG_ALIGN_BOTTOM);
ewl_container_child_append(EWL_CONTAINER(pane3), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked, "Right Bottom");
+ ewl_paned_test_cb_clicked, "Right Bottom");
ewl_widget_show(o);
pbox = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(pane1), pbox);
ewl_object_fill_policy_set(EWL_OBJECT(pbox),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_NONE);
ewl_widget_show(pbox);
o = ewl_button_new();
@@ -144,7 +144,7 @@ create_test(Ewl_Container *box)
static void
ewl_paned_test_cb_clicked(Ewl_Widget *w, void *ev __UNUSED__,
- void *data)
+ void *data)
{
printf("Clicked %s\n", (char *)data);
ewl_widget_hide(w);
@@ -152,7 +152,7 @@ ewl_paned_test_cb_clicked(Ewl_Widget *w, void *ev __UNUSED__,
static void
ewl_paned_test_cb_clicked_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data)
+ void *data)
{
printf("Destroy Clicked %s\n", (char *)data);
ewl_widget_destroy(w);
@@ -160,7 +160,7 @@ ewl_paned_test_cb_clicked_destroy(Ewl_Widget *w, void *ev __UNUSED__,
static void
ewl_paned_test_cb_add(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Widget *o;
Ewl_Paned *p;
@@ -172,7 +172,7 @@ ewl_paned_test_cb_add(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
ewl_container_child_append(EWL_CONTAINER(p), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_paned_test_cb_clicked_destroy, "New Button");
+ ewl_paned_test_cb_clicked_destroy, "New Button");
ewl_widget_show(o);
}
@@ -192,8 +192,8 @@ initial_size_get(char *buf, int len)
val = ewl_paned_initial_size_get(EWL_PANED(paned), child);
if (val != 240) {
- LOG_FAILURE(buf, len, "get value is different from the set one");
- ret = 0;
+ LOG_FAILURE(buf, len, "get value is different from the set one");
+ ret = 0;
}
ewl_widget_destroy(paned);
@@ -216,8 +216,8 @@ initial_size_unset_get(char *buf, int len)
val = ewl_paned_initial_size_get(EWL_PANED(paned), child);
if (val != 0) {
- LOG_FAILURE(buf, len, "get value is not 0");
- ret = 0;
+ LOG_FAILURE(buf, len, "get value is not 0");
+ ret = 0;
}
ewl_widget_destroy(paned);
@@ -243,8 +243,8 @@ initial_size_after_remove_get(char *buf, int len)
val = ewl_paned_initial_size_get(EWL_PANED(paned), child);
if (val != 0) {
- LOG_FAILURE(buf, len, "get value is not zero");
- ret = 0;
+ LOG_FAILURE(buf, len, "get value is not zero");
+ ret = 0;
}
ewl_widget_destroy(child);
@@ -265,20 +265,20 @@ initial_size_many_get(char *buf, int len)
/* build the children and set the initial size for them */
for (i = 0; i < 4; i++) {
- w[i] = ewl_cell_new();
- ewl_container_child_append(EWL_CONTAINER(paned), w[i]);
- ewl_paned_initial_size_set(EWL_PANED(paned), w[i], 240 + i);
+ w[i] = ewl_cell_new();
+ ewl_container_child_append(EWL_CONTAINER(paned), w[i]);
+ ewl_paned_initial_size_set(EWL_PANED(paned), w[i], 240 + i);
}
/* now check the set values */
for (i = 0; i < 4; i++) {
- int val = ewl_paned_initial_size_get(EWL_PANED(paned), w[i]);
+ int val = ewl_paned_initial_size_get(EWL_PANED(paned), w[i]);
- if (val != 240 + i) {
- LOG_FAILURE(buf, len, "get value is not zero");
- ret = 0;
- break;
- }
+ if (val != 240 + i) {
+ LOG_FAILURE(buf, len, "get value is not zero");
+ ret = 0;
+ break;
+ }
}
ewl_widget_destroy(paned);
@@ -302,8 +302,8 @@ fixed_size_get(char *buf, int len)
val = ewl_paned_fixed_size_get(EWL_PANED(paned), child);
if (!val) {
- LOG_FAILURE(buf, len, "get value is different from the set one");
- ret = 0;
+ LOG_FAILURE(buf, len, "get value is different from the set one");
+ ret = 0;
}
ewl_widget_destroy(paned);
@@ -326,8 +326,8 @@ fixed_size_unset_get(char *buf, int len)
val = ewl_paned_fixed_size_get(EWL_PANED(paned), child);
if (val) {
- LOG_FAILURE(buf, len, "get value is not FALSE");
- ret = 0;
+ LOG_FAILURE(buf, len, "get value is not FALSE");
+ ret = 0;
}
ewl_widget_destroy(paned);
diff --git a/src/bin/tests/password/ewl_password_test.c b/src/bin/tests/password/ewl_password_test.c
index 9007ff2..b6c5e2f 100644
--- a/src/bin/tests/password/ewl_password_test.c
+++ b/src/bin/tests/password/ewl_password_test.c
@@ -18,7 +18,7 @@ test_info(Ewl_Test *test)
{
test->name = "Password";
test->tip = "Defines the Ewl_Password class to allow\n"
- "for single line obscured text.";
+ "for single line obscured text.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -34,9 +34,9 @@ create_test(Ewl_Container *box)
ewl_object_padding_set(EWL_OBJECT(password[0]), 5, 5, 5, 0);
ewl_container_child_append(box, password[0]);
ewl_callback_append(password[0], EWL_CALLBACK_VALUE_CHANGED,
- cb_fetch_password_text, NULL);
+ cb_fetch_password_text, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(password[0]),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
ewl_widget_show(password[0]);
password[1] = ewl_password_new();
@@ -46,9 +46,9 @@ create_test(Ewl_Container *box)
ewl_object_padding_set(EWL_OBJECT(password[1]), 5, 5, 0, 0);
ewl_container_child_append(box, password[1]);
ewl_callback_append(password[1], EWL_CALLBACK_VALUE_CHANGED,
- cb_fetch_password_text, NULL);
+ cb_fetch_password_text, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(password[1]),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
ewl_widget_show(password[1]);
password[2] = ewl_password_new();
@@ -57,9 +57,9 @@ create_test(Ewl_Container *box)
ewl_object_padding_set(EWL_OBJECT(password[2]), 5, 5, 0, 0);
ewl_container_child_append(box, password[2]);
ewl_callback_append(password[2], EWL_CALLBACK_VALUE_CHANGED,
- cb_fetch_password_text, NULL);
+ cb_fetch_password_text, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(password[2]),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
ewl_widget_show(password[2]);
button_hbox = ewl_hbox_new();
@@ -73,7 +73,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button[0]), "Fetch text");
ewl_container_child_append(EWL_CONTAINER(button_hbox), button[0]);
ewl_callback_append(button[0], EWL_CALLBACK_CLICKED,
- cb_fetch_password_text, NULL);
+ cb_fetch_password_text, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(button[0]), EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(button[0]), EWL_FLAG_ALIGN_CENTER);
ewl_widget_show(button[0]);
@@ -82,7 +82,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button[1]), "Set Text");
ewl_container_child_append(EWL_CONTAINER(button_hbox), button[1]);
ewl_callback_append(button[1], EWL_CALLBACK_CLICKED,
- cb_set_password_text, NULL);
+ cb_set_password_text, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(button[1]), EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(button[1]), EWL_FLAG_ALIGN_CENTER);
ewl_widget_show(button[1]);
@@ -92,7 +92,7 @@ create_test(Ewl_Container *box)
static void
cb_fetch_password_text(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
char *s;
@@ -111,7 +111,7 @@ cb_fetch_password_text(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
cb_set_password_text(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_text_text_set(EWL_TEXT(password[0]), "Play with me ?");
ewl_text_text_set(EWL_TEXT(password[1]), "E W L ! ! !");
diff --git a/src/bin/tests/pointer/ewl_pointer_test.c b/src/bin/tests/pointer/ewl_pointer_test.c
index 0396348..9045623 100644
--- a/src/bin/tests/pointer/ewl_pointer_test.c
+++ b/src/bin/tests/pointer/ewl_pointer_test.c
@@ -33,8 +33,8 @@ create_test(Ewl_Container *box)
o = ewl_entry_new();
ewl_attach_mouse_argb_cursor_set(o, pointer_win);
ewl_text_text_set(EWL_TEXT(o), "Expect to see a button cursor\n"
- "over this entry and a normal cursor\n"
- "over other parts of the window");
+ "over this entry and a normal cursor\n"
+ "over other parts of the window");
ewl_entry_editable_set(EWL_ENTRY(o), FALSE);
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
ewl_container_child_append(EWL_CONTAINER(box), o);
diff --git a/src/bin/tests/progressbar/ewl_progressbar_test.c b/src/bin/tests/progressbar/ewl_progressbar_test.c
index 562a1e5..152781d 100644
--- a/src/bin/tests/progressbar/ewl_progressbar_test.c
+++ b/src/bin/tests/progressbar/ewl_progressbar_test.c
@@ -11,7 +11,7 @@ static int create_test(Ewl_Container *box);
static void cb_rerun_progressbars(Ewl_Widget *w, void *ev, void *data);
static void cb_set_new_range(Ewl_Widget *w, void *ev, void *data);
static void cb_destroy_progressbar_test(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static int cb_increment_progress(void *data);
static Ecore_Timer *progress_timer[3];
@@ -37,13 +37,13 @@ create_test(Ewl_Container *box)
ewl_container_child_append(EWL_CONTAINER(box), progressbar_vbox);
ewl_box_spacing_set(EWL_BOX(progressbar_vbox), 0);
ewl_callback_prepend(EWL_WIDGET(progressbar_vbox), EWL_CALLBACK_DESTROY,
- cb_destroy_progressbar_test, NULL);
+ cb_destroy_progressbar_test, NULL);
ewl_widget_show(progressbar_vbox);
progressbar_box = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(progressbar_vbox),
- progressbar_box);
+ progressbar_box);
ewl_box_spacing_set(EWL_BOX(progressbar_box), 0);
ewl_widget_show(progressbar_box);
@@ -51,17 +51,17 @@ create_test(Ewl_Container *box)
* First and second progressbar
*/
for (i = 0; i < 2; i++) {
- progressbar[i] = ewl_progressbar_new();
- if (i == 0)
- ewl_range_invert_set(EWL_RANGE(progressbar[0]), TRUE);
- ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
- ewl_widget_show(progressbar[i]);
+ progressbar[i] = ewl_progressbar_new();
+ if (i == 0)
+ ewl_range_invert_set(EWL_RANGE(progressbar[0]), TRUE);
+ ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
+ ewl_widget_show(progressbar[i]);
- progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
- (Ewl_Progressbar *) progressbar[i]);
+ progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
+ (Ewl_Progressbar *) progressbar[i]);
- ewl_container_child_append(EWL_CONTAINER(progressbar_box),
- progressbar[i]);
+ ewl_container_child_append(EWL_CONTAINER(progressbar_box),
+ progressbar[i]);
}
/*
@@ -72,7 +72,7 @@ create_test(Ewl_Container *box)
ewl_widget_show(progressbar[2]);
progress_timer[2] = ecore_timer_add(0.1, cb_increment_progress,
- (Ewl_Progressbar *) progressbar[2]);
+ (Ewl_Progressbar *) progressbar[2]);
ewl_container_child_append(EWL_CONTAINER(progressbar_vbox), progressbar[2]);
@@ -89,7 +89,7 @@ create_test(Ewl_Container *box)
*/
progressbar_box = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(progressbar_vbox),
- progressbar_box);
+ progressbar_box);
ewl_box_spacing_set(EWL_BOX(progressbar_box), 0);
ewl_widget_show(progressbar_box);
@@ -97,7 +97,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button), "Rerun");
ewl_container_child_append(EWL_CONTAINER(progressbar_box), button);
ewl_callback_prepend(button, EWL_CALLBACK_CLICKED,
- cb_rerun_progressbars, NULL);
+ cb_rerun_progressbars, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
ewl_widget_show (button);
@@ -106,7 +106,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button), "Set a random range from 0-500");
ewl_container_child_append(EWL_CONTAINER(progressbar_box), button);
ewl_callback_prepend(button, EWL_CALLBACK_CLICKED,
- cb_set_new_range, NULL);
+ cb_set_new_range, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
ewl_widget_show (button);
@@ -125,57 +125,57 @@ cb_increment_progress(void *data)
val = ewl_range_value_get(r);
if (val >= r->max_val) {
- for (i = 0; i < 3; i++) {
- if (progress_timer[i]) {
- ecore_timer_del(progress_timer[i]);
- progress_timer[i] = NULL;
- }
- }
- return 0;
+ for (i = 0; i < 3; i++) {
+ if (progress_timer[i]) {
+ ecore_timer_del(progress_timer[i]);
+ progress_timer[i] = NULL;
+ }
+ }
+ return 0;
}
val += 1;
ewl_range_value_set(r, val);
if (val >= 20 && val < 35 ) {
- ewl_progressbar_custom_label_set(EWL_PROGRESSBAR(r),
- "%.0lf / %.0lf kbytes");
+ ewl_progressbar_custom_label_set(EWL_PROGRESSBAR(r),
+ "%.0lf / %.0lf kbytes");
}
if (val >= 35 && val < 60) {
- value = ewl_range_value_get(r);
- range = ewl_range_maximum_value_get(r);
+ value = ewl_range_value_get(r);
+ range = ewl_range_maximum_value_get(r);
- snprintf(c, sizeof (c), "%.0lf of %.0lf beers", value, range);
- ewl_progressbar_label_set(EWL_PROGRESSBAR(r), c);
+ snprintf(c, sizeof (c), "%.0lf of %.0lf beers", value, range);
+ ewl_progressbar_label_set(EWL_PROGRESSBAR(r), c);
}
if (val == 60)
- ewl_progressbar_label_hide(EWL_PROGRESSBAR(r));
+ ewl_progressbar_label_hide(EWL_PROGRESSBAR(r));
if (val == 70)
- ewl_progressbar_label_show(EWL_PROGRESSBAR(r));
+ ewl_progressbar_label_show(EWL_PROGRESSBAR(r));
return 1;
}
static void
cb_destroy_progressbar_test(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
int i;
for (i = 0; i < 3; i++) {
- if (progress_timer[i]) {
- ecore_timer_del(progress_timer[i]);
- progress_timer[i] = NULL;
- }
+ if (progress_timer[i]) {
+ ecore_timer_del(progress_timer[i]);
+ progress_timer[i] = NULL;
+ }
}
}
static void
cb_set_new_range(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
int i, j;
@@ -183,36 +183,36 @@ cb_set_new_range(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
printf ("New random value: %d\n", j);
for (i = 0; i < 3; i++) {
- ewl_range_maximum_value_set(EWL_RANGE(progressbar[i]), j);
+ ewl_range_maximum_value_set(EWL_RANGE(progressbar[i]), j);
- if (ewl_range_value_get(EWL_RANGE(progressbar[i])) >= j)
- cb_rerun_progressbars(EWL_WIDGET (progressbar[i]),
- NULL, NULL);
+ if (ewl_range_value_get(EWL_RANGE(progressbar[i])) >= j)
+ cb_rerun_progressbars(EWL_WIDGET (progressbar[i]),
+ NULL, NULL);
}
}
static void
cb_rerun_progressbars (Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
int i;
for (i = 0; i < 3; i++) {
- /*
- * Make sure to autolabel the bar on start again,
- * if we stop a place where it labels manually.
- * (since the auto label is turned off when you label manually)
- */
- ewl_progressbar_label_show (EWL_PROGRESSBAR (progressbar[i]));
- ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
-
- if (progress_timer[i]) {
- ecore_timer_del(progress_timer[i]);
- progress_timer[i] = NULL;
- }
-
- progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
- progressbar[i]);
+ /*
+ * Make sure to autolabel the bar on start again,
+ * if we stop a place where it labels manually.
+ * (since the auto label is turned off when you label manually)
+ */
+ ewl_progressbar_label_show (EWL_PROGRESSBAR (progressbar[i]));
+ ewl_range_value_set(EWL_RANGE(progressbar[i]), 0);
+
+ if (progress_timer[i]) {
+ ecore_timer_del(progress_timer[i]);
+ progress_timer[i] = NULL;
+ }
+
+ progress_timer[i] = ecore_timer_add(0.1, cb_increment_progress,
+ progressbar[i]);
}
}
diff --git a/src/bin/tests/puzzle/ewl_puzzle_test.c b/src/bin/tests/puzzle/ewl_puzzle_test.c
index a4ebac0..d009311 100644
--- a/src/bin/tests/puzzle/ewl_puzzle_test.c
+++ b/src/bin/tests/puzzle/ewl_puzzle_test.c
@@ -76,7 +76,7 @@ create_test(Ewl_Container *box)
*/
w = ewl_image_new();
ewl_image_file_path_set(EWL_IMAGE(w), PACKAGE_DATA_DIR
- "/ewl/images/e-logo.png");
+ "/ewl/images/e-logo.png");
ewl_image_proportional_set(EWL_IMAGE(w), FALSE);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
ewl_container_child_append(EWL_CONTAINER(hbox), w);
@@ -97,9 +97,9 @@ create_test(Ewl_Container *box)
ewl_text_wrap_set(EWL_TEXT(w), TRUE);
ewl_object_w_request(EWL_OBJECT(w), 400);
ewl_text_text_append(EWL_TEXT(w),
- "The rules are really simple. Just try "
- "to have the same image on your left "
- "like you have on your right hand.");
+ "The rules are really simple. Just try "
+ "to have the same image on your left "
+ "like you have on your right hand.");
ewl_container_child_append(EWL_CONTAINER(hbox), w);
ewl_widget_show(w);
@@ -121,12 +121,12 @@ puzzle_grid_fill(Ewl_Grid *grid)
Ewl_Widget *w;
int i, random;
int unsort[6][15] =
- {{4, 2, 5, 14, 0, 11, 6, 13, 10, 12, 1, 9, 8, 7, 3},
- {0, 2, 3, 7, 8, 4, 1, 6, 12, 5, 10, 11, 9, 13, 14},
- {1, 2, 6, 3, 13, 7, 10, 11, 0, 5, 12, 14, 4, 8, 9},
- {1, 10, 2, 3, 7, 9, 11, 6, 0, 8, 12, 5, 14, 4, 13},
- {0, 5, 1, 2, 9, 3, 7, 10, 4, 6, 11, 14, 8, 12, 13},
- {1, 3, 11, 14, 0, 7, 2, 13, 8, 12, 6, 10, 4, 9, 5}};
+ {{4, 2, 5, 14, 0, 11, 6, 13, 10, 12, 1, 9, 8, 7, 3},
+ {0, 2, 3, 7, 8, 4, 1, 6, 12, 5, 10, 11, 9, 13, 14},
+ {1, 2, 6, 3, 13, 7, 10, 11, 0, 5, 12, 14, 4, 8, 9},
+ {1, 10, 2, 3, 7, 9, 11, 6, 0, 8, 12, 5, 14, 4, 13},
+ {0, 5, 1, 2, 9, 3, 7, 10, 4, 6, 11, 14, 8, 12, 13},
+ {1, 3, 11, 14, 0, 7, 2, 13, 8, 12, 6, 10, 4, 9, 5}};
/* a really stupid randomizer */
random = time(NULL) % 6;
@@ -136,23 +136,23 @@ puzzle_grid_fill(Ewl_Grid *grid)
*/
for (i = 0; i < 15; i++)
{
- char buf[PATH_MAX];
-
- snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR
- "/ewl/images/e-logo-%i.png", unsort[random][i]);
-
- w = ewl_image_new();
- ewl_image_file_path_set(EWL_IMAGE(w), buf);
- ewl_image_proportional_set(EWL_IMAGE(w), FALSE);
- ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
- ewl_container_child_append(EWL_CONTAINER(grid), w);
- ewl_grid_child_position_set(EWL_GRID(grid), w,
- i % 4, i % 4, i / 4, i / 4);
- ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP,
- puzzle_mouse_up_cb, grid);
- ewl_widget_show(w);
-
- childs[i % 4][i / 4] = w;
+ char buf[PATH_MAX];
+
+ snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR
+ "/ewl/images/e-logo-%i.png", unsort[random][i]);
+
+ w = ewl_image_new();
+ ewl_image_file_path_set(EWL_IMAGE(w), buf);
+ ewl_image_proportional_set(EWL_IMAGE(w), FALSE);
+ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
+ ewl_container_child_append(EWL_CONTAINER(grid), w);
+ ewl_grid_child_position_set(EWL_GRID(grid), w,
+ i % 4, i % 4, i / 4, i / 4);
+ ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP,
+ puzzle_mouse_up_cb, grid);
+ ewl_widget_show(w);
+
+ childs[i % 4][i / 4] = w;
}
free_col = free_row = 3;
}
@@ -183,51 +183,51 @@ puzzle_mouse_up_cb(Ewl_Widget *w, void *e, void *data)
ch = ewl_object_current_h_get(EWL_OBJECT(w));
if (ev->x > cx && ev->y > cy && ev->x < cx + cw && ev->y < cy + ch)
- return;
+ return;
ewl_grid_child_position_get(EWL_GRID(g), w, &col, NULL, &row, NULL);
if (col == free_col && ev->x > cx && ev->x < cx + cw) {
- int direction, i;
+ int direction, i;
- if (ev->y < cy)
- direction = -1;
- else
- direction = 1;
+ if (ev->y < cy)
+ direction = -1;
+ else
+ direction = 1;
- if (sign(free_row - row) != direction)
- return;
+ if (sign(free_row - row) != direction)
+ return;
- for (i = free_row; i != row; i -= direction) {
- Ewl_Widget *move;
+ for (i = free_row; i != row; i -= direction) {
+ Ewl_Widget *move;
- move = childs[col][i - direction];
- ewl_grid_child_position_set(EWL_GRID(g),
- move, col, col, i, i);
- childs[col][i] = move;
- }
- free_row = row;
+ move = childs[col][i - direction];
+ ewl_grid_child_position_set(EWL_GRID(g),
+ move, col, col, i, i);
+ childs[col][i] = move;
+ }
+ free_row = row;
}
else if (row == free_row && ev->y > cy && ev->y < cy + ch) {
- int direction, i;
+ int direction, i;
- if (ev->x < cx)
- direction = -1;
- else
- direction = 1;
+ if (ev->x < cx)
+ direction = -1;
+ else
+ direction = 1;
- if (sign(free_col - col) != direction)
- return;
+ if (sign(free_col - col) != direction)
+ return;
- for (i = free_col; i != col; i -= direction) {
- Ewl_Widget *move;
+ for (i = free_col; i != col; i -= direction) {
+ Ewl_Widget *move;
- move = childs[i - direction][row];
- ewl_grid_child_position_set(EWL_GRID(g),
- move, i, i, row, row);
- childs[i][row] = move;
- }
- free_col = col;
+ move = childs[i - direction][row];
+ ewl_grid_child_position_set(EWL_GRID(g),
+ move, i, i, row, row);
+ childs[i][row] = move;
+ }
+ free_col = col;
}
}
@@ -235,9 +235,9 @@ static int
sign(int x)
{
if (x > 0)
- return 1;
+ return 1;
if (x < 0)
- return -1;
+ return -1;
return 0;
}
diff --git a/src/bin/tests/range/ewl_range_test.c b/src/bin/tests/range/ewl_range_test.c
index 945dd11..24a0be5 100644
--- a/src/bin/tests/range/ewl_range_test.c
+++ b/src/bin/tests/range/ewl_range_test.c
@@ -15,8 +15,8 @@
static int range_new(char *buf, int len);
static Ewl_Unit_Test range_unit_tests[] = {
- {"range new", range_new, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"range new", range_new, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -42,21 +42,21 @@ range_new(char *buf, int len)
/* if we don't get a valid pointer we are out of space or something
* went wrong */
if (!ewl_range_init(EWL_RANGE(range)))
- LOG_FAILURE(buf, len, "Fail to init a new range widget");
+ LOG_FAILURE(buf, len, "Fail to init a new range widget");
else if (ewl_range_value_get(EWL_RANGE(range)) != 0.0)
- LOG_FAILURE(buf, len, "Range value != 0.0");
+ LOG_FAILURE(buf, len, "Range value != 0.0");
else if (ewl_range_minimum_value_get(EWL_RANGE(range)) != 0.0)
- LOG_FAILURE(buf, len, "Range minimum != 0.0");
+ LOG_FAILURE(buf, len, "Range minimum != 0.0");
else if (ewl_range_maximum_value_get(EWL_RANGE(range)) != 100.0)
- LOG_FAILURE(buf, len, "Range maximum != 100.0");
+ LOG_FAILURE(buf, len, "Range maximum != 100.0");
else if (ewl_range_step_get(EWL_RANGE(range)) != 10.0)
- LOG_FAILURE(buf, len, "Range step != 10.0");
+ LOG_FAILURE(buf, len, "Range step != 10.0");
else if (ewl_range_invert_get(EWL_RANGE(range)))
- LOG_FAILURE(buf, len, "Range is inverted by default");
+ LOG_FAILURE(buf, len, "Range is inverted by default");
else if (ewl_range_unknown_get(EWL_RANGE(range)))
- LOG_FAILURE(buf, len, "Range's range is unknown by default");
+ LOG_FAILURE(buf, len, "Range's range is unknown by default");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(range);
diff --git a/src/bin/tests/seeker/ewl_seeker_test.c b/src/bin/tests/seeker/ewl_seeker_test.c
index 48f2d98..609b684 100644
--- a/src/bin/tests/seeker/ewl_seeker_test.c
+++ b/src/bin/tests/seeker/ewl_seeker_test.c
@@ -26,14 +26,14 @@ create_test(Ewl_Container *box)
hseeker = ewl_hseeker_new();
ewl_object_position_request(EWL_OBJECT(hseeker), 30, 0);
ewl_callback_append(hseeker, EWL_CALLBACK_VALUE_CHANGED,
- cb_print_value, NULL);
+ cb_print_value, NULL);
ewl_container_child_append(box, hseeker);
ewl_widget_show(hseeker);
vseeker = ewl_vseeker_new();
ewl_object_position_request(EWL_OBJECT(vseeker), 0, 30);
ewl_callback_append(vseeker, EWL_CALLBACK_VALUE_CHANGED,
- cb_print_value, NULL);
+ cb_print_value, NULL);
ewl_container_child_append(box, vseeker);
ewl_widget_show(vseeker);
diff --git a/src/bin/tests/shadow/ewl_shadow_test.c b/src/bin/tests/shadow/ewl_shadow_test.c
index ec8fb37..9c9b91e 100644
--- a/src/bin/tests/shadow/ewl_shadow_test.c
+++ b/src/bin/tests/shadow/ewl_shadow_test.c
@@ -12,7 +12,7 @@ void test_info(Ewl_Test *test)
{
test->name = "Shadow";
test->tip = "Defines the Ewl_Shadow class for displaying\n"
- "a container that will shadow other widgets.";
+ "a container that will shadow other widgets.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -32,7 +32,7 @@ create_test(Ewl_Container *box)
image = ewl_image_new();
ewl_image_file_set(EWL_IMAGE(image),
- PACKAGE_DATA_DIR "/ewl/images/elicit.png", NULL);
+ PACKAGE_DATA_DIR "/ewl/images/elicit.png", NULL);
ewl_image_size_set(EWL_IMAGE(image), 220, 210);
ewl_object_alignment_set(EWL_OBJECT(image), EWL_FLAG_ALIGN_CENTER);
ewl_container_child_append(EWL_CONTAINER(shadow), image);
diff --git a/src/bin/tests/spinner/ewl_spinner_test.c b/src/bin/tests/spinner/ewl_spinner_test.c
index bdd4d27..8535a08 100644
--- a/src/bin/tests/spinner/ewl_spinner_test.c
+++ b/src/bin/tests/spinner/ewl_spinner_test.c
@@ -18,8 +18,8 @@ test_info(Ewl_Test *test)
{
test->name = "Spinner";
test->tip = "Provides a field for entering numerical\n"
- "values, along with buttons to increment\n"
- "and decrement the value.";
+ "values, along with buttons to increment\n"
+ "and decrement the value.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -126,7 +126,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(separator), "Get Values");
ewl_container_child_append(EWL_CONTAINER(box), separator);
ewl_callback_append(separator, EWL_CALLBACK_CLICKED,
- cb_value_show, NULL);
+ cb_value_show, NULL);
ewl_widget_show(separator);
return 1;
@@ -134,13 +134,13 @@ create_test(Ewl_Container *box)
static void
cb_value_show(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
printf("X %d, Y %d, W %d, H %d\n",
- (int)ewl_range_value_get(EWL_RANGE(spinner[0])),
- (int)ewl_range_value_get(EWL_RANGE(spinner[1])),
- (int)ewl_range_value_get(EWL_RANGE(spinner[2])),
- (int)ewl_range_value_get(EWL_RANGE(spinner[3])));
+ (int)ewl_range_value_get(EWL_RANGE(spinner[0])),
+ (int)ewl_range_value_get(EWL_RANGE(spinner[1])),
+ (int)ewl_range_value_get(EWL_RANGE(spinner[2])),
+ (int)ewl_range_value_get(EWL_RANGE(spinner[3])));
}
diff --git a/src/bin/tests/statusbar/ewl_statusbar_test.c b/src/bin/tests/statusbar/ewl_statusbar_test.c
index fad391b..45b2aa0 100644
--- a/src/bin/tests/statusbar/ewl_statusbar_test.c
+++ b/src/bin/tests/statusbar/ewl_statusbar_test.c
@@ -41,7 +41,7 @@ create_test(Ewl_Container *box)
button = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(button), "push");
ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_push_cb,
- statusbar);
+ statusbar);
ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
ewl_container_child_append(EWL_CONTAINER(hbox), button);
ewl_widget_show(button);
@@ -49,7 +49,7 @@ create_test(Ewl_Container *box)
button = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(button), "pop");
ewl_callback_append(button, EWL_CALLBACK_CLICKED, button_pop_cb,
- statusbar);
+ statusbar);
ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
ewl_container_child_append(EWL_CONTAINER(hbox), button);
ewl_widget_show(button);
@@ -59,7 +59,7 @@ create_test(Ewl_Container *box)
static void
button_push_cb(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Statusbar *sb;
char msg[20];
@@ -72,7 +72,7 @@ button_push_cb(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
button_pop_cb(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Statusbar *sb;
diff --git a/src/bin/tests/table/ewl_table_test.c b/src/bin/tests/table/ewl_table_test.c
index 50b7523..ac8fc7b 100644
--- a/src/bin/tests/table/ewl_table_test.c
+++ b/src/bin/tests/table/ewl_table_test.c
@@ -13,7 +13,7 @@ test_info(Ewl_Test *test)
{
test->name = "Table";
test->tip = "Defines the Ewl_Table class used for\n"
- "laying out Ewl_Widget's in an array.";
+ "laying out Ewl_Widget's in an array.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -40,7 +40,7 @@ create_test(Ewl_Container *box)
ewl_table_attach(EWL_TABLE(table), button[1], 1, 1, 2, 2);
ewl_object_set_custom_size(EWL_OBJECT(button[1]), 100, 20);
ewl_object_fill_policy_set(EWL_OBJECT(button[1]),
- EWL_FLAG_FILL_NORMAL);
+ EWL_FLAG_FILL_NORMAL);
ewl_widget_realize(button[1]);
button[2] = ewl_button_new();
@@ -48,7 +48,7 @@ create_test(Ewl_Container *box)
ewl_table_attach(EWL_TABLE(table), button[2], 1, 1, 3, 3);
ewl_object_set_custom_size(EWL_OBJECT(button[2]), 100, 20);
ewl_object_fill_policy_set(EWL_OBJECT(button[2]),
- EWL_FLAG_FILL_NORMAL);
+ EWL_FLAG_FILL_NORMAL);
ewl_widget_show(button[2]);
@@ -75,7 +75,7 @@ create_test(Ewl_Container *box)
ewl_table_attach(EWL_TABLE(table), button[6], 2, 2, 4, 4);
ewl_object_set_custom_size(EWL_OBJECT(button[6]), 100, 20);
ewl_object_fill_policy_set(EWL_OBJECT(button[6]),
- EWL_FLAG_FILL_NORMAL);
+ EWL_FLAG_FILL_NORMAL);
ewl_widget_realize(button[6]);
button[7] = ewl_button_new();
@@ -83,7 +83,7 @@ create_test(Ewl_Container *box)
ewl_table_attach(EWL_TABLE(table), button[7], 3, 3, 4, 4);
ewl_object_set_custom_size(EWL_OBJECT(button[7]), 100, 20);
ewl_object_fill_policy_set(EWL_OBJECT(button[7]),
- EWL_FLAG_FILL_NORMAL);
+ EWL_FLAG_FILL_NORMAL);
ewl_widget_realize(button[7]);
button[8] = ewl_button_new();
@@ -102,7 +102,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button[10]), NULL);
ewl_object_set_custom_size(EWL_OBJECT(button[10]), 100, 20);
ewl_object_fill_policy_set(EWL_OBJECT(button[10]),
- EWL_FLAG_FILL_NORMAL);
+ EWL_FLAG_FILL_NORMAL);
ewl_table_attach(EWL_TABLE(table), button[10], 4, 4, 4, 4);
ewl_widget_realize(button[10]);
@@ -110,7 +110,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(button[11]), NULL);
ewl_object_set_custom_size(EWL_OBJECT(button[11]), 100, 20);
ewl_object_fill_policy_set(EWL_OBJECT(button[11]),
- EWL_FLAG_FILL_NORMAL);
+ EWL_FLAG_FILL_NORMAL);
ewl_table_attach(EWL_TABLE(table), button[11], 4, 4, 5, 5);
ewl_widget_realize(button[11]);
diff --git a/src/bin/tests/text/ewl_text_test.c b/src/bin/tests/text/ewl_text_test.c
index 1ee16df..50f92a9 100644
--- a/src/bin/tests/text/ewl_text_test.c
+++ b/src/bin/tests/text/ewl_text_test.c
@@ -18,11 +18,11 @@ static int text_valid_utf8_set_get(char *buf, int len);
static int text_invalid_utf8_set_get(char *buf, int len);
static Ewl_Unit_Test text_unit_tests[] = {
- {"text set/get", text_test_set_get, NULL, -1, 0},
- {"valid UTF-8 text set/get", text_valid_utf8_set_get, NULL, -1, 0},
- {"invalid UTF-8 text set/get", text_invalid_utf8_set_get, NULL, -1, 0},
- {"null text set/get", text_test_set_get_null, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"text set/get", text_test_set_get, NULL, -1, 0},
+ {"valid UTF-8 text set/get", text_valid_utf8_set_get, NULL, -1, 0},
+ {"invalid UTF-8 text set/get", text_invalid_utf8_set_get, NULL, -1, 0},
+ {"null text set/get", text_test_set_get_null, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -30,7 +30,7 @@ test_info(Ewl_Test *test)
{
test->name = "Text";
test->tip = "Defines a class for multi-line text layout\n"
- "and formatting.";
+ "and formatting.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
@@ -67,8 +67,8 @@ create_test(Ewl_Container *box)
printf("Styles set\n");
ewl_text_styles_set(EWL_TEXT(o), EWL_TEXT_STYLE_DOUBLE_UNDERLINE
- | EWL_TEXT_STYLE_OUTLINE
- | EWL_TEXT_STYLE_SOFT_SHADOW);
+ | EWL_TEXT_STYLE_OUTLINE
+ | EWL_TEXT_STYLE_SOFT_SHADOW);
printf("Double underline colour set\n");
ewl_text_double_underline_color_set(EWL_TEXT(o), 50, 50, 50, 255);
@@ -92,16 +92,16 @@ create_test(Ewl_Container *box)
ewl_text_text_append(EWL_TEXT(o), "This is the link."); /* 17 */
len = ewl_text_cursor_position_get(EWL_TEXT(o)) -
- ewl_text_trigger_start_pos_get(trigger);
+ ewl_text_trigger_start_pos_get(trigger);
ewl_text_trigger_length_set(trigger, len);
ewl_container_child_append(EWL_CONTAINER(o), EWL_WIDGET(trigger));
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_UP,
- trigger_cb, "You clicked the trigger, have a cookie.");
+ trigger_cb, "You clicked the trigger, have a cookie.");
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_IN,
- trigger_cb_mouse_in, NULL);
+ trigger_cb_mouse_in, NULL);
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_OUT,
- trigger_cb_mouse_out, NULL);
+ trigger_cb_mouse_out, NULL);
printf("Inserting 'The fifth bunch of text\\n' [139]\n");
ewl_text_text_insert(EWL_TEXT(o), "The fifth bunch of text\n", 0); /* 24 */
@@ -143,16 +143,16 @@ create_test(Ewl_Container *box)
printf("Appending 'This is the multi\\n\\nline link.' [226]\n");
ewl_text_text_append(EWL_TEXT(o), "This is the multi\n\nline link."); /* 29 */
len = ewl_text_cursor_position_get(EWL_TEXT(o)) -
- ewl_text_trigger_start_pos_get(trigger);
+ ewl_text_trigger_start_pos_get(trigger);
ewl_text_trigger_length_set(trigger, len);
ewl_container_child_append(EWL_CONTAINER(o), EWL_WIDGET(trigger));
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_UP,
- trigger_cb, "You clicked the multi-line trigger, have a coke.");
+ trigger_cb, "You clicked the multi-line trigger, have a coke.");
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_IN,
- trigger_cb_mouse_in, NULL);
+ trigger_cb_mouse_in, NULL);
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_OUT,
- trigger_cb_mouse_out, NULL);
+ trigger_cb_mouse_out, NULL);
printf("Colour set\n");
ewl_text_color_set(EWL_TEXT(o), 255, 0, 255, 255);
@@ -189,7 +189,7 @@ trigger_cb(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data)
static void
trigger_cb_mouse_in(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text_Trigger *t;
@@ -201,7 +201,7 @@ trigger_cb_mouse_in(Ewl_Widget *w, void *ev __UNUSED__,
static void
trigger_cb_mouse_out(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text_Trigger *t;
@@ -223,9 +223,9 @@ text_test_set_get(char *buf, int len)
t = ewl_text_text_get(EWL_TEXT(o));
if (strcmp(t, "This is the test text."))
- LOG_FAILURE(buf, len, "text_get did not match text_set.");
+ LOG_FAILURE(buf, len, "text_get did not match text_set.");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -242,9 +242,9 @@ text_test_set_get_null(char *buf, int len)
t = ewl_text_text_get(EWL_TEXT(o));
if (t)
- LOG_FAILURE(buf, len, "text_get did not return null.");
+ LOG_FAILURE(buf, len, "text_get did not return null.");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -254,8 +254,8 @@ text_valid_utf8_set_get(char *buf, int len)
{
Ewl_Widget *t;
char text[] = "This a valid UTF-8 string, although it contains "
- "at the moment only 7-bit ascii code.\n"
- " This will be changed later!";
+ "at the moment only 7-bit ascii code.\n"
+ " This will be changed later!";
const char * returned_text;
unsigned char *utext;
@@ -271,9 +271,9 @@ text_valid_utf8_set_get(char *buf, int len)
returned_text = ewl_text_text_get(EWL_TEXT(t));
if (strcmp(text, returned_text)) {
- LOG_FAILURE(buf, len, "Incorrect UTF-8 validation during"
- "setting a US-ASCII string");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect UTF-8 validation during"
+ "setting a US-ASCII string");
+ return FALSE;
}
ewl_text_clear(EWL_TEXT(t));
@@ -292,9 +292,9 @@ text_valid_utf8_set_get(char *buf, int len)
returned_text = ewl_text_text_get(EWL_TEXT(t));
if (strcmp(text, returned_text)) {
- LOG_FAILURE(buf, len, "Incorrect UTF-8 validation during"
- "setting a valid UTF-8 string");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect UTF-8 validation during"
+ "setting a valid UTF-8 string");
+ return FALSE;
}
return TRUE;
}
@@ -305,8 +305,8 @@ text_invalid_utf8_set_get(char *buf, int len)
{
Ewl_Widget *t;
char text[] = "This a valid UTF-8 string, although it contains "
- "at the moment only 7-bit ascii code.\n"
- " This will be changed later!";
+ "at the moment only 7-bit ascii code.\n"
+ " This will be changed later!";
const char *returned_text;
unsigned char *utext;
@@ -328,17 +328,17 @@ text_invalid_utf8_set_get(char *buf, int len)
returned_text = ewl_text_text_get(EWL_TEXT(t));
if (!returned_text)
- LOG_FAILURE(buf, len, "ewl_text_text_get() returned a NULL pointer");
+ LOG_FAILURE(buf, len, "ewl_text_text_get() returned a NULL pointer");
else if (!strcmp(text, returned_text)
- || returned_text[2] < 0
- || returned_text[4] < 0
- || returned_text[10] < 0
- || returned_text[11] < 0)
+ || returned_text[2] < 0
+ || returned_text[4] < 0
+ || returned_text[10] < 0
+ || returned_text[11] < 0)
{
- LOG_FAILURE(buf, len, "Incorrect UTF-8 validation during"
- "setting a invalid UTF-8 string");
- return FALSE;
+ LOG_FAILURE(buf, len, "Incorrect UTF-8 validation during"
+ "setting a invalid UTF-8 string");
+ return FALSE;
}
return TRUE;
}
diff --git a/src/bin/tests/text_editor/ewl_text_editor_test.c b/src/bin/tests/text_editor/ewl_text_editor_test.c
index 2473e6b..a54b1a2 100644
--- a/src/bin/tests/text_editor/ewl_text_editor_test.c
+++ b/src/bin/tests/text_editor/ewl_text_editor_test.c
@@ -23,26 +23,26 @@ typedef struct
} Ewl_Text_Editor_Control;
static char *txt = "I'm not a lumberjack, or a fur trader,\n"
- "I don't live in an igloo,\n"
- "Or eat blubber,\n"
- "Or own a dogsled,\n"
- "And I don't know Jimmy, Sally, or Suzie from Canada,"
- "although I'm certain they're really really nice,\n"
- "I have a Prime Minister, not a President,\n"
- "I speak English and French, not American,\n"
- "And I pronounce it about, not aboot,\n"
- "I can proudly sew my country's flag on my backpack,\n"
- "I believe in peacekeeping, not policing,\n"
- "diversity, not assimilation,\n"
- "and that the Beaver is a truly proud and nobel animal,\n"
- "a touque is a hat,\n"
- "a chesterfield is a couch,\n"
- "and it is pronounced Zed, not Zee, Zed,\n"
- "Canada is the 2nd largest land mass,\n"
- "the first nation of hockey,\n"
- "and the best part of North America,\n"
- "My name is Joe,\n"
- "and I AM CANADIAN!!!!!";
+ "I don't live in an igloo,\n"
+ "Or eat blubber,\n"
+ "Or own a dogsled,\n"
+ "And I don't know Jimmy, Sally, or Suzie from Canada,"
+ "although I'm certain they're really really nice,\n"
+ "I have a Prime Minister, not a President,\n"
+ "I speak English and French, not American,\n"
+ "And I pronounce it about, not aboot,\n"
+ "I can proudly sew my country's flag on my backpack,\n"
+ "I believe in peacekeeping, not policing,\n"
+ "diversity, not assimilation,\n"
+ "and that the Beaver is a truly proud and nobel animal,\n"
+ "a touque is a hat,\n"
+ "a chesterfield is a couch,\n"
+ "and it is pronounced Zed, not Zee, Zed,\n"
+ "Canada is the 2nd largest land mass,\n"
+ "the first nation of hockey,\n"
+ "and the best part of North America,\n"
+ "My name is Joe,\n"
+ "and I AM CANADIAN!!!!!";
static int create_test(Ewl_Container *box);
@@ -70,7 +70,7 @@ test_info(Ewl_Test *test)
{
test->name = "Text Editor";
test->tip = "Defines a class for multi-line text layout\n"
- "and formatting.";
+ "and formatting.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_ADVANCED;
@@ -87,109 +87,109 @@ create_test(Ewl_Container *box)
ewl_widget_show(hbox);
{
- int i;
- Ewl_Model *model;
- Ewl_View *view;
- Ecore_List *styles;
-
- struct
- {
- char *icon;
- char *tooltip;
- void (*cb)(Ewl_Widget *w, void *ev, void *data);
- } format[] = {
- {EWL_ICON_FORMAT_JUSTIFY_LEFT, "Left align",
- ete_cb_justify_left},
- {EWL_ICON_FORMAT_JUSTIFY_CENTER, "Center",
- ete_cb_justify_center},
- {EWL_ICON_FORMAT_JUSTIFY_RIGHT, "Right align",
- ete_cb_justify_right},
- {EWL_ICON_FORMAT_TEXT_BOLD, "Bold", ete_cb_bold},
- {EWL_ICON_FORMAT_TEXT_ITALIC, "Italic", ete_cb_italic},
- {EWL_ICON_FORMAT_TEXT_UNDERLINE, "Underline",
- ete_cb_underline},
- {EWL_ICON_FORMAT_TEXT_STRIKETHROUGH, "Strikethrough",
- ete_cb_strikethrough},
- {NULL, NULL, NULL}
- };
-
- styles = ecore_list_new();
- ecore_list_append(styles, "None");
- ecore_list_append(styles, "Shadow");
- ecore_list_append(styles, "Soft Shadow");
- ecore_list_append(styles, "Far Shadow");
- ecore_list_append(styles, "Glow");
- ecore_list_append(styles, "Outline");
-
- for (i = 0; format[i].icon != NULL; i++)
- {
- const char *path;
-
- path = ewl_icon_theme_icon_path_get(format[i].icon,
- EWL_ICON_SIZE_SMALL);
-
- o = ewl_icon_simple_new();
- ewl_icon_image_set(EWL_ICON(o), path,
- format[i].icon);
- ewl_icon_label_set(EWL_ICON(o), format[i].tooltip);
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_VFILL);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- format[i].cb, NULL);
- ewl_attach_tooltip_text_set(o, format[i].tooltip);
- ewl_widget_show(o);
- }
-
- o = ewl_spacer_new();
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_widget_show(o);
-
- o = ewl_label_new();
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
- ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
- ewl_label_text_set(EWL_LABEL(o), "Font Style");
- ewl_widget_show(o);
-
- model = ewl_model_ecore_list_instance();
- view = ewl_label_view_get();
- o = ewl_combo_new();
- ewl_mvc_model_set(EWL_MVC(o), model);
- ewl_mvc_view_set(EWL_MVC(o), view);
- ewl_mvc_data_set(EWL_MVC(o), styles);
- ewl_mvc_selected_set(EWL_MVC(o), NULL,
- ewl_mvc_data_get(EWL_MVC(o)), 0, 0);
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ete_cb_styles_changed, NULL);
- ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
- ewl_widget_show(o);
-
- o = ewl_label_new();
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
- ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
- ewl_label_text_set(EWL_LABEL(o), "Font Size");
- ewl_widget_show(o);
-
- o = ewl_spinner_new();
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
- ewl_range_value_set(EWL_RANGE(o), 12);
- ewl_range_minimum_value_set(EWL_RANGE(o), 8);
- ewl_range_maximum_value_set(EWL_RANGE(o), 72);
- ewl_range_step_set(EWL_RANGE(o), 1);
- ewl_spinner_digits_set(EWL_SPINNER(o), 0);
- ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ete_cb_font_size, NULL);
- ewl_widget_show(o);
+ int i;
+ Ewl_Model *model;
+ Ewl_View *view;
+ Ecore_List *styles;
+
+ struct
+ {
+ char *icon;
+ char *tooltip;
+ void (*cb)(Ewl_Widget *w, void *ev, void *data);
+ } format[] = {
+ {EWL_ICON_FORMAT_JUSTIFY_LEFT, "Left align",
+ ete_cb_justify_left},
+ {EWL_ICON_FORMAT_JUSTIFY_CENTER, "Center",
+ ete_cb_justify_center},
+ {EWL_ICON_FORMAT_JUSTIFY_RIGHT, "Right align",
+ ete_cb_justify_right},
+ {EWL_ICON_FORMAT_TEXT_BOLD, "Bold", ete_cb_bold},
+ {EWL_ICON_FORMAT_TEXT_ITALIC, "Italic", ete_cb_italic},
+ {EWL_ICON_FORMAT_TEXT_UNDERLINE, "Underline",
+ ete_cb_underline},
+ {EWL_ICON_FORMAT_TEXT_STRIKETHROUGH, "Strikethrough",
+ ete_cb_strikethrough},
+ {NULL, NULL, NULL}
+ };
+
+ styles = ecore_list_new();
+ ecore_list_append(styles, "None");
+ ecore_list_append(styles, "Shadow");
+ ecore_list_append(styles, "Soft Shadow");
+ ecore_list_append(styles, "Far Shadow");
+ ecore_list_append(styles, "Glow");
+ ecore_list_append(styles, "Outline");
+
+ for (i = 0; format[i].icon != NULL; i++)
+ {
+ const char *path;
+
+ path = ewl_icon_theme_icon_path_get(format[i].icon,
+ EWL_ICON_SIZE_SMALL);
+
+ o = ewl_icon_simple_new();
+ ewl_icon_image_set(EWL_ICON(o), path,
+ format[i].icon);
+ ewl_icon_label_set(EWL_ICON(o), format[i].tooltip);
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_object_fill_policy_set(EWL_OBJECT(o),
+ EWL_FLAG_FILL_VFILL);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED,
+ format[i].cb, NULL);
+ ewl_attach_tooltip_text_set(o, format[i].tooltip);
+ ewl_widget_show(o);
+ }
+
+ o = ewl_spacer_new();
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_widget_show(o);
+
+ o = ewl_label_new();
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
+ ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
+ ewl_label_text_set(EWL_LABEL(o), "Font Style");
+ ewl_widget_show(o);
+
+ model = ewl_model_ecore_list_instance();
+ view = ewl_label_view_get();
+ o = ewl_combo_new();
+ ewl_mvc_model_set(EWL_MVC(o), model);
+ ewl_mvc_view_set(EWL_MVC(o), view);
+ ewl_mvc_data_set(EWL_MVC(o), styles);
+ ewl_mvc_selected_set(EWL_MVC(o), NULL,
+ ewl_mvc_data_get(EWL_MVC(o)), 0, 0);
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
+ ete_cb_styles_changed, NULL);
+ ewl_object_fill_policy_set(EWL_OBJECT(o),
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ ewl_widget_show(o);
+
+ o = ewl_label_new();
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
+ ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
+ ewl_label_text_set(EWL_LABEL(o), "Font Size");
+ ewl_widget_show(o);
+
+ o = ewl_spinner_new();
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
+ ewl_range_value_set(EWL_RANGE(o), 12);
+ ewl_range_minimum_value_set(EWL_RANGE(o), 8);
+ ewl_range_maximum_value_set(EWL_RANGE(o), 72);
+ ewl_range_step_set(EWL_RANGE(o), 1);
+ ewl_spinner_digits_set(EWL_SPINNER(o), 0);
+ ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
+ ete_cb_font_size, NULL);
+ ewl_widget_show(o);
}
scroll = ewl_scrollpane_new();
ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(scroll),
- EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
+ EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
ewl_container_child_append(EWL_CONTAINER(box), scroll);
ewl_widget_name_set(scroll, "scrollpane");
ewl_widget_show(scroll);
@@ -216,25 +216,25 @@ create_test(Ewl_Container *box)
ewl_widget_show(hbox);
{
- int i;
- Ewl_Text_Editor_Control btns [] = {
- {"Fetch", ete_cb_fetch},
- {"Set", ete_cb_set},
- {"Load", ete_cb_load},
- {"Clear", ete_cb_clear},
- {NULL, NULL}
- };
-
- for (i = 0; btns[i].name != NULL; i++)
- {
- o = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(o), btns[i].name);
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HSHRINK|EWL_FLAG_FILL_VSHRINK);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED, btns[i].cb, NULL);
- ewl_widget_show(o);
- }
+ int i;
+ Ewl_Text_Editor_Control btns [] = {
+ {"Fetch", ete_cb_fetch},
+ {"Set", ete_cb_set},
+ {"Load", ete_cb_load},
+ {"Clear", ete_cb_clear},
+ {NULL, NULL}
+ };
+
+ for (i = 0; btns[i].name != NULL; i++)
+ {
+ o = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(o), btns[i].name);
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_object_fill_policy_set(EWL_OBJECT(o),
+ EWL_FLAG_FILL_HSHRINK|EWL_FLAG_FILL_VSHRINK);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED, btns[i].cb, NULL);
+ ewl_widget_show(o);
+ }
}
@@ -251,30 +251,30 @@ ete_style_apply(Ewl_Text *t, Ewl_Text_Style s)
styles = ewl_text_styles_get(t, cursor_pos);
if (styles & s)
- styles &= ~s;
+ styles &= ~s;
else
- styles |= s;
+ styles |= s;
if (ewl_text_has_selection(t))
{
- Ewl_Text_Trigger *selection;
+ Ewl_Text_Trigger *selection;
- selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(t));
- ewl_text_cursor_position_set(t,
- ewl_text_trigger_start_pos_get(selection));
+ selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(t));
+ ewl_text_cursor_position_set(t,
+ ewl_text_trigger_start_pos_get(selection));
- ewl_text_styles_apply(t, styles,
- ewl_text_trigger_length_get(selection));
+ ewl_text_styles_apply(t, styles,
+ ewl_text_trigger_length_get(selection));
- ewl_text_cursor_position_set(t, cursor_pos);
+ ewl_text_cursor_position_set(t, cursor_pos);
}
else
- ewl_text_styles_set(t, styles);
+ ewl_text_styles_set(t, styles);
}
static void
ete_cb_styles_changed(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *entry;
Ewl_Selection_Idx *idx;
@@ -285,29 +285,29 @@ ete_cb_styles_changed(Ewl_Widget *w, void *ev __UNUSED__,
entry = ewl_widget_name_find("entry");
if (!strcmp(str, "None"))
- ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_NONE);
+ ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_NONE);
else if (!strcmp(str, "Shadow"))
- ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_SHADOW);
+ ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_SHADOW);
else if (!strcmp(str, "Soft Shadow"))
- ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_SOFT_SHADOW);
+ ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_SOFT_SHADOW);
else if (!strcmp(str, "Far Shadow"))
- ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_FAR_SHADOW);
+ ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_FAR_SHADOW);
else if (!strcmp(str, "Glow"))
- ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_GLOW);
+ ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_GLOW);
else if (!strcmp(str, "Outline"))
- ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_OUTLINE);
+ ete_style_apply(EWL_TEXT(entry), EWL_TEXT_STYLE_OUTLINE);
}
static void
ete_cb_strikethrough(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *entry;
@@ -317,7 +317,7 @@ ete_cb_strikethrough(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
ete_cb_underline(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *entry;
@@ -336,41 +336,41 @@ ete_align_apply(unsigned int align)
if (ewl_text_has_selection(t))
{
- Ewl_Text_Trigger *selection;
- unsigned int cursor_pos;
+ Ewl_Text_Trigger *selection;
+ unsigned int cursor_pos;
- cursor_pos = ewl_text_cursor_position_get(t);
+ cursor_pos = ewl_text_cursor_position_get(t);
- selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(t));
- ewl_text_cursor_position_set(t,
- ewl_text_trigger_start_pos_get(selection));
+ selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(t));
+ ewl_text_cursor_position_set(t,
+ ewl_text_trigger_start_pos_get(selection));
- ewl_text_align_apply(t, align,
- ewl_text_trigger_length_get(selection));
+ ewl_text_align_apply(t, align,
+ ewl_text_trigger_length_get(selection));
- ewl_text_cursor_position_set(t, cursor_pos);
+ ewl_text_cursor_position_set(t, cursor_pos);
}
else
- ewl_text_align_set(t, align);
+ ewl_text_align_set(t, align);
}
static void
ete_cb_justify_left(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ete_align_apply(EWL_FLAG_ALIGN_LEFT);
}
static void
ete_cb_justify_center(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ete_align_apply(EWL_FLAG_ALIGN_CENTER);
}
static void
ete_cb_justify_right(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ete_align_apply(EWL_FLAG_ALIGN_RIGHT);
}
@@ -386,91 +386,91 @@ ete_font_apply(char *font)
t = EWL_TEXT(w);
if (ewl_text_has_selection(EWL_TEXT(t)))
- of = ewl_text_font_get(EWL_TEXT(t),
- ewl_text_trigger_start_pos_get(
- EWL_TEXT_TRIGGER(ewl_text_selection_get(EWL_TEXT(t)))));
+ of = ewl_text_font_get(EWL_TEXT(t),
+ ewl_text_trigger_start_pos_get(
+ EWL_TEXT_TRIGGER(ewl_text_selection_get(EWL_TEXT(t)))));
else
- of = ewl_text_font_get(EWL_TEXT(t),
- ewl_text_cursor_position_get(EWL_TEXT(t)));
+ of = ewl_text_font_get(EWL_TEXT(t),
+ ewl_text_cursor_position_get(EWL_TEXT(t)));
if (!strcmp(of, "ewl/default/bold-italic"))
{
- if (!strcmp(font, "ewl/default/bold"))
- font = "ewl/default/italic";
- else if (!strcmp(font, "ewl/default/italic"))
- font = "ewl/default/bold";
+ if (!strcmp(font, "ewl/default/bold"))
+ font = "ewl/default/italic";
+ else if (!strcmp(font, "ewl/default/italic"))
+ font = "ewl/default/bold";
}
else if ((!strcmp(of, "ewl/default/italic") && !strcmp(font, "ewl/default/bold"))
- || ((!strcmp(of, "ewl/default/bold") && (!strcmp(font, "ewl/default/italic")))))
- font = "ewl/default/bold-italic";
+ || ((!strcmp(of, "ewl/default/bold") && (!strcmp(font, "ewl/default/italic")))))
+ font = "ewl/default/bold-italic";
else if (!strcmp(of, font))
- font = "ewl/default";
+ font = "ewl/default";
if (ewl_text_has_selection(t))
{
- Ewl_Text_Trigger *selection;
- unsigned int cursor_pos;
+ Ewl_Text_Trigger *selection;
+ unsigned int cursor_pos;
- cursor_pos = ewl_text_cursor_position_get(t);
+ cursor_pos = ewl_text_cursor_position_get(t);
- selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(t));
- ewl_text_cursor_position_set(t,
- ewl_text_trigger_start_pos_get(selection));
+ selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(t));
+ ewl_text_cursor_position_set(t,
+ ewl_text_trigger_start_pos_get(selection));
- ewl_text_font_apply(t, font,
- ewl_text_trigger_length_get(selection));
+ ewl_text_font_apply(t, font,
+ ewl_text_trigger_length_get(selection));
- ewl_text_cursor_position_set(t, cursor_pos);
+ ewl_text_cursor_position_set(t, cursor_pos);
}
else
- ewl_text_font_set(t, font);
+ ewl_text_font_set(t, font);
}
static void
ete_cb_bold(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ete_font_apply("ewl/default/bold");
}
static void
ete_cb_italic(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ete_font_apply("ewl/default/italic");
}
static void
ete_cb_font_size(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *entry;
entry = ewl_widget_name_find("entry");
if (ewl_text_has_selection(EWL_TEXT(entry)))
{
- unsigned int cursor_pos;
- Ewl_Text_Trigger *selection;
-
- cursor_pos = ewl_text_cursor_position_get(EWL_TEXT(entry));
- selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(
- EWL_TEXT(entry)));
- ewl_text_cursor_position_set(EWL_TEXT(entry),
- ewl_text_trigger_start_pos_get(selection));
- ewl_text_font_size_apply(EWL_TEXT(entry),
- ewl_range_value_get(EWL_RANGE(w)),
- ewl_text_trigger_length_get(selection));
- ewl_text_cursor_position_set(EWL_TEXT(entry), cursor_pos);
+ unsigned int cursor_pos;
+ Ewl_Text_Trigger *selection;
+
+ cursor_pos = ewl_text_cursor_position_get(EWL_TEXT(entry));
+ selection = EWL_TEXT_TRIGGER(ewl_text_selection_get(
+ EWL_TEXT(entry)));
+ ewl_text_cursor_position_set(EWL_TEXT(entry),
+ ewl_text_trigger_start_pos_get(selection));
+ ewl_text_font_size_apply(EWL_TEXT(entry),
+ ewl_range_value_get(EWL_RANGE(w)),
+ ewl_text_trigger_length_get(selection));
+ ewl_text_cursor_position_set(EWL_TEXT(entry), cursor_pos);
}
else
- ewl_text_font_size_set(EWL_TEXT(entry),
- ewl_range_value_get(EWL_RANGE(w)));
+ ewl_text_font_size_set(EWL_TEXT(entry),
+ ewl_range_value_get(EWL_RANGE(w)));
}
static void
ete_cb_fetch(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *entry;
char *txt;
@@ -479,14 +479,14 @@ ete_cb_fetch(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
txt = ewl_text_text_get(EWL_TEXT(entry));
if (txt) {
- printf("%s\n", txt);
- free(txt);
+ printf("%s\n", txt);
+ free(txt);
}
}
static void
ete_cb_set(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *entry;
@@ -496,14 +496,14 @@ ete_cb_set(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
ete_cb_load(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
printf("I do nothing yet ...\n");
}
static void
ete_cb_clear(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *entry, *scroll;
diff --git a/src/bin/tests/text_format/ewl_text_format_test.c b/src/bin/tests/text_format/ewl_text_format_test.c
index 493ced6..262379d 100644
--- a/src/bin/tests/text_format/ewl_text_format_test.c
+++ b/src/bin/tests/text_format/ewl_text_format_test.c
@@ -34,41 +34,41 @@ static int tf_apply_full_node_text(char *buf, int len);
static int tf_apply_partial_node_text(char *buf, int len);
static Ewl_Unit_Test text_fmt_unit_tests[] = {
- {"New Format", tf_new, NULL, -1, 0},
- {"New NULL Text", tf_new_null_text, NULL, -1, 1},
- {"Clear Format", tf_clear, NULL, -1, 0},
-
- {"Count empty", tf_count_empty, NULL, -1, 0},
- {"Count non-empty", tf_count_non_empty, NULL, -1, 0},
-
- {"Prepend to empty", tf_prepend_empty, NULL, -1, 0},
- {"Prepend to non-empty", tf_prepend_non_empty, NULL, -1, 0},
- {"Append to empty", tf_append_empty, NULL, -1, 0},
- {"Append to non-empty", tf_append_non_empty, NULL, -1, 0},
- {"Insert to empty", tf_insert_empty, NULL, -1, 0},
- {"Insert to non-empty", tf_insert_non_empty, NULL, -1, 0},
-
- {"Delete from empty list", tf_delete_empty, NULL, -1, 0},
- {"Delete from non-empty list", tf_delete_non_empty, NULL, -1, 0},
- {"Delete past end text", tf_delete_past_end, NULL, -1, 0},
- {"Delete all", tf_delete_all, NULL, -1, 0},
- {"Delete full node", tf_delete_full_node, NULL, -1, 0},
- {"Delete partial node", tf_delete_partial_node, NULL, -1, 0},
-
- /* gets */
- /* goto's */
-
- /* apply */
- {"Apply empty text", tf_apply_empty_text, NULL, -1, 0},
- {"Apply full text", tf_apply_full_text, NULL, -1, 0},
- {"Apply past end text", tf_apply_past_end_text, NULL, -1, 0},
- {"Apply full node text", tf_apply_full_node_text, NULL, -1, 0},
- {"Apply partial node text", tf_apply_partial_node_text, NULL, -1, 0},
-
- /* char_to_byte */
- /* byte_to_char */
-
- {NULL, NULL, NULL, -1, 0}
+ {"New Format", tf_new, NULL, -1, 0},
+ {"New NULL Text", tf_new_null_text, NULL, -1, 1},
+ {"Clear Format", tf_clear, NULL, -1, 0},
+
+ {"Count empty", tf_count_empty, NULL, -1, 0},
+ {"Count non-empty", tf_count_non_empty, NULL, -1, 0},
+
+ {"Prepend to empty", tf_prepend_empty, NULL, -1, 0},
+ {"Prepend to non-empty", tf_prepend_non_empty, NULL, -1, 0},
+ {"Append to empty", tf_append_empty, NULL, -1, 0},
+ {"Append to non-empty", tf_append_non_empty, NULL, -1, 0},
+ {"Insert to empty", tf_insert_empty, NULL, -1, 0},
+ {"Insert to non-empty", tf_insert_non_empty, NULL, -1, 0},
+
+ {"Delete from empty list", tf_delete_empty, NULL, -1, 0},
+ {"Delete from non-empty list", tf_delete_non_empty, NULL, -1, 0},
+ {"Delete past end text", tf_delete_past_end, NULL, -1, 0},
+ {"Delete all", tf_delete_all, NULL, -1, 0},
+ {"Delete full node", tf_delete_full_node, NULL, -1, 0},
+ {"Delete partial node", tf_delete_partial_node, NULL, -1, 0},
+
+ /* gets */
+ /* goto's */
+
+ /* apply */
+ {"Apply empty text", tf_apply_empty_text, NULL, -1, 0},
+ {"Apply full text", tf_apply_full_text, NULL, -1, 0},
+ {"Apply past end text", tf_apply_past_end_text, NULL, -1, 0},
+ {"Apply full node text", tf_apply_full_node_text, NULL, -1, 0},
+ {"Apply partial node text", tf_apply_partial_node_text, NULL, -1, 0},
+
+ /* char_to_byte */
+ /* byte_to_char */
+
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -91,8 +91,8 @@ tf_new(char *buf, int len)
fmt = ewl_text_fmt_new(EWL_TEXT(t));
if (!fmt)
{
- LOG_FAILURE(buf, len, "_new returned NULL.");
- return 0;
+ LOG_FAILURE(buf, len, "_new returned NULL.");
+ return 0;
}
ewl_widget_destroy(t);
ewl_text_fmt_destroy(fmt);
@@ -107,9 +107,9 @@ tf_new_null_text(char *buf, int len)
fmt = ewl_text_fmt_new(NULL);
if (fmt)
{
- LOG_FAILURE(buf, len, "_new returned fmt when Ewl_Text was NULL.");
- ewl_text_fmt_destroy(fmt);
- return 0;
+ LOG_FAILURE(buf, len, "_new returned fmt when Ewl_Text was NULL.");
+ ewl_text_fmt_destroy(fmt);
+ return 0;
}
return 1;
}
@@ -131,20 +131,20 @@ tf_clear(char *buf, int len)
ewl_text_fmt_clear(fmt);
if (ecore_dlist_count(fmt->nodes) != 0)
{
- LOG_FAILURE(buf, len, "_clear left items in -> nodes.");
- return 0;
+ LOG_FAILURE(buf, len, "_clear left items in -> nodes.");
+ return 0;
}
if ((fmt->current_node.char_idx != 0)
- || (fmt->current_node.byte_idx != 0))
+ || (fmt->current_node.byte_idx != 0))
{
- LOG_FAILURE(buf, len, "_clear didn't reset current_node values.");
- return 0;
+ LOG_FAILURE(buf, len, "_clear didn't reset current_node values.");
+ return 0;
}
if ((fmt->length.char_len != 0)
- || (fmt->length.byte_len != 0))
+ || (fmt->length.byte_len != 0))
{
- LOG_FAILURE(buf, len, "_clear didn't reset length values.");
- return 0;
+ LOG_FAILURE(buf, len, "_clear didn't reset length values.");
+ return 0;
}
ewl_text_fmt_destroy(fmt);
@@ -164,8 +164,8 @@ tf_count_empty(char *buf, int len)
if (ewl_text_fmt_node_count_get(fmt) != 0)
{
- LOG_FAILURE(buf, len, "_count returned non-zero on blank list.");
- return 0;
+ LOG_FAILURE(buf, len, "_count returned non-zero on blank list.");
+ return 0;
}
return 1;
}
diff --git a/src/bin/tests/theme/ewl_theme_test.c b/src/bin/tests/theme/ewl_theme_test.c
index aade1e7..1317d1d 100644
--- a/src/bin/tests/theme/ewl_theme_test.c
+++ b/src/bin/tests/theme/ewl_theme_test.c
@@ -36,7 +36,7 @@ test_info(Ewl_Test *test)
{
test->name = "Theme";
test->tip = "Shows the utilization of themes\n"
- "inside a EWL application.";
+ "inside a EWL application.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_ADVANCED;
@@ -70,24 +70,24 @@ create_test(Ewl_Container *box)
rep = opendir(PACKAGE_DATA_DIR "/ewl/themes");
while ((file = readdir(rep)))
{
- char *name;
- int len;
-
- name = file->d_name;
- len = strlen(name);
-
- if ((len >= 4) && (!strcmp(name + len - 4, ".edj"))) {
- Ewl_Widget *w;
-
- w = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(w), name);
- ewl_object_fill_policy_set(EWL_OBJECT(w),
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
- ewl_callback_append(w, EWL_CALLBACK_CLICKED,
- cb_select_theme, strdup(name));
- ewl_container_child_append(EWL_CONTAINER(list), w);
- ewl_widget_show(w);
- }
+ char *name;
+ int len;
+
+ name = file->d_name;
+ len = strlen(name);
+
+ if ((len >= 4) && (!strcmp(name + len - 4, ".edj"))) {
+ Ewl_Widget *w;
+
+ w = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(w), name);
+ ewl_object_fill_policy_set(EWL_OBJECT(w),
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
+ ewl_callback_append(w, EWL_CALLBACK_CLICKED,
+ cb_select_theme, strdup(name));
+ ewl_container_child_append(EWL_CONTAINER(list), w);
+ ewl_widget_show(w);
+ }
}
list = ewl_hbox_new();
@@ -130,7 +130,7 @@ cb_select_theme(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data)
notebook = ewl_widget_name_find("notebook");
snprintf(theme_filename, sizeof(theme_filename),
- PACKAGE_DATA_DIR "/ewl/themes/%s", (char *)data);
+ PACKAGE_DATA_DIR "/ewl/themes/%s", (char *)data);
ewl_theme_data_reset(notebook);
ewl_theme_data_str_set(notebook, "/file", theme_filename);
@@ -152,7 +152,7 @@ cb_apply_theme(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data)
static void
cb_default_theme(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *db = w;
@@ -166,12 +166,12 @@ widgets_build(void)
Ewl_Widget *misc, *item, *vbox, *notebook;
int i;
struct {
- char *name;
- char *image;
+ char *name;
+ char *image;
} menus[] = {
- {"image", "dia-diagram.png"},
- {NULL, NULL},
- {"label", NULL}
+ {"image", "dia-diagram.png"},
+ {NULL, NULL},
+ {"label", NULL}
};
notebook = ewl_notebook_new();
@@ -213,7 +213,7 @@ widgets_build(void)
vbox = ewl_vbox_new();
ewl_container_child_append(EWL_CONTAINER(notebook), vbox);
ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(notebook), vbox,
- "Numerical & Text Entries");
+ "Numerical & Text Entries");
ewl_widget_show(vbox);
misc = ewl_entry_new();
@@ -271,17 +271,17 @@ widgets_build(void)
for (i = 0; i < 3; i++)
{
- item = ewl_menu_item_new();
- if (menus[i].name)
- ewl_button_label_set(EWL_BUTTON(item),
- menus[i].name);
+ item = ewl_menu_item_new();
+ if (menus[i].name)
+ ewl_button_label_set(EWL_BUTTON(item),
+ menus[i].name);
- if (menus[i].image)
- ewl_button_image_set(EWL_BUTTON(item),
- menus[i].image, NULL);
+ if (menus[i].image)
+ ewl_button_image_set(EWL_BUTTON(item),
+ menus[i].image, NULL);
- ewl_container_child_append(EWL_CONTAINER(misc), item);
- ewl_widget_show(item);
+ ewl_container_child_append(EWL_CONTAINER(misc), item);
+ ewl_widget_show(item);
}
misc = ewl_hseparator_new();
@@ -295,24 +295,24 @@ XXX Port this to use the model/view system
for (i = 0; i < 3; i++)
{
- item = ewl_menu_item_new();
- if (menus[i].name)
- ewl_button_label_set(EWL_BUTTON(item),
- menus[i].name);
+ item = ewl_menu_item_new();
+ if (menus[i].name)
+ ewl_button_label_set(EWL_BUTTON(item),
+ menus[i].name);
- if (menus[i].image)
- ewl_button_image_set(EWL_BUTTON(item),
- menus[i].image, NULL);
+ if (menus[i].image)
+ ewl_button_image_set(EWL_BUTTON(item),
+ menus[i].image, NULL);
- ewl_container_child_append(EWL_CONTAINER(misc), item);
- ewl_widget_show(item);
+ ewl_container_child_append(EWL_CONTAINER(misc), item);
+ ewl_widget_show(item);
}
/* List/tree */
vbox = ewl_vbox_new();
ewl_container_child_append(EWL_CONTAINER(notebook), vbox);
ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(notebook), vbox,
- "List and Tree");
+ "List and Tree");
ewl_widget_show(vbox);
str = "List";
diff --git a/src/bin/tests/toolbar/ewl_toolbar_test.c b/src/bin/tests/toolbar/ewl_toolbar_test.c
index 8f9a338..26ba004 100644
--- a/src/bin/tests/toolbar/ewl_toolbar_test.c
+++ b/src/bin/tests/toolbar/ewl_toolbar_test.c
@@ -34,7 +34,7 @@ create_test(Ewl_Container *box)
ewl_container_child_append(EWL_CONTAINER(body), o2);
ewl_object_alignment_set(EWL_OBJECT(o2), EWL_FLAG_ALIGN_CENTER);
ewl_object_fill_policy_set(EWL_OBJECT(o2),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_toolbar_icon_part_hide(EWL_TOOLBAR(o2), EWL_ICON_PART_LABEL);
ewl_widget_show(o2);
diff --git a/src/bin/tests/tooltip/ewl_tooltip_test.c b/src/bin/tests/tooltip/ewl_tooltip_test.c
index c6009bf..80ceec2 100644
--- a/src/bin/tests/tooltip/ewl_tooltip_test.c
+++ b/src/bin/tests/tooltip/ewl_tooltip_test.c
@@ -12,7 +12,7 @@ test_info(Ewl_Test *test)
{
test->name = "Tooltip";
test->tip = "Defines a widget for displaying short\n"
- "messages after a delay.";
+ "messages after a delay.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_SIMPLE;
diff --git a/src/bin/tests/tree/ewl_tree_test.c b/src/bin/tests/tree/ewl_tree_test.c
index 25fc7c5..86a2910 100644
--- a/src/bin/tests/tree/ewl_tree_test.c
+++ b/src/bin/tests/tree/ewl_tree_test.c
@@ -37,14 +37,14 @@ struct Tree_Test_Data
static int create_test(Ewl_Container *win);
static void *tree_test_data_setup(void);
static Ewl_Widget *tree_test_cb_widget_fetch(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
static void *tree_test_cb_header_data_fetch(void *data, unsigned int column);
static Ewl_Widget *tree_test_cb_header_fetch(void *data, unsigned int column);
static void *tree_test_data_fetch(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
static int tree_test_column_sortable(void *data, unsigned int column);
static void tree_test_data_sort(void *data, unsigned int column,
- Ewl_Sort_Direction sort);
+ Ewl_Sort_Direction sort);
static unsigned int tree_test_data_count_get(void *data);
static int tree_test_data_expandable_get(void *data, unsigned int row);
static void *tree_test_data_expansion_fetch(void *data, unsigned int row);
@@ -61,7 +61,7 @@ test_info(Ewl_Test *test)
{
test->name = "Tree";
test->tip = "Defines a widget for laying out other\n"
- "widgets in a tree or list like manner.";
+ "widgets in a tree or list like manner.";
test->filename = __FILE__;
test->func = create_test;
test->type = EWL_TEST_TYPE_CONTAINER;
@@ -78,7 +78,7 @@ create_test(Ewl_Container *box)
o2 = ewl_hbox_new();
ewl_container_child_append(box, o2);
ewl_object_fill_policy_set(EWL_OBJECT(o2),
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
ewl_widget_show(o2);
/* create our data */
@@ -89,13 +89,13 @@ create_test(Ewl_Container *box)
model = ewl_model_new();
ewl_model_data_fetch_set(model, tree_test_data_fetch);
ewl_model_data_header_fetch_set(model,
- tree_test_cb_header_data_fetch);
+ tree_test_cb_header_data_fetch);
ewl_model_data_sort_set(model, tree_test_data_sort);
ewl_model_column_sortable_set(model, tree_test_column_sortable);
ewl_model_data_count_set(model, tree_test_data_count_get);
ewl_model_data_expandable_set(model, tree_test_data_expandable_get);
ewl_model_expansion_data_fetch_set(model,
- tree_test_data_expansion_fetch);
+ tree_test_data_expansion_fetch);
view = ewl_view_new();
ewl_view_widget_fetch_set(view, tree_test_cb_widget_fetch);
@@ -105,7 +105,7 @@ create_test(Ewl_Container *box)
ewl_container_child_append(EWL_CONTAINER(box), tree);
ewl_object_fill_policy_set(EWL_OBJECT(tree), EWL_FLAG_FILL_ALL);
ewl_callback_append(tree, EWL_CALLBACK_VALUE_CHANGED,
- tree_cb_value_changed, NULL);
+ tree_cb_value_changed, NULL);
ewl_mvc_data_set(EWL_MVC(tree), data);
ewl_mvc_model_set(EWL_MVC(tree), model);
ewl_mvc_view_set(EWL_MVC(tree), view);
@@ -125,7 +125,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o), "Scroll headers");
ewl_container_child_append(EWL_CONTAINER(o3), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_tree_cb_scroll_headers, tree);
+ ewl_tree_cb_scroll_headers, tree);
ewl_widget_show(o);
o = ewl_checkbutton_new();
@@ -133,7 +133,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o), "Hide headers");
ewl_container_child_append(EWL_CONTAINER(o3), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_tree_cb_hide_headers, tree);
+ ewl_tree_cb_hide_headers, tree);
ewl_widget_show(o);
o = ewl_checkbutton_new();
@@ -141,7 +141,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o), "Plain view");
ewl_container_child_append(EWL_CONTAINER(o2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_tree_cb_plain_view, tree);
+ ewl_tree_cb_plain_view, tree);
ewl_widget_show(o);
o = ewl_spinner_new();
@@ -160,7 +160,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o), "Set number of rows");
ewl_container_child_append(EWL_CONTAINER(o2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_tree_cb_set_rows_clicked, NULL);
+ ewl_tree_cb_set_rows_clicked, NULL);
ewl_widget_show(o);
o = ewl_button_new();
@@ -168,7 +168,7 @@ create_test(Ewl_Container *box)
ewl_button_label_set(EWL_BUTTON(o), "Row select");
ewl_container_child_append(EWL_CONTAINER(o2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- tree_cb_select_mode_change, NULL);
+ tree_cb_select_mode_change, NULL);
ewl_widget_show(o);
return 1;
@@ -248,29 +248,29 @@ tree_test_data_setup(void)
static Ewl_Widget *
tree_test_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int column)
+ unsigned int column)
{
Ewl_Widget *w = NULL;
switch (column) {
- case 0:
- w = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(w), data);
- break;
- case 1:
- w = ewl_image_new();
- ewl_image_file_path_set(EWL_IMAGE(w), data);
- break;
- case 2:
- {
- Tree_Test_Row_Data *d;
- d = data;
-
- w = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(w), d->text);
- ewl_button_image_set(EWL_BUTTON(w), d->image, NULL);
- }
- break;
+ case 0:
+ w = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(w), data);
+ break;
+ case 1:
+ w = ewl_image_new();
+ ewl_image_file_path_set(EWL_IMAGE(w), data);
+ break;
+ case 2:
+ {
+ Tree_Test_Row_Data *d;
+ d = data;
+
+ w = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(w), d->text);
+ ewl_button_image_set(EWL_BUTTON(w), d->image, NULL);
+ }
+ break;
}
ewl_widget_show(w);
@@ -281,10 +281,10 @@ static void *
tree_test_cb_header_data_fetch(void *data __UNUSED__, unsigned int column)
{
if (column == 0)
- return "Title";
+ return "Title";
if (column == 1)
- return "Image";
+ return "Image";
return "Button";
}
@@ -313,25 +313,25 @@ tree_test_data_fetch(void *data, unsigned int row, unsigned int column)
* normal app */
if (row >= d->row_count)
{
- printf("Asking for too many rows %d (count == %d)\n",
- row, d->row_count);
- return NULL;
+ printf("Asking for too many rows %d (count == %d)\n",
+ row, d->row_count);
+ return NULL;
}
if (column == 0)
- val = d->rows[row % d->count]->text;
+ val = d->rows[row % d->count]->text;
else if (column == 1)
- val = d->rows[row % d->count]->image;
+ val = d->rows[row % d->count]->image;
else if (column == 2)
- val = d->rows[row % d->count];
+ val = d->rows[row % d->count];
else
{
- /* NOTE: this is just for testing purposes, should not be
- * needed in a normal app */
- printf("Unknown column %d\n", column);
+ /* NOTE: this is just for testing purposes, should not be
+ * needed in a normal app */
+ printf("Unknown column %d\n", column);
}
return val;
@@ -345,45 +345,45 @@ tree_test_data_sort(void *data, unsigned int column, Ewl_Sort_Direction sort)
/* just leave it if we're in sort none. */
if (sort == EWL_SORT_DIRECTION_NONE)
- return;
+ return;
d = data;
for (i = (d->count - 1); i >= 0; i--)
{
- int j;
-
- for (j = 1; j <= i; j++)
- {
- char *a, *b;
-
- if (column == 0)
- {
- a = d->rows[j - 1]->text;
- b = d->rows[j]->text;
- }
- else
- {
- a = d->rows[j - 1]->image;
- b = d->rows[j]->image;
- }
-
- if (((sort == EWL_SORT_DIRECTION_ASCENDING)
- && strcmp(a, b) > 0)
- || ((sort == EWL_SORT_DIRECTION_DESCENDING)
- && strcmp(a, b) < 0))
- {
- char *temp;
-
- temp = d->rows[j - 1]->text;
- d->rows[j - 1]->text = d->rows[j]->text;
- d->rows[j]->text = temp;
-
- temp = d->rows[j - 1]->image;
- d->rows[j - 1]->image = d->rows[j]->image;
- d->rows[j]->image = temp;
- }
- }
+ int j;
+
+ for (j = 1; j <= i; j++)
+ {
+ char *a, *b;
+
+ if (column == 0)
+ {
+ a = d->rows[j - 1]->text;
+ b = d->rows[j]->text;
+ }
+ else
+ {
+ a = d->rows[j - 1]->image;
+ b = d->rows[j]->image;
+ }
+
+ if (((sort == EWL_SORT_DIRECTION_ASCENDING)
+ && strcmp(a, b) > 0)
+ || ((sort == EWL_SORT_DIRECTION_DESCENDING)
+ && strcmp(a, b) < 0))
+ {
+ char *temp;
+
+ temp = d->rows[j - 1]->text;
+ d->rows[j - 1]->text = d->rows[j]->text;
+ d->rows[j]->text = temp;
+
+ temp = d->rows[j - 1]->image;
+ d->rows[j - 1]->image = d->rows[j]->image;
+ d->rows[j]->image = temp;
+ }
+ }
}
}
@@ -412,7 +412,7 @@ tree_test_data_expandable_get(void *data, unsigned int row)
d = data;
if (d && d->rows[row % d->count])
- ret = d->rows[row % d->count]->expandable;
+ ret = d->rows[row % d->count]->expandable;
return ret;
}
@@ -438,8 +438,8 @@ ewl_tree_cb_scroll_headers(Ewl_Widget *w, void *ev __UNUSED__, void *data)
view = ewl_tree_content_widget_get(tree);
if (EWL_TREE_VIEW_SCROLLED_IS(view))
- ewl_tree_view_scrolled_scroll_headers_set(EWL_TREE_VIEW(view),
- ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w)));
+ ewl_tree_view_scrolled_scroll_headers_set(EWL_TREE_VIEW(view),
+ ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w)));
}
static void
@@ -451,7 +451,7 @@ ewl_tree_cb_hide_headers(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *da
tree = data;
if (ewl_tree_headers_visible_get(tree))
- vis = FALSE;
+ vis = FALSE;
ewl_tree_headers_visible_set(tree, vis);
}
@@ -464,16 +464,16 @@ ewl_tree_cb_plain_view(Ewl_Widget *w, void *ev __UNUSED__, void *data)
tree = data;
if (ewl_checkbutton_is_checked(EWL_CHECKBUTTON(w)))
- view = ewl_tree_view_plain_get();
+ view = ewl_tree_view_plain_get();
else
- view = ewl_tree_view_scrolled_get();
+ view = ewl_tree_view_scrolled_get();
ewl_tree_content_view_set(EWL_TREE(tree), view);
}
static void
ewl_tree_cb_set_rows_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *spinner, *tree;
Tree_Test_Data *d;
@@ -489,7 +489,7 @@ ewl_tree_cb_set_rows_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
tree_cb_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ecore_List *selected;
Ewl_Selection *sel;
@@ -499,73 +499,73 @@ tree_cb_value_changed(Ewl_Widget *w, void *ev __UNUSED__,
ecore_list_first_goto(selected);
while ((sel = ecore_list_next(selected)))
{
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- char *val;
- unsigned int col;
- Ewl_Selection_Idx *idx;
-
- idx = EWL_SELECTION_IDX(sel);
- col = idx->column;
- if (col != 2)
- val = sel->model->fetch(sel->data, idx->row, col);
- else
- {
- Tree_Test_Row_Data *d;
- d = sel->model->fetch(sel->data, idx->row, col);
- val = d->text;
- }
-
- printf(" [%d,%d] %s\n", idx->row, idx->column, val);
- }
- else
- {
- Ewl_Selection_Range *idx;
- unsigned int i, k;
-
- idx = EWL_SELECTION_RANGE(sel);
- for (i = idx->start.row; i <= idx->end.row; i++)
- {
- for (k = idx->start.column; k <=
- idx->end.column; k++)
- {
- char *val;
-
- if (k != 3)
- val = sel->model->fetch(sel->data,
- i, k);
- else
- {
- Tree_Test_Row_Data *d;
- d = sel->model->fetch(sel->data,
- i, k);
- val = d->text;
- }
- printf(" [%d,%d] %s\n", i, k, val);
- }
- }
- }
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ char *val;
+ unsigned int col;
+ Ewl_Selection_Idx *idx;
+
+ idx = EWL_SELECTION_IDX(sel);
+ col = idx->column;
+ if (col != 2)
+ val = sel->model->fetch(sel->data, idx->row, col);
+ else
+ {
+ Tree_Test_Row_Data *d;
+ d = sel->model->fetch(sel->data, idx->row, col);
+ val = d->text;
+ }
+
+ printf(" [%d,%d] %s\n", idx->row, idx->column, val);
+ }
+ else
+ {
+ Ewl_Selection_Range *idx;
+ unsigned int i, k;
+
+ idx = EWL_SELECTION_RANGE(sel);
+ for (i = idx->start.row; i <= idx->end.row; i++)
+ {
+ for (k = idx->start.column; k <=
+ idx->end.column; k++)
+ {
+ char *val;
+
+ if (k != 3)
+ val = sel->model->fetch(sel->data,
+ i, k);
+ else
+ {
+ Tree_Test_Row_Data *d;
+ d = sel->model->fetch(sel->data,
+ i, k);
+ val = d->text;
+ }
+ printf(" [%d,%d] %s\n", i, k, val);
+ }
+ }
+ }
}
}
static void
tree_cb_select_mode_change(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *tree;
tree = ewl_widget_name_find("tree");
if (!strcmp(ewl_button_label_get(EWL_BUTTON(w)), "Row select"))
{
- ewl_button_label_set(EWL_BUTTON(w), "Cell select");
- ewl_tree_selection_type_set(EWL_TREE(tree),
- EWL_TREE_SELECTION_TYPE_ROW);
+ ewl_button_label_set(EWL_BUTTON(w), "Cell select");
+ ewl_tree_selection_type_set(EWL_TREE(tree),
+ EWL_TREE_SELECTION_TYPE_ROW);
}
else
{
- ewl_button_label_set(EWL_BUTTON(w), "Row select");
- ewl_tree_selection_type_set(EWL_TREE(tree),
- EWL_TREE_SELECTION_TYPE_CELL);
+ ewl_button_label_set(EWL_BUTTON(w), "Row select");
+ ewl_tree_selection_type_set(EWL_TREE(tree),
+ EWL_TREE_SELECTION_TYPE_CELL);
}
}
diff --git a/src/bin/tests/widget/ewl_widget_test.c b/src/bin/tests/widget/ewl_widget_test.c
index 14e1a2d..b975bbc 100644
--- a/src/bin/tests/widget/ewl_widget_test.c
+++ b/src/bin/tests/widget/ewl_widget_test.c
@@ -52,41 +52,41 @@ static int focusable_test_set_get(char *buf, int len);
static int focus_test_send_get(char *buf, int len);
static Ewl_Unit_Test widget_unit_tests[] = {
- {"EWL_WIDGET_IS", widget_is_test, NULL, -1, 0},
- {"Widget name set/get", name_test_set_get, NULL, -1, 0},
- {"Widget NULL name set/get", name_test_nul_set_get, NULL, -1, 0},
- {"Widget name find", name_find_test, NULL, -1, 0},
- {"Widget missing name find", name_find_missing_test, NULL, -1, 0},
- {"Widget find NULL", name_find_null_test, NULL, -1, 1},
- {"Widget type is test", widget_type_is_test, NULL, -1, 0},
- {"Widget type is without type test", widget_type_is_non_type_test, NULL, -1, 0},
- {"Widget enable", widget_enable_test, NULL, -1, 0},
- {"Widget disable", widget_disable_test, NULL, -1, 0},
- {"Widget colour set/get", widget_colour_test_set_get, NULL, -1, 0},
- {"Widget colour get NULL", widget_colour_test_get_null, NULL, -1, 0},
- {"widget appearance set/get", appearance_test_set_get, NULL, -1, 0},
- {"widget appearance path set/get", appearance_path_test_set_get, NULL, -1, 0},
- {"widget inheritance set/get", inheritance_test_set_get, NULL, -1, 0},
- {"widget internal set/get", internal_test_set_get, NULL, -1, 0},
- {"widget clipped set/get", clipped_test_set_get, NULL, -1, 0},
- {"widget data set/get", data_test_set_get, NULL, -1, 0},
- {"widget data set/remove", data_test_set_remove, NULL, -1, 0},
- {"widget_new", widget_new, NULL, -1, 0},
- {"widget_init state", init, NULL, -1, 0},
- {"widget_show state", show, NULL, -1, 0},
- {"widget_realize state", realize, NULL, -1, 0},
- {"widget realize unrealize state", realize_unrealize, NULL, -1, 0},
- {"widget_parent_set state", parent_set, NULL, -1, 0},
- {"widget parent set while shown state", parent_set_show, NULL, -1, 0},
- {"widget Reparent unrealized state", reparent_unrealized, NULL, -1, 0},
- {"widget reparent realized state", reparent_realized, NULL, -1, 0},
- {"widget realize then reveal state", realize_reveal, NULL, -1, 0},
- {"widget realize reveal obscure state", realize_reveal_obscure, NULL, -1, 0},
- {"widget realize reveal unrealize state", realize_reveal_unrealize, NULL, -1, 0},
- {"widget show realize unrealize state", show_realize_unrealize, NULL, -1, 0},
- {"widget focusable set/get", focusable_test_set_get, NULL, -1, 0},
- {"widget focus send/get", focus_test_send_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"EWL_WIDGET_IS", widget_is_test, NULL, -1, 0},
+ {"Widget name set/get", name_test_set_get, NULL, -1, 0},
+ {"Widget NULL name set/get", name_test_nul_set_get, NULL, -1, 0},
+ {"Widget name find", name_find_test, NULL, -1, 0},
+ {"Widget missing name find", name_find_missing_test, NULL, -1, 0},
+ {"Widget find NULL", name_find_null_test, NULL, -1, 1},
+ {"Widget type is test", widget_type_is_test, NULL, -1, 0},
+ {"Widget type is without type test", widget_type_is_non_type_test, NULL, -1, 0},
+ {"Widget enable", widget_enable_test, NULL, -1, 0},
+ {"Widget disable", widget_disable_test, NULL, -1, 0},
+ {"Widget colour set/get", widget_colour_test_set_get, NULL, -1, 0},
+ {"Widget colour get NULL", widget_colour_test_get_null, NULL, -1, 0},
+ {"widget appearance set/get", appearance_test_set_get, NULL, -1, 0},
+ {"widget appearance path set/get", appearance_path_test_set_get, NULL, -1, 0},
+ {"widget inheritance set/get", inheritance_test_set_get, NULL, -1, 0},
+ {"widget internal set/get", internal_test_set_get, NULL, -1, 0},
+ {"widget clipped set/get", clipped_test_set_get, NULL, -1, 0},
+ {"widget data set/get", data_test_set_get, NULL, -1, 0},
+ {"widget data set/remove", data_test_set_remove, NULL, -1, 0},
+ {"widget_new", widget_new, NULL, -1, 0},
+ {"widget_init state", init, NULL, -1, 0},
+ {"widget_show state", show, NULL, -1, 0},
+ {"widget_realize state", realize, NULL, -1, 0},
+ {"widget realize unrealize state", realize_unrealize, NULL, -1, 0},
+ {"widget_parent_set state", parent_set, NULL, -1, 0},
+ {"widget parent set while shown state", parent_set_show, NULL, -1, 0},
+ {"widget Reparent unrealized state", reparent_unrealized, NULL, -1, 0},
+ {"widget reparent realized state", reparent_realized, NULL, -1, 0},
+ {"widget realize then reveal state", realize_reveal, NULL, -1, 0},
+ {"widget realize reveal obscure state", realize_reveal_obscure, NULL, -1, 0},
+ {"widget realize reveal unrealize state", realize_reveal_unrealize, NULL, -1, 0},
+ {"widget show realize unrealize state", show_realize_unrealize, NULL, -1, 0},
+ {"widget focusable set/get", focusable_test_set_get, NULL, -1, 0},
+ {"widget focus send/get", focus_test_send_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -145,7 +145,7 @@ create_test(Ewl_Container *box)
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "Change fullscreen setting");
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_widget_cb_toggle_fullscreen, NULL);
+ ewl_widget_cb_toggle_fullscreen, NULL);
ewl_container_child_append(EWL_CONTAINER(b2), o);
ewl_widget_show(o);
@@ -154,7 +154,7 @@ create_test(Ewl_Container *box)
static void
ewl_widget_cb_toggle(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *o, *o2;
@@ -163,39 +163,39 @@ ewl_widget_cb_toggle(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
if (DISABLED(o))
{
- ewl_widget_enable(o);
- ewl_widget_disable(o2);
+ ewl_widget_enable(o);
+ ewl_widget_disable(o2);
}
else
{
- ewl_widget_disable(o);
- ewl_widget_enable(o2);
+ ewl_widget_disable(o);
+ ewl_widget_enable(o2);
}
}
static void
ewl_widget_cb_first_click(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
printf("First clicked\n");
}
static void
ewl_widget_cb_second_click(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
printf("Second clicked\n");
}
static void
ewl_widget_cb_toggle_fullscreen(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Embed *win;
win = ewl_embed_widget_find(w);
ewl_window_fullscreen_set(EWL_WINDOW(win),
- !ewl_window_fullscreen_get(EWL_WINDOW(win)));
+ !ewl_window_fullscreen_get(EWL_WINDOW(win)));
}
/*
@@ -212,9 +212,9 @@ appearance_test_set_get(char *buf, int len)
ewl_widget_appearance_set(w, "my_appearance");
if (strcmp("my_appearance", ewl_widget_appearance_get(w)))
- LOG_FAILURE(buf, len, "appearance_get doesn't match appearance_set");
+ LOG_FAILURE(buf, len, "appearance_get doesn't match appearance_set");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -238,9 +238,9 @@ appearance_path_test_set_get(char *buf, int len)
ewl_widget_appearance_set(w, "my_appearance");
if (strcmp("/vbox/my_appearance", ewl_widget_appearance_path_get(w)))
- LOG_FAILURE(buf, len, "appearance_path_get doesn't match");
+ LOG_FAILURE(buf, len, "appearance_path_get doesn't match");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -262,13 +262,13 @@ inheritance_test_set_get(char *buf, int len)
ewl_widget_inherit(w, my_class);
if (!ewl_widget_type_is(w, my_class))
- LOG_FAILURE(buf, len, "inheritance doesn't contain correct type");
+ LOG_FAILURE(buf, len, "inheritance doesn't contain correct type");
else {
- if (ewl_widget_type_is(w, unknown_class))
- LOG_FAILURE(buf, len,
- "inheritance contains incorrect type");
- else
- ret = 1;
+ if (ewl_widget_type_is(w, unknown_class))
+ LOG_FAILURE(buf, len,
+ "inheritance contains incorrect type");
+ else
+ ret = 1;
}
return ret;
@@ -288,19 +288,19 @@ internal_test_set_get(char *buf, int len)
ewl_widget_init(w);
if (!ewl_widget_internal_is(w)) {
- ewl_widget_internal_set(w, TRUE);
- if (ewl_widget_internal_is(w)) {
- ewl_widget_internal_set(w, FALSE);
- if (ewl_widget_internal_is(w))
- LOG_FAILURE(buf, len, "internal flag not FALSE");
- else
- ret = 1;
- }
- else
- LOG_FAILURE(buf, len, "internal flag not TRUE");
+ ewl_widget_internal_set(w, TRUE);
+ if (ewl_widget_internal_is(w)) {
+ ewl_widget_internal_set(w, FALSE);
+ if (ewl_widget_internal_is(w))
+ LOG_FAILURE(buf, len, "internal flag not FALSE");
+ else
+ ret = 1;
+ }
+ else
+ LOG_FAILURE(buf, len, "internal flag not TRUE");
}
else
- LOG_FAILURE(buf, len, "internal set after widget_init");
+ LOG_FAILURE(buf, len, "internal set after widget_init");
return ret;
}
@@ -319,19 +319,19 @@ clipped_test_set_get(char *buf, int len)
ewl_widget_init(w);
if (ewl_widget_clipped_is(w)) {
- ewl_widget_clipped_set(w, FALSE);
- if (!ewl_widget_clipped_is(w)) {
- ewl_widget_clipped_set(w, TRUE);
- if (!ewl_widget_clipped_is(w))
- LOG_FAILURE(buf, len, "clipped flag not TRUE");
- else
- ret = 1;
- }
- else
- LOG_FAILURE(buf, len, "clipped flag not FALSE");
+ ewl_widget_clipped_set(w, FALSE);
+ if (!ewl_widget_clipped_is(w)) {
+ ewl_widget_clipped_set(w, TRUE);
+ if (!ewl_widget_clipped_is(w))
+ LOG_FAILURE(buf, len, "clipped flag not TRUE");
+ else
+ ret = 1;
+ }
+ else
+ LOG_FAILURE(buf, len, "clipped flag not FALSE");
}
else
- LOG_FAILURE(buf, len, "clipped not set after widget_init");
+ LOG_FAILURE(buf, len, "clipped not set after widget_init");
return ret;
}
@@ -357,11 +357,11 @@ data_test_set_get(char *buf, int len)
found = ewl_widget_data_get(w, key);
if (!found)
- LOG_FAILURE(buf, len, "could not find set data");
+ LOG_FAILURE(buf, len, "could not find set data");
else if (found != value)
- LOG_FAILURE(buf, len, "found value does not match set data");
+ LOG_FAILURE(buf, len, "found value does not match set data");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -386,13 +386,13 @@ data_test_set_remove(char *buf, int len)
found = ewl_widget_data_del(w, key);
if (!found)
- LOG_FAILURE(buf, len, "could not find set data");
+ LOG_FAILURE(buf, len, "could not find set data");
else if (found != value)
- LOG_FAILURE(buf, len, "removed value does not match set data");
+ LOG_FAILURE(buf, len, "removed value does not match set data");
else if (ewl_widget_data_get(w, key))
- LOG_FAILURE(buf, len, "data value present after remove");
+ LOG_FAILURE(buf, len, "data value present after remove");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -408,11 +408,11 @@ widget_new(char *buf, int len)
w = ewl_widget_new();
if (!w)
- LOG_FAILURE(buf, len, "Failed to create widget");
+ LOG_FAILURE(buf, len, "Failed to create widget");
else
{
- ewl_widget_destroy(w);
- ret = 1;
+ ewl_widget_destroy(w);
+ ret = 1;
}
return ret;
@@ -430,13 +430,13 @@ init(char *buf, int len)
w = ewl_widget_new();
if (VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget VISIBLE after _init");
+ LOG_FAILURE(buf, len, "Widget VISIBLE after _init");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after _init");
+ LOG_FAILURE(buf, len, "Widget REALIZED after _init");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after _init");
+ LOG_FAILURE(buf, len, "Widget REVEALED after _init");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
@@ -456,13 +456,13 @@ show(char *buf, int len)
ewl_widget_show(w);
if (!VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget !VISIBLE after show");
+ LOG_FAILURE(buf, len, "Widget !VISIBLE after show");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after show");
+ LOG_FAILURE(buf, len, "Widget REALIZED after show");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after show");
+ LOG_FAILURE(buf, len, "Widget REVEALED after show");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -480,39 +480,39 @@ realize(char *buf, int len)
w = ewl_widget_new();
ewl_widget_realize(w);
if (VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget VISIBLE after realize");
+ LOG_FAILURE(buf, len, "Widget VISIBLE after realize");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED without window");
+ LOG_FAILURE(buf, len, "Widget REALIZED without window");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after realize");
+ LOG_FAILURE(buf, len, "Widget REVEALED after realize");
else
{
- Ewl_Widget *win;
-
- /*
- * Create a window and add the child to allow the realize to
- * succeed. This will be using the buffer engine.
- */
- win = ewl_window_new();
- ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
-
- ewl_container_child_append(EWL_CONTAINER(win), w);
- ewl_widget_realize(w);
-
- if (VISIBLE(win))
- LOG_FAILURE(buf, len, "Window VISIBLE after realize");
- else if (!REALIZED(win))
- LOG_FAILURE(buf, len, "Window !REALIZED after realize");
- else if (!REALIZED(w))
- LOG_FAILURE(buf, len, "Widget !REALIZED after realize");
- else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after realize");
- else if (REVEALED(win))
- LOG_FAILURE(buf, len, "Window REVEALED after realize");
- else
- ret = 1;
-
- ewl_widget_destroy(win);
+ Ewl_Widget *win;
+
+ /*
+ * Create a window and add the child to allow the realize to
+ * succeed. This will be using the buffer engine.
+ */
+ win = ewl_window_new();
+ ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
+
+ ewl_container_child_append(EWL_CONTAINER(win), w);
+ ewl_widget_realize(w);
+
+ if (VISIBLE(win))
+ LOG_FAILURE(buf, len, "Window VISIBLE after realize");
+ else if (!REALIZED(win))
+ LOG_FAILURE(buf, len, "Window !REALIZED after realize");
+ else if (!REALIZED(w))
+ LOG_FAILURE(buf, len, "Widget !REALIZED after realize");
+ else if (REVEALED(w))
+ LOG_FAILURE(buf, len, "Widget REVEALED after realize");
+ else if (REVEALED(win))
+ LOG_FAILURE(buf, len, "Window REVEALED after realize");
+ else
+ ret = 1;
+
+ ewl_widget_destroy(win);
}
ewl_widget_destroy(w);
return ret;
@@ -532,15 +532,15 @@ realize_unrealize(char *buf, int len)
ewl_widget_unrealize(w);
if (VISIBLE(w))
- /* This is the currently expected behavior, but we're discussing
- * if this is really the behavior we want */
- LOG_FAILURE(buf, len, "Widget VISIBLE after realize/unrealize");
+ /* This is the currently expected behavior, but we're discussing
+ * if this is really the behavior we want */
+ LOG_FAILURE(buf, len, "Widget VISIBLE after realize/unrealize");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after realize/unrealize");
+ LOG_FAILURE(buf, len, "Widget REALIZED after realize/unrealize");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after realize/unrealize");
+ LOG_FAILURE(buf, len, "Widget REVEALED after realize/unrealize");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -561,17 +561,17 @@ parent_set(char *buf, int len)
w = ewl_widget_new();
ewl_widget_parent_set(w, b);
if (!w->parent)
- LOG_FAILURE(buf, len, "Widget parent NULL after parent set");
+ LOG_FAILURE(buf, len, "Widget parent NULL after parent set");
else if (ewl_widget_parent_get(w) != b)
- LOG_FAILURE(buf, len, "Widget parent wrong after parent set");
+ LOG_FAILURE(buf, len, "Widget parent wrong after parent set");
else if (VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget VISIBLE after parent set");
+ LOG_FAILURE(buf, len, "Widget VISIBLE after parent set");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after parent set");
+ LOG_FAILURE(buf, len, "Widget REALIZED after parent set");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after parent set");
+ LOG_FAILURE(buf, len, "Widget REVEALED after parent set");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
ewl_widget_destroy(b);
@@ -595,18 +595,18 @@ parent_set_show(char *buf, int len)
ewl_widget_parent_set(w, b);
if (!w->parent)
- LOG_FAILURE(buf, len, "Parent NULL after parent_set");
+ LOG_FAILURE(buf, len, "Parent NULL after parent_set");
else if (!VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget !VISIBLE after parent_set");
+ LOG_FAILURE(buf, len, "Widget !VISIBLE after parent_set");
else if (REALIZED(w))
- /* The widget has not been realized yet as that happens in the
- * idle loop, so this should test that it is still not realized
- * after changing parents. */
- LOG_FAILURE(buf, len, "Widget REALIZED after parent_set");
+ /* The widget has not been realized yet as that happens in the
+ * idle loop, so this should test that it is still not realized
+ * after changing parents. */
+ LOG_FAILURE(buf, len, "Widget REALIZED after parent_set");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after parent_set");
+ LOG_FAILURE(buf, len, "Widget REVEALED after parent_set");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
ewl_widget_destroy(b);
@@ -634,17 +634,17 @@ reparent_unrealized(char *buf, int len)
ewl_widget_parent_set(w, b2);
if (!w->parent)
- LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
+ LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
else if (w->parent != b2)
- LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
+ LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
else if (VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget VISIBLE after reparent");
+ LOG_FAILURE(buf, len, "Widget VISIBLE after reparent");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
+ LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
+ LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
ewl_widget_destroy(b1);
@@ -670,17 +670,17 @@ reparent_realized(char *buf, int len)
ewl_widget_parent_set(w, b2);
if (!w->parent)
- LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
+ LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
else if (w->parent != b2)
- LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
+ LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
else if (!VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget !VISIBLE after reparent");
+ LOG_FAILURE(buf, len, "Widget !VISIBLE after reparent");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
+ LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
+ LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
ewl_widget_destroy(b1);
@@ -700,45 +700,45 @@ realize_reveal(char *buf, int len)
ewl_widget_reveal(w);
if (VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget VISIBLE after realize/reveal");
+ LOG_FAILURE(buf, len, "Widget VISIBLE after realize/reveal");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after realize/reveal");
+ LOG_FAILURE(buf, len, "Widget REALIZED after realize/reveal");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after realize/reveal");
+ LOG_FAILURE(buf, len, "Widget REVEALED after realize/reveal");
else
{
- Ewl_Widget *win;
-
- /*
- * Create a window and add the child to allow the realize to
- * succeed. This will be using the buffer engine.
- */
- win = ewl_window_new();
- ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
-
- ewl_container_child_append(EWL_CONTAINER(win), w);
- ewl_widget_realize(w);
- ewl_widget_reveal(w);
-
- if (VISIBLE(win))
- LOG_FAILURE(buf, len,
- "Window VISIBLE after realize/reveal");
- else if (!REALIZED(win))
- LOG_FAILURE(buf, len,
- "Window !REALIZED after realize/reveal");
- else if (!REALIZED(w))
- LOG_FAILURE(buf, len,
- "Widget !REALIZED after realize/reveal");
- else if (!REVEALED(w))
- LOG_FAILURE(buf, len,
- "Widget !REVEALED after realize/reveal");
- else if (REVEALED(win))
- LOG_FAILURE(buf, len,
- "Window REVEALED after realize/reveal");
- else
- ret = 1;
-
- ewl_widget_destroy(win);
+ Ewl_Widget *win;
+
+ /*
+ * Create a window and add the child to allow the realize to
+ * succeed. This will be using the buffer engine.
+ */
+ win = ewl_window_new();
+ ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
+
+ ewl_container_child_append(EWL_CONTAINER(win), w);
+ ewl_widget_realize(w);
+ ewl_widget_reveal(w);
+
+ if (VISIBLE(win))
+ LOG_FAILURE(buf, len,
+ "Window VISIBLE after realize/reveal");
+ else if (!REALIZED(win))
+ LOG_FAILURE(buf, len,
+ "Window !REALIZED after realize/reveal");
+ else if (!REALIZED(w))
+ LOG_FAILURE(buf, len,
+ "Widget !REALIZED after realize/reveal");
+ else if (!REVEALED(w))
+ LOG_FAILURE(buf, len,
+ "Widget !REVEALED after realize/reveal");
+ else if (REVEALED(win))
+ LOG_FAILURE(buf, len,
+ "Window REVEALED after realize/reveal");
+ else
+ ret = 1;
+
+ ewl_widget_destroy(win);
}
ewl_widget_destroy(w);
@@ -767,25 +767,25 @@ realize_reveal_obscure(char *buf, int len)
ewl_widget_obscure(w);
if (VISIBLE(win))
- LOG_FAILURE(buf, len,
- "Window VISIBLE after realize/reveal/obscure");
+ LOG_FAILURE(buf, len,
+ "Window VISIBLE after realize/reveal/obscure");
else if (!REALIZED(win))
- LOG_FAILURE(buf, len,
- "Window !REALIZED after realize/reveal/obscure");
+ LOG_FAILURE(buf, len,
+ "Window !REALIZED after realize/reveal/obscure");
else if (!REALIZED(w))
- LOG_FAILURE(buf, len,
- "Widget !REALIZED after realize/reveal/obscure");
+ LOG_FAILURE(buf, len,
+ "Widget !REALIZED after realize/reveal/obscure");
else if (REVEALED(w))
- LOG_FAILURE(buf, len,
- "Widget REVEALED after realize/reveal/obscure");
+ LOG_FAILURE(buf, len,
+ "Widget REVEALED after realize/reveal/obscure");
else if (REVEALED(win))
- LOG_FAILURE(buf, len,
- "Window REVEALED after realize/reveal/obscure");
+ LOG_FAILURE(buf, len,
+ "Window REVEALED after realize/reveal/obscure");
else if (REVEALED(win))
- LOG_FAILURE(buf, len,
- "Window REVEALED after realize/reveal/obscure");
+ LOG_FAILURE(buf, len,
+ "Window REVEALED after realize/reveal/obscure");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(win);
ewl_widget_destroy(w);
@@ -814,17 +814,17 @@ realize_reveal_unrealize(char *buf, int len)
ewl_widget_unrealize(w);
if (VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget VISIBLE after realize/reveal/unrealize");
+ LOG_FAILURE(buf, len, "Widget VISIBLE after realize/reveal/unrealize");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after realize/reveal/unrealize");
+ LOG_FAILURE(buf, len, "Widget REALIZED after realize/reveal/unrealize");
else if (!REALIZED(win))
- LOG_FAILURE(buf, len, "Window !REALIZED after realize/reveal/unrealize");
+ LOG_FAILURE(buf, len, "Window !REALIZED after realize/reveal/unrealize");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after realize/reveal/unrealize");
+ LOG_FAILURE(buf, len, "Widget REVEALED after realize/reveal/unrealize");
else if (REVEALED(win))
- LOG_FAILURE(buf, len, "Window REVEALED after realize/reveal/unrealize");
+ LOG_FAILURE(buf, len, "Window REVEALED after realize/reveal/unrealize");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(win);
ewl_widget_destroy(w);
@@ -853,17 +853,17 @@ show_realize_unrealize(char *buf, int len)
ewl_widget_unrealize(w);
if (!VISIBLE(w))
- LOG_FAILURE(buf, len, "Widget not VISIBLE after show/realize/unrealize");
+ LOG_FAILURE(buf, len, "Widget not VISIBLE after show/realize/unrealize");
else if (REALIZED(w))
- LOG_FAILURE(buf, len, "Widget REALIZED after show/realize/unrealize");
+ LOG_FAILURE(buf, len, "Widget REALIZED after show/realize/unrealize");
else if (!REALIZED(win))
- LOG_FAILURE(buf, len, "Window !REALIZED after show/realize/unrealize");
+ LOG_FAILURE(buf, len, "Window !REALIZED after show/realize/unrealize");
else if (REVEALED(w))
- LOG_FAILURE(buf, len, "Widget REVEALED after show/realize/unrealize");
+ LOG_FAILURE(buf, len, "Widget REVEALED after show/realize/unrealize");
else if (REVEALED(win))
- LOG_FAILURE(buf, len, "Window REVEALED after show/realize/unrealize");
+ LOG_FAILURE(buf, len, "Window REVEALED after show/realize/unrealize");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(win);
ewl_widget_destroy(w);
@@ -881,9 +881,9 @@ widget_is_test(char *buf, int len)
w = ewl_widget_new();
if (!EWL_WIDGET_IS(w))
- LOG_FAILURE(buf, len, "Widget is not Widget type");
+ LOG_FAILURE(buf, len, "Widget is not Widget type");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -903,9 +903,9 @@ name_test_set_get(char *buf, int len)
ewl_widget_name_set(w, "test widget");
name = ewl_widget_name_get(w);
if (strcmp("test widget", name))
- LOG_FAILURE(buf, len, "Returned name '%s' not 'test widget'", name);
+ LOG_FAILURE(buf, len, "Returned name '%s' not 'test widget'", name);
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -924,9 +924,9 @@ name_test_nul_set_get(char *buf, int len)
ewl_widget_name_set(w, "test name");
ewl_widget_name_set(w, NULL);
if (NULL != ewl_widget_name_get(w))
- LOG_FAILURE(buf, len, "Widget name not NULL");
+ LOG_FAILURE(buf, len, "Widget name not NULL");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -945,9 +945,9 @@ name_find_test(char *buf, int len)
ewl_widget_name_set(w1, "test widget");
w2 = ewl_widget_name_find("test widget");
if (w1 != w2)
- LOG_FAILURE(buf, len, "widget found not equal to widget set");
+ LOG_FAILURE(buf, len, "widget found not equal to widget set");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w1);
return ret;
@@ -964,9 +964,9 @@ name_find_missing_test(char *buf, int len)
w = ewl_widget_name_find("Missing widget name");
if (w != NULL)
- LOG_FAILURE(buf, len, "Found widget when we shouldn't have");
+ LOG_FAILURE(buf, len, "Found widget when we shouldn't have");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -982,9 +982,9 @@ name_find_null_test(char *buf, int len)
w = ewl_widget_name_find(NULL);
if (w != NULL)
- LOG_FAILURE(buf, len, "Found widget when searching for NULL");
+ LOG_FAILURE(buf, len, "Found widget when searching for NULL");
else
- ret = 1;
+ ret = 1;
return ret;
}
@@ -1000,9 +1000,9 @@ widget_type_is_test(char *buf, int len)
w = ewl_widget_new();
ewl_widget_inherit(w, "my type");
if (!ewl_widget_type_is(w, "my type"))
- LOG_FAILURE(buf, len, "Failed to match 'my type' on widget");
+ LOG_FAILURE(buf, len, "Failed to match 'my type' on widget");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -1019,9 +1019,9 @@ widget_type_is_non_type_test(char *buf, int len)
w = ewl_widget_new();
if (ewl_widget_type_is(w, "my missing type"))
- LOG_FAILURE(buf, len, "Matchined 'my missing type' on widget without type set");
+ LOG_FAILURE(buf, len, "Matchined 'my missing type' on widget without type set");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -1041,9 +1041,9 @@ widget_enable_test(char *buf, int len)
ewl_widget_enable(w);
if (DISABLED(w))
- LOG_FAILURE(buf, len, "Widget DISABLED after calling enable");
+ LOG_FAILURE(buf, len, "Widget DISABLED after calling enable");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -1061,9 +1061,9 @@ widget_disable_test(char *buf, int len)
w = ewl_widget_new();
ewl_widget_disable(w);
if (!DISABLED(w))
- LOG_FAILURE(buf, len, "Widget not disabled aftering calling disable");
+ LOG_FAILURE(buf, len, "Widget not disabled aftering calling disable");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -1083,15 +1083,15 @@ widget_colour_test_set_get(char *buf, int len)
ewl_widget_color_set(w, 248, 148, 48, 255);
ewl_widget_color_get(w, &r, &g, &b, &a);
if (r != 248)
- LOG_FAILURE(buf, len, "Red colour not retrieved correctly");
+ LOG_FAILURE(buf, len, "Red colour not retrieved correctly");
else if (g != 148)
- LOG_FAILURE(buf, len, "Green colour not retrived correctly");
+ LOG_FAILURE(buf, len, "Green colour not retrived correctly");
else if (b != 48)
- LOG_FAILURE(buf, len, "Blue colour not retrived correctly");
+ LOG_FAILURE(buf, len, "Blue colour not retrived correctly");
else if (a != 255)
- LOG_FAILURE(buf, len, "Alpha colour not retrieved correctly");
+ LOG_FAILURE(buf, len, "Alpha colour not retrieved correctly");
else
- ret = 1;
+ ret = 1;
ewl_widget_destroy(w);
return ret;
@@ -1125,21 +1125,21 @@ focusable_test_set_get(char *buf, int len)
w = ewl_widget_new();
focusable = ewl_widget_focusable_get(w);
if (focusable) {
- ewl_widget_focusable_set(w, FALSE);
- focusable = ewl_widget_focusable_get(w);
- if (!focusable) {
- ewl_widget_focusable_set(w, TRUE);
- focusable = ewl_widget_focusable_get(w);
- if (focusable)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "focusable set to FALSE");
- }
- else
- LOG_FAILURE(buf, len, "focusable set to TRUE");
+ ewl_widget_focusable_set(w, FALSE);
+ focusable = ewl_widget_focusable_get(w);
+ if (!focusable) {
+ ewl_widget_focusable_set(w, TRUE);
+ focusable = ewl_widget_focusable_get(w);
+ if (focusable)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "focusable set to FALSE");
+ }
+ else
+ LOG_FAILURE(buf, len, "focusable set to TRUE");
}
else
- LOG_FAILURE(buf, len, "default focusable set to FALSE");
+ LOG_FAILURE(buf, len, "default focusable set to FALSE");
return ret;
}
@@ -1157,18 +1157,18 @@ focus_test_send_get(char *buf, int len)
ewl_widget_focus_send(w);
if (ewl_widget_focused_get() == w)
- LOG_FAILURE(buf, len, "focused with no embed");
+ LOG_FAILURE(buf, len, "focused with no embed");
else {
- Ewl_Widget *embed;
+ Ewl_Widget *embed;
- embed = ewl_embed_new();
- ewl_container_child_append(EWL_CONTAINER(embed), w);
- ewl_widget_focus_send(w);
+ embed = ewl_embed_new();
+ ewl_container_child_append(EWL_CONTAINER(embed), w);
+ ewl_widget_focus_send(w);
- if (ewl_widget_focused_get() == w)
- ret = 1;
- else
- LOG_FAILURE(buf, len, "widget not focused");
+ if (ewl_widget_focused_get() == w)
+ ret = 1;
+ else
+ LOG_FAILURE(buf, len, "widget not focused");
}
return ret;
diff --git a/src/bin/tests/window/ewl_window_test.c b/src/bin/tests/window/ewl_window_test.c
index fcc54c1..ee19813 100644
--- a/src/bin/tests/window/ewl_window_test.c
+++ b/src/bin/tests/window/ewl_window_test.c
@@ -33,20 +33,20 @@ static int override_set_get(char *buf, int len);
*/
static Ewl_Unit_Test window_unit_tests[] = {
- {"title set/get", title_set_get, NULL, -1, 0},
- {"name set/get", name_set_get, NULL, -1, 0},
- {"class set/get", class_set_get, NULL, -1, 0},
- {"borderless set/get", borderless_set_get, NULL, -1, 0},
- {"dialog set/get", dialog_set_get, NULL, -1, 0},
- {"fullscreen set/get", fullscreen_set_get, NULL, -1, 0},
- {"skip_taskbar set/get", skip_taskbar_set_get, NULL, -1, 0},
- {"skip_pager set/get", skip_pager_set_get, NULL, -1, 0},
- {"urgent set/get", urgent_set_get, NULL, -1, 0},
- {"modal set/get", modal_set_get, NULL, -1, 0},
- {"keyboard_grab set/get", keyboard_grab_set_get, NULL, -1, 0},
- {"pointer_grab set/get", pointer_grab_set_get, NULL, -1, 0},
- {"override set/get", override_set_get, NULL, -1, 0},
- {NULL, NULL, NULL, -1, 0}
+ {"title set/get", title_set_get, NULL, -1, 0},
+ {"name set/get", name_set_get, NULL, -1, 0},
+ {"class set/get", class_set_get, NULL, -1, 0},
+ {"borderless set/get", borderless_set_get, NULL, -1, 0},
+ {"dialog set/get", dialog_set_get, NULL, -1, 0},
+ {"fullscreen set/get", fullscreen_set_get, NULL, -1, 0},
+ {"skip_taskbar set/get", skip_taskbar_set_get, NULL, -1, 0},
+ {"skip_pager set/get", skip_pager_set_get, NULL, -1, 0},
+ {"urgent set/get", urgent_set_get, NULL, -1, 0},
+ {"modal set/get", modal_set_get, NULL, -1, 0},
+ {"keyboard_grab set/get", keyboard_grab_set_get, NULL, -1, 0},
+ {"pointer_grab set/get", pointer_grab_set_get, NULL, -1, 0},
+ {"override set/get", override_set_get, NULL, -1, 0},
+ {NULL, NULL, NULL, -1, 0}
};
void
@@ -105,7 +105,7 @@ 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)));
+ !ewl_window_borderless_get(EWL_WINDOW(data)));
}
/*
@@ -122,21 +122,21 @@ title_set_get(char *buf, int len)
title = ewl_window_title_get(EWL_WINDOW(win));
if (title)
- snprintf(buf, len, "default title set to '%s'", title);
+ snprintf(buf, len, "default title set to '%s'", title);
else {
- ewl_window_title_set(EWL_WINDOW(win), "A title");
- title = ewl_window_title_get(EWL_WINDOW(win));
-
- if (strcmp(title, "A title"))
- snprintf(buf, len, "incorrect title set");
- else {
- ewl_window_title_set(EWL_WINDOW(win), "");
- title = ewl_window_title_get(EWL_WINDOW(win));
- if (title)
- snprintf(buf, len, "non-empty title set");
- else
- ret = 1;
- }
+ ewl_window_title_set(EWL_WINDOW(win), "A title");
+ title = ewl_window_title_get(EWL_WINDOW(win));
+
+ if (strcmp(title, "A title"))
+ snprintf(buf, len, "incorrect title set");
+ else {
+ ewl_window_title_set(EWL_WINDOW(win), "");
+ title = ewl_window_title_get(EWL_WINDOW(win));
+ if (title)
+ snprintf(buf, len, "non-empty title set");
+ else
+ ret = 1;
+ }
}
ewl_widget_destroy(win);
@@ -158,21 +158,21 @@ name_set_get(char *buf, int len)
name = ewl_window_name_get(EWL_WINDOW(win));
if (name)
- snprintf(buf, len, "default name set to '%s'", name);
+ snprintf(buf, len, "default name set to '%s'", name);
else {
- ewl_window_name_set(EWL_WINDOW(win), "A name");
- name = ewl_window_name_get(EWL_WINDOW(win));
-
- if (strcmp(name, "A name"))
- snprintf(buf, len, "incorrect name set");
- else {
- ewl_window_name_set(EWL_WINDOW(win), "");
- name = ewl_window_name_get(EWL_WINDOW(win));
- if (name)
- snprintf(buf, len, "non-empty name set");
- else
- ret = 1;
- }
+ ewl_window_name_set(EWL_WINDOW(win), "A name");
+ name = ewl_window_name_get(EWL_WINDOW(win));
+
+ if (strcmp(name, "A name"))
+ snprintf(buf, len, "incorrect name set");
+ else {
+ ewl_window_name_set(EWL_WINDOW(win), "");
+ name = ewl_window_name_get(EWL_WINDOW(win));
+ if (name)
+ snprintf(buf, len, "non-empty name set");
+ else
+ ret = 1;
+ }
}
ewl_widget_destroy(win);
@@ -194,21 +194,21 @@ class_set_get(char *buf, int len)
class = ewl_window_class_get(EWL_WINDOW(win));
if (class)
- snprintf(buf, len, "default class set to '%s'", class);
+ snprintf(buf, len, "default class set to '%s'", class);
else {
- ewl_window_class_set(EWL_WINDOW(win), "A class");
- class = ewl_window_class_get(EWL_WINDOW(win));
-
- if (strcmp(class, "A class"))
- snprintf(buf, len, "incorrect class set");
- else {
- ewl_window_class_set(EWL_WINDOW(win), "");
- class = ewl_window_class_get(EWL_WINDOW(win));
- if (class)
- snprintf(buf, len, "non-empty class set");
- else
- ret = 1;
- }
+ ewl_window_class_set(EWL_WINDOW(win), "A class");
+ class = ewl_window_class_get(EWL_WINDOW(win));
+
+ if (strcmp(class, "A class"))
+ snprintf(buf, len, "incorrect class set");
+ else {
+ ewl_window_class_set(EWL_WINDOW(win), "");
+ class = ewl_window_class_get(EWL_WINDOW(win));
+ if (class)
+ snprintf(buf, len, "non-empty class set");
+ else
+ ret = 1;
+ }
}
ewl_widget_destroy(win);
@@ -228,13 +228,13 @@ borderless_set_get(char *buf, int len)
win = ewl_window_new();
ewl_window_borderless_set(EWL_WINDOW(win), TRUE);
if (ewl_window_borderless_get(EWL_WINDOW(win)))
- ret = 1;
+ ret = 1;
else
- snprintf(buf, len, "setting borderless TRUE failed");
+ snprintf(buf, len, "setting borderless TRUE failed");
ewl_window_borderless_set(EWL_WINDOW(win), FALSE);
if (ewl_window_borderless_get(EWL_WINDOW(win)))
- snprintf(buf, len, "setting borderless FALSE failed");
+ snprintf(buf, len, "setting borderless FALSE failed");
ewl_widget_destroy(win);
@@ -254,20 +254,20 @@ dialog_set_get(char *buf, int len)
if (!ewl_window_dialog_get(EWL_WINDOW(win))) {
- ewl_window_dialog_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_dialog_get(EWL_WINDOW(win))) {
-
- ewl_window_dialog_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_dialog_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "dialog unset failed");
- }
- else
- snprintf(buf, len, "dialog set failed");
+ ewl_window_dialog_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_dialog_get(EWL_WINDOW(win))) {
+
+ ewl_window_dialog_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_dialog_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "dialog unset failed");
+ }
+ else
+ snprintf(buf, len, "dialog set failed");
}
else
- snprintf(buf, len, "default dialog set");
+ snprintf(buf, len, "default dialog set");
ewl_widget_destroy(win);
@@ -287,20 +287,20 @@ fullscreen_set_get(char *buf, int len)
if (!ewl_window_fullscreen_get(EWL_WINDOW(win))) {
- ewl_window_fullscreen_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_fullscreen_get(EWL_WINDOW(win))) {
-
- ewl_window_fullscreen_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_fullscreen_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "fullscreen unset failed");
- }
- else
- snprintf(buf, len, "fullscreen set failed");
+ ewl_window_fullscreen_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_fullscreen_get(EWL_WINDOW(win))) {
+
+ ewl_window_fullscreen_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_fullscreen_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "fullscreen unset failed");
+ }
+ else
+ snprintf(buf, len, "fullscreen set failed");
}
else
- snprintf(buf, len, "default fullscreen set");
+ snprintf(buf, len, "default fullscreen set");
ewl_widget_destroy(win);
@@ -320,20 +320,20 @@ skip_taskbar_set_get(char *buf, int len)
if (!ewl_window_skip_taskbar_get(EWL_WINDOW(win))) {
- ewl_window_skip_taskbar_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_skip_taskbar_get(EWL_WINDOW(win))) {
-
- ewl_window_skip_taskbar_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_skip_taskbar_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "skip_taskbar unset failed");
- }
- else
- snprintf(buf, len, "skip_taskbar set failed");
+ ewl_window_skip_taskbar_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_skip_taskbar_get(EWL_WINDOW(win))) {
+
+ ewl_window_skip_taskbar_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_skip_taskbar_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "skip_taskbar unset failed");
+ }
+ else
+ snprintf(buf, len, "skip_taskbar set failed");
}
else
- snprintf(buf, len, "default skip_taskbar set");
+ snprintf(buf, len, "default skip_taskbar set");
ewl_widget_destroy(win);
@@ -353,20 +353,20 @@ skip_pager_set_get(char *buf, int len)
if (!ewl_window_skip_pager_get(EWL_WINDOW(win))) {
- ewl_window_skip_pager_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_skip_pager_get(EWL_WINDOW(win))) {
-
- ewl_window_skip_pager_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_skip_pager_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "skip_pager unset failed");
- }
- else
- snprintf(buf, len, "skip_pager set failed");
+ ewl_window_skip_pager_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_skip_pager_get(EWL_WINDOW(win))) {
+
+ ewl_window_skip_pager_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_skip_pager_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "skip_pager unset failed");
+ }
+ else
+ snprintf(buf, len, "skip_pager set failed");
}
else
- snprintf(buf, len, "default skip_pager set");
+ snprintf(buf, len, "default skip_pager set");
ewl_widget_destroy(win);
@@ -386,20 +386,20 @@ urgent_set_get(char *buf, int len)
if (!ewl_window_urgent_get(EWL_WINDOW(win))) {
- ewl_window_urgent_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_urgent_get(EWL_WINDOW(win))) {
-
- ewl_window_urgent_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_urgent_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "urgent unset failed");
- }
- else
- snprintf(buf, len, "urgent set failed");
+ ewl_window_urgent_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_urgent_get(EWL_WINDOW(win))) {
+
+ ewl_window_urgent_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_urgent_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "urgent unset failed");
+ }
+ else
+ snprintf(buf, len, "urgent set failed");
}
else
- snprintf(buf, len, "default urgent set");
+ snprintf(buf, len, "default urgent set");
ewl_widget_destroy(win);
@@ -419,20 +419,20 @@ modal_set_get(char *buf, int len)
if (!ewl_window_modal_get(EWL_WINDOW(win))) {
- ewl_window_modal_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_modal_get(EWL_WINDOW(win))) {
-
- ewl_window_modal_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_modal_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "modal unset failed");
- }
- else
- snprintf(buf, len, "modal set failed");
+ ewl_window_modal_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_modal_get(EWL_WINDOW(win))) {
+
+ ewl_window_modal_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_modal_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "modal unset failed");
+ }
+ else
+ snprintf(buf, len, "modal set failed");
}
else
- snprintf(buf, len, "default modal set");
+ snprintf(buf, len, "default modal set");
ewl_widget_destroy(win);
@@ -452,20 +452,20 @@ keyboard_grab_set_get(char *buf, int len)
if (!ewl_window_keyboard_grab_get(EWL_WINDOW(win))) {
- ewl_window_keyboard_grab_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_keyboard_grab_get(EWL_WINDOW(win))) {
-
- ewl_window_keyboard_grab_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_keyboard_grab_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "keyboard_grab unset failed");
- }
- else
- snprintf(buf, len, "keyboard_grab set failed");
+ ewl_window_keyboard_grab_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_keyboard_grab_get(EWL_WINDOW(win))) {
+
+ ewl_window_keyboard_grab_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_keyboard_grab_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "keyboard_grab unset failed");
+ }
+ else
+ snprintf(buf, len, "keyboard_grab set failed");
}
else
- snprintf(buf, len, "default keyboard_grab set");
+ snprintf(buf, len, "default keyboard_grab set");
ewl_widget_destroy(win);
@@ -485,20 +485,20 @@ pointer_grab_set_get(char *buf, int len)
if (!ewl_window_pointer_grab_get(EWL_WINDOW(win))) {
- ewl_window_pointer_grab_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_pointer_grab_get(EWL_WINDOW(win))) {
-
- ewl_window_pointer_grab_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_pointer_grab_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "pointer_grab unset failed");
- }
- else
- snprintf(buf, len, "pointer_grab set failed");
+ ewl_window_pointer_grab_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_pointer_grab_get(EWL_WINDOW(win))) {
+
+ ewl_window_pointer_grab_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_pointer_grab_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "pointer_grab unset failed");
+ }
+ else
+ snprintf(buf, len, "pointer_grab set failed");
}
else
- snprintf(buf, len, "default pointer_grab set");
+ snprintf(buf, len, "default pointer_grab set");
ewl_widget_destroy(win);
@@ -518,20 +518,20 @@ override_set_get(char *buf, int len)
if (!ewl_window_override_get(EWL_WINDOW(win))) {
- ewl_window_override_set(EWL_WINDOW(win), TRUE);
- if (ewl_window_override_get(EWL_WINDOW(win))) {
-
- ewl_window_override_set(EWL_WINDOW(win), FALSE);
- if (!ewl_window_override_get(EWL_WINDOW(win)))
- ret = 1;
- else
- snprintf(buf, len, "override unset failed");
- }
- else
- snprintf(buf, len, "override set failed");
+ ewl_window_override_set(EWL_WINDOW(win), TRUE);
+ if (ewl_window_override_get(EWL_WINDOW(win))) {
+
+ ewl_window_override_set(EWL_WINDOW(win), FALSE);
+ if (!ewl_window_override_get(EWL_WINDOW(win)))
+ ret = 1;
+ else
+ snprintf(buf, len, "override unset failed");
+ }
+ else
+ snprintf(buf, len, "override set failed");
}
else
- snprintf(buf, len, "default override set");
+ snprintf(buf, len, "default override set");
ewl_widget_destroy(win);
diff --git a/src/engines/evas/ewl_engine_evas.c b/src/engines/evas/ewl_engine_evas.c
index 023fdfd..e857922 100644
--- a/src/engines/evas/ewl_engine_evas.c
+++ b/src/engines/evas/ewl_engine_evas.c
@@ -14,7 +14,7 @@ static int ee_init(Ewl_Engine *engine);
static void ee_shutdown(Ewl_Engine *engine);
static void ee_canvas_output_set(Ewl_Embed *embed, int x, int y, int width,
- int height);
+ int height);
static void ee_canvas_render(Ewl_Embed *embed);
static void ee_canvas_freeze(Ewl_Embed *embed);
static void ee_canvas_thaw(Ewl_Embed *embed);
@@ -29,41 +29,41 @@ static Evas_Object *ewl_widget_layer_neighbor_find_below(Ewl_Widget *w);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- NULL,
- ee_canvas_output_set,
- ee_canvas_render,
- ee_canvas_freeze,
- ee_canvas_thaw,
- ee_canvas_damage_add
+ NULL,
+ ee_canvas_output_set,
+ ee_canvas_render,
+ ee_canvas_freeze,
+ ee_canvas_thaw,
+ ee_canvas_damage_add
};
static void *theme_funcs[EWL_ENGINE_THEME_MAX] =
{
- /* FIXME: disable these calls for now. They stop ejde reloading
- * the theme object correctly after it was obscured, in some
- * cases. If these problems are solved, please activate them
- * again. For more information see bug #3, #116 and #456*/
- NULL, //edje_freeze,
- NULL, //edje_thaw,
- edje_file_data_get,
- ee_canvas_smart_new,
- NULL,
- evas_object_del,
- evas_object_move,
- evas_object_resize,
- evas_object_show,
- evas_object_hide,
- evas_object_clip_set,
- evas_object_clip_unset,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL, NULL,
- ee_canvas_clip_add,
- evas_object_del,
- evas_object_clipees_get,
- evas_object_color_set,
- ee_canvas_stack_add,
- ee_canvas_layer_update,
+ /* FIXME: disable these calls for now. They stop ejde reloading
+ * the theme object correctly after it was obscured, in some
+ * cases. If these problems are solved, please activate them
+ * again. For more information see bug #3, #116 and #456*/
+ NULL, //edje_freeze,
+ NULL, //edje_thaw,
+ edje_file_data_get,
+ ee_canvas_smart_new,
+ NULL,
+ evas_object_del,
+ evas_object_move,
+ evas_object_resize,
+ evas_object_show,
+ evas_object_hide,
+ evas_object_clip_set,
+ evas_object_clip_unset,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL, NULL,
+ ee_canvas_clip_add,
+ evas_object_del,
+ evas_object_clipees_get,
+ evas_object_color_set,
+ ee_canvas_stack_add,
+ ee_canvas_layer_update,
};
Ecore_DList *
@@ -83,12 +83,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -137,7 +137,7 @@ ee_canvas_render(Ewl_Embed *embed)
DCHECK_PARAM_PTR(embed);
if (embed->canvas)
- evas_render(embed->canvas);
+ evas_render(embed->canvas);
DRETURN(DLEVEL_STABLE);
}
@@ -149,7 +149,7 @@ ee_canvas_freeze(Ewl_Embed *embed)
DCHECK_PARAM_PTR(embed);
if (embed->canvas && evas_event_freeze_get(embed->canvas) < 1) {
- evas_event_freeze(embed->canvas);
+ evas_event_freeze(embed->canvas);
}
DRETURN(DLEVEL_STABLE);
@@ -162,7 +162,7 @@ ee_canvas_thaw(Ewl_Embed *embed)
DCHECK_PARAM_PTR(embed);
if (embed->canvas && evas_event_freeze_get(embed->canvas) > 0)
- evas_event_thaw(embed->canvas);
+ evas_event_thaw(embed->canvas);
DRETURN(DLEVEL_STABLE);
}
@@ -174,7 +174,7 @@ ee_canvas_damage_add(Ewl_Embed *embed, int x, int y, int w, int h)
DCHECK_PARAM_PTR(embed);
if (embed->canvas)
- evas_damage_rectangle_add(embed->canvas, x, y, w, h);
+ evas_damage_rectangle_add(embed->canvas, x, y, w, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -188,11 +188,11 @@ ee_canvas_smart_new(Ewl_Embed *embed)
DCHECK_PARAM_PTR_RET(embed, NULL);
if (!widget_smart) {
- widget_smart = evas_smart_new("Ewl Widget Smart Object",
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL);
+ widget_smart = evas_smart_new("Ewl Widget Smart Object",
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL);
}
smart_object = evas_object_smart_add(embed->canvas, widget_smart);
@@ -209,7 +209,7 @@ ee_canvas_clip_add(Ewl_Embed *embed)
obj = evas_object_rectangle_add(embed->canvas);
if (obj)
- evas_object_pass_events_set(obj, TRUE);
+ evas_object_pass_events_set(obj, TRUE);
DRETURN_PTR(obj, DLEVEL_STABLE);
}
@@ -224,28 +224,28 @@ ee_canvas_stack_add(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (w->parent && !REVEALED(w->parent))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (w->parent && !w->toplayered)
- smart_parent = w->parent->smart_object;
+ smart_parent = w->parent->smart_object;
else {
- Ewl_Embed *emb;
+ Ewl_Embed *emb;
- emb = ewl_embed_widget_find(w);
- smart_parent = emb->smart;
+ emb = ewl_embed_widget_find(w);
+ smart_parent = emb->smart;
}
evas_object_smart_member_add(w->smart_object, smart_parent);
if (w->theme_object)
- evas_object_smart_member_add(w->theme_object, w->smart_object);
+ evas_object_smart_member_add(w->theme_object, w->smart_object);
if (w->fx_clip_box)
- evas_object_smart_member_add(w->fx_clip_box, w->smart_object);
+ evas_object_smart_member_add(w->fx_clip_box, w->smart_object);
if (w->theme_object && w->fx_clip_box)
- evas_object_stack_below(w->theme_object, w->fx_clip_box);
+ evas_object_stack_below(w->theme_object, w->fx_clip_box);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -261,33 +261,33 @@ ee_canvas_layer_update(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!(p = w->parent))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* check first if the widget should be on the top */
if (w->toplayered)
{
- evas_object_raise(w->smart_object);
- DRETURN(DLEVEL_STABLE);
+ evas_object_raise(w->smart_object);
+ DRETURN(DLEVEL_STABLE);
}
layer = ewl_widget_layer_priority_get(w);
if (layer == 0)
- evas_object_stack_above(w->smart_object, p->fx_clip_box);
+ evas_object_stack_above(w->smart_object, p->fx_clip_box);
else if (layer > 0) {
- Evas_Object *above;
+ Evas_Object *above;
- if (!(above = ewl_widget_layer_neighbor_find_above(w)))
- DWARNING("No object above.");
+ if (!(above = ewl_widget_layer_neighbor_find_above(w)))
+ DWARNING("No object above.");
- evas_object_stack_above(w->smart_object, above);
+ evas_object_stack_above(w->smart_object, above);
}
else {
- Evas_Object *below;
+ Evas_Object *below;
- if (!(below = ewl_widget_layer_neighbor_find_below(w)))
- DWARNING("No object below.");
+ if (!(below = ewl_widget_layer_neighbor_find_below(w)))
+ DWARNING("No object below.");
- evas_object_stack_below(w->smart_object, below);
+ evas_object_stack_below(w->smart_object, below);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -303,27 +303,27 @@ ewl_widget_layer_neighbor_find_above(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, NULL);
if (!w->parent)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
o = ol = w->parent->fx_clip_box;
while ((o = evas_object_above_get(o)))
{
- Ewl_Widget *found;
-
- found = evas_object_data_get(o, "EWL");
- /*
- * Perhaps it is a cached object so no reason to stop iterating
- */
- if (found) {
- /* ignore the widget itself */
- if (w == found)
- continue;
- if (ewl_widget_layer_priority_get(w) <=
- ewl_widget_layer_priority_get(found))
- break;
- ol = o;
- }
+ Ewl_Widget *found;
+
+ found = evas_object_data_get(o, "EWL");
+ /*
+ * Perhaps it is a cached object so no reason to stop iterating
+ */
+ if (found) {
+ /* ignore the widget itself */
+ if (w == found)
+ continue;
+ if (ewl_widget_layer_priority_get(w) <=
+ ewl_widget_layer_priority_get(found))
+ break;
+ ol = o;
+ }
}
DRETURN_PTR(ol, DLEVEL_STABLE);
@@ -339,27 +339,27 @@ ewl_widget_layer_neighbor_find_below(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, NULL);
if (!w->parent)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
o = ol = w->parent->fx_clip_box;
while ((o = evas_object_below_get(o)))
{
- Ewl_Widget *found;
-
- found = evas_object_data_get(o, "EWL");
- /*
- * Perhaps it is a cached object so no reason to stop iterating
- */
- if (found) {
- /* ignore the widget itself */
- if (w == found)
- continue;
- if (ewl_widget_layer_priority_get(w) >=
- ewl_widget_layer_priority_get(found))
- break;
- ol = o;
- }
+ Ewl_Widget *found;
+
+ found = evas_object_data_get(o, "EWL");
+ /*
+ * Perhaps it is a cached object so no reason to stop iterating
+ */
+ if (found) {
+ /* ignore the widget itself */
+ if (w == found)
+ continue;
+ if (ewl_widget_layer_priority_get(w) >=
+ ewl_widget_layer_priority_get(found))
+ break;
+ ol = o;
+ }
}
DRETURN_PTR(ol, DLEVEL_STABLE);
diff --git a/src/engines/evas_buffer/Ewl_Engine_Evas_Buffer.h b/src/engines/evas_buffer/Ewl_Engine_Evas_Buffer.h
index a32c9f3..cb361af 100644
--- a/src/engines/evas_buffer/Ewl_Engine_Evas_Buffer.h
+++ b/src/engines/evas_buffer/Ewl_Engine_Evas_Buffer.h
@@ -7,7 +7,7 @@
#include <Evas_Engine_Buffer.h>
#define EWL_ENGINE_EVAS_BUFFER(engine) \
- ((Ewl_Engine_Evas_Buffer *)engine)
+ ((Ewl_Engine_Evas_Buffer *)engine)
typedef struct Ewl_Engine_Evas_Buffer Ewl_Engine_Evas_Buffer;
struct Ewl_Engine_Evas_Buffer
diff --git a/src/engines/evas_buffer/ewl_engine_evas_buffer.c b/src/engines/evas_buffer/ewl_engine_evas_buffer.c
index 541e66a..3a4742a 100644
--- a/src/engines/evas_buffer/ewl_engine_evas_buffer.c
+++ b/src/engines/evas_buffer/ewl_engine_evas_buffer.c
@@ -6,16 +6,16 @@
static void ee_canvas_setup(Ewl_Window *win, int debug);
static void ee_canvas_output_set(Ewl_Embed *embed, int x, int y, int width,
- int height);
+ int height);
static void ee_canvas_render(Ewl_Embed *emb);
static int ee_init(Ewl_Engine *engine);
static void ee_shutdown(Ewl_Engine *engine);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- ee_canvas_output_set,
- ee_canvas_render, NULL, NULL
+ ee_canvas_setup,
+ ee_canvas_output_set,
+ ee_canvas_render, NULL, NULL
};
Ecore_DList *
@@ -40,12 +40,12 @@ ewl_engine_create(int *argv __UNUSED__, char ** argc __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Buffer, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -97,8 +97,8 @@ ee_canvas_setup(Ewl_Window *win, int debug __UNUSED__)
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use buffer engine for rendering.\n");
- exit(-1);
+ fprintf(stderr, "Unable to use buffer engine for rendering.\n");
+ exit(-1);
}
win->window = bufinfo = (Evas_Engine_Info_Buffer *)info;
@@ -115,11 +115,11 @@ ee_canvas_setup(Ewl_Window *win, int debug __UNUSED__)
o = EWL_OBJECT(win);
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -146,15 +146,15 @@ ee_canvas_output_set(Ewl_Embed *emb, int x, int y, int width, int height)
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use buffer engine for rendering.\n");
- exit(-1);
+ fprintf(stderr, "Unable to use buffer engine for rendering.\n");
+ exit(-1);
}
o = EWL_OBJECT(emb);
bufinfo = (Evas_Engine_Info_Buffer *)info;
bufinfo->info.dest_buffer_row_bytes = sizeof(int) * width;
bufinfo->info.dest_buffer = realloc(bufinfo->info.dest_buffer,
- bufinfo->info.dest_buffer_row_bytes * height);
+ bufinfo->info.dest_buffer_row_bytes * height);
evas_engine_info_set(evas, info);
@@ -170,14 +170,14 @@ ee_canvas_render(Ewl_Embed *embed)
DCHECK_PARAM_PTR(embed);
if (embed->canvas) {
- Evas_List *updates;
-
- updates = evas_render_updates(embed->canvas);
- if (updates) {
- ewl_callback_call(EWL_WIDGET(embed),
- EWL_CALLBACK_VALUE_CHANGED);
- evas_render_updates_free(updates);
- }
+ Evas_List *updates;
+
+ updates = evas_render_updates(embed->canvas);
+ if (updates) {
+ ewl_callback_call(EWL_WIDGET(embed),
+ EWL_CALLBACK_VALUE_CHANGED);
+ evas_render_updates_free(updates);
+ }
}
DRETURN(DLEVEL_STABLE);
diff --git a/src/engines/evas_fb/Ewl_Engine_Evas_Fb.h b/src/engines/evas_fb/Ewl_Engine_Evas_Fb.h
index d36ddaf..afbc04c 100644
--- a/src/engines/evas_fb/Ewl_Engine_Evas_Fb.h
+++ b/src/engines/evas_fb/Ewl_Engine_Evas_Fb.h
@@ -8,7 +8,7 @@
#include <Evas_Engine_FB.h>
#define EWL_ENGINE_EVAS_FB(engine) \
- ((Ewl_Engine_Evas_Fb *)engine)
+ ((Ewl_Engine_Evas_Fb *)engine)
typedef struct Ewl_Engine_Evas_Fb Ewl_Engine_Evas_Fb;
struct Ewl_Engine_Evas_Fb
diff --git a/src/engines/evas_fb/ewl_engine_evas_fb.c b/src/engines/evas_fb/ewl_engine_evas_fb.c
index 8c920c6..0d98cff 100644
--- a/src/engines/evas_fb/ewl_engine_evas_fb.c
+++ b/src/engines/evas_fb/ewl_engine_evas_fb.c
@@ -22,8 +22,8 @@ static void ee_shutdown(Ewl_Engine *engine);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
Ecore_DList *
@@ -48,12 +48,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Fb, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -68,33 +68,33 @@ ee_init(Ewl_Engine *engine)
DCHECK_PARAM_PTR_RET(engine, TRUE);
if (ee_key_down_handler)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (!ecore_fb_init(NULL))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ee_key_down_handler = ecore_event_handler_add(
- ECORE_FB_EVENT_KEY_DOWN,
- ewl_ev_fb_key_down, engine);
+ ECORE_FB_EVENT_KEY_DOWN,
+ ewl_ev_fb_key_down, engine);
ee_key_up_handler = ecore_event_handler_add(
- ECORE_FB_EVENT_KEY_UP,
- ewl_ev_fb_key_up, engine);
+ ECORE_FB_EVENT_KEY_UP,
+ ewl_ev_fb_key_up, engine);
ee_mouse_down_handler = ecore_event_handler_add(
- ECORE_FB_EVENT_MOUSE_BUTTON_DOWN,
- ewl_ev_fb_mouse_down, engine);
+ ECORE_FB_EVENT_MOUSE_BUTTON_DOWN,
+ ewl_ev_fb_mouse_down, engine);
ee_mouse_up_handler = ecore_event_handler_add(
- ECORE_FB_EVENT_MOUSE_BUTTON_UP,
- ewl_ev_fb_mouse_up, engine);
+ ECORE_FB_EVENT_MOUSE_BUTTON_UP,
+ ewl_ev_fb_mouse_up, engine);
ee_mouse_move_handler = ecore_event_handler_add(
- ECORE_FB_EVENT_MOUSE_MOVE,
- ewl_ev_fb_mouse_move, engine);
+ ECORE_FB_EVENT_MOUSE_MOVE,
+ ewl_ev_fb_mouse_move, engine);
if (!ee_key_down_handler || !ee_key_up_handler
- || !ee_mouse_down_handler || !ee_mouse_up_handler
- || !ee_mouse_move_handler)
+ || !ee_mouse_down_handler || !ee_mouse_up_handler
+ || !ee_mouse_move_handler)
{
- ee_shutdown(engine);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ ee_shutdown(engine);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
info = NEW(Ewl_Engine_Info, 1);
@@ -113,23 +113,23 @@ ee_shutdown(Ewl_Engine *engine)
DCHECK_PARAM_PTR(engine);
if (ee_key_down_handler)
- ecore_event_handler_del(ee_key_down_handler);
+ ecore_event_handler_del(ee_key_down_handler);
ee_key_down_handler = NULL;
if (ee_key_up_handler)
- ecore_event_handler_del(ee_key_up_handler);
+ ecore_event_handler_del(ee_key_up_handler);
ee_key_up_handler = NULL;
if (ee_mouse_down_handler)
- ecore_event_handler_del(ee_mouse_down_handler);
+ ecore_event_handler_del(ee_mouse_down_handler);
ee_mouse_down_handler = NULL;
if (ee_mouse_up_handler)
- ecore_event_handler_del(ee_mouse_up_handler);
+ ecore_event_handler_del(ee_mouse_up_handler);
ee_mouse_up_handler = NULL;
if (ee_mouse_move_handler)
- ecore_event_handler_del(ee_mouse_move_handler);
+ ecore_event_handler_del(ee_mouse_move_handler);
ee_mouse_move_handler = NULL;
ecore_fb_shutdown();
@@ -157,8 +157,8 @@ ee_canvas_setup(Ewl_Window *win, int debug __UNUSED__)
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use evas_fb engine for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use evas_fb engine for rendering, ");
+ exit(-1);
}
win->window = fbinfo = (Evas_Engine_Info_FB *)info;
@@ -173,11 +173,11 @@ ee_canvas_setup(Ewl_Window *win, int debug __UNUSED__)
o = EWL_OBJECT(win);
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
EWL_ENGINE_EVAS_FB(EWL_EMBED(win)->engine)->window = win;
@@ -199,7 +199,7 @@ ewl_ev_fb_key_down(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_embed_key_down_feed(embed, ev->keyname, ewl_ev_modifiers_get());
@@ -220,7 +220,7 @@ ewl_ev_fb_key_up(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_embed_key_down_feed(embed, ev->keyname, ewl_ev_modifiers_get());
@@ -243,12 +243,12 @@ ewl_ev_fb_mouse_down(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (ev->double_click)
- clicks = 2;
+ clicks = 2;
if (ev->triple_click)
- clicks = 3;
+ clicks = 3;
key_modifiers = ewl_ev_modifiers_get();
@@ -257,7 +257,7 @@ ewl_ev_fb_mouse_down(void *data, int type __UNUSED__, void *e)
ewl_embed_mouse_move_feed(embed, ev->x, ev->y, key_modifiers);
ewl_embed_mouse_down_feed(embed, ev->button, clicks, ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -277,7 +277,7 @@ ewl_ev_fb_mouse_up(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_move_feed(embed, ev->x, ev->y, key_modifiers);
@@ -300,10 +300,10 @@ ewl_ev_fb_mouse_move(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_embed_mouse_move_feed(embed, ev->x, ev->y,
- ewl_ev_modifiers_get());
+ ewl_ev_modifiers_get());
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
diff --git a/src/engines/evas_gl_glew/Ewl_Engine_Evas_Gl_Glew.h b/src/engines/evas_gl_glew/Ewl_Engine_Evas_Gl_Glew.h
index 398bfad..6e8f4bb 100644
--- a/src/engines/evas_gl_glew/Ewl_Engine_Evas_Gl_Glew.h
+++ b/src/engines/evas_gl_glew/Ewl_Engine_Evas_Gl_Glew.h
@@ -8,7 +8,7 @@
#include <Ecore_Win32.h>
#define EWL_ENGINE_EVAS_GL_GLEW(engine) \
- ((Ewl_Engine_Evas_Gl_Glew *)engine)
+ ((Ewl_Engine_Evas_Gl_Glew *)engine)
typedef struct Ewl_Engine_Evas_Gl_Glew Ewl_Engine_Evas_Gl_Glew;
struct Ewl_Engine_Evas_Gl_Glew
diff --git a/src/engines/evas_gl_glew/ewl_engine_evas_gl_glew.c b/src/engines/evas_gl_glew/ewl_engine_evas_gl_glew.c
index 951142a..1af7250 100644
--- a/src/engines/evas_gl_glew/ewl_engine_evas_gl_glew.c
+++ b/src/engines/evas_gl_glew/ewl_engine_evas_gl_glew.c
@@ -11,8 +11,8 @@ static void ee_canvas_setup(Ewl_Window *win, int debug);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
Ecore_DList *
@@ -38,12 +38,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Gl_Glew, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -91,9 +91,9 @@ ee_canvas_setup(Ewl_Window *win, int debug)
if (!ecore_win32_glew_init(win->window))
{
- fprintf(stderr, "[Ewl] Unable to set OpenGL Glew data "
- "for rendering, ");
- exit(-1);
+ fprintf(stderr, "[Ewl] Unable to set OpenGL Glew data "
+ "for rendering, ");
+ exit(-1);
}
evas = evas_new();
@@ -102,8 +102,8 @@ ee_canvas_setup(Ewl_Window *win, int debug)
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use gl_glew engine for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use gl_glew engine for rendering, ");
+ exit(-1);
}
glinfo = (Evas_Engine_Info_GL_Glew *)info;
@@ -115,11 +115,11 @@ ee_canvas_setup(Ewl_Window *win, int debug)
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/engines/evas_gl_x11/Ewl_Engine_Evas_Gl_X11.h b/src/engines/evas_gl_x11/Ewl_Engine_Evas_Gl_X11.h
index fd48e68..bdc59b8 100644
--- a/src/engines/evas_gl_x11/Ewl_Engine_Evas_Gl_X11.h
+++ b/src/engines/evas_gl_x11/Ewl_Engine_Evas_Gl_X11.h
@@ -8,7 +8,7 @@
#include <Evas_Engine_GL_X11.h>
#define EWL_ENGINE_EVAS_GL_X11(engine) \
- ((Ewl_Engine_Evas_Gl_X11 *)engine)
+ ((Ewl_Engine_Evas_Gl_X11 *)engine)
typedef struct Ewl_Engine_Evas_Gl_X11 Ewl_Engine_Evas_Gl_X11;
struct Ewl_Engine_Evas_Gl_X11
diff --git a/src/engines/evas_gl_x11/ewl_engine_evas_gl_x11.c b/src/engines/evas_gl_x11/ewl_engine_evas_gl_x11.c
index a18a5a3..cce9e2d 100644
--- a/src/engines/evas_gl_x11/ewl_engine_evas_gl_x11.c
+++ b/src/engines/evas_gl_x11/ewl_engine_evas_gl_x11.c
@@ -11,8 +11,8 @@ static void ee_canvas_setup(Ewl_Window *win, int debug);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
Ecore_DList *
@@ -38,12 +38,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Gl_X11, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -95,33 +95,33 @@ ee_canvas_setup(Ewl_Window *win, int debug)
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use gl_x11 engine for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use gl_x11 engine for rendering, ");
+ exit(-1);
}
glinfo = (Evas_Engine_Info_GL_X11 *)info;
glinfo->info.display = ecore_x_display_get();
glinfo->info.visual = glinfo->func.best_visual_get(
- glinfo->info.display,
- DefaultScreen(glinfo->info.display));
+ glinfo->info.display,
+ DefaultScreen(glinfo->info.display));
glinfo->info.colormap = glinfo->func.best_colormap_get(
- glinfo->info.display,
- DefaultScreen(glinfo->info.display));
+ glinfo->info.display,
+ DefaultScreen(glinfo->info.display));
glinfo->info.drawable = (Ecore_X_Window)win->window;
glinfo->info.depth = glinfo->func.best_depth_get(
- glinfo->info.display,
- DefaultScreen(glinfo->info.display));
+ glinfo->info.display,
+ DefaultScreen(glinfo->info.display));
o = EWL_OBJECT(win);
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/engines/evas_software_16_x11/Ewl_Engine_Evas_Software_16_X11.h b/src/engines/evas_software_16_x11/Ewl_Engine_Evas_Software_16_X11.h
index 3b4c288..09d94f0 100644
--- a/src/engines/evas_software_16_x11/Ewl_Engine_Evas_Software_16_X11.h
+++ b/src/engines/evas_software_16_x11/Ewl_Engine_Evas_Software_16_X11.h
@@ -8,7 +8,7 @@
#include <Evas_Engine_Software_16_X11.h>
#define EWL_ENGINE_EVAS_SOFTWARE_16_X11(engine) \
- ((Ewl_Engine_Evas_Software_16_X11 *)engine)
+ ((Ewl_Engine_Evas_Software_16_X11 *)engine)
typedef struct Ewl_Engine_Evas_Software_16_X11 Ewl_Engine_Evas_Software_16_X11;
struct Ewl_Engine_Evas_Software_16_X11
diff --git a/src/engines/evas_software_16_x11/ewl_engine_evas_software_16_x11.c b/src/engines/evas_software_16_x11/ewl_engine_evas_software_16_x11.c
index 47e39b0..84c8362 100644
--- a/src/engines/evas_software_16_x11/ewl_engine_evas_software_16_x11.c
+++ b/src/engines/evas_software_16_x11/ewl_engine_evas_software_16_x11.c
@@ -10,8 +10,8 @@ static void ee_shutdown(Ewl_Engine *engine);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
Ecore_DList *
@@ -37,12 +37,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Software_16_X11, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -92,14 +92,14 @@ ee_canvas_setup(Ewl_Window *win, int debug)
evas = evas_new();
evas_output_method_set(evas,
- evas_render_method_lookup("software_16_x11"));
+ evas_render_method_lookup("software_16_x11"));
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use software_16_x11 engine "
- "for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use software_16_x11 engine "
+ "for rendering, ");
+ exit(-1);
}
sinfo = (Evas_Engine_Info_Software_16_X11 *)info;
@@ -110,11 +110,11 @@ ee_canvas_setup(Ewl_Window *win, int debug)
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/engines/evas_software_sdl/Ewl_Engine_Evas_Software_SDL.h b/src/engines/evas_software_sdl/Ewl_Engine_Evas_Software_SDL.h
index 4cb79cb..5339ab9 100644
--- a/src/engines/evas_software_sdl/Ewl_Engine_Evas_Software_SDL.h
+++ b/src/engines/evas_software_sdl/Ewl_Engine_Evas_Software_SDL.h
@@ -8,7 +8,7 @@
#include <Evas_Engine_SDL.h>
#define EWL_ENGINE_EVAS_SOFTWARE_SDL(engine) \
- ((Ewl_Engine_Evas_Software_SDL *)engine)
+ ((Ewl_Engine_Evas_Software_SDL *)engine)
typedef struct Ewl_Engine_Evas_Software_SDL Ewl_Engine_Evas_Software_SDL;
struct Ewl_Engine_Evas_Software_SDL
diff --git a/src/engines/evas_software_sdl/ewl_engine_evas_software_sdl.c b/src/engines/evas_software_sdl/ewl_engine_evas_software_sdl.c
index fc382a9..01359ce 100644
--- a/src/engines/evas_software_sdl/ewl_engine_evas_software_sdl.c
+++ b/src/engines/evas_software_sdl/ewl_engine_evas_software_sdl.c
@@ -24,8 +24,8 @@ static void ee_shutdown(Ewl_Engine *engine);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
Ecore_DList *
@@ -50,12 +50,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Software_SDL, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -85,33 +85,33 @@ ee_init(Ewl_Engine *engine)
DCHECK_PARAM_PTR_RET(engine, TRUE);
if (ee_key_down_handler)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (!ecore_sdl_init(NULL))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ee_key_down_handler = ecore_event_handler_add(
- ECORE_SDL_EVENT_KEY_DOWN,
- ewl_ev_sdl_key_down, engine);
+ ECORE_SDL_EVENT_KEY_DOWN,
+ ewl_ev_sdl_key_down, engine);
ee_key_up_handler = ecore_event_handler_add(
- ECORE_SDL_EVENT_KEY_UP,
- ewl_ev_sdl_key_up, engine);
+ ECORE_SDL_EVENT_KEY_UP,
+ ewl_ev_sdl_key_up, engine);
ee_mouse_down_handler = ecore_event_handler_add(
- ECORE_SDL_EVENT_MOUSE_BUTTON_DOWN,
- ewl_ev_sdl_mouse_down, engine);
+ ECORE_SDL_EVENT_MOUSE_BUTTON_DOWN,
+ ewl_ev_sdl_mouse_down, engine);
ee_mouse_up_handler = ecore_event_handler_add(
- ECORE_SDL_EVENT_MOUSE_BUTTON_UP,
- ewl_ev_sdl_mouse_up, engine);
+ ECORE_SDL_EVENT_MOUSE_BUTTON_UP,
+ ewl_ev_sdl_mouse_up, engine);
ee_mouse_move_handler = ecore_event_handler_add(
- ECORE_SDL_EVENT_MOUSE_MOVE,
- ewl_ev_sdl_mouse_move, engine);
+ ECORE_SDL_EVENT_MOUSE_MOVE,
+ ewl_ev_sdl_mouse_move, engine);
if (!ee_key_down_handler || !ee_key_up_handler
- || !ee_mouse_down_handler || !ee_mouse_up_handler
- || !ee_mouse_move_handler)
+ || !ee_mouse_down_handler || !ee_mouse_up_handler
+ || !ee_mouse_move_handler)
{
- ee_shutdown(engine);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ ee_shutdown(engine);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
info = NEW(Ewl_Engine_Info, 1);
@@ -130,23 +130,23 @@ ee_shutdown(Ewl_Engine *engine)
DCHECK_PARAM_PTR(engine);
if (ee_key_down_handler)
- ecore_event_handler_del(ee_key_down_handler);
+ ecore_event_handler_del(ee_key_down_handler);
ee_key_down_handler = NULL;
if (ee_key_up_handler)
- ecore_event_handler_del(ee_key_up_handler);
+ ecore_event_handler_del(ee_key_up_handler);
ee_key_up_handler = NULL;
if (ee_mouse_down_handler)
- ecore_event_handler_del(ee_mouse_down_handler);
+ ecore_event_handler_del(ee_mouse_down_handler);
ee_mouse_down_handler = NULL;
if (ee_mouse_up_handler)
- ecore_event_handler_del(ee_mouse_up_handler);
+ ecore_event_handler_del(ee_mouse_up_handler);
ee_mouse_up_handler = NULL;
if (ee_mouse_move_handler)
- ecore_event_handler_del(ee_mouse_move_handler);
+ ecore_event_handler_del(ee_mouse_move_handler);
ee_mouse_move_handler = NULL;
ecore_timer_del(ewl_event);
@@ -175,8 +175,8 @@ ee_canvas_setup(Ewl_Window *win, int debug __UNUSED__)
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use evas_software_sdl engine for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use evas_software_sdl engine for rendering, ");
+ exit(-1);
}
win->window = sdlinfo = (Evas_Engine_Info_SDL *)info;
@@ -190,11 +190,11 @@ ee_canvas_setup(Ewl_Window *win, int debug __UNUSED__)
o = EWL_OBJECT(win);
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ecore_idler_add(ewl_idler_event_setup, NULL);
@@ -219,7 +219,7 @@ ewl_ev_sdl_key_down(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_embed_key_down_feed(embed, ev->keyname, ewl_ev_modifiers_get());
@@ -240,7 +240,7 @@ ewl_ev_sdl_key_up(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_embed_key_down_feed(embed, ev->keyname, ewl_ev_modifiers_get());
@@ -263,12 +263,12 @@ ewl_ev_sdl_mouse_down(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (ev->double_click)
- clicks = 2;
+ clicks = 2;
if (ev->triple_click)
- clicks = 3;
+ clicks = 3;
key_modifiers = ewl_ev_modifiers_get();
@@ -277,7 +277,7 @@ ewl_ev_sdl_mouse_down(void *data, int type __UNUSED__, void *e)
ewl_embed_mouse_move_feed(embed, ev->x, ev->y, key_modifiers);
ewl_embed_mouse_down_feed(embed, ev->button, clicks, ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -297,7 +297,7 @@ ewl_ev_sdl_mouse_up(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_move_feed(embed, ev->x, ev->y, key_modifiers);
@@ -320,10 +320,10 @@ ewl_ev_sdl_mouse_move(void *data, int type __UNUSED__, void *e)
embed = EWL_EMBED(engine->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_embed_mouse_move_feed(embed, ev->x, ev->y,
- ewl_ev_modifiers_get());
+ ewl_ev_modifiers_get());
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
diff --git a/src/engines/evas_software_x11/Ewl_Engine_Evas_Software_X11.h b/src/engines/evas_software_x11/Ewl_Engine_Evas_Software_X11.h
index 4923a5a..bfe4746 100644
--- a/src/engines/evas_software_x11/Ewl_Engine_Evas_Software_X11.h
+++ b/src/engines/evas_software_x11/Ewl_Engine_Evas_Software_X11.h
@@ -8,7 +8,7 @@
#include <Evas_Engine_Software_X11.h>
#define EWL_ENGINE_EVAS_SOFTWARE_X11(engine) \
- ((Ewl_Engine_Evas_Software_X11 *)engine)
+ ((Ewl_Engine_Evas_Software_X11 *)engine)
typedef struct Ewl_Engine_Evas_Software_X11 Ewl_Engine_Evas_Software_X11;
struct Ewl_Engine_Evas_Software_X11
diff --git a/src/engines/evas_software_x11/ewl_engine_evas_software_x11.c b/src/engines/evas_software_x11/ewl_engine_evas_software_x11.c
index b9df4e0..38c81b6 100644
--- a/src/engines/evas_software_x11/ewl_engine_evas_software_x11.c
+++ b/src/engines/evas_software_x11/ewl_engine_evas_software_x11.c
@@ -10,8 +10,8 @@ static void ee_shutdown(Ewl_Engine *engine);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
Ecore_DList *
@@ -37,12 +37,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Software_X11, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -92,37 +92,37 @@ ee_canvas_setup(Ewl_Window *win, int debug)
evas = evas_new();
evas_output_method_set(evas,
- evas_render_method_lookup("software_x11"));
+ evas_render_method_lookup("software_x11"));
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use software_x11 engine "
- "for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use software_x11 engine "
+ "for rendering, ");
+ exit(-1);
}
sinfo = (Evas_Engine_Info_Software_X11 *)info;
sinfo->info.display = ecore_x_display_get();
sinfo->info.visual = DefaultVisual(sinfo->info.display,
- DefaultScreen(sinfo->info.display));
+ DefaultScreen(sinfo->info.display));
sinfo->info.colormap = DefaultColormap(sinfo->info.display,
- DefaultScreen(sinfo->info.display));
+ DefaultScreen(sinfo->info.display));
sinfo->info.drawable = (Ecore_X_Window)win->window;
sinfo->info.depth = DefaultDepth(sinfo->info.display,
- DefaultScreen(sinfo->info.display));
+ DefaultScreen(sinfo->info.display));
sinfo->info.rotation = 0;
sinfo->info.debug = debug;
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/engines/evas_software_xcb/Ewl_Engine_Evas_Software_Xcb.h b/src/engines/evas_software_xcb/Ewl_Engine_Evas_Software_Xcb.h
index f536b14..9e45297 100644
--- a/src/engines/evas_software_xcb/Ewl_Engine_Evas_Software_Xcb.h
+++ b/src/engines/evas_software_xcb/Ewl_Engine_Evas_Software_Xcb.h
@@ -8,7 +8,7 @@
#include <Evas_Engine_Software_Xcb.h>
#define EWL_ENGINE_EVAS_SOFTWARE_XCB(engine) \
- ((Ewl_Engine_Evas_Software_Xcb *)engine)
+ ((Ewl_Engine_Evas_Software_Xcb *)engine)
typedef struct Ewl_Engine_Evas_Software_Xcb Ewl_Engine_Evas_Software_Xcb;
struct Ewl_Engine_Evas_Software_Xcb
diff --git a/src/engines/evas_software_xcb/ewl_engine_evas_software_xcb.c b/src/engines/evas_software_xcb/ewl_engine_evas_software_xcb.c
index c7e5de4..2f4612b 100644
--- a/src/engines/evas_software_xcb/ewl_engine_evas_software_xcb.c
+++ b/src/engines/evas_software_xcb/ewl_engine_evas_software_xcb.c
@@ -10,8 +10,8 @@ static void ee_shutdown(Ewl_Engine *engine);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
static xcb_visualtype_t *
@@ -60,12 +60,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Software_Xcb, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -115,14 +115,14 @@ ee_canvas_setup(Ewl_Window *win, int debug)
evas = evas_new();
evas_output_method_set(evas,
- evas_render_method_lookup("software_xcb"));
+ evas_render_method_lookup("software_xcb"));
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use software_xcb engine "
- "for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use software_xcb engine "
+ "for rendering, ");
+ exit(-1);
}
sinfo = (Evas_Engine_Info_Software_Xcb *)info;
@@ -130,7 +130,7 @@ ee_canvas_setup(Ewl_Window *win, int debug)
sinfo->info.conn = ecore_x_connection_get();
sinfo->info.screen = ecore_x_default_screen_get();
sinfo->info.visual = visualtype_get(sinfo->info.conn,
- sinfo->info.screen);
+ sinfo->info.screen);
sinfo->info.colormap = sinfo->info.screen->default_colormap;
sinfo->info.drawable = (Ecore_X_Window)win->window;
sinfo->info.depth = sinfo->info.screen->root_depth;
@@ -140,11 +140,11 @@ ee_canvas_setup(Ewl_Window *win, int debug)
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/engines/evas_xrender_x11/Ewl_Engine_Evas_Xrender_X11.h b/src/engines/evas_xrender_x11/Ewl_Engine_Evas_Xrender_X11.h
index 649e0e0..eb43207 100644
--- a/src/engines/evas_xrender_x11/Ewl_Engine_Evas_Xrender_X11.h
+++ b/src/engines/evas_xrender_x11/Ewl_Engine_Evas_Xrender_X11.h
@@ -8,7 +8,7 @@
#include <Evas_Engine_XRender_X11.h>
#define EWL_ENGINE_EVAS_XRENDER_X11(engine) \
- ((Ewl_Engine_Evas_Xrender_X11 *)engine)
+ ((Ewl_Engine_Evas_Xrender_X11 *)engine)
typedef struct Ewl_Engine_Evas_Xrender_X11 Ewl_Engine_Evas_Xrender_X11;
struct Ewl_Engine_Evas_Xrender_X11
diff --git a/src/engines/evas_xrender_x11/ewl_engine_evas_xrender_x11.c b/src/engines/evas_xrender_x11/ewl_engine_evas_xrender_x11.c
index c987eb8..7948a84 100644
--- a/src/engines/evas_xrender_x11/ewl_engine_evas_xrender_x11.c
+++ b/src/engines/evas_xrender_x11/ewl_engine_evas_xrender_x11.c
@@ -11,8 +11,8 @@ static void ee_shutdown(Ewl_Engine *engine);
static void *canvas_funcs[EWL_ENGINE_CANVAS_MAX] =
{
- ee_canvas_setup,
- NULL, NULL, NULL, NULL
+ ee_canvas_setup,
+ NULL, NULL, NULL, NULL
};
Ecore_DList *
@@ -38,12 +38,12 @@ ewl_engine_create(int *argc __UNUSED__, char ** argv __UNUSED__)
engine = NEW(Ewl_Engine_Evas_Xrender_X11, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine)))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -93,31 +93,31 @@ ee_canvas_setup(Ewl_Window *win, int debug __UNUSED__)
evas = evas_new();
evas_output_method_set(evas,
- evas_render_method_lookup("xrender_x11"));
+ evas_render_method_lookup("xrender_x11"));
info = evas_engine_info_get(evas);
if (!info)
{
- fprintf(stderr, "Unable to use xrender_x11 engine "
- "for rendering, ");
- exit(-1);
+ fprintf(stderr, "Unable to use xrender_x11 engine "
+ "for rendering, ");
+ exit(-1);
}
sinfo = (Evas_Engine_Info_XRender_X11 *)info;
sinfo->info.display = ecore_x_display_get();
sinfo->info.visual = DefaultVisual(sinfo->info.display,
- DefaultScreen(sinfo->info.display));
+ DefaultScreen(sinfo->info.display));
sinfo->info.drawable = (Ecore_X_Window)win->window;
evas_engine_info_set(evas, info);
evas_output_size_set(evas, ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_h_get(o));
evas_output_viewport_set(evas, ewl_object_current_x_get(o),
- ewl_object_current_y_get(o),
- ewl_object_current_w_get(o),
- ewl_object_current_h_get(o));
+ ewl_object_current_y_get(o),
+ ewl_object_current_w_get(o),
+ ewl_object_current_h_get(o));
ewl_embed_canvas_set(EWL_EMBED(win), evas, win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/engines/win32/ewl_engine_win32.c b/src/engines/win32/ewl_engine_win32.c
index 75278e6..ad24d11 100644
--- a/src/engines/win32/ewl_engine_win32.c
+++ b/src/engines/win32/ewl_engine_win32.c
@@ -53,8 +53,8 @@ static void ee_window_dialog_set(Ewl_Window *win);
static void ee_window_states_set(Ewl_Window *win);
static void ee_window_state_request(Ewl_Window *win, int states);
static void ee_window_state_handle(Ewl_Window *win, int states,
- Ewl_Window_Flags ewl_flag,
- Ecore_Win32_Window_State ecore_flag);
+ Ewl_Window_Flags ewl_flag,
+ Ecore_Win32_Window_State ecore_flag);
static void ee_window_states_set_helper(Ewl_Window *win);
static void ee_window_hints_set(Ewl_Window *win);
static void ee_window_transient_for(Ewl_Window *win);
@@ -71,43 +71,43 @@ static int ee_pointer_get(Ewl_Embed *embed);
static void *window_funcs[EWL_ENGINE_WINDOW_MAX] =
{
- ee_window_new,
- ee_window_destroy,
- ee_window_move,
- ee_window_resize,
- ee_window_min_max_size_set,
- ee_window_show,
- ee_window_hide,
- ee_window_title_set,
- NULL,
- ee_window_borderless_set,
- ee_window_dialog_set,
- ee_window_states_set,
- ee_window_hints_set,
- ee_window_transient_for,
- ee_window_leader_set,
- ee_window_raise,
- ee_window_lower,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- ee_window_geometry_set,
- NULL,
- ee_desktop_size_get,
- NULL,
- NULL,
- NULL,
- NULL,
+ ee_window_new,
+ ee_window_destroy,
+ ee_window_move,
+ ee_window_resize,
+ ee_window_min_max_size_set,
+ ee_window_show,
+ ee_window_hide,
+ ee_window_title_set,
+ NULL,
+ ee_window_borderless_set,
+ ee_window_dialog_set,
+ ee_window_states_set,
+ ee_window_hints_set,
+ ee_window_transient_for,
+ ee_window_leader_set,
+ ee_window_raise,
+ ee_window_lower,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ee_window_geometry_set,
+ NULL,
+ ee_desktop_size_get,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
};
static void *pointer_funcs[EWL_ENGINE_POINTER_MAX] =
{
- ee_pointer_data_new,
- ee_pointer_free,
- ee_pointer_get,
- ee_pointer_set,
+ ee_pointer_data_new,
+ ee_pointer_free,
+ ee_pointer_get,
+ ee_pointer_set,
};
Ecore_DList *
@@ -127,12 +127,12 @@ ewl_engine_create(int *argc, char ** argv)
engine = NEW(Ewl_Engine_Win32, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine), argc, argv))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -149,53 +149,53 @@ ee_init(Ewl_Engine *engine, int *argc, char ** argv)
printf (" **** ee_init\n");
/* If the event handlers are already setup don't do it again */
if (ee_expose_handler)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
printf (" **** ee_init : ecore_win32_init\n");
if (!ecore_win32_init())
{
- fprintf(stderr, "Unable to initialize Ecore Win32.\n"
- "Is your DISPLAY variable set correctly?\n\n");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ fprintf(stderr, "Unable to initialize Ecore Win32.\n"
+ "Is your DISPLAY variable set correctly?\n\n");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
printf (" **** ee_init : events : damage, configure, delete\n");
ee_expose_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_WINDOW_DAMAGE,
- ewl_ev_win32_window_expose, NULL);
+ ECORE_WIN32_EVENT_WINDOW_DAMAGE,
+ ewl_ev_win32_window_expose, NULL);
ee_configure_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_WINDOW_CONFIGURE,
- ewl_ev_win32_window_configure, NULL);
+ ECORE_WIN32_EVENT_WINDOW_CONFIGURE,
+ ewl_ev_win32_window_configure, NULL);
ee_delete_request_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST,
- ewl_ev_win32_window_delete, NULL);
+ ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST,
+ ewl_ev_win32_window_delete, NULL);
/*
* Register dispatching functions for keyboard events.
*/
ee_key_down_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_KEY_DOWN,
- ewl_ev_win32_key_down, NULL);
+ ECORE_WIN32_EVENT_KEY_DOWN,
+ ewl_ev_win32_key_down, NULL);
ee_key_up_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_KEY_UP,
- ewl_ev_win32_key_up, NULL);
+ ECORE_WIN32_EVENT_KEY_UP,
+ ewl_ev_win32_key_up, NULL);
/*
* Register dispatching functions for DND events
*/
/*
ee_dnd_position_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_XDND_POSITION,
- ewl_ev_dnd_position, NULL);
+ ECORE_WIN32_EVENT_XDND_POSITION,
+ ewl_ev_dnd_position, NULL);
ee_dnd_enter_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_XDND_ENTER,
- ewl_ev_dnd_enter, NULL);
+ ECORE_WIN32_EVENT_XDND_ENTER,
+ ewl_ev_dnd_enter, NULL);
ee_dnd_leave_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_XDND_LEAVE,
- ewl_ev_dnd_leave, NULL);
+ ECORE_WIN32_EVENT_XDND_LEAVE,
+ ewl_ev_dnd_leave, NULL);
ee_dnd_drop_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_XDND_DROP,
- ewl_ev_dnd_drop, NULL);
+ ECORE_WIN32_EVENT_XDND_DROP,
+ ewl_ev_dnd_drop, NULL);
*/
/*
@@ -203,8 +203,8 @@ ee_init(Ewl_Engine *engine, int *argc, char ** argv)
*/
/*
ee_selection_notify_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_SELECTION_NOTIFY,
- ewl_ev_win32_data_received, NULL);
+ ECORE_WIN32_EVENT_SELECTION_NOTIFY,
+ ewl_ev_win32_data_received, NULL);
*/
/*
@@ -212,47 +212,47 @@ ee_init(Ewl_Engine *engine, int *argc, char ** argv)
*/
/*
ee_selection_request_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_SELECTION_REQUEST,
- ewl_ev_win32_data_request, NULL);
+ ECORE_WIN32_EVENT_SELECTION_REQUEST,
+ ewl_ev_win32_data_request, NULL);
*/
/*
* Finally, register dispatching functions for mouse events.
*/
ee_mouse_down_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN,
- ewl_ev_win32_mouse_down, NULL);
+ ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN,
+ ewl_ev_win32_mouse_down, NULL);
ee_mouse_up_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_MOUSE_BUTTON_UP,
- ewl_ev_win32_mouse_up, NULL);
+ ECORE_WIN32_EVENT_MOUSE_BUTTON_UP,
+ ewl_ev_win32_mouse_up, NULL);
ee_mouse_move_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_MOUSE_MOVE,
- ewl_ev_win32_mouse_move, NULL);
+ ECORE_WIN32_EVENT_MOUSE_MOVE,
+ ewl_ev_win32_mouse_move, NULL);
ee_mouse_wheel_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_MOUSE_WHEEL,
- ewl_ev_win32_mouse_wheel, NULL);
+ ECORE_WIN32_EVENT_MOUSE_WHEEL,
+ ewl_ev_win32_mouse_wheel, NULL);
ee_mouse_out_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_MOUSE_OUT,
- ewl_ev_win32_mouse_out, NULL);
+ ECORE_WIN32_EVENT_MOUSE_OUT,
+ ewl_ev_win32_mouse_out, NULL);
ee_focus_in_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_WINDOW_FOCUS_IN,
- ewl_ev_win32_focus_in, NULL);
+ ECORE_WIN32_EVENT_WINDOW_FOCUS_IN,
+ ewl_ev_win32_focus_in, NULL);
ee_focus_out_handler = ecore_event_handler_add(
- ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT,
- ewl_ev_win32_focus_out, NULL);
+ ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT,
+ ewl_ev_win32_focus_out, NULL);
if (!ee_expose_handler || !ee_configure_handler
- || !ee_delete_request_handler
- || !ee_key_down_handler || !ee_key_up_handler
- || !ee_mouse_down_handler
- || !ee_mouse_up_handler || !ee_mouse_move_handler
- || !ee_mouse_wheel_handler || !ee_mouse_out_handler
- || !ee_focus_in_handler || !ee_focus_out_handler)
+ || !ee_delete_request_handler
+ || !ee_key_down_handler || !ee_key_up_handler
+ || !ee_mouse_down_handler
+ || !ee_mouse_up_handler || !ee_mouse_move_handler
+ || !ee_mouse_wheel_handler || !ee_mouse_out_handler
+ || !ee_focus_in_handler || !ee_focus_out_handler)
{
- ee_shutdown(EWL_ENGINE(engine));
+ ee_shutdown(EWL_ENGINE(engine));
- fprintf(stderr, "Unable to create Ecore Win32 event handlers.\n");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ fprintf(stderr, "Unable to create Ecore Win32 event handlers.\n");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
info = NEW(Ewl_Engine_Info, 1);
@@ -274,77 +274,77 @@ ee_shutdown(Ewl_Engine *engine)
printf (" **** ee_shutdown\n");
if (ee_expose_handler)
- ecore_event_handler_del(ee_expose_handler);
+ ecore_event_handler_del(ee_expose_handler);
ee_expose_handler = NULL;
if (ee_configure_handler)
- ecore_event_handler_del(ee_configure_handler);
+ ecore_event_handler_del(ee_configure_handler);
ee_configure_handler = NULL;
if (ee_delete_request_handler)
- ecore_event_handler_del(ee_delete_request_handler);
+ ecore_event_handler_del(ee_delete_request_handler);
ee_delete_request_handler = NULL;
if (ee_key_down_handler)
- ecore_event_handler_del(ee_key_down_handler);
+ ecore_event_handler_del(ee_key_down_handler);
ee_key_down_handler = NULL;
if (ee_key_up_handler)
- ecore_event_handler_del(ee_key_up_handler);
+ ecore_event_handler_del(ee_key_up_handler);
ee_key_up_handler = NULL;
/*
if (ee_dnd_position_handler)
- ecore_event_handler_del(ee_dnd_position_handler);
+ ecore_event_handler_del(ee_dnd_position_handler);
ee_dnd_position_handler = NULL;
if (ee_dnd_enter_handler)
- ecore_event_handler_del(ee_dnd_enter_handler);
+ ecore_event_handler_del(ee_dnd_enter_handler);
ee_dnd_enter_handler = NULL;
if (ee_dnd_leave_handler)
- ecore_event_handler_del(ee_dnd_leave_handler);
+ ecore_event_handler_del(ee_dnd_leave_handler);
ee_dnd_leave_handler = NULL;
if (ee_dnd_drop_handler)
- ecore_event_handler_del(ee_dnd_drop_handler);
+ ecore_event_handler_del(ee_dnd_drop_handler);
ee_dnd_drop_handler = NULL;
if (ee_selection_notify_handler)
- ecore_event_handler_del(ee_selection_notify_handler);
+ ecore_event_handler_del(ee_selection_notify_handler);
ee_selection_notify_handler = NULL;
if (ee_selection_request_handler)
- ecore_event_handler_del(ee_selection_request_handler);
+ ecore_event_handler_del(ee_selection_request_handler);
ee_selection_request_handler = NULL;
*/
if (ee_mouse_down_handler)
- ecore_event_handler_del(ee_mouse_down_handler);
+ ecore_event_handler_del(ee_mouse_down_handler);
ee_mouse_down_handler = NULL;
if (ee_mouse_up_handler)
- ecore_event_handler_del(ee_mouse_up_handler);
+ ecore_event_handler_del(ee_mouse_up_handler);
ee_mouse_up_handler = NULL;
if (ee_mouse_move_handler)
- ecore_event_handler_del(ee_mouse_move_handler);
+ ecore_event_handler_del(ee_mouse_move_handler);
ee_mouse_move_handler = NULL;
if (ee_mouse_wheel_handler)
- ecore_event_handler_del(ee_mouse_wheel_handler);
+ ecore_event_handler_del(ee_mouse_wheel_handler);
ee_mouse_wheel_handler = NULL;
if (ee_mouse_out_handler)
- ecore_event_handler_del(ee_mouse_out_handler);
+ ecore_event_handler_del(ee_mouse_out_handler);
ee_mouse_out_handler = NULL;
if (ee_focus_in_handler)
- ecore_event_handler_del(ee_focus_in_handler);
+ ecore_event_handler_del(ee_focus_in_handler);
ee_focus_in_handler = NULL;
if (ee_focus_out_handler)
- ecore_event_handler_del(ee_focus_out_handler);
+ ecore_event_handler_del(ee_focus_out_handler);
ee_focus_out_handler = NULL;
ecore_win32_shutdown();
@@ -368,20 +368,20 @@ ee_window_new(Ewl_Window *win)
ewl_object_current_h_get(EWL_OBJECT(win)));
if (win->flags & EWL_WINDOW_OVERRIDE)
- xwin = ecore_win32_window_override_new(0,
- EWL_EMBED(win)->x, EWL_EMBED(win)->y,
- ewl_object_current_w_get(EWL_OBJECT(win)),
- ewl_object_current_h_get(EWL_OBJECT(win)));
+ xwin = ecore_win32_window_override_new(0,
+ EWL_EMBED(win)->x, EWL_EMBED(win)->y,
+ ewl_object_current_w_get(EWL_OBJECT(win)),
+ ewl_object_current_h_get(EWL_OBJECT(win)));
else
- xwin = ecore_win32_window_new(0,
- EWL_EMBED(win)->x, EWL_EMBED(win)->y,
- ewl_object_current_w_get(EWL_OBJECT(win)),
- ewl_object_current_h_get(EWL_OBJECT(win)));
+ xwin = ecore_win32_window_new(0,
+ EWL_EMBED(win)->x, EWL_EMBED(win)->y,
+ ewl_object_current_w_get(EWL_OBJECT(win)),
+ ewl_object_current_h_get(EWL_OBJECT(win)));
win->window = (void *)xwin;
printf ("flags : %d %d\n", win->flags & EWL_WINDOW_OVERRIDE, win->flags & EWL_WINDOW_BORDERLESS);
if (win->flags & EWL_WINDOW_BORDERLESS)
- ee_window_borderless_set(win);
+ ee_window_borderless_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -411,8 +411,8 @@ ee_window_move(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_win32_window_move(win->window,
- EWL_EMBED(win)->x,
- EWL_EMBED(win)->y);
+ EWL_EMBED(win)->x,
+ EWL_EMBED(win)->y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -433,8 +433,8 @@ ee_window_resize(Ewl_Window *win)
ecore_win32_window_resize(win->window, width, height);
if (EWL_EMBED(win)->canvas_window != win->window)
- ecore_win32_window_resize(EWL_EMBED(win)->canvas_window,
- width, height);
+ ecore_win32_window_resize(EWL_EMBED(win)->canvas_window,
+ width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -448,11 +448,11 @@ ee_window_min_max_size_set(Ewl_Window *win)
printf ("ee_window_min_max_size_set %p\n", win->window);
ecore_win32_window_size_min_set(win->window,
- ewl_object_minimum_w_get(EWL_OBJECT(win)),
- ewl_object_minimum_h_get(EWL_OBJECT(win)));
+ ewl_object_minimum_w_get(EWL_OBJECT(win)),
+ ewl_object_minimum_h_get(EWL_OBJECT(win)));
ecore_win32_window_size_max_set(win->window,
- ewl_object_maximum_w_get(EWL_OBJECT(win)),
- ewl_object_maximum_h_get(EWL_OBJECT(win)));
+ ewl_object_maximum_w_get(EWL_OBJECT(win)),
+ ewl_object_maximum_h_get(EWL_OBJECT(win)));
ecore_win32_window_size_base_set(win->window, 0, 0);
ecore_win32_window_size_step_set(win->window, 0, 0);
@@ -506,7 +506,7 @@ ee_window_borderless_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_win32_window_borderless_set(win->window,
- (!!(win->flags & EWL_WINDOW_BORDERLESS)));
+ (!!(win->flags & EWL_WINDOW_BORDERLESS)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -519,9 +519,9 @@ ee_window_dialog_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_win32_window_type_set(win->window,
- ((!!(win->flags & EWL_WINDOW_DIALOG)) ?
- ECORE_WIN32_WINDOW_TYPE_DIALOG :
- ECORE_WIN32_WINDOW_TYPE_NORMAL));
+ ((!!(win->flags & EWL_WINDOW_DIALOG)) ?
+ ECORE_WIN32_WINDOW_TYPE_DIALOG :
+ ECORE_WIN32_WINDOW_TYPE_NORMAL));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -539,9 +539,9 @@ ee_window_states_set(Ewl_Window *win)
if (!diff) DRETURN(DLEVEL_STABLE);
if (REALIZED(win))
- ee_window_state_request(win, diff);
+ ee_window_state_request(win, diff);
else
- ee_window_states_set_helper(win);
+ ee_window_states_set_helper(win);
win->old_flags = win->flags;
@@ -550,8 +550,8 @@ ee_window_states_set(Ewl_Window *win)
static void
ee_window_state_handle(Ewl_Window *win, int states,
- Ewl_Window_Flags ewl_flag,
- Ecore_Win32_Window_State ecore_flag)
+ Ewl_Window_Flags ewl_flag,
+ Ecore_Win32_Window_State ecore_flag)
{
int state = 0;
@@ -561,9 +561,9 @@ ee_window_state_handle(Ewl_Window *win, int states,
if (states & ewl_flag)
{
- state = (!!(win->flags & ewl_flag));
- ecore_win32_window_state_request_send(win->window,
- ecore_flag, state);
+ state = (!!(win->flags & ewl_flag));
+ ecore_win32_window_state_request_send(win->window,
+ ecore_flag, state);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -577,11 +577,11 @@ ee_window_state_request(Ewl_Window *win, int states)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ee_window_state_handle(win, states, EWL_WINDOW_FULLSCREEN,
- ECORE_WIN32_WINDOW_STATE_FULLSCREEN);
+ ECORE_WIN32_WINDOW_STATE_FULLSCREEN);
ee_window_state_handle(win, states, EWL_WINDOW_MODAL,
- ECORE_WIN32_WINDOW_STATE_MODAL);
+ ECORE_WIN32_WINDOW_STATE_MODAL);
ee_window_state_handle(win, states, EWL_WINDOW_DEMANDS_ATTENTION,
- ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION);
+ ECORE_WIN32_WINDOW_STATE_DEMANDS_ATTENTION);
win->flags &= ~EWL_WINDOW_DEMANDS_ATTENTION;
@@ -602,13 +602,13 @@ ee_window_states_set_helper(Ewl_Window *win)
* only relevant if the window has been realized */
if (!win->window)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!!(win->flags & EWL_WINDOW_FULLSCREEN))
- states[count++] = ECORE_WIN32_WINDOW_STATE_FULLSCREEN;
+ states[count++] = ECORE_WIN32_WINDOW_STATE_FULLSCREEN;
if (!!(win->flags & EWL_WINDOW_MODAL))
- states[count++] = ECORE_WIN32_WINDOW_STATE_MODAL;
+ states[count++] = ECORE_WIN32_WINDOW_STATE_MODAL;
ecore_win32_window_state_set(win->window, states, count);
@@ -626,23 +626,23 @@ ee_window_hints_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
/* if (win->flags & EWL_WINDOW_LEADER) */
-/* win_group = win->leader.ewl->window; */
+/* win_group = win->leader.ewl->window; */
/* else if (win->flags & EWL_WINDOW_LEADER_FOREIGN) */
-/* win_group = win->leader.foreign; */
+/* win_group = win->leader.foreign; */
/* else */
-/* win_group = NULL; */
+/* win_group = NULL; */
/* if (win->flags & EWL_WINDOW_URGENT) */
-/* urgent = TRUE; */
+/* urgent = TRUE; */
/* ecore_x_icccm_hints_set( win->window, */
-/* 1, // accepts focus */
-/* 0, // initial states */
-/* 0, // icon pixmap */
-/* 0, // icon mask */
-/* 0, // icon window */
-/* win_group, // window group */
-/* urgent); // is urgent */
+/* 1, // accepts focus */
+/* 0, // initial states */
+/* 0, // icon pixmap */
+/* 0, // icon mask */
+/* 0, // icon window */
+/* win_group, // window group */
+/* urgent); // is urgent */
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -655,13 +655,13 @@ ee_window_transient_for(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
/* if (win->flags & EWL_WINDOW_TRANSIENT) */
-/* ecore_x_icccm_transient_for_set(win->window, */
-/* win->transient.ewl->window); */
+/* ecore_x_icccm_transient_for_set(win->window, */
+/* win->transient.ewl->window); */
/* else if (win->flags & EWL_WINDOW_TRANSIENT_FOREIGN) */
-/* ecore_x_icccm_transient_for_set(win->window, */
-/* win->transient.foreign); */
+/* ecore_x_icccm_transient_for_set(win->window, */
+/* win->transient.foreign); */
/* else */
-/* ecore_x_icccm_transient_for_unset(win->window); */
+/* ecore_x_icccm_transient_for_unset(win->window); */
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -676,16 +676,16 @@ ee_window_leader_set(Ewl_Window *win)
/* DCHECK_TYPE(win, EWL_WINDOW_TYPE); */
/* if (win->flags & EWL_WINDOW_LEADER) */
-/* leader = win->leader.ewl->window; */
+/* leader = win->leader.ewl->window; */
/* else if (win->flags & EWL_WINDOW_LEADER_FOREIGN) */
-/* leader = win->leader.foreign; */
+/* leader = win->leader.foreign; */
/* else */
-/* /\* according to the icccm specs a client leader */
-/* * sets itself to the leader *\/ */
-/* leader = win->window; */
+/* /\* according to the icccm specs a client leader */
+/* * sets itself to the leader *\/ */
+/* leader = win->window; */
/* ecore_x_icccm_client_leader_set(win->window, */
-/* leader); */
+/* leader); */
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -721,7 +721,7 @@ ee_window_geometry_set(Ewl_Window *win, int *width, int *height)
printf ("ee_window_geometry_set\n");
ecore_win32_window_size_get((win ? win->window : NULL),
- width, height);
+ width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -747,7 +747,7 @@ ee_pointer_data_new(Ewl_Embed *embed, int *data, int w, int h)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, 0);
DRETURN_INT((int)ecore_win32_cursor_new(embed->canvas_window,
- data, w, h, 0, 0), DLEVEL_STABLE);
+ data, w, h, 0, 0), DLEVEL_STABLE);
}
static void
@@ -865,7 +865,7 @@ ewl_ev_win32_window_expose(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
printf (" **** ewl_ev_win32_window_expose\n");
event.x = ev->x;
@@ -900,19 +900,19 @@ ewl_ev_win32_window_configure(void *data __UNUSED__, int type __UNUSED__, void *
embed = ewl_embed_canvas_window_find((void *)ev->window);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
/*
* Save coords and queue a configure event if the window is moved.
*/
if (ev->x != embed->x) {
- embed->x = ev->x;
- config = 1;
+ embed->x = ev->x;
+ config = 1;
}
if (ev->y != embed->y) {
- embed->y = ev->y;
- config = 1;
+ embed->y = ev->y;
+ config = 1;
}
if (!ev->window)
@@ -923,28 +923,28 @@ ewl_ev_win32_window_configure(void *data __UNUSED__, int type __UNUSED__, void *
* we can finish when the embed is not a window
*/
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (config)
- ewl_widget_configure(EWL_WIDGET(window));
+ ewl_widget_configure(EWL_WIDGET(window));
printf (" **** ewl_ev_win32_window_configure\n");
/*
* Configure events really only need to occur on resize.
*/
if ((ewl_object_current_w_get(EWL_OBJECT(window)) != ev->width)
- || (ewl_object_current_h_get(EWL_OBJECT(window)) != ev->height)) {
-
- /*
- * Right now this is commented out, as it was preventing windows
- * from resizing when WE were the ones setting the size
- * (mainly on initial show of the window). It would be nice to
- * add this back in to limit the # of window resizes occuring.
- * (As long as it doesn't break initial size.)
- */
- window->flags |= EWL_WINDOW_USER_CONFIGURE;
- ewl_object_geometry_request(EWL_OBJECT(window), 0, 0, ev->width,
- ev->height);
+ || (ewl_object_current_h_get(EWL_OBJECT(window)) != ev->height)) {
+
+ /*
+ * Right now this is commented out, as it was preventing windows
+ * from resizing when WE were the ones setting the size
+ * (mainly on initial show of the window). It would be nice to
+ * add this back in to limit the # of window resizes occuring.
+ * (As long as it doesn't break initial size.)
+ */
+ window->flags |= EWL_WINDOW_USER_CONFIGURE;
+ ewl_object_geometry_request(EWL_OBJECT(window), 0, 0, ev->width,
+ ev->height);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -966,7 +966,7 @@ ewl_ev_win32_window_delete(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_DELETE_WINDOW);
@@ -986,28 +986,28 @@ ewl_ev_win32_key_down(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
if (strstr(ev->keyname, "Shift_"))
- key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
else if (strstr(ev->keyname, "Control_"))
- key_modifiers |= EWL_KEY_MODIFIER_CTRL;
+ key_modifiers |= EWL_KEY_MODIFIER_CTRL;
else if (strstr(ev->keyname, "Alt_"))
- key_modifiers |= EWL_KEY_MODIFIER_ALT;
+ key_modifiers |= EWL_KEY_MODIFIER_ALT;
else if (strstr(ev->keyname, "Mod_"))
- key_modifiers |= EWL_KEY_MODIFIER_MOD;
+ key_modifiers |= EWL_KEY_MODIFIER_MOD;
else if (strstr(ev->keyname, "Super_"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
else if (strstr(ev->keyname, "Hyper_"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
else if (!ev->keycompose || iscntrl(*ev->keycompose))
- ewl_embed_key_down_feed(EWL_EMBED(window), ev->keyname,
- key_modifiers);
+ ewl_embed_key_down_feed(EWL_EMBED(window), ev->keyname,
+ key_modifiers);
else
- ewl_embed_key_down_feed(EWL_EMBED(window), ev->keycompose,
- key_modifiers);
+ ewl_embed_key_down_feed(EWL_EMBED(window), ev->keycompose,
+ key_modifiers);
ewl_ev_modifiers_set(key_modifiers);
@@ -1027,28 +1027,28 @@ ewl_ev_win32_key_up(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
if (strstr(ev->keyname, "Shift_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
else if (strstr(ev->keyname, "Control_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
+ key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
else if (strstr(ev->keyname, "Alt_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
else if (strstr(ev->keyname, "Mod_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
+ key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
else if (strstr(ev->keyname, "Super_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
else if (strstr(ev->keyname, "Hyper_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
else if (!ev->keycompose || iscntrl(*ev->keycompose))
- ewl_embed_key_up_feed(EWL_EMBED(window), ev->keyname,
- key_modifiers);
+ ewl_embed_key_up_feed(EWL_EMBED(window), ev->keyname,
+ key_modifiers);
else
- ewl_embed_key_up_feed(EWL_EMBED(window), ev->keycompose,
- key_modifiers);
+ ewl_embed_key_up_feed(EWL_EMBED(window), ev->keycompose,
+ key_modifiers);
ewl_ev_modifiers_set(key_modifiers);
@@ -1069,16 +1069,16 @@ ewl_ev_win32_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (ev->double_click)
- clicks = 2;
+ clicks = 2;
if (ev->triple_click)
- clicks = 3;
+ clicks = 3;
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_down_feed(EWL_EMBED(window), ev->button, clicks,
- ev->x, ev->y, key_modifiers);
+ ev->x, ev->y, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1096,12 +1096,12 @@ ewl_ev_win32_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_up_feed(EWL_EMBED(window), ev->button, ev->x,
- ev->y, key_modifiers);
+ ev->y, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1119,11 +1119,11 @@ ewl_ev_win32_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_move_feed(EWL_EMBED(window), ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1139,11 +1139,11 @@ ewl_ev_win32_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_out_feed(EWL_EMBED(window), ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1159,11 +1159,11 @@ ewl_ev_win32_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_wheel_feed(EWL_EMBED(window), ev->x, ev->y,
- ev->z, ev->direction, key_modifiers);
+ ev->z, ev->direction, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1179,7 +1179,7 @@ ewl_ev_win32_focus_in(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_FOCUS_IN);
@@ -1196,7 +1196,7 @@ ewl_ev_win32_focus_out(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->window);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_FOCUS_OUT);
diff --git a/src/engines/x11/ewl_engine_x11.c b/src/engines/x11/ewl_engine_x11.c
index e9060a0..f10e7d6 100644
--- a/src/engines/x11/ewl_engine_x11.c
+++ b/src/engines/x11/ewl_engine_x11.c
@@ -70,8 +70,8 @@ static void ee_window_dialog_set(Ewl_Window *win);
static void ee_window_states_set(Ewl_Window *win);
static void ee_window_state_request(Ewl_Window *win, int states);
static void ee_window_state_handle(Ewl_Window *win, int states,
- Ewl_Window_Flags ewl_flag,
- Ecore_X_Window_State ecore_flag);
+ Ewl_Window_Flags ewl_flag,
+ Ecore_X_Window_State ecore_flag);
static void ee_window_states_set_helper(Ewl_Window *win);
static void ee_window_hints_set(Ewl_Window *win);
static void ee_window_transient_for(Ewl_Window *win);
@@ -98,43 +98,43 @@ static int ee_pointer_get(Ewl_Embed *embed);
static void *window_funcs[EWL_ENGINE_WINDOW_MAX] =
{
- ee_window_new,
- ee_window_destroy,
- ee_window_move,
- ee_window_resize,
- ee_window_min_max_size_set,
- ee_window_show,
- ee_window_hide,
- ee_window_title_set,
- ee_window_name_class_set,
- ee_window_borderless_set,
- ee_window_dialog_set,
- ee_window_states_set,
- ee_window_hints_set,
- ee_window_transient_for,
- ee_window_leader_set,
- ee_window_raise,
- ee_window_lower,
- ee_keyboard_grab,
- ee_keyboard_ungrab,
- ee_pointer_grab,
- ee_pointer_ungrab,
- ee_window_selection_text_set,
- ee_window_geometry_set,
- ee_dnd_aware_set,
- ee_desktop_size_get,
- ee_dnd_drag_types_set,
- ee_dnd_drag_begin,
- ee_dnd_drag_drop,
- ee_dnd_drag_data_send,
+ ee_window_new,
+ ee_window_destroy,
+ ee_window_move,
+ ee_window_resize,
+ ee_window_min_max_size_set,
+ ee_window_show,
+ ee_window_hide,
+ ee_window_title_set,
+ ee_window_name_class_set,
+ ee_window_borderless_set,
+ ee_window_dialog_set,
+ ee_window_states_set,
+ ee_window_hints_set,
+ ee_window_transient_for,
+ ee_window_leader_set,
+ ee_window_raise,
+ ee_window_lower,
+ ee_keyboard_grab,
+ ee_keyboard_ungrab,
+ ee_pointer_grab,
+ ee_pointer_ungrab,
+ ee_window_selection_text_set,
+ ee_window_geometry_set,
+ ee_dnd_aware_set,
+ ee_desktop_size_get,
+ ee_dnd_drag_types_set,
+ ee_dnd_drag_begin,
+ ee_dnd_drag_drop,
+ ee_dnd_drag_data_send,
};
static void *pointer_funcs[EWL_ENGINE_POINTER_MAX] =
{
- ee_pointer_data_new,
- ee_pointer_free,
- ee_pointer_get,
- ee_pointer_set,
+ ee_pointer_data_new,
+ ee_pointer_free,
+ ee_pointer_get,
+ ee_pointer_set,
};
Ecore_DList *
@@ -154,12 +154,12 @@ ewl_engine_create(int *argc, char ** argv)
engine = NEW(Ewl_Engine_X11, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine), argc, argv))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -177,117 +177,117 @@ ee_init(Ewl_Engine *engine, int *argc, char ** argv)
/* If the event handlers are already setup don't do it again */
if (ee_expose_handler)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (argc && argv)
{
- for (i = 1; i < *argc; i++)
- {
- if (!strcmp(argv[i], "-display"))
- {
- if (++i < *argc)
- display = argv[i];
- }
- }
+ for (i = 1; i < *argc; i++)
+ {
+ if (!strcmp(argv[i], "-display"))
+ {
+ if (++i < *argc)
+ display = argv[i];
+ }
+ }
}
if (!ecore_x_init(display))
{
- fprintf(stderr, "Unable to initialize Ecore X.\n"
- "Is your DISPLAY variable set correctly?\n\n");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ fprintf(stderr, "Unable to initialize Ecore X.\n"
+ "Is your DISPLAY variable set correctly?\n\n");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ee_expose_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_DAMAGE,
- ewl_ev_x_window_expose, NULL);
+ ECORE_X_EVENT_WINDOW_DAMAGE,
+ ewl_ev_x_window_expose, NULL);
ee_configure_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_CONFIGURE,
- ewl_ev_x_window_configure, NULL);
+ ECORE_X_EVENT_WINDOW_CONFIGURE,
+ ewl_ev_x_window_configure, NULL);
ee_delete_request_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
- ewl_ev_x_window_delete, NULL);
+ ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
+ ewl_ev_x_window_delete, NULL);
/*
* Register dispatching functions for keyboard events.
*/
ee_key_down_handler = ecore_event_handler_add(
- ECORE_X_EVENT_KEY_DOWN,
- ewl_ev_x_key_down, NULL);
+ ECORE_X_EVENT_KEY_DOWN,
+ ewl_ev_x_key_down, NULL);
ee_key_up_handler = ecore_event_handler_add(
- ECORE_X_EVENT_KEY_UP,
- ewl_ev_x_key_up, NULL);
+ ECORE_X_EVENT_KEY_UP,
+ ewl_ev_x_key_up, NULL);
/*
* Register dispatching functions for DND events
*/
ee_dnd_position_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_POSITION,
- ewl_ev_dnd_position, NULL);
+ ECORE_X_EVENT_XDND_POSITION,
+ ewl_ev_dnd_position, NULL);
ee_dnd_enter_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_ENTER,
- ewl_ev_dnd_enter, NULL);
+ ECORE_X_EVENT_XDND_ENTER,
+ ewl_ev_dnd_enter, NULL);
ee_dnd_leave_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_LEAVE,
- ewl_ev_dnd_leave, NULL);
+ ECORE_X_EVENT_XDND_LEAVE,
+ ewl_ev_dnd_leave, NULL);
ee_dnd_drop_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_DROP,
- ewl_ev_dnd_drop, NULL);
+ ECORE_X_EVENT_XDND_DROP,
+ ewl_ev_dnd_drop, NULL);
/*
* Selection callbacks to allow for data transfers.
*/
ee_selection_notify_handler = ecore_event_handler_add(
- ECORE_X_EVENT_SELECTION_NOTIFY,
- ewl_ev_x_data_received, NULL);
+ ECORE_X_EVENT_SELECTION_NOTIFY,
+ ewl_ev_x_data_received, NULL);
/*
* Selection callbacks to allow for pasting.
*/
ee_selection_request_handler = ecore_event_handler_add(
- ECORE_X_EVENT_SELECTION_REQUEST,
- ewl_ev_x_data_request, NULL);
+ ECORE_X_EVENT_SELECTION_REQUEST,
+ ewl_ev_x_data_request, NULL);
/*
* Finally, register dispatching functions for mouse events.
*/
ee_mouse_down_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
- ewl_ev_x_mouse_down, NULL);
+ ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
+ ewl_ev_x_mouse_down, NULL);
ee_mouse_up_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_BUTTON_UP,
- ewl_ev_x_mouse_up, NULL);
+ ECORE_X_EVENT_MOUSE_BUTTON_UP,
+ ewl_ev_x_mouse_up, NULL);
ee_mouse_move_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_MOVE,
- ewl_ev_x_mouse_move, NULL);
+ ECORE_X_EVENT_MOUSE_MOVE,
+ ewl_ev_x_mouse_move, NULL);
ee_mouse_wheel_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_WHEEL,
- ewl_ev_x_mouse_wheel, NULL);
+ ECORE_X_EVENT_MOUSE_WHEEL,
+ ewl_ev_x_mouse_wheel, NULL);
ee_mouse_out_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_OUT,
- ewl_ev_x_mouse_out, NULL);
+ ECORE_X_EVENT_MOUSE_OUT,
+ ewl_ev_x_mouse_out, NULL);
ee_focus_in_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_FOCUS_IN,
- ewl_ev_x_focus_in, NULL);
+ ECORE_X_EVENT_WINDOW_FOCUS_IN,
+ ewl_ev_x_focus_in, NULL);
ee_focus_out_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_FOCUS_OUT,
- ewl_ev_x_focus_out, NULL);
+ ECORE_X_EVENT_WINDOW_FOCUS_OUT,
+ ewl_ev_x_focus_out, NULL);
if (!ee_expose_handler || !ee_configure_handler
- || !ee_delete_request_handler
- || !ee_key_down_handler || !ee_key_up_handler
- || !ee_dnd_position_handler || !ee_dnd_enter_handler
- || !ee_dnd_leave_handler || !ee_dnd_drop_handler
- || !ee_selection_notify_handler || !ee_selection_request_handler
- || !ee_mouse_down_handler
- || !ee_mouse_up_handler || !ee_mouse_move_handler
- || !ee_mouse_wheel_handler || !ee_mouse_out_handler
- || !ee_focus_in_handler || !ee_focus_out_handler)
+ || !ee_delete_request_handler
+ || !ee_key_down_handler || !ee_key_up_handler
+ || !ee_dnd_position_handler || !ee_dnd_enter_handler
+ || !ee_dnd_leave_handler || !ee_dnd_drop_handler
+ || !ee_selection_notify_handler || !ee_selection_request_handler
+ || !ee_mouse_down_handler
+ || !ee_mouse_up_handler || !ee_mouse_move_handler
+ || !ee_mouse_wheel_handler || !ee_mouse_out_handler
+ || !ee_focus_in_handler || !ee_focus_out_handler)
{
- ee_shutdown(EWL_ENGINE(engine));
+ ee_shutdown(EWL_ENGINE(engine));
- fprintf(stderr, "Unable to create Ecore X event handlers.\n");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ fprintf(stderr, "Unable to create Ecore X event handlers.\n");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
info = NEW(Ewl_Engine_Info, 1);
@@ -307,75 +307,75 @@ ee_shutdown(Ewl_Engine *engine)
DCHECK_PARAM_PTR(engine);
if (ee_expose_handler)
- ecore_event_handler_del(ee_expose_handler);
+ ecore_event_handler_del(ee_expose_handler);
ee_expose_handler = NULL;
if (ee_configure_handler)
- ecore_event_handler_del(ee_configure_handler);
+ ecore_event_handler_del(ee_configure_handler);
ee_configure_handler = NULL;
if (ee_delete_request_handler)
- ecore_event_handler_del(ee_delete_request_handler);
+ ecore_event_handler_del(ee_delete_request_handler);
ee_delete_request_handler = NULL;
if (ee_key_down_handler)
- ecore_event_handler_del(ee_key_down_handler);
+ ecore_event_handler_del(ee_key_down_handler);
ee_key_down_handler = NULL;
if (ee_key_up_handler)
- ecore_event_handler_del(ee_key_up_handler);
+ ecore_event_handler_del(ee_key_up_handler);
ee_key_up_handler = NULL;
if (ee_dnd_position_handler)
- ecore_event_handler_del(ee_dnd_position_handler);
+ ecore_event_handler_del(ee_dnd_position_handler);
ee_dnd_position_handler = NULL;
if (ee_dnd_enter_handler)
- ecore_event_handler_del(ee_dnd_enter_handler);
+ ecore_event_handler_del(ee_dnd_enter_handler);
ee_dnd_enter_handler = NULL;
if (ee_dnd_leave_handler)
- ecore_event_handler_del(ee_dnd_leave_handler);
+ ecore_event_handler_del(ee_dnd_leave_handler);
ee_dnd_leave_handler = NULL;
if (ee_dnd_drop_handler)
- ecore_event_handler_del(ee_dnd_drop_handler);
+ ecore_event_handler_del(ee_dnd_drop_handler);
ee_dnd_drop_handler = NULL;
if (ee_selection_notify_handler)
- ecore_event_handler_del(ee_selection_notify_handler);
+ ecore_event_handler_del(ee_selection_notify_handler);
ee_selection_notify_handler = NULL;
if (ee_selection_request_handler)
- ecore_event_handler_del(ee_selection_request_handler);
+ ecore_event_handler_del(ee_selection_request_handler);
ee_selection_request_handler = NULL;
if (ee_mouse_down_handler)
- ecore_event_handler_del(ee_mouse_down_handler);
+ ecore_event_handler_del(ee_mouse_down_handler);
ee_mouse_down_handler = NULL;
if (ee_mouse_up_handler)
- ecore_event_handler_del(ee_mouse_up_handler);
+ ecore_event_handler_del(ee_mouse_up_handler);
ee_mouse_up_handler = NULL;
if (ee_mouse_move_handler)
- ecore_event_handler_del(ee_mouse_move_handler);
+ ecore_event_handler_del(ee_mouse_move_handler);
ee_mouse_move_handler = NULL;
if (ee_mouse_wheel_handler)
- ecore_event_handler_del(ee_mouse_wheel_handler);
+ ecore_event_handler_del(ee_mouse_wheel_handler);
ee_mouse_wheel_handler = NULL;
if (ee_mouse_out_handler)
- ecore_event_handler_del(ee_mouse_out_handler);
+ ecore_event_handler_del(ee_mouse_out_handler);
ee_mouse_out_handler = NULL;
if (ee_focus_in_handler)
- ecore_event_handler_del(ee_focus_in_handler);
+ ecore_event_handler_del(ee_focus_in_handler);
ee_focus_in_handler = NULL;
if (ee_focus_out_handler)
- ecore_event_handler_del(ee_focus_out_handler);
+ ecore_event_handler_del(ee_focus_out_handler);
ee_focus_out_handler = NULL;
ecore_x_shutdown();
@@ -395,21 +395,21 @@ ee_window_new(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_OVERRIDE)
- xwin = ecore_x_window_override_new(0,
- EWL_EMBED(win)->x, EWL_EMBED(win)->y,
- ewl_object_current_w_get(EWL_OBJECT(win)),
- ewl_object_current_h_get(EWL_OBJECT(win)));
+ xwin = ecore_x_window_override_new(0,
+ EWL_EMBED(win)->x, EWL_EMBED(win)->y,
+ ewl_object_current_w_get(EWL_OBJECT(win)),
+ ewl_object_current_h_get(EWL_OBJECT(win)));
else
- xwin = ecore_x_window_new(0,
- EWL_EMBED(win)->x, EWL_EMBED(win)->y,
- ewl_object_current_w_get(EWL_OBJECT(win)),
- ewl_object_current_h_get(EWL_OBJECT(win)));
+ xwin = ecore_x_window_new(0,
+ EWL_EMBED(win)->x, EWL_EMBED(win)->y,
+ ewl_object_current_w_get(EWL_OBJECT(win)),
+ ewl_object_current_h_get(EWL_OBJECT(win)));
ecore_x_icccm_protocol_set(xwin, ECORE_X_WM_PROTOCOL_DELETE_REQUEST, 1);
win->window = (void *)xwin;
if (win->flags & EWL_WINDOW_BORDERLESS)
- ee_window_borderless_set(win);
+ ee_window_borderless_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -439,8 +439,8 @@ ee_window_move(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_window_move((Ecore_X_Window)win->window,
- EWL_EMBED(win)->x,
- EWL_EMBED(win)->y);
+ EWL_EMBED(win)->x,
+ EWL_EMBED(win)->y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -460,8 +460,8 @@ ee_window_resize(Ewl_Window *win)
ecore_x_window_resize((Ecore_X_Window)win->window, width, height);
if (EWL_EMBED(win)->canvas_window != win->window)
- ecore_x_window_resize((Ecore_X_Window)EWL_EMBED(win)->canvas_window,
- width, height);
+ ecore_x_window_resize((Ecore_X_Window)EWL_EMBED(win)->canvas_window,
+ width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -474,14 +474,14 @@ ee_window_min_max_size_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_icccm_size_pos_hints_set((Ecore_X_Window)win->window,
- 0, ECORE_X_GRAVITY_NW,
- ewl_object_minimum_w_get(EWL_OBJECT(win)),
- ewl_object_minimum_h_get(EWL_OBJECT(win)),
- ewl_object_maximum_w_get(EWL_OBJECT(win)),
- ewl_object_maximum_h_get(EWL_OBJECT(win)),
- 0, 0, /* base */
- 0, 0, /* step */
- 0, 0); /* aspect */
+ 0, ECORE_X_GRAVITY_NW,
+ ewl_object_minimum_w_get(EWL_OBJECT(win)),
+ ewl_object_minimum_h_get(EWL_OBJECT(win)),
+ ewl_object_maximum_w_get(EWL_OBJECT(win)),
+ ewl_object_maximum_h_get(EWL_OBJECT(win)),
+ 0, 0, /* base */
+ 0, 0, /* step */
+ 0, 0); /* aspect */
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -536,7 +536,7 @@ ee_window_name_class_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_icccm_name_class_set((Ecore_X_Window)win->window, win->name,
- (win->classname ? win->classname : win->name));
+ (win->classname ? win->classname : win->name));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -549,7 +549,7 @@ ee_window_borderless_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_mwm_borderless_set((Ecore_X_Window)win->window,
- (!!(win->flags & EWL_WINDOW_BORDERLESS)));
+ (!!(win->flags & EWL_WINDOW_BORDERLESS)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -562,9 +562,9 @@ ee_window_dialog_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_netwm_window_type_set((Ecore_X_Window)win->window,
- ((!!(win->flags & EWL_WINDOW_DIALOG)) ?
- ECORE_X_WINDOW_TYPE_DIALOG :
- ECORE_X_WINDOW_TYPE_NORMAL));
+ ((!!(win->flags & EWL_WINDOW_DIALOG)) ?
+ ECORE_X_WINDOW_TYPE_DIALOG :
+ ECORE_X_WINDOW_TYPE_NORMAL));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -582,9 +582,9 @@ ee_window_states_set(Ewl_Window *win)
if (!diff) DRETURN(DLEVEL_STABLE);
if (REALIZED(win))
- ee_window_state_request(win, diff);
+ ee_window_state_request(win, diff);
else
- ee_window_states_set_helper(win);
+ ee_window_states_set_helper(win);
win->old_flags = win->flags;
@@ -593,8 +593,8 @@ ee_window_states_set(Ewl_Window *win)
static void
ee_window_state_handle(Ewl_Window *win, int states,
- Ewl_Window_Flags ewl_flag,
- Ecore_X_Window_State ecore_flag)
+ Ewl_Window_Flags ewl_flag,
+ Ecore_X_Window_State ecore_flag)
{
int state = 0;
@@ -604,9 +604,9 @@ ee_window_state_handle(Ewl_Window *win, int states,
if (states & ewl_flag)
{
- state = (!!(win->flags & ewl_flag));
- ecore_x_netwm_state_request_send((Ecore_X_Window)win->window,
- 0, ecore_flag, ECORE_X_WINDOW_STATE_UNKNOWN, state);
+ state = (!!(win->flags & ewl_flag));
+ ecore_x_netwm_state_request_send((Ecore_X_Window)win->window,
+ 0, ecore_flag, ECORE_X_WINDOW_STATE_UNKNOWN, state);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -620,15 +620,15 @@ ee_window_state_request(Ewl_Window *win, int states)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ee_window_state_handle(win, states, EWL_WINDOW_FULLSCREEN,
- ECORE_X_WINDOW_STATE_FULLSCREEN);
+ ECORE_X_WINDOW_STATE_FULLSCREEN);
ee_window_state_handle(win, states, EWL_WINDOW_SKIP_TASKBAR,
- ECORE_X_WINDOW_STATE_SKIP_TASKBAR);
+ ECORE_X_WINDOW_STATE_SKIP_TASKBAR);
ee_window_state_handle(win, states, EWL_WINDOW_SKIP_PAGER,
- ECORE_X_WINDOW_STATE_SKIP_PAGER);
+ ECORE_X_WINDOW_STATE_SKIP_PAGER);
ee_window_state_handle(win, states, EWL_WINDOW_MODAL,
- ECORE_X_WINDOW_STATE_MODAL);
+ ECORE_X_WINDOW_STATE_MODAL);
ee_window_state_handle(win, states, EWL_WINDOW_DEMANDS_ATTENTION,
- ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION);
+ ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION);
win->flags &= ~EWL_WINDOW_DEMANDS_ATTENTION;
@@ -649,19 +649,19 @@ ee_window_states_set_helper(Ewl_Window *win)
* only relevant if the window has been realized */
if (!win->window)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!!(win->flags & EWL_WINDOW_FULLSCREEN))
- states[count++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
+ states[count++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
if (!!(win->flags & EWL_WINDOW_SKIP_TASKBAR))
- states[count++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
+ states[count++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
if (!!(win->flags & EWL_WINDOW_SKIP_PAGER))
- states[count++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
+ states[count++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
if (!!(win->flags & EWL_WINDOW_MODAL))
- states[count++] = ECORE_X_WINDOW_STATE_MODAL;
+ states[count++] = ECORE_X_WINDOW_STATE_MODAL;
ecore_x_netwm_window_state_set((Ecore_X_Window)win->window, states, count);
@@ -679,23 +679,23 @@ ee_window_hints_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_LEADER)
- win_group = win->leader.ewl->window;
+ win_group = win->leader.ewl->window;
else if (win->flags & EWL_WINDOW_LEADER_FOREIGN)
- win_group = win->leader.foreign;
+ win_group = win->leader.foreign;
else
- win_group = NULL;
+ win_group = NULL;
if (win->flags & EWL_WINDOW_URGENT)
- urgent = TRUE;
+ urgent = TRUE;
ecore_x_icccm_hints_set((Ecore_X_Window) win->window,
- 1, // accepts focus
- 0, // initial states
- 0, // icon pixmap
- 0, // icon mask
- 0, // icon window
- (Ecore_X_Window) win_group, // window group
- urgent); // is urgent
+ 1, // accepts focus
+ 0, // initial states
+ 0, // icon pixmap
+ 0, // icon mask
+ 0, // icon window
+ (Ecore_X_Window) win_group, // window group
+ urgent); // is urgent
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -708,13 +708,13 @@ ee_window_transient_for(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_TRANSIENT)
- ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
- (Ecore_X_Window)win->transient.ewl->window);
+ ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
+ (Ecore_X_Window)win->transient.ewl->window);
else if (win->flags & EWL_WINDOW_TRANSIENT_FOREIGN)
- ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
- (Ecore_X_Window)win->transient.foreign);
+ ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
+ (Ecore_X_Window)win->transient.foreign);
else
- ecore_x_icccm_transient_for_unset((Ecore_X_Window)win->window);
+ ecore_x_icccm_transient_for_unset((Ecore_X_Window)win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -729,16 +729,16 @@ ee_window_leader_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_LEADER)
- leader = win->leader.ewl->window;
+ leader = win->leader.ewl->window;
else if (win->flags & EWL_WINDOW_LEADER_FOREIGN)
- leader = win->leader.foreign;
+ leader = win->leader.foreign;
else
- /* according to the icccm specs a client leader
- * sets itself to the leader */
- leader = win->window;
+ /* according to the icccm specs a client leader
+ * sets itself to the leader */
+ leader = win->window;
ecore_x_icccm_client_leader_set((Ecore_X_Window)win->window,
- (Ecore_X_Window)leader);
+ (Ecore_X_Window)leader);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -778,13 +778,13 @@ ee_keyboard_grab(Ewl_Window *win)
if ((!!(win->flags & EWL_WINDOW_GRAB_KEYBOARD)))
{
- ret = ecore_x_keyboard_grab((Ecore_X_Window)win->window);
- ee_current_key_grab_window = win;
+ ret = ecore_x_keyboard_grab((Ecore_X_Window)win->window);
+ ee_current_key_grab_window = win;
}
else if (ee_current_key_grab_window == win)
{
- ecore_x_keyboard_ungrab();
- ee_current_key_grab_window = NULL;
+ ecore_x_keyboard_ungrab();
+ ee_current_key_grab_window = NULL;
}
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -814,13 +814,13 @@ ee_pointer_grab(Ewl_Window *win)
if ((!!(win->flags & EWL_WINDOW_GRAB_POINTER)))
{
- ret = ecore_x_pointer_grab((Ecore_X_Window)win->window);
- ee_current_pointer_grab_window = win;
+ ret = ecore_x_pointer_grab((Ecore_X_Window)win->window);
+ ee_current_pointer_grab_window = win;
}
else if (ee_current_pointer_grab_window == win)
{
- ecore_x_pointer_ungrab();
- ee_current_pointer_grab_window = NULL;
+ ecore_x_pointer_ungrab();
+ ee_current_pointer_grab_window = NULL;
}
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -848,11 +848,11 @@ ee_window_selection_text_set(Ewl_Embed *emb, const char *txt)
DCHECK_TYPE(emb, EWL_EMBED_TYPE);
if (txt)
- ecore_x_selection_primary_set(
- (Ecore_X_Window)emb->canvas_window,
- (unsigned char *)txt, strlen(txt) + 1);
+ ecore_x_selection_primary_set(
+ (Ecore_X_Window)emb->canvas_window,
+ (unsigned char *)txt, strlen(txt) + 1);
else
- ecore_x_selection_primary_clear();
+ ecore_x_selection_primary_clear();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -863,7 +863,7 @@ ee_window_geometry_set(Ewl_Window *win, int *width, int *height)
DENTER_FUNCTION(DLEVEL_STABLE);
ecore_x_window_geometry_get((win ? (Ecore_X_Window)win->window : (Ecore_X_Window)0),
- NULL, NULL, width, height);
+ NULL, NULL, width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -900,7 +900,7 @@ ee_dnd_drag_types_set(Ewl_Embed *embed, const char **types, unsigned int num)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
ecore_x_dnd_aware_set((Ecore_X_Window)embed->canvas_window,
- (num > 0 ? 1 : 0));
+ (num > 0 ? 1 : 0));
ecore_x_dnd_types_set((Ecore_X_Window)embed->canvas_window, (char **)types, num);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -941,11 +941,11 @@ ee_dnd_drag_data_send(Ewl_Embed *embed, void *handle, void *data, int len)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, FALSE);
ecore_x_window_prop_property_set(request->requestor, request->property,
- request->target, 8, data, len);
+ request->target, 8, data, len);
DRETURN_INT(ecore_x_selection_notify_send(request->requestor,
- request->selection, request->target,
- request->property, request->time), DLEVEL_STABLE);
+ request->selection, request->target,
+ request->property, request->time), DLEVEL_STABLE);
}
static int
@@ -956,7 +956,7 @@ ee_pointer_data_new(Ewl_Embed *embed, int *data, int w, int h)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, 0);
DRETURN_INT(ecore_x_cursor_new((Ecore_X_Window)embed->canvas_window,
- data, w, h, 0, 0), DLEVEL_STABLE);
+ data, w, h, 0, 0), DLEVEL_STABLE);
}
static void
@@ -995,9 +995,9 @@ ee_pointer_set(Ewl_Embed *embed, int pointer)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
if (pointer >= EWL_MOUSE_CURSOR_MAX)
- cur = pointer;
+ cur = pointer;
else
- cur = ecore_x_cursor_shape_get(pointer);
+ cur = ecore_x_cursor_shape_get(pointer);
ecore_x_window_cursor_set((Ecore_X_Window)embed->canvas_window, cur);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1020,7 +1020,7 @@ ewl_ev_x_window_expose(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
event.x = ev->x;
event.y = ev->y;
@@ -1051,19 +1051,19 @@ ewl_ev_x_window_configure(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
/*
* Save coords and queue a configure event if the window is moved.
*/
if ((ev->from_wm) && (ev->x != embed->x)) {
- embed->x = ev->x;
- config = 1;
+ embed->x = ev->x;
+ config = 1;
}
if ((ev->from_wm) && (ev->y != embed->y)) {
- embed->y = ev->y;
- config = 1;
+ embed->y = ev->y;
+ config = 1;
}
window = ewl_window_window_find((void *)ev->win);
@@ -1071,27 +1071,27 @@ ewl_ev_x_window_configure(void *data __UNUSED__, int type __UNUSED__, void *e)
* we can finish when the embed is not a window
*/
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (config)
- ewl_widget_configure(EWL_WIDGET(window));
+ ewl_widget_configure(EWL_WIDGET(window));
/*
* Configure events really only need to occur on resize.
*/
if ((ewl_object_current_w_get(EWL_OBJECT(window)) != ev->w)
- || (ewl_object_current_h_get(EWL_OBJECT(window)) != ev->h)) {
-
- /*
- * Right now this is commented out, as it was preventing windows
- * from resizing when WE were the ones setting the size
- * (mainly on initial show of the window). It would be nice to
- * add this back in to limit the # of window resizes occuring.
- * (As long as it doesn't break initial size.)
- */
- if (ev->from_wm) window->flags |= EWL_WINDOW_USER_CONFIGURE;
- ewl_object_geometry_request(EWL_OBJECT(window), 0, 0, ev->w,
- ev->h);
+ || (ewl_object_current_h_get(EWL_OBJECT(window)) != ev->h)) {
+
+ /*
+ * Right now this is commented out, as it was preventing windows
+ * from resizing when WE were the ones setting the size
+ * (mainly on initial show of the window). It would be nice to
+ * add this back in to limit the # of window resizes occuring.
+ * (As long as it doesn't break initial size.)
+ */
+ if (ev->from_wm) window->flags |= EWL_WINDOW_USER_CONFIGURE;
+ ewl_object_geometry_request(EWL_OBJECT(window), 0, 0, ev->w,
+ ev->h);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1113,7 +1113,7 @@ ewl_ev_x_window_delete(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_DELETE_WINDOW);
@@ -1133,28 +1133,28 @@ ewl_ev_x_key_down(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
if (strstr(ev->keyname, "Shift_"))
- key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
else if (strstr(ev->keyname, "Control_"))
- key_modifiers |= EWL_KEY_MODIFIER_CTRL;
+ key_modifiers |= EWL_KEY_MODIFIER_CTRL;
else if (strstr(ev->keyname, "Alt_"))
- key_modifiers |= EWL_KEY_MODIFIER_ALT;
+ key_modifiers |= EWL_KEY_MODIFIER_ALT;
else if (strstr(ev->keyname, "Mod_"))
- key_modifiers |= EWL_KEY_MODIFIER_MOD;
+ key_modifiers |= EWL_KEY_MODIFIER_MOD;
else if (strstr(ev->keyname, "Super_"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
else if (strstr(ev->keyname, "Hyper_"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
else if (!ev->key_compose || iscntrl(*ev->key_compose))
- ewl_embed_key_down_feed(EWL_EMBED(window), ev->keyname,
- key_modifiers);
+ ewl_embed_key_down_feed(EWL_EMBED(window), ev->keyname,
+ key_modifiers);
else
- ewl_embed_key_down_feed(EWL_EMBED(window), ev->key_compose,
- key_modifiers);
+ ewl_embed_key_down_feed(EWL_EMBED(window), ev->key_compose,
+ key_modifiers);
ewl_ev_modifiers_set(key_modifiers);
@@ -1174,28 +1174,28 @@ ewl_ev_x_key_up(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
if (strstr(ev->keyname, "Shift_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
else if (strstr(ev->keyname, "Control_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
+ key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
else if (strstr(ev->keyname, "Alt_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
else if (strstr(ev->keyname, "Mod_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
+ key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
else if (strstr(ev->keyname, "Super_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
else if (strstr(ev->keyname, "Hyper_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
else if (!ev->key_compose || iscntrl(*ev->key_compose))
- ewl_embed_key_up_feed(EWL_EMBED(window), ev->keyname,
- key_modifiers);
+ ewl_embed_key_up_feed(EWL_EMBED(window), ev->keyname,
+ key_modifiers);
else
- ewl_embed_key_up_feed(EWL_EMBED(window), ev->key_compose,
- key_modifiers);
+ ewl_embed_key_up_feed(EWL_EMBED(window), ev->key_compose,
+ key_modifiers);
ewl_ev_modifiers_set(key_modifiers);
@@ -1216,16 +1216,16 @@ ewl_ev_x_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (ev->double_click)
- clicks = 2;
+ clicks = 2;
if (ev->triple_click)
- clicks = 3;
+ clicks = 3;
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_down_feed(EWL_EMBED(window), ev->button, clicks,
- ev->x, ev->y, key_modifiers);
+ ev->x, ev->y, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1243,12 +1243,12 @@ ewl_ev_x_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_up_feed(EWL_EMBED(window), ev->button, ev->x,
- ev->y, key_modifiers);
+ ev->y, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1266,11 +1266,11 @@ ewl_ev_x_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_move_feed(EWL_EMBED(window), ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1286,11 +1286,11 @@ ewl_ev_x_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_out_feed(EWL_EMBED(window), ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1306,11 +1306,11 @@ ewl_ev_x_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_wheel_feed(EWL_EMBED(window), ev->x, ev->y,
- ev->z, ev->direction, key_modifiers);
+ ev->z, ev->direction, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1326,7 +1326,7 @@ ewl_ev_x_focus_in(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_FOCUS_IN);
@@ -1343,7 +1343,7 @@ ewl_ev_x_focus_out(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_FOCUS_OUT);
@@ -1362,43 +1362,43 @@ ewl_ev_x_data_received(void *data __UNUSED__, int type __UNUSED__, void *e)
/* Handle everything *except* XDND selection */
if (ev->selection != ECORE_X_SELECTION_XDND)
- printf("Paste event received\n");
+ printf("Paste event received\n");
else
{
- Ewl_Embed *embed;
- Ecore_X_Selection_Data *data = ev->data;
-
- embed = ewl_embed_canvas_window_find((void *)ev->win);
- if (embed)
- {
- if (data->content == ECORE_X_SELECTION_CONTENT_FILES)
- {
- Ecore_X_Selection_Data_Files *files = ev->data;
- ewl_embed_dnd_data_received_feed(embed,
- ev->target,
- files->files,
- files->num_files,
- data->format);
- }
- else if (data->content == ECORE_X_SELECTION_CONTENT_TEXT)
- {
- Ecore_X_Selection_Data_Text *text = ev->data;
- ewl_embed_dnd_data_received_feed(embed,
- ev->target, text->text,
- data->length,
- data->format);
- }
- else
- {
- ewl_embed_dnd_data_received_feed(embed,
- ev->target, data->data,
- data->length,
- data->format);
- }
- }
-
- ecore_x_dnd_send_finished();
+ Ewl_Embed *embed;
+ Ecore_X_Selection_Data *data = ev->data;
+
+ embed = ewl_embed_canvas_window_find((void *)ev->win);
+ if (embed)
+ {
+ if (data->content == ECORE_X_SELECTION_CONTENT_FILES)
+ {
+ Ecore_X_Selection_Data_Files *files = ev->data;
+ ewl_embed_dnd_data_received_feed(embed,
+ ev->target,
+ files->files,
+ files->num_files,
+ data->format);
+ }
+ else if (data->content == ECORE_X_SELECTION_CONTENT_TEXT)
+ {
+ Ecore_X_Selection_Data_Text *text = ev->data;
+ ewl_embed_dnd_data_received_feed(embed,
+ ev->target, text->text,
+ data->length,
+ data->format);
+ }
+ else
+ {
+ ewl_embed_dnd_data_received_feed(embed,
+ ev->target, data->data,
+ data->length,
+ data->format);
+ }
+ }
+
+ ecore_x_dnd_send_finished();
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1417,24 +1417,24 @@ ewl_ev_x_data_request(void *data __UNUSED__, int type __UNUSED__, void *e)
/* Handle everything *except* XDND selection */
if (ev->selection != ECORE_X_ATOM_SELECTION_XDND)
{
- char *rec, *dnd;
+ char *rec, *dnd;
- rec = XGetAtomName(ecore_x_display_get(), ev->selection);
- dnd = XGetAtomName(ecore_x_display_get(), ECORE_X_ATOM_SELECTION_XDND);
- printf("Data request event received: %s not %s\n", rec, dnd);
- XFree(rec);
- XFree(dnd);
+ rec = XGetAtomName(ecore_x_display_get(), ev->selection);
+ dnd = XGetAtomName(ecore_x_display_get(), ECORE_X_ATOM_SELECTION_XDND);
+ printf("Data request event received: %s not %s\n", rec, dnd);
+ XFree(rec);
+ XFree(dnd);
}
else if (ev->selection == ECORE_X_ATOM_SELECTION_XDND)
{
- Ewl_Embed *embed;
- char *atom;
+ Ewl_Embed *embed;
+ char *atom;
- embed = ewl_embed_canvas_window_find((void *)ev->owner);
- atom = XGetAtomName(ecore_x_display_get(), ev->target);
- ewl_embed_dnd_data_request_feed(embed, ev, atom);
- XFree(atom);
+ embed = ewl_embed_canvas_window_find((void *)ev->owner);
+ atom = XGetAtomName(ecore_x_display_get(), ev->target);
+ ewl_embed_dnd_data_request_feed(embed, ev, atom);
+ XFree(atom);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1457,38 +1457,38 @@ ewl_ev_dnd_position(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (window) {
- Ewl_Embed *embed;
-
- ewl_embed_window_position_get(EWL_EMBED(window), &wx, &wy);
- x = ev->position.x - wx;
- y = ev->position.y - wy;
-
- /*
- * Look for the child here
- */
- embed = ewl_embed_canvas_window_find((void *)ev->win);
- if (embed) {
- /* First see if we need to send an 'enter'
- * to the widget */
- if (ewl_embed_dnd_position_feed(embed, x, y, &px,
- &py, &pw, &ph))
- will_accept = 1;
-
- if (embed->last.drop_widget) {
- rect.x = px;
- rect.y = py;
- rect.width = pw;
- rect.height = ph;
- } else {
- rect.x = 0;
- rect.y = 0;
- rect.width = 0;
- rect.height = 0;
- }
-
- /* Don't send status for windows we don't own */
- ecore_x_dnd_send_status(will_accept, 0, rect, ECORE_X_DND_ACTION_PRIVATE);
- }
+ Ewl_Embed *embed;
+
+ ewl_embed_window_position_get(EWL_EMBED(window), &wx, &wy);
+ x = ev->position.x - wx;
+ y = ev->position.y - wy;
+
+ /*
+ * Look for the child here
+ */
+ embed = ewl_embed_canvas_window_find((void *)ev->win);
+ if (embed) {
+ /* First see if we need to send an 'enter'
+ * to the widget */
+ if (ewl_embed_dnd_position_feed(embed, x, y, &px,
+ &py, &pw, &ph))
+ will_accept = 1;
+
+ if (embed->last.drop_widget) {
+ rect.x = px;
+ rect.y = py;
+ rect.width = pw;
+ rect.height = ph;
+ } else {
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = 0;
+ rect.height = 0;
+ }
+
+ /* Don't send status for windows we don't own */
+ ecore_x_dnd_send_status(will_accept, 0, rect, ECORE_X_DND_ACTION_PRIVATE);
+ }
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1508,11 +1508,11 @@ ewl_ev_dnd_enter(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (embed) {
- embed->dnd_types.num_types = ev->num_types;
- embed->dnd_types.types = malloc(sizeof(char*) * ev->num_types);
+ embed->dnd_types.num_types = ev->num_types;
+ embed->dnd_types.types = malloc(sizeof(char*) * ev->num_types);
- for (i = 0; i < ev->num_types; i++)
- embed->dnd_types.types[i] = strdup(ev->types[i]);
+ for (i = 0; i < ev->num_types; i++)
+ embed->dnd_types.types[i] = strdup(ev->types[i]);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1531,15 +1531,15 @@ ewl_ev_dnd_leave(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (embed) {
- if (embed->dnd_types.num_types > 0) {
- for (i = 0; i < embed->dnd_types.num_types; i++)
- FREE(embed->dnd_types.types[i]);
+ if (embed->dnd_types.num_types > 0) {
+ for (i = 0; i < embed->dnd_types.num_types; i++)
+ FREE(embed->dnd_types.types[i]);
- FREE(embed->dnd_types.types);
- embed->dnd_types.types = NULL;
- embed->dnd_types.num_types = 0;
+ FREE(embed->dnd_types.types);
+ embed->dnd_types.types = NULL;
+ embed->dnd_types.num_types = 0;
- }
+ }
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1558,20 +1558,20 @@ ewl_ev_dnd_drop(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (embed) {
- int x, y, wx, wy;
- const char *type;
+ int x, y, wx, wy;
+ const char *type;
- ewl_embed_window_position_get(embed, &wx, &wy);
+ ewl_embed_window_position_get(embed, &wx, &wy);
- if (ev->source == (Ecore_X_Window)embed->canvas_window)
- internal = 1;
+ if (ev->source == (Ecore_X_Window)embed->canvas_window)
+ internal = 1;
- x = ev->position.x - wx;
- y = ev->position.y - wy;
+ x = ev->position.x - wx;
+ y = ev->position.y - wy;
- type = ewl_embed_dnd_drop_feed(embed, x, y, internal);
- if (type)
- ecore_x_selection_xdnd_request(ev->win, (char *)type);
+ type = ewl_embed_dnd_drop_feed(embed, x, y, internal);
+ if (type)
+ ecore_x_selection_xdnd_request(ev->win, (char *)type);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
diff --git a/src/engines/xcb/ewl_engine_xcb.c b/src/engines/xcb/ewl_engine_xcb.c
index 1ec2391..7275921 100644
--- a/src/engines/xcb/ewl_engine_xcb.c
+++ b/src/engines/xcb/ewl_engine_xcb.c
@@ -69,8 +69,8 @@ static void ee_window_dialog_set(Ewl_Window *win);
static void ee_window_states_set(Ewl_Window *win);
static void ee_window_state_request(Ewl_Window *win, int states);
static void ee_window_state_handle(Ewl_Window *win, int states,
- Ewl_Window_Flags ewl_flag,
- Ecore_X_Window_State ecore_flag);
+ Ewl_Window_Flags ewl_flag,
+ Ecore_X_Window_State ecore_flag);
static void ee_window_states_set_helper(Ewl_Window *win);
static void ee_window_hints_set(Ewl_Window *win);
static void ee_window_transient_for(Ewl_Window *win);
@@ -97,43 +97,43 @@ static int ee_pointer_get(Ewl_Embed *embed);
static void *window_funcs[EWL_ENGINE_WINDOW_MAX] =
{
- ee_window_new,
- ee_window_destroy,
- ee_window_move,
- ee_window_resize,
- ee_window_min_max_size_set,
- ee_window_show,
- ee_window_hide,
- ee_window_title_set,
- ee_window_name_class_set,
- ee_window_borderless_set,
- ee_window_dialog_set,
- ee_window_states_set,
- ee_window_hints_set,
- ee_window_transient_for,
- ee_window_leader_set,
- ee_window_raise,
- ee_window_lower,
- ee_keyboard_grab,
- ee_keyboard_ungrab,
- ee_pointer_grab,
- ee_pointer_ungrab,
- ee_window_selection_text_set,
- ee_window_geometry_set,
- ee_dnd_aware_set,
- ee_desktop_size_get,
- ee_dnd_drag_types_set,
- ee_dnd_drag_begin,
- ee_dnd_drag_drop,
- ee_dnd_drag_data_send,
+ ee_window_new,
+ ee_window_destroy,
+ ee_window_move,
+ ee_window_resize,
+ ee_window_min_max_size_set,
+ ee_window_show,
+ ee_window_hide,
+ ee_window_title_set,
+ ee_window_name_class_set,
+ ee_window_borderless_set,
+ ee_window_dialog_set,
+ ee_window_states_set,
+ ee_window_hints_set,
+ ee_window_transient_for,
+ ee_window_leader_set,
+ ee_window_raise,
+ ee_window_lower,
+ ee_keyboard_grab,
+ ee_keyboard_ungrab,
+ ee_pointer_grab,
+ ee_pointer_ungrab,
+ ee_window_selection_text_set,
+ ee_window_geometry_set,
+ ee_dnd_aware_set,
+ ee_desktop_size_get,
+ ee_dnd_drag_types_set,
+ ee_dnd_drag_begin,
+ ee_dnd_drag_drop,
+ ee_dnd_drag_data_send,
};
static void *pointer_funcs[EWL_ENGINE_POINTER_MAX] =
{
- ee_pointer_data_new,
- ee_pointer_free,
- ee_pointer_get,
- ee_pointer_set,
+ ee_pointer_data_new,
+ ee_pointer_free,
+ ee_pointer_get,
+ ee_pointer_set,
};
Ecore_DList *
@@ -153,12 +153,12 @@ ewl_engine_create(int *argc, char ** argv)
engine = NEW(Ewl_Engine_Xcb, 1);
if (!engine)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ee_init(EWL_ENGINE(engine), argc, argv))
{
- FREE(engine);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(engine);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_ENGINE(engine), DLEVEL_STABLE);
@@ -176,117 +176,117 @@ ee_init(Ewl_Engine *engine, int *argc, char ** argv)
/* If the event handlers are already setup don't do it again */
if (ee_expose_handler)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (argc && argv)
{
- for (i = 1; i < *argc; i++)
- {
- if (!strcmp(argv[i], "-display"))
- {
- if (++i < *argc)
- display = argv[i];
- }
- }
+ for (i = 1; i < *argc; i++)
+ {
+ if (!strcmp(argv[i], "-display"))
+ {
+ if (++i < *argc)
+ display = argv[i];
+ }
+ }
}
if (!ecore_x_init(display))
{
- fprintf(stderr, "Unable to initialize Ecore X.\n"
- "Is your DISPLAY variable set correctly?\n\n");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ fprintf(stderr, "Unable to initialize Ecore X.\n"
+ "Is your DISPLAY variable set correctly?\n\n");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ee_expose_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_DAMAGE,
- ewl_ev_x_window_expose, NULL);
+ ECORE_X_EVENT_WINDOW_DAMAGE,
+ ewl_ev_x_window_expose, NULL);
ee_configure_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_CONFIGURE,
- ewl_ev_x_window_configure, NULL);
+ ECORE_X_EVENT_WINDOW_CONFIGURE,
+ ewl_ev_x_window_configure, NULL);
ee_delete_request_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
- ewl_ev_x_window_delete, NULL);
+ ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
+ ewl_ev_x_window_delete, NULL);
/*
* Register dispatching functions for keyboard events.
*/
ee_key_down_handler = ecore_event_handler_add(
- ECORE_X_EVENT_KEY_DOWN,
- ewl_ev_x_key_down, NULL);
+ ECORE_X_EVENT_KEY_DOWN,
+ ewl_ev_x_key_down, NULL);
ee_key_up_handler = ecore_event_handler_add(
- ECORE_X_EVENT_KEY_UP,
- ewl_ev_x_key_up, NULL);
+ ECORE_X_EVENT_KEY_UP,
+ ewl_ev_x_key_up, NULL);
/*
* Register dispatching functions for DND events
*/
ee_dnd_position_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_POSITION,
- ewl_ev_dnd_position, NULL);
+ ECORE_X_EVENT_XDND_POSITION,
+ ewl_ev_dnd_position, NULL);
ee_dnd_enter_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_ENTER,
- ewl_ev_dnd_enter, NULL);
+ ECORE_X_EVENT_XDND_ENTER,
+ ewl_ev_dnd_enter, NULL);
ee_dnd_leave_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_LEAVE,
- ewl_ev_dnd_leave, NULL);
+ ECORE_X_EVENT_XDND_LEAVE,
+ ewl_ev_dnd_leave, NULL);
ee_dnd_drop_handler = ecore_event_handler_add(
- ECORE_X_EVENT_XDND_DROP,
- ewl_ev_dnd_drop, NULL);
+ ECORE_X_EVENT_XDND_DROP,
+ ewl_ev_dnd_drop, NULL);
/*
* Selection callbacks to allow for data transfers.
*/
ee_selection_notify_handler = ecore_event_handler_add(
- ECORE_X_EVENT_SELECTION_NOTIFY,
- ewl_ev_x_data_received, NULL);
+ ECORE_X_EVENT_SELECTION_NOTIFY,
+ ewl_ev_x_data_received, NULL);
/*
* Selection callbacks to allow for pasting.
*/
ee_selection_request_handler = ecore_event_handler_add(
- ECORE_X_EVENT_SELECTION_REQUEST,
- ewl_ev_x_data_request, NULL);
+ ECORE_X_EVENT_SELECTION_REQUEST,
+ ewl_ev_x_data_request, NULL);
/*
* Finally, register dispatching functions for mouse events.
*/
ee_mouse_down_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
- ewl_ev_x_mouse_down, NULL);
+ ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
+ ewl_ev_x_mouse_down, NULL);
ee_mouse_up_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_BUTTON_UP,
- ewl_ev_x_mouse_up, NULL);
+ ECORE_X_EVENT_MOUSE_BUTTON_UP,
+ ewl_ev_x_mouse_up, NULL);
ee_mouse_move_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_MOVE,
- ewl_ev_x_mouse_move, NULL);
+ ECORE_X_EVENT_MOUSE_MOVE,
+ ewl_ev_x_mouse_move, NULL);
ee_mouse_wheel_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_WHEEL,
- ewl_ev_x_mouse_wheel, NULL);
+ ECORE_X_EVENT_MOUSE_WHEEL,
+ ewl_ev_x_mouse_wheel, NULL);
ee_mouse_out_handler = ecore_event_handler_add(
- ECORE_X_EVENT_MOUSE_OUT,
- ewl_ev_x_mouse_out, NULL);
+ ECORE_X_EVENT_MOUSE_OUT,
+ ewl_ev_x_mouse_out, NULL);
ee_focus_in_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_FOCUS_IN,
- ewl_ev_x_focus_in, NULL);
+ ECORE_X_EVENT_WINDOW_FOCUS_IN,
+ ewl_ev_x_focus_in, NULL);
ee_focus_out_handler = ecore_event_handler_add(
- ECORE_X_EVENT_WINDOW_FOCUS_OUT,
- ewl_ev_x_focus_out, NULL);
+ ECORE_X_EVENT_WINDOW_FOCUS_OUT,
+ ewl_ev_x_focus_out, NULL);
if (!ee_expose_handler || !ee_configure_handler
- || !ee_delete_request_handler
- || !ee_key_down_handler || !ee_key_up_handler
- || !ee_dnd_position_handler || !ee_dnd_enter_handler
- || !ee_dnd_leave_handler || !ee_dnd_drop_handler
- || !ee_selection_notify_handler || !ee_selection_request_handler
- || !ee_mouse_down_handler
- || !ee_mouse_up_handler || !ee_mouse_move_handler
- || !ee_mouse_wheel_handler || !ee_mouse_out_handler
- || !ee_focus_in_handler || !ee_focus_out_handler)
+ || !ee_delete_request_handler
+ || !ee_key_down_handler || !ee_key_up_handler
+ || !ee_dnd_position_handler || !ee_dnd_enter_handler
+ || !ee_dnd_leave_handler || !ee_dnd_drop_handler
+ || !ee_selection_notify_handler || !ee_selection_request_handler
+ || !ee_mouse_down_handler
+ || !ee_mouse_up_handler || !ee_mouse_move_handler
+ || !ee_mouse_wheel_handler || !ee_mouse_out_handler
+ || !ee_focus_in_handler || !ee_focus_out_handler)
{
- ee_shutdown(EWL_ENGINE(engine));
+ ee_shutdown(EWL_ENGINE(engine));
- fprintf(stderr, "Unable to create Ecore X event handlers.\n");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ fprintf(stderr, "Unable to create Ecore X event handlers.\n");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
info = NEW(Ewl_Engine_Info, 1);
@@ -306,75 +306,75 @@ ee_shutdown(Ewl_Engine *engine)
DCHECK_PARAM_PTR(engine);
if (ee_expose_handler)
- ecore_event_handler_del(ee_expose_handler);
+ ecore_event_handler_del(ee_expose_handler);
ee_expose_handler = NULL;
if (ee_configure_handler)
- ecore_event_handler_del(ee_configure_handler);
+ ecore_event_handler_del(ee_configure_handler);
ee_configure_handler = NULL;
if (ee_delete_request_handler)
- ecore_event_handler_del(ee_delete_request_handler);
+ ecore_event_handler_del(ee_delete_request_handler);
ee_delete_request_handler = NULL;
if (ee_key_down_handler)
- ecore_event_handler_del(ee_key_down_handler);
+ ecore_event_handler_del(ee_key_down_handler);
ee_key_down_handler = NULL;
if (ee_key_up_handler)
- ecore_event_handler_del(ee_key_up_handler);
+ ecore_event_handler_del(ee_key_up_handler);
ee_key_up_handler = NULL;
if (ee_dnd_position_handler)
- ecore_event_handler_del(ee_dnd_position_handler);
+ ecore_event_handler_del(ee_dnd_position_handler);
ee_dnd_position_handler = NULL;
if (ee_dnd_enter_handler)
- ecore_event_handler_del(ee_dnd_enter_handler);
+ ecore_event_handler_del(ee_dnd_enter_handler);
ee_dnd_enter_handler = NULL;
if (ee_dnd_leave_handler)
- ecore_event_handler_del(ee_dnd_leave_handler);
+ ecore_event_handler_del(ee_dnd_leave_handler);
ee_dnd_leave_handler = NULL;
if (ee_dnd_drop_handler)
- ecore_event_handler_del(ee_dnd_drop_handler);
+ ecore_event_handler_del(ee_dnd_drop_handler);
ee_dnd_drop_handler = NULL;
if (ee_selection_notify_handler)
- ecore_event_handler_del(ee_selection_notify_handler);
+ ecore_event_handler_del(ee_selection_notify_handler);
ee_selection_notify_handler = NULL;
if (ee_selection_request_handler)
- ecore_event_handler_del(ee_selection_request_handler);
+ ecore_event_handler_del(ee_selection_request_handler);
ee_selection_request_handler = NULL;
if (ee_mouse_down_handler)
- ecore_event_handler_del(ee_mouse_down_handler);
+ ecore_event_handler_del(ee_mouse_down_handler);
ee_mouse_down_handler = NULL;
if (ee_mouse_up_handler)
- ecore_event_handler_del(ee_mouse_up_handler);
+ ecore_event_handler_del(ee_mouse_up_handler);
ee_mouse_up_handler = NULL;
if (ee_mouse_move_handler)
- ecore_event_handler_del(ee_mouse_move_handler);
+ ecore_event_handler_del(ee_mouse_move_handler);
ee_mouse_move_handler = NULL;
if (ee_mouse_wheel_handler)
- ecore_event_handler_del(ee_mouse_wheel_handler);
+ ecore_event_handler_del(ee_mouse_wheel_handler);
ee_mouse_wheel_handler = NULL;
if (ee_mouse_out_handler)
- ecore_event_handler_del(ee_mouse_out_handler);
+ ecore_event_handler_del(ee_mouse_out_handler);
ee_mouse_out_handler = NULL;
if (ee_focus_in_handler)
- ecore_event_handler_del(ee_focus_in_handler);
+ ecore_event_handler_del(ee_focus_in_handler);
ee_focus_in_handler = NULL;
if (ee_focus_out_handler)
- ecore_event_handler_del(ee_focus_out_handler);
+ ecore_event_handler_del(ee_focus_out_handler);
ee_focus_out_handler = NULL;
ecore_x_shutdown();
@@ -394,15 +394,15 @@ ee_window_new(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_OVERRIDE)
- xwin = ecore_x_window_override_new(0,
- EWL_EMBED(win)->x, EWL_EMBED(win)->y,
- ewl_object_current_w_get(EWL_OBJECT(win)),
- ewl_object_current_h_get(EWL_OBJECT(win)));
+ xwin = ecore_x_window_override_new(0,
+ EWL_EMBED(win)->x, EWL_EMBED(win)->y,
+ ewl_object_current_w_get(EWL_OBJECT(win)),
+ ewl_object_current_h_get(EWL_OBJECT(win)));
else
- xwin = ecore_x_window_new(0,
- EWL_EMBED(win)->x, EWL_EMBED(win)->y,
- ewl_object_current_w_get(EWL_OBJECT(win)),
- ewl_object_current_h_get(EWL_OBJECT(win)));
+ xwin = ecore_x_window_new(0,
+ EWL_EMBED(win)->x, EWL_EMBED(win)->y,
+ ewl_object_current_w_get(EWL_OBJECT(win)),
+ ewl_object_current_h_get(EWL_OBJECT(win)));
ecore_x_icccm_protocol_get_prefetch(xwin);
ecore_x_icccm_protocol_get_fetch();
@@ -410,7 +410,7 @@ ee_window_new(Ewl_Window *win)
win->window = (void *)(long)xwin;
if (win->flags & EWL_WINDOW_BORDERLESS)
- ee_window_borderless_set(win);
+ ee_window_borderless_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -440,8 +440,8 @@ ee_window_move(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_window_move((Ecore_X_Window)win->window,
- EWL_EMBED(win)->x,
- EWL_EMBED(win)->y);
+ EWL_EMBED(win)->x,
+ EWL_EMBED(win)->y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -461,8 +461,8 @@ ee_window_resize(Ewl_Window *win)
ecore_x_window_resize((Ecore_X_Window)win->window, width, height);
if (EWL_EMBED(win)->canvas_window != win->window)
- ecore_x_window_resize((Ecore_X_Window)EWL_EMBED(win)->canvas_window,
- width, height);
+ ecore_x_window_resize((Ecore_X_Window)EWL_EMBED(win)->canvas_window,
+ width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -477,14 +477,14 @@ ee_window_min_max_size_set(Ewl_Window *win)
ecore_x_icccm_size_pos_hints_get_prefetch((Ecore_X_Window)win->window);
ecore_x_icccm_size_pos_hints_get_fetch();
ecore_x_icccm_size_pos_hints_set((Ecore_X_Window)win->window,
- 0, ECORE_X_GRAVITY_NW,
- ewl_object_minimum_w_get(EWL_OBJECT(win)),
- ewl_object_minimum_h_get(EWL_OBJECT(win)),
- ewl_object_maximum_w_get(EWL_OBJECT(win)),
- ewl_object_maximum_h_get(EWL_OBJECT(win)),
- 0, 0, /* base */
- 0, 0, /* step */
- 0, 0); /* aspect */
+ 0, ECORE_X_GRAVITY_NW,
+ ewl_object_minimum_w_get(EWL_OBJECT(win)),
+ ewl_object_minimum_h_get(EWL_OBJECT(win)),
+ ewl_object_maximum_w_get(EWL_OBJECT(win)),
+ ewl_object_maximum_h_get(EWL_OBJECT(win)),
+ 0, 0, /* base */
+ 0, 0, /* step */
+ 0, 0); /* aspect */
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -536,7 +536,7 @@ ee_window_name_class_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_icccm_name_class_set((Ecore_X_Window)win->window, win->name,
- (win->classname ? win->classname : win->name));
+ (win->classname ? win->classname : win->name));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -549,7 +549,7 @@ ee_window_borderless_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_mwm_borderless_set((Ecore_X_Window)win->window,
- (!!(win->flags & EWL_WINDOW_BORDERLESS)));
+ (!!(win->flags & EWL_WINDOW_BORDERLESS)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -562,9 +562,9 @@ ee_window_dialog_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ecore_x_netwm_window_type_set((Ecore_X_Window)win->window,
- ((!!(win->flags & EWL_WINDOW_DIALOG)) ?
- ECORE_X_WINDOW_TYPE_DIALOG :
- ECORE_X_WINDOW_TYPE_NORMAL));
+ ((!!(win->flags & EWL_WINDOW_DIALOG)) ?
+ ECORE_X_WINDOW_TYPE_DIALOG :
+ ECORE_X_WINDOW_TYPE_NORMAL));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -582,9 +582,9 @@ ee_window_states_set(Ewl_Window *win)
if (!diff) DRETURN(DLEVEL_STABLE);
if (REALIZED(win))
- ee_window_state_request(win, diff);
+ ee_window_state_request(win, diff);
else
- ee_window_states_set_helper(win);
+ ee_window_states_set_helper(win);
win->old_flags = win->flags;
@@ -593,8 +593,8 @@ ee_window_states_set(Ewl_Window *win)
static void
ee_window_state_handle(Ewl_Window *win, int states,
- Ewl_Window_Flags ewl_flag,
- Ecore_X_Window_State ecore_flag)
+ Ewl_Window_Flags ewl_flag,
+ Ecore_X_Window_State ecore_flag)
{
int state = 0;
@@ -604,9 +604,9 @@ ee_window_state_handle(Ewl_Window *win, int states,
if (states & ewl_flag)
{
- state = (!!(win->flags & ewl_flag));
- ecore_x_netwm_state_request_send((Ecore_X_Window)win->window,
- 0, ecore_flag, ECORE_X_WINDOW_STATE_UNKNOWN, state);
+ state = (!!(win->flags & ewl_flag));
+ ecore_x_netwm_state_request_send((Ecore_X_Window)win->window,
+ 0, ecore_flag, ECORE_X_WINDOW_STATE_UNKNOWN, state);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -620,15 +620,15 @@ ee_window_state_request(Ewl_Window *win, int states)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
ee_window_state_handle(win, states, EWL_WINDOW_FULLSCREEN,
- ECORE_X_WINDOW_STATE_FULLSCREEN);
+ ECORE_X_WINDOW_STATE_FULLSCREEN);
ee_window_state_handle(win, states, EWL_WINDOW_SKIP_TASKBAR,
- ECORE_X_WINDOW_STATE_SKIP_TASKBAR);
+ ECORE_X_WINDOW_STATE_SKIP_TASKBAR);
ee_window_state_handle(win, states, EWL_WINDOW_SKIP_PAGER,
- ECORE_X_WINDOW_STATE_SKIP_PAGER);
+ ECORE_X_WINDOW_STATE_SKIP_PAGER);
ee_window_state_handle(win, states, EWL_WINDOW_MODAL,
- ECORE_X_WINDOW_STATE_MODAL);
+ ECORE_X_WINDOW_STATE_MODAL);
ee_window_state_handle(win, states, EWL_WINDOW_DEMANDS_ATTENTION,
- ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION);
+ ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION);
win->flags &= ~EWL_WINDOW_DEMANDS_ATTENTION;
@@ -649,19 +649,19 @@ ee_window_states_set_helper(Ewl_Window *win)
* only relevant if the window has been realized */
if (!win->window)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!!(win->flags & EWL_WINDOW_FULLSCREEN))
- states[count++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
+ states[count++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
if (!!(win->flags & EWL_WINDOW_SKIP_TASKBAR))
- states[count++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
+ states[count++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
if (!!(win->flags & EWL_WINDOW_SKIP_PAGER))
- states[count++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
+ states[count++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
if (!!(win->flags & EWL_WINDOW_MODAL))
- states[count++] = ECORE_X_WINDOW_STATE_MODAL;
+ states[count++] = ECORE_X_WINDOW_STATE_MODAL;
ecore_x_netwm_window_state_set((Ecore_X_Window)win->window, states, count);
@@ -679,23 +679,23 @@ ee_window_hints_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_LEADER)
- win_group = win->leader.ewl->window;
+ win_group = win->leader.ewl->window;
else if (win->flags & EWL_WINDOW_LEADER_FOREIGN)
- win_group = win->leader.foreign;
+ win_group = win->leader.foreign;
else
- win_group = NULL;
+ win_group = NULL;
if (win->flags & EWL_WINDOW_URGENT)
- urgent = TRUE;
+ urgent = TRUE;
ecore_x_icccm_hints_set((Ecore_X_Window) win->window,
- 1, // accepts focus
- 0, // initial states
- 0, // icon pixmap
- 0, // icon mask
- 0, // icon window
- (Ecore_X_Window) win_group, // window group
- urgent); // is urgent
+ 1, // accepts focus
+ 0, // initial states
+ 0, // icon pixmap
+ 0, // icon mask
+ 0, // icon window
+ (Ecore_X_Window) win_group, // window group
+ urgent); // is urgent
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -708,13 +708,13 @@ ee_window_transient_for(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_TRANSIENT)
- ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
- (Ecore_X_Window)win->transient.ewl->window);
+ ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
+ (Ecore_X_Window)win->transient.ewl->window);
else if (win->flags & EWL_WINDOW_TRANSIENT_FOREIGN)
- ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
- (Ecore_X_Window)win->transient.foreign);
+ ecore_x_icccm_transient_for_set((Ecore_X_Window)win->window,
+ (Ecore_X_Window)win->transient.foreign);
else
- ecore_x_icccm_transient_for_unset((Ecore_X_Window)win->window);
+ ecore_x_icccm_transient_for_unset((Ecore_X_Window)win->window);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -729,16 +729,16 @@ ee_window_leader_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (win->flags & EWL_WINDOW_LEADER)
- leader = win->leader.ewl->window;
+ leader = win->leader.ewl->window;
else if (win->flags & EWL_WINDOW_LEADER_FOREIGN)
- leader = win->leader.foreign;
+ leader = win->leader.foreign;
else
- /* according to the icccm specs a client leader
- * sets itself to the leader */
- leader = win->window;
+ /* according to the icccm specs a client leader
+ * sets itself to the leader */
+ leader = win->window;
ecore_x_icccm_client_leader_set((Ecore_X_Window)win->window,
- (Ecore_X_Window)leader);
+ (Ecore_X_Window)leader);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -778,13 +778,13 @@ ee_keyboard_grab(Ewl_Window *win)
if ((!!(win->flags & EWL_WINDOW_GRAB_KEYBOARD)))
{
- ret = ecore_x_keyboard_grab((Ecore_X_Window)win->window);
- ee_current_key_grab_window = win;
+ ret = ecore_x_keyboard_grab((Ecore_X_Window)win->window);
+ ee_current_key_grab_window = win;
}
else if (ee_current_key_grab_window == win)
{
- ecore_x_keyboard_ungrab();
- ee_current_key_grab_window = NULL;
+ ecore_x_keyboard_ungrab();
+ ee_current_key_grab_window = NULL;
}
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -814,13 +814,13 @@ ee_pointer_grab(Ewl_Window *win)
if ((!!(win->flags & EWL_WINDOW_GRAB_POINTER)))
{
- ret = ecore_x_pointer_grab((Ecore_X_Window)win->window);
- ee_current_pointer_grab_window = win;
+ ret = ecore_x_pointer_grab((Ecore_X_Window)win->window);
+ ee_current_pointer_grab_window = win;
}
else if (ee_current_pointer_grab_window == win)
{
- ecore_x_pointer_ungrab();
- ee_current_pointer_grab_window = NULL;
+ ecore_x_pointer_ungrab();
+ ee_current_pointer_grab_window = NULL;
}
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -850,11 +850,11 @@ ee_window_selection_text_set(Ewl_Embed *emb, const char *txt)
ecore_x_selection_primary_prefetch();
ecore_x_selection_primary_fetch();
if (txt)
- ecore_x_selection_primary_set(
- (Ecore_X_Window)emb->canvas_window,
- (unsigned char *)txt, strlen(txt) + 1);
+ ecore_x_selection_primary_set(
+ (Ecore_X_Window)emb->canvas_window,
+ (unsigned char *)txt, strlen(txt) + 1);
else
- ecore_x_selection_primary_clear();
+ ecore_x_selection_primary_clear();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -867,7 +867,7 @@ ee_window_geometry_set(Ewl_Window *win, int *width, int *height)
ecore_x_drawable_geometry_get_prefetch((win ? (Ecore_X_Window)win->window : (Ecore_X_Window)0));
ecore_x_drawable_geometry_get_fetch();
ecore_x_window_geometry_get((win ? (Ecore_X_Window)win->window : (Ecore_X_Window)0),
- NULL, NULL, width, height);
+ NULL, NULL, width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -907,7 +907,7 @@ ee_dnd_drag_types_set(Ewl_Embed *embed, const char **types, unsigned int num)
ecore_x_dnd_type_get_prefetch((Ecore_X_Window)embed->canvas_window);
ecore_x_dnd_aware_set((Ecore_X_Window)embed->canvas_window,
- (num > 0 ? 1 : 0));
+ (num > 0 ? 1 : 0));
ecore_x_dnd_type_get_fetch();
ecore_x_dnd_types_set((Ecore_X_Window)embed->canvas_window, (char **)types, num);
@@ -951,11 +951,11 @@ ee_dnd_drag_data_send(Ewl_Embed *embed, void *handle, void *data, int len)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, FALSE);
ecore_x_window_prop_property_set(request->requestor, request->property,
- request->target, 8, data, len);
+ request->target, 8, data, len);
DRETURN_INT(ecore_x_selection_notify_send(request->requestor,
- request->selection, request->target,
- request->property, request->time), DLEVEL_STABLE);
+ request->selection, request->target,
+ request->property, request->time), DLEVEL_STABLE);
}
static int
@@ -966,7 +966,7 @@ ee_pointer_data_new(Ewl_Embed *embed, int *data, int w, int h)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, 0);
DRETURN_INT(ecore_x_cursor_new((Ecore_X_Window)embed->canvas_window,
- data, w, h, 0, 0), DLEVEL_STABLE);
+ data, w, h, 0, 0), DLEVEL_STABLE);
}
static void
@@ -1005,9 +1005,9 @@ ee_pointer_set(Ewl_Embed *embed, int pointer)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
if (pointer >= EWL_MOUSE_CURSOR_MAX)
- cur = pointer;
+ cur = pointer;
else
- cur = ecore_x_cursor_shape_get(pointer);
+ cur = ecore_x_cursor_shape_get(pointer);
ecore_x_window_cursor_set((Ecore_X_Window)embed->canvas_window, cur);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1030,7 +1030,7 @@ ewl_ev_x_window_expose(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
event.x = ev->x;
event.y = ev->y;
@@ -1061,19 +1061,19 @@ ewl_ev_x_window_configure(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (!embed)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
/*
* Save coords and queue a configure event if the window is moved.
*/
if ((ev->from_wm) && (ev->x != embed->x)) {
- embed->x = ev->x;
- config = 1;
+ embed->x = ev->x;
+ config = 1;
}
if ((ev->from_wm) && (ev->y != embed->y)) {
- embed->y = ev->y;
- config = 1;
+ embed->y = ev->y;
+ config = 1;
}
window = ewl_window_window_find((void *)ev->win);
@@ -1081,27 +1081,27 @@ ewl_ev_x_window_configure(void *data __UNUSED__, int type __UNUSED__, void *e)
* we can finish when the embed is not a window
*/
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (config)
- ewl_widget_configure(EWL_WIDGET(window));
+ ewl_widget_configure(EWL_WIDGET(window));
/*
* Configure events really only need to occur on resize.
*/
if ((ewl_object_current_w_get(EWL_OBJECT(window)) != ev->w)
- || (ewl_object_current_h_get(EWL_OBJECT(window)) != ev->h)) {
-
- /*
- * Right now this is commented out, as it was preventing windows
- * from resizing when WE were the ones setting the size
- * (mainly on initial show of the window). It would be nice to
- * add this back in to limit the # of window resizes occuring.
- * (As long as it doesn't break initial size.)
- */
- if (ev->from_wm) window->flags |= EWL_WINDOW_USER_CONFIGURE;
- ewl_object_geometry_request(EWL_OBJECT(window), 0, 0, ev->w,
- ev->h);
+ || (ewl_object_current_h_get(EWL_OBJECT(window)) != ev->h)) {
+
+ /*
+ * Right now this is commented out, as it was preventing windows
+ * from resizing when WE were the ones setting the size
+ * (mainly on initial show of the window). It would be nice to
+ * add this back in to limit the # of window resizes occuring.
+ * (As long as it doesn't break initial size.)
+ */
+ if (ev->from_wm) window->flags |= EWL_WINDOW_USER_CONFIGURE;
+ ewl_object_geometry_request(EWL_OBJECT(window), 0, 0, ev->w,
+ ev->h);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1123,7 +1123,7 @@ ewl_ev_x_window_delete(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_DELETE_WINDOW);
@@ -1143,28 +1143,28 @@ ewl_ev_x_key_down(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
if (strstr(ev->keyname, "Shift_"))
- key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
else if (strstr(ev->keyname, "Control_"))
- key_modifiers |= EWL_KEY_MODIFIER_CTRL;
+ key_modifiers |= EWL_KEY_MODIFIER_CTRL;
else if (strstr(ev->keyname, "Alt_"))
- key_modifiers |= EWL_KEY_MODIFIER_ALT;
+ key_modifiers |= EWL_KEY_MODIFIER_ALT;
else if (strstr(ev->keyname, "Mod_"))
- key_modifiers |= EWL_KEY_MODIFIER_MOD;
+ key_modifiers |= EWL_KEY_MODIFIER_MOD;
else if (strstr(ev->keyname, "Super_"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
else if (strstr(ev->keyname, "Hyper_"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
else if (!ev->key_compose || iscntrl(*ev->key_compose))
- ewl_embed_key_down_feed(EWL_EMBED(window), ev->keyname,
- key_modifiers);
+ ewl_embed_key_down_feed(EWL_EMBED(window), ev->keyname,
+ key_modifiers);
else
- ewl_embed_key_down_feed(EWL_EMBED(window), ev->key_compose,
- key_modifiers);
+ ewl_embed_key_down_feed(EWL_EMBED(window), ev->key_compose,
+ key_modifiers);
ewl_ev_modifiers_set(key_modifiers);
@@ -1184,28 +1184,28 @@ ewl_ev_x_key_up(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
if (strstr(ev->keyname, "Shift_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
else if (strstr(ev->keyname, "Control_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
+ key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
else if (strstr(ev->keyname, "Alt_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
else if (strstr(ev->keyname, "Mod_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
+ key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
else if (strstr(ev->keyname, "Super_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
else if (strstr(ev->keyname, "Hyper_"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
else if (!ev->key_compose || iscntrl(*ev->key_compose))
- ewl_embed_key_up_feed(EWL_EMBED(window), ev->keyname,
- key_modifiers);
+ ewl_embed_key_up_feed(EWL_EMBED(window), ev->keyname,
+ key_modifiers);
else
- ewl_embed_key_up_feed(EWL_EMBED(window), ev->key_compose,
- key_modifiers);
+ ewl_embed_key_up_feed(EWL_EMBED(window), ev->key_compose,
+ key_modifiers);
ewl_ev_modifiers_set(key_modifiers);
@@ -1226,16 +1226,16 @@ ewl_ev_x_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
if (ev->double_click)
- clicks = 2;
+ clicks = 2;
if (ev->triple_click)
- clicks = 3;
+ clicks = 3;
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_down_feed(EWL_EMBED(window), ev->button, clicks,
- ev->x, ev->y, key_modifiers);
+ ev->x, ev->y, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1253,12 +1253,12 @@ ewl_ev_x_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_up_feed(EWL_EMBED(window), ev->button, ev->x,
- ev->y, key_modifiers);
+ ev->y, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1276,11 +1276,11 @@ ewl_ev_x_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_move_feed(EWL_EMBED(window), ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1296,11 +1296,11 @@ ewl_ev_x_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_out_feed(EWL_EMBED(window), ev->x, ev->y,
- key_modifiers);
+ key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1316,11 +1316,11 @@ ewl_ev_x_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
key_modifiers = ewl_ev_modifiers_get();
ewl_embed_mouse_wheel_feed(EWL_EMBED(window), ev->x, ev->y,
- ev->z, ev->direction, key_modifiers);
+ ev->z, ev->direction, key_modifiers);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1336,7 +1336,7 @@ ewl_ev_x_focus_in(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_FOCUS_IN);
@@ -1353,7 +1353,7 @@ ewl_ev_x_focus_out(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (!window)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
ewl_callback_call(EWL_WIDGET(window), EWL_CALLBACK_FOCUS_OUT);
@@ -1372,43 +1372,43 @@ ewl_ev_x_data_received(void *data __UNUSED__, int type __UNUSED__, void *e)
/* Handle everything *except* XDND selection */
if (ev->selection != ECORE_X_SELECTION_XDND)
- printf("Paste event received\n");
+ printf("Paste event received\n");
else
{
- Ewl_Embed *embed;
- Ecore_X_Selection_Data *data = ev->data;
-
- embed = ewl_embed_canvas_window_find((void *)ev->win);
- if (embed)
- {
- if (data->content == ECORE_X_SELECTION_CONTENT_FILES)
- {
- Ecore_X_Selection_Data_Files *files = ev->data;
- ewl_embed_dnd_data_received_feed(embed,
- ev->target,
- files->files,
- files->num_files,
- data->format);
- }
- else if (data->content == ECORE_X_SELECTION_CONTENT_TEXT)
- {
- Ecore_X_Selection_Data_Text *text = ev->data;
- ewl_embed_dnd_data_received_feed(embed,
- ev->target, text->text,
- data->length,
- data->format);
- }
- else
- {
- ewl_embed_dnd_data_received_feed(embed,
- ev->target, data->data,
- data->length,
- data->format);
- }
- }
-
- ecore_x_dnd_send_finished();
+ Ewl_Embed *embed;
+ Ecore_X_Selection_Data *data = ev->data;
+
+ embed = ewl_embed_canvas_window_find((void *)ev->win);
+ if (embed)
+ {
+ if (data->content == ECORE_X_SELECTION_CONTENT_FILES)
+ {
+ Ecore_X_Selection_Data_Files *files = ev->data;
+ ewl_embed_dnd_data_received_feed(embed,
+ ev->target,
+ files->files,
+ files->num_files,
+ data->format);
+ }
+ else if (data->content == ECORE_X_SELECTION_CONTENT_TEXT)
+ {
+ Ecore_X_Selection_Data_Text *text = ev->data;
+ ewl_embed_dnd_data_received_feed(embed,
+ ev->target, text->text,
+ data->length,
+ data->format);
+ }
+ else
+ {
+ ewl_embed_dnd_data_received_feed(embed,
+ ev->target, data->data,
+ data->length,
+ data->format);
+ }
+ }
+
+ ecore_x_dnd_send_finished();
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1427,30 +1427,30 @@ ewl_ev_x_data_request(void *data __UNUSED__, int type __UNUSED__, void *e)
/* Handle everything *except* XDND selection */
if (ev->selection != ECORE_X_ATOM_SELECTION_XDND)
{
- char *rec, *dnd;
-
- ecore_x_atom_name_get_prefetch(ev->selection);
- ecore_x_atom_name_get_prefetch(ECORE_X_ATOM_SELECTION_XDND);
- ecore_x_atom_name_get_fetch();
- rec = ecore_x_atom_name_get(ev->selection);
- ecore_x_atom_name_get_fetch();
- dnd = ecore_x_atom_name_get(ECORE_X_ATOM_SELECTION_XDND);
- printf("Data request event received: %s not %s\n", rec, dnd);
- free(rec);
- free(dnd);
+ char *rec, *dnd;
+
+ ecore_x_atom_name_get_prefetch(ev->selection);
+ ecore_x_atom_name_get_prefetch(ECORE_X_ATOM_SELECTION_XDND);
+ ecore_x_atom_name_get_fetch();
+ rec = ecore_x_atom_name_get(ev->selection);
+ ecore_x_atom_name_get_fetch();
+ dnd = ecore_x_atom_name_get(ECORE_X_ATOM_SELECTION_XDND);
+ printf("Data request event received: %s not %s\n", rec, dnd);
+ free(rec);
+ free(dnd);
}
else if (ev->selection == ECORE_X_ATOM_SELECTION_XDND)
{
- Ewl_Embed *embed;
- char *atom;
-
- ecore_x_atom_name_get_prefetch(ev->target);
- embed = ewl_embed_canvas_window_find((void *)ev->owner);
- ecore_x_atom_name_get_fetch();
- atom = ecore_x_atom_name_get(ev->target);
- ewl_embed_dnd_data_request_feed(embed, ev, atom);
- free(atom);
+ Ewl_Embed *embed;
+ char *atom;
+
+ ecore_x_atom_name_get_prefetch(ev->target);
+ embed = ewl_embed_canvas_window_find((void *)ev->owner);
+ ecore_x_atom_name_get_fetch();
+ atom = ecore_x_atom_name_get(ev->target);
+ ewl_embed_dnd_data_request_feed(embed, ev, atom);
+ free(atom);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1473,38 +1473,38 @@ ewl_ev_dnd_position(void *data __UNUSED__, int type __UNUSED__, void *e)
window = ewl_window_window_find((void *)ev->win);
if (window) {
- Ewl_Embed *embed;
-
- ewl_embed_window_position_get(EWL_EMBED(window), &wx, &wy);
- x = ev->position.x - wx;
- y = ev->position.y - wy;
-
- /*
- * Look for the child here
- */
- embed = ewl_embed_canvas_window_find((void *)ev->win);
- if (embed) {
- /* First see if we need to send an 'enter'
- * to the widget */
- if (ewl_embed_dnd_position_feed(embed, x, y, &px,
- &py, &pw, &ph))
- will_accept = 1;
-
- if (embed->last.drop_widget) {
- rect.x = px;
- rect.y = py;
- rect.width = pw;
- rect.height = ph;
- } else {
- rect.x = 0;
- rect.y = 0;
- rect.width = 0;
- rect.height = 0;
- }
-
- /* Don't send status for windows we don't own */
- ecore_x_dnd_send_status(will_accept, 0, rect, ECORE_X_DND_ACTION_PRIVATE);
- }
+ Ewl_Embed *embed;
+
+ ewl_embed_window_position_get(EWL_EMBED(window), &wx, &wy);
+ x = ev->position.x - wx;
+ y = ev->position.y - wy;
+
+ /*
+ * Look for the child here
+ */
+ embed = ewl_embed_canvas_window_find((void *)ev->win);
+ if (embed) {
+ /* First see if we need to send an 'enter'
+ * to the widget */
+ if (ewl_embed_dnd_position_feed(embed, x, y, &px,
+ &py, &pw, &ph))
+ will_accept = 1;
+
+ if (embed->last.drop_widget) {
+ rect.x = px;
+ rect.y = py;
+ rect.width = pw;
+ rect.height = ph;
+ } else {
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = 0;
+ rect.height = 0;
+ }
+
+ /* Don't send status for windows we don't own */
+ ecore_x_dnd_send_status(will_accept, 0, rect, ECORE_X_DND_ACTION_PRIVATE);
+ }
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -1524,11 +1524,11 @@ ewl_ev_dnd_enter(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (embed) {
- embed->dnd_types.num_types = ev->num_types;
- embed->dnd_types.types = malloc(sizeof(char*) * ev->num_types);
+ embed->dnd_types.num_types = ev->num_types;
+ embed->dnd_types.types = malloc(sizeof(char*) * ev->num_types);
- for (i = 0; i < ev->num_types; i++)
- embed->dnd_types.types[i] = strdup(ev->types[i]);
+ for (i = 0; i < ev->num_types; i++)
+ embed->dnd_types.types[i] = strdup(ev->types[i]);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1547,15 +1547,15 @@ ewl_ev_dnd_leave(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (embed) {
- if (embed->dnd_types.num_types > 0) {
- for (i = 0; i < embed->dnd_types.num_types; i++)
- FREE(embed->dnd_types.types[i]);
+ if (embed->dnd_types.num_types > 0) {
+ for (i = 0; i < embed->dnd_types.num_types; i++)
+ FREE(embed->dnd_types.types[i]);
- FREE(embed->dnd_types.types);
- embed->dnd_types.types = NULL;
- embed->dnd_types.num_types = 0;
+ FREE(embed->dnd_types.types);
+ embed->dnd_types.types = NULL;
+ embed->dnd_types.num_types = 0;
- }
+ }
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1574,20 +1574,20 @@ ewl_ev_dnd_drop(void *data __UNUSED__, int type __UNUSED__, void *e)
embed = ewl_embed_canvas_window_find((void *)ev->win);
if (embed) {
- int x, y, wx, wy;
- const char *type;
+ int x, y, wx, wy;
+ const char *type;
- ewl_embed_window_position_get(embed, &wx, &wy);
+ ewl_embed_window_position_get(embed, &wx, &wy);
- if (ev->source == (Ecore_X_Window)embed->canvas_window)
- internal = 1;
+ if (ev->source == (Ecore_X_Window)embed->canvas_window)
+ internal = 1;
- x = ev->position.x - wx;
- y = ev->position.y - wy;
+ x = ev->position.x - wx;
+ y = ev->position.y - wy;
- type = ewl_embed_dnd_drop_feed(embed, x, y, internal);
- if (type)
- ecore_x_selection_xdnd_request(ev->win, (char *)type);
+ type = ewl_embed_dnd_drop_feed(embed, x, y, internal);
+ if (type)
+ ecore_x_selection_xdnd_request(ev->win, (char *)type);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
diff --git a/src/lib/ewl_attach.c b/src/lib/ewl_attach.c
index d8b6bb2..af6e6c2 100644
--- a/src/lib/ewl_attach.c
+++ b/src/lib/ewl_attach.c
@@ -38,13 +38,13 @@ static Ewl_Attach_List *ewl_attach_list_new(void);
static void ewl_attach_list_free(Ewl_Attach_List *list);
static void ewl_attach_list_add(Ewl_Attach_List *list, Ewl_Widget *parent,
- Ewl_Attach *attach);
+ Ewl_Attach *attach);
static void *ewl_attach_list_get(Ewl_Attach_List *list, Ewl_Attach_Type type);
static Ewl_Attach *ewl_attach_new(Ewl_Attach_Type t,
- Ewl_Attach_Data_Type dt, void *data);
+ Ewl_Attach_Data_Type dt, void *data);
static int ewl_attach_init(Ewl_Attach *attach, Ewl_Attach_Type t,
- Ewl_Attach_Data_Type dt, void *data);
+ Ewl_Attach_Data_Type dt, void *data);
static void ewl_attach_free(Ewl_Attach *attach);
static void ewl_attach_parent_setup(Ewl_Widget *w);
@@ -78,19 +78,19 @@ ewl_attach_text_set(Ewl_Widget *w, Ewl_Attach_Type t, const char *data)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!w->attach)
- ewl_attach_parent_setup(w);
+ ewl_attach_parent_setup(w);
if (data)
{
- Ewl_Attach *attach;
+ Ewl_Attach *attach;
- attach = ewl_attach_new(t, EWL_ATTACH_DATA_TYPE_TEXT,
- (void *)data);
- if (attach)
- ewl_attach_list_add(w->attach, w, attach);
+ attach = ewl_attach_new(t, EWL_ATTACH_DATA_TYPE_TEXT,
+ (void *)data);
+ if (attach)
+ ewl_attach_list_add(w->attach, w, attach);
}
else
- ewl_attach_list_del(w->attach, t);
+ ewl_attach_list_del(w->attach, t);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -111,19 +111,19 @@ ewl_attach_widget_set(Ewl_Widget *w, Ewl_Attach_Type t, Ewl_Widget *data)
DCHECK_TYPE(data, EWL_WIDGET_TYPE);
if (!w->attach)
- ewl_attach_parent_setup(w);
+ ewl_attach_parent_setup(w);
if (data)
{
- Ewl_Attach *attach;
+ Ewl_Attach *attach;
- attach = ewl_attach_new(t, EWL_ATTACH_DATA_TYPE_WIDGET,
- (void *)data);
- if (attach)
- ewl_attach_list_add(w->attach, w, attach);
+ attach = ewl_attach_new(t, EWL_ATTACH_DATA_TYPE_WIDGET,
+ (void *)data);
+ if (attach)
+ ewl_attach_list_add(w->attach, w, attach);
}
else
- ewl_attach_list_del(w->attach, t);
+ ewl_attach_list_del(w->attach, t);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -144,18 +144,18 @@ ewl_attach_other_set(Ewl_Widget *w, Ewl_Attach_Type t, void *data)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!w->attach)
- ewl_attach_parent_setup(w);
+ ewl_attach_parent_setup(w);
if (data)
{
- Ewl_Attach *attach;
+ Ewl_Attach *attach;
- attach = ewl_attach_new(t, EWL_ATTACH_DATA_TYPE_OTHER, data);
- if (attach)
- ewl_attach_list_add(w->attach, w, attach);
+ attach = ewl_attach_new(t, EWL_ATTACH_DATA_TYPE_OTHER, data);
+ if (attach)
+ ewl_attach_list_add(w->attach, w, attach);
}
else
- ewl_attach_list_del(w->attach, t);
+ ewl_attach_list_del(w->attach, t);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -180,15 +180,15 @@ ewl_attach_dnd_drag_set(Ewl_Widget *w, Ewl_Widget *c, void *data, int size)
dnd_data = ewl_attach_get(w, EWL_ATTACH_TYPE_DND_DATA);
if (!c && !data) {
- if (dnd_data)
- FREE(dnd_data);
+ if (dnd_data)
+ FREE(dnd_data);
}
else {
- if (!dnd_data)
- dnd_data = NEW(Ewl_Attach_Dnd, 1);
- dnd_data->cursor = c;
- dnd_data->data = data;
- dnd_data->size = size;
+ if (!dnd_data)
+ dnd_data = NEW(Ewl_Attach_Dnd, 1);
+ dnd_data->cursor = c;
+ dnd_data->data = data;
+ dnd_data->size = size;
}
ewl_attach_other_set(w, EWL_ATTACH_TYPE_DND_DATA, dnd_data);
@@ -213,13 +213,13 @@ ewl_attach_get(Ewl_Widget *w, Ewl_Attach_Type t)
if (!w->attach)
{
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
attach = ewl_attach_list_get(w->attach, t);
if (attach)
{
- DRETURN_PTR(attach->data, DLEVEL_STABLE);
+ DRETURN_PTR(attach->data, DLEVEL_STABLE);
}
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -243,18 +243,18 @@ ewl_attach_list_free(Ewl_Attach_List *list)
DCHECK_PARAM_PTR(list);
if (list->direct)
- ewl_attach_list_del(list, EWL_ATTACH(list->list)->type);
+ ewl_attach_list_del(list, EWL_ATTACH(list->list)->type);
else
{
- while (list->len)
- {
- if (!list->direct)
- ewl_attach_list_del(list,
- EWL_ATTACH(list->list[0])->type);
- else
- ewl_attach_list_del(list,
- EWL_ATTACH(list->list)->type);
- }
+ while (list->len)
+ {
+ if (!list->direct)
+ ewl_attach_list_del(list,
+ EWL_ATTACH(list->list[0])->type);
+ else
+ ewl_attach_list_del(list,
+ EWL_ATTACH(list->list)->type);
+ }
}
FREE(list);
@@ -270,50 +270,50 @@ ewl_attach_list_add(Ewl_Attach_List *list, Ewl_Widget *parent, Ewl_Attach *attac
if (!list->len)
{
- list->len = 1;
- list->direct = 1;
- list->list = (void *)attach;
+ list->len = 1;
+ list->direct = 1;
+ list->list = (void *)attach;
- ewl_attach_attach_type_setup(parent, attach);
- DRETURN(DLEVEL_STABLE);
+ ewl_attach_attach_type_setup(parent, attach);
+ DRETURN(DLEVEL_STABLE);
}
else if (list->direct)
{
- Ewl_Attach *tmp;
- tmp = EWL_ATTACH(list->list);
-
- /* replace if the same type */
- if (tmp->type == attach->type)
- {
- ewl_attach_free(tmp);
- list->list = (void *)attach;
-
- ewl_attach_attach_type_setup(parent, attach);
- DRETURN(DLEVEL_STABLE);
- }
-
- list->list = malloc(sizeof(void *));
- list->list[0] = tmp;
- list->direct = 0;
+ Ewl_Attach *tmp;
+ tmp = EWL_ATTACH(list->list);
+
+ /* replace if the same type */
+ if (tmp->type == attach->type)
+ {
+ ewl_attach_free(tmp);
+ list->list = (void *)attach;
+
+ ewl_attach_attach_type_setup(parent, attach);
+ DRETURN(DLEVEL_STABLE);
+ }
+
+ list->list = malloc(sizeof(void *));
+ list->list[0] = tmp;
+ list->direct = 0;
}
else
{
- unsigned int i;
- Ewl_Attach *tmp;
-
- /* replace if in list already */
- for (i = 0; i < list->len; i++)
- {
- tmp = EWL_ATTACH(list->list[i]);
- if (tmp->type == attach->type)
- {
- ewl_attach_free(tmp);
- list->list[i] = attach;
-
- ewl_attach_attach_type_setup(parent, attach);
- DRETURN(DLEVEL_STABLE);
- }
- }
+ unsigned int i;
+ Ewl_Attach *tmp;
+
+ /* replace if in list already */
+ for (i = 0; i < list->len; i++)
+ {
+ tmp = EWL_ATTACH(list->list[i]);
+ if (tmp->type == attach->type)
+ {
+ ewl_attach_free(tmp);
+ list->list[i] = attach;
+
+ ewl_attach_attach_type_setup(parent, attach);
+ DRETURN(DLEVEL_STABLE);
+ }
+ }
}
list->len ++;
@@ -335,14 +335,14 @@ ewl_attach_attach_type_setup(Ewl_Widget *w, Ewl_Attach *attach)
switch (attach->type)
{
- case EWL_ATTACH_TYPE_TOOLTIP:
- ewl_attach_tooltip_attach(w, attach);
- break;
-
- case EWL_ATTACH_TYPE_COLOR:
- case EWL_ATTACH_TYPE_NAME:
- default:
- break;
+ case EWL_ATTACH_TYPE_TOOLTIP:
+ ewl_attach_tooltip_attach(w, attach);
+ break;
+
+ case EWL_ATTACH_TYPE_COLOR:
+ case EWL_ATTACH_TYPE_NAME:
+ default:
+ break;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -362,46 +362,46 @@ ewl_attach_list_del(Ewl_Attach_List *list, Ewl_Attach_Type type)
if (!list->len)
{
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
else if (list->direct)
{
- Ewl_Attach *tmp;
-
- tmp = EWL_ATTACH(list->list);
- if (tmp->type == type)
- {
- ewl_attach_free(tmp);
- list->len --;
- list->direct = 0;
- list->list = NULL;
- }
- DRETURN(DLEVEL_STABLE);
+ Ewl_Attach *tmp;
+
+ tmp = EWL_ATTACH(list->list);
+ if (tmp->type == type)
+ {
+ ewl_attach_free(tmp);
+ list->len --;
+ list->direct = 0;
+ list->list = NULL;
+ }
+ DRETURN(DLEVEL_STABLE);
}
else
{
- unsigned int i;
- Ewl_Attach *tmp;
-
- for (i = 0; i < list->len; i++)
- {
- tmp = EWL_ATTACH(list->list[i]);
-
- if (tmp->type == type)
- {
- ewl_attach_free(tmp);
- list->len --;
-
- /* if not the last entry */
- if (i != list->len)
- memmove(list->list + i,
- list->list + i + 1,
- list->len * sizeof(void *));
-
- list->list = realloc(list->list,
- list->len * sizeof(void *));
- }
- }
+ unsigned int i;
+ Ewl_Attach *tmp;
+
+ for (i = 0; i < list->len; i++)
+ {
+ tmp = EWL_ATTACH(list->list[i]);
+
+ if (tmp->type == type)
+ {
+ ewl_attach_free(tmp);
+ list->len --;
+
+ /* if not the last entry */
+ if (i != list->len)
+ memmove(list->list + i,
+ list->list + i + 1,
+ list->len * sizeof(void *));
+
+ list->list = realloc(list->list,
+ list->len * sizeof(void *));
+ }
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -415,33 +415,33 @@ ewl_attach_list_get(Ewl_Attach_List *list, Ewl_Attach_Type type)
if (!list->len)
{
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
else if (list->direct)
{
- Ewl_Attach *tmp;
-
- tmp = EWL_ATTACH(list->list);
- if (tmp->type == type)
- {
- DRETURN_PTR(tmp, DLEVEL_STABLE);
- }
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ Ewl_Attach *tmp;
+
+ tmp = EWL_ATTACH(list->list);
+ if (tmp->type == type)
+ {
+ DRETURN_PTR(tmp, DLEVEL_STABLE);
+ }
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
else
{
- unsigned int i;
- Ewl_Attach *tmp;
-
- for (i = 0; i < list->len; i++)
- {
- tmp = EWL_ATTACH(list->list[i]);
-
- if (tmp->type == type)
- {
- DRETURN_PTR(tmp, DLEVEL_STABLE);
- }
- }
+ unsigned int i;
+ Ewl_Attach *tmp;
+
+ for (i = 0; i < list->len; i++)
+ {
+ tmp = EWL_ATTACH(list->list[i]);
+
+ if (tmp->type == type)
+ {
+ DRETURN_PTR(tmp, DLEVEL_STABLE);
+ }
+ }
}
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -456,12 +456,12 @@ ewl_attach_new(Ewl_Attach_Type t, Ewl_Attach_Data_Type dt, void *data)
attach = NEW(Ewl_Attach, 1);
if (!attach)
{
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!ewl_attach_init(attach, t, dt, data))
{
- FREE(attach);
+ FREE(attach);
}
DRETURN_PTR(attach, DLEVEL_STABLE);
@@ -469,7 +469,7 @@ ewl_attach_new(Ewl_Attach_Type t, Ewl_Attach_Data_Type dt, void *data)
static int
ewl_attach_init(Ewl_Attach *attach, Ewl_Attach_Type t,
- Ewl_Attach_Data_Type dt, void *data)
+ Ewl_Attach_Data_Type dt, void *data)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(attach, FALSE);
@@ -477,9 +477,9 @@ ewl_attach_init(Ewl_Attach *attach, Ewl_Attach_Type t,
attach->type = t;
if (dt == EWL_ATTACH_DATA_TYPE_TEXT)
- attach->data = strdup(data);
+ attach->data = strdup(data);
else
- attach->data = data;
+ attach->data = data;
attach->data_type = dt;
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -495,7 +495,7 @@ ewl_attach_free(Ewl_Attach *attach)
if ((attach->data_type == EWL_ATTACH_DATA_TYPE_TEXT))
{
- IF_FREE(attach->data);
+ IF_FREE(attach->data);
}
@@ -513,14 +513,14 @@ ewl_attach_parent_setup(Ewl_Widget *w)
w->attach = ewl_attach_list_new();
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY,
- ewl_attach_cb_parent_destroy, NULL);
+ ewl_attach_cb_parent_destroy, NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_attach_cb_parent_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -528,14 +528,14 @@ ewl_attach_cb_parent_destroy(Ewl_Widget *w, void *ev __UNUSED__,
/* make sure the timer gets cleaned up if the widget goes away */
if ((ewl_attach_tooltip) && (w == ewl_attach_tooltip->to)
- && (ewl_attach_tooltip->timer))
+ && (ewl_attach_tooltip->timer))
{
- ecore_timer_del(ewl_attach_tooltip->timer);
- ewl_attach_tooltip->timer = NULL;
+ ecore_timer_del(ewl_attach_tooltip->timer);
+ ewl_attach_tooltip->timer = NULL;
}
if (w->attach)
- ewl_attach_list_free(w->attach);
+ ewl_attach_list_free(w->attach);
w->attach = NULL;
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -550,13 +550,13 @@ ewl_attach_tooltip_attach(Ewl_Widget *w, Ewl_Attach *attach)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_attach_cb_tooltip_mouse_move, NULL);
+ ewl_attach_cb_tooltip_mouse_move, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_attach_cb_tooltip_mouse_down, NULL);
+ ewl_attach_cb_tooltip_mouse_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_OUT,
- ewl_attach_cb_tooltip_mouse_out, NULL);
+ ewl_attach_cb_tooltip_mouse_out, NULL);
ewl_callback_append(w, EWL_CALLBACK_OBSCURE,
- ewl_attach_cb_tooltip_mouse_out, NULL);
+ ewl_attach_cb_tooltip_mouse_out, NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -569,10 +569,10 @@ ewl_attach_tooltip_detach(Ewl_Attach *attach)
/* make sure the display attach is our attach */
if (!ewl_attach_tooltip || (ewl_attach_tooltip->attach != attach))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_attach_tooltip->timer)
- ecore_timer_del(ewl_attach_tooltip->timer);
+ ecore_timer_del(ewl_attach_tooltip->timer);
ewl_attach_tooltip->timer = NULL;
ewl_attach_tooltip->to = NULL;
@@ -582,18 +582,18 @@ ewl_attach_tooltip_detach(Ewl_Attach *attach)
/* cleanup the display window */
if (ewl_attach_tooltip->box)
{
- if (attach->data_type != EWL_ATTACH_DATA_TYPE_TEXT)
- ewl_container_child_remove(
- EWL_CONTAINER(ewl_attach_tooltip->box),
- EWL_WIDGET(attach->data));
+ if (attach->data_type != EWL_ATTACH_DATA_TYPE_TEXT)
+ ewl_container_child_remove(
+ EWL_CONTAINER(ewl_attach_tooltip->box),
+ EWL_WIDGET(attach->data));
- ewl_widget_destroy(ewl_attach_tooltip->box);
- ewl_attach_tooltip->box = NULL;
+ ewl_widget_destroy(ewl_attach_tooltip->box);
+ ewl_attach_tooltip->box = NULL;
}
/* destroy window if needed */
if (ewl_attach_tooltip->win && VISIBLE(ewl_attach_tooltip->win))
- ewl_widget_hide(ewl_attach_tooltip->win);
+ ewl_widget_hide(ewl_attach_tooltip->win);
ewl_attach_tooltip->attach = NULL;
@@ -616,23 +616,23 @@ ewl_attach_cb_tooltip_mouse_move(Ewl_Widget *w, void *ev, void *data __UNUSED__)
e = ev;
attach = ewl_attach_list_get(w->attach, EWL_ATTACH_TYPE_TOOLTIP);
if (!attach)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!ewl_attach_tooltip)
- ewl_attach_tooltip = NEW(Ewl_Attach_Tooltip, 1);
+ ewl_attach_tooltip = NEW(Ewl_Attach_Tooltip, 1);
/* we only want to kill this tooltip if the move is outside
* the move tolerance */
if (ewl_attach_tooltip && (ewl_attach_tooltip->attach == attach))
{
- int amt = 0;
-
- amt = ewl_theme_data_int_get(w, "/tooltip/tolerance");
- if ((e->x >= (ewl_attach_tooltip->x - amt))
- && (e->x <= (ewl_attach_tooltip->x + amt))
- && (e->y >= (ewl_attach_tooltip->y - amt))
- && (e->y <= (ewl_attach_tooltip->y + amt)))
- DRETURN(DLEVEL_STABLE);
+ int amt = 0;
+
+ amt = ewl_theme_data_int_get(w, "/tooltip/tolerance");
+ if ((e->x >= (ewl_attach_tooltip->x - amt))
+ && (e->x <= (ewl_attach_tooltip->x + amt))
+ && (e->y >= (ewl_attach_tooltip->y - amt))
+ && (e->y <= (ewl_attach_tooltip->y + amt)))
+ DRETURN(DLEVEL_STABLE);
}
ewl_attach_tooltip_detach(attach);
@@ -647,14 +647,14 @@ ewl_attach_cb_tooltip_mouse_move(Ewl_Widget *w, void *ev, void *data __UNUSED__)
if (delay_str) delay = atof(delay_str);
ewl_attach_tooltip->timer = ecore_timer_add(delay,
- ewl_attach_cb_tooltip_timer, w);
+ ewl_attach_cb_tooltip_timer, w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_attach_cb_tooltip_mouse_down(Ewl_Widget *w __UNUSED__,
- void *ev __UNUSED__, void *data __UNUSED__)
+ void *ev __UNUSED__, void *data __UNUSED__)
{
Ewl_Attach *attach;
@@ -669,7 +669,7 @@ ewl_attach_cb_tooltip_mouse_down(Ewl_Widget *w __UNUSED__,
static void
ewl_attach_cb_tooltip_mouse_out(Ewl_Widget *w __UNUSED__,
- void *ev __UNUSED__, void *data __UNUSED__)
+ void *ev __UNUSED__, void *data __UNUSED__)
{
Ewl_Attach *attach;
@@ -698,89 +698,89 @@ ewl_attach_cb_tooltip_timer(void *data)
w = data;
emb = ewl_embed_widget_find(w);
if (!emb)
- DRETURN_INT(ECORE_CALLBACK_CANCEL, DLEVEL_STABLE);
+ DRETURN_INT(ECORE_CALLBACK_CANCEL, DLEVEL_STABLE);
if (!(ewl_attach_tooltip->win))
{
- int oh, ov;
-
- ewl_attach_tooltip->win = ewl_popup_new();
- ewl_popup_type_set(EWL_POPUP(ewl_attach_tooltip->win),
- EWL_POPUP_TYPE_MOUSE);
- ewl_popup_follow_set(EWL_POPUP(ewl_attach_tooltip->win),
- EWL_WIDGET(emb));
- ewl_attach_tooltip->embed = EWL_WIDGET(emb);
- ewl_callback_prepend(ewl_attach_tooltip->win,
- EWL_CALLBACK_DESTROY,
- ewl_attach_cb_tooltip_win_destroy,
- NULL);
-
- ov = ewl_theme_data_int_get(EWL_WIDGET(w),
- "/tooltip/voffset");
- oh = ewl_theme_data_int_get(EWL_WIDGET(w),
- "/tooltip/hoffset");
-
- ewl_popup_offset_set(EWL_POPUP(ewl_attach_tooltip->win),
- oh, ov);
- ewl_widget_appearance_set(ewl_attach_tooltip->win,
- EWL_ATTACH_TOOLTIP_TYPE);
- ewl_widget_inherit(ewl_attach_tooltip->win,
- EWL_ATTACH_TOOLTIP_TYPE);
+ int oh, ov;
+
+ ewl_attach_tooltip->win = ewl_popup_new();
+ ewl_popup_type_set(EWL_POPUP(ewl_attach_tooltip->win),
+ EWL_POPUP_TYPE_MOUSE);
+ ewl_popup_follow_set(EWL_POPUP(ewl_attach_tooltip->win),
+ EWL_WIDGET(emb));
+ ewl_attach_tooltip->embed = EWL_WIDGET(emb);
+ ewl_callback_prepend(ewl_attach_tooltip->win,
+ EWL_CALLBACK_DESTROY,
+ ewl_attach_cb_tooltip_win_destroy,
+ NULL);
+
+ ov = ewl_theme_data_int_get(EWL_WIDGET(w),
+ "/tooltip/voffset");
+ oh = ewl_theme_data_int_get(EWL_WIDGET(w),
+ "/tooltip/hoffset");
+
+ ewl_popup_offset_set(EWL_POPUP(ewl_attach_tooltip->win),
+ oh, ov);
+ ewl_widget_appearance_set(ewl_attach_tooltip->win,
+ EWL_ATTACH_TOOLTIP_TYPE);
+ ewl_widget_inherit(ewl_attach_tooltip->win,
+ EWL_ATTACH_TOOLTIP_TYPE);
}
else
{
- /* see if we need to add to the embed */
- if ((!ewl_attach_tooltip->embed)
- || (ewl_attach_tooltip->embed
- != EWL_WIDGET(emb)))
- {
- ewl_attach_tooltip->embed = EWL_WIDGET(emb);
- ewl_popup_follow_set(EWL_POPUP(ewl_attach_tooltip->win),
- ewl_attach_tooltip->embed);
- }
+ /* see if we need to add to the embed */
+ if ((!ewl_attach_tooltip->embed)
+ || (ewl_attach_tooltip->embed
+ != EWL_WIDGET(emb)))
+ {
+ ewl_attach_tooltip->embed = EWL_WIDGET(emb);
+ ewl_popup_follow_set(EWL_POPUP(ewl_attach_tooltip->win),
+ ewl_attach_tooltip->embed);
+ }
}
ewl_widget_show(ewl_attach_tooltip->win);
if (!(ewl_attach_tooltip->box))
{
- ewl_attach_tooltip->box = ewl_hbox_new();
- ewl_container_child_append(
- EWL_CONTAINER(ewl_attach_tooltip->win),
- ewl_attach_tooltip->box);
+ ewl_attach_tooltip->box = ewl_hbox_new();
+ ewl_container_child_append(
+ EWL_CONTAINER(ewl_attach_tooltip->win),
+ ewl_attach_tooltip->box);
}
ewl_widget_show(ewl_attach_tooltip->box);
if (ewl_attach_tooltip->attach->data_type ==
- EWL_ATTACH_DATA_TYPE_WIDGET)
+ EWL_ATTACH_DATA_TYPE_WIDGET)
{
- ewl_container_child_append(
- EWL_CONTAINER(ewl_attach_tooltip->box),
- EWL_WIDGET(ewl_attach_tooltip->attach->data));
+ ewl_container_child_append(
+ EWL_CONTAINER(ewl_attach_tooltip->box),
+ EWL_WIDGET(ewl_attach_tooltip->attach->data));
- ewl_widget_show(EWL_WIDGET(ewl_attach_tooltip->attach->data));
+ ewl_widget_show(EWL_WIDGET(ewl_attach_tooltip->attach->data));
}
else
{
- Ewl_Widget *o;
-
- o = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(o),
- ewl_attach_tooltip->attach->data);
- ewl_container_child_append(
- EWL_CONTAINER(ewl_attach_tooltip->box), o);
- ewl_widget_show(o);
+ Ewl_Widget *o;
+
+ o = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(o),
+ ewl_attach_tooltip->attach->data);
+ ewl_container_child_append(
+ EWL_CONTAINER(ewl_attach_tooltip->box), o);
+ ewl_widget_show(o);
}
ewl_popup_mouse_position_set(EWL_POPUP(ewl_attach_tooltip->win),
- ewl_attach_tooltip->x,
- ewl_attach_tooltip->y);
+ ewl_attach_tooltip->x,
+ ewl_attach_tooltip->y);
DRETURN_INT(ECORE_CALLBACK_CANCEL, DLEVEL_STABLE);
}
static void
ewl_attach_cb_tooltip_win_destroy(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_attach.h b/src/lib/ewl_attach.h
index 7403e1d..2690198 100644
--- a/src/lib/ewl_attach.h
+++ b/src/lib/ewl_attach.h
@@ -37,11 +37,11 @@ typedef struct Ewl_Attach Ewl_Attach;
*/
struct Ewl_Attach
{
- Ewl_Attach_Type type; /**< The type of the attachment */
+ Ewl_Attach_Type type; /**< The type of the attachment */
Ewl_Attach_Data_Type data_type; /**< The data type of the attachment */
- void *data; /**< The attachment data */
- void *priv_data; /**< Any private data in the attachment */
+ void *data; /**< The attachment data */
+ void *priv_data; /**< Any private data in the attachment */
};
/**
@@ -54,9 +54,9 @@ typedef struct Ewl_Attach_Dnd Ewl_Attach_Dnd;
*/
struct Ewl_Attach_Dnd
{
- Ewl_Widget *cursor; /**< Cursor displayed for DND */
- void *data; /**< The attachment data */
- int size; /**< Any private data in the attachment */
+ Ewl_Widget *cursor; /**< Cursor displayed for DND */
+ void *data; /**< The attachment data */
+ int size; /**< Any private data in the attachment */
};
/**
@@ -80,7 +80,7 @@ struct Ewl_Attach_Dnd
*/
#define ewl_attach_mouse_cursor_set(w, data) \
ewl_attach_other_set(EWL_WIDGET(w), EWL_ATTACH_TYPE_MOUSE_CURSOR, \
- (int *)data)
+ (int *)data)
/**
* @def ewl_attach_mouse_argb_cursor_set(w, cursor)
@@ -88,7 +88,7 @@ struct Ewl_Attach_Dnd
*/
#define ewl_attach_mouse_argb_cursor_set(w, cursor) \
ewl_attach_other_set(EWL_WIDGET(w), \
- EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR, cursor)
+ EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR, cursor)
/**
* @def ewl_attach_color_set(w, data)
@@ -124,7 +124,7 @@ struct Ewl_Attach_Dnd
*/
#define ewl_attach_widget_association_set(w, data) \
ewl_attach_other_set(EWL_WIDGET(w), \
- EWL_ATTACH_TYPE_WIDGET_ASSOCIATION, data)
+ EWL_ATTACH_TYPE_WIDGET_ASSOCIATION, data)
/**
* @def ewl_attach_widget_association_get(w)
diff --git a/src/lib/ewl_border.c b/src/lib/ewl_border.c
index c8b00b6..78d1dce 100644
--- a/src/lib/ewl_border.c
+++ b/src/lib/ewl_border.c
@@ -19,12 +19,12 @@ ewl_border_new(void)
b = NEW(Ewl_Border, 1);
if (!b) {
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!ewl_border_init(b)) {
- ewl_widget_destroy(EWL_WIDGET(b));
- b = NULL;
+ ewl_widget_destroy(EWL_WIDGET(b));
+ b = NULL;
}
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
@@ -46,7 +46,7 @@ ewl_border_init(Ewl_Border * b)
w = EWL_WIDGET(b);
if (!ewl_box_init(EWL_BOX(w))) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_box_orientation_set(EWL_BOX(w), EWL_ORIENTATION_VERTICAL);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
@@ -120,22 +120,22 @@ ewl_border_label_position_set(Ewl_Border *b, Ewl_Position pos)
DCHECK_TYPE(b, EWL_BORDER_TYPE);
if (b->label_position == pos)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
b->label_position = pos;
switch (b->label_position) {
- case EWL_POSITION_LEFT:
- case EWL_POSITION_RIGHT:
- ewl_box_orientation_set(EWL_BOX(b),
- EWL_ORIENTATION_HORIZONTAL);
- break;
-
- case EWL_POSITION_TOP:
- case EWL_POSITION_BOTTOM:
- default:
- ewl_box_orientation_set(EWL_BOX(b),
- EWL_ORIENTATION_VERTICAL);
- break;
+ case EWL_POSITION_LEFT:
+ case EWL_POSITION_RIGHT:
+ ewl_box_orientation_set(EWL_BOX(b),
+ EWL_ORIENTATION_HORIZONTAL);
+ break;
+
+ case EWL_POSITION_TOP:
+ case EWL_POSITION_BOTTOM:
+ default:
+ ewl_box_orientation_set(EWL_BOX(b),
+ EWL_ORIENTATION_VERTICAL);
+ break;
}
ewl_widget_appearance_set(EWL_WIDGET(b), EWL_BORDER_TYPE);
@@ -146,10 +146,10 @@ ewl_border_label_position_set(Ewl_Border *b, Ewl_Position pos)
ewl_container_child_remove(EWL_CONTAINER(b), b->label);
if ((b->label_position == EWL_POSITION_LEFT)
- || (b->label_position == EWL_POSITION_TOP))
- ewl_container_child_prepend(EWL_CONTAINER(b), b->label);
+ || (b->label_position == EWL_POSITION_TOP))
+ ewl_container_child_prepend(EWL_CONTAINER(b), b->label);
else
- ewl_container_child_append(EWL_CONTAINER(b), b->label);
+ ewl_container_child_append(EWL_CONTAINER(b), b->label);
ewl_container_redirect_set(EWL_CONTAINER(b), EWL_CONTAINER(b->body));
ewl_widget_configure(EWL_WIDGET(b));
diff --git a/src/lib/ewl_border.h b/src/lib/ewl_border.h
index 55c68f8..3b32252 100644
--- a/src/lib/ewl_border.h
+++ b/src/lib/ewl_border.h
@@ -51,23 +51,23 @@ typedef struct Ewl_Border Ewl_Border;
*/
struct Ewl_Border
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
- Ewl_Widget *label; /**< Text label for the border */
- Ewl_Widget *body; /**< Box for holding children */
- Ewl_Position label_position; /**< Flags for placing the label */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Widget *label; /**< Text label for the border */
+ Ewl_Widget *body; /**< Box for holding children */
+ Ewl_Position label_position; /**< Flags for placing the label */
};
Ewl_Widget *ewl_border_new(void);
-int ewl_border_init(Ewl_Border * b);
+int ewl_border_init(Ewl_Border * b);
-void ewl_border_label_set(Ewl_Border *b, const char *t);
+void ewl_border_label_set(Ewl_Border *b, const char *t);
const char *ewl_border_label_get(Ewl_Border *b);
-void ewl_border_label_position_set(Ewl_Border *b, Ewl_Position pos);
+void ewl_border_label_position_set(Ewl_Border *b, Ewl_Position pos);
Ewl_Position ewl_border_label_position_get(Ewl_Border *b);
-void ewl_border_label_alignment_set(Ewl_Border *b,
- unsigned int align);
+void ewl_border_label_alignment_set(Ewl_Border *b,
+ unsigned int align);
unsigned int ewl_border_label_alignment_get(Ewl_Border *b);
/**
diff --git a/src/lib/ewl_box.c b/src/lib/ewl_box.c
index b12cb79..e675b4b 100644
--- a/src/lib/ewl_box.c
+++ b/src/lib/ewl_box.c
@@ -49,14 +49,14 @@ static Ewl_Box_Orientation *ewl_box_info = NULL;
static void ewl_box_setup(void);
static int ewl_box_configure_calc(Ewl_Box * b, Ewl_Object **spread,
- int *fill_size, int *align_size);
+ int *fill_size, int *align_size);
static void ewl_box_configure_fill(Ewl_Object **spread, int fill_count,
- int *fill_size);
+ int *fill_size);
static void ewl_box_configure_layout(Ewl_Box * b, int *x, int *y,
- int *fill, int *align,
- int *align_size);
+ int *fill, int *align,
+ int *align_size);
static void ewl_box_configure_child(Ewl_Box * b, Ewl_Object * c, int *x,
- int *y, int *align, int *align_size);
+ int *y, int *align, int *align_size);
/**
* @return Returns NULL on failure, or a newly allocated box on success.
@@ -71,11 +71,11 @@ Ewl_Widget
b = NEW(Ewl_Box, 1);
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_box_init(b)) {
- ewl_widget_destroy(EWL_WIDGET(b));
- b = NULL;
+ ewl_widget_destroy(EWL_WIDGET(b));
+ b = NULL;
}
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
@@ -94,7 +94,7 @@ Ewl_Widget
b = ewl_box_new();
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(b), EWL_ORIENTATION_HORIZONTAL);
@@ -114,7 +114,7 @@ Ewl_Widget
b = ewl_box_new();
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(b), EWL_ORIENTATION_VERTICAL);
@@ -143,8 +143,8 @@ ewl_box_init(Ewl_Box * b)
* Initialize the container portion of the box
*/
if (!ewl_container_init(EWL_CONTAINER(b))) {
- ewl_widget_destroy(EWL_WIDGET(b));
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ ewl_widget_destroy(EWL_WIDGET(b));
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_widget_inherit(w, EWL_BOX_TYPE);
@@ -157,7 +157,7 @@ ewl_box_init(Ewl_Box * b)
* Setup the container size change handlers.
*/
ewl_container_resize_notify_set(EWL_CONTAINER(b),
- ewl_box_cb_child_resize);
+ ewl_box_cb_child_resize);
ewl_container_show_notify_set(EWL_CONTAINER(b), ewl_box_cb_child_show);
ewl_container_hide_notify_set(EWL_CONTAINER(b), ewl_box_cb_child_hide);
@@ -165,17 +165,17 @@ ewl_box_init(Ewl_Box * b)
* Attach the default layout callback.
*/
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_box_cb_configure, NULL);
+ ewl_box_cb_configure, NULL);
ewl_callback_del(w, EWL_CALLBACK_FOCUS_OUT, ewl_widget_cb_focus_out);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT,
- ewl_container_cb_container_focus_out, NULL);
+ ewl_container_cb_container_focus_out, NULL);
/*
* Check if the info structs have been created yet, if not create
* them.
*/
if (!ewl_box_horizontal)
- ewl_box_setup();
+ ewl_box_setup();
/*
* Set the box's appropriate orientation, set to a garbage value so
@@ -213,7 +213,7 @@ ewl_box_orientation_set(Ewl_Box * b, Ewl_Orientation o)
* widgets now have the new orientation layout
*/
if (b->orientation == o)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
b->orientation = o;
@@ -223,12 +223,12 @@ ewl_box_orientation_set(Ewl_Box * b, Ewl_Orientation o)
* menubar */
appearance = ewl_widget_appearance_get(EWL_WIDGET(b));
if ((b->orientation == EWL_ORIENTATION_HORIZONTAL)
- && (!strcmp(appearance, "vbox")))
- ewl_widget_appearance_set(EWL_WIDGET(b), "hbox");
+ && (!strcmp(appearance, "vbox")))
+ ewl_widget_appearance_set(EWL_WIDGET(b), "hbox");
else if ((b->orientation == EWL_ORIENTATION_VERTICAL)
- && (!strcmp(appearance, "hbox")))
- ewl_widget_appearance_set(EWL_WIDGET(b), "vbox");
+ && (!strcmp(appearance, "hbox")))
+ ewl_widget_appearance_set(EWL_WIDGET(b), "vbox");
IF_FREE(appearance);
@@ -240,8 +240,8 @@ ewl_box_orientation_set(Ewl_Box * b, Ewl_Orientation o)
c = EWL_CONTAINER(b);
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children))) {
- if (!UNMANAGED(child))
- ewl_box_cb_child_show(c, child);
+ if (!UNMANAGED(child))
+ ewl_box_cb_child_show(c, child);
}
ewl_widget_configure(EWL_WIDGET(b));
@@ -284,61 +284,61 @@ ewl_box_homogeneous_set(Ewl_Box *b, unsigned int h)
DCHECK_TYPE(b, EWL_BOX_TYPE);
if (b->homogeneous == !!h)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
b->homogeneous = !!h;
c = EWL_CONTAINER(b);
if (h) {
- ewl_callback_del(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
- ewl_box_cb_configure);
- ewl_callback_append(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
- ewl_box_cb_configure_homogeneous, NULL);
- ewl_container_show_notify_set(c,
- ewl_box_cb_child_homogeneous_show);
- ewl_container_hide_notify_set(c,
- ewl_box_cb_child_homogeneous_show);
- ewl_container_resize_notify_set(c,
- ewl_box_cb_child_homogeneous_resize);
- /*
- * calculate the new preferred size, we use here the show cb
- * since it does exactly what we need to do
- */
- ewl_box_cb_child_homogeneous_show(c, NULL);
+ ewl_callback_del(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
+ ewl_box_cb_configure);
+ ewl_callback_append(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
+ ewl_box_cb_configure_homogeneous, NULL);
+ ewl_container_show_notify_set(c,
+ ewl_box_cb_child_homogeneous_show);
+ ewl_container_hide_notify_set(c,
+ ewl_box_cb_child_homogeneous_show);
+ ewl_container_resize_notify_set(c,
+ ewl_box_cb_child_homogeneous_resize);
+ /*
+ * calculate the new preferred size, we use here the show cb
+ * since it does exactly what we need to do
+ */
+ ewl_box_cb_child_homogeneous_show(c, NULL);
}
else {
- int nodes;
-
- ewl_callback_del(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
- ewl_box_cb_configure_homogeneous);
- ewl_callback_append(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
- ewl_box_cb_configure, NULL);
- ewl_container_show_notify_set(c,
- ewl_box_cb_child_show);
- ewl_container_hide_notify_set(c,
- ewl_box_cb_child_hide);
- ewl_container_resize_notify_set(c,
- ewl_box_cb_child_resize);
- /*
- * calculate the new preferred size
- */
- nodes = ewl_container_child_count_visible_get(c) - 1;
- if (b->orientation == EWL_ORIENTATION_HORIZONTAL) {
- ewl_container_largest_prefer(c,
- EWL_ORIENTATION_VERTICAL);
- ewl_container_sum_prefer(c,
- EWL_ORIENTATION_HORIZONTAL);
- ewl_object_preferred_inner_w_set(EWL_OBJECT(b),
- PREFERRED_W(b) + b->spacing * nodes);
- }
- else {
- ewl_container_largest_prefer(c,
- EWL_ORIENTATION_HORIZONTAL);
- ewl_container_sum_prefer(c,
- EWL_ORIENTATION_VERTICAL);
- ewl_object_preferred_inner_h_set(EWL_OBJECT(b),
- PREFERRED_H(b) + b->spacing * nodes);
- }
+ int nodes;
+
+ ewl_callback_del(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
+ ewl_box_cb_configure_homogeneous);
+ ewl_callback_append(EWL_WIDGET(b), EWL_CALLBACK_CONFIGURE,
+ ewl_box_cb_configure, NULL);
+ ewl_container_show_notify_set(c,
+ ewl_box_cb_child_show);
+ ewl_container_hide_notify_set(c,
+ ewl_box_cb_child_hide);
+ ewl_container_resize_notify_set(c,
+ ewl_box_cb_child_resize);
+ /*
+ * calculate the new preferred size
+ */
+ nodes = ewl_container_child_count_visible_get(c) - 1;
+ if (b->orientation == EWL_ORIENTATION_HORIZONTAL) {
+ ewl_container_largest_prefer(c,
+ EWL_ORIENTATION_VERTICAL);
+ ewl_container_sum_prefer(c,
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(b),
+ PREFERRED_W(b) + b->spacing * nodes);
+ }
+ else {
+ ewl_container_largest_prefer(c,
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_container_sum_prefer(c,
+ EWL_ORIENTATION_VERTICAL);
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(b),
+ PREFERRED_H(b) + b->spacing * nodes);
+ }
}
ewl_widget_configure(EWL_WIDGET(b));
@@ -385,14 +385,14 @@ ewl_box_spacing_set(Ewl_Box * b, int s)
nodes = ewl_container_child_count_visible_get(EWL_CONTAINER(b)) - 1;
if (nodes > 0) {
- if (b->orientation == EWL_ORIENTATION_HORIZONTAL)
- ewl_object_preferred_inner_w_set(EWL_OBJECT(w),
- PREFERRED_W(w) - (nodes * b->spacing) +
- (nodes * s));
- else
- ewl_object_preferred_inner_h_set(EWL_OBJECT(w),
- PREFERRED_H(w) - (nodes * b->spacing) +
- (nodes * s));
+ if (b->orientation == EWL_ORIENTATION_HORIZONTAL)
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(w),
+ PREFERRED_W(w) - (nodes * b->spacing) +
+ (nodes * s));
+ else
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(w),
+ PREFERRED_H(w) - (nodes * b->spacing) +
+ (nodes * s));
}
b->spacing = s;
@@ -422,7 +422,7 @@ ewl_box_spacing_set(Ewl_Box * b, int s)
*/
void
ewl_box_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Box *b;
@@ -446,7 +446,7 @@ ewl_box_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* Catch the easy case, and return.
*/
if (!fill_count)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
spread = alloca(fill_count * sizeof(Ewl_Object *));
@@ -463,17 +463,17 @@ ewl_box_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* orientations.
*/
if (b->orientation == EWL_ORIENTATION_HORIZONTAL) {
- fill = &x;
- fill_size = &width;
- align = &y;
- align_size = &height;
- ewl_box_info = ewl_box_horizontal;
+ fill = &x;
+ fill_size = &width;
+ align = &y;
+ align_size = &height;
+ ewl_box_info = ewl_box_horizontal;
} else {
- fill = &y;
- fill_size = &height;
- align = &x;
- align_size = &width;
- ewl_box_info = ewl_box_vertical;
+ fill = &y;
+ fill_size = &height;
+ align = &x;
+ align_size = &width;
+ ewl_box_info = ewl_box_vertical;
}
/*
@@ -509,7 +509,7 @@ ewl_box_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_box_cb_configure_homogeneous(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
int i, num;
int x, y;
@@ -525,12 +525,12 @@ ewl_box_cb_configure_homogeneous(Ewl_Widget *w, void *ev_data __UNUSED__,
DCHECK_TYPE(w, EWL_BOX_TYPE);
if (ecore_dlist_empty_is(EWL_CONTAINER(w)->children))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
num = ewl_container_child_count_visible_get(EWL_CONTAINER(w));
if (!num)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
b = EWL_BOX(w);
@@ -547,11 +547,11 @@ ewl_box_cb_configure_homogeneous(Ewl_Widget *w, void *ev_data __UNUSED__,
* orientations.
*/
if (b->orientation == EWL_ORIENTATION_HORIZONTAL) {
- fill = &x;
- fill_size = &width;
+ fill = &x;
+ fill_size = &width;
} else {
- fill = &y;
- fill_size = &height;
+ fill = &y;
+ fill_size = &height;
}
*fill_size -= b->spacing * (num - 1);
@@ -561,14 +561,14 @@ ewl_box_cb_configure_homogeneous(Ewl_Widget *w, void *ev_data __UNUSED__,
i = 0;
ecore_dlist_first_goto(EWL_CONTAINER(w)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(w)->children))) {
- if (!VISIBLE(child))
- continue;
-
- i++;
- if (i == num)
- *fill_size += remainder;
- ewl_object_place(child, x, y, width, height);
- *fill += *fill_size + b->spacing;
+ if (!VISIBLE(child))
+ continue;
+
+ i++;
+ if (i == num)
+ *fill_size += remainder;
+ ewl_object_place(child, x, y, width, height);
+ *fill += *fill_size + b->spacing;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -590,7 +590,7 @@ ewl_box_configure_calc(Ewl_Box * b, Ewl_Object **spread, int *fill_size, int *al
DCHECK_PARAM_PTR_RET(spread, 0);
initial = *fill_size /
- ewl_container_child_count_visible_get(EWL_CONTAINER(b));
+ ewl_container_child_count_visible_get(EWL_CONTAINER(b));
/*
* Sort the children into lists dependant on their alignment within the
@@ -599,44 +599,44 @@ ewl_box_configure_calc(Ewl_Box * b, Ewl_Object **spread, int *fill_size, int *al
i = 0;
ecore_dlist_first_goto(EWL_CONTAINER(b)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(b)->children))) {
- int change;
- unsigned int policy;
-
- if (!VISIBLE(child) || UNMANAGED(child))
- continue;
- /*
- * Place the child on a list depending on it's matching
- * alignment. First check for top/left alignment.
- */
- /*
- * Set the initial fill size to the preferred size.
- */
- ewl_box_info->fill_set(child, initial);
-
- change = ewl_box_info->fill_ask(child);
-
- /*
- * Figure out how much extra space is available for
- * filling widgets.
- */
- *fill_size -= change + b->spacing;
-
- /*
- * Attempt to give the widget the full size, this will
- * fail if the fill policy or bounds don't allow it.
- */
- ewl_box_info->align_set(child, *align_size);
-
- /*
- * If it has a fill policy for a direction we're
- * concerned with, add it to the fill list.
- */
- policy = ewl_object_fill_policy_get(child);
- policy &= ewl_box_info->f_policy;
- if (policy || change == initial) {
- spread[i] = child;
- i++;
- }
+ int change;
+ unsigned int policy;
+
+ if (!VISIBLE(child) || UNMANAGED(child))
+ continue;
+ /*
+ * Place the child on a list depending on it's matching
+ * alignment. First check for top/left alignment.
+ */
+ /*
+ * Set the initial fill size to the preferred size.
+ */
+ ewl_box_info->fill_set(child, initial);
+
+ change = ewl_box_info->fill_ask(child);
+
+ /*
+ * Figure out how much extra space is available for
+ * filling widgets.
+ */
+ *fill_size -= change + b->spacing;
+
+ /*
+ * Attempt to give the widget the full size, this will
+ * fail if the fill policy or bounds don't allow it.
+ */
+ ewl_box_info->align_set(child, *align_size);
+
+ /*
+ * If it has a fill policy for a direction we're
+ * concerned with, add it to the fill list.
+ */
+ policy = ewl_object_fill_policy_get(child);
+ policy &= ewl_box_info->f_policy;
+ if (policy || change == initial) {
+ spread[i] = child;
+ i++;
+ }
}
/* the last widget does not have spacing on its right side, so
@@ -673,44 +673,44 @@ ewl_box_configure_fill(Ewl_Object **spread, int fill_count, int *fill_size)
*/
while (space && fill_count) {
- i = 0;
- while ((i < fill_count) && (c = spread[i])) {
-
- /*
- * Save the current size of the child, then
- * attempt to give it a portion of the space
- * available.
- */
- temp = ewl_box_info->fill_ask(c);
- ewl_box_info->fill_set(c, temp + space);
-
- /*
- * Determine if the child accepted any of the space
- */
- temp = ewl_box_info->fill_ask(c) - temp;
-
- /*
- * If the child did not accept any of the size, then
- * it's at it's max/min and is no longer useful.
- */
- if (!temp) {
- if (i + 1 < fill_count) {
- memmove((spread + i), (spread + i + 1),
- (fill_count - i) *
- sizeof(Ewl_Object *));
- }
- fill_count--;
- }
- else {
- *fill_size -= temp;
- i++;
- }
- }
-
- /*
- * Calculate the space to give per child.
- */
- space = (!fill_count ? 0 : *fill_size / fill_count);
+ i = 0;
+ while ((i < fill_count) && (c = spread[i])) {
+
+ /*
+ * Save the current size of the child, then
+ * attempt to give it a portion of the space
+ * available.
+ */
+ temp = ewl_box_info->fill_ask(c);
+ ewl_box_info->fill_set(c, temp + space);
+
+ /*
+ * Determine if the child accepted any of the space
+ */
+ temp = ewl_box_info->fill_ask(c) - temp;
+
+ /*
+ * If the child did not accept any of the size, then
+ * it's at it's max/min and is no longer useful.
+ */
+ if (!temp) {
+ if (i + 1 < fill_count) {
+ memmove((spread + i), (spread + i + 1),
+ (fill_count - i) *
+ sizeof(Ewl_Object *));
+ }
+ fill_count--;
+ }
+ else {
+ *fill_size -= temp;
+ i++;
+ }
+ }
+
+ /*
+ * Calculate the space to give per child.
+ */
+ space = (!fill_count ? 0 : *fill_size / fill_count);
}
/*
@@ -718,50 +718,50 @@ ewl_box_configure_fill(Ewl_Object **spread, int fill_count, int *fill_size)
*/
while (*fill_size && fill_count) {
- /*
- * Determine the sign of the amount to be incremented.
- */
- remainder = *fill_size / abs(*fill_size);
-
- /*
- * Add the remainder sign to each child.
- */
- i = 0;
- while (*fill_size && (i < fill_count) && (c = spread[i])) {
-
- /*
- * Store the current size of the child.
- */
- temp = ewl_box_info->fill_ask(c);
-
- /*
- * Attempt to give it a portion of the remaining space
- */
- ewl_box_info->fill_set(c, temp + remainder);
-
- /*
- * Determine if the child accepted the space
- */
- temp = ewl_box_info->fill_ask(c) - temp;
-
- /*
- * Remove the child if it didn't accept any space,
- * otherwise subtract the accepted space from the
- * total.
- */
- if (!temp || (*fill_size - temp < 0)) {
- if (i + 1 < fill_count) {
- memmove((spread + i), (spread + i + 1),
- (fill_count - i) *
- sizeof(Ewl_Object *));
- }
- fill_count--;
- }
- else {
- *fill_size -= remainder;
- i++;
- }
- }
+ /*
+ * Determine the sign of the amount to be incremented.
+ */
+ remainder = *fill_size / abs(*fill_size);
+
+ /*
+ * Add the remainder sign to each child.
+ */
+ i = 0;
+ while (*fill_size && (i < fill_count) && (c = spread[i])) {
+
+ /*
+ * Store the current size of the child.
+ */
+ temp = ewl_box_info->fill_ask(c);
+
+ /*
+ * Attempt to give it a portion of the remaining space
+ */
+ ewl_box_info->fill_set(c, temp + remainder);
+
+ /*
+ * Determine if the child accepted the space
+ */
+ temp = ewl_box_info->fill_ask(c) - temp;
+
+ /*
+ * Remove the child if it didn't accept any space,
+ * otherwise subtract the accepted space from the
+ * total.
+ */
+ if (!temp || (*fill_size - temp < 0)) {
+ if (i + 1 < fill_count) {
+ memmove((spread + i), (spread + i + 1),
+ (fill_count - i) *
+ sizeof(Ewl_Object *));
+ }
+ fill_count--;
+ }
+ else {
+ *fill_size -= remainder;
+ i++;
+ }
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -769,7 +769,7 @@ ewl_box_configure_fill(Ewl_Object **spread, int fill_count, int *fill_size)
static void
ewl_box_configure_layout(Ewl_Box * b, int *x, int *y, int *fill,
- int *align, int *align_size)
+ int *align, int *align_size)
{
Ewl_Object *child;
@@ -783,19 +783,19 @@ ewl_box_configure_layout(Ewl_Box * b, int *x, int *y, int *fill,
ecore_dlist_first_goto(EWL_CONTAINER(b)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(b)->children))) {
- if (!VISIBLE(child) || UNMANAGED(child))
- continue;
+ if (!VISIBLE(child) || UNMANAGED(child))
+ continue;
- /*
- * Position this child based on the determined values.
- */
- ewl_box_configure_child(b, child, x, y, align,
- align_size);
+ /*
+ * Position this child based on the determined values.
+ */
+ ewl_box_configure_child(b, child, x, y, align,
+ align_size);
- /*
- * Move to the next position for the child.
- */
- *fill += ewl_box_info->fill_ask(child) + b->spacing;
+ /*
+ * Move to the next position for the child.
+ */
+ *fill += ewl_box_info->fill_ask(child) + b->spacing;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -803,7 +803,7 @@ ewl_box_configure_layout(Ewl_Box * b, int *x, int *y, int *fill,
static void
ewl_box_configure_child(Ewl_Box * b __UNUSED__, Ewl_Object * c,
- int *x, int *y, int *align, int *align_size)
+ int *x, int *y, int *align, int *align_size)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
@@ -814,7 +814,7 @@ ewl_box_configure_child(Ewl_Box * b __UNUSED__, Ewl_Object * c,
* direct use of the current coordinates.
*/
if (ewl_object_alignment_get(c) & ewl_box_info->a1_align) {
- ewl_object_position_request(c, *x, *y);
+ ewl_object_position_request(c, *x, *y);
}
/*
@@ -822,18 +822,18 @@ ewl_box_configure_child(Ewl_Box * b __UNUSED__, Ewl_Object * c,
* there is some calculation to be made.
*/
else if (ewl_object_alignment_get(c) & ewl_box_info->a3_align) {
- *align += *align_size - ewl_box_info->align_ask(c);
- ewl_object_position_request(c, *x, *y);
- *align -= *align_size - ewl_box_info->align_ask(c);
+ *align += *align_size - ewl_box_info->align_ask(c);
+ ewl_object_position_request(c, *x, *y);
+ *align -= *align_size - ewl_box_info->align_ask(c);
}
/*
* The final one is for centering the child.
*/
else {
- *align += (*align_size - ewl_box_info->align_ask(c)) / 2;
- ewl_object_position_request(c, *x, *y);
- *align -= (*align_size - ewl_box_info->align_ask(c)) / 2;
+ *align += (*align_size - ewl_box_info->align_ask(c)) / 2;
+ ewl_object_position_request(c, *x, *y);
+ *align -= (*align_size - ewl_box_info->align_ask(c)) / 2;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -860,7 +860,7 @@ ewl_box_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (ewl_container_child_count_visible_get(c) > 1)
- space = EWL_BOX(c)->spacing;
+ space = EWL_BOX(c)->spacing;
/*
* Get the sizes common to both calculations.
@@ -875,16 +875,16 @@ ewl_box_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
* Base the info used on the orientation of the box.
*/
if (EWL_BOX(c)->orientation == EWL_ORIENTATION_HORIZONTAL) {
- cw += space;
- ewl_object_preferred_inner_w_set(EWL_OBJECT(c), width + cw);
- if (ch > height)
- ewl_object_preferred_inner_h_set(EWL_OBJECT(c), ch);
+ cw += space;
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(c), width + cw);
+ if (ch > height)
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(c), ch);
}
else {
- ch += space;
- if (cw > width)
- ewl_object_preferred_inner_w_set(EWL_OBJECT(c), cw);
- ewl_object_preferred_inner_h_set(EWL_OBJECT(c), height + ch);
+ ch += space;
+ if (cw > width)
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(c), cw);
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(c), height + ch);
}
/* printf("Box %p children visible %d after show\n", c, ++EWL_BOX(c)->shows); */
@@ -901,7 +901,7 @@ ewl_box_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
*/
void
ewl_box_cb_child_homogeneous_show(Ewl_Container *c,
- Ewl_Widget *w __UNUSED__)
+ Ewl_Widget *w __UNUSED__)
{
int numc;
int size, space = 0;
@@ -912,17 +912,17 @@ ewl_box_cb_child_homogeneous_show(Ewl_Container *c,
numc = ewl_container_child_count_visible_get(c);
if (numc > 1)
- space = EWL_BOX(c)->spacing;
+ space = EWL_BOX(c)->spacing;
ewl_container_largest_prefer(c, EWL_ORIENTATION_HORIZONTAL);
ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
if (EWL_BOX(c)->orientation == EWL_ORIENTATION_HORIZONTAL) {
- size = (PREFERRED_W(c) + space) * numc - space;
- ewl_object_preferred_inner_w_set(EWL_OBJECT(c), size);
+ size = (PREFERRED_W(c) + space) * numc - space;
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(c), size);
}
else {
- size = (PREFERRED_H(c) + space) * numc - space;
- ewl_object_preferred_inner_h_set(EWL_OBJECT(c), size);
+ size = (PREFERRED_H(c) + space) * numc - space;
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(c), size);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -948,21 +948,21 @@ ewl_box_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (ewl_container_child_count_visible_get(c) > 1)
- space = b->spacing;
+ space = b->spacing;
if (b->orientation == EWL_ORIENTATION_HORIZONTAL) {
- int width;
- width = ewl_object_preferred_inner_w_get(EWL_OBJECT(c));
- width -= ewl_object_preferred_w_get(EWL_OBJECT(w));
- ewl_object_preferred_inner_w_set(EWL_OBJECT(c), width - space);
- ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
+ int width;
+ width = ewl_object_preferred_inner_w_get(EWL_OBJECT(c));
+ width -= ewl_object_preferred_w_get(EWL_OBJECT(w));
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(c), width - space);
+ ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
}
else {
- int height;
- height = ewl_object_preferred_inner_h_get(EWL_OBJECT(c));
- height -= ewl_object_preferred_h_get(EWL_OBJECT(w));
- ewl_object_preferred_inner_h_set(EWL_OBJECT(c), height - space);
- ewl_container_largest_prefer(c, EWL_ORIENTATION_HORIZONTAL);
+ int height;
+ height = ewl_object_preferred_inner_h_get(EWL_OBJECT(c));
+ height -= ewl_object_preferred_h_get(EWL_OBJECT(w));
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(c), height - space);
+ ewl_container_largest_prefer(c, EWL_ORIENTATION_HORIZONTAL);
}
/* printf("Box %p children visible %d after hide\n", c, --EWL_BOX(c)->shows); */
@@ -981,7 +981,7 @@ ewl_box_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
*/
void
ewl_box_cb_child_homogeneous_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
- int size __UNUSED__, Ewl_Orientation o)
+ int size __UNUSED__, Ewl_Orientation o)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
@@ -992,13 +992,13 @@ ewl_box_cb_child_homogeneous_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
* like in the show cb
*/
if (EWL_BOX(c)->orientation == o)
- ewl_box_cb_child_homogeneous_show(c, NULL);
+ ewl_box_cb_child_homogeneous_show(c, NULL);
/*
* Find the new largest widget in the alignment direction
*/
else
- ewl_container_largest_prefer(c, o);
+ ewl_container_largest_prefer(c, o);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1013,7 +1013,7 @@ ewl_box_cb_child_homogeneous_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
*/
void
ewl_box_cb_child_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
- int size, Ewl_Orientation o)
+ int size, Ewl_Orientation o)
{
int align_size, fill_size;
Ewl_Box_Orientation *info;
@@ -1027,14 +1027,14 @@ ewl_box_cb_child_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
* orientation.
*/
if (EWL_BOX(c)->orientation == EWL_ORIENTATION_HORIZONTAL) {
- fill_size = PREFERRED_W(c);
- align_size = PREFERRED_H(c);
- info = ewl_box_horizontal;
+ fill_size = PREFERRED_W(c);
+ align_size = PREFERRED_H(c);
+ info = ewl_box_horizontal;
}
else {
- fill_size = PREFERRED_H(c);
- align_size = PREFERRED_W(c);
- info = ewl_box_vertical;
+ fill_size = PREFERRED_H(c);
+ align_size = PREFERRED_W(c);
+ info = ewl_box_vertical;
}
/*
@@ -1042,13 +1042,13 @@ ewl_box_cb_child_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
* current orientation size.
*/
if (EWL_BOX(c)->orientation == o)
- info->pref_fill_set(EWL_OBJECT(c), fill_size + size);
+ info->pref_fill_set(EWL_OBJECT(c), fill_size + size);
/*
* Find the new largest widget in the alignment direction
*/
else
- ewl_container_largest_prefer(c, o);
+ ewl_container_largest_prefer(c, o);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1065,85 +1065,85 @@ ewl_box_setup(void)
ewl_shutdown_add(ewl_box_cb_shutdown);
if (!ewl_box_vertical) {
- ewl_box_vertical = NEW(Ewl_Box_Orientation, 1);
- if (!ewl_box_vertical)
- DRETURN(DLEVEL_STABLE);
-
- /*
- * This sets the aligments for filling direction.
- */
- ewl_box_vertical->f1_align = EWL_FLAG_ALIGN_TOP;
- ewl_box_vertical->f3_align = EWL_FLAG_ALIGN_BOTTOM;
-
- /*
- * These are the valid fill policies for this widget.
- */
- ewl_box_vertical->f_policy =
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_VFILL;
-
- /*
- * This sets the aligments for the non-filling direction.
- */
- ewl_box_vertical->a1_align = EWL_FLAG_ALIGN_LEFT;
- ewl_box_vertical->a3_align = EWL_FLAG_ALIGN_RIGHT;
-
- /*
- * These functions allow for asking the dimensions of the
- * children.
- */
- ewl_box_vertical->fill_ask = ewl_object_current_h_get;
-
- ewl_box_vertical->align_ask = ewl_object_current_w_get;
-
- /*
- * These functions allow for setting the dimensions of the
- * children.
- */
- ewl_box_vertical->fill_set = ewl_object_h_request;
- ewl_box_vertical->pref_fill_set = ewl_object_preferred_inner_h_set;
-
- ewl_box_vertical->align_set = ewl_object_w_request;
+ ewl_box_vertical = NEW(Ewl_Box_Orientation, 1);
+ if (!ewl_box_vertical)
+ DRETURN(DLEVEL_STABLE);
+
+ /*
+ * This sets the aligments for filling direction.
+ */
+ ewl_box_vertical->f1_align = EWL_FLAG_ALIGN_TOP;
+ ewl_box_vertical->f3_align = EWL_FLAG_ALIGN_BOTTOM;
+
+ /*
+ * These are the valid fill policies for this widget.
+ */
+ ewl_box_vertical->f_policy =
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_VFILL;
+
+ /*
+ * This sets the aligments for the non-filling direction.
+ */
+ ewl_box_vertical->a1_align = EWL_FLAG_ALIGN_LEFT;
+ ewl_box_vertical->a3_align = EWL_FLAG_ALIGN_RIGHT;
+
+ /*
+ * These functions allow for asking the dimensions of the
+ * children.
+ */
+ ewl_box_vertical->fill_ask = ewl_object_current_h_get;
+
+ ewl_box_vertical->align_ask = ewl_object_current_w_get;
+
+ /*
+ * These functions allow for setting the dimensions of the
+ * children.
+ */
+ ewl_box_vertical->fill_set = ewl_object_h_request;
+ ewl_box_vertical->pref_fill_set = ewl_object_preferred_inner_h_set;
+
+ ewl_box_vertical->align_set = ewl_object_w_request;
}
if (!ewl_box_horizontal) {
- ewl_box_horizontal = NEW(Ewl_Box_Orientation, 1);
- if (!ewl_box_horizontal)
- DRETURN(DLEVEL_STABLE);
-
- /*
- * This sets the aligments for the filling direction.
- */
- ewl_box_horizontal->f1_align = EWL_FLAG_ALIGN_LEFT;
- ewl_box_horizontal->f3_align = EWL_FLAG_ALIGN_RIGHT;
-
- /*
- * These are the valid fill policies for this widget.
- */
- ewl_box_horizontal->f_policy =
- EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_HFILL;
-
- /*
- * This sets the aligments for the non-filling direction.
- */
- ewl_box_horizontal->a1_align = EWL_FLAG_ALIGN_TOP;
- ewl_box_horizontal->a3_align = EWL_FLAG_ALIGN_BOTTOM;
-
- /*
- * These functions allow for asking the dimensions of the
- * children.
- */
- ewl_box_horizontal->fill_ask = ewl_object_current_w_get;
-
- ewl_box_horizontal->align_ask = ewl_object_current_h_get;
-
- /*
- * These functions allow for setting the dimensions of the
- * children.
- */
- ewl_box_horizontal->fill_set = ewl_object_w_request;
- ewl_box_horizontal->pref_fill_set = ewl_object_preferred_inner_w_set;
-
- ewl_box_horizontal->align_set = ewl_object_h_request;
+ ewl_box_horizontal = NEW(Ewl_Box_Orientation, 1);
+ if (!ewl_box_horizontal)
+ DRETURN(DLEVEL_STABLE);
+
+ /*
+ * This sets the aligments for the filling direction.
+ */
+ ewl_box_horizontal->f1_align = EWL_FLAG_ALIGN_LEFT;
+ ewl_box_horizontal->f3_align = EWL_FLAG_ALIGN_RIGHT;
+
+ /*
+ * These are the valid fill policies for this widget.
+ */
+ ewl_box_horizontal->f_policy =
+ EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_HFILL;
+
+ /*
+ * This sets the aligments for the non-filling direction.
+ */
+ ewl_box_horizontal->a1_align = EWL_FLAG_ALIGN_TOP;
+ ewl_box_horizontal->a3_align = EWL_FLAG_ALIGN_BOTTOM;
+
+ /*
+ * These functions allow for asking the dimensions of the
+ * children.
+ */
+ ewl_box_horizontal->fill_ask = ewl_object_current_w_get;
+
+ ewl_box_horizontal->align_ask = ewl_object_current_h_get;
+
+ /*
+ * These functions allow for setting the dimensions of the
+ * children.
+ */
+ ewl_box_horizontal->fill_set = ewl_object_w_request;
+ ewl_box_horizontal->pref_fill_set = ewl_object_preferred_inner_w_set;
+
+ ewl_box_horizontal->align_set = ewl_object_h_request;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_box.h b/src/lib/ewl_box.h
index d6e7394..eb46aef 100644
--- a/src/lib/ewl_box.h
+++ b/src/lib/ewl_box.h
@@ -54,38 +54,38 @@ typedef struct Ewl_Box Ewl_Box;
*/
struct Ewl_Box
{
- Ewl_Container container; /**< Inherit from Ewl_Container */
+ Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Orientation orientation; /**< Indicate the orientation of layout */
- int spacing; /**< Space between each widget in the box */
+ Ewl_Orientation orientation; /**< Indicate the orientation of layout */
+ int spacing; /**< Space between each widget in the box */
- unsigned int homogeneous; /**< Flag indicating space assignemnt */
+ unsigned int homogeneous; /**< Flag indicating space assignemnt */
};
Ewl_Widget *ewl_box_new(void);
Ewl_Widget *ewl_hbox_new(void);
Ewl_Widget *ewl_vbox_new(void);
-int ewl_box_init(Ewl_Box *box);
-void ewl_box_orientation_set(Ewl_Box *b, Ewl_Orientation o);
+int ewl_box_init(Ewl_Box *box);
+void ewl_box_orientation_set(Ewl_Box *b, Ewl_Orientation o);
Ewl_Orientation ewl_box_orientation_get(Ewl_Box *b);
-void ewl_box_spacing_set(Ewl_Box *b, int spacing);
-void ewl_box_homogeneous_set(Ewl_Box *b, unsigned int h);
+void ewl_box_spacing_set(Ewl_Box *b, int spacing);
+void ewl_box_homogeneous_set(Ewl_Box *b, unsigned int h);
unsigned int ewl_box_homogeneous_get(Ewl_Box *b);
/*
* Internally used callbacks, override at your own risk.
*/
void ewl_box_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
void ewl_box_cb_child_homogeneous_resize(Ewl_Container *c,
- Ewl_Widget *w, int size, Ewl_Orientation o);
+ Ewl_Widget *w, int size, Ewl_Orientation o);
void ewl_box_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_box_cb_child_hide(Ewl_Container *c, Ewl_Widget *w);
void ewl_box_cb_child_homogeneous_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_box_cb_configure(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_box_cb_configure_homogeneous(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @}
diff --git a/src/lib/ewl_button.c b/src/lib/ewl_button.c
index f34046f..feddd91 100644
--- a/src/lib/ewl_button.c
+++ b/src/lib/ewl_button.c
@@ -14,9 +14,9 @@ static const Ewl_Stock_Funcs const stock_funcs = {
};
static Ewl_Widget *ewl_button_view_cb_widget_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
static Ewl_Widget *ewl_button_view_cb_header_fetch(void *data,
- unsigned int col);
+ unsigned int col);
/**
* @return Returns NULL on failure, a pointer to a new button on success
@@ -31,11 +31,11 @@ ewl_button_new(void)
b = NEW(Ewl_Button, 1);
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_button_init(b)) {
- ewl_widget_destroy(EWL_WIDGET(b));
- b = NULL;
+ ewl_widget_destroy(EWL_WIDGET(b));
+ b = NULL;
}
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
@@ -59,7 +59,7 @@ ewl_button_init(Ewl_Button *b)
w = EWL_WIDGET(b);
if (!ewl_stock_init(EWL_STOCK(b)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_BUTTON_TYPE);
ewl_stock_functions_set(EWL_STOCK(b), &stock_funcs);
@@ -83,11 +83,11 @@ ewl_button_init(Ewl_Button *b)
ewl_widget_focusable_set(w, TRUE);
ewl_callback_append(w, EWL_CALLBACK_KEY_DOWN,
- ewl_button_cb_key_down, NULL);
+ ewl_button_cb_key_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
- ewl_container_cb_widget_focus_in, NULL);
+ ewl_container_cb_widget_focus_in, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT,
- ewl_container_cb_widget_focus_out, NULL);
+ ewl_container_cb_widget_focus_out, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -112,7 +112,7 @@ ewl_button_view_get(void)
static Ewl_Widget *
ewl_button_view_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Widget *button;
@@ -151,32 +151,32 @@ ewl_button_label_set(Ewl_Button *b, const char *l)
DCHECK_TYPE(b, EWL_BUTTON_TYPE);
if ((!l) && (b->label_object)) {
- ewl_widget_destroy(b->label_object);
- b->label_object = NULL;
+ ewl_widget_destroy(b->label_object);
+ b->label_object = NULL;
}
else if (!b->label_object) {
- Ewl_Container *redir;
-
- /*
- * Save the current redirection and focus on the point where
- * our internal widgets belong.
- */
- redir = ewl_container_redirect_get(EWL_CONTAINER(b));
- ewl_container_redirect_set(EWL_CONTAINER(b),
- EWL_CONTAINER(b->body));
-
- b->label_object = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(b->label_object), l);
- ewl_object_fill_policy_set(EWL_OBJECT(b->label_object),
- EWL_FLAG_FILL_VFILL);
- ewl_container_child_append(EWL_CONTAINER(b), b->label_object);
- ewl_widget_internal_set(b->label_object, TRUE);
- ewl_widget_show(b->label_object);
-
- ewl_container_redirect_set(EWL_CONTAINER(b), redir);
+ Ewl_Container *redir;
+
+ /*
+ * Save the current redirection and focus on the point where
+ * our internal widgets belong.
+ */
+ redir = ewl_container_redirect_get(EWL_CONTAINER(b));
+ ewl_container_redirect_set(EWL_CONTAINER(b),
+ EWL_CONTAINER(b->body));
+
+ b->label_object = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(b->label_object), l);
+ ewl_object_fill_policy_set(EWL_OBJECT(b->label_object),
+ EWL_FLAG_FILL_VFILL);
+ ewl_container_child_append(EWL_CONTAINER(b), b->label_object);
+ ewl_widget_internal_set(b->label_object, TRUE);
+ ewl_widget_show(b->label_object);
+
+ ewl_container_redirect_set(EWL_CONTAINER(b), redir);
}
else
- ewl_label_text_set(EWL_LABEL(b->label_object), l);
+ ewl_label_text_set(EWL_LABEL(b->label_object), l);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -194,8 +194,8 @@ ewl_button_label_get(Ewl_Button *b)
DCHECK_TYPE_RET(b, EWL_BUTTON_TYPE, NULL);
if (b->label_object)
- DRETURN_PTR(ewl_label_text_get(EWL_LABEL(b->label_object)),
- DLEVEL_STABLE);
+ DRETURN_PTR(ewl_label_text_get(EWL_LABEL(b->label_object)),
+ DLEVEL_STABLE);
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -216,34 +216,34 @@ ewl_button_image_set(Ewl_Button *b, const char *file, const char *key)
if (!file)
{
- if (b->image_object)
- ewl_widget_destroy(b->image_object);
- b->image_object = NULL;
+ if (b->image_object)
+ ewl_widget_destroy(b->image_object);
+ b->image_object = NULL;
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
if (!b->image_object)
{
- Ewl_Container *redir;
-
- /*
- * Save the current redirection and focus on the point where
- * our internal widgets belong.
- */
- redir = ewl_container_redirect_get(EWL_CONTAINER(b));
- ewl_container_redirect_set(EWL_CONTAINER(b),
- EWL_CONTAINER(b->body));
- b->image_object = ewl_image_new();
- ewl_container_child_prepend(EWL_CONTAINER(b), b->image_object);
- ewl_widget_internal_set(b->image_object, TRUE);
- ewl_object_fill_policy_set(EWL_OBJECT(b->image_object),
- EWL_FLAG_FILL_NONE);
- ewl_object_alignment_set(EWL_OBJECT(b->image_object),
- EWL_FLAG_ALIGN_CENTER);
- ewl_widget_show(b->image_object);
-
- ewl_container_redirect_set(EWL_CONTAINER(b), redir);
+ Ewl_Container *redir;
+
+ /*
+ * Save the current redirection and focus on the point where
+ * our internal widgets belong.
+ */
+ redir = ewl_container_redirect_get(EWL_CONTAINER(b));
+ ewl_container_redirect_set(EWL_CONTAINER(b),
+ EWL_CONTAINER(b->body));
+ b->image_object = ewl_image_new();
+ ewl_container_child_prepend(EWL_CONTAINER(b), b->image_object);
+ ewl_widget_internal_set(b->image_object, TRUE);
+ ewl_object_fill_policy_set(EWL_OBJECT(b->image_object),
+ EWL_FLAG_FILL_NONE);
+ ewl_object_alignment_set(EWL_OBJECT(b->image_object),
+ EWL_FLAG_ALIGN_CENTER);
+ ewl_widget_show(b->image_object);
+
+ ewl_container_redirect_set(EWL_CONTAINER(b), redir);
}
ewl_image_file_set(EWL_IMAGE(b->image_object), file, key);
@@ -266,9 +266,9 @@ ewl_button_image_get(Ewl_Button *b)
DCHECK_TYPE_RET(b, EWL_BUTTON_TYPE, NULL);
if (!b->image_object)
- file = NULL;
+ file = NULL;
else
- file = ewl_image_file_path_get(EWL_IMAGE(b->image_object));
+ file = ewl_image_file_path_get(EWL_IMAGE(b->image_object));
DRETURN_PTR(file, DLEVEL_STABLE);
}
@@ -288,7 +288,7 @@ ewl_button_image_size_set(Ewl_Button *b, int width, int height)
DCHECK_TYPE(b, EWL_BUTTON_TYPE);
if (!b->image_object)
- ewl_button_image_set(b, "", NULL);
+ ewl_button_image_set(b, "", NULL);
ewl_image_size_set(EWL_IMAGE(b->image_object), width, height);
@@ -312,7 +312,7 @@ ewl_button_image_size_get(Ewl_Button *b, int *width, int *height)
DCHECK_TYPE(b, EWL_BUTTON_TYPE);
if (b->image_object)
- ewl_image_size_get(EWL_IMAGE(b->image_object), &w, &h);
+ ewl_image_size_get(EWL_IMAGE(b->image_object), &w, &h);
if (width) *width = w;
if (height) *height = h;
@@ -351,7 +351,7 @@ ewl_button_alignment_get(Ewl_Button *b)
DCHECK_TYPE_RET(b, EWL_BUTTON_TYPE, 0);
DRETURN_INT(ewl_object_alignment_get(EWL_OBJECT(b->body)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -385,7 +385,7 @@ ewl_button_fill_policy_get(Ewl_Button *b)
DCHECK_TYPE_RET(b, EWL_BUTTON_TYPE, 0);
DRETURN_INT(ewl_object_fill_policy_get(EWL_OBJECT(b->body)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -407,20 +407,20 @@ ewl_button_cb_key_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
event = ev;
if ((!strcmp(event->keyname, "Return"))
- || (!strcmp(event->keyname, "KP_Return"))
- || (!strcmp(event->keyname, "Enter"))
- || (!strcmp(event->keyname, "KP_Enter"))
- || (!strcmp(event->keyname, "\n"))
- || (!strcmp(event->keyname, " ")))
+ || (!strcmp(event->keyname, "KP_Return"))
+ || (!strcmp(event->keyname, "Enter"))
+ || (!strcmp(event->keyname, "KP_Enter"))
+ || (!strcmp(event->keyname, "\n"))
+ || (!strcmp(event->keyname, " ")))
{
- Ewl_Event_Mouse_Up e;
+ Ewl_Event_Mouse_Up e;
- e.base.modifiers = 0;
- e.base.x = 0;
- e.base.y = 0;
- e.button = 1;
+ e.base.modifiers = 0;
+ e.base.x = 0;
+ e.base.y = 0;
+ e.button = 1;
- ewl_callback_call_with_event_data(w, EWL_CALLBACK_CLICKED, &e);
+ ewl_callback_call_with_event_data(w, EWL_CALLBACK_CLICKED, &e);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_button.h b/src/lib/ewl_button.h
index 085a511..3df6bd8 100644
--- a/src/lib/ewl_button.h
+++ b/src/lib/ewl_button.h
@@ -55,30 +55,30 @@ typedef struct Ewl_Button Ewl_Button;
*/
struct Ewl_Button
{
- Ewl_Stock stock; /**< Inherit from the box for adding widgets */
- Ewl_Widget *body; /**< The body of the button */
- Ewl_Widget *label_object; /**< Labels are common, make it easy */
- Ewl_Widget *image_object; /**< Add an image to the button if needed */
+ Ewl_Stock stock; /**< Inherit from the box for adding widgets */
+ Ewl_Widget *body; /**< The body of the button */
+ Ewl_Widget *label_object; /**< Labels are common, make it easy */
+ Ewl_Widget *image_object; /**< Add an image to the button if needed */
};
Ewl_Widget *ewl_button_new(void);
-int ewl_button_init(Ewl_Button *b);
+int ewl_button_init(Ewl_Button *b);
Ewl_View *ewl_button_view_get(void);
-void ewl_button_label_set(Ewl_Button *b, const char *l);
+void ewl_button_label_set(Ewl_Button *b, const char *l);
const char *ewl_button_label_get(Ewl_Button *b);
-void ewl_button_image_set(Ewl_Button *b, const char *file, const char *key);
+void ewl_button_image_set(Ewl_Button *b, const char *file, const char *key);
const char *ewl_button_image_get(Ewl_Button *b);
-void ewl_button_image_size_set(Ewl_Button *b, int width, int height);
-void ewl_button_image_size_get(Ewl_Button *b, int *width, int *height);
+void ewl_button_image_size_set(Ewl_Button *b, int width, int height);
+void ewl_button_image_size_get(Ewl_Button *b, int *width, int *height);
unsigned int ewl_button_alignment_get(Ewl_Button *b);
-void ewl_button_alignment_set(Ewl_Button *b, unsigned int align);
+void ewl_button_alignment_set(Ewl_Button *b, unsigned int align);
unsigned int ewl_button_fill_policy_get(Ewl_Button *b);
-void ewl_button_fill_policy_set(Ewl_Button *b, unsigned int fill);
+void ewl_button_fill_policy_set(Ewl_Button *b, unsigned int fill);
/*
* Internal
diff --git a/src/lib/ewl_calendar.c b/src/lib/ewl_calendar.c
index bb4a453..42f8852 100644
--- a/src/lib/ewl_calendar.c
+++ b/src/lib/ewl_calendar.c
@@ -13,21 +13,21 @@
static void ewl_calendar_grid_setup(Ewl_Calendar *cal);
static int ewl_calendar_leap_year_detect(unsigned int year);
static void ewl_calendar_highlight_today(struct tm *now, Ewl_Label *day,
- Ewl_Calendar *cal);
+ Ewl_Calendar *cal);
static void ewl_calendar_day_select_cb(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
static void ewl_calendar_day_pick_cb(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
static void ewl_calendar_prev_month_cb(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
static void ewl_calendar_next_month_cb(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
static void ewl_calendar_add_day_labels(Ewl_Calendar *ib);
static const char * const months[] = {"January", "February", "March", "April",
- "May", "June", "July", "August", "September",
- "October", "November", "December"};
+ "May", "June", "July", "August", "September",
+ "October", "November", "December"};
static const int mdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
@@ -45,11 +45,11 @@ ewl_calendar_new(void)
ib = NEW(Ewl_Calendar, 1);
if (!ib)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_calendar_init(ib)) {
- ewl_widget_destroy(EWL_WIDGET(ib));
- ib = NULL;
+ ewl_widget_destroy(EWL_WIDGET(ib));
+ ib = NULL;
}
DRETURN_PTR(EWL_WIDGET(ib), DLEVEL_STABLE);
@@ -73,7 +73,7 @@ ewl_calendar_init(Ewl_Calendar* ib)
w = EWL_WIDGET(ib);
if (!ewl_box_init(EWL_BOX(ib)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(ib), EWL_ORIENTATION_HORIZONTAL);
ewl_widget_appearance_set(w, EWL_CALENDAR_TYPE);
@@ -95,20 +95,20 @@ ewl_calendar_init(Ewl_Calendar* ib)
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
icon = ewl_icon_theme_icon_path_get(EWL_ICON_GO_PREVIOUS,
- EWL_ICON_SIZE_SMALL);
+ EWL_ICON_SIZE_SMALL);
if (icon)
- ewl_icon_image_set(EWL_ICON(o), icon, EWL_ICON_GO_PREVIOUS);
+ ewl_icon_image_set(EWL_ICON(o), icon, EWL_ICON_GO_PREVIOUS);
ewl_icon_alt_text_set(EWL_ICON(o), "<<");
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_calendar_prev_month_cb, ib);
+ ewl_calendar_prev_month_cb, ib);
ewl_widget_show(o);
ib->month_label = ewl_label_new();
ewl_object_fill_policy_set(EWL_OBJECT(ib->month_label),
- EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL |
+ EWL_FLAG_FILL_VSHRINK);
ewl_object_alignment_set(EWL_OBJECT(ib->month_label),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_container_child_append(EWL_CONTAINER(top_hbox), ib->month_label);
ewl_widget_show(ib->month_label);
@@ -117,12 +117,12 @@ ewl_calendar_init(Ewl_Calendar* ib)
ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_RIGHT);
ewl_container_child_append(EWL_CONTAINER(top_hbox), o);
icon = ewl_icon_theme_icon_path_get(EWL_ICON_GO_NEXT,
- EWL_ICON_SIZE_SMALL);
+ EWL_ICON_SIZE_SMALL);
if (icon)
- ewl_icon_image_set(EWL_ICON(o), icon, EWL_ICON_GO_NEXT);
+ ewl_icon_image_set(EWL_ICON(o), icon, EWL_ICON_GO_NEXT);
ewl_icon_alt_text_set(EWL_ICON(o), ">>");
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_calendar_next_month_cb, ib);
+ ewl_calendar_next_month_cb, ib);
ewl_widget_show(o);
ib->grid = ewl_grid_new();
@@ -238,7 +238,7 @@ ewl_calendar_grid_setup(Ewl_Calendar *cal)
/* Make the initial display */
snprintf(display_top, sizeof(display_top), "%s %d",
- months[cal->cur_month], cal->cur_year);
+ months[cal->cur_month], cal->cur_year);
ewl_label_text_set(EWL_LABEL(cal->month_label), display_top);
today = cal->cur_day;
@@ -254,8 +254,8 @@ ewl_calendar_grid_setup(Ewl_Calendar *cal)
cur_row = 2;
cur_col = date->tm_wday + 1;
if (cur_col > 7) {
- cur_row = 2;
- cur_col = 1;
+ cur_row = 2;
+ cur_col = 1;
}
cur_day = 0;
@@ -265,42 +265,42 @@ ewl_calendar_grid_setup(Ewl_Calendar *cal)
days = mdays[cal->cur_month];
/* If february, do leap years... */
if (cal->cur_month == 1) {
- if (ewl_calendar_leap_year_detect(cal->cur_year))
- days = 29;
- else
- days = 28;
+ if (ewl_calendar_leap_year_detect(cal->cur_year))
+ days = 29;
+ else
+ days = 28;
}
while (cur_day < days) {
- char day[3];
-
- if (cur_col > 7) {
- cur_row++;
- cur_col = 1;
- }
-
- snprintf(day, sizeof(day), "%d", cur_day + 1);
- day_label = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(day_label), day);
- ewl_object_alignment_set(EWL_OBJECT(day_label),
- EWL_FLAG_ALIGN_RIGHT);
- ewl_callback_append(EWL_WIDGET(day_label),
- EWL_CALLBACK_MOUSE_DOWN,
- ewl_calendar_day_select_cb, cal);
- ewl_callback_append(EWL_WIDGET(day_label),
- EWL_CALLBACK_CLICKED,
- ewl_calendar_day_pick_cb, cal);
-
- ewl_container_child_append(EWL_CONTAINER(cal->grid), day_label);
- ewl_grid_child_position_set(EWL_GRID(cal->grid),
- day_label, cur_col - 1,
- cur_col - 1, cur_row - 1,
- cur_row - 1);
- ewl_calendar_highlight_today(date, EWL_LABEL(day_label), cal);
- ewl_widget_show(day_label);
-
- cur_col++;
- cur_day++;
+ char day[3];
+
+ if (cur_col > 7) {
+ cur_row++;
+ cur_col = 1;
+ }
+
+ snprintf(day, sizeof(day), "%d", cur_day + 1);
+ day_label = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(day_label), day);
+ ewl_object_alignment_set(EWL_OBJECT(day_label),
+ EWL_FLAG_ALIGN_RIGHT);
+ ewl_callback_append(EWL_WIDGET(day_label),
+ EWL_CALLBACK_MOUSE_DOWN,
+ ewl_calendar_day_select_cb, cal);
+ ewl_callback_append(EWL_WIDGET(day_label),
+ EWL_CALLBACK_CLICKED,
+ ewl_calendar_day_pick_cb, cal);
+
+ ewl_container_child_append(EWL_CONTAINER(cal->grid), day_label);
+ ewl_grid_child_position_set(EWL_GRID(cal->grid),
+ day_label, cur_col - 1,
+ cur_col - 1, cur_row - 1,
+ cur_row - 1);
+ ewl_calendar_highlight_today(date, EWL_LABEL(day_label), cal);
+ ewl_widget_show(day_label);
+
+ cur_col++;
+ cur_day++;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -322,7 +322,7 @@ ewl_calendar_leap_year_detect(unsigned int year)
static void
ewl_calendar_highlight_today(struct tm *now, Ewl_Label *day,
- Ewl_Calendar *cal)
+ Ewl_Calendar *cal)
{
int i;
@@ -336,8 +336,8 @@ ewl_calendar_highlight_today(struct tm *now, Ewl_Label *day,
/* Get the day */
i = atoi(ewl_label_text_get(EWL_LABEL(day)));
if ((i == now->tm_mday) && ((now->tm_year + 1900) == cal->cur_year)
- && (now->tm_mon == cal->cur_month)) {
- ewl_widget_color_set(EWL_WIDGET(day), 0, 0, 255, 255);
+ && (now->tm_mon == cal->cur_month)) {
+ ewl_widget_color_set(EWL_WIDGET(day), 0, 0, 255, 255);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -345,7 +345,7 @@ ewl_calendar_highlight_today(struct tm *now, Ewl_Label *day,
static void
ewl_calendar_day_select_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
struct tm *now;
time_t now_tm;
@@ -364,9 +364,9 @@ ewl_calendar_day_select_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
ewl_container_child_iterate_begin(EWL_CONTAINER(EWL_CALENDAR(user_data)->grid));
while ((it = ewl_container_child_next(
- EWL_CONTAINER(EWL_CALENDAR(user_data)->grid))) != NULL) {
- ewl_widget_color_set(EWL_WIDGET(it), 255, 255, 255, 255);
- ewl_calendar_highlight_today(now, EWL_LABEL(it), EWL_CALENDAR(user_data));
+ EWL_CONTAINER(EWL_CALENDAR(user_data)->grid))) != NULL) {
+ ewl_widget_color_set(EWL_WIDGET(it), 255, 255, 255, 255);
+ ewl_calendar_highlight_today(now, EWL_LABEL(it), EWL_CALENDAR(user_data));
}
ewl_widget_color_set(w, 255, 0, 0, 255);
@@ -377,7 +377,7 @@ ewl_calendar_day_select_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
static void
ewl_calendar_day_pick_cb(Ewl_Widget *w __UNUSED__, void *ev_data,
- void *user_data)
+ void *user_data)
{
Ewl_Event_Mouse_Down *ev;
@@ -387,15 +387,15 @@ ewl_calendar_day_pick_cb(Ewl_Widget *w __UNUSED__, void *ev_data,
ev = ev_data;
if (ev->clicks == 2)
- ewl_callback_call(EWL_WIDGET(user_data),
- EWL_CALLBACK_VALUE_CHANGED);
+ ewl_callback_call(EWL_WIDGET(user_data),
+ EWL_CALLBACK_VALUE_CHANGED);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_calendar_prev_month_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Calendar *ib;
@@ -406,8 +406,8 @@ ewl_calendar_prev_month_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
ib = EWL_CALENDAR(user_data);
ib->cur_month -= 1;
if (ib->cur_month < 0) {
- ib->cur_month = 11;
- ib->cur_year--;
+ ib->cur_month = 11;
+ ib->cur_year--;
}
ewl_calendar_grid_setup(ib);
@@ -416,7 +416,7 @@ ewl_calendar_prev_month_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
static void
ewl_calendar_next_month_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Calendar *ib;
@@ -427,8 +427,8 @@ ewl_calendar_next_month_cb(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
ib = EWL_CALENDAR(user_data);
ib->cur_month += 1;
if (ib->cur_month > 11) {
- ib->cur_month = 0;
- ib->cur_year++;
+ ib->cur_month = 0;
+ ib->cur_year++;
}
ewl_calendar_grid_setup(ib);
@@ -448,13 +448,13 @@ ewl_calendar_add_day_labels(Ewl_Calendar *ib)
for (i = 0; days[i] != NULL; i++)
{
- day_label = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(day_label), days[i]);
- ewl_container_child_append(EWL_CONTAINER(ib->grid),
- day_label);
- ewl_object_alignment_set(EWL_OBJECT(day_label),
- EWL_FLAG_ALIGN_CENTER);
- ewl_widget_show(day_label);
+ day_label = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(day_label), days[i]);
+ ewl_container_child_append(EWL_CONTAINER(ib->grid),
+ day_label);
+ ewl_object_alignment_set(EWL_OBJECT(day_label),
+ EWL_FLAG_ALIGN_CENTER);
+ ewl_widget_show(day_label);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_calendar.h b/src/lib/ewl_calendar.h
index 5ff11d6..352f4d7 100644
--- a/src/lib/ewl_calendar.h
+++ b/src/lib/ewl_calendar.h
@@ -51,21 +51,21 @@ typedef struct Ewl_Calendar Ewl_Calendar;
*/
struct Ewl_Calendar
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
- int cur_day; /**< The current day selected */
- int cur_month; /**< The current month selected */
- int cur_year; /**< The current year selected */
- Ewl_Widget *grid; /**< The layout grid */
- Ewl_Widget *month_label; /**< The month label */
+ int cur_day; /**< The current day selected */
+ int cur_month; /**< The current month selected */
+ int cur_year; /**< The current year selected */
+ Ewl_Widget *grid; /**< The layout grid */
+ Ewl_Widget *month_label; /**< The month label */
};
Ewl_Widget *ewl_calendar_new(void);
-int ewl_calendar_init(Ewl_Calendar *calendar);
-char *ewl_calendar_ascii_time_get(Ewl_Calendar *cal);
-int ewl_calendar_day_get(Ewl_Calendar *c);
-int ewl_calendar_month_get(Ewl_Calendar *c);
-int ewl_calendar_year_get(Ewl_Calendar *c);
+int ewl_calendar_init(Ewl_Calendar *calendar);
+char *ewl_calendar_ascii_time_get(Ewl_Calendar *cal);
+int ewl_calendar_day_get(Ewl_Calendar *c);
+int ewl_calendar_month_get(Ewl_Calendar *c);
+int ewl_calendar_year_get(Ewl_Calendar *c);
/**
* @}
diff --git a/src/lib/ewl_callback.c b/src/lib/ewl_callback.c
index 887ef54..131ac34 100644
--- a/src/lib/ewl_callback.c
+++ b/src/lib/ewl_callback.c
@@ -18,12 +18,12 @@ static unsigned int ewl_callback_hash(const void *key);
static int ewl_callback_compare(const void *key1, const void *key2);
static void ewl_callback_unregister(Ewl_Callback * cb);
static Ewl_Callback *ewl_callback_get(Ewl_Widget *w, unsigned int type,
- unsigned int idx);
+ unsigned int idx);
static void ewl_callback_rm(Ewl_Widget *w, unsigned int t,
- unsigned int pos);
+ unsigned int pos);
static int ewl_callback_insert(Ewl_Widget *w, unsigned int t,
- Ewl_Callback *cb, unsigned int pos);
+ Ewl_Callback *cb, unsigned int pos);
static int callback_type_count;
static int callback_id = 0;
@@ -58,7 +58,7 @@ ewl_callbacks_init(void)
DENTER_FUNCTION(DLEVEL_STABLE);
cb_registration = ecore_hash_new(ewl_callback_hash,
- ewl_callback_compare);
+ ewl_callback_compare);
callback_type_count = EWL_CALLBACK_MAX + 1;
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -96,8 +96,8 @@ ewl_callback_unregister(Ewl_Callback *cb)
cb->references--;
if (cb->references < 1) {
- ecore_hash_remove(cb_registration, cb);
- FREE(cb);
+ ecore_hash_remove(cb_registration, cb);
+ FREE(cb);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -114,55 +114,55 @@ ewl_callback_rm(Ewl_Widget *w, unsigned int t, unsigned int pos)
* widget is already destroyed */
if (t > EWL_CALLBACK_MAX)
- place = EWL_CALLBACK_MAX;
+ place = EWL_CALLBACK_MAX;
else
- place = t;
+ place = t;
/* deal with the direct case first */
if (w->callbacks[place].mask & EWL_CALLBACK_TYPE_DIRECT)
{
- ewl_callback_unregister((Ewl_Callback *)w->callbacks[place].list);
+ ewl_callback_unregister((Ewl_Callback *)w->callbacks[place].list);
- w->callbacks[place].len = 0;
- w->callbacks[place].list = NULL;
- EWL_CALLBACK_SET_NODIRECT(w, place);
+ w->callbacks[place].len = 0;
+ w->callbacks[place].list = NULL;
+ EWL_CALLBACK_SET_NODIRECT(w, place);
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
ewl_callback_unregister(w->callbacks[place].list[pos]);
/* if this will empty the list (we've already handled direct) */
if ((EWL_CALLBACK_LEN(w, place) - 1) == 0)
{
- w->callbacks[place].len = 0;
- w->callbacks[place].list[0] = NULL;
- FREE(w->callbacks[place].list);
+ w->callbacks[place].len = 0;
+ w->callbacks[place].list[0] = NULL;
+ FREE(w->callbacks[place].list);
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
/* not the last position */
if ((int)pos != (EWL_CALLBACK_LEN(w, place) - 1))
{
- memmove(w->callbacks[place].list + pos,
- w->callbacks[place].list + (pos + 1),
- (w->callbacks[place].len - pos - 1) * sizeof(void *));
+ memmove(w->callbacks[place].list + pos,
+ w->callbacks[place].list + (pos + 1),
+ (w->callbacks[place].len - pos - 1) * sizeof(void *));
}
w->callbacks[place].len -= 1;
w->callbacks[place].list[EWL_CALLBACK_LEN(w, place)] = NULL;
w->callbacks[place].list = realloc(w->callbacks[place].list,
- w->callbacks[place].len * sizeof(void *));
+ w->callbacks[place].len * sizeof(void *));
if (pos < EWL_CALLBACK_POS(w, place))
- EWL_CALLBACK_POS(w, place)--;
+ EWL_CALLBACK_POS(w, place)--;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static int
ewl_callback_insert(Ewl_Widget *w, unsigned int t,
- Ewl_Callback *cb, unsigned int pos)
+ Ewl_Callback *cb, unsigned int pos)
{
unsigned int place;
Ewl_Callback *old = NULL;
@@ -173,24 +173,24 @@ ewl_callback_insert(Ewl_Widget *w, unsigned int t,
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, 0);
if (EWL_CALLBACK_LEN(w, t) == 255) {
- DERROR("Maximum number of callbacks of one type "
- "exceeded on a widget\n");
- DRETURN_INT(0, DLEVEL_STABLE);
+ DERROR("Maximum number of callbacks of one type "
+ "exceeded on a widget\n");
+ DRETURN_INT(0, DLEVEL_STABLE);
}
if (t > EWL_CALLBACK_MAX)
- place = EWL_CALLBACK_MAX;
+ place = EWL_CALLBACK_MAX;
else
- place = t;
+ place = t;
/* set direct if possible */
if (!EWL_CALLBACK_LEN(w, t))
{
- w->callbacks[place].list = (void *)cb;
- w->callbacks[place].len = 1;
- EWL_CALLBACK_SET_DIRECT(w, t);
+ w->callbacks[place].list = (void *)cb;
+ w->callbacks[place].len = 1;
+ EWL_CALLBACK_SET_DIRECT(w, t);
- DRETURN_INT(cb->id, DLEVEL_STABLE);
+ DRETURN_INT(cb->id, DLEVEL_STABLE);
}
w->callbacks[place].len ++;
@@ -198,37 +198,37 @@ ewl_callback_insert(Ewl_Widget *w, unsigned int t,
* pointer and set the list to NULL so it'll be allocd' correctly */
if (w->callbacks[place].mask & EWL_CALLBACK_TYPE_DIRECT)
{
- old = (Ewl_Callback *)w->callbacks[place].list;
- w->callbacks[place].list = NULL;
- EWL_CALLBACK_SET_NODIRECT(w, t);
+ old = (Ewl_Callback *)w->callbacks[place].list;
+ w->callbacks[place].list = NULL;
+ EWL_CALLBACK_SET_NODIRECT(w, t);
}
w->callbacks[place].list = realloc(w->callbacks[place].list,
- w->callbacks[place].len * sizeof(void *));
+ w->callbacks[place].len * sizeof(void *));
/* if old is set this was a direct so we can just set 0, 1 and be
* done with it */
if (old)
{
- w->callbacks[place].list[0] = (!pos ? cb : old);
- w->callbacks[place].list[1] = ( pos ? cb : old);
+ w->callbacks[place].list[0] = (!pos ? cb : old);
+ w->callbacks[place].list[1] = ( pos ? cb : old);
}
else
{
- /* only have to move if we aren't at the end (of the
- * original lenth already */
- if ((int)pos != (w->callbacks[place].len - 1))
- {
- memmove(w->callbacks[place].list + (pos + 1),
- w->callbacks[place].list + pos,
- (w->callbacks[place].len - pos - 1)
- * sizeof(void *));
- }
- w->callbacks[place].list[pos] = cb;
+ /* only have to move if we aren't at the end (of the
+ * original lenth already */
+ if ((int)pos != (w->callbacks[place].len - 1))
+ {
+ memmove(w->callbacks[place].list + (pos + 1),
+ w->callbacks[place].list + pos,
+ (w->callbacks[place].len - pos - 1)
+ * sizeof(void *));
+ }
+ w->callbacks[place].list[pos] = cb;
}
if (pos <= EWL_CALLBACK_POS(w, t))
- EWL_CALLBACK_POS(w, t)++;
+ EWL_CALLBACK_POS(w, t)++;
DRETURN_INT(cb->id, DLEVEL_STABLE);
}
@@ -247,17 +247,17 @@ ewl_callback_get(Ewl_Widget *w, unsigned int t, unsigned int i)
chain = &(w->callbacks[EWL_CALLBACK_INDEX(t)]);
if (chain->mask & EWL_CALLBACK_TYPE_DIRECT)
- cb = EWL_CALLBACK(chain->list);
+ cb = EWL_CALLBACK(chain->list);
else if (chain->list)
- cb = chain->list[i];
+ cb = chain->list[i];
if (t >= EWL_CALLBACK_MAX)
- ccb = EWL_CALLBACK_CUSTOM(cb);
+ ccb = EWL_CALLBACK_CUSTOM(cb);
/* make sure the event id's match (if this is a custom callback */
if (ccb && (ccb->event_id != t))
- cb = NULL;
+ cb = NULL;
DRETURN_PTR(cb, DLEVEL_STABLE);
}
@@ -276,8 +276,8 @@ ewl_callback_type_add(void)
static int
ewl_callback_position_insert(Ewl_Widget *w, unsigned int type,
- Ewl_Callback_Function func,
- unsigned int pos, void *user_data)
+ Ewl_Callback_Function func,
+ unsigned int pos, void *user_data)
{
int ret;
Ewl_Callback *cb, *found;
@@ -288,26 +288,26 @@ ewl_callback_position_insert(Ewl_Widget *w, unsigned int type,
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, 0);
if (type < EWL_CALLBACK_MAX)
- cb = alloca(sizeof(Ewl_Callback));
+ cb = alloca(sizeof(Ewl_Callback));
else
- cb = alloca(sizeof(Ewl_Callback_Custom));
+ cb = alloca(sizeof(Ewl_Callback_Custom));
cb->func = func;
cb->user_data = user_data;
found = ecore_hash_get(cb_registration, cb);
if (!found) {
- if (type < EWL_CALLBACK_MAX) {
- found = NEW(Ewl_Callback, 1);
- }
- else {
- found = NEW(Ewl_Callback_Custom, 1);
- EWL_CALLBACK_CUSTOM(found)->event_id = type;
- }
- found->func = func;
- found->user_data = user_data;
- found->id = ++callback_id;
- ecore_hash_set(cb_registration, found, found);
+ if (type < EWL_CALLBACK_MAX) {
+ found = NEW(Ewl_Callback, 1);
+ }
+ else {
+ found = NEW(Ewl_Callback_Custom, 1);
+ EWL_CALLBACK_CUSTOM(found)->event_id = type;
+ }
+ found->func = func;
+ found->user_data = user_data;
+ found->id = ++callback_id;
+ ecore_hash_set(cb_registration, found, found);
}
found->references++;
@@ -331,7 +331,7 @@ ewl_callback_position_insert(Ewl_Widget *w, unsigned int type,
*/
int
ewl_callback_append(Ewl_Widget *w, unsigned int t,
- Ewl_Callback_Function f, void *user_data)
+ Ewl_Callback_Function f, void *user_data)
{
int ret;
@@ -341,7 +341,7 @@ ewl_callback_append(Ewl_Widget *w, unsigned int t,
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, 0);
ret = ewl_callback_position_insert(w, t, f,
- EWL_CALLBACK_LEN(w, t), user_data);
+ EWL_CALLBACK_LEN(w, t), user_data);
DRETURN_INT(ret, DLEVEL_STABLE);
}
@@ -359,7 +359,7 @@ ewl_callback_append(Ewl_Widget *w, unsigned int t,
*/
int
ewl_callback_prepend(Ewl_Widget *w, unsigned int t,
- Ewl_Callback_Function f, void *user_data)
+ Ewl_Callback_Function f, void *user_data)
{
int ret;
@@ -388,8 +388,8 @@ ewl_callback_prepend(Ewl_Widget *w, unsigned int t,
*/
int
ewl_callback_insert_after(Ewl_Widget *w, unsigned int t,
- Ewl_Callback_Function f, void *user_data,
- Ewl_Callback_Function after, void *after_data)
+ Ewl_Callback_Function f, void *user_data,
+ Ewl_Callback_Function after, void *after_data)
{
Ewl_Callback *search;
int ret;
@@ -405,13 +405,13 @@ ewl_callback_insert_after(Ewl_Widget *w, unsigned int t,
*/
for (pos = 0; pos < EWL_CALLBACK_LEN(w, t); pos++)
{
- search = ewl_callback_get(w, t, pos);
- if (search && (search->func == after) &&
- (search->user_data == after_data))
- {
- pos ++;
- break;
- }
+ search = ewl_callback_get(w, t, pos);
+ if (search && (search->func == after) &&
+ (search->user_data == after_data))
+ {
+ pos ++;
+ break;
+ }
}
ret = ewl_callback_position_insert(w, t, f, pos, user_data);
@@ -451,7 +451,7 @@ ewl_callback_call(Ewl_Widget *w, unsigned int t)
*/
void
ewl_callback_call_with_event_data(Ewl_Widget *w, unsigned int t,
- void *ev_data)
+ void *ev_data)
{
Ewl_Callback *cb;
Ewl_Widget *parent, *top = NULL;
@@ -465,13 +465,13 @@ ewl_callback_call_with_event_data(Ewl_Widget *w, unsigned int t,
*/
parent = w->parent;
while (parent) {
- if (EWL_CALLBACK_FLAGS(parent, t) & EWL_CALLBACK_NOTIFY_INTERCEPT)
- top = parent;
- parent = parent->parent;
+ if (EWL_CALLBACK_FLAGS(parent, t) & EWL_CALLBACK_NOTIFY_INTERCEPT)
+ top = parent;
+ parent = parent->parent;
}
if (top)
- w = top;
+ w = top;
/*
* Now search up the tree to find the first notified widget. This may
@@ -480,22 +480,22 @@ ewl_callback_call_with_event_data(Ewl_Widget *w, unsigned int t,
top = NULL;
parent = w->parent;
while (parent) {
- if (EWL_CALLBACK_FLAGS(parent, t) & EWL_CALLBACK_NOTIFY_NOTIFY)
- {
- top = parent;
- break;
- }
- parent = parent->parent;
+ if (EWL_CALLBACK_FLAGS(parent, t) & EWL_CALLBACK_NOTIFY_NOTIFY)
+ {
+ top = parent;
+ break;
+ }
+ parent = parent->parent;
}
if (top)
- ewl_callback_call_with_event_data(top, t, ev_data);
+ ewl_callback_call_with_event_data(top, t, ev_data);
/*
* Make sure the widget has callbacks of the given type
*/
if (!EWL_CALLBACK_LEN(w, t))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Loop through and execute each of the callbacks of a certain type for
@@ -504,24 +504,24 @@ ewl_callback_call_with_event_data(Ewl_Widget *w, unsigned int t,
EWL_CALLBACK_POS(w, t) = 0;
while (EWL_CALLBACK_POS(w, t) < EWL_CALLBACK_LEN(w, t))
{
- Ewl_Callback *newcb = NULL;
+ Ewl_Callback *newcb = NULL;
- cb = ewl_callback_get(w, t, EWL_CALLBACK_POS(w, t));
+ cb = ewl_callback_get(w, t, EWL_CALLBACK_POS(w, t));
- /* keep going if there is no callback at this spot. This can
- * happen with hte custom array */
- if (!cb)
- {
- EWL_CALLBACK_POS(w, t)++;
- continue;
- }
+ /* keep going if there is no callback at this spot. This can
+ * happen with hte custom array */
+ if (!cb)
+ {
+ EWL_CALLBACK_POS(w, t)++;
+ continue;
+ }
- if (cb->func)
- cb->func(w, ev_data, cb->user_data);
+ if (cb->func)
+ cb->func(w, ev_data, cb->user_data);
- newcb = ewl_callback_get(w, t, EWL_CALLBACK_POS(w, t));
- if (cb == newcb)
- EWL_CALLBACK_POS(w, t)++;
+ newcb = ewl_callback_get(w, t, EWL_CALLBACK_POS(w, t));
+ if (cb == newcb)
+ EWL_CALLBACK_POS(w, t)++;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -545,28 +545,28 @@ ewl_callback_del_type(Ewl_Widget *w, unsigned int t)
* destroyed by the time we get here */
if (!EWL_CALLBACK_LEN(w, t))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (t > EWL_CALLBACK_MAX) {
- unsigned int i = 0;
-
- /*
- * Handle custom types by verifying that the event id matches
- * the specified callback type.
- */
- while (i < EWL_CALLBACK_LEN(w, t)) {
- Ewl_Callback_Custom *cb;
-
- cb = (Ewl_Callback_Custom *)ewl_callback_get(w, t, i);
- if (cb && (cb->event_id == t))
- ewl_callback_rm(w, t, i);
- else
- i++;
- }
+ unsigned int i = 0;
+
+ /*
+ * Handle custom types by verifying that the event id matches
+ * the specified callback type.
+ */
+ while (i < EWL_CALLBACK_LEN(w, t)) {
+ Ewl_Callback_Custom *cb;
+
+ cb = (Ewl_Callback_Custom *)ewl_callback_get(w, t, i);
+ if (cb && (cb->event_id == t))
+ ewl_callback_rm(w, t, i);
+ else
+ i++;
+ }
}
else {
- while (EWL_CALLBACK_LEN(w, t))
- ewl_callback_rm(w, t, EWL_CALLBACK_LEN(w, t) - 1);
+ while (EWL_CALLBACK_LEN(w, t))
+ ewl_callback_rm(w, t, EWL_CALLBACK_LEN(w, t) - 1);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -593,15 +593,15 @@ ewl_callback_del_cb_id(Ewl_Widget *w, unsigned int t, int cb_id)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!EWL_CALLBACK_LEN(w, t) || cb_id > callback_id)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
for (i = 0; i < EWL_CALLBACK_LEN(w, t); i++)
{
- cb = ewl_callback_get(w, t, i);
- if (cb && (cb->id == cb_id)) {
- ewl_callback_rm(w, t, i);
- break;
- }
+ cb = ewl_callback_get(w, t, i);
+ if (cb && (cb->id == cb_id)) {
+ ewl_callback_rm(w, t, i);
+ break;
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -629,13 +629,13 @@ ewl_callback_clear(Ewl_Widget *w)
* First clear out all standard callback types.
*/
for (i = 0; i < EWL_CALLBACK_MAX; i++)
- ewl_callback_del_type(w, i);
+ ewl_callback_del_type(w, i);
/*
* Finally clear out all custom callbacks.
*/
while (EWL_CALLBACK_LEN(w, i))
- ewl_callback_rm(w, i, EWL_CALLBACK_LEN(w, i) - 1);
+ ewl_callback_rm(w, i, EWL_CALLBACK_LEN(w, i) - 1);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -661,15 +661,15 @@ ewl_callback_del(Ewl_Widget *w, unsigned int t, Ewl_Callback_Function f)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!EWL_CALLBACK_LEN(w, t))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
for (i = 0; i < EWL_CALLBACK_LEN(w, t); i++)
{
- cb = ewl_callback_get(w, t, i);
- if (cb && (cb->func == f)) {
- ewl_callback_rm(w, t, i);
- break;
- }
+ cb = ewl_callback_get(w, t, i);
+ if (cb && (cb->func == f)) {
+ ewl_callback_rm(w, t, i);
+ break;
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -688,7 +688,7 @@ ewl_callback_del(Ewl_Widget *w, unsigned int t, Ewl_Callback_Function f)
*/
void
ewl_callback_del_with_data(Ewl_Widget *w, unsigned int t,
- Ewl_Callback_Function f, void *d)
+ Ewl_Callback_Function f, void *d)
{
Ewl_Callback *cb;
unsigned int i;
@@ -698,15 +698,15 @@ ewl_callback_del_with_data(Ewl_Widget *w, unsigned int t,
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!EWL_CALLBACK_LEN(w, t))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
for (i = 0; i < EWL_CALLBACK_LEN(w, t); i++)
{
- cb = ewl_callback_get(w, t, i);
- if (cb && (cb->func == f) && (cb->user_data == d)) {
- ewl_callback_rm(w, t, i);
- break;
- }
+ cb = ewl_callback_get(w, t, i);
+ if (cb && (cb->func == f) && (cb->user_data == d)) {
+ ewl_callback_rm(w, t, i);
+ break;
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -726,7 +726,7 @@ ewl_callback_hash(const void *key)
cb = EWL_CALLBACK(key);
DRETURN_INT((unsigned int) (cb->func) ^
- (unsigned int) (cb->user_data), DLEVEL_STABLE);
+ (unsigned int) (cb->user_data), DLEVEL_STABLE);
}
/*
@@ -747,7 +747,7 @@ ewl_callback_compare(const void *key1, const void *key2)
cb2 = EWL_CALLBACK(key2);
if ((cb1->func == cb2->func) && (cb1->user_data == cb2->user_data))
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
DRETURN_INT(-1, DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_callback.h b/src/lib/ewl_callback.h
index c183771..66fd484 100644
--- a/src/lib/ewl_callback.h
+++ b/src/lib/ewl_callback.h
@@ -24,7 +24,7 @@ typedef struct Ewl_Callback Ewl_Callback;
* A shortcut for declaring functions that take a callback funciton pointer.
*/
typedef void (*Ewl_Callback_Function) (Ewl_Widget * widget, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @def EWL_CALLBACK_FUNCTION(cb_func)
@@ -37,10 +37,10 @@ typedef void (*Ewl_Callback_Function) (Ewl_Widget * widget, void *ev_data,
*/
struct Ewl_Callback
{
- Ewl_Callback_Function func; /**< Function executed */
- void *user_data; /**< user specified data to pass to func */
- int references; /**< Reference counting */
- int id; /**< id number of this callback */
+ Ewl_Callback_Function func; /**< Function executed */
+ void *user_data; /**< user specified data to pass to func */
+ int references; /**< Reference counting */
+ int id; /**< id number of this callback */
};
@@ -60,8 +60,8 @@ typedef struct Ewl_Callback_Custom Ewl_Callback_Custom;
*/
struct Ewl_Callback_Custom
{
- Ewl_Callback cb; /**< Inherit from Ewl_Callback */
- unsigned int event_id; /**< Add an event id */
+ Ewl_Callback cb; /**< Inherit from Ewl_Callback */
+ unsigned int event_id; /**< Add an event id */
};
/**
@@ -105,72 +105,72 @@ struct Ewl_Callback_Custom
* Sets the callback intercept flag from a widget for a certain event type.
*/
#define EWL_CALLBACK_FLAG_INTERCEPT(w, t) \
- w->callbacks[EWL_CALLBACK_INDEX(t)].mask |= EWL_CALLBACK_NOTIFY_INTERCEPT
+ w->callbacks[EWL_CALLBACK_INDEX(t)].mask |= EWL_CALLBACK_NOTIFY_INTERCEPT
/**
* @def EWL_CALLBACK_FLAG_NOINTERCEPT(w, t)
* Clears the callback intercept flag from a widget for a certain event type.
*/
#define EWL_CALLBACK_FLAG_NOINTERCEPT(w, t) \
- w->callbacks[EWL_CALLBACK_INDEX(t)].mask = \
- w->callbacks[EWL_CALLBACK_INDEX(t)].mask & ~EWL_CALLBACK_NOTIFY_INTERCEPT
+ w->callbacks[EWL_CALLBACK_INDEX(t)].mask = \
+ w->callbacks[EWL_CALLBACK_INDEX(t)].mask & ~EWL_CALLBACK_NOTIFY_INTERCEPT
/**
* @def EWL_CALLBACK_FLAG_NOTIFY(w, t)
* Sets the callback notify flag from a widget for a certain event type.
*/
#define EWL_CALLBACK_FLAG_NOTIFY(w, t) \
- w->callbacks[EWL_CALLBACK_INDEX(t)].mask |= EWL_CALLBACK_NOTIFY_NOTIFY
+ w->callbacks[EWL_CALLBACK_INDEX(t)].mask |= EWL_CALLBACK_NOTIFY_NOTIFY
/**
* @def EWL_CALLBACK_FLAG_NONOTIFY(w, t)
* Remove the callback notify flag from a widget for a certain event type.
*/
#define EWL_CALLBACK_FLAG_NONOTIFY(w, t) \
- w->callbacks[EWL_CALLBACK_INDEX(t)].mask &= ~EWL_CALLBACK_NOTIFY_NOTIFY
+ w->callbacks[EWL_CALLBACK_INDEX(t)].mask &= ~EWL_CALLBACK_NOTIFY_NOTIFY
/**
* @def EWL_CALLBACK_SET_DIRECT(w, t)
* Sets the callback direct flag for a centain event type
*/
#define EWL_CALLBACK_SET_DIRECT(w, t) \
- w->callbacks[EWL_CALLBACK_INDEX(t)].mask |= EWL_CALLBACK_TYPE_DIRECT
+ w->callbacks[EWL_CALLBACK_INDEX(t)].mask |= EWL_CALLBACK_TYPE_DIRECT
/**
* @def EWL_CALLBACK_SET_NODIRECT(w, t)
* Clears the callback direct flag from a widget for a certain event type
*/
#define EWL_CALLBACK_SET_NODIRECT(w, t) \
- w->callbacks[EWL_CALLBACK_INDEX(t)].mask &= ~EWL_CALLBACK_TYPE_DIRECT
+ w->callbacks[EWL_CALLBACK_INDEX(t)].mask &= ~EWL_CALLBACK_TYPE_DIRECT
-int ewl_callbacks_init(void);
-void ewl_callbacks_shutdown(void);
+int ewl_callbacks_init(void);
+void ewl_callbacks_shutdown(void);
unsigned int ewl_callback_type_add(void);
-int ewl_callback_append(Ewl_Widget * widget, unsigned int type,
- Ewl_Callback_Function func,
- void *user_data);
-int ewl_callback_prepend(Ewl_Widget * widget,
- unsigned int type,
- Ewl_Callback_Function func,
- void *user_data);
-int ewl_callback_insert_after(Ewl_Widget * w, unsigned int t,
- Ewl_Callback_Function f,
- void *user_data,
- Ewl_Callback_Function after,
- void *after_data);
-void ewl_callback_clear(Ewl_Widget * widget);
-void ewl_callback_call(Ewl_Widget * widget, unsigned int type);
-void ewl_callback_call_with_event_data(Ewl_Widget * widget,
- unsigned int type,
- void *event_data);
-void ewl_callback_del_type(Ewl_Widget * w, unsigned int t);
-void ewl_callback_del_cb_id(Ewl_Widget * w, unsigned int t,
- int cb_id);
-void ewl_callback_del(Ewl_Widget * w, unsigned int t,
- Ewl_Callback_Function f);
-void ewl_callback_del_with_data(Ewl_Widget * w, unsigned int t,
- Ewl_Callback_Function f, void *data);
+int ewl_callback_append(Ewl_Widget * widget, unsigned int type,
+ Ewl_Callback_Function func,
+ void *user_data);
+int ewl_callback_prepend(Ewl_Widget * widget,
+ unsigned int type,
+ Ewl_Callback_Function func,
+ void *user_data);
+int ewl_callback_insert_after(Ewl_Widget * w, unsigned int t,
+ Ewl_Callback_Function f,
+ void *user_data,
+ Ewl_Callback_Function after,
+ void *after_data);
+void ewl_callback_clear(Ewl_Widget * widget);
+void ewl_callback_call(Ewl_Widget * widget, unsigned int type);
+void ewl_callback_call_with_event_data(Ewl_Widget * widget,
+ unsigned int type,
+ void *event_data);
+void ewl_callback_del_type(Ewl_Widget * w, unsigned int t);
+void ewl_callback_del_cb_id(Ewl_Widget * w, unsigned int t,
+ int cb_id);
+void ewl_callback_del(Ewl_Widget * w, unsigned int t,
+ Ewl_Callback_Function f);
+void ewl_callback_del_with_data(Ewl_Widget * w, unsigned int t,
+ Ewl_Callback_Function f, void *data);
/**
* @}
diff --git a/src/lib/ewl_cell.c b/src/lib/ewl_cell.c
index 3dc0ce9..d13a45b 100644
--- a/src/lib/ewl_cell.c
+++ b/src/lib/ewl_cell.c
@@ -20,11 +20,11 @@ ewl_cell_new(void)
cell = NEW(Ewl_Cell, 1);
if (!cell)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_cell_init(EWL_CELL(cell))) {
- FREE(cell);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(cell);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(cell, DLEVEL_STABLE);
@@ -44,19 +44,19 @@ ewl_cell_init(Ewl_Cell *cell)
DCHECK_PARAM_PTR_RET(cell, FALSE);
if (!ewl_container_init(EWL_CONTAINER(cell)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_object_fill_policy_set(EWL_OBJECT(cell), EWL_FLAG_FILL_FILL |
- EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HSHRINK);
ewl_widget_appearance_set(EWL_WIDGET(cell), EWL_CELL_TYPE);
ewl_widget_inherit(EWL_WIDGET(cell), EWL_CELL_TYPE);
ewl_container_show_notify_set(EWL_CONTAINER(cell), ewl_cell_cb_child_show);
ewl_container_resize_notify_set(EWL_CONTAINER(cell),
- ewl_cell_cb_child_resize);
+ ewl_cell_cb_child_resize);
ewl_callback_append(EWL_WIDGET(cell), EWL_CALLBACK_CONFIGURE,
- ewl_cell_cb_configure, NULL);
+ ewl_cell_cb_configure, NULL);
ewl_container_callback_notify(EWL_CONTAINER(cell), EWL_CALLBACK_FOCUS_IN);
ewl_container_callback_notify(EWL_CONTAINER(cell), EWL_CALLBACK_FOCUS_OUT);
@@ -73,7 +73,7 @@ ewl_cell_init(Ewl_Cell *cell)
*/
void
ewl_cell_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Container *c;
Ewl_Object *child;
@@ -87,11 +87,11 @@ ewl_cell_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
/* we need to skip all unmanaged widgets first */
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)) && UNMANAGED(child))
- ;
+ ;
if (child)
- ewl_object_place(child, CURRENT_X(w), CURRENT_Y(w),
- CURRENT_W(w), CURRENT_H(w));
+ ewl_object_place(child, CURRENT_X(w), CURRENT_Y(w),
+ CURRENT_W(w), CURRENT_H(w));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -120,13 +120,13 @@ ewl_cell_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
*/
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children))) {
- if (child != w)
- ewl_container_child_remove(c, child);
+ if (child != w)
+ ewl_container_child_remove(c, child);
}
ewl_object_preferred_inner_size_set(EWL_OBJECT(c),
- ewl_object_preferred_w_get(EWL_OBJECT(w)),
- ewl_object_preferred_h_get(EWL_OBJECT(w)));
+ ewl_object_preferred_w_get(EWL_OBJECT(w)),
+ ewl_object_preferred_h_get(EWL_OBJECT(w)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -142,7 +142,7 @@ ewl_cell_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
*/
void
ewl_cell_cb_child_resize(Ewl_Container *c, Ewl_Widget *w,
- int size __UNUSED__, Ewl_Orientation o __UNUSED__)
+ int size __UNUSED__, Ewl_Orientation o __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
@@ -151,8 +151,8 @@ ewl_cell_cb_child_resize(Ewl_Container *c, Ewl_Widget *w,
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
ewl_object_preferred_inner_size_set(EWL_OBJECT(c),
- ewl_object_preferred_w_get(EWL_OBJECT(w)),
- ewl_object_preferred_h_get(EWL_OBJECT(w)));
+ ewl_object_preferred_w_get(EWL_OBJECT(w)),
+ ewl_object_preferred_h_get(EWL_OBJECT(w)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -171,7 +171,7 @@ ewl_cell_state_change_cb_add(Ewl_Cell *cell)
DCHECK_TYPE(cell, EWL_CELL_TYPE);
ewl_callback_append(EWL_WIDGET(cell), EWL_CALLBACK_STATE_CHANGED,
- ewl_cell_cb_state_changed, NULL);
+ ewl_cell_cb_state_changed, NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -189,7 +189,7 @@ ewl_cell_state_change_cb_del(Ewl_Cell *cell)
DCHECK_TYPE(cell, EWL_CELL_TYPE);
ewl_callback_del(EWL_WIDGET(cell), EWL_CALLBACK_STATE_CHANGED,
- ewl_cell_cb_state_changed);
+ ewl_cell_cb_state_changed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -218,18 +218,18 @@ ewl_cell_cb_state_changed(Ewl_Widget *w, void *ev, void *data __UNUSED__)
/* Only want this for selected signals */
if (!strcmp(e->state, "selected"))
- send_state = "parent,selected";
+ send_state = "parent,selected";
else if (!strcmp(e->state, "deselect"))
- send_state = "parent,deselect";
+ send_state = "parent,deselect";
else if ((!strcmp(e->state, "parent,selected")) ||
- (!strcmp(e->state, "parent,deselect")))
- send_state = e->state;
+ (!strcmp(e->state, "parent,deselect")))
+ send_state = e->state;
else
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_container_child_iterate_begin(EWL_CONTAINER(w));
while ((o = ewl_container_child_next(EWL_CONTAINER(w))))
- ewl_widget_state_set(o, send_state, e->flag);
+ ewl_widget_state_set(o, send_state, e->flag);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_cell.h b/src/lib/ewl_cell.h
index 2f55697..b4c40f0 100644
--- a/src/lib/ewl_cell.h
+++ b/src/lib/ewl_cell.h
@@ -51,9 +51,9 @@ struct Ewl_Cell
};
Ewl_Widget *ewl_cell_new(void);
-int ewl_cell_init(Ewl_Cell *cell);
-void ewl_cell_state_change_cb_add(Ewl_Cell *cell);
-void ewl_cell_state_change_cb_del(Ewl_Cell *cell);
+int ewl_cell_init(Ewl_Cell *cell);
+void ewl_cell_state_change_cb_add(Ewl_Cell *cell);
+void ewl_cell_state_change_cb_del(Ewl_Cell *cell);
/*
* Internally used callbacks, override at your own risk.
@@ -61,7 +61,7 @@ void ewl_cell_state_change_cb_del(Ewl_Cell *cell);
void ewl_cell_cb_configure(Ewl_Widget * w, void *ev_data, void *user_data);
void ewl_cell_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_cell_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
/**
* @}
diff --git a/src/lib/ewl_check.c b/src/lib/ewl_check.c
index 4243a23..22a0409 100644
--- a/src/lib/ewl_check.c
+++ b/src/lib/ewl_check.c
@@ -18,11 +18,11 @@ ewl_check_new(void)
b = NEW(Ewl_Check, 1);
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_check_init(EWL_CHECK(b))) {
- ewl_widget_destroy(EWL_WIDGET(b));
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(EWL_WIDGET(b));
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
@@ -47,7 +47,7 @@ ewl_check_init(Ewl_Check *cb)
w = EWL_WIDGET(cb);
if (!ewl_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_CHECK_TYPE);
ewl_widget_inherit(w, EWL_CHECK_TYPE);
@@ -56,9 +56,9 @@ ewl_check_init(Ewl_Check *cb)
ewl_object_preferred_inner_size_set(EWL_OBJECT(w), 20, 20);
ewl_callback_append(w, EWL_CALLBACK_CLICKED,
- ewl_check_cb_clicked, NULL);
+ ewl_check_cb_clicked, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_OUT,
- ewl_check_cb_update_check, NULL);
+ ewl_check_cb_update_check, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -80,7 +80,7 @@ ewl_check_checked_set(Ewl_Check *cb, int c)
DCHECK_TYPE(cb, EWL_CHECK_TYPE);
if (cb->checked == !!c)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
cb->checked = !!c;
ewl_check_cb_update_check(EWL_WIDGET(cb), NULL, NULL);
@@ -113,7 +113,7 @@ ewl_check_is_checked(Ewl_Check *cb)
*/
void
ewl_check_cb_clicked(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Check *cb;
@@ -139,7 +139,7 @@ ewl_check_cb_clicked(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_check_cb_update_check(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Check *cb;
@@ -149,9 +149,9 @@ ewl_check_cb_update_check(Ewl_Widget *w, void *ev_data __UNUSED__,
cb = EWL_CHECK(w);
if (cb->checked)
- ewl_widget_state_set(w, "checked", EWL_STATE_PERSISTENT);
+ ewl_widget_state_set(w, "checked", EWL_STATE_PERSISTENT);
else
- ewl_widget_state_set(w, "default", EWL_STATE_PERSISTENT);
+ ewl_widget_state_set(w, "default", EWL_STATE_PERSISTENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_check.h b/src/lib/ewl_check.h
index 05899bd..a2921ae 100644
--- a/src/lib/ewl_check.h
+++ b/src/lib/ewl_check.h
@@ -53,10 +53,10 @@ struct Ewl_Check
};
Ewl_Widget *ewl_check_new(void);
-int ewl_check_init(Ewl_Check *c);
+int ewl_check_init(Ewl_Check *c);
-int ewl_check_is_checked(Ewl_Check *c);
-void ewl_check_checked_set(Ewl_Check *c, int checked);
+int ewl_check_is_checked(Ewl_Check *c);
+void ewl_check_checked_set(Ewl_Check *c, int checked);
/*
* Internally used callbacks.
diff --git a/src/lib/ewl_checkbutton.c b/src/lib/ewl_checkbutton.c
index 112907e..8770cae 100644
--- a/src/lib/ewl_checkbutton.c
+++ b/src/lib/ewl_checkbutton.c
@@ -8,10 +8,10 @@
#include "ewl_debug.h"
static Ewl_Widget *ewl_checkbutton_view_cb_widget_fetch(void *data,
- unsigned int row,
- unsigned int col);
+ unsigned int row,
+ unsigned int col);
static Ewl_Widget *ewl_checkbutton_view_cb_header_fetch(void *data,
- unsigned int col);
+ unsigned int col);
/**
* @return Returns the newly allocated checkbutton on success, NULL on failure.
@@ -26,11 +26,11 @@ ewl_checkbutton_new(void)
b = NEW(Ewl_Checkbutton, 1);
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_checkbutton_init(b)) {
- ewl_widget_destroy(EWL_WIDGET(b));
- b = NULL;
+ ewl_widget_destroy(EWL_WIDGET(b));
+ b = NULL;
}
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
@@ -57,7 +57,7 @@ ewl_checkbutton_init(Ewl_Checkbutton *cb)
w = EWL_WIDGET(cb);
if (!ewl_button_init(b))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_CHECKBUTTON_TYPE);
ewl_widget_inherit(w, EWL_CHECKBUTTON_TYPE);
@@ -65,7 +65,7 @@ ewl_checkbutton_init(Ewl_Checkbutton *cb)
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_LEFT);
ewl_callback_append(w, EWL_CALLBACK_CLICKED,
- ewl_checkbutton_cb_clicked, NULL);
+ ewl_checkbutton_cb_clicked, NULL);
cb->label_position = EWL_POSITION_RIGHT;
@@ -112,7 +112,7 @@ ewl_checkbutton_is_checked(Ewl_Checkbutton *cb)
DCHECK_TYPE_RET(cb, EWL_CHECKBUTTON_TYPE, FALSE);
DRETURN_INT(ewl_check_is_checked(EWL_CHECK(EWL_CHECKBUTTON(cb)->check)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -135,11 +135,11 @@ ewl_checkbutton_label_position_set(Ewl_Checkbutton *cb, Ewl_Position p)
b = EWL_BUTTON(cb);
if (cb->label_position == p)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
cb->label_position = p;
ewl_container_child_remove(EWL_CONTAINER(cb),
- EWL_WIDGET(b->label_object));
+ EWL_WIDGET(b->label_object));
ewl_container_child_remove(EWL_CONTAINER(cb), cb->check);
/*
@@ -147,13 +147,13 @@ ewl_checkbutton_label_position_set(Ewl_Checkbutton *cb, Ewl_Position p)
* order.
*/
if (p == EWL_POSITION_RIGHT) {
- ewl_container_child_append(EWL_CONTAINER(cb), cb->check);
- ewl_container_child_append(EWL_CONTAINER(cb),
- EWL_WIDGET(b->label_object));
+ ewl_container_child_append(EWL_CONTAINER(cb), cb->check);
+ ewl_container_child_append(EWL_CONTAINER(cb),
+ EWL_WIDGET(b->label_object));
} else {
- ewl_container_child_append(EWL_CONTAINER(cb),
- EWL_WIDGET(b->label_object));
- ewl_container_child_append(EWL_CONTAINER(cb), cb->check);
+ ewl_container_child_append(EWL_CONTAINER(cb),
+ EWL_WIDGET(b->label_object));
+ ewl_container_child_append(EWL_CONTAINER(cb), cb->check);
}
ewl_widget_configure(EWL_WIDGET(cb));
@@ -171,7 +171,7 @@ ewl_checkbutton_label_position_set(Ewl_Checkbutton *cb, Ewl_Position p)
*/
void
ewl_checkbutton_cb_clicked(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Checkbutton *cb;
@@ -182,9 +182,9 @@ ewl_checkbutton_cb_clicked(Ewl_Widget *w, void *ev_data __UNUSED__,
cb = EWL_CHECKBUTTON(w);
if (ewl_check_is_checked(EWL_CHECK(cb->check)))
- ewl_check_checked_set(EWL_CHECK(cb->check), FALSE);
+ ewl_check_checked_set(EWL_CHECK(cb->check), FALSE);
else
- ewl_check_checked_set(EWL_CHECK(cb->check), TRUE);
+ ewl_check_checked_set(EWL_CHECK(cb->check), TRUE);
ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -210,7 +210,7 @@ ewl_checkbutton_view_get(void)
static Ewl_Widget *
ewl_checkbutton_view_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Widget *check;
diff --git a/src/lib/ewl_checkbutton.h b/src/lib/ewl_checkbutton.h
index 8f7cf73..5b8abda 100644
--- a/src/lib/ewl_checkbutton.h
+++ b/src/lib/ewl_checkbutton.h
@@ -52,19 +52,19 @@ typedef struct Ewl_Checkbutton Ewl_Checkbutton;
*/
struct Ewl_Checkbutton
{
- Ewl_Button button; /**< Inherit the basic button properties */
- Ewl_Position label_position; /**< Order of label and check */
- Ewl_Widget *check; /**< Check widget represented */
+ Ewl_Button button; /**< Inherit the basic button properties */
+ Ewl_Position label_position; /**< Order of label and check */
+ Ewl_Widget *check; /**< Check widget represented */
};
Ewl_Widget *ewl_checkbutton_new(void);
-int ewl_checkbutton_init(Ewl_Checkbutton *cb);
+int ewl_checkbutton_init(Ewl_Checkbutton *cb);
-void ewl_checkbutton_checked_set(Ewl_Checkbutton *cb, int checked);
-int ewl_checkbutton_is_checked(Ewl_Checkbutton *cb);
+void ewl_checkbutton_checked_set(Ewl_Checkbutton *cb, int checked);
+int ewl_checkbutton_is_checked(Ewl_Checkbutton *cb);
-void ewl_checkbutton_label_position_set(Ewl_Checkbutton *cb,
- Ewl_Position p);
+void ewl_checkbutton_label_position_set(Ewl_Checkbutton *cb,
+ Ewl_Position p);
Ewl_View *ewl_checkbutton_view_get(void);
/*
diff --git a/src/lib/ewl_colordialog.c b/src/lib/ewl_colordialog.c
index 8ee7dac..0a821c7 100644
--- a/src/lib/ewl_colordialog.c
+++ b/src/lib/ewl_colordialog.c
@@ -23,13 +23,13 @@ ewl_colordialog_new(void)
w = NEW(Ewl_Colordialog, 1);
if (!w)
{
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!ewl_colordialog_init(EWL_COLORDIALOG(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -49,7 +49,7 @@ ewl_colordialog_init(Ewl_Colordialog *cd)
DCHECK_PARAM_PTR_RET(cd, FALSE);
if (!ewl_dialog_init(EWL_DIALOG(cd))) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_widget_inherit(EWL_WIDGET(cd), EWL_COLORDIALOG_TYPE);
@@ -59,7 +59,7 @@ ewl_colordialog_init(Ewl_Colordialog *cd)
ewl_window_class_set(EWL_WINDOW(cd), "Ewl Colordialog");
ewl_callback_append(EWL_WIDGET(cd), EWL_CALLBACK_DELETE_WINDOW,
- ewl_colordialog_cb_delete_window, NULL);
+ ewl_colordialog_cb_delete_window, NULL);
ewl_dialog_active_area_set(EWL_DIALOG(cd), EWL_POSITION_TOP);
@@ -68,7 +68,7 @@ ewl_colordialog_init(Ewl_Colordialog *cd)
ewl_widget_internal_set(cd->picker, TRUE);
ewl_container_child_append(EWL_CONTAINER(cd), cd->picker);
ewl_object_fill_policy_set(EWL_OBJECT(cd->picker),
- EWL_FLAG_FILL_FILL);
+ EWL_FLAG_FILL_FILL);
ewl_widget_show(cd->picker);
ewl_dialog_active_area_set(EWL_DIALOG(cd), EWL_POSITION_BOTTOM);
@@ -78,14 +78,14 @@ ewl_colordialog_init(Ewl_Colordialog *cd)
ewl_container_child_append(EWL_CONTAINER(cd), o);
ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_OK);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_colordialog_cb_button_click, cd);
+ ewl_colordialog_cb_button_click, cd);
ewl_widget_show(o);
o = ewl_button_new();
ewl_container_child_append(EWL_CONTAINER(cd), o);
ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_CANCEL);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_colordialog_cb_button_click, cd);
+ ewl_colordialog_cb_button_click, cd);
ewl_widget_show(o);
/* enable alpha channel by default */
@@ -179,7 +179,7 @@ ewl_colordialog_alpha_get(Ewl_Colordialog *cd)
*/
void
ewl_colordialog_current_rgb_set(Ewl_Colordialog *cd, unsigned int r,
- unsigned int g, unsigned int b)
+ unsigned int g, unsigned int b)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cd);
@@ -200,7 +200,7 @@ ewl_colordialog_current_rgb_set(Ewl_Colordialog *cd, unsigned int r,
*/
void
ewl_colordialog_current_rgb_get(Ewl_Colordialog *cd, unsigned int *r,
- unsigned int *g, unsigned int *b)
+ unsigned int *g, unsigned int *b)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cd);
@@ -223,8 +223,8 @@ ewl_colordialog_current_rgb_get(Ewl_Colordialog *cd, unsigned int *r,
*/
void
ewl_colordialog_previous_rgba_set(Ewl_Colordialog *cd, unsigned int r,
- unsigned int g, unsigned int b,
- unsigned int a)
+ unsigned int g, unsigned int b,
+ unsigned int a)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cd);
@@ -247,8 +247,8 @@ ewl_colordialog_previous_rgba_set(Ewl_Colordialog *cd, unsigned int r,
*/
void
ewl_colordialog_previous_rgba_get(Ewl_Colordialog *cd, unsigned int *r,
- unsigned int *g, unsigned int *b,
- unsigned int *a)
+ unsigned int *g, unsigned int *b,
+ unsigned int *a)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cd);
@@ -332,7 +332,7 @@ ewl_colordialog_cb_button_click(Ewl_Widget *w, void *ev __UNUSED__, void *data)
*/
void
ewl_colordialog_cb_delete_window(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -354,7 +354,7 @@ ewl_colordialog_respond(Ewl_Colordialog *cd, unsigned int response)
cd_ev.response = response;
ewl_callback_call_with_event_data(EWL_WIDGET(cd),
- EWL_CALLBACK_VALUE_CHANGED, &cd_ev);
+ EWL_CALLBACK_VALUE_CHANGED, &cd_ev);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_colordialog.h b/src/lib/ewl_colordialog.h
index 3810cd7..290a293 100644
--- a/src/lib/ewl_colordialog.h
+++ b/src/lib/ewl_colordialog.h
@@ -43,32 +43,32 @@ typedef struct Ewl_Colordialog Ewl_Colordialog;
*/
struct Ewl_Colordialog
{
- Ewl_Dialog dialog; /**< Inherits from Ewl_Dialog */
- Ewl_Widget *picker; /**< Store the color picker widget */
+ Ewl_Dialog dialog; /**< Inherits from Ewl_Dialog */
+ Ewl_Widget *picker; /**< Store the color picker widget */
};
Ewl_Widget *ewl_colordialog_new(void);
-int ewl_colordialog_init(Ewl_Colordialog *cd);
+int ewl_colordialog_init(Ewl_Colordialog *cd);
-void ewl_colordialog_has_alpha_set(Ewl_Colordialog *cp, unsigned int alpha);
+void ewl_colordialog_has_alpha_set(Ewl_Colordialog *cp, unsigned int alpha);
unsigned int ewl_colordialog_has_alpha_get(Ewl_Colordialog *cp);
-void ewl_colordialog_alpha_set(Ewl_Colordialog *cp, unsigned int alpha);
+void ewl_colordialog_alpha_set(Ewl_Colordialog *cp, unsigned int alpha);
unsigned int ewl_colordialog_alpha_get(Ewl_Colordialog *cp);
-void ewl_colordialog_current_rgb_set(Ewl_Colordialog *cp, unsigned int r,
- unsigned int g, unsigned int b);
-void ewl_colordialog_current_rgb_get(Ewl_Colordialog *cp, unsigned int *r,
- unsigned int *g, unsigned int *b);
+void ewl_colordialog_current_rgb_set(Ewl_Colordialog *cp, unsigned int r,
+ unsigned int g, unsigned int b);
+void ewl_colordialog_current_rgb_get(Ewl_Colordialog *cp, unsigned int *r,
+ unsigned int *g, unsigned int *b);
-void ewl_colordialog_previous_rgba_set(Ewl_Colordialog *cp, unsigned int r,
- unsigned int g, unsigned int b,
- unsigned int a);
-void ewl_colordialog_previous_rgba_get(Ewl_Colordialog *cp, unsigned int *r,
- unsigned int *g, unsigned int *b,
- unsigned int *a);
+void ewl_colordialog_previous_rgba_set(Ewl_Colordialog *cp, unsigned int r,
+ unsigned int g, unsigned int b,
+ unsigned int a);
+void ewl_colordialog_previous_rgba_get(Ewl_Colordialog *cp, unsigned int *r,
+ unsigned int *g, unsigned int *b,
+ unsigned int *a);
-void ewl_colordialog_color_mode_set(Ewl_Colordialog *cp, Ewl_Color_Mode type);
+void ewl_colordialog_color_mode_set(Ewl_Colordialog *cp, Ewl_Color_Mode type);
Ewl_Color_Mode ewl_colordialog_color_mode_get(Ewl_Colordialog *cp);
/*
diff --git a/src/lib/ewl_colorpicker.c b/src/lib/ewl_colorpicker.c
index da50737..09945b1 100644
--- a/src/lib/ewl_colorpicker.c
+++ b/src/lib/ewl_colorpicker.c
@@ -11,8 +11,8 @@
#include "ewl_debug.h"
static void ewl_colorpicker_display_update(Ewl_Colorpicker *cp, unsigned int r,
- unsigned int g, unsigned int b, double h,
- double s, double v);
+ unsigned int g, unsigned int b, double h,
+ double s, double v);
#define EWL_COLORPICKER_SPINNER_TYPE "colorpicker_spinner"
#define EWL_COLORPICKER_SPINNER(spinner) ((Ewl_Colorpicker_Spinner *)spinner)
@@ -53,18 +53,18 @@ struct Ewl_Colorpicker_Radiobutton
static Ewl_Widget *ewl_colorpicker_spinner_new(void);
static int ewl_colorpicker_spinner_init(Ewl_Colorpicker_Spinner *sp);
static void ewl_colorpicker_spinner_mode_set(Ewl_Colorpicker_Spinner *sp,
- Ewl_Color_Mode mode);
+ Ewl_Color_Mode mode);
static Ewl_Color_Mode ewl_colorpicker_spinner_mode_get(
- Ewl_Colorpicker_Spinner *sp);
+ Ewl_Colorpicker_Spinner *sp);
static Ewl_Widget *ewl_colorpicker_radiobutton_new(void);
static int ewl_colorpicker_radiobutton_init(Ewl_Colorpicker_Radiobutton *sp);
static void ewl_colorpicker_radiobutton_mode_set(
- Ewl_Colorpicker_Radiobutton *sp,
- Ewl_Color_Mode mode);
+ Ewl_Colorpicker_Radiobutton *sp,
+ Ewl_Color_Mode mode);
static Ewl_Color_Mode ewl_colorpicker_radiobutton_mode_get(
- Ewl_Colorpicker_Radiobutton *sp);
+ Ewl_Colorpicker_Radiobutton *sp);
/**
* @return Returns a new Ewl_Colorpicker widget or NULL on failure
@@ -80,13 +80,13 @@ ewl_colorpicker_new(void)
w = NEW(Ewl_Colorpicker, 1);
if (!w)
{
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!ewl_colorpicker_init(EWL_COLORPICKER(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -106,17 +106,17 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
int i;
struct
{
- char *name;
- Ewl_Color_Mode mode;
- int max;
+ char *name;
+ Ewl_Color_Mode mode;
+ int max;
} modes[] = {
- {"H", EWL_COLOR_MODE_HSV_HUE, 360},
- {"S", EWL_COLOR_MODE_HSV_SATURATION, 100},
- {"V", EWL_COLOR_MODE_HSV_VALUE, 100},
- {"R", EWL_COLOR_MODE_RGB_RED, 255},
- {"G", EWL_COLOR_MODE_RGB_GREEN, 255},
- {"B", EWL_COLOR_MODE_RGB_BLUE, 255},
- {NULL, EWL_COLOR_MODE_RGB_RED, 0}
+ {"H", EWL_COLOR_MODE_HSV_HUE, 360},
+ {"S", EWL_COLOR_MODE_HSV_SATURATION, 100},
+ {"V", EWL_COLOR_MODE_HSV_VALUE, 100},
+ {"R", EWL_COLOR_MODE_RGB_RED, 255},
+ {"G", EWL_COLOR_MODE_RGB_GREEN, 255},
+ {"B", EWL_COLOR_MODE_RGB_BLUE, 255},
+ {NULL, EWL_COLOR_MODE_RGB_RED, 0}
};
const char *types[] = { "application/x-color", NULL };
@@ -124,7 +124,7 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
DCHECK_PARAM_PTR_RET(cp, FALSE);
if (!ewl_box_init(EWL_BOX(cp)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(cp), EWL_ORIENTATION_HORIZONTAL);
ewl_widget_appearance_set(EWL_WIDGET(cp), EWL_COLORPICKER_TYPE);
@@ -132,7 +132,7 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
ewl_dnd_accepted_types_set(EWL_WIDGET(cp), types);
ewl_callback_append(EWL_WIDGET(cp), EWL_CALLBACK_DND_DATA_RECEIVED,
- ewl_colorpicker_cb_dnd_data, NULL);
+ ewl_colorpicker_cb_dnd_data, NULL);
r = g = b = 0;
@@ -156,7 +156,7 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_FILL);
ewl_object_padding_set(EWL_OBJECT(o), 2, 2, 2, 2);
ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ewl_colorpicker_cb_square_change, cp);
+ ewl_colorpicker_cb_square_change, cp);
cp->picker.square = o;
ewl_widget_show(o);
@@ -169,7 +169,7 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
ewl_object_maximum_size_set(EWL_OBJECT(o), 15, EWL_OBJECT_MAX_SIZE);
ewl_object_padding_set(EWL_OBJECT(o), 2, 2, 2, 2);
ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ewl_colorpicker_cb_vertical_change, cp);
+ ewl_colorpicker_cb_vertical_change, cp);
cp->picker.vertical = o;
ewl_widget_show(o);
@@ -183,7 +183,7 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
ewl_grid_column_preferred_w_use(EWL_GRID(hbox), 0);
ewl_container_child_append(EWL_CONTAINER(vbox), hbox);
ewl_object_fill_policy_set(EWL_OBJECT(hbox),
- EWL_FLAG_FILL_NONE | EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_NONE | EWL_FLAG_FILL_HFILL);
ewl_widget_show(hbox);
o = ewl_label_new();
@@ -201,7 +201,7 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
ewl_object_padding_set(EWL_OBJECT(o), 2, 2, 2, 2);
ewl_object_minimum_h_set(EWL_OBJECT(o), 20);
ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
cp->preview.current = o;
ewl_widget_show(o);
@@ -220,9 +220,9 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
ewl_object_padding_set(EWL_OBJECT(o), 2, 2, 2, 2);
ewl_object_minimum_h_set(EWL_OBJECT(o), 20);
ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_colorpicker_cb_previous_clicked, cp);
+ ewl_colorpicker_cb_previous_clicked, cp);
cp->preview.previous = o;
ewl_widget_show(o);
@@ -236,70 +236,70 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
/* setup the spinners and radiobuttons */
for (i = 0; modes[i].name != NULL; i++)
{
- hbox = ewl_hbox_new();
- ewl_widget_internal_set(hbox, TRUE);
- ewl_container_child_append(EWL_CONTAINER(vbox), hbox);
- ewl_widget_show(hbox);
-
- o = ewl_colorpicker_radiobutton_new();
- ewl_widget_internal_set(o, TRUE);
- ewl_button_label_set(EWL_BUTTON(o), modes[i].name);
- if (!prev)
- ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), TRUE);
- else
- ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), FALSE);
-
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_colorpicker_radiobutton_mode_set(EWL_COLORPICKER_RADIOBUTTON(o),
- modes[i].mode);
- if (prev)
- ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o), EWL_RADIOBUTTON(prev));
- ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ewl_colorpicker_cb_radio_change, cp);
- prev = o;
- ewl_widget_show(o);
-
- o = ewl_colorpicker_spinner_new();
- ewl_widget_internal_set(o, TRUE);
- ewl_container_child_append(EWL_CONTAINER(hbox), o);
- ewl_range_minimum_value_set(EWL_RANGE(o), 0);
- ewl_range_maximum_value_set(EWL_RANGE(o), modes[i].max);
-
- switch(modes[i].mode)
- {
- case EWL_COLOR_MODE_HSV_HUE:
- ewl_range_value_set(EWL_RANGE(o), h);
- cp->spinners.hsv.h = o;
- break;
- case EWL_COLOR_MODE_HSV_SATURATION:
- ewl_range_value_set(EWL_RANGE(o), s * 100);
- cp->spinners.hsv.s = o;
- break;
- case EWL_COLOR_MODE_HSV_VALUE:
- ewl_range_value_set(EWL_RANGE(o), v * 100);
- cp->spinners.hsv.v = o;
- break;
- case EWL_COLOR_MODE_RGB_RED:
- ewl_range_value_set(EWL_RANGE(o), r);
- cp->spinners.rgb.r = o;
- break;
- case EWL_COLOR_MODE_RGB_GREEN:
- ewl_range_value_set(EWL_RANGE(o), g);
- cp->spinners.rgb.g = o;
- break;
- case EWL_COLOR_MODE_RGB_BLUE:
- ewl_range_value_set(EWL_RANGE(o), b);
- cp->spinners.rgb.b = o;
- break;
- }
-
- ewl_range_step_set(EWL_RANGE(o), 1);
- ewl_spinner_digits_set(EWL_SPINNER(o), 0);
- ewl_colorpicker_spinner_mode_set(EWL_COLORPICKER_SPINNER(o),
- modes[i].mode);
- ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ewl_colorpicker_cb_spinner_change, cp);
- ewl_widget_show(o);
+ hbox = ewl_hbox_new();
+ ewl_widget_internal_set(hbox, TRUE);
+ ewl_container_child_append(EWL_CONTAINER(vbox), hbox);
+ ewl_widget_show(hbox);
+
+ o = ewl_colorpicker_radiobutton_new();
+ ewl_widget_internal_set(o, TRUE);
+ ewl_button_label_set(EWL_BUTTON(o), modes[i].name);
+ if (!prev)
+ ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), TRUE);
+ else
+ ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o), FALSE);
+
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_colorpicker_radiobutton_mode_set(EWL_COLORPICKER_RADIOBUTTON(o),
+ modes[i].mode);
+ if (prev)
+ ewl_radiobutton_chain_set(EWL_RADIOBUTTON(o), EWL_RADIOBUTTON(prev));
+ ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
+ ewl_colorpicker_cb_radio_change, cp);
+ prev = o;
+ ewl_widget_show(o);
+
+ o = ewl_colorpicker_spinner_new();
+ ewl_widget_internal_set(o, TRUE);
+ ewl_container_child_append(EWL_CONTAINER(hbox), o);
+ ewl_range_minimum_value_set(EWL_RANGE(o), 0);
+ ewl_range_maximum_value_set(EWL_RANGE(o), modes[i].max);
+
+ switch(modes[i].mode)
+ {
+ case EWL_COLOR_MODE_HSV_HUE:
+ ewl_range_value_set(EWL_RANGE(o), h);
+ cp->spinners.hsv.h = o;
+ break;
+ case EWL_COLOR_MODE_HSV_SATURATION:
+ ewl_range_value_set(EWL_RANGE(o), s * 100);
+ cp->spinners.hsv.s = o;
+ break;
+ case EWL_COLOR_MODE_HSV_VALUE:
+ ewl_range_value_set(EWL_RANGE(o), v * 100);
+ cp->spinners.hsv.v = o;
+ break;
+ case EWL_COLOR_MODE_RGB_RED:
+ ewl_range_value_set(EWL_RANGE(o), r);
+ cp->spinners.rgb.r = o;
+ break;
+ case EWL_COLOR_MODE_RGB_GREEN:
+ ewl_range_value_set(EWL_RANGE(o), g);
+ cp->spinners.rgb.g = o;
+ break;
+ case EWL_COLOR_MODE_RGB_BLUE:
+ ewl_range_value_set(EWL_RANGE(o), b);
+ cp->spinners.rgb.b = o;
+ break;
+ }
+
+ ewl_range_step_set(EWL_RANGE(o), 1);
+ ewl_spinner_digits_set(EWL_SPINNER(o), 0);
+ ewl_colorpicker_spinner_mode_set(EWL_COLORPICKER_SPINNER(o),
+ modes[i].mode);
+ ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
+ ewl_colorpicker_cb_spinner_change, cp);
+ ewl_widget_show(o);
}
o = ewl_hbox_new();
@@ -321,7 +321,7 @@ ewl_colorpicker_init(Ewl_Colorpicker *cp)
ewl_range_step_set(EWL_RANGE(o), 1);
ewl_spinner_digits_set(EWL_SPINNER(o), 0);
ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ewl_colorpicker_cb_alpha_change, cp);
+ ewl_colorpicker_cb_alpha_change, cp);
ewl_widget_show(o);
cp->spinners.alpha = o;
@@ -344,7 +344,7 @@ ewl_colorpicker_has_alpha_set(Ewl_Colorpicker *cp, unsigned int alpha)
DCHECK_TYPE(cp, EWL_COLORPICKER_TYPE);
if (cp->has_alpha == !!alpha)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
cp->has_alpha = !!alpha;
@@ -416,7 +416,7 @@ ewl_colorpicker_alpha_get(Ewl_Colorpicker *cp)
*/
void
ewl_colorpicker_current_rgb_set(Ewl_Colorpicker *cp, unsigned int r,
- unsigned int g, unsigned int b)
+ unsigned int g, unsigned int b)
{
double h, s, v;
@@ -429,7 +429,7 @@ ewl_colorpicker_current_rgb_set(Ewl_Colorpicker *cp, unsigned int r,
if (b > 255) b = 255;
ewl_widget_color_set(cp->preview.current, r, g, b,
- ewl_range_value_get(EWL_RANGE(cp->spinners.alpha)));
+ ewl_range_value_get(EWL_RANGE(cp->spinners.alpha)));
ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.square), r, g, b);
ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.vertical), r, g, b);
@@ -449,7 +449,7 @@ ewl_colorpicker_current_rgb_set(Ewl_Colorpicker *cp, unsigned int r,
*/
void
ewl_colorpicker_current_rgb_get(Ewl_Colorpicker *cp, unsigned int *r,
- unsigned int *g, unsigned int *b)
+ unsigned int *g, unsigned int *b)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cp);
@@ -471,8 +471,8 @@ ewl_colorpicker_current_rgb_get(Ewl_Colorpicker *cp, unsigned int *r,
*/
void
ewl_colorpicker_previous_rgba_set(Ewl_Colorpicker *cp, unsigned int r,
- unsigned int g, unsigned int b,
- unsigned int a)
+ unsigned int g, unsigned int b,
+ unsigned int a)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cp);
@@ -499,8 +499,8 @@ ewl_colorpicker_previous_rgba_set(Ewl_Colorpicker *cp, unsigned int r,
*/
void
ewl_colorpicker_previous_rgba_get(Ewl_Colorpicker *cp, unsigned int *r,
- unsigned int *g, unsigned int *b,
- unsigned int *a)
+ unsigned int *g, unsigned int *b,
+ unsigned int *a)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cp);
@@ -559,7 +559,7 @@ ewl_colorpicker_color_mode_get(Ewl_Colorpicker *cp)
*/
void
ewl_colorpicker_cb_square_change(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Colorpicker *cp;
unsigned int r, g, b;
@@ -588,7 +588,7 @@ ewl_colorpicker_cb_square_change(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
*/
void
ewl_colorpicker_cb_vertical_change(Ewl_Widget *w __UNUSED__,
- void *ev __UNUSED__, void *data)
+ void *ev __UNUSED__, void *data)
{
Ewl_Colorpicker *cp;
unsigned int r, g, b;
@@ -610,40 +610,40 @@ ewl_colorpicker_cb_vertical_change(Ewl_Widget *w __UNUSED__,
switch (cp->mode)
{
- case EWL_COLOR_MODE_RGB_RED:
- r2 = r;
- break;
- case EWL_COLOR_MODE_RGB_GREEN:
- g2 = g;
- break;
- case EWL_COLOR_MODE_RGB_BLUE:
- b2 = b;
- break;
- case EWL_COLOR_MODE_HSV_HUE:
- h2 = h;
- set_hsv = TRUE;
- break;
- case EWL_COLOR_MODE_HSV_SATURATION:
- s2 = s;
- set_hsv = TRUE;
- break;
- case EWL_COLOR_MODE_HSV_VALUE:
- v2 = v;
- set_hsv = TRUE;
- break;
- default:
- break;
+ case EWL_COLOR_MODE_RGB_RED:
+ r2 = r;
+ break;
+ case EWL_COLOR_MODE_RGB_GREEN:
+ g2 = g;
+ break;
+ case EWL_COLOR_MODE_RGB_BLUE:
+ b2 = b;
+ break;
+ case EWL_COLOR_MODE_HSV_HUE:
+ h2 = h;
+ set_hsv = TRUE;
+ break;
+ case EWL_COLOR_MODE_HSV_SATURATION:
+ s2 = s;
+ set_hsv = TRUE;
+ break;
+ case EWL_COLOR_MODE_HSV_VALUE:
+ v2 = v;
+ set_hsv = TRUE;
+ break;
+ default:
+ break;
}
if (set_hsv == FALSE)
{
- ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.square), r2, g2, b2);
- ewl_spectrum_hsv_get(EWL_SPECTRUM(cp->picker.square), &h2, &s2, &v2);
+ ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.square), r2, g2, b2);
+ ewl_spectrum_hsv_get(EWL_SPECTRUM(cp->picker.square), &h2, &s2, &v2);
}
else
{
- ewl_spectrum_hsv_set(EWL_SPECTRUM(cp->picker.square), h2, s2, v2);
- ewl_spectrum_rgb_get(EWL_SPECTRUM(cp->picker.square), &r2, &g2, &b2);
+ ewl_spectrum_hsv_set(EWL_SPECTRUM(cp->picker.square), h2, s2, v2);
+ ewl_spectrum_rgb_get(EWL_SPECTRUM(cp->picker.square), &r2, &g2, &b2);
}
ewl_colorpicker_display_update(cp, r2, g2, b2, h2, s2, v2);
@@ -680,50 +680,50 @@ ewl_colorpicker_cb_spinner_change(Ewl_Widget *w, void *ev __UNUSED__, void *data
mode = ewl_colorpicker_spinner_mode_get(EWL_COLORPICKER_SPINNER(w));
switch ((int)mode)
{
- case EWL_COLOR_MODE_RGB_RED:
- r = ewl_range_value_get(EWL_RANGE(cp->spinners.rgb.r));
- break;
-
- case EWL_COLOR_MODE_RGB_GREEN:
- g = ewl_range_value_get(EWL_RANGE(cp->spinners.rgb.g));
- break;
-
- case EWL_COLOR_MODE_RGB_BLUE:
- b = ewl_range_value_get(EWL_RANGE(cp->spinners.rgb.b));
- break;
-
- case EWL_COLOR_MODE_HSV_HUE:
- h = ewl_range_value_get(EWL_RANGE(cp->spinners.hsv.h));
- set_hsv = TRUE;
- break;
-
- case EWL_COLOR_MODE_HSV_SATURATION:
- s = ewl_range_value_get(EWL_RANGE(cp->spinners.hsv.s)) / 100.0;
- set_hsv = TRUE;
- break;
-
- case EWL_COLOR_MODE_HSV_VALUE:
- v = ewl_range_value_get(EWL_RANGE(cp->spinners.hsv.v)) / 100.0;
- set_hsv = TRUE;
- break;
-
- default:
- break;
+ case EWL_COLOR_MODE_RGB_RED:
+ r = ewl_range_value_get(EWL_RANGE(cp->spinners.rgb.r));
+ break;
+
+ case EWL_COLOR_MODE_RGB_GREEN:
+ g = ewl_range_value_get(EWL_RANGE(cp->spinners.rgb.g));
+ break;
+
+ case EWL_COLOR_MODE_RGB_BLUE:
+ b = ewl_range_value_get(EWL_RANGE(cp->spinners.rgb.b));
+ break;
+
+ case EWL_COLOR_MODE_HSV_HUE:
+ h = ewl_range_value_get(EWL_RANGE(cp->spinners.hsv.h));
+ set_hsv = TRUE;
+ break;
+
+ case EWL_COLOR_MODE_HSV_SATURATION:
+ s = ewl_range_value_get(EWL_RANGE(cp->spinners.hsv.s)) / 100.0;
+ set_hsv = TRUE;
+ break;
+
+ case EWL_COLOR_MODE_HSV_VALUE:
+ v = ewl_range_value_get(EWL_RANGE(cp->spinners.hsv.v)) / 100.0;
+ set_hsv = TRUE;
+ break;
+
+ default:
+ break;
}
if (set_hsv)
{
- ewl_spectrum_hsv_set(EWL_SPECTRUM(cp->picker.square), h, s, v);
- ewl_spectrum_hsv_set(EWL_SPECTRUM(cp->picker.vertical), h, s, v);
+ ewl_spectrum_hsv_set(EWL_SPECTRUM(cp->picker.square), h, s, v);
+ ewl_spectrum_hsv_set(EWL_SPECTRUM(cp->picker.vertical), h, s, v);
- ewl_spectrum_rgb_get(EWL_SPECTRUM(cp->picker.square), &r, &g, &b);
+ ewl_spectrum_rgb_get(EWL_SPECTRUM(cp->picker.square), &r, &g, &b);
}
else
{
- ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.square), r, g, b);
- ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.vertical), r, g, b);
+ ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.square), r, g, b);
+ ewl_spectrum_rgb_set(EWL_SPECTRUM(cp->picker.vertical), r, g, b);
- ewl_spectrum_hsv_get(EWL_SPECTRUM(cp->picker.square), &h, &s, &v);
+ ewl_spectrum_hsv_get(EWL_SPECTRUM(cp->picker.square), &h, &s, &v);
}
ewl_colorpicker_display_update(cp, r, g, b, h, s, v);
@@ -799,7 +799,7 @@ ewl_colorpicker_cb_radio_change(Ewl_Widget *w, void *ev __UNUSED__, void *data)
*/
void
ewl_colorpicker_cb_previous_clicked(Ewl_Widget *w __UNUSED__,
- void *ev __UNUSED__, void *data)
+ void *ev __UNUSED__, void *data)
{
Ewl_Colorpicker *cp;
@@ -809,7 +809,7 @@ ewl_colorpicker_cb_previous_clicked(Ewl_Widget *w __UNUSED__,
cp = data;
ewl_colorpicker_current_rgb_set(cp, cp->previous.r, cp->previous.g,
- cp->previous.b);
+ cp->previous.b);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -824,7 +824,7 @@ ewl_colorpicker_cb_previous_clicked(Ewl_Widget *w __UNUSED__,
*/
void
ewl_colorpicker_cb_dnd_data(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
unsigned int i;
unsigned int curcolors[4];
@@ -837,30 +837,30 @@ ewl_colorpicker_cb_dnd_data(Ewl_Widget *w, void *ev,
DCHECK_TYPE(w, EWL_COLORPICKER_TYPE);
ewl_colorpicker_current_rgb_get(cp, &curcolors[0], &curcolors[1],
- &curcolors[2]);
+ &curcolors[2]);
curcolors[3] = ewl_colorpicker_alpha_get(cp);
if (event->format == 32) {
- unsigned long *colors;
- colors = event->data;
- for (i = 0; i < event->len && i < 4; i++)
- curcolors[i] = colors[i] >> ((sizeof(long) * 8) - 8);
+ unsigned long *colors;
+ colors = event->data;
+ for (i = 0; i < event->len && i < 4; i++)
+ curcolors[i] = colors[i] >> ((sizeof(long) * 8) - 8);
}
else if (event->format == 16) {
- unsigned short *colors;
- colors = event->data;
- for (i = 0; i < event->len && i < 4; i++)
- curcolors[i] = colors[i] >> 8;
+ unsigned short *colors;
+ colors = event->data;
+ for (i = 0; i < event->len && i < 4; i++)
+ curcolors[i] = colors[i] >> 8;
}
else {
- unsigned char *colors;
- colors = event->data;
- for (i = 0; i < event->len && i < 4; i++)
- curcolors[i] = colors[i];
+ unsigned char *colors;
+ colors = event->data;
+ for (i = 0; i < event->len && i < 4; i++)
+ curcolors[i] = colors[i];
}
ewl_colorpicker_current_rgb_set(cp, curcolors[0], curcolors[1],
- curcolors[2]);
+ curcolors[2]);
ewl_colorpicker_alpha_set(cp, curcolors[3]);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -868,14 +868,14 @@ ewl_colorpicker_cb_dnd_data(Ewl_Widget *w, void *ev,
static void
ewl_colorpicker_display_update(Ewl_Colorpicker *cp, unsigned int r, unsigned int g,
- unsigned int b, double h, double s, double v)
+ unsigned int b, double h, double s, double v)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(cp);
DCHECK_TYPE(cp, EWL_COLORPICKER_TYPE);
if (cp->updating)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
cp->updating = TRUE;
@@ -888,7 +888,7 @@ ewl_colorpicker_display_update(Ewl_Colorpicker *cp, unsigned int r, unsigned int
ewl_range_value_set(EWL_RANGE(cp->spinners.hsv.v), v * 100);
ewl_widget_color_set(cp->preview.current, r, g, b,
- ewl_range_value_get(EWL_RANGE(cp->spinners.alpha)));
+ ewl_range_value_get(EWL_RANGE(cp->spinners.alpha)));
ewl_callback_call(EWL_WIDGET(cp), EWL_CALLBACK_VALUE_CHANGED);
cp->updating = FALSE;
@@ -905,12 +905,12 @@ ewl_colorpicker_spinner_new(void)
w = NEW(Ewl_Colorpicker_Spinner, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_colorpicker_spinner_init(EWL_COLORPICKER_SPINNER(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -922,7 +922,7 @@ ewl_colorpicker_spinner_init(Ewl_Colorpicker_Spinner *sp)
DENTER_FUNCTION(DLEVEL_STABLE);
if (!ewl_spinner_init(EWL_SPINNER(sp)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(sp), EWL_COLORPICKER_SPINNER_TYPE);
sp->mode = EWL_COLOR_MODE_RGB_RED;
@@ -932,7 +932,7 @@ ewl_colorpicker_spinner_init(Ewl_Colorpicker_Spinner *sp)
static void
ewl_colorpicker_spinner_mode_set(Ewl_Colorpicker_Spinner *sp,
- Ewl_Color_Mode mode)
+ Ewl_Color_Mode mode)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(sp);
@@ -949,7 +949,7 @@ ewl_colorpicker_spinner_mode_get(Ewl_Colorpicker_Spinner *sp)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(sp, EWL_COLOR_MODE_RGB_RED);
DCHECK_TYPE_RET(sp, EWL_COLORPICKER_SPINNER_TYPE,
- EWL_COLOR_MODE_RGB_RED);
+ EWL_COLOR_MODE_RGB_RED);
DRETURN_INT(sp->mode, DLEVEL_STABLE);
}
@@ -963,12 +963,12 @@ ewl_colorpicker_radiobutton_new(void)
w = NEW(Ewl_Colorpicker_Radiobutton, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_colorpicker_radiobutton_init(EWL_COLORPICKER_RADIOBUTTON(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -980,7 +980,7 @@ ewl_colorpicker_radiobutton_init(Ewl_Colorpicker_Radiobutton *rb)
DENTER_FUNCTION(DLEVEL_STABLE);
if (!ewl_radiobutton_init(EWL_RADIOBUTTON(rb)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(rb), EWL_COLORPICKER_RADIOBUTTON_TYPE);
rb->mode = EWL_COLOR_MODE_RGB_RED;
@@ -990,7 +990,7 @@ ewl_colorpicker_radiobutton_init(Ewl_Colorpicker_Radiobutton *rb)
static void
ewl_colorpicker_radiobutton_mode_set(Ewl_Colorpicker_Radiobutton *rb,
- Ewl_Color_Mode mode)
+ Ewl_Color_Mode mode)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(rb);
@@ -1007,7 +1007,7 @@ ewl_colorpicker_radiobutton_mode_get(Ewl_Colorpicker_Radiobutton *rb)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(rb, EWL_COLOR_MODE_RGB_RED);
DCHECK_TYPE_RET(rb, EWL_COLORPICKER_RADIOBUTTON_TYPE,
- EWL_COLOR_MODE_RGB_RED);
+ EWL_COLOR_MODE_RGB_RED);
DRETURN_INT(rb->mode, DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_colorpicker.h b/src/lib/ewl_colorpicker.h
index 8ffe784..7f25e58 100644
--- a/src/lib/ewl_colorpicker.h
+++ b/src/lib/ewl_colorpicker.h
@@ -43,69 +43,69 @@ typedef struct Ewl_Colorpicker Ewl_Colorpicker;
*/
struct Ewl_Colorpicker
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
struct
{
- Ewl_Widget *square; /**< The square picker box */
- Ewl_Widget *vertical; /**< The vertical picker box */
- } picker; /**< This holds the two picker boxes */
+ Ewl_Widget *square; /**< The square picker box */
+ Ewl_Widget *vertical; /**< The vertical picker box */
+ } picker; /**< This holds the two picker boxes */
struct
{
- Ewl_Widget *current; /**< The current colour preview */
- Ewl_Widget *previous; /**< The previous colour preview */
- } preview; /**< The preview boxes */
+ Ewl_Widget *current; /**< The current colour preview */
+ Ewl_Widget *previous; /**< The previous colour preview */
+ } preview; /**< The preview boxes */
struct
{
- struct
- {
- Ewl_Widget *r; /**< The red value */
- Ewl_Widget *g; /**< The green value */
- Ewl_Widget *b; /**< The blue value */
- } rgb; /**< The pickers RGB values */
-
- struct
- {
- Ewl_Widget *h; /**< The current hue */
- Ewl_Widget *s; /**< The current saturation */
- Ewl_Widget *v; /**< The current value */
- } hsv; /**< The pickers HSV values */
-
- Ewl_Widget *alpha; /**< The alpha value */
- } spinners; /**< The spinners to hold the different values */
-
- Ewl_Widget *alpha_box; /**< Box holding alpha information */
-
- Ewl_Color_Set previous; /**< The previous color */
- Ewl_Color_Mode mode; /**< The current mode */
-
- unsigned int has_alpha:1; /**< Does the picker deal with alpha values */
- unsigned int updating:1; /**< Are we currently updating the widget */
+ struct
+ {
+ Ewl_Widget *r; /**< The red value */
+ Ewl_Widget *g; /**< The green value */
+ Ewl_Widget *b; /**< The blue value */
+ } rgb; /**< The pickers RGB values */
+
+ struct
+ {
+ Ewl_Widget *h; /**< The current hue */
+ Ewl_Widget *s; /**< The current saturation */
+ Ewl_Widget *v; /**< The current value */
+ } hsv; /**< The pickers HSV values */
+
+ Ewl_Widget *alpha; /**< The alpha value */
+ } spinners; /**< The spinners to hold the different values */
+
+ Ewl_Widget *alpha_box; /**< Box holding alpha information */
+
+ Ewl_Color_Set previous; /**< The previous color */
+ Ewl_Color_Mode mode; /**< The current mode */
+
+ unsigned int has_alpha:1; /**< Does the picker deal with alpha values */
+ unsigned int updating:1; /**< Are we currently updating the widget */
};
Ewl_Widget *ewl_colorpicker_new(void);
-int ewl_colorpicker_init(Ewl_Colorpicker *cp);
+int ewl_colorpicker_init(Ewl_Colorpicker *cp);
-void ewl_colorpicker_has_alpha_set(Ewl_Colorpicker *cp, unsigned int alpha);
+void ewl_colorpicker_has_alpha_set(Ewl_Colorpicker *cp, unsigned int alpha);
unsigned int ewl_colorpicker_has_alpha_get(Ewl_Colorpicker *cp);
-void ewl_colorpicker_alpha_set(Ewl_Colorpicker *cp, unsigned int alpha);
+void ewl_colorpicker_alpha_set(Ewl_Colorpicker *cp, unsigned int alpha);
unsigned int ewl_colorpicker_alpha_get(Ewl_Colorpicker *cp);
-void ewl_colorpicker_current_rgb_set(Ewl_Colorpicker *cp, unsigned int r,
- unsigned int g, unsigned int b);
-void ewl_colorpicker_current_rgb_get(Ewl_Colorpicker *cp, unsigned int *r,
- unsigned int *g, unsigned int *b);
+void ewl_colorpicker_current_rgb_set(Ewl_Colorpicker *cp, unsigned int r,
+ unsigned int g, unsigned int b);
+void ewl_colorpicker_current_rgb_get(Ewl_Colorpicker *cp, unsigned int *r,
+ unsigned int *g, unsigned int *b);
-void ewl_colorpicker_previous_rgba_set(Ewl_Colorpicker *cp, unsigned int r,
- unsigned int g, unsigned int b,
- unsigned int a);
-void ewl_colorpicker_previous_rgba_get(Ewl_Colorpicker *cp, unsigned int *r,
- unsigned int *g, unsigned int *b,
- unsigned int *a);
+void ewl_colorpicker_previous_rgba_set(Ewl_Colorpicker *cp, unsigned int r,
+ unsigned int g, unsigned int b,
+ unsigned int a);
+void ewl_colorpicker_previous_rgba_get(Ewl_Colorpicker *cp, unsigned int *r,
+ unsigned int *g, unsigned int *b,
+ unsigned int *a);
-void ewl_colorpicker_color_mode_set(Ewl_Colorpicker *cp, Ewl_Color_Mode type);
+void ewl_colorpicker_color_mode_set(Ewl_Colorpicker *cp, Ewl_Color_Mode type);
Ewl_Color_Mode ewl_colorpicker_color_mode_get(Ewl_Colorpicker *cp);
/*
diff --git a/src/lib/ewl_combo.c b/src/lib/ewl_combo.c
index bbbfeb9..7b8186b 100644
--- a/src/lib/ewl_combo.c
+++ b/src/lib/ewl_combo.c
@@ -12,10 +12,10 @@
static void ewl_combo_cb_selected_change(Ewl_MVC *mvc);
Ewl_Widget *ewl_combo_submenu_new(Ewl_Combo *c, const Ewl_Model *model,
- const Ewl_View *view, void *mvc_data);
+ const Ewl_View *view, void *mvc_data);
static void ewl_combo_popup_fill(Ewl_Combo *combo, Ewl_Container *c,
- const Ewl_Model *model, const Ewl_View *view,
- void *mvc_data);
+ const Ewl_Model *model, const Ewl_View *view,
+ void *mvc_data);
/**
* @return Returns a pointer to a new combo on success, NULL on failure.
@@ -30,12 +30,12 @@ ewl_combo_new(void)
combo = NEW(Ewl_Combo, 1);
if (!combo)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_combo_init(combo))
{
- ewl_widget_destroy(EWL_WIDGET(combo));
- combo = NULL;
+ ewl_widget_destroy(EWL_WIDGET(combo));
+ combo = NULL;
}
DRETURN_PTR(EWL_WIDGET(combo), DLEVEL_STABLE);
@@ -53,21 +53,21 @@ ewl_combo_init(Ewl_Combo *combo)
DCHECK_PARAM_PTR_RET(combo, FALSE);
if (!ewl_mvc_init(EWL_MVC(combo)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(combo), EWL_COMBO_TYPE);
ewl_widget_appearance_set(EWL_WIDGET(combo), EWL_COMBO_TYPE);
ewl_box_orientation_set(EWL_BOX(combo), EWL_ORIENTATION_HORIZONTAL);
ewl_mvc_selected_change_cb_set(EWL_MVC(combo),
- ewl_combo_cb_selected_change);
+ ewl_combo_cb_selected_change);
combo->button = ewl_button_new();
ewl_container_child_append(EWL_CONTAINER(combo), combo->button);
ewl_widget_internal_set(combo->button, TRUE);
ewl_object_alignment_set(EWL_OBJECT(combo->button),
- EWL_FLAG_ALIGN_RIGHT);
+ EWL_FLAG_ALIGN_RIGHT);
ewl_callback_append(combo->button, EWL_CALLBACK_CLICKED,
- ewl_combo_cb_decrement_clicked, combo);
+ ewl_combo_cb_decrement_clicked, combo);
ewl_widget_show(combo->button);
/*
@@ -76,19 +76,19 @@ ewl_combo_init(Ewl_Combo *combo)
combo->popup = ewl_context_menu_new();
ewl_popup_follow_set(EWL_POPUP(combo->popup), EWL_WIDGET(combo));
ewl_popup_type_set(EWL_POPUP(combo->popup),
- EWL_POPUP_TYPE_MENU_VERTICAL);
+ EWL_POPUP_TYPE_MENU_VERTICAL);
ewl_popup_fit_to_follow_set(EWL_POPUP(combo->popup), TRUE);
ewl_window_keyboard_grab_set(EWL_WINDOW(combo->popup), TRUE);
ewl_window_pointer_grab_set(EWL_WINDOW(combo->popup), TRUE);
ewl_widget_appearance_set(combo->popup, EWL_COMBO_TYPE
- "/"EWL_POPUP_TYPE);
+ "/"EWL_POPUP_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(combo->popup),
- EWL_FLAG_FILL_HFILL
- | EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_HFILL
+ | EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(combo->popup),
- EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
+ EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
ewl_callback_append(combo->popup, EWL_CALLBACK_HIDE,
- ewl_combo_cb_popup_hide, combo);
+ ewl_combo_cb_popup_hide, combo);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -111,7 +111,7 @@ ewl_combo_editable_set(Ewl_Combo *combo, unsigned int editable)
DCHECK_TYPE(combo, EWL_COMBO_TYPE);
if (combo->editable == !!editable)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
combo->editable = !!editable;
@@ -153,34 +153,34 @@ ewl_combo_scrollable_set(Ewl_Combo *combo, unsigned int scrollable)
DCHECK_TYPE(combo, EWL_COMBO_TYPE);
if (combo->scrollable == !!scrollable)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
combo->scrollable = !!scrollable;
if (scrollable) {
- Ewl_Widget *scroll;
- int max_h;
-
- max_h = ewl_theme_data_int_get(EWL_WIDGET(combo),
- "/combo/popup/height");
- /* set it to sane values if it isn't defined in the theme */
- if (max_h <= 0)
- max_h = 100;
-
- /* setup the new scrollpane container */
- scroll = ewl_scrollpane_new();
- ewl_object_fill_policy_set(EWL_OBJECT(scroll),
- EWL_FLAG_FILL_HFILL
- | EWL_FLAG_FILL_SHRINK);
- ewl_object_maximum_h_set(EWL_OBJECT(scroll), max_h);
- ewl_widget_show(scroll);
-
- ewl_context_menu_container_set(EWL_CONTEXT_MENU(combo->popup),
- EWL_CONTAINER(scroll));
+ Ewl_Widget *scroll;
+ int max_h;
+
+ max_h = ewl_theme_data_int_get(EWL_WIDGET(combo),
+ "/combo/popup/height");
+ /* set it to sane values if it isn't defined in the theme */
+ if (max_h <= 0)
+ max_h = 100;
+
+ /* setup the new scrollpane container */
+ scroll = ewl_scrollpane_new();
+ ewl_object_fill_policy_set(EWL_OBJECT(scroll),
+ EWL_FLAG_FILL_HFILL
+ | EWL_FLAG_FILL_SHRINK);
+ ewl_object_maximum_h_set(EWL_OBJECT(scroll), max_h);
+ ewl_widget_show(scroll);
+
+ ewl_context_menu_container_set(EWL_CONTEXT_MENU(combo->popup),
+ EWL_CONTAINER(scroll));
}
else
- ewl_context_menu_container_set(EWL_CONTEXT_MENU(combo->popup),
- NULL);
+ ewl_context_menu_container_set(EWL_CONTEXT_MENU(combo->popup),
+ NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -230,7 +230,7 @@ ewl_combo_popup_container_set(Ewl_Combo *combo, Ewl_Container *c)
*/
void
ewl_combo_cb_decrement_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Combo *combo;
const Ewl_Model *model;
@@ -249,23 +249,23 @@ ewl_combo_cb_decrement_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
/* nothing to do if we have no model or view
* Note that mvc_data == NULL is legal */
if (!model || !view)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_widget_show(combo->popup);
ewl_window_raise(EWL_WINDOW(combo->popup));
ewl_widget_focus_send(EWL_WIDGET(combo->popup));
ewl_widget_state_set(combo->button, "expanded",
- EWL_STATE_PERSISTENT);
+ EWL_STATE_PERSISTENT);
ewl_widget_state_set(EWL_WIDGET(combo), "expanded",
- EWL_STATE_PERSISTENT);
+ EWL_STATE_PERSISTENT);
if (!ewl_mvc_dirty_get(EWL_MVC(combo)))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_container_reset(EWL_CONTAINER(combo->popup));
ewl_combo_popup_fill(combo, EWL_CONTAINER(combo->popup),
- model, view, mvc_data);
+ model, view, mvc_data);
ewl_mvc_dirty_set(EWL_MVC(combo), FALSE);
@@ -282,7 +282,7 @@ ewl_combo_cb_decrement_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
*/
void
ewl_combo_cb_popup_hide(Ewl_Widget *w __UNUSED__,
- void *ev __UNUSED__, void *data)
+ void *ev __UNUSED__, void *data)
{
Ewl_Combo *combo;
@@ -293,7 +293,7 @@ ewl_combo_cb_popup_hide(Ewl_Widget *w __UNUSED__,
combo = EWL_COMBO(data);
ewl_widget_state_set(combo->button, "collapsed", EWL_STATE_PERSISTENT);
ewl_widget_state_set(EWL_WIDGET(combo), "collapsed",
- EWL_STATE_PERSISTENT);
+ EWL_STATE_PERSISTENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -314,61 +314,61 @@ ewl_combo_cb_selected_change(Ewl_MVC *mvc)
view = ewl_mvc_view_get(mvc);
if (!ewl_mvc_data_get(mvc))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* if we haven't already build a cell for the header, build it
* now
*/
if (!combo->header) {
- combo->header = ewl_cell_new();
- ewl_container_child_prepend(EWL_CONTAINER(combo),
- combo->header);
- ewl_object_fill_policy_set(EWL_OBJECT(combo->header),
- EWL_FLAG_FILL_FILL);
- ewl_widget_show(combo->header);
+ combo->header = ewl_cell_new();
+ ewl_container_child_prepend(EWL_CONTAINER(combo),
+ combo->header);
+ ewl_object_fill_policy_set(EWL_OBJECT(combo->header),
+ EWL_FLAG_FILL_FILL);
+ ewl_widget_show(combo->header);
}
else
- ewl_container_reset(EWL_CONTAINER(combo->header));
+ ewl_container_reset(EWL_CONTAINER(combo->header));
if (ewl_mvc_selected_count_get(mvc))
{
- Ewl_Selection_Idx *idx;
- const Ewl_Model *model;
- void *mvc_data;
-
- idx = ewl_mvc_selected_get(mvc);
- model = idx->sel.model;
- mvc_data = idx->sel.data;
-
- if (combo->editable)
- {
- /* Give the row selected in the column parameter,
- * ewl_filepicker needs this to display proper filter
- */
-
- item = view->header_fetch(ewl_mvc_data_get(mvc),
- idx->row);
- }
-
- else
- {
-
-
- item = view->fetch(model->fetch(mvc_data, idx->row, 0),
- idx->row, 0);
- }
-
- FREE(idx);
+ Ewl_Selection_Idx *idx;
+ const Ewl_Model *model;
+ void *mvc_data;
+
+ idx = ewl_mvc_selected_get(mvc);
+ model = idx->sel.model;
+ mvc_data = idx->sel.data;
+
+ if (combo->editable)
+ {
+ /* Give the row selected in the column parameter,
+ * ewl_filepicker needs this to display proper filter
+ */
+
+ item = view->header_fetch(ewl_mvc_data_get(mvc),
+ idx->row);
+ }
+
+ else
+ {
+
+
+ item = view->fetch(model->fetch(mvc_data, idx->row, 0),
+ idx->row, 0);
+ }
+
+ FREE(idx);
}
else if (view && view->header_fetch)
- item = view->header_fetch(ewl_mvc_data_get(mvc), 0);
+ item = view->header_fetch(ewl_mvc_data_get(mvc), 0);
if (item)
{
- ewl_container_child_prepend(EWL_CONTAINER(combo->header), item);
- ewl_widget_show(item);
+ ewl_container_child_prepend(EWL_CONTAINER(combo->header), item);
+ ewl_widget_show(item);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -384,7 +384,7 @@ ewl_combo_cb_selected_change(Ewl_MVC *mvc)
*/
Ewl_Widget *
ewl_combo_submenu_new(Ewl_Combo *combo, const Ewl_Model *model,
- const Ewl_View *view, void *mvc_data)
+ const Ewl_View *view, void *mvc_data)
{
Ewl_Widget *menu;
@@ -394,21 +394,21 @@ ewl_combo_submenu_new(Ewl_Combo *combo, const Ewl_Model *model,
menu = ewl_menu_new();
ewl_widget_appearance_set(EWL_MENU(menu)->popup, EWL_COMBO_TYPE
- "/"EWL_POPUP_TYPE);
+ "/"EWL_POPUP_TYPE);
ewl_widget_appearance_set(menu, EWL_COMBO_TYPE"_menu");
/* nothing to do if we have no model/view or data */
if (!model || !view)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_combo_popup_fill(combo, EWL_CONTAINER(menu),
- model, view, mvc_data);
+ model, view, mvc_data);
ewl_button_label_set(EWL_BUTTON(menu), NULL);
ewl_button_image_set(EWL_BUTTON(menu), NULL, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(menu), EWL_FLAG_FILL_HFILL);
ewl_container_redirect_set(EWL_CONTAINER(menu),
- EWL_CONTAINER(EWL_BUTTON(menu)->body));
+ EWL_CONTAINER(EWL_BUTTON(menu)->body));
DRETURN_PTR(menu, DLEVEL_STABLE);
}
@@ -424,7 +424,7 @@ ewl_combo_submenu_new(Ewl_Combo *combo, const Ewl_Model *model,
*/
static void
ewl_combo_popup_fill(Ewl_Combo *combo, Ewl_Container *c, const Ewl_Model *model,
- const Ewl_View *view, void *mvc_data)
+ const Ewl_View *view, void *mvc_data)
{
unsigned int count, i;
@@ -435,55 +435,55 @@ ewl_combo_popup_fill(Ewl_Combo *combo, Ewl_Container *c, const Ewl_Model *model,
DCHECK_TYPE(c, EWL_CONTAINER_TYPE);
if (!model->count)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
count = model->count(mvc_data);
for (i = 0; i < count; i++)
{
- Ewl_Widget *o, *item;
-
- if (model->expansion.is && model->expansion.is(mvc_data, i))
- {
- const Ewl_Model *em;
- const Ewl_View *ev;
- void *ed;
-
- /* if there shouldn't be a model for the expansion
- * we us the current model */
- if (!model->expansion.model
- || !(em = model->expansion.model(mvc_data, i)))
- em = model;
- /* if there shouldm't be a view for the expansion
- * we us the current view */
- if (!view->expansion
- || !(ev = view->expansion(mvc_data,i)))
- ev = view;
-
- /* if there is no data for the expansion use the
- * current mvc data */
- if (model->expansion.data)
- ed = model->expansion.data(mvc_data, i);
- else
- ed = mvc_data;
-
- o = ewl_combo_submenu_new(combo, em, ev, ed);
- }
- else
- {
- o = ewl_combo_cell_new();
- ewl_combo_cell_combo_set(EWL_COMBO_CELL(o), combo);
- ewl_combo_cell_model_set(EWL_COMBO_CELL(o), model);
- ewl_combo_cell_data_set(EWL_COMBO_CELL(o), mvc_data);
- }
- ewl_container_child_append(c, o);
- ewl_widget_show(o);
-
- if (view->fetch && model->fetch)
- {
- item = view->fetch(model->fetch(mvc_data, i, 0), i, 0);
- ewl_container_child_append(EWL_CONTAINER(o), item);
- ewl_widget_show(item);
- }
+ Ewl_Widget *o, *item;
+
+ if (model->expansion.is && model->expansion.is(mvc_data, i))
+ {
+ const Ewl_Model *em;
+ const Ewl_View *ev;
+ void *ed;
+
+ /* if there shouldn't be a model for the expansion
+ * we us the current model */
+ if (!model->expansion.model
+ || !(em = model->expansion.model(mvc_data, i)))
+ em = model;
+ /* if there shouldm't be a view for the expansion
+ * we us the current view */
+ if (!view->expansion
+ || !(ev = view->expansion(mvc_data,i)))
+ ev = view;
+
+ /* if there is no data for the expansion use the
+ * current mvc data */
+ if (model->expansion.data)
+ ed = model->expansion.data(mvc_data, i);
+ else
+ ed = mvc_data;
+
+ o = ewl_combo_submenu_new(combo, em, ev, ed);
+ }
+ else
+ {
+ o = ewl_combo_cell_new();
+ ewl_combo_cell_combo_set(EWL_COMBO_CELL(o), combo);
+ ewl_combo_cell_model_set(EWL_COMBO_CELL(o), model);
+ ewl_combo_cell_data_set(EWL_COMBO_CELL(o), mvc_data);
+ }
+ ewl_container_child_append(c, o);
+ ewl_widget_show(o);
+
+ if (view->fetch && model->fetch)
+ {
+ item = view->fetch(model->fetch(mvc_data, i, 0), i, 0);
+ ewl_container_child_append(EWL_CONTAINER(o), item);
+ ewl_widget_show(item);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -501,12 +501,12 @@ ewl_combo_cell_new(void)
cell = NEW(Ewl_Combo_Cell, 1);
if (!cell)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_combo_cell_init(cell))
{
- ewl_widget_destroy(EWL_WIDGET(cell));
- cell = NULL;
+ ewl_widget_destroy(EWL_WIDGET(cell));
+ cell = NULL;
}
DRETURN_PTR(EWL_WIDGET(cell), DLEVEL_STABLE);
@@ -524,13 +524,13 @@ ewl_combo_cell_init(Ewl_Combo_Cell *cell)
DCHECK_PARAM_PTR_RET(cell, FALSE);
if (!ewl_cell_init(EWL_CELL(cell)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(cell), EWL_COMBO_CELL_TYPE);
ewl_widget_appearance_set(EWL_WIDGET(cell), EWL_COMBO_CELL_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(cell), EWL_FLAG_FILL_HFILL);
ewl_callback_append(EWL_WIDGET(cell), EWL_CALLBACK_CLICKED,
- ewl_combo_cell_cb_clicked, NULL);
+ ewl_combo_cell_cb_clicked, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -640,7 +640,7 @@ ewl_combo_cell_data_get(Ewl_Combo_Cell *cell)
*/
void
ewl_combo_cell_cb_clicked(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Combo *combo;
const Ewl_Model *model;
diff --git a/src/lib/ewl_combo.h b/src/lib/ewl_combo.h
index f9eccda..68ea9d0 100644
--- a/src/lib/ewl_combo.h
+++ b/src/lib/ewl_combo.h
@@ -54,25 +54,25 @@ struct Ewl_Combo
{
Ewl_MVC mvc; /**< Inherit from Ewl_MVC */
- Ewl_Widget *popup; /**< Use a popup to display with. */
- Ewl_Widget *button; /**< expand/contract button */
- Ewl_Widget *header; /**< The combo header widget */
+ Ewl_Widget *popup; /**< Use a popup to display with. */
+ Ewl_Widget *button; /**< expand/contract button */
+ Ewl_Widget *header; /**< The combo header widget */
unsigned char editable:1; /**< Is the combo editable */
unsigned char scrollable:1; /**< Is the combo scrollable */
};
Ewl_Widget *ewl_combo_new(void);
-int ewl_combo_init(Ewl_Combo *combo);
+int ewl_combo_init(Ewl_Combo *combo);
-void ewl_combo_editable_set(Ewl_Combo *combo,
- unsigned int editable);
+void ewl_combo_editable_set(Ewl_Combo *combo,
+ unsigned int editable);
unsigned int ewl_combo_editable_get(Ewl_Combo *combo);
-void ewl_combo_scrollable_set(Ewl_Combo *combo,
- unsigned int scrollable);
+void ewl_combo_scrollable_set(Ewl_Combo *combo,
+ unsigned int scrollable);
unsigned int ewl_combo_scrollable_get(Ewl_Combo *combo);
-void ewl_combo_popup_container_set(Ewl_Combo *combo,
- Ewl_Container *c);
+void ewl_combo_popup_container_set(Ewl_Combo *combo,
+ Ewl_Container *c);
/*
@@ -113,25 +113,25 @@ typedef struct Ewl_Combo_Cell Ewl_Combo_Cell;
*/
struct Ewl_Combo_Cell
{
- Ewl_Cell cell; /**< Inherit from the cell */
- Ewl_Combo *combo; /**< The parent combo */
- const Ewl_Model *model; /**< The model that was used to build the
- content of the cell */
- void *mvc_data; /**< The mvc data that was used to build the
- content of the cell */
+ Ewl_Cell cell; /**< Inherit from the cell */
+ Ewl_Combo *combo; /**< The parent combo */
+ const Ewl_Model *model; /**< The model that was used to build the
+ content of the cell */
+ void *mvc_data; /**< The mvc data that was used to build the
+ content of the cell */
};
Ewl_Widget *ewl_combo_cell_new(void);
-int ewl_combo_cell_init(Ewl_Combo_Cell *c);
-void ewl_combo_cell_combo_set(Ewl_Combo_Cell *c, Ewl_Combo *combo);
+int ewl_combo_cell_init(Ewl_Combo_Cell *c);
+void ewl_combo_cell_combo_set(Ewl_Combo_Cell *c, Ewl_Combo *combo);
Ewl_Combo *ewl_combo_cell_combo_get(Ewl_Combo_Cell *c);
-void ewl_combo_cell_model_set(Ewl_Combo_Cell *c,
- const Ewl_Model *model);
+void ewl_combo_cell_model_set(Ewl_Combo_Cell *c,
+ const Ewl_Model *model);
const Ewl_Model *ewl_combo_cell_model_get(Ewl_Combo_Cell *c);
-void ewl_combo_cell_data_set(Ewl_Combo_Cell *c, void *mvc_data);
-void *ewl_combo_cell_data_get(Ewl_Combo_Cell *c);
+void ewl_combo_cell_data_set(Ewl_Combo_Cell *c, void *mvc_data);
+void *ewl_combo_cell_data_get(Ewl_Combo_Cell *c);
/**
* @}
diff --git a/src/lib/ewl_config.c b/src/lib/ewl_config.c
index 1d2f34e..6e731bf 100644
--- a/src/lib/ewl_config.c
+++ b/src/lib/ewl_config.c
@@ -34,7 +34,7 @@ static int ewl_config_file_write_lock(int fd, long size);
static int ewl_config_file_unlock(int fd, long size);
static int ewl_config_load(Ewl_Config *cfg);
static int ewl_config_file_load(Ewl_Config *cfg, unsigned int is_system,
- const char *file);
+ const char *file);
static void ewl_config_parse(Ewl_Config *cfg, Ecore_Hash *hash, char *data);
static Ecore_Hash *ewl_config_create_hash(void);
@@ -43,7 +43,7 @@ static void ewl_config_create_system_hash(Ewl_Config *cfg);
static void ewl_config_create_user_hash(Ewl_Config *cfg);
static Ecore_Hash *ewl_config_set_hash_get(Ewl_Config *cfg,
- Ewl_State_Type state);
+ Ewl_State_Type state);
static const char *ewl_config_get(Ewl_Config *cfg, const char *key);
static const char * ewl_config_env_get(Ewl_Config *cfg, const char *key);
static char *ewl_config_trim(char *v);
@@ -51,7 +51,7 @@ static char *ewl_config_file_name_user_get(Ewl_Config *cfg);
static char *ewl_config_file_name_system_get(Ewl_Config *cfg);
static char *ewl_config_file_name_clean(Ewl_Config *cfg);
static int ewl_config_save(Ewl_Config *cfg, Ecore_Hash *hash,
- const char *file);
+ const char *file);
/**
* @internal
@@ -65,12 +65,12 @@ ewl_config_init(void)
ewl_config = ewl_config_new("ewl");
if (!ewl_config)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
if ((!ewl_config_string_get(ewl_config, EWL_CONFIG_THEME_NAME))
- || (!ewl_config_string_get(ewl_config,
- EWL_CONFIG_ENGINE_NAME)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ || (!ewl_config_string_get(ewl_config,
+ EWL_CONFIG_ENGINE_NAME)))
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -102,22 +102,22 @@ ewl_config_cache_init(void)
DENTER_FUNCTION(DLEVEL_STABLE);
ewl_config_cache.enable = ewl_config_int_get(ewl_config,
- EWL_CONFIG_DEBUG_ENABLE);
+ EWL_CONFIG_DEBUG_ENABLE);
ewl_config_cache.segv = ewl_config_int_get(ewl_config,
- EWL_CONFIG_DEBUG_SEGV);
+ EWL_CONFIG_DEBUG_SEGV);
ewl_config_cache.backtrace = ewl_config_int_get(ewl_config,
- EWL_CONFIG_DEBUG_BACKTRACE);
+ EWL_CONFIG_DEBUG_BACKTRACE);
ewl_config_cache.evas_render = ewl_config_int_get(ewl_config,
- EWL_CONFIG_DEBUG_EVAS_RENDER);
+ EWL_CONFIG_DEBUG_EVAS_RENDER);
ewl_config_cache.gc_reap = ewl_config_int_get(ewl_config,
- EWL_CONFIG_DEBUG_GC_REAP);
+ EWL_CONFIG_DEBUG_GC_REAP);
ewl_config_cache.level = ewl_config_int_get(ewl_config,
- EWL_CONFIG_DEBUG_LEVEL);
+ EWL_CONFIG_DEBUG_LEVEL);
ewl_config_cache.print_signals = ewl_config_int_get(ewl_config,
- EWL_CONFIG_THEME_PRINT_SIGNALS);
+ EWL_CONFIG_THEME_PRINT_SIGNALS);
ewl_config_cache.print_keys = ewl_config_int_get(ewl_config,
- EWL_CONFIG_THEME_PRINT_KEYS);
+ EWL_CONFIG_THEME_PRINT_KEYS);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -178,13 +178,13 @@ ewl_config_destroy(Ewl_Config *cfg)
*/
void
ewl_config_string_set(Ewl_Config *cfg, const char *k, const char *v,
- Ewl_State_Type state)
+ Ewl_State_Type state)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(k);
ecore_hash_set(ewl_config_set_hash_get(cfg, state),
- strdup(k), strdup(v));
+ strdup(k), strdup(v));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -217,7 +217,7 @@ ewl_config_string_get(Ewl_Config *cfg, const char *k)
*/
void
ewl_config_int_set(Ewl_Config *cfg, const char *k, int v,
- Ewl_State_Type state)
+ Ewl_State_Type state)
{
char buf[128];
@@ -226,7 +226,7 @@ ewl_config_int_set(Ewl_Config *cfg, const char *k, int v,
snprintf(buf, sizeof(buf), "%d", v);
ecore_hash_set(ewl_config_set_hash_get(cfg, state),
- strdup(k), strdup(buf));
+ strdup(k), strdup(buf));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -265,7 +265,7 @@ ewl_config_int_get(Ewl_Config *cfg, const char *k)
*/
void
ewl_config_float_set(Ewl_Config *cfg, const char *k, float v,
- Ewl_State_Type state)
+ Ewl_State_Type state)
{
char buf[128];
@@ -274,7 +274,7 @@ ewl_config_float_set(Ewl_Config *cfg, const char *k, float v,
snprintf(buf, sizeof(buf), "%f", v);
ecore_hash_set(ewl_config_set_hash_get(cfg, state),
- strdup(k), strdup(buf));
+ strdup(k), strdup(buf));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -316,8 +316,8 @@ ewl_config_float_get(Ewl_Config *cfg, const char *k)
*/
void
ewl_config_color_set(Ewl_Config *cfg, const char *k, int r, int g,
- int b, int a,
- Ewl_State_Type state)
+ int b, int a,
+ Ewl_State_Type state)
{
char buf[128];
@@ -326,7 +326,7 @@ ewl_config_color_set(Ewl_Config *cfg, const char *k, int r, int g,
snprintf(buf, sizeof(buf), "%i %i %i %i", r, g, b, a);
ecore_hash_set(ewl_config_set_hash_get(cfg, state),
- strdup(k), strdup(buf));
+ strdup(k), strdup(buf));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -343,7 +343,7 @@ ewl_config_color_set(Ewl_Config *cfg, const char *k, int r, int g,
*/
void
ewl_config_color_get(Ewl_Config *cfg, const char *k, int *r, int *g,
- int *b, int *a)
+ int *b, int *a)
{
const char *val;
int tmp_r = 0, tmp_g = 0, tmp_b = 0, tmp_a = 0;
@@ -396,7 +396,7 @@ ewl_config_instance_key_remove(Ewl_Config *cfg, const char *k)
DCHECK_PARAM_PTR(k);
if (cfg->data.instance && (ecore_hash_get(cfg->data.instance, k)))
- ecore_hash_remove(cfg->data.instance, k);
+ ecore_hash_remove(cfg->data.instance, k);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -415,7 +415,7 @@ ewl_config_system_key_remove(Ewl_Config *cfg, const char *k)
DCHECK_PARAM_PTR(k);
if (cfg->data.system && (ecore_hash_get(cfg->data.system, k)))
- ecore_hash_remove(cfg->data.system, k);
+ ecore_hash_remove(cfg->data.system, k);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -434,7 +434,7 @@ ewl_config_user_key_remove(Ewl_Config *cfg, const char *k)
DCHECK_PARAM_PTR(k);
if (cfg->data.user && (ecore_hash_get(cfg->data.user, k)))
- ecore_hash_remove(cfg->data.user, k);
+ ecore_hash_remove(cfg->data.user, k);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -499,7 +499,7 @@ ewl_config_system_save(Ewl_Config *cfg)
DCHECK_PARAM_PTR_RET(cfg, FALSE);
if (!ewl_config_can_save_system(cfg))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
hash = ecore_hash_new(ecore_str_hash, ecore_str_compare);
@@ -508,8 +508,8 @@ ewl_config_system_save(Ewl_Config *cfg)
ecore_list_first_goto(keys);
while ((key = ecore_list_next(keys)))
{
- ecore_hash_set(hash, key,
- ecore_hash_get(cfg->data.system, key));
+ ecore_hash_set(hash, key,
+ ecore_hash_get(cfg->data.system, key));
}
IF_FREE_LIST(keys);
@@ -518,8 +518,8 @@ ewl_config_system_save(Ewl_Config *cfg)
ecore_list_first_goto(keys);
while ((key = ecore_list_next(keys)))
{
- ecore_hash_set(hash, key,
- ecore_hash_get(cfg->data.user, key));
+ ecore_hash_set(hash, key,
+ ecore_hash_get(cfg->data.user, key));
}
IF_FREE_LIST(keys);
@@ -609,18 +609,18 @@ ewl_config_save(Ewl_Config *cfg, Ecore_Hash *hash, const char *file)
key = dirname(path);
if (!ecore_file_exists(key) && !ecore_file_mkpath(key))
{
- DWARNING("Unable to create %s directory path.", key);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DWARNING("Unable to create %s directory path.", key);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
FREE(path);
/* if the hash doesn't exist then treat it is empty */
if (!hash)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
#ifndef _WIN32
fd = open(file, O_CREAT | O_WRONLY | O_TRUNC,
- S_IRWXU | S_IRGRP | S_IROTH);
+ S_IRWXU | S_IRGRP | S_IROTH);
#else
# ifdef __MINGW32__
fd = _sopen(file, O_CREAT | O_WRONLY | O_TRUNC, _SH_DENYRD, S_IRWXU);
@@ -630,30 +630,30 @@ ewl_config_save(Ewl_Config *cfg, Ecore_Hash *hash, const char *file)
#endif /* _WIN32 */
if (fd == -1)
{
- DWARNING("Unable to open cfg file %s.", file);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DWARNING("Unable to open cfg file %s.", file);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
size = ecore_file_size(file);
if (!ewl_config_file_write_lock(fd, size))
{
- DWARNING("Unable to lock %s for write.", file);
- close(fd);
+ DWARNING("Unable to lock %s for write.", file);
+ close(fd);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
keys = ecore_hash_keys(hash);
ecore_list_first_goto(keys);
while ((key = ecore_list_next(keys)))
{
- int len;
+ int len;
- len = snprintf(data, sizeof(data), "%s = %s\n", key,
- (char *)ecore_hash_get(hash, key));
+ len = snprintf(data, sizeof(data), "%s = %s\n", key,
+ (char *)ecore_hash_get(hash, key));
- write(fd, data, len);
+ write(fd, data, len);
}
/* release the lock */
@@ -675,8 +675,8 @@ ewl_config_file_name_clean(Ewl_Config *cfg)
fname = strdup(cfg->app_name);
for(p = fname; *p != '\0'; p++)
{
- if (isspace(*p) || (*p == '/') || (*p == '\\'))
- *p = '_';
+ if (isspace(*p) || (*p == '/') || (*p == '\\'))
+ *p = '_';
}
DRETURN_PTR(fname, DLEVEL_STABLE);
@@ -692,15 +692,15 @@ ewl_config_file_name_build_get(Ewl_Config *cfg)
DCHECK_PARAM_PTR_RET(cfg, NULL);
if (!getenv("srcdir"))
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!strcmp(cfg->app_name, "ewl"))
- is_ewl = TRUE;
+ is_ewl = TRUE;
fname = ewl_config_file_name_clean(cfg);
snprintf(cfg_filename, sizeof(cfg_filename),
- "%s/../../data/config/%s%s.cfg", getenv("srcdir"),
- (is_ewl ? "" : "apps/"), fname);
+ "%s/../../data/config/%s%s.cfg", getenv("srcdir"),
+ (is_ewl ? "" : "apps/"), fname);
FREE(fname);
@@ -717,12 +717,12 @@ ewl_config_file_name_system_get(Ewl_Config *cfg)
DCHECK_PARAM_PTR_RET(cfg, NULL);
if (!strcmp(cfg->app_name, "ewl"))
- is_ewl = TRUE;
+ is_ewl = TRUE;
fname = ewl_config_file_name_clean(cfg);
snprintf(cfg_filename, sizeof(cfg_filename),
- "%s/ewl/%s%s.cfg", PACKAGE_SYSCONF_DIR,
- (is_ewl ? "" : "apps/"), fname);
+ "%s/ewl/%s%s.cfg", PACKAGE_SYSCONF_DIR,
+ (is_ewl ? "" : "apps/"), fname);
FREE(fname);
@@ -739,14 +739,14 @@ ewl_config_file_name_user_get(Ewl_Config *cfg)
DCHECK_PARAM_PTR_RET(cfg, NULL);
if (!strcmp(cfg->app_name, "ewl"))
- is_ewl = TRUE;
+ is_ewl = TRUE;
fname = ewl_config_file_name_clean(cfg);
snprintf(cfg_filename, sizeof(cfg_filename),
- "%s/.ewl/config/%s%s.cfg",
- (getenv("HOME") ? getenv("HOME") : "/tmp"),
- (is_ewl ? "" : "apps/"),
- fname);
+ "%s/.ewl/config/%s%s.cfg",
+ (getenv("HOME") ? getenv("HOME") : "/tmp"),
+ (is_ewl ? "" : "apps/"),
+ fname);
FREE(fname);
@@ -777,7 +777,7 @@ ewl_config_load(Ewl_Config *cfg)
/* if we failed to load both config files we're in trouble */
if (!sys_ret && !user_ret)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
/* XXX deal with the colour classes */
@@ -788,23 +788,23 @@ ewl_config_load(Ewl_Config *cfg)
/* update the evas info for the embeds */
if (ewl_embed_list && !ecore_list_empty_is(ewl_embed_list))
{
- Ewl_Embed *e;
-
- ecore_list_first_goto(ewl_embed_list);
- while ((e = ecore_list_next(ewl_embed_list)) != NULL)
- {
- if (!e->canvas) continue;
-
- evas_font_cache_flush(e->canvas);
- evas_font_cache_set(e->canvas,
- ewl_config_int_get(ewl_config,
- EWL_CONFIG_CACHE_EVAS_FONT));
-
- evas_image_cache_flush(e->canvas);
- evas_image_cache_set(e->canvas,
- ewl_config_int_get(ewl_config,
- EWL_CONFIG_CACHE_EVAS_IMAGE));
- }
+ Ewl_Embed *e;
+
+ ecore_list_first_goto(ewl_embed_list);
+ while ((e = ecore_list_next(ewl_embed_list)) != NULL)
+ {
+ if (!e->canvas) continue;
+
+ evas_font_cache_flush(e->canvas);
+ evas_font_cache_set(e->canvas,
+ ewl_config_int_get(ewl_config,
+ EWL_CONFIG_CACHE_EVAS_FONT));
+
+ evas_image_cache_flush(e->canvas);
+ evas_image_cache_set(e->canvas,
+ ewl_config_int_get(ewl_config,
+ EWL_CONFIG_CACHE_EVAS_IMAGE));
+ }
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -831,7 +831,7 @@ ewl_config_create_user_hash(Ewl_Config *cfg)
DCHECK_PARAM_PTR(cfg);
if (!cfg->data.user)
- cfg->data.user = ewl_config_create_hash();
+ cfg->data.user = ewl_config_create_hash();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -843,7 +843,7 @@ ewl_config_create_system_hash(Ewl_Config *cfg)
DCHECK_PARAM_PTR(cfg);
if (!cfg->data.system)
- cfg->data.system = ewl_config_create_hash();
+ cfg->data.system = ewl_config_create_hash();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -855,7 +855,7 @@ ewl_config_create_instance_hash(Ewl_Config *cfg)
DCHECK_PARAM_PTR(cfg);
if (!cfg->data.instance)
- cfg->data.instance = ewl_config_create_hash();
+ cfg->data.instance = ewl_config_create_hash();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -870,13 +870,13 @@ ewl_config_set_hash_get(Ewl_Config *cfg, Ewl_State_Type state)
if (state == EWL_STATE_TRANSIENT)
{
- ewl_config_create_instance_hash(cfg);
- hash = cfg->data.instance;
+ ewl_config_create_instance_hash(cfg);
+ hash = cfg->data.instance;
}
else
{
- ewl_config_create_user_hash(cfg);
- hash = cfg->data.user;
+ ewl_config_create_user_hash(cfg);
+ hash = cfg->data.user;
}
DRETURN_PTR(hash, DLEVEL_STABLE);
@@ -894,23 +894,23 @@ ewl_config_get(Ewl_Config *cfg, const char *key)
DCHECK_PARAM_PTR_RET(key, NULL);
if (cfg->data.instance
- && (val = ecore_hash_get(cfg->data.instance, key)))
+ && (val = ecore_hash_get(cfg->data.instance, key)))
{
- /* we got our value, just NOP */
+ /* we got our value, just NOP */
}
else if ((val = ewl_config_env_get(cfg, key)))
{
- /* we got our value, just NOP */
+ /* we got our value, just NOP */
}
else if (cfg->data.user
- && (val = ecore_hash_get(cfg->data.user, key)))
+ && (val = ecore_hash_get(cfg->data.user, key)))
{
- /* we got our value, just NOP */
+ /* we got our value, just NOP */
}
else if (cfg->data.system
- && (val = ecore_hash_get(cfg->data.system, key)))
+ && (val = ecore_hash_get(cfg->data.system, key)))
{
- /* we got our value, just NOP */
+ /* we got our value, just NOP */
}
DRETURN_PTR(val, DLEVEL_STABLE);
@@ -937,12 +937,12 @@ ewl_config_env_get(Ewl_Config *cfg, const char *key)
*/
while (epos < PATH_MAX && key[kpos])
{
- if (isalnum(key[kpos]))
- var_name[epos] = toupper(key[kpos]);
- else
- var_name[epos] = '_';
- epos++;
- kpos++;
+ if (isalnum(key[kpos]))
+ var_name[epos] = toupper(key[kpos]);
+ else
+ var_name[epos] = '_';
+ epos++;
+ kpos++;
}
var_name[epos] = '\0';
@@ -969,7 +969,7 @@ ewl_config_file_load(Ewl_Config *cfg, unsigned int is_system, const char *file)
/* make sure the config file exists */
if (!ecore_file_exists(file))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
#ifndef _WIN32
fd = open(file, O_RDONLY, S_IRUSR);
@@ -982,18 +982,18 @@ ewl_config_file_load(Ewl_Config *cfg, unsigned int is_system, const char *file)
#endif /* _WIN32 */
if (fd == -1)
{
- DWARNING("Unable to open cfg file %s.", file);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DWARNING("Unable to open cfg file %s.", file);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
size = ecore_file_size(file);
if (!ewl_config_file_read_lock(fd, size))
{
- DWARNING("Unable to lock %s for read.", file);
+ DWARNING("Unable to lock %s for read.", file);
- close(fd);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ close(fd);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
/* read the file into memory
@@ -1012,13 +1012,13 @@ ewl_config_file_load(Ewl_Config *cfg, unsigned int is_system, const char *file)
/* create the hash to store the values */
if (is_system)
{
- ewl_config_create_system_hash(cfg);
- hash = cfg->data.system;
+ ewl_config_create_system_hash(cfg);
+ hash = cfg->data.system;
}
else
{
- ewl_config_create_user_hash(cfg);
- hash = cfg->data.user;
+ ewl_config_create_user_hash(cfg);
+ hash = cfg->data.user;
}
ewl_config_parse(cfg, hash, data);
@@ -1040,50 +1040,50 @@ ewl_config_parse(Ewl_Config *cfg, Ecore_Hash *hash, char *data)
start = data;
while (start)
{
- char *middle = NULL, *end, *key = NULL, *val = NULL;
-
- /* skip over blank space */
- while (isspace(*start) && (*start != '\0'))
- start ++;
- if (*start == '\0') break;
-
- /* skip over comment lines */
- if (*start == '#')
- {
- while ((*start != '\n') && (*start != '\0'))
- start ++;
- if (*start == '\0') break;
-
- start ++;
-
- continue;
- }
-
- /* at this point we should have an actual key/value pair */
- end = start;
- while ((*end != '\0') && (*end != '\n') && (*end != '\r'))
- {
- if (*end == '=')
- {
- middle = end;
- *middle = '\0';
- }
- end ++;
- }
- *end = '\0';
-
- if (start && middle && end)
- {
- key = strdup(start);
- key = ewl_config_trim(key);
-
- val = strdup(middle + 1);
- val = ewl_config_trim(val);
-
- ecore_hash_set(hash, key, val);
- }
-
- start = end + 1;
+ char *middle = NULL, *end, *key = NULL, *val = NULL;
+
+ /* skip over blank space */
+ while (isspace(*start) && (*start != '\0'))
+ start ++;
+ if (*start == '\0') break;
+
+ /* skip over comment lines */
+ if (*start == '#')
+ {
+ while ((*start != '\n') && (*start != '\0'))
+ start ++;
+ if (*start == '\0') break;
+
+ start ++;
+
+ continue;
+ }
+
+ /* at this point we should have an actual key/value pair */
+ end = start;
+ while ((*end != '\0') && (*end != '\n') && (*end != '\r'))
+ {
+ if (*end == '=')
+ {
+ middle = end;
+ *middle = '\0';
+ }
+ end ++;
+ }
+ *end = '\0';
+
+ if (start && middle && end)
+ {
+ key = strdup(start);
+ key = ewl_config_trim(key);
+
+ val = strdup(middle + 1);
+ val = ewl_config_trim(val);
+
+ ecore_hash_set(hash, key, val);
+ }
+
+ start = end + 1;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_config.h b/src/lib/ewl_config.h
index ef3b539..2416f15 100644
--- a/src/lib/ewl_config.h
+++ b/src/lib/ewl_config.h
@@ -18,52 +18,52 @@ typedef struct Ewl_Config Ewl_Config;
*/
struct Ewl_Config
{
- char *app_name; /**< The application name*/
+ char *app_name; /**< The application name*/
struct
{
- Ecore_Hash *user; /**< User data */
- Ecore_Hash *system; /**< System data */
- Ecore_Hash *instance; /**< Data for this instance only */
- } data; /**< The config data */
+ Ecore_Hash *user; /**< User data */
+ Ecore_Hash *system; /**< System data */
+ Ecore_Hash *instance; /**< Data for this instance only */
+ } data; /**< The config data */
};
-int ewl_config_init(void);
-void ewl_config_shutdown(void);
-void ewl_config_cache_init(void);
+int ewl_config_init(void);
+void ewl_config_shutdown(void);
+void ewl_config_cache_init(void);
Ewl_Config *ewl_config_new(const char *app_name);
-void ewl_config_destroy(Ewl_Config *cfg);
+void ewl_config_destroy(Ewl_Config *cfg);
-void ewl_config_string_set(Ewl_Config *cfg, const char *k,
- const char *v,
- Ewl_State_Type state);
+void ewl_config_string_set(Ewl_Config *cfg, const char *k,
+ const char *v,
+ Ewl_State_Type state);
const char *ewl_config_string_get(Ewl_Config *cfg, const char *k);
-void ewl_config_int_set(Ewl_Config *cfg, const char *k, int v,
- Ewl_State_Type state);
-int ewl_config_int_get(Ewl_Config *cfg, const char *k);
+void ewl_config_int_set(Ewl_Config *cfg, const char *k, int v,
+ Ewl_State_Type state);
+int ewl_config_int_get(Ewl_Config *cfg, const char *k);
-void ewl_config_float_set(Ewl_Config *cfg, const char *k,
- float v,
- Ewl_State_Type state);
-float ewl_config_float_get(Ewl_Config *cfg, const char *k);
+void ewl_config_float_set(Ewl_Config *cfg, const char *k,
+ float v,
+ Ewl_State_Type state);
+float ewl_config_float_get(Ewl_Config *cfg, const char *k);
-void ewl_config_color_set(Ewl_Config *cfg, const char *k,
- int r, int g, int b, int a,
- Ewl_State_Type state);
-void ewl_config_color_get(Ewl_Config *cfg, const char *k,
- int *r, int *g,
- int *b, int *a);
+void ewl_config_color_set(Ewl_Config *cfg, const char *k,
+ int r, int g, int b, int a,
+ Ewl_State_Type state);
+void ewl_config_color_get(Ewl_Config *cfg, const char *k,
+ int *r, int *g,
+ int *b, int *a);
-void ewl_config_key_remove(Ewl_Config *cfg, const char *k);
-void ewl_config_instance_key_remove(Ewl_Config *cfg, const char *k);
-void ewl_config_system_key_remove(Ewl_Config *cfg, const char *k);
-void ewl_config_user_key_remove(Ewl_Config *cfg, const char *k);
+void ewl_config_key_remove(Ewl_Config *cfg, const char *k);
+void ewl_config_instance_key_remove(Ewl_Config *cfg, const char *k);
+void ewl_config_system_key_remove(Ewl_Config *cfg, const char *k);
+void ewl_config_user_key_remove(Ewl_Config *cfg, const char *k);
-int ewl_config_can_save_system(Ewl_Config *cfg);
-int ewl_config_system_save(Ewl_Config *cfg);
-int ewl_config_user_save(Ewl_Config *cfg);
+int ewl_config_can_save_system(Ewl_Config *cfg);
+int ewl_config_system_save(Ewl_Config *cfg);
+int ewl_config_user_save(Ewl_Config *cfg);
/**
* @}
diff --git a/src/lib/ewl_container.c b/src/lib/ewl_container.c
index e36eb70..41ddfa1 100644
--- a/src/lib/ewl_container.c
+++ b/src/lib/ewl_container.c
@@ -7,9 +7,9 @@
#include <Evas.h>
static void ewl_container_child_insert_helper(Ewl_Container *pc,
- Ewl_Widget *child,
- int index,
- int skip_internal);
+ Ewl_Widget *child,
+ int index,
+ int skip_internal);
static int ewl_container_child_count_get_helper(Ewl_Container *c, int skip);
/**
@@ -34,7 +34,7 @@ ewl_container_init(Ewl_Container *c)
* Initialize the fields inherited from the widget class
*/
if (!ewl_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_CONTAINER_TYPE);
ewl_object_recursive_set(EWL_OBJECT(w), TRUE);
@@ -49,23 +49,23 @@ ewl_container_init(Ewl_Container *c)
* children with necessary window and evas information.
*/
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_container_cb_configure, NULL);
+ ewl_container_cb_configure, NULL);
ewl_callback_append(w, EWL_CALLBACK_OBSCURE,
- ewl_container_cb_obscure, NULL);
+ ewl_container_cb_obscure, NULL);
ewl_callback_append(w, EWL_CALLBACK_REVEAL,
- ewl_container_cb_reveal, NULL);
+ ewl_container_cb_reveal, NULL);
ewl_callback_append(w, EWL_CALLBACK_REALIZE,
- ewl_container_cb_reveal, NULL);
+ ewl_container_cb_reveal, NULL);
ewl_callback_append(w, EWL_CALLBACK_REALIZE,
- ewl_container_cb_realize, NULL);
+ ewl_container_cb_realize, NULL);
ewl_callback_append(w, EWL_CALLBACK_UNREALIZE,
- ewl_container_cb_unrealize, NULL);
+ ewl_container_cb_unrealize, NULL);
ewl_callback_append(w, EWL_CALLBACK_REPARENT,
- ewl_container_cb_reparent, NULL);
+ ewl_container_cb_reparent, NULL);
ewl_callback_append(w, EWL_CALLBACK_WIDGET_ENABLE,
- ewl_container_cb_enable, NULL);
+ ewl_container_cb_enable, NULL);
ewl_callback_append(w, EWL_CALLBACK_WIDGET_DISABLE,
- ewl_container_cb_disable, NULL);
+ ewl_container_cb_disable, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -188,15 +188,15 @@ ewl_container_child_append(Ewl_Container *pc, Ewl_Widget *child)
DCHECK_TYPE(child, EWL_WIDGET_TYPE);
if (pc == EWL_CONTAINER(child->parent))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_widget_parent_of(child, EWL_WIDGET(pc))) {
- DWARNING("Attempting to make a child a parent of itself.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Attempting to make a child a parent of itself.");
+ DRETURN(DLEVEL_STABLE);
}
while (pc->redirect)
- pc = pc->redirect;
+ pc = pc->redirect;
ewl_widget_parent_set(child, EWL_WIDGET(pc));
ecore_dlist_append(pc->children, child);
@@ -223,15 +223,15 @@ ewl_container_child_prepend(Ewl_Container *pc, Ewl_Widget *child)
DCHECK_TYPE(child, EWL_WIDGET_TYPE);
if (pc == EWL_CONTAINER(child->parent))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_widget_parent_of(child, EWL_WIDGET(pc))) {
- DWARNING("Attempting to make a child a parent of itself.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Attempting to make a child a parent of itself.");
+ DRETURN(DLEVEL_STABLE);
}
while (pc->redirect)
- pc = pc->redirect;
+ pc = pc->redirect;
ewl_widget_parent_set(child, EWL_WIDGET(pc));
ecore_dlist_prepend(pc->children, child);
@@ -242,7 +242,7 @@ ewl_container_child_prepend(Ewl_Container *pc, Ewl_Widget *child)
static void
ewl_container_child_insert_helper(Ewl_Container *pc, Ewl_Widget *child,
- int index, int skip_internal)
+ int index, int skip_internal)
{
Ewl_Widget *cur;
int idx = 0;
@@ -255,31 +255,31 @@ ewl_container_child_insert_helper(Ewl_Container *pc, Ewl_Widget *child,
/* already inserted */
if (pc == EWL_CONTAINER(child->parent))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_widget_parent_of(child, EWL_WIDGET(pc))) {
- DWARNING("Attempting to make a child a parent of itself.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Attempting to make a child a parent of itself.");
+ DRETURN(DLEVEL_STABLE);
}
/* find the real container */
while (pc->redirect)
- pc = pc->redirect;
+ pc = pc->redirect;
/* find our insertion point */
ecore_dlist_first_goto(pc->children);
while ((cur = ecore_dlist_current(pc->children)))
{
- if (skip_internal && ewl_widget_internal_is(cur))
- {
- ecore_dlist_next(pc->children);
- continue;
- }
+ if (skip_internal && ewl_widget_internal_is(cur))
+ {
+ ecore_dlist_next(pc->children);
+ continue;
+ }
- if (idx == index) break;
+ if (idx == index) break;
- idx++;
- ecore_dlist_next(pc->children);
+ idx++;
+ ecore_dlist_next(pc->children);
}
ewl_widget_parent_set(child, EWL_WIDGET(pc));
@@ -326,7 +326,7 @@ ewl_container_child_insert(Ewl_Container *pc, Ewl_Widget *child, int index)
*/
void
ewl_container_child_insert_internal(Ewl_Container *pc,
- Ewl_Widget *child, int index)
+ Ewl_Widget *child, int index)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(pc);
@@ -360,7 +360,7 @@ ewl_container_child_remove(Ewl_Container *pc, Ewl_Widget *child)
DCHECK_TYPE(child, EWL_WIDGET_TYPE);
if (child == EWL_WIDGET(pc->redirect))
- pc->redirect = NULL;
+ pc->redirect = NULL;
/*
* First remove reference to the parent if necessary.
@@ -368,12 +368,12 @@ ewl_container_child_remove(Ewl_Container *pc, Ewl_Widget *child)
* with a NULL parent on the widget.
*/
if (child->parent) {
- ewl_widget_parent_set(child, NULL);
- DRETURN(DLEVEL_STABLE);
+ ewl_widget_parent_set(child, NULL);
+ DRETURN(DLEVEL_STABLE);
}
if (!pc->children)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Traverse the list to the child.
@@ -384,7 +384,7 @@ ewl_container_child_remove(Ewl_Container *pc, Ewl_Widget *child)
* If the child isn't found, then this isn't it's parent.
*/
if (!temp)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* get the index of the widget we are removing */
idx = ecore_dlist_index(pc->children);
@@ -394,7 +394,7 @@ ewl_container_child_remove(Ewl_Container *pc, Ewl_Widget *child)
*/
ecore_dlist_remove(pc->children);
if (VISIBLE(child) && REALIZED(child))
- ewl_container_child_hide_call(pc, child);
+ ewl_container_child_hide_call(pc, child);
ewl_container_child_remove_call(pc, child, idx);
ewl_widget_configure(EWL_WIDGET(pc));
@@ -422,8 +422,8 @@ ewl_container_child_count_get_helper(Ewl_Container *c, int skip)
ecore_dlist_first_goto(container->children);
while ((child = ecore_dlist_next(container->children)))
{
- if (skip && ewl_widget_internal_is(child)) continue;
- count++;
+ if (skip && ewl_widget_internal_is(child)) continue;
+ count++;
}
DRETURN_INT(count, DLEVEL_STABLE);
@@ -490,7 +490,7 @@ ewl_container_child_count_visible_get(Ewl_Container *c)
static Ewl_Widget *
ewl_container_child_helper_get(Ewl_Container *parent, int index,
- unsigned int skip)
+ unsigned int skip)
{
Ewl_Container *container = NULL;
Ewl_Widget *child;
@@ -506,9 +506,9 @@ ewl_container_child_helper_get(Ewl_Container *parent, int index,
ecore_dlist_first_goto(container->children);
while ((child = ecore_dlist_next(container->children))) {
- if (skip && ewl_widget_internal_is(child)) continue;
- if (count == index) break;
- count ++;
+ if (skip && ewl_widget_internal_is(child)) continue;
+ if (count == index) break;
+ count ++;
}
DRETURN_PTR(((count == index) ? child : NULL), DLEVEL_STABLE);
@@ -558,7 +558,7 @@ ewl_container_child_internal_get(Ewl_Container *parent, int index)
static int
ewl_container_child_index_helper_get(Ewl_Container *parent, Ewl_Widget *w,
- unsigned int skip)
+ unsigned int skip)
{
unsigned int idx = 0;
int ret = -1;
@@ -576,13 +576,13 @@ ewl_container_child_index_helper_get(Ewl_Container *parent, Ewl_Widget *w,
ecore_dlist_first_goto(container->children);
while ((child = ecore_dlist_next(container->children))) {
- if (skip && ewl_widget_internal_is(child)) continue;
- if (child == w)
- {
- ret = idx;
- break;
- }
- idx ++;
+ if (skip && ewl_widget_internal_is(child)) continue;
+ if (child == w)
+ {
+ ret = idx;
+ break;
+ }
+ idx ++;
}
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -654,8 +654,8 @@ ewl_container_child_resize(Ewl_Widget *w, int size, Ewl_Orientation o)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!size || !REALIZED(w) || ewl_object_queued_has(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_SCHEDULED_REVEAL))
- DRETURN(DLEVEL_STABLE);
+ EWL_FLAG_QUEUED_SCHEDULED_REVEAL))
+ DRETURN(DLEVEL_STABLE);
c = EWL_CONTAINER(w->parent);
@@ -665,7 +665,7 @@ ewl_container_child_resize(Ewl_Widget *w, int size, Ewl_Orientation o)
* child resizes.
*/
if (HIDDEN(w) || !c || !c->child_resize)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Store the parents current size so we can determine if it changes
@@ -690,9 +690,9 @@ ewl_container_child_resize(Ewl_Widget *w, int size, Ewl_Orientation o)
* change size (ie. it's parent isn't on the configure queue).
*/
if (EWL_WIDGET(c)->parent)
- ewl_widget_configure(EWL_WIDGET(c)->parent);
+ ewl_widget_configure(EWL_WIDGET(c)->parent);
else
- ewl_widget_configure(EWL_WIDGET(c));
+ ewl_widget_configure(EWL_WIDGET(c));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -718,7 +718,7 @@ ewl_container_child_at_get(Ewl_Container *widget, int x, int y)
DCHECK_TYPE_RET(widget, EWL_CONTAINER_TYPE, NULL);
if (!widget->children || ecore_dlist_empty_is(widget->children))
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ecore_dlist_first_goto(widget->children);
@@ -726,21 +726,21 @@ ewl_container_child_at_get(Ewl_Container *widget, int x, int y)
* Search through the children to find an intersecting child.
*/
while ((child = ecore_dlist_next(EWL_CONTAINER(widget)->children))) {
- if (VISIBLE(child) && !DISABLED(child)
- && x >= (CURRENT_X(child) - INSET_LEFT(child))
- && y >= (CURRENT_Y(child) - INSET_TOP(child))
- && (CURRENT_X(child) + CURRENT_W(child) +
- INSET_RIGHT(child)) >= x
- && (CURRENT_Y(child) + CURRENT_H(child) +
- INSET_BOTTOM(child)) >= y) {
- if (child->toplayered) {
- found = child;
- break;
- }
- if ((!found || ewl_widget_layer_priority_get(found) <=
- ewl_widget_layer_priority_get(child)))
- found = child;
- }
+ if (VISIBLE(child) && !DISABLED(child)
+ && x >= (CURRENT_X(child) - INSET_LEFT(child))
+ && y >= (CURRENT_Y(child) - INSET_TOP(child))
+ && (CURRENT_X(child) + CURRENT_W(child) +
+ INSET_RIGHT(child)) >= x
+ && (CURRENT_Y(child) + CURRENT_H(child) +
+ INSET_BOTTOM(child)) >= y) {
+ if (child->toplayered) {
+ found = child;
+ break;
+ }
+ if ((!found || ewl_widget_layer_priority_get(found) <=
+ ewl_widget_layer_priority_get(child)))
+ found = child;
+ }
}
DRETURN_PTR(found, DLEVEL_STABLE);
@@ -768,7 +768,7 @@ ewl_container_child_at_recursive_get(Ewl_Container *widget, int x, int y)
DCHECK_TYPE_RET(widget, EWL_CONTAINER_TYPE, NULL);
if (!widget->children || ecore_dlist_empty_is(widget->children))
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
/*
* The starting point is the current widget
@@ -780,18 +780,18 @@ ewl_container_child_at_recursive_get(Ewl_Container *widget, int x, int y)
* found.
*/
if (!DISABLED(child))
- child2 = ewl_container_child_at_get(EWL_CONTAINER(child), x, y);
+ child2 = ewl_container_child_at_get(EWL_CONTAINER(child), x, y);
while (child2) {
- if (RECURSIVE(child2))
- child = child2;
- else
- DRETURN_PTR(child2, DLEVEL_STABLE);
-
- if (!DISABLED(child))
- child2 = ewl_container_child_at_get(EWL_CONTAINER(child), x, y);
- else
- child2 = NULL;
+ if (RECURSIVE(child2))
+ child = child2;
+ else
+ DRETURN_PTR(child2, DLEVEL_STABLE);
+
+ if (!DISABLED(child))
+ child2 = ewl_container_child_at_get(EWL_CONTAINER(child), x, y);
+ else
+ child2 = NULL;
}
DRETURN_PTR((child2 ? child2 : child), DLEVEL_STABLE);
@@ -815,29 +815,29 @@ ewl_container_reset(Ewl_Container *c)
DCHECK_TYPE(c, EWL_CONTAINER_TYPE);
while (c->redirect)
- c = c->redirect;
+ c = c->redirect;
if (!c->children)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Loop through removing each child and destroying it.
*/
ecore_dlist_first_goto(c->children);
while ((w = ecore_dlist_current(c->children))) {
- if (!ewl_object_flags_has(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_INTERNAL,
- EWL_FLAGS_PROPERTY_MASK)) {
- ewl_widget_destroy(w);
-
- /*
- * Start over in case the list was modified from a
- * callback.
- */
- ecore_dlist_first_goto(c->children);
- }
- else
- ecore_dlist_next(c->children);
+ if (!ewl_object_flags_has(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_INTERNAL,
+ EWL_FLAGS_PROPERTY_MASK)) {
+ ewl_widget_destroy(w);
+
+ /*
+ * Start over in case the list was modified from a
+ * callback.
+ */
+ ecore_dlist_first_goto(c->children);
+ }
+ else
+ ecore_dlist_next(c->children);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -861,7 +861,7 @@ ewl_container_child_iterate_begin(Ewl_Container *c)
DCHECK_TYPE(c, EWL_CONTAINER_TYPE);
while (c->redirect)
- c = c->redirect;
+ c = c->redirect;
ecore_dlist_first_goto(c->children);
@@ -883,14 +883,14 @@ ewl_container_child_next(Ewl_Container *c)
DCHECK_TYPE_RET(c, EWL_CONTAINER_TYPE, NULL);
while (c->redirect)
- c = c->redirect;
+ c = c->redirect;
if (c->iterator) {
- w = c->iterator(c);
+ w = c->iterator(c);
}
else {
- while ((w = ecore_dlist_next(c->children)) &&
- (ewl_widget_internal_is(w)));
+ while ((w = ecore_dlist_next(c->children)) &&
+ (ewl_widget_internal_is(w)));
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -1022,21 +1022,21 @@ ewl_container_largest_prefer(Ewl_Container *c, Ewl_Orientation o)
DCHECK_TYPE(c, EWL_CONTAINER_TYPE);
if (o == EWL_ORIENTATION_HORIZONTAL) {
- get_size = ewl_object_preferred_w_get;
- set_size = ewl_object_preferred_inner_w_set;
+ get_size = ewl_object_preferred_w_get;
+ set_size = ewl_object_preferred_inner_w_set;
}
else {
- get_size = ewl_object_preferred_h_get;
- set_size = ewl_object_preferred_inner_h_set;
+ get_size = ewl_object_preferred_h_get;
+ set_size = ewl_object_preferred_inner_h_set;
}
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children))) {
- if (VISIBLE(child) && REALIZED(child)) {
- curr_size = get_size(child);
- if (curr_size > max_size)
- max_size = curr_size;
- }
+ if (VISIBLE(child) && REALIZED(child)) {
+ curr_size = get_size(child);
+ if (curr_size > max_size)
+ max_size = curr_size;
+ }
}
set_size(EWL_OBJECT(c), max_size);
@@ -1063,18 +1063,18 @@ ewl_container_sum_prefer(Ewl_Container *c, Ewl_Orientation o)
DCHECK_TYPE(c, EWL_CONTAINER_TYPE);
if (o == EWL_ORIENTATION_HORIZONTAL) {
- get_size = ewl_object_preferred_w_get;
- set_size = ewl_object_preferred_inner_w_set;
+ get_size = ewl_object_preferred_w_get;
+ set_size = ewl_object_preferred_inner_w_set;
}
else {
- get_size = ewl_object_preferred_h_get;
- set_size = ewl_object_preferred_inner_h_set;
+ get_size = ewl_object_preferred_h_get;
+ set_size = ewl_object_preferred_inner_h_set;
}
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children))) {
- if (VISIBLE(child) && REALIZED(child))
- curr_size += get_size(child);
+ if (VISIBLE(child) && REALIZED(child))
+ curr_size += get_size(child);
}
set_size(EWL_OBJECT(c), curr_size);
@@ -1099,10 +1099,10 @@ ewl_container_child_add_call(Ewl_Container *c, Ewl_Widget *w)
/* ignore unmanaged children */
if (UNMANAGED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (c->child_add)
- c->child_add(c, w);
+ c->child_add(c, w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1125,14 +1125,14 @@ ewl_container_child_remove_call(Ewl_Container *c, Ewl_Widget *w, int idx)
/* do nothing if the container is being destroyed */
if (DESTROYED(c))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* ignore unmanaged children */
if (UNMANAGED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (c->child_remove)
- c->child_remove(c, w, idx);
+ c->child_remove(c, w, idx);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1154,22 +1154,22 @@ ewl_container_child_show_call(Ewl_Container *c, Ewl_Widget *w)
/* ignore unmanaged children */
if (UNMANAGED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
c->visible_children++;
if (c->visible_children > ecore_dlist_count(c->children))
- DWARNING("visible children count exceed total child count "
- "(%d > %d)\n", c->visible_children,
- ecore_dlist_count(c->children));
+ DWARNING("visible children count exceed total child count "
+ "(%d > %d)\n", c->visible_children,
+ ecore_dlist_count(c->children));
if (c->child_show)
- c->child_show(c, w);
+ c->child_show(c, w);
/*
* Only show it if there are visible children.
*/
if (c->clip_box)
- evas_object_show(c->clip_box);
+ evas_object_show(c->clip_box);
ewl_widget_configure(EWL_WIDGET(c));
@@ -1193,24 +1193,24 @@ ewl_container_child_hide_call(Ewl_Container *c, Ewl_Widget *w)
/* ignore unmanaged children */
if (UNMANAGED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* do nothing if the container is being destroyed */
if (DESTROYED(c))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
c->visible_children--;
if (c->visible_children < 0)
- DWARNING("visible_children is %d\n", c->visible_children);
+ DWARNING("visible_children is %d\n", c->visible_children);
if (c->child_hide)
- c->child_hide(c, w);
+ c->child_hide(c, w);
if (c->clip_box) {
- const Evas_List *clippees;
- clippees = evas_object_clipees_get(c->clip_box);
- if (!clippees)
- evas_object_hide(c->clip_box);
+ const Evas_List *clippees;
+ clippees = evas_object_clipees_get(c->clip_box);
+ if (!clippees)
+ evas_object_hide(c->clip_box);
}
ewl_widget_configure(EWL_WIDGET(c));
@@ -1234,19 +1234,19 @@ ewl_container_destroy(Ewl_Container *c)
c->redirect = NULL;
if (c->children) {
- /*
- * Destroy any children still in the container. Do not remove
- * in order to avoid list walking.
- */
- while ((child = ecore_dlist_first_goto(c->children))) {
- ewl_widget_destroy(child);
- }
-
- /*
- * Destroy the container list and set it to NULL.
- */
- ecore_dlist_destroy(c->children);
- c->children = NULL;
+ /*
+ * Destroy any children still in the container. Do not remove
+ * in order to avoid list walking.
+ */
+ while ((child = ecore_dlist_first_goto(c->children))) {
+ ewl_widget_destroy(child);
+ }
+
+ /*
+ * Destroy the container list and set it to NULL.
+ */
+ ecore_dlist_destroy(c->children);
+ c->children = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1267,11 +1267,11 @@ ewl_container_end_redirect_get(Ewl_Container *c)
DCHECK_TYPE_RET(c, EWL_CONTAINER_TYPE, NULL);
if (!c->redirect)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
while (c->redirect) {
- rc = c->redirect;
- c = c->redirect;
+ rc = c->redirect;
+ c = c->redirect;
}
DRETURN_PTR(rc, DLEVEL_STABLE);
@@ -1322,7 +1322,7 @@ ewl_container_redirect_set(Ewl_Container *c, Ewl_Container *rc)
*/
void
ewl_container_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Widget *child;
@@ -1331,14 +1331,14 @@ ewl_container_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
DCHECK_TYPE(w, EWL_CONTAINER_TYPE);
if (!EWL_CONTAINER(w)->children)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Reparent all of the containers children
*/
ecore_dlist_first_goto(EWL_CONTAINER(w)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(w)->children)) != NULL) {
- ewl_widget_reparent(child);
+ ewl_widget_reparent(child);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1354,7 +1354,7 @@ ewl_container_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_container_cb_enable(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Widget *child;
@@ -1363,14 +1363,14 @@ ewl_container_cb_enable(Ewl_Widget *w, void *ev_data __UNUSED__,
DCHECK_TYPE(w, EWL_CONTAINER_TYPE);
if (!EWL_CONTAINER(w)->children)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Enable all of the containers children
*/
ecore_dlist_first_goto(EWL_CONTAINER(w)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(w)->children)) != NULL) {
- ewl_widget_enable(child);
+ ewl_widget_enable(child);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1386,7 +1386,7 @@ ewl_container_cb_enable(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_container_cb_disable(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Widget *child;
@@ -1395,14 +1395,14 @@ ewl_container_cb_disable(Ewl_Widget *w, void *ev_data __UNUSED__,
DCHECK_TYPE(w, EWL_CONTAINER_TYPE);
if (!EWL_CONTAINER(w)->children)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Disable all of the containers children
*/
ecore_dlist_first_goto(EWL_CONTAINER(w)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(w)->children)) != NULL) {
- ewl_widget_disable(child);
+ ewl_widget_disable(child);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1418,7 +1418,7 @@ ewl_container_cb_disable(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_container_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *e;
Ewl_Container *c;
@@ -1434,8 +1434,8 @@ ewl_container_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
e = ewl_embed_widget_find(EWL_WIDGET(w));
if (e && c->clip_box) {
- ewl_embed_object_cache(e, c->clip_box);
- c->clip_box = NULL;
+ ewl_embed_object_cache(e, c->clip_box);
+ c->clip_box = NULL;
}
/*
@@ -1444,11 +1444,11 @@ ewl_container_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
* obscured.
*/
if (c->children) {
- ecore_dlist_first_goto(c->children);
- while ((w = ecore_dlist_next(c->children))) {
- if (REALIZED(w))
- ewl_widget_obscure(w);
- }
+ ecore_dlist_first_goto(c->children);
+ while ((w = ecore_dlist_next(c->children))) {
+ if (REALIZED(w))
+ ewl_widget_obscure(w);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1464,7 +1464,7 @@ ewl_container_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_container_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *e;
Ewl_Container *c;
@@ -1477,7 +1477,7 @@ ewl_container_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
e = ewl_embed_widget_find(EWL_WIDGET(w));
if (e && !c->clip_box) {
- c->clip_box = ewl_embed_object_request(e, "rectangle");
+ c->clip_box = ewl_embed_object_request(e, "rectangle");
}
/*
@@ -1485,21 +1485,21 @@ ewl_container_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
* to the wanted area.
*/
if (!c->clip_box)
- c->clip_box = evas_object_rectangle_add(e->canvas);
+ c->clip_box = evas_object_rectangle_add(e->canvas);
/*
* Setup the remaining properties for the clip box.
*/
if (c->clip_box) {
- evas_object_pass_events_set(c->clip_box, TRUE);
- evas_object_smart_member_add(c->clip_box, w->smart_object);
+ evas_object_pass_events_set(c->clip_box, TRUE);
+ evas_object_smart_member_add(c->clip_box, w->smart_object);
- if (w->fx_clip_box) {
- evas_object_clip_set(c->clip_box, w->fx_clip_box);
- evas_object_stack_below(c->clip_box, w->fx_clip_box);
- }
+ if (w->fx_clip_box) {
+ evas_object_clip_set(c->clip_box, w->fx_clip_box);
+ evas_object_stack_below(c->clip_box, w->fx_clip_box);
+ }
- evas_object_color_set(c->clip_box, 255, 255, 255, 255);
+ evas_object_color_set(c->clip_box, 255, 255, 255, 255);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1517,7 +1517,7 @@ ewl_container_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_container_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
int i = 0;
Ewl_Container *c;
@@ -1530,7 +1530,7 @@ ewl_container_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
c = EWL_CONTAINER(w);
if (!c->children || ecore_dlist_empty_is(c->children))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* If this container has not yet been realized, then it's children
@@ -1539,11 +1539,11 @@ ewl_container_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
* realize any of them that should be visible.
*/
while ((child = ecore_dlist_index_goto(c->children, i))) {
- ewl_callback_call_with_event_data(child, EWL_CALLBACK_REPARENT,
- c);
- if (VISIBLE(child))
- ewl_realize_request(child);
- i++;
+ ewl_callback_call_with_event_data(child, EWL_CALLBACK_REPARENT,
+ c);
+ if (VISIBLE(child))
+ ewl_realize_request(child);
+ i++;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1559,21 +1559,21 @@ ewl_container_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_container_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_CONTAINER_TYPE);
if (EWL_CONTAINER(w)->clip_box) {
- /*
- * Move the clip box into the new position and size of the
- * container.
- */
- evas_object_move(EWL_CONTAINER(w)->clip_box,
- CURRENT_X(w), CURRENT_Y(w));
- evas_object_resize(EWL_CONTAINER(w)->clip_box,
- CURRENT_W(w), CURRENT_H(w));
+ /*
+ * Move the clip box into the new position and size of the
+ * container.
+ */
+ evas_object_move(EWL_CONTAINER(w)->clip_box,
+ CURRENT_X(w), CURRENT_Y(w));
+ evas_object_resize(EWL_CONTAINER(w)->clip_box,
+ CURRENT_W(w), CURRENT_H(w));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1589,7 +1589,7 @@ ewl_container_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_container_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Container *c;
Ewl_Widget *child;
@@ -1604,8 +1604,8 @@ ewl_container_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
* Clean up the clip box of the container.
*/
if (c->clip_box) {
- ewl_canvas_object_destroy(c->clip_box);
- c->clip_box = NULL;
+ ewl_canvas_object_destroy(c->clip_box);
+ c->clip_box = NULL;
}
/*
@@ -1613,10 +1613,10 @@ ewl_container_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
* exist at this point. Is this legitimate ordering?
*/
if (c->children) {
- ecore_dlist_first_goto(c->children);
- while ((child = ecore_dlist_next(c->children))) {
- ewl_widget_unrealize(child);
- }
+ ecore_dlist_first_goto(c->children);
+ while ((child = ecore_dlist_next(c->children))) {
+ ewl_widget_unrealize(child);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1639,12 +1639,12 @@ ewl_container_cb_container_focus_out(Ewl_Widget *w, void *ev_data, void *user_da
DCHECK_PARAM_PTR(w);
if (ev_data)
- focus_in = EWL_WIDGET(ev_data);
+ focus_in = EWL_WIDGET(ev_data);
/* If its a child or is disabled then don't send a signal */
if ((focus_in) && (!ewl_widget_parent_of(w, focus_in)) &&
- (!DISABLED(w)) && (focus_in != w))
- ewl_widget_state_set(w, "focus,out", EWL_STATE_TRANSIENT);
+ (!DISABLED(w)) && (focus_in != w))
+ ewl_widget_state_set(w, "focus,out", EWL_STATE_TRANSIENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1666,15 +1666,15 @@ ewl_container_cb_widget_focus_out(Ewl_Widget *w, void *ev_data, void *user_data)
DCHECK_PARAM_PTR(w);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
c = EWL_CONTAINER(w);
while (c->redirect)
- c = c->redirect;
+ c = c->redirect;
ecore_dlist_first_goto(c->children);
while ((w = ecore_dlist_next(c->children)))
- ewl_widget_state_set(w, "focus,out", EWL_STATE_TRANSIENT);
+ ewl_widget_state_set(w, "focus,out", EWL_STATE_TRANSIENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1696,15 +1696,15 @@ ewl_container_cb_widget_focus_in(Ewl_Widget *w, void *ev_data, void *user_data)
DCHECK_PARAM_PTR(w);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
c = EWL_CONTAINER(w);
while (c->redirect)
- c = c->redirect;
+ c = c->redirect;
ecore_dlist_first_goto(c->children);
while ((w = ecore_dlist_next(c->children)))
- ewl_widget_state_set(w, "focus,in", EWL_STATE_TRANSIENT);
+ ewl_widget_state_set(w, "focus,in", EWL_STATE_TRANSIENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1728,10 +1728,10 @@ ewl_container_children_show(Ewl_Container *c)
ewl_container_child_iterate_begin(c);
while ((w = ewl_container_child_next(c)))
{
- if (EWL_CONTAINER_IS(w))
- ewl_container_children_show(EWL_CONTAINER(w));
- else
- ewl_widget_show(w);
+ if (EWL_CONTAINER_IS(w))
+ ewl_container_children_show(EWL_CONTAINER(w));
+ else
+ ewl_widget_show(w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_container.h b/src/lib/ewl_container.h
index b6dd234..b87783d 100644
--- a/src/lib/ewl_container.h
+++ b/src/lib/ewl_container.h
@@ -59,7 +59,7 @@ typedef void (*Ewl_Child_Remove) (Ewl_Container *c, Ewl_Widget *w, int idx);
* resized in the Ewl_Container.
*/
typedef void (*Ewl_Child_Resize) (Ewl_Container *c, Ewl_Widget *w,
- int size, Ewl_Orientation o);
+ int size, Ewl_Orientation o);
/**
* A typedef to shorten the definition of the child_show callbacks. This
@@ -107,72 +107,72 @@ struct Ewl_Container
Ewl_Container_Iterator iterator; /**< Function to find next child */
};
-int ewl_container_init(Ewl_Container *container);
-
-void ewl_container_add_notify_set(Ewl_Container *container,
- Ewl_Child_Add add);
-void ewl_container_remove_notify_set(Ewl_Container *container,
- Ewl_Child_Remove remove);
-void ewl_container_resize_notify_set(Ewl_Container *container,
- Ewl_Child_Resize resize);
-void ewl_container_show_notify_set(Ewl_Container *container,
- Ewl_Child_Show show);
-void ewl_container_hide_notify_set(Ewl_Container *container,
- Ewl_Child_Hide show);
-
-void ewl_container_child_append(Ewl_Container *parent,
- Ewl_Widget *child);
-void ewl_container_child_prepend(Ewl_Container *parent,
- Ewl_Widget *child);
-void ewl_container_child_insert(Ewl_Container *parent,
- Ewl_Widget *child, int index);
-void ewl_container_child_insert_internal(Ewl_Container *parent,
- Ewl_Widget *child, int index);
-void ewl_container_child_remove(Ewl_Container *parent,
- Ewl_Widget *child);
-void ewl_container_child_resize(Ewl_Widget *w, int size,
- Ewl_Orientation o);
+int ewl_container_init(Ewl_Container *container);
+
+void ewl_container_add_notify_set(Ewl_Container *container,
+ Ewl_Child_Add add);
+void ewl_container_remove_notify_set(Ewl_Container *container,
+ Ewl_Child_Remove remove);
+void ewl_container_resize_notify_set(Ewl_Container *container,
+ Ewl_Child_Resize resize);
+void ewl_container_show_notify_set(Ewl_Container *container,
+ Ewl_Child_Show show);
+void ewl_container_hide_notify_set(Ewl_Container *container,
+ Ewl_Child_Hide show);
+
+void ewl_container_child_append(Ewl_Container *parent,
+ Ewl_Widget *child);
+void ewl_container_child_prepend(Ewl_Container *parent,
+ Ewl_Widget *child);
+void ewl_container_child_insert(Ewl_Container *parent,
+ Ewl_Widget *child, int index);
+void ewl_container_child_insert_internal(Ewl_Container *parent,
+ Ewl_Widget *child, int index);
+void ewl_container_child_remove(Ewl_Container *parent,
+ Ewl_Widget *child);
+void ewl_container_child_resize(Ewl_Widget *w, int size,
+ Ewl_Orientation o);
Ewl_Widget *ewl_container_child_get(Ewl_Container *parent, int index);
Ewl_Widget *ewl_container_child_internal_get(Ewl_Container *parent, int index);
-int ewl_container_child_index_get(Ewl_Container *parent,
- Ewl_Widget *child);
-int ewl_container_child_index_internal_get(Ewl_Container *parent,
- Ewl_Widget *child);
-void ewl_container_child_iterate_begin(Ewl_Container *c);
+int ewl_container_child_index_get(Ewl_Container *parent,
+ Ewl_Widget *child);
+int ewl_container_child_index_internal_get(Ewl_Container *parent,
+ Ewl_Widget *child);
+void ewl_container_child_iterate_begin(Ewl_Container *c);
Ewl_Widget *ewl_container_child_next(Ewl_Container *c);
-void ewl_container_child_iterator_set(Ewl_Container *c,
- Ewl_Container_Iterator i);
-int ewl_container_child_count_get(Ewl_Container *c);
-int ewl_container_child_count_internal_get(Ewl_Container *c);
-int ewl_container_child_count_visible_get(Ewl_Container *c);
-void ewl_container_children_show(Ewl_Container *c);
-void ewl_container_destroy(Ewl_Container *c);
-void ewl_container_reset(Ewl_Container *c);
-void ewl_container_callback_notify(Ewl_Container *c,
- unsigned int t);
-void ewl_container_callback_nonotify(Ewl_Container *c,
- unsigned int t);
-void ewl_container_callback_intercept(Ewl_Container *c,
- unsigned int t);
-void ewl_container_callback_nointercept(Ewl_Container *c,
- unsigned int t);
+void ewl_container_child_iterator_set(Ewl_Container *c,
+ Ewl_Container_Iterator i);
+int ewl_container_child_count_get(Ewl_Container *c);
+int ewl_container_child_count_internal_get(Ewl_Container *c);
+int ewl_container_child_count_visible_get(Ewl_Container *c);
+void ewl_container_children_show(Ewl_Container *c);
+void ewl_container_destroy(Ewl_Container *c);
+void ewl_container_reset(Ewl_Container *c);
+void ewl_container_callback_notify(Ewl_Container *c,
+ unsigned int t);
+void ewl_container_callback_nonotify(Ewl_Container *c,
+ unsigned int t);
+void ewl_container_callback_intercept(Ewl_Container *c,
+ unsigned int t);
+void ewl_container_callback_nointercept(Ewl_Container *c,
+ unsigned int t);
Ewl_Widget *ewl_container_child_at_get(Ewl_Container *widget,
- int x, int y);
+ int x, int y);
Ewl_Widget *ewl_container_child_at_recursive_get(Ewl_Container *widget,
- int x, int y);
-void ewl_container_largest_prefer(Ewl_Container *c,
- Ewl_Orientation o);
-void ewl_container_sum_prefer(Ewl_Container *c, Ewl_Orientation o);
+ int x, int y);
+void ewl_container_largest_prefer(Ewl_Container *c,
+ Ewl_Orientation o);
+void ewl_container_sum_prefer(Ewl_Container *c, Ewl_Orientation o);
-void ewl_container_child_add_call(Ewl_Container *c, Ewl_Widget *w);
-void ewl_container_child_remove_call(Ewl_Container *c, Ewl_Widget *w,
- int idx);
-void ewl_container_child_show_call(Ewl_Container *c, Ewl_Widget *w);
-void ewl_container_child_hide_call(Ewl_Container *c, Ewl_Widget *w);
+void ewl_container_child_add_call(Ewl_Container *c, Ewl_Widget *w);
+void ewl_container_child_remove_call(Ewl_Container *c, Ewl_Widget *w,
+ int idx);
+void ewl_container_child_show_call(Ewl_Container *c, Ewl_Widget *w);
+void ewl_container_child_hide_call(Ewl_Container *c, Ewl_Widget *w);
Ewl_Container *ewl_container_end_redirect_get(Ewl_Container *c);
Ewl_Container *ewl_container_redirect_get(Ewl_Container *c);
-void ewl_container_redirect_set(Ewl_Container *c, Ewl_Container *rc);
+void ewl_container_redirect_set(Ewl_Container *c, Ewl_Container *rc);
/*
* Internally used callbacks, override at your own risk.
diff --git a/src/lib/ewl_context_menu.c b/src/lib/ewl_context_menu.c
index f1202b7..f8a2781 100644
--- a/src/lib/ewl_context_menu.c
+++ b/src/lib/ewl_context_menu.c
@@ -10,7 +10,7 @@
static Ewl_Context_Menu *ewl_context_menu_grabber = NULL;
static int ewl_context_menu_mouse_feed(Ewl_Context_Menu *cm,
- Ewl_Embed *emb, int x, int y);
+ Ewl_Embed *emb, int x, int y);
static void ewl_context_menu_grabber_set(Ewl_Context_Menu *cm);
static void ewl_context_menu_grabber_unset(Ewl_Context_Menu *cm);
@@ -29,11 +29,11 @@ ewl_context_menu_new(void)
cm = NEW(Ewl_Context_Menu, 1);
if (!cm)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_context_menu_init(cm)) {
- ewl_widget_destroy(EWL_WIDGET(cm));
- cm = NULL;
+ ewl_widget_destroy(EWL_WIDGET(cm));
+ cm = NULL;
}
DRETURN_PTR(EWL_WIDGET(cm), DLEVEL_STABLE);
@@ -58,14 +58,14 @@ ewl_context_menu_init(Ewl_Context_Menu *cm)
w = EWL_WIDGET(cm);
if (!ewl_popup_init(EWL_POPUP(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_CONTEXT_MENU_TYPE);
/* XXX This isn't really correct */
ewl_widget_appearance_set(w, EWL_MENU_TYPE);
//ewl_widget_appearance_set(w, EWL_CONTEXT_MENU_TYPE"/"EWL_POPUP_TYPE);
ewl_object_alignment_set(EWL_OBJECT(w),
- EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
+ EWL_FLAG_ALIGN_LEFT | EWL_FLAG_ALIGN_TOP);
ewl_popup_type_set(EWL_POPUP(cm), EWL_POPUP_TYPE_MOUSE);
oh = ewl_theme_data_int_get(w, "/context_menu/hoffset");
ov = ewl_theme_data_int_get(w, "/context_menu/voffset");
@@ -75,13 +75,13 @@ ewl_context_menu_init(Ewl_Context_Menu *cm)
/* add the callbacks */
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_context_menu_cb_mouse_down, NULL);
+ ewl_context_menu_cb_mouse_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_context_menu_cb_mouse_move, NULL);
+ ewl_context_menu_cb_mouse_move, NULL);
ewl_callback_append(w, EWL_CALLBACK_HIDE,
- ewl_context_menu_cb_hide, NULL);
+ ewl_context_menu_cb_hide, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
- ewl_context_menu_cb_focus_in, NULL);
+ ewl_context_menu_cb_focus_in, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -108,22 +108,22 @@ ewl_context_menu_attach(Ewl_Context_Menu *cm, Ewl_Widget *w)
emb = ewl_embed_widget_find(w);
if (!emb) {
- DWARNING("Provided widget has no embed parent.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Provided widget has no embed parent.");
+ DRETURN(DLEVEL_STABLE);
}
follow = ewl_popup_follow_get(EWL_POPUP(cm));
if (!follow)
- ewl_popup_follow_set(EWL_POPUP(cm), EWL_WIDGET(emb));
+ ewl_popup_follow_set(EWL_POPUP(cm), EWL_WIDGET(emb));
else if (follow != EWL_WIDGET(emb)) {
- DWARNING("Sorry, the context menu doesn't work in multiple embeds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Sorry, the context menu doesn't work in multiple embeds.");
+ DRETURN(DLEVEL_STABLE);
}
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_context_menu_cb_attach_mouse_down, cm);
+ ewl_context_menu_cb_attach_mouse_down, cm);
DRETURN(DLEVEL_STABLE);
}
@@ -144,7 +144,7 @@ ewl_context_menu_detach(Ewl_Context_Menu *cm, Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
ewl_callback_del(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_context_menu_cb_attach_mouse_down);
+ ewl_context_menu_cb_attach_mouse_down);
DRETURN(DLEVEL_STABLE);
}
@@ -152,7 +152,7 @@ ewl_context_menu_detach(Ewl_Context_Menu *cm, Ewl_Widget *w)
/**
* @param cm: the context menu to set the container
* @param c: the container to use inside of the context menu, if @a c is
- * NULL then this function will use a vbox instead
+ * NULL then this function will use a vbox instead
* @brief set a custom container for the context menu
*
* This function give you the ability to set a custom container as
@@ -176,17 +176,17 @@ ewl_context_menu_container_set(Ewl_Context_Menu *cm, Ewl_Container *c)
/* if there is not a container specified we will create a vbox as
* default */
if (!c) {
- c = EWL_CONTAINER(ewl_vbox_new());
- ewl_object_fill_policy_set(EWL_OBJECT(c), EWL_FLAG_FILL_HFILL);
+ c = EWL_CONTAINER(ewl_vbox_new());
+ ewl_object_fill_policy_set(EWL_OBJECT(c), EWL_FLAG_FILL_HFILL);
}
/* remove the old container */
if (cm->container) {
- old_c = EWL_CONTAINER(cm->container);
- ewl_container_redirect_set(EWL_CONTAINER(cm), NULL);
- ewl_container_child_remove(EWL_CONTAINER(cm),
- EWL_WIDGET(old_c));
- cm->container = NULL;
+ old_c = EWL_CONTAINER(cm->container);
+ ewl_container_redirect_set(EWL_CONTAINER(cm), NULL);
+ ewl_container_child_remove(EWL_CONTAINER(cm),
+ EWL_WIDGET(old_c));
+ cm->container = NULL;
}
/* now we can append the new container */
@@ -199,7 +199,7 @@ ewl_context_menu_container_set(Ewl_Context_Menu *cm, Ewl_Container *c)
/* add the callbacks to the last container in the redirect list */
red = ewl_container_end_redirect_get(c);
if (!red)
- red = c;
+ red = c;
/* we need to keep a reference to the old callbacks before we
* override them */
@@ -213,13 +213,13 @@ ewl_context_menu_container_set(Ewl_Context_Menu *cm, Ewl_Container *c)
* Note: We leave internal widgets out because they are part of the
* container and not of the context menu */
if (old_c) {
- Ewl_Widget *child;
+ Ewl_Widget *child;
- ewl_container_child_iterate_begin(old_c);
- while ((child = ewl_container_child_next(old_c)))
- ewl_container_child_append(c, child);
- /* and now destroy the old container */
- ewl_widget_destroy(EWL_WIDGET(old_c));
+ ewl_container_child_iterate_begin(old_c);
+ while ((child = ewl_container_child_next(old_c)))
+ ewl_container_child_append(c, child);
+ /* and now destroy the old container */
+ ewl_widget_destroy(EWL_WIDGET(old_c));
}
cm->container = EWL_WIDGET(c);
@@ -237,7 +237,7 @@ ewl_context_menu_container_set(Ewl_Context_Menu *cm, Ewl_Container *c)
*/
void
ewl_context_menu_cb_attach_mouse_down(Ewl_Widget *w __UNUSED__, void *ev_data,
- void *user_data)
+ void *user_data)
{
Ewl_Event_Mouse_Down *ev;
@@ -249,11 +249,11 @@ ewl_context_menu_cb_attach_mouse_down(Ewl_Widget *w __UNUSED__, void *ev_data,
ev = ev_data;
if (ev->button != 3)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_widget_focus_send(EWL_WIDGET(user_data));
ewl_popup_mouse_position_set(EWL_POPUP(user_data), ev->base.x,
- ev->base.y);
+ ev->base.y);
ewl_widget_show(EWL_WIDGET(user_data));
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -269,30 +269,30 @@ ewl_context_menu_cb_attach_mouse_down(Ewl_Widget *w __UNUSED__, void *ev_data,
*/
void
ewl_context_menu_cb_mouse_down(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_CONTEXT_MENU_TYPE);
if (w == ewl_embed_focused_widget_get(EWL_EMBED(w))) {
- Ewl_Context_Menu *cm;
+ Ewl_Context_Menu *cm;
- cm = EWL_CONTEXT_MENU(w);
- if (cm->open_menu)
- {
- ewl_menu_collapse(EWL_MENU(cm->open_menu));
- cm->open_menu = NULL;
- }
+ cm = EWL_CONTEXT_MENU(w);
+ if (cm->open_menu)
+ {
+ ewl_menu_collapse(EWL_MENU(cm->open_menu));
+ cm->open_menu = NULL;
+ }
- while (EWL_POPUP_IS(w)) {
- ewl_widget_hide(w);
+ while (EWL_POPUP_IS(w)) {
+ ewl_widget_hide(w);
- w = ewl_popup_follow_get(EWL_POPUP(w));
- if (!w) break;
+ w = ewl_popup_follow_get(EWL_POPUP(w));
+ if (!w) break;
- w = EWL_WIDGET(ewl_embed_widget_find(w));
- }
+ w = EWL_WIDGET(ewl_embed_widget_find(w));
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -308,7 +308,7 @@ ewl_context_menu_cb_mouse_down(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_context_menu_cb_hide(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Context_Menu *cm;
@@ -319,8 +319,8 @@ ewl_context_menu_cb_hide(Ewl_Widget *w, void *ev_data __UNUSED__,
cm = EWL_CONTEXT_MENU(w);
if (cm->open_menu) {
- ewl_menu_collapse(EWL_MENU(cm->open_menu));
- cm->open_menu = NULL;
+ ewl_menu_collapse(EWL_MENU(cm->open_menu));
+ cm->open_menu = NULL;
}
ewl_context_menu_grabber_unset(cm);
@@ -338,7 +338,7 @@ ewl_context_menu_cb_hide(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_context_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Event_Mouse *ev;
Ewl_Context_Menu *cm;
@@ -363,35 +363,35 @@ ewl_context_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data,
ey += ev->y;
if ((ev->x > 0) && (ev->y > 0) &&
- (ev->x <= width) && (ev->y <= height)) {
- /* The mouse is actually in the popup, set the
- * popup to be active if it isn't already */
- if (ewl_embed_active_embed_get() != popup_embed)
- ewl_embed_active_set(popup_embed, TRUE);
+ (ev->x <= width) && (ev->y <= height)) {
+ /* The mouse is actually in the popup, set the
+ * popup to be active if it isn't already */
+ if (ewl_embed_active_embed_get() != popup_embed)
+ ewl_embed_active_set(popup_embed, TRUE);
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
else if (cm->open_menu &&
- ewl_menu_mouse_feed(EWL_MENU(cm->open_menu), ex, ey)) {
- DRETURN(DLEVEL_STABLE);
+ ewl_menu_mouse_feed(EWL_MENU(cm->open_menu), ex, ey)) {
+ DRETURN(DLEVEL_STABLE);
}
else {
- Ewl_Widget *follow;
- Ewl_Embed *popup;
+ Ewl_Widget *follow;
+ Ewl_Embed *popup;
- /* We now feed the mouse moves to only the parent if the mouse
- * is inside of it */
- popup = EWL_EMBED(w);
- do {
- follow = ewl_popup_follow_get(EWL_POPUP(popup));
- if (!follow) break;
+ /* We now feed the mouse moves to only the parent if the mouse
+ * is inside of it */
+ popup = EWL_EMBED(w);
+ do {
+ follow = ewl_popup_follow_get(EWL_POPUP(popup));
+ if (!follow) break;
- popup = ewl_embed_widget_find(follow);
+ popup = ewl_embed_widget_find(follow);
- if (ewl_context_menu_mouse_feed(cm, popup, ex, ey))
- break;
+ if (ewl_context_menu_mouse_feed(cm, popup, ex, ey))
+ break;
- } while (EWL_POPUP_IS(popup));
+ } while (EWL_POPUP_IS(popup));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -407,7 +407,7 @@ ewl_context_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data,
*/
void
ewl_context_menu_cb_focus_in(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -440,19 +440,19 @@ ewl_context_menu_cb_child_add(Ewl_Container *c, Ewl_Widget *w)
/* call the overridden callback first */
if (cm->child_add)
- cm->child_add(c, w);
+ cm->child_add(c, w);
if (ewl_widget_internal_is(w) || !ewl_widget_focusable_get(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (EWL_MENU_IS(w))
- EWL_MENU_ITEM(w)->inmenu = EWL_WIDGET(cm);
+ EWL_MENU_ITEM(w)->inmenu = EWL_WIDGET(cm);
else
- ewl_callback_append(w, EWL_CALLBACK_CLICKED,
- ewl_context_menu_cb_child_clicked, cm);
+ ewl_callback_append(w, EWL_CALLBACK_CLICKED,
+ ewl_context_menu_cb_child_clicked, cm);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_IN,
- ewl_context_menu_cb_child_mouse_in, NULL);
+ ewl_context_menu_cb_child_mouse_in, NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -478,20 +478,20 @@ ewl_context_menu_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx)
cm = EWL_CONTEXT_MENU(ewl_embed_widget_find(EWL_WIDGET(c)));
/* call the overridden callback first */
if (cm->child_remove)
- cm->child_remove(c, w, idx);
+ cm->child_remove(c, w, idx);
if (ewl_widget_internal_is(w) || !ewl_widget_focusable_get(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (EWL_MENU_IS(w)) {
- EWL_MENU_ITEM(w)->inmenu = NULL;
+ EWL_MENU_ITEM(w)->inmenu = NULL;
}
else
- ewl_callback_del(w, EWL_CALLBACK_CLICKED,
- ewl_context_menu_cb_child_clicked);
+ ewl_callback_del(w, EWL_CALLBACK_CLICKED,
+ ewl_context_menu_cb_child_clicked);
ewl_callback_del(w, EWL_CALLBACK_MOUSE_IN,
- ewl_context_menu_cb_child_mouse_in);
+ ewl_context_menu_cb_child_mouse_in);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -506,7 +506,7 @@ ewl_context_menu_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx)
*/
void
ewl_context_menu_cb_child_mouse_in(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Context_Menu *cm;
Ewl_Embed *emb;
@@ -521,8 +521,8 @@ ewl_context_menu_cb_child_mouse_in(Ewl_Widget *w, void *ev_data __UNUSED__,
/* hide the open sub menu */
if (cm->open_menu && (cm->open_menu != w))
{
- ewl_menu_collapse(EWL_MENU(cm->open_menu));
- cm->open_menu = NULL;
+ ewl_menu_collapse(EWL_MENU(cm->open_menu));
+ cm->open_menu = NULL;
}
/* send the focus to the child */
@@ -544,7 +544,7 @@ ewl_context_menu_cb_child_mouse_in(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_context_menu_cb_child_clicked(Ewl_Widget *w __UNUSED__,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
Ewl_Widget *c;
@@ -555,12 +555,12 @@ ewl_context_menu_cb_child_clicked(Ewl_Widget *w __UNUSED__,
c = EWL_WIDGET(user_data);
while (EWL_POPUP_IS(c)) {
- ewl_widget_hide(c);
+ ewl_widget_hide(c);
- c = ewl_popup_follow_get(EWL_POPUP(c));
- if (!c) break;
+ c = ewl_popup_follow_get(EWL_POPUP(c));
+ if (!c) break;
- c = EWL_WIDGET(ewl_embed_widget_find(c));
+ c = EWL_WIDGET(ewl_embed_widget_find(c));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -583,8 +583,8 @@ ewl_context_menu_mouse_feed(Ewl_Context_Menu *cm, Ewl_Embed *emb, int x, int y)
y -= emb_y;
if ((x > 0) && (y > 0) && (x <= emb_w) && (y <= emb_h)) {
- ewl_embed_mouse_move_feed(emb, x, y, 0);
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ ewl_embed_mouse_move_feed(emb, x, y, 0);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
@@ -598,10 +598,10 @@ ewl_context_menu_grabber_set(Ewl_Context_Menu *cm)
DCHECK_TYPE(cm, EWL_CONTEXT_MENU_TYPE);
if (cm == ewl_context_menu_grabber)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_context_menu_grabber)
- ewl_context_menu_grabber_unset(ewl_context_menu_grabber);
+ ewl_context_menu_grabber_unset(ewl_context_menu_grabber);
ewl_context_menu_grabber = cm;
ewl_window_keyboard_grab_set(EWL_WINDOW(cm), TRUE);
@@ -618,10 +618,10 @@ ewl_context_menu_grabber_unset(Ewl_Context_Menu *cm)
DCHECK_TYPE(cm, EWL_CONTEXT_MENU_TYPE);
if (cm == ewl_context_menu_grabber) {
- ewl_window_keyboard_grab_set(EWL_WINDOW(cm), FALSE);
- ewl_window_pointer_grab_set(EWL_WINDOW(cm), FALSE);
+ ewl_window_keyboard_grab_set(EWL_WINDOW(cm), FALSE);
+ ewl_window_pointer_grab_set(EWL_WINDOW(cm), FALSE);
- ewl_context_menu_grabber = NULL;
+ ewl_context_menu_grabber = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_context_menu.h b/src/lib/ewl_context_menu.h
index e83236b..fed03de 100644
--- a/src/lib/ewl_context_menu.h
+++ b/src/lib/ewl_context_menu.h
@@ -25,7 +25,7 @@
* Returns TRUE if the widget is an Ewl_Context_Menu, FALSE otherwise
*/
#define EWL_CONTEXT_MENU_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), \
- EWL_CONTEXT_MENU_TYPE))
+ EWL_CONTEXT_MENU_TYPE))
/**
* Ewl_Context_Menu
@@ -51,31 +51,31 @@ struct Ewl_Context_Menu
};
Ewl_Widget *ewl_context_menu_new(void);
-int ewl_context_menu_init(Ewl_Context_Menu *cm);
-void ewl_context_menu_attach(Ewl_Context_Menu *cm, Ewl_Widget *w);
-void ewl_context_menu_detach(Ewl_Context_Menu *cm, Ewl_Widget *w);
+int ewl_context_menu_init(Ewl_Context_Menu *cm);
+void ewl_context_menu_attach(Ewl_Context_Menu *cm, Ewl_Widget *w);
+void ewl_context_menu_detach(Ewl_Context_Menu *cm, Ewl_Widget *w);
-void ewl_context_menu_container_set(Ewl_Context_Menu *cm,
- Ewl_Container *c);
+void ewl_context_menu_container_set(Ewl_Context_Menu *cm,
+ Ewl_Container *c);
/*
* Internal, override at your own risk
*/
void ewl_context_menu_cb_hide(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_context_menu_cb_mouse_down(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_context_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_context_menu_cb_focus_in(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_context_menu_cb_attach_mouse_down(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_context_menu_cb_child_add(Ewl_Container *c, Ewl_Widget *w);
void ewl_context_menu_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx);
void ewl_context_menu_cb_child_mouse_in(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_context_menu_cb_child_clicked(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @}
diff --git a/src/lib/ewl_cursor.c b/src/lib/ewl_cursor.c
index 59884bc..1b63b37 100644
--- a/src/lib/ewl_cursor.c
+++ b/src/lib/ewl_cursor.c
@@ -21,12 +21,12 @@ ewl_cursor_new(void)
w = NEW(Ewl_Cursor, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_cursor_init(EWL_CURSOR(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -46,7 +46,7 @@ ewl_cursor_init(Ewl_Cursor *cursor)
DCHECK_PARAM_PTR_RET(cursor, FALSE);
if (!ewl_window_init(EWL_WINDOW(cursor)))
- DRETURN_INT(FALSE, DLEVEL_UNSTABLE);
+ DRETURN_INT(FALSE, DLEVEL_UNSTABLE);
ewl_widget_appearance_set(w, EWL_CURSOR_TYPE);
ewl_widget_inherit(w, EWL_CURSOR_TYPE);
@@ -56,9 +56,9 @@ ewl_cursor_init(Ewl_Cursor *cursor)
ewl_embed_engine_name_set(EWL_EMBED(cursor), "evas_buffer");
ewl_callback_append(w, EWL_CALLBACK_VALUE_CHANGED,
- ewl_cursor_cb_render, NULL);
+ ewl_cursor_cb_render, NULL);
ewl_callback_append(w, EWL_CALLBACK_DESTROY,
- ewl_cursor_cb_destroy, NULL);
+ ewl_cursor_cb_destroy, NULL);
DRETURN_INT(TRUE, DLEVEL_UNSTABLE);
}
@@ -80,22 +80,22 @@ ewl_cursor_cb_render(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
*/
parent = ewl_widget_focused_get();
if (parent)
- parent = EWL_WIDGET(ewl_embed_widget_find(parent));
+ parent = EWL_WIDGET(ewl_embed_widget_find(parent));
if (!parent)
- DRETURN(DLEVEL_UNSTABLE);
+ DRETURN(DLEVEL_UNSTABLE);
if (cursor->handle)
- ewl_engine_pointer_free(EWL_EMBED(parent), cursor->handle);
+ ewl_engine_pointer_free(EWL_EMBED(parent), cursor->handle);
width = ewl_object_current_w_get(EWL_OBJECT(cursor));
height = ewl_object_current_h_get(EWL_OBJECT(cursor));
handle = ewl_engine_pointer_data_new(EWL_EMBED(parent),
- EWL_EMBED(cursor)->canvas_window, width, height);
+ EWL_EMBED(cursor)->canvas_window, width, height);
if (EWL_EMBED(parent)->cursor == cursor->handle)
- ewl_engine_pointer_set(EWL_EMBED(parent), handle);
+ ewl_engine_pointer_set(EWL_EMBED(parent), handle);
cursor->handle = handle;
@@ -104,7 +104,7 @@ ewl_cursor_cb_render(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
static void
ewl_cursor_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Cursor *cursor = EWL_CURSOR(w);
@@ -113,8 +113,8 @@ ewl_cursor_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
/* FIXME: Also needs to be handled for the correct engine refs
if (cursor->handle)
- ewl_engine_pointer_free(parent, cursor->handle);
- */
+ ewl_engine_pointer_free(parent, cursor->handle);
+ */
cursor->handle = 0;
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_cursor.h b/src/lib/ewl_cursor.h
index 8ca4261..9f372a8 100644
--- a/src/lib/ewl_cursor.h
+++ b/src/lib/ewl_cursor.h
@@ -47,13 +47,13 @@ typedef struct Ewl_Cursor Ewl_Cursor;
*/
struct Ewl_Cursor
{
- Ewl_Window window; /**< Inherit from Ewl_Window */
- int refcount; /**< Number of references to cursor */
- int handle; /**< Engine id for generated cursor */
+ Ewl_Window window; /**< Inherit from Ewl_Window */
+ int refcount; /**< Number of references to cursor */
+ int handle; /**< Engine id for generated cursor */
};
Ewl_Widget *ewl_cursor_new(void);
-int ewl_cursor_init(Ewl_Cursor *c);
+int ewl_cursor_init(Ewl_Cursor *c);
/**
* @}
diff --git a/src/lib/ewl_datepicker.c b/src/lib/ewl_datepicker.c
index 898e7f8..2c3dd26 100644
--- a/src/lib/ewl_datepicker.c
+++ b/src/lib/ewl_datepicker.c
@@ -8,7 +8,7 @@
#include "ewl_debug.h"
static void ewl_datepicker_cb_dropdown(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @return Returns NULL on failure, a new Ewl_Datepicker on success
@@ -23,11 +23,11 @@ ewl_datepicker_new(void)
ib = NEW(Ewl_Datepicker, 1);
if (!ib)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_datepicker_init(ib)) {
- ewl_widget_destroy(EWL_WIDGET(ib));
- ib = NULL;
+ ewl_widget_destroy(EWL_WIDGET(ib));
+ ib = NULL;
}
DRETURN_PTR(EWL_WIDGET(ib), DLEVEL_STABLE);
@@ -45,40 +45,40 @@ ewl_datepicker_init(Ewl_Datepicker *dp)
DCHECK_PARAM_PTR_RET(dp, FALSE);
if (!ewl_text_init(EWL_TEXT(dp)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(dp), EWL_DATEPICKER_TYPE);
ewl_widget_inherit(EWL_WIDGET(dp), EWL_DATEPICKER_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(dp), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
dp->calendar_window = ewl_popup_new();
ewl_widget_appearance_set(dp->calendar_window,
- EWL_DATEPICKER_TYPE"/"EWL_POPUP_TYPE);
+ EWL_DATEPICKER_TYPE"/"EWL_POPUP_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(dp->calendar_window),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_popup_type_set(EWL_POPUP(dp->calendar_window),
- EWL_POPUP_TYPE_MENU_VERTICAL);
+ EWL_POPUP_TYPE_MENU_VERTICAL);
ewl_popup_follow_set(EWL_POPUP(dp->calendar_window), EWL_WIDGET(dp));
ewl_window_keyboard_grab_set(EWL_WINDOW(dp->calendar_window), TRUE);
ewl_window_pointer_grab_set(EWL_WINDOW(dp->calendar_window), TRUE);
ewl_callback_append(dp->calendar_window, EWL_CALLBACK_MOUSE_DOWN,
- ewl_datepicker_cb_window_mouse_down, dp);
+ ewl_datepicker_cb_window_mouse_down, dp);
dp->calendar = ewl_calendar_new();
ewl_object_fill_policy_set(EWL_OBJECT(dp->calendar),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_container_child_append(EWL_CONTAINER(dp->calendar_window),
- dp->calendar);
+ dp->calendar);
ewl_callback_append(EWL_WIDGET(dp->calendar),
- EWL_CALLBACK_VALUE_CHANGED,
- ewl_datepicker_cb_value_changed, dp);
+ EWL_CALLBACK_VALUE_CHANGED,
+ ewl_datepicker_cb_value_changed, dp);
ewl_widget_show(dp->calendar);
ewl_callback_prepend(EWL_WIDGET(dp), EWL_CALLBACK_DESTROY,
- ewl_datepicker_cb_destroy, dp);
+ ewl_datepicker_cb_destroy, dp);
ewl_callback_append(EWL_WIDGET(dp), EWL_CALLBACK_MOUSE_DOWN,
- ewl_datepicker_cb_dropdown, NULL);
+ ewl_datepicker_cb_dropdown, NULL);
ewl_callback_call(EWL_WIDGET(dp->calendar), EWL_CALLBACK_VALUE_CHANGED);
@@ -95,7 +95,7 @@ ewl_datepicker_init(Ewl_Datepicker *dp)
*/
void
ewl_datepicker_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Datepicker *dp;
@@ -119,7 +119,7 @@ ewl_datepicker_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_datepicker_cb_value_changed(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *user_data)
+ void *user_data)
{
char *date;
Ewl_Datepicker* dp;
@@ -148,21 +148,21 @@ ewl_datepicker_cb_value_changed(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
*/
void
ewl_datepicker_cb_window_mouse_down(Ewl_Widget *w, void *ev __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_EMBED_TYPE);
if (w == ewl_embed_focused_widget_get(EWL_EMBED(w)))
- ewl_widget_hide(w);
+ ewl_widget_hide(w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_datepicker_cb_dropdown(Ewl_Widget *w, void *ev __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Datepicker *dp;
diff --git a/src/lib/ewl_datepicker.h b/src/lib/ewl_datepicker.h
index 7a9cf60..bb13a52 100644
--- a/src/lib/ewl_datepicker.h
+++ b/src/lib/ewl_datepicker.h
@@ -49,15 +49,15 @@ typedef struct Ewl_Datepicker Ewl_Datepicker;
*/
struct Ewl_Datepicker
{
- Ewl_Text text; /**< Inherit from Ewl_Text */
+ Ewl_Text text; /**< Inherit from Ewl_Text */
- Ewl_Widget *calendar; /**< The calendar */
- Ewl_Widget *calendar_window; /**< The window */
+ Ewl_Widget *calendar; /**< The calendar */
+ Ewl_Widget *calendar_window; /**< The window */
};
Ewl_Widget *ewl_datepicker_new(void);
-int ewl_datepicker_init(Ewl_Datepicker* datepicker);
+int ewl_datepicker_init(Ewl_Datepicker* datepicker);
/*
* Internally used callbacks, override at your risk
@@ -65,7 +65,7 @@ int ewl_datepicker_init(Ewl_Datepicker* datepicker);
void ewl_datepicker_cb_destroy(Ewl_Widget *w, void *ev, void *user_data);
void ewl_datepicker_cb_value_changed(Ewl_Widget *w, void *ev, void *user_data);
void ewl_datepicker_cb_window_mouse_down(Ewl_Widget *w, void *ev,
- void *user_data);
+ void *user_data);
/**
* @}
diff --git a/src/lib/ewl_debug.h b/src/lib/ewl_debug.h
index ab9089b..7ccb79c 100644
--- a/src/lib/ewl_debug.h
+++ b/src/lib/ewl_debug.h
@@ -25,15 +25,15 @@ typedef struct Ewl_Config_Cache Ewl_Config_Cache;
*/
struct Ewl_Config_Cache
{
- int level; /**< Debug level */
- unsigned char enable:1; /**< Enable debugging */
- unsigned char segv:1; /**< Segv on D* messages */
- unsigned char backtrace:1; /**< Print backtrace on D* messages */
- unsigned char evas_render:1; /**< Debug evas render calls */
- unsigned char gc_reap:1; /**< Debug garbage collection */
-
- unsigned char print_signals:1; /**< Print theme signals */
- unsigned char print_keys:1; /**< Print theem keys */
+ int level; /**< Debug level */
+ unsigned char enable:1; /**< Enable debugging */
+ unsigned char segv:1; /**< Segv on D* messages */
+ unsigned char backtrace:1; /**< Print backtrace on D* messages */
+ unsigned char evas_render:1; /**< Debug evas render calls */
+ unsigned char gc_reap:1; /**< Debug garbage collection */
+
+ unsigned char print_signals:1; /**< Print theme signals */
+ unsigned char print_keys:1; /**< Print theem keys */
};
extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
@@ -46,9 +46,9 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
if (DEBUGGING(lvl)) \
{ \
- ewl_debug_indent_print(1); \
- fprintf(stderr, "--> %f - %s:%i\tEntering %s();\n", \
- ecore_time_get(), __FILE__, __LINE__, __func__); \
+ ewl_debug_indent_print(1); \
+ fprintf(stderr, "--> %f - %s:%i\tEntering %s();\n", \
+ ecore_time_get(), __FILE__, __LINE__, __func__); \
} \
}
@@ -56,9 +56,9 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
if (DEBUGGING(lvl)) \
{ \
- ewl_debug_indent_print(-1); \
- fprintf(stderr, "<-- %f - %s:%i\tLeaving %s();\n", \
- ecore_time_get(), __FILE__, __LINE__, __func__); \
+ ewl_debug_indent_print(-1); \
+ fprintf(stderr, "<-- %f - %s:%i\tLeaving %s();\n", \
+ ecore_time_get(), __FILE__, __LINE__, __func__); \
} \
}
@@ -67,9 +67,9 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
DLEAVE_FUNCTION(lvl); \
if (DEBUGGING(lvl)) \
{ \
- ewl_debug_indent_print(0); \
- fprintf(stderr, "<-- %f - %s:%i\tReturn in %s();\n", \
- ecore_time_get(), __FILE__, __LINE__, __func__); \
+ ewl_debug_indent_print(0); \
+ fprintf(stderr, "<-- %f - %s:%i\tReturn in %s();\n", \
+ ecore_time_get(), __FILE__, __LINE__, __func__); \
} \
return; \
}
@@ -79,9 +79,9 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
DLEAVE_FUNCTION(lvl); \
if (DEBUGGING(lvl)) \
{ \
- ewl_debug_indent_print(0); \
- fprintf(stderr, "<-- %f - %s:%i\tReturning %p in %s();\n", \
- ecore_time_get(), __FILE__, __LINE__, (void *) (ptr), __func__); \
+ ewl_debug_indent_print(0); \
+ fprintf(stderr, "<-- %f - %s:%i\tReturning %p in %s();\n", \
+ ecore_time_get(), __FILE__, __LINE__, (void *) (ptr), __func__); \
} \
return (void *)(ptr); \
}
@@ -91,9 +91,9 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
DLEAVE_FUNCTION(lvl); \
if (DEBUGGING(lvl)) \
{ \
- ewl_debug_indent_print(0); \
- fprintf(stderr, "<-- %f - %s:%i\tReturning %f in %s();\n", \
- ecore_time_get(), __FILE__, __LINE__, (float) (num), __func__); \
+ ewl_debug_indent_print(0); \
+ fprintf(stderr, "<-- %f - %s:%i\tReturning %f in %s();\n", \
+ ecore_time_get(), __FILE__, __LINE__, (float) (num), __func__); \
} \
return num; \
}
@@ -103,9 +103,9 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
DLEAVE_FUNCTION(lvl); \
if (DEBUGGING(lvl)) \
{ \
- ewl_debug_indent_print(0); \
- fprintf(stderr, "<-- %f - %s:%i\tReturning %i in %s();\n", \
- ecore_time_get(), __FILE__, __LINE__, (int) (num), __func__); \
+ ewl_debug_indent_print(0); \
+ fprintf(stderr, "<-- %f - %s:%i\tReturning %i in %s();\n", \
+ ecore_time_get(), __FILE__, __LINE__, (int) (num), __func__); \
} \
return num; \
}
@@ -114,7 +114,7 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
ewl_print_warning(); \
fprintf(stderr, "\tIn function:\n\n" \
- "\t%s();\n\n", __func__); \
+ "\t%s();\n\n", __func__); \
fprintf(stderr, fmt, ## args); \
fprintf(stderr, "\n"); \
ewl_backtrace(); \
@@ -125,16 +125,16 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
if (!(ptr)) \
{ \
- ewl_print_warning(); \
- fprintf(stderr, "\tThis program is calling:\n\n" \
- "\t%s();\n\n" \
- "\tWith the parameter:\n\n" \
- "\t%s\n\n" \
- "\tbeing NULL. Please fix your program.\n", \
- __func__, # ptr); \
- ewl_backtrace(); \
- ewl_segv(); \
- return; \
+ ewl_print_warning(); \
+ fprintf(stderr, "\tThis program is calling:\n\n" \
+ "\t%s();\n\n" \
+ "\tWith the parameter:\n\n" \
+ "\t%s\n\n" \
+ "\tbeing NULL. Please fix your program.\n", \
+ __func__, # ptr); \
+ ewl_backtrace(); \
+ ewl_segv(); \
+ return; \
} \
}
@@ -142,16 +142,16 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
if (!(ptr)) \
{ \
- ewl_print_warning(); \
- fprintf(stderr, "\tThis program is calling:\n\n" \
- "\t%s();\n\n" \
- "\tWith the parameter:\n\n" \
- "\t%s\n\n" \
- "\tbeing NULL. Please fix your program.\n", \
- __func__, # ptr); \
- ewl_backtrace(); \
- ewl_segv(); \
- return ret; \
+ ewl_print_warning(); \
+ fprintf(stderr, "\tThis program is calling:\n\n" \
+ "\t%s();\n\n" \
+ "\tWith the parameter:\n\n" \
+ "\t%s\n\n" \
+ "\tbeing NULL. Please fix your program.\n", \
+ __func__, # ptr); \
+ ewl_backtrace(); \
+ ewl_segv(); \
+ return ret; \
} \
}
@@ -159,20 +159,20 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
if (ptr && !ewl_widget_type_is(EWL_WIDGET(ptr), type)) \
{ \
- ewl_print_warning(); \
- fprintf(stderr, "\tThis program is calling:\n\n" \
- "\t%s();\n\n" \
- "\tWith the paramter:\n\n" \
- "\t%s\n\n" \
- "\tas the wrong type. (%s) instead of (%s).\n" \
- "\tPlease fix your program.\n", \
- __func__, # ptr, \
- (EWL_WIDGET(ptr)->inheritance ? \
- EWL_WIDGET(ptr)->inheritance : \
- "NULL") , type); \
- ewl_backtrace(); \
- ewl_segv(); \
- return; \
+ ewl_print_warning(); \
+ fprintf(stderr, "\tThis program is calling:\n\n" \
+ "\t%s();\n\n" \
+ "\tWith the paramter:\n\n" \
+ "\t%s\n\n" \
+ "\tas the wrong type. (%s) instead of (%s).\n" \
+ "\tPlease fix your program.\n", \
+ __func__, # ptr, \
+ (EWL_WIDGET(ptr)->inheritance ? \
+ EWL_WIDGET(ptr)->inheritance : \
+ "NULL") , type); \
+ ewl_backtrace(); \
+ ewl_segv(); \
+ return; \
} \
}
@@ -180,20 +180,20 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
if (ptr && !ewl_widget_type_is(EWL_WIDGET(ptr), type)) \
{ \
- ewl_print_warning(); \
- fprintf(stderr, "\tThis program is calling:\n\n" \
- "\t%s();\n\n" \
- "\tWith the paramter:\n\n" \
- "\t%s\n\n" \
- "\tas the wrong type. (%s) instead of (%s).\n" \
- "\tPlease fix your program.\n", \
- __func__, # ptr, \
- (EWL_WIDGET(ptr)->inheritance ? \
- EWL_WIDGET(ptr)->inheritance : \
- "NULL") , type); \
- ewl_backtrace(); \
- ewl_segv(); \
- return ret; \
+ ewl_print_warning(); \
+ fprintf(stderr, "\tThis program is calling:\n\n" \
+ "\t%s();\n\n" \
+ "\tWith the paramter:\n\n" \
+ "\t%s\n\n" \
+ "\tas the wrong type. (%s) instead of (%s).\n" \
+ "\tPlease fix your program.\n", \
+ __func__, # ptr, \
+ (EWL_WIDGET(ptr)->inheritance ? \
+ EWL_WIDGET(ptr)->inheritance : \
+ "NULL") , type); \
+ ewl_backtrace(); \
+ ewl_segv(); \
+ return ret; \
} \
}
@@ -209,13 +209,13 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
#define DCHECK_PARAM_PTR(ptr) \
{ \
if (!(ptr)) { \
- return; \
+ return; \
} \
}
#define DCHECK_PARAM_PTR_RET(ptr, ret) \
{ \
if (!(ptr)) { \
- return ret; \
+ return ret; \
} \
}
#define DCHECK_TYPE(ptr, type) {}
@@ -226,7 +226,7 @@ extern Ewl_Config_Cache ewl_config_cache; /**< system debug data */
{ \
ewl_print_warning(); \
fprintf(stderr, "\tIn function:\n\n" \
- "\t%s();\n\n", __func__); \
+ "\t%s();\n\n", __func__); \
fprintf(stderr, fmt); \
}
diff --git a/src/lib/ewl_dialog.c b/src/lib/ewl_dialog.c
index 8486d97..cdd6e1f 100644
--- a/src/lib/ewl_dialog.c
+++ b/src/lib/ewl_dialog.c
@@ -21,12 +21,12 @@ ewl_dialog_new(void)
d = NEW(Ewl_Dialog, 1);
if (!d) {
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!ewl_dialog_init(d)) {
- ewl_widget_destroy(EWL_WIDGET(d));
- d = NULL;
+ ewl_widget_destroy(EWL_WIDGET(d));
+ d = NULL;
}
DRETURN_PTR(EWL_WIDGET(d), DLEVEL_STABLE);
@@ -48,7 +48,7 @@ ewl_dialog_init(Ewl_Dialog *dialog)
w = EWL_WIDGET(dialog);
if (!ewl_window_init(EWL_WINDOW(dialog))) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_widget_appearance_set(w, EWL_DIALOG_TYPE);
@@ -61,7 +61,7 @@ ewl_dialog_init(Ewl_Dialog *dialog)
*/
dialog->box = ewl_vbox_new();
if (!dialog->box) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_container_child_append(EWL_CONTAINER(dialog), dialog->box);
ewl_widget_internal_set(dialog->box, TRUE);
@@ -73,7 +73,7 @@ ewl_dialog_init(Ewl_Dialog *dialog)
*/
dialog->vbox = ewl_vbox_new();
if (!dialog->vbox) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_container_child_append(EWL_CONTAINER(dialog->box), dialog->vbox);
@@ -84,7 +84,7 @@ ewl_dialog_init(Ewl_Dialog *dialog)
dialog->separator = ewl_hseparator_new();
if (!dialog->separator) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_container_child_append(EWL_CONTAINER(dialog->box), dialog->separator);
ewl_widget_internal_set(dialog->separator, TRUE);
@@ -96,21 +96,21 @@ ewl_dialog_init(Ewl_Dialog *dialog)
dialog->action_area = ewl_cell_new();
ewl_widget_appearance_set(dialog->action_area, "actionarea");
ewl_object_fill_policy_set(EWL_OBJECT(dialog->action_area),
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
ewl_widget_internal_set(dialog->action_area, TRUE);
ewl_container_child_append(EWL_CONTAINER(dialog->box),
- dialog->action_area);
+ dialog->action_area);
ewl_widget_show(dialog->action_area);
dialog->action_box = ewl_hbox_new();
if (!dialog->action_box) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_container_child_append(EWL_CONTAINER(dialog->action_area),
- dialog->action_box);
+ dialog->action_box);
ewl_box_homogeneous_set(EWL_BOX(dialog->action_box), FALSE);
ewl_object_fill_policy_set(EWL_OBJECT(dialog->action_box),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_widget_internal_set(dialog->action_box, TRUE);
ewl_widget_show(dialog->action_box);
@@ -133,7 +133,7 @@ ewl_dialog_action_position_set(Ewl_Dialog *d, Ewl_Position pos)
DCHECK_TYPE(d, EWL_DIALOG_TYPE);
if (pos == d->position) {
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
d->position = pos;
@@ -142,24 +142,24 @@ ewl_dialog_action_position_set(Ewl_Dialog *d, Ewl_Position pos)
* First determine the orientation of the dialog area.
*/
if (pos & (EWL_POSITION_LEFT | EWL_POSITION_RIGHT)) {
- ewl_box_orientation_set(EWL_BOX(d->box),
- EWL_ORIENTATION_HORIZONTAL);
- ewl_separator_orientation_set(EWL_SEPARATOR((d->separator)),
- EWL_ORIENTATION_VERTICAL);
- ewl_box_orientation_set(EWL_BOX(d->action_box),
- EWL_ORIENTATION_VERTICAL);
- ewl_object_fill_policy_set(EWL_OBJECT(d->action_area),
- EWL_FLAG_FILL_VFILL);
+ ewl_box_orientation_set(EWL_BOX(d->box),
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_separator_orientation_set(EWL_SEPARATOR((d->separator)),
+ EWL_ORIENTATION_VERTICAL);
+ ewl_box_orientation_set(EWL_BOX(d->action_box),
+ EWL_ORIENTATION_VERTICAL);
+ ewl_object_fill_policy_set(EWL_OBJECT(d->action_area),
+ EWL_FLAG_FILL_VFILL);
}
else {
- ewl_box_orientation_set(EWL_BOX(d->box),
- EWL_ORIENTATION_VERTICAL);
- ewl_separator_orientation_set(EWL_SEPARATOR((d->separator)),
- EWL_ORIENTATION_HORIZONTAL);
- ewl_box_orientation_set(EWL_BOX(d->action_box),
- EWL_ORIENTATION_HORIZONTAL);
- ewl_object_fill_policy_set(EWL_OBJECT(d->action_area),
- EWL_FLAG_FILL_HFILL);
+ ewl_box_orientation_set(EWL_BOX(d->box),
+ EWL_ORIENTATION_VERTICAL);
+ ewl_separator_orientation_set(EWL_SEPARATOR((d->separator)),
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_box_orientation_set(EWL_BOX(d->action_box),
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_object_fill_policy_set(EWL_OBJECT(d->action_area),
+ EWL_FLAG_FILL_HFILL);
}
ewl_container_child_remove(EWL_CONTAINER(d->box), d->separator);
@@ -169,16 +169,16 @@ ewl_dialog_action_position_set(Ewl_Dialog *d, Ewl_Position pos)
* Repack order of the widgets to match new position
*/
if (pos & (EWL_POSITION_LEFT | EWL_POSITION_TOP)) {
- ewl_container_child_prepend(EWL_CONTAINER(d->box),
- d->separator);
- ewl_container_child_prepend(EWL_CONTAINER(d->box),
- d->action_area);
+ ewl_container_child_prepend(EWL_CONTAINER(d->box),
+ d->separator);
+ ewl_container_child_prepend(EWL_CONTAINER(d->box),
+ d->action_area);
}
else {
- ewl_container_child_append(EWL_CONTAINER(d->box),
- d->separator);
- ewl_container_child_append(EWL_CONTAINER(d->box),
- d->action_area);
+ ewl_container_child_append(EWL_CONTAINER(d->box),
+ d->separator);
+ ewl_container_child_append(EWL_CONTAINER(d->box),
+ d->action_area);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -230,7 +230,7 @@ ewl_dialog_action_fill_policy_get(Ewl_Dialog *d)
DCHECK_TYPE_RET(d, EWL_DIALOG_TYPE, EWL_FLAG_FILL_NONE);
DRETURN_INT(ewl_object_fill_policy_get(EWL_OBJECT(d->action_box)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -264,7 +264,7 @@ ewl_dialog_action_alignment_get(Ewl_Dialog *d)
DCHECK_TYPE_RET(d, EWL_DIALOG_TYPE, EWL_FLAG_FILL_NONE);
DRETURN_INT(ewl_object_alignment_get(EWL_OBJECT(d->action_box)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -280,7 +280,7 @@ ewl_dialog_has_separator_get(Ewl_Dialog *dialog)
DCHECK_TYPE_RET(dialog, EWL_DIALOG_TYPE, FALSE);
if (!dialog)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
DRETURN_INT(dialog->separator != NULL, DLEVEL_STABLE);
}
@@ -302,23 +302,23 @@ ewl_dialog_has_separator_set(Ewl_Dialog *dialog, unsigned int has_sep)
DCHECK_TYPE(dialog, EWL_DIALOG_TYPE);
if (has_sep && (dialog->separator == NULL)) {
- ewl_container_child_iterate_begin(EWL_CONTAINER(EWL_DIALOG(dialog)->vbox));
- n = 0;
- child = ewl_container_child_next(EWL_CONTAINER(EWL_DIALOG(dialog)->vbox));
- while (child) {
- n++;
- child = ewl_container_child_next(EWL_CONTAINER(EWL_DIALOG(dialog)->vbox));
- }
- dialog->separator = ewl_hseparator_new();
- ewl_container_child_insert(EWL_CONTAINER(dialog->vbox),
- dialog->separator, n);
- ewl_object_fill_policy_set(EWL_OBJECT(dialog->separator),
- EWL_FLAG_FILL_SHRINK);
- ewl_widget_show(dialog->separator);
+ ewl_container_child_iterate_begin(EWL_CONTAINER(EWL_DIALOG(dialog)->vbox));
+ n = 0;
+ child = ewl_container_child_next(EWL_CONTAINER(EWL_DIALOG(dialog)->vbox));
+ while (child) {
+ n++;
+ child = ewl_container_child_next(EWL_CONTAINER(EWL_DIALOG(dialog)->vbox));
+ }
+ dialog->separator = ewl_hseparator_new();
+ ewl_container_child_insert(EWL_CONTAINER(dialog->vbox),
+ dialog->separator, n);
+ ewl_object_fill_policy_set(EWL_OBJECT(dialog->separator),
+ EWL_FLAG_FILL_SHRINK);
+ ewl_widget_show(dialog->separator);
} else if (!has_sep && (dialog->separator != NULL)) {
- ewl_widget_destroy(dialog->separator);
- dialog->separator = NULL;
+ ewl_widget_destroy(dialog->separator);
+ dialog->separator = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -341,11 +341,11 @@ ewl_dialog_active_area_set(Ewl_Dialog *d, Ewl_Position pos)
d->active_area = pos;
if (pos == d->position)
- ewl_container_redirect_set(EWL_CONTAINER(d),
- EWL_CONTAINER(d->action_box));
+ ewl_container_redirect_set(EWL_CONTAINER(d),
+ EWL_CONTAINER(d->action_box));
else
- ewl_container_redirect_set(EWL_CONTAINER(d),
- EWL_CONTAINER(d->vbox));
+ ewl_container_redirect_set(EWL_CONTAINER(d),
+ EWL_CONTAINER(d->vbox));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_dialog.h b/src/lib/ewl_dialog.h
index 2c9eba5..ee715e9 100644
--- a/src/lib/ewl_dialog.h
+++ b/src/lib/ewl_dialog.h
@@ -49,35 +49,35 @@ typedef struct Ewl_Dialog Ewl_Dialog;
*/
struct Ewl_Dialog
{
- Ewl_Window window; /**< Inherit from a window */
+ Ewl_Window window; /**< Inherit from a window */
- Ewl_Widget *box; /**< The box for window layout */
- Ewl_Widget *vbox; /**< The box where messages are displayed */
+ Ewl_Widget *box; /**< The box for window layout */
+ Ewl_Widget *vbox; /**< The box where messages are displayed */
Ewl_Widget *action_area; /**< The cell holding the action box */
Ewl_Widget *action_box; /**< The box where the buttons are added */
Ewl_Widget *separator; /**< The separator between vbox and action_area */
- Ewl_Position position; /**< Position of the action_area */
+ Ewl_Position position; /**< Position of the action_area */
Ewl_Position active_area; /**< Which section of the dialog is active */
};
Ewl_Widget *ewl_dialog_new (void);
-int ewl_dialog_init (Ewl_Dialog *dialog);
+int ewl_dialog_init (Ewl_Dialog *dialog);
-void ewl_dialog_action_position_set(Ewl_Dialog *d, Ewl_Position pos);
+void ewl_dialog_action_position_set(Ewl_Dialog *d, Ewl_Position pos);
Ewl_Position ewl_dialog_action_position_get(Ewl_Dialog *dialog);
-void ewl_dialog_action_fill_policy_set(Ewl_Dialog *d, unsigned int pol);
+void ewl_dialog_action_fill_policy_set(Ewl_Dialog *d, unsigned int pol);
unsigned int ewl_dialog_action_fill_policy_get(Ewl_Dialog *dialog);
-void ewl_dialog_action_alignment_set(Ewl_Dialog *d, unsigned int a);
+void ewl_dialog_action_alignment_set(Ewl_Dialog *d, unsigned int a);
unsigned int ewl_dialog_action_alignment_get(Ewl_Dialog *dialog);
-void ewl_dialog_active_area_set(Ewl_Dialog *d, Ewl_Position pos);
+void ewl_dialog_active_area_set(Ewl_Dialog *d, Ewl_Position pos);
Ewl_Position ewl_dialog_active_area_get(Ewl_Dialog *d);
unsigned int ewl_dialog_has_separator_get(Ewl_Dialog *dialog);
-void ewl_dialog_has_separator_set(Ewl_Dialog *dialog,
- unsigned int has_sep);
+void ewl_dialog_has_separator_set(Ewl_Dialog *dialog,
+ unsigned int has_sep);
/**
* @}
diff --git a/src/lib/ewl_dnd.c b/src/lib/ewl_dnd.c
index 2edea18..eda804b 100644
--- a/src/lib/ewl_dnd.c
+++ b/src/lib/ewl_dnd.c
@@ -46,14 +46,14 @@ ewl_dnd_init(void)
EWL_CALLBACK_DND_DATA_REQUEST = ewl_callback_type_add();
ewl_dnd_provided_hash = ecore_hash_new(ecore_direct_hash,
- ecore_direct_compare);
+ ecore_direct_compare);
if (!ewl_dnd_provided_hash)
- goto PROVIDED_ERROR;
+ goto PROVIDED_ERROR;
ewl_dnd_accepted_hash = ecore_hash_new(ecore_direct_hash,
- ecore_direct_compare);
+ ecore_direct_compare);
if (!ewl_dnd_accepted_hash)
- goto ACCEPTED_ERROR;
+ goto ACCEPTED_ERROR;
ecore_hash_free_value_cb_set(ewl_dnd_accepted_hash, free);
ewl_dnd_widget = NULL;
@@ -107,18 +107,18 @@ ewl_dnd_provided_types_set(Ewl_Widget *w, const char **types)
IF_FREE(type);
if (types && *types) {
- type = ewl_dnd_types_encode(types);
- ecore_hash_set(ewl_dnd_provided_hash, w, type);
- ewl_object_flags_add(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_DND_SOURCE,
- EWL_FLAGS_PROPERTY_MASK);
+ type = ewl_dnd_types_encode(types);
+ ecore_hash_set(ewl_dnd_provided_hash, w, type);
+ ewl_object_flags_add(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_DND_SOURCE,
+ EWL_FLAGS_PROPERTY_MASK);
}
else {
- type = ecore_hash_remove(ewl_dnd_provided_hash, w);
- IF_FREE(type);
- ewl_object_flags_remove(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_DND_SOURCE,
- EWL_FLAGS_PROPERTY_MASK);
+ type = ecore_hash_remove(ewl_dnd_provided_hash, w);
+ IF_FREE(type);
+ ewl_object_flags_remove(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_DND_SOURCE,
+ EWL_FLAGS_PROPERTY_MASK);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -184,30 +184,30 @@ ewl_dnd_accepted_types_set(Ewl_Widget *w, const char **types)
IF_FREE(type);
if (types && *types) {
- type = ewl_dnd_types_encode(types);
- ecore_hash_set(ewl_dnd_accepted_hash, w, type);
- ewl_object_flags_add(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_DND_TARGET,
- EWL_FLAGS_PROPERTY_MASK);
-
- if (REALIZED(w) && REVEALED(w)) {
- Ewl_Embed *emb;
-
- emb = ewl_embed_widget_find(w);
- if (emb) ewl_embed_dnd_aware_set(emb);
- }
+ type = ewl_dnd_types_encode(types);
+ ecore_hash_set(ewl_dnd_accepted_hash, w, type);
+ ewl_object_flags_add(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_DND_TARGET,
+ EWL_FLAGS_PROPERTY_MASK);
+
+ if (REALIZED(w) && REVEALED(w)) {
+ Ewl_Embed *emb;
+
+ emb = ewl_embed_widget_find(w);
+ if (emb) ewl_embed_dnd_aware_set(emb);
+ }
}
else {
- ewl_object_flags_remove(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_DND_TARGET,
- EWL_FLAGS_PROPERTY_MASK);
+ ewl_object_flags_remove(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_DND_TARGET,
+ EWL_FLAGS_PROPERTY_MASK);
- if (REALIZED(w) && REVEALED(w)) {
- Ewl_Embed *emb;
+ if (REALIZED(w) && REVEALED(w)) {
+ Ewl_Embed *emb;
- emb = ewl_embed_widget_find(w);
- if (emb) ewl_embed_dnd_aware_remove(emb);
- }
+ emb = ewl_embed_widget_find(w);
+ if (emb) ewl_embed_dnd_aware_remove(emb);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -272,7 +272,7 @@ ewl_dnd_drag_start(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!ewl_dnd_status || ewl_dragging_current)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
emb = ewl_embed_widget_find(w);
if (!emb) DRETURN(DLEVEL_STABLE);
@@ -285,7 +285,7 @@ ewl_dnd_drag_start(Ewl_Widget *w)
* Count the number of mime types set on the widget.
*/
for (i = 0; types && types[i]; i++)
- ;
+ ;
/*
* Flag the provided DND types on the embed and begin the DND process.
@@ -297,13 +297,13 @@ ewl_dnd_drag_start(Ewl_Widget *w)
* Create a fallback cursor to display during DND operations.
*/
if (!ewl_dnd_default_cursor) {
- ewl_dnd_default_cursor = ewl_cursor_new();
+ ewl_dnd_default_cursor = ewl_cursor_new();
- /*
- * Add a theme point as these tend to be a specialized class of cursors.
- */
- ewl_widget_appearance_set(ewl_dnd_default_cursor, "dndcursor");
- ewl_widget_show(ewl_dnd_default_cursor);
+ /*
+ * Add a theme point as these tend to be a specialized class of cursors.
+ */
+ ewl_widget_appearance_set(ewl_dnd_default_cursor, "dndcursor");
+ ewl_widget_show(ewl_dnd_default_cursor);
}
/*
@@ -420,10 +420,10 @@ ewl_dnd_types_encoded_contains(char *types, char *type)
DENTER_FUNCTION(DLEVEL_STABLE);
while (*types) {
- if (!(strcmp(types, type)))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ if (!(strcmp(types, type)))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
- types += strlen(types) + 1;
+ types += strlen(types) + 1;
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
@@ -446,15 +446,15 @@ ewl_dnd_types_encode(const char **types)
* Determine the length of all types.
*/
for (tmptype = (char *)types[0]; tmptype; tmptype = (char *)types[i]) {
- len += strlen(tmptype) + 1;
- i++;
+ len += strlen(tmptype) + 1;
+ i++;
}
type = tmptype = NEW(char, len + 1);
count = i;
for (i = 0; i < count; i++) {
- tmptype = ewl_dnd_type_stpcpy(tmptype, types[i]);
- tmptype++;
+ tmptype = ewl_dnd_type_stpcpy(tmptype, types[i]);
+ tmptype++;
}
*tmptype = '\0';
@@ -474,20 +474,20 @@ ewl_dnd_types_decode(const char *types)
DENTER_FUNCTION(DLEVEL_STABLE);
if (!types)
- DRETURN_PTR(types, DLEVEL_STABLE);
+ DRETURN_PTR(types, DLEVEL_STABLE);
/*
* Short lists so iterate over multiple times rather than incur
* allocation overhead.
*/
for (tmp = types, count = 0; *tmp; tmp++, count++) {
- while (*tmp) tmp++;
+ while (*tmp) tmp++;
}
list = NEW(char *, count + 1);
for (tmp = types, count = 0; *tmp; tmp++, count++) {
- list[count] = strdup(tmp);
- while (*tmp) tmp++;
+ list[count] = strdup(tmp);
+ while (*tmp) tmp++;
}
DRETURN_PTR(list, DLEVEL_STABLE);
@@ -505,9 +505,9 @@ ewl_dnd_type_stpcpy(char *dst, const char *src)
DCHECK_PARAM_PTR_RET(dst, dst);
while (*src) {
- *dst = *src;
- dst++;
- src++;
+ *dst = *src;
+ dst++;
+ src++;
}
*dst = '\0';
diff --git a/src/lib/ewl_dnd.h b/src/lib/ewl_dnd.h
index 01e922b..15ce886 100644
--- a/src/lib/ewl_dnd.h
+++ b/src/lib/ewl_dnd.h
@@ -15,26 +15,26 @@ extern unsigned int EWL_CALLBACK_DND_DROP;
extern unsigned int EWL_CALLBACK_DND_DATA_RECEIVED;
extern unsigned int EWL_CALLBACK_DND_DATA_REQUEST;
-int ewl_dnd_init(void);
-void ewl_dnd_shutdown(void);
+int ewl_dnd_init(void);
+void ewl_dnd_shutdown(void);
-void ewl_dnd_drag_start(Ewl_Widget *w);
-void ewl_dnd_drag_drop(Ewl_Widget *w);
-void ewl_dnd_drag_widget_clear(void);
+void ewl_dnd_drag_start(Ewl_Widget *w);
+void ewl_dnd_drag_drop(Ewl_Widget *w);
+void ewl_dnd_drag_widget_clear(void);
Ewl_Widget *ewl_dnd_drag_widget_get(void);
-int ewl_dnd_status_get(void);
+int ewl_dnd_status_get(void);
-void ewl_dnd_provided_types_set(Ewl_Widget *w, const char **types);
-int ewl_dnd_provided_types_contains(Ewl_Widget *w, char *type);
-char **ewl_dnd_provided_types_get(Ewl_Widget *w);
+void ewl_dnd_provided_types_set(Ewl_Widget *w, const char **types);
+int ewl_dnd_provided_types_contains(Ewl_Widget *w, char *type);
+char **ewl_dnd_provided_types_get(Ewl_Widget *w);
-void ewl_dnd_accepted_types_set(Ewl_Widget *w, const char **types);
-int ewl_dnd_accepted_types_contains(Ewl_Widget *w, char *type);
+void ewl_dnd_accepted_types_set(Ewl_Widget *w, const char **types);
+int ewl_dnd_accepted_types_contains(Ewl_Widget *w, char *type);
const char **ewl_dnd_accepted_types_get(Ewl_Widget *w);
-void ewl_dnd_disable(void);
-void ewl_dnd_enable(void);
+void ewl_dnd_disable(void);
+void ewl_dnd_enable(void);
/**
* @}
diff --git a/src/lib/ewl_embed.c b/src/lib/ewl_embed.c
index 7017d0b..5d97486 100644
--- a/src/lib/ewl_embed.c
+++ b/src/lib/ewl_embed.c
@@ -16,39 +16,39 @@ static Ewl_Embed *ewl_embed_active_embed = NULL;
static void ewl_embed_smart_cb_del(Evas_Object *obj);
static void ewl_embed_smart_cb_move(Evas_Object *obj, Evas_Coord x,
- Evas_Coord y);
+ Evas_Coord y);
static void ewl_embed_smart_cb_resize(Evas_Object *obj, Evas_Coord w,
- Evas_Coord h);
+ Evas_Coord h);
static void ewl_embed_smart_cb_show(Evas_Object *obj);
static void ewl_embed_smart_cb_hide(Evas_Object *obj);
static void ewl_embed_smart_cb_clip_set(Evas_Object *obj, Evas_Object *clip);
static void ewl_embed_smart_cb_clip_unset(Evas_Object *obj);
static void ewl_embed_tab_order_change(Ewl_Embed *e,
- void *(*change)(Ecore_DList *list),
- void *(*cycle)(Ecore_DList *list));
+ void *(*change)(Ecore_DList *list),
+ void *(*cycle)(Ecore_DList *list));
/*
* Catch mouse events processed through the evas
*/
static void ewl_embed_evas_cb_mouse_out(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+ void *event_info);
static void ewl_embed_evas_cb_mouse_down(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+ void *event_info);
static void ewl_embed_evas_cb_mouse_up(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+ void *event_info);
static void ewl_embed_evas_cb_mouse_move(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+ void *event_info);
static void ewl_embed_evas_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+ void *event_info);
/*
* Catch key events processed through the evas
*/
static void ewl_embed_evas_cb_key_down(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+ void *event_info);
static void ewl_embed_evas_cb_key_up(void *data, Evas *e, Evas_Object *obj,
- void *event_info);
+ void *event_info);
/**
* @return Returns a new embed on success, or NULL on failure.
@@ -63,11 +63,11 @@ ewl_embed_new(void)
w = NEW(Ewl_Embed, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_embed_init(w)) {
- ewl_widget_destroy(EWL_WIDGET(w));
- w = NULL;
+ ewl_widget_destroy(EWL_WIDGET(w));
+ w = NULL;
}
DRETURN_PTR(EWL_WIDGET(w), DLEVEL_STABLE);
@@ -90,34 +90,34 @@ ewl_embed_init(Ewl_Embed *w)
* Initialize the fields of the inherited container class
*/
if (!ewl_cell_init(EWL_CELL(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(w), EWL_EMBED_TYPE);
ewl_widget_inherit(EWL_WIDGET(w), EWL_EMBED_TYPE);
if (!ewl_embed_engine_name_set(w, ewl_config_string_get(ewl_config,
- EWL_CONFIG_ENGINE_NAME)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ EWL_CONFIG_ENGINE_NAME)))
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
ewl_object_toplevel_set(EWL_OBJECT(w), EWL_FLAG_PROPERTY_TOPLEVEL);
/* remove the notify flags set by the cell */
ewl_container_callback_nonotify(EWL_CONTAINER(w),
- EWL_CALLBACK_FOCUS_IN);
+ EWL_CALLBACK_FOCUS_IN);
ewl_container_callback_nonotify(EWL_CONTAINER(w),
- EWL_CALLBACK_FOCUS_OUT);
+ EWL_CALLBACK_FOCUS_OUT);
ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_REALIZE,
- ewl_embed_cb_realize, NULL);
+ ewl_embed_cb_realize, NULL);
ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_UNREALIZE,
- ewl_embed_cb_unrealize, NULL);
+ ewl_embed_cb_unrealize, NULL);
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_DESTROY,
- ewl_embed_cb_destroy, NULL);
+ ewl_embed_cb_destroy, NULL);
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE,
- ewl_embed_cb_configure, NULL);
+ ewl_embed_cb_configure, NULL);
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_FOCUS_OUT,
- ewl_embed_cb_focus_out, NULL);
+ ewl_embed_cb_focus_out, NULL);
ecore_list_append(ewl_embed_list, w);
@@ -144,8 +144,8 @@ ewl_embed_engine_name_set(Ewl_Embed *embed, const char *engine)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, FALSE);
if (REALIZED(embed)) {
- ewl_widget_unrealize(EWL_WIDGET(embed));
- realize = TRUE;
+ ewl_widget_unrealize(EWL_WIDGET(embed));
+ realize = TRUE;
}
IF_RELEASE(embed->engine_name);
@@ -154,12 +154,12 @@ ewl_embed_engine_name_set(Ewl_Embed *embed, const char *engine)
embed->engine = ewl_engine_new(engine, NULL, NULL);
if (!embed->engine)
{
- DERROR("Error creating engine ...\n");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DERROR("Error creating engine ...\n");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
if (realize)
- ewl_widget_realize(EWL_WIDGET(embed));
+ ewl_widget_realize(EWL_WIDGET(embed));
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -189,8 +189,8 @@ ewl_embed_shutdown(void)
DENTER_FUNCTION(DLEVEL_STABLE);
if (embedded_smart) {
- evas_smart_free(embedded_smart);
- embedded_smart = NULL;
+ evas_smart_free(embedded_smart);
+ embedded_smart = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -220,38 +220,38 @@ ewl_embed_canvas_set(Ewl_Embed *emb, void *canvas, Ewl_Embed_Window *canvas_wind
emb->canvas_window = canvas_window;
if (!embedded_smart) {
- static const Evas_Smart_Class sc = {
- "EWL Embedded Smart Object",
- EVAS_SMART_CLASS_VERSION,
- NULL,
- ewl_embed_smart_cb_del,
- ewl_embed_smart_cb_move,
- ewl_embed_smart_cb_resize,
- ewl_embed_smart_cb_show,
- ewl_embed_smart_cb_hide,
- NULL,
- ewl_embed_smart_cb_clip_set,
- ewl_embed_smart_cb_clip_unset,
- NULL
- };
- embedded_smart = evas_smart_class_new(&sc);
+ static const Evas_Smart_Class sc = {
+ "EWL Embedded Smart Object",
+ EVAS_SMART_CLASS_VERSION,
+ NULL,
+ ewl_embed_smart_cb_del,
+ ewl_embed_smart_cb_move,
+ ewl_embed_smart_cb_resize,
+ ewl_embed_smart_cb_show,
+ ewl_embed_smart_cb_hide,
+ NULL,
+ ewl_embed_smart_cb_clip_set,
+ ewl_embed_smart_cb_clip_unset,
+ NULL
+ };
+ embedded_smart = evas_smart_class_new(&sc);
}
if (emb->smart) {
- ewl_canvas_object_destroy(emb->smart);
- emb->smart = NULL;
+ ewl_canvas_object_destroy(emb->smart);
+ emb->smart = NULL;
}
emb->smart = evas_object_smart_add(emb->canvas, embedded_smart);
evas_object_smart_data_set(emb->smart, emb);
if (VISIBLE(emb))
- ewl_realize_request(EWL_WIDGET(emb));
+ ewl_realize_request(EWL_WIDGET(emb));
paths = ewl_theme_font_path_get();
ecore_list_first_goto(paths);
while ((font_path = ecore_list_next(paths)))
- evas_font_path_append(canvas, font_path);
+ evas_font_path_append(canvas, font_path);
DRETURN_PTR(emb->smart, DLEVEL_STABLE);
}
@@ -271,7 +271,7 @@ ewl_embed_focus_set(Ewl_Embed *embed, int f)
embed->focus = f;
if (embed->smart)
- evas_object_focus_set(embed->smart, f);
+ evas_object_focus_set(embed->smart, f);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -308,47 +308,47 @@ ewl_embed_active_set(Ewl_Embed *embed, unsigned int act)
/* return if we're seting active and we're already the active embed */
if (act && (embed == ewl_embed_active_embed))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!act)
{
- /* if you said false and we aren't actually the active embed
- * just exit */
- if (embed != ewl_embed_active_embed)
- DRETURN(DLEVEL_STABLE);
-
- e = embed;
- ewl_embed_active_embed = NULL;
- ewl_embed_focus_set(embed, FALSE);
+ /* if you said false and we aren't actually the active embed
+ * just exit */
+ if (embed != ewl_embed_active_embed)
+ DRETURN(DLEVEL_STABLE);
+
+ e = embed;
+ ewl_embed_active_embed = NULL;
+ ewl_embed_focus_set(embed, FALSE);
}
else
{
- e = ewl_embed_active_embed;
- ewl_embed_active_embed = embed;
- ewl_embed_focus_set(embed, TRUE);
+ e = ewl_embed_active_embed;
+ ewl_embed_active_embed = embed;
+ ewl_embed_focus_set(embed, TRUE);
}
if (e && e->last.clicked)
{
- Ewl_Widget *temp;
+ Ewl_Widget *temp;
- ewl_object_state_remove(EWL_OBJECT(e->last.clicked),
- EWL_FLAG_STATE_FOCUSED);
- ewl_object_state_remove(EWL_OBJECT(e->last.clicked),
- EWL_FLAG_STATE_PRESSED);
+ ewl_object_state_remove(EWL_OBJECT(e->last.clicked),
+ EWL_FLAG_STATE_FOCUSED);
+ ewl_object_state_remove(EWL_OBJECT(e->last.clicked),
+ EWL_FLAG_STATE_PRESSED);
- ewl_callback_call(e->last.clicked, EWL_CALLBACK_FOCUS_OUT);
+ ewl_callback_call(e->last.clicked, EWL_CALLBACK_FOCUS_OUT);
- /* Clean the last.clicked up recursively */
- temp = e->last.clicked;
- while (temp) {
- if (!DISABLED(temp))
- ewl_object_state_remove(EWL_OBJECT(temp),
- EWL_FLAG_STATE_PRESSED);
- temp = temp->parent;
- }
+ /* Clean the last.clicked up recursively */
+ temp = e->last.clicked;
+ while (temp) {
+ if (!DISABLED(temp))
+ ewl_object_state_remove(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_PRESSED);
+ temp = temp->parent;
+ }
- e->last.clicked = NULL;
+ e->last.clicked = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -398,7 +398,7 @@ ewl_embed_last_mouse_position_get(int *x, int *y)
*/
void
ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname,
- unsigned int mods)
+ unsigned int mods)
{
Ewl_Widget *temp;
Ewl_Event_Key_Down ev;
@@ -414,15 +414,15 @@ ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname,
*/
/* FIXME This "Tab" should probably be made a config variable */
if ((!(embed->last.focused
- && ewl_widget_ignore_focus_change_get(embed->last.focused)))
- && (!strcmp(keyname, "Tab")))
+ && ewl_widget_ignore_focus_change_get(embed->last.focused)))
+ && (!strcmp(keyname, "Tab")))
{
- if (mods & EWL_KEY_MODIFIER_SHIFT)
- ewl_embed_tab_order_previous(embed);
- else
- ewl_embed_tab_order_next(embed);
+ if (mods & EWL_KEY_MODIFIER_SHIFT)
+ ewl_embed_tab_order_previous(embed);
+ else
+ ewl_embed_tab_order_next(embed);
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
/*
@@ -436,18 +436,18 @@ ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname,
* appropriate widget.
*/
if (!embed->last.focused) {
- if (embed->last.clicked)
- ewl_embed_focused_widget_set(embed,
- embed->last.clicked);
- else
- {
- ewl_embed_focused_widget_set(embed,
- ecore_dlist_first_goto(embed->tab_order));
-
- if (!embed->last.focused)
- ewl_embed_focused_widget_set(embed,
- EWL_WIDGET(embed));
- }
+ if (embed->last.clicked)
+ ewl_embed_focused_widget_set(embed,
+ embed->last.clicked);
+ else
+ {
+ ewl_embed_focused_widget_set(embed,
+ ecore_dlist_first_goto(embed->tab_order));
+
+ if (!embed->last.focused)
+ ewl_embed_focused_widget_set(embed,
+ EWL_WIDGET(embed));
+ }
}
/*
@@ -456,10 +456,10 @@ ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname,
*/
temp = embed->last.focused;
while (temp) {
- if (!DISABLED(temp))
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_KEY_DOWN, &ev);
- temp = temp->parent;
+ if (!DISABLED(temp))
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_KEY_DOWN, &ev);
+ temp = temp->parent;
}
FREE(ev.base.keyname);
@@ -476,7 +476,7 @@ ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname,
*/
void
ewl_embed_key_up_feed(Ewl_Embed *embed, const char *keyname,
- unsigned int mods)
+ unsigned int mods)
{
Ewl_Widget *temp;
Ewl_Event_Key_Up ev;
@@ -490,9 +490,9 @@ ewl_embed_key_up_feed(Ewl_Embed *embed, const char *keyname,
* actual focus change was done in key down */
/* FIXME Should probably make this "Tab" a config variable */
if ((embed->last.focused
- && (!ewl_widget_ignore_focus_change_get(embed->last.focused)))
- && (!strcmp(keyname, "Tab")))
- DRETURN(DLEVEL_STABLE);
+ && (!ewl_widget_ignore_focus_change_get(embed->last.focused)))
+ && (!strcmp(keyname, "Tab")))
+ DRETURN(DLEVEL_STABLE);
ev.base.modifiers = mods;
ev.base.keyname = strdup(keyname);
@@ -503,10 +503,10 @@ ewl_embed_key_up_feed(Ewl_Embed *embed, const char *keyname,
*/
temp = embed->last.focused;
while (temp) {
- if (!DISABLED(temp))
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_KEY_UP, &ev);
- temp = temp->parent;
+ if (!DISABLED(temp))
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_KEY_UP, &ev);
+ temp = temp->parent;
}
FREE(ev.base.keyname);
@@ -526,7 +526,7 @@ ewl_embed_key_up_feed(Ewl_Embed *embed, const char *keyname,
*/
void
ewl_embed_mouse_down_feed(Ewl_Embed *embed, int b, int clicks, int x, int y,
- unsigned int mods)
+ unsigned int mods)
{
Ewl_Event_Mouse_Down ev;
Ewl_Widget *temp = NULL;
@@ -559,7 +559,7 @@ ewl_embed_mouse_down_feed(Ewl_Embed *embed, int b, int clicks, int x, int y,
* the internal children */
temp = widget;
while (temp && temp->parent && ewl_widget_internal_is(temp))
- temp = temp->parent;
+ temp = temp->parent;
/* Set last focused to new widget */
embed->last.focused = temp;
@@ -587,18 +587,18 @@ ewl_embed_mouse_down_feed(Ewl_Embed *embed, int b, int clicks, int x, int y,
*/
temp = widget;
while (temp) {
- if (!DISABLED(temp)) {
- ewl_object_state_add(EWL_OBJECT(temp),
- EWL_FLAG_STATE_PRESSED);
-
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_MOUSE_DOWN, &ev);
-
- if (ev.clicks > 1)
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_CLICKED, &ev);
- }
- temp = temp->parent;
+ if (!DISABLED(temp)) {
+ ewl_object_state_add(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_PRESSED);
+
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_MOUSE_DOWN, &ev);
+
+ if (ev.clicks > 1)
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_CLICKED, &ev);
+ }
+ temp = temp->parent;
}
/* Set to upper widget */
@@ -610,24 +610,24 @@ ewl_embed_mouse_down_feed(Ewl_Embed *embed, int b, int clicks, int x, int y,
* change. Then select the new widget and notify it of the selection.
*/
if (widget != deselect) {
- /*
- * Make sure these widgets haven't been scheduled for
- * deletion before we send their callbacks.
- */
- if (deselect && !DESTROYED(deselect) &&
- !ewl_widget_parent_of(deselect, widget)) {
- ewl_object_state_remove(EWL_OBJECT(deselect),
- EWL_FLAG_STATE_FOCUSED);
- ewl_callback_call_with_event_data(deselect,
- EWL_CALLBACK_FOCUS_OUT, widget);
- }
-
- if (widget && !DISABLED(widget) && !DESTROYED(widget)) {
- ewl_object_state_add(EWL_OBJECT(widget),
- EWL_FLAG_STATE_FOCUSED);
- ewl_callback_call_with_event_data(widget,
- EWL_CALLBACK_FOCUS_IN, deselect);
- }
+ /*
+ * Make sure these widgets haven't been scheduled for
+ * deletion before we send their callbacks.
+ */
+ if (deselect && !DESTROYED(deselect) &&
+ !ewl_widget_parent_of(deselect, widget)) {
+ ewl_object_state_remove(EWL_OBJECT(deselect),
+ EWL_FLAG_STATE_FOCUSED);
+ ewl_callback_call_with_event_data(deselect,
+ EWL_CALLBACK_FOCUS_OUT, widget);
+ }
+
+ if (widget && !DISABLED(widget) && !DESTROYED(widget)) {
+ ewl_object_state_add(EWL_OBJECT(widget),
+ EWL_FLAG_STATE_FOCUSED);
+ ewl_callback_call_with_event_data(widget,
+ EWL_CALLBACK_FOCUS_IN, deselect);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -644,7 +644,7 @@ ewl_embed_mouse_down_feed(Ewl_Embed *embed, int b, int clicks, int x, int y,
*/
void
ewl_embed_mouse_up_feed(Ewl_Embed *embed, int b, int x, int y,
- unsigned int mods)
+ unsigned int mods)
{
Ewl_Widget *temp;
Ewl_Event_Mouse_Up ev;
@@ -673,14 +673,14 @@ ewl_embed_mouse_up_feed(Ewl_Embed *embed, int b, int x, int y,
*/
temp = embed->last.clicked;
while (temp) {
- if (!DISABLED(temp)) {
- ewl_object_state_remove(EWL_OBJECT(temp),
- EWL_FLAG_STATE_PRESSED);
- ewl_callback_call_with_event_data(temp,
- EWL_CALLBACK_MOUSE_UP, &ev);
-
- }
- temp = temp->parent;
+ if (!DISABLED(temp)) {
+ ewl_object_state_remove(EWL_OBJECT(temp),
+ EWL_FLAG_STATE_PRESSED);
+ ewl_callback_call_with_event_data(temp,
+ EWL_CALLBACK_MOUSE_UP, &ev);
+
+ }
+ temp = temp->parent;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -725,11 +725,11 @@ ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
check = EWL_OBJECT(embed->last.mouse_in);
if (!check || !ewl_object_state_has(check, EWL_FLAG_STATE_PRESSED)) {
- widget = ewl_container_child_at_recursive_get(EWL_CONTAINER(embed), x, y);
- if (!widget) widget = EWL_WIDGET(embed);
+ widget = ewl_container_child_at_recursive_get(EWL_CONTAINER(embed), x, y);
+ if (!widget) widget = EWL_WIDGET(embed);
}
else
- widget = embed->last.mouse_in;
+ widget = embed->last.mouse_in;
/* Cycle through all parents of the widget to see if any have
@@ -739,21 +739,21 @@ ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
check = NULL;
while (temp)
{
- if (ewl_attach_get(temp, EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR) ||
- ewl_attach_get(temp, EWL_ATTACH_TYPE_MOUSE_CURSOR))
- {
- check = EWL_OBJECT(temp);
- break;
- }
-
- temp = temp->parent;
+ if (ewl_attach_get(temp, EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR) ||
+ ewl_attach_get(temp, EWL_ATTACH_TYPE_MOUSE_CURSOR))
+ {
+ check = EWL_OBJECT(temp);
+ break;
+ }
+
+ temp = temp->parent;
}
/* Set the cursor to first parent if possible */
if (check)
- ewl_embed_mouse_cursor_set(EWL_WIDGET(check));
+ ewl_embed_mouse_cursor_set(EWL_WIDGET(check));
else if (embed->last.mouse_in && embed->last.mouse_in->parent)
- ewl_embed_mouse_cursor_set(embed->last.mouse_in->parent);
+ ewl_embed_mouse_cursor_set(embed->last.mouse_in->parent);
/*
* Defocus all widgets up to the level of a shared parent of
@@ -761,11 +761,11 @@ ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
*/
check = EWL_OBJECT(embed->last.mouse_in);
while (check && (widget != EWL_WIDGET(check))
- && !ewl_widget_parent_of(EWL_WIDGET(check), widget)) {
+ && !ewl_widget_parent_of(EWL_WIDGET(check), widget)) {
- ewl_object_state_remove(check, EWL_FLAG_STATE_MOUSE_IN);
- ewl_callback_call(EWL_WIDGET(check), EWL_CALLBACK_MOUSE_OUT);
- check = EWL_OBJECT(EWL_WIDGET(check)->parent);
+ ewl_object_state_remove(check, EWL_FLAG_STATE_MOUSE_IN);
+ ewl_callback_call(EWL_WIDGET(check), EWL_CALLBACK_MOUSE_OUT);
+ check = EWL_OBJECT(EWL_WIDGET(check)->parent);
}
/*
@@ -775,37 +775,37 @@ ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
embed->last.mouse_in = widget;
check = EWL_OBJECT(widget);
while (check) {
- if (!DISABLED(check)) {
-
- /*
- * First mouse move event in a widget marks it focused.
- */
- if (!(ewl_object_state_has(check,
- EWL_FLAG_STATE_MOUSE_IN))) {
-
- /* Only set the cursor different if it is non-default */
- if (ewl_attach_get(EWL_WIDGET(check),
- EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR) ||
- ewl_attach_get(EWL_WIDGET(check),
- EWL_ATTACH_TYPE_MOUSE_CURSOR))
- ewl_embed_mouse_cursor_set(EWL_WIDGET(check));
-
- ewl_object_state_add(check,
- EWL_FLAG_STATE_MOUSE_IN);
- ewl_callback_call_with_event_data(EWL_WIDGET(check),
- EWL_CALLBACK_MOUSE_IN, &ev);
- }
-
- ewl_callback_call_with_event_data(EWL_WIDGET(check),
- EWL_CALLBACK_MOUSE_MOVE, &ev);
- }
-
- /*
- * It's possible that the call to MOUSE_IN caused the
- * 'embed->last.mouse_in' to have become null. Make sure this
- * pointer is still here
- */
- if (check) check = EWL_OBJECT(EWL_WIDGET(check)->parent);
+ if (!DISABLED(check)) {
+
+ /*
+ * First mouse move event in a widget marks it focused.
+ */
+ if (!(ewl_object_state_has(check,
+ EWL_FLAG_STATE_MOUSE_IN))) {
+
+ /* Only set the cursor different if it is non-default */
+ if (ewl_attach_get(EWL_WIDGET(check),
+ EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR) ||
+ ewl_attach_get(EWL_WIDGET(check),
+ EWL_ATTACH_TYPE_MOUSE_CURSOR))
+ ewl_embed_mouse_cursor_set(EWL_WIDGET(check));
+
+ ewl_object_state_add(check,
+ EWL_FLAG_STATE_MOUSE_IN);
+ ewl_callback_call_with_event_data(EWL_WIDGET(check),
+ EWL_CALLBACK_MOUSE_IN, &ev);
+ }
+
+ ewl_callback_call_with_event_data(EWL_WIDGET(check),
+ EWL_CALLBACK_MOUSE_MOVE, &ev);
+ }
+
+ /*
+ * It's possible that the call to MOUSE_IN caused the
+ * 'embed->last.mouse_in' to have become null. Make sure this
+ * pointer is still here
+ */
+ if (check) check = EWL_OBJECT(EWL_WIDGET(check)->parent);
}
/*
@@ -814,13 +814,13 @@ ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
*/
check = EWL_OBJECT(embed->last.drag_widget);
if (check && ewl_object_state_has(check, EWL_FLAG_STATE_DND))
- ewl_callback_call_with_event_data(EWL_WIDGET(check),
- EWL_CALLBACK_MOUSE_MOVE, &ev);
+ ewl_callback_call_with_event_data(EWL_WIDGET(check),
+ EWL_CALLBACK_MOUSE_MOVE, &ev);
check = EWL_OBJECT(embed->last.clicked);
if (check && ewl_object_state_has(check, EWL_FLAG_STATE_PRESSED))
- ewl_callback_call_with_event_data(EWL_WIDGET(check),
- EWL_CALLBACK_MOUSE_MOVE, &ev);
+ ewl_callback_call_with_event_data(EWL_WIDGET(check),
+ EWL_CALLBACK_MOUSE_MOVE, &ev);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -851,36 +851,36 @@ ewl_embed_dnd_drop_feed(Ewl_Embed *embed, int x, int y, int internal __UNUSED__)
* Find the lowest DND aware widget
*/
while (widget) {
- if (ewl_object_flags_has(EWL_OBJECT(widget),
- EWL_FLAG_PROPERTY_DND_TARGET,
- EWL_FLAGS_PROPERTY_MASK))
- break;
- widget = widget->parent;
+ if (ewl_object_flags_has(EWL_OBJECT(widget),
+ EWL_FLAG_PROPERTY_DND_TARGET,
+ EWL_FLAGS_PROPERTY_MASK))
+ break;
+ widget = widget->parent;
}
if (!widget) DRETURN_PTR(NULL, DLEVEL_STABLE);
/* Request a DND data request */
for (i = 0; i < embed->dnd_types.num_types; i++) {
- if (ewl_dnd_accepted_types_contains(widget, embed->dnd_types.types[i])) {
- result = embed->dnd_types.types[i];
- break;
- }
+ if (ewl_dnd_accepted_types_contains(widget, embed->dnd_types.types[i])) {
+ result = embed->dnd_types.types[i];
+ break;
+ }
}
if (result) {
- Ewl_Event_Dnd_Drop ev;
-
- ev.x = x;
- ev.y = y;
- ev.data = NULL;
-
- embed->last.drop_widget = widget;
- parent = widget;
- while (parent) {
- ewl_callback_call_with_event_data(parent,
- EWL_CALLBACK_DND_DROP, &ev);
- parent = parent->parent;
- }
+ Ewl_Event_Dnd_Drop ev;
+
+ ev.x = x;
+ ev.y = y;
+ ev.data = NULL;
+
+ embed->last.drop_widget = widget;
+ parent = widget;
+ while (parent) {
+ ewl_callback_call_with_event_data(parent,
+ EWL_CALLBACK_DND_DROP, &ev);
+ parent = parent->parent;
+ }
}
ewl_dnd_drag_widget_clear();
@@ -921,36 +921,36 @@ ewl_embed_dnd_position_feed(Ewl_Embed *embed, int x, int y, int* px, int* py, in
* Find the lowest DND aware widget
*/
while (widget) {
- if (ewl_object_flags_has(EWL_OBJECT(widget),
- EWL_FLAG_PROPERTY_DND_TARGET,
- EWL_FLAGS_PROPERTY_MASK))
- break;
- widget = widget->parent;
+ if (ewl_object_flags_has(EWL_OBJECT(widget),
+ EWL_FLAG_PROPERTY_DND_TARGET,
+ EWL_FLAGS_PROPERTY_MASK))
+ break;
+ widget = widget->parent;
}
if (!widget) {
- DWARNING("Could not find widget for dnd position event.");
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("Could not find widget for dnd position event.");
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
/* If the last position event was over a different widget,
* feed the leaving widget a 'null' */
if (embed->dnd_last_position != widget) {
- if (embed->dnd_last_position) {
- parent = embed->dnd_last_position;
- while (parent) {
- ewl_callback_call_with_event_data(parent,
- EWL_CALLBACK_DND_LEAVE, &ev);
- parent = parent->parent;
- }
- }
-
- parent = widget;
- while (parent) {
- ewl_callback_call_with_event_data(parent,
- EWL_CALLBACK_DND_ENTER, &ev);
- parent = parent->parent;
- }
+ if (embed->dnd_last_position) {
+ parent = embed->dnd_last_position;
+ while (parent) {
+ ewl_callback_call_with_event_data(parent,
+ EWL_CALLBACK_DND_LEAVE, &ev);
+ parent = parent->parent;
+ }
+ }
+
+ parent = widget;
+ while (parent) {
+ ewl_callback_call_with_event_data(parent,
+ EWL_CALLBACK_DND_ENTER, &ev);
+ parent = parent->parent;
+ }
}
/*
@@ -958,9 +958,9 @@ ewl_embed_dnd_position_feed(Ewl_Embed *embed, int x, int y, int* px, int* py, in
*/
parent = widget;
while (parent) {
- ewl_callback_call_with_event_data(parent,
- EWL_CALLBACK_DND_POSITION, &ev);
- parent = parent->parent;
+ ewl_callback_call_with_event_data(parent,
+ EWL_CALLBACK_DND_POSITION, &ev);
+ parent = parent->parent;
}
embed->last.drop_widget = widget;
@@ -968,11 +968,11 @@ ewl_embed_dnd_position_feed(Ewl_Embed *embed, int x, int y, int* px, int* py, in
/* Request a DND data request */
for (i = 0; i < embed->dnd_types.num_types; i++) {
- if (ewl_dnd_accepted_types_contains(widget,
- embed->dnd_types.types[i])) {
- result = embed->dnd_types.types[i];
- break;
- }
+ if (ewl_dnd_accepted_types_contains(widget,
+ embed->dnd_types.types[i])) {
+ result = embed->dnd_types.types[i];
+ break;
+ }
}
if (px) *px = CURRENT_X(widget);
@@ -1007,11 +1007,11 @@ ewl_embed_mouse_out_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
ev.base.y = y;
while (embed->last.mouse_in) {
- ewl_object_state_remove(EWL_OBJECT(embed->last.mouse_in),
- EWL_FLAG_STATE_MOUSE_IN);
- ewl_callback_call_with_event_data(embed->last.mouse_in,
- EWL_CALLBACK_MOUSE_OUT, &ev);
- embed->last.mouse_in = embed->last.mouse_in->parent;
+ ewl_object_state_remove(EWL_OBJECT(embed->last.mouse_in),
+ EWL_FLAG_STATE_MOUSE_IN);
+ ewl_callback_call_with_event_data(embed->last.mouse_in,
+ EWL_CALLBACK_MOUSE_OUT, &ev);
+ embed->last.mouse_in = embed->last.mouse_in->parent;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1029,7 +1029,7 @@ ewl_embed_mouse_out_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
*/
void
ewl_embed_mouse_wheel_feed(Ewl_Embed *embed, int x, int y, int z, int dir,
- unsigned int mods)
+ unsigned int mods)
{
Ewl_Widget *w;
Ewl_Event_Mouse_Wheel ev;
@@ -1048,13 +1048,13 @@ ewl_embed_mouse_wheel_feed(Ewl_Embed *embed, int x, int y, int z, int dir,
w = embed->last.mouse_in;
if (!w)
- ewl_callback_call_with_event_data(EWL_WIDGET(embed),
- EWL_CALLBACK_MOUSE_WHEEL, &ev);
+ ewl_callback_call_with_event_data(EWL_WIDGET(embed),
+ EWL_CALLBACK_MOUSE_WHEEL, &ev);
while (w) {
- ewl_callback_call_with_event_data(w,
- EWL_CALLBACK_MOUSE_WHEEL, &ev);
- w = w->parent;
+ ewl_callback_call_with_event_data(w,
+ EWL_CALLBACK_MOUSE_WHEEL, &ev);
+ w = w->parent;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1071,7 +1071,7 @@ ewl_embed_mouse_wheel_feed(Ewl_Embed *embed, int x, int y, int z, int dir,
*/
void
ewl_embed_dnd_data_received_feed(Ewl_Embed *embed, char *type, void *data,
- unsigned int len, unsigned int format)
+ unsigned int len, unsigned int format)
{
Ewl_Event_Dnd_Data_Received ev;
@@ -1084,17 +1084,17 @@ ewl_embed_dnd_data_received_feed(Ewl_Embed *embed, char *type, void *data,
* If a widget is expecting DND data, send the data to the widget
*/
if (embed->last.drop_widget) {
- if (ewl_dnd_accepted_types_contains(embed->last.drop_widget, type)) {
- /*
- * setup the event struct
- */
- ev.type = type;
- ev.data = data;
- ev.len = len;
- ev.format= format;
- ewl_callback_call_with_event_data(embed->last.drop_widget,
- EWL_CALLBACK_DND_DATA_RECEIVED, &ev);
- }
+ if (ewl_dnd_accepted_types_contains(embed->last.drop_widget, type)) {
+ /*
+ * setup the event struct
+ */
+ ev.type = type;
+ ev.data = data;
+ ev.len = len;
+ ev.format= format;
+ ewl_callback_call_with_event_data(embed->last.drop_widget,
+ EWL_CALLBACK_DND_DATA_RECEIVED, &ev);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1119,15 +1119,15 @@ ewl_embed_dnd_data_request_feed(Ewl_Embed *embed, void *handle, char *type)
* If a widget is expecting DND data, send the data to the widget
*/
if (embed->last.drag_widget) {
- if (ewl_dnd_provided_types_contains(embed->last.drag_widget, type)) {
- /*
- * setup the event struct
- */
- ev.handle = handle;
- ev.type = type;
- ewl_callback_call_with_event_data(embed->last.drag_widget,
- EWL_CALLBACK_DND_DATA_REQUEST, &ev);
- }
+ if (ewl_dnd_provided_types_contains(embed->last.drag_widget, type)) {
+ /*
+ * setup the event struct
+ */
+ ev.handle = handle;
+ ev.type = type;
+ ewl_callback_call_with_event_data(embed->last.drag_widget,
+ EWL_CALLBACK_DND_DATA_REQUEST, &ev);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1151,8 +1151,8 @@ ewl_embed_font_path_add(char *path)
ecore_list_first_goto(ewl_embed_list);
while ((e = ecore_list_next(ewl_embed_list))) {
- if (REALIZED(e))
- evas_font_path_append(e->canvas, path);
+ if (REALIZED(e))
+ evas_font_path_append(e->canvas, path);
}
ecore_list_append(ewl_theme_font_path_get(), strdup(path));
@@ -1175,8 +1175,8 @@ ewl_embed_canvas_window_find(Ewl_Embed_Window *window)
ecore_list_first_goto(ewl_embed_list);
while ((retemb = ecore_list_next(ewl_embed_list)) != NULL) {
- if (retemb->canvas_window == window)
- DRETURN_PTR(retemb, DLEVEL_STABLE);
+ if (retemb->canvas_window == window)
+ DRETURN_PTR(retemb, DLEVEL_STABLE);
}
DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -1195,10 +1195,10 @@ ewl_embed_widget_find(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, NULL);
while (w->parent)
- w = w->parent;
+ w = w->parent;
if (!ewl_object_toplevel_get(EWL_OBJECT(w)))
- w = NULL;
+ w = NULL;
DRETURN_PTR(EWL_EMBED(w), DLEVEL_STABLE);
}
@@ -1229,27 +1229,27 @@ ewl_embed_object_cache(Ewl_Embed *e, void *obj)
/* we have to unclip all of the clippees so that we don't end up
* getting into an infinite loop resetting the clip later */
while ((clippees = evas_object_clipees_get(obj)))
- evas_object_clip_unset(clippees->data);
+ evas_object_clip_unset(clippees->data);
if (e->obj_cache) {
- Ecore_List *obj_list;
- const char *type;
+ Ecore_List *obj_list;
+ const char *type;
- type = evas_object_type_get(obj);
+ type = evas_object_type_get(obj);
- /* reset the file and the key of the edje object */
- if (!strcmp(type, "edje"))
- edje_object_file_set(obj, "", "");
+ /* reset the file and the key of the edje object */
+ if (!strcmp(type, "edje"))
+ edje_object_file_set(obj, "", "");
- obj_list = ecore_hash_get(e->obj_cache, (void *)type);
- if (!obj_list) {
- obj_list = ecore_list_new();
- ecore_hash_set(e->obj_cache, (void *)type, obj_list);
- }
- ecore_list_prepend(obj_list, obj);
+ obj_list = ecore_hash_get(e->obj_cache, (void *)type);
+ if (!obj_list) {
+ obj_list = ecore_list_new();
+ ecore_hash_set(e->obj_cache, (void *)type, obj_list);
+ }
+ ecore_list_prepend(obj_list, obj);
}
else
- ewl_canvas_object_destroy(obj);
+ ewl_canvas_object_destroy(obj);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1273,7 +1273,7 @@ ewl_embed_object_request(Ewl_Embed *e, char *type)
DCHECK_TYPE_RET(e, EWL_EMBED_TYPE, NULL);
if (!e->obj_cache)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
obj_list = ecore_hash_get(e->obj_cache, type);
if (obj_list) obj = ecore_list_first_remove(obj_list);
@@ -1340,25 +1340,25 @@ ewl_embed_tab_order_insert(Ewl_Embed *e, Ewl_Widget *w, unsigned int idx)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!ewl_widget_parent_of(EWL_WIDGET(e), w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* do nothing if this widget isn't focusable */
if (!ewl_widget_focusable_get(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
current_idx = ecore_dlist_index(e->tab_order);
/* make sure this widget isn't already in the list */
if (ewl_object_in_tab_list_get(EWL_OBJECT(w))
- && ecore_dlist_goto(e->tab_order, w)) {
- int del_idx;
+ && ecore_dlist_goto(e->tab_order, w)) {
+ int del_idx;
- /* if this widget was before or at our current focused
- * widget then we need to decrement our counter */
- del_idx = ecore_dlist_index(e->tab_order);
- if (del_idx <= current_idx) current_idx --;
+ /* if this widget was before or at our current focused
+ * widget then we need to decrement our counter */
+ del_idx = ecore_dlist_index(e->tab_order);
+ if (del_idx <= current_idx) current_idx --;
- ecore_dlist_remove(e->tab_order);
+ ecore_dlist_remove(e->tab_order);
}
ecore_dlist_index_goto(e->tab_order, idx);
@@ -1383,7 +1383,7 @@ ewl_embed_tab_order_insert(Ewl_Embed *e, Ewl_Widget *w, unsigned int idx)
*/
void
ewl_embed_tab_order_insert_after(Ewl_Embed *e, Ewl_Widget *w,
- Ewl_Widget *after)
+ Ewl_Widget *after)
{
int cur_idx, idx;
@@ -1398,8 +1398,8 @@ ewl_embed_tab_order_insert_after(Ewl_Embed *e, Ewl_Widget *w,
cur_idx = ecore_dlist_index(e->tab_order);
if (!ecore_dlist_goto(e->tab_order, after))
{
- ewl_embed_tab_order_append(e, w);
- DRETURN(DLEVEL_STABLE);
+ ewl_embed_tab_order_append(e, w);
+ DRETURN(DLEVEL_STABLE);
}
idx = ecore_dlist_index(e->tab_order);
@@ -1419,7 +1419,7 @@ ewl_embed_tab_order_insert_after(Ewl_Embed *e, Ewl_Widget *w,
*/
void
ewl_embed_tab_order_insert_before(Ewl_Embed *e, Ewl_Widget *w,
- Ewl_Widget *before)
+ Ewl_Widget *before)
{
int cur_idx, idx;
@@ -1434,8 +1434,8 @@ ewl_embed_tab_order_insert_before(Ewl_Embed *e, Ewl_Widget *w,
cur_idx = ecore_dlist_index(e->tab_order);
if (!ecore_dlist_goto(e->tab_order, before))
{
- ewl_embed_tab_order_prepend(e, w);
- DRETURN(DLEVEL_STABLE);
+ ewl_embed_tab_order_prepend(e, w);
+ DRETURN(DLEVEL_STABLE);
}
idx = ecore_dlist_index(e->tab_order);
@@ -1462,7 +1462,7 @@ ewl_embed_tab_order_remove(Ewl_Embed *e, Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (ecore_dlist_goto(e->tab_order, w))
- ecore_dlist_remove(e->tab_order);
+ ecore_dlist_remove(e->tab_order);
ewl_object_in_tab_list_set(EWL_OBJECT(w), FALSE);
@@ -1481,7 +1481,7 @@ void ewl_embed_tab_order_next(Ewl_Embed *e)
DCHECK_TYPE(e, EWL_EMBED_TYPE);
ewl_embed_tab_order_change(e, ecore_dlist_next,
- ecore_dlist_first_goto);
+ ecore_dlist_first_goto);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1500,7 +1500,7 @@ ewl_embed_tab_order_previous(Ewl_Embed *e)
DCHECK_TYPE(e, EWL_EMBED_TYPE);
ewl_embed_tab_order_change(e, ecore_dlist_previous,
- ecore_dlist_last_goto);
+ ecore_dlist_last_goto);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1515,7 +1515,7 @@ ewl_embed_tab_order_previous(Ewl_Embed *e)
*/
static void
ewl_embed_tab_order_change(Ewl_Embed *e, void *(*change)(Ecore_DList *list),
- void *(*cycle)(Ecore_DList *list))
+ void *(*cycle)(Ecore_DList *list))
{
Ewl_Widget *w, *start;
@@ -1528,35 +1528,35 @@ ewl_embed_tab_order_change(Ewl_Embed *e, void *(*change)(Ecore_DList *list),
/* make sure the list is at the last focused widget */
if (e->last.focused)
{
- ecore_dlist_goto(e->tab_order, e->last.focused);
- change(e->tab_order);
- if (!ecore_dlist_current(e->tab_order))
- cycle(e->tab_order);
+ ecore_dlist_goto(e->tab_order, e->last.focused);
+ change(e->tab_order);
+ if (!ecore_dlist_current(e->tab_order))
+ cycle(e->tab_order);
}
else
- cycle(e->tab_order);
+ cycle(e->tab_order);
w = ecore_dlist_current(e->tab_order);
if (!w) DRETURN(DLEVEL_STABLE);
start = w;
while (!VISIBLE(w) || !ewl_widget_focusable_get(w)
- || ewl_widget_internal_is(w)
- || DISABLED(w))
+ || ewl_widget_internal_is(w)
+ || DISABLED(w))
{
- change(e->tab_order);
- w = ecore_dlist_current(e->tab_order);
-
- /* check if we hit the end of the list and loop to the start */
- if (!w)
- {
- cycle(e->tab_order);
- w = ecore_dlist_current(e->tab_order);
- }
-
- /* make sure we don't cycle */
- if (w == start)
- DRETURN(DLEVEL_STABLE);
+ change(e->tab_order);
+ w = ecore_dlist_current(e->tab_order);
+
+ /* check if we hit the end of the list and loop to the start */
+ if (!w)
+ {
+ cycle(e->tab_order);
+ w = ecore_dlist_current(e->tab_order);
+ }
+
+ /* make sure we don't cycle */
+ if (w == start)
+ DRETURN(DLEVEL_STABLE);
}
if (w) ewl_embed_focused_widget_set(e, w);
@@ -1580,13 +1580,13 @@ ewl_embed_focused_widget_set(Ewl_Embed *embed, Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (embed->last.focused && (embed->last.focused != w))
- ewl_callback_call_with_event_data(embed->last.focused,
- EWL_CALLBACK_FOCUS_OUT, w);
+ ewl_callback_call_with_event_data(embed->last.focused,
+ EWL_CALLBACK_FOCUS_OUT, w);
embed->last.focused = w;
if (embed->last.focused)
- ewl_callback_call(embed->last.focused, EWL_CALLBACK_FOCUS_IN);
+ ewl_callback_call(embed->last.focused, EWL_CALLBACK_FOCUS_IN);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1619,8 +1619,8 @@ ewl_embed_info_parent_find(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, NULL);
for (temp = w->parent; temp; temp = temp->parent) {
- if (VISIBLE(temp) && !DISABLED(temp) && !DESTROYED(temp))
- break;
+ if (VISIBLE(temp) && !DISABLED(temp) && !DESTROYED(temp))
+ break;
}
DRETURN_PTR(temp, DLEVEL_STABLE);
@@ -1646,29 +1646,29 @@ ewl_embed_info_widgets_cleanup(Ewl_Embed *e, Ewl_Widget *w)
ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAG_STATE_PRESSED);
if ((w == e->last.focused)
- || (RECURSIVE(w)
- && ewl_widget_parent_of(w, e->last.focused)))
- e->last.focused = ewl_embed_info_parent_find(w);
+ || (RECURSIVE(w)
+ && ewl_widget_parent_of(w, e->last.focused)))
+ e->last.focused = ewl_embed_info_parent_find(w);
if ((w == e->last.clicked)
- || (RECURSIVE(w)
- && ewl_widget_parent_of(w, e->last.clicked)))
- e->last.clicked = ewl_embed_info_parent_find(w);
+ || (RECURSIVE(w)
+ && ewl_widget_parent_of(w, e->last.clicked)))
+ e->last.clicked = ewl_embed_info_parent_find(w);
if ((w == e->last.mouse_in)
- || (RECURSIVE(w)
- && ewl_widget_parent_of(w, e->last.mouse_in)))
- e->last.mouse_in = ewl_embed_info_parent_find(w);
+ || (RECURSIVE(w)
+ && ewl_widget_parent_of(w, e->last.mouse_in)))
+ e->last.mouse_in = ewl_embed_info_parent_find(w);
if ((w == e->last.drop_widget)
- || (RECURSIVE(w)
- && ewl_widget_parent_of(w, e->last.drop_widget)))
- e->last.drop_widget = ewl_embed_info_parent_find(w);
+ || (RECURSIVE(w)
+ && ewl_widget_parent_of(w, e->last.drop_widget)))
+ e->last.drop_widget = ewl_embed_info_parent_find(w);
if ((w == e->last.drag_widget)
- || (RECURSIVE(w)
- && ewl_widget_parent_of(w, e->last.drag_widget)))
- e->last.drag_widget = ewl_embed_info_parent_find(w);
+ || (RECURSIVE(w)
+ && ewl_widget_parent_of(w, e->last.drag_widget)))
+ e->last.drag_widget = ewl_embed_info_parent_find(w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1690,10 +1690,10 @@ ewl_embed_coord_to_screen(Ewl_Embed *e, int xx, int yy, int *x, int *y)
DCHECK_TYPE(e, EWL_EMBED_TYPE);
if (e->canvas) {
- if (x) *x = (int)(evas_coord_world_x_to_screen(e->canvas,
- (Evas_Coord)(xx)));
- if (y) *y = (int)(evas_coord_world_y_to_screen(e->canvas,
- (Evas_Coord)(yy)));
+ if (x) *x = (int)(evas_coord_world_x_to_screen(e->canvas,
+ (Evas_Coord)(xx)));
+ if (y) *y = (int)(evas_coord_world_y_to_screen(e->canvas,
+ (Evas_Coord)(yy)));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1722,14 +1722,14 @@ ewl_embed_mouse_cursor_set(Ewl_Widget *w)
if (!embed) DRETURN(DLEVEL_STABLE);
if ((argb = ewl_attach_get(w, EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR))) {
- pointer = argb->handle;
- ewl_attach_mouse_cursor_set(w, pointer);
+ pointer = argb->handle;
+ ewl_attach_mouse_cursor_set(w, pointer);
}
if (!pointer) {
- if (!(pointer = (int)ewl_attach_get(w,
- EWL_ATTACH_TYPE_MOUSE_CURSOR)))
- pointer = EWL_MOUSE_CURSOR_LEFT_PTR;
+ if (!(pointer = (int)ewl_attach_get(w,
+ EWL_ATTACH_TYPE_MOUSE_CURSOR)))
+ pointer = EWL_MOUSE_CURSOR_LEFT_PTR;
}
ewl_engine_pointer_set(embed, pointer);
embed->cursor = pointer;
@@ -1857,7 +1857,7 @@ ewl_embed_thaw(Ewl_Embed *e)
*/
void
ewl_embed_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *emb;
@@ -1870,52 +1870,52 @@ ewl_embed_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
ewl_embed_freeze(emb);
if (!emb->ev_clip) {
- /*
- * first try to get the ev_clip from the cach
- */
- emb->ev_clip = ewl_embed_object_request(emb, "rectangle");
- if (!emb->ev_clip)
- emb->ev_clip = evas_object_rectangle_add(emb->canvas);
-
- evas_object_color_set(emb->ev_clip, 0, 0, 0, 0);
- evas_object_smart_member_add(emb->ev_clip, emb->smart);
- evas_object_show(emb->ev_clip);
+ /*
+ * first try to get the ev_clip from the cach
+ */
+ emb->ev_clip = ewl_embed_object_request(emb, "rectangle");
+ if (!emb->ev_clip)
+ emb->ev_clip = evas_object_rectangle_add(emb->canvas);
+
+ evas_object_color_set(emb->ev_clip, 0, 0, 0, 0);
+ evas_object_smart_member_add(emb->ev_clip, emb->smart);
+ evas_object_show(emb->ev_clip);
}
if (emb->smart) {
- evas_object_focus_set(emb->smart, emb->focus);
- /*
- * Catch mouse events processed through the evas
- */
- evas_object_event_callback_add(emb->smart,
- EVAS_CALLBACK_MOUSE_OUT,
- ewl_embed_evas_cb_mouse_out, emb);
- evas_object_event_callback_add(emb->smart,
- EVAS_CALLBACK_MOUSE_DOWN,
- ewl_embed_evas_cb_mouse_down, emb);
- evas_object_event_callback_add(emb->smart,
- EVAS_CALLBACK_MOUSE_UP,
- ewl_embed_evas_cb_mouse_up, emb);
- evas_object_event_callback_add(emb->smart,
- EVAS_CALLBACK_MOUSE_MOVE,
- ewl_embed_evas_cb_mouse_move, emb);
- evas_object_event_callback_add(emb->smart,
- EVAS_CALLBACK_MOUSE_WHEEL,
- ewl_embed_evas_cb_mouse_wheel, emb);
-
- /*
- * Catch key events processed through the evas
- */
- evas_object_event_callback_add(emb->smart,
- EVAS_CALLBACK_KEY_DOWN,
- ewl_embed_evas_cb_key_down, emb);
- evas_object_event_callback_add(emb->smart,
- EVAS_CALLBACK_KEY_UP, ewl_embed_evas_cb_key_up,
- emb);
+ evas_object_focus_set(emb->smart, emb->focus);
+ /*
+ * Catch mouse events processed through the evas
+ */
+ evas_object_event_callback_add(emb->smart,
+ EVAS_CALLBACK_MOUSE_OUT,
+ ewl_embed_evas_cb_mouse_out, emb);
+ evas_object_event_callback_add(emb->smart,
+ EVAS_CALLBACK_MOUSE_DOWN,
+ ewl_embed_evas_cb_mouse_down, emb);
+ evas_object_event_callback_add(emb->smart,
+ EVAS_CALLBACK_MOUSE_UP,
+ ewl_embed_evas_cb_mouse_up, emb);
+ evas_object_event_callback_add(emb->smart,
+ EVAS_CALLBACK_MOUSE_MOVE,
+ ewl_embed_evas_cb_mouse_move, emb);
+ evas_object_event_callback_add(emb->smart,
+ EVAS_CALLBACK_MOUSE_WHEEL,
+ ewl_embed_evas_cb_mouse_wheel, emb);
+
+ /*
+ * Catch key events processed through the evas
+ */
+ evas_object_event_callback_add(emb->smart,
+ EVAS_CALLBACK_KEY_DOWN,
+ ewl_embed_evas_cb_key_down, emb);
+ evas_object_event_callback_add(emb->smart,
+ EVAS_CALLBACK_KEY_UP, ewl_embed_evas_cb_key_up,
+ emb);
}
if (emb->dnd_count)
- ewl_engine_embed_dnd_aware_set(emb);
+ ewl_engine_embed_dnd_aware_set(emb);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1930,7 +1930,7 @@ ewl_embed_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_embed_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *emb;
@@ -1940,14 +1940,14 @@ ewl_embed_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
emb = EWL_EMBED(w);
if (emb->ev_clip) {
- ewl_canvas_object_destroy(emb->ev_clip);
- emb->ev_clip = NULL;
+ ewl_canvas_object_destroy(emb->ev_clip);
+ emb->ev_clip = NULL;
}
if (emb->smart) {
- evas_object_smart_data_set(emb->smart, NULL);
- ewl_canvas_object_destroy(emb->smart);
- emb->smart = NULL;
+ evas_object_smart_data_set(emb->smart, NULL);
+ ewl_canvas_object_destroy(emb->smart);
+ emb->smart = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1963,7 +1963,7 @@ ewl_embed_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_embed_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *emb;
@@ -1973,10 +1973,10 @@ ewl_embed_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
emb = EWL_EMBED(w);
if (emb->ev_clip) {
- evas_object_move(emb->ev_clip, (Evas_Coord)(CURRENT_X(w)),
- (Evas_Coord)(CURRENT_Y(w)));
- evas_object_resize(emb->ev_clip, (Evas_Coord)(CURRENT_W(w)),
- (Evas_Coord)(CURRENT_H(w)));
+ evas_object_move(emb->ev_clip, (Evas_Coord)(CURRENT_X(w)),
+ (Evas_Coord)(CURRENT_Y(w)));
+ evas_object_resize(emb->ev_clip, (Evas_Coord)(CURRENT_W(w)),
+ (Evas_Coord)(CURRENT_H(w)));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1992,7 +1992,7 @@ ewl_embed_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_embed_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *emb;
@@ -2002,11 +2002,11 @@ ewl_embed_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
emb = EWL_EMBED(w);
if (!emb->last.focused)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_object_state_has(EWL_OBJECT(emb->last.focused),
- EWL_FLAG_STATE_PRESSED))
- ewl_embed_mouse_up_feed(emb, 1, 0, 0, ewl_ev_modifiers_get());
+ EWL_FLAG_STATE_PRESSED))
+ ewl_embed_mouse_up_feed(emb, 1, 0, 0, ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2020,7 +2020,7 @@ ewl_embed_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
* @brief The destroy callback
*/
void ewl_embed_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *emb;
@@ -2030,7 +2030,7 @@ void ewl_embed_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
emb = EWL_EMBED(w);
if (ecore_list_goto(ewl_embed_list, w))
- ecore_list_remove(ewl_embed_list);
+ ecore_list_remove(ewl_embed_list);
ewl_embed_cache_cleanup(emb);
@@ -2038,7 +2038,7 @@ void ewl_embed_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
emb->tab_order = NULL;
if (emb == ewl_embed_active_embed)
- ewl_embed_active_embed = NULL;
+ ewl_embed_active_embed = NULL;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2056,7 +2056,7 @@ ewl_embed_dnd_aware_set(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
if (REALIZED(embed) && (embed->dnd_count == 0))
- ewl_engine_embed_dnd_aware_set(embed);
+ ewl_engine_embed_dnd_aware_set(embed);
embed->dnd_count++;
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2076,7 +2076,7 @@ ewl_embed_dnd_aware_remove(Ewl_Embed *embed)
/* FIXME: Need to remove the XdndAware property on refcount == 0
if (REALIZED(embed) && (embed->dnd_count == 0))
- ewl_engine_embed_dnd_aware_set(embed); */
+ ewl_engine_embed_dnd_aware_set(embed); */
embed->dnd_count--;
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2120,25 +2120,25 @@ ewl_embed_cache_cleanup(Ewl_Embed *emb)
key_list = ecore_hash_keys(emb->obj_cache);
if (key_list) {
- char *key;
- Evas_Object *obj;
- Ecore_List *obj_list;
-
- /*
- * Iterate over all object types destroying them as we go. No
- * need to free the key string.
- */
- while ((key = ecore_list_first_remove(key_list))) {
- /*
- * Now queue all objects for destruction.
- */
- obj_list = ecore_hash_remove(emb->obj_cache, key);
- while ((obj = ecore_list_first_remove(obj_list)))
- ewl_canvas_object_destroy(obj);
-
- IF_FREE_LIST(obj_list);
- }
- IF_FREE_LIST(key_list);
+ char *key;
+ Evas_Object *obj;
+ Ecore_List *obj_list;
+
+ /*
+ * Iterate over all object types destroying them as we go. No
+ * need to free the key string.
+ */
+ while ((key = ecore_list_first_remove(key_list))) {
+ /*
+ * Now queue all objects for destruction.
+ */
+ obj_list = ecore_hash_remove(emb->obj_cache, key);
+ while ((obj = ecore_list_first_remove(obj_list)))
+ ewl_canvas_object_destroy(obj);
+
+ IF_FREE_LIST(obj_list);
+ }
+ IF_FREE_LIST(key_list);
}
IF_FREE_HASH(emb->obj_cache);
@@ -2155,8 +2155,8 @@ ewl_embed_smart_cb_del(Evas_Object *obj)
emb = evas_object_smart_data_get(obj);
if (emb) {
- emb->smart = NULL;
- ewl_widget_unrealize(EWL_WIDGET(emb));
+ emb->smart = NULL;
+ ewl_widget_unrealize(EWL_WIDGET(emb));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2172,8 +2172,8 @@ ewl_embed_smart_cb_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
emb = evas_object_smart_data_get(obj);
if (emb)
- ewl_object_position_request(EWL_OBJECT(emb),
- (int)(x), (int)(y));
+ ewl_object_position_request(EWL_OBJECT(emb),
+ (int)(x), (int)(y));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2188,7 +2188,7 @@ ewl_embed_smart_cb_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
emb = evas_object_smart_data_get(obj);
if (emb)
- ewl_object_size_request(EWL_OBJECT(emb), (int)(w), (int)(h));
+ ewl_object_size_request(EWL_OBJECT(emb), (int)(w), (int)(h));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2233,7 +2233,7 @@ ewl_embed_smart_cb_clip_set(Evas_Object *obj, Evas_Object *clip)
emb = evas_object_smart_data_get(obj);
w = EWL_WIDGET(emb);
if (emb && w->fx_clip_box && (clip != w->fx_clip_box))
- evas_object_clip_set(w->fx_clip_box, clip);
+ evas_object_clip_set(w->fx_clip_box, clip);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2250,14 +2250,14 @@ ewl_embed_smart_cb_clip_unset(Evas_Object *obj)
emb = evas_object_smart_data_get(obj);
w = EWL_WIDGET(emb);
if (emb && w->fx_clip_box)
- evas_object_clip_unset(w->fx_clip_box);
+ evas_object_clip_unset(w->fx_clip_box);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_embed_evas_cb_mouse_out(void *data, Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__, void *event_info)
+ Evas_Object *obj __UNUSED__, void *event_info)
{
Ewl_Embed *embed;
Evas_Event_Mouse_Out *ev = event_info;
@@ -2269,18 +2269,18 @@ ewl_embed_evas_cb_mouse_out(void *data, Evas *e __UNUSED__,
embed = data;
if (ev->canvas.x < CURRENT_X(embed)
- || ev->canvas.x >= (CURRENT_X(embed) + CURRENT_W(embed))
- || ev->canvas.y < CURRENT_Y(embed)
- || ev->canvas.y >= (CURRENT_Y(embed) + CURRENT_H(embed)))
- ewl_embed_mouse_out_feed(embed, ev->canvas.x, ev->canvas.y,
- ewl_ev_modifiers_get());
+ || ev->canvas.x >= (CURRENT_X(embed) + CURRENT_W(embed))
+ || ev->canvas.y < CURRENT_Y(embed)
+ || ev->canvas.y >= (CURRENT_Y(embed) + CURRENT_H(embed)))
+ ewl_embed_mouse_out_feed(embed, ev->canvas.x, ev->canvas.y,
+ ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_embed_evas_cb_mouse_down(void *data, Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__, void *event_info)
+ Evas_Object *obj __UNUSED__, void *event_info)
{
Ewl_Embed *embed;
Evas_Event_Mouse_Down *ev;
@@ -2292,14 +2292,14 @@ ewl_embed_evas_cb_mouse_down(void *data, Evas *e __UNUSED__,
ev = event_info;
embed = data;
ewl_embed_mouse_down_feed(embed, ev->button, 1, ev->canvas.x,
- ev->canvas.y, ewl_ev_modifiers_get());
+ ev->canvas.y, ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_embed_evas_cb_mouse_up(void *data, Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__, void *event_info)
+ Evas_Object *obj __UNUSED__, void *event_info)
{
Ewl_Embed *embed;
Evas_Event_Mouse_Up *ev;
@@ -2311,14 +2311,14 @@ ewl_embed_evas_cb_mouse_up(void *data, Evas *e __UNUSED__,
ev = event_info;
embed = data;
ewl_embed_mouse_up_feed(embed, ev->button, ev->canvas.x,
- ev->canvas.y, ewl_ev_modifiers_get());
+ ev->canvas.y, ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_embed_evas_cb_mouse_move(void *data, Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__, void *event_info)
+ Evas_Object *obj __UNUSED__, void *event_info)
{
Ewl_Embed *embed;
Evas_Event_Mouse_Move *ev;
@@ -2330,15 +2330,15 @@ ewl_embed_evas_cb_mouse_move(void *data, Evas *e __UNUSED__,
ev = event_info;
embed = data;
ewl_embed_mouse_move_feed(embed, ev->cur.canvas.x, ev->cur.canvas.y,
- ewl_ev_modifiers_get());
+ ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_embed_evas_cb_mouse_wheel(void *data, Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__,
- void *event_info)
+ Evas_Object *obj __UNUSED__,
+ void *event_info)
{
Ewl_Embed *embed;
Evas_Event_Mouse_Wheel *ev;
@@ -2351,14 +2351,14 @@ ewl_embed_evas_cb_mouse_wheel(void *data, Evas *e __UNUSED__,
embed = data;
ewl_embed_mouse_wheel_feed(embed, ev->canvas.x, ev->canvas.y, ev->z,
- ev->direction, ewl_ev_modifiers_get());
+ ev->direction, ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_embed_evas_cb_key_down(void *data, Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__, void *event_info)
+ Evas_Object *obj __UNUSED__, void *event_info)
{
Ewl_Embed *embed;
Evas_Event_Key_Down *ev;
@@ -2372,33 +2372,33 @@ ewl_embed_evas_cb_key_down(void *data, Evas *e __UNUSED__,
embed = data;
if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
- key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers |= EWL_KEY_MODIFIER_SHIFT;
else if (evas_key_modifier_is_set(ev->modifiers, "Alt"))
- key_modifiers |= EWL_KEY_MODIFIER_ALT;
+ key_modifiers |= EWL_KEY_MODIFIER_ALT;
else if (evas_key_modifier_is_set(ev->modifiers, "Control"))
- key_modifiers |= EWL_KEY_MODIFIER_CTRL;
+ key_modifiers |= EWL_KEY_MODIFIER_CTRL;
else if (evas_key_modifier_is_set(ev->modifiers, "Meta"))
- key_modifiers |= EWL_KEY_MODIFIER_MOD;
+ key_modifiers |= EWL_KEY_MODIFIER_MOD;
else if (evas_key_modifier_is_set(ev->modifiers, "Super"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
else if (evas_key_modifier_is_set(ev->modifiers, "Hyper"))
- key_modifiers |= EWL_KEY_MODIFIER_WIN;
+ key_modifiers |= EWL_KEY_MODIFIER_WIN;
ewl_ev_modifiers_set(key_modifiers);
if (!ev->string || iscntrl(*ev->string))
- ewl_embed_key_down_feed(embed, ev->keyname,
- ewl_ev_modifiers_get());
+ ewl_embed_key_down_feed(embed, ev->keyname,
+ ewl_ev_modifiers_get());
else
- ewl_embed_key_down_feed(embed, ev->string,
- ewl_ev_modifiers_get());
+ ewl_embed_key_down_feed(embed, ev->string,
+ ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_embed_evas_cb_key_up(void *data, Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__, void *event_info)
+ Evas_Object *obj __UNUSED__, void *event_info)
{
Ewl_Embed *embed;
Evas_Event_Key_Down *ev = event_info;
@@ -2411,26 +2411,26 @@ ewl_embed_evas_cb_key_up(void *data, Evas *e __UNUSED__,
embed = data;
key_modifiers = ewl_ev_modifiers_get();
if (!evas_key_modifier_is_set(ev->modifiers, "Shift"))
- key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_SHIFT;
else if (!evas_key_modifier_is_set(ev->modifiers, "Alt"))
- key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
+ key_modifiers &= ~EWL_KEY_MODIFIER_ALT;
else if (!evas_key_modifier_is_set(ev->modifiers, "Control"))
- key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
+ key_modifiers &= ~EWL_KEY_MODIFIER_CTRL;
else if (!evas_key_modifier_is_set(ev->modifiers, "Meta"))
- key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
+ key_modifiers &= ~EWL_KEY_MODIFIER_MOD;
else if (!evas_key_modifier_is_set(ev->modifiers, "Super"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
else if (!evas_key_modifier_is_set(ev->modifiers, "Hyper"))
- key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
+ key_modifiers &= ~EWL_KEY_MODIFIER_WIN;
ewl_ev_modifiers_set(key_modifiers);
if (!ev->string || iscntrl(*ev->string))
- ewl_embed_key_up_feed(embed, ev->keyname,
- ewl_ev_modifiers_get());
+ ewl_embed_key_up_feed(embed, ev->keyname,
+ ewl_ev_modifiers_get());
else
- ewl_embed_key_up_feed(embed, ev->string,
- ewl_ev_modifiers_get());
+ ewl_embed_key_up_feed(embed, ev->string,
+ ewl_ev_modifiers_get());
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_embed.h b/src/lib/ewl_embed.h
index 21313e3..740e8ac 100644
--- a/src/lib/ewl_embed.h
+++ b/src/lib/ewl_embed.h
@@ -61,121 +61,121 @@ typedef void *Ewl_Embed_Window;
*/
struct Ewl_Embed
{
- Ewl_Cell cell; /**< Inherits from the Ewl_Cell class */
+ Ewl_Cell cell; /**< Inherits from the Ewl_Cell class */
const char *engine_name; /**< Name of current engine used */
- void *engine; /**< The display engine */
+ void *engine; /**< The display engine */
- void *canvas; /**< Canvas where drawing takes place. */
- void *canvas_window; /**< The window holding the canvas. */
- int cursor; /**< Id for current cursor in use */
+ void *canvas; /**< Canvas where drawing takes place. */
+ void *canvas_window; /**< The window holding the canvas. */
+ int cursor; /**< Id for current cursor in use */
- void *smart; /**< Manipulate Ewl_Embed from canvas */
- void *ev_clip; /**< Clip box to receive canvas events */
+ void *smart; /**< Manipulate Ewl_Embed from canvas */
+ void *ev_clip; /**< Clip box to receive canvas events */
Ecore_DList *tab_order; /**< Order of widgets to send focus */
Ecore_Hash *obj_cache; /**< Hash of object queues for reuse */
struct
{
- Ewl_Widget *clicked; /**< Last clicked widget */
- Ewl_Widget *focused; /**< Last focused widget */
- Ewl_Widget *mouse_in; /**< Last widget to receive a mouse_in */
- Ewl_Widget *drop_widget; /**< The current DND drop target */
- Ewl_Widget *drag_widget; /**< The current DND drag source */
- } last; /**< Collection of widgets to last receive events */
+ Ewl_Widget *clicked; /**< Last clicked widget */
+ Ewl_Widget *focused; /**< Last focused widget */
+ Ewl_Widget *mouse_in; /**< Last widget to receive a mouse_in */
+ Ewl_Widget *drop_widget; /**< The current DND drop target */
+ Ewl_Widget *drag_widget; /**< The current DND drag source */
+ } last; /**< Collection of widgets to last receive events */
int x; /**< Screen relative horizontal position of window */
int y; /**< Screen relative vertical position of window */
- int dnd_count; /**< DND aware widget count */
- int focus; /**< Indicates if it receives focus */
+ int dnd_count; /**< DND aware widget count */
+ int focus; /**< Indicates if it receives focus */
- Ewl_Dnd_Types dnd_types; /**< The dnd type */
- Ewl_Widget *dnd_last_position; /**< The last dnd position */
+ Ewl_Dnd_Types dnd_types; /**< The dnd type */
+ Ewl_Widget *dnd_last_position; /**< The last dnd position */
};
Ewl_Widget *ewl_embed_new(void);
-int ewl_embed_init(Ewl_Embed *emb);
-int ewl_embed_engine_name_set(Ewl_Embed *embed, const char *engine);
+int ewl_embed_init(Ewl_Embed *emb);
+int ewl_embed_engine_name_set(Ewl_Embed *embed, const char *engine);
const char *ewl_embed_engine_name_get(Ewl_Embed *embed);
-void ewl_embed_shutdown(void);
+void ewl_embed_shutdown(void);
void *ewl_embed_canvas_set(Ewl_Embed *emb, void *canvas,
- Ewl_Embed_Window *canvas_window);
+ Ewl_Embed_Window *canvas_window);
-void ewl_embed_focus_set(Ewl_Embed *embed, int f);
-int ewl_embed_focus_get(Ewl_Embed *embed);
+void ewl_embed_focus_set(Ewl_Embed *embed, int f);
+int ewl_embed_focus_get(Ewl_Embed *embed);
-void ewl_embed_active_set(Ewl_Embed *embed, unsigned int act);
+void ewl_embed_active_set(Ewl_Embed *embed, unsigned int act);
Ewl_Embed *ewl_embed_active_embed_get(void);
-void ewl_embed_last_mouse_position_get(int *x, int *y);
+void ewl_embed_last_mouse_position_get(int *x, int *y);
-void ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname,
- unsigned int modifiers);
-void ewl_embed_key_up_feed(Ewl_Embed *embed, const char *keyname,
- unsigned int modifiers);
-void ewl_embed_mouse_down_feed(Ewl_Embed *embed, int b, int clicks,
- int x, int y, unsigned int modifiers);
-void ewl_embed_mouse_up_feed(Ewl_Embed *embed, int b, int x,
- int y, unsigned int modifiers);
-void ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y,
- unsigned int modifiers);
+void ewl_embed_key_down_feed(Ewl_Embed *embed, const char *keyname,
+ unsigned int modifiers);
+void ewl_embed_key_up_feed(Ewl_Embed *embed, const char *keyname,
+ unsigned int modifiers);
+void ewl_embed_mouse_down_feed(Ewl_Embed *embed, int b, int clicks,
+ int x, int y, unsigned int modifiers);
+void ewl_embed_mouse_up_feed(Ewl_Embed *embed, int b, int x,
+ int y, unsigned int modifiers);
+void ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y,
+ unsigned int modifiers);
const char *ewl_embed_dnd_position_feed(Ewl_Embed *embed, int x, int y,
- int *, int *, int *, int *);
+ int *, int *, int *, int *);
const char *ewl_embed_dnd_drop_feed(Ewl_Embed* embed, int x, int y,
- int internal);
-void ewl_embed_dnd_data_received_feed(Ewl_Embed* embed, char *type,
- void *data,
- unsigned int len,
- unsigned int format);
-void ewl_embed_dnd_data_request_feed(Ewl_Embed* embed, void *handle,
- char *type);
-
-void ewl_embed_mouse_out_feed(Ewl_Embed *embed, int x, int y,
- unsigned int modifiers);
-void ewl_embed_mouse_wheel_feed(Ewl_Embed *embed, int x, int y,
- int z, int dir, unsigned int mods);
-
-void ewl_embed_font_path_add(char *path);
+ int internal);
+void ewl_embed_dnd_data_received_feed(Ewl_Embed* embed, char *type,
+ void *data,
+ unsigned int len,
+ unsigned int format);
+void ewl_embed_dnd_data_request_feed(Ewl_Embed* embed, void *handle,
+ char *type);
+
+void ewl_embed_mouse_out_feed(Ewl_Embed *embed, int x, int y,
+ unsigned int modifiers);
+void ewl_embed_mouse_wheel_feed(Ewl_Embed *embed, int x, int y,
+ int z, int dir, unsigned int mods);
+
+void ewl_embed_font_path_add(char *path);
Ewl_Embed *ewl_embed_canvas_window_find(Ewl_Embed_Window *win);
Ewl_Embed *ewl_embed_widget_find(Ewl_Widget *w);
-void ewl_embed_object_cache(Ewl_Embed *e, void *obj);
+void ewl_embed_object_cache(Ewl_Embed *e, void *obj);
void *ewl_embed_object_request(Ewl_Embed *e, char *type);
-void ewl_embed_tab_order_append(Ewl_Embed *e, Ewl_Widget *w);
-void ewl_embed_tab_order_prepend(Ewl_Embed *e, Ewl_Widget *w);
-void ewl_embed_tab_order_insert(Ewl_Embed *e, Ewl_Widget *w,
- unsigned int idx);
-void ewl_embed_tab_order_insert_before(Ewl_Embed *e, Ewl_Widget *w,
- Ewl_Widget *before);
-void ewl_embed_tab_order_insert_after(Ewl_Embed *e, Ewl_Widget *w,
- Ewl_Widget *after);
-void ewl_embed_tab_order_remove(Ewl_Embed *e, Ewl_Widget *w);
-void ewl_embed_tab_order_next(Ewl_Embed *e);
-void ewl_embed_tab_order_previous(Ewl_Embed *e);
-
-void ewl_embed_focused_widget_set(Ewl_Embed *e, Ewl_Widget *w);
+void ewl_embed_tab_order_append(Ewl_Embed *e, Ewl_Widget *w);
+void ewl_embed_tab_order_prepend(Ewl_Embed *e, Ewl_Widget *w);
+void ewl_embed_tab_order_insert(Ewl_Embed *e, Ewl_Widget *w,
+ unsigned int idx);
+void ewl_embed_tab_order_insert_before(Ewl_Embed *e, Ewl_Widget *w,
+ Ewl_Widget *before);
+void ewl_embed_tab_order_insert_after(Ewl_Embed *e, Ewl_Widget *w,
+ Ewl_Widget *after);
+void ewl_embed_tab_order_remove(Ewl_Embed *e, Ewl_Widget *w);
+void ewl_embed_tab_order_next(Ewl_Embed *e);
+void ewl_embed_tab_order_previous(Ewl_Embed *e);
+
+void ewl_embed_focused_widget_set(Ewl_Embed *e, Ewl_Widget *w);
Ewl_Widget *ewl_embed_focused_widget_get(Ewl_Embed *e);
-void ewl_embed_info_widgets_cleanup(Ewl_Embed *e, Ewl_Widget *w);
+void ewl_embed_info_widgets_cleanup(Ewl_Embed *e, Ewl_Widget *w);
-void ewl_embed_coord_to_screen(Ewl_Embed *e, int xx, int yy,
- int *x, int *y);
+void ewl_embed_coord_to_screen(Ewl_Embed *e, int xx, int yy,
+ int *x, int *y);
-void ewl_embed_mouse_cursor_set(Ewl_Widget *w);
-void ewl_embed_position_get(Ewl_Embed *e, int *x, int *y);
-void ewl_embed_window_position_get(Ewl_Embed *e, int *x, int *y);
-void ewl_embed_desktop_size_get(Ewl_Embed *e, int *w, int *y);
-void ewl_embed_freeze(Ewl_Embed *e);
-void ewl_embed_thaw(Ewl_Embed *e);
+void ewl_embed_mouse_cursor_set(Ewl_Widget *w);
+void ewl_embed_position_get(Ewl_Embed *e, int *x, int *y);
+void ewl_embed_window_position_get(Ewl_Embed *e, int *x, int *y);
+void ewl_embed_desktop_size_get(Ewl_Embed *e, int *w, int *y);
+void ewl_embed_freeze(Ewl_Embed *e);
+void ewl_embed_thaw(Ewl_Embed *e);
-void ewl_embed_dnd_aware_set(Ewl_Embed *embed);
-void ewl_embed_dnd_aware_remove(Ewl_Embed *embed);
+void ewl_embed_dnd_aware_set(Ewl_Embed *embed);
+void ewl_embed_dnd_aware_remove(Ewl_Embed *embed);
-void ewl_embed_selection_text_set(Ewl_Embed *emb, const char *txt);
+void ewl_embed_selection_text_set(Ewl_Embed *emb, const char *txt);
-void ewl_embed_cache_cleanup(Ewl_Embed *emb);
+void ewl_embed_cache_cleanup(Ewl_Embed *emb);
/*
* Internally used callbacks, override at your own risk.
diff --git a/src/lib/ewl_engines.c b/src/lib/ewl_engines.c
index a401f72..a014e6a 100644
--- a/src/lib/ewl_engines.c
+++ b/src/lib/ewl_engines.c
@@ -27,7 +27,7 @@ static Ecore_Hash *ewl_engines = NULL;
static void ewl_engine_free(Ewl_Engine *engine);
static void **ewl_engine_hooks_get(Ewl_Engine *engine, Ewl_Engine_Hook_Type type);
static void *ewl_engine_hook_get(Ewl_Embed *embed,
- Ewl_Engine_Hook_Type type, int hook);
+ Ewl_Engine_Hook_Type type, int hook);
/**
* @return Returns no value
@@ -40,7 +40,7 @@ ewl_engines_init(void)
ewl_engines = ecore_hash_new(ecore_str_hash, ecore_str_compare);
if (!ewl_engines)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ecore_hash_free_key_cb_set(ewl_engines, ECORE_FREE_CB(free));
ecore_hash_free_value_cb_set(ewl_engines, ECORE_FREE_CB(ewl_engine_free));
@@ -60,8 +60,8 @@ ewl_engines_shutdown(void)
IF_FREE_HASH(ewl_engines);
if (ewl_engines_path)
{
- ecore_path_group_del(ewl_engines_path);
- ewl_engines_path = 0;
+ ecore_path_group_del(ewl_engines_path);
+ ewl_engines_path = 0;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -80,34 +80,34 @@ ewl_engine_names_get(void)
DENTER_FUNCTION(DLEVEL_STABLE);
snprintf(dir, sizeof(dir), "%s/ewl/%s", PACKAGE_LIB_DIR,
- EWL_ENGINE_DIR);
+ EWL_ENGINE_DIR);
if (!ecore_file_exists(dir))
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
files = ecore_file_ls(dir);
if (!files || (ecore_list_count(files) == 0))
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
names = ecore_list_new();
if (!names)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ecore_list_free_cb_set(names, ECORE_FREE_CB(free));
ecore_list_first_goto(files);
while ((file = ecore_list_next(files)))
{
- char *ext;
-
- ext = strchr(file, '.');
- if (ext)
- {
- char *lastext;
- lastext = strrchr(file, '.');
- if (!strncmp(lastext, EWL_ENGINE_EXT, strlen(EWL_ENGINE_EXT)) && ext == lastext) {
- *ext = '\0';
- ecore_list_append(names, strdup(file));
- }
- }
+ char *ext;
+
+ ext = strchr(file, '.');
+ if (ext)
+ {
+ char *lastext;
+ lastext = strrchr(file, '.');
+ if (!strncmp(lastext, EWL_ENGINE_EXT, strlen(EWL_ENGINE_EXT)) && ext == lastext) {
+ *ext = '\0';
+ ecore_list_append(names, strdup(file));
+ }
+ }
}
IF_FREE_LIST(files);
@@ -137,74 +137,74 @@ ewl_engine_new(const char *name, int *argc, char ** argv)
/* see if we've created this engine already */
engine = ecore_hash_get(ewl_engines, name);
if (engine)
- DRETURN_PTR(engine, DLEVEL_STABLE);
+ DRETURN_PTR(engine, DLEVEL_STABLE);
if (!ewl_engines_path)
{
- char pathname[PATH_MAX];
+ char pathname[PATH_MAX];
- ewl_engines_path = ecore_path_group_new();
- snprintf(pathname, sizeof(pathname), "%s/ewl/%s/",
- PACKAGE_LIB_DIR,
- EWL_ENGINE_DIR);
- ecore_path_group_add(ewl_engines_path, pathname);
+ ewl_engines_path = ecore_path_group_new();
+ snprintf(pathname, sizeof(pathname), "%s/ewl/%s/",
+ PACKAGE_LIB_DIR,
+ EWL_ENGINE_DIR);
+ ecore_path_group_add(ewl_engines_path, pathname);
}
plugin = ecore_plugin_load(ewl_engines_path, name, INTERFACE_CURRENT);
if (!plugin)
{
- DWARNING("Unable to open engine %s.", name);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("Unable to open engine %s.", name);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
dependancies = ecore_plugin_symbol_get(plugin, "ewl_engine_dependancies");
if (!dependancies)
{
- DWARNING("Unable to find ewl_engine_dependancies for "
- "the %s engine.", name);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("Unable to find ewl_engine_dependancies for "
+ "the %s engine.", name);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
/* create all the needed parent engines for this engine */
dep_list = dependancies();
if (dep_list)
{
- char *dep_name;
-
- /* this doesn't have a free callback attached to it because
- * the engines are cached and the _shutdown() function will
- * cleanup the cache */
- deps = ecore_dlist_new();
- while ((dep_name = ecore_list_first_remove(dep_list)))
- {
- Ewl_Engine *parent;
-
- parent = ewl_engine_new(dep_name, argc, argv);
- if (!parent)
- {
- FREE(dep_name);
- ecore_dlist_destroy(dep_list);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
- }
-
- ecore_dlist_append(deps, parent);
- FREE(dep_name);
- }
- ecore_dlist_destroy(dep_list);
+ char *dep_name;
+
+ /* this doesn't have a free callback attached to it because
+ * the engines are cached and the _shutdown() function will
+ * cleanup the cache */
+ deps = ecore_dlist_new();
+ while ((dep_name = ecore_list_first_remove(dep_list)))
+ {
+ Ewl_Engine *parent;
+
+ parent = ewl_engine_new(dep_name, argc, argv);
+ if (!parent)
+ {
+ FREE(dep_name);
+ ecore_dlist_destroy(dep_list);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
+ }
+
+ ecore_dlist_append(deps, parent);
+ FREE(dep_name);
+ }
+ ecore_dlist_destroy(dep_list);
}
create_engine = ecore_plugin_symbol_get(plugin, "ewl_engine_create");
if (!create_engine)
{
- DWARNING("Unable to find ewl_engine_create for the %s engine.", name);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("Unable to find ewl_engine_create for the %s engine.", name);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
engine = EWL_ENGINE(create_engine(argc, argv));
if (!engine)
{
- fprintf(stderr, "Unable to create %s engine.\n", name);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ fprintf(stderr, "Unable to create %s engine.\n", name);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
engine->plugin = plugin;
@@ -230,10 +230,10 @@ ewl_engine_window_new(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
window_new = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_NEW);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_NEW);
if (window_new)
- window_new(win);
+ window_new(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -253,13 +253,13 @@ ewl_engine_window_destroy(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_destroy = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DESTROY);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DESTROY);
if (window_destroy)
- window_destroy(win);
+ window_destroy(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -279,13 +279,13 @@ ewl_engine_window_move(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_move = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_MOVE);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_MOVE);
if (window_move)
- window_move(win);
+ window_move(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -305,13 +305,13 @@ ewl_engine_window_resize(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_resize = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_RESIZE);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_RESIZE);
if (window_resize)
- window_resize(win);
+ window_resize(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -331,10 +331,10 @@ ewl_engine_window_min_max_size_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
window_min_max_size_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_MIN_MAX_SIZE_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_MIN_MAX_SIZE_SET);
if (window_min_max_size_set)
- window_min_max_size_set(win);
+ window_min_max_size_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -354,10 +354,10 @@ ewl_engine_window_show(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
window_show = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_SHOW);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_SHOW);
if (window_show)
- window_show(win);
+ window_show(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -377,10 +377,10 @@ ewl_engine_window_hide(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
window_hide = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_HIDE);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_HIDE);
if (window_hide)
- window_hide(win);
+ window_hide(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -400,13 +400,13 @@ ewl_engine_window_title_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_title_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_TITLE_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_TITLE_SET);
if (window_title_set)
- window_title_set(win);
+ window_title_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -426,13 +426,13 @@ ewl_engine_window_name_class_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_name_class_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_NAME_CLASS_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_NAME_CLASS_SET);
if (window_name_class_set)
- window_name_class_set(win);
+ window_name_class_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -452,13 +452,13 @@ ewl_engine_window_borderless_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_borderless_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_NAME_CLASS_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_NAME_CLASS_SET);
if (window_borderless_set)
- window_borderless_set(win);
+ window_borderless_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -478,13 +478,13 @@ ewl_engine_window_dialog_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_dialog_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DIALOG_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DIALOG_SET);
if (window_dialog_set)
- window_dialog_set(win);
+ window_dialog_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -504,13 +504,13 @@ ewl_engine_window_states_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_states_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_STATES_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_STATES_SET);
if (window_states_set)
- window_states_set(win);
+ window_states_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -530,13 +530,13 @@ ewl_engine_window_hints_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_hints_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_HINTS_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_HINTS_SET);
if (window_hints_set)
- window_hints_set(win);
+ window_hints_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -556,13 +556,13 @@ ewl_engine_window_transient_for(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_transient_for = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_TRANSIENT_FOR);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_TRANSIENT_FOR);
if (window_transient_for)
- window_transient_for(win);
+ window_transient_for(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -582,13 +582,13 @@ ewl_engine_window_leader_set(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!(win->window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_leader_set = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_LEADER_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_LEADER_SET);
if (window_leader_set)
- window_leader_set(win);
+ window_leader_set(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -608,13 +608,13 @@ ewl_engine_window_raise(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_raise = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_RAISE);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_RAISE);
if (window_raise)
- window_raise(win);
+ window_raise(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -634,13 +634,13 @@ ewl_engine_window_lower(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!REALIZED(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
window_lower = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_LOWER);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_LOWER);
if (window_lower)
- window_lower(win);
+ window_lower(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -660,13 +660,13 @@ ewl_engine_keyboard_grab(Ewl_Window *win)
DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, 0);
if (!VISIBLE(win) || !REALIZED(win))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
keyboard_grab = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_KEYBOARD_GRAB);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_KEYBOARD_GRAB);
if (keyboard_grab)
- DRETURN_INT(keyboard_grab(win), DLEVEL_STABLE);
+ DRETURN_INT(keyboard_grab(win), DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -686,13 +686,13 @@ ewl_engine_keyboard_ungrab(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!VISIBLE(win) || !REALIZED(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
keyboard_ungrab = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_KEYBOARD_UNGRAB);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_KEYBOARD_UNGRAB);
if (keyboard_ungrab)
- keyboard_ungrab(win);
+ keyboard_ungrab(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -712,13 +712,13 @@ ewl_engine_pointer_grab(Ewl_Window *win)
DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, 0);
if (!VISIBLE(win) || !REALIZED(win))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
pointer_grab = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_POINTER_GRAB);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_POINTER_GRAB);
if (pointer_grab)
- DRETURN_INT(pointer_grab(win), DLEVEL_STABLE);
+ DRETURN_INT(pointer_grab(win), DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -738,13 +738,13 @@ ewl_engine_pointer_ungrab(Ewl_Window *win)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (!VISIBLE(win) || !REALIZED(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
pointer_ungrab = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_POINTER_UNGRAB);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_POINTER_UNGRAB);
if (pointer_ungrab)
- pointer_ungrab(win);
+ pointer_ungrab(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -766,13 +766,13 @@ ewl_engine_embed_selection_text_set(Ewl_Embed *emb, const char *txt)
DCHECK_TYPE(emb, EWL_EMBED_TYPE);
if (!REALIZED(emb))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
embed_selection_text_set = ewl_engine_hook_get(EWL_EMBED(emb),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_SELECTION_TEXT_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_SELECTION_TEXT_SET);
if (embed_selection_text_set)
- embed_selection_text_set(emb, txt);
+ embed_selection_text_set(emb, txt);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -801,10 +801,10 @@ ewl_engine_window_geometry_get(Ewl_Window *win, int root, int *width, int *heigh
if (height) *height = 0;
window_geometry_get = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_GEOMETRY_GET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_GEOMETRY_GET);
if (window_geometry_get)
- window_geometry_get((root ? NULL : win), width, height);
+ window_geometry_get((root ? NULL : win), width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -824,13 +824,13 @@ ewl_engine_embed_dnd_aware_set(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
if (!(embed->canvas_window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
embed_dnd_aware_set = ewl_engine_hook_get(EWL_EMBED(embed),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DND_AWARE_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DND_AWARE_SET);
if (embed_dnd_aware_set)
- embed_dnd_aware_set(embed);
+ embed_dnd_aware_set(embed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -852,13 +852,13 @@ ewl_engine_embed_dnd_drag_types_set(Ewl_Embed *embed, char **types, unsigned int
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
if (!(embed->canvas_window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
embed_dnd_drag_types_set = ewl_engine_hook_get(EWL_EMBED(embed),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DND_DRAG_TYPES_SET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DND_DRAG_TYPES_SET);
if (embed_dnd_drag_types_set)
- embed_dnd_drag_types_set(embed, types, num);
+ embed_dnd_drag_types_set(embed, types, num);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -878,13 +878,13 @@ ewl_engine_embed_dnd_drag_start(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
if (!(embed->canvas_window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
embed_dnd_drag_start = ewl_engine_hook_get(EWL_EMBED(embed),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DND_DRAG_START);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DND_DRAG_START);
if (embed_dnd_drag_start)
- embed_dnd_drag_start(embed);
+ embed_dnd_drag_start(embed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -904,13 +904,13 @@ ewl_engine_embed_dnd_drag_drop(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
if (!(embed->canvas_window))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
embed_dnd_drag_drop = ewl_engine_hook_get(EWL_EMBED(embed),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DND_DRAG_DROP);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DND_DRAG_DROP);
if (embed_dnd_drag_drop)
- embed_dnd_drag_drop(embed);
+ embed_dnd_drag_drop(embed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -925,7 +925,7 @@ ewl_engine_embed_dnd_drag_drop(Ewl_Embed *embed)
*/
int
ewl_engine_embed_dnd_drag_data_send(Ewl_Embed *embed, void *handle, void *data,
- int size)
+ int size)
{
Ewl_Engine_Cb_Window_Dnd_Drag_Data_Send embed_dnd_drag_data_send;
@@ -934,14 +934,14 @@ ewl_engine_embed_dnd_drag_data_send(Ewl_Embed *embed, void *handle, void *data,
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, FALSE);
if (!(embed->canvas_window))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
embed_dnd_drag_data_send = ewl_engine_hook_get(EWL_EMBED(embed),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DND_DRAG_DATA_SEND);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DND_DRAG_DATA_SEND);
if (embed_dnd_drag_data_send)
- DRETURN_INT(embed_dnd_drag_data_send(embed, handle, data, size),
- DLEVEL_STABLE);
+ DRETURN_INT(embed_dnd_drag_data_send(embed, handle, data, size),
+ DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -963,10 +963,10 @@ ewl_engine_desktop_size_get(Ewl_Embed *embed, int *w, int *h)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
desktop_size_get = ewl_engine_hook_get(EWL_EMBED(embed),
- EWL_ENGINE_HOOK_TYPE_WINDOW,
- EWL_ENGINE_WINDOW_DESKTOP_SIZE_GET);
+ EWL_ENGINE_HOOK_TYPE_WINDOW,
+ EWL_ENGINE_WINDOW_DESKTOP_SIZE_GET);
if (desktop_size_get)
- desktop_size_get(embed, w, h);
+ desktop_size_get(embed, w, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -987,10 +987,10 @@ ewl_engine_canvas_setup(Ewl_Window *win, int debug)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
canvas_setup = ewl_engine_hook_get(EWL_EMBED(win),
- EWL_ENGINE_HOOK_TYPE_CANVAS,
- EWL_ENGINE_CANVAS_SETUP);
+ EWL_ENGINE_HOOK_TYPE_CANVAS,
+ EWL_ENGINE_CANVAS_SETUP);
if (canvas_setup)
- canvas_setup(win, debug);
+ canvas_setup(win, debug);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1014,10 +1014,10 @@ ewl_engine_canvas_output_set(Ewl_Embed *emb, int x, int y, int width, int height
DCHECK_TYPE(emb, EWL_EMBED_TYPE);
canvas_output_set = ewl_engine_hook_get(emb,
- EWL_ENGINE_HOOK_TYPE_CANVAS,
- EWL_ENGINE_CANVAS_OUTPUT_SET);
+ EWL_ENGINE_HOOK_TYPE_CANVAS,
+ EWL_ENGINE_CANVAS_OUTPUT_SET);
if (canvas_output_set)
- canvas_output_set(emb, x, y, width, height);
+ canvas_output_set(emb, x, y, width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1037,10 +1037,10 @@ ewl_engine_canvas_render(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
canvas_render = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_CANVAS,
- EWL_ENGINE_CANVAS_RENDER);
+ EWL_ENGINE_HOOK_TYPE_CANVAS,
+ EWL_ENGINE_CANVAS_RENDER);
if (canvas_render)
- canvas_render(embed);
+ canvas_render(embed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1060,10 +1060,10 @@ ewl_engine_canvas_freeze(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
canvas_freeze = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_CANVAS,
- EWL_ENGINE_CANVAS_FREEZE);
+ EWL_ENGINE_HOOK_TYPE_CANVAS,
+ EWL_ENGINE_CANVAS_FREEZE);
if (canvas_freeze)
- canvas_freeze(embed);
+ canvas_freeze(embed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1083,10 +1083,10 @@ ewl_engine_canvas_thaw(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
canvas_thaw = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_CANVAS,
- EWL_ENGINE_CANVAS_THAW);
+ EWL_ENGINE_HOOK_TYPE_CANVAS,
+ EWL_ENGINE_CANVAS_THAW);
if (canvas_thaw)
- canvas_thaw(embed);
+ canvas_thaw(embed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1101,10 +1101,10 @@ ewl_engine_canvas_damage_add(Ewl_Embed *embed, int x, int y, int w, int h)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
damage_add = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_CANVAS,
- EWL_ENGINE_CANVAS_DAMAGE_ADD);
+ EWL_ENGINE_HOOK_TYPE_CANVAS,
+ EWL_ENGINE_CANVAS_DAMAGE_ADD);
if (damage_add)
- damage_add(embed, x, y, w, h);
+ damage_add(embed, x, y, w, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1124,10 +1124,10 @@ ewl_engine_theme_freeze(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_freeze = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_FREEZE);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_FREEZE);
if (theme_freeze)
- theme_freeze();
+ theme_freeze();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1147,10 +1147,10 @@ ewl_engine_theme_thaw(Ewl_Embed *embed)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_thaw = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_THAW);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_THAW);
if (theme_thaw)
- theme_thaw();
+ theme_thaw();
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1174,11 +1174,11 @@ ewl_engine_theme_data_get(Ewl_Widget *w, char *key)
embed = ewl_embed_widget_find(w);
if (embed) {
- theme_data_get = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_DATA_GET);
- if (theme_data_get)
- value = theme_data_get(ewl_theme_path_get(), key);
+ theme_data_get = ewl_engine_hook_get(embed,
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_DATA_GET);
+ if (theme_data_get)
+ value = theme_data_get(ewl_theme_path_get(), key);
}
DRETURN_PTR(value, DLEVEL_STABLE);
@@ -1200,11 +1200,11 @@ ewl_engine_theme_widget_group(Ewl_Widget *w)
embed = ewl_embed_widget_find(w);
if (embed) {
- theme_widget_group = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_WIDGET_GROUP);
- if (theme_widget_group)
- DRETURN_PTR(theme_widget_group(w), DLEVEL_STABLE);
+ theme_widget_group = ewl_engine_hook_get(embed,
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_WIDGET_GROUP);
+ if (theme_widget_group)
+ DRETURN_PTR(theme_widget_group(w), DLEVEL_STABLE);
}
DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -1224,10 +1224,10 @@ ewl_engine_theme_object_add(Ewl_Embed *embed)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, NULL);
theme_object_add = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_ADD);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_ADD);
if (theme_object_add)
- DRETURN_PTR(theme_object_add(embed), DLEVEL_STABLE);
+ DRETURN_PTR(theme_object_add(embed), DLEVEL_STABLE);
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -1247,10 +1247,10 @@ ewl_engine_theme_object_del(Ewl_Embed *embed, void *obj)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_object_del = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_DEL);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_DEL);
if (theme_object_del)
- theme_object_del(obj);
+ theme_object_del(obj);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1269,10 +1269,10 @@ ewl_engine_theme_object_move(Ewl_Embed *embed, void *obj, int x, int y)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_object_move = ewl_engine_hook_get(EWL_EMBED(embed),
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_MOVE);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_MOVE);
if (theme_object_move)
- theme_object_move(obj, x, y);
+ theme_object_move(obj, x, y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1291,10 +1291,10 @@ ewl_engine_theme_object_resize(Ewl_Embed *embed, void *obj, int width, int heigh
DCHECK_TYPE(embed, EWL_WIDGET_TYPE);
theme_object_resize = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_RESIZE);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_RESIZE);
if (theme_object_resize)
- theme_object_resize(obj, width, height);
+ theme_object_resize(obj, width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1313,10 +1313,10 @@ ewl_engine_theme_object_show(Ewl_Embed *embed, void *obj)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_object_show = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_SHOW);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_SHOW);
if (theme_object_show)
- theme_object_show(obj);
+ theme_object_show(obj);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1335,10 +1335,10 @@ ewl_engine_theme_object_hide(Ewl_Embed *embed, void *obj)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_object_hide = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_HIDE);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_HIDE);
if (theme_object_hide)
- theme_object_hide(obj);
+ theme_object_hide(obj);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1357,10 +1357,10 @@ ewl_engine_theme_object_clip_set(Ewl_Embed *embed, void *obj, void *clip)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_object_clip_set = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_CLIP_SET);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_CLIP_SET);
if (theme_object_clip_set)
- theme_object_clip_set(obj, clip);
+ theme_object_clip_set(obj, clip);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1379,10 +1379,10 @@ ewl_engine_theme_object_clip_unset(Ewl_Embed *embed, void *obj)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_object_clip_unset = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_CLIP_UNSET);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_CLIP_UNSET);
if (theme_object_clip_unset)
- theme_object_clip_unset(obj);
+ theme_object_clip_unset(obj);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1401,10 +1401,10 @@ ewl_engine_theme_object_file_set(Ewl_Embed *embed, void *obj, char *file, char *
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
theme_object_file_set = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_THEME,
- EWL_ENGINE_THEME_OBJECT_FILE_SET);
+ EWL_ENGINE_HOOK_TYPE_THEME,
+ EWL_ENGINE_THEME_OBJECT_FILE_SET);
if (theme_object_file_set)
- theme_object_file_set(obj, file, group);
+ theme_object_file_set(obj, file, group);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1423,10 +1423,10 @@ ewl_engine_pointer_data_new(Ewl_Embed *embed, unsigned int *data, int w, int h)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, 0);
pointer_data_new = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_POINTER,
- EWL_ENGINE_POINTER_DATA_NEW);
+ EWL_ENGINE_HOOK_TYPE_POINTER,
+ EWL_ENGINE_POINTER_DATA_NEW);
if (pointer_data_new)
- DRETURN_INT(pointer_data_new(embed, data, w, h), DLEVEL_STABLE);
+ DRETURN_INT(pointer_data_new(embed, data, w, h), DLEVEL_STABLE);
DRETURN_INT(0, DLEVEL_STABLE);
}
@@ -1445,10 +1445,10 @@ ewl_engine_pointer_set(Ewl_Embed *embed, int pointer)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
pointer_set = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_POINTER,
- EWL_ENGINE_POINTER_SET);
+ EWL_ENGINE_HOOK_TYPE_POINTER,
+ EWL_ENGINE_POINTER_SET);
if (pointer_set)
- pointer_set(embed, pointer);
+ pointer_set(embed, pointer);
embed->cursor = pointer;
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1468,10 +1468,10 @@ ewl_engine_pointer_free(Ewl_Embed *embed, int pointer)
DCHECK_TYPE(embed, EWL_EMBED_TYPE);
pointer_free = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_POINTER,
- EWL_ENGINE_POINTER_FREE);
+ EWL_ENGINE_HOOK_TYPE_POINTER,
+ EWL_ENGINE_POINTER_FREE);
if (pointer_free)
- pointer_free(embed, pointer);
+ pointer_free(embed, pointer);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1490,10 +1490,10 @@ ewl_engine_pointer_get(Ewl_Embed *embed)
DCHECK_TYPE_RET(embed, EWL_EMBED_TYPE, 0);
pointer_get = ewl_engine_hook_get(embed,
- EWL_ENGINE_HOOK_TYPE_POINTER,
- EWL_ENGINE_POINTER_GET);
+ EWL_ENGINE_HOOK_TYPE_POINTER,
+ EWL_ENGINE_POINTER_GET);
if (pointer_get)
- DRETURN_INT(pointer_get(embed), DLEVEL_STABLE);
+ DRETURN_INT(pointer_get(embed), DLEVEL_STABLE);
DRETURN_INT(0, DLEVEL_STABLE);
}
@@ -1508,24 +1508,24 @@ ewl_engine_hooks_get(Ewl_Engine *engine, Ewl_Engine_Hook_Type type)
switch (type)
{
- case EWL_ENGINE_HOOK_TYPE_WINDOW:
- hooks = engine->functions->hooks.window;
- break;
-
- case EWL_ENGINE_HOOK_TYPE_CANVAS:
- hooks = engine->functions->hooks.canvas;
- break;
-
- case EWL_ENGINE_HOOK_TYPE_THEME:
- hooks = engine->functions->hooks.theme;
- break;
- case EWL_ENGINE_HOOK_TYPE_POINTER:
- hooks = engine->functions->hooks.pointer;
- break;
-
- default:
- DWARNING("Unknown hook type.");
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ case EWL_ENGINE_HOOK_TYPE_WINDOW:
+ hooks = engine->functions->hooks.window;
+ break;
+
+ case EWL_ENGINE_HOOK_TYPE_CANVAS:
+ hooks = engine->functions->hooks.canvas;
+ break;
+
+ case EWL_ENGINE_HOOK_TYPE_THEME:
+ hooks = engine->functions->hooks.theme;
+ break;
+ case EWL_ENGINE_HOOK_TYPE_POINTER:
+ hooks = engine->functions->hooks.pointer;
+ break;
+
+ default:
+ DWARNING("Unknown hook type.");
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(hooks, DLEVEL_STABLE);
@@ -1553,15 +1553,15 @@ ewl_engine_hook_get(Ewl_Embed *embed, Ewl_Engine_Hook_Type type, int hook)
hooks = ewl_engine_hooks_get(caller, type);
if ((!hooks || !hooks[hook]) && caller->dependancies)
{
- Ecore_DList *deps;
-
- deps = caller->dependancies;
- ecore_dlist_first_goto(deps);
- while ((caller = ecore_dlist_next(deps)))
- {
- hooks = ewl_engine_hooks_get(caller, type);
- if (hooks && hooks[hook]) break;
- }
+ Ecore_DList *deps;
+
+ deps = caller->dependancies;
+ ecore_dlist_first_goto(deps);
+ while ((caller = ecore_dlist_next(deps)))
+ {
+ hooks = ewl_engine_hooks_get(caller, type);
+ if (hooks && hooks[hook]) break;
+ }
}
if (hooks) match = hooks[hook];
@@ -1575,11 +1575,11 @@ ewl_engine_free(Ewl_Engine *engine)
DCHECK_PARAM_PTR(engine);
if (engine->functions->shutdown)
- engine->functions->shutdown(engine);
+ engine->functions->shutdown(engine);
/* parents will be shutdown when their freed by the cleanup code */
if (engine->dependancies)
- ecore_dlist_destroy(engine->dependancies);
+ ecore_dlist_destroy(engine->dependancies);
ecore_plugin_unload(engine->plugin);
engine->plugin = NULL;
diff --git a/src/lib/ewl_engines.h b/src/lib/ewl_engines.h
index 981d312..9f73bc6 100644
--- a/src/lib/ewl_engines.h
+++ b/src/lib/ewl_engines.h
@@ -4,38 +4,38 @@
enum Ewl_Engine_Window_Hooks
{
- EWL_ENGINE_WINDOW_NEW, /**< Create the window */
+ EWL_ENGINE_WINDOW_NEW, /**< Create the window */
EWL_ENGINE_WINDOW_DESTROY,/**< Destroy the window */
- EWL_ENGINE_WINDOW_MOVE, /**< Move the window to
- the given location */
- EWL_ENGINE_WINDOW_RESIZE, /**< Resize the window */
+ EWL_ENGINE_WINDOW_MOVE, /**< Move the window to
+ the given location */
+ EWL_ENGINE_WINDOW_RESIZE, /**< Resize the window */
EWL_ENGINE_WINDOW_MIN_MAX_SIZE_SET, /**< Set the min and max sizes */
- EWL_ENGINE_WINDOW_SHOW, /**< Show the window */
- EWL_ENGINE_WINDOW_HIDE, /**< Hide the window */
+ EWL_ENGINE_WINDOW_SHOW, /**< Show the window */
+ EWL_ENGINE_WINDOW_HIDE, /**< Hide the window */
EWL_ENGINE_WINDOW_TITLE_SET, /**< Set the window title */
EWL_ENGINE_WINDOW_NAME_CLASS_SET,/**< Set the window name/class */
EWL_ENGINE_WINDOW_BORDERLESS_SET,/**< Set the borderless
- state of the window */
- EWL_ENGINE_WINDOW_DIALOG_SET, /**< Set the dialog setting of the window */
- EWL_ENGINE_WINDOW_STATES_SET, /**< Set the window state flags */
- EWL_ENGINE_WINDOW_HINTS_SET, /**< Set the hints */
+ state of the window */
+ EWL_ENGINE_WINDOW_DIALOG_SET, /**< Set the dialog setting of the window */
+ EWL_ENGINE_WINDOW_STATES_SET, /**< Set the window state flags */
+ EWL_ENGINE_WINDOW_HINTS_SET, /**< Set the hints */
EWL_ENGINE_WINDOW_TRANSIENT_FOR,/**< Set the window transient */
- EWL_ENGINE_WINDOW_LEADER_SET, /**< Set the windo to be a client */
- EWL_ENGINE_WINDOW_RAISE, /**< Raise the window */
- EWL_ENGINE_WINDOW_LOWER, /**< Lower the window */
+ EWL_ENGINE_WINDOW_LEADER_SET, /**< Set the windo to be a client */
+ EWL_ENGINE_WINDOW_RAISE, /**< Raise the window */
+ EWL_ENGINE_WINDOW_LOWER, /**< Lower the window */
- EWL_ENGINE_WINDOW_KEYBOARD_GRAB, /**< Set the keyboard grab */
- EWL_ENGINE_WINDOW_KEYBOARD_UNGRAB, /**< Set the keyboard ungrab */
- EWL_ENGINE_WINDOW_POINTER_GRAB, /**< Set the pointer grab */
- EWL_ENGINE_WINDOW_POINTER_UNGRAB, /**< Set the pointer ungrab */
+ EWL_ENGINE_WINDOW_KEYBOARD_GRAB, /**< Set the keyboard grab */
+ EWL_ENGINE_WINDOW_KEYBOARD_UNGRAB, /**< Set the keyboard ungrab */
+ EWL_ENGINE_WINDOW_POINTER_GRAB, /**< Set the pointer grab */
+ EWL_ENGINE_WINDOW_POINTER_UNGRAB, /**< Set the pointer ungrab */
EWL_ENGINE_WINDOW_SELECTION_TEXT_SET, /**< Set the selection text */
EWL_ENGINE_WINDOW_GEOMETRY_GET, /**< Get the window geometry */
- EWL_ENGINE_WINDOW_DND_AWARE_SET, /**< Set the window dnd aware */
+ EWL_ENGINE_WINDOW_DND_AWARE_SET, /**< Set the window dnd aware */
EWL_ENGINE_WINDOW_DESKTOP_SIZE_GET, /**< Get the size of the desktop */
EWL_ENGINE_WINDOW_DND_DRAG_TYPES_SET, /**< Set window drag types */
@@ -126,15 +126,15 @@ typedef struct Ewl_Engine_Info Ewl_Engine_Info;
*/
struct Ewl_Engine_Info
{
- void (*shutdown)(Ewl_Engine *engine); /**< Shutdown the engine */
+ void (*shutdown)(Ewl_Engine *engine); /**< Shutdown the engine */
struct
{
- void **window; /**< The window hooks */
- void **canvas; /**< The canvas hooks */
- void **theme; /**< The theme hooks */
- void **pointer; /**< The pointer hooks */
- } hooks; /**< The engine hooks */
+ void **window; /**< The window hooks */
+ void **canvas; /**< The canvas hooks */
+ void **theme; /**< The theme hooks */
+ void **pointer; /**< The pointer hooks */
+ } hooks; /**< The engine hooks */
};
/**
@@ -142,89 +142,89 @@ struct Ewl_Engine_Info
*/
struct Ewl_Engine
{
- Ecore_Plugin * plugin; /**< The plugin of the engine */
+ Ecore_Plugin * plugin; /**< The plugin of the engine */
- Ecore_DList *dependancies; /**< The engines this one depends on */
- Ewl_Engine_Info *functions; /**< The functions used by ewl,
- suppled by the engine */
+ Ecore_DList *dependancies; /**< The engines this one depends on */
+ Ewl_Engine_Info *functions; /**< The functions used by ewl,
+ suppled by the engine */
};
extern Ecore_Path_Group *ewl_engines_path;
-int ewl_engines_init(void);
-void ewl_engines_shutdown(void);
+int ewl_engines_init(void);
+void ewl_engines_shutdown(void);
Ecore_List *ewl_engine_names_get(void);
Ewl_Engine *ewl_engine_new(const char *name,
- int *argc, char ** argv);
-
-void ewl_engine_event_handlers_init(void);
-void ewl_engine_event_handlers_shutdown(void);
-
-void ewl_engine_engine_shutdown(Ewl_Window *win);
-
-void ewl_engine_window_new(Ewl_Window *win);
-void ewl_engine_window_destroy(Ewl_Window *win);
-
-void ewl_engine_window_move(Ewl_Window *win);
-void ewl_engine_window_resize(Ewl_Window *win);
-void ewl_engine_window_min_max_size_set(Ewl_Window *win);
-void ewl_engine_window_show(Ewl_Window *win);
-void ewl_engine_window_hide(Ewl_Window *win);
-
-void ewl_engine_window_title_set(Ewl_Window *win);
-void ewl_engine_window_name_class_set(Ewl_Window *win);
-
-void ewl_engine_window_borderless_set(Ewl_Window *win);
-void ewl_engine_window_dialog_set(Ewl_Window *win);
-void ewl_engine_window_states_set(Ewl_Window *win);
-void ewl_engine_window_hints_set(Ewl_Window *win);
-void ewl_engine_window_transient_for(Ewl_Window *win);
-void ewl_engine_window_leader_set(Ewl_Window *win);
-
-void ewl_engine_window_raise(Ewl_Window *win);
-void ewl_engine_window_lower(Ewl_Window *win);
-
-int ewl_engine_keyboard_grab(Ewl_Window *win);
-void ewl_engine_keyboard_ungrab(Ewl_Window *win);
-int ewl_engine_pointer_grab(Ewl_Window *win);
-void ewl_engine_pointer_ungrab(Ewl_Window *win);
-
-void ewl_engine_window_geometry_get(Ewl_Window *win, int root,
- int *width, int *height);
-void ewl_engine_embed_selection_text_set(Ewl_Embed *emb,
- const char *txt);
-void ewl_engine_embed_dnd_aware_set(Ewl_Embed *embed);
-void ewl_engine_embed_dnd_drag_types_set(Ewl_Embed *embed,
- char **types,
- unsigned int num);
-void ewl_engine_embed_dnd_drag_start(Ewl_Embed *embed);
-void ewl_engine_embed_dnd_drag_drop(Ewl_Embed *embed);
+ int *argc, char ** argv);
+
+void ewl_engine_event_handlers_init(void);
+void ewl_engine_event_handlers_shutdown(void);
+
+void ewl_engine_engine_shutdown(Ewl_Window *win);
+
+void ewl_engine_window_new(Ewl_Window *win);
+void ewl_engine_window_destroy(Ewl_Window *win);
+
+void ewl_engine_window_move(Ewl_Window *win);
+void ewl_engine_window_resize(Ewl_Window *win);
+void ewl_engine_window_min_max_size_set(Ewl_Window *win);
+void ewl_engine_window_show(Ewl_Window *win);
+void ewl_engine_window_hide(Ewl_Window *win);
+
+void ewl_engine_window_title_set(Ewl_Window *win);
+void ewl_engine_window_name_class_set(Ewl_Window *win);
+
+void ewl_engine_window_borderless_set(Ewl_Window *win);
+void ewl_engine_window_dialog_set(Ewl_Window *win);
+void ewl_engine_window_states_set(Ewl_Window *win);
+void ewl_engine_window_hints_set(Ewl_Window *win);
+void ewl_engine_window_transient_for(Ewl_Window *win);
+void ewl_engine_window_leader_set(Ewl_Window *win);
+
+void ewl_engine_window_raise(Ewl_Window *win);
+void ewl_engine_window_lower(Ewl_Window *win);
+
+int ewl_engine_keyboard_grab(Ewl_Window *win);
+void ewl_engine_keyboard_ungrab(Ewl_Window *win);
+int ewl_engine_pointer_grab(Ewl_Window *win);
+void ewl_engine_pointer_ungrab(Ewl_Window *win);
+
+void ewl_engine_window_geometry_get(Ewl_Window *win, int root,
+ int *width, int *height);
+void ewl_engine_embed_selection_text_set(Ewl_Embed *emb,
+ const char *txt);
+void ewl_engine_embed_dnd_aware_set(Ewl_Embed *embed);
+void ewl_engine_embed_dnd_drag_types_set(Ewl_Embed *embed,
+ char **types,
+ unsigned int num);
+void ewl_engine_embed_dnd_drag_start(Ewl_Embed *embed);
+void ewl_engine_embed_dnd_drag_drop(Ewl_Embed *embed);
int ewl_engine_embed_dnd_drag_data_send(Ewl_Embed *embed,
- void *handle,
- void *data,
- int size);
-void ewl_engine_desktop_size_get(Ewl_Embed *embed, int *w, int *h);
-
-void ewl_engine_canvas_setup(Ewl_Window *win, int debug);
-void ewl_engine_canvas_output_set(Ewl_Embed *emb, int x, int y,
- int width, int height);
-void ewl_engine_canvas_render(Ewl_Embed *embed);
-void ewl_engine_canvas_freeze(Ewl_Embed *embed);
-void ewl_engine_canvas_thaw(Ewl_Embed *embed);
-void ewl_engine_canvas_damage_add(Ewl_Embed *embed, int x, int y,
- int w, int h);
-
-void ewl_engine_theme_freeze(Ewl_Embed *embed);
-void ewl_engine_theme_thaw(Ewl_Embed *embed);
-char *ewl_engine_theme_data_get(Ewl_Widget *w, char *key);
-
-int ewl_engine_pointer_data_new(Ewl_Embed *embed,
- unsigned int *data, int w, int h);
-void ewl_engine_pointer_free(Ewl_Embed *embed, int pointer);
-void ewl_engine_pointer_set(Ewl_Embed *embed, int pointer);
-int ewl_engine_pointer_get(Ewl_Embed *embed);
+ void *handle,
+ void *data,
+ int size);
+void ewl_engine_desktop_size_get(Ewl_Embed *embed, int *w, int *h);
+
+void ewl_engine_canvas_setup(Ewl_Window *win, int debug);
+void ewl_engine_canvas_output_set(Ewl_Embed *emb, int x, int y,
+ int width, int height);
+void ewl_engine_canvas_render(Ewl_Embed *embed);
+void ewl_engine_canvas_freeze(Ewl_Embed *embed);
+void ewl_engine_canvas_thaw(Ewl_Embed *embed);
+void ewl_engine_canvas_damage_add(Ewl_Embed *embed, int x, int y,
+ int w, int h);
+
+void ewl_engine_theme_freeze(Ewl_Embed *embed);
+void ewl_engine_theme_thaw(Ewl_Embed *embed);
+char *ewl_engine_theme_data_get(Ewl_Widget *w, char *key);
+
+int ewl_engine_pointer_data_new(Ewl_Embed *embed,
+ unsigned int *data, int w, int h);
+void ewl_engine_pointer_free(Ewl_Embed *embed, int pointer);
+void ewl_engine_pointer_set(Ewl_Embed *embed, int pointer);
+int ewl_engine_pointer_get(Ewl_Embed *embed);
/**
* Internal engine hook typedefs, you only need these if you're writing an
@@ -234,55 +234,55 @@ int ewl_engine_pointer_get(Ewl_Embed *embed);
typedef void (*Ewl_Engine_Cb_Window_New)(Ewl_Window *win); /**< Create the window */
typedef void (*Ewl_Engine_Cb_Window_Destroy)(Ewl_Window *win);/**< Destroy the window */
typedef void (*Ewl_Engine_Cb_Window_Move)(Ewl_Window *win); /**< Move the window to
- the given location */
+ the given location */
typedef void (*Ewl_Engine_Cb_Window_Resize)(Ewl_Window *win); /**< Resize the window */
typedef void (*Ewl_Engine_Cb_Window_Min_Max_Size_Set)(Ewl_Window *win); /**< Set the min
- and max sizes */
+ and max sizes */
typedef void (*Ewl_Engine_Cb_Window_Show)(Ewl_Window *win); /**< Show the window */
typedef void (*Ewl_Engine_Cb_Window_Hide)(Ewl_Window *win); /**< Hide the window */
typedef void (*Ewl_Engine_Cb_Window_Title_Set)(Ewl_Window *win); /**< Set the window title */
typedef void (*Ewl_Engine_Cb_Window_Name_Class_Set)(Ewl_Window *win); /**< Set the window
- name/class */
+ name/class */
typedef void (*Ewl_Engine_Cb_Window_Borderless_Set)(Ewl_Window *win); /**< Set the borderless
- state of the window */
+ state of the window */
typedef void (*Ewl_Engine_Cb_Window_Dialog_Set)(Ewl_Window *win); /**< Set the dialog
- setting of the window */
+ setting of the window */
typedef void (*Ewl_Engine_Cb_Window_Transient_For)(Ewl_Window *win); /**< Set the window
- transient */
+ transient */
typedef void (*Ewl_Engine_Cb_Window_Leader_Set)(Ewl_Window *win); /**< Set the window's
- leader */
+ leader */
typedef void (*Ewl_Engine_Cb_Window_States_Set)(Ewl_Window *win); /**< Set the window states */
typedef void (*Ewl_Engine_Cb_Window_Hints_Set)(Ewl_Window *win); /**< Set the window hints */
typedef void (*Ewl_Engine_Cb_Window_Raise)(Ewl_Window *win); /**< Raise the window */
typedef void (*Ewl_Engine_Cb_Window_Lower)(Ewl_Window *win); /**< Lower the window */
typedef int (*Ewl_Engine_Cb_Keyboard_Grab)(Ewl_Window *win); /**< Set the keyboard grab */
typedef void (*Ewl_Engine_Cb_Keyboard_Ungrab)(Ewl_Window *win); /**< Set the keyboard
- ungrab */
+ ungrab */
typedef int (*Ewl_Engine_Cb_Pointer_Grab)(Ewl_Window *win); /**< Set the pointer grab */
typedef void (*Ewl_Engine_Cb_Pointer_Ungrab)(Ewl_Window *win); /**< Set the pointer ungrab */
typedef void (*Ewl_Engine_Cb_Window_Selection_Text_Set)(Ewl_Embed *emb,
- const char *txt); /**< Set the
- selection text */
+ const char *txt); /**< Set the
+ selection text */
typedef void (*Ewl_Engine_Cb_Window_Geometry_Get)(Ewl_Window *win,
- int *width, int *height); /**< Get the window
- geometry */
+ int *width, int *height); /**< Get the window
+ geometry */
typedef void (*Ewl_Engine_Cb_Window_Dnd_Aware_Set)(Ewl_Embed *embed); /**< Set the embed
- dnd aware */
+ dnd aware */
typedef void (*Ewl_Engine_Cb_Window_Dnd_Drag_Types_Set)(Ewl_Embed *embed, char **types, unsigned int num); /**< Set the drag types */
typedef void (*Ewl_Engine_Cb_Window_Dnd_Drag_Start)(Ewl_Embed *embed); /**< Start the drag process */
typedef void (*Ewl_Engine_Cb_Window_Dnd_Drag_Drop)(Ewl_Embed *embed); /**< End the drag process with a drop event */
typedef int (*Ewl_Engine_Cb_Window_Dnd_Drag_Data_Send)(Ewl_Embed *embed, void *handle, void *data, int size); /**< Send the drag data */
typedef void (*Ewl_Engine_Cb_Window_Desktop_Size_Get)(Ewl_Embed *embed,
- int *w, int *h); /**< Get the desktop
- size */
+ int *w, int *h); /**< Get the desktop
+ size */
typedef void (*Ewl_Engine_Cb_Canvas_Setup)(Ewl_Window *win, int debug); /**< Setup the render canvas */
typedef void (*Ewl_Engine_Cb_Canvas_Output_Set)(Ewl_Embed *emb, int x, int y,
- int width, int height);
+ int width, int height);
typedef void (*Ewl_Engine_Cb_Canvas_Render)(Ewl_Embed *embed);
typedef void (*Ewl_Engine_Cb_Canvas_Freeze)(Ewl_Embed *embed);
typedef void (*Ewl_Engine_Cb_Canvas_Thaw)(Ewl_Embed *embed);
typedef void (*Ewl_Engine_Cb_Canvas_Damage_Add)(Ewl_Embed *embed,
- int x, int y, int w, int h);
+ int x, int y, int w, int h);
typedef void (*Ewl_Engine_Cb_Theme_Freeze)();
typedef void (*Ewl_Engine_Cb_Theme_Thaw)();
typedef char *(*Ewl_Engine_Cb_Theme_Data_Get)(const char *path, char *key);
@@ -298,27 +298,27 @@ typedef void *(*Ewl_Engine_Cb_Theme_Object_Clip_Unset)(void *obj);
typedef void (*Ewl_Engine_Cb_Theme_Object_Stack_Add)(Ewl_Widget *w);
typedef void (*Ewl_Engine_Cb_Theme_Object_Layer_Update)(Ewl_Widget *w);
typedef void (*Ewl_Engine_Cb_Theme_Object_File_Set)(void *obj, char *path,
- char *group);
+ char *group);
typedef void *(*Ewl_Engine_Cb_Theme_Object_Load_Error)(void *obj);
typedef void (*Ewl_Engine_Cb_Theme_Object_Min_Size_Get)(void *obj, int *w, int *h);
typedef void (*Ewl_Engine_Cb_Theme_Object_Max_Size_Get)(void *obj, int *w, int *h);
typedef void (*Ewl_Engine_Cb_Theme_Object_Signal_Send)(void *obj,
- char *state, char *source);
+ char *state, char *source);
typedef void (*Ewl_Engine_Cb_Theme_Object_Part_Text_Set)(void *obj,
- char *part, char *text);
+ char *part, char *text);
typedef void (*Ewl_Engine_Cb_Theme_Object_Color_Class_Set)(char *name, int r,
- int g, int b, int r2,
- int g2, int b2, int r3,
- int g3, int b3);
+ int g, int b, int r2,
+ int g2, int b2, int r3,
+ int g3, int b3);
typedef void *(*Ewl_Engine_Cb_Theme_Clip_Add)(Ewl_Embed *embed);
typedef void (*Ewl_Engine_Cb_Theme_Clip_Del)(void *clip);
typedef void *(*Ewl_Engine_Cb_Theme_Clip_Clipees_Get)(void *clip);
typedef void (*Ewl_Engine_Cb_Theme_Clip_Color_Set)(void *clip, int r, int g,
- int b, int a);
+ int b, int a);
typedef int (*Ewl_Engine_Cb_Pointer_Data_New)(Ewl_Embed *embed,
- unsigned int *data,
- int w, int h);
+ unsigned int *data,
+ int w, int h);
typedef void (*Ewl_Engine_Cb_Pointer_Free)(Ewl_Embed *embed, int pointer);
typedef void (*Ewl_Engine_Cb_Pointer_Set)(Ewl_Embed *embed, int pointer);
typedef int (*Ewl_Engine_Cb_Pointer_Get)(Ewl_Embed *embed);
diff --git a/src/lib/ewl_entry.c b/src/lib/ewl_entry.c
index 6eb2122..95b905e 100644
--- a/src/lib/ewl_entry.c
+++ b/src/lib/ewl_entry.c
@@ -11,7 +11,7 @@
#include "ewl_debug.h"
static Ewl_Widget *ewl_entry_view_cb_widget_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
static Ewl_Widget *ewl_entry_view_cb_header_fetch(void *data, unsigned int col);
#ifdef _WIN32
@@ -99,12 +99,12 @@ ewl_entry_new(void)
w = NEW(Ewl_Entry, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_entry_init(EWL_ENTRY(w)))
{
- ewl_widget_destroy(w);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(w);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -148,14 +148,14 @@ ewl_entry_init(Ewl_Entry *e)
w = EWL_WIDGET(e);
if (!ewl_text_init(EWL_TEXT(e)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_ENTRY_TYPE);
ewl_widget_appearance_set(w, EWL_ENTRY_TYPE);
ewl_widget_focusable_set(EWL_WIDGET(e), TRUE);
ewl_object_fill_policy_set(EWL_OBJECT(e), EWL_FLAG_FILL_HSHRINK |
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
ewl_container_callback_intercept(EWL_CONTAINER(w), EWL_CALLBACK_FOCUS_IN);
ewl_container_callback_intercept(EWL_CONTAINER(w), EWL_CALLBACK_FOCUS_OUT);
@@ -180,23 +180,23 @@ ewl_entry_init(Ewl_Entry *e)
/* setup callbacks */
ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
- ewl_entry_cb_focus_in, NULL);
+ ewl_entry_cb_focus_in, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT,
- ewl_entry_cb_focus_out, NULL);
+ ewl_entry_cb_focus_out, NULL);
ewl_callback_prepend(w, EWL_CALLBACK_CONFIGURE,
- ewl_entry_cb_configure, NULL);
+ ewl_entry_cb_configure, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_entry_cb_mouse_down, NULL);
+ ewl_entry_cb_mouse_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP,
- ewl_entry_cb_mouse_up, NULL);
+ ewl_entry_cb_mouse_up, NULL);
ewl_callback_append(w, EWL_CALLBACK_WIDGET_DISABLE,
- ewl_entry_cb_disable, NULL);
+ ewl_entry_cb_disable, NULL);
ewl_callback_append(w, EWL_CALLBACK_WIDGET_ENABLE,
- ewl_entry_cb_enable, NULL);
+ ewl_entry_cb_enable, NULL);
ewl_callback_append(w, EWL_CALLBACK_DND_POSITION,
- ewl_entry_cb_dnd_position, NULL);
+ ewl_entry_cb_dnd_position, NULL);
ewl_callback_append(w, EWL_CALLBACK_DND_DATA_RECEIVED,
- ewl_entry_cb_dnd_data, NULL);
+ ewl_entry_cb_dnd_data, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -248,31 +248,31 @@ ewl_entry_editable_set(Ewl_Entry *e, unsigned int editable)
DCHECK_TYPE(e, EWL_ENTRY_TYPE);
if (e->editable == !!editable)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
e->editable = !!editable;
if (e->editable)
{
- ewl_callback_append(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN,
- ewl_entry_cb_key_down, NULL);
+ ewl_callback_append(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN,
+ ewl_entry_cb_key_down, NULL);
- if (ewl_object_state_has(EWL_OBJECT(e), EWL_FLAG_STATE_FOCUSED))
- ewl_widget_show(e->cursor);
+ if (ewl_object_state_has(EWL_OBJECT(e), EWL_FLAG_STATE_FOCUSED))
+ ewl_widget_show(e->cursor);
- ewl_widget_state_set(EWL_WIDGET(e), "enabled",
- EWL_STATE_PERSISTENT);
+ ewl_widget_state_set(EWL_WIDGET(e), "enabled",
+ EWL_STATE_PERSISTENT);
}
else
{
- ewl_callback_del(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN,
- ewl_entry_cb_key_down);
+ ewl_callback_del(EWL_WIDGET(e), EWL_CALLBACK_KEY_DOWN,
+ ewl_entry_cb_key_down);
- if (ewl_object_state_has(EWL_OBJECT(e), EWL_FLAG_STATE_FOCUSED))
- ewl_widget_hide(e->cursor);
+ if (ewl_object_state_has(EWL_OBJECT(e), EWL_FLAG_STATE_FOCUSED))
+ ewl_widget_hide(e->cursor);
- ewl_widget_state_set(EWL_WIDGET(e), "disabled",
- EWL_STATE_PERSISTENT);
+ ewl_widget_state_set(EWL_WIDGET(e), "disabled",
+ EWL_STATE_PERSISTENT);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -310,17 +310,17 @@ ewl_entry_selection_clear(Ewl_Entry *e)
sel = EWL_TEXT_TRIGGER(ewl_text_selection_get(EWL_TEXT(e)));
if (sel)
{
- unsigned int len, pos;
+ unsigned int len, pos;
- len = ewl_text_trigger_length_get(sel);
- pos = ewl_text_trigger_start_pos_get(sel);
- ewl_text_cursor_position_set(EWL_TEXT(e), pos);
- ewl_text_text_delete(EWL_TEXT(e), len);
+ len = ewl_text_trigger_length_get(sel);
+ pos = ewl_text_trigger_start_pos_get(sel);
+ ewl_text_cursor_position_set(EWL_TEXT(e), pos);
+ ewl_text_text_delete(EWL_TEXT(e), len);
- /* remove the selection */
- ewl_text_trigger_length_set(sel, 0);
+ /* remove the selection */
+ ewl_text_trigger_length_set(sel, 0);
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
@@ -340,7 +340,7 @@ ewl_entry_selection_clear(Ewl_Entry *e)
*/
void
ewl_entry_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Entry *e;
unsigned int c_pos;
@@ -353,7 +353,7 @@ ewl_entry_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
e = EWL_ENTRY(w);
if (!e->editable)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
c_pos = ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor));
ewl_text_index_geometry_map(EWL_TEXT(e), c_pos, &cx, &cy, &cw, &ch);
@@ -365,9 +365,9 @@ ewl_entry_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
oy = (cy + ch) - (CURRENT_Y(e) + CURRENT_H(e));
if (ox < 0)
- ox = 0;
+ ox = 0;
if (oy < 0)
- oy = 0;
+ oy = 0;
ewl_text_offsets_set(EWL_TEXT(e), -ox, -oy);
@@ -386,7 +386,7 @@ ewl_entry_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_entry_cb_focus_in(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Entry *entry;
@@ -396,7 +396,7 @@ ewl_entry_cb_focus_in(Ewl_Widget *w, void *ev __UNUSED__,
entry = EWL_ENTRY(w);
if (entry->editable && !VISIBLE(entry->cursor))
- ewl_widget_show(entry->cursor);
+ ewl_widget_show(entry->cursor);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -411,7 +411,7 @@ ewl_entry_cb_focus_in(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_entry_cb_focus_out(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Entry *entry;
@@ -421,7 +421,7 @@ ewl_entry_cb_focus_out(Ewl_Widget *w, void *ev __UNUSED__,
entry = EWL_ENTRY(w);
if (entry->editable && VISIBLE(entry->cursor))
- ewl_widget_hide(entry->cursor);
+ ewl_widget_hide(entry->cursor);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -449,57 +449,57 @@ ewl_entry_cb_key_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
/* reset the cursor blink */
ewl_widget_state_set(EWL_WIDGET(e->cursor), "noblink",
- EWL_STATE_PERSISTENT);
+ EWL_STATE_PERSISTENT);
if (!event->keyname)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!strcmp(event->keyname, "Left"))
- ewl_entry_cursor_move_left(e);
+ ewl_entry_cursor_move_left(e);
else if (!strcmp(event->keyname, "Right"))
- ewl_entry_cursor_move_right(e);
+ ewl_entry_cursor_move_right(e);
else if (!strcmp(event->keyname, "Up"))
- ewl_entry_cursor_move_up(e);
+ ewl_entry_cursor_move_up(e);
else if (!strcmp(event->keyname, "Down"))
- ewl_entry_cursor_move_down(e);
+ ewl_entry_cursor_move_down(e);
else if (!strcmp(event->keyname, "BackSpace"))
{
- if (!ewl_entry_selection_clear(e))
- ewl_entry_delete_left(e);
+ if (!ewl_entry_selection_clear(e))
+ ewl_entry_delete_left(e);
}
else if (!strcmp(event->keyname, "Delete"))
{
- if (!ewl_entry_selection_clear(e))
- ewl_entry_delete_right(e);
+ if (!ewl_entry_selection_clear(e))
+ ewl_entry_delete_right(e);
}
else if ((!strcmp(event->keyname, "Return"))
- || (!strcmp(event->keyname, "KP_Return"))
- || (!strcmp(event->keyname, "Enter"))
- || (!strcmp(event->keyname, "KP_Enter"))
- || (!strcmp(event->keyname, "\n")))
+ || (!strcmp(event->keyname, "KP_Return"))
+ || (!strcmp(event->keyname, "Enter"))
+ || (!strcmp(event->keyname, "KP_Enter"))
+ || (!strcmp(event->keyname, "\n")))
{
- if (!e->multiline)
- ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED);
- else
- {
- ewl_entry_selection_clear(e);
-
- ewl_text_text_insert(EWL_TEXT(e), "\n",
- ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor)));
- }
+ if (!e->multiline)
+ ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED);
+ else
+ {
+ ewl_entry_selection_clear(e);
+
+ ewl_text_text_insert(EWL_TEXT(e), "\n",
+ ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor)));
+ }
}
else if (!(event->modifiers & EWL_KEY_MODIFIER_CTRL))
{
- ewl_entry_selection_clear(e);
+ ewl_entry_selection_clear(e);
- if ((strlen(event->keyname) == 1) || (*event->keyname < 0))
- ewl_text_text_insert(EWL_TEXT(e), event->keyname,
- ewl_entry_cursor_position_get(
- EWL_ENTRY_CURSOR(e->cursor)));
+ if ((strlen(event->keyname) == 1) || (*event->keyname < 0))
+ ewl_text_text_insert(EWL_TEXT(e), event->keyname,
+ ewl_entry_cursor_position_get(
+ EWL_ENTRY_CURSOR(e->cursor)));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -529,7 +529,7 @@ ewl_entry_cb_mouse_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
e->in_select_mode = TRUE;
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_entry_cb_mouse_move, NULL);
+ ewl_entry_cb_mouse_move, NULL);
idx = ewl_text_coord_index_map(EWL_TEXT(e), event->x, event->y);
ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor), idx);
@@ -548,7 +548,7 @@ ewl_entry_cb_mouse_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
*/
void
ewl_entry_cb_mouse_up(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Entry *e;
@@ -614,7 +614,7 @@ ewl_entry_cb_enable(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
*/
void
ewl_entry_cb_mouse_move(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -648,10 +648,10 @@ ewl_entry_cb_dnd_position(Ewl_Widget *w, void *ev, void *data __UNUSED__)
txt = EWL_TEXT(w);
if (EWL_ENTRY(w)->editable && !DISABLED(w)) {
- ewl_widget_focus_send(w);
- ewl_text_cursor_position_set(txt,
- ewl_text_coord_index_map(txt, event->x,
- event->y));
+ ewl_widget_focus_send(w);
+ ewl_text_cursor_position_set(txt,
+ ewl_text_coord_index_map(txt, event->x,
+ event->y));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -680,26 +680,26 @@ ewl_entry_cb_dnd_data(Ewl_Widget *w, void *ev, void *data __UNUSED__)
txt = EWL_TEXT(w);
if (EWL_ENTRY(w)->editable && !DISABLED(w)) {
- if (!strcmp(event->type, "text/plain")
- && strcmp(nl_langinfo(CODESET), "UTF-8")) {
- char *text;
-
- text = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8",
- event->data);
- if (text) {
- ewl_text_text_insert(txt, text,
- ewl_text_cursor_position_get(txt));
- }
- else {
- ewl_text_text_insert(txt, event->data,
- ewl_text_cursor_position_get(txt));
- }
-
- IF_FREE(text);
- }
- else
- ewl_text_text_insert(txt, event->data,
- ewl_text_cursor_position_get(txt));
+ if (!strcmp(event->type, "text/plain")
+ && strcmp(nl_langinfo(CODESET), "UTF-8")) {
+ char *text;
+
+ text = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8",
+ event->data);
+ if (text) {
+ ewl_text_text_insert(txt, text,
+ ewl_text_cursor_position_get(txt));
+ }
+ else {
+ ewl_text_text_insert(txt, event->data,
+ ewl_text_cursor_position_get(txt));
+ }
+
+ IF_FREE(text);
+ }
+ else
+ ewl_text_text_insert(txt, event->data,
+ ewl_text_cursor_position_get(txt));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -723,7 +723,7 @@ ewl_entry_cursor_move_left(Ewl_Entry *e)
/* we're already at the start */
if (pos == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor), pos - 1);
ewl_widget_configure(EWL_WIDGET(e));
@@ -749,7 +749,7 @@ ewl_entry_cursor_move_right(Ewl_Entry *e)
/* if we are already at the end, stop */
if (pos == ewl_text_length_get(EWL_TEXT(e)))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor), pos + 1);
ewl_widget_configure(EWL_WIDGET(e));
@@ -814,13 +814,13 @@ ewl_entry_delete_left(Ewl_Entry *e)
DCHECK_TYPE(e, EWL_ENTRY_TYPE);
if (!EWL_TEXT(e)->text)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
pos = ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor));
/* we cannot delete anything if we are at the beginning of the text */
if (pos == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor), pos - 1);
ewl_text_text_delete(EWL_TEXT(e), 1);
@@ -841,7 +841,7 @@ ewl_entry_delete_right(Ewl_Entry *e)
DCHECK_TYPE(e, EWL_ENTRY_TYPE);
if (!EWL_TEXT(e)->text)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_text_text_delete(EWL_TEXT(e), 1);
@@ -866,12 +866,12 @@ ewl_entry_cursor_new(Ewl_Entry *parent)
w = NEW(Ewl_Entry_Cursor, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_entry_cursor_init(EWL_ENTRY_CURSOR(w), parent))
{
- ewl_widget_destroy(w);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(w);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -892,7 +892,7 @@ ewl_entry_cursor_init(Ewl_Entry_Cursor *c, Ewl_Entry *parent)
DCHECK_TYPE_RET(parent, EWL_ENTRY_TYPE, FALSE);
if (!ewl_widget_init(EWL_WIDGET(c)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(c), EWL_ENTRY_CURSOR_TYPE);
ewl_widget_inherit(EWL_WIDGET(c), EWL_ENTRY_CURSOR_TYPE);
@@ -934,7 +934,7 @@ ewl_entry_cursor_position_get(Ewl_Entry_Cursor *c)
DCHECK_TYPE_RET(c, EWL_ENTRY_CURSOR_TYPE, 0);
DRETURN_INT(ewl_text_cursor_position_get(EWL_TEXT(c->parent)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -957,7 +957,7 @@ ewl_entry_view_get(void)
static Ewl_Widget *
ewl_entry_view_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Widget *entry;
diff --git a/src/lib/ewl_entry.h b/src/lib/ewl_entry.h
index b28f97a..086be48 100644
--- a/src/lib/ewl_entry.h
+++ b/src/lib/ewl_entry.h
@@ -57,22 +57,22 @@ typedef struct Ewl_Entry Ewl_Entry;
*/
struct Ewl_Entry
{
- Ewl_Text text; /**< The Ewl_Text parent */
- Ewl_Widget *cursor; /**< The cursor */
+ Ewl_Text text; /**< The Ewl_Text parent */
+ Ewl_Widget *cursor; /**< The cursor */
- unsigned int multiline:1; /**< Is the entry multi-line */
- unsigned int editable:1; /**< Is the entry editable */
- unsigned int in_select_mode:1; /**< Are we in select mode */
+ unsigned int multiline:1; /**< Is the entry multi-line */
+ unsigned int editable:1; /**< Is the entry editable */
+ unsigned int in_select_mode:1; /**< Are we in select mode */
};
Ewl_Widget *ewl_entry_new(void);
Ewl_Widget *ewl_password_new(void);
-int ewl_entry_init(Ewl_Entry *e);
+int ewl_entry_init(Ewl_Entry *e);
-void ewl_entry_multiline_set(Ewl_Entry *e, unsigned int multiline);
+void ewl_entry_multiline_set(Ewl_Entry *e, unsigned int multiline);
unsigned int ewl_entry_multiline_get(Ewl_Entry *e);
-void ewl_entry_editable_set(Ewl_Entry *e, unsigned int editable);
+void ewl_entry_editable_set(Ewl_Entry *e, unsigned int editable);
unsigned int ewl_entry_editable_get(Ewl_Entry *e);
unsigned int ewl_entry_selection_clear(Ewl_Entry *e);
@@ -120,13 +120,13 @@ typedef struct Ewl_Entry_Cursor Ewl_Entry_Cursor;
*/
struct Ewl_Entry_Cursor
{
- Ewl_Widget widget; /**< Inherit from Ewl_Widget */
- Ewl_Entry *parent; /**< The parent Ewl_Text */
+ Ewl_Widget widget; /**< Inherit from Ewl_Widget */
+ Ewl_Entry *parent; /**< The parent Ewl_Text */
};
Ewl_Widget *ewl_entry_cursor_new(Ewl_Entry *parent);
-int ewl_entry_cursor_init(Ewl_Entry_Cursor *c, Ewl_Entry *parent);
-void ewl_entry_cursor_position_set(Ewl_Entry_Cursor *c, unsigned int pos);
+int ewl_entry_cursor_init(Ewl_Entry_Cursor *c, Ewl_Entry *parent);
+void ewl_entry_cursor_position_set(Ewl_Entry_Cursor *c, unsigned int pos);
unsigned int ewl_entry_cursor_position_get(Ewl_Entry_Cursor *c);
/**
diff --git a/src/lib/ewl_enums.h b/src/lib/ewl_enums.h
index 6a77327..794817a 100644
--- a/src/lib/ewl_enums.h
+++ b/src/lib/ewl_enums.h
@@ -56,10 +56,10 @@ typedef enum Ewl_Callback_Type Ewl_Callback_Type;
*/
enum Ewl_Event_Notify
{
- EWL_CALLBACK_NOTIFY_NONE = 0, /**< No notification or interception */
- EWL_CALLBACK_NOTIFY_NOTIFY = 1, /**< Notify of call */
- EWL_CALLBACK_NOTIFY_INTERCEPT = 2, /**< Intercept call */
- EWL_CALLBACK_TYPE_DIRECT = 4 /**< Direct call */
+ EWL_CALLBACK_NOTIFY_NONE = 0, /**< No notification or interception */
+ EWL_CALLBACK_NOTIFY_NOTIFY = 1, /**< Notify of call */
+ EWL_CALLBACK_NOTIFY_INTERCEPT = 2, /**< Intercept call */
+ EWL_CALLBACK_TYPE_DIRECT = 4 /**< Direct call */
};
/**
@@ -74,8 +74,8 @@ typedef enum Ewl_Event_Notify Ewl_Event_Notify;
*/
enum Ewl_Orientation
{
- EWL_ORIENTATION_HORIZONTAL, /**< Horizontal layout */
- EWL_ORIENTATION_VERTICAL /**< Vertical layout */
+ EWL_ORIENTATION_HORIZONTAL, /**< Horizontal layout */
+ EWL_ORIENTATION_VERTICAL /**< Vertical layout */
};
/**
@@ -117,45 +117,45 @@ enum Ewl_Flags
/*
* Flags identifying the visibility status of the widget
*/
- EWL_FLAG_VISIBLE_HIDDEN = 0, /**< Widget hidden */
- EWL_FLAG_VISIBLE_SHOWN = 0x100, /**< Widget shown */
- EWL_FLAG_VISIBLE_REALIZED = 0x200, /**< Widget realized */
- EWL_FLAG_VISIBLE_REVEALED = 0x400, /**< Widget revealed */
- EWL_FLAG_VISIBLE_NOCLIP = 0x800, /**< Widget has no clip */
+ EWL_FLAG_VISIBLE_HIDDEN = 0, /**< Widget hidden */
+ EWL_FLAG_VISIBLE_SHOWN = 0x100, /**< Widget shown */
+ EWL_FLAG_VISIBLE_REALIZED = 0x200, /**< Widget realized */
+ EWL_FLAG_VISIBLE_REVEALED = 0x400, /**< Widget revealed */
+ EWL_FLAG_VISIBLE_NOCLIP = 0x800, /**< Widget has no clip */
/*
* Behavior modifying properties.
*/
- EWL_FLAG_PROPERTY_RECURSIVE = 0x1000, /**< Widget is recursive */
- EWL_FLAG_PROPERTY_TOPLEVEL = 0x2000, /**< Widget is a top level widget */
- EWL_FLAG_PROPERTY_INTERNAL = 0x4000, /**< Widget is internal */
- EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS = 0x8000, /**< Widget will block tab focus changes */
- EWL_FLAG_PROPERTY_FOCUSABLE = 0x10000, /**< Widget is focusable */
- EWL_FLAG_PROPERTY_IN_TAB_LIST = 0x20000, /**< Widget is in the tab order */
- EWL_FLAG_PROPERTY_DND_TARGET = 0x40000, /**< Widget is DND aware */
- EWL_FLAG_PROPERTY_DND_SOURCE = 0x80000, /**< Widget is dragable */
+ EWL_FLAG_PROPERTY_RECURSIVE = 0x1000, /**< Widget is recursive */
+ EWL_FLAG_PROPERTY_TOPLEVEL = 0x2000, /**< Widget is a top level widget */
+ EWL_FLAG_PROPERTY_INTERNAL = 0x4000, /**< Widget is internal */
+ EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS = 0x8000, /**< Widget will block tab focus changes */
+ EWL_FLAG_PROPERTY_FOCUSABLE = 0x10000, /**< Widget is focusable */
+ EWL_FLAG_PROPERTY_IN_TAB_LIST = 0x20000, /**< Widget is in the tab order */
+ EWL_FLAG_PROPERTY_DND_TARGET = 0x40000, /**< Widget is DND aware */
+ EWL_FLAG_PROPERTY_DND_SOURCE = 0x80000, /**< Widget is dragable */
/*
* Flags to indicate queues this object is on.
*/
- EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE = 0x100000, /**< Configure scheduled */
- EWL_FLAG_QUEUED_SCHEDULED_REVEAL = 0x200000, /**< Reveal scheduled */
- EWL_FLAG_QUEUED_SCHEDULED_DESTROY = 0x400000, /**< Delete scheduled */
+ EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE = 0x100000, /**< Configure scheduled */
+ EWL_FLAG_QUEUED_SCHEDULED_REVEAL = 0x200000, /**< Reveal scheduled */
+ EWL_FLAG_QUEUED_SCHEDULED_DESTROY = 0x400000, /**< Delete scheduled */
- EWL_FLAG_QUEUED_PROCESS_CONFIGURE = 0x800000, /**< Configure in progress */
- EWL_FLAG_QUEUED_PROCESS_REVEAL = 0x1000000, /**< Reveal in progress */
- EWL_FLAG_QUEUED_PROCESS_DESTROY = 0x2000000, /**< Delete in progress */
+ EWL_FLAG_QUEUED_PROCESS_CONFIGURE = 0x800000, /**< Configure in progress */
+ EWL_FLAG_QUEUED_PROCESS_REVEAL = 0x1000000, /**< Reveal in progress */
+ EWL_FLAG_QUEUED_PROCESS_DESTROY = 0x2000000, /**< Delete in progress */
/*
* The state enum specifies the current state of a widget, ie. has it
* been clicked, does it have the keyboard focus, etc.
*/
- EWL_FLAG_STATE_NORMAL = 0, /**< Widget state normal */
- EWL_FLAG_STATE_MOUSE_IN = 0x4000000, /**< Mouse is in the widget */
- EWL_FLAG_STATE_PRESSED = 0x8000000, /**< Widget is pressed */
- EWL_FLAG_STATE_FOCUSED = 0x10000000, /**< Widget has focus */
- EWL_FLAG_STATE_DISABLED = 0x20000000, /**< Widget is disabled */
- EWL_FLAG_STATE_DND = 0x40000000, /**< Widget is engaged in DND */
+ EWL_FLAG_STATE_NORMAL = 0, /**< Widget state normal */
+ EWL_FLAG_STATE_MOUSE_IN = 0x4000000, /**< Mouse is in the widget */
+ EWL_FLAG_STATE_PRESSED = 0x8000000, /**< Widget is pressed */
+ EWL_FLAG_STATE_FOCUSED = 0x10000000, /**< Widget has focus */
+ EWL_FLAG_STATE_DISABLED = 0x20000000, /**< Widget is disabled */
+ EWL_FLAG_STATE_DND = 0x40000000, /**< Widget is engaged in DND */
};
/**
@@ -169,51 +169,51 @@ enum Ewl_Flags
* The alignment mask
*/
#define EWL_FLAGS_ALIGN_MASK (EWL_FLAG_ALIGN_CENTER | EWL_FLAG_ALIGN_LEFT | \
- EWL_FLAG_ALIGN_RIGHT | EWL_FLAG_ALIGN_TOP | \
- EWL_FLAG_ALIGN_BOTTOM)
+ EWL_FLAG_ALIGN_RIGHT | EWL_FLAG_ALIGN_TOP | \
+ EWL_FLAG_ALIGN_BOTTOM)
/**
* @def EWL_FLAGS_FILL_MASK
* The fill mask
*/
#define EWL_FLAGS_FILL_MASK (EWL_FLAG_FILL_NONE | EWL_FLAG_FILL_SHRINK | \
- EWL_FLAG_FILL_FILL)
+ EWL_FLAG_FILL_FILL)
/**
* @def EWL_FLAGS_VISIBLE_MASK
* The visibility mask
*/
#define EWL_FLAGS_VISIBLE_MASK (EWL_FLAG_VISIBLE_HIDDEN | \
- EWL_FLAG_VISIBLE_SHOWN | EWL_FLAG_VISIBLE_REALIZED | \
- EWL_FLAG_VISIBLE_REVEALED | EWL_FLAG_VISIBLE_NOCLIP)
+ EWL_FLAG_VISIBLE_SHOWN | EWL_FLAG_VISIBLE_REALIZED | \
+ EWL_FLAG_VISIBLE_REVEALED | EWL_FLAG_VISIBLE_NOCLIP)
/**
* @def EWL_FLAGS_PROPERTY_MASK
* The property mask
*/
#define EWL_FLAGS_PROPERTY_MASK (EWL_FLAG_PROPERTY_RECURSIVE | \
- EWL_FLAG_PROPERTY_TOPLEVEL | EWL_FLAG_PROPERTY_INTERNAL | \
- EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS | EWL_FLAG_PROPERTY_FOCUSABLE | \
- EWL_FLAG_PROPERTY_DND_TARGET | EWL_FLAG_PROPERTY_DND_SOURCE | \
- EWL_FLAG_PROPERTY_IN_TAB_LIST)
+ EWL_FLAG_PROPERTY_TOPLEVEL | EWL_FLAG_PROPERTY_INTERNAL | \
+ EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS | EWL_FLAG_PROPERTY_FOCUSABLE | \
+ EWL_FLAG_PROPERTY_DND_TARGET | EWL_FLAG_PROPERTY_DND_SOURCE | \
+ EWL_FLAG_PROPERTY_IN_TAB_LIST)
/**
* @def EWL_FLAGS_QUEUED_MASK
* The queue mask
*/
#define EWL_FLAGS_QUEUED_MASK (EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE | \
- EWL_FLAG_QUEUED_SCHEDULED_REVEAL | EWL_FLAG_QUEUED_SCHEDULED_DESTROY | \
- EWL_FLAG_QUEUED_PROCESS_CONFIGURE | EWL_FLAG_QUEUED_PROCESS_REVEAL | \
- EWL_FLAG_QUEUED_PROCESS_DESTROY)
+ EWL_FLAG_QUEUED_SCHEDULED_REVEAL | EWL_FLAG_QUEUED_SCHEDULED_DESTROY | \
+ EWL_FLAG_QUEUED_PROCESS_CONFIGURE | EWL_FLAG_QUEUED_PROCESS_REVEAL | \
+ EWL_FLAG_QUEUED_PROCESS_DESTROY)
/**
* @def EWL_FLAGS_STATE_MASK
* The state mask
*/
#define EWL_FLAGS_STATE_MASK (EWL_FLAG_STATE_NORMAL | \
- EWL_FLAG_STATE_MOUSE_IN | EWL_FLAG_STATE_PRESSED | \
- EWL_FLAG_STATE_FOCUSED | EWL_FLAG_STATE_DND | \
- EWL_FLAG_STATE_DISABLED)
+ EWL_FLAG_STATE_MOUSE_IN | EWL_FLAG_STATE_PRESSED | \
+ EWL_FLAG_STATE_FOCUSED | EWL_FLAG_STATE_DND | \
+ EWL_FLAG_STATE_DISABLED)
/**
* @enum Ewl_Position
@@ -221,10 +221,10 @@ enum Ewl_Flags
*/
enum Ewl_Position
{
- EWL_POSITION_LEFT = 0x1, /**< Left position */
- EWL_POSITION_RIGHT = 0x2, /**< Right position */
- EWL_POSITION_TOP = 0x4, /**< Top position */
- EWL_POSITION_BOTTOM = 0x8 /**< Bottom position */
+ EWL_POSITION_LEFT = 0x1, /**< Left position */
+ EWL_POSITION_RIGHT = 0x2, /**< Right position */
+ EWL_POSITION_TOP = 0x4, /**< Top position */
+ EWL_POSITION_BOTTOM = 0x8 /**< Bottom position */
};
/**
@@ -244,22 +244,22 @@ typedef enum Ewl_Position Ewl_Position;
*/
enum Ewl_Window_Flags
{
- EWL_WINDOW_BORDERLESS = 0x1, /**< Window is borderless */
- EWL_WINDOW_USER_CONFIGURE = 0x2, /**< User configure */
- EWL_WINDOW_GRAB_POINTER = 0x4, /**< Window grabs pointer */
- EWL_WINDOW_GRAB_KEYBOARD = 0x8, /**< Window grabs keyboard */
- EWL_WINDOW_OVERRIDE = 0x10, /**< Window override setting */
- EWL_WINDOW_FULLSCREEN = 0x20, /**< Window is fullscreen */
- EWL_WINDOW_DIALOG = 0x40, /**< Window has no max and min buttons */
- EWL_WINDOW_MODAL = 0x80, /**< Window is modal */
- EWL_WINDOW_TRANSIENT = 0x100, /**< Window is transient for */
- EWL_WINDOW_TRANSIENT_FOREIGN = 0x200, /**< Window is transient for */
- EWL_WINDOW_LEADER = 0x400, /**< Window HAS a leader */
- EWL_WINDOW_LEADER_FOREIGN = 0x800, /**< Window HAS a leader */
- EWL_WINDOW_SKIP_TASKBAR = 0x1000, /**< Window skips taskbar */
- EWL_WINDOW_SKIP_PAGER = 0x2000, /**< Window skips pager */
- EWL_WINDOW_DEMANDS_ATTENTION = 0x4000, /**< Window requires attention */
- EWL_WINDOW_URGENT = 0x8000 /**< Window is urgent */
+ EWL_WINDOW_BORDERLESS = 0x1, /**< Window is borderless */
+ EWL_WINDOW_USER_CONFIGURE = 0x2, /**< User configure */
+ EWL_WINDOW_GRAB_POINTER = 0x4, /**< Window grabs pointer */
+ EWL_WINDOW_GRAB_KEYBOARD = 0x8, /**< Window grabs keyboard */
+ EWL_WINDOW_OVERRIDE = 0x10, /**< Window override setting */
+ EWL_WINDOW_FULLSCREEN = 0x20, /**< Window is fullscreen */
+ EWL_WINDOW_DIALOG = 0x40, /**< Window has no max and min buttons */
+ EWL_WINDOW_MODAL = 0x80, /**< Window is modal */
+ EWL_WINDOW_TRANSIENT = 0x100, /**< Window is transient for */
+ EWL_WINDOW_TRANSIENT_FOREIGN = 0x200, /**< Window is transient for */
+ EWL_WINDOW_LEADER = 0x400, /**< Window HAS a leader */
+ EWL_WINDOW_LEADER_FOREIGN = 0x800, /**< Window HAS a leader */
+ EWL_WINDOW_SKIP_TASKBAR = 0x1000, /**< Window skips taskbar */
+ EWL_WINDOW_SKIP_PAGER = 0x2000, /**< Window skips pager */
+ EWL_WINDOW_DEMANDS_ATTENTION = 0x4000, /**< Window requires attention */
+ EWL_WINDOW_URGENT = 0x8000 /**< Window is urgent */
};
/**
@@ -273,10 +273,10 @@ typedef enum Ewl_Window_Flags Ewl_Window_Flags;
*/
enum Ewl_Popup_Type
{
- EWL_POPUP_TYPE_NONE, /**< No popup type */
- EWL_POPUP_TYPE_MOUSE, /**< Popup off the mouse */
- EWL_POPUP_TYPE_MENU_HORIZONTAL, /**< Popup with horizontal data */
- EWL_POPUP_TYPE_MENU_VERTICAL /**< Popup with vertical data */
+ EWL_POPUP_TYPE_NONE, /**< No popup type */
+ EWL_POPUP_TYPE_MOUSE, /**< Popup off the mouse */
+ EWL_POPUP_TYPE_MENU_HORIZONTAL, /**< Popup with horizontal data */
+ EWL_POPUP_TYPE_MENU_VERTICAL /**< Popup with vertical data */
};
/**
@@ -290,9 +290,9 @@ typedef enum Ewl_Popup_Type Ewl_Popup_Type;
*/
enum Ewl_Tree_Node_Flags
{
- EWL_TREE_NODE_NOEXPAND = 0, /**< Node does not expand */
- EWL_TREE_NODE_COLLAPSED = 1, /**< Node is collapsed */
- EWL_TREE_NODE_EXPANDED = 2, /**< Node is expanded */
+ EWL_TREE_NODE_NOEXPAND = 0, /**< Node does not expand */
+ EWL_TREE_NODE_COLLAPSED = 1, /**< Node is collapsed */
+ EWL_TREE_NODE_EXPANDED = 2, /**< Node is expanded */
};
/**
@@ -306,7 +306,7 @@ typedef enum Ewl_Tree_Node_Flags Ewl_Tree_Node_Flags;
*/
enum Ewl_Notebook_Flags
{
- EWL_NOTEBOOK_FLAG_TABS_HIDDEN = 0x10 /**< Tabbar is hidden */
+ EWL_NOTEBOOK_FLAG_TABS_HIDDEN = 0x10 /**< Tabbar is hidden */
};
/**
@@ -320,9 +320,9 @@ typedef enum Ewl_Notebook_Flags Ewl_Notebook_Flags;
*/
enum Ewl_Scrollpane_Flags
{
- EWL_SCROLLPANE_FLAG_NONE, /**< No flags set */
- EWL_SCROLLPANE_FLAG_AUTO_VISIBLE, /**< Hide if possible */
- EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN /**< Always hide */
+ EWL_SCROLLPANE_FLAG_NONE, /**< No flags set */
+ EWL_SCROLLPANE_FLAG_AUTO_VISIBLE, /**< Hide if possible */
+ EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN /**< Always hide */
};
/**
@@ -336,11 +336,11 @@ typedef enum Ewl_Scrollpane_Flags Ewl_Scrollpane_Flags;
*/
enum Ewl_Key_Modifiers
{
- EWL_KEY_MODIFIER_SHIFT = 0x1, /**< Shift key */
- EWL_KEY_MODIFIER_CTRL = 0x2, /**< Ctrl key */
- EWL_KEY_MODIFIER_ALT = 0x4, /**< Alt key */
- EWL_KEY_MODIFIER_MOD = 0x8, /**< Mod key */
- EWL_KEY_MODIFIER_WIN = 0x10, /**< Win key */
+ EWL_KEY_MODIFIER_SHIFT = 0x1, /**< Shift key */
+ EWL_KEY_MODIFIER_CTRL = 0x2, /**< Ctrl key */
+ EWL_KEY_MODIFIER_ALT = 0x4, /**< Alt key */
+ EWL_KEY_MODIFIER_MOD = 0x8, /**< Mod key */
+ EWL_KEY_MODIFIER_WIN = 0x10, /**< Win key */
};
/**
@@ -614,10 +614,10 @@ typedef enum Ewl_Filelist_Event_Type Ewl_Filelist_Event_Type;
*/
enum Ewl_Grid_Resize_Type
{
- EWL_GRID_RESIZE_NORMAL, /**< use the standard resize methode */
- EWL_GRID_RESIZE_FIXED, /**< use the user set size */
- EWL_GRID_RESIZE_RELATIVE, /**< use the user set relative size */
- EWL_GRID_RESIZE_NONE /**< use the preferred size of the row */
+ EWL_GRID_RESIZE_NORMAL, /**< use the standard resize methode */
+ EWL_GRID_RESIZE_FIXED, /**< use the user set size */
+ EWL_GRID_RESIZE_RELATIVE, /**< use the user set relative size */
+ EWL_GRID_RESIZE_NONE /**< use the preferred size of the row */
};
/**
@@ -754,11 +754,11 @@ typedef enum Ewl_Text_Wrap Ewl_Text_Wrap;
*/
enum Ewl_Rotate
{
- EWL_ROTATE_CW_90, /**< 90 degree clockwise rotation */
- EWL_ROTATE_180, /**< 180 degree rotation */
- EWL_ROTATE_CW_270, /**< 270 degree clockwise rotation */
- EWL_ROTATE_CC_90, /**< 90 degree counter-clockwise rotation */
- EWL_ROTATE_CC_270 /**< 270 degree counter-clockwise rotation */
+ EWL_ROTATE_CW_90, /**< 90 degree clockwise rotation */
+ EWL_ROTATE_180, /**< 180 degree rotation */
+ EWL_ROTATE_CW_270, /**< 270 degree clockwise rotation */
+ EWL_ROTATE_CC_90, /**< 90 degree counter-clockwise rotation */
+ EWL_ROTATE_CC_270 /**< 270 degree counter-clockwise rotation */
};
/**
@@ -772,8 +772,8 @@ typedef enum Ewl_Rotate Ewl_Rotate;
*/
enum Ewl_Selection_Type
{
- EWL_SELECTION_TYPE_INDEX, /**< Single index */
- EWL_SELECTION_TYPE_RANGE /**< Range of indices */
+ EWL_SELECTION_TYPE_INDEX, /**< Single index */
+ EWL_SELECTION_TYPE_RANGE /**< Range of indices */
};
/**
@@ -787,9 +787,9 @@ typedef enum Ewl_Selection_Type Ewl_Selection_Type;
*/
enum Ewl_Selection_Mode
{
- EWL_SELECTION_MODE_NONE, /**< No selection allowed */
- EWL_SELECTION_MODE_SINGLE, /**< Single select only */
- EWL_SELECTION_MODE_MULTI /**< Multi select mode */
+ EWL_SELECTION_MODE_NONE, /**< No selection allowed */
+ EWL_SELECTION_MODE_SINGLE, /**< Single select only */
+ EWL_SELECTION_MODE_MULTI /**< Multi select mode */
};
/**
@@ -803,8 +803,8 @@ typedef enum Ewl_Selection_Mode Ewl_Selection_Mode;
*/
enum Ewl_Tree_Selection_Type
{
- EWL_TREE_SELECTION_TYPE_ROW, /**< Row selection */
- EWL_TREE_SELECTION_TYPE_CELL /**< Cell selection */
+ EWL_TREE_SELECTION_TYPE_ROW, /**< Row selection */
+ EWL_TREE_SELECTION_TYPE_CELL /**< Cell selection */
};
/**
diff --git a/src/lib/ewl_events.h b/src/lib/ewl_events.h
index bd90912..de2132a 100644
--- a/src/lib/ewl_events.h
+++ b/src/lib/ewl_events.h
@@ -48,8 +48,8 @@ typedef struct Ewl_Event_Key Ewl_Event_Key;
*/
struct Ewl_Event_Key
{
- unsigned int modifiers; /**< Key modifiers that were pressed */
- char *keyname; /**< Name of the key that was pressed */
+ unsigned int modifiers; /**< Key modifiers that were pressed */
+ char *keyname; /**< Name of the key that was pressed */
};
/**
@@ -68,7 +68,7 @@ typedef struct Ewl_Event_Key_Down Ewl_Event_Key_Down;
*/
struct Ewl_Event_Key_Down
{
- Ewl_Event_Key base; /**< Basic key information */
+ Ewl_Event_Key base; /**< Basic key information */
};
/**
@@ -87,7 +87,7 @@ typedef struct Ewl_Event_Key_Up Ewl_Event_Key_Up;
*/
struct Ewl_Event_Key_Up
{
- Ewl_Event_Key base; /**< Basic key information */
+ Ewl_Event_Key base; /**< Basic key information */
};
/**
@@ -107,8 +107,8 @@ typedef struct Ewl_Event_Mouse Ewl_Event_Mouse;
struct Ewl_Event_Mouse
{
unsigned int modifiers; /**< Modifiers that were pressed */
- int x; /**< X coordinate the mouse release occurred at */
- int y; /**< Y coordinate the mouse release occurred at */
+ int x; /**< X coordinate the mouse release occurred at */
+ int y; /**< Y coordinate the mouse release occurred at */
};
/**
@@ -127,9 +127,9 @@ typedef struct Ewl_Event_Mouse_Down Ewl_Event_Mouse_Down;
*/
struct Ewl_Event_Mouse_Down
{
- Ewl_Event_Mouse base; /**< Base mouse information */
- int button; /**< The mouse button that was released */
- int clicks; /**< Number of consecutive clicks */
+ Ewl_Event_Mouse base; /**< Base mouse information */
+ int button; /**< The mouse button that was released */
+ int clicks; /**< Number of consecutive clicks */
};
/**
@@ -148,8 +148,8 @@ typedef struct Ewl_Event_Mouse_Up Ewl_Event_Mouse_Up;
*/
struct Ewl_Event_Mouse_Up
{
- Ewl_Event_Mouse base; /**< Base mouse information */
- int button; /**< The mouse button that was released */
+ Ewl_Event_Mouse base; /**< Base mouse information */
+ int button; /**< The mouse button that was released */
};
/**
@@ -168,7 +168,7 @@ typedef struct Ewl_Event_Mouse_Move Ewl_Event_Mouse_Move;
*/
struct Ewl_Event_Mouse_Move
{
- Ewl_Event_Mouse base; /**< Base mouse information */
+ Ewl_Event_Mouse base; /**< Base mouse information */
};
/**
@@ -187,7 +187,7 @@ typedef struct Ewl_Event_Mouse_In Ewl_Event_Mouse_In;
*/
struct Ewl_Event_Mouse_In
{
- Ewl_Event_Mouse base; /**< Base mouse information */
+ Ewl_Event_Mouse base; /**< Base mouse information */
};
/**
@@ -225,9 +225,9 @@ typedef struct Ewl_Event_Mouse_Wheel Ewl_Event_Mouse_Wheel;
*/
struct Ewl_Event_Mouse_Wheel
{
- Ewl_Event_Mouse base; /**< Base mouse information */
- int z; /**< Z value of mouse wheel */
- int dir; /**< Direction mouse wheel scrolled */
+ Ewl_Event_Mouse base; /**< Base mouse information */
+ int z; /**< Z value of mouse wheel */
+ int dir; /**< Direction mouse wheel scrolled */
};
/**
@@ -246,8 +246,8 @@ typedef struct Ewl_Dnd_Types Ewl_Dnd_Types;
*/
struct Ewl_Dnd_Types
{
- int num_types; /**< The number of DND types */
- char** types; /**< The list of DND types */
+ int num_types; /**< The number of DND types */
+ char** types; /**< The list of DND types */
};
/**
@@ -288,7 +288,7 @@ struct Ewl_Event_Dnd_Drop
{
int x; /**< X coordinate the mouse moved to */
int y; /**< Y coordinate the mouse moved to */
- void* data; /**< Data from drop source */
+ void* data; /**< Data from drop source */
};
/**
@@ -373,7 +373,7 @@ struct Ewl_Event_State_Change
};
unsigned int ewl_ev_modifiers_get(void);
-void ewl_ev_modifiers_set(unsigned int modifiers);
+void ewl_ev_modifiers_set(unsigned int modifiers);
/**
* @}
diff --git a/src/lib/ewl_expansion.c b/src/lib/ewl_expansion.c
index 4fe8f38..5c8b08c 100644
--- a/src/lib/ewl_expansion.c
+++ b/src/lib/ewl_expansion.c
@@ -20,11 +20,11 @@ ewl_expansion_new(void)
b = NEW(Ewl_Expansion, 1);
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_expansion_init(EWL_EXPANSION(b))) {
- ewl_widget_destroy(EWL_WIDGET(b));
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(EWL_WIDGET(b));
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
@@ -48,7 +48,7 @@ ewl_expansion_init(Ewl_Expansion *cb)
w = EWL_WIDGET(cb);
if (!ewl_check_init(EWL_CHECK(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_EXPANSION_TYPE);
ewl_widget_inherit(w, EWL_EXPANSION_TYPE);
@@ -56,7 +56,7 @@ ewl_expansion_init(Ewl_Expansion *cb)
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_TOP);
ewl_callback_append(w, EWL_CALLBACK_REVEAL,
- ewl_expansion_cb_reveal, NULL);
+ ewl_expansion_cb_reveal, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -114,11 +114,11 @@ ewl_expansion_expandable_update(Ewl_Expansion *ex)
DCHECK_TYPE(ex, EWL_EXPANSION_TYPE);
if (ex->expandable)
- ewl_widget_state_set(EWL_WIDGET(ex), "expandable",
- EWL_STATE_TRANSIENT);
+ ewl_widget_state_set(EWL_WIDGET(ex), "expandable",
+ EWL_STATE_TRANSIENT);
else
- ewl_widget_state_set(EWL_WIDGET(ex), "nonexpandable",
- EWL_STATE_TRANSIENT);
+ ewl_widget_state_set(EWL_WIDGET(ex), "nonexpandable",
+ EWL_STATE_TRANSIENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -133,7 +133,7 @@ ewl_expansion_expandable_update(Ewl_Expansion *ex)
*/
void
ewl_expansion_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
diff --git a/src/lib/ewl_expansion.h b/src/lib/ewl_expansion.h
index a5d80f2..b9f4b38 100644
--- a/src/lib/ewl_expansion.h
+++ b/src/lib/ewl_expansion.h
@@ -51,11 +51,11 @@ struct Ewl_Expansion
};
Ewl_Widget *ewl_expansion_new(void);
-int ewl_expansion_init(Ewl_Expansion *c);
+int ewl_expansion_init(Ewl_Expansion *c);
-int ewl_expansion_is_expandable(Ewl_Expansion *c);
-void ewl_expansion_expandable_set(Ewl_Expansion *c,
- int expandable);
+int ewl_expansion_is_expandable(Ewl_Expansion *c);
+void ewl_expansion_expandable_set(Ewl_Expansion *c,
+ int expandable);
/*
* Internally used callbacks.
*/
diff --git a/src/lib/ewl_filedialog.c b/src/lib/ewl_filedialog.c
index cfa1311..e4453aa 100644
--- a/src/lib/ewl_filedialog.c
+++ b/src/lib/ewl_filedialog.c
@@ -10,7 +10,7 @@
static void ewl_filedialog_respond(Ewl_Filedialog *fd, unsigned int response);
static void ewl_filedialog_cb_value_changed(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filedialog_cb_column_view(Ewl_Widget *w, void *ev, void *data);
static void ewl_filedialog_cb_icon_view(Ewl_Widget *w, void *ev, void *data);
static void ewl_filedialog_cb_list_view(Ewl_Widget *w, void *ev, void *data);
@@ -32,7 +32,7 @@ ewl_filedialog_multiselect_new(void)
fd = ewl_filedialog_new();
if (!fd)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_filedialog_multiselect_set(EWL_FILEDIALOG(fd), TRUE);
@@ -52,12 +52,12 @@ ewl_filedialog_new(void)
fd = NEW(Ewl_Filedialog, 1);
if (!fd)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_filedialog_init(fd))
{
- ewl_widget_destroy(EWL_WIDGET(fd));
- fd = NULL;
+ ewl_widget_destroy(EWL_WIDGET(fd));
+ fd = NULL;
}
DRETURN_PTR(EWL_WIDGET(fd), DLEVEL_STABLE);
@@ -78,7 +78,7 @@ ewl_filedialog_init(Ewl_Filedialog *fd)
w = EWL_WIDGET(fd);
if (!ewl_dialog_init(EWL_DIALOG(fd)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_FILEDIALOG_TYPE);
@@ -87,7 +87,7 @@ ewl_filedialog_init(Ewl_Filedialog *fd)
ewl_window_class_set(EWL_WINDOW(fd), "Ewl Filedialog");
ewl_callback_append(EWL_WIDGET(fd), EWL_CALLBACK_DELETE_WINDOW,
- ewl_filedialog_cb_delete_window, NULL);
+ ewl_filedialog_cb_delete_window, NULL);
ewl_dialog_active_area_set(EWL_DIALOG(fd), EWL_POSITION_TOP);
@@ -96,7 +96,7 @@ ewl_filedialog_init(Ewl_Filedialog *fd)
ewl_widget_internal_set(fd->fp, TRUE);
ewl_container_child_append(EWL_CONTAINER(fd), fd->fp);
ewl_callback_append(fd->fp, EWL_CALLBACK_VALUE_CHANGED,
- ewl_filedialog_cb_value_changed, fd);
+ ewl_filedialog_cb_value_changed, fd);
ewl_widget_show(fd->fp);
/* we don't want an action area with this as the filepicker provides
@@ -116,42 +116,42 @@ ewl_filedialog_init(Ewl_Filedialog *fd)
ewl_button_label_set(EWL_BUTTON(o), "Icon view");
ewl_container_child_append(EWL_CONTAINER(menu), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filedialog_cb_icon_view, fd);
+ ewl_filedialog_cb_icon_view, fd);
ewl_widget_show(o);
o = ewl_menu_item_new();
ewl_button_label_set(EWL_BUTTON(o), "List view");
ewl_container_child_append(EWL_CONTAINER(menu), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filedialog_cb_list_view, fd);
+ ewl_filedialog_cb_list_view, fd);
ewl_widget_show(o);
o = ewl_menu_item_new();
ewl_button_label_set(EWL_BUTTON(o), "Column view");
ewl_container_child_append(EWL_CONTAINER(menu), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filedialog_cb_column_view, fd);
+ ewl_filedialog_cb_column_view, fd);
ewl_widget_show(o);
o = ewl_menu_item_new();
ewl_button_label_set(EWL_BUTTON(o), "Tree view");
ewl_container_child_append(EWL_CONTAINER(menu), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filedialog_cb_tree_view, fd);
+ ewl_filedialog_cb_tree_view, fd);
ewl_widget_show(o);
o = ewl_menu_item_new();
ewl_button_label_set(EWL_BUTTON(o), "Show Dot Files");
ewl_container_child_append(EWL_CONTAINER(fd->menu), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filedialog_cb_show_dot, fd);
+ ewl_filedialog_cb_show_dot, fd);
ewl_widget_show(o);
o = ewl_menu_item_new();
ewl_button_label_set(EWL_BUTTON(o), "Show Favorites");
ewl_container_child_append(EWL_CONTAINER(fd->menu), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filedialog_cb_show_favorites, fd);
+ ewl_filedialog_cb_show_favorites, fd);
ewl_widget_show(o);
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -188,7 +188,7 @@ ewl_filedialog_list_view_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, NULL);
DRETURN_PTR(ewl_filepicker_list_view_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -223,7 +223,7 @@ ewl_filedialog_directory_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, NULL);
DRETURN_PTR(ewl_filepicker_directory_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -257,7 +257,7 @@ ewl_filedialog_multiselect_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE);
DRETURN_INT(ewl_filepicker_multiselect_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -291,7 +291,7 @@ ewl_filedialog_show_dot_files_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE);
DRETURN_INT(ewl_filepicker_show_dot_files_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -325,7 +325,7 @@ ewl_filedialog_show_favorites_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE);
DRETURN_INT(ewl_filepicker_show_favorites_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -359,7 +359,7 @@ ewl_filedialog_selected_file_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, NULL);
DRETURN_PTR(ewl_filepicker_selected_file_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -393,7 +393,7 @@ ewl_filedialog_selected_files_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, NULL);
DRETURN_PTR(ewl_filepicker_selected_files_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -406,8 +406,8 @@ ewl_filedialog_selected_files_get(Ewl_Filedialog *fd)
*/
void
ewl_filedialog_filter_add(Ewl_Filedialog *fd, const char *name,
- const char *filter,
- Ecore_List *mime_types)
+ const char *filter,
+ Ecore_List *mime_types)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(fd);
@@ -433,7 +433,7 @@ ewl_filedialog_filter_add(Ewl_Filedialog *fd, const char *name,
*/
void
ewl_filedialog_cb_delete_window(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Filedialog *fd;
@@ -456,14 +456,14 @@ ewl_filedialog_respond(Ewl_Filedialog *fd, unsigned int response)
ev.response = response;
ewl_callback_call_with_event_data(EWL_WIDGET(fd),
- EWL_CALLBACK_VALUE_CHANGED, &ev);
+ EWL_CALLBACK_VALUE_CHANGED, &ev);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_filedialog_cb_value_changed(Ewl_Widget *w __UNUSED__, void *ev,
- void *data)
+ void *data)
{
Ewl_Filedialog *fd;
Ewl_Event_Action_Response *e;
@@ -483,7 +483,7 @@ ewl_filedialog_cb_value_changed(Ewl_Widget *w __UNUSED__, void *ev,
static void
ewl_filedialog_cb_column_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filedialog *fd;
@@ -499,7 +499,7 @@ ewl_filedialog_cb_column_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
ewl_filedialog_cb_icon_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filedialog *fd;
@@ -515,7 +515,7 @@ ewl_filedialog_cb_icon_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
ewl_filedialog_cb_list_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filedialog *fd;
@@ -531,7 +531,7 @@ ewl_filedialog_cb_list_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
ewl_filedialog_cb_tree_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filedialog *fd;
@@ -547,7 +547,7 @@ ewl_filedialog_cb_tree_view(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
ewl_filedialog_cb_show_dot(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filedialog *fd;
@@ -557,14 +557,14 @@ ewl_filedialog_cb_show_dot(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
fd = data;
ewl_filedialog_show_dot_files_set(fd,
- !ewl_filedialog_show_dot_files_get(fd));
+ !ewl_filedialog_show_dot_files_get(fd));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_filedialog_cb_show_favorites(Ewl_Widget *w __UNUSED__,
- void *ev __UNUSED__, void *data)
+ void *ev __UNUSED__, void *data)
{
Ewl_Filedialog *fd;
@@ -574,7 +574,7 @@ ewl_filedialog_cb_show_favorites(Ewl_Widget *w __UNUSED__,
fd = data;
ewl_filedialog_show_favorites_set(fd,
- !ewl_filedialog_show_favorites_get(fd));
+ !ewl_filedialog_show_favorites_get(fd));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -609,7 +609,7 @@ ewl_filedialog_save_as_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE);
DRETURN_INT(ewl_filepicker_save_as_get(EWL_FILEPICKER(fd->fp)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -642,7 +642,7 @@ ewl_filedialog_return_directories_get(Ewl_Filedialog *fd)
DCHECK_TYPE_RET(fd, EWL_FILEDIALOG_TYPE, FALSE);
DRETURN_INT(ewl_filepicker_return_directories_get
- (EWL_FILEPICKER(fd->fp)), DLEVEL_STABLE);
+ (EWL_FILEPICKER(fd->fp)), DLEVEL_STABLE);
}
/**
diff --git a/src/lib/ewl_filedialog.h b/src/lib/ewl_filedialog.h
index 021c5a3..2725827 100644
--- a/src/lib/ewl_filedialog.h
+++ b/src/lib/ewl_filedialog.h
@@ -50,52 +50,52 @@ typedef struct Ewl_Filedialog Ewl_Filedialog;
*/
struct Ewl_Filedialog
{
- Ewl_Dialog dialog; /**< The dialog base class */
- Ewl_Widget *fp; /**< Ewl_Filepicker */
- Ewl_Widget *menu; /**< The menu */
+ Ewl_Dialog dialog; /**< The dialog base class */
+ Ewl_Widget *fp; /**< Ewl_Filepicker */
+ Ewl_Widget *menu; /**< The menu */
};
Ewl_Widget *ewl_filedialog_multiselect_new(void);
Ewl_Widget *ewl_filedialog_new(void);
-int ewl_filedialog_init(Ewl_Filedialog *fd);
+int ewl_filedialog_init(Ewl_Filedialog *fd);
-void ewl_filedialog_list_view_set(Ewl_Filedialog *fd,
- Ewl_Filelist_View view);
+void ewl_filedialog_list_view_set(Ewl_Filedialog *fd,
+ Ewl_Filelist_View view);
Ewl_Filelist_View *ewl_filedialog_list_view_get(Ewl_Filedialog *fd);
-void ewl_filedialog_directory_set(Ewl_Filedialog *fd,
- const char *dir);
+void ewl_filedialog_directory_set(Ewl_Filedialog *fd,
+ const char *dir);
const char *ewl_filedialog_directory_get(Ewl_Filedialog *fd);
-void ewl_filedialog_multiselect_set(Ewl_Filedialog *fd,
- unsigned int ms);
+void ewl_filedialog_multiselect_set(Ewl_Filedialog *fd,
+ unsigned int ms);
unsigned int ewl_filedialog_multiselect_get(Ewl_Filedialog *fd);
-void ewl_filedialog_show_dot_files_set(Ewl_Filedialog *fd,
- unsigned int dot);
+void ewl_filedialog_show_dot_files_set(Ewl_Filedialog *fd,
+ unsigned int dot);
unsigned int ewl_filedialog_show_dot_files_get(Ewl_Filedialog *fd);
-void ewl_filedialog_show_favorites_set(Ewl_Filedialog *fd,
- unsigned int show);
+void ewl_filedialog_show_favorites_set(Ewl_Filedialog *fd,
+ unsigned int show);
unsigned int ewl_filedialog_show_favorites_get(Ewl_Filedialog *fd);
-void ewl_filedialog_selected_file_set(Ewl_Filedialog *fd,
- const char *file);
-char *ewl_filedialog_selected_file_get(Ewl_Filedialog *fd);
+void ewl_filedialog_selected_file_set(Ewl_Filedialog *fd,
+ const char *file);
+char *ewl_filedialog_selected_file_get(Ewl_Filedialog *fd);
-void ewl_filedialog_selected_files_set(Ewl_Filedialog *fd,
- Ecore_List *files);
+void ewl_filedialog_selected_files_set(Ewl_Filedialog *fd,
+ Ecore_List *files);
Ecore_List *ewl_filedialog_selected_files_get(Ewl_Filedialog *fd);
-void ewl_filedialog_filter_add(Ewl_Filedialog *fd,
- const char *name,
- const char *filter,
- Ecore_List *mime_types);
-void ewl_filedialog_save_as_set(Ewl_Filedialog *fd,
- unsigned int t);
+void ewl_filedialog_filter_add(Ewl_Filedialog *fd,
+ const char *name,
+ const char *filter,
+ Ecore_List *mime_types);
+void ewl_filedialog_save_as_set(Ewl_Filedialog *fd,
+ unsigned int t);
unsigned int ewl_filedialog_save_as_get(Ewl_Filedialog *fd);
-void ewl_filedialog_return_directories_set(Ewl_Filedialog *fd,
- unsigned int t);
+void ewl_filedialog_return_directories_set(Ewl_Filedialog *fd,
+ unsigned int t);
unsigned int ewl_filedialog_return_directories_get(Ewl_Filedialog *fd);
Ewl_Widget *ewl_filedialog_save_as_new(void);
diff --git a/src/lib/ewl_filelist.c b/src/lib/ewl_filelist.c
index 0806444..4e5088d 100644
--- a/src/lib/ewl_filelist.c
+++ b/src/lib/ewl_filelist.c
@@ -24,7 +24,7 @@
static void ewl_filelist_setup(Ewl_Filelist *fl);
static void ewl_filelist_view_setup(Ewl_Filelist *fl);
static void ewl_filelist_cb_clicked(Ewl_Widget *w, void *ev,
- void *data __UNUSED__);
+ void *data __UNUSED__);
/**
* @return Returns a new Ewl_Filelist widget or NULL on failure
@@ -39,12 +39,12 @@ ewl_filelist_new(void)
w = NEW(Ewl_Filelist, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_filelist_init(EWL_FILELIST(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -62,7 +62,7 @@ ewl_filelist_init(Ewl_Filelist *fl)
DCHECK_PARAM_PTR_RET(fl, FALSE);
if (!ewl_box_init(EWL_BOX(fl)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(fl), EWL_FILELIST_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(fl), EWL_FLAG_FILL_FILL);
@@ -71,7 +71,7 @@ ewl_filelist_init(Ewl_Filelist *fl)
fl->scroll_flags.v = EWL_SCROLLPANE_FLAG_AUTO_VISIBLE;
ewl_callback_prepend(EWL_WIDGET(fl), EWL_CALLBACK_DESTROY,
- ewl_filelist_cb_destroy, NULL);
+ ewl_filelist_cb_destroy, NULL);
fl->view_flag = EWL_FILELIST_VIEW_ICON;
fl->multiselect = FALSE;
@@ -98,39 +98,39 @@ ewl_filelist_setup(Ewl_Filelist *fl)
fl->view = ewl_view_new();
ewl_view_widget_fetch_set(fl->view,
- ewl_filelist_view_widget_fetch);
+ ewl_filelist_view_widget_fetch);
ewl_view_header_fetch_set(fl->view,
- ewl_filelist_view_header_fetch);
+ ewl_filelist_view_header_fetch);
fl->model = ewl_model_new();
ewl_model_data_count_set(fl->model,
- ewl_filelist_model_data_count);
+ ewl_filelist_model_data_count);
ewl_model_data_fetch_set(fl->model,
- ewl_filelist_model_data_fetch);
+ ewl_filelist_model_data_fetch);
ewl_model_data_sort_set(fl->model,
- ewl_filelist_model_data_sort);
+ ewl_filelist_model_data_sort);
ewl_model_column_sortable_set(fl->model,
- ewl_filelist_model_column_sortable);
+ ewl_filelist_model_column_sortable);
ewl_model_data_unref_set(fl->model,
- ewl_filelist_model_data_unref);
+ ewl_filelist_model_data_unref);
/* For now just create a tree and set different views */
fl->controller = ewl_tree_new();
ewl_mvc_view_set(EWL_MVC(fl->controller), fl->view);
ewl_mvc_model_set(EWL_MVC(fl->controller), fl->model);
ewl_tree_selection_type_set(EWL_TREE(fl->controller),
- EWL_TREE_SELECTION_TYPE_ROW);
+ EWL_TREE_SELECTION_TYPE_ROW);
ewl_container_child_append(EWL_CONTAINER(fl), fl->controller);
ewl_callback_append(EWL_WIDGET(fl->controller),
- EWL_CALLBACK_CLICKED, ewl_filelist_cb_clicked, fl);
+ EWL_CALLBACK_CLICKED, ewl_filelist_cb_clicked, fl);
ewl_widget_show(fl->controller);
if (fl->multiselect)
- ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
- EWL_SELECTION_MODE_MULTI);
+ ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
+ EWL_SELECTION_MODE_MULTI);
else
- ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
- EWL_SELECTION_MODE_SINGLE);
+ ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
+ EWL_SELECTION_MODE_SINGLE);
ewl_filelist_view_setup(fl);
@@ -155,50 +155,50 @@ ewl_filelist_view_setup(Ewl_Filelist *fl)
if (fl->view_flag == EWL_FILELIST_VIEW_TREE)
{
- ewl_tree_column_count_set(EWL_TREE(fl->controller), 2);
- ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
- TRUE);
- ewl_tree_alternate_row_colors_set
- (EWL_TREE(fl->controller), TRUE);
- ewl_model_expansion_data_fetch_set(fl->model,
- ewl_filelist_model_data_expansion_data_fetch);
- ewl_model_data_expandable_set(fl->model,
- ewl_filelist_model_data_expandable_get);
- view = ewl_tree_view_scrolled_get();
+ ewl_tree_column_count_set(EWL_TREE(fl->controller), 2);
+ ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
+ TRUE);
+ ewl_tree_alternate_row_colors_set
+ (EWL_TREE(fl->controller), TRUE);
+ ewl_model_expansion_data_fetch_set(fl->model,
+ ewl_filelist_model_data_expansion_data_fetch);
+ ewl_model_data_expandable_set(fl->model,
+ ewl_filelist_model_data_expandable_get);
+ view = ewl_tree_view_scrolled_get();
}
else if (fl->view_flag == EWL_FILELIST_VIEW_LIST)
{
- ewl_tree_column_count_set(EWL_TREE(fl->controller), 6);
- ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
- TRUE);
- ewl_tree_alternate_row_colors_set
- (EWL_TREE(fl->controller), TRUE);
- view = ewl_tree_view_scrolled_get();
+ ewl_tree_column_count_set(EWL_TREE(fl->controller), 6);
+ ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
+ TRUE);
+ ewl_tree_alternate_row_colors_set
+ (EWL_TREE(fl->controller), TRUE);
+ view = ewl_tree_view_scrolled_get();
}
/* Until column view is written just default and throw a warning */
else if (fl->view_flag == EWL_FILELIST_VIEW_COLUMN)
{
- ewl_tree_column_count_set(EWL_TREE(fl->controller), 1);
- ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
- FALSE);
- ewl_tree_alternate_row_colors_set
- (EWL_TREE(fl->controller), FALSE);
- view = ewl_tree_view_freebox_get();
- DWARNING("Column view not implemented");
+ ewl_tree_column_count_set(EWL_TREE(fl->controller), 1);
+ ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
+ FALSE);
+ ewl_tree_alternate_row_colors_set
+ (EWL_TREE(fl->controller), FALSE);
+ view = ewl_tree_view_freebox_get();
+ DWARNING("Column view not implemented");
}
/* Make icon view default */
else
{
- ewl_tree_column_count_set(EWL_TREE(fl->controller), 1);
- /* XXX dirty hack, please remove it after we have a
- * freebox mvc implementation */
- ewl_container_reset(EWL_CONTAINER(EWL_TREE(fl->controller)->header));
- ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
- FALSE);
- ewl_tree_alternate_row_colors_set
- (EWL_TREE(fl->controller), FALSE);
- view = ewl_tree_view_freebox_get();
- fl->view_flag = EWL_FILELIST_VIEW_ICON;
+ ewl_tree_column_count_set(EWL_TREE(fl->controller), 1);
+ /* XXX dirty hack, please remove it after we have a
+ * freebox mvc implementation */
+ ewl_container_reset(EWL_CONTAINER(EWL_TREE(fl->controller)->header));
+ ewl_tree_headers_visible_set(EWL_TREE(fl->controller),
+ FALSE);
+ ewl_tree_alternate_row_colors_set
+ (EWL_TREE(fl->controller), FALSE);
+ view = ewl_tree_view_freebox_get();
+ fl->view_flag = EWL_FILELIST_VIEW_ICON;
}
/* Set the view and redraw the tree */
@@ -222,7 +222,7 @@ ewl_filelist_view_set(Ewl_Filelist *fl, Ewl_Filelist_View view)
DCHECK_TYPE(fl, EWL_FILELIST_TYPE);
if (fl->view_flag == view)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fl->view_flag = view;
ewl_filelist_view_setup(fl);
@@ -260,28 +260,28 @@ ewl_filelist_directory_set(Ewl_Filelist *fl, const char *dir)
if (dir == NULL)
{
- IF_FREE(fl->directory);
- fl->directory = NULL;
+ IF_FREE(fl->directory);
+ fl->directory = NULL;
}
else if ((!fl->directory) || (strcmp(dir, fl->directory)))
{
- Ewl_Filelist_Directory *data;
- Ewl_Event_Action_Response ev_data;
-
- IF_FREE(fl->directory);
- fl->directory = strdup(dir);
-
- data = ewl_mvc_data_get(EWL_MVC(fl->controller));
- if (data) ewl_filelist_model_data_unref(data);
-
- data = ewl_filelist_model_directory_new(fl->directory,
- fl->show_dot, TRUE, fl->filter);
- ewl_mvc_data_set(EWL_MVC(fl->controller), data);
- ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE);
-
- ev_data.response = EWL_FILELIST_EVENT_DIR_CHANGE;
- ewl_callback_call_with_event_data(EWL_WIDGET(fl),
- EWL_CALLBACK_VALUE_CHANGED, &ev_data);
+ Ewl_Filelist_Directory *data;
+ Ewl_Event_Action_Response ev_data;
+
+ IF_FREE(fl->directory);
+ fl->directory = strdup(dir);
+
+ data = ewl_mvc_data_get(EWL_MVC(fl->controller));
+ if (data) ewl_filelist_model_data_unref(data);
+
+ data = ewl_filelist_model_directory_new(fl->directory,
+ fl->show_dot, TRUE, fl->filter);
+ ewl_mvc_data_set(EWL_MVC(fl->controller), data);
+ ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE);
+
+ ev_data.response = EWL_FILELIST_EVENT_DIR_CHANGE;
+ ewl_callback_call_with_event_data(EWL_WIDGET(fl),
+ EWL_CALLBACK_VALUE_CHANGED, &ev_data);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -325,9 +325,9 @@ ewl_filelist_filter_set(Ewl_Filelist *fl, Ewl_Filelist_Filter *filter)
/* Set the filelist and test if there is any change in data */
if (dir)
- ret = ewl_filelist_model_filter_set(dir, filter);
+ ret = ewl_filelist_model_filter_set(dir, filter);
if (ret)
- ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE);
+ ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -363,25 +363,25 @@ ewl_filelist_multiselect_set(Ewl_Filelist *fl, unsigned int ms)
DCHECK_TYPE(fl, EWL_FILELIST_TYPE);
if (fl->multiselect == !!ms)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fl->multiselect = !!ms;
-
+
if (fl->multiselect)
{
- ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
- EWL_SELECTION_MODE_MULTI);
- ev_data.response = EWL_FILELIST_EVENT_MULTI_TRUE;
+ ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
+ EWL_SELECTION_MODE_MULTI);
+ ev_data.response = EWL_FILELIST_EVENT_MULTI_TRUE;
}
else
{
- ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
- EWL_SELECTION_MODE_SINGLE);
- ev_data.response = EWL_FILELIST_EVENT_MULTI_FALSE;
+ ewl_mvc_selection_mode_set(EWL_MVC(fl->controller),
+ EWL_SELECTION_MODE_SINGLE);
+ ev_data.response = EWL_FILELIST_EVENT_MULTI_FALSE;
}
ewl_callback_call_with_event_data(EWL_WIDGET(fl),
- EWL_CALLBACK_VALUE_CHANGED, &ev_data);
+ EWL_CALLBACK_VALUE_CHANGED, &ev_data);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -418,16 +418,16 @@ ewl_filelist_show_dot_files_set(Ewl_Filelist *fl, unsigned int dot)
DCHECK_TYPE(fl, EWL_FILELIST_TYPE);
if (fl->show_dot == !!dot)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fl->show_dot = !!dot;
dir = ewl_mvc_data_get(EWL_MVC(fl->controller));
/* check if data and then call the model function */
if (dir)
- ret = ewl_filelist_model_show_dot_files_set(dir, dot);
+ ret = ewl_filelist_model_show_dot_files_set(dir, dot);
if (ret)
- ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE);
+ ewl_mvc_dirty_set(EWL_MVC(fl->controller), TRUE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -468,37 +468,37 @@ ewl_filelist_selected_file_set(Ewl_Filelist *fl, const char *file)
if (!file)
{
- ewl_mvc_selected_clear(EWL_MVC(fl->controller));
- DRETURN(DLEVEL_STABLE);
+ ewl_mvc_selected_clear(EWL_MVC(fl->controller));
+ DRETURN(DLEVEL_STABLE);
}
filename = ewl_filelist_expand_path(fl, file);
data = ewl_mvc_data_get(EWL_MVC(fl->controller));
if (ecore_file_is_dir(filename))
{
- temp = data->dirs;
- dir = 1;
+ temp = data->dirs;
+ dir = 1;
}
else
- temp = data->files;
+ temp = data->files;
ecore_list_first_goto(temp);
while ((file_temp = ecore_list_next(temp)))
{
- if (!strcoll(file_temp->name, file))
- {
- index = ecore_list_index(temp);
- break;
- }
+ if (!strcoll(file_temp->name, file))
+ {
+ index = ecore_list_index(temp);
+ break;
+ }
}
if ((index >= 0) && (dir == 0))
- ewl_mvc_selected_set(EWL_MVC(fl->controller), NULL,
- NULL, (index + data->num_dirs - 1), 0);
+ ewl_mvc_selected_set(EWL_MVC(fl->controller), NULL,
+ NULL, (index + data->num_dirs - 1), 0);
else if ((index >= 0) && (dir == 1))
- ewl_mvc_selected_set(EWL_MVC(fl->controller), NULL,
- NULL, (index - 1), 0);
+ ewl_mvc_selected_set(EWL_MVC(fl->controller), NULL,
+ NULL, (index - 1), 0);
FREE(filename);
ewl_filelist_selected_files_change_notify(fl);
@@ -525,34 +525,34 @@ ewl_filelist_selected_file_get(Ewl_Filelist *fl)
DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE, NULL);
if (!ewl_mvc_selected_count_get(EWL_MVC(fl->controller)))
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
idx = ewl_mvc_selected_get(EWL_MVC(fl->controller));
data = EWL_SELECTION(idx)->data;
if (idx->row < data->num_dirs)
- file = ecore_list_index_goto(data->dirs, idx->row);
+ file = ecore_list_index_goto(data->dirs, idx->row);
else
{
- i = (idx->row - data->num_dirs);
- file = ecore_list_index_goto(data->files, i);
+ i = (idx->row - data->num_dirs);
+ file = ecore_list_index_goto(data->files, i);
}
FREE(idx);
if (!file)
{
- /* This should be fixed now */
- DWARNING("MVC has selected file, but cannot find the data!");
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ /* This should be fixed now */
+ DWARNING("MVC has selected file, but cannot find the data!");
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!strcmp(file->name, ".."))
- snprintf(path, PATH_MAX, "%s", data->name);
+ snprintf(path, PATH_MAX, "%s", data->name);
else if (!strcmp(data->name, "/"))
- snprintf(path, PATH_MAX, "%s%s", data->name, file->name);
+ snprintf(path, PATH_MAX, "%s%s", data->name, file->name);
else
- snprintf(path, PATH_MAX, "%s/%s", data->name, file->name);
+ snprintf(path, PATH_MAX, "%s/%s", data->name, file->name);
DRETURN_PTR(strdup(path), DLEVEL_STABLE);
}
@@ -572,24 +572,24 @@ ewl_filelist_size_get(off_t st_size)
dsize = (double)st_size;
if (dsize < 1024)
- snprintf(size, sizeof(size), "%.0f b", dsize);
+ snprintf(size, sizeof(size), "%.0f b", dsize);
else
{
- dsize /= 1024.0;
- if (dsize < 1024)
- suffix = "kb";
- else
- {
- dsize /= 1024.0;
- if (dsize < 1024)
- suffix = "mb";
- else
- {
- dsize /= 1024.0;
- suffix = "gb";
- }
- }
- snprintf(size, sizeof(size), "%.1f %s", dsize, suffix);
+ dsize /= 1024.0;
+ if (dsize < 1024)
+ suffix = "kb";
+ else
+ {
+ dsize /= 1024.0;
+ if (dsize < 1024)
+ suffix = "mb";
+ else
+ {
+ dsize /= 1024.0;
+ suffix = "gb";
+ }
+ }
+ snprintf(size, sizeof(size), "%.1f %s", dsize, suffix);
}
DRETURN_PTR(strdup(size), DLEVEL_STABLE);
@@ -610,7 +610,7 @@ ewl_filelist_perms_get(mode_t st_mode)
perm = (char *)malloc(sizeof(char) * 10);
for (i = 0; i < 9; i++)
- perm[i] = '-';
+ perm[i] = '-';
perm[9] = '\0';
@@ -654,7 +654,7 @@ ewl_filelist_username_get(uid_t st_uid)
#ifdef HAVE_PWD_H
pwd = getpwuid(st_uid);
if (pwd)
- snprintf(name, PATH_MAX, "%s", pwd->pw_name);
+ snprintf(name, PATH_MAX, "%s", pwd->pw_name);
else
#else
# ifdef _WIN32
@@ -664,20 +664,20 @@ ewl_filelist_username_get(uid_t st_uid)
if (!homedir) homedir = getenv("USERPROFILE");
if (homedir)
{
- char *p;
- p = homedir;
- while (p)
- {
- if (*p == '\\') *p = '/';
- p++;
- }
- p = strrchr(homedir, '/');
- snprintf(name, PATH_MAX, "%s", p);
+ char *p;
+ p = homedir;
+ while (p)
+ {
+ if (*p == '\\') *p = '/';
+ p++;
+ }
+ p = strrchr(homedir, '/');
+ snprintf(name, PATH_MAX, "%s", p);
}
else
# endif /* _WIN32 */
#endif /* HAVE_PWD_H */
- snprintf(name, PATH_MAX, "%-8d", (int)st_uid);
+ snprintf(name, PATH_MAX, "%-8d", (int)st_uid);
DRETURN_PTR(strdup(name), DLEVEL_STABLE);
}
@@ -700,10 +700,10 @@ ewl_filelist_groupname_get(gid_t st_gid)
#ifdef HAVE_GRP_H
grp = getgrgid(st_gid);
if (grp)
- snprintf(name, PATH_MAX, "%s", grp->gr_name);
+ snprintf(name, PATH_MAX, "%s", grp->gr_name);
else
#endif /* HAVE_GRP_H */
- snprintf(name, PATH_MAX, "%-8d", (int)st_gid);
+ snprintf(name, PATH_MAX, "%-8d", (int)st_gid);
DRETURN_PTR(strdup(name), DLEVEL_STABLE);
}
@@ -723,8 +723,8 @@ ewl_filelist_modtime_get(time_t st_modtime)
time = ctime(&st_modtime);
if (time)
{
- time = strdup(time);
- time[strlen(time) - 1] = '\0';
+ time = strdup(time);
+ time[strlen(time) - 1] = '\0';
}
else time = strdup("Unknown");
@@ -763,13 +763,13 @@ ewl_filelist_selected_file_preview_get(Ewl_Filelist *fl, const char *path)
time = ewl_filelist_modtime_get(buf.st_mtime);
snprintf(file_info, PATH_MAX,
- "Size: %s\n"
- "User ID: %s\n"
- "Group ID: %s\n"
- "Permissions: %s\n"
- "Last Modified: %s\n",
- size, username, groupname,
- perms, time);
+ "Size: %s\n"
+ "User ID: %s\n"
+ "Group ID: %s\n"
+ "Permissions: %s\n"
+ "Last Modified: %s\n",
+ size, username, groupname,
+ perms, time);
box = ewl_vbox_new();
ewl_widget_show(box);
@@ -789,7 +789,7 @@ ewl_filelist_selected_file_preview_get(Ewl_Filelist *fl, const char *path)
icon = ewl_icon_new();
ewl_box_orientation_set(EWL_BOX(icon),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
ewl_icon_label_set(EWL_ICON(icon), path);
ewl_icon_extended_data_set(EWL_ICON(icon), text);
ewl_icon_type_set(EWL_ICON(icon), EWL_ICON_TYPE_LONG);
@@ -824,7 +824,7 @@ ewl_filelist_multi_select_preview_get(Ewl_Filelist *fl)
icon = ewl_icon_simple_new();
ewl_box_orientation_set(EWL_BOX(icon),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
ewl_icon_label_set(EWL_ICON(icon), "Multiple files selected");
ewl_container_child_append(EWL_CONTAINER(box), icon);
ewl_widget_show(icon);
@@ -864,34 +864,34 @@ ewl_filelist_selected_files_set(Ewl_Filelist *fl, Ecore_List *files)
/* For every file, search for a match */
for (i = 0; i < ecore_list_count(files); i++)
{
- path = ecore_list_next(files);
-
- /* Set temp to whichever list the file could be in */
- if (ecore_file_is_dir(path))
- {
- temp = data->dirs;
- index = 0;
- }
- else
- {
- temp = data->files;
- index = data->num_dirs;
- }
-
- /* Search the list and return the index if found */
- while ((file = ecore_list_next(temp)))
- {
- if (!strcmp(file->name, ecore_file_file_get(path)))
- {
- index = (index + ecore_list_index(temp) - 1);
- sel = ewl_mvc_selection_index_new(fl->model,
- NULL, index, 0);
- ecore_list_append(selected, sel);
- break;
- }
- }
- ecore_list_first_goto(temp);
- }
+ path = ecore_list_next(files);
+
+ /* Set temp to whichever list the file could be in */
+ if (ecore_file_is_dir(path))
+ {
+ temp = data->dirs;
+ index = 0;
+ }
+ else
+ {
+ temp = data->files;
+ index = data->num_dirs;
+ }
+
+ /* Search the list and return the index if found */
+ while ((file = ecore_list_next(temp)))
+ {
+ if (!strcmp(file->name, ecore_file_file_get(path)))
+ {
+ index = (index + ecore_list_index(temp) - 1);
+ sel = ewl_mvc_selection_index_new(fl->model,
+ NULL, index, 0);
+ ecore_list_append(selected, sel);
+ break;
+ }
+ }
+ ecore_list_first_goto(temp);
+ }
ewl_mvc_selected_list_set(EWL_MVC(fl->controller), selected);
ewl_filelist_selected_files_change_notify(fl);
@@ -925,81 +925,81 @@ ewl_filelist_selected_files_get(Ewl_Filelist *fl)
ecore_list_first_goto(selected);
while ((sel = ecore_list_next(selected)))
{
- data = sel->data;
- /* If using Index instead of range */
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- Ewl_Selection_Idx *idx;
-
- idx = EWL_SELECTION_IDX(sel);
- /* Get the file data */
- if (idx->row < data->num_dirs)
- file = ecore_list_index_goto(data->dirs, idx->row);
- else
- file = ecore_list_index_goto(data->files,
- (idx->row - data->num_dirs));
-
- if (!file)
- {
- /* This should be fixed now */
- DWARNING("MVC has selected file, but cannot "
- "find the data!");
- continue;
- }
-
- if (!strcmp(file->name, ".."))
- snprintf(path, PATH_MAX, "%s", data->name);
-
- else if (!strcmp(data->name, "/"))
- snprintf(path, PATH_MAX, "%s%s",
- data->name, file->name);
-
- else
- snprintf(path, PATH_MAX, "%s/%s",
- data->name, file->name);
-
- ecore_list_append(ret, strdup(path));
- }
-
- /* If using range instead of index */
- else if (sel->type == EWL_SELECTION_TYPE_RANGE)
- {
- Ewl_Selection_Range *r;
- unsigned int i;
-
- r = EWL_SELECTION_RANGE(sel);
- for (i = r->start.row; i <= r->end.row; i++)
- {
- /* Get the file data */
- if (i < data->num_dirs)
- file = ecore_list_index_goto(data->dirs, i);
- else
- file = ecore_list_index_goto(data->files,
- (i - data->num_dirs));
-
- if (!file)
- {
- /* This should be fixed now */
- DWARNING("MVC has selected file, but "
- "cannot find the data!");
- continue;
- }
-
- if (!strcmp(file->name, ".."))
- snprintf(path, PATH_MAX, "%s", data->name);
-
- else if (!strcmp(data->name, "/"))
- snprintf(path, PATH_MAX, "%s%s",
- data->name, file->name);
-
- else
- snprintf(path, PATH_MAX, "%s/%s",
- data->name, file->name);
-
- ecore_list_append(ret, strdup(path));
- }
- }
- }
+ data = sel->data;
+ /* If using Index instead of range */
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ Ewl_Selection_Idx *idx;
+
+ idx = EWL_SELECTION_IDX(sel);
+ /* Get the file data */
+ if (idx->row < data->num_dirs)
+ file = ecore_list_index_goto(data->dirs, idx->row);
+ else
+ file = ecore_list_index_goto(data->files,
+ (idx->row - data->num_dirs));
+
+ if (!file)
+ {
+ /* This should be fixed now */
+ DWARNING("MVC has selected file, but cannot "
+ "find the data!");
+ continue;
+ }
+
+ if (!strcmp(file->name, ".."))
+ snprintf(path, PATH_MAX, "%s", data->name);
+
+ else if (!strcmp(data->name, "/"))
+ snprintf(path, PATH_MAX, "%s%s",
+ data->name, file->name);
+
+ else
+ snprintf(path, PATH_MAX, "%s/%s",
+ data->name, file->name);
+
+ ecore_list_append(ret, strdup(path));
+ }
+
+ /* If using range instead of index */
+ else if (sel->type == EWL_SELECTION_TYPE_RANGE)
+ {
+ Ewl_Selection_Range *r;
+ unsigned int i;
+
+ r = EWL_SELECTION_RANGE(sel);
+ for (i = r->start.row; i <= r->end.row; i++)
+ {
+ /* Get the file data */
+ if (i < data->num_dirs)
+ file = ecore_list_index_goto(data->dirs, i);
+ else
+ file = ecore_list_index_goto(data->files,
+ (i - data->num_dirs));
+
+ if (!file)
+ {
+ /* This should be fixed now */
+ DWARNING("MVC has selected file, but "
+ "cannot find the data!");
+ continue;
+ }
+
+ if (!strcmp(file->name, ".."))
+ snprintf(path, PATH_MAX, "%s", data->name);
+
+ else if (!strcmp(data->name, "/"))
+ snprintf(path, PATH_MAX, "%s%s",
+ data->name, file->name);
+
+ else
+ snprintf(path, PATH_MAX, "%s/%s",
+ data->name, file->name);
+
+ ecore_list_append(ret, strdup(path));
+ }
+ }
+ }
DRETURN_PTR(ret, DLEVEL_STABLE);
}
@@ -1021,7 +1021,7 @@ ewl_filelist_selected_files_change_notify(Ewl_Filelist *fl)
ev_data.response = EWL_FILELIST_EVENT_SELECTION_CHANGE;
ewl_callback_call_with_event_data(EWL_WIDGET(fl),
- EWL_CALLBACK_VALUE_CHANGED, &ev_data);
+ EWL_CALLBACK_VALUE_CHANGED, &ev_data);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1055,7 +1055,7 @@ ewl_filelist_vscroll_flag_get(Ewl_Filelist *fl)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(fl, EWL_SCROLLPANE_FLAG_NONE);
DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE,
- EWL_SCROLLPANE_FLAG_NONE);
+ EWL_SCROLLPANE_FLAG_NONE);
DRETURN_INT(fl->scroll_flags.v, DLEVEL_STABLE);
}
@@ -1089,7 +1089,7 @@ ewl_filelist_hscroll_flag_get(Ewl_Filelist *fl)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(fl, EWL_SCROLLPANE_FLAG_NONE);
DCHECK_TYPE_RET(fl, EWL_FILELIST_TYPE,
- EWL_SCROLLPANE_FLAG_NONE);
+ EWL_SCROLLPANE_FLAG_NONE);
DRETURN_INT(fl->scroll_flags.h, DLEVEL_STABLE);
}
@@ -1109,19 +1109,19 @@ ewl_filelist_stock_icon_get(const char *path)
DCHECK_PARAM_PTR_RET(path, NULL);
if (ecore_file_is_dir(path))
- DRETURN_PTR(EWL_ICON_FOLDER, DLEVEL_STABLE);
+ DRETURN_PTR(EWL_ICON_FOLDER, DLEVEL_STABLE);
ptr = strrchr(path, '.');
if (ptr)
{
- ret = ewl_io_manager_extension_icon_name_get(ptr);
- if (ret) DRETURN_PTR(ret, DLEVEL_STABLE);
+ ret = ewl_io_manager_extension_icon_name_get(ptr);
+ if (ret) DRETURN_PTR(ret, DLEVEL_STABLE);
}
if (ecore_file_can_exec(path))
- ret = EWL_ICON_APPLICATION_X_EXECUTABLE;
+ ret = EWL_ICON_APPLICATION_X_EXECUTABLE;
else
- ret = EWL_ICON_TEXT_X_GENERIC;
+ ret = EWL_ICON_TEXT_X_GENERIC;
DRETURN_PTR(ret, DLEVEL_STABLE);
}
@@ -1147,34 +1147,34 @@ ewl_filelist_expand_path(Ewl_Filelist *fl, const char *dir)
cur_dir = ewl_filelist_directory_get(EWL_FILELIST(fl));
if (!strcmp(dir, ".."))
{
- char *t, *t2;
-
- snprintf(path, PATH_MAX, "%s", cur_dir);
- t = path;
- t2 = t;
- while ((*t != '\0'))
- {
- if ((*t == '/') && (*(t + 1) != '\0')) t2 = t;
- t++;
- }
- *t2 = '\0';
-
- /* make sure we always have at least / in there */
- if (path[0] == '\0')
- {
- path[0] = '/';
- path[1] = '\0';
- }
+ char *t, *t2;
+
+ snprintf(path, PATH_MAX, "%s", cur_dir);
+ t = path;
+ t2 = t;
+ while ((*t != '\0'))
+ {
+ if ((*t == '/') && (*(t + 1) != '\0')) t2 = t;
+ t++;
+ }
+ *t2 = '\0';
+
+ /* make sure we always have at least / in there */
+ if (path[0] == '\0')
+ {
+ path[0] = '/';
+ path[1] = '\0';
+ }
}
else
{
- /* if the current directory is just / we dont' want to end
- * up with // on the start of the path. So, check to see if
- * the second item in cur_dir is a \0, and if so just append
- * "" instead of getting // twice */
- snprintf(path, PATH_MAX, "%s/%s",
- ((cur_dir[1] != '\0') ? cur_dir : ""),
- dir);
+ /* if the current directory is just / we dont' want to end
+ * up with // on the start of the path. So, check to see if
+ * the second item in cur_dir is a \0, and if so just append
+ * "" instead of getting // twice */
+ snprintf(path, PATH_MAX, "%s/%s",
+ ((cur_dir[1] != '\0') ? cur_dir : ""),
+ dir);
}
DRETURN_PTR(strdup(path), DLEVEL_STABLE);
@@ -1190,7 +1190,7 @@ ewl_filelist_expand_path(Ewl_Filelist *fl, const char *dir)
*/
void
ewl_filelist_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Filelist *fl;
@@ -1209,7 +1209,7 @@ ewl_filelist_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
static void
ewl_filelist_cb_clicked(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Event_Mouse_Down *md;
char *file, *t;
@@ -1225,49 +1225,49 @@ ewl_filelist_cb_clicked(Ewl_Widget *w, void *ev,
fl = data;
if (!ewl_mvc_selected_count_get(EWL_MVC(fl->controller)))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* Single clicks only */
if (md->clicks != 2)
{
- ewl_filelist_selected_files_change_notify(fl);
- DRETURN(DLEVEL_STABLE);
+ ewl_filelist_selected_files_change_notify(fl);
+ DRETURN(DLEVEL_STABLE);
}
/* Ensure that the click is on an icon, need to check for a
* highlight as the first click callback will create
*/
c = ewl_container_child_at_recursive_get(EWL_CONTAINER(fl),
- md->base.x, md->base.y);
+ md->base.x, md->base.y);
while (c && c->parent)
{
- if (!ewl_widget_internal_is(c))
- {
- i = 1;
- break;
- }
- c = c->parent;
+ if (!ewl_widget_internal_is(c))
+ {
+ i = 1;
+ break;
+ }
+ c = c->parent;
}
if (!i)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* Handle double clicks */
file = ewl_filelist_selected_file_get(fl);
/* If .. */
if (!strcmp(file, fl->directory))
{
- t = ecore_file_dir_get(fl->directory);
- ewl_filelist_directory_set(fl, t);
- FREE(t);
+ t = ecore_file_dir_get(fl->directory);
+ ewl_filelist_directory_set(fl, t);
+ FREE(t);
}
/* Change dir if dir, else call above */
else if (ecore_file_is_dir(file))
- ewl_filelist_directory_set(fl, file);
+ ewl_filelist_directory_set(fl, file);
/* Send signal of file selected */
else
- ewl_filelist_selected_files_change_notify(fl);
+ ewl_filelist_selected_files_change_notify(fl);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_filelist.h b/src/lib/ewl_filelist.h
index 0acd191..76f8c25 100644
--- a/src/lib/ewl_filelist.h
+++ b/src/lib/ewl_filelist.h
@@ -40,9 +40,9 @@ typedef struct Ewl_Filelist_Filter Ewl_Filelist_Filter;
* **/
struct Ewl_Filelist_Filter
{
- char *name;
- char *extension;
- Ecore_List *mime_list;
+ char *name;
+ char *extension;
+ Ecore_List *mime_list;
};
/**
@@ -73,24 +73,24 @@ typedef struct Ewl_Filelist Ewl_Filelist;
*/
struct Ewl_Filelist
{
- Ewl_Box box; /**< Inherits from Ewl_Box */
+ Ewl_Box box; /**< Inherits from Ewl_Box */
Ewl_Widget *controller; /**< Must inherit from mvc **/
- Ewl_View *view; /**< The view for mvc */
- Ewl_Model *model; /**< The model for the mvc */
+ Ewl_View *view; /**< The view for mvc */
+ Ewl_Model *model; /**< The model for the mvc */
- char *directory; /**< The directory to display */
- Ewl_Filelist_Filter *filter; /**< The file filter to employ */
+ char *directory; /**< The directory to display */
+ Ewl_Filelist_Filter *filter; /**< The file filter to employ */
- unsigned char multiselect:1; /**< Allow multiple file selctions */
- unsigned char show_dot:1; /**< Show . files */
+ unsigned char multiselect:1; /**< Allow multiple file selctions */
+ unsigned char show_dot:1; /**< Show . files */
- Ewl_Filelist_View view_flag; /**< The view to use for controller */
+ Ewl_Filelist_View view_flag; /**< The view to use for controller */
struct
- { Ewl_Scrollpane_Flags h; /**< Horizontal scroll flag */
- Ewl_Scrollpane_Flags v; /**< Vertical scroll flag */
- } scroll_flags; /**< Flags to modify a containing scrollpane */
+ { Ewl_Scrollpane_Flags h; /**< Horizontal scroll flag */
+ Ewl_Scrollpane_Flags v; /**< Vertical scroll flag */
+ } scroll_flags; /**< Flags to modify a containing scrollpane */
};
/**
@@ -155,60 +155,60 @@ struct Ewl_Filelist_Directory
Ewl_Widget *ewl_filelist_new(void);
-int ewl_filelist_init(Ewl_Filelist *fl);
+int ewl_filelist_init(Ewl_Filelist *fl);
-void ewl_filelist_directory_set(Ewl_Filelist *fl,
- const char *dir);
+void ewl_filelist_directory_set(Ewl_Filelist *fl,
+ const char *dir);
const char *ewl_filelist_directory_get(Ewl_Filelist *fl);
-void ewl_filelist_filter_set(Ewl_Filelist *fl,
- Ewl_Filelist_Filter *filter);
+void ewl_filelist_filter_set(Ewl_Filelist *fl,
+ Ewl_Filelist_Filter *filter);
Ewl_Filelist_Filter *ewl_filelist_filter_get(Ewl_Filelist *fl);
-void ewl_filelist_view_set(Ewl_Filelist *fl,
- Ewl_Filelist_View view);
+void ewl_filelist_view_set(Ewl_Filelist *fl,
+ Ewl_Filelist_View view);
Ewl_Filelist_View *ewl_filelist_view_get(Ewl_Filelist *fl);
-void ewl_filelist_multiselect_set(Ewl_Filelist *fl,
- unsigned int ms);
+void ewl_filelist_multiselect_set(Ewl_Filelist *fl,
+ unsigned int ms);
unsigned int ewl_filelist_multiselect_get(Ewl_Filelist *fl);
-void ewl_filelist_show_dot_files_set(Ewl_Filelist *fl,
- unsigned int dot);
+void ewl_filelist_show_dot_files_set(Ewl_Filelist *fl,
+ unsigned int dot);
unsigned int ewl_filelist_show_dot_files_get(Ewl_Filelist *fl);
-void ewl_filelist_selected_file_set(Ewl_Filelist *fl,
- const char *file);
-char *ewl_filelist_selected_file_get(Ewl_Filelist *fl);
-char *ewl_filelist_size_get(off_t st_size);
-char *ewl_filelist_perms_get(mode_t st_mode);
-char *ewl_filelist_username_get(uid_t st_uid);
-char *ewl_filelist_groupname_get(gid_t st_gid);
-char *ewl_filelist_modtime_get(time_t modtime);
+void ewl_filelist_selected_file_set(Ewl_Filelist *fl,
+ const char *file);
+char *ewl_filelist_selected_file_get(Ewl_Filelist *fl);
+char *ewl_filelist_size_get(off_t st_size);
+char *ewl_filelist_perms_get(mode_t st_mode);
+char *ewl_filelist_username_get(uid_t st_uid);
+char *ewl_filelist_groupname_get(gid_t st_gid);
+char *ewl_filelist_modtime_get(time_t modtime);
Ewl_Widget *ewl_filelist_selected_file_preview_get(Ewl_Filelist *fl,
- const char *path);
+ const char *path);
Ewl_Widget *ewl_filelist_multi_select_preview_get(Ewl_Filelist *fl);
-void ewl_filelist_selected_files_set(Ewl_Filelist *fl,
- Ecore_List *files);
+void ewl_filelist_selected_files_set(Ewl_Filelist *fl,
+ Ecore_List *files);
Ecore_List *ewl_filelist_selected_files_get(Ewl_Filelist *fl);
-void ewl_filelist_selected_files_change_notify(Ewl_Filelist *fl);
+void ewl_filelist_selected_files_change_notify(Ewl_Filelist *fl);
-void ewl_filelist_selected_signal_all(Ewl_Filelist *fl,
- const char *signal);
+void ewl_filelist_selected_signal_all(Ewl_Filelist *fl,
+ const char *signal);
-void ewl_filelist_vscroll_flag_set(Ewl_Filelist *fl,
- Ewl_Scrollpane_Flags v);
+void ewl_filelist_vscroll_flag_set(Ewl_Filelist *fl,
+ Ewl_Scrollpane_Flags v);
Ewl_Scrollpane_Flags ewl_filelist_vscroll_flag_get(Ewl_Filelist *fl);
-void ewl_filelist_hscroll_flag_set(Ewl_Filelist *fl,
- Ewl_Scrollpane_Flags h);
+void ewl_filelist_hscroll_flag_set(Ewl_Filelist *fl,
+ Ewl_Scrollpane_Flags h);
Ewl_Scrollpane_Flags ewl_filelist_hscroll_flag_get(Ewl_Filelist *fl);
const char *ewl_filelist_stock_icon_get(const char *path);
-char *ewl_filelist_expand_path(Ewl_Filelist *fl, const char *dir);
+char *ewl_filelist_expand_path(Ewl_Filelist *fl, const char *dir);
/*
* Internally used functions, override at your own risk
diff --git a/src/lib/ewl_filelist_model.c b/src/lib/ewl_filelist_model.c
index 13bf9d9..bf35264 100644
--- a/src/lib/ewl_filelist_model.c
+++ b/src/lib/ewl_filelist_model.c
@@ -10,14 +10,14 @@
#include <fnmatch.h>
static int ewl_filelist_model_data_name_sort(Ewl_Filelist_File *file1,
- Ewl_Filelist_File *file2);
+ Ewl_Filelist_File *file2);
static int ewl_filelist_model_data_size_sort(Ewl_Filelist_File *file1,
- Ewl_Filelist_File *file2);
+ Ewl_Filelist_File *file2);
static void free_file(Ewl_Filelist_File *file);
void ewl_filelist_model_filter(Ewl_Filelist_Directory *dir);
static unsigned int ewl_filelist_model_filter_main
- (Ewl_Filelist_Directory *dir,
- Ewl_Filelist_File *file);
+ (Ewl_Filelist_Directory *dir,
+ Ewl_Filelist_File *file);
/**
* @param path: The path to the directory to read
@@ -29,9 +29,9 @@ static unsigned int ewl_filelist_model_filter_main
*/
Ewl_Filelist_Directory *
ewl_filelist_model_directory_new(const char *path,
- unsigned char show_dot,
- unsigned int show_dot_dot,
- Ewl_Filelist_Filter *filter)
+ unsigned char show_dot,
+ unsigned int show_dot_dot,
+ Ewl_Filelist_Filter *filter)
{
Ewl_Filelist_Directory *dir;
Ewl_Filelist_File *file;
@@ -51,54 +51,54 @@ ewl_filelist_model_directory_new(const char *path,
all_files = ecore_file_ls(path);
if (!all_files)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
/* Add in the ".." entry for now */
if ((show_dot_dot) && (strcmp(path, "/")))
- ecore_list_prepend(all_files, strdup(path));
+ ecore_list_prepend(all_files, strdup(path));
while ((file_temp = ecore_list_first_remove(all_files)))
{
- /* allocate the memory for the file structure */
- file = NEW(Ewl_Filelist_File, 1);
-
- /* test for .. */
- if (strcmp(file_temp, path))
- {
- snprintf(filename, PATH_MAX, "%s/%s", path,
- file_temp);
- file->name = ecore_string_instance(file_temp);
- }
- else
- {
- snprintf(filename, PATH_MAX, "%s", file_temp);
- file->name = ecore_string_instance("..");
- }
-
- /* info about the filename */
- stat(filename, &st);
- file->size = st.st_size;
- file->modtime = st.st_mtime;
- file->mode = st.st_mode;
- file->groupname = st.st_gid;
- file->username = st.st_uid;
- file->is_dir = ecore_file_is_dir(filename);
- file->readable = ecore_file_can_read(filename);
- file->writeable = ecore_file_can_write(filename);
-
- if ((file->is_dir))
- {
- ecore_list_append(dirs, file);
- nd = nd + 1;
- }
-
- else
- {
- ecore_list_append(files, file);
- nf = nf + 1;
- }
-
- FREE(file_temp);
+ /* allocate the memory for the file structure */
+ file = NEW(Ewl_Filelist_File, 1);
+
+ /* test for .. */
+ if (strcmp(file_temp, path))
+ {
+ snprintf(filename, PATH_MAX, "%s/%s", path,
+ file_temp);
+ file->name = ecore_string_instance(file_temp);
+ }
+ else
+ {
+ snprintf(filename, PATH_MAX, "%s", file_temp);
+ file->name = ecore_string_instance("..");
+ }
+
+ /* info about the filename */
+ stat(filename, &st);
+ file->size = st.st_size;
+ file->modtime = st.st_mtime;
+ file->mode = st.st_mode;
+ file->groupname = st.st_gid;
+ file->username = st.st_uid;
+ file->is_dir = ecore_file_is_dir(filename);
+ file->readable = ecore_file_can_read(filename);
+ file->writeable = ecore_file_can_write(filename);
+
+ if ((file->is_dir))
+ {
+ ecore_list_append(dirs, file);
+ nd = nd + 1;
+ }
+
+ else
+ {
+ ecore_list_append(files, file);
+ nf = nf + 1;
+ }
+
+ FREE(file_temp);
}
/* create the new directory structure */
@@ -127,7 +127,7 @@ ewl_filelist_model_directory_new(const char *path,
*/
int
ewl_filelist_model_column_sortable(void *data __UNUSED__,
- unsigned int column)
+ unsigned int column)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DRETURN_INT(((column == 0) || (column == 1)), DLEVEL_STABLE);
@@ -152,7 +152,7 @@ ewl_filelist_model_data_count(void *data)
*/
void *
ewl_filelist_model_data_fetch(void *data, unsigned int row,
- unsigned int column)
+ unsigned int column)
{
Ewl_Filelist_Directory *fld;
Ewl_Filelist_File *file;
@@ -167,26 +167,26 @@ ewl_filelist_model_data_fetch(void *data, unsigned int row,
/* Check if in dirs or files list */
if (row < fld->num_dirs)
- file = ecore_list_index_goto(fld->dirs, row);
+ file = ecore_list_index_goto(fld->dirs, row);
else
{
- i = (row - fld->num_dirs);
- file = ecore_list_index_goto(fld->files, i);
+ i = (row - fld->num_dirs);
+ file = ecore_list_index_goto(fld->files, i);
}
if ((column == 0) && (strcmp(file->name, "..")))
{
- snprintf(path, PATH_MAX, "%s/%s", fld->name, file->name);
- ret = strdup(path);
+ snprintf(path, PATH_MAX, "%s/%s", fld->name, file->name);
+ ret = strdup(path);
}
else if (column == 1) ret = ewl_filelist_size_get(file->size);
else if (column == 2) ret = ewl_filelist_perms_get(file->mode);
else if (column == 3) ret = ewl_filelist_username_get
- (file->username);
+ (file->username);
else if (column == 4) ret = ewl_filelist_groupname_get
- (file->groupname);
+ (file->groupname);
else if (column == 5) ret = ewl_filelist_modtime_get
- (file->modtime);
+ (file->modtime);
else ret = strdup(file->name);
/* ret needs to be freed by the view or with model_data_free_set */
@@ -198,7 +198,7 @@ ewl_filelist_model_data_fetch(void *data, unsigned int row,
*/
void
ewl_filelist_model_data_sort(void *data, unsigned int column,
- Ewl_Sort_Direction sort)
+ Ewl_Sort_Direction sort)
{
Ewl_Filelist_Directory *fld = data;
@@ -209,68 +209,68 @@ ewl_filelist_model_data_sort(void *data, unsigned int column,
DCHECK_PARAM_PTR(sort);
if (sort == EWL_SORT_DIRECTION_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* Remove .. entry to add in later */
if (fld->num_dirs != 0)
{
- file = ecore_list_first(fld->dirs);
- if (!strcmp(file->name, ".."))
- root = ecore_list_first_remove(fld->dirs);
+ file = ecore_list_first(fld->dirs);
+ if (!strcmp(file->name, ".."))
+ root = ecore_list_first_remove(fld->dirs);
}
if (column == 0)
{
- if (sort == EWL_SORT_DIRECTION_ASCENDING)
- {
- ecore_list_sort(fld->dirs,
- ECORE_COMPARE_CB
- (ewl_filelist_model_data_name_sort),
- ECORE_SORT_MIN);
-
- ecore_list_sort(fld->files,
- ECORE_COMPARE_CB
- (ewl_filelist_model_data_name_sort),
- ECORE_SORT_MIN);
- }
-
- else if (sort == EWL_SORT_DIRECTION_DESCENDING)
- {
- ecore_list_sort(fld->dirs,
- ECORE_COMPARE_CB
- (ewl_filelist_model_data_name_sort),
- ECORE_SORT_MAX);
-
- ecore_list_sort(fld->files,
- ECORE_COMPARE_CB
- (ewl_filelist_model_data_name_sort),
- ECORE_SORT_MAX);
- }
+ if (sort == EWL_SORT_DIRECTION_ASCENDING)
+ {
+ ecore_list_sort(fld->dirs,
+ ECORE_COMPARE_CB
+ (ewl_filelist_model_data_name_sort),
+ ECORE_SORT_MIN);
+
+ ecore_list_sort(fld->files,
+ ECORE_COMPARE_CB
+ (ewl_filelist_model_data_name_sort),
+ ECORE_SORT_MIN);
+ }
+
+ else if (sort == EWL_SORT_DIRECTION_DESCENDING)
+ {
+ ecore_list_sort(fld->dirs,
+ ECORE_COMPARE_CB
+ (ewl_filelist_model_data_name_sort),
+ ECORE_SORT_MAX);
+
+ ecore_list_sort(fld->files,
+ ECORE_COMPARE_CB
+ (ewl_filelist_model_data_name_sort),
+ ECORE_SORT_MAX);
+ }
}
/* size sort does nothing for directories so don't sort dirs */
else if (column == 1)
{
- if (sort == EWL_SORT_DIRECTION_ASCENDING)
- {
- ecore_list_sort(fld->files,
- ECORE_COMPARE_CB
- (ewl_filelist_model_data_size_sort),
- ECORE_SORT_MIN);
- }
-
- else if (sort == EWL_SORT_DIRECTION_DESCENDING)
- {
- ecore_list_sort(fld->files,
- ECORE_COMPARE_CB
- (ewl_filelist_model_data_size_sort),
- ECORE_SORT_MAX);
- }
+ if (sort == EWL_SORT_DIRECTION_ASCENDING)
+ {
+ ecore_list_sort(fld->files,
+ ECORE_COMPARE_CB
+ (ewl_filelist_model_data_size_sort),
+ ECORE_SORT_MIN);
+ }
+
+ else if (sort == EWL_SORT_DIRECTION_DESCENDING)
+ {
+ ecore_list_sort(fld->files,
+ ECORE_COMPARE_CB
+ (ewl_filelist_model_data_size_sort),
+ ECORE_SORT_MAX);
+ }
}
/* Put .. entry back in */
if (root)
- ecore_list_prepend(fld->dirs, root);
+ ecore_list_prepend(fld->dirs, root);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -280,7 +280,7 @@ ewl_filelist_model_data_sort(void *data, unsigned int column,
*/
static int
ewl_filelist_model_data_name_sort(Ewl_Filelist_File *file1,
- Ewl_Filelist_File *file2)
+ Ewl_Filelist_File *file2)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(file1, 0);
@@ -293,7 +293,7 @@ ewl_filelist_model_data_name_sort(Ewl_Filelist_File *file1,
*/
static int
ewl_filelist_model_data_size_sort(Ewl_Filelist_File *file1,
- Ewl_Filelist_File *file2)
+ Ewl_Filelist_File *file2)
{
int ret;
@@ -302,9 +302,9 @@ ewl_filelist_model_data_size_sort(Ewl_Filelist_File *file1,
DCHECK_PARAM_PTR_RET(file2, 0);
if (file1->size > file2->size)
- ret = 1;
+ ret = 1;
else if (file1->size < file2->size)
- ret = -1;
+ ret = -1;
else ret = 0;
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -323,11 +323,11 @@ ewl_filelist_model_data_expandable_get(void *data, unsigned int row)
DCHECK_PARAM_PTR_RET(data, 0);
if (row >= fld->num_dirs)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
file = ecore_list_index_goto(fld->dirs, row);
if (!strcmp(file->name, ".."))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -337,7 +337,7 @@ ewl_filelist_model_data_expandable_get(void *data, unsigned int row)
*/
void *
ewl_filelist_model_data_expansion_data_fetch(void *data,
- unsigned int parent)
+ unsigned int parent)
{
char path[PATH_MAX];
Ewl_Filelist_File *file;
@@ -349,8 +349,8 @@ ewl_filelist_model_data_expansion_data_fetch(void *data,
file = ecore_list_index_goto(fld->dirs, parent);
snprintf(path, PATH_MAX, "%s/%s", fld->name, file->name);
subdir = ewl_filelist_model_directory_new
- (path, fld->show_dot,
- FALSE, fld->filter);
+ (path, fld->show_dot,
+ FALSE, fld->filter);
DRETURN_PTR(subdir, DLEVEL_STABLE);
}
@@ -399,14 +399,14 @@ static void free_file(Ewl_Filelist_File *file)
*/
unsigned int
ewl_filelist_model_show_dot_files_set(Ewl_Filelist_Directory *dir,
- unsigned int show_dot)
+ unsigned int show_dot)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(dir, FALSE);
/* If nothing has changed, leave */
if (show_dot == !!dir->show_dot)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
/* Else set value in */
dir->show_dot = !!show_dot;
@@ -453,41 +453,41 @@ ewl_filelist_model_filter(Ewl_Filelist_Directory *dir)
if (!dir->show_dot)
{
- /* Run through files and filter hidden first, then others */
- ecore_list_first_goto(dir->rfiles);
- while ((file = ecore_list_next(dir->rfiles)))
- {
- ret = ewl_filelist_model_filter_main(dir, file);
- if ((file->name[0] != '.') && (ret))
- ecore_list_append(dir->files, file);
-
- }
-
- /* Now directories */
- ecore_list_first_goto(dir->rdirs);
- while ((file = ecore_list_next(dir->rdirs)))
- {
- if ((file->name[0] != '.') ||
- (!strcmp(file->name, "..")))
- ecore_list_append(dir->dirs, file);
- }
+ /* Run through files and filter hidden first, then others */
+ ecore_list_first_goto(dir->rfiles);
+ while ((file = ecore_list_next(dir->rfiles)))
+ {
+ ret = ewl_filelist_model_filter_main(dir, file);
+ if ((file->name[0] != '.') && (ret))
+ ecore_list_append(dir->files, file);
+
+ }
+
+ /* Now directories */
+ ecore_list_first_goto(dir->rdirs);
+ while ((file = ecore_list_next(dir->rdirs)))
+ {
+ if ((file->name[0] != '.') ||
+ (!strcmp(file->name, "..")))
+ ecore_list_append(dir->dirs, file);
+ }
}
/* If showing hidden */
else
{
- /* Still loop through to check if pass filter */
- ecore_list_first_goto(dir->rfiles);
- while ((file = ecore_list_next(dir->rfiles)))
- {
- ret = ewl_filelist_model_filter_main(dir, file);
- if (ret)
- ecore_list_append(dir->files, file);
- }
-
- ecore_list_first_goto(dir->rdirs);
- while ((file = ecore_list_next(dir->rdirs)))
- ecore_list_append(dir->dirs, file);
+ /* Still loop through to check if pass filter */
+ ecore_list_first_goto(dir->rfiles);
+ while ((file = ecore_list_next(dir->rfiles)))
+ {
+ ret = ewl_filelist_model_filter_main(dir, file);
+ if (ret)
+ ecore_list_append(dir->files, file);
+ }
+
+ ecore_list_first_goto(dir->rdirs);
+ while ((file = ecore_list_next(dir->rdirs)))
+ ecore_list_append(dir->dirs, file);
}
@@ -506,7 +506,7 @@ ewl_filelist_model_filter(Ewl_Filelist_Directory *dir)
*/
unsigned int
ewl_filelist_model_filter_set(Ewl_Filelist_Directory *dir,
- Ewl_Filelist_Filter *filter)
+ Ewl_Filelist_Filter *filter)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(dir, FALSE);
@@ -514,8 +514,8 @@ ewl_filelist_model_filter_set(Ewl_Filelist_Directory *dir,
/* If nothing has changed, leave */
if ((dir->filter) && (!memcmp(dir->filter, filter,
- sizeof(dir->filter))))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ sizeof(dir->filter))))
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
/* Set the filter and call the function */
dir->filter = filter;
@@ -546,7 +546,7 @@ ewl_filelist_model_filter_get(Ewl_Filelist_Directory *dir)
*/
static unsigned int
ewl_filelist_model_filter_main(Ewl_Filelist_Directory *dir,
- Ewl_Filelist_File *file)
+ Ewl_Filelist_File *file)
{
Ewl_Filelist_Filter *filter = dir->filter;
const char *mime_check;
@@ -558,32 +558,32 @@ ewl_filelist_model_filter_main(Ewl_Filelist_Directory *dir,
/* If there's no filter return all files */
if (!filter)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
/* First check mime types */
if (filter->mime_list)
{
- mime_check = ewl_io_manager_uri_mime_type_get(file->name);
- ecore_list_first_goto(filter->mime_list);
- while ((mime_given = ecore_list_next(filter->mime_list)))
- {
- if ((mime_check) && (!strcmp(mime_given,
- mime_check)))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
- }
+ mime_check = ewl_io_manager_uri_mime_type_get(file->name);
+ ecore_list_first_goto(filter->mime_list);
+ while ((mime_given = ecore_list_next(filter->mime_list)))
+ {
+ if ((mime_check) && (!strcmp(mime_given,
+ mime_check)))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+ }
}
/* Next check extension */
else if (filter->extension)
{
- if (!fnmatch(filter->extension, file->name, 0))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ if (!fnmatch(filter->extension, file->name, 0))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
}
/* If no filter at all is in effect */
else if ((!filter->extension) && (!filter->mime_list))
{
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
diff --git a/src/lib/ewl_filelist_model.h b/src/lib/ewl_filelist_model.h
index 9131c00..c562706 100644
--- a/src/lib/ewl_filelist_model.h
+++ b/src/lib/ewl_filelist_model.h
@@ -10,30 +10,30 @@
*/
Ewl_Filelist_Directory *ewl_filelist_model_directory_new(const char *path,
- unsigned char show_dot,
- unsigned int show_dot_dot,
- Ewl_Filelist_Filter *filter);
+ unsigned char show_dot,
+ unsigned int show_dot_dot,
+ Ewl_Filelist_Filter *filter);
unsigned int ewl_filelist_model_data_count(void *data);
void *ewl_filelist_model_data_fetch(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
void ewl_filelist_model_data_sort(void *data, unsigned int column,
- Ewl_Sort_Direction sort);
+ Ewl_Sort_Direction sort);
int ewl_filelist_model_data_expandable_get(void *data,
- unsigned int row);
+ unsigned int row);
void *ewl_filelist_model_data_expansion_data_fetch(void *data,
- unsigned int parent);
+ unsigned int parent);
unsigned int ewl_filelist_model_data_unref(void *data);
int ewl_filelist_model_column_sortable(void *data,
- unsigned int column);
+ unsigned int column);
unsigned int ewl_filelist_model_show_dot_files_set(Ewl_Filelist_Directory *dir,
- unsigned int show_dot);
+ unsigned int show_dot);
unsigned int ewl_filelist_model_show_dot_files_get(Ewl_Filelist_Directory *dir);
unsigned int ewl_filelist_model_filter_set(Ewl_Filelist_Directory *dir,
- Ewl_Filelist_Filter *filter);
+ Ewl_Filelist_Filter *filter);
Ewl_Filelist_Filter *ewl_filelist_model_filter_get
- (Ewl_Filelist_Directory *dir);
+ (Ewl_Filelist_Directory *dir);
/**
* @}
diff --git a/src/lib/ewl_filelist_view.c b/src/lib/ewl_filelist_view.c
index 70220f6..53293b3 100644
--- a/src/lib/ewl_filelist_view.c
+++ b/src/lib/ewl_filelist_view.c
@@ -10,7 +10,7 @@
#include "ewl_debug.h"
Ewl_Widget *ewl_filelist_view_widget_fetch(void *data,
- unsigned int row __UNUSED__, unsigned int column)
+ unsigned int row __UNUSED__, unsigned int column)
{
Ewl_Widget *ret;
const char *img = NULL, *stock, *filename;
@@ -22,31 +22,31 @@ Ewl_Widget *ewl_filelist_view_widget_fetch(void *data,
ret = ewl_icon_simple_new();
ewl_icon_constrain_set(EWL_ICON(ret), EWL_ICON_SIZE_MEDIUM);
ewl_box_orientation_set(EWL_BOX(ret),
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
ewl_object_alignment_set(EWL_OBJECT(ret), EWL_FLAG_ALIGN_LEFT);
/* Get and set data into icon */
if (column == 0)
{
- if (!strcmp(data, ".."))
- img = ewl_icon_theme_icon_path_get
- (EWL_ICON_GO_UP,
- EWL_ICON_SIZE_MEDIUM);
- else
- {
- stock = ewl_filelist_stock_icon_get(data);
- img = ewl_icon_theme_icon_path_get(stock,
- EWL_ICON_SIZE_MEDIUM);
- }
- if (img) ewl_icon_image_set(EWL_ICON(ret),
- img, NULL);
+ if (!strcmp(data, ".."))
+ img = ewl_icon_theme_icon_path_get
+ (EWL_ICON_GO_UP,
+ EWL_ICON_SIZE_MEDIUM);
+ else
+ {
+ stock = ewl_filelist_stock_icon_get(data);
+ img = ewl_icon_theme_icon_path_get(stock,
+ EWL_ICON_SIZE_MEDIUM);
+ }
+ if (img) ewl_icon_image_set(EWL_ICON(ret),
+ img, NULL);
- filename = ecore_file_file_get(data);
- ewl_icon_label_set(EWL_ICON(ret), filename);
+ filename = ecore_file_file_get(data);
+ ewl_icon_label_set(EWL_ICON(ret), filename);
}
else
{
- ewl_icon_label_set(EWL_ICON(ret), data);
+ ewl_icon_label_set(EWL_ICON(ret), data);
}
FREE(data);
@@ -56,7 +56,7 @@ Ewl_Widget *ewl_filelist_view_widget_fetch(void *data,
}
Ewl_Widget *ewl_filelist_view_header_fetch(void *data __UNUSED__,
- unsigned int column)
+ unsigned int column)
{
Ewl_Widget *l;
char *t;
diff --git a/src/lib/ewl_filelist_view.h b/src/lib/ewl_filelist_view.h
index 2ff2b67..16a788d 100644
--- a/src/lib/ewl_filelist_view.h
+++ b/src/lib/ewl_filelist_view.h
@@ -9,7 +9,7 @@
*/
Ewl_Widget *ewl_filelist_view_widget_fetch(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
Ewl_Widget *ewl_filelist_view_header_fetch(void *data, unsigned int column);
/**
diff --git a/src/lib/ewl_filepicker.c b/src/lib/ewl_filepicker.c
index f70a2b2..4416ec9 100644
--- a/src/lib/ewl_filepicker.c
+++ b/src/lib/ewl_filepicker.c
@@ -31,38 +31,38 @@ struct Ewl_Filepicker_Dialog
static void ewl_filepicker_favorites_populate(Ewl_Filepicker *fp);
static void ewl_filepicker_cb_list_value_changed(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_button_clicked(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_destroy(Ewl_Widget *w, void *ev, void *data);
static void ewl_filepicker_path_populate(Ewl_Filepicker *fp, char *path);
static void ewl_filepicker_cb_path_change(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_filter_change(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_path_entry_change(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_type_change(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_dir_new(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_dialog_response(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_filepicker_cb_dialog_delete(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void *ewl_filepicker_cb_type_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
static unsigned int ewl_filepicker_cb_type_count(void *data);
static Ewl_Widget *ewl_filepicker_cb_type_header(void *data, unsigned int col);
static void *ewl_filepicker_cb_path_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
static unsigned int ewl_filepicker_cb_path_count(void *data);
static Ewl_Widget *ewl_filepicker_cb_path_header(void *data,
- unsigned int col);
+ unsigned int col);
static void ewl_filepicker_filter_free_cb(Ewl_Filelist_Filter *filter);
static void ewl_filepicker_type_change(Ewl_Filepicker *fp);
@@ -81,12 +81,12 @@ ewl_filepicker_new(void)
w = NEW(Ewl_Filepicker, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_filepicker_init(EWL_FILEPICKER(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -107,7 +107,7 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
DCHECK_PARAM_PTR_RET(fp, FALSE);
if (!ewl_box_init(EWL_BOX(fp)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
fp->ret_dir = TRUE;
ewl_box_orientation_set(EWL_BOX(fp), EWL_ORIENTATION_VERTICAL);
@@ -115,19 +115,19 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
ewl_widget_appearance_set(EWL_WIDGET(fp), EWL_FILEPICKER_TYPE);
ewl_callback_prepend(EWL_WIDGET(fp), EWL_CALLBACK_DESTROY,
- ewl_filepicker_cb_destroy, NULL);
+ ewl_filepicker_cb_destroy, NULL);
ewl_object_preferred_inner_size_set(EWL_OBJECT(fp), 400, 300);
fp->mvc_path.model = ewl_model_new();
ewl_model_data_fetch_set(fp->mvc_path.model,
- ewl_filepicker_cb_path_fetch);
+ ewl_filepicker_cb_path_fetch);
ewl_model_data_count_set(fp->mvc_path.model,
- ewl_filepicker_cb_path_count);
+ ewl_filepicker_cb_path_count);
fp->mvc_path.view = ewl_label_view_get();
ewl_view_header_fetch_set(fp->mvc_path.view,
- ewl_filepicker_cb_path_header);
+ ewl_filepicker_cb_path_header);
fp->path = ecore_list_new();
ecore_list_free_cb_set(fp->path, ECORE_FREE_CB(free));
@@ -135,37 +135,37 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
box = ewl_htoolbar_new();
ewl_container_child_append(EWL_CONTAINER(fp), box);
ewl_object_fill_policy_set(EWL_OBJECT(box),
- EWL_FLAG_FILL_NONE | EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_NONE | EWL_FLAG_FILL_HFILL);
ewl_widget_show(box);
fp->dir_button = ewl_icon_new();
ewl_icon_alt_text_set(EWL_ICON(fp->dir_button), "New Directory");
path = ewl_icon_theme_icon_path_get(EWL_ICON_FOLDER_NEW,
- EWL_ICON_SIZE_MEDIUM);
+ EWL_ICON_SIZE_MEDIUM);
if (path)
- ewl_icon_image_set(EWL_ICON(fp->dir_button), path, NULL);
+ ewl_icon_image_set(EWL_ICON(fp->dir_button), path, NULL);
ewl_callback_append(fp->dir_button, EWL_CALLBACK_CLICKED,
- ewl_filepicker_cb_dir_new, fp);
+ ewl_filepicker_cb_dir_new, fp);
ewl_container_child_append(EWL_CONTAINER(box), fp->dir_button);
ewl_object_fill_policy_set(EWL_OBJECT(fp->dir_button),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_widget_show(fp->dir_button);
fp->mvc_path.combo = ewl_combo_new();
ewl_combo_editable_set(EWL_COMBO(fp->mvc_path.combo), TRUE);
ewl_container_child_prepend(EWL_CONTAINER(box),
- fp->mvc_path.combo);
+ fp->mvc_path.combo);
ewl_mvc_model_set(EWL_MVC(fp->mvc_path.combo),
- fp->mvc_path.model);
+ fp->mvc_path.model);
ewl_mvc_view_set(EWL_MVC(fp->mvc_path.combo),
- fp->mvc_path.view);
+ fp->mvc_path.view);
ewl_mvc_data_set(EWL_MVC(fp->mvc_path.combo), fp);
ewl_callback_append(fp->mvc_path.combo,
- EWL_CALLBACK_VALUE_CHANGED,
- ewl_filepicker_cb_path_change, fp);
+ EWL_CALLBACK_VALUE_CHANGED,
+ ewl_filepicker_cb_path_change, fp);
ewl_object_fill_policy_set(EWL_OBJECT(fp->mvc_path.combo),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_widget_show(fp->mvc_path.combo);
o = ewl_hbox_new();
@@ -175,16 +175,16 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
fp->favorites_box = ewl_vbox_new();
ewl_container_child_append(EWL_CONTAINER(o), fp->favorites_box);
ewl_object_fill_policy_set(EWL_OBJECT(fp->favorites_box),
- EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
+ EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
ewl_filepicker_favorites_populate(fp);
ewl_filepicker_show_favorites_set(fp, FALSE);
fp->file_list = ewl_filelist_new();
ewl_container_child_append(EWL_CONTAINER(o), fp->file_list);
ewl_callback_append(EWL_WIDGET(fp->file_list),
- EWL_CALLBACK_VALUE_CHANGED,
- ewl_filepicker_cb_list_value_changed,
- fp);
+ EWL_CALLBACK_VALUE_CHANGED,
+ ewl_filepicker_cb_list_value_changed,
+ fp);
ewl_widget_show(fp->file_list);
o = ewl_hbox_new();
@@ -194,7 +194,7 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
box = ewl_vbox_new();
ewl_container_child_append(EWL_CONTAINER(o), box);
ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_widget_show(box);
fp->file_entry = ewl_entry_new();
@@ -203,32 +203,32 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
fp->filters = ecore_list_new();
ecore_list_free_cb_set(fp->filters,
- ECORE_FREE_CB(ewl_filepicker_filter_free_cb));
+ ECORE_FREE_CB(ewl_filepicker_filter_free_cb));
fp->mvc_filters.model = ewl_model_new();
ewl_model_data_fetch_set(fp->mvc_filters.model,
- ewl_filepicker_cb_type_fetch);
+ ewl_filepicker_cb_type_fetch);
ewl_model_data_count_set(fp->mvc_filters.model,
- ewl_filepicker_cb_type_count);
+ ewl_filepicker_cb_type_count);
fp->mvc_filters.view = ewl_label_view_get();
ewl_view_header_fetch_set(fp->mvc_filters.view,
- ewl_filepicker_cb_type_header);
+ ewl_filepicker_cb_type_header);
fp->mvc_filters.combo = ewl_combo_new();
ewl_mvc_model_set(EWL_MVC(fp->mvc_filters.combo),
- fp->mvc_filters.model);
+ fp->mvc_filters.model);
ewl_mvc_view_set(EWL_MVC(fp->mvc_filters.combo),
- fp->mvc_filters.view);
+ fp->mvc_filters.view);
ewl_mvc_data_set(EWL_MVC(fp->mvc_filters.combo), fp);
ewl_combo_editable_set(EWL_COMBO(fp->mvc_filters.combo), TRUE);
ewl_callback_append(fp->mvc_filters.combo,
- EWL_CALLBACK_VALUE_CHANGED,
- ewl_filepicker_cb_type_change, fp);
+ EWL_CALLBACK_VALUE_CHANGED,
+ ewl_filepicker_cb_type_change, fp);
ewl_container_child_append(EWL_CONTAINER(box),
- fp->mvc_filters.combo);
+ fp->mvc_filters.combo);
ewl_object_fill_policy_set(EWL_OBJECT(fp->mvc_filters.combo),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_widget_show(fp->mvc_filters.combo);
box = ewl_vbox_new();
@@ -240,16 +240,16 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
ewl_container_child_append(EWL_CONTAINER(box), fp->ret_button);
ewl_stock_type_set(EWL_STOCK(fp->ret_button), EWL_STOCK_OPEN);
ewl_callback_append(fp->ret_button, EWL_CALLBACK_CLICKED,
- ewl_filepicker_cb_button_clicked, fp);
+ ewl_filepicker_cb_button_clicked, fp);
ewl_object_fill_policy_set(EWL_OBJECT(fp->ret_button),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_widget_show(fp->ret_button);
o = ewl_button_new();
ewl_container_child_append(EWL_CONTAINER(box), o);
ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_CANCEL);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filepicker_cb_button_clicked, fp);
+ ewl_filepicker_cb_button_clicked, fp);
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
ewl_widget_show(o);
@@ -257,7 +257,7 @@ ewl_filepicker_init(Ewl_Filepicker *fp)
ewl_filepicker_filter_add(fp, "All files", NULL, NULL);
ewl_filepicker_directory_set(fp, NULL);
ewl_mvc_selected_set(EWL_MVC(fp->mvc_filters.combo),
- NULL, fp, 0, 0);
+ NULL, fp, 0, 0);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -294,14 +294,14 @@ ewl_filepicker_type_change(Ewl_Filepicker *fp)
if (fp->saveas_dialog)
{
- ewl_widget_enable(fp->file_entry);
- ewl_stock_type_set(EWL_STOCK(fp->ret_button), EWL_STOCK_SAVE);
+ ewl_widget_enable(fp->file_entry);
+ ewl_stock_type_set(EWL_STOCK(fp->ret_button), EWL_STOCK_SAVE);
}
else
{
- if (ewl_filelist_multiselect_get(EWL_FILELIST(fp->file_list)))
- ewl_widget_disable(fp->file_entry);
- ewl_stock_type_set(EWL_STOCK(fp->ret_button), EWL_STOCK_OPEN);
+ if (ewl_filelist_multiselect_get(EWL_FILELIST(fp->file_list)))
+ ewl_widget_disable(fp->file_entry);
+ ewl_stock_type_set(EWL_STOCK(fp->ret_button), EWL_STOCK_OPEN);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -321,7 +321,7 @@ ewl_filepicker_save_as_set(Ewl_Filepicker *fp, unsigned int t)
DCHECK_TYPE(fp, EWL_FILEPICKER_TYPE);
if (fp->saveas_dialog == t)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fp->saveas_dialog = !!t;
ewl_filepicker_type_change(fp);
@@ -390,13 +390,13 @@ ewl_filepicker_show_favorites_set(Ewl_Filepicker *fp, unsigned int show)
DCHECK_TYPE(fp, EWL_FILEPICKER_TYPE);
if (show == fp->show_favorites)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fp->show_favorites = !!show;
if (fp->show_favorites)
- ewl_widget_show(fp->favorites_box);
+ ewl_widget_show(fp->favorites_box);
else
- ewl_widget_hide(fp->favorites_box);
+ ewl_widget_hide(fp->favorites_box);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -434,7 +434,7 @@ ewl_filepicker_list_view_set(Ewl_Filepicker *fp, Ewl_Filelist_View view)
temp = EWL_FILELIST(fp->file_list);
if (temp->view_flag == view)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_filelist_view_set(EWL_FILELIST(fp->file_list), view);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -452,7 +452,7 @@ ewl_filepicker_list_view_get(Ewl_Filepicker *fp)
DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, NULL);
DRETURN_PTR(ewl_filelist_view_get(EWL_FILELIST(fp->file_list)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -474,25 +474,25 @@ ewl_filepicker_directory_set(Ewl_Filepicker *fp, const char *dir)
* and if that failes try /tmp and if that fails try / */
if (!dir)
{
- char *t;
+ char *t;
- t = getenv("HOME");
- if (t) tmp = strdup(t);
- else tmp = strdup("/tmp");
+ t = getenv("HOME");
+ if (t) tmp = strdup(t);
+ else tmp = strdup("/tmp");
- if (!ecore_file_exists(tmp))
- {
- FREE(tmp);
- tmp = strdup("/");
- }
+ if (!ecore_file_exists(tmp))
+ {
+ FREE(tmp);
+ tmp = strdup("/");
+ }
}
else
- tmp = strdup(dir);
+ tmp = strdup(dir);
if ((ecore_file_is_dir(tmp)) && (ecore_file_can_read(tmp)))
{
- ewl_filepicker_path_populate(fp, tmp);
- ewl_filelist_directory_set(EWL_FILELIST(fp->file_list), tmp);
+ ewl_filepicker_path_populate(fp, tmp);
+ ewl_filelist_directory_set(EWL_FILELIST(fp->file_list), tmp);
}
FREE(tmp);
@@ -513,7 +513,7 @@ ewl_filepicker_directory_get(Ewl_Filepicker *fp)
DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, NULL);
DRETURN_PTR(ewl_filelist_directory_get(EWL_FILELIST(fp->file_list)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -524,7 +524,7 @@ ewl_filepicker_directory_get(Ewl_Filepicker *fp)
*/
void
ewl_filepicker_filter_set(Ewl_Filepicker *fp,
- Ewl_Filelist_Filter *filter)
+ Ewl_Filelist_Filter *filter)
{
int idx;
@@ -533,7 +533,7 @@ ewl_filepicker_filter_set(Ewl_Filepicker *fp,
DCHECK_TYPE(fp, EWL_FILEPICKER_TYPE);
if (filter == ewl_filepicker_filter_get(fp))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ecore_list_goto(fp->filters, filter);
idx = ecore_list_index(fp->filters);
@@ -555,7 +555,7 @@ ewl_filepicker_filter_get(Ewl_Filepicker *fp)
DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, NULL);
DRETURN_PTR(ewl_filelist_filter_get(EWL_FILELIST(fp->file_list)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -589,7 +589,7 @@ ewl_filepicker_multiselect_get(Ewl_Filepicker *fp)
DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, FALSE);
DRETURN_INT(ewl_filelist_multiselect_get(EWL_FILELIST(fp->file_list)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -624,7 +624,7 @@ ewl_filepicker_show_dot_files_get(Ewl_Filepicker *fp)
DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, FALSE);
DRETURN_INT(ewl_filelist_show_dot_files_get(EWL_FILELIST(fp->file_list)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -666,38 +666,38 @@ ewl_filepicker_selected_file_get(Ewl_Filepicker *fp)
* selected array from the file list */
file = ewl_text_text_get(EWL_TEXT(fp->file_entry));
if (!file)
- ret = ewl_filelist_selected_file_get(EWL_FILELIST(fp->file_list));
+ ret = ewl_filelist_selected_file_get(EWL_FILELIST(fp->file_list));
else
{
- dir = ewl_filelist_directory_get(EWL_FILELIST(fp->file_list));
- file_len = strlen(file);
- if (file_len)
- {
- if (file[0] != '/')
- {
- dir_len = strlen(dir);
- if (dir_len == 1)
- dir_len = 0;
- len = dir_len + file_len + 2;
- ret = NEW(char, len);
- strcat(ret, dir);
- if (dir_len > 1)
- strcat(ret, "/");
- strcat(ret, file);
- }
- else
- {
- ret = file;
- file = NULL;
- }
- }
- else
- ret = NULL;
+ dir = ewl_filelist_directory_get(EWL_FILELIST(fp->file_list));
+ file_len = strlen(file);
+ if (file_len)
+ {
+ if (file[0] != '/')
+ {
+ dir_len = strlen(dir);
+ if (dir_len == 1)
+ dir_len = 0;
+ len = dir_len + file_len + 2;
+ ret = NEW(char, len);
+ strcat(ret, dir);
+ if (dir_len > 1)
+ strcat(ret, "/");
+ strcat(ret, file);
+ }
+ else
+ {
+ ret = file;
+ file = NULL;
+ }
+ }
+ else
+ ret = NULL;
}
IF_FREE(file);
if ((!fp->ret_dir) && (ret) && (ecore_file_is_dir(ret)))
- FREE(ret);
+ FREE(ret);
DRETURN_PTR(ret, DLEVEL_STABLE);
}
@@ -733,7 +733,7 @@ ewl_filepicker_selected_files_get(Ewl_Filepicker *fp)
DCHECK_TYPE_RET(fp, EWL_FILEPICKER_TYPE, NULL);
DRETURN_PTR(ewl_filelist_selected_files_get(EWL_FILELIST(fp->file_list)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -746,8 +746,8 @@ ewl_filepicker_selected_files_get(Ewl_Filepicker *fp)
*/
Ewl_Filelist_Filter *
ewl_filepicker_filter_add(Ewl_Filepicker *fp, const char *name,
- const char *extension,
- Ecore_List *mime_types)
+ const char *extension,
+ Ecore_List *mime_types)
{
Ewl_Filelist_Filter *f;
@@ -758,7 +758,7 @@ ewl_filepicker_filter_add(Ewl_Filepicker *fp, const char *name,
f= NEW(Ewl_Filelist_Filter, 1);
if (!f)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
f->name = strdup(name);
if (extension) f->extension = strdup(extension);
@@ -794,56 +794,56 @@ ewl_filepicker_cb_list_value_changed(Ewl_Widget *w, void *ev, void *data)
if (e->response == EWL_FILELIST_EVENT_DIR_CHANGE)
{
- char *dir;
+ char *dir;
- dir = strdup(ewl_filelist_directory_get(fl));
- ewl_filepicker_path_populate(fp, dir);
+ dir = strdup(ewl_filelist_directory_get(fl));
+ ewl_filepicker_path_populate(fp, dir);
- if (!ecore_file_can_write(dir))
- ewl_widget_disable(fp->dir_button);
- else
- ewl_widget_enable(fp->dir_button);
- ewl_text_clear(EWL_TEXT(fp->file_entry));
- FREE(dir);
+ if (!ecore_file_can_write(dir))
+ ewl_widget_disable(fp->dir_button);
+ else
+ ewl_widget_enable(fp->dir_button);
+ ewl_text_clear(EWL_TEXT(fp->file_entry));
+ FREE(dir);
}
else if (e->response == EWL_FILELIST_EVENT_SELECTION_CHANGE)
{
- if (ecore_file_is_dir(file))
- {
- if ((!fp->saveas_dialog) && (!fl->multiselect) &&
- (fp->ret_dir))
- ewl_text_text_set(EWL_TEXT(fp->file_entry),
- file);
- }
- else
- {
- if (!fl->multiselect)
- ewl_text_text_set(EWL_TEXT(fp->file_entry),
- ecore_file_file_get(file));
- }
+ if (ecore_file_is_dir(file))
+ {
+ if ((!fp->saveas_dialog) && (!fl->multiselect) &&
+ (fp->ret_dir))
+ ewl_text_text_set(EWL_TEXT(fp->file_entry),
+ file);
+ }
+ else
+ {
+ if (!fl->multiselect)
+ ewl_text_text_set(EWL_TEXT(fp->file_entry),
+ ecore_file_file_get(file));
+ }
}
else if ((e->response == EWL_FILELIST_EVENT_MULTI_TRUE) &&
- (!fp->saveas_dialog))
+ (!fp->saveas_dialog))
{
- ewl_widget_disable(fp->file_entry);
- ewl_text_clear(EWL_TEXT(fp->file_entry));
+ ewl_widget_disable(fp->file_entry);
+ ewl_text_clear(EWL_TEXT(fp->file_entry));
}
else if ((e->response == EWL_FILELIST_EVENT_MULTI_FALSE) &&
- (!fp->saveas_dialog))
+ (!fp->saveas_dialog))
{
- if ((ecore_file_is_dir(file)) && (fp->ret_dir))
- {
- ewl_text_text_set(EWL_TEXT(fp->file_entry),
- file);
- }
- else
- {
- ewl_text_text_set(EWL_TEXT(fp->file_entry),
- ecore_file_file_get(file));
- }
- ewl_widget_enable(fp->file_entry);
+ if ((ecore_file_is_dir(file)) && (fp->ret_dir))
+ {
+ ewl_text_text_set(EWL_TEXT(fp->file_entry),
+ file);
+ }
+ else
+ {
+ ewl_text_text_set(EWL_TEXT(fp->file_entry),
+ ecore_file_file_get(file));
+ }
+ ewl_widget_enable(fp->file_entry);
}
FREE(file);
@@ -853,7 +853,7 @@ ewl_filepicker_cb_list_value_changed(Ewl_Widget *w, void *ev, void *data)
static void
ewl_filepicker_cb_button_clicked(Ewl_Widget *w, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filepicker *fp;
Ewl_Stock *s;
@@ -871,11 +871,11 @@ ewl_filepicker_cb_button_clicked(Ewl_Widget *w, void *ev __UNUSED__,
if (e.response == EWL_STOCK_CANCEL)
{
- ewl_text_text_set(EWL_TEXT(fp->file_entry), NULL);
- ewl_filepicker_selected_file_set(fp, NULL);
+ ewl_text_text_set(EWL_TEXT(fp->file_entry), NULL);
+ ewl_filepicker_selected_file_set(fp, NULL);
}
ewl_callback_call_with_event_data(EWL_WIDGET(fp),
- EWL_CALLBACK_VALUE_CHANGED, &e);
+ EWL_CALLBACK_VALUE_CHANGED, &e);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -894,7 +894,7 @@ ewl_filepicker_favorites_populate(Ewl_Filepicker *fp)
static void *
ewl_filepicker_cb_type_fetch(void *data, unsigned int row,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Filepicker *fp;
Ewl_Filelist_Filter *filter;
@@ -937,16 +937,16 @@ ewl_filepicker_cb_type_header(void *data, unsigned int col)
w = ewl_entry_new();
if (filter)
- ewl_text_text_set(EWL_TEXT(w), filter->name);
+ ewl_text_text_set(EWL_TEXT(w), filter->name);
ewl_callback_append(w, EWL_CALLBACK_VALUE_CHANGED,
- ewl_filepicker_cb_filter_change, fp);
+ ewl_filepicker_cb_filter_change, fp);
DRETURN_PTR(w, DLEVEL_STABLE);
}
static void *
ewl_filepicker_cb_path_fetch(void *data, unsigned int row,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Filepicker *fp;
@@ -987,7 +987,7 @@ ewl_filepicker_cb_path_header(void *data, unsigned int col __UNUSED__)
entry = ewl_entry_new();
ewl_text_text_set(EWL_TEXT(entry), path);
ewl_callback_append(entry, EWL_CALLBACK_VALUE_CHANGED,
- ewl_filepicker_cb_path_entry_change, fp);
+ ewl_filepicker_cb_path_entry_change, fp);
DRETURN_PTR(entry, DLEVEL_STABLE);
}
@@ -1004,23 +1004,23 @@ ewl_filepicker_path_populate(Ewl_Filepicker *fp, char *path)
/* Clear the list and free the data first */
while ((p = ecore_list_first_remove(fp->path)))
- FREE(p);
+ FREE(p);
ecore_list_append(fp->path, strdup("/"));
p = path;
while ((t = strchr((p + 1), '/')))
{
- *t = '\0';
- ecore_list_prepend(fp->path, strdup(path));
+ *t = '\0';
+ ecore_list_prepend(fp->path, strdup(path));
- *t = '/';
- p = t;
+ *t = '/';
+ p = t;
}
/* do we have more stuff? if so, make sure we get the last path */
if (p && (*(p + 1) != '\0'))
- ecore_list_prepend(fp->path, strdup(path));
+ ecore_list_prepend(fp->path, strdup(path));
ewl_mvc_dirty_set(EWL_MVC(fp->mvc_path.combo), TRUE);
ewl_mvc_selected_set(EWL_MVC(fp->mvc_path.combo), NULL, fp->path, 0, 0);
@@ -1030,7 +1030,7 @@ ewl_filepicker_path_populate(Ewl_Filepicker *fp, char *path)
static void
ewl_filepicker_cb_path_change(Ewl_Widget *w, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filepicker *fp;
Ewl_Selection_Idx *idx;
@@ -1045,8 +1045,8 @@ ewl_filepicker_cb_path_change(Ewl_Widget *w, void *ev __UNUSED__,
if (idx->row == 0)
{
- free(idx);
- DRETURN(DLEVEL_STABLE);
+ free(idx);
+ DRETURN(DLEVEL_STABLE);
}
ecore_list_index_goto(fp->path, idx->row);
@@ -1071,7 +1071,7 @@ ewl_filepicker_cb_filter_change(Ewl_Widget *w, void *ev __UNUSED__, void *data)
name = ewl_text_text_get(EWL_TEXT(w));
if (!name)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_filepicker_filter_add(fp, name, name, NULL);
ewl_filepicker_cb_type_change(fp->mvc_filters.combo, NULL, fp);
@@ -1082,7 +1082,7 @@ ewl_filepicker_cb_filter_change(Ewl_Widget *w, void *ev __UNUSED__, void *data)
static void
ewl_filepicker_cb_path_entry_change(Ewl_Widget *w, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filepicker *fp;
char *path;
@@ -1096,7 +1096,7 @@ ewl_filepicker_cb_path_entry_change(Ewl_Widget *w, void *ev __UNUSED__,
path = ewl_text_text_get(EWL_TEXT(w));
if (!path)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_filepicker_directory_set(fp, path);
FREE(path);
@@ -1106,7 +1106,7 @@ ewl_filepicker_cb_path_entry_change(Ewl_Widget *w, void *ev __UNUSED__,
static void
ewl_filepicker_cb_type_change(Ewl_Widget *w, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Filepicker *fp;
Ewl_Filelist_Filter *filter;
@@ -1121,9 +1121,9 @@ ewl_filepicker_cb_type_change(Ewl_Widget *w, void *ev __UNUSED__,
idx = ewl_mvc_selected_get(EWL_MVC(w));
if (idx)
{
- ecore_list_index_goto(fp->filters, idx->row);
- filter = ecore_list_current(fp->filters);
- ewl_filelist_filter_set(EWL_FILELIST(fp->file_list), filter);
+ ecore_list_index_goto(fp->filters, idx->row);
+ filter = ecore_list_current(fp->filters);
+ ewl_filelist_filter_set(EWL_FILELIST(fp->file_list), filter);
}
FREE(idx);
@@ -1133,7 +1133,7 @@ ewl_filepicker_cb_type_change(Ewl_Widget *w, void *ev __UNUSED__,
static void
ewl_filepicker_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Filepicker *fp;
@@ -1171,7 +1171,7 @@ ewl_filepicker_filter_free_cb(Ewl_Filelist_Filter *filter)
static void
ewl_filepicker_cb_dir_new(Ewl_Widget *w, void *ev,
- void *data)
+ void *data)
{
Ewl_Widget *d;
Ewl_Embed *win;
@@ -1192,7 +1192,7 @@ ewl_filepicker_cb_dir_new(Ewl_Widget *w, void *ev,
ewl_window_class_set(EWL_WINDOW(d), "Create New Folder");
ewl_window_transient_for_foreign(EWL_WINDOW(d), win->canvas_window);
ewl_callback_append(d, EWL_CALLBACK_DELETE_WINDOW,
- ewl_filepicker_cb_dialog_delete, resp);
+ ewl_filepicker_cb_dialog_delete, resp);
ewl_object_fill_policy_set(EWL_OBJECT(d), EWL_FLAG_FILL_NONE);
ewl_dialog_active_area_set(EWL_DIALOG(d), EWL_POSITION_TOP);
ewl_widget_show(d);
@@ -1203,7 +1203,7 @@ ewl_filepicker_cb_dir_new(Ewl_Widget *w, void *ev,
ewl_widget_show(box);
path = ewl_icon_theme_icon_path_get(EWL_ICON_FOLDER_NEW,
- 32);
+ 32);
o = ewl_image_new();
if (path) ewl_image_file_path_set(EWL_IMAGE(o), path);
ewl_container_child_append(EWL_CONTAINER(box), o);
@@ -1213,7 +1213,7 @@ ewl_filepicker_cb_dir_new(Ewl_Widget *w, void *ev,
ewl_text_text_set(EWL_TEXT(o), "New Folder");
ewl_container_child_append(EWL_CONTAINER(box), o);
ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
- ewl_filepicker_cb_dialog_response, resp);
+ ewl_filepicker_cb_dialog_response, resp);
ewl_widget_show(o);
ewl_dialog_active_area_set(EWL_DIALOG(d), EWL_POSITION_BOTTOM);
@@ -1224,21 +1224,21 @@ ewl_filepicker_cb_dir_new(Ewl_Widget *w, void *ev,
o = ewl_button_new();
ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_OK);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filepicker_cb_dialog_response, resp);
+ ewl_filepicker_cb_dialog_response, resp);
ewl_container_child_append(EWL_CONTAINER(d), o);
ewl_widget_show(o);
o = ewl_button_new();
ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_CANCEL);
ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- ewl_filepicker_cb_dialog_response, resp);
+ ewl_filepicker_cb_dialog_response, resp);
ewl_container_child_append(EWL_CONTAINER(d), o);
ewl_widget_show(o);
}
static void
ewl_filepicker_cb_dialog_delete(Ewl_Widget *w, void *ev,
- void *data)
+ void *data)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -1253,7 +1253,7 @@ ewl_filepicker_cb_dialog_delete(Ewl_Widget *w, void *ev,
static void
ewl_filepicker_cb_dialog_response(Ewl_Widget *w, void *ev,
- void *data)
+ void *data)
{
Ewl_Filepicker_Dialog *resp;
const char *path;
@@ -1269,28 +1269,28 @@ ewl_filepicker_cb_dialog_response(Ewl_Widget *w, void *ev,
/* There is a callback on the entry that calls this */
if (ewl_widget_type_is(w, EWL_STOCK_TYPE))
- response = ewl_stock_type_get(EWL_STOCK(w));
+ response = ewl_stock_type_get(EWL_STOCK(w));
else
- response = EWL_STOCK_OK;
+ response = EWL_STOCK_OK;
name = ewl_text_text_get(EWL_TEXT(resp->e));
if ((response == EWL_STOCK_CANCEL) || (!name))
{
- ewl_widget_destroy(resp->d);
- FREE(resp);
- DRETURN(DLEVEL_STABLE);
+ ewl_widget_destroy(resp->d);
+ FREE(resp);
+ DRETURN(DLEVEL_STABLE);
}
path = ewl_filelist_directory_get(EWL_FILELIST(resp->fp->file_list));
if (name[0] == '/')
- snprintf(res, PATH_MAX, "%s%s", path, name);
+ snprintf(res, PATH_MAX, "%s%s", path, name);
else
- snprintf(res, PATH_MAX, "%s/%s", path, name);
+ snprintf(res, PATH_MAX, "%s/%s", path, name);
if (ecore_file_mkpath(res))
- ewl_filepicker_directory_set(EWL_FILEPICKER(resp->fp), res);
+ ewl_filepicker_directory_set(EWL_FILEPICKER(resp->fp), res);
ewl_widget_destroy(resp->d);
FREE(name);
diff --git a/src/lib/ewl_filepicker.h b/src/lib/ewl_filepicker.h
index 7ccce35..0617d9d 100644
--- a/src/lib/ewl_filepicker.h
+++ b/src/lib/ewl_filepicker.h
@@ -47,77 +47,77 @@ typedef struct Ewl_Filepicker Ewl_Filepicker;
*/
struct Ewl_Filepicker
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
- Ewl_Widget *file_list; /**< The file list widet */
+ Ewl_Widget *file_list; /**< The file list widet */
- Ewl_Widget *type_combo; /**< File type combo */
- Ewl_Widget *file_entry; /**< Filename entry box */
- Ewl_Widget *favorites_box; /**< Favoirte directory box */
- Ewl_Widget *path_combo; /**< Path combo box */
- Ewl_Widget *dir_button; /**< Button to create a directory */
- Ewl_Widget *ret_button; /**< The save/open button */
+ Ewl_Widget *type_combo; /**< File type combo */
+ Ewl_Widget *file_entry; /**< Filename entry box */
+ Ewl_Widget *favorites_box; /**< Favoirte directory box */
+ Ewl_Widget *path_combo; /**< Path combo box */
+ Ewl_Widget *dir_button; /**< Button to create a directory */
+ Ewl_Widget *ret_button; /**< The save/open button */
- Ecore_List *path; /**< The path components */
- Ecore_List *filters; /**< The type filters */
+ Ecore_List *path; /**< The path components */
+ Ecore_List *filters; /**< The type filters */
struct
{
- Ewl_Model *model;
- Ewl_View *view;
- Ewl_Widget *combo;
+ Ewl_Model *model;
+ Ewl_View *view;
+ Ewl_Widget *combo;
} mvc_filters, mvc_path;
- unsigned char show_favorites:1; /**< Show the favorite box */
+ unsigned char show_favorites:1; /**< Show the favorite box */
unsigned char saveas_dialog:1; /**< Open or save dialog */
- unsigned char ret_dir:1; /**< Allow directories to be returned */
+ unsigned char ret_dir:1; /**< Allow directories to be returned */
};
Ewl_Widget *ewl_filepicker_new(void);
-int ewl_filepicker_init(Ewl_Filepicker *fp);
+int ewl_filepicker_init(Ewl_Filepicker *fp);
-void ewl_filepicker_directory_set(Ewl_Filepicker *fp,
- const char *dir);
+void ewl_filepicker_directory_set(Ewl_Filepicker *fp,
+ const char *dir);
const char *ewl_filepicker_directory_get(Ewl_Filepicker *fp);
-void ewl_filepicker_filter_set(Ewl_Filepicker *fp,
- Ewl_Filelist_Filter *filter);
+void ewl_filepicker_filter_set(Ewl_Filepicker *fp,
+ Ewl_Filelist_Filter *filter);
Ewl_Filelist_Filter *ewl_filepicker_filter_get(Ewl_Filepicker *fp);
-void ewl_filepicker_multiselect_set(Ewl_Filepicker *fp,
- unsigned int ms);
+void ewl_filepicker_multiselect_set(Ewl_Filepicker *fp,
+ unsigned int ms);
unsigned int ewl_filepicker_multiselect_get(Ewl_Filepicker *fp);
-void ewl_filepicker_show_dot_files_set(Ewl_Filepicker *fp,
- unsigned int dot);
+void ewl_filepicker_show_dot_files_set(Ewl_Filepicker *fp,
+ unsigned int dot);
unsigned int ewl_filepicker_show_dot_files_get(Ewl_Filepicker *fp);
-void ewl_filepicker_selected_file_set(Ewl_Filepicker *fp,
- const char *file);
-char *ewl_filepicker_selected_file_get(Ewl_Filepicker *fp);
+void ewl_filepicker_selected_file_set(Ewl_Filepicker *fp,
+ const char *file);
+char *ewl_filepicker_selected_file_get(Ewl_Filepicker *fp);
-void ewl_filepicker_selected_files_set(Ewl_Filepicker *fp,
- Ecore_List *files);
+void ewl_filepicker_selected_files_set(Ewl_Filepicker *fp,
+ Ecore_List *files);
Ecore_List *ewl_filepicker_selected_files_get(Ewl_Filepicker *fp);
-void ewl_filepicker_show_favorites_set(Ewl_Filepicker *fp,
- unsigned int show);
+void ewl_filepicker_show_favorites_set(Ewl_Filepicker *fp,
+ unsigned int show);
unsigned int ewl_filepicker_show_favorites_get(Ewl_Filepicker *fp);
-void ewl_filepicker_list_view_set(Ewl_Filepicker *fp,
- Ewl_Filelist_View view);
+void ewl_filepicker_list_view_set(Ewl_Filepicker *fp,
+ Ewl_Filelist_View view);
Ewl_Filelist_View *ewl_filepicker_list_view_get(Ewl_Filepicker *fp);
Ewl_Filelist_Filter *ewl_filepicker_filter_add(Ewl_Filepicker *fp,
- const char *name,
- const char *extension,
- Ecore_List *mime_types);
-void ewl_filepicker_save_as_set(Ewl_Filepicker *fp,
- unsigned int t);
+ const char *name,
+ const char *extension,
+ Ecore_List *mime_types);
+void ewl_filepicker_save_as_set(Ewl_Filepicker *fp,
+ unsigned int t);
unsigned int ewl_filepicker_save_as_get(Ewl_Filepicker *fp);
-void ewl_filepicker_return_directories_set(Ewl_Filepicker *fp,
- unsigned int t);
+void ewl_filepicker_return_directories_set(Ewl_Filepicker *fp,
+ unsigned int t);
unsigned int ewl_filepicker_return_directories_get(Ewl_Filepicker *fp);
Ewl_Widget *ewl_filepicker_save_as_new(void);
/**
diff --git a/src/lib/ewl_floater.c b/src/lib/ewl_floater.c
index 8e8f942..9aff521 100644
--- a/src/lib/ewl_floater.c
+++ b/src/lib/ewl_floater.c
@@ -18,11 +18,11 @@ ewl_floater_new(void)
f = NEW(Ewl_Floater, 1);
if (!f)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_floater_init(EWL_FLOATER(f))) {
- ewl_widget_destroy(f);
- f = NULL;
+ ewl_widget_destroy(f);
+ f = NULL;
}
DRETURN_PTR(EWL_WIDGET(f), DLEVEL_STABLE);
@@ -50,17 +50,17 @@ ewl_floater_init(Ewl_Floater *f)
* normal, and the widget to follow.
*/
if (!ewl_box_init(EWL_BOX(w))) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_box_orientation_set(EWL_BOX(w), EWL_ORIENTATION_VERTICAL);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NORMAL);
ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_LEFT
- | EWL_FLAG_ALIGN_TOP);
+ | EWL_FLAG_ALIGN_TOP);
ewl_widget_appearance_set(w, EWL_FLOATER_TYPE);
ewl_widget_inherit(w, EWL_FLOATER_TYPE);
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY,
- ewl_floater_cb_destroy, NULL);
+ ewl_floater_cb_destroy, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -83,11 +83,11 @@ ewl_floater_follow_set(Ewl_Floater *f, Ewl_Widget *p)
* Don't follow the old parent.
*/
if (f->follows) {
- ewl_callback_del_with_data(f->follows, EWL_CALLBACK_CONFIGURE,
- ewl_floater_cb_follow_configure, f);
- ewl_callback_del_with_data(EWL_WIDGET(f->follows),
- EWL_CALLBACK_DESTROY,
- ewl_floater_cb_follow_destroy, f);
+ ewl_callback_del_with_data(f->follows, EWL_CALLBACK_CONFIGURE,
+ ewl_floater_cb_follow_configure, f);
+ ewl_callback_del_with_data(EWL_WIDGET(f->follows),
+ EWL_CALLBACK_DESTROY,
+ ewl_floater_cb_follow_destroy, f);
}
/*
@@ -95,10 +95,10 @@ ewl_floater_follow_set(Ewl_Floater *f, Ewl_Widget *p)
* widget it follows, if they are not the same.
*/
if (p) {
- ewl_callback_append(p, EWL_CALLBACK_CONFIGURE,
- ewl_floater_cb_follow_configure, f);
- ewl_callback_prepend(p, EWL_CALLBACK_DESTROY,
- ewl_floater_cb_follow_destroy, f);
+ ewl_callback_append(p, EWL_CALLBACK_CONFIGURE,
+ ewl_floater_cb_follow_configure, f);
+ ewl_callback_prepend(p, EWL_CALLBACK_DESTROY,
+ ewl_floater_cb_follow_destroy, f);
}
f->follows = p;
@@ -138,7 +138,7 @@ ewl_floater_position_set(Ewl_Floater *f, int x, int y)
DCHECK_TYPE(f, EWL_FLOATER_TYPE);
if (x == f->x && y == f->y)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Set the coordinates of the floater, this will be used for either
@@ -148,9 +148,9 @@ ewl_floater_position_set(Ewl_Floater *f, int x, int y)
f->y = y;
if (f->follows)
- ewl_widget_configure(f->follows);
+ ewl_widget_configure(f->follows);
else
- ewl_object_position_request(EWL_OBJECT(f), f->x, f->y);
+ ewl_object_position_request(EWL_OBJECT(f), f->x, f->y);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -172,15 +172,15 @@ ewl_floater_relative_set(Ewl_Floater *f, Ewl_Widget *w)
DCHECK_TYPE(f, EWL_FLOATER_TYPE);
if (f->follows == w)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Remove the callback attached to the configure event for the
* followed widget.
*/
if (f->follows)
- ewl_callback_del(f->follows, EWL_CALLBACK_CONFIGURE,
- ewl_floater_cb_follow_configure);
+ ewl_callback_del(f->follows, EWL_CALLBACK_CONFIGURE,
+ ewl_floater_cb_follow_configure);
/*
* Set the widget that the floater follows.
@@ -202,7 +202,7 @@ ewl_floater_relative_set(Ewl_Floater *f, Ewl_Widget *w)
*/
void
ewl_floater_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -224,7 +224,7 @@ ewl_floater_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_floater_cb_follow_configure(Ewl_Widget *w __UNUSED__,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
int align, x, y;
Ewl_Floater *f;
@@ -240,11 +240,11 @@ ewl_floater_cb_follow_configure(Ewl_Widget *w __UNUSED__,
* positioning.
*/
if (f->follows) {
- x = ewl_object_current_x_get(EWL_OBJECT(f->follows)) + f->x;
- y = ewl_object_current_y_get(EWL_OBJECT(f->follows)) + f->y;
+ x = ewl_object_current_x_get(EWL_OBJECT(f->follows)) + f->x;
+ y = ewl_object_current_y_get(EWL_OBJECT(f->follows)) + f->y;
} else {
- x = f->x;
- y = f->y;
+ x = f->x;
+ y = f->y;
}
/*
@@ -257,18 +257,18 @@ ewl_floater_cb_follow_configure(Ewl_Widget *w __UNUSED__,
* Determine the horizontal placement of the widget based on alignment
*/
if (align & EWL_FLAG_ALIGN_RIGHT) {
- x -= CURRENT_W(f);
+ x -= CURRENT_W(f);
} else if (!(align & EWL_FLAG_ALIGN_LEFT)) {
- x -= CURRENT_W(f) / 2;
+ x -= CURRENT_W(f) / 2;
}
/*
* Determine the vertical placement of the widget based on alignment
*/
if (align & EWL_FLAG_ALIGN_BOTTOM) {
- y -= CURRENT_H(f);
+ y -= CURRENT_H(f);
} else if (!(align & EWL_FLAG_ALIGN_TOP)) {
- y -= CURRENT_H(f) / 2;
+ y -= CURRENT_H(f) / 2;
}
/*
@@ -289,7 +289,7 @@ ewl_floater_cb_follow_configure(Ewl_Widget *w __UNUSED__,
*/
void
ewl_floater_cb_follow_destroy(Ewl_Widget *w __UNUSED__ ,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(user_data);
diff --git a/src/lib/ewl_floater.h b/src/lib/ewl_floater.h
index b6768af..f2a373f 100644
--- a/src/lib/ewl_floater.h
+++ b/src/lib/ewl_floater.h
@@ -60,19 +60,19 @@ struct Ewl_Floater
Ewl_Widget *ewl_floater_new(void);
-int ewl_floater_init(Ewl_Floater *f);
-void ewl_floater_follow_set(Ewl_Floater *f, Ewl_Widget *p);
+int ewl_floater_init(Ewl_Floater *f);
+void ewl_floater_follow_set(Ewl_Floater *f, Ewl_Widget *p);
Ewl_Widget *ewl_floater_follow_get(Ewl_Floater *f);
-void ewl_floater_position_set(Ewl_Floater *parent, int x, int y);
+void ewl_floater_position_set(Ewl_Floater *parent, int x, int y);
/*
* Internally used callbacks, override at your own risk.
*/
void ewl_floater_cb_destroy(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_floater_cb_follow_configure(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_floater_cb_follow_destroy(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @}
diff --git a/src/lib/ewl_freebox.c b/src/lib/ewl_freebox.c
index 3610d59..e2b7fbf 100644
--- a/src/lib/ewl_freebox.c
+++ b/src/lib/ewl_freebox.c
@@ -69,12 +69,12 @@ ewl_freebox_new(void)
fb = NEW(Ewl_Freebox, 1);
if (!fb)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_freebox_init(EWL_FREEBOX(fb)))
{
- ewl_widget_destroy(fb);
- fb = NULL;
+ ewl_widget_destroy(fb);
+ fb = NULL;
}
DRETURN_PTR(fb, DLEVEL_STABLE);
@@ -92,17 +92,17 @@ ewl_freebox_init(Ewl_Freebox *fb)
DCHECK_PARAM_PTR_RET(fb, TRUE);
if (!ewl_container_init(EWL_CONTAINER(fb)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(fb), EWL_FREEBOX_TYPE);
ewl_widget_inherit(EWL_WIDGET(fb), EWL_FREEBOX_TYPE);
ewl_callback_append(EWL_WIDGET(fb), EWL_CALLBACK_CONFIGURE,
- ewl_freebox_cb_configure, NULL);
+ ewl_freebox_cb_configure, NULL);
ewl_container_add_notify_set(EWL_CONTAINER(fb),
- ewl_freebox_cb_child_add);
+ ewl_freebox_cb_child_add);
ewl_container_show_notify_set(EWL_CONTAINER(fb),
- ewl_freebox_cb_child_show);
+ ewl_freebox_cb_child_show);
fb->layout = EWL_FREEBOX_LAYOUT_AUTO;
fb->orientation = EWL_ORIENTATION_HORIZONTAL;
@@ -126,7 +126,7 @@ ewl_freebox_orientation_set(Ewl_Freebox *fb, Ewl_Orientation orientation)
DCHECK_TYPE(fb, EWL_FREEBOX_TYPE);
if (orientation == fb->orientation)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fb->orientation = orientation;
ewl_widget_configure(EWL_WIDGET(fb));
@@ -145,7 +145,7 @@ ewl_freebox_orientation_get(Ewl_Freebox *fb)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(fb, EWL_ORIENTATION_HORIZONTAL);
DCHECK_TYPE_RET(fb, EWL_FREEBOX_TYPE,
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
DRETURN_INT(fb->orientation, DLEVEL_STABLE);
}
@@ -164,7 +164,7 @@ ewl_freebox_layout_type_set(Ewl_Freebox *fb, Ewl_Freebox_Layout_Type type)
DCHECK_TYPE(fb, EWL_FREEBOX_TYPE);
if (fb->layout == type)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fb->layout = type;
ewl_widget_configure(EWL_WIDGET(fb));
@@ -202,7 +202,7 @@ ewl_freebox_comparator_set(Ewl_Freebox *fb, Ewl_Freebox_Comparator cmp)
DCHECK_TYPE(fb, EWL_FREEBOX_TYPE);
if (fb->comparator == cmp)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
fb->comparator = cmp;
fb->sorted = FALSE;
@@ -257,7 +257,7 @@ ewl_freebox_resort(Ewl_Freebox *fb)
*/
void
ewl_freebox_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Freebox *fb;
@@ -267,13 +267,13 @@ ewl_freebox_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
fb = EWL_FREEBOX(w);
if (fb->layout == EWL_FREEBOX_LAYOUT_AUTO)
- ewl_freebox_layout_auto(fb);
+ ewl_freebox_layout_auto(fb);
else if (fb->layout == EWL_FREEBOX_LAYOUT_MANUAL)
- ewl_freebox_layout_manual(fb);
+ ewl_freebox_layout_manual(fb);
else if (fb->layout == EWL_FREEBOX_LAYOUT_COMPARATOR)
- ewl_freebox_layout_comparator(fb);
+ ewl_freebox_layout_comparator(fb);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -349,33 +349,33 @@ ewl_freebox_layout_auto(Ewl_Freebox *fb)
DCHECK_TYPE(fb, EWL_FREEBOX_TYPE);
pad = ewl_theme_data_int_get(EWL_WIDGET(fb),
- "auto/padding");
+ "auto/padding");
if (fb->orientation == EWL_ORIENTATION_HORIZONTAL)
{
- pref_inner = ewl_object_preferred_inner_h_set;
- current_pos = ewl_object_current_x_get;
- current_size = ewl_object_current_w_get;
- current_anchor = ewl_object_current_y_get;
+ pref_inner = ewl_object_preferred_inner_h_set;
+ current_pos = ewl_object_current_x_get;
+ current_size = ewl_object_current_w_get;
+ current_anchor = ewl_object_current_y_get;
- stable_dir = &child_w;
- grow_dir = &child_h;
+ stable_dir = &child_w;
+ grow_dir = &child_h;
- x = &cur_align;
- y = &cur_pos;
+ x = &cur_align;
+ y = &cur_pos;
}
else
{
- pref_inner = ewl_object_preferred_inner_w_set;
- current_pos = ewl_object_current_y_get;
- current_size = ewl_object_current_h_get;
- current_anchor = ewl_object_current_x_get;
+ pref_inner = ewl_object_preferred_inner_w_set;
+ current_pos = ewl_object_current_y_get;
+ current_size = ewl_object_current_h_get;
+ current_anchor = ewl_object_current_x_get;
- stable_dir = &child_h;
- grow_dir = &child_w;
+ stable_dir = &child_h;
+ grow_dir = &child_w;
- x = &cur_pos;
- y = &cur_align;
+ x = &cur_pos;
+ y = &cur_align;
}
base_pos = current_pos(EWL_OBJECT(fb));
@@ -393,20 +393,20 @@ ewl_freebox_layout_auto(Ewl_Freebox *fb)
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)))
{
- if (!VISIBLE(child) || UNMANAGED(child)) continue;
- ewl_object_preferred_size_get(EWL_OBJECT(child),
- &child_w, &child_h);
-
- /* past end of widget, wrap */
- if ((cur_align + *stable_dir) > max_pos)
- {
- cur_align = base_pos;
- cur_pos += *col_size + pad;
- *(++col_size) = 0;
- }
-
- *col_size = MAX(*col_size, *grow_dir);
- cur_align += *stable_dir + pad;
+ if (!VISIBLE(child) || UNMANAGED(child)) continue;
+ ewl_object_preferred_size_get(EWL_OBJECT(child),
+ &child_w, &child_h);
+
+ /* past end of widget, wrap */
+ if ((cur_align + *stable_dir) > max_pos)
+ {
+ cur_align = base_pos;
+ cur_pos += *col_size + pad;
+ *(++col_size) = 0;
+ }
+
+ *col_size = MAX(*col_size, *grow_dir);
+ cur_align += *stable_dir + pad;
}
/* reset the start values */
@@ -418,22 +418,22 @@ ewl_freebox_layout_auto(Ewl_Freebox *fb)
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)))
{
- if (!VISIBLE(child) || UNMANAGED(child)) continue;
- ewl_object_preferred_size_get(EWL_OBJECT(child),
- &child_w, &child_h);
-
- /* past end of widget, wrap */
- if ((cur_align + *stable_dir) > max_pos)
- {
- cur_align = base_pos;
- cur_pos += *col_size + pad;
- col_size++;
- }
-
- *grow_dir = *col_size;
-
- ewl_object_place(EWL_OBJECT(child), *x, *y, child_w, child_h);
- cur_align += *stable_dir + pad;
+ if (!VISIBLE(child) || UNMANAGED(child)) continue;
+ ewl_object_preferred_size_get(EWL_OBJECT(child),
+ &child_w, &child_h);
+
+ /* past end of widget, wrap */
+ if ((cur_align + *stable_dir) > max_pos)
+ {
+ cur_align = base_pos;
+ cur_pos += *col_size + pad;
+ col_size++;
+ }
+
+ *grow_dir = *col_size;
+
+ ewl_object_place(EWL_OBJECT(child), *x, *y, child_w, child_h);
+ cur_align += *stable_dir + pad;
}
pref_inner(EWL_OBJECT(fb), cur_pos - start_pos + *col_size + pad);
@@ -471,10 +471,10 @@ ewl_freebox_layout_comparator(Ewl_Freebox *fb)
/* we're boned if we don't have a comparator */
if (!fb->comparator)
{
- DWARNING("No comparator set and using "
- "EWL_FREEBOX_LAYOUT_COMPARATOR. "
- "Bad programmer, bad.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("No comparator set and using "
+ "EWL_FREEBOX_LAYOUT_COMPARATOR. "
+ "Bad programmer, bad.");
+ DRETURN(DLEVEL_STABLE);
}
c = EWL_CONTAINER(fb);
@@ -482,13 +482,13 @@ ewl_freebox_layout_comparator(Ewl_Freebox *fb)
/* sort the data if needed */
if (!fb->sorted)
{
- ecore_dlist_sort(c->children, ECORE_COMPARE_CB(fb->comparator),
- ECORE_SORT_MIN);
+ ecore_dlist_sort(c->children, ECORE_COMPARE_CB(fb->comparator),
+ ECORE_SORT_MIN);
- /* we set sorted to TRUE at the end here as each of those
- * inserts into the container will trigger our child_add
- * callback which will set sorted to FALSE */
- fb->sorted = TRUE;
+ /* we set sorted to TRUE at the end here as each of those
+ * inserts into the container will trigger our child_add
+ * callback which will set sorted to FALSE */
+ fb->sorted = TRUE;
}
/* just use the autolayout which will layout in the order the items
diff --git a/src/lib/ewl_freebox.h b/src/lib/ewl_freebox.h
index bf97edb..60c46f3 100644
--- a/src/lib/ewl_freebox.h
+++ b/src/lib/ewl_freebox.h
@@ -51,32 +51,32 @@ typedef struct Ewl_Freebox Ewl_Freebox;
*/
struct Ewl_Freebox
{
- Ewl_Container container; /**< Inherit from Ewl_Container */
+ Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Freebox_Layout_Type layout; /**< The current layout type */
+ Ewl_Freebox_Layout_Type layout; /**< The current layout type */
Ewl_Freebox_Comparator comparator; /**< The item comparator */
- Ewl_Orientation orientation; /**< The orientation of the box */
- unsigned short sorted; /**< Is the box sorted */
+ Ewl_Orientation orientation; /**< The orientation of the box */
+ unsigned short sorted; /**< Is the box sorted */
};
-Ewl_Widget *ewl_vfreebox_new(void);
-Ewl_Widget *ewl_hfreebox_new(void);
-Ewl_Widget *ewl_freebox_new(void);
-int ewl_freebox_init(Ewl_Freebox *fb);
+Ewl_Widget *ewl_vfreebox_new(void);
+Ewl_Widget *ewl_hfreebox_new(void);
+Ewl_Widget *ewl_freebox_new(void);
+int ewl_freebox_init(Ewl_Freebox *fb);
-void ewl_freebox_orientation_set(Ewl_Freebox *fb,
- Ewl_Orientation orientation);
-Ewl_Orientation ewl_freebox_orientation_get(Ewl_Freebox *fb);
+void ewl_freebox_orientation_set(Ewl_Freebox *fb,
+ Ewl_Orientation orientation);
+Ewl_Orientation ewl_freebox_orientation_get(Ewl_Freebox *fb);
-void ewl_freebox_layout_type_set(Ewl_Freebox *fb,
- Ewl_Freebox_Layout_Type type);
+void ewl_freebox_layout_type_set(Ewl_Freebox *fb,
+ Ewl_Freebox_Layout_Type type);
Ewl_Freebox_Layout_Type ewl_freebox_layout_type_get(Ewl_Freebox *fb);
-void ewl_freebox_comparator_set(Ewl_Freebox *fb,
- Ewl_Freebox_Comparator cmp);
+void ewl_freebox_comparator_set(Ewl_Freebox *fb,
+ Ewl_Freebox_Comparator cmp);
Ewl_Freebox_Comparator ewl_freebox_comparator_get(Ewl_Freebox *fb);
-void ewl_freebox_resort(Ewl_Freebox *fb);
+void ewl_freebox_resort(Ewl_Freebox *fb);
/*
* Internal callbacks, override at your risk
diff --git a/src/lib/ewl_grid.c b/src/lib/ewl_grid.c
index ad218d8..3dd58da 100644
--- a/src/lib/ewl_grid.c
+++ b/src/lib/ewl_grid.c
@@ -25,11 +25,11 @@ ewl_grid_new(void)
g = NEW(Ewl_Grid, 1);
if (!g)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_grid_init(g)) {
- ewl_widget_destroy(EWL_WIDGET(g));
- g = NULL;
+ ewl_widget_destroy(EWL_WIDGET(g));
+ g = NULL;
}
DRETURN_PTR(EWL_WIDGET(g), DLEVEL_STABLE);
@@ -51,20 +51,20 @@ ewl_grid_init(Ewl_Grid *g)
* Initialize the grids inherited fields
*/
if (!ewl_container_init(EWL_CONTAINER(g)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(g), EWL_GRID_TYPE);
ewl_widget_inherit(EWL_WIDGET(g), EWL_GRID_TYPE);
ewl_container_add_notify_set(EWL_CONTAINER(g), ewl_grid_cb_child_add);
ewl_container_remove_notify_set(EWL_CONTAINER(g),
- ewl_grid_cb_child_remove);
+ ewl_grid_cb_child_remove);
ewl_container_show_notify_set(EWL_CONTAINER(g),
- ewl_grid_cb_child_show);
+ ewl_grid_cb_child_show);
ewl_container_hide_notify_set(EWL_CONTAINER(g),
- ewl_grid_cb_child_show);
+ ewl_grid_cb_child_show);
ewl_container_resize_notify_set(EWL_CONTAINER(g),
- ewl_grid_cb_child_resize);
+ ewl_grid_cb_child_resize);
/*
* the smallest size where a grid make sense
@@ -81,9 +81,9 @@ ewl_grid_init(Ewl_Grid *g)
* Append callbacks
*/
ewl_callback_append(EWL_WIDGET(g), EWL_CALLBACK_CONFIGURE,
- ewl_grid_cb_configure, NULL);
+ ewl_grid_cb_configure, NULL);
ewl_callback_prepend(EWL_WIDGET(g), EWL_CALLBACK_DESTROY,
- ewl_grid_cb_destroy, NULL);
+ ewl_grid_cb_destroy, NULL);
ewl_widget_focusable_set(EWL_WIDGET(g), FALSE);
@@ -111,45 +111,45 @@ ewl_grid_dimensions_set(Ewl_Grid *g, int cols, int rows)
w = EWL_WIDGET(g);
if ((cols == g->cols) && (rows == g->rows))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
IF_FREE(g->map);
g->data_dirty = TRUE;
if (cols != g->cols) {
- col_new = NEW(Ewl_Grid_Info, cols);
- if (!col_new)
- DRETURN(DLEVEL_STABLE);
+ col_new = NEW(Ewl_Grid_Info, cols);
+ if (!col_new)
+ DRETURN(DLEVEL_STABLE);
- if (g->col_size) {
- int num;
+ if (g->col_size) {
+ int num;
- num = MIN(cols, g->cols);
- for (i = 0; i < num; i++)
- col_new[i] = g->col_size[i];
+ num = MIN(cols, g->cols);
+ for (i = 0; i < num; i++)
+ col_new[i] = g->col_size[i];
- FREE(g->col_size);
- }
- g->col_size = col_new;
- g->cols = cols;
+ FREE(g->col_size);
+ }
+ g->col_size = col_new;
+ g->cols = cols;
}
if (rows != g->rows) {
- row_new = NEW(Ewl_Grid_Info, rows);
- if (!row_new)
- DRETURN(DLEVEL_STABLE);
+ row_new = NEW(Ewl_Grid_Info, rows);
+ if (!row_new)
+ DRETURN(DLEVEL_STABLE);
- if (g->row_size) {
- int num;
+ if (g->row_size) {
+ int num;
- num = MIN(rows, g->rows);
- for (i = 0; i < num; i++)
- row_new[i] = g->row_size[i];
+ num = MIN(rows, g->rows);
+ for (i = 0; i < num; i++)
+ row_new[i] = g->row_size[i];
- FREE(g->row_size);
- }
- g->row_size = row_new;
- g->rows = rows;
+ FREE(g->row_size);
+ }
+ g->row_size = row_new;
+ g->rows = rows;
}
ewl_widget_configure(w);
@@ -191,7 +191,7 @@ ewl_grid_orientation_set(Ewl_Grid *g, Ewl_Orientation orientation)
DCHECK_TYPE(g, EWL_GRID_TYPE);
if (g->orientation == orientation)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
g->orientation = orientation;
g->data_dirty = TRUE;
@@ -233,10 +233,10 @@ ewl_grid_homogeneous_set(Ewl_Grid *g, unsigned int h)
DCHECK_TYPE(g, EWL_GRID_TYPE);
if (g->homogeneous_h != h)
- ewl_grid_hhomogeneous_set(g, h);
+ ewl_grid_hhomogeneous_set(g, h);
if (g->homogeneous_v != h)
- ewl_grid_vhomogeneous_set(g, h);
+ ewl_grid_vhomogeneous_set(g, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -259,7 +259,7 @@ ewl_grid_hhomogeneous_set(Ewl_Grid *g, unsigned int h)
DCHECK_TYPE(g, EWL_GRID_TYPE);
if (g->homogeneous_h == h)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
g->homogeneous_h = h;
g->data_dirty = TRUE;
@@ -286,7 +286,7 @@ ewl_grid_vhomogeneous_set(Ewl_Grid *g, unsigned int h)
DCHECK_TYPE(g, EWL_GRID_TYPE);
if (g->homogeneous_v == h)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
g->homogeneous_v = h;
g->data_dirty = TRUE;
@@ -337,8 +337,8 @@ ewl_grid_vhomogeneous_get(Ewl_Grid *g)
*/
void
ewl_grid_child_position_set(Ewl_Grid *g, Ewl_Widget *w,
- int start_col, int end_col,
- int start_row, int end_row)
+ int start_col, int end_col,
+ int start_row, int end_row)
{
Ewl_Grid_Child *child;
int new_cols, new_rows;
@@ -356,36 +356,36 @@ ewl_grid_child_position_set(Ewl_Grid *g, Ewl_Widget *w,
* check bounds
*/
if (start_col < 0) {
- DWARNING("start_col out of bounds. min is 0.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("start_col out of bounds. min is 0.");
+ DRETURN(DLEVEL_STABLE);
}
if (end_col >= g->cols)
- new_cols = end_col + 1;
+ new_cols = end_col + 1;
else
- new_cols = g->cols;
+ new_cols = g->cols;
if (start_row < 0) {
- DWARNING("start_row out of bounds. min is 0.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("start_row out of bounds. min is 0.");
+ DRETURN(DLEVEL_STABLE);
}
if (end_row >= g->rows)
- new_rows = end_row + 1;
+ new_rows = end_row + 1;
else
- new_rows = g->rows;
+ new_rows = g->rows;
/*
* create a new child
*/
if (!(child = ewl_widget_data_get(w,g))) {
- child = NEW(Ewl_Grid_Child, 1);
- if (!child)
- DRETURN(DLEVEL_STABLE);
+ child = NEW(Ewl_Grid_Child, 1);
+ if (!child)
+ DRETURN(DLEVEL_STABLE);
}
else {
- g->space -= (child->end_col - child->start_col + 1)
- * (child->end_row - child->start_row + 1) + 1;
+ g->space -= (child->end_col - child->start_col + 1)
+ * (child->end_row - child->start_row + 1) + 1;
}
child->start_col = start_col;
child->end_col = end_col;
@@ -398,10 +398,10 @@ ewl_grid_child_position_set(Ewl_Grid *g, Ewl_Widget *w,
* if there is to less space resize the grid
*/
if (g->space > (new_cols * new_rows)) {
- if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
- new_rows = g->space / new_cols + 1;
- else
- new_cols = g->space / new_rows + 1;
+ if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
+ new_rows = g->space / new_cols + 1;
+ else
+ new_cols = g->space / new_rows + 1;
}
/*
@@ -426,8 +426,8 @@ ewl_grid_child_position_set(Ewl_Grid *g, Ewl_Widget *w,
*/
void
ewl_grid_child_position_get(Ewl_Grid *g, Ewl_Widget *w,
- int *start_col, int *end_col,
- int *start_row, int *end_row)
+ int *start_col, int *end_col,
+ int *start_row, int *end_row)
{
Ewl_Grid_Child *child;
int sc, ec, sr, er;
@@ -440,49 +440,49 @@ ewl_grid_child_position_get(Ewl_Grid *g, Ewl_Widget *w,
child = ewl_widget_data_get(w, g);
if (child) {
- /*
- * for a fixed-positioned widget we can
- * just return the data
- */
- sc = child->start_col;
- ec = child->end_col;
- sr = child->start_row;
- er = child->end_row;
+ /*
+ * for a fixed-positioned widget we can
+ * just return the data
+ */
+ sc = child->start_col;
+ ec = child->end_col;
+ sr = child->start_row;
+ er = child->end_row;
}
else {
- Ewl_Widget *c;
- int col, row;
- void (*go_next)(Ewl_Grid *g, int *c, int *r);
- /*
- * for a floating widget we have to search
- * for the current position
- */
- if (!g->map)
- ewl_grid_map_recalc(g);
- /*
- * setup the position stuff for the floating
- * widgets
- */
- ewl_grid_map_start_position_get(g, &col, &row);
- if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
- go_next = ewl_grid_hmap_position_next;
- else
- go_next = ewl_grid_vmap_position_next;
-
- /*
- * and now find the current position
- */
- ecore_dlist_first_goto(EWL_CONTAINER(g)->children);
- while ((c = ecore_dlist_next(EWL_CONTAINER(g)->children))
- && c != w) {
- if (UNMANAGED(c))
- continue;
-
- if (!ewl_widget_data_get(c, g))
- go_next(g, &col, &row);
- }
- sc = ec = col;
- sr = er = row;
+ Ewl_Widget *c;
+ int col, row;
+ void (*go_next)(Ewl_Grid *g, int *c, int *r);
+ /*
+ * for a floating widget we have to search
+ * for the current position
+ */
+ if (!g->map)
+ ewl_grid_map_recalc(g);
+ /*
+ * setup the position stuff for the floating
+ * widgets
+ */
+ ewl_grid_map_start_position_get(g, &col, &row);
+ if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
+ go_next = ewl_grid_hmap_position_next;
+ else
+ go_next = ewl_grid_vmap_position_next;
+
+ /*
+ * and now find the current position
+ */
+ ecore_dlist_first_goto(EWL_CONTAINER(g)->children);
+ while ((c = ecore_dlist_next(EWL_CONTAINER(g)->children))
+ && c != w) {
+ if (UNMANAGED(c))
+ continue;
+
+ if (!ewl_widget_data_get(c, g))
+ go_next(g, &col, &row);
+ }
+ sc = ec = col;
+ sr = er = row;
}
if (start_col) *start_col = sc;
@@ -509,7 +509,7 @@ ewl_grid_column_current_w_get(Ewl_Grid *g, int col)
DCHECK_TYPE_RET(g, EWL_GRID_TYPE, 0);
if ((col >= g->cols) || (col < 0))
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
DRETURN_INT(g->col_size[col].current_size, DLEVEL_STABLE);
}
@@ -532,11 +532,11 @@ ewl_grid_column_fixed_w_set(Ewl_Grid *g, int col, int width)
* check bounds
*/
if (col < 0) {
- DWARNING("parameter 'col' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'col' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (col >= g->cols)
- ewl_grid_dimensions_set(g, col + 1, g->rows);
+ ewl_grid_dimensions_set(g, col + 1, g->rows);
g->col_size[col].resize_type = EWL_GRID_RESIZE_FIXED;
g->col_size[col].user.size = width;
@@ -563,7 +563,7 @@ ewl_grid_column_fixed_w_get(Ewl_Grid *g, int col)
DCHECK_TYPE_RET(g, EWL_GRID_TYPE, 0);
if ((col >= g->cols) || (col < 0))
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
DRETURN_INT(g->col_size[col].user.size, DLEVEL_STABLE);
}
@@ -586,11 +586,11 @@ ewl_grid_column_relative_w_set(Ewl_Grid *g, int col, float relw)
* check bounds
*/
if (col < 0) {
- DWARNING("parameter 'col' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'col' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (col >= g->cols)
- ewl_grid_dimensions_set(g, col + 1, g->rows);
+ ewl_grid_dimensions_set(g, col + 1, g->rows);
g->col_size[col].resize_type = EWL_GRID_RESIZE_RELATIVE;
g->col_size[col].user.rel_size = relw;
@@ -617,7 +617,7 @@ ewl_grid_column_relative_w_get(Ewl_Grid *g, int col)
DCHECK_TYPE_RET(g, EWL_GRID_TYPE, 0.0);
if ((col >= g->cols) || (col < 0))
- DRETURN_FLOAT(0.0, DLEVEL_STABLE);
+ DRETURN_FLOAT(0.0, DLEVEL_STABLE);
DRETURN_FLOAT(g->col_size[col].user.rel_size, DLEVEL_STABLE);
}
@@ -639,11 +639,11 @@ ewl_grid_column_preferred_w_use(Ewl_Grid *g, int col)
* check bounds
*/
if (col < 0) {
- DWARNING("parameter 'col' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'col' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (col >= g->cols)
- ewl_grid_dimensions_set(g, col + 1, g->rows);
+ ewl_grid_dimensions_set(g, col + 1, g->rows);
g->col_size[col].resize_type = EWL_GRID_RESIZE_NONE;
g->col_size[col].user.size = 0;
@@ -671,11 +671,11 @@ ewl_grid_column_w_remove(Ewl_Grid *g, int col)
* check bounds
*/
if (col < 0) {
- DWARNING("parameter 'col' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'col' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (col >= g->cols)
- ewl_grid_dimensions_set(g, col + 1, g->rows);
+ ewl_grid_dimensions_set(g, col + 1, g->rows);
g->col_size[col].resize_type = EWL_GRID_RESIZE_NORMAL;
g->col_size[col].user.size = 0;
@@ -702,7 +702,7 @@ ewl_grid_row_current_h_get(Ewl_Grid *g, int row)
DCHECK_TYPE_RET(g, EWL_GRID_TYPE, 0);
if ((row >= g->rows) || (row < 0))
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
DRETURN_INT(g->row_size[row].current_size, DLEVEL_STABLE);
}
@@ -725,11 +725,11 @@ ewl_grid_row_fixed_h_set(Ewl_Grid *g, int row, int height)
* check bounds
*/
if (row < 0) {
- DWARNING("parameter 'row' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'row' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (row >= g->rows)
- ewl_grid_dimensions_set(g, g->cols, row + 1);
+ ewl_grid_dimensions_set(g, g->cols, row + 1);
g->row_size[row].resize_type = EWL_GRID_RESIZE_FIXED;
g->row_size[row].user.size = height;
@@ -756,7 +756,7 @@ ewl_grid_row_fixed_h_get(Ewl_Grid *g, int row)
DCHECK_TYPE_RET(g, EWL_GRID_TYPE, 0);
if ((row >= g->rows) || (row < 0))
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
DRETURN_INT(g->row_size[row].user.size, DLEVEL_STABLE);
}
@@ -779,11 +779,11 @@ ewl_grid_row_relative_h_set(Ewl_Grid *g, int row, float relh)
* check bounds
*/
if (row < 0) {
- DWARNING("parameter 'row' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'row' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (row >= g->rows)
- ewl_grid_dimensions_set(g, g->cols, row + 1);
+ ewl_grid_dimensions_set(g, g->cols, row + 1);
g->row_size[row].resize_type = EWL_GRID_RESIZE_RELATIVE;
g->row_size[row].user.rel_size = relh;
@@ -810,7 +810,7 @@ ewl_grid_row_relative_h_get(Ewl_Grid *g, int row)
DCHECK_TYPE_RET(g, EWL_GRID_TYPE, 0.0);
if ((row >= g->rows) || (row < 0))
- DRETURN_FLOAT(0.0, DLEVEL_STABLE);
+ DRETURN_FLOAT(0.0, DLEVEL_STABLE);
DRETURN_FLOAT(g->row_size[row].user.rel_size, DLEVEL_STABLE);
}
@@ -832,11 +832,11 @@ ewl_grid_row_preferred_h_use(Ewl_Grid *g, int row)
* check bounds
*/
if (row < 0) {
- DWARNING("parameter 'row' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'row' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (row >= g->rows)
- ewl_grid_dimensions_set(g, g->cols, row + 1);
+ ewl_grid_dimensions_set(g, g->cols, row + 1);
g->row_size[row].resize_type = EWL_GRID_RESIZE_NONE;
g->row_size[row].user.size = 0;
@@ -864,11 +864,11 @@ ewl_grid_row_h_remove(Ewl_Grid *g, int row)
* check bounds
*/
if (row < 0) {
- DWARNING("parameter 'row' is out of bounds.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter 'row' is out of bounds.");
+ DRETURN(DLEVEL_STABLE);
}
else if (row >= g->rows)
- ewl_grid_dimensions_set(g, g->cols, row + 1);
+ ewl_grid_dimensions_set(g, g->cols, row + 1);
g->row_size[row].resize_type = EWL_GRID_RESIZE_NORMAL;
g->row_size[row].user.size = 0;
@@ -889,13 +889,13 @@ ewl_grid_row_h_remove(Ewl_Grid *g, int row)
*/
void
ewl_grid_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Grid *g;
Ewl_Grid_Child *c;
Ewl_Widget *child;
- int c_w = 0, c_h = 0; /* child width/height */
- int c_x = 0, c_y = 0; /* child x/y coordinate */
+ int c_w = 0, c_h = 0; /* child width/height */
+ int c_x = 0, c_y = 0; /* child x/y coordinate */
int col, row;
void (*go_next)(Ewl_Grid *g, int *c, int *r);
@@ -906,10 +906,10 @@ ewl_grid_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
g = EWL_GRID(w);
if (!g->map)
- ewl_grid_map_recalc(g);
+ ewl_grid_map_recalc(g);
if (g->data_dirty)
- ewl_grid_child_data_collect(g);
+ ewl_grid_child_data_collect(g);
ewl_grid_resize(g);
@@ -919,50 +919,50 @@ ewl_grid_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
ewl_grid_map_start_position_get(g, &col, &row);
if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
- go_next = ewl_grid_hmap_position_next;
+ go_next = ewl_grid_hmap_position_next;
else
- go_next = ewl_grid_vmap_position_next;
+ go_next = ewl_grid_vmap_position_next;
ecore_dlist_first_goto(EWL_CONTAINER(w)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(w)->children))) {
- if (UNMANAGED(child))
- continue;
-
- c = (Ewl_Grid_Child *)ewl_widget_data_get(child, (void *) g);
- if (c) {
- /*
- * calculate the geometry of the fixed widgets
- */
- /* calculate child widgets width */
- c_w = g->col_size[c->end_col].current_pos
- - g->col_size[c->start_col].current_pos
- + g->col_size[c->end_col].current_size;
-
- /* calculate child widgets height */
- c_h = g->row_size[c->end_row].current_pos
- - g->row_size[c->start_row].current_pos
- + g->row_size[c->end_row].current_size;
-
- /* calculate child widgets x coordinate */
- c_x = g->col_size[c->start_col].current_pos;
-
- /* calculate child widgets y coordinate */
- c_y = g->row_size[c->start_row].current_pos;
- }
- else {
- /*
- * get the geometry of the non-fixed widgets
- */
- c_w = g->col_size[col].current_size;
- c_h = g->row_size[row].current_size;
- c_x = g->col_size[col].current_pos;
- c_y = g->row_size[row].current_pos;
-
- go_next(g, &col, &row);
- }
-
- ewl_object_place(EWL_OBJECT(child), c_x, c_y, c_w, c_h);
- ewl_widget_configure(child);
+ if (UNMANAGED(child))
+ continue;
+
+ c = (Ewl_Grid_Child *)ewl_widget_data_get(child, (void *) g);
+ if (c) {
+ /*
+ * calculate the geometry of the fixed widgets
+ */
+ /* calculate child widgets width */
+ c_w = g->col_size[c->end_col].current_pos
+ - g->col_size[c->start_col].current_pos
+ + g->col_size[c->end_col].current_size;
+
+ /* calculate child widgets height */
+ c_h = g->row_size[c->end_row].current_pos
+ - g->row_size[c->start_row].current_pos
+ + g->row_size[c->end_row].current_size;
+
+ /* calculate child widgets x coordinate */
+ c_x = g->col_size[c->start_col].current_pos;
+
+ /* calculate child widgets y coordinate */
+ c_y = g->row_size[c->start_row].current_pos;
+ }
+ else {
+ /*
+ * get the geometry of the non-fixed widgets
+ */
+ c_w = g->col_size[col].current_size;
+ c_h = g->row_size[row].current_size;
+ c_x = g->col_size[col].current_pos;
+ c_y = g->row_size[row].current_pos;
+
+ go_next(g, &col, &row);
+ }
+
+ ewl_object_place(EWL_OBJECT(child), c_x, c_y, c_w, c_h);
+ ewl_widget_configure(child);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -978,7 +978,7 @@ ewl_grid_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_grid_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Grid *g;
@@ -1017,19 +1017,19 @@ ewl_grid_map_recalc(Ewl_Grid *g)
ecore_dlist_first_goto(EWL_CONTAINER(g)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(g)->children))) {
- if (UNMANAGED(child))
- continue;
-
- c = (Ewl_Grid_Child *) ewl_widget_data_get(child, (void *)g);
- if (!c) continue;
-
- /*
- * mark all positions that content a positioned widget
- */
- for (l = c->start_col; l <= c->end_col && l < g->cols; l++)
- for (k = c->start_row; k <= c->end_row
- && k < g->rows; k++)
- g->map[g->cols * k + l] = 1;
+ if (UNMANAGED(child))
+ continue;
+
+ c = (Ewl_Grid_Child *) ewl_widget_data_get(child, (void *)g);
+ if (!c) continue;
+
+ /*
+ * mark all positions that content a positioned widget
+ */
+ for (l = c->start_col; l <= c->end_col && l < g->cols; l++)
+ for (k = c->start_row; k <= c->end_row
+ && k < g->rows; k++)
+ g->map[g->cols * k + l] = 1;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1054,7 +1054,7 @@ ewl_grid_child_data_collect(Ewl_Grid *g)
DCHECK_TYPE(g, EWL_GRID_TYPE);
if (!g->map)
- ewl_grid_map_recalc(g);
+ ewl_grid_map_recalc(g);
/*
* setup the position stuff for the floating
@@ -1062,34 +1062,34 @@ ewl_grid_child_data_collect(Ewl_Grid *g)
*/
ewl_grid_map_start_position_get(g, &col, &row);
if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
- go_next = ewl_grid_hmap_position_next;
+ go_next = ewl_grid_hmap_position_next;
else
- go_next = ewl_grid_vmap_position_next;
+ go_next = ewl_grid_vmap_position_next;
/*
* First collect the data of the non-fixed postion widgets
*/
ecore_dlist_first_goto(EWL_CONTAINER(g)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(g)->children))) {
- int pref_w, pref_h;
+ int pref_w, pref_h;
- if (UNMANAGED(child))
- continue;
+ if (UNMANAGED(child))
+ continue;
- c = (Ewl_Grid_Child *) ewl_widget_data_get(child, (void *) g);
- if (c) continue;
+ c = (Ewl_Grid_Child *) ewl_widget_data_get(child, (void *) g);
+ if (c) continue;
- /*
- * go to the next free place
- */
- pref_w = ewl_object_preferred_w_get(EWL_OBJECT(child));
- pref_h = ewl_object_preferred_h_get(EWL_OBJECT(child));
- g->col_size[col].preferred_size =
- MAX(g->col_size[col].preferred_size, pref_w);
- g->row_size[row].preferred_size =
- MAX(g->row_size[row].preferred_size, pref_h);
+ /*
+ * go to the next free place
+ */
+ pref_w = ewl_object_preferred_w_get(EWL_OBJECT(child));
+ pref_h = ewl_object_preferred_h_get(EWL_OBJECT(child));
+ g->col_size[col].preferred_size =
+ MAX(g->col_size[col].preferred_size, pref_w);
+ g->row_size[row].preferred_size =
+ MAX(g->row_size[row].preferred_size, pref_h);
- go_next(g, &col, &row);
+ go_next(g, &col, &row);
}
/*
@@ -1097,106 +1097,106 @@ ewl_grid_child_data_collect(Ewl_Grid *g)
*/
ecore_dlist_first_goto(EWL_CONTAINER(g)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(g)->children))) {
- int pref_w = 0, pref_h = 0;
- int i;
-
- if (UNMANAGED(child))
- continue;
-
- c = (Ewl_Grid_Child *) ewl_widget_data_get(child, (void *) g);
- if (!c) continue;
-
- /*
- * first calculate the current preferred size
- * of the cells
- */
- for (i = c->start_col; i <= c->end_col; i++)
- pref_w += g->col_size[i].preferred_size;
-
- for (i = c->start_row; i <= c->end_row; i++)
- pref_h += g->row_size[i].preferred_size;
-
- pref_w = ewl_object_preferred_w_get(EWL_OBJECT(child)) - pref_w;
- pref_h = ewl_object_preferred_h_get(EWL_OBJECT(child)) - pref_h;
-
- if (pref_w > 0) {
- pref_w /= c->end_col - c->start_col + 1;
- for (i = c->start_col; i <= c->end_col; i++)
- g->col_size[i].preferred_size += pref_w;
- }
-
- if (pref_h > 0) {
- pref_h /= c->end_row - c->start_row + 1;
- for (i = c->start_row; i <= c->end_row; i++)
- g->row_size[i].preferred_size += pref_h;
- }
+ int pref_w = 0, pref_h = 0;
+ int i;
+
+ if (UNMANAGED(child))
+ continue;
+
+ c = (Ewl_Grid_Child *) ewl_widget_data_get(child, (void *) g);
+ if (!c) continue;
+
+ /*
+ * first calculate the current preferred size
+ * of the cells
+ */
+ for (i = c->start_col; i <= c->end_col; i++)
+ pref_w += g->col_size[i].preferred_size;
+
+ for (i = c->start_row; i <= c->end_row; i++)
+ pref_h += g->row_size[i].preferred_size;
+
+ pref_w = ewl_object_preferred_w_get(EWL_OBJECT(child)) - pref_w;
+ pref_h = ewl_object_preferred_h_get(EWL_OBJECT(child)) - pref_h;
+
+ if (pref_w > 0) {
+ pref_w /= c->end_col - c->start_col + 1;
+ for (i = c->start_col; i <= c->end_col; i++)
+ g->col_size[i].preferred_size += pref_w;
+ }
+
+ if (pref_h > 0) {
+ pref_h /= c->end_row - c->start_row + 1;
+ for (i = c->start_row; i <= c->end_row; i++)
+ g->row_size[i].preferred_size += pref_h;
+ }
}
/*
* calculate the preferred size
*/
if (g->homogeneous_h) {
- int i, size;
+ int i, size;
- for (i = 0, size = 0; i < g->cols; i++)
- size = MAX(size, g->col_size[i].preferred_size);
+ for (i = 0, size = 0; i < g->cols; i++)
+ size = MAX(size, g->col_size[i].preferred_size);
- ewl_object_preferred_inner_w_set(EWL_OBJECT(g), size * g->cols);
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(g), size * g->cols);
}
else {
- float rel;
- int i, fixed;
-
- rel = 0.0;
- fixed = 0;
- for (i = 0; i < g->cols; i++) {
- switch (g->col_size[i].resize_type) {
- case EWL_GRID_RESIZE_RELATIVE:
- rel += g->col_size[i].user.rel_size;
- break;
-
- case EWL_GRID_RESIZE_FIXED:
- fixed += g->col_size[i].user.size;
- break;
-
- default:
- fixed += g->col_size[i].preferred_size;
- }
- }
- ewl_object_preferred_inner_w_set(EWL_OBJECT(g),
- (int)(fixed / (1.0 - rel)));
+ float rel;
+ int i, fixed;
+
+ rel = 0.0;
+ fixed = 0;
+ for (i = 0; i < g->cols; i++) {
+ switch (g->col_size[i].resize_type) {
+ case EWL_GRID_RESIZE_RELATIVE:
+ rel += g->col_size[i].user.rel_size;
+ break;
+
+ case EWL_GRID_RESIZE_FIXED:
+ fixed += g->col_size[i].user.size;
+ break;
+
+ default:
+ fixed += g->col_size[i].preferred_size;
+ }
+ }
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(g),
+ (int)(fixed / (1.0 - rel)));
}
if (g->homogeneous_v) {
- int i, size;
+ int i, size;
- for (i = 0, size = 0; i < g->rows; i++)
- size = MAX(size, g->row_size[i].preferred_size);
+ for (i = 0, size = 0; i < g->rows; i++)
+ size = MAX(size, g->row_size[i].preferred_size);
- ewl_object_preferred_inner_h_set(EWL_OBJECT(g), size * g->rows);
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(g), size * g->rows);
}
else {
- float rel;
- int i, fixed;
-
- rel = 0.0;
- fixed = 0;
- for (i = 0; i < g->rows; i++) {
- switch (g->row_size[i].resize_type) {
- case EWL_GRID_RESIZE_RELATIVE:
- rel += g->row_size[i].user.rel_size;
- break;
-
- case EWL_GRID_RESIZE_FIXED:
- fixed += g->row_size[i].user.size;
- break;
-
- default:
- fixed += g->row_size[i].preferred_size;
- }
- }
- ewl_object_preferred_inner_h_set(EWL_OBJECT(g),
- (int)(fixed / (1.0 - rel)));
+ float rel;
+ int i, fixed;
+
+ rel = 0.0;
+ fixed = 0;
+ for (i = 0; i < g->rows; i++) {
+ switch (g->row_size[i].resize_type) {
+ case EWL_GRID_RESIZE_RELATIVE:
+ rel += g->row_size[i].user.rel_size;
+ break;
+
+ case EWL_GRID_RESIZE_FIXED:
+ fixed += g->row_size[i].user.size;
+ break;
+
+ default:
+ fixed += g->row_size[i].preferred_size;
+ }
+ }
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(g),
+ (int)(fixed / (1.0 - rel)));
}
g->data_dirty = FALSE;
@@ -1228,123 +1228,123 @@ ewl_grid_resize(Ewl_Grid *g)
* calculated the new columns' widths
*/
if (g->homogeneous_h) {
- for (i = 0; i < g->cols; i++)
- g->col_size[i].current_size = new_w / g->cols;
+ for (i = 0; i < g->cols; i++)
+ g->col_size[i].current_size = new_w / g->cols;
}
else {
- int var; /* the variable size part */
- int fixed; /* the fixed size part */
- double rel;
-
- var = fixed = 0;
- /*
- * first we calculate the different parts of the size
- */
- for (i = 0; i < g->cols; i++) {
- switch (g->col_size[i].resize_type) {
- case EWL_GRID_RESIZE_RELATIVE:
- fixed += g->col_size[i].user.rel_size
- * new_w;
- g->col_size[i].current_size =
- g->col_size[i].user.rel_size
- * new_w;
- break;
-
- case EWL_GRID_RESIZE_FIXED:
- fixed += g->col_size[i].user.size;
- g->col_size[i].current_size =
- g->col_size[i].user.size;
- break;
-
- case EWL_GRID_RESIZE_NONE:
- fixed += g->col_size[i].preferred_size;
- g->col_size[i].current_size =
- g->col_size[i].preferred_size;
- break;
-
- default:
- var += g->col_size[i].preferred_size;
-
- }
- }
-
- /*
- * we can only distribute the rest size to the
- * non-fixed ones
- */
- if (var != 0) {
- rel = (double)(new_w - fixed) / (double)var;
- for (i = 0; i < g->cols; i++) {
- if (g->col_size[i].resize_type
- != EWL_GRID_RESIZE_NORMAL)
- continue;
-
- g->col_size[i].current_size =
- (int)(g->col_size[i].preferred_size
- * rel);
- }
- }
+ int var; /* the variable size part */
+ int fixed; /* the fixed size part */
+ double rel;
+
+ var = fixed = 0;
+ /*
+ * first we calculate the different parts of the size
+ */
+ for (i = 0; i < g->cols; i++) {
+ switch (g->col_size[i].resize_type) {
+ case EWL_GRID_RESIZE_RELATIVE:
+ fixed += g->col_size[i].user.rel_size
+ * new_w;
+ g->col_size[i].current_size =
+ g->col_size[i].user.rel_size
+ * new_w;
+ break;
+
+ case EWL_GRID_RESIZE_FIXED:
+ fixed += g->col_size[i].user.size;
+ g->col_size[i].current_size =
+ g->col_size[i].user.size;
+ break;
+
+ case EWL_GRID_RESIZE_NONE:
+ fixed += g->col_size[i].preferred_size;
+ g->col_size[i].current_size =
+ g->col_size[i].preferred_size;
+ break;
+
+ default:
+ var += g->col_size[i].preferred_size;
+
+ }
+ }
+
+ /*
+ * we can only distribute the rest size to the
+ * non-fixed ones
+ */
+ if (var != 0) {
+ rel = (double)(new_w - fixed) / (double)var;
+ for (i = 0; i < g->cols; i++) {
+ if (g->col_size[i].resize_type
+ != EWL_GRID_RESIZE_NORMAL)
+ continue;
+
+ g->col_size[i].current_size =
+ (int)(g->col_size[i].preferred_size
+ * rel);
+ }
+ }
}
/*
* calculated the new rows' heights
*/
if (g->homogeneous_v) {
- for (i = 0; i < g->rows; i++)
- g->row_size[i].current_size = new_h / g->rows;
+ for (i = 0; i < g->rows; i++)
+ g->row_size[i].current_size = new_h / g->rows;
}
else {
- int var; /* the variable size part */
- int fixed; /* the fixed size part */
- double rel;
-
- var = fixed = 0;
- /*
- * first we calculate the different parts of the size
- */
- for (i = 0; i < g->rows; i++) {
- switch (g->row_size[i].resize_type) {
- case EWL_GRID_RESIZE_RELATIVE:
- fixed += g->row_size[i].user.rel_size
- * new_h;
- g->row_size[i].current_size =
- g->row_size[i].user.rel_size
- * new_h;
- break;
-
- case EWL_GRID_RESIZE_FIXED:
- fixed += g->row_size[i].user.size;
- g->row_size[i].current_size =
- g->row_size[i].user.size;
- break;
-
- case EWL_GRID_RESIZE_NONE:
- fixed += g->row_size[i].preferred_size;
- g->row_size[i].current_size =
- g->row_size[i].preferred_size;
- break;
-
- default:
- var += g->row_size[i].preferred_size;
- }
- }
-
- /*
- * we can only distribute the rest size to the
- * non-fixed ones
- */
- if (var != 0) {
- rel = (double)(new_h - fixed) / (double)var;
- for (i = 0; i < g->rows; i++) {
- if (g->row_size[i].resize_type
- != EWL_GRID_RESIZE_NORMAL)
- continue;
-
- g->row_size[i].current_size =
- (int)(g->row_size[i].preferred_size
- * rel);
- }
- }
+ int var; /* the variable size part */
+ int fixed; /* the fixed size part */
+ double rel;
+
+ var = fixed = 0;
+ /*
+ * first we calculate the different parts of the size
+ */
+ for (i = 0; i < g->rows; i++) {
+ switch (g->row_size[i].resize_type) {
+ case EWL_GRID_RESIZE_RELATIVE:
+ fixed += g->row_size[i].user.rel_size
+ * new_h;
+ g->row_size[i].current_size =
+ g->row_size[i].user.rel_size
+ * new_h;
+ break;
+
+ case EWL_GRID_RESIZE_FIXED:
+ fixed += g->row_size[i].user.size;
+ g->row_size[i].current_size =
+ g->row_size[i].user.size;
+ break;
+
+ case EWL_GRID_RESIZE_NONE:
+ fixed += g->row_size[i].preferred_size;
+ g->row_size[i].current_size =
+ g->row_size[i].preferred_size;
+ break;
+
+ default:
+ var += g->row_size[i].preferred_size;
+ }
+ }
+
+ /*
+ * we can only distribute the rest size to the
+ * non-fixed ones
+ */
+ if (var != 0) {
+ rel = (double)(new_h - fixed) / (double)var;
+ for (i = 0; i < g->rows; i++) {
+ if (g->row_size[i].resize_type
+ != EWL_GRID_RESIZE_NORMAL)
+ continue;
+
+ g->row_size[i].current_size =
+ (int)(g->row_size[i].preferred_size
+ * rel);
+ }
+ }
}
/*
@@ -1354,38 +1354,38 @@ ewl_grid_resize(Ewl_Grid *g)
*/
left_over = new_w;
for (i = 0; i < g->cols; i++)
- left_over -= g->col_size[i].current_size;
+ left_over -= g->col_size[i].current_size;
if (g->cols == 0)
- g->cols = 1;
+ g->cols = 1;
while (left_over != 0) {
- if (left_over > 0) {
- g->col_size[left_over % g->cols].current_size += 1;
- left_over--;
- } else if (left_over < 0) {
- left_over2 = 0 - left_over;
- g->col_size[left_over2 % g->cols].current_size -= 1;
- left_over++;
- }
+ if (left_over > 0) {
+ g->col_size[left_over % g->cols].current_size += 1;
+ left_over--;
+ } else if (left_over < 0) {
+ left_over2 = 0 - left_over;
+ g->col_size[left_over2 % g->cols].current_size -= 1;
+ left_over++;
+ }
}
left_over = new_h;
for (i = 0; i < g->rows; i++)
- left_over -= g->row_size[i].current_size;
+ left_over -= g->row_size[i].current_size;
if (g->rows == 0)
- g->rows = 1;
+ g->rows = 1;
while (left_over != 0) {
- if (left_over > 0) {
- g->row_size[left_over % g->rows].current_size += 1;
- left_over--;
- } else if (left_over < 0) {
- left_over2 = 0 - left_over;
- g->row_size[left_over2 % g->rows].current_size -= 1;
- left_over++;
- }
+ if (left_over > 0) {
+ g->row_size[left_over % g->rows].current_size += 1;
+ left_over--;
+ } else if (left_over < 0) {
+ left_over2 = 0 - left_over;
+ g->row_size[left_over2 % g->rows].current_size -= 1;
+ left_over++;
+ }
}
/*
@@ -1393,14 +1393,14 @@ ewl_grid_resize(Ewl_Grid *g)
*/
pos = CURRENT_X(g);
for (i = 0; i < g->cols; i++) {
- g->col_size[i].current_pos = pos;
- pos += g->col_size[i].current_size;
+ g->col_size[i].current_pos = pos;
+ pos += g->col_size[i].current_size;
}
pos = CURRENT_Y(g);
for (i = 0; i < g->rows; i++) {
- g->row_size[i].current_pos = pos;
- pos += g->row_size[i].current_size;
+ g->row_size[i].current_pos = pos;
+ pos += g->row_size[i].current_size;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1431,11 +1431,11 @@ ewl_grid_hmap_position_next(Ewl_Grid *g, int *c, int *r)
row = *r;
do {
- col++;
- if (col >= g->cols) {
- col = 0;
- row++;
- }
+ col++;
+ if (col >= g->cols) {
+ col = 0;
+ row++;
+ }
} while (g->map[col + (row * g->cols)] != 0);
*c = col;
@@ -1469,11 +1469,11 @@ ewl_grid_vmap_position_next(Ewl_Grid *g, int *c, int *r)
row = *r;
do {
- row++;
- if (row >= g->rows) {
- row = 0;
- col++;
- }
+ row++;
+ if (row >= g->rows) {
+ row = 0;
+ col++;
+ }
} while (g->map[col + (row * g->cols)] != 0);
*c = col;
@@ -1503,10 +1503,10 @@ ewl_grid_map_start_position_get(Ewl_Grid *g, int *c, int *r)
*r = 0;
if (g->map && *g->map != 0) {
- if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
- ewl_grid_hmap_position_next(g, c, r);
- else
- ewl_grid_vmap_position_next(g, c, r);
+ if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
+ ewl_grid_hmap_position_next(g, c, r);
+ else
+ ewl_grid_vmap_position_next(g, c, r);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1533,12 +1533,12 @@ ewl_grid_cb_child_add(Ewl_Container *p, Ewl_Widget *c __UNUSED__)
g->space++;
if (g->space > (g->cols * g->rows)) {
- if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
- ewl_grid_dimensions_set(g, g->cols,
- (g->space / g->cols) + 1);
- else
- ewl_grid_dimensions_set(g, (g->space / g->rows) + 1,
- g->rows);
+ if (g->orientation == EWL_ORIENTATION_HORIZONTAL)
+ ewl_grid_dimensions_set(g, g->cols,
+ (g->space / g->cols) + 1);
+ else
+ ewl_grid_dimensions_set(g, (g->space / g->rows) + 1,
+ g->rows);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1568,12 +1568,12 @@ ewl_grid_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx __UNUSED__)
child = (Ewl_Grid_Child *)ewl_widget_data_get(w, g);
if (child) {
- g->space -= (child->end_row - child->start_row + 1)
- * (child->end_col - child->start_col + 1);
- FREE(child);
+ g->space -= (child->end_row - child->start_row + 1)
+ * (child->end_col - child->start_col + 1);
+ FREE(child);
}
else
- g->space--;
+ g->space--;
IF_FREE(g->map);
g->data_dirty = TRUE;
@@ -1612,8 +1612,8 @@ ewl_grid_cb_child_show(Ewl_Container *p, Ewl_Widget *child __UNUSED__)
*/
void
ewl_grid_cb_child_resize(Ewl_Container *p, Ewl_Widget *child __UNUSED__,
- int size __UNUSED__,
- Ewl_Orientation o __UNUSED__)
+ int size __UNUSED__,
+ Ewl_Orientation o __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(p);
diff --git a/src/lib/ewl_grid.h b/src/lib/ewl_grid.h
index 841e2ae..23bd139 100644
--- a/src/lib/ewl_grid.h
+++ b/src/lib/ewl_grid.h
@@ -41,13 +41,13 @@ typedef struct Ewl_Grid_Info Ewl_Grid_Info;
*/
struct Ewl_Grid_Info
{
- int current_size; /**< the current size */
- int current_pos; /**< the current position */
- int preferred_size; /**< The greatest preferred size of a widget inside */
+ int current_size; /**< the current size */
+ int current_pos; /**< the current position */
+ int preferred_size; /**< The greatest preferred size of a widget inside */
union {
- int size; /**< The size set by the user */
- float rel_size; /**< The relative size */
- } user; /**< The user set values for the grid */
+ int size; /**< The size set by the user */
+ float rel_size; /**< The relative size */
+ } user; /**< The user set values for the grid */
Ewl_Grid_Resize_Type resize_type; /**< Are there values set by the user */
};
@@ -68,22 +68,22 @@ typedef struct Ewl_Grid Ewl_Grid;
*/
struct Ewl_Grid
{
- Ewl_Container container; /**< Inherit from Ewl_Container */
+ Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Grid_Info *col_size; /**< Horizontal/vertical size of the columns */
- Ewl_Grid_Info *row_size; /**< Horizontal/vertical size of the rows */
- unsigned char data_dirty:1; /**< flag if the size of the columns and rows must
- be recalculated */
- unsigned char homogeneous_h:1; /**< Horizontal homogeneous flag */
- unsigned char homogeneous_v:1; /**< Vertical homogeneous flag */
+ Ewl_Grid_Info *col_size; /**< Horizontal/vertical size of the columns */
+ Ewl_Grid_Info *row_size; /**< Horizontal/vertical size of the rows */
+ unsigned char data_dirty:1; /**< flag if the size of the columns and rows must
+ be recalculated */
+ unsigned char homogeneous_h:1; /**< Horizontal homogeneous flag */
+ unsigned char homogeneous_v:1; /**< Vertical homogeneous flag */
- Ewl_Orientation orientation; /**< The grid orientation */
+ Ewl_Orientation orientation; /**< The grid orientation */
- int rows; /**< Row count */
- int cols; /**< Column count */
- int space; /**< Space count */
+ int rows; /**< Row count */
+ int cols; /**< Column count */
+ int space; /**< Space count */
- char *map; /**< Map of the child that have a postion */
+ char *map; /**< Map of the child that have a postion */
};
/**
@@ -96,51 +96,51 @@ typedef struct Ewl_Grid_Child Ewl_Grid_Child;
*/
struct Ewl_Grid_Child
{
- int start_col; /**< The start column */
- int start_row; /**< The start row */
+ int start_col; /**< The start column */
+ int start_row; /**< The start row */
- int end_col; /**< The end column */
- int end_row; /**< The end row */
+ int end_col; /**< The end column */
+ int end_row; /**< The end row */
};
Ewl_Widget *ewl_grid_new(void);
-int ewl_grid_init(Ewl_Grid *g);
-
-void ewl_grid_child_position_set(Ewl_Grid *g, Ewl_Widget *child,
- int start_col, int end_col, int start_row,
- int end_row);
-void ewl_grid_child_position_get(Ewl_Grid *g, Ewl_Widget *child,
- int *start_col, int *end_col, int *start_row,
- int *end_row);
-
-void ewl_grid_dimensions_set(Ewl_Grid *g, int col, int row);
-void ewl_grid_dimensions_get(Ewl_Grid *g, int *col, int *row);
-
-int ewl_grid_column_current_w_get(Ewl_Grid *g, int col);
-void ewl_grid_column_fixed_w_set(Ewl_Grid *g, int col, int width);
-int ewl_grid_column_fixed_w_get(Ewl_Grid *g, int col);
-void ewl_grid_column_relative_w_set(Ewl_Grid *g, int col, float relw);
-float ewl_grid_column_relative_w_get(Ewl_Grid *g, int col);
-void ewl_grid_column_preferred_w_use(Ewl_Grid *g, int col);
-void ewl_grid_column_w_remove(Ewl_Grid *g, int col);
-
-int ewl_grid_row_current_h_get(Ewl_Grid *g, int row);
-void ewl_grid_row_fixed_h_set(Ewl_Grid *g, int row, int height);
-int ewl_grid_row_fixed_h_get(Ewl_Grid *g, int row);
-void ewl_grid_row_relative_h_set(Ewl_Grid *g, int col, float relh);
-float ewl_grid_row_relative_h_get(Ewl_Grid *g, int col);
-void ewl_grid_row_preferred_h_use(Ewl_Grid *g, int col);
-void ewl_grid_row_h_remove(Ewl_Grid *g, int row);
-
-void ewl_grid_orientation_set(Ewl_Grid *g, Ewl_Orientation orientation);
+int ewl_grid_init(Ewl_Grid *g);
+
+void ewl_grid_child_position_set(Ewl_Grid *g, Ewl_Widget *child,
+ int start_col, int end_col, int start_row,
+ int end_row);
+void ewl_grid_child_position_get(Ewl_Grid *g, Ewl_Widget *child,
+ int *start_col, int *end_col, int *start_row,
+ int *end_row);
+
+void ewl_grid_dimensions_set(Ewl_Grid *g, int col, int row);
+void ewl_grid_dimensions_get(Ewl_Grid *g, int *col, int *row);
+
+int ewl_grid_column_current_w_get(Ewl_Grid *g, int col);
+void ewl_grid_column_fixed_w_set(Ewl_Grid *g, int col, int width);
+int ewl_grid_column_fixed_w_get(Ewl_Grid *g, int col);
+void ewl_grid_column_relative_w_set(Ewl_Grid *g, int col, float relw);
+float ewl_grid_column_relative_w_get(Ewl_Grid *g, int col);
+void ewl_grid_column_preferred_w_use(Ewl_Grid *g, int col);
+void ewl_grid_column_w_remove(Ewl_Grid *g, int col);
+
+int ewl_grid_row_current_h_get(Ewl_Grid *g, int row);
+void ewl_grid_row_fixed_h_set(Ewl_Grid *g, int row, int height);
+int ewl_grid_row_fixed_h_get(Ewl_Grid *g, int row);
+void ewl_grid_row_relative_h_set(Ewl_Grid *g, int col, float relh);
+float ewl_grid_row_relative_h_get(Ewl_Grid *g, int col);
+void ewl_grid_row_preferred_h_use(Ewl_Grid *g, int col);
+void ewl_grid_row_h_remove(Ewl_Grid *g, int row);
+
+void ewl_grid_orientation_set(Ewl_Grid *g, Ewl_Orientation orientation);
Ewl_Orientation ewl_grid_orientation_get(Ewl_Grid *g);
-void ewl_grid_homogeneous_set(Ewl_Grid *g, unsigned int h);
+void ewl_grid_homogeneous_set(Ewl_Grid *g, unsigned int h);
-void ewl_grid_hhomogeneous_set(Ewl_Grid *g, unsigned int h);
+void ewl_grid_hhomogeneous_set(Ewl_Grid *g, unsigned int h);
unsigned int ewl_grid_hhomogeneous_get(Ewl_Grid *g);
-void ewl_grid_vhomogeneous_set(Ewl_Grid *g, unsigned int h);
+void ewl_grid_vhomogeneous_set(Ewl_Grid *g, unsigned int h);
unsigned int ewl_grid_vhomogeneous_get(Ewl_Grid *g);
/*
@@ -152,7 +152,7 @@ void ewl_grid_cb_child_add(Ewl_Container *p, Ewl_Widget *c);
void ewl_grid_cb_child_remove(Ewl_Container *p, Ewl_Widget *c, int idx);
void ewl_grid_cb_child_show(Ewl_Container *p, Ewl_Widget *child);
void ewl_grid_cb_child_resize(Ewl_Container *p, Ewl_Widget *child,
- int size, Ewl_Orientation o);
+ int size, Ewl_Orientation o);
/**
* @}
diff --git a/src/lib/ewl_histogram.c b/src/lib/ewl_histogram.c
index ad12042..63521c9 100644
--- a/src/lib/ewl_histogram.c
+++ b/src/lib/ewl_histogram.c
@@ -23,10 +23,10 @@ ewl_histogram_new(void)
hist = NEW(Ewl_Histogram, 1);
if (!hist)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_histogram_init(hist)) {
- FREE(hist);
+ FREE(hist);
}
DRETURN_PTR(EWL_WIDGET(hist), DLEVEL_STABLE);
@@ -46,12 +46,12 @@ ewl_histogram_init(Ewl_Histogram *hist)
DCHECK_PARAM_PTR_RET(hist, FALSE);
if (!ewl_image_init(EWL_IMAGE(hist)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_HISTOGRAM_TYPE);
ewl_widget_inherit(w, EWL_HISTOGRAM_TYPE);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_histogram_cb_configure, NULL);
+ ewl_histogram_cb_configure, NULL);
ewl_object_preferred_inner_size_set(EWL_OBJECT(hist), 256, 256);
hist->channel = EWL_HISTOGRAM_CHANNEL_R;
@@ -69,7 +69,7 @@ ewl_histogram_init(Ewl_Histogram *hist)
*/
void
ewl_histogram_color_set(Ewl_Histogram *hist, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(hist);
@@ -95,7 +95,7 @@ ewl_histogram_color_set(Ewl_Histogram *hist, unsigned int r, unsigned int g,
*/
void
ewl_histogram_color_get(Ewl_Histogram *hist, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a)
+ unsigned int *b, unsigned int *a)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(hist);
@@ -130,7 +130,7 @@ ewl_histogram_channel_set(Ewl_Histogram *hist, Ewl_Histogram_Channel channel)
hist->channel = channel;
if (hist->source && REALIZED(hist->source))
- ewl_histogram_cb_data_load(EWL_WIDGET(hist), NULL, hist);
+ ewl_histogram_cb_data_load(EWL_WIDGET(hist), NULL, hist);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -167,11 +167,11 @@ ewl_histogram_image_set(Ewl_Histogram *hist, Ewl_Image *image)
hist->source = image;
if (REALIZED(image))
- ewl_histogram_cb_data_load(EWL_WIDGET(hist), NULL, hist);
+ ewl_histogram_cb_data_load(EWL_WIDGET(hist), NULL, hist);
/* Append the callback to catch an obscure/reveal */
ewl_callback_append(EWL_WIDGET(image), EWL_CALLBACK_REVEAL,
- ewl_histogram_cb_data_load, hist);
+ ewl_histogram_cb_data_load, hist);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -201,7 +201,7 @@ ewl_histogram_image_get(Ewl_Histogram *hist)
*/
void
ewl_histogram_cb_configure(Ewl_Widget *w, void *event __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -209,7 +209,7 @@ ewl_histogram_cb_configure(Ewl_Widget *w, void *event __UNUSED__,
/* Only bother drawing if we've seen some usable data. */
if (EWL_HISTOGRAM(w)->maxv)
- ewl_histogram_draw(EWL_HISTOGRAM(w));
+ ewl_histogram_draw(EWL_HISTOGRAM(w));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -234,36 +234,36 @@ ewl_histogram_cb_data_load(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *
DCHECK_TYPE(hist, EWL_HISTOGRAM_TYPE);
if (!hist->source || !REALIZED(hist->source))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
data = evas_object_image_data_get(hist->source->image, 0);
evas_object_image_size_get(hist->source->image, &width, &height);
for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
- unsigned int color;
- unsigned char brightness;
-
- color = *data;
- switch (hist->channel) {
-
- case EWL_HISTOGRAM_CHANNEL_R:
- brightness = R_CALC(color);
- break;
- case EWL_HISTOGRAM_CHANNEL_G:
- brightness = G_CALC(color);
- break;
- case EWL_HISTOGRAM_CHANNEL_B:
- brightness = B_CALC(color);
- break;
- case EWL_HISTOGRAM_CHANNEL_Y:
- default:
- brightness = Y_CALC(color);
- break;
- }
- hist->graph[brightness]++;
- data++;
- }
+ for (x = 0; x < width; x++) {
+ unsigned int color;
+ unsigned char brightness;
+
+ color = *data;
+ switch (hist->channel) {
+
+ case EWL_HISTOGRAM_CHANNEL_R:
+ brightness = R_CALC(color);
+ break;
+ case EWL_HISTOGRAM_CHANNEL_G:
+ brightness = G_CALC(color);
+ break;
+ case EWL_HISTOGRAM_CHANNEL_B:
+ brightness = B_CALC(color);
+ break;
+ case EWL_HISTOGRAM_CHANNEL_Y:
+ default:
+ brightness = Y_CALC(color);
+ break;
+ }
+ hist->graph[brightness]++;
+ data++;
+ }
}
/*
@@ -272,8 +272,8 @@ ewl_histogram_cb_data_load(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *
* and this lookup is over a fixed data size.
*/
for (x = 0; x < 256; x++) {
- if (hist->graph[x] > maxv)
- maxv = hist->graph[x];
+ if (hist->graph[x] > maxv)
+ maxv = hist->graph[x];
}
hist->maxv = maxv;
@@ -302,69 +302,69 @@ ewl_histogram_draw(Ewl_Histogram *hist)
dst = data = evas_object_image_data_get(img, 1);
if (!data)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* If no color specified, choose a sane default for the channel
* represented.
*/
if (!hist->color.a) {
- color = (unsigned int)(128 << 24);
- switch (hist->channel) {
- case EWL_HISTOGRAM_CHANNEL_R:
- color |= (unsigned int)(128 << 16);
- break;
- case EWL_HISTOGRAM_CHANNEL_G:
- color |= (unsigned int)(128 << 8);
- break;
- case EWL_HISTOGRAM_CHANNEL_B:
- color |= (unsigned int)(128);
- break;
- default:
- break;
- }
+ color = (unsigned int)(128 << 24);
+ switch (hist->channel) {
+ case EWL_HISTOGRAM_CHANNEL_R:
+ color |= (unsigned int)(128 << 16);
+ break;
+ case EWL_HISTOGRAM_CHANNEL_G:
+ color |= (unsigned int)(128 << 8);
+ break;
+ case EWL_HISTOGRAM_CHANNEL_B:
+ color |= (unsigned int)(128);
+ break;
+ default:
+ break;
+ }
}
else
- color = (unsigned int)(hist->color.a << 24 |
- hist->color.r << 16 |
- hist->color.g << 8 |
- hist->color.b);
+ color = (unsigned int)(hist->color.a << 24 |
+ hist->color.r << 16 |
+ hist->color.g << 8 |
+ hist->color.b);
for (y = 0; y < img_h; y++) {
- for (x = 0; x < img_w; x++) {
- int index;
- int cutoff;
- int x_scale;
- int w1, w2;
-
- /* Determine the base index for this x position */
- x_scale = x << 8;
- index = x_scale / img_w;
-
- /*
- * Determine distance between index points.
- * Used to determine rounding error and distance from
- * next point.
- * This is at x * 256 scale.
- */
- w1 = index * img_w;
- w2 = w1 + img_w;
-
- cutoff = hist->graph[index];
-
- /* Determine if this index should be weighted */
- if ((x_scale != w1) && (index < 255)
- && (cutoff || hist->graph[index + 1])) {
- cutoff = (cutoff * (w2 - x_scale));
- cutoff += (hist->graph[index + 1] * (x_scale - w1));
- cutoff = (cutoff / (w2 - w1));
- }
-
- cutoff = (img_h * cutoff) / hist->maxv;
-
- *dst = ((img_h - y) < cutoff ? color : 0x0);
- dst++;
- }
+ for (x = 0; x < img_w; x++) {
+ int index;
+ int cutoff;
+ int x_scale;
+ int w1, w2;
+
+ /* Determine the base index for this x position */
+ x_scale = x << 8;
+ index = x_scale / img_w;
+
+ /*
+ * Determine distance between index points.
+ * Used to determine rounding error and distance from
+ * next point.
+ * This is at x * 256 scale.
+ */
+ w1 = index * img_w;
+ w2 = w1 + img_w;
+
+ cutoff = hist->graph[index];
+
+ /* Determine if this index should be weighted */
+ if ((x_scale != w1) && (index < 255)
+ && (cutoff || hist->graph[index + 1])) {
+ cutoff = (cutoff * (w2 - x_scale));
+ cutoff += (hist->graph[index + 1] * (x_scale - w1));
+ cutoff = (cutoff / (w2 - w1));
+ }
+
+ cutoff = (img_h * cutoff) / hist->maxv;
+
+ *dst = ((img_h - y) < cutoff ? color : 0x0);
+ dst++;
+ }
}
evas_object_image_data_set(img, data);
diff --git a/src/lib/ewl_histogram.h b/src/lib/ewl_histogram.h
index 2bfeca6..3370243 100644
--- a/src/lib/ewl_histogram.h
+++ b/src/lib/ewl_histogram.h
@@ -53,21 +53,21 @@ struct Ewl_Histogram
};
Ewl_Widget *ewl_histogram_new(void);
-int ewl_histogram_init(Ewl_Histogram *histogram);
+int ewl_histogram_init(Ewl_Histogram *histogram);
-void ewl_histogram_color_set(Ewl_Histogram *histogram,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_histogram_color_get(Ewl_Histogram *histogram,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a);
+void ewl_histogram_color_set(Ewl_Histogram *histogram,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_histogram_color_get(Ewl_Histogram *histogram,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a);
-void ewl_histogram_image_set(Ewl_Histogram *histogram,
- Ewl_Image *image);
+void ewl_histogram_image_set(Ewl_Histogram *histogram,
+ Ewl_Image *image);
Ewl_Image *ewl_histogram_image_get(Ewl_Histogram *histogram);
-void ewl_histogram_channel_set(Ewl_Histogram *histogram,
- Ewl_Histogram_Channel channel);
+void ewl_histogram_channel_set(Ewl_Histogram *histogram,
+ Ewl_Histogram_Channel channel);
Ewl_Histogram_Channel ewl_histogram_channel_get(Ewl_Histogram *histogram);
/*
diff --git a/src/lib/ewl_icon.c b/src/lib/ewl_icon.c
index fffcd0d..95d57d5 100644
--- a/src/lib/ewl_icon.c
+++ b/src/lib/ewl_icon.c
@@ -42,12 +42,12 @@ ewl_icon_new(void)
w = NEW(Ewl_Icon, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_icon_init(EWL_ICON(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -74,7 +74,7 @@ ewl_icon_simple_new(void)
w = ewl_icon_new();
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_icon_label_complex_set(EWL_ICON(w), FALSE);
ewl_icon_label_compressed_set(EWL_ICON(w), FALSE);
@@ -96,7 +96,7 @@ ewl_icon_init(Ewl_Icon *icon)
DCHECK_PARAM_PTR_RET(icon, FALSE);
if (!ewl_stock_init(EWL_STOCK((icon))))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_stock_functions_set(EWL_STOCK(icon), &stock_funcs);
ewl_stock_type_set(EWL_STOCK(icon), EWL_STOCK_NONE);
@@ -109,7 +109,7 @@ ewl_icon_init(Ewl_Icon *icon)
ewl_widget_inherit(EWL_WIDGET(icon), EWL_ICON_TYPE);
ewl_callback_prepend(EWL_WIDGET(icon), EWL_CALLBACK_DESTROY,
- ewl_icon_cb_destroy, NULL);
+ ewl_icon_cb_destroy, NULL);
/*
* set some defaults
*/
@@ -134,7 +134,7 @@ ewl_icon_type_set(Ewl_Icon *icon, Ewl_Icon_Type type)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->type == type)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
icon->type = type;
@@ -142,10 +142,10 @@ ewl_icon_type_set(Ewl_Icon *icon, Ewl_Icon_Type type)
* data */
if (icon->extended)
{
- if (type == EWL_ICON_TYPE_SHORT)
- ewl_widget_hide(icon->extended);
- else
- ewl_widget_show(icon->extended);
+ if (type == EWL_ICON_TYPE_SHORT)
+ ewl_widget_hide(icon->extended);
+ else
+ ewl_widget_show(icon->extended);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -180,7 +180,7 @@ ewl_icon_part_hide(Ewl_Icon *icon, Ewl_Icon_Part part)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->hidden == part)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
icon->hidden = part;
@@ -207,44 +207,44 @@ ewl_icon_image_set(Ewl_Icon *icon, const char *file, const char *key)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->image)
- ewl_widget_destroy(icon->image);
+ ewl_widget_destroy(icon->image);
img = ewl_image_new();
ewl_image_file_set(EWL_IMAGE(img), file, key);
if (icon->thumbnailing)
{
- icon->image = ewl_image_thumbnail_get(EWL_IMAGE(img));
- ewl_callback_append(icon->image, EWL_CALLBACK_VALUE_CHANGED,
- ewl_icon_cb_thumb_value_changed, icon);
+ icon->image = ewl_image_thumbnail_get(EWL_IMAGE(img));
+ ewl_callback_append(icon->image, EWL_CALLBACK_VALUE_CHANGED,
+ ewl_icon_cb_thumb_value_changed, icon);
}
else
- icon->image = img;
+ icon->image = img;
ewl_icon_constrain_set(icon, icon->constrain);
ewl_image_proportional_set(EWL_IMAGE(icon->image), TRUE);
ewl_object_alignment_set(EWL_OBJECT(icon->image),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_widget_internal_set(icon->image, TRUE);
ewl_container_child_prepend(EWL_CONTAINER(icon), icon->image);
if (icon->hidden == EWL_ICON_PART_IMAGE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!icon->thumbnailing)
- ewl_icon_parts_update(icon);
+ ewl_icon_parts_update(icon);
else if (!icon->alt)
{
- const char *path;
+ const char *path;
- path = ewl_icon_theme_icon_path_get(
- EWL_ICON_IMAGE_LOADING, 0),
- ewl_image_file_set(EWL_IMAGE(icon->image), path,
- EWL_ICON_IMAGE_LOADING);
- ewl_widget_show(icon->image);
+ path = ewl_icon_theme_icon_path_get(
+ EWL_ICON_IMAGE_LOADING, 0),
+ ewl_image_file_set(EWL_IMAGE(icon->image), path,
+ EWL_ICON_IMAGE_LOADING);
+ ewl_widget_show(icon->image);
}
else
- ewl_widget_show(icon->alt);
+ ewl_widget_show(icon->alt);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -265,7 +265,7 @@ ewl_icon_image_file_get(Ewl_Icon *icon)
DCHECK_TYPE_RET(icon, EWL_ICON_TYPE, NULL);
if (icon->image)
- file = ewl_image_file_path_get(EWL_IMAGE(icon->image));
+ file = ewl_image_file_path_get(EWL_IMAGE(icon->image));
DRETURN_PTR(file, DLEVEL_STABLE);
}
@@ -284,15 +284,15 @@ ewl_icon_editable_set(Ewl_Icon *icon, unsigned int e)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->editable == e)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
icon->editable = e;
if (icon->editable && icon->label)
- ewl_callback_append(icon->label, EWL_CALLBACK_MOUSE_DOWN,
- ewl_icon_cb_label_mouse_down, icon);
+ ewl_callback_append(icon->label, EWL_CALLBACK_MOUSE_DOWN,
+ ewl_icon_cb_label_mouse_down, icon);
else if (icon->label)
- ewl_callback_del(icon->label, EWL_CALLBACK_MOUSE_DOWN,
- ewl_icon_cb_label_mouse_down);
+ ewl_callback_del(icon->label, EWL_CALLBACK_MOUSE_DOWN,
+ ewl_icon_cb_label_mouse_down);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -327,17 +327,17 @@ ewl_icon_label_set(Ewl_Icon *icon, const char *label)
if (!label)
{
- if (icon->label)
- {
- ewl_icon_label_text_set(icon, NULL);
- IF_FREE(icon->label_text);
- }
+ if (icon->label)
+ {
+ ewl_icon_label_text_set(icon, NULL);
+ IF_FREE(icon->label_text);
+ }
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
if (!icon->label)
- ewl_icon_label_build(icon);
+ ewl_icon_label_build(icon);
icon->label_text = strdup(label);
ewl_icon_label_update(icon);
@@ -358,7 +358,7 @@ ewl_icon_label_get(Ewl_Icon *icon)
DCHECK_TYPE_RET(icon, EWL_ICON_TYPE, NULL);
if (!icon->label)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
DRETURN_PTR(icon->label_text, DLEVEL_STABLE);
}
@@ -381,16 +381,16 @@ ewl_icon_extended_data_set(Ewl_Icon *icon, Ewl_Widget *ext)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->extended)
- ewl_widget_destroy(icon->extended);
+ ewl_widget_destroy(icon->extended);
icon->extended = ext;
ewl_widget_internal_set(icon->extended, TRUE);
ewl_container_child_append(EWL_CONTAINER(icon), icon->extended);
if (icon->type == EWL_ICON_TYPE_SHORT)
- ewl_widget_hide(icon->extended);
+ ewl_widget_hide(icon->extended);
else
- ewl_widget_show(icon->extended);
+ ewl_widget_show(icon->extended);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -425,7 +425,7 @@ ewl_icon_constrain_set(Ewl_Icon *icon, unsigned int val)
icon->constrain = val;
if (icon->image)
- ewl_image_constrain_set(EWL_IMAGE(icon->image), val);
+ ewl_image_constrain_set(EWL_IMAGE(icon->image), val);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -460,7 +460,7 @@ ewl_icon_label_compressed_set(Ewl_Icon *icon, unsigned int compress)
/* nothing to do if no compression change */
if (compress == icon->compress_label)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
icon->compress_label = !!compress;
ewl_icon_label_update(icon);
@@ -498,12 +498,12 @@ ewl_icon_label_complex_set(Ewl_Icon *icon, unsigned int c)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->complex_label == !!c)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
icon->complex_label = !!c;
if (!icon->label)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* we are now switching from Ewl_Label to Ewl_Text
@@ -549,7 +549,7 @@ ewl_icon_thumbnailing_set(Ewl_Icon *icon, unsigned int t)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->thumbnailing == !!t)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
icon->thumbnailing = !!t;
@@ -588,8 +588,8 @@ ewl_icon_alt_text_set(Ewl_Icon *icon, const char *txt)
if (icon->alt)
{
- ewl_label_text_set(EWL_LABEL(icon->alt), txt);
- DRETURN(DLEVEL_STABLE);
+ ewl_label_text_set(EWL_LABEL(icon->alt), txt);
+ DRETURN(DLEVEL_STABLE);
}
icon->alt = ewl_label_new();
@@ -603,10 +603,10 @@ ewl_icon_alt_text_set(Ewl_Icon *icon, const char *txt)
img = ewl_icon_theme_icon_path_get(EWL_ICON_IMAGE_LOADING, 0);
file = ewl_icon_image_file_get(icon);
if ((!file || !ecore_file_exists(ewl_icon_image_file_get(icon))) ||
- (icon->image && !strcmp(img, file)))
+ (icon->image && !strcmp(img, file)))
{
- if (icon->image) ewl_widget_hide(icon->image);
- ewl_widget_show(icon->alt);
+ if (icon->image) ewl_widget_hide(icon->image);
+ ewl_widget_show(icon->alt);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -652,7 +652,7 @@ ewl_icon_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
static void
ewl_icon_cb_label_mouse_down(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Icon *icon;
Ewl_Widget *entry;
@@ -674,14 +674,14 @@ ewl_icon_cb_label_mouse_down(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
/* put the entry in the same spot as the label */
ewl_object_current_geometry_get(EWL_OBJECT(icon->label), &x, &y,
- NULL, NULL);
+ NULL, NULL);
ewl_object_position_request(EWL_OBJECT(entry), x, y);
ewl_widget_show(entry);
ewl_callback_append(entry, EWL_CALLBACK_FOCUS_OUT,
- ewl_icon_cb_entry_focus_out, icon);
+ ewl_icon_cb_entry_focus_out, icon);
ewl_callback_append(entry, EWL_CALLBACK_VALUE_CHANGED,
- ewl_icon_cb_entry_value_changed, icon);
+ ewl_icon_cb_entry_value_changed, icon);
ewl_embed_focused_widget_set(emb, entry);
@@ -738,42 +738,42 @@ ewl_icon_parts_update(Ewl_Icon *icon)
* show both the label and the image
*/
if (icon->hidden == EWL_ICON_PART_NONE) {
- if (icon->label)
- ewl_widget_show(icon->label);
- if (icon->image)
- ewl_widget_show(icon->image);
+ if (icon->label)
+ ewl_widget_show(icon->label);
+ if (icon->image)
+ ewl_widget_show(icon->image);
}
/*
* show only the label
*/
else if (icon->hidden == EWL_ICON_PART_IMAGE) {
- if (icon->label && icon->image) {
- ewl_widget_show(icon->label);
- ewl_widget_hide(icon->image);
- }
- else if (icon->label)
- ewl_widget_show(icon->label);
- /*
- * show the image if there is no label
- */
- else if (icon->image)
- ewl_widget_show(icon->image);
+ if (icon->label && icon->image) {
+ ewl_widget_show(icon->label);
+ ewl_widget_hide(icon->image);
+ }
+ else if (icon->label)
+ ewl_widget_show(icon->label);
+ /*
+ * show the image if there is no label
+ */
+ else if (icon->image)
+ ewl_widget_show(icon->image);
}
/*
* show only the image
*/
else if (icon->hidden == EWL_ICON_PART_LABEL) {
- if (icon->label && icon->image) {
- ewl_widget_show(icon->image);
- ewl_widget_hide(icon->label);
- }
- else if (icon->image)
- ewl_widget_show(icon->image);
- /*
- * show label if there is no image
- */
- else if (icon->label)
- ewl_widget_show(icon->label);
+ if (icon->label && icon->image) {
+ ewl_widget_show(icon->image);
+ ewl_widget_hide(icon->label);
+ }
+ else if (icon->image)
+ ewl_widget_show(icon->image);
+ /*
+ * show label if there is no image
+ */
+ else if (icon->label)
+ ewl_widget_show(icon->label);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -787,36 +787,36 @@ ewl_icon_label_build(Ewl_Icon *icon)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->complex_label)
- icon->label = ewl_text_new();
+ icon->label = ewl_text_new();
else
- icon->label = ewl_label_new();
+ icon->label = ewl_label_new();
ewl_object_fill_policy_set(EWL_OBJECT(icon->label),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(icon->label),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
if (icon->editable)
- ewl_callback_append(icon->label,
- EWL_CALLBACK_MOUSE_DOWN,
- ewl_icon_cb_label_mouse_down, icon);
+ ewl_callback_append(icon->label,
+ EWL_CALLBACK_MOUSE_DOWN,
+ ewl_icon_cb_label_mouse_down, icon);
if (icon->hidden != EWL_ICON_PART_LABEL)
- ewl_widget_show(icon->label);
+ ewl_widget_show(icon->label);
/* if we have a image make sure we are after it, but
* before anything that is after the image */
if (icon->image && icon->extended)
{
- int idx;
- idx = ewl_container_child_index_get(EWL_CONTAINER(icon),
- icon->image);
- ewl_container_child_insert_internal(EWL_CONTAINER(icon),
- icon->label, idx + 1);
+ int idx;
+ idx = ewl_container_child_index_get(EWL_CONTAINER(icon),
+ icon->image);
+ ewl_container_child_insert_internal(EWL_CONTAINER(icon),
+ icon->label, idx + 1);
}
else
- ewl_container_child_append(EWL_CONTAINER(icon),
- icon->label);
+ ewl_container_child_append(EWL_CONTAINER(icon),
+ icon->label);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -829,9 +829,9 @@ ewl_icon_label_text_set(Ewl_Icon *icon, const char *txt)
DCHECK_TYPE(icon, EWL_ICON_TYPE);
if (icon->complex_label)
- ewl_text_text_set(EWL_TEXT(icon->label), txt);
+ ewl_text_text_set(EWL_TEXT(icon->label), txt);
else
- ewl_label_text_set(EWL_LABEL(icon->label), txt);
+ ewl_label_text_set(EWL_LABEL(icon->label), txt);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -845,29 +845,29 @@ ewl_icon_label_update(Ewl_Icon *icon)
/* nothing to do if no label set */
if (!icon->label_text)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (icon->compress_label &&
- (strlen(icon->label_text) > EWL_ICON_COMPRESS_SIZE))
+ (strlen(icon->label_text) > EWL_ICON_COMPRESS_SIZE))
{
- char *c;
+ char *c;
- c = NEW(char, EWL_ICON_COMPRESS_SIZE + 4);
- strncpy(c, icon->label_text, EWL_ICON_COMPRESS_SIZE);
- strcat(c, "...");
+ c = NEW(char, EWL_ICON_COMPRESS_SIZE + 4);
+ strncpy(c, icon->label_text, EWL_ICON_COMPRESS_SIZE);
+ strcat(c, "...");
- ewl_icon_label_text_set(icon, c);
- FREE(c);
+ ewl_icon_label_text_set(icon, c);
+ FREE(c);
}
else
- ewl_icon_label_text_set(icon, icon->label_text);
+ ewl_icon_label_text_set(icon, icon->label_text);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_icon_cb_thumb_value_changed(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Icon *icon;
@@ -877,10 +877,10 @@ ewl_icon_cb_thumb_value_changed(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
icon = EWL_ICON(data);
if (icon->alt && VISIBLE(icon->alt))
- ewl_widget_hide(icon->alt);
+ ewl_widget_hide(icon->alt);
if (!VISIBLE(icon->image))
- ewl_widget_show(icon->image);
+ ewl_widget_show(icon->image);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_icon.h b/src/lib/ewl_icon.h
index f870e14..833eba2 100644
--- a/src/lib/ewl_icon.h
+++ b/src/lib/ewl_icon.h
@@ -44,19 +44,19 @@ typedef struct Ewl_Icon Ewl_Icon;
*/
struct Ewl_Icon
{
- Ewl_Stock stock; /**< Inherit from Ewl_Box */
- Ewl_Widget *label; /**< The icons label */
- Ewl_Widget *image; /**< The icons image */
- Ewl_Widget *alt; /**< The icons alt text */
- Ewl_Widget *extended; /**< The icons extended information */
+ Ewl_Stock stock; /**< Inherit from Ewl_Box */
+ Ewl_Widget *label; /**< The icons label */
+ Ewl_Widget *image; /**< The icons image */
+ Ewl_Widget *alt; /**< The icons alt text */
+ Ewl_Widget *extended; /**< The icons extended information */
- char *label_text; /**< The label text */
+ char *label_text; /**< The label text */
- unsigned int constrain; /**< The image constrain value */
+ unsigned int constrain; /**< The image constrain value */
- Ewl_Icon_Type type; /**< The icons type */
- Ewl_Icon_Part hidden; /**< The hidden part */
- unsigned char editable:1; /**< Is the icon editable? */
+ Ewl_Icon_Type type; /**< The icons type */
+ Ewl_Icon_Part hidden; /**< The hidden part */
+ unsigned char editable:1; /**< Is the icon editable? */
unsigned char compress_label:1; /**< Should the label be compressed? */
unsigned char complex_label:1; /**< Should the label be a Ewl_Text? */
unsigned char thumbnailing:1; /**< Should the image be thumbnailed?*/
@@ -64,41 +64,41 @@ struct Ewl_Icon
Ewl_Widget *ewl_icon_new(void);
Ewl_Widget *ewl_icon_simple_new(void);
-int ewl_icon_init(Ewl_Icon *icon);
+int ewl_icon_init(Ewl_Icon *icon);
-void ewl_icon_type_set(Ewl_Icon *icon, Ewl_Icon_Type type);
+void ewl_icon_type_set(Ewl_Icon *icon, Ewl_Icon_Type type);
Ewl_Icon_Type ewl_icon_type_get(Ewl_Icon *icon);
void ewl_icon_part_hide(Ewl_Icon *icon, Ewl_Icon_Part part);
-void ewl_icon_image_set(Ewl_Icon *icon, const char *file,
- const char *key);
+void ewl_icon_image_set(Ewl_Icon *icon, const char *file,
+ const char *key);
const char *ewl_icon_image_file_get(Ewl_Icon *icon);
void ewl_icon_thumbnailing_set(Ewl_Icon *icon, unsigned int thumb);
unsigned int ewl_icon_thumbnailing_get(Ewl_Icon *icon);
-void ewl_icon_constrain_set(Ewl_Icon *icon, unsigned int val);
+void ewl_icon_constrain_set(Ewl_Icon *icon, unsigned int val);
unsigned int ewl_icon_constrain_get(Ewl_Icon *icon);
-void ewl_icon_alt_text_set(Ewl_Icon *icon, const char *txt);
+void ewl_icon_alt_text_set(Ewl_Icon *icon, const char *txt);
const char *ewl_icon_alt_text_get(Ewl_Icon *icon);
-void ewl_icon_label_set(Ewl_Icon *icon, const char *label);
+void ewl_icon_label_set(Ewl_Icon *icon, const char *label);
const char *ewl_icon_label_get(Ewl_Icon *icon);
-void ewl_icon_editable_set(Ewl_Icon *icon, unsigned int e);
+void ewl_icon_editable_set(Ewl_Icon *icon, unsigned int e);
unsigned int ewl_icon_editable_get(Ewl_Icon *icon);
-void ewl_icon_label_compressed_set(Ewl_Icon *icon,
- unsigned int compress);
+void ewl_icon_label_compressed_set(Ewl_Icon *icon,
+ unsigned int compress);
unsigned int ewl_icon_label_compressed_get(Ewl_Icon *icon);
void ewl_icon_label_complex_set(Ewl_Icon *icon,
- unsigned int complex_label);
+ unsigned int complex_label);
unsigned int ewl_icon_label_complex_get(Ewl_Icon *icon);
-void ewl_icon_extended_data_set(Ewl_Icon *icon, Ewl_Widget *ext);
+void ewl_icon_extended_data_set(Ewl_Icon *icon, Ewl_Widget *ext);
Ewl_Widget *ewl_icon_extended_data_get(Ewl_Icon *icon);
/*
diff --git a/src/lib/ewl_icon_theme.c b/src/lib/ewl_icon_theme.c
index 3938820..4f9c591 100644
--- a/src/lib/ewl_icon_theme.c
+++ b/src/lib/ewl_icon_theme.c
@@ -12,8 +12,8 @@ static Ecore_Hash *ewl_icon_theme_cache = NULL;
static Ecore_Hash *ewl_icon_fallback_theme_cache = NULL;
static void ewl_icon_theme_cb_free(void *data);
static const char *ewl_icon_theme_icon_path_get_helper(const char *icon,
- const char *size, const char *theme,
- const char *key, Ecore_Hash *cache);
+ const char *size, const char *theme,
+ const char *key, Ecore_Hash *cache);
/**
* @return Returns TRUE on success or FALSE on failure
@@ -26,16 +26,16 @@ ewl_icon_theme_init(void)
if (!ewl_icon_theme_cache)
{
- ewl_icon_theme_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(ewl_icon_theme_cache, ewl_icon_theme_cb_free);
- ecore_hash_free_value_cb_set(ewl_icon_theme_cache, free);
-
- ewl_icon_fallback_theme_cache = ecore_hash_new(
- ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(ewl_icon_fallback_theme_cache,
- ewl_icon_theme_cb_free);
- ecore_hash_free_value_cb_set(ewl_icon_fallback_theme_cache,
- free);
+ ewl_icon_theme_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+ ecore_hash_free_key_cb_set(ewl_icon_theme_cache, ewl_icon_theme_cb_free);
+ ecore_hash_free_value_cb_set(ewl_icon_theme_cache, free);
+
+ ewl_icon_fallback_theme_cache = ecore_hash_new(
+ ecore_str_hash, ecore_str_compare);
+ ecore_hash_free_key_cb_set(ewl_icon_fallback_theme_cache,
+ ewl_icon_theme_cb_free);
+ ecore_hash_free_value_cb_set(ewl_icon_fallback_theme_cache,
+ free);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -72,10 +72,10 @@ ewl_icon_theme_theme_change(void)
/* check if this is an edje theme */
if (icon_theme && (!strncasecmp(icon_theme + (strlen(icon_theme) - 4),
- ".edj", 4)))
- ewl_icon_theme_is_edje = 1;
+ ".edj", 4)))
+ ewl_icon_theme_is_edje = 1;
else
- ewl_icon_theme_is_edje = 0;
+ ewl_icon_theme_is_edje = 0;
/* destroy the cache and re-create it */
IF_FREE_HASH(ewl_icon_theme_cache);
@@ -106,39 +106,39 @@ ewl_icon_theme_icon_path_get(const char *icon, int size)
DCHECK_PARAM_PTR_RET(icon, NULL);
icon_theme = ewl_config_string_get(ewl_config,
- EWL_CONFIG_THEME_ICON_THEME);
+ EWL_CONFIG_THEME_ICON_THEME);
/* make sure we have an icon theme */
if (!icon_theme)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
/* if our theme is an edje just return the .edj file */
if (ewl_icon_theme_is_edje)
- DRETURN_PTR(icon_theme, DLEVEL_STABLE);
+ DRETURN_PTR(icon_theme, DLEVEL_STABLE);
if (size == 0)
- size = ewl_config_int_get(ewl_config,
- EWL_CONFIG_THEME_ICON_SIZE);
+ size = ewl_config_int_get(ewl_config,
+ EWL_CONFIG_THEME_ICON_SIZE);
snprintf(icon_size, sizeof(icon_size), "%dx%d", size, size);
snprintf(key, sizeof(key), "%s@%s", icon, icon_size);
ret = ewl_icon_theme_icon_path_get_helper(icon, icon_size, icon_theme,
- key, ewl_icon_theme_cache);
+ key, ewl_icon_theme_cache);
if (ret == EWL_THEME_KEY_NOMATCH)
- ret = ewl_icon_theme_icon_path_get_helper(icon, icon_size, "EWL",
- key, ewl_icon_fallback_theme_cache);
+ ret = ewl_icon_theme_icon_path_get_helper(icon, icon_size, "EWL",
+ key, ewl_icon_fallback_theme_cache);
if (ret == EWL_THEME_KEY_NOMATCH)
- ret = NULL;
+ ret = NULL;
DRETURN_PTR(ret, DLEVEL_STABLE);
}
static const char *
ewl_icon_theme_icon_path_get_helper(const char *icon, const char *size,
- const char *theme, const char *key,
- Ecore_Hash *cache)
+ const char *theme, const char *key,
+ Ecore_Hash *cache)
{
char *ret;
@@ -148,10 +148,10 @@ ewl_icon_theme_icon_path_get_helper(const char *icon, const char *size,
ret = ecore_hash_get(cache, key);
if (!ret)
{
- /* XXX: How to store NOMATCH in the cache? The cache is strings which must be free'd */
- ret = efreet_icon_path_find(theme, icon, size);
- if (!ret) ret = EWL_THEME_KEY_NOMATCH;
- else ecore_hash_set(cache, strdup(key), (void *)ret);
+ /* XXX: How to store NOMATCH in the cache? The cache is strings which must be free'd */
+ ret = efreet_icon_path_find(theme, icon, size);
+ if (!ret) ret = EWL_THEME_KEY_NOMATCH;
+ else ecore_hash_set(cache, strdup(key), (void *)ret);
}
DRETURN_PTR(ret, DLEVEL_STABLE);;
@@ -163,7 +163,7 @@ ewl_icon_theme_cb_free(void *data)
DENTER_FUNCTION(DLEVEL_STABLE);
if (data == EWL_THEME_KEY_NOMATCH)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
IF_FREE(data);
diff --git a/src/lib/ewl_icon_theme.h b/src/lib/ewl_icon_theme.h
index 51fde2e..6637e54 100644
--- a/src/lib/ewl_icon_theme.h
+++ b/src/lib/ewl_icon_theme.h
@@ -9,10 +9,10 @@
* @{
*/
-int ewl_icon_theme_init(void);
-void ewl_icon_theme_shutdown(void);
+int ewl_icon_theme_init(void);
+void ewl_icon_theme_shutdown(void);
-void ewl_icon_theme_theme_change(void);
+void ewl_icon_theme_theme_change(void);
const char *ewl_icon_theme_icon_path_get(const char *icon, int size);
@@ -122,7 +122,7 @@ const char *ewl_icon_theme_icon_path_get(const char *icon, int size);
#define EWL_ICON_HELP_BROWSER "help-browser" /**< help browser */
#define EWL_ICON_MULTIMEDIA_VOLUME_CONTROL "multimedia-volume-control" /**< multimedia volume control */
#define EWL_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility" /**< pref desktop
- accessibility */
+ accessibility */
#define EWL_ICON_PREFERENCES_DESKTOP_FONT "preferences-desktop-font" /**< pref desktop font */
#define EWL_ICON_PREFERENCES_DESKTOP_KEYBOARD "preferences-desktop-keyboard" /**< pref desktop keyboard */
#define EWL_ICON_PREFERENCES_DESKTOP_LOCALE "preferences-desktop-locale" /**< pref desktop locale */
@@ -146,9 +146,9 @@ const char *ewl_icon_theme_icon_path_get(const char *icon, int size);
#define EWL_ICON_APPLICATIONS_UTILITIES "applications-utilities" /**< apps utilities */
#define EWL_ICON_PREFERENCES_DESKTOP "preferences-desktop" /**< prefs desktop */
#define EWL_ICON_PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility" /**< prefs desktop
- accessibility */
+ accessibility */
#define EWL_ICON_PREFERENCES_DESKTOP_PERIPHERALS "preferences-desktop-peripherals" /**< prefs desktop
- peripherals */
+ peripherals */
#define EWL_ICON_PREFERENCES_DESKTOP_PERSONAL "preferences-desktop-personal" /**< prefs desktop personal */
#define EWL_ICON_PREFERENCES_OTHER "preferences-other" /**< prefs other */
#define EWL_ICON_PREFERENCES_SYSTEM "preferences-system" /**< prefs system */
diff --git a/src/lib/ewl_image.c b/src/lib/ewl_image.c
index 8d513b4..018d8c8 100644
--- a/src/lib/ewl_image.c
+++ b/src/lib/ewl_image.c
@@ -26,7 +26,7 @@ static void ewl_image_rotate_90(Ewl_Image *img, int cc);
static Ewl_Widget *ewl_image_view_cb_header_fetch(void *data, unsigned int col);
static Ewl_Widget *ewl_image_view_cb_widget_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
/**
* @return Returns a pointer to a new image widget on success, NULL on failure.
@@ -44,11 +44,11 @@ ewl_image_new(void)
image = NEW(Ewl_Image, 1);
if (!image)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_image_init(image)) {
- ewl_widget_destroy(EWL_WIDGET(image));
- image = NULL;
+ ewl_widget_destroy(EWL_WIDGET(image));
+ image = NULL;
}
DRETURN_PTR(EWL_WIDGET(image), DLEVEL_STABLE);
@@ -74,7 +74,7 @@ ewl_image_view_get(void)
static Ewl_Widget *
ewl_image_view_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Widget *image;
@@ -117,7 +117,7 @@ ewl_image_init(Ewl_Image *i)
w = EWL_WIDGET(i);
if (!ewl_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_IMAGE_TYPE);
ewl_widget_inherit(w, EWL_IMAGE_TYPE);
@@ -128,19 +128,19 @@ ewl_image_init(Ewl_Image *i)
* Append necessary callbacks.
*/
ewl_callback_append(w, EWL_CALLBACK_REVEAL, ewl_image_cb_reveal,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_OBSCURE, ewl_image_cb_obscure,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_image_cb_destroy,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_image_cb_configure,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN, ewl_image_cb_mouse_down,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, ewl_image_cb_mouse_up,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, ewl_image_cb_mouse_move,
- NULL);
+ NULL);
i->sw = 1.0;
i->sh = 1.0;
@@ -203,11 +203,11 @@ ewl_image_file_key_set(Ewl_Image *i, const char *key)
DCHECK_TYPE(i, EWL_IMAGE_TYPE);
if (i->path)
- ewl_image_file_set(i, i->path, key);
+ ewl_image_file_set(i, i->path, key);
else
{
- IF_FREE(i->key);
- if (key) i->key = strdup(key);
+ IF_FREE(i->key);
+ if (key) i->key = strdup(key);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -255,19 +255,19 @@ ewl_image_file_set(Ewl_Image *i, const char *im, const char *key)
* Determine the type of image to be loaded.
*/
if (im) {
- i->type = ewl_image_type_get(im);
- i->path = strdup(im);
- if (key) i->key = strdup(key);
+ i->type = ewl_image_type_get(im);
+ i->path = strdup(im);
+ if (key) i->key = strdup(key);
}
else
- i->type = EWL_IMAGE_TYPE_NORMAL;
+ i->type = EWL_IMAGE_TYPE_NORMAL;
/*
* Load the new image if widget has been realized
*/
if (REALIZED(w)) {
- ewl_widget_obscure(w);
- ewl_widget_reveal(w);
+ ewl_widget_obscure(w);
+ ewl_widget_reveal(w);
}
ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED);
@@ -295,20 +295,20 @@ ewl_image_constrain_set(Ewl_Image *i, unsigned int size)
osize = i->cs;
i->cs = size;
if (size) {
- ewl_object_preferred_inner_w_set(EWL_OBJECT(i), size);
- ewl_object_preferred_inner_h_set(EWL_OBJECT(i), size);
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(i), size);
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(i), size);
}
else if (i->sw != 1.0 || i->sh != 1.0) {
- ewl_image_scale_set(i, i->sw, i->sh);
+ ewl_image_scale_set(i, i->sw, i->sh);
}
else if (i->aw != i->ow || i->ah != i->oh) {
- ewl_image_size_set(i, i->aw, i->ah);
+ ewl_image_size_set(i, i->aw, i->ah);
}
else {
- if (ewl_object_preferred_inner_w_get(EWL_OBJECT(i)) == osize)
- ewl_object_preferred_inner_w_set(EWL_OBJECT(i), i->ow);
- if (ewl_object_preferred_inner_h_get(EWL_OBJECT(i)) == osize)
- ewl_object_preferred_inner_h_set(EWL_OBJECT(i), i->oh);
+ if (ewl_object_preferred_inner_w_get(EWL_OBJECT(i)) == osize)
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(i), i->ow);
+ if (ewl_object_preferred_inner_h_get(EWL_OBJECT(i)) == osize)
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(i), i->oh);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -392,28 +392,28 @@ ewl_image_scale_set(Ewl_Image *i, double wp, double hp)
* Use set bounds if available, otherwise original image size.
*/
if (i->cs) {
- aw = ah = i->cs;
+ aw = ah = i->cs;
}
else {
- if (i->aw)
- aw = i->aw;
- else
- aw = i->ow;
-
- if (i->ah)
- ah = i->ah;
- else
- ah = i->oh;
+ if (i->aw)
+ aw = i->aw;
+ else
+ aw = i->ow;
+
+ if (i->ah)
+ ah = i->ah;
+ else
+ ah = i->oh;
}
/*
* Check for proportional scaling and adjust to fit.
*/
if (i->proportional) {
- if (wp < hp)
- hp = wp;
- else
- hp = wp;
+ if (wp < hp)
+ hp = wp;
+ else
+ hp = wp;
}
ewl_object_preferred_inner_w_set(EWL_OBJECT(i), wp * aw);
@@ -438,9 +438,9 @@ ewl_image_scale_get(Ewl_Image *i, double *wp, double *hp)
DCHECK_TYPE(i, EWL_IMAGE_TYPE);
if (wp)
- *wp = i->sw;
+ *wp = i->sw;
if (hp)
- *hp = i->sh;
+ *hp = i->sh;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -491,9 +491,9 @@ ewl_image_size_get(Ewl_Image *i, int *w, int *h)
DCHECK_TYPE(i, EWL_IMAGE_TYPE);
if (w)
- *w = i->aw;
+ *w = i->aw;
if (h)
- *h = i->ah;
+ *h = i->ah;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -549,39 +549,39 @@ ewl_image_flip(Ewl_Image *img, Ewl_Orientation orient)
if (orient == EWL_ORIENTATION_VERTICAL)
{
- mx = w;
- my = h / 2;
- ia = &iy;
- ib = &ix;
- oa = &oy;
- ob = &ox;
- s = h;
+ mx = w;
+ my = h / 2;
+ ia = &iy;
+ ib = &ix;
+ oa = &oy;
+ ob = &ox;
+ s = h;
}
else
{
- mx = w / 2;
- my = h;
- ia = &ix;
- ib = &iy;
- oa = &ox;
- ob = &oy;
- s = w;
+ mx = w / 2;
+ my = h;
+ ia = &ix;
+ ib = &iy;
+ oa = &ox;
+ ob = &oy;
+ s = w;
}
for (iy = 0; iy < my; iy++)
{
- for (ix = 0; ix < mx; ix++)
- {
- *oa = s - 1 - *ia;
- *ob = *ib;
-
- i = iy * w + ix;
- j = oy * w + ox;
-
- tmp = in[j];
- in[j] = in[i];
- in[i] = tmp;
- }
+ for (ix = 0; ix < mx; ix++)
+ {
+ *oa = s - 1 - *ia;
+ *ob = *ib;
+
+ i = iy * w + ix;
+ j = oy * w + ox;
+
+ tmp = in[j];
+ in[j] = in[i];
+ in[i] = tmp;
+ }
}
evas_object_image_data_set(img->image, in);
@@ -604,14 +604,14 @@ ewl_image_rotate(Ewl_Image *i, Ewl_Rotate rotate)
DCHECK_TYPE(i, EWL_IMAGE_TYPE);
if (rotate == EWL_ROTATE_180)
- ewl_image_rotate_180(i);
+ ewl_image_rotate_180(i);
else if ((rotate == EWL_ROTATE_CW_90) ||
- (rotate == EWL_ROTATE_CC_270))
- ewl_image_rotate_90(i, FALSE);
+ (rotate == EWL_ROTATE_CC_270))
+ ewl_image_rotate_90(i, FALSE);
else
- ewl_image_rotate_90(i, TRUE);
+ ewl_image_rotate_90(i, TRUE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -633,16 +633,16 @@ ewl_image_thumbnail_get(Ewl_Image *i)
#ifdef BUILD_EPSILON_SUPPORT
if (i->path && (i->type == EWL_IMAGE_TYPE_NORMAL)) {
- thumb = ewl_image_thumbnail_new();
- if (thumb) {
- ewl_image_thumbnail_request(EWL_IMAGE_THUMBNAIL(thumb),
- (char *)ewl_image_file_path_get(i));
- EWL_IMAGE_THUMBNAIL(thumb)->orig = EWL_WIDGET(i);
- ewl_callback_append(EWL_WIDGET(i),
- EWL_CALLBACK_VALUE_CHANGED,
- ewl_image_thumbnail_cb_value_changed,
- thumb);
- }
+ thumb = ewl_image_thumbnail_new();
+ if (thumb) {
+ ewl_image_thumbnail_request(EWL_IMAGE_THUMBNAIL(thumb),
+ (char *)ewl_image_file_path_get(i));
+ EWL_IMAGE_THUMBNAIL(thumb)->orig = EWL_WIDGET(i);
+ ewl_callback_append(EWL_WIDGET(i),
+ EWL_CALLBACK_VALUE_CHANGED,
+ ewl_image_thumbnail_cb_value_changed,
+ thumb);
+ }
}
#endif
@@ -664,7 +664,7 @@ ewl_image_thumbnail_cb_value_changed(Ewl_Widget *w, void *ev, void *data)
image = w;
ewl_image_thumbnail_request(EWL_IMAGE_THUMBNAIL(thumb),
- ewl_image_file_path_get(EWL_IMAGE(image)));
+ ewl_image_file_path_get(EWL_IMAGE(image)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -683,8 +683,8 @@ ewl_image_thumbnail_new(void)
thumb = NEW(Ewl_Image_Thumbnail, 1);
if (!ewl_image_thumbnail_init(EWL_IMAGE_THUMBNAIL(thumb))) {
- ewl_widget_destroy(EWL_WIDGET(thumb));
- thumb = NULL;
+ ewl_widget_destroy(EWL_WIDGET(thumb));
+ thumb = NULL;
}
DRETURN_PTR(thumb, DLEVEL_STABLE);
@@ -702,23 +702,23 @@ ewl_image_thumbnail_init(Ewl_Image_Thumbnail *image)
DCHECK_PARAM_PTR_RET(image, FALSE);
if (!ewl_image_init(EWL_IMAGE(image)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(image),
- EWL_IMAGE_THUMBNAIL_TYPE);
+ EWL_IMAGE_THUMBNAIL_TYPE);
ewl_widget_inherit(EWL_WIDGET(image), EWL_IMAGE_THUMBNAIL_TYPE);
ewl_callback_prepend(EWL_WIDGET(image), EWL_CALLBACK_DESTROY,
- ewl_image_thumbnail_cb_destroy, NULL);
+ ewl_image_thumbnail_cb_destroy, NULL);
image->size = EWL_THUMBNAIL_SIZE_NORMAL;
#ifdef BUILD_EPSILON_SUPPORT
if (!ewl_image_epsilon_handler) {
- epsilon_request_init();
- ewl_image_epsilon_handler =
- ecore_event_handler_add(EPSILON_EVENT_DONE,
- ewl_image_thumbnail_cb_complete,
- NULL);
+ epsilon_request_init();
+ ewl_image_epsilon_handler =
+ ecore_event_handler_add(EPSILON_EVENT_DONE,
+ ewl_image_thumbnail_cb_complete,
+ NULL);
}
#endif
@@ -777,7 +777,7 @@ ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb, const char *path)
#ifdef BUILD_EPSILON_SUPPORT
if (thumb->size == EWL_THUMBNAIL_SIZE_NORMAL)
- size = EPSILON_THUMB_NORMAL;
+ size = EPSILON_THUMB_NORMAL;
else size = EPSILON_THUMB_LARGE;
thumb->thumb = epsilon_request_add(path, size, thumb);
@@ -790,7 +790,7 @@ ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb, const char *path)
static void
ewl_image_thumbnail_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Image_Thumbnail *thumb;
@@ -801,9 +801,9 @@ ewl_image_thumbnail_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
thumb = EWL_IMAGE_THUMBNAIL(w);
if (thumb->thumb) {
#ifdef BUILD_EPSILON_SUPPORT
- epsilon_request_del(thumb->thumb);
+ epsilon_request_del(thumb->thumb);
#endif
- thumb->thumb = NULL;
+ thumb->thumb = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -812,7 +812,7 @@ ewl_image_thumbnail_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
#ifdef BUILD_EPSILON_SUPPORT
static int
ewl_image_thumbnail_cb_complete(void *data __UNUSED__, int type __UNUSED__,
- void *event)
+ void *event)
{
Ewl_Image_Thumbnail *thumb;
Epsilon_Request *ev;
@@ -825,14 +825,14 @@ ewl_image_thumbnail_cb_complete(void *data __UNUSED__, int type __UNUSED__,
if (thumb)
{
- if (ev->dest)
- {
- ewl_image_file_path_set(EWL_IMAGE(thumb), ev->dest);
- ewl_callback_call(EWL_WIDGET(thumb),
- EWL_CALLBACK_VALUE_CHANGED);
- }
-
- thumb->thumb = NULL;
+ if (ev->dest)
+ {
+ ewl_image_file_path_set(EWL_IMAGE(thumb), ev->dest);
+ ewl_callback_call(EWL_WIDGET(thumb),
+ EWL_CALLBACK_VALUE_CHANGED);
+ }
+
+ thumb->thumb = NULL;
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -849,7 +849,7 @@ ewl_image_thumbnail_cb_complete(void *data __UNUSED__, int type __UNUSED__,
*/
void
ewl_image_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
Ewl_Embed *emb;
@@ -867,52 +867,52 @@ ewl_image_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
* Load the image based on the type.
*/
if (i->type == EWL_IMAGE_TYPE_EDJE) {
- if (!i->image)
- i->image = ewl_embed_object_request(emb, "edje");
- if (!i->image)
- i->image = edje_object_add(emb->canvas);
- if (!i->image)
- DRETURN(DLEVEL_STABLE);
-
- if (i->path)
- edje_object_file_set(i->image, i->path, i->key);
- edje_object_size_min_get(i->image, &i->ow, &i->oh);
+ if (!i->image)
+ i->image = ewl_embed_object_request(emb, "edje");
+ if (!i->image)
+ i->image = edje_object_add(emb->canvas);
+ if (!i->image)
+ DRETURN(DLEVEL_STABLE);
+
+ if (i->path)
+ edje_object_file_set(i->image, i->path, i->key);
+ edje_object_size_min_get(i->image, &i->ow, &i->oh);
} else {
- if (!i->image)
- i->image = ewl_embed_object_request(emb, EWL_IMAGE_TYPE);
- if (!i->image)
- i->image = evas_object_image_add(emb->canvas);
- if (!i->image)
- DRETURN(DLEVEL_STABLE);
-
- if (i->path)
- evas_object_image_file_set(i->image, i->path, i->key);
- evas_object_image_size_get(i->image, &i->ow, &i->oh);
+ if (!i->image)
+ i->image = ewl_embed_object_request(emb, EWL_IMAGE_TYPE);
+ if (!i->image)
+ i->image = evas_object_image_add(emb->canvas);
+ if (!i->image)
+ DRETURN(DLEVEL_STABLE);
+
+ if (i->path)
+ evas_object_image_file_set(i->image, i->path, i->key);
+ evas_object_image_size_get(i->image, &i->ow, &i->oh);
}
evas_object_smart_member_add(i->image, w->smart_object);
if (w->fx_clip_box)
- evas_object_stack_below(i->image, w->fx_clip_box);
+ evas_object_stack_below(i->image, w->fx_clip_box);
if (w->fx_clip_box)
- evas_object_clip_set(i->image, w->fx_clip_box);
+ evas_object_clip_set(i->image, w->fx_clip_box);
evas_object_pass_events_set(i->image, TRUE);
evas_object_show(i->image);
if (!i->ow)
- i->ow = 1;
+ i->ow = 1;
if (!i->oh)
- i->oh = 1;
+ i->oh = 1;
/*
* Bound the scales when proportional.
*/
if (i->proportional) {
- if (i->sw < i->sh)
- sh = i->sw;
- else
- sw = i->sh;
+ if (i->sw < i->sh)
+ sh = i->sw;
+ else
+ sw = i->sh;
}
sw = i->sw;
@@ -922,18 +922,18 @@ ewl_image_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
* Bound to absolute size.
*/
if (i->cs) {
- ww = hh = i->cs;
+ ww = hh = i->cs;
}
else {
- if (i->aw)
- ww = i->aw;
- else
- ww = i->ow;
-
- if (i->ah)
- hh = i->ah;
- else
- hh = i->oh;
+ if (i->aw)
+ ww = i->aw;
+ else
+ ww = i->ow;
+
+ if (i->ah)
+ hh = i->ah;
+ else
+ hh = i->oh;
}
ewl_object_preferred_inner_w_set(EWL_OBJECT(i), sw * ww);
@@ -952,7 +952,7 @@ ewl_image_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_image_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
Ewl_Embed *emb;
@@ -965,9 +965,9 @@ ewl_image_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
i = EWL_IMAGE(w);
if (emb && i->image) {
- evas_object_image_file_set(i->image, NULL, NULL);
- ewl_embed_object_cache(emb, i->image);
- i->image = NULL;
+ evas_object_image_file_set(i->image, NULL, NULL);
+ ewl_embed_object_cache(emb, i->image);
+ i->image = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -983,7 +983,7 @@ ewl_image_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_image_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
@@ -1009,7 +1009,7 @@ ewl_image_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_image_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
@@ -1019,7 +1019,7 @@ ewl_image_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
i = EWL_IMAGE(w);
if (!i->image)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1034,7 +1034,7 @@ ewl_image_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_image_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
int ww, hh;
@@ -1046,51 +1046,51 @@ ewl_image_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
i = EWL_IMAGE(w);
if (!i->image)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ww = CURRENT_W(w);
hh = CURRENT_H(w);
if (i->cs) {
- /*
- * Limit to the constraining size
- */
- if (ww > i->cs)
- ww = i->cs;
- if (hh > i->cs)
- hh = i->cs;
-
- /*
- * Use images original size if smaller than constraint.
- */
- if (ww > i->ow)
- ww = i->ow;
- if (hh > i->oh)
- hh = i->oh;
+ /*
+ * Limit to the constraining size
+ */
+ if (ww > i->cs)
+ ww = i->cs;
+ if (hh > i->cs)
+ hh = i->cs;
+
+ /*
+ * Use images original size if smaller than constraint.
+ */
+ if (ww > i->ow)
+ ww = i->ow;
+ if (hh > i->oh)
+ hh = i->oh;
}
/*
* Fit the proportional scale.
*/
if (i->proportional) {
- double sw, sh;
-
- sw = (double)ww / (double)i->ow;
- sh = (double)hh / (double)i->oh;
- if (sw < sh) {
- hh = sw * i->oh;
- }
- else {
- ww = sh * i->ow;
- }
+ double sw, sh;
+
+ sw = (double)ww / (double)i->ow;
+ sh = (double)hh / (double)i->oh;
+ if (sw < sh) {
+ hh = sw * i->oh;
+ }
+ else {
+ ww = sh * i->ow;
+ }
}
/*
* set the tile width and height if not set already
*/
if (!i->tile.set) {
- i->tile.x = i->tile.y = 0;
- i->tile.w = ww;
- i->tile.h = hh;
+ i->tile.x = i->tile.y = 0;
+ i->tile.w = ww;
+ i->tile.h = hh;
}
dx = (CURRENT_W(w) - ww) / 2;
@@ -1100,8 +1100,8 @@ ewl_image_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* Move the image into place based on type.
*/
if (i->type != EWL_IMAGE_TYPE_EDJE)
- evas_object_image_fill_set(i->image, i->tile.x, i->tile.y,
- i->tile.w, i->tile.h);
+ evas_object_image_fill_set(i->image, i->tile.x, i->tile.y,
+ i->tile.w, i->tile.h);
evas_object_move(i->image, CURRENT_X(w) + dx, CURRENT_Y(w) + dy);
evas_object_resize(i->image, ww, hh);
@@ -1126,7 +1126,7 @@ ewl_image_type_get(const char *i)
|| (l >= 4 && !(strncasecmp(i + l - 4, ".eet", 4)))
|| (l >= 4 && !(strncasecmp(i + l - 4, ".edj", 4)))
|| (l >= 4 && !(strncasecmp(i + l - 4, ".eap", 4))))
- DRETURN_INT(EWL_IMAGE_TYPE_EDJE, DLEVEL_STABLE);
+ DRETURN_INT(EWL_IMAGE_TYPE_EDJE, DLEVEL_STABLE);
DRETURN_INT(EWL_IMAGE_TYPE_NORMAL, DLEVEL_STABLE);
}
@@ -1141,7 +1141,7 @@ ewl_image_type_get(const char *i)
*/
void
ewl_image_cb_mouse_down(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
Ewl_Embed *emb;
@@ -1156,10 +1156,10 @@ ewl_image_cb_mouse_down(Ewl_Widget *w, void *ev_data,
ev = ev_data;
if (i->type == EWL_IMAGE_TYPE_EDJE)
- evas_event_feed_mouse_down(emb->canvas, ev->button,
- EVAS_BUTTON_NONE,
- (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff),
- NULL);
+ evas_event_feed_mouse_down(emb->canvas, ev->button,
+ EVAS_BUTTON_NONE,
+ (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff),
+ NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1174,7 +1174,7 @@ ewl_image_cb_mouse_down(Ewl_Widget *w, void *ev_data,
*/
void
ewl_image_cb_mouse_up(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
Ewl_Embed *emb;
@@ -1189,10 +1189,10 @@ ewl_image_cb_mouse_up(Ewl_Widget *w, void *ev_data,
ev = ev_data;
if (i->type == EWL_IMAGE_TYPE_EDJE && emb)
- evas_event_feed_mouse_up(emb->canvas, ev->button,
- EVAS_BUTTON_NONE,
- (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff),
- NULL);
+ evas_event_feed_mouse_up(emb->canvas, ev->button,
+ EVAS_BUTTON_NONE,
+ (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff),
+ NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1207,7 +1207,7 @@ ewl_image_cb_mouse_up(Ewl_Widget *w, void *ev_data,
*/
void
ewl_image_cb_mouse_move(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Image *i;
Ewl_Embed *emb;
@@ -1222,9 +1222,9 @@ ewl_image_cb_mouse_move(Ewl_Widget *w, void *ev_data,
ev = ev_data;
if (i->type == EWL_IMAGE_TYPE_EDJE)
- evas_event_feed_mouse_move(emb->canvas, ev->x, ev->y,
- (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff),
- NULL);
+ evas_event_feed_mouse_move(emb->canvas, ev->x, ev->y,
+ (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff),
+ NULL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1251,34 +1251,34 @@ ewl_image_rotate_90(Ewl_Image *img, int cc)
/* these pointers pull the invarient conditional out of the loop */
if (cc)
{
- oa = &oy;
- ob = &ox;
- ia = &iy;
- ib = &ix;
- os = oh;
+ oa = &oy;
+ ob = &ox;
+ ia = &iy;
+ ib = &ix;
+ os = oh;
}
else
{
- oa = &ox;
- ob = &oy;
- ia = &ix;
- ib = &iy;
- os = ow;
+ oa = &ox;
+ ob = &oy;
+ ia = &ix;
+ ib = &iy;
+ os = ow;
}
for (i = 0; i < (w * h); i++)
{
- ix = i % w;
- iy = i / w;
+ ix = i % w;
+ iy = i / w;
- /* rotate */
- *oa = os - 1 - *ib;
- *ob = *ia;
+ /* rotate */
+ *oa = os - 1 - *ib;
+ *ob = *ia;
- /* convert back to array index */
- j = oy * ow + ox;
+ /* convert back to array index */
+ j = oy * ow + ox;
- out[j] = in[i];
+ out[j] = in[i];
}
img->ow = ow;
@@ -1309,15 +1309,15 @@ ewl_image_rotate_180(Ewl_Image *img)
size = w * h / 2;
for (i = 0; i < size; i++)
{
- ix = i % w;
- iy = i / w;
- ox = w - 1 - ix;
- oy = h - 1 - iy;
- j = oy * w + ox;
-
- tmp = in[j];
- in[j] = in[i];
- in[i] = tmp;
+ ix = i % w;
+ iy = i / w;
+ ox = w - 1 - ix;
+ oy = h - 1 - iy;
+ j = oy * w + ox;
+
+ tmp = in[j];
+ in[j] = in[i];
+ in[i] = tmp;
}
evas_object_image_data_set(img->image, in);
diff --git a/src/lib/ewl_image.h b/src/lib/ewl_image.h
index bedd5b1..b6549f6 100644
--- a/src/lib/ewl_image.h
+++ b/src/lib/ewl_image.h
@@ -48,27 +48,27 @@ typedef struct Ewl_Image Ewl_Image;
*/
struct Ewl_Image
{
- Ewl_Widget widget; /**< Inherit from Ewl_Widget */
- Ewl_Image_Type type; /**< The type of the image */
- void *image; /**< The evas object for the image */
- char *path; /**< The path to the image */
- char *key; /**< The key for the image */
- char proportional; /**< Is the image displayed proportional */
- int ow, /**< Original image width */
- oh; /**< Original image height */
- double sw, /**< Scale width */
- sh; /**< Scale height */
- int cs; /**< Constrain size */
- int aw, /**< Scale width */
- ah; /**< Scale height */
+ Ewl_Widget widget; /**< Inherit from Ewl_Widget */
+ Ewl_Image_Type type; /**< The type of the image */
+ void *image; /**< The evas object for the image */
+ char *path; /**< The path to the image */
+ char *key; /**< The key for the image */
+ char proportional; /**< Is the image displayed proportional */
+ int ow, /**< Original image width */
+ oh; /**< Original image height */
+ double sw, /**< Scale width */
+ sh; /**< Scale height */
+ int cs; /**< Constrain size */
+ int aw, /**< Scale width */
+ ah; /**< Scale height */
struct {
- int set; /**< Tiling set? */
- int x, /**< Tile x start */
- y, /**< Tile y start */
- w, /**< Tile width */
- h; /**< Tile height */
- } tile; /**< Image tiling information */
+ int set; /**< Tiling set? */
+ int x, /**< Tile x start */
+ y, /**< Tile y start */
+ w, /**< Tile width */
+ h; /**< Tile height */
+ } tile; /**< Image tiling information */
};
/**
@@ -82,7 +82,7 @@ struct Ewl_Image
*/
struct Ewl_Image_Thumbnail
{
- Ewl_Image image; /**< Inherit from Ewl_Image */
+ Ewl_Image image; /**< Inherit from Ewl_Image */
void *thumb; /**< Outstanding request to thumbnail image */
Ewl_Thumbnail_Size size; /**< Size of the thumbnails>*/
Ewl_Widget *orig; /**< Reference to image used to create thumb */
@@ -100,40 +100,40 @@ typedef struct Ewl_Image_Thumbnail Ewl_Image_Thumbnail;
#define EWL_IMAGE_THUMBNAIL(image) ((Ewl_Image_Thumbnail *) image)
Ewl_Widget *ewl_image_new(void);
-int ewl_image_init(Ewl_Image *i);
+int ewl_image_init(Ewl_Image *i);
Ewl_View *ewl_image_view_get(void);
-void ewl_image_file_set(Ewl_Image *i, const char *im,
- const char *key);
-void ewl_image_file_path_set(Ewl_Image *i, const char *im);
+void ewl_image_file_set(Ewl_Image *i, const char *im,
+ const char *key);
+void ewl_image_file_path_set(Ewl_Image *i, const char *im);
const char *ewl_image_file_path_get(Ewl_Image *i);
-void ewl_image_file_key_set(Ewl_Image *i, const char *key);
+void ewl_image_file_key_set(Ewl_Image *i, const char *key);
const char *ewl_image_file_key_get(Ewl_Image *i);
-void ewl_image_proportional_set(Ewl_Image *i, char p);
-char ewl_image_proportional_get(Ewl_Image *i);
-void ewl_image_scale_set(Ewl_Image *i, double wp, double hp);
-void ewl_image_scale_get(Ewl_Image *i, double *wp, double *hp);
-void ewl_image_size_set(Ewl_Image *i, int w, int h);
-void ewl_image_size_get(Ewl_Image *i, int *w, int *h);
-void ewl_image_tile_set(Ewl_Image *i, int x, int y,
- int w, int h);
-void ewl_image_constrain_set(Ewl_Image *i, unsigned int size);
+void ewl_image_proportional_set(Ewl_Image *i, char p);
+char ewl_image_proportional_get(Ewl_Image *i);
+void ewl_image_scale_set(Ewl_Image *i, double wp, double hp);
+void ewl_image_scale_get(Ewl_Image *i, double *wp, double *hp);
+void ewl_image_size_set(Ewl_Image *i, int w, int h);
+void ewl_image_size_get(Ewl_Image *i, int *w, int *h);
+void ewl_image_tile_set(Ewl_Image *i, int x, int y,
+ int w, int h);
+void ewl_image_constrain_set(Ewl_Image *i, unsigned int size);
unsigned int ewl_image_constrain_get(Ewl_Image *i);
-void ewl_image_flip(Ewl_Image *img, Ewl_Orientation orient);
-void ewl_image_rotate(Ewl_Image *i, Ewl_Rotate rotate);
+void ewl_image_flip(Ewl_Image *img, Ewl_Orientation orient);
+void ewl_image_rotate(Ewl_Image *i, Ewl_Rotate rotate);
Ewl_Widget *ewl_image_thumbnail_get(Ewl_Image *i);
Ewl_Widget *ewl_image_thumbnail_new(void);
-int ewl_image_thumbnail_init(Ewl_Image_Thumbnail *image);
-void ewl_image_thumbnail_size_set(Ewl_Image_Thumbnail *thumb,
- Ewl_Thumbnail_Size s);
+int ewl_image_thumbnail_init(Ewl_Image_Thumbnail *image);
+void ewl_image_thumbnail_size_set(Ewl_Image_Thumbnail *thumb,
+ Ewl_Thumbnail_Size s);
Ewl_Thumbnail_Size ewl_image_thumbnail_size_get(Ewl_Image_Thumbnail *thumb);
-void ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb,
- const char *path);
+void ewl_image_thumbnail_request(Ewl_Image_Thumbnail *thumb,
+ const char *path);
/*
* Internally used callbacks, override at your own risk.
diff --git a/src/lib/ewl_io_manager.c b/src/lib/ewl_io_manager.c
index f130e26..26cd291 100644
--- a/src/lib/ewl_io_manager.c
+++ b/src/lib/ewl_io_manager.c
@@ -27,64 +27,64 @@ ewl_io_manager_init(void)
if (!ewl_io_manager_ext_icon_map)
{
- /* XXX this is a dumb way to do this.... */
- ewl_io_manager_ext_icon_map = ecore_hash_new(ecore_str_hash,
- ewl_io_manager_strcasecompare);
- /* Images */
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".png",
- EWL_ICON_IMAGE_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".jpg",
- EWL_ICON_IMAGE_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".gif",
- EWL_ICON_IMAGE_X_GENERIC);
-
- /* Videos */
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".wmv",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".mpg",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".mpeg",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".avi",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".mov",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".asf",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".mp4",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".mkv",
- EWL_ICON_VIDEO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".ogm",
- EWL_ICON_VIDEO_X_GENERIC);
-
- /* Audio */
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".mp3",
- EWL_ICON_AUDIO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".mka",
- EWL_ICON_AUDIO_X_GENERIC);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".ogg",
- EWL_ICON_AUDIO_X_GENERIC);
-
- /* HTML */
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".html",
- EWL_ICON_TEXT_HTML);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".htm",
- EWL_ICON_TEXT_HTML);
-
- /* Scirpts */
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".pl",
- EWL_ICON_TEXT_X_SCRIPT);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".sh",
- EWL_ICON_TEXT_X_SCRIPT);
- ecore_hash_set(ewl_io_manager_ext_icon_map, ".ksh",
- EWL_ICON_TEXT_X_SCRIPT);
-
- ewl_io_manager_plugins = ecore_hash_new(ecore_str_hash,
- ecore_str_compare);
- ecore_hash_free_key_cb_set(ewl_io_manager_plugins, free);
- ecore_hash_free_value_cb_set(ewl_io_manager_plugins,
- ewl_io_manager_cb_free_plugin);
+ /* XXX this is a dumb way to do this.... */
+ ewl_io_manager_ext_icon_map = ecore_hash_new(ecore_str_hash,
+ ewl_io_manager_strcasecompare);
+ /* Images */
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".png",
+ EWL_ICON_IMAGE_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".jpg",
+ EWL_ICON_IMAGE_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".gif",
+ EWL_ICON_IMAGE_X_GENERIC);
+
+ /* Videos */
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".wmv",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".mpg",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".mpeg",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".avi",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".mov",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".asf",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".mp4",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".mkv",
+ EWL_ICON_VIDEO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".ogm",
+ EWL_ICON_VIDEO_X_GENERIC);
+
+ /* Audio */
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".mp3",
+ EWL_ICON_AUDIO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".mka",
+ EWL_ICON_AUDIO_X_GENERIC);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".ogg",
+ EWL_ICON_AUDIO_X_GENERIC);
+
+ /* HTML */
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".html",
+ EWL_ICON_TEXT_HTML);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".htm",
+ EWL_ICON_TEXT_HTML);
+
+ /* Scirpts */
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".pl",
+ EWL_ICON_TEXT_X_SCRIPT);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".sh",
+ EWL_ICON_TEXT_X_SCRIPT);
+ ecore_hash_set(ewl_io_manager_ext_icon_map, ".ksh",
+ EWL_ICON_TEXT_X_SCRIPT);
+
+ ewl_io_manager_plugins = ecore_hash_new(ecore_str_hash,
+ ecore_str_compare);
+ ecore_hash_free_key_cb_set(ewl_io_manager_plugins, free);
+ ecore_hash_free_value_cb_set(ewl_io_manager_plugins,
+ ewl_io_manager_cb_free_plugin);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -103,8 +103,8 @@ ewl_io_manager_shutdown(void)
IF_FREE_HASH(ewl_io_manager_plugins);
if (ewl_io_manager_path)
{
- ecore_path_group_del(ewl_io_manager_path);
- ewl_io_manager_path = 0;
+ ecore_path_group_del(ewl_io_manager_path);
+ ewl_io_manager_path = 0;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -181,15 +181,15 @@ ewl_io_manager_uri_read(const char *uri)
mime = ewl_io_manager_uri_mime_type_get(uri);
if (!mime)
{
- DWARNING("Unable to determine mime type for %s.", uri);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("Unable to determine mime type for %s.", uri);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
plugin = ewl_io_manager_plugin_get(mime);
if (!plugin)
{
- DWARNING("No plugin available to read mime type: %s.", mime);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("No plugin available to read mime type: %s.", mime);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
ret = plugin->uri_read(uri);
@@ -216,8 +216,8 @@ ewl_io_manager_string_read(const char *string, const char *mime)
plugin = ewl_io_manager_plugin_get(mime);
if (!plugin)
{
- DWARNING("No plugin available to read mime type: %s.", mime);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("No plugin available to read mime type: %s.", mime);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
ret = plugin->string_read(string);
@@ -234,7 +234,7 @@ ewl_io_manager_string_read(const char *string, const char *mime)
*/
int
ewl_io_manager_uri_write(Ewl_Widget *data, const char *uri,
- const char *mime)
+ const char *mime)
{
Ewl_IO_Manager_Plugin *plugin = NULL;
int ret;
@@ -248,8 +248,8 @@ ewl_io_manager_uri_write(Ewl_Widget *data, const char *uri,
plugin = ewl_io_manager_plugin_get(mime);
if (!plugin)
{
- DWARNING("No plugin available to write mime type: %s.", mime);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DWARNING("No plugin available to write mime type: %s.", mime);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ret = plugin->uri_write(data, uri);
@@ -266,7 +266,7 @@ ewl_io_manager_uri_write(Ewl_Widget *data, const char *uri,
*/
int
ewl_io_manager_string_write(Ewl_Widget *data, char **string,
- const char *mime)
+ const char *mime)
{
Ewl_IO_Manager_Plugin *plugin = NULL;
int ret = 0;
@@ -279,8 +279,8 @@ ewl_io_manager_string_write(Ewl_Widget *data, char **string,
plugin = ewl_io_manager_plugin_get(mime);
if (!plugin)
{
- DWARNING("No plugin available to write mime type: %s.", mime);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DWARNING("No plugin available to write mime type: %s.", mime);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ret = plugin->string_write(data, string);
@@ -301,18 +301,18 @@ ewl_io_manager_plugin_get(const char *mime)
/* see if this was already cached */
plugin = ecore_hash_get(ewl_io_manager_plugins, mime);
if (plugin)
- DRETURN_PTR(plugin, DLEVEL_STABLE);
+ DRETURN_PTR(plugin, DLEVEL_STABLE);
if (!ewl_io_manager_path)
{
- ewl_io_manager_path = ecore_path_group_new();
- ecore_path_group_add(ewl_io_manager_path,
- PACKAGE_LIB_DIR"/ewl/plugins/");
+ ewl_io_manager_path = ecore_path_group_new();
+ ecore_path_group_add(ewl_io_manager_path,
+ PACKAGE_LIB_DIR"/ewl/plugins/");
}
m = strdup(mime);
while ((ptr = strchr(m, '/')))
- *ptr = '_';
+ *ptr = '_';
snprintf(name, sizeof(name), "ewl_io_manager_%s_plugin", m);
FREE(m);
@@ -321,44 +321,44 @@ ewl_io_manager_plugin_get(const char *mime)
plugin->plugin = ecore_plugin_load(ewl_io_manager_path, name, NULL);
if (!plugin->plugin)
{
- FREE(plugin);
- m = strdup(mime);
- plugin = NULL;
-
- /* check for fallback plugins */
- ptr = strrchr(m, '/');
- if (ptr)
- {
- *ptr = '\0';
- plugin = ewl_io_manager_plugin_get(m);
- }
-
- FREE(m);
- DRETURN_PTR(plugin, DLEVEL_STABLE);
+ FREE(plugin);
+ m = strdup(mime);
+ plugin = NULL;
+
+ /* check for fallback plugins */
+ ptr = strrchr(m, '/');
+ if (ptr)
+ {
+ *ptr = '\0';
+ plugin = ewl_io_manager_plugin_get(m);
+ }
+
+ FREE(m);
+ DRETURN_PTR(plugin, DLEVEL_STABLE);
}
plugin->uri_read =
- ecore_plugin_symbol_get(plugin->plugin,
- "ewl_io_manager_plugin_uri_read");
+ ecore_plugin_symbol_get(plugin->plugin,
+ "ewl_io_manager_plugin_uri_read");
plugin->string_read =
- ecore_plugin_symbol_get(plugin->plugin,
- "ewl_io_manager_plugin_string_read");
+ ecore_plugin_symbol_get(plugin->plugin,
+ "ewl_io_manager_plugin_string_read");
plugin->uri_write =
- ecore_plugin_symbol_get(plugin->plugin,
- "ewl_io_manager_plugin_uri_write");
+ ecore_plugin_symbol_get(plugin->plugin,
+ "ewl_io_manager_plugin_uri_write");
plugin->string_write =
- ecore_plugin_symbol_get(plugin->plugin,
- "ewl_io_manager_plugin_string_write");
+ ecore_plugin_symbol_get(plugin->plugin,
+ "ewl_io_manager_plugin_string_write");
if (!plugin->uri_read || !plugin->uri_write
- || !plugin->uri_write || !plugin->string_write)
+ || !plugin->uri_write || !plugin->string_write)
{
- if (plugin->plugin)
- ecore_plugin_unload(plugin->plugin);
+ if (plugin->plugin)
+ ecore_plugin_unload(plugin->plugin);
- FREE(plugin);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(plugin);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
ecore_hash_set(ewl_io_manager_plugins, strdup(mime), plugin);
@@ -373,15 +373,15 @@ ewl_io_manager_strcasecompare(const void *key1, const void *key2)
if (!key1 || !key2)
{
- DRETURN_INT(ecore_direct_compare(key1, key2), DLEVEL_STABLE);
+ DRETURN_INT(ecore_direct_compare(key1, key2), DLEVEL_STABLE);
}
else if (key1 == key2)
{
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
}
DRETURN_INT(strcasecmp((const char *)key1,
- (const char *)key2), DLEVEL_STABLE);
+ (const char *)key2), DLEVEL_STABLE);
}
static void
@@ -394,7 +394,7 @@ ewl_io_manager_cb_free_plugin(void *data)
plugin = data;
if (plugin->plugin)
- ecore_plugin_unload(plugin->plugin);
+ ecore_plugin_unload(plugin->plugin);
plugin->plugin = NULL;
plugin->uri_write = NULL;
diff --git a/src/lib/ewl_io_manager.h b/src/lib/ewl_io_manager.h
index 4cce1d6..c40faf2 100644
--- a/src/lib/ewl_io_manager.h
+++ b/src/lib/ewl_io_manager.h
@@ -19,17 +19,17 @@ typedef struct Ewl_IO_Manager_Plugin Ewl_IO_Manager_Plugin;
*/
struct Ewl_IO_Manager_Plugin
{
- Ecore_Plugin *plugin; /**< The libray handle */
+ Ecore_Plugin *plugin; /**< The libray handle */
- Ewl_Widget *(*uri_read)(const char *uri); /**< The URI read fuction */
+ Ewl_Widget *(*uri_read)(const char *uri); /**< The URI read fuction */
Ewl_Widget *(*string_read)(const char *string); /**< The string read function */
int (*uri_write)(Ewl_Widget *data, const char *uri); /**< The URI write function */
int (*string_write)(Ewl_Widget *data, char **string); /**< The string write function */
};
-int ewl_io_manager_init(void);
-void ewl_io_manager_shutdown(void);
+int ewl_io_manager_init(void);
+void ewl_io_manager_shutdown(void);
const char *ewl_io_manager_extension_icon_name_get(const char *ext);
const char *ewl_io_manager_mime_type_icon_name_get(const char *mime);
@@ -38,12 +38,12 @@ const char *ewl_io_manager_uri_mime_type_get(const char *uri);
Ewl_Widget *ewl_io_manager_uri_read(const char *uri);
Ewl_Widget *ewl_io_manager_string_read(const char *string,
- const char *mime);
+ const char *mime);
-int ewl_io_manager_uri_write(Ewl_Widget *data, const
- char *uri, const char *mime);
-int ewl_io_manager_string_write(Ewl_Widget *data,
- char **string, const char *mime);
+int ewl_io_manager_uri_write(Ewl_Widget *data, const
+ char *uri, const char *mime);
+int ewl_io_manager_string_write(Ewl_Widget *data,
+ char **string, const char *mime);
/**
* @}
diff --git a/src/lib/ewl_label.c b/src/lib/ewl_label.c
index 9d4fe6d..8fa9bb2 100644
--- a/src/lib/ewl_label.c
+++ b/src/lib/ewl_label.c
@@ -6,7 +6,7 @@
#include "ewl_debug.h"
static Ewl_Widget *ewl_label_view_cb_widget_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
static Ewl_Widget *ewl_label_view_cb_header_fetch(void *data, unsigned int col);
/**
@@ -22,12 +22,12 @@ ewl_label_new(void)
label = NEW(Ewl_Label, 1);
if (!label) {
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!ewl_label_init(label)) {
- ewl_widget_destroy(EWL_WIDGET(label));
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(EWL_WIDGET(label));
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(EWL_WIDGET(label), DLEVEL_STABLE);
@@ -48,7 +48,7 @@ ewl_label_init(Ewl_Label *la)
w = EWL_WIDGET(la);
if (!ewl_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_LABEL_TYPE);
ewl_widget_inherit(w, EWL_LABEL_TYPE);
@@ -113,7 +113,7 @@ ewl_label_view_get(void)
static Ewl_Widget *
ewl_label_view_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ewl_Widget *label;
diff --git a/src/lib/ewl_label.h b/src/lib/ewl_label.h
index f46819f..50b1cd3 100644
--- a/src/lib/ewl_label.h
+++ b/src/lib/ewl_label.h
@@ -52,10 +52,10 @@ struct Ewl_Label
};
Ewl_Widget *ewl_label_new(void);
-int ewl_label_init(Ewl_Label *la);
+int ewl_label_init(Ewl_Label *la);
Ewl_View *ewl_label_view_get(void);
-void ewl_label_text_set(Ewl_Label *la, const char *text);
+void ewl_label_text_set(Ewl_Label *la, const char *text);
const char *ewl_label_text_get(Ewl_Label *la);
Ewl_View *ewl_label_view_get(void);
diff --git a/src/lib/ewl_list.c b/src/lib/ewl_list.c
index 1f18a7f..90b2ea6 100644
--- a/src/lib/ewl_list.c
+++ b/src/lib/ewl_list.c
@@ -6,8 +6,8 @@
#include "ewl_debug.h"
static Ewl_Widget *ewl_list_widget_at(Ewl_MVC *mvc, void *data,
- unsigned int row,
- unsigned int column);
+ unsigned int row,
+ unsigned int column);
/**
* @return Returns a new Ewl_Widget on success or NULL on failure
@@ -22,12 +22,12 @@ ewl_list_new(void)
list = NEW(Ewl_List, 1);
if (!list)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_list_init(EWL_LIST(list)))
{
- ewl_widget_destroy(list);
- list = NULL;
+ ewl_widget_destroy(list);
+ list = NULL;
}
DRETURN_PTR(list, DLEVEL_STABLE);
@@ -45,7 +45,7 @@ ewl_list_init(Ewl_List *list)
DCHECK_PARAM_PTR_RET(list, FALSE);
if (!ewl_mvc_init(EWL_MVC(list)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(list), EWL_LIST_TYPE);
ewl_widget_inherit(EWL_WIDGET(list), EWL_LIST_TYPE);
@@ -53,7 +53,7 @@ ewl_list_init(Ewl_List *list)
ewl_mvc_selected_change_cb_set(EWL_MVC(list), ewl_list_cb_selected_change);
ewl_callback_append(EWL_WIDGET(list), EWL_CALLBACK_CONFIGURE,
- ewl_list_cb_configure, NULL);
+ ewl_list_cb_configure, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -68,7 +68,7 @@ ewl_list_init(Ewl_List *list)
*/
void
ewl_list_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_List *list;
const Ewl_Model *model;
@@ -89,26 +89,26 @@ ewl_list_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
/* if either the list isn't dirty or some of the MVC controls have
* not been set on the list just leave this up to the box to handle */
if ((!ewl_mvc_dirty_get(EWL_MVC(list)))
- || !model || !view || !mvc_data)
- DRETURN(DLEVEL_STABLE);
+ || !model || !view || !mvc_data)
+ DRETURN(DLEVEL_STABLE);
/* create all the widgets and pack into the container */
ewl_container_reset(EWL_CONTAINER(list));
for (i = 0; i < (int)model->count(mvc_data); i++)
{
- Ewl_Widget *o, *cell;
+ Ewl_Widget *o, *cell;
- cell = ewl_cell_new();
- ewl_cell_state_change_cb_add(EWL_CELL(cell));
- ewl_container_child_append(EWL_CONTAINER(list), cell);
- ewl_callback_append(cell, EWL_CALLBACK_CLICKED,
- ewl_list_cb_item_clicked, list);
- ewl_widget_show(cell);
+ cell = ewl_cell_new();
+ ewl_cell_state_change_cb_add(EWL_CELL(cell));
+ ewl_container_child_append(EWL_CONTAINER(list), cell);
+ ewl_callback_append(cell, EWL_CALLBACK_CLICKED,
+ ewl_list_cb_item_clicked, list);
+ ewl_widget_show(cell);
- o = view->fetch(model->fetch(mvc_data, i, 0), i, 0);
- ewl_widget_show(o);
+ o = view->fetch(model->fetch(mvc_data, i, 0), i, 0);
+ ewl_widget_show(o);
- ewl_container_child_append(EWL_CONTAINER(cell), o);
+ ewl_container_child_append(EWL_CONTAINER(cell), o);
}
ewl_list_cb_selected_change(EWL_MVC(list));
@@ -139,8 +139,8 @@ ewl_list_cb_item_clicked(Ewl_Widget *w, void *ev __UNUSED__, void *data)
DCHECK_TYPE(data, EWL_LIST_TYPE);
if (ewl_mvc_selection_mode_get(EWL_MVC(data)) ==
- EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ EWL_SELECTION_MODE_NONE)
+ DRETURN(DLEVEL_STABLE);
model = ewl_mvc_model_get(EWL_MVC(data));
mvc_data = ewl_mvc_data_get(EWL_MVC(data));
@@ -149,8 +149,8 @@ ewl_list_cb_item_clicked(Ewl_Widget *w, void *ev __UNUSED__, void *data)
if ((unsigned int) row > model->count(mvc_data))
{
- DWARNING("Don't use container function on MVC widget!");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Don't use container function on MVC widget!");
+ DRETURN(DLEVEL_STABLE);
}
ewl_mvc_handle_click(EWL_MVC(data), NULL, mvc_data, row, 0);
@@ -178,7 +178,7 @@ ewl_list_cb_selected_change(Ewl_MVC *mvc)
static Ewl_Widget *
ewl_list_widget_at(Ewl_MVC *mvc, void *data __UNUSED__, unsigned int row,
- unsigned int column __UNUSED__)
+ unsigned int column __UNUSED__)
{
Ewl_Widget *w;
diff --git a/src/lib/ewl_list.h b/src/lib/ewl_list.h
index 599cdc3..8323129 100644
--- a/src/lib/ewl_list.h
+++ b/src/lib/ewl_list.h
@@ -44,11 +44,11 @@ typedef struct Ewl_List Ewl_List;
*/
struct Ewl_List
{
- Ewl_MVC mvc; /**< The mvc parent */
+ Ewl_MVC mvc; /**< The mvc parent */
};
Ewl_Widget *ewl_list_new(void);
-int ewl_list_init(Ewl_List *list);
+int ewl_list_init(Ewl_List *list);
/*
* Internal stuff.
diff --git a/src/lib/ewl_macros.h b/src/lib/ewl_macros.h
index 8c800ac..c7ab9cc 100644
--- a/src/lib/ewl_macros.h
+++ b/src/lib/ewl_macros.h
@@ -26,7 +26,7 @@
{ \
if (dat) \
{ \
- dat = realloc(dat, sizeof(type) * num); \
+ dat = realloc(dat, sizeof(type) * num); \
} \
}
@@ -59,8 +59,8 @@
#define IF_FREE_LIST(list) \
{ \
if (list) { \
- ecore_list_destroy(list); \
- list = NULL; \
+ ecore_list_destroy(list); \
+ list = NULL; \
} \
}
@@ -72,8 +72,8 @@
#define IF_FREE_HASH(hash) \
{ \
if (hash) { \
- ecore_hash_destroy(hash); \
- hash = NULL; \
+ ecore_hash_destroy(hash); \
+ hash = NULL; \
} \
}
@@ -85,8 +85,8 @@
#define IF_RELEASE(item) \
{ \
if (item) { \
- ecore_string_release(item); \
- item = NULL; \
+ ecore_string_release(item); \
+ item = NULL; \
} \
}
diff --git a/src/lib/ewl_media.c b/src/lib/ewl_media.c
index af42866..66f2afd 100644
--- a/src/lib/ewl_media.c
+++ b/src/lib/ewl_media.c
@@ -13,7 +13,7 @@
static void ewl_media_size_update(Ewl_Media *m);
static void ewl_media_cb_update_timer(void *data, Evas_Object *obj, void
- *event_info);
+ *event_info);
/**
* @return Returns a pointer to a new media on success, NULL on failure.
@@ -29,11 +29,11 @@ ewl_media_new(void)
#ifdef BUILD_EMOTION_SUPPORT
m = NEW(Ewl_Media, 1);
if (!m)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_media_init(m)) {
- ewl_widget_destroy(EWL_WIDGET(m));
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(EWL_WIDGET(m));
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
#endif
@@ -58,19 +58,19 @@ ewl_media_init(Ewl_Media *m)
w = EWL_WIDGET(m);
if (!ewl_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_MEDIA_TYPE);
ewl_widget_inherit(EWL_WIDGET(w), EWL_MEDIA_TYPE);
ewl_callback_append(w, EWL_CALLBACK_REALIZE,
- ewl_media_cb_realize, NULL);
+ ewl_media_cb_realize, NULL);
ewl_callback_append(w, EWL_CALLBACK_REVEAL,
- ewl_media_cb_reveal, NULL);
+ ewl_media_cb_reveal, NULL);
ewl_callback_append(w, EWL_CALLBACK_UNREALIZE,
- ewl_media_cb_unrealize, NULL);
+ ewl_media_cb_unrealize, NULL);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_media_cb_configure, NULL);
+ ewl_media_cb_configure, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -117,19 +117,19 @@ ewl_media_module_set(Ewl_Media *m, Ewl_Media_Module_Type module)
*/
if (m->video)
{
- switch (module)
- {
- case EWL_MEDIA_MODULE_GSTREAMER:
- ret = emotion_object_init(m->video,
- "gstreamer");
- break;
-
- case EWL_MEDIA_MODULE_XINE:
- default:
- ret = emotion_object_init(m->video,
- "xine");
- break;
- }
+ switch (module)
+ {
+ case EWL_MEDIA_MODULE_GSTREAMER:
+ ret = emotion_object_init(m->video,
+ "gstreamer");
+ break;
+
+ case EWL_MEDIA_MODULE_XINE:
+ default:
+ ret = emotion_object_init(m->video,
+ "xine");
+ break;
+ }
}
#endif
@@ -175,7 +175,7 @@ ewl_media_media_set(Ewl_Media *m, const char *media)
* Update the emotion to the new file
*/
if (m->video)
- emotion_object_file_set(m->video, m->media);
+ emotion_object_file_set(m->video, m->media);
#endif
/*
@@ -184,7 +184,7 @@ ewl_media_media_set(Ewl_Media *m, const char *media)
* added.
*/
if (m->video)
- ewl_media_size_update(m);
+ ewl_media_size_update(m);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -220,7 +220,7 @@ ewl_media_length_get(Ewl_Media *m)
#ifdef BUILD_EMOTION_SUPPORT
if (m->video)
- length = emotion_object_play_length_get(m->video);
+ length = emotion_object_play_length_get(m->video);
#endif
DRETURN_INT(length, DLEVEL_STABLE);
@@ -273,7 +273,7 @@ ewl_media_play_set(Ewl_Media *m, int p)
#ifdef BUILD_EMOTION_SUPPORT
if (m->video)
- emotion_object_play_set(m->video, p);
+ emotion_object_play_set(m->video, p);
#endif
DRETURN(DLEVEL_STABLE);
@@ -296,7 +296,7 @@ ewl_media_seekable_get(Ewl_Media *m)
#ifdef BUILD_EMOTION_SUPPORT
if (m->video && !m->block_seek)
- seekable = emotion_object_seekable_get(m->video);
+ seekable = emotion_object_seekable_get(m->video);
#endif
DRETURN_INT(seekable, DLEVEL_STABLE);
@@ -318,7 +318,7 @@ ewl_media_position_get(Ewl_Media *m)
#ifdef BUILD_EMOTION_SUPPORT
if (m->video)
- p = emotion_object_position_get(m->video);
+ p = emotion_object_position_get(m->video);
#endif
DRETURN_FLOAT(p, DLEVEL_STABLE);
@@ -369,15 +369,15 @@ ewl_media_position_set(Ewl_Media *m, double p)
DCHECK_TYPE(m, EWL_MEDIA_TYPE);
if (p == m->position)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
m->position = p;
#ifdef BUILD_EMOTION_SUPPORT
if (m->video && ewl_media_seekable_get(m)) {
- m->block_seek = 1;
- emotion_object_position_set(m->video, m->position);
- m->block_seek = 0;
+ m->block_seek = 1;
+ emotion_object_position_set(m->video, m->position);
+ m->block_seek = 0;
}
#endif
@@ -413,13 +413,13 @@ ewl_media_audio_mute_set(Ewl_Media *m, int mute)
DCHECK_TYPE(m, EWL_MEDIA_TYPE);
if (m->mute == !!mute)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
m->mute = !!mute;
#ifdef BUILD_EMOTION_SUPPORT
if (m->video)
- emotion_object_audio_mute_set(m->video, m->mute);
+ emotion_object_audio_mute_set(m->video, m->mute);
#endif
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -454,13 +454,13 @@ ewl_media_audio_volume_set(Ewl_Media *m, double v)
DCHECK_TYPE(m, EWL_MEDIA_TYPE);
if (m->volume == v)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
m->volume = v;
#ifdef BUILD_EMOTION_SUPPORT
if (m->video)
- emotion_object_audio_volume_set(m->video, m->volume);
+ emotion_object_audio_volume_set(m->video, m->volume);
#endif
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -476,7 +476,7 @@ ewl_media_audio_volume_set(Ewl_Media *m, double v)
*/
void
ewl_media_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Media *m;
Ewl_Embed *emb;
@@ -498,8 +498,8 @@ ewl_media_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
m->video = emotion_object_add(emb->canvas);
if (ewl_media_module_set(m, m->module) && m->media) {
- emotion_object_file_set(m->video, m->media);
- ewl_media_size_update(m);
+ emotion_object_file_set(m->video, m->media);
+ ewl_media_size_update(m);
}
#endif
/*
@@ -520,7 +520,7 @@ ewl_media_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_media_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Media *m;
@@ -531,11 +531,11 @@ ewl_media_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
m = EWL_MEDIA(w);
if (m->video) {
- evas_object_smart_member_add(m->video, w->smart_object);
- if (w->fx_clip_box) {
- evas_object_clip_set(m->video, w->fx_clip_box);
- evas_object_stack_above(m->video, w->fx_clip_box);
- }
+ evas_object_smart_member_add(m->video, w->smart_object);
+ if (w->fx_clip_box) {
+ evas_object_clip_set(m->video, w->fx_clip_box);
+ evas_object_stack_above(m->video, w->fx_clip_box);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -551,7 +551,7 @@ ewl_media_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_media_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Media *m;
@@ -577,7 +577,7 @@ ewl_media_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_media_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Media *m;
@@ -591,10 +591,10 @@ ewl_media_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* Update the emotion position and size.
*/
if (m->video) {
- evas_object_move(m->video, CURRENT_X(w), CURRENT_Y(w));
- evas_object_resize(m->video, CURRENT_W(w), CURRENT_H(w));
- evas_object_smart_callback_add(m->video, "frame_decode",
- ewl_media_cb_update_timer, m);
+ evas_object_move(m->video, CURRENT_X(w), CURRENT_Y(w));
+ evas_object_resize(m->video, CURRENT_W(w), CURRENT_H(w));
+ evas_object_smart_callback_add(m->video, "frame_decode",
+ ewl_media_cb_update_timer, m);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -614,15 +614,15 @@ ewl_media_size_update(Ewl_Media *m)
#endif
if (width && height)
- ewl_object_preferred_inner_size_set(EWL_OBJECT(m), width, height);
+ ewl_object_preferred_inner_size_set(EWL_OBJECT(m), width, height);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_media_cb_update_timer(void *data,
- Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
Ewl_Media *m;
diff --git a/src/lib/ewl_media.h b/src/lib/ewl_media.h
index 645afa4..1d6527f 100644
--- a/src/lib/ewl_media.h
+++ b/src/lib/ewl_media.h
@@ -48,44 +48,44 @@ typedef struct Ewl_Media Ewl_Media;
*/
struct Ewl_Media
{
- Ewl_Widget widget; /**< Inherit from Ewl_Widget */
- void *video; /**< Emotion does the actual work */
+ Ewl_Widget widget; /**< Inherit from Ewl_Widget */
+ void *video; /**< Emotion does the actual work */
Ewl_Media_Module_Type module; /**< Path to the module file */
- char *media; /**< Path to the media file */
- int block_seek; /**< Temporarily prevent seeking */
+ char *media; /**< Path to the media file */
+ int block_seek; /**< Temporarily prevent seeking */
- double volume; /**< The volume setting */
- double position; /**< The position setting */
- unsigned char mute:1; /**< The mute value */
+ double volume; /**< The volume setting */
+ double position; /**< The position setting */
+ unsigned char mute:1; /**< The mute value */
};
-Ewl_Widget *ewl_media_new(void);
-int ewl_media_init(Ewl_Media *m);
+Ewl_Widget *ewl_media_new(void);
+int ewl_media_init(Ewl_Media *m);
-unsigned int ewl_media_is_available(void);
+unsigned int ewl_media_is_available(void);
-int ewl_media_module_set(Ewl_Media *m,
- Ewl_Media_Module_Type module);
+int ewl_media_module_set(Ewl_Media *m,
+ Ewl_Media_Module_Type module);
Ewl_Media_Module_Type ewl_media_module_get(Ewl_Media *m);
-void ewl_media_media_set(Ewl_Media *m, const char *media);
-const char *ewl_media_media_get(Ewl_Media *m);
+void ewl_media_media_set(Ewl_Media *m, const char *media);
+const char *ewl_media_media_get(Ewl_Media *m);
-int ewl_media_length_get(Ewl_Media *m);
-void ewl_media_length_time_get(Ewl_Media *m, int *h,
- int *min, double *s);
+int ewl_media_length_get(Ewl_Media *m);
+void ewl_media_length_time_get(Ewl_Media *m, int *h,
+ int *min, double *s);
-void ewl_media_play_set(Ewl_Media *m, int p);
-int ewl_media_seekable_get(Ewl_Media *m);
-double ewl_media_position_get(Ewl_Media *m);
-void ewl_media_position_time_get(Ewl_Media *m, int *h,
- int *min, double *s);
-void ewl_media_position_set(Ewl_Media *m, double p);
+void ewl_media_play_set(Ewl_Media *m, int p);
+int ewl_media_seekable_get(Ewl_Media *m);
+double ewl_media_position_get(Ewl_Media *m);
+void ewl_media_position_time_get(Ewl_Media *m, int *h,
+ int *min, double *s);
+void ewl_media_position_set(Ewl_Media *m, double p);
-int ewl_media_audio_mute_get(Ewl_Media *m);
-void ewl_media_audio_mute_set(Ewl_Media *m, int mute);
-double ewl_media_audio_volume_get(Ewl_Media *m);
-void ewl_media_audio_volume_set(Ewl_Media *m, double v);
+int ewl_media_audio_mute_get(Ewl_Media *m);
+void ewl_media_audio_mute_set(Ewl_Media *m, int mute);
+double ewl_media_audio_volume_get(Ewl_Media *m);
+void ewl_media_audio_volume_set(Ewl_Media *m, double v);
/*
* Internally used callbacks, override at your own risk.
diff --git a/src/lib/ewl_menu.c b/src/lib/ewl_menu.c
index 9d8588b..1da0013 100644
--- a/src/lib/ewl_menu.c
+++ b/src/lib/ewl_menu.c
@@ -19,11 +19,11 @@ ewl_menu_new(void)
menu = NEW(Ewl_Menu, 1);
if (!menu)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_menu_init(menu)) {
- ewl_widget_destroy(EWL_WIDGET(menu));
- menu = NULL;
+ ewl_widget_destroy(EWL_WIDGET(menu));
+ menu = NULL;
}
DRETURN_PTR(EWL_WIDGET(menu), DLEVEL_STABLE);
@@ -44,7 +44,7 @@ ewl_menu_init(Ewl_Menu *menu)
* Initialize the defaults of the inherited fields.
*/
if (!ewl_menu_item_init(EWL_MENU_ITEM(menu)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(menu), "menu_container");
ewl_widget_inherit(EWL_WIDGET(menu), EWL_MENU_TYPE);
@@ -53,13 +53,13 @@ ewl_menu_init(Ewl_Menu *menu)
* add the callbacks
*/
ewl_callback_append(EWL_WIDGET(menu), EWL_CALLBACK_MOUSE_MOVE,
- ewl_menu_cb_mouse_move, NULL);
+ ewl_menu_cb_mouse_move, NULL);
ewl_callback_append(EWL_WIDGET(menu), EWL_CALLBACK_FOCUS_IN,
- ewl_menu_cb_expand, NULL);
+ ewl_menu_cb_expand, NULL);
ewl_callback_append(EWL_WIDGET(menu), EWL_CALLBACK_CONFIGURE,
- ewl_menu_cb_configure, NULL);
+ ewl_menu_cb_configure, NULL);
ewl_callback_prepend(EWL_WIDGET(menu), EWL_CALLBACK_DESTROY,
- ewl_menu_cb_destroy, NULL);
+ ewl_menu_cb_destroy, NULL);
/*
* Create the popup menu portion of the widget.
@@ -67,15 +67,15 @@ ewl_menu_init(Ewl_Menu *menu)
menu->popup = ewl_context_menu_new();
ewl_popup_follow_set(EWL_POPUP(menu->popup), EWL_WIDGET(menu));
ewl_popup_type_set(EWL_POPUP(menu->popup),
- EWL_POPUP_TYPE_MENU_VERTICAL);
+ EWL_POPUP_TYPE_MENU_VERTICAL);
ewl_widget_internal_set(menu->popup, TRUE);
ewl_widget_appearance_set(EWL_WIDGET(menu->popup), EWL_MENU_TYPE);
/* redirect the menu container to the popup menu */
ewl_container_redirect_set(EWL_CONTAINER(menu),
- EWL_CONTAINER(menu->popup));
+ EWL_CONTAINER(menu->popup));
ewl_callback_prepend(menu->popup, EWL_CALLBACK_DESTROY,
- ewl_menu_cb_popup_destroy, menu);
+ ewl_menu_cb_popup_destroy, menu);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -98,17 +98,17 @@ ewl_menu_from_info(Ewl_Menu *menu, Ewl_Menu_Info *info)
for (i = 0; info[i].name != NULL; i++)
{
- Ewl_Widget *item;
+ Ewl_Widget *item;
- item = ewl_menu_item_new();
- ewl_button_label_set(EWL_BUTTON(item), info[i].name);
- ewl_button_image_set(EWL_BUTTON(item), info[i].img, NULL);
- ewl_container_child_append(EWL_CONTAINER(menu), item);
+ item = ewl_menu_item_new();
+ ewl_button_label_set(EWL_BUTTON(item), info[i].name);
+ ewl_button_image_set(EWL_BUTTON(item), info[i].img, NULL);
+ ewl_container_child_append(EWL_CONTAINER(menu), item);
- if (info[i].cb)
- ewl_callback_append(item, EWL_CALLBACK_CLICKED,
- info[i].cb, NULL);
- ewl_widget_show(item);
+ if (info[i].cb)
+ ewl_callback_append(item, EWL_CALLBACK_CLICKED,
+ info[i].cb, NULL);
+ ewl_widget_show(item);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -141,7 +141,7 @@ ewl_menu_collapse(Ewl_Menu *menu)
*/
void
ewl_menu_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Menu *menu;
Ewl_Box *parent;
@@ -154,13 +154,13 @@ ewl_menu_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
parent = EWL_BOX(menu->menubar_parent);
if ((parent && (ewl_box_orientation_get(parent)
- == EWL_ORIENTATION_VERTICAL))
- || EWL_MENU_ITEM(menu)->inmenu)
- ewl_popup_type_set(EWL_POPUP(menu->popup),
- EWL_POPUP_TYPE_MENU_HORIZONTAL);
+ == EWL_ORIENTATION_VERTICAL))
+ || EWL_MENU_ITEM(menu)->inmenu)
+ ewl_popup_type_set(EWL_POPUP(menu->popup),
+ EWL_POPUP_TYPE_MENU_HORIZONTAL);
else
- ewl_popup_type_set(EWL_POPUP(menu->popup),
- EWL_POPUP_TYPE_MENU_VERTICAL);
+ ewl_popup_type_set(EWL_POPUP(menu->popup),
+ EWL_POPUP_TYPE_MENU_VERTICAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -175,7 +175,7 @@ ewl_menu_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Menu *menu;
@@ -185,25 +185,25 @@ ewl_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data __UNUSED__,
menu = EWL_MENU(w);
if (menu->menubar_parent) {
- Ewl_Menu *sub, *hide_menu = NULL;
- Ewl_Container *bar;
-
- bar = EWL_CONTAINER(menu->menubar_parent);
- ewl_container_child_iterate_begin(bar);
- while ((sub = EWL_MENU(ewl_container_child_next(bar)))) {
- if ((sub != EWL_MENU(w))
- && EWL_MENU_IS(sub)
- && (sub->popup)
- && VISIBLE(sub->popup)) {
- hide_menu = sub;
- break;
- }
- }
-
- if (hide_menu) {
- ewl_widget_hide(hide_menu->popup);
- ewl_callback_call(w, EWL_CALLBACK_FOCUS_IN);
- }
+ Ewl_Menu *sub, *hide_menu = NULL;
+ Ewl_Container *bar;
+
+ bar = EWL_CONTAINER(menu->menubar_parent);
+ ewl_container_child_iterate_begin(bar);
+ while ((sub = EWL_MENU(ewl_container_child_next(bar)))) {
+ if ((sub != EWL_MENU(w))
+ && EWL_MENU_IS(sub)
+ && (sub->popup)
+ && VISIBLE(sub->popup)) {
+ hide_menu = sub;
+ break;
+ }
+ }
+
+ if (hide_menu) {
+ ewl_widget_hide(hide_menu->popup);
+ ewl_callback_call(w, EWL_CALLBACK_FOCUS_IN);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -219,7 +219,7 @@ ewl_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_menu_cb_expand(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Menu *menu;
Ewl_Menu_Item *item;
@@ -235,13 +235,13 @@ ewl_menu_cb_expand(Ewl_Widget *w, void *ev_data __UNUSED__,
ewl_window_raise(EWL_WINDOW(menu->popup));
if (item->inmenu) {
- Ewl_Context_Menu *cm;
+ Ewl_Context_Menu *cm;
- cm = EWL_CONTEXT_MENU(item->inmenu);
- cm->open_menu = EWL_WIDGET(menu);
+ cm = EWL_CONTEXT_MENU(item->inmenu);
+ cm->open_menu = EWL_WIDGET(menu);
}
else
- ewl_widget_focus_send(menu->popup);
+ ewl_widget_focus_send(menu->popup);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -256,7 +256,7 @@ ewl_menu_cb_expand(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_menu_cb_popup_destroy(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Menu *m;
@@ -293,10 +293,10 @@ ewl_menu_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
menu = EWL_MENU(w);
if (menu->popup) {
- ewl_callback_del(menu->popup, EWL_CALLBACK_DESTROY,
- ewl_menu_cb_popup_destroy);
- ewl_widget_destroy(menu->popup);
- menu->popup = NULL;
+ ewl_callback_del(menu->popup, EWL_CALLBACK_DESTROY,
+ ewl_menu_cb_popup_destroy);
+ ewl_widget_destroy(menu->popup);
+ menu->popup = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -318,8 +318,8 @@ ewl_menu_mouse_feed(Ewl_Menu *menu, int x, int y)
if ((x > 0) && (y > 0) && (x <= emb_w) && (y <= emb_h))
{
- ewl_embed_mouse_move_feed(EWL_EMBED(menu->popup), x, y, 0);
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ ewl_embed_mouse_move_feed(EWL_EMBED(menu->popup), x, y, 0);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
diff --git a/src/lib/ewl_menu.h b/src/lib/ewl_menu.h
index 48dab4a..1a35375 100644
--- a/src/lib/ewl_menu.h
+++ b/src/lib/ewl_menu.h
@@ -50,10 +50,10 @@ typedef struct Ewl_Menu Ewl_Menu;
*/
struct Ewl_Menu
{
- Ewl_Menu_Item item; /**< Inherit from Ewl_Menu_Base */
+ Ewl_Menu_Item item; /**< Inherit from Ewl_Menu_Base */
Ewl_Widget *popup; /**< The popup holding the menu items */
- Ewl_Widget *menubar_parent; /**< Parent menu bar */
+ Ewl_Widget *menubar_parent; /**< Parent menu bar */
};
/**
@@ -66,17 +66,17 @@ typedef struct Ewl_Menu_Info Ewl_Menu_Info;
*/
struct Ewl_Menu_Info
{
- const char *name; /**< The name of the menu item */
- const char *img; /**< The menu item image */
+ const char *name; /**< The name of the menu item */
+ const char *img; /**< The menu item image */
void (*cb)(Ewl_Widget *w, void *ev, void *data); /**< The menu item callback */
};
Ewl_Widget *ewl_menu_new(void);
-int ewl_menu_init(Ewl_Menu *menu);
+int ewl_menu_init(Ewl_Menu *menu);
-void ewl_menu_from_info(Ewl_Menu *menu, Ewl_Menu_Info *info);
+void ewl_menu_from_info(Ewl_Menu *menu, Ewl_Menu_Info *info);
-void ewl_menu_collapse(Ewl_Menu *menu);
+void ewl_menu_collapse(Ewl_Menu *menu);
/*
* Internally used callbacks, override at your own risk.
diff --git a/src/lib/ewl_menu_item.c b/src/lib/ewl_menu_item.c
index 7d5b7c8..24c9918 100644
--- a/src/lib/ewl_menu_item.c
+++ b/src/lib/ewl_menu_item.c
@@ -18,11 +18,11 @@ ewl_menu_item_new(void)
item = NEW(Ewl_Menu_Item, 1);
if (!item)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_menu_item_init(item)) {
- ewl_widget_destroy(EWL_WIDGET(item));
- item = NULL;
+ ewl_widget_destroy(EWL_WIDGET(item));
+ item = NULL;
}
DRETURN_PTR(EWL_WIDGET(item), DLEVEL_STABLE);
@@ -43,7 +43,7 @@ ewl_menu_item_init(Ewl_Menu_Item *item)
* Initialize the inherited container fields.
*/
if (!ewl_button_init(EWL_BUTTON(item)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_button_fill_policy_set(EWL_BUTTON(item), EWL_FLAG_FILL_HFILL);
ewl_button_alignment_set(EWL_BUTTON(item), EWL_FLAG_ALIGN_LEFT);
@@ -54,7 +54,7 @@ ewl_menu_item_init(Ewl_Menu_Item *item)
ewl_object_fill_policy_set(EWL_OBJECT(item), EWL_FLAG_FILL_HFILL);
ewl_object_fill_policy_set(EWL_OBJECT(EWL_BUTTON(item)->label_object),
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_menu_item.h b/src/lib/ewl_menu_item.h
index afa16f0..c9253f7 100644
--- a/src/lib/ewl_menu_item.h
+++ b/src/lib/ewl_menu_item.h
@@ -50,12 +50,12 @@ typedef struct Ewl_Menu_Item Ewl_Menu_Item;
*/
struct Ewl_Menu_Item
{
- Ewl_Button button; /**< Inherit from Ewl_Button */
- Ewl_Widget *inmenu; /**< Set if inside a menu */
+ Ewl_Button button; /**< Inherit from Ewl_Button */
+ Ewl_Widget *inmenu; /**< Set if inside a menu */
};
Ewl_Widget *ewl_menu_item_new(void);
-int ewl_menu_item_init(Ewl_Menu_Item *menu);
+int ewl_menu_item_init(Ewl_Menu_Item *menu);
/**
* @}
diff --git a/src/lib/ewl_menubar.c b/src/lib/ewl_menubar.c
index 863ce0d..ce90bfa 100644
--- a/src/lib/ewl_menubar.c
+++ b/src/lib/ewl_menubar.c
@@ -19,11 +19,11 @@ ewl_menubar_new(void)
mb = NEW(Ewl_Menubar, 1);
if (!mb)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_menubar_init(mb)) {
- ewl_widget_destroy(EWL_WIDGET(mb));
- mb = NULL;
+ ewl_widget_destroy(EWL_WIDGET(mb));
+ mb = NULL;
}
DRETURN_PTR(EWL_WIDGET(mb), DLEVEL_STABLE);
@@ -43,10 +43,10 @@ ewl_hmenubar_new(void)
mb = ewl_menubar_new();
if (!mb)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_menubar_orientation_set(EWL_MENUBAR(mb),
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
DRETURN_PTR(mb, DLEVEL_STABLE);
}
@@ -65,10 +65,10 @@ ewl_vmenubar_new(void)
mb = ewl_menubar_new();
if (!mb)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_menubar_orientation_set(EWL_MENUBAR(mb),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
DRETURN_PTR(mb, DLEVEL_STABLE);
}
@@ -85,22 +85,22 @@ ewl_menubar_init(Ewl_Menubar *mb)
DCHECK_PARAM_PTR_RET(mb, FALSE);
if (!ewl_box_init(EWL_BOX(mb))) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_widget_appearance_set(EWL_WIDGET(mb), EWL_MENUBAR_TYPE);
ewl_widget_inherit(EWL_WIDGET(mb), EWL_MENUBAR_TYPE);
mb->inner_box = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(mb),
- EWL_WIDGET(mb->inner_box));
+ EWL_WIDGET(mb->inner_box));
ewl_widget_internal_set(EWL_WIDGET(mb->inner_box), TRUE);
ewl_widget_show(EWL_WIDGET(mb->inner_box));
ewl_container_redirect_set(EWL_CONTAINER(mb),
- EWL_CONTAINER(mb->inner_box));
+ EWL_CONTAINER(mb->inner_box));
ewl_container_add_notify_set(EWL_CONTAINER(mb->inner_box),
- ewl_menubar_cb_child_add);
+ ewl_menubar_cb_child_add);
ewl_menubar_orientation_set(mb, EWL_ORIENTATION_HORIZONTAL);
@@ -125,15 +125,15 @@ ewl_menubar_from_info(Ewl_Menubar *mb, Ewl_Menubar_Info *info)
for (i = 0; info[i].name != NULL; i++)
{
- Ewl_Widget *menu;
-
- menu = ewl_menu_new();
- ewl_button_label_set(EWL_BUTTON(menu), info[i].name);
- ewl_menu_from_info(EWL_MENU(menu), info[i].menu);
- ewl_container_child_append(EWL_CONTAINER(mb), menu);
- ewl_object_fill_policy_set(EWL_OBJECT(menu),
- EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
- ewl_widget_show(menu);
+ Ewl_Widget *menu;
+
+ menu = ewl_menu_new();
+ ewl_button_label_set(EWL_BUTTON(menu), info[i].name);
+ ewl_menu_from_info(EWL_MENU(menu), info[i].menu);
+ ewl_container_child_append(EWL_CONTAINER(mb), menu);
+ ewl_object_fill_policy_set(EWL_OBJECT(menu),
+ EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
+ ewl_widget_show(menu);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -154,20 +154,20 @@ ewl_menubar_orientation_set(Ewl_Menubar *mb, Ewl_Orientation o)
ewl_box_orientation_set(EWL_BOX(mb), o);
if (o == EWL_ORIENTATION_HORIZONTAL) {
- ewl_object_fill_policy_set(EWL_OBJECT(mb),
- EWL_FLAG_FILL_HFILL);
- ewl_box_orientation_set(EWL_BOX(mb->inner_box),
- EWL_ORIENTATION_HORIZONTAL);
- ewl_object_fill_policy_set(EWL_OBJECT(mb->inner_box),
- EWL_FLAG_FILL_HFILL);
+ ewl_object_fill_policy_set(EWL_OBJECT(mb),
+ EWL_FLAG_FILL_HFILL);
+ ewl_box_orientation_set(EWL_BOX(mb->inner_box),
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_object_fill_policy_set(EWL_OBJECT(mb->inner_box),
+ EWL_FLAG_FILL_HFILL);
} else if (o == EWL_ORIENTATION_VERTICAL) {
- ewl_object_fill_policy_set(EWL_OBJECT(mb),
- EWL_FLAG_FILL_VFILL);
- ewl_box_orientation_set(EWL_BOX(mb->inner_box),
- EWL_ORIENTATION_VERTICAL);
- ewl_object_fill_policy_set(EWL_OBJECT(mb->inner_box),
- EWL_FLAG_FILL_VFILL);
+ ewl_object_fill_policy_set(EWL_OBJECT(mb),
+ EWL_FLAG_FILL_VFILL);
+ ewl_box_orientation_set(EWL_BOX(mb->inner_box),
+ EWL_ORIENTATION_VERTICAL);
+ ewl_object_fill_policy_set(EWL_OBJECT(mb->inner_box),
+ EWL_FLAG_FILL_VFILL);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -206,7 +206,7 @@ ewl_menubar_cb_child_add(Ewl_Container *c, Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (EWL_MENU_IS(w))
- EWL_MENU(w)->menubar_parent = EWL_WIDGET(c);
+ EWL_MENU(w)->menubar_parent = EWL_WIDGET(c);
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_menubar.h b/src/lib/ewl_menubar.h
index 7f3069f..c8600a7 100644
--- a/src/lib/ewl_menubar.h
+++ b/src/lib/ewl_menubar.h
@@ -51,8 +51,8 @@ typedef struct Ewl_Menubar Ewl_Menubar;
*/
struct Ewl_Menubar
{
- Ewl_Box outer_box; /**< Inherit from Ewl_Box */
- Ewl_Widget *inner_box; /**< The box to pack the widgets into */
+ Ewl_Box outer_box; /**< Inherit from Ewl_Box */
+ Ewl_Widget *inner_box; /**< The box to pack the widgets into */
};
/**
@@ -65,22 +65,22 @@ typedef struct Ewl_Menubar_Info Ewl_Menubar_Info;
*/
struct Ewl_Menubar_Info
{
- char *name; /**< The menu name */
- Ewl_Menu_Info *menu; /**< The menu items */
+ char *name; /**< The menu name */
+ Ewl_Menu_Info *menu; /**< The menu items */
};
Ewl_Widget *ewl_menubar_new(void);
Ewl_Widget *ewl_hmenubar_new(void);
Ewl_Widget *ewl_vmenubar_new(void);
-int ewl_menubar_init(Ewl_Menubar *mb);
+int ewl_menubar_init(Ewl_Menubar *mb);
-void ewl_menubar_from_info(Ewl_Menubar *mb, Ewl_Menubar_Info *info);
+void ewl_menubar_from_info(Ewl_Menubar *mb, Ewl_Menubar_Info *info);
-void ewl_menubar_orientation_set(Ewl_Menubar *mb, Ewl_Orientation o);
+void ewl_menubar_orientation_set(Ewl_Menubar *mb, Ewl_Orientation o);
Ewl_Orientation ewl_menubar_orientation_get(Ewl_Menubar *mb);
-void ewl_menubar_cb_child_add(Ewl_Container *c, Ewl_Widget *w);
+void ewl_menubar_cb_child_add(Ewl_Container *c, Ewl_Widget *w);
/**
* @}
diff --git a/src/lib/ewl_misc.c b/src/lib/ewl_misc.c
index baf7000..95e99f1 100644
--- a/src/lib/ewl_misc.c
+++ b/src/lib/ewl_misc.c
@@ -92,8 +92,8 @@ void
ewl_print_warning(void)
{
fprintf(stderr, "\n***** Ewl Developer Warning ***** :\n"
- " To find where this is occurring set a breakpoint\n"
- " for the function ewl_print_warning.\n");
+ " To find where this is occurring set a breakpoint\n"
+ " for the function ewl_print_warning.\n");
}
/**
@@ -104,8 +104,8 @@ void
ewl_segv(void)
{
if (ewl_config_cache.segv) {
- char *null = NULL;
- *null = '\0';
+ char *null = NULL;
+ *null = '\0';
}
}
@@ -123,13 +123,13 @@ ewl_backtrace(void)
size_t i;
if (!ewl_config_cache.backtrace)
- return;
+ return;
fprintf(stderr, "\n***** Backtrace *****\n");
size = backtrace(array, 128);
strings = backtrace_symbols(array, size);
for (i = 0; i < size; i++)
- fprintf(stderr, "%s\n", strings[i]);
+ fprintf(stderr, "%s\n", strings[i]);
FREE(strings);
#endif
@@ -153,53 +153,53 @@ ewl_init(int *argc, char **argv)
/* check if we are already initialized */
if (++ewl_init_count > 1)
- DRETURN_INT(ewl_init_count, DLEVEL_STABLE);
+ DRETURN_INT(ewl_init_count, DLEVEL_STABLE);
/* set the locale for string collation if it isn't already set */
locale = setlocale(LC_COLLATE, NULL);
if (strcmp(locale, "C") || strcmp(locale, "POSIX")) {
- setlocale(LC_COLLATE, "");
+ setlocale(LC_COLLATE, "");
}
shutdown_queue = ecore_list_new();
if (!shutdown_queue) {
- fprintf(stderr, "Could not create Ewl shutdown queue.\n");
- goto ERROR;
+ fprintf(stderr, "Could not create Ewl shutdown queue.\n");
+ goto ERROR;
}
if (!evas_init()) {
- fprintf(stderr, "Could not initialize Evas.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Evas.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, evas_shutdown);
if (!ecore_init()) {
- fprintf(stderr, "Could not initialize Ecore.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ecore.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ecore_shutdown);
if (!efreet_init()) {
- fprintf(stderr, "Could not initialize Efreet.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Efreet.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, efreet_shutdown);
if (!efreet_mime_init()) {
- fprintf(stderr, "Could not initialize Efreet_Mime.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Efreet_Mime.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, efreet_mime_shutdown);
if (!ecore_string_init()) {
- fprintf(stderr, "Could not initialize Ecore Strings.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ecore Strings.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ecore_string_shutdown);
if (!edje_init()) {
- fprintf(stderr, "Could not initialize Edje.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Edje.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, edje_shutdown);
@@ -216,14 +216,14 @@ ewl_init(int *argc, char **argv)
ewl_window_list = ecore_list_new();
shutdown_hooks = ecore_list_new();
if ((!reveal_list) || (!obscure_list) || (!configure_active)
- || (!configure_available)
- || (!realize_list) || (!destroy_list)
- || (!free_evas_list) || (!free_evas_object_list)
- || (!child_add_list) || (!ewl_embed_list)
- || (!ewl_window_list) || (!shutdown_hooks)) {
- fprintf(stderr, "Unable to initialize internal configuration."
- " Out of memory?\n");
- goto ERROR;
+ || (!configure_available)
+ || (!realize_list) || (!destroy_list)
+ || (!free_evas_list) || (!free_evas_object_list)
+ || (!child_add_list) || (!ewl_embed_list)
+ || (!ewl_window_list) || (!shutdown_hooks)) {
+ fprintf(stderr, "Unable to initialize internal configuration."
+ " Out of memory?\n");
+ goto ERROR;
}
/*
@@ -233,14 +233,14 @@ ewl_init(int *argc, char **argv)
ecore_list_free_cb_set(configure_available, free);
if (!ewl_config_init()) {
- fprintf(stderr, "Could not initialize Ewl Config.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ewl Config.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_config_shutdown);
if (!ewl_engines_init()) {
- fprintf(stderr, "Could not intialize Ewl Engines.\n");
- goto ERROR;
+ fprintf(stderr, "Could not intialize Ewl Engines.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_engines_shutdown);
@@ -253,14 +253,14 @@ ewl_init(int *argc, char **argv)
/* we create the engine we will be working with here so that it is
* initialized before we start to use it. */
if (!ewl_engine_new(ewl_config_string_get(ewl_config,
- EWL_CONFIG_ENGINE_NAME), argc, argv)) {
- fprintf(stderr, "Could not initialize Ewl Engine.\n");
- goto ERROR;
+ EWL_CONFIG_ENGINE_NAME), argc, argv)) {
+ fprintf(stderr, "Could not initialize Ewl Engine.\n");
+ goto ERROR;
}
if (!ewl_callbacks_init()) {
- fprintf(stderr, "Could not initialize Ewl Callback system.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ewl Callback system.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_callbacks_shutdown);
@@ -269,38 +269,38 @@ ewl_init(int *argc, char **argv)
EWL_CALLBACK_DELETE_WINDOW = ewl_callback_type_add();
if (!ewl_theme_init()) {
- fprintf(stderr, "Could not setup Ewl Theme system.\n");
- goto ERROR;
+ fprintf(stderr, "Could not setup Ewl Theme system.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_theme_shutdown);
if (!ewl_icon_theme_init()) {
- fprintf(stderr, "Could not initialize Ewl Icon Theme system.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ewl Icon Theme system.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_icon_theme_shutdown);
if (!ewl_dnd_init()) {
- fprintf(stderr, "Could not initialize Ewl DND support.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ewl DND support.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_dnd_shutdown);
if (!ewl_io_manager_init()) {
- fprintf(stderr, "Could not initialize Ewl IO Manager.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ewl IO Manager.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_io_manager_shutdown);
if (!ewl_text_context_init()) {
- fprintf(stderr, "Could not initialize Ewl Text Context system.\n");
- goto ERROR;
+ fprintf(stderr, "Could not initialize Ewl Text Context system.\n");
+ goto ERROR;
}
ecore_list_prepend(shutdown_queue, ewl_text_context_shutdown);
if (!(idle_enterer = ecore_idle_enterer_add(ewl_idle_render, NULL))) {
- fprintf(stderr, "Could not create Idle Enterer.\n");
- goto ERROR;
+ fprintf(stderr, "Could not create Idle Enterer.\n");
+ goto ERROR;
}
DRETURN_INT(ewl_init_count, DLEVEL_STABLE);
@@ -326,10 +326,10 @@ ewl_shutdown(void)
DENTER_FUNCTION(DLEVEL_STABLE);
if (--ewl_init_count)
- DRETURN_INT(ewl_init_count, DLEVEL_STABLE);
+ DRETURN_INT(ewl_init_count, DLEVEL_STABLE);
while ((hook = ecore_list_first_remove(shutdown_hooks)))
- hook();
+ hook();
IF_FREE_LIST(shutdown_hooks);
/*
@@ -337,20 +337,20 @@ ewl_shutdown(void)
*/
if (ewl_embed_list)
{
- Ewl_Widget *emb;
+ Ewl_Widget *emb;
- while ((emb = ecore_list_first_remove(ewl_embed_list)))
- ewl_widget_destroy(emb);
+ while ((emb = ecore_list_first_remove(ewl_embed_list)))
+ ewl_widget_destroy(emb);
- while (ewl_garbage_collect_idler(NULL) > 0)
- ;
- IF_FREE_LIST(ewl_embed_list);
+ while (ewl_garbage_collect_idler(NULL) > 0)
+ ;
+ IF_FREE_LIST(ewl_embed_list);
}
if (idle_enterer)
{
- ecore_idle_enterer_del(idle_enterer);
- idle_enterer = NULL;
+ ecore_idle_enterer_del(idle_enterer);
+ idle_enterer = NULL;
}
/*
@@ -369,7 +369,7 @@ ewl_shutdown(void)
/* shutdown all the subsystems */
while ((shutdown = ecore_list_first_remove(shutdown_queue)))
- shutdown();
+ shutdown();
IF_FREE_LIST(shutdown_queue);
DRETURN_INT(ewl_init_count, DLEVEL_STABLE);
@@ -438,21 +438,21 @@ ewl_idle_render(void *data __UNUSED__)
DENTER_FUNCTION(DLEVEL_STABLE);
if (!ewl_embed_list) {
- DERROR("EWL has not been initialized. Exiting....\n");
- ewl_main_quit();
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DERROR("EWL has not been initialized. Exiting....\n");
+ ewl_main_quit();
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
if (ecore_list_empty_is(ewl_embed_list))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
/*
* Freeze events on the evases to reduce overhead
*/
ecore_list_first_goto(ewl_embed_list);
while ((emb = ecore_list_next(ewl_embed_list)) != NULL)
- if (REALIZED(emb))
- ewl_embed_freeze(emb);
+ if (REALIZED(emb))
+ ewl_embed_freeze(emb);
/*
* Clean out the unused widgets first, to avoid them being drawn or
@@ -460,40 +460,40 @@ ewl_idle_render(void *data __UNUSED__)
* finally layout the widgets.
*/
if (!ecore_list_empty_is(destroy_list) ||
- !ecore_list_empty_is(free_evas_list) ||
- !ecore_list_empty_is(free_evas_object_list))
- ewl_garbage_collect = ecore_idler_add(ewl_garbage_collect_idler,
- NULL);
+ !ecore_list_empty_is(free_evas_list) ||
+ !ecore_list_empty_is(free_evas_object_list))
+ ewl_garbage_collect = ecore_idler_add(ewl_garbage_collect_idler,
+ NULL);
if (!ecore_list_empty_is(realize_list))
- ewl_realize_queue();
+ ewl_realize_queue();
while (!ecore_list_empty_is(configure_active)) {
- ewl_configure_queue_run();
-
- /*
- * Reclaim obscured objects at this point
- */
- while ((w = ecore_list_first_remove(obscure_list))) {
- /*
- * Ensure the widget is still obscured, then mark it
- * revealed so that the obscure will succeed (and mark
- * it obscured again.
- */
- if (REVEALED(w))
- ewl_widget_obscure(w);
- }
-
- /*
- * Allocate objects to revealed widgets.
- */
- while ((w = ecore_list_first_remove(reveal_list))) {
- /*
- * Follow the same logic as the obscure loop.
- */
- if (!REVEALED(w))
- ewl_widget_reveal(w);
- }
+ ewl_configure_queue_run();
+
+ /*
+ * Reclaim obscured objects at this point
+ */
+ while ((w = ecore_list_first_remove(obscure_list))) {
+ /*
+ * Ensure the widget is still obscured, then mark it
+ * revealed so that the obscure will succeed (and mark
+ * it obscured again.
+ */
+ if (REVEALED(w))
+ ewl_widget_obscure(w);
+ }
+
+ /*
+ * Allocate objects to revealed widgets.
+ */
+ while ((w = ecore_list_first_remove(reveal_list))) {
+ /*
+ * Follow the same logic as the obscure loop.
+ */
+ if (!REVEALED(w))
+ ewl_widget_reveal(w);
+ }
}
/*
@@ -501,22 +501,22 @@ ewl_idle_render(void *data __UNUSED__)
*/
ecore_list_first_goto(ewl_embed_list);
while ((emb = ecore_list_next(ewl_embed_list)) != NULL) {
- ewl_embed_thaw(emb);
+ ewl_embed_thaw(emb);
- if (REALIZED(emb)) {
- double render_time = 0;
+ if (REALIZED(emb)) {
+ double render_time = 0;
- if (ewl_config_cache.evas_render) {
- printf("Entering render\n");
- render_time = ecore_time_get();
- }
+ if (ewl_config_cache.evas_render) {
+ printf("Entering render\n");
+ render_time = ecore_time_get();
+ }
- ewl_engine_canvas_render(emb);
+ ewl_engine_canvas_render(emb);
- if (ewl_config_cache.evas_render)
- printf("Render time: %f seconds\n",
- ecore_time_get() - render_time);
- }
+ if (ewl_config_cache.evas_render)
+ printf("Render time: %f seconds\n",
+ ecore_time_get() - render_time);
+ }
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -556,122 +556,122 @@ ewl_init_parse_options(int *argc, char **argv)
DENTER_FUNCTION(DLEVEL_STABLE);
if (!argc || !argv)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
engines = ewl_engine_names_get();
i = 0;
while (i < *argc) {
- if (!strcmp(argv[i], "--ewl-segv")) {
- ewl_config_int_set(ewl_config, EWL_CONFIG_DEBUG_SEGV,
- 1, EWL_STATE_TRANSIENT);
- matched++;
- }
- else if (!strcmp(argv[i], "--ewl-backtrace")) {
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_DEBUG_BACKTRACE, 1,
- EWL_STATE_TRANSIENT);
- matched++;
- }
- else if (!strcmp(argv[i], "--ewl-theme")) {
- if (i + 1 < *argc) {
- ewl_config_string_set(ewl_config,
- EWL_CONFIG_THEME_NAME,
- argv[i + 1],
- EWL_STATE_TRANSIENT);
- matched++;
- }
- matched++;
- }
- else if (!strcmp(argv[i], "--ewl-print-theme-keys")) {
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_THEME_PRINT_KEYS, 1,
- EWL_STATE_TRANSIENT);
- matched++;
- }
- else if (!strcmp(argv[i], "--ewl-print-theme-signals")) {
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_THEME_PRINT_SIGNALS, 1,
- EWL_STATE_TRANSIENT);
- matched++;
- }
- else if (!strcmp(argv[i], "--ewl-print-gc-reap")) {
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_DEBUG_GC_REAP, 1,
- EWL_STATE_TRANSIENT);
- matched++;
- }
- else if (!strcmp(argv[i], "--ewl-debug")) {
- if ((i + 1) < *argc) {
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_DEBUG_LEVEL, atoi(argv[i + 1]),
- EWL_STATE_TRANSIENT);
- matched++;
- } else {
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_DEBUG_LEVEL, 1,
- EWL_STATE_TRANSIENT);
- }
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_DEBUG_ENABLE, 1,
- EWL_STATE_TRANSIENT);
- matched ++;
- }
- else if (!strcmp(argv[i], "--ewl-debug-paint")) {
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_DEBUG_EVAS_RENDER, 1,
- EWL_STATE_TRANSIENT);
- matched ++;
- }
- else if (!strcmp(argv[i], "--ewl-help")) {
- ewl_print_help();
- matched ++;
-
- /* this has to exit. otherwise we end up returning
- * FALSE from ewl_init which triggers the app to
- * spit out an error */
- exit(0);
- }
- else if (!strncmp(argv[i], "--ewl-", 6)) {
- unsigned int len;
-
- len = strlen("--ewl-");
- if (strlen(argv[i]) > len)
- {
- char *eng;
- char *name;
-
- eng = strdup(argv[i] + len);
-
- while ((name = strchr(eng, '-')))
- *name = '_';
-
- ecore_list_first_goto(engines);
- while ((name = ecore_list_next(engines)))
- {
- if (!strcmp(eng, name))
- {
- ewl_config_string_set(ewl_config,
- EWL_CONFIG_ENGINE_NAME, name,
- EWL_STATE_TRANSIENT);
- matched ++;
-
- break;
- }
- }
-
- FREE(eng);
- }
- }
-
- if (matched > 0) {
- while (matched) {
- ewl_init_remove_option(argc, argv, i);
- matched--;
- }
- }
- else
- i++;
+ if (!strcmp(argv[i], "--ewl-segv")) {
+ ewl_config_int_set(ewl_config, EWL_CONFIG_DEBUG_SEGV,
+ 1, EWL_STATE_TRANSIENT);
+ matched++;
+ }
+ else if (!strcmp(argv[i], "--ewl-backtrace")) {
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_DEBUG_BACKTRACE, 1,
+ EWL_STATE_TRANSIENT);
+ matched++;
+ }
+ else if (!strcmp(argv[i], "--ewl-theme")) {
+ if (i + 1 < *argc) {
+ ewl_config_string_set(ewl_config,
+ EWL_CONFIG_THEME_NAME,
+ argv[i + 1],
+ EWL_STATE_TRANSIENT);
+ matched++;
+ }
+ matched++;
+ }
+ else if (!strcmp(argv[i], "--ewl-print-theme-keys")) {
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_THEME_PRINT_KEYS, 1,
+ EWL_STATE_TRANSIENT);
+ matched++;
+ }
+ else if (!strcmp(argv[i], "--ewl-print-theme-signals")) {
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_THEME_PRINT_SIGNALS, 1,
+ EWL_STATE_TRANSIENT);
+ matched++;
+ }
+ else if (!strcmp(argv[i], "--ewl-print-gc-reap")) {
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_DEBUG_GC_REAP, 1,
+ EWL_STATE_TRANSIENT);
+ matched++;
+ }
+ else if (!strcmp(argv[i], "--ewl-debug")) {
+ if ((i + 1) < *argc) {
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_DEBUG_LEVEL, atoi(argv[i + 1]),
+ EWL_STATE_TRANSIENT);
+ matched++;
+ } else {
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_DEBUG_LEVEL, 1,
+ EWL_STATE_TRANSIENT);
+ }
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_DEBUG_ENABLE, 1,
+ EWL_STATE_TRANSIENT);
+ matched ++;
+ }
+ else if (!strcmp(argv[i], "--ewl-debug-paint")) {
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_DEBUG_EVAS_RENDER, 1,
+ EWL_STATE_TRANSIENT);
+ matched ++;
+ }
+ else if (!strcmp(argv[i], "--ewl-help")) {
+ ewl_print_help();
+ matched ++;
+
+ /* this has to exit. otherwise we end up returning
+ * FALSE from ewl_init which triggers the app to
+ * spit out an error */
+ exit(0);
+ }
+ else if (!strncmp(argv[i], "--ewl-", 6)) {
+ unsigned int len;
+
+ len = strlen("--ewl-");
+ if (strlen(argv[i]) > len)
+ {
+ char *eng;
+ char *name;
+
+ eng = strdup(argv[i] + len);
+
+ while ((name = strchr(eng, '-')))
+ *name = '_';
+
+ ecore_list_first_goto(engines);
+ while ((name = ecore_list_next(engines)))
+ {
+ if (!strcmp(eng, name))
+ {
+ ewl_config_string_set(ewl_config,
+ EWL_CONFIG_ENGINE_NAME, name,
+ EWL_STATE_TRANSIENT);
+ matched ++;
+
+ break;
+ }
+ }
+
+ FREE(eng);
+ }
+ }
+
+ if (matched > 0) {
+ while (matched) {
+ ewl_init_remove_option(argc, argv, i);
+ matched--;
+ }
+ }
+ else
+ i++;
}
IF_FREE_LIST(engines);
@@ -687,7 +687,7 @@ ewl_init_remove_option(int *argc, char **argv, int i)
*argc = *argc - 1;
for (j = i; j < *argc; j++)
- argv[j] = argv[j + 1];
+ argv[j] = argv[j + 1];
argv[j] = NULL;
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -706,26 +706,26 @@ ewl_print_help(void)
DENTER_FUNCTION(DLEVEL_STABLE);
printf("EWL Help\n"
- "\t--ewl-backtrace Print a stack trace warnings occur.\n"
- "\t--ewl-debug <level> Set the debugging printf level.\n"
- "\t--ewl-debug-paint Enable repaint debugging.\n"
- "\t--ewl-help Print this help message.\n"
- "\t--ewl-print-gc-reap Print garbage collection stats.\n"
- "\t--ewl-print-theme-keys Print theme keys matched widgets.\n"
- "\t--ewl-print-theme-signals Print theme keys matched widgets.\n"
- "\t--ewl-segv Trigger crash when warning printed.\n"
- "\t--ewl-theme <theme> Set the theme to use for widgets.\n"
- " AVAILABLE ENGINES\n");
+ "\t--ewl-backtrace Print a stack trace warnings occur.\n"
+ "\t--ewl-debug <level> Set the debugging printf level.\n"
+ "\t--ewl-debug-paint Enable repaint debugging.\n"
+ "\t--ewl-help Print this help message.\n"
+ "\t--ewl-print-gc-reap Print garbage collection stats.\n"
+ "\t--ewl-print-theme-keys Print theme keys matched widgets.\n"
+ "\t--ewl-print-theme-signals Print theme keys matched widgets.\n"
+ "\t--ewl-segv Trigger crash when warning printed.\n"
+ "\t--ewl-theme <theme> Set the theme to use for widgets.\n"
+ " AVAILABLE ENGINES\n");
names = ewl_engine_names_get();
while ((name = ecore_list_first_remove(names)))
{
- char *t;
- while ((t = strchr(name, '_')))
- *t = '-';
+ char *t;
+ while ((t = strchr(name, '_')))
+ *t = '-';
- printf("\t--ewl-%s\n", name);
- FREE(name);
+ printf("\t--ewl-%s\n", name);
+ FREE(name);
}
IF_FREE_LIST(names);
@@ -752,7 +752,7 @@ ewl_configure_request(Ewl_Widget * w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!VISIBLE(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
o = EWL_OBJECT(w);
@@ -761,9 +761,9 @@ ewl_configure_request(Ewl_Widget * w)
* within a configure callback.
*/
if (ewl_object_queued_has(o, (EWL_FLAG_QUEUED_SCHEDULED_DESTROY |
- EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE |
- EWL_FLAG_QUEUED_PROCESS_CONFIGURE)))
- DRETURN(DLEVEL_STABLE);
+ EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE |
+ EWL_FLAG_QUEUED_PROCESS_CONFIGURE)))
+ DRETURN(DLEVEL_STABLE);
/*
* Check for any parent scheduled for configuration, and look for the
@@ -771,24 +771,24 @@ ewl_configure_request(Ewl_Widget * w)
*/
search = w;
while (search->parent) {
- search = search->parent;
- if (ewl_object_queued_has(EWL_OBJECT(search),
- EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE))
- DRETURN(DLEVEL_TESTING);
+ search = search->parent;
+ if (ewl_object_queued_has(EWL_OBJECT(search),
+ EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE))
+ DRETURN(DLEVEL_TESTING);
}
/*
* Verify top level widget is not queued for configure.
*/
if (ewl_object_queued_has(EWL_OBJECT(search),
- EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE))
- DRETURN(DLEVEL_TESTING);
+ EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE))
+ DRETURN(DLEVEL_TESTING);
/*
* Stop processing if this widget doesn't have a valid embed parent.
*/
if (!ewl_object_toplevel_get(EWL_OBJECT(search)))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
emb = EWL_EMBED(search);
/*
@@ -804,29 +804,29 @@ ewl_configure_request(Ewl_Widget * w)
* one.
*/
if (queue_buffer) {
- if (queue_buffer->end >= EWL_CONFIGURE_QUEUE_SIZE)
- queue_buffer = NULL;
+ if (queue_buffer->end >= EWL_CONFIGURE_QUEUE_SIZE)
+ queue_buffer = NULL;
}
if (!queue_buffer) {
- /*
- * Attempt to use a previously allocated buffer first, fallback
- * to allocating one.
- */
- if (!ecore_list_empty_is(configure_available)) {
- queue_buffer = ecore_list_first_remove(configure_available);
- }
- else {
- queue_buffer = NEW(Ewl_Configure_Queue, 1);
- }
- ecore_list_append(configure_active, queue_buffer);
+ /*
+ * Attempt to use a previously allocated buffer first, fallback
+ * to allocating one.
+ */
+ if (!ecore_list_empty_is(configure_available)) {
+ queue_buffer = ecore_list_first_remove(configure_available);
+ }
+ else {
+ queue_buffer = NEW(Ewl_Configure_Queue, 1);
+ }
+ ecore_list_append(configure_active, queue_buffer);
}
/*
* Add the widget to the end of the queue.
*/
if (queue_buffer)
- queue_buffer->buffer[queue_buffer->end++] = w;
+ queue_buffer->buffer[queue_buffer->end++] = w;
DLEAVE_FUNCTION(DLEVEL_TESTING);
}
@@ -837,9 +837,9 @@ ewl_configure_queue_widget_run(Ewl_Widget *w)
DENTER_FUNCTION(DLEVEL_STABLE);
if (ewl_object_toplevel_get(EWL_OBJECT(w))) {
- ewl_object_size_request(EWL_OBJECT(w),
- ewl_object_current_w_get(EWL_OBJECT(w)),
- ewl_object_current_h_get(EWL_OBJECT(w)));
+ ewl_object_size_request(EWL_OBJECT(w),
+ ewl_object_current_w_get(EWL_OBJECT(w)),
+ ewl_object_current_h_get(EWL_OBJECT(w)));
}
/*
@@ -854,18 +854,18 @@ ewl_configure_queue_widget_run(Ewl_Widget *w)
* queued to receive new evas objects.
*/
if (!ewl_widget_onscreen_is(w)) {
- if (REVEALED(w))
- ecore_list_prepend(obscure_list, w);
+ if (REVEALED(w))
+ ecore_list_prepend(obscure_list, w);
}
else {
- if (!REVEALED(w))
- ecore_list_prepend(reveal_list, w);
-
- ewl_object_queued_add(EWL_OBJECT(w), EWL_FLAG_QUEUED_PROCESS_CONFIGURE);
- if (REALIZED(w) && VISIBLE(w) && REVEALED(w))
- ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
- ewl_object_queued_remove(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_PROCESS_CONFIGURE);
+ if (!REVEALED(w))
+ ecore_list_prepend(reveal_list, w);
+
+ ewl_object_queued_add(EWL_OBJECT(w), EWL_FLAG_QUEUED_PROCESS_CONFIGURE);
+ if (REALIZED(w) && VISIBLE(w) && REVEALED(w))
+ ewl_callback_call(w, EWL_CALLBACK_CONFIGURE);
+ ewl_object_queued_remove(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_PROCESS_CONFIGURE);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -887,19 +887,19 @@ ewl_configure_queue_run(void)
* Configure any widgets that need it.
*/
while ((queue_buffer = ecore_list_first_remove(configure_active))) {
- int i;
- for (i = 0; i < queue_buffer->end; i++) {
- Ewl_Widget *w;
-
- w = queue_buffer->buffer[i];
- ewl_configure_queue_widget_run(w);
- }
-
- /*
- * Add to the available list re-initialized.
- */
- queue_buffer->end = 0;
- ecore_list_prepend(configure_available, queue_buffer);
+ int i;
+ for (i = 0; i < queue_buffer->end; i++) {
+ Ewl_Widget *w;
+
+ w = queue_buffer->buffer[i];
+ ewl_configure_queue_widget_run(w);
+ }
+
+ /*
+ * Add to the available list re-initialized.
+ */
+ queue_buffer->end = 0;
+ ecore_list_prepend(configure_available, queue_buffer);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -921,21 +921,21 @@ ewl_configure_cancel_request(Ewl_Widget *w)
ecore_list_first_goto(configure_active);
while ((queue_buffer = ecore_list_next(configure_active))) {
- int i;
- for (i = 0; i < queue_buffer->end; i++) {
- Ewl_Widget *tmp;
-
- tmp = queue_buffer->buffer[i];
- if (tmp == w) {
- ewl_object_queued_remove(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE);
- if (i < queue_buffer->end - 1)
- memmove(queue_buffer->buffer + i,
- queue_buffer->buffer + i + 1,
- queue_buffer->end - i - 1);
- queue_buffer->end--;
- }
- }
+ int i;
+ for (i = 0; i < queue_buffer->end; i++) {
+ Ewl_Widget *tmp;
+
+ tmp = queue_buffer->buffer[i];
+ if (tmp == w) {
+ ewl_object_queued_remove(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE);
+ if (i < queue_buffer->end - 1)
+ memmove(queue_buffer->buffer + i,
+ queue_buffer->buffer + i + 1,
+ queue_buffer->end - i - 1);
+ queue_buffer->end--;
+ }
+ }
}
DLEAVE_FUNCTION(DLEVEL_TESTING);
@@ -957,18 +957,18 @@ ewl_realize_request(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (ewl_object_queued_has(EWL_OBJECT(w), EWL_FLAG_QUEUED_SCHEDULED_REVEAL))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!ewl_object_flags_get(EWL_OBJECT(w), EWL_FLAG_PROPERTY_TOPLEVEL)) {
- Ewl_Object *o = EWL_OBJECT(w->parent);
- if (!o)
- DRETURN(DLEVEL_STABLE);
-
- if (!ewl_object_queued_has(EWL_OBJECT(o),
- EWL_FLAG_QUEUED_PROCESS_REVEAL)) {
- if (!REALIZED(o))
- DRETURN(DLEVEL_STABLE);
- }
+ Ewl_Object *o = EWL_OBJECT(w->parent);
+ if (!o)
+ DRETURN(DLEVEL_STABLE);
+
+ if (!ewl_object_queued_has(EWL_OBJECT(o),
+ EWL_FLAG_QUEUED_PROCESS_REVEAL)) {
+ if (!REALIZED(o))
+ DRETURN(DLEVEL_STABLE);
+ }
}
ewl_object_queued_add(EWL_OBJECT(w), EWL_FLAG_QUEUED_SCHEDULED_REVEAL);
@@ -995,9 +995,9 @@ ewl_realize_cancel_request(Ewl_Widget *w)
ecore_list_goto(realize_list, w);
if (ecore_list_current(realize_list) == w)
{
- ewl_object_queued_remove(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_SCHEDULED_REVEAL);
- ecore_list_remove(realize_list);
+ ewl_object_queued_remove(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_SCHEDULED_REVEAL);
+ ecore_list_remove(realize_list);
}
DLEAVE_FUNCTION(DLEVEL_TESTING);
@@ -1022,14 +1022,14 @@ ewl_realize_queue(void)
* or they are a toplevel widget.
*/
while ((w = ecore_list_first_remove(realize_list))) {
- if (VISIBLE(w) && !REALIZED(w)) {
- ewl_object_queued_add(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_PROCESS_REVEAL);
- ewl_widget_realize(EWL_WIDGET(w));
- ewl_object_queued_remove(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_PROCESS_REVEAL);
- ecore_list_prepend(child_add_list, w);
- }
+ if (VISIBLE(w) && !REALIZED(w)) {
+ ewl_object_queued_add(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_PROCESS_REVEAL);
+ ewl_widget_realize(EWL_WIDGET(w));
+ ewl_object_queued_remove(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_PROCESS_REVEAL);
+ ecore_list_prepend(child_add_list, w);
+ }
}
/*
@@ -1037,27 +1037,27 @@ ewl_realize_queue(void)
* top.
*/
while ((w = ecore_list_first_remove(child_add_list))) {
- /*
- * Check visibility in case the realize callback changed it.
- */
- if (VISIBLE(w))
- ewl_callback_call(w, EWL_CALLBACK_SHOW);
-
- /*
- * Give the top level widgets their initial preferred size.
- */
- if (ewl_object_flags_get(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_TOPLEVEL)) {
- ewl_object_size_request(EWL_OBJECT(w),
- ewl_object_current_w_get(EWL_OBJECT(w)),
- ewl_object_current_h_get(EWL_OBJECT(w)));
- }
-
- /*
- * Indicate widget no longer on the realize queue.
- */
- ewl_object_queued_remove(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_SCHEDULED_REVEAL);
+ /*
+ * Check visibility in case the realize callback changed it.
+ */
+ if (VISIBLE(w))
+ ewl_callback_call(w, EWL_CALLBACK_SHOW);
+
+ /*
+ * Give the top level widgets their initial preferred size.
+ */
+ if (ewl_object_flags_get(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_TOPLEVEL)) {
+ ewl_object_size_request(EWL_OBJECT(w),
+ ewl_object_current_w_get(EWL_OBJECT(w)),
+ ewl_object_current_h_get(EWL_OBJECT(w)));
+ }
+
+ /*
+ * Indicate widget no longer on the realize queue.
+ */
+ ewl_object_queued_remove(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_SCHEDULED_REVEAL);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1079,10 +1079,10 @@ ewl_destroy_request(Ewl_Widget *w)
DCHECK_PARAM_PTR(w);
if (DESTROYED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (CONFIGURED(w))
- ewl_configure_cancel_request(w);
+ ewl_configure_cancel_request(w);
ewl_object_queued_add(EWL_OBJECT(w), EWL_FLAG_QUEUED_SCHEDULED_DESTROY);
@@ -1095,7 +1095,7 @@ ewl_destroy_request(Ewl_Widget *w)
* Schedule child widgets for destruction.
*/
if (ewl_object_recursive_get(EWL_OBJECT(w)))
- ewl_container_destroy(EWL_CONTAINER(w));
+ ewl_container_destroy(EWL_CONTAINER(w));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1156,48 +1156,48 @@ ewl_garbage_collect_idler(void *data __UNUSED__)
if (ewl_config_cache.gc_reap) printf("---\n");
while ((cleanup < EWL_GC_LIMIT) &&
- (w = ecore_list_first_remove(destroy_list))) {
- if (ewl_object_queued_has(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE))
- ewl_configure_cancel_request(w);
-
- ewl_callback_call(w, EWL_CALLBACK_DESTROY);
- ewl_callback_del_type(w, EWL_CALLBACK_DESTROY);
- ewl_widget_free(w);
- cleanup++;
+ (w = ecore_list_first_remove(destroy_list))) {
+ if (ewl_object_queued_has(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE))
+ ewl_configure_cancel_request(w);
+
+ ewl_callback_call(w, EWL_CALLBACK_DESTROY);
+ ewl_callback_del_type(w, EWL_CALLBACK_DESTROY);
+ ewl_widget_free(w);
+ cleanup++;
}
if (ewl_config_cache.gc_reap)
- printf("Destroyed %d EWL objects\n", cleanup);
+ printf("Destroyed %d EWL objects\n", cleanup);
cleanup = 0;
while ((obj = ecore_list_first_remove(free_evas_object_list))) {
- evas_object_del(obj);
- cleanup++;
+ evas_object_del(obj);
+ cleanup++;
}
if (ewl_config_cache.gc_reap)
- printf("Destroyed %d Evas Objects\n", cleanup);
+ printf("Destroyed %d Evas Objects\n", cleanup);
cleanup = 0;
/* make sure the widget and object lists are clear before trying to
* remove the evas canvas */
if ((ecore_list_count(free_evas_object_list) == 0)
- && (ecore_list_count(destroy_list) == 0)) {
- while ((evas = ecore_list_first_remove(free_evas_list))) {
- evas_free(evas);
- cleanup++;
- }
+ && (ecore_list_count(destroy_list) == 0)) {
+ while ((evas = ecore_list_first_remove(free_evas_list))) {
+ evas_free(evas);
+ cleanup++;
+ }
}
if (ewl_config_cache.gc_reap)
- printf("Destroyed %d Evas\n---\n", cleanup);
+ printf("Destroyed %d Evas\n---\n", cleanup);
/* We set the ewl_garbage_collect to NULL because when we return 0
* (because destroy_list is empty) ecore will cleanup the idler
* memory for us. */
if (!ecore_list_count(destroy_list))
- ewl_garbage_collect = NULL;
+ ewl_garbage_collect = NULL;
DRETURN_INT(ecore_list_count(destroy_list), DLEVEL_STABLE);
}
@@ -1232,10 +1232,10 @@ ewl_debug_indent_print(int mod_dir)
if (mod_dir < 0) ewl_debug_indent_lvl --;
if (ewl_debug_indent_lvl < 0)
- ewl_debug_indent_lvl = 0;
+ ewl_debug_indent_lvl = 0;
for (indent = 0; indent < (ewl_debug_indent_lvl << 1) + 2; indent++)
- fputc(' ', stderr);
+ fputc(' ', stderr);
if (mod_dir > 0) ewl_debug_indent_lvl ++;
}
diff --git a/src/lib/ewl_model.c b/src/lib/ewl_model.c
index a1f0b3a..e0ef1f0 100644
--- a/src/lib/ewl_model.c
+++ b/src/lib/ewl_model.c
@@ -19,8 +19,8 @@ ewl_model_new(void)
model = NEW(Ewl_Model, 1);
if (!ewl_model_init(model))
{
- FREE(model);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(model);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(model, DLEVEL_STABLE);
@@ -41,8 +41,8 @@ ewl_model_ecore_list_instance(void)
model = ewl_model_new();
if (model)
{
- ewl_model_data_fetch_set(model, ewl_model_cb_ecore_list_fetch);
- ewl_model_data_count_set(model, ewl_model_cb_ecore_list_count);
+ ewl_model_data_fetch_set(model, ewl_model_cb_ecore_list_fetch);
+ ewl_model_data_count_set(model, ewl_model_cb_ecore_list_count);
}
DRETURN_PTR(model, DLEVEL_STABLE);
@@ -320,7 +320,7 @@ ewl_model_data_expandable_get(const Ewl_Model *m)
*/
void
ewl_model_expansion_data_fetch_set(Ewl_Model *m,
- Ewl_Model_Expansion_Data_Fetch get)
+ Ewl_Model_Expansion_Data_Fetch get)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(m);
@@ -388,7 +388,7 @@ ewl_model_data_free_get(const Ewl_Model *m)
*/
void
ewl_model_expansion_model_fetch_set(Ewl_Model *m,
- Ewl_Model_Expansion_Model_Fetch f)
+ Ewl_Model_Expansion_Model_Fetch f)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(m);
@@ -421,7 +421,7 @@ ewl_model_expansion_model_fetch_get(const Ewl_Model *m)
*/
void *
ewl_model_cb_ecore_list_fetch(void *data, unsigned int row,
- unsigned int col __UNUSED__)
+ unsigned int col __UNUSED__)
{
Ecore_List *list;
diff --git a/src/lib/ewl_model.h b/src/lib/ewl_model.h
index 6b342e0..fd471e7 100644
--- a/src/lib/ewl_model.h
+++ b/src/lib/ewl_model.h
@@ -26,7 +26,7 @@ typedef struct Ewl_Model Ewl_Model;
* A typedef to shorten the definition of the model_fetch callbacks.
*/
typedef void *(*Ewl_Model_Data_Fetch)(void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
/**
* @def EWL_MODEL_FREE(f)
@@ -84,7 +84,7 @@ typedef void *(*Ewl_Model_Data_Header_Fetch)(void *data, unsigned int col);
* callback
*/
typedef Ewl_Model *(*Ewl_Model_Expansion_Model_Fetch)(void *data,
- unsigned int row);
+ unsigned int row);
/**
* @def EWL_MODEL_DATA_SORT(f)
@@ -97,7 +97,7 @@ typedef Ewl_Model *(*Ewl_Model_Expansion_Model_Fetch)(void *data,
* A typedef to shorten the definition of the model_sort callbacks.
*/
typedef void (*Ewl_Model_Data_Sort)(void *data, unsigned int column,
- Ewl_Sort_Direction sort);
+ Ewl_Sort_Direction sort);
/**
* @def EWL_MODEL_DATA_COUNT(f)
@@ -158,9 +158,9 @@ struct Ewl_Model
{
struct
{
- Ewl_Model_Data_Expandable is; /**< Is the row expandable */
- Ewl_Model_Expansion_Data_Fetch data; /**< Get expansion data */
- Ewl_Model_Expansion_Model_Fetch model; /**< Get expansion model */
+ Ewl_Model_Data_Expandable is; /**< Is the row expandable */
+ Ewl_Model_Expansion_Data_Fetch data; /**< Get expansion data */
+ Ewl_Model_Expansion_Model_Fetch model; /**< Get expansion model */
} expansion;
Ewl_Model_Column_Sortable sortable; /**< Is a column sortable */
@@ -174,60 +174,60 @@ struct Ewl_Model
Ewl_Model_Data_Highlight highlight; /**< Highlight the cell */
};
-Ewl_Model *ewl_model_new(void);
-int ewl_model_init(Ewl_Model *model);
+Ewl_Model *ewl_model_new(void);
+int ewl_model_init(Ewl_Model *model);
-Ewl_Model *ewl_model_ecore_list_instance(void);
+Ewl_Model *ewl_model_ecore_list_instance(void);
-void ewl_model_data_fetch_set(Ewl_Model *m,
- Ewl_Model_Data_Fetch get);
+void ewl_model_data_fetch_set(Ewl_Model *m,
+ Ewl_Model_Data_Fetch get);
Ewl_Model_Data_Fetch ewl_model_data_fetch_get(const Ewl_Model *m);
-void ewl_model_data_header_fetch_set(Ewl_Model *m,
- Ewl_Model_Data_Header_Fetch get);
+void ewl_model_data_header_fetch_set(Ewl_Model *m,
+ Ewl_Model_Data_Header_Fetch get);
Ewl_Model_Data_Header_Fetch ewl_model_data_header_fetch_get(const Ewl_Model *m);
-void ewl_model_data_free_set(Ewl_Model *m,
- Ewl_Model_Data_Free assign);
+void ewl_model_data_free_set(Ewl_Model *m,
+ Ewl_Model_Data_Free assign);
Ewl_Model_Data_Free ewl_model_data_free_get(const Ewl_Model *m);
-void ewl_model_column_sortable_set(Ewl_Model *m,
- Ewl_Model_Column_Sortable sortable);
+void ewl_model_column_sortable_set(Ewl_Model *m,
+ Ewl_Model_Column_Sortable sortable);
Ewl_Model_Column_Sortable ewl_model_column_sortable_get(const Ewl_Model *m);
-void ewl_model_data_sort_set(Ewl_Model *m,
- Ewl_Model_Data_Sort sort);
+void ewl_model_data_sort_set(Ewl_Model *m,
+ Ewl_Model_Data_Sort sort);
Ewl_Model_Data_Sort ewl_model_data_sort_get(const Ewl_Model *m);
-void ewl_model_data_highlight_set(Ewl_Model *m,
- Ewl_Model_Data_Highlight highlight);
+void ewl_model_data_highlight_set(Ewl_Model *m,
+ Ewl_Model_Data_Highlight highlight);
Ewl_Model_Data_Highlight ewl_model_data_highlight_get(const Ewl_Model *m);
-void ewl_model_data_count_set(Ewl_Model *m,
- Ewl_Model_Data_Count count);
+void ewl_model_data_count_set(Ewl_Model *m,
+ Ewl_Model_Data_Count count);
Ewl_Model_Data_Count ewl_model_data_count_get(const Ewl_Model *m);
-void ewl_model_data_unref_set(Ewl_Model *m,
- Ewl_Model_Data_Unref unref);
+void ewl_model_data_unref_set(Ewl_Model *m,
+ Ewl_Model_Data_Unref unref);
Ewl_Model_Data_Unref ewl_model_data_unref_get(const Ewl_Model *m);
-void ewl_model_data_expandable_set(Ewl_Model *m,
- Ewl_Model_Data_Expandable exp);
+void ewl_model_data_expandable_set(Ewl_Model *m,
+ Ewl_Model_Data_Expandable exp);
Ewl_Model_Data_Expandable ewl_model_data_expandable_get(const Ewl_Model *m);
-void ewl_model_expansion_data_fetch_set(Ewl_Model *m,
- Ewl_Model_Expansion_Data_Fetch get);
+void ewl_model_expansion_data_fetch_set(Ewl_Model *m,
+ Ewl_Model_Expansion_Data_Fetch get);
Ewl_Model_Expansion_Data_Fetch ewl_model_expansion_data_fetch_get(const Ewl_Model *m);
-void ewl_model_expansion_model_fetch_set(Ewl_Model *m,
- Ewl_Model_Expansion_Model_Fetch f);
+void ewl_model_expansion_model_fetch_set(Ewl_Model *m,
+ Ewl_Model_Expansion_Model_Fetch f);
Ewl_Model_Expansion_Model_Fetch ewl_model_expansion_model_fetch_get(const Ewl_Model *m);
/*
* Internal stuff.
*/
void *ewl_model_cb_ecore_list_fetch(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
unsigned int ewl_model_cb_ecore_list_count(void *data);
/**
diff --git a/src/lib/ewl_mvc.c b/src/lib/ewl_mvc.c
index 5a30221..b3bc913 100644
--- a/src/lib/ewl_mvc.c
+++ b/src/lib/ewl_mvc.c
@@ -7,27 +7,27 @@
static void ewl_mvc_selected_clear_private(Ewl_MVC *mvc);
static unsigned int ewl_mvc_selected_goto(Ewl_MVC *mvc,
- unsigned int row, unsigned int column);
+ unsigned int row, unsigned int column);
static void ewl_mvc_selected_insert(Ewl_MVC *mvc, const Ewl_Model *model,
- void *data, Ewl_Selection *sel,
- unsigned int row, unsigned int column);
+ void *data, Ewl_Selection *sel,
+ unsigned int row, unsigned int column);
static void ewl_mvc_selected_range_split(Ewl_MVC *mvc,
- Ewl_Selection_Range *range,
- unsigned int row, unsigned int column);
+ Ewl_Selection_Range *range,
+ unsigned int row, unsigned int column);
static int ewl_mvc_selection_intersects(Ewl_Selection_Range *range,
- Ewl_Selection *sel);
+ Ewl_Selection *sel);
static int ewl_mvc_selection_contained(Ewl_Selection_Range *a,
- Ewl_Selection_Range *b);
+ Ewl_Selection_Range *b);
static int ewl_mvc_line_intersects(int astart, int aend, int bstart, int bend);
static void ewl_mvc_range_merge(Ecore_List *list, const Ewl_Model *model, void *data,
- Ewl_Selection_Range *range, Ewl_Selection_Range *cur);
+ Ewl_Selection_Range *range, Ewl_Selection_Range *cur);
static Ewl_Selection *ewl_mvc_selection_make(const Ewl_Model *model, void *data,
- unsigned int top, unsigned int left,
- unsigned int bottom, unsigned int right);
+ unsigned int top, unsigned int left,
+ unsigned int bottom, unsigned int right);
static void ewl_mvc_selected_change_notify(Ewl_MVC *mvc);
static void ewl_mvc_highlight_do(Ewl_MVC *mvc, Ewl_Container *c,
- Ewl_Selection *sel, Ewl_Widget *w);
+ Ewl_Selection *sel, Ewl_Widget *w);
static void ewl_mvc_cb_highlight_destroy(Ewl_Widget *w, void *ev, void *data);
static void ewl_mvc_cb_sel_free(void *data);
static void ewl_mvc_selection_free(Ewl_Selection *sel);
@@ -44,15 +44,15 @@ ewl_mvc_init(Ewl_MVC *mvc)
DCHECK_PARAM_PTR_RET(mvc, FALSE);
if (!ewl_box_init(EWL_BOX(mvc)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(mvc), EWL_MVC_TYPE);
ewl_box_orientation_set(EWL_BOX(mvc), EWL_ORIENTATION_VERTICAL);
ewl_callback_append(EWL_WIDGET(mvc), EWL_CALLBACK_DESTROY,
- ewl_mvc_cb_destroy, NULL);
+ ewl_mvc_cb_destroy, NULL);
ewl_callback_append(EWL_WIDGET(mvc), EWL_CALLBACK_DESTROY,
- ewl_mvc_cb_data_unref, NULL);
+ ewl_mvc_cb_data_unref, NULL);
ewl_mvc_selection_mode_set(mvc, EWL_SELECTION_MODE_SINGLE);
@@ -74,11 +74,11 @@ ewl_mvc_view_set(Ewl_MVC *mvc, const Ewl_View *view)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->view == view)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
mvc->view = view;
if (mvc->cb.view_change)
- mvc->cb.view_change(mvc);
+ mvc->cb.view_change(mvc);
ewl_mvc_dirty_set(mvc, TRUE);
@@ -134,7 +134,7 @@ ewl_mvc_model_set(Ewl_MVC *mvc, const Ewl_Model *model)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->model == model)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
mvc->model = model;
ewl_mvc_dirty_set(mvc, TRUE);
@@ -208,7 +208,7 @@ ewl_mvc_dirty_set(Ewl_MVC *mvc, unsigned int dirty)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->dirty == dirty)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
mvc->dirty = !!dirty;
ewl_widget_configure(EWL_WIDGET(mvc));
@@ -245,17 +245,17 @@ ewl_mvc_selection_mode_set(Ewl_MVC *mvc, Ewl_Selection_Mode mode)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == mode)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
mvc->selection_mode = mode;
if (mode == EWL_SELECTION_MODE_NONE)
{
- IF_FREE_LIST(mvc->selected);
+ IF_FREE_LIST(mvc->selected);
}
else if (!mvc->selected)
{
- mvc->selected = ecore_list_new();
- ecore_list_free_cb_set(mvc->selected, ewl_mvc_cb_sel_free);
+ mvc->selected = ecore_list_new();
+ ecore_list_free_cb_set(mvc->selected, ewl_mvc_cb_sel_free);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -289,7 +289,7 @@ ewl_mvc_selected_clear(Ewl_MVC *mvc)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_mvc_selected_clear_private(mvc);
ewl_mvc_selected_change_notify(mvc);
@@ -307,10 +307,10 @@ ewl_mvc_selected_clear_private(Ewl_MVC *mvc)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
while ((sel = ecore_list_first_remove(mvc->selected)))
- ewl_mvc_selection_free(sel);
+ ewl_mvc_selection_free(sel);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -333,24 +333,24 @@ ewl_mvc_selected_list_set(Ewl_MVC *mvc, Ecore_List *list)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
count = ewl_mvc_selected_count_get(mvc);
ewl_mvc_selected_clear_private(mvc);
if (!list || (ecore_list_count(list) == 0))
{
- if (count > 0) ewl_mvc_selected_change_notify(mvc);
- DRETURN(DLEVEL_STABLE);
+ if (count > 0) ewl_mvc_selected_change_notify(mvc);
+ DRETURN(DLEVEL_STABLE);
}
ewl_mvc_selected_insert(mvc, NULL, NULL,
- ecore_list_first_remove(list), 0, 0);
+ ecore_list_first_remove(list), 0, 0);
if (mvc->selection_mode == EWL_SELECTION_MODE_MULTI)
{
- while ((sel = ecore_list_first_remove(list)))
- ewl_mvc_selected_insert(mvc, NULL, NULL, sel, 0, 0);
+ while ((sel = ecore_list_first_remove(list)))
+ ewl_mvc_selected_insert(mvc, NULL, NULL, sel, 0, 0);
}
ewl_mvc_selected_change_notify(mvc);
@@ -372,7 +372,7 @@ ewl_mvc_selected_list_get(Ewl_MVC *mvc)
DCHECK_TYPE_RET(mvc, EWL_MVC_TYPE, NULL);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
DRETURN_PTR(mvc->selected, DLEVEL_STABLE);
}
@@ -391,8 +391,8 @@ ewl_mvc_selected_list_get(Ewl_MVC *mvc)
*/
void
ewl_mvc_selected_range_add(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
- unsigned int srow, unsigned int scolumn,
- unsigned int erow, unsigned int ecolumn)
+ unsigned int srow, unsigned int scolumn,
+ unsigned int erow, unsigned int ecolumn)
{
Ewl_Selection *sel;
const Ewl_Model *mod;
@@ -403,7 +403,7 @@ ewl_mvc_selected_range_add(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (model) mod = model;
else mod = ewl_mvc_model_get(mvc);
@@ -411,25 +411,25 @@ ewl_mvc_selected_range_add(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
/* make sure the start comes before the end */
if (erow < srow)
{
- tmp = erow;
- erow = srow;
- srow = tmp;
+ tmp = erow;
+ erow = srow;
+ srow = tmp;
}
if (ecolumn < scolumn)
{
- tmp = ecolumn;
- ecolumn = scolumn;
- scolumn = tmp;
+ tmp = ecolumn;
+ ecolumn = scolumn;
+ scolumn = tmp;
}
if (mvc->selection_mode == EWL_SELECTION_MODE_SINGLE)
- ewl_mvc_selected_insert(mvc, mod, data, NULL, srow, scolumn);
+ ewl_mvc_selected_insert(mvc, mod, data, NULL, srow, scolumn);
else
{
- sel = ewl_mvc_selection_range_new(mod, data, srow, scolumn,
- erow, ecolumn);
- ewl_mvc_selected_insert(mvc, NULL, NULL, sel, 0, 0);
+ sel = ewl_mvc_selection_range_new(mod, data, srow, scolumn,
+ erow, ecolumn);
+ ewl_mvc_selected_insert(mvc, NULL, NULL, sel, 0, 0);
}
ewl_mvc_selected_change_notify(mvc);
@@ -449,14 +449,14 @@ ewl_mvc_selected_range_add(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
*/
void
ewl_mvc_selected_set(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
- unsigned int row, unsigned int column)
+ unsigned int row, unsigned int column)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(mvc);
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_mvc_selected_clear_private(mvc);
ewl_mvc_selected_add(mvc, model, data, row, column);
@@ -476,7 +476,7 @@ ewl_mvc_selected_set(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
*/
void
ewl_mvc_selected_add(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
- unsigned int row, unsigned int column)
+ unsigned int row, unsigned int column)
{
const Ewl_Model *mod;
@@ -485,7 +485,7 @@ ewl_mvc_selected_add(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (model) mod = model;
else mod = ewl_mvc_model_get(mvc);
@@ -515,7 +515,7 @@ ewl_mvc_selected_get(Ewl_MVC *mvc)
DCHECK_TYPE_RET(mvc, EWL_MVC_TYPE, NULL);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ecore_list_last_goto(mvc->selected);
sel = ecore_list_current(mvc->selected);
@@ -527,19 +527,19 @@ ewl_mvc_selected_get(Ewl_MVC *mvc)
ret->sel.data = sel->data;
if (sel->type == EWL_SELECTION_TYPE_INDEX)
{
- Ewl_Selection_Idx *si;
+ Ewl_Selection_Idx *si;
- si = EWL_SELECTION_IDX(sel);
- ret->row = si->row;
- ret->column = si->column;
+ si = EWL_SELECTION_IDX(sel);
+ ret->row = si->row;
+ ret->column = si->column;
}
else
{
- Ewl_Selection_Range *si;
+ Ewl_Selection_Range *si;
- si = EWL_SELECTION_RANGE(sel);
- ret->row = si->start.row;
- ret->column = si->start.column;
+ si = EWL_SELECTION_RANGE(sel);
+ ret->row = si->start.row;
+ ret->column = si->start.column;
}
DRETURN_PTR(ret, DLEVEL_STABLE);
@@ -555,7 +555,7 @@ ewl_mvc_selected_get(Ewl_MVC *mvc)
*/
void
ewl_mvc_selected_rm(Ewl_MVC *mvc, void *data __UNUSED__, unsigned int row,
- unsigned int column)
+ unsigned int column)
{
Ewl_Selection *sel;
@@ -564,22 +564,22 @@ ewl_mvc_selected_rm(Ewl_MVC *mvc, void *data __UNUSED__, unsigned int row,
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_mvc_selected_goto(mvc, row, column))
{
- sel = ecore_list_current(mvc->selected);
-
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- sel = ecore_list_remove(mvc->selected);
- ewl_mvc_selection_free(sel);
- }
- else
- ewl_mvc_selected_range_split(mvc,
- EWL_SELECTION_RANGE(sel), row, column);
-
- ewl_mvc_selected_change_notify(mvc);
+ sel = ecore_list_current(mvc->selected);
+
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ sel = ecore_list_remove(mvc->selected);
+ ewl_mvc_selection_free(sel);
+ }
+ else
+ ewl_mvc_selected_range_split(mvc,
+ EWL_SELECTION_RANGE(sel), row, column);
+
+ ewl_mvc_selected_change_notify(mvc);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -603,32 +603,32 @@ ewl_mvc_selected_count_get(Ewl_MVC *mvc)
DCHECK_TYPE_RET(mvc, EWL_MVC_TYPE, 0);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
/* make sure we only return 1 or 0 for the single select case */
if (mvc->selection_mode == EWL_SELECTION_MODE_SINGLE)
{
- if (ecore_list_count(mvc->selected))
- DRETURN_INT(1, DLEVEL_STABLE);
+ if (ecore_list_count(mvc->selected))
+ DRETURN_INT(1, DLEVEL_STABLE);
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
}
ecore_list_first_goto(mvc->selected);
while ((sel = ecore_list_next(mvc->selected)))
{
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- count ++;
- else if (sel->type == EWL_SELECTION_TYPE_RANGE)
- {
- Ewl_Selection_Range *r;
- unsigned int rows = 0, columns = 0;
-
- r = EWL_SELECTION_RANGE(sel);
- rows = (r->end.row - r->start.row) + 1;
- columns = (r->end.column - r->start.column) + 1;
- count += (rows * columns);
- }
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ count ++;
+ else if (sel->type == EWL_SELECTION_TYPE_RANGE)
+ {
+ Ewl_Selection_Range *r;
+ unsigned int rows = 0, columns = 0;
+
+ r = EWL_SELECTION_RANGE(sel);
+ rows = (r->end.row - r->start.row) + 1;
+ columns = (r->end.column - r->start.column) + 1;
+ count += (rows * columns);
+ }
}
DRETURN_INT(count, DLEVEL_STABLE);
@@ -651,26 +651,26 @@ ewl_mvc_selected_goto(Ewl_MVC *mvc, unsigned int row, unsigned int column)
ecore_list_first_goto(mvc->selected);
while ((sel = ecore_list_current(mvc->selected)))
{
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- Ewl_Selection_Idx *idx;
- idx = EWL_SELECTION_IDX(sel);
- if ((idx->row == row) && (idx->column == column))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
- }
- else
- {
- Ewl_Selection_Range *r;
-
- r = EWL_SELECTION_RANGE(sel);
-
- /* see if we match within the range */
- if ((r->start.row <= row) && (r->start.column <= column)
- && (r->end.row >= row)
- && (r->end.column >= column))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
- }
- ecore_list_next(mvc->selected);
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ Ewl_Selection_Idx *idx;
+ idx = EWL_SELECTION_IDX(sel);
+ if ((idx->row == row) && (idx->column == column))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+ }
+ else
+ {
+ Ewl_Selection_Range *r;
+
+ r = EWL_SELECTION_RANGE(sel);
+
+ /* see if we match within the range */
+ if ((r->start.row <= row) && (r->start.column <= column)
+ && (r->end.row >= row)
+ && (r->end.column >= column))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+ }
+ ecore_list_next(mvc->selected);
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
@@ -686,21 +686,21 @@ ewl_mvc_selected_goto(Ewl_MVC *mvc, unsigned int row, unsigned int column)
*/
unsigned int
ewl_mvc_selected_is(Ewl_MVC *mvc, void *data __UNUSED__, unsigned int row,
- unsigned int column)
+ unsigned int column)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(mvc, FALSE);
DCHECK_TYPE_RET(mvc, EWL_MVC_TYPE, FALSE);
if (mvc->selection_mode == EWL_SELECTION_MODE_NONE)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
DRETURN_INT(ewl_mvc_selected_goto(mvc, row, column), DLEVEL_STABLE);
}
static void
ewl_mvc_selected_insert(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
- Ewl_Selection *sel, unsigned int row, unsigned int column)
+ Ewl_Selection *sel, unsigned int row, unsigned int column)
{
Ewl_Selection_Range *range;
Ewl_Selection *cur;
@@ -710,25 +710,25 @@ ewl_mvc_selected_insert(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
DCHECK_PARAM_PTR(mvc);
if (!sel)
- sel = EWL_SELECTION(ewl_mvc_selection_index_new(model,
- data, row, column));
+ sel = EWL_SELECTION(ewl_mvc_selection_index_new(model,
+ data, row, column));
/* if this is an index and the index is already selected
* then we're done. Otherwise, just insert the item into the list
* and be done with it. */
if (sel->type == EWL_SELECTION_TYPE_INDEX)
{
- Ewl_Selection_Idx *idx;
+ Ewl_Selection_Idx *idx;
- idx = EWL_SELECTION_IDX(sel);
- if (ewl_mvc_selected_goto(mvc, idx->row, idx->column))
- {
- ewl_mvc_selection_free(sel);
- DRETURN(DLEVEL_STABLE);
- }
+ idx = EWL_SELECTION_IDX(sel);
+ if (ewl_mvc_selected_goto(mvc, idx->row, idx->column))
+ {
+ ewl_mvc_selection_free(sel);
+ DRETURN(DLEVEL_STABLE);
+ }
- ecore_list_append(mvc->selected, sel);
- DRETURN(DLEVEL_STABLE);
+ ecore_list_append(mvc->selected, sel);
+ DRETURN(DLEVEL_STABLE);
}
/* We've got a range we're trying to insert from here onwards */
@@ -744,53 +744,53 @@ ewl_mvc_selected_insert(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
ecore_list_first_goto(mvc->selected);
while ((cur = ecore_list_current(mvc->selected)))
{
- /* ecore_list_remove updates the index by itself */
- if (ewl_mvc_selection_intersects(range, cur))
- {
- ecore_list_remove(mvc->selected);
-
- /* just free indexes as their covered by the
- * range and don't need to be re-inserted */
- if (cur->type == EWL_SELECTION_TYPE_INDEX)
- ewl_mvc_selection_free(cur);
- else
- ecore_list_append(intersections, cur);
-
- }
- else
- ecore_list_next(mvc->selected);
+ /* ecore_list_remove updates the index by itself */
+ if (ewl_mvc_selection_intersects(range, cur))
+ {
+ ecore_list_remove(mvc->selected);
+
+ /* just free indexes as their covered by the
+ * range and don't need to be re-inserted */
+ if (cur->type == EWL_SELECTION_TYPE_INDEX)
+ ewl_mvc_selection_free(cur);
+ else
+ ecore_list_append(intersections, cur);
+
+ }
+ else
+ ecore_list_next(mvc->selected);
}
/* if we intersect nothing just add ourselves to the list
* and be done with it */
if (ecore_list_count(intersections) == 0)
- ecore_list_insert(mvc->selected, range);
+ ecore_list_insert(mvc->selected, range);
else
{
- Ewl_Selection_Range *ptr;
-
- while ((ptr = ecore_list_first_remove(intersections)))
- {
- /* if range is contained inside current then
- * this can be the only intersection. we add
- * current to the list, destroy range and
- * are done
- *
- * We can't do this inside
- * ewl_mvc_range_merge() as we free range in
- * this case and keep ptr. This is backwards
- * to what's expected by _merge()
- */
- if (ewl_mvc_selection_contained(ptr, range))
- {
- ecore_list_append(mvc->selected, ptr);
- ewl_mvc_selection_free(EWL_SELECTION(range));
- range = NULL;
- break;
- }
- ewl_mvc_range_merge(mvc->selected, model, data, range, ptr);
- }
- if (range) ecore_list_append(mvc->selected, range);
+ Ewl_Selection_Range *ptr;
+
+ while ((ptr = ecore_list_first_remove(intersections)))
+ {
+ /* if range is contained inside current then
+ * this can be the only intersection. we add
+ * current to the list, destroy range and
+ * are done
+ *
+ * We can't do this inside
+ * ewl_mvc_range_merge() as we free range in
+ * this case and keep ptr. This is backwards
+ * to what's expected by _merge()
+ */
+ if (ewl_mvc_selection_contained(ptr, range))
+ {
+ ecore_list_append(mvc->selected, ptr);
+ ewl_mvc_selection_free(EWL_SELECTION(range));
+ range = NULL;
+ break;
+ }
+ ewl_mvc_range_merge(mvc->selected, model, data, range, ptr);
+ }
+ if (range) ecore_list_append(mvc->selected, range);
}
ecore_list_destroy(intersections);
@@ -803,7 +803,7 @@ ewl_mvc_selected_insert(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
* if it is no longer needed */
static void
ewl_mvc_range_merge(Ecore_List *list, const Ewl_Model *model, void *data,
- Ewl_Selection_Range *range, Ewl_Selection_Range *cur)
+ Ewl_Selection_Range *range, Ewl_Selection_Range *cur)
{
Ewl_Selection *sel;
@@ -817,23 +817,23 @@ ewl_mvc_range_merge(Ecore_List *list, const Ewl_Model *model, void *data,
* range */
if (ewl_mvc_selection_contained(range, cur))
{
- ewl_mvc_selection_free(EWL_SELECTION(cur));
- DRETURN(DLEVEL_STABLE);
+ ewl_mvc_selection_free(EWL_SELECTION(cur));
+ DRETURN(DLEVEL_STABLE);
}
/* see if this is a merge of the two along one of the sides */
if (((range->start.row == cur->start.row)
- && (range->end.row == cur->end.row))
- || ((range->start.column == cur->start.column)
- && (range->end.column == cur->end.column)))
+ && (range->end.row == cur->end.row))
+ || ((range->start.column == cur->start.column)
+ && (range->end.column == cur->end.column)))
{
- range->start.row = MIN(range->start.row, cur->start.row);
- range->start.column = MIN(range->start.column, cur->start.column);
- range->end.row = MAX(range->end.row, cur->end.row);
- range->end.column = MAX(range->end.column, cur->end.column);
+ range->start.row = MIN(range->start.row, cur->start.row);
+ range->start.column = MIN(range->start.column, cur->start.column);
+ range->end.row = MAX(range->end.row, cur->end.row);
+ range->end.column = MAX(range->end.column, cur->end.column);
- ewl_mvc_selection_free(EWL_SELECTION(cur));
- DRETURN(DLEVEL_STABLE);
+ ewl_mvc_selection_free(EWL_SELECTION(cur));
+ DRETURN(DLEVEL_STABLE);
}
/* not merged and not overlapped we're going to need to split @a cur
@@ -854,43 +854,43 @@ ewl_mvc_range_merge(Ecore_List *list, const Ewl_Model *model, void *data,
/* find everything above (case 1) */
if (cur->start.row < range->start.row)
{
- sel = ewl_mvc_selection_make(model, data, cur->start.row,
- cur->start.column,
- range->start.row - 1,
- cur->end.column);
- ecore_list_append(list, sel);
+ sel = ewl_mvc_selection_make(model, data, cur->start.row,
+ cur->start.column,
+ range->start.row - 1,
+ cur->end.column);
+ ecore_list_append(list, sel);
}
/* find everything left (case 2) */
if (cur->start.column < range->start.column)
{
- sel = ewl_mvc_selection_make(model, data,
- MAX(range->start.row, cur->start.row),
- cur->start.column,
- cur->end.row,
- range->start.column - 1);
- ecore_list_append(list, sel);
+ sel = ewl_mvc_selection_make(model, data,
+ MAX(range->start.row, cur->start.row),
+ cur->start.column,
+ cur->end.row,
+ range->start.column - 1);
+ ecore_list_append(list, sel);
}
/* find everything below (case 3) */
if (cur->end.row > range->end.row)
{
- sel = ewl_mvc_selection_make(model, data, range->end.row + 1,
- MAX(range->start.column, cur->start.column),
- cur->end.row,
- cur->end.column);
- ecore_list_append(list, sel);
+ sel = ewl_mvc_selection_make(model, data, range->end.row + 1,
+ MAX(range->start.column, cur->start.column),
+ cur->end.row,
+ cur->end.column);
+ ecore_list_append(list, sel);
}
/* find everything left (case 4) */
if (cur->end.column > range->end.column)
{
- sel = ewl_mvc_selection_make(model, data,
- MAX(range->start.row, cur->start.row),
- range->end.column + 1,
- MIN(range->end.row, cur->end.row),
- cur->end.column);
- ecore_list_append(list, sel);
+ sel = ewl_mvc_selection_make(model, data,
+ MAX(range->start.row, cur->start.row),
+ range->end.column + 1,
+ MIN(range->end.row, cur->end.row),
+ cur->end.column);
+ ecore_list_append(list, sel);
}
ewl_mvc_selection_free(EWL_SELECTION(cur));
@@ -899,8 +899,8 @@ ewl_mvc_range_merge(Ecore_List *list, const Ewl_Model *model, void *data,
static Ewl_Selection *
ewl_mvc_selection_make(const Ewl_Model *model, void *data, unsigned int top,
- unsigned int left, unsigned int bottom,
- unsigned int right)
+ unsigned int left, unsigned int bottom,
+ unsigned int right)
{
Ewl_Selection *sel;
@@ -908,12 +908,12 @@ ewl_mvc_selection_make(const Ewl_Model *model, void *data, unsigned int top,
if ((top != bottom) || (left != right))
{
- sel = EWL_SELECTION(ewl_mvc_selection_range_new(model,
- data, top, left, bottom, right));
+ sel = EWL_SELECTION(ewl_mvc_selection_range_new(model,
+ data, top, left, bottom, right));
}
else
- sel = EWL_SELECTION(ewl_mvc_selection_index_new(model,
- data, top, left));
+ sel = EWL_SELECTION(ewl_mvc_selection_index_new(model,
+ data, top, left));
DRETURN_PTR(sel, DLEVEL_STABLE);
}
@@ -930,42 +930,42 @@ ewl_mvc_selection_intersects(Ewl_Selection_Range *range, Ewl_Selection *sel)
if (sel->type == EWL_SELECTION_TYPE_INDEX)
{
- Ewl_Selection_Idx *idx;
-
- idx = EWL_SELECTION_IDX(sel);
- if ((range->start.row <= idx->row) && (range->end.row >= idx->row)
- && (range->start.column <= idx->column)
- && (range->end.column >= idx->column))
- {
- DRETURN_INT(TRUE, DLEVEL_STABLE);
- }
+ Ewl_Selection_Idx *idx;
+
+ idx = EWL_SELECTION_IDX(sel);
+ if ((range->start.row <= idx->row) && (range->end.row >= idx->row)
+ && (range->start.column <= idx->column)
+ && (range->end.column >= idx->column))
+ {
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+ }
}
else
{
- Ewl_Selection_Range *cur;
- cur = EWL_SELECTION_RANGE(sel);
-
- /* is one range completely inside another */
- if ((ewl_mvc_selection_contained(range, cur))
- || (ewl_mvc_selection_contained(cur, range)))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
-
- /* if the columns intersect and the rows intersect then the
- * boxes intersect */
- if (ewl_mvc_line_intersects(cur->start.row, cur->end.row,
- range->start.row, range->end.row)
- || ewl_mvc_line_intersects(range->start.row, range->end.row,
- cur->start.row, cur->end.row))
- {
- if (ewl_mvc_line_intersects(cur->start.column, cur->end.column,
- range->start.column, range->end.column)
- || ewl_mvc_line_intersects(range->start.column,
- range->end.column, cur->start.column,
- cur->end.column))
- {
- DRETURN_INT(TRUE, DLEVEL_STABLE);
- }
- }
+ Ewl_Selection_Range *cur;
+ cur = EWL_SELECTION_RANGE(sel);
+
+ /* is one range completely inside another */
+ if ((ewl_mvc_selection_contained(range, cur))
+ || (ewl_mvc_selection_contained(cur, range)))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+ /* if the columns intersect and the rows intersect then the
+ * boxes intersect */
+ if (ewl_mvc_line_intersects(cur->start.row, cur->end.row,
+ range->start.row, range->end.row)
+ || ewl_mvc_line_intersects(range->start.row, range->end.row,
+ cur->start.row, cur->end.row))
+ {
+ if (ewl_mvc_line_intersects(cur->start.column, cur->end.column,
+ range->start.column, range->end.column)
+ || ewl_mvc_line_intersects(range->start.column,
+ range->end.column, cur->start.column,
+ cur->end.column))
+ {
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
+ }
+ }
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
@@ -986,10 +986,10 @@ ewl_mvc_line_intersects(int astart, int aend, int bstart, int bend)
DENTER_FUNCTION(DLEVEL_STABLE);
if ((((astart <= bstart) && (bstart <= aend))
- || ((astart <= bend) && (bend <= aend)))
- || (((bstart <= astart) && (astart <= bend))
- || ((bstart <= aend) && (aend <= bend))))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ || ((astart <= bend) && (bend <= aend)))
+ || (((bstart <= astart) && (astart <= bend))
+ || ((bstart <= aend) && (aend <= bend))))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -1005,14 +1005,14 @@ ewl_mvc_selection_contained(Ewl_Selection_Range *a, Ewl_Selection_Range *b)
DCHECK_PARAM_PTR_RET(b, FALSE);
if ((a->start.column <= b->start.column)
- && (b->start.column <= a->end.column)
- && (a->start.column <= b->end.column)
- && (b->end.column <= a->end.column)
- && (a->start.row <= b->start.row)
- && (b->start.row <= a->end.row)
- && (a->start.row <= b->end.row)
- && (b->end.row <= a->end.row))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ && (b->start.column <= a->end.column)
+ && (a->start.column <= b->end.column)
+ && (b->end.column <= a->end.column)
+ && (a->start.row <= b->start.row)
+ && (b->start.row <= a->end.row)
+ && (a->start.row <= b->end.row)
+ && (b->end.row <= a->end.row))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -1032,7 +1032,7 @@ ewl_mvc_selection_contained(Ewl_Selection_Range *a, Ewl_Selection_Range *b)
*/
static void
ewl_mvc_selected_range_split(Ewl_MVC *mvc, Ewl_Selection_Range *range,
- unsigned int row, unsigned int column)
+ unsigned int row, unsigned int column)
{
Ewl_Selection *sel;
const Ewl_Model *model;
@@ -1051,38 +1051,38 @@ ewl_mvc_selected_range_split(Ewl_MVC *mvc, Ewl_Selection_Range *range,
/* we have something above, case 1 */
if (range->start.row < row)
{
- sel = ewl_mvc_selection_make(model, data, range->start.row,
- range->start.column,
- row - 1,
- range->end.column);
- ecore_list_append(mvc->selected, sel);
+ sel = ewl_mvc_selection_make(model, data, range->start.row,
+ range->start.column,
+ row - 1,
+ range->end.column);
+ ecore_list_append(mvc->selected, sel);
}
/* something left, case 2 */
if (range->start.column < column)
{
- sel = ewl_mvc_selection_make(model, data, row,
- range->start.column,
- range->end.row,
- column - 1);
- ecore_list_append(mvc->selected, sel);
+ sel = ewl_mvc_selection_make(model, data, row,
+ range->start.column,
+ range->end.row,
+ column - 1);
+ ecore_list_append(mvc->selected, sel);
}
/* something below, case 3 */
if (range->end.row > row)
{
- sel = ewl_mvc_selection_make(model, data, row + 1, column,
- range->end.row,
- range->end.column);
- ecore_list_append(mvc->selected, sel);
+ sel = ewl_mvc_selection_make(model, data, row + 1, column,
+ range->end.row,
+ range->end.column);
+ ecore_list_append(mvc->selected, sel);
}
/* something right, case 4 */
if (range->end.column > row)
{
- sel = ewl_mvc_selection_make(model, data, row, column + 1,
- row, range->end.column);
- ecore_list_append(mvc->selected, sel);
+ sel = ewl_mvc_selection_make(model, data, row, column + 1,
+ row, range->end.column);
+ ecore_list_append(mvc->selected, sel);
}
ewl_mvc_selection_free(EWL_SELECTION(range));
@@ -1102,7 +1102,7 @@ ewl_mvc_selected_range_split(Ewl_MVC *mvc, Ewl_Selection_Range *range,
*/
void
ewl_mvc_handle_click(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
- unsigned int row, unsigned int column)
+ unsigned int row, unsigned int column)
{
unsigned int modifiers;
int multi_select = FALSE;
@@ -1114,13 +1114,13 @@ ewl_mvc_handle_click(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
switch (ewl_mvc_selection_mode_get(mvc))
{
- case EWL_SELECTION_MODE_NONE:
- DRETURN(DLEVEL_STABLE);
- case EWL_SELECTION_MODE_MULTI:
- multi_select = TRUE;
- break;
- default:
- break;
+ case EWL_SELECTION_MODE_NONE:
+ DRETURN(DLEVEL_STABLE);
+ case EWL_SELECTION_MODE_MULTI:
+ multi_select = TRUE;
+ break;
+ default:
+ break;
}
if (model) mod = model;
@@ -1129,55 +1129,55 @@ ewl_mvc_handle_click(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
modifiers = ewl_ev_modifiers_get();
if (multi_select && (modifiers & EWL_KEY_MODIFIER_SHIFT))
{
- /* is this the first click? */
- if (ewl_mvc_selected_count_get(mvc) > 0)
- {
- Ewl_Selection *sel;
- void *sdata;
- unsigned int srow, scolumn;
- const Ewl_Model *smod;
-
- /* A shift will add the current position into a
- * range with the last selected item. If the
- * last selected is a range, it will take the
- * start position */
- sel = ecore_list_last_goto(mvc->selected);
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- Ewl_Selection_Idx *idx;
-
- idx = EWL_SELECTION_IDX(sel);
- smod = sel->model;
- sdata = sel->data;
- srow = idx->row;
- scolumn = idx->column;
- }
- else
- {
- Ewl_Selection_Range *idx;
-
- idx = EWL_SELECTION_RANGE(sel);
- smod = sel->model;
- sdata = sel->data;
- srow = idx->start.row;
- scolumn = idx->start.column;
- }
-
- ewl_mvc_selected_range_add(mvc, smod, data, srow, scolumn,
- row, column);
- }
- else
- ewl_mvc_selected_set(mvc, mod, data, row, column);
+ /* is this the first click? */
+ if (ewl_mvc_selected_count_get(mvc) > 0)
+ {
+ Ewl_Selection *sel;
+ void *sdata;
+ unsigned int srow, scolumn;
+ const Ewl_Model *smod;
+
+ /* A shift will add the current position into a
+ * range with the last selected item. If the
+ * last selected is a range, it will take the
+ * start position */
+ sel = ecore_list_last_goto(mvc->selected);
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ Ewl_Selection_Idx *idx;
+
+ idx = EWL_SELECTION_IDX(sel);
+ smod = sel->model;
+ sdata = sel->data;
+ srow = idx->row;
+ scolumn = idx->column;
+ }
+ else
+ {
+ Ewl_Selection_Range *idx;
+
+ idx = EWL_SELECTION_RANGE(sel);
+ smod = sel->model;
+ sdata = sel->data;
+ srow = idx->start.row;
+ scolumn = idx->start.column;
+ }
+
+ ewl_mvc_selected_range_add(mvc, smod, data, srow, scolumn,
+ row, column);
+ }
+ else
+ ewl_mvc_selected_set(mvc, mod, data, row, column);
}
else if (multi_select && (modifiers & EWL_KEY_MODIFIER_CTRL))
{
- if (ewl_mvc_selected_is(mvc, data, row, column))
- ewl_mvc_selected_rm(mvc, data, row, column);
- else
- ewl_mvc_selected_add(mvc, mod, data, row, column);
+ if (ewl_mvc_selected_is(mvc, data, row, column))
+ ewl_mvc_selected_rm(mvc, data, row, column);
+ else
+ ewl_mvc_selected_add(mvc, mod, data, row, column);
}
else
- ewl_mvc_selected_set(mvc, mod, data, row, column);
+ ewl_mvc_selected_set(mvc, mod, data, row, column);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1194,7 +1194,7 @@ ewl_mvc_handle_click(Ewl_MVC *mvc, const Ewl_Model *model, void *data,
void
ewl_mvc_highlight(Ewl_MVC *mvc, Ewl_Container *c,
Ewl_Widget *(*widget)(Ewl_MVC *mvc, void *data, unsigned int row,
- unsigned int column))
+ unsigned int column))
{
Ewl_Selection *sel;
@@ -1204,45 +1204,45 @@ ewl_mvc_highlight(Ewl_MVC *mvc, Ewl_Container *c,
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
if (!mvc->selected || !REALIZED(mvc))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ecore_list_first_goto(mvc->selected);
while ((sel = ecore_list_next(mvc->selected)))
{
- Ewl_Widget *w;
-
- /* if it's already highlighted we can skip it */
- if (sel->highlight) continue;
-
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- Ewl_Selection_Idx *idx;
-
- idx = EWL_SELECTION_IDX(sel);
- w = widget(mvc, sel->data, idx->row, idx->column);
- /* w can be NULL, for example when the selected
- * row or widget is hidden or collapsed */
- if (w)
- ewl_mvc_highlight_do(mvc, c, sel, w);
- }
- else
- {
- unsigned int i, k;
- Ewl_Selection_Range *idx;
-
- idx = EWL_SELECTION_RANGE(sel);
- for (i = idx->start.row; i <= idx->end.row; i++)
- {
- for (k = idx->start.column;
- k <= idx->end.column; k++)
- {
- w = widget(mvc, sel->data, i, k);
- if (!w) continue;
-
- ewl_mvc_highlight_do(mvc, c, sel, w);
- }
- }
- }
+ Ewl_Widget *w;
+
+ /* if it's already highlighted we can skip it */
+ if (sel->highlight) continue;
+
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ Ewl_Selection_Idx *idx;
+
+ idx = EWL_SELECTION_IDX(sel);
+ w = widget(mvc, sel->data, idx->row, idx->column);
+ /* w can be NULL, for example when the selected
+ * row or widget is hidden or collapsed */
+ if (w)
+ ewl_mvc_highlight_do(mvc, c, sel, w);
+ }
+ else
+ {
+ unsigned int i, k;
+ Ewl_Selection_Range *idx;
+
+ idx = EWL_SELECTION_RANGE(sel);
+ for (i = idx->start.row; i <= idx->end.row; i++)
+ {
+ for (k = idx->start.column;
+ k <= idx->end.column; k++)
+ {
+ w = widget(mvc, sel->data, i, k);
+ if (!w) continue;
+
+ ewl_mvc_highlight_do(mvc, c, sel, w);
+ }
+ }
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1250,7 +1250,7 @@ ewl_mvc_highlight(Ewl_MVC *mvc, Ewl_Container *c,
static void
ewl_mvc_highlight_do(Ewl_MVC *mvc __UNUSED__, Ewl_Container *c,
- Ewl_Selection *sel, Ewl_Widget *w)
+ Ewl_Selection *sel, Ewl_Widget *w)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
@@ -1261,15 +1261,15 @@ ewl_mvc_highlight_do(Ewl_MVC *mvc __UNUSED__, Ewl_Container *c,
ewl_widget_state_set(w, "selected", EWL_STATE_PERSISTENT);
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY,
- ewl_mvc_cb_highlight_destroy, sel);
+ ewl_mvc_cb_highlight_destroy, sel);
if (sel->type == EWL_SELECTION_TYPE_INDEX)
- sel->highlight = w;
+ sel->highlight = w;
else
{
- if (!sel->highlight)
- sel->highlight = ecore_list_new();
- ecore_list_append(sel->highlight, w);
+ if (!sel->highlight)
+ sel->highlight = ecore_list_new();
+ ecore_list_append(sel->highlight, w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1291,7 +1291,7 @@ ewl_mvc_selected_change_cb_set(Ewl_MVC *mvc, void (*cb)(Ewl_MVC *mvc))
mvc->cb.selected_change = cb;
if (mvc->selected && (ecore_list_count(mvc->selected) > 0))
- cb(mvc);
+ cb(mvc);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1339,8 +1339,8 @@ ewl_mvc_cb_data_unref(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
/* unref the data, we don't need it anylonger */
if (mvc->data && mvc->model && mvc->model->unref)
{
- mvc->model->unref(mvc->data);
- mvc->data = NULL;
+ mvc->model->unref(mvc->data);
+ mvc->data = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1355,7 +1355,7 @@ ewl_mvc_selected_change_notify(Ewl_MVC *mvc)
/* notify any inheriting widgets */
if (mvc->cb.selected_change)
- mvc->cb.selected_change(mvc);
+ mvc->cb.selected_change(mvc);
/* notify the app */
ewl_callback_call(EWL_WIDGET(mvc), EWL_CALLBACK_VALUE_CHANGED);
@@ -1386,27 +1386,27 @@ ewl_mvc_selection_free(Ewl_Selection *sel)
* and causes highlights to hang around */
if (sel->highlight)
{
- if (sel->type == EWL_SELECTION_TYPE_INDEX)
- {
- ewl_callback_del(sel->highlight, EWL_CALLBACK_DESTROY,
- ewl_mvc_cb_highlight_destroy);
- ewl_widget_state_set(sel->highlight, "deselect",
- EWL_STATE_PERSISTENT);
- }
- else
- {
- Ewl_Widget *w;
-
- while ((w = ecore_list_first_remove(sel->highlight)))
- {
- ewl_callback_del(w, EWL_CALLBACK_DESTROY,
- ewl_mvc_cb_highlight_destroy);
- ewl_widget_state_set(w, "deselect",
- EWL_STATE_PERSISTENT);
- }
-
- IF_FREE_LIST(sel->highlight);
- }
+ if (sel->type == EWL_SELECTION_TYPE_INDEX)
+ {
+ ewl_callback_del(sel->highlight, EWL_CALLBACK_DESTROY,
+ ewl_mvc_cb_highlight_destroy);
+ ewl_widget_state_set(sel->highlight, "deselect",
+ EWL_STATE_PERSISTENT);
+ }
+ else
+ {
+ Ewl_Widget *w;
+
+ while ((w = ecore_list_first_remove(sel->highlight)))
+ {
+ ewl_callback_del(w, EWL_CALLBACK_DESTROY,
+ ewl_mvc_cb_highlight_destroy);
+ ewl_widget_state_set(w, "deselect",
+ EWL_STATE_PERSISTENT);
+ }
+
+ IF_FREE_LIST(sel->highlight);
+ }
}
FREE(sel);
@@ -1422,14 +1422,14 @@ ewl_mvc_cb_highlight_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data)
sel = data;
if (sel->type == EWL_SELECTION_TYPE_INDEX)
- sel->highlight = NULL;
+ sel->highlight = NULL;
else
{
- Ewl_Widget *cur;
+ Ewl_Widget *cur;
- ecore_list_goto(sel->highlight, w);
- cur = ecore_list_current(sel->highlight);
- if (cur == w) ecore_list_remove(sel->highlight);
+ ecore_list_goto(sel->highlight, w);
+ cur = ecore_list_current(sel->highlight);
+ if (cur == w) ecore_list_remove(sel->highlight);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1445,7 +1445,7 @@ ewl_mvc_cb_highlight_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data)
*/
Ewl_Selection *
ewl_mvc_selection_index_new(const Ewl_Model *model, void *data, unsigned int row,
- unsigned int column)
+ unsigned int column)
{
Ewl_Selection_Idx *sel;
@@ -1473,8 +1473,8 @@ ewl_mvc_selection_index_new(const Ewl_Model *model, void *data, unsigned int row
*/
Ewl_Selection *
ewl_mvc_selection_range_new(const Ewl_Model *model, void *data, unsigned int srow,
- unsigned int scolumn, unsigned int erow,
- unsigned int ecolumn)
+ unsigned int scolumn, unsigned int erow,
+ unsigned int ecolumn)
{
Ewl_Selection_Range *sel;
diff --git a/src/lib/ewl_mvc.h b/src/lib/ewl_mvc.h
index 65327df..ad1f2b9 100644
--- a/src/lib/ewl_mvc.h
+++ b/src/lib/ewl_mvc.h
@@ -46,11 +46,11 @@ typedef struct Ewl_Selection Ewl_Selection;
*/
struct Ewl_Selection
{
- Ewl_Selection_Type type; /**< The type of selection */
- const Ewl_Model *model; /**< The model to work with this
- selection */
- void *highlight; /**< highlight widgets for the MVC */
- void *data; /**< Data containing the selection */
+ Ewl_Selection_Type type; /**< The type of selection */
+ const Ewl_Model *model; /**< The model to work with this
+ selection */
+ void *highlight; /**< highlight widgets for the MVC */
+ void *data; /**< Data containing the selection */
};
/**
@@ -69,10 +69,10 @@ typedef struct Ewl_Selection_Idx Ewl_Selection_Idx;
*/
struct Ewl_Selection_Idx
{
- Ewl_Selection sel; /**< Inherit from Ewl_Selection */
+ Ewl_Selection sel; /**< Inherit from Ewl_Selection */
- unsigned int row; /**< Index row */
- unsigned int column; /**< Index column */
+ unsigned int row; /**< Index row */
+ unsigned int column; /**< Index column */
};
/**
@@ -91,14 +91,14 @@ typedef struct Ewl_Selection_Range Ewl_Selection_Range;
*/
struct Ewl_Selection_Range
{
- Ewl_Selection sel; /**< Inherit from Ewl_Selection */
+ Ewl_Selection sel; /**< Inherit from Ewl_Selection */
struct
{
- unsigned int row;/**< Index row */
- unsigned int column;/**< Index column */
- } start, /**< Start of range */
- end; /**< End of range */
+ unsigned int row;/**< Index row */
+ unsigned int column;/**< Index column */
+ } start, /**< Start of range */
+ end; /**< End of range */
};
/**
@@ -117,94 +117,94 @@ typedef struct Ewl_MVC Ewl_MVC;
*/
struct Ewl_MVC
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
- void *data; /**< The mvc data */
- const Ewl_View *view; /**< The view for the mvc */
- const Ewl_Model *model; /**< The model for the mvc */
+ void *data; /**< The mvc data */
+ const Ewl_View *view; /**< The view for the mvc */
+ const Ewl_Model *model; /**< The model for the mvc */
struct {
- void (*view_change)(Ewl_MVC *mvc); /**< View change callback */
- void (*selected_change)(Ewl_MVC *mvc); /**< Selected change callback */
- } cb; /**< Callbacks to the inheriting widgets */
+ void (*view_change)(Ewl_MVC *mvc); /**< View change callback */
+ void (*selected_change)(Ewl_MVC *mvc); /**< Selected change callback */
+ } cb; /**< Callbacks to the inheriting widgets */
- Ecore_List *selected; /**< The selected cells */
+ Ecore_List *selected; /**< The selected cells */
- Ewl_Selection_Mode selection_mode; /**< The widget selection mode*/
- unsigned char dirty:1; /**< Is the data dirty */
+ Ewl_Selection_Mode selection_mode; /**< The widget selection mode*/
+ unsigned char dirty:1; /**< Is the data dirty */
};
-int ewl_mvc_init(Ewl_MVC *mvc);
+int ewl_mvc_init(Ewl_MVC *mvc);
-void ewl_mvc_view_set(Ewl_MVC *mvc, const Ewl_View *view);
+void ewl_mvc_view_set(Ewl_MVC *mvc, const Ewl_View *view);
const Ewl_View *ewl_mvc_view_get(Ewl_MVC *mvc);
-void ewl_mvc_model_set(Ewl_MVC *mvc, const Ewl_Model *model);
+void ewl_mvc_model_set(Ewl_MVC *mvc, const Ewl_Model *model);
const Ewl_Model *ewl_mvc_model_get(Ewl_MVC *mvc);
-void ewl_mvc_data_set(Ewl_MVC *mvc, void *data);
-void *ewl_mvc_data_get(Ewl_MVC *mvc);
+void ewl_mvc_data_set(Ewl_MVC *mvc, void *data);
+void *ewl_mvc_data_get(Ewl_MVC *mvc);
-void ewl_mvc_dirty_set(Ewl_MVC *mvc, unsigned int dirty);
+void ewl_mvc_dirty_set(Ewl_MVC *mvc, unsigned int dirty);
unsigned int ewl_mvc_dirty_get(Ewl_MVC *mvc);
-void ewl_mvc_selection_mode_set(Ewl_MVC *mvc,
- Ewl_Selection_Mode mode);
+void ewl_mvc_selection_mode_set(Ewl_MVC *mvc,
+ Ewl_Selection_Mode mode);
Ewl_Selection_Mode ewl_mvc_selection_mode_get(Ewl_MVC *mvc);
-void ewl_mvc_selected_clear(Ewl_MVC *mvc);
+void ewl_mvc_selected_clear(Ewl_MVC *mvc);
-void ewl_mvc_selected_list_set(Ewl_MVC *mvc, Ecore_List *list);
+void ewl_mvc_selected_list_set(Ewl_MVC *mvc, Ecore_List *list);
Ecore_List *ewl_mvc_selected_list_get(Ewl_MVC *mvc);
-void ewl_mvc_selected_range_add(Ewl_MVC *mvc,
- const Ewl_Model * model,
- void *data,
- unsigned int srow,
- unsigned int scolumn,
- unsigned int erow,
- unsigned int ecolumn);
-
-void ewl_mvc_selected_set(Ewl_MVC *mvc, const Ewl_Model *model,
- void *data, unsigned int row,
- unsigned int column);
-void ewl_mvc_selected_add(Ewl_MVC *mvc, const Ewl_Model *model,
- void *data, unsigned int row,
- unsigned int column);
+void ewl_mvc_selected_range_add(Ewl_MVC *mvc,
+ const Ewl_Model * model,
+ void *data,
+ unsigned int srow,
+ unsigned int scolumn,
+ unsigned int erow,
+ unsigned int ecolumn);
+
+void ewl_mvc_selected_set(Ewl_MVC *mvc, const Ewl_Model *model,
+ void *data, unsigned int row,
+ unsigned int column);
+void ewl_mvc_selected_add(Ewl_MVC *mvc, const Ewl_Model *model,
+ void *data, unsigned int row,
+ unsigned int column);
Ewl_Selection_Idx *ewl_mvc_selected_get(Ewl_MVC *mvc);
-void ewl_mvc_selected_rm(Ewl_MVC *mvc, void *data, unsigned int row,
- unsigned int column);
+void ewl_mvc_selected_rm(Ewl_MVC *mvc, void *data, unsigned int row,
+ unsigned int column);
unsigned int ewl_mvc_selected_count_get(Ewl_MVC *mvc);
unsigned int ewl_mvc_selected_is(Ewl_MVC *mvc, void *data, unsigned int row,
- unsigned int column);
+ unsigned int column);
Ewl_Selection *ewl_mvc_selection_index_new(const Ewl_Model *model, void *data,
- unsigned int row,
- unsigned int column);
+ unsigned int row,
+ unsigned int column);
Ewl_Selection *ewl_mvc_selection_range_new(const Ewl_Model *model, void *data,
- unsigned int srow,
- unsigned int scolumn,
- unsigned int erow,
- unsigned int ecolumn);
+ unsigned int srow,
+ unsigned int scolumn,
+ unsigned int erow,
+ unsigned int ecolumn);
-void ewl_mvc_highlight(Ewl_MVC *mvc, Ewl_Container *c,
- Ewl_Widget *(*widget)(Ewl_MVC *mvc,
- void *data, unsigned int row,
- unsigned int column));
+void ewl_mvc_highlight(Ewl_MVC *mvc, Ewl_Container *c,
+ Ewl_Widget *(*widget)(Ewl_MVC *mvc,
+ void *data, unsigned int row,
+ unsigned int column));
/*
* internal
*/
-void ewl_mvc_view_change_cb_set(Ewl_MVC *mvc, void (*cb)(Ewl_MVC *mvc));
-void ewl_mvc_selected_change_cb_set(Ewl_MVC *mvc, void (*cb)(Ewl_MVC *mvc));
+void ewl_mvc_view_change_cb_set(Ewl_MVC *mvc, void (*cb)(Ewl_MVC *mvc));
+void ewl_mvc_selected_change_cb_set(Ewl_MVC *mvc, void (*cb)(Ewl_MVC *mvc));
-void ewl_mvc_cb_destroy(Ewl_Widget *w, void *ev, void *data);
-void ewl_mvc_cb_data_unref(Ewl_Widget *w, void *ev, void *data);
+void ewl_mvc_cb_destroy(Ewl_Widget *w, void *ev, void *data);
+void ewl_mvc_cb_data_unref(Ewl_Widget *w, void *ev, void *data);
-void ewl_mvc_handle_click(Ewl_MVC *mvc, const Ewl_Model *model,
- void *data, unsigned int row,
- unsigned int column);
+void ewl_mvc_handle_click(Ewl_MVC *mvc, const Ewl_Model *model,
+ void *data, unsigned int row,
+ unsigned int column);
/**
* @}
diff --git a/src/lib/ewl_notebook.c b/src/lib/ewl_notebook.c
index 008c50a..d9bd25f 100644
--- a/src/lib/ewl_notebook.c
+++ b/src/lib/ewl_notebook.c
@@ -19,12 +19,12 @@ ewl_notebook_new(void)
w = NEW(Ewl_Notebook, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_notebook_init(EWL_NOTEBOOK(w)))
{
- ewl_widget_destroy(w);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(w);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -42,7 +42,7 @@ ewl_notebook_init(Ewl_Notebook *n)
DCHECK_PARAM_PTR_RET(n, FALSE);
if (!ewl_box_init(EWL_BOX(n)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(n), EWL_ORIENTATION_VERTICAL);
@@ -54,32 +54,32 @@ ewl_notebook_init(Ewl_Notebook *n)
n->body.tabbar = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(n), n->body.tabbar);
ewl_object_fill_policy_set(EWL_OBJECT(n->body.tabbar),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_object_alignment_set(EWL_OBJECT(n->body.tabbar),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_widget_internal_set(n->body.tabbar, TRUE);
ewl_widget_appearance_set(n->body.tabbar, "top/tabbar");
ewl_widget_show(n->body.tabbar);
n->body.pages = ewl_vbox_new();
ewl_object_fill_policy_set(EWL_OBJECT(n->body.pages),
- EWL_FLAG_FILL_ALL);
+ EWL_FLAG_FILL_ALL);
ewl_container_child_append(EWL_CONTAINER(n), n->body.pages);
ewl_widget_internal_set(n->body.pages, TRUE);
ewl_widget_appearance_set(n->body.pages, "pages");
ewl_widget_show(n->body.pages);
ewl_container_redirect_set(EWL_CONTAINER(n),
- EWL_CONTAINER(n->body.pages));
+ EWL_CONTAINER(n->body.pages));
ewl_container_show_notify_set(EWL_CONTAINER(n->body.pages),
- ewl_notebook_cb_child_show);
+ ewl_notebook_cb_child_show);
ewl_container_hide_notify_set(EWL_CONTAINER(n->body.pages),
- ewl_notebook_cb_child_hide);
+ ewl_notebook_cb_child_hide);
ewl_container_add_notify_set(EWL_CONTAINER(n->body.pages),
- ewl_notebook_cb_child_add);
+ ewl_notebook_cb_child_add);
ewl_container_remove_notify_set(EWL_CONTAINER(n->body.pages),
- ewl_notebook_cb_child_remove);
+ ewl_notebook_cb_child_remove);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -115,7 +115,7 @@ ewl_notebook_tabbar_alignment_get(Ewl_Notebook *n)
DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, 0);
DRETURN_INT(ewl_object_alignment_get(EWL_OBJECT(n->body.tabbar)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -134,56 +134,56 @@ ewl_notebook_tabbar_position_set(Ewl_Notebook *n, Ewl_Position pos)
DCHECK_TYPE(n, "notebook");
if (n->tabbar_position == pos)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
n->tabbar_position = pos;
switch(pos)
{
- case EWL_POSITION_LEFT:
- case EWL_POSITION_RIGHT:
- ewl_box_orientation_set(EWL_BOX(n),
- EWL_ORIENTATION_HORIZONTAL);
- ewl_box_orientation_set(EWL_BOX(n->body.tabbar),
- EWL_ORIENTATION_VERTICAL);
-
- t = ewl_object_preferred_w_get(EWL_OBJECT(n->body.tabbar));
- ewl_object_preferred_size_get(EWL_OBJECT(n->body.pages),
- &pw, &ph);
-
- ewl_object_preferred_inner_size_set(EWL_OBJECT(n), t + pw, ph);
-
- break;
- case EWL_POSITION_TOP:
- case EWL_POSITION_BOTTOM:
- default:
- ewl_box_orientation_set(EWL_BOX(n),
- EWL_ORIENTATION_VERTICAL);
- ewl_box_orientation_set(EWL_BOX(n->body.tabbar),
- EWL_ORIENTATION_HORIZONTAL);
-
- t = ewl_object_preferred_h_get(EWL_OBJECT(n->body.tabbar));
- ewl_object_preferred_size_get(EWL_OBJECT(n->body.pages),
- &pw, &ph);
-
- ewl_object_preferred_inner_size_set(EWL_OBJECT(n), pw, ph + t);
-
- break;
+ case EWL_POSITION_LEFT:
+ case EWL_POSITION_RIGHT:
+ ewl_box_orientation_set(EWL_BOX(n),
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_box_orientation_set(EWL_BOX(n->body.tabbar),
+ EWL_ORIENTATION_VERTICAL);
+
+ t = ewl_object_preferred_w_get(EWL_OBJECT(n->body.tabbar));
+ ewl_object_preferred_size_get(EWL_OBJECT(n->body.pages),
+ &pw, &ph);
+
+ ewl_object_preferred_inner_size_set(EWL_OBJECT(n), t + pw, ph);
+
+ break;
+ case EWL_POSITION_TOP:
+ case EWL_POSITION_BOTTOM:
+ default:
+ ewl_box_orientation_set(EWL_BOX(n),
+ EWL_ORIENTATION_VERTICAL);
+ ewl_box_orientation_set(EWL_BOX(n->body.tabbar),
+ EWL_ORIENTATION_HORIZONTAL);
+
+ t = ewl_object_preferred_h_get(EWL_OBJECT(n->body.tabbar));
+ ewl_object_preferred_size_get(EWL_OBJECT(n->body.pages),
+ &pw, &ph);
+
+ ewl_object_preferred_inner_size_set(EWL_OBJECT(n), pw, ph + t);
+
+ break;
}
switch (pos)
{
- case EWL_POSITION_LEFT:
- ewl_widget_appearance_set(n->body.tabbar, "left/tabbar");
- break;
- case EWL_POSITION_RIGHT:
- ewl_widget_appearance_set(n->body.tabbar, "right/tabbar");
- break;
- case EWL_POSITION_TOP:
- ewl_widget_appearance_set(n->body.tabbar, "top/tabbar");
- break;
- case EWL_POSITION_BOTTOM:
- ewl_widget_appearance_set(n->body.tabbar, "bottom/tabbar");
- break;
+ case EWL_POSITION_LEFT:
+ ewl_widget_appearance_set(n->body.tabbar, "left/tabbar");
+ break;
+ case EWL_POSITION_RIGHT:
+ ewl_widget_appearance_set(n->body.tabbar, "right/tabbar");
+ break;
+ case EWL_POSITION_TOP:
+ ewl_widget_appearance_set(n->body.tabbar, "top/tabbar");
+ break;
+ case EWL_POSITION_BOTTOM:
+ ewl_widget_appearance_set(n->body.tabbar, "bottom/tabbar");
+ break;
}
ewl_container_child_remove(EWL_CONTAINER(n), n->body.tabbar);
@@ -192,15 +192,15 @@ ewl_notebook_tabbar_position_set(Ewl_Notebook *n, Ewl_Position pos)
ewl_container_redirect_set(EWL_CONTAINER(n), NULL);
if ((n->tabbar_position == EWL_POSITION_RIGHT)
- || (n->tabbar_position == EWL_POSITION_BOTTOM))
- ewl_container_child_append(EWL_CONTAINER(n), n->body.tabbar);
+ || (n->tabbar_position == EWL_POSITION_BOTTOM))
+ ewl_container_child_append(EWL_CONTAINER(n), n->body.tabbar);
else if ((n->tabbar_position == EWL_POSITION_LEFT)
- || (n->tabbar_position == EWL_POSITION_TOP))
- ewl_container_child_prepend(EWL_CONTAINER(n), n->body.tabbar);
+ || (n->tabbar_position == EWL_POSITION_TOP))
+ ewl_container_child_prepend(EWL_CONTAINER(n), n->body.tabbar);
ewl_container_redirect_set(EWL_CONTAINER(n),
- EWL_CONTAINER(n->body.pages));
+ EWL_CONTAINER(n->body.pages));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -235,15 +235,15 @@ ewl_notebook_tabbar_visible_set(Ewl_Notebook *n, unsigned int visible)
if (visible)
{
- ewl_widget_state_set(EWL_WIDGET(n->body.pages), "tabs",
- EWL_STATE_PERSISTENT);
- ewl_widget_show(n->body.tabbar);
+ ewl_widget_state_set(EWL_WIDGET(n->body.pages), "tabs",
+ EWL_STATE_PERSISTENT);
+ ewl_widget_show(n->body.tabbar);
}
else
{
- ewl_widget_state_set(EWL_WIDGET(n->body.pages), "notabs",
- EWL_STATE_PERSISTENT);
- ewl_widget_hide(n->body.tabbar);
+ ewl_widget_state_set(EWL_WIDGET(n->body.pages), "notabs",
+ EWL_STATE_PERSISTENT);
+ ewl_widget_hide(n->body.tabbar);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -262,7 +262,7 @@ ewl_notebook_tabbar_visible_get(Ewl_Notebook *n)
DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, FALSE);
DRETURN_INT(((VISIBLE(n->body.tabbar)) ? TRUE : FALSE),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -281,20 +281,20 @@ ewl_notebook_visible_page_set(Ewl_Notebook *n, Ewl_Widget *page)
DCHECK_TYPE(n, EWL_NOTEBOOK_TYPE);
if (page == n->cur_page)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (n->cur_page)
{
- Ewl_Widget *w;
+ Ewl_Widget *w;
- t = ewl_attach_widget_association_get(n->cur_page);
- if (t) ewl_widget_state_set(t, "default", EWL_STATE_PERSISTENT);
+ t = ewl_attach_widget_association_get(n->cur_page);
+ if (t) ewl_widget_state_set(t, "default", EWL_STATE_PERSISTENT);
- /* make sure we set n->cur_page null first or the hide
- * callback won't let us hide */
- w = n->cur_page;
- n->cur_page = NULL;
- ewl_widget_hide(w);
+ /* make sure we set n->cur_page null first or the hide
+ * callback won't let us hide */
+ w = n->cur_page;
+ n->cur_page = NULL;
+ ewl_widget_hide(w);
}
n->cur_page = page;
@@ -332,7 +332,7 @@ ewl_notebook_visible_page_get(Ewl_Notebook *n)
*/
void
ewl_notebook_page_tab_text_set(Ewl_Notebook *n, Ewl_Widget *page,
- const char *text)
+ const char *text)
{
Ewl_Widget *t = NULL;
@@ -344,9 +344,9 @@ ewl_notebook_page_tab_text_set(Ewl_Notebook *n, Ewl_Widget *page,
if (text)
{
- t = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(t), text);
- ewl_widget_show(t);
+ t = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(t), text);
+ ewl_widget_show(t);
}
ewl_notebook_page_tab_widget_set(n, page, t);
@@ -386,7 +386,7 @@ ewl_notebook_page_tab_text_get(Ewl_Notebook *n, Ewl_Widget *page)
*/
void
ewl_notebook_page_tab_widget_set(Ewl_Notebook *n, Ewl_Widget *page,
- Ewl_Widget *tab)
+ Ewl_Widget *tab)
{
Ewl_Widget *t;
@@ -398,31 +398,31 @@ ewl_notebook_page_tab_widget_set(Ewl_Notebook *n, Ewl_Widget *page,
if (!tab)
{
- tab = ewl_hbox_new();
- ewl_widget_show(tab);
+ tab = ewl_hbox_new();
+ ewl_widget_show(tab);
}
t = ewl_attach_widget_association_get(page);
if (!t)
{
- int idx = 0;
+ int idx = 0;
- t = ewl_hbox_new();
- ewl_widget_appearance_set(t, "tab");
- ewl_attach_widget_association_set(page, t);
- ewl_attach_widget_association_set(t, page);
- ewl_widget_show(t);
+ t = ewl_hbox_new();
+ ewl_widget_appearance_set(t, "tab");
+ ewl_attach_widget_association_set(page, t);
+ ewl_attach_widget_association_set(t, page);
+ ewl_widget_show(t);
- ewl_callback_append(t, EWL_CALLBACK_CLICKED,
- ewl_notebook_cb_tab_clicked, n);
+ ewl_callback_append(t, EWL_CALLBACK_CLICKED,
+ ewl_notebook_cb_tab_clicked, n);
- idx = ewl_container_child_index_get(EWL_CONTAINER(n), page);
- ewl_container_child_insert(EWL_CONTAINER(n->body.tabbar), t, idx);
+ idx = ewl_container_child_index_get(EWL_CONTAINER(n), page);
+ ewl_container_child_insert(EWL_CONTAINER(n->body.tabbar), t, idx);
}
/* if this is the current page set it's tab to selected */
if (n->cur_page == page)
- ewl_widget_state_set(t, "selected", EWL_STATE_PERSISTENT);
+ ewl_widget_state_set(t, "selected", EWL_STATE_PERSISTENT);
ewl_container_child_append(EWL_CONTAINER(t), tab);
@@ -449,8 +449,8 @@ ewl_notebook_page_tab_widget_get(Ewl_Notebook *n, Ewl_Widget *page)
t = ewl_attach_widget_association_get(page);
if (!t)
{
- DWARNING("We have a notebook page with no tab, bad, very bad.");
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DWARNING("We have a notebook page with no tab, bad, very bad.");
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
o = ewl_container_child_get(EWL_CONTAINER(n), 0);
@@ -489,7 +489,7 @@ ewl_notebook_tabbar_homogeneous_get(Ewl_Notebook *n)
DCHECK_TYPE_RET(n, EWL_NOTEBOOK_TYPE, 0);
DRETURN_INT(ewl_box_homogeneous_get(EWL_BOX(n->body.tabbar)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -514,7 +514,7 @@ ewl_notebook_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
n = EWL_NOTEBOOK(EWL_WIDGET(c)->parent);
if (n->cur_page != w)
- ewl_widget_hide(w);
+ ewl_widget_hide(w);
ewl_object_preferred_size_get(EWL_OBJECT(n->cur_page), &pw, &ph);
ewl_object_preferred_inner_size_set(EWL_OBJECT(n->body.pages), pw, ph);
@@ -543,7 +543,7 @@ ewl_notebook_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
n = EWL_NOTEBOOK(EWL_WIDGET(c)->parent);
if (n->cur_page == w)
- ewl_widget_show(w);
+ ewl_widget_show(w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -574,8 +574,8 @@ ewl_notebook_cb_child_add(Ewl_Container *c, Ewl_Widget *w)
/* we have no current page, make it this one */
if (!n->cur_page)
{
- ewl_notebook_visible_page_set(n, w);
- ewl_widget_show(w);
+ ewl_notebook_visible_page_set(n, w);
+ ewl_widget_show(w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -591,7 +591,7 @@ ewl_notebook_cb_child_add(Ewl_Container *c, Ewl_Widget *w)
*/
void
ewl_notebook_cb_child_remove(Ewl_Container *c, Ewl_Widget *w,
- int rem_idx __UNUSED__)
+ int rem_idx __UNUSED__)
{
Ewl_Widget *t;
Ewl_Notebook *n;
@@ -609,32 +609,32 @@ ewl_notebook_cb_child_remove(Ewl_Container *c, Ewl_Widget *w,
t = ewl_attach_widget_association_get(w);
if (t)
{
- idx = ewl_container_child_index_get(
- EWL_CONTAINER(n->body.tabbar), t);
+ idx = ewl_container_child_index_get(
+ EWL_CONTAINER(n->body.tabbar), t);
- ewl_widget_destroy(t);
+ ewl_widget_destroy(t);
}
/* change visible pages if needed */
if (w == n->cur_page)
{
- Ewl_Widget *page, *new_tab;
- int count;
-
- /* make sure we aren't off the end of the list */
- count = ewl_container_child_count_get(EWL_CONTAINER(n->body.tabbar));
- if (idx >= count) idx = count - 1;
-
- new_tab = ewl_container_child_get(
- EWL_CONTAINER(n->body.tabbar), idx);
-
- if (new_tab)
- {
- page = ewl_attach_widget_association_get(new_tab);
- if (page)
- ewl_notebook_visible_page_set(
- EWL_NOTEBOOK(n), page);
- }
+ Ewl_Widget *page, *new_tab;
+ int count;
+
+ /* make sure we aren't off the end of the list */
+ count = ewl_container_child_count_get(EWL_CONTAINER(n->body.tabbar));
+ if (idx >= count) idx = count - 1;
+
+ new_tab = ewl_container_child_get(
+ EWL_CONTAINER(n->body.tabbar), idx);
+
+ if (new_tab)
+ {
+ page = ewl_attach_widget_association_get(new_tab);
+ if (page)
+ ewl_notebook_visible_page_set(
+ EWL_NOTEBOOK(n), page);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_notebook.h b/src/lib/ewl_notebook.h
index 31e2633..3c08bd2 100644
--- a/src/lib/ewl_notebook.h
+++ b/src/lib/ewl_notebook.h
@@ -53,50 +53,50 @@ typedef struct Ewl_Notebook Ewl_Notebook;
*/
struct Ewl_Notebook
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
struct {
- Ewl_Widget *tabbar; /**< Holds the tabs */
- Ewl_Widget *pages; /**< Holds the notebook pages */
- } body; /**< The body of the notebook */
+ Ewl_Widget *tabbar; /**< Holds the tabs */
+ Ewl_Widget *pages; /**< Holds the notebook pages */
+ } body; /**< The body of the notebook */
- Ewl_Widget *cur_page; /**< The currently active page */
- Ewl_Position tabbar_position; /**< The position of the tabbar in the notebook */
+ Ewl_Widget *cur_page; /**< The currently active page */
+ Ewl_Position tabbar_position; /**< The position of the tabbar in the notebook */
};
Ewl_Widget *ewl_notebook_new(void);
-int ewl_notebook_init(Ewl_Notebook *n);
+int ewl_notebook_init(Ewl_Notebook *n);
-void ewl_notebook_tabbar_alignment_set(Ewl_Notebook *n,
- unsigned int align);
+void ewl_notebook_tabbar_alignment_set(Ewl_Notebook *n,
+ unsigned int align);
unsigned int ewl_notebook_tabbar_alignment_get(Ewl_Notebook *n);
-void ewl_notebook_tabbar_position_set(Ewl_Notebook *n,
- Ewl_Position pos);
+void ewl_notebook_tabbar_position_set(Ewl_Notebook *n,
+ Ewl_Position pos);
Ewl_Position ewl_notebook_tabbar_position_get(Ewl_Notebook *n);
-void ewl_notebook_tabbar_visible_set(Ewl_Notebook *n,
- unsigned int visible);
+void ewl_notebook_tabbar_visible_set(Ewl_Notebook *n,
+ unsigned int visible);
unsigned int ewl_notebook_tabbar_visible_get(Ewl_Notebook *n);
-void ewl_notebook_tabbar_homogeneous_set(Ewl_Notebook *n,
- unsigned int h);
+void ewl_notebook_tabbar_homogeneous_set(Ewl_Notebook *n,
+ unsigned int h);
unsigned int ewl_notebook_tabbar_homogeneous_get(Ewl_Notebook *n);
-void ewl_notebook_visible_page_set(Ewl_Notebook *n,
- Ewl_Widget *page);
+void ewl_notebook_visible_page_set(Ewl_Notebook *n,
+ Ewl_Widget *page);
Ewl_Widget *ewl_notebook_visible_page_get(Ewl_Notebook *n);
-void ewl_notebook_page_tab_text_set(Ewl_Notebook *n,
- Ewl_Widget *page,
- const char *text);
+void ewl_notebook_page_tab_text_set(Ewl_Notebook *n,
+ Ewl_Widget *page,
+ const char *text);
const char *ewl_notebook_page_tab_text_get(Ewl_Notebook *n,
- Ewl_Widget *page);
+ Ewl_Widget *page);
-void ewl_notebook_page_tab_widget_set(Ewl_Notebook *n,
- Ewl_Widget *page,
- Ewl_Widget *tab);
+void ewl_notebook_page_tab_widget_set(Ewl_Notebook *n,
+ Ewl_Widget *page,
+ Ewl_Widget *tab);
Ewl_Widget *ewl_notebook_page_tab_widget_get(Ewl_Notebook *n,
- Ewl_Widget *page);
+ Ewl_Widget *page);
/*
* Internal stuff.
diff --git a/src/lib/ewl_object.c b/src/lib/ewl_object.c
index 1afbccc..00a526a 100644
--- a/src/lib/ewl_object.c
+++ b/src/lib/ewl_object.c
@@ -25,13 +25,13 @@ ewl_object_init(Ewl_Object *o)
* Set the default minimum sizes.
*/
ewl_object_minimum_size_set(o, EWL_OBJECT_MIN_SIZE,
- EWL_OBJECT_MIN_SIZE);
+ EWL_OBJECT_MIN_SIZE);
/*
* Set the default maximum sizes.
*/
ewl_object_maximum_size_set(o, EWL_OBJECT_MAX_SIZE,
- EWL_OBJECT_MAX_SIZE);
+ EWL_OBJECT_MAX_SIZE);
/*
* Set the default fill policy and alignment for the object.
@@ -101,7 +101,7 @@ ewl_object_current_x_get(Ewl_Object *o)
DCHECK_PARAM_PTR_RET(o, 0);
DRETURN_INT(CURRENT_X(o) - PADDING_LEFT(o) - INSET_LEFT(o),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -116,7 +116,7 @@ ewl_object_current_y_get(Ewl_Object *o)
DCHECK_PARAM_PTR_RET(o, 0);
DRETURN_INT(CURRENT_Y(o) - PADDING_TOP(o) - INSET_TOP(o),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -134,17 +134,17 @@ ewl_object_current_w_get(Ewl_Object *o)
w = CURRENT_W(o);
if (w < MINIMUM_W(o))
- w = MINIMUM_W(o);
+ w = MINIMUM_W(o);
if (w < PREFERRED_W(o) && !(ewl_object_fill_policy_get(o) &
- EWL_FLAG_FILL_HSHRINK))
- w = PREFERRED_W(o);
+ EWL_FLAG_FILL_HSHRINK))
+ w = PREFERRED_W(o);
if (w > MAXIMUM_W(o))
- w = MAXIMUM_W(o);
+ w = MAXIMUM_W(o);
if ((w + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o)) > w)
- w += PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
+ w += PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
DRETURN_INT(w, DLEVEL_STABLE);
}
@@ -164,17 +164,17 @@ ewl_object_current_h_get(Ewl_Object *o)
h = CURRENT_H(o);
if (h < MINIMUM_H(o))
- h = MINIMUM_H(o);
+ h = MINIMUM_H(o);
if (h < PREFERRED_H(o) && !(ewl_object_fill_policy_get(o) &
- EWL_FLAG_FILL_VSHRINK))
- h = PREFERRED_H(o);
+ EWL_FLAG_FILL_VSHRINK))
+ h = PREFERRED_H(o);
if (h > MAXIMUM_H(o))
- h = MAXIMUM_H(o);
+ h = MAXIMUM_H(o);
if ((h + PADDING_VERTICAL(o) + INSET_VERTICAL(o)) > h)
- h += PADDING_VERTICAL(o) + INSET_VERTICAL(o);
+ h += PADDING_VERTICAL(o) + INSET_VERTICAL(o);
DRETURN_INT(h, DLEVEL_STABLE);
}
@@ -229,11 +229,11 @@ ewl_object_preferred_inner_w_set(Ewl_Object *o, int w)
o->preferred.w = w;
if (CURRENT_W(o) < PREFERRED_W(o))
- fill = EWL_FLAG_FILL_HSHRINK;
+ fill = EWL_FLAG_FILL_HSHRINK;
else if (CURRENT_W(o) > PREFERRED_W(o))
- fill = EWL_FLAG_FILL_HFILL;
+ fill = EWL_FLAG_FILL_HFILL;
else
- fill = 0;
+ fill = 0;
resize = ewl_object_fill_policy_get(EWL_OBJECT(o));
@@ -241,9 +241,9 @@ ewl_object_preferred_inner_w_set(Ewl_Object *o, int w)
* Now update the widgets parent of the change in size if necessary.
*/
if (!(resize & fill))
- ewl_container_child_resize(EWL_WIDGET(o),
- PREFERRED_W(o) - old_size,
- EWL_ORIENTATION_HORIZONTAL);
+ ewl_container_child_resize(EWL_WIDGET(o),
+ PREFERRED_W(o) - old_size,
+ EWL_ORIENTATION_HORIZONTAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -274,11 +274,11 @@ ewl_object_preferred_inner_h_set(Ewl_Object *o, int h)
o->preferred.h = h;
if (CURRENT_H(o) < PREFERRED_H(o))
- fill = EWL_FLAG_FILL_VSHRINK;
+ fill = EWL_FLAG_FILL_VSHRINK;
else if (CURRENT_H(o) > PREFERRED_H(o))
- fill = EWL_FLAG_FILL_VFILL;
+ fill = EWL_FLAG_FILL_VFILL;
else
- fill = 0;
+ fill = 0;
resize = ewl_object_fill_policy_get(EWL_OBJECT(o));
@@ -286,9 +286,9 @@ ewl_object_preferred_inner_h_set(Ewl_Object *o, int h)
* Now update the widgets parent of the change in size if necessary.
*/
if (!(resize & fill))
- ewl_container_child_resize(EWL_WIDGET(o),
- PREFERRED_H(o) - old_size,
- EWL_ORIENTATION_VERTICAL);
+ ewl_container_child_resize(EWL_WIDGET(o),
+ PREFERRED_H(o) - old_size,
+ EWL_ORIENTATION_VERTICAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -331,11 +331,11 @@ ewl_object_preferred_w_get(Ewl_Object *o)
add = INSET_HORIZONTAL(o) + PADDING_HORIZONTAL(o);
if (PREFERRED_W(o) < MINIMUM_W(o))
- temp = MINIMUM_W(o);
+ temp = MINIMUM_W(o);
else if (PREFERRED_W(o) > MAXIMUM_W(o))
- temp = MAXIMUM_W(o);
+ temp = MAXIMUM_W(o);
else
- temp = PREFERRED_W(o);
+ temp = PREFERRED_W(o);
temp += add;
@@ -358,11 +358,11 @@ ewl_object_preferred_h_get(Ewl_Object *o)
add = INSET_VERTICAL(o) + PADDING_VERTICAL(o);
if (PREFERRED_H(o) < MINIMUM_H(o))
- temp = MINIMUM_H(o);
+ temp = MINIMUM_H(o);
else if (PREFERRED_H(o) > MAXIMUM_H(o))
- temp = MAXIMUM_H(o);
+ temp = MAXIMUM_H(o);
else
- temp = PREFERRED_H(o);
+ temp = PREFERRED_H(o);
temp += add;
@@ -555,24 +555,24 @@ ewl_object_w_request(Ewl_Object *o, int w)
DCHECK_PARAM_PTR(o);
if (w > PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o))
- w -= PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
+ w -= PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
else
- w = 0;
+ w = 0;
/*
* Bound the width by the preferred size first.
*/
if ((w < o->preferred.w && !(o->flags & EWL_FLAG_FILL_HSHRINK))
|| (w > o->preferred.w && !(o->flags & EWL_FLAG_FILL_HFILL)))
- w = o->preferred.w;
+ w = o->preferred.w;
/*
* Now bound it by the min's and max's to achieve the desired size.
*/
if (w < MINIMUM_W(o))
- w = MINIMUM_W(o);
+ w = MINIMUM_W(o);
else if (w > MAXIMUM_W(o))
- w = MAXIMUM_W(o);
+ w = MAXIMUM_W(o);
o->current.w = w;
ewl_widget_configure(EWL_WIDGET(o));
@@ -595,24 +595,24 @@ ewl_object_h_request(Ewl_Object *o, int h)
DCHECK_PARAM_PTR(o);
if (h > PADDING_VERTICAL(o) + INSET_VERTICAL(o))
- h -= PADDING_VERTICAL(o) + INSET_VERTICAL(o);
+ h -= PADDING_VERTICAL(o) + INSET_VERTICAL(o);
else
- h = 0;
+ h = 0;
/*
* Bound the width by the preferred size first.
*/
if ((h < o->preferred.h && !(o->flags & EWL_FLAG_FILL_VSHRINK))
|| (h > o->preferred.h && !(o->flags & EWL_FLAG_FILL_VFILL)))
- h = o->preferred.h;
+ h = o->preferred.h;
/*
* Now bound it by the min's and max's to achieve the desired size.
*/
if (h < MINIMUM_H(o))
- h = MINIMUM_H(o);
+ h = MINIMUM_H(o);
else if (h > MAXIMUM_H(o))
- h = MAXIMUM_H(o);
+ h = MAXIMUM_H(o);
o->current.h = h;
ewl_widget_configure(EWL_WIDGET(o));
@@ -662,24 +662,24 @@ ewl_object_minimum_w_set(Ewl_Object *o, int w)
DCHECK_PARAM_PTR(o);
if (w < EWL_OBJECT_MIN_SIZE)
- w = EWL_OBJECT_MIN_SIZE;
+ w = EWL_OBJECT_MIN_SIZE;
if (w > EWL_OBJECT_MAX_SIZE)
- w = EWL_OBJECT_MAX_SIZE;
+ w = EWL_OBJECT_MAX_SIZE;
old_size = MINIMUM_W(o);
new_size = o->minimum.w = w;
if (MAXIMUM_W(o) < w)
- o->minimum.w = w;
+ o->minimum.w = w;
if (PREFERRED_W(o) < MINIMUM_W(o))
- ewl_container_child_resize(EWL_WIDGET(o),
- MINIMUM_W(o) - PREFERRED_W(o),
- EWL_ORIENTATION_HORIZONTAL);
+ ewl_container_child_resize(EWL_WIDGET(o),
+ MINIMUM_W(o) - PREFERRED_W(o),
+ EWL_ORIENTATION_HORIZONTAL);
if (CURRENT_W(o) < w)
- ewl_object_w_request(o, w);
+ ewl_object_w_request(o, w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -703,24 +703,24 @@ ewl_object_minimum_h_set(Ewl_Object *o, int h)
DCHECK_PARAM_PTR(o);
if (h < EWL_OBJECT_MIN_SIZE)
- h = EWL_OBJECT_MIN_SIZE;
+ h = EWL_OBJECT_MIN_SIZE;
if (h > EWL_OBJECT_MAX_SIZE)
- h = EWL_OBJECT_MAX_SIZE;
+ h = EWL_OBJECT_MAX_SIZE;
old_size = MINIMUM_H(o);
new_size = o->minimum.h = h;
if (MAXIMUM_H(o) < h)
- o->minimum.h = h;
+ o->minimum.h = h;
if (PREFERRED_H(o) < MINIMUM_H(o))
- ewl_container_child_resize(EWL_WIDGET(o),
- MINIMUM_H(o) - PREFERRED_H(o),
- EWL_ORIENTATION_VERTICAL);
+ ewl_container_child_resize(EWL_WIDGET(o),
+ MINIMUM_H(o) - PREFERRED_H(o),
+ EWL_ORIENTATION_VERTICAL);
if (CURRENT_H(o) < h)
- ewl_object_h_request(o, h);
+ ewl_object_h_request(o, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -739,12 +739,12 @@ ewl_object_minimum_w_get(Ewl_Object *o)
DCHECK_PARAM_PTR_RET(o, 0);
if (o->flags & EWL_FLAG_FILL_HSHRINK || MINIMUM_W(o) > PREFERRED_W(o))
- val = MINIMUM_W(o);
+ val = MINIMUM_W(o);
else
- val = PREFERRED_W(o);
+ val = PREFERRED_W(o);
DRETURN_INT(val + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -761,12 +761,12 @@ ewl_object_minimum_h_get(Ewl_Object *o)
DCHECK_PARAM_PTR_RET(o, 0);
if (o->flags & EWL_FLAG_FILL_VSHRINK || MINIMUM_H(o) > PREFERRED_H(o))
- val = MINIMUM_H(o);
+ val = MINIMUM_H(o);
else
- val = PREFERRED_H(o);
+ val = PREFERRED_H(o);
DRETURN_INT(val + PADDING_VERTICAL(o) + INSET_VERTICAL(o),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -831,21 +831,21 @@ ewl_object_maximum_w_set(Ewl_Object *o, int w)
DCHECK_PARAM_PTR(o);
if (w < EWL_OBJECT_MIN_SIZE)
- w = EWL_OBJECT_MIN_SIZE;
+ w = EWL_OBJECT_MIN_SIZE;
if (w > EWL_OBJECT_MAX_SIZE)
- w = EWL_OBJECT_MAX_SIZE;
+ w = EWL_OBJECT_MAX_SIZE;
o->maximum.w = w;
if (MINIMUM_W(o) > w)
- o->maximum.w = w;
+ o->maximum.w = w;
if (PREFERRED_W(o) > MAXIMUM_W(o))
- ewl_object_preferred_inner_w_set(o, PREFERRED_W(o));
+ ewl_object_preferred_inner_w_set(o, PREFERRED_W(o));
if (CURRENT_W(o) > w)
- ewl_object_h_request(o, w);
+ ewl_object_h_request(o, w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -867,21 +867,21 @@ ewl_object_maximum_h_set(Ewl_Object *o, int h)
DCHECK_PARAM_PTR(o);
if (h < EWL_OBJECT_MIN_SIZE)
- h = EWL_OBJECT_MIN_SIZE;
+ h = EWL_OBJECT_MIN_SIZE;
if (h > EWL_OBJECT_MAX_SIZE)
- h = EWL_OBJECT_MAX_SIZE;
+ h = EWL_OBJECT_MAX_SIZE;
o->maximum.h = h;
if (MINIMUM_H(o) > h)
- o->minimum.h = h;
+ o->minimum.h = h;
if (PREFERRED_H(o) > MAXIMUM_H(o))
- ewl_object_preferred_inner_h_set(o, PREFERRED_H(o));
+ ewl_object_preferred_inner_h_set(o, PREFERRED_H(o));
if (CURRENT_H(o) > h)
- ewl_object_h_request(o, h);
+ ewl_object_h_request(o, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -900,12 +900,12 @@ ewl_object_maximum_w_get(Ewl_Object *o)
DCHECK_PARAM_PTR_RET(o, 0);
if (o->flags & EWL_FLAG_FILL_HFILL)
- val = MAXIMUM_W(o);
+ val = MAXIMUM_W(o);
else
- val = PREFERRED_W(o);
+ val = PREFERRED_W(o);
if ((val + PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o)) > val)
- val += PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
+ val += PADDING_HORIZONTAL(o) + INSET_HORIZONTAL(o);
DRETURN_INT(val, DLEVEL_STABLE);
}
@@ -924,12 +924,12 @@ ewl_object_maximum_h_get(Ewl_Object *o)
DCHECK_PARAM_PTR_RET(o, 0);
if (o->flags & EWL_FLAG_FILL_VFILL)
- val = MAXIMUM_H(o);
+ val = MAXIMUM_H(o);
else
- val = PREFERRED_H(o);
+ val = PREFERRED_H(o);
if ((val + PADDING_VERTICAL(o) + INSET_VERTICAL(o)) > val)
- val += PADDING_VERTICAL(o) + INSET_VERTICAL(o);
+ val += PADDING_VERTICAL(o) + INSET_VERTICAL(o);
DRETURN_INT(val, DLEVEL_STABLE);
}
@@ -988,9 +988,9 @@ ewl_object_padding_set(Ewl_Object *o, int l, int r, int t, int b)
* Now update the widgets parent of the change in size.
*/
ewl_container_child_resize(EWL_WIDGET(o), dh,
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
ewl_container_child_resize(EWL_WIDGET(o), dv,
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1109,9 +1109,9 @@ ewl_object_insets_set(Ewl_Object *o, int l, int r, int t, int b)
* Now update the widgets parent of the change in size.
*/
ewl_container_child_resize(EWL_WIDGET(o), dh,
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
ewl_container_child_resize(EWL_WIDGET(o), dv,
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1220,7 +1220,7 @@ ewl_object_alignment_set(Ewl_Object *o, unsigned int align)
ewl_object_flags_add(o, align, EWL_FLAGS_ALIGN_MASK);
if (EWL_WIDGET(o)->parent)
- ewl_widget_configure(EWL_WIDGET(o)->parent);
+ ewl_widget_configure(EWL_WIDGET(o)->parent);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1255,21 +1255,21 @@ ewl_object_place(Ewl_Object *o, int x, int y, int w, int h)
* Horizontal position
*/
if (o->flags & EWL_FLAG_ALIGN_LEFT)
- x_pos = x;
+ x_pos = x;
else if (o->flags & EWL_FLAG_ALIGN_RIGHT)
- x_pos = x + w - w_accept;
+ x_pos = x + w - w_accept;
else
- x_pos = x + ((w - w_accept) / 2);
+ x_pos = x + ((w - w_accept) / 2);
/*
* Vertical position
*/
if (o->flags & EWL_FLAG_ALIGN_TOP)
- y_pos = y;
+ y_pos = y;
else if (o->flags & EWL_FLAG_ALIGN_BOTTOM)
- y_pos = y + h - h_accept;
+ y_pos = y + h - h_accept;
else
- y_pos = y + ((h - h_accept) / 2);
+ y_pos = y + ((h - h_accept) / 2);
ewl_object_position_request(o, x_pos, y_pos);
@@ -1299,14 +1299,14 @@ ewl_object_fill_policy_set(Ewl_Object *o, unsigned int fill)
DCHECK_PARAM_PTR(o);
if ((o->flags & EWL_FLAGS_FILL_MASK) == fill)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
old_mask = o->flags;
ewl_object_flags_remove(o, EWL_FLAGS_FILL_MASK, EWL_FLAGS_FILL_MASK);
ewl_object_flags_add(o, fill, EWL_FLAGS_FILL_MASK);
if (EWL_WIDGET(o)->parent)
- ewl_widget_configure(EWL_WIDGET(o)->parent);
+ ewl_widget_configure(EWL_WIDGET(o)->parent);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_object.h b/src/lib/ewl_object.h
index 9ccb059..74a68b5 100644
--- a/src/lib/ewl_object.h
+++ b/src/lib/ewl_object.h
@@ -66,16 +66,16 @@ struct Ewl_Object
{
struct
{
- int x, /**< Horizontal position */
- y; /**< Vertical position */
- int w, /**< Width */
- h; /**< Height */
+ int x, /**< Horizontal position */
+ y; /**< Vertical position */
+ int w, /**< Width */
+ h; /**< Height */
} current; /**< The current size and position of an object. */
struct
{
- int w, /**< Width */
- h; /**< Height */
+ int w, /**< Width */
+ h; /**< Height */
}
preferred, /**< The optimal size of the object in ideal circumstances */
maximum, /**< The guaranteed maximum size this object will receive. */
@@ -83,98 +83,98 @@ struct Ewl_Object
struct
{
- short l, /**< Left value */
- r, /**< Right value */
- t, /**< Top value */
- b; /**< Bottom value */
+ short l, /**< Left value */
+ r, /**< Right value */
+ t, /**< Top value */
+ b; /**< Bottom value */
} pad, /**< The space padded around the outside of the object. */
insets; /**< The space inside where children should not be laid out. */
unsigned int flags; /**< Bitmask indicating fill policy and alignment */
};
-int ewl_object_init(Ewl_Object *o);
-void ewl_object_current_geometry_get(Ewl_Object *o, int *x, int *y,
- int *w, int *h);
-
-void ewl_object_current_size_get(Ewl_Object *o, int *w, int *h);
-int ewl_object_current_x_get(Ewl_Object *o);
-int ewl_object_current_y_get(Ewl_Object *o);
-int ewl_object_current_w_get(Ewl_Object *o);
-int ewl_object_current_h_get(Ewl_Object *o);
-
-void ewl_object_preferred_inner_size_set(Ewl_Object *o, int w, int h);
-void ewl_object_preferred_inner_size_get(Ewl_Object *o, int *w, int *h);
-void ewl_object_preferred_size_get(Ewl_Object *o, int *w, int *h);
-
-void ewl_object_preferred_inner_w_set(Ewl_Object *o, int w);
-int ewl_object_preferred_w_get(Ewl_Object *o);
-int ewl_object_preferred_inner_w_get(Ewl_Object *o);
-
-void ewl_object_preferred_inner_h_set(Ewl_Object *o, int h);
-int ewl_object_preferred_inner_h_get(Ewl_Object *o);
-int ewl_object_preferred_h_get(Ewl_Object *o);
-
-void ewl_object_geometry_request(Ewl_Object *o, int x, int y,
- int w, int h);
-void ewl_object_size_request(Ewl_Object *o, int w, int h);
-void ewl_object_position_request(Ewl_Object *o, int x, int y);
-void ewl_object_x_request(Ewl_Object *o, int x);
-void ewl_object_y_request(Ewl_Object *o, int y);
-void ewl_object_w_request(Ewl_Object *o, int w);
-void ewl_object_h_request(Ewl_Object *o, int h);
-
-void ewl_object_minimum_size_set(Ewl_Object *o, int w, int h);
-void ewl_object_minimum_w_set(Ewl_Object *o, int w);
-void ewl_object_minimum_h_set(Ewl_Object *o, int h);
-
-void ewl_object_minimum_size_get(Ewl_Object *o, int *w, int *h);
-int ewl_object_minimum_w_get(Ewl_Object *o);
-int ewl_object_minimum_h_get(Ewl_Object *o);
-
-void ewl_object_maximum_size_set(Ewl_Object *o, int w, int h);
-void ewl_object_maximum_w_set(Ewl_Object *o, int w);
-void ewl_object_maximum_h_set(Ewl_Object *o, int h);
-
-void ewl_object_maximum_size_get(Ewl_Object *o, int *w, int *h);
-int ewl_object_maximum_w_get(Ewl_Object *o);
-int ewl_object_maximum_h_get(Ewl_Object *o);
+int ewl_object_init(Ewl_Object *o);
+void ewl_object_current_geometry_get(Ewl_Object *o, int *x, int *y,
+ int *w, int *h);
+
+void ewl_object_current_size_get(Ewl_Object *o, int *w, int *h);
+int ewl_object_current_x_get(Ewl_Object *o);
+int ewl_object_current_y_get(Ewl_Object *o);
+int ewl_object_current_w_get(Ewl_Object *o);
+int ewl_object_current_h_get(Ewl_Object *o);
+
+void ewl_object_preferred_inner_size_set(Ewl_Object *o, int w, int h);
+void ewl_object_preferred_inner_size_get(Ewl_Object *o, int *w, int *h);
+void ewl_object_preferred_size_get(Ewl_Object *o, int *w, int *h);
+
+void ewl_object_preferred_inner_w_set(Ewl_Object *o, int w);
+int ewl_object_preferred_w_get(Ewl_Object *o);
+int ewl_object_preferred_inner_w_get(Ewl_Object *o);
+
+void ewl_object_preferred_inner_h_set(Ewl_Object *o, int h);
+int ewl_object_preferred_inner_h_get(Ewl_Object *o);
+int ewl_object_preferred_h_get(Ewl_Object *o);
+
+void ewl_object_geometry_request(Ewl_Object *o, int x, int y,
+ int w, int h);
+void ewl_object_size_request(Ewl_Object *o, int w, int h);
+void ewl_object_position_request(Ewl_Object *o, int x, int y);
+void ewl_object_x_request(Ewl_Object *o, int x);
+void ewl_object_y_request(Ewl_Object *o, int y);
+void ewl_object_w_request(Ewl_Object *o, int w);
+void ewl_object_h_request(Ewl_Object *o, int h);
+
+void ewl_object_minimum_size_set(Ewl_Object *o, int w, int h);
+void ewl_object_minimum_w_set(Ewl_Object *o, int w);
+void ewl_object_minimum_h_set(Ewl_Object *o, int h);
+
+void ewl_object_minimum_size_get(Ewl_Object *o, int *w, int *h);
+int ewl_object_minimum_w_get(Ewl_Object *o);
+int ewl_object_minimum_h_get(Ewl_Object *o);
+
+void ewl_object_maximum_size_set(Ewl_Object *o, int w, int h);
+void ewl_object_maximum_w_set(Ewl_Object *o, int w);
+void ewl_object_maximum_h_set(Ewl_Object *o, int h);
+
+void ewl_object_maximum_size_get(Ewl_Object *o, int *w, int *h);
+int ewl_object_maximum_w_get(Ewl_Object *o);
+int ewl_object_maximum_h_get(Ewl_Object *o);
unsigned int ewl_object_alignment_get(Ewl_Object *o);
-void ewl_object_alignment_set(Ewl_Object *o, unsigned int align);
-void ewl_object_place(Ewl_Object *o, int x, int y, int w, int h);
+void ewl_object_alignment_set(Ewl_Object *o, unsigned int align);
+void ewl_object_place(Ewl_Object *o, int x, int y, int w, int h);
unsigned int ewl_object_fill_policy_get(Ewl_Object *o);
-void ewl_object_fill_policy_set(Ewl_Object *o, unsigned int fill);
+void ewl_object_fill_policy_set(Ewl_Object *o, unsigned int fill);
/*
* Padding setting and retrieval functions.
*/
-void ewl_object_padding_set(Ewl_Object *o, int l, int r, int t,
- int b);
-void ewl_object_padding_get(Ewl_Object *o, int *l, int *r, int *t,
- int *b);
-int ewl_object_padding_top_get(Ewl_Object *o);
-int ewl_object_padding_bottom_get(Ewl_Object *o);
-int ewl_object_padding_left_get(Ewl_Object *o);
-int ewl_object_padding_right_get(Ewl_Object *o);
+void ewl_object_padding_set(Ewl_Object *o, int l, int r, int t,
+ int b);
+void ewl_object_padding_get(Ewl_Object *o, int *l, int *r, int *t,
+ int *b);
+int ewl_object_padding_top_get(Ewl_Object *o);
+int ewl_object_padding_bottom_get(Ewl_Object *o);
+int ewl_object_padding_left_get(Ewl_Object *o);
+int ewl_object_padding_right_get(Ewl_Object *o);
/*
* Inset setting and retrieval functions.
*/
-void ewl_object_insets_set(Ewl_Object *o, int l, int r, int t,
- int b);
-void ewl_object_insets_get(Ewl_Object *o, int *l, int *r, int *t,
- int *b);
-int ewl_object_insets_top_get(Ewl_Object *o);
-int ewl_object_insets_bottom_get(Ewl_Object *o);
-int ewl_object_insets_left_get(Ewl_Object *o);
-int ewl_object_insets_right_get(Ewl_Object *o);
+void ewl_object_insets_set(Ewl_Object *o, int l, int r, int t,
+ int b);
+void ewl_object_insets_get(Ewl_Object *o, int *l, int *r, int *t,
+ int *b);
+int ewl_object_insets_top_get(Ewl_Object *o);
+int ewl_object_insets_bottom_get(Ewl_Object *o);
+int ewl_object_insets_left_get(Ewl_Object *o);
+int ewl_object_insets_right_get(Ewl_Object *o);
-void ewl_object_flags_add(Ewl_Object *o, unsigned int flags,
- unsigned int mask);
-void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
- unsigned int mask);
+void ewl_object_flags_add(Ewl_Object *o, unsigned int flags,
+ unsigned int mask);
+void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
+ unsigned int mask);
/**
* @param o: the parameter to retrieve the current value of object flags
@@ -214,9 +214,9 @@ void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
*/
#define ewl_object_recursive_set(o, val) \
(val ? ewl_object_flags_add(o, EWL_FLAG_PROPERTY_RECURSIVE, \
- EWL_FLAGS_PROPERTY_MASK) : \
+ EWL_FLAGS_PROPERTY_MASK) : \
ewl_object_flags_remove(o, EWL_FLAG_PROPERTY_RECURSIVE, \
- EWL_FLAGS_PROPERTY_MASK));
+ EWL_FLAGS_PROPERTY_MASK));
/**
* @def ewl_object_recursive_get(o)
@@ -236,9 +236,9 @@ void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
*/
#define ewl_object_toplevel_set(o, val) \
(val ? ewl_object_flags_add(o, EWL_FLAG_PROPERTY_TOPLEVEL, \
- EWL_FLAGS_PROPERTY_MASK) : \
+ EWL_FLAGS_PROPERTY_MASK) : \
ewl_object_flags_remove(o, EWL_FLAG_PROPERTY_TOPLEVEL, \
- EWL_FLAGS_PROPERTY_MASK));
+ EWL_FLAGS_PROPERTY_MASK));
/**
* @def ewl_object_toplevel_get(o)
@@ -484,9 +484,9 @@ void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
*/
#define ewl_object_custom_size_set(o, w, h) \
{ \
- ewl_object_minimum_size_set(o, w, h); \
- ewl_object_maximum_size_set(o, w, h); \
- ewl_object_fill_policy_set(o, EWL_FLAG_FILL_NONE); \
+ ewl_object_minimum_size_set(o, w, h); \
+ ewl_object_maximum_size_set(o, w, h); \
+ ewl_object_fill_policy_set(o, EWL_FLAG_FILL_NONE); \
}
/**
@@ -497,10 +497,10 @@ void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
*/
#define ewl_object_custom_w_set(o, w) \
{ \
- ewl_object_maximum_w_set(o, w); \
- ewl_object_minimum_w_set(o, w); \
- ewl_object_fill_policy_set(o, ewl_object_fill_policy_get(o) & \
- ~(EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK)); \
+ ewl_object_maximum_w_set(o, w); \
+ ewl_object_minimum_w_set(o, w); \
+ ewl_object_fill_policy_set(o, ewl_object_fill_policy_get(o) & \
+ ~(EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK)); \
}
/**
@@ -511,10 +511,10 @@ void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
*/
#define ewl_object_custom_h_set(o, h) \
{ \
- ewl_object_maximum_h_set(o, h); \
- ewl_object_minimum_h_set(o, h); \
- ewl_object_fill_policy_set(o, ewl_object_fill_policy_get(o) & \
- ~(EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK)); \
+ ewl_object_maximum_h_set(o, h); \
+ ewl_object_minimum_h_set(o, h); \
+ ewl_object_fill_policy_set(o, ewl_object_fill_policy_get(o) & \
+ ~(EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK)); \
}
/**
@@ -552,18 +552,18 @@ void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
* Used to determine if a widget has been destroyed
*/
#define DESTROYED(o) (ewl_object_queued_has(EWL_OBJECT(o), \
- EWL_FLAG_QUEUED_SCHEDULED_DESTROY) \
- || ewl_object_queued_has(EWL_OBJECT(o), \
- EWL_FLAG_QUEUED_PROCESS_DESTROY))
+ EWL_FLAG_QUEUED_SCHEDULED_DESTROY) \
+ || ewl_object_queued_has(EWL_OBJECT(o), \
+ EWL_FLAG_QUEUED_PROCESS_DESTROY))
/**
* @def CONFIGURED(o)
* Used to determine if a widget is scheduled for configure
*/
#define CONFIGURED(o) (ewl_object_queued_has(EWL_OBJECT(o), \
- EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE) \
- || ewl_object_queued_has(EWL_OBJECT(o), \
- EWL_FLAG_QUEUED_PROCESS_CONFIGURE))
+ EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE) \
+ || ewl_object_queued_has(EWL_OBJECT(o), \
+ EWL_FLAG_QUEUED_PROCESS_CONFIGURE))
/**
* @def DISABLED(o)
@@ -589,9 +589,9 @@ void ewl_object_flags_remove(Ewl_Object *o, unsigned int flags,
*/
#define ewl_object_in_tab_list_set(o, val) \
(val ? ewl_object_flags_add(o, EWL_FLAG_PROPERTY_IN_TAB_LIST, \
- EWL_FLAGS_PROPERTY_MASK) : \
+ EWL_FLAGS_PROPERTY_MASK) : \
ewl_object_flags_remove(o, EWL_FLAG_PROPERTY_IN_TAB_LIST, \
- EWL_FLAGS_PROPERTY_MASK));
+ EWL_FLAGS_PROPERTY_MASK));
/**
* @}
diff --git a/src/lib/ewl_overlay.c b/src/lib/ewl_overlay.c
index fb791b1..ba044d3 100644
--- a/src/lib/ewl_overlay.c
+++ b/src/lib/ewl_overlay.c
@@ -18,11 +18,11 @@ ewl_overlay_new(void)
w = NEW(Ewl_Overlay, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_overlay_init(w)) {
- ewl_widget_destroy(EWL_WIDGET(w));
- w = NULL;
+ ewl_widget_destroy(EWL_WIDGET(w));
+ w = NULL;
}
DRETURN_PTR(EWL_WIDGET(w), DLEVEL_STABLE);
@@ -45,15 +45,15 @@ ewl_overlay_init(Ewl_Overlay *w)
* Initialize the fields of the inherited container class
*/
if (!ewl_container_init(EWL_CONTAINER(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(w), EWL_OVERLAY_TYPE);
ewl_widget_inherit(EWL_WIDGET(w), EWL_OVERLAY_TYPE);
ewl_container_show_notify_set(EWL_CONTAINER(w),
- ewl_overlay_cb_child_show);
+ ewl_overlay_cb_child_show);
ewl_container_resize_notify_set(EWL_CONTAINER(w),
- ewl_overlay_cb_child_resize);
+ ewl_overlay_cb_child_resize);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_NONE);
@@ -62,7 +62,7 @@ ewl_overlay_init(Ewl_Overlay *w)
* has special needs for placement.
*/
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE,
- ewl_overlay_cb_configure, NULL);
+ ewl_overlay_cb_configure, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -77,7 +77,7 @@ ewl_overlay_init(Ewl_Overlay *w)
*/
void
ewl_overlay_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Object *o;
Ewl_Object *child;
@@ -93,21 +93,21 @@ ewl_overlay_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
ecore_dlist_first_goto(EWL_CONTAINER(w)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(w)->children))) {
- int width, height;
- /* ignore unmanaged widgets */
- if (UNMANAGED(child))
- continue;
- /*
- * Try to give the child the full size of the overlay from it's
- * base position. The object will constrict it based on the
- * fill policy. Don't add the TOP and LEFT insets since
- * they've already been accounted for.
- */
- width = CURRENT_W(w) + CURRENT_X(w);
- width -= ewl_object_current_x_get(child);
- height = CURRENT_H(w) + CURRENT_Y(w);
- height -= ewl_object_current_y_get(child);
- ewl_object_size_request(child, width, height);
+ int width, height;
+ /* ignore unmanaged widgets */
+ if (UNMANAGED(child))
+ continue;
+ /*
+ * Try to give the child the full size of the overlay from it's
+ * base position. The object will constrict it based on the
+ * fill policy. Don't add the TOP and LEFT insets since
+ * they've already been accounted for.
+ */
+ width = CURRENT_W(w) + CURRENT_X(w);
+ width -= ewl_object_current_x_get(child);
+ height = CURRENT_H(w) + CURRENT_Y(w);
+ height -= ewl_object_current_y_get(child);
+ ewl_object_size_request(child, width, height);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -135,12 +135,12 @@ ewl_overlay_cb_child_show(Ewl_Container *o, Ewl_Widget *child)
size += ewl_object_preferred_w_get(EWL_OBJECT(child));
size -= CURRENT_X(o);
if (size > PREFERRED_W(o))
- ewl_object_preferred_inner_w_set(EWL_OBJECT(o), size);
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(o), size);
size = ewl_object_current_y_get(EWL_OBJECT(child)) +
- ewl_object_preferred_h_get(EWL_OBJECT(child)) - CURRENT_Y(o);
+ ewl_object_preferred_h_get(EWL_OBJECT(child)) - CURRENT_Y(o);
if (size > PREFERRED_H(o))
- ewl_object_preferred_inner_h_set(EWL_OBJECT(o), size);
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(o), size);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -173,41 +173,41 @@ ewl_overlay_cb_child_resize(Ewl_Container *c, Ewl_Widget *w,
ecore_dlist_first_goto(EWL_CONTAINER(overlay)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(overlay)->children))) {
- int cs;
-
- /*
- * FIXME: Do we really want to do this?
- * Move children within the bounds of the viewable area
- */
- if (ewl_object_current_x_get(child) < CURRENT_X(overlay))
- ewl_object_x_request(child, CURRENT_X(overlay));
- if (ewl_object_current_y_get(child) < CURRENT_Y(overlay))
- ewl_object_y_request(child, CURRENT_Y(overlay));
-
- cs = ewl_object_current_x_get(child) +
- ewl_object_preferred_w_get(child);
-
- /*
- * Check the width and x position vs. overlay width.
- */
- if (maxw < cs)
- maxw = cs;
-
- cs = ewl_object_current_y_get(child) +
- ewl_object_preferred_h_get(child);
-
- /*
- * Check the height and y position vs. overlay height.
- */
- if (maxh < cs)
- maxh = cs;
+ int cs;
+
+ /*
+ * FIXME: Do we really want to do this?
+ * Move children within the bounds of the viewable area
+ */
+ if (ewl_object_current_x_get(child) < CURRENT_X(overlay))
+ ewl_object_x_request(child, CURRENT_X(overlay));
+ if (ewl_object_current_y_get(child) < CURRENT_Y(overlay))
+ ewl_object_y_request(child, CURRENT_Y(overlay));
+
+ cs = ewl_object_current_x_get(child) +
+ ewl_object_preferred_w_get(child);
+
+ /*
+ * Check the width and x position vs. overlay width.
+ */
+ if (maxw < cs)
+ maxw = cs;
+
+ cs = ewl_object_current_y_get(child) +
+ ewl_object_preferred_h_get(child);
+
+ /*
+ * Check the height and y position vs. overlay height.
+ */
+ if (maxh < cs)
+ maxh = cs;
}
ewl_object_preferred_inner_size_set(EWL_OBJECT(overlay), maxw, maxh);
ewl_object_size_request(EWL_OBJECT(c),
- ewl_object_current_w_get(EWL_OBJECT(c)),
- ewl_object_current_h_get(EWL_OBJECT(c)));
+ ewl_object_current_w_get(EWL_OBJECT(c)),
+ ewl_object_current_h_get(EWL_OBJECT(c)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_overlay.h b/src/lib/ewl_overlay.h
index d94d25c..fe8abc5 100644
--- a/src/lib/ewl_overlay.h
+++ b/src/lib/ewl_overlay.h
@@ -54,7 +54,7 @@ struct Ewl_Overlay
};
Ewl_Widget *ewl_overlay_new(void);
-int ewl_overlay_init(Ewl_Overlay *win);
+int ewl_overlay_init(Ewl_Overlay *win);
/*
* Internally used callbacks, override at your own risk.
@@ -63,7 +63,7 @@ void ewl_overlay_cb_configure(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_overlay_cb_child_show(Ewl_Container *emb, Ewl_Widget *child);
void ewl_overlay_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
/**
* @}
diff --git a/src/lib/ewl_paned.c b/src/lib/ewl_paned.c
index 371780b..6d07bd4 100644
--- a/src/lib/ewl_paned.c
+++ b/src/lib/ewl_paned.c
@@ -43,25 +43,25 @@ static Ewl_Paned_Layout *layout = NULL;
static void ewl_paned_cb_shutdown(void);
static void ewl_paned_grabber_cb_mouse_down(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_paned_grabber_cb_mouse_up(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_paned_grabber_cb_mouse_move(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_paned_grabbers_update(Ewl_Paned *p);
static void ewl_paned_layout_setup(void);
static int ewl_paned_pane_info_setup(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- Ewl_Paned_Layout *layout, int *resizable);
+ Ewl_Paned_Layout *layout, int *resizable);
static int ewl_paned_pane_info_collect(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- Ewl_Paned_Layout *layout, int *resizable, int grabber_size);
+ Ewl_Paned_Layout *layout, int *resizable, int grabber_size);
static void ewl_paned_pane_info_layout(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- int pane_num, Ewl_Paned_Layout *layout,
- int available, int resizable);
+ int pane_num, Ewl_Paned_Layout *layout,
+ int available, int resizable);
static int ewl_paned_widgets_place(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- int grabber_size);
+ int grabber_size);
static int ewl_paned_grapper_size_get(Ewl_Paned *p);
@@ -78,12 +78,12 @@ ewl_paned_new(void)
pane = NEW(Ewl_Paned, 1);
if (!pane)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_paned_init(pane))
{
- ewl_widget_destroy(EWL_WIDGET(pane));
- pane = NULL;
+ ewl_widget_destroy(EWL_WIDGET(pane));
+ pane = NULL;
}
DRETURN_PTR(pane, DLEVEL_STABLE);
}
@@ -112,8 +112,8 @@ ewl_vpaned_new(void)
pane = ewl_paned_new();
if (pane)
- ewl_paned_orientation_set(EWL_PANED(pane),
- EWL_ORIENTATION_VERTICAL);
+ ewl_paned_orientation_set(EWL_PANED(pane),
+ EWL_ORIENTATION_VERTICAL);
DRETURN_PTR(pane, DLEVEL_STABLE);
}
@@ -134,34 +134,34 @@ ewl_paned_init(Ewl_Paned *p)
w = EWL_WIDGET(p);
if (!ewl_container_init(EWL_CONTAINER(p)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
if (!horizontal_layout)
- ewl_paned_layout_setup();
+ ewl_paned_layout_setup();
ewl_widget_appearance_set(w, EWL_PANED_TYPE);
ewl_widget_inherit(w, EWL_PANED_TYPE);
p->orientation = EWL_ORIENTATION_HORIZONTAL;
ewl_container_add_notify_set(EWL_CONTAINER(p),
- ewl_paned_cb_child_add);
+ ewl_paned_cb_child_add);
ewl_container_remove_notify_set(EWL_CONTAINER(p),
- ewl_paned_cb_child_remove);
+ ewl_paned_cb_child_remove);
ewl_container_show_notify_set(EWL_CONTAINER(p),
- ewl_paned_cb_child_show);
+ ewl_paned_cb_child_show);
ewl_container_resize_notify_set(EWL_CONTAINER(p),
- ewl_paned_cb_child_resize);
+ ewl_paned_cb_child_resize);
ewl_container_hide_notify_set(EWL_CONTAINER(p),
- ewl_paned_cb_child_hide);
+ ewl_paned_cb_child_hide);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_paned_cb_configure, NULL);
+ ewl_paned_cb_configure, NULL);
ewl_callback_append(w, EWL_CALLBACK_DESTROY,
- ewl_paned_cb_destroy, NULL);
+ ewl_paned_cb_destroy, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_LEFT |
- EWL_FLAG_ALIGN_TOP);
+ EWL_FLAG_ALIGN_TOP);
ewl_widget_focusable_set(w, FALSE);
p->new_panes = TRUE;
@@ -183,7 +183,7 @@ ewl_paned_orientation_set(Ewl_Paned *p, Ewl_Orientation o)
DCHECK_TYPE(p, EWL_PANED_TYPE);
if (p->orientation == o)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
p->orientation = o;
@@ -192,9 +192,9 @@ ewl_paned_orientation_set(Ewl_Paned *p, Ewl_Orientation o)
ecore_dlist_first_goto(EWL_CONTAINER(p)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(p)->children)))
{
- if (EWL_PANED_GRABBER_IS(child))
- ewl_paned_grabber_paned_orientation_set(
- EWL_PANED_GRABBER(child), o);
+ if (EWL_PANED_GRABBER_IS(child))
+ ewl_paned_grabber_paned_orientation_set(
+ EWL_PANED_GRABBER(child), o);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -256,7 +256,7 @@ ewl_paned_initial_size_get(Ewl_Paned *p, Ewl_Widget *child)
info = ewl_paned_size_info_get(p, child);
if (!info || !info->initial_size_has)
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
DRETURN_INT(info->initial_size, DLEVEL_STABLE);
}
@@ -300,7 +300,7 @@ ewl_paned_fixed_size_get(Ewl_Paned *p, Ewl_Widget *child)
info = ewl_paned_size_info_get(p, child);
if (!info)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
DRETURN_INT(info->fixed, DLEVEL_STABLE);
}
@@ -326,11 +326,11 @@ ewl_paned_cb_child_add(Ewl_Container *c, Ewl_Widget *w)
/* if this is a grabber we can skipp it */
if (EWL_PANED_GRABBER_IS(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
o = ewl_paned_grabber_new();
ewl_paned_grabber_paned_orientation_set(EWL_PANED_GRABBER(o),
- ewl_paned_orientation_get(EWL_PANED(c)));
+ ewl_paned_orientation_get(EWL_PANED(c)));
/* insert the grabber at the same position as the pane so the
* grabber ends up to the left of the pane in the children list */
@@ -364,7 +364,7 @@ ewl_paned_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx)
p = EWL_PANED(c);
/* skip grabbers */
if (EWL_PANED_GRABBER_IS(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* our grabber is always to our left, since we were just removed
* from idx that means it's at idx - 1 */
@@ -372,7 +372,7 @@ ewl_paned_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx)
ewl_widget_destroy(o);
if (p->last_pane == w)
- p->last_pane = NULL;
+ p->last_pane = NULL;
ewl_paned_size_info_del(p, w);
ewl_paned_grabbers_update(EWL_PANED(c));
@@ -408,21 +408,21 @@ ewl_paned_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
if (EWL_ORIENTATION_HORIZONTAL == EWL_PANED(c)->orientation)
{
- if (info && info->initial_size_has)
- cw += info->initial_size;
- else
- cw += ww;
+ if (info && info->initial_size_has)
+ cw += info->initial_size;
+ else
+ cw += ww;
- if (wh > ch) ch = wh;
+ if (wh > ch) ch = wh;
}
else
{
- if (info && info->initial_size_has)
- ch += info->initial_size;
- else
- ch += wh;
+ if (info && info->initial_size_has)
+ ch += info->initial_size;
+ else
+ ch += wh;
- if (ww > cw) cw = ww;
+ if (ww > cw) cw = ww;
}
ewl_object_preferred_inner_size_set(EWL_OBJECT(c), cw, ch);
@@ -440,7 +440,7 @@ ewl_paned_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
*/
void
ewl_paned_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o)
+ Ewl_Orientation o)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
@@ -450,23 +450,23 @@ ewl_paned_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
if (o == EWL_PANED(c)->orientation)
{
- Ewl_Paned_Size_Info *info;
-
- info = ewl_paned_size_info_get(EWL_PANED(c), w);
- if (!info || !info->initial_size_has)
- {
- if (o == EWL_ORIENTATION_HORIZONTAL)
- ewl_object_preferred_inner_w_set(
- EWL_OBJECT(c), PREFERRED_W(c)
- + size);
- else
- ewl_object_preferred_inner_h_set(
- EWL_OBJECT(c), PREFERRED_H(c)
- + size);
- }
+ Ewl_Paned_Size_Info *info;
+
+ info = ewl_paned_size_info_get(EWL_PANED(c), w);
+ if (!info || !info->initial_size_has)
+ {
+ if (o == EWL_ORIENTATION_HORIZONTAL)
+ ewl_object_preferred_inner_w_set(
+ EWL_OBJECT(c), PREFERRED_W(c)
+ + size);
+ else
+ ewl_object_preferred_inner_h_set(
+ EWL_OBJECT(c), PREFERRED_H(c)
+ + size);
+ }
}
else
- ewl_container_largest_prefer(c, o);
+ ewl_container_largest_prefer(c, o);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -496,17 +496,17 @@ ewl_paned_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
if (EWL_ORIENTATION_HORIZONTAL == EWL_PANED(c)->orientation)
{
- if (info && info->initial_size_has)
- cw -= info->initial_size;
- else
- cw -= ww;
+ if (info && info->initial_size_has)
+ cw -= info->initial_size;
+ else
+ cw -= ww;
}
else
{
- if (info && info->initial_size_has)
- ch -= info->initial_size;
- else
- ch -= wh;
+ if (info && info->initial_size_has)
+ ch -= info->initial_size;
+ else
+ ch -= wh;
}
ewl_object_preferred_inner_size_set(EWL_OBJECT(c), cw, ch);
@@ -547,20 +547,20 @@ ewl_paned_arrange(Ewl_Paned *p, int pane_num)
if (ewl_paned_orientation_get(p) == EWL_ORIENTATION_HORIZONTAL)
{
- layout = horizontal_layout;
- main_size = CURRENT_W(w);
- main_pos = CURRENT_X(w);
+ layout = horizontal_layout;
+ main_size = CURRENT_W(w);
+ main_pos = CURRENT_X(w);
}
else
{
- layout = vertical_layout;
- main_size = CURRENT_H(w);
- main_pos = CURRENT_Y(w);
+ layout = vertical_layout;
+ main_size = CURRENT_H(w);
+ main_pos = CURRENT_Y(w);
}
/* we cannot place the panes if there aren't any */
if (pane_num <= 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* setup the array holding the information about the panes */
panes = alloca(sizeof(Ewl_Paned_Pane_Info) * pane_num);
@@ -569,11 +569,11 @@ ewl_paned_arrange(Ewl_Paned *p, int pane_num)
/* if there are new widgets we place them first */
if (p->new_panes)
- used_size = ewl_paned_pane_info_setup(p, panes, layout,
- &resizable);
+ used_size = ewl_paned_pane_info_setup(p, panes, layout,
+ &resizable);
else
- used_size = ewl_paned_pane_info_collect(p, panes, layout,
- &resizable, grabber_size);
+ used_size = ewl_paned_pane_info_collect(p, panes, layout,
+ &resizable, grabber_size);
available = main_size - grabber_size * (pane_num - 1) - used_size;
@@ -599,14 +599,14 @@ ewl_paned_arrange(Ewl_Paned *p, int pane_num)
*/
void
ewl_paned_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
int pane_num;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_PANED_TYPE);
- /* we need to now the number of panes */
+ /* we need to now the number of panes */
pane_num = (ewl_container_child_count_visible_get(EWL_CONTAINER(w)) + 1)/2;
ewl_paned_arrange(EWL_PANED(w), pane_num);
@@ -624,7 +624,7 @@ ewl_paned_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_paned_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Paned *p;
@@ -651,7 +651,7 @@ ewl_paned_grabbers_update(Ewl_Paned *p)
DCHECK_TYPE(p, EWL_PANED_TYPE);
if (p->updating_grabbers)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
p->updating_grabbers = 1;
@@ -659,27 +659,27 @@ ewl_paned_grabbers_update(Ewl_Paned *p)
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)))
{
- /* internal means grabber */
- if (EWL_PANED_GRABBER_IS(child))
- {
- /* if there is a widget to the left we store the
- * grabber */
- if (left) g = child;
- ewl_widget_hide(child);
- }
- else if (VISIBLE(child) && !UNMANAGED(child))
- {
- left = 1;
-
- /* if we have a grabber to the left of us we need to
- * show it as that means there is a widget to the
- * left of us */
- if (g)
- {
- ewl_widget_show(g);
- g = NULL;
- }
- }
+ /* internal means grabber */
+ if (EWL_PANED_GRABBER_IS(child))
+ {
+ /* if there is a widget to the left we store the
+ * grabber */
+ if (left) g = child;
+ ewl_widget_hide(child);
+ }
+ else if (VISIBLE(child) && !UNMANAGED(child))
+ {
+ left = 1;
+
+ /* if we have a grabber to the left of us we need to
+ * show it as that means there is a widget to the
+ * left of us */
+ if (g)
+ {
+ ewl_widget_show(g);
+ g = NULL;
+ }
+ }
}
p->updating_grabbers = 0;
@@ -689,7 +689,7 @@ ewl_paned_grabbers_update(Ewl_Paned *p)
static int
ewl_paned_pane_info_setup(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- Ewl_Paned_Layout *layout, int *resizable)
+ Ewl_Paned_Layout *layout, int *resizable)
{
Ewl_Widget *child;
Ewl_Container *c;
@@ -705,27 +705,27 @@ ewl_paned_pane_info_setup(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)))
{
- if (!VISIBLE(child) || EWL_PANED_GRABBER_IS(child)
- || UNMANAGED(child))
- continue;
-
- panes->info = ewl_paned_size_info_get(p, child);
- panes->pane = child;
-
- if (panes->info && panes->info->initial_size_has)
- {
- panes->size = panes->info->initial_size;
- panes->fixed = TRUE;
- }
- else
- {
- panes->size = layout->minimum_size(EWL_OBJECT(child));
- (*resizable)++;
- panes->fixed = FALSE;
- }
-
- available += panes->size;
- panes++;
+ if (!VISIBLE(child) || EWL_PANED_GRABBER_IS(child)
+ || UNMANAGED(child))
+ continue;
+
+ panes->info = ewl_paned_size_info_get(p, child);
+ panes->pane = child;
+
+ if (panes->info && panes->info->initial_size_has)
+ {
+ panes->size = panes->info->initial_size;
+ panes->fixed = TRUE;
+ }
+ else
+ {
+ panes->size = layout->minimum_size(EWL_OBJECT(child));
+ (*resizable)++;
+ panes->fixed = FALSE;
+ }
+
+ available += panes->size;
+ panes++;
}
p->new_panes = FALSE;
@@ -735,7 +735,7 @@ ewl_paned_pane_info_setup(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
static int
ewl_paned_pane_info_collect(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- Ewl_Paned_Layout *layout, int *resizable, int grabber_size)
+ Ewl_Paned_Layout *layout, int *resizable, int grabber_size)
{
Ewl_Container *c;
Ewl_Widget *child;
@@ -756,30 +756,30 @@ ewl_paned_pane_info_collect(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)))
{
- int pos;
-
- if (!VISIBLE(child) || UNMANAGED(child))
- continue;
- if (!EWL_PANED_GRABBER_IS(child))
- {
- panes[i].pane = child;
- panes[i].info = ewl_paned_size_info_get(p, child);
- if (panes[i].info && panes[i].info->fixed)
- panes[i].fixed = TRUE;
- else
- {
- panes[i].fixed = FALSE;
- (*resizable)++;
- }
-
- continue;
- }
-
- pos = layout->current_position(EWL_OBJECT(child));
- panes[i].size = pos - prev_pos;
- available += panes[i].size;
- prev_pos = pos + grabber_size;
- i++;
+ int pos;
+
+ if (!VISIBLE(child) || UNMANAGED(child))
+ continue;
+ if (!EWL_PANED_GRABBER_IS(child))
+ {
+ panes[i].pane = child;
+ panes[i].info = ewl_paned_size_info_get(p, child);
+ if (panes[i].info && panes[i].info->fixed)
+ panes[i].fixed = TRUE;
+ else
+ {
+ panes[i].fixed = FALSE;
+ (*resizable)++;
+ }
+
+ continue;
+ }
+
+ pos = layout->current_position(EWL_OBJECT(child));
+ panes[i].size = pos - prev_pos;
+ available += panes[i].size;
+ prev_pos = pos + grabber_size;
+ i++;
}
/* only the last position is not set because we have no grabber
* at the end */
@@ -791,8 +791,8 @@ ewl_paned_pane_info_collect(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
static void
ewl_paned_pane_info_layout(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- int pane_num, Ewl_Paned_Layout *layout,
- int available, int resizable)
+ int pane_num, Ewl_Paned_Layout *layout,
+ int available, int resizable)
{
int cur_res = resizable;
@@ -802,66 +802,66 @@ ewl_paned_pane_info_layout(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
while (available != 0)
{
- int give;
- int i;
-
- /* if we have no panes we don't need to calc their place,
- * or, if cur_res is as low as it will get avoid endless
- * loop
- */
- if ((cur_res < 1) || (cur_res == (resizable - pane_num)))
- DRETURN(DLEVEL_STABLE);
-
- /* give can also be negative, so see it as a can take or give */
- give = available / cur_res;
- /* reset the resizable pane_num now */
- cur_res = resizable;
- i = 0;
- /* to prevent rounding errors */
- if (give == 0) {
- give = (available > 0) ? 1 : -1;
- if (p->last_pane)
- {
- /* find the index to start with */
- while ((panes[i].pane) &&
- (panes[i].pane
- != p->last_pane))
- i++;
- /* on the next run we don't want to start
- * with this widget */
- p->last_pane = NULL;
- i++;
- if (i >= pane_num)
- i = 0;
- }
- }
-
- for (;i < pane_num; i++)
- {
- int min;
-
- if (panes[i].fixed)
- continue;
-
- min = layout->minimum_size(EWL_OBJECT(panes[i].pane));
-
- if (min > panes[i].size + give) {
- available -= panes[i].size - min;
- panes[i].size = min;
- cur_res--;
- }
- else {
- available -= give;
- panes[i].size += give;
- }
-
- /* if there is no space to distribute left
- * we can stop in resizing the panes */
- if (available == 0) {
- p->last_pane = panes[i].pane;
- break;
- }
- }
+ int give;
+ int i;
+
+ /* if we have no panes we don't need to calc their place,
+ * or, if cur_res is as low as it will get avoid endless
+ * loop
+ */
+ if ((cur_res < 1) || (cur_res == (resizable - pane_num)))
+ DRETURN(DLEVEL_STABLE);
+
+ /* give can also be negative, so see it as a can take or give */
+ give = available / cur_res;
+ /* reset the resizable pane_num now */
+ cur_res = resizable;
+ i = 0;
+ /* to prevent rounding errors */
+ if (give == 0) {
+ give = (available > 0) ? 1 : -1;
+ if (p->last_pane)
+ {
+ /* find the index to start with */
+ while ((panes[i].pane) &&
+ (panes[i].pane
+ != p->last_pane))
+ i++;
+ /* on the next run we don't want to start
+ * with this widget */
+ p->last_pane = NULL;
+ i++;
+ if (i >= pane_num)
+ i = 0;
+ }
+ }
+
+ for (;i < pane_num; i++)
+ {
+ int min;
+
+ if (panes[i].fixed)
+ continue;
+
+ min = layout->minimum_size(EWL_OBJECT(panes[i].pane));
+
+ if (min > panes[i].size + give) {
+ available -= panes[i].size - min;
+ panes[i].size = min;
+ cur_res--;
+ }
+ else {
+ available -= give;
+ panes[i].size += give;
+ }
+
+ /* if there is no space to distribute left
+ * we can stop in resizing the panes */
+ if (available == 0) {
+ p->last_pane = panes[i].pane;
+ break;
+ }
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -869,7 +869,7 @@ ewl_paned_pane_info_layout(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
static int
ewl_paned_widgets_place(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
- int grabber_size)
+ int grabber_size)
{
Ewl_Container *c;
Ewl_Widget *child;
@@ -884,35 +884,35 @@ ewl_paned_widgets_place(Ewl_Paned *p, Ewl_Paned_Pane_Info *panes,
if (ewl_paned_orientation_get(p) == EWL_ORIENTATION_HORIZONTAL)
{
- first_pos = cur_pos = CURRENT_X(p);
- x = &cur_pos;
- y = &CURRENT_Y(p);
- w = &cur_size;
- h = &CURRENT_H(p);
+ first_pos = cur_pos = CURRENT_X(p);
+ x = &cur_pos;
+ y = &CURRENT_Y(p);
+ w = &cur_size;
+ h = &CURRENT_H(p);
}
else
{
- first_pos = cur_pos = CURRENT_Y(p);
- x = &CURRENT_X(p);
- y = &cur_pos;
- w = &CURRENT_W(p);
- h = &cur_size;
+ first_pos = cur_pos = CURRENT_Y(p);
+ x = &CURRENT_X(p);
+ y = &cur_pos;
+ w = &CURRENT_W(p);
+ h = &cur_size;
}
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)))
{
- if (!VISIBLE(child) || UNMANAGED(child))
- continue;
+ if (!VISIBLE(child) || UNMANAGED(child))
+ continue;
- if (EWL_PANED_GRABBER_IS(child))
- cur_size = grabber_size;
- else
- cur_size = (panes++)->size;
+ if (EWL_PANED_GRABBER_IS(child))
+ cur_size = grabber_size;
+ else
+ cur_size = (panes++)->size;
- ewl_object_place(EWL_OBJECT(child), *x, *y, *w, *h);
+ ewl_object_place(EWL_OBJECT(child), *x, *y, *w, *h);
- cur_pos += cur_size;
+ cur_pos += cur_size;
}
DRETURN_INT(cur_pos - first_pos, DLEVEL_STABLE);
@@ -933,11 +933,11 @@ ewl_paned_grapper_size_get(Ewl_Paned *p)
ecore_list_first_goto(c->children);
while ((child = ecore_list_next(c->children)))
{
- if (!VISIBLE(child) || !EWL_PANED_GRABBER_IS(child))
- continue;
-
- DRETURN_INT(layout->current_size(EWL_OBJECT(child)),
- DLEVEL_STABLE);
+ if (!VISIBLE(child) || !EWL_PANED_GRABBER_IS(child))
+ continue;
+
+ DRETURN_INT(layout->current_size(EWL_OBJECT(child)),
+ DLEVEL_STABLE);
}
DRETURN_INT(0, DLEVEL_STABLE);
@@ -962,20 +962,20 @@ ewl_paned_size_info_add(Ewl_Paned *p, Ewl_Widget *w)
* to create one */
info = ewl_paned_size_info_get(p, w);
if (info)
- DRETURN_PTR(info, DLEVEL_STABLE);
+ DRETURN_PTR(info, DLEVEL_STABLE);
/* ok we don't have found one first we have to resize our array */
p->info = realloc(p->info, (p->info_size + 1)
- * sizeof(Ewl_Paned_Size_Info));
+ * sizeof(Ewl_Paned_Size_Info));
/* now we need to find the position for the new info item */
for (i = 0; i < p->info_size; i++)
{
- if (p->info[i].child > w)
- break;
+ if (p->info[i].child > w)
+ break;
}
/* move the rest so we can insert it */
memmove(p->info + i + 1, p->info + i,
- sizeof(Ewl_Paned_Size_Info) * (p->info_size - i));
+ sizeof(Ewl_Paned_Size_Info) * (p->info_size - i));
memset(p->info + i, 0, sizeof(Ewl_Paned_Size_Info));
p->info[i].child = w;
p->info_size++;
@@ -994,7 +994,7 @@ ewl_paned_size_info_compare(const void *key1, const void *key2)
info2 = key2;
DRETURN_INT(ecore_direct_compare(info1->child, info2->child),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
Ewl_Paned_Size_Info *
@@ -1010,8 +1010,8 @@ ewl_paned_size_info_get(Ewl_Paned *p, Ewl_Widget *w)
info.child = w;
DRETURN_PTR(bsearch(&info, p->info, p->info_size,
- sizeof(Ewl_Paned_Size_Info),
- ewl_paned_size_info_compare), DLEVEL_STABLE);
+ sizeof(Ewl_Paned_Size_Info),
+ ewl_paned_size_info_compare), DLEVEL_STABLE);
}
void
@@ -1025,10 +1025,10 @@ ewl_paned_size_info_del(Ewl_Paned *p, Ewl_Widget *w)
info = ewl_paned_size_info_get(p, w);
if (!info)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
memmove(info, info + 1, (p->info_size - (info - p->info) - 1)
- * sizeof(Ewl_Paned_Size_Info));
+ * sizeof(Ewl_Paned_Size_Info));
p->info = realloc(p->info, --p->info_size);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1051,12 +1051,12 @@ ewl_paned_grabber_new(void)
w = NEW(Ewl_Paned_Grabber, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_paned_grabber_init(EWL_PANED_GRABBER(w)))
{
- ewl_widget_destroy(w);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(w);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -1074,15 +1074,15 @@ ewl_paned_grabber_init(Ewl_Paned_Grabber *g)
DCHECK_PARAM_PTR_RET(g, FALSE);
if (!ewl_separator_init(EWL_SEPARATOR(g)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(g), EWL_PANED_GRABBER_TYPE);
ewl_paned_grabber_paned_orientation_set(g, EWL_ORIENTATION_VERTICAL);
ewl_callback_append(EWL_WIDGET(g), EWL_CALLBACK_MOUSE_DOWN,
- ewl_paned_grabber_cb_mouse_down, NULL);
+ ewl_paned_grabber_cb_mouse_down, NULL);
ewl_callback_append(EWL_WIDGET(g), EWL_CALLBACK_MOUSE_UP,
- ewl_paned_grabber_cb_mouse_up, NULL);
+ ewl_paned_grabber_cb_mouse_up, NULL);
ewl_widget_internal_set(EWL_WIDGET(g), TRUE);
@@ -1104,19 +1104,19 @@ ewl_paned_grabber_paned_orientation_set(Ewl_Paned_Grabber *g, Ewl_Orientation o)
if (o == EWL_ORIENTATION_HORIZONTAL)
{
- ewl_separator_orientation_set(EWL_SEPARATOR(g),
- EWL_ORIENTATION_VERTICAL);
- ewl_widget_appearance_set(EWL_WIDGET(g), "grabber/vertical");
- ewl_paned_grabber_show_cursor_for(g,
- EWL_POSITION_LEFT | EWL_POSITION_RIGHT);
+ ewl_separator_orientation_set(EWL_SEPARATOR(g),
+ EWL_ORIENTATION_VERTICAL);
+ ewl_widget_appearance_set(EWL_WIDGET(g), "grabber/vertical");
+ ewl_paned_grabber_show_cursor_for(g,
+ EWL_POSITION_LEFT | EWL_POSITION_RIGHT);
}
else
{
- ewl_separator_orientation_set(EWL_SEPARATOR(g),
- EWL_ORIENTATION_HORIZONTAL);
- ewl_widget_appearance_set(EWL_WIDGET(g), "grabber/horizontal");
- ewl_paned_grabber_show_cursor_for(g,
- EWL_POSITION_TOP | EWL_POSITION_BOTTOM);
+ ewl_separator_orientation_set(EWL_SEPARATOR(g),
+ EWL_ORIENTATION_HORIZONTAL);
+ ewl_widget_appearance_set(EWL_WIDGET(g), "grabber/horizontal");
+ ewl_paned_grabber_show_cursor_for(g,
+ EWL_POSITION_TOP | EWL_POSITION_BOTTOM);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1133,10 +1133,10 @@ ewl_paned_grabber_orientation_get(Ewl_Paned_Grabber *g)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(g, EWL_ORIENTATION_HORIZONTAL);
DCHECK_TYPE_RET(g, EWL_PANED_GRABBER_TYPE,
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
DRETURN_INT(ewl_separator_orientation_get(EWL_SEPARATOR(g)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -1158,17 +1158,17 @@ ewl_paned_grabber_show_cursor_for(Ewl_Paned_Grabber *g, unsigned int dir)
DCHECK_TYPE(g, EWL_PANED_GRABBER_TYPE);
if ((dir & EWL_POSITION_LEFT) && (dir & EWL_POSITION_RIGHT))
- pos = EWL_MOUSE_CURSOR_SB_H_DOUBLE_ARROW;
+ pos = EWL_MOUSE_CURSOR_SB_H_DOUBLE_ARROW;
else if ((dir & EWL_POSITION_TOP) && (dir & EWL_POSITION_BOTTOM))
- pos = EWL_MOUSE_CURSOR_SB_V_DOUBLE_ARROW;
+ pos = EWL_MOUSE_CURSOR_SB_V_DOUBLE_ARROW;
else if (dir & EWL_POSITION_LEFT)
- pos = EWL_MOUSE_CURSOR_SB_LEFT_ARROW;
+ pos = EWL_MOUSE_CURSOR_SB_LEFT_ARROW;
else if (dir & EWL_POSITION_RIGHT)
- pos = EWL_MOUSE_CURSOR_SB_RIGHT_ARROW;
+ pos = EWL_MOUSE_CURSOR_SB_RIGHT_ARROW;
else if (dir & EWL_POSITION_TOP)
- pos = EWL_MOUSE_CURSOR_SB_UP_ARROW;
+ pos = EWL_MOUSE_CURSOR_SB_UP_ARROW;
else
- pos = EWL_MOUSE_CURSOR_SB_DOWN_ARROW;
+ pos = EWL_MOUSE_CURSOR_SB_DOWN_ARROW;
ewl_attach_mouse_cursor_set(EWL_WIDGET(g), pos);
@@ -1177,7 +1177,7 @@ ewl_paned_grabber_show_cursor_for(Ewl_Paned_Grabber *g, unsigned int dir)
static void
ewl_paned_grabber_cb_mouse_down(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Paned *p;
Ewl_Event_Mouse *event;
@@ -1191,13 +1191,13 @@ ewl_paned_grabber_cb_mouse_down(Ewl_Widget *w, void *ev,
p = EWL_PANED(w->parent);
if (ewl_paned_orientation_get(p) == EWL_ORIENTATION_HORIZONTAL)
- ds = CURRENT_X(w) - event->x;
+ ds = CURRENT_X(w) - event->x;
else
- ds = CURRENT_Y(w) - event->y;
+ ds = CURRENT_Y(w) - event->y;
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_paned_grabber_cb_mouse_move,
- (void *) ds);
+ ewl_paned_grabber_cb_mouse_move,
+ (void *) ds);
ewl_widget_state_set(w, "selected", EWL_STATE_PERSISTENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1205,14 +1205,14 @@ ewl_paned_grabber_cb_mouse_down(Ewl_Widget *w, void *ev,
static void
ewl_paned_grabber_cb_mouse_up(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
ewl_callback_del(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_paned_grabber_cb_mouse_move);
+ ewl_paned_grabber_cb_mouse_move);
ewl_widget_state_set(w, "default", EWL_STATE_PERSISTENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1246,17 +1246,17 @@ ewl_paned_grabber_cb_mouse_move(Ewl_Widget *w, void *ev, void *data)
if (ewl_paned_orientation_get(p) == EWL_ORIENTATION_HORIZONTAL)
{
- layout = horizontal_layout;
- mouse_pos = e->x;
- paned_pos = CURRENT_X(p);
- paned_size = CURRENT_W(p);
+ layout = horizontal_layout;
+ mouse_pos = e->x;
+ paned_pos = CURRENT_X(p);
+ paned_size = CURRENT_W(p);
}
else
{
- layout = vertical_layout;
- mouse_pos = e->y;
- paned_pos = CURRENT_Y(p);
- paned_size = CURRENT_H(p);
+ layout = vertical_layout;
+ mouse_pos = e->y;
+ paned_pos = CURRENT_Y(p);
+ paned_size = CURRENT_H(p);
}
grabber_pos = layout->current_position(EWL_OBJECT(w));
@@ -1268,7 +1268,7 @@ ewl_paned_grabber_cb_mouse_move(Ewl_Widget *w, void *ev, void *data)
*/
mouse_vec = mouse_pos - grabber_pos + mouse_offset;
if (mouse_vec == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* find the previous grabber that is blocking us */
ecore_dlist_goto(c->children, w);
@@ -1277,24 +1277,24 @@ ewl_paned_grabber_cb_mouse_move(Ewl_Widget *w, void *ev, void *data)
ecore_dlist_previous(c->children);
while ((child = ecore_dlist_previous(c->children)))
{
- if (!VISIBLE(child) || UNMANAGED(child)) continue;
-
- if (EWL_PANED_GRABBER_IS(child))
- {
- stop_grabber = EWL_PANED_GRABBER(child);
- break;
- }
- else
- prev_pane = child;
+ if (!VISIBLE(child) || UNMANAGED(child)) continue;
+
+ if (EWL_PANED_GRABBER_IS(child))
+ {
+ stop_grabber = EWL_PANED_GRABBER(child);
+ break;
+ }
+ else
+ prev_pane = child;
}
/* if we didn't find a privous grabber set the paned position instead */
if (stop_grabber)
- prev_grabber_pos =
- layout->current_position(EWL_OBJECT(stop_grabber))
- + grabber_size;
+ prev_grabber_pos =
+ layout->current_position(EWL_OBJECT(stop_grabber))
+ + grabber_size;
else
- prev_grabber_pos = paned_pos;
+ prev_grabber_pos = paned_pos;
/* and now find the right/bottom pane */
ecore_dlist_goto(c->children, w);
@@ -1304,22 +1304,22 @@ ewl_paned_grabber_cb_mouse_move(Ewl_Widget *w, void *ev, void *data)
ecore_dlist_next(c->children);
while ((child = ecore_list_next(c->children)))
{
- if (!VISIBLE(child) || UNMANAGED(child)) continue;
-
- if (EWL_PANED_GRABBER_IS(child)) {
- stop_grabber = EWL_PANED_GRABBER(child);
- break;
- }
- else
- next_pane = child;
+ if (!VISIBLE(child) || UNMANAGED(child)) continue;
+
+ if (EWL_PANED_GRABBER_IS(child)) {
+ stop_grabber = EWL_PANED_GRABBER(child);
+ break;
+ }
+ else
+ next_pane = child;
}
/* if we didn't find a prevous grabber set the paned position instead */
if (stop_grabber)
- next_grabber_pos =
- layout->current_position(EWL_OBJECT(stop_grabber));
+ next_grabber_pos =
+ layout->current_position(EWL_OBJECT(stop_grabber));
else
- next_grabber_pos = paned_pos + paned_size;
+ next_grabber_pos = paned_pos + paned_size;
/*
* now we have collected enought data to place the grabber
@@ -1327,61 +1327,61 @@ ewl_paned_grabber_cb_mouse_move(Ewl_Widget *w, void *ev, void *data)
*/
/* we don't want to shrink the panes more that it is allowed */
if (mouse_vec < 0) {
- /* the left side get shrinked */
- int pane_min = layout->minimum_size(EWL_OBJECT(prev_pane));
- if (grabber_pos + mouse_vec - prev_grabber_pos < pane_min)
- grabber_pos_new = prev_grabber_pos + pane_min;
- else
- /* note that mouse_vec is here negative! */
- grabber_pos_new = grabber_pos + mouse_vec;
+ /* the left side get shrinked */
+ int pane_min = layout->minimum_size(EWL_OBJECT(prev_pane));
+ if (grabber_pos + mouse_vec - prev_grabber_pos < pane_min)
+ grabber_pos_new = prev_grabber_pos + pane_min;
+ else
+ /* note that mouse_vec is here negative! */
+ grabber_pos_new = grabber_pos + mouse_vec;
}
else {
- /* the right/bottom side get shrinked */
- int pane_min = layout->minimum_size(EWL_OBJECT(next_pane));
- if (next_grabber_pos - (grabber_pos + mouse_vec + grabber_size)
- < pane_min)
- grabber_pos_new =
- next_grabber_pos - pane_min - grabber_size;
- else
- grabber_pos_new = grabber_pos + mouse_vec;
+ /* the right/bottom side get shrinked */
+ int pane_min = layout->minimum_size(EWL_OBJECT(next_pane));
+ if (next_grabber_pos - (grabber_pos + mouse_vec + grabber_size)
+ < pane_min)
+ grabber_pos_new =
+ next_grabber_pos - pane_min - grabber_size;
+ else
+ grabber_pos_new = grabber_pos + mouse_vec;
}
/*
* finally we can place the stuff
*/
if (ewl_paned_orientation_get(p) == EWL_ORIENTATION_HORIZONTAL) {
- ewl_object_place(EWL_OBJECT(prev_pane), prev_grabber_pos,
- CURRENT_Y(p),
- grabber_pos_new - prev_grabber_pos,
- CURRENT_H(p));
- ewl_object_place(EWL_OBJECT(w), grabber_pos_new,
- CURRENT_Y(p),
- grabber_size,
- CURRENT_H(p));
- ewl_object_place(EWL_OBJECT(next_pane),
- grabber_pos_new + grabber_size,
- CURRENT_Y(p),
- next_grabber_pos - grabber_pos_new
- - grabber_size,
- CURRENT_H(p));
+ ewl_object_place(EWL_OBJECT(prev_pane), prev_grabber_pos,
+ CURRENT_Y(p),
+ grabber_pos_new - prev_grabber_pos,
+ CURRENT_H(p));
+ ewl_object_place(EWL_OBJECT(w), grabber_pos_new,
+ CURRENT_Y(p),
+ grabber_size,
+ CURRENT_H(p));
+ ewl_object_place(EWL_OBJECT(next_pane),
+ grabber_pos_new + grabber_size,
+ CURRENT_Y(p),
+ next_grabber_pos - grabber_pos_new
+ - grabber_size,
+ CURRENT_H(p));
}
else {
- ewl_object_place(EWL_OBJECT(prev_pane),
- CURRENT_X(p),
- prev_grabber_pos,
- CURRENT_W(p),
- grabber_pos_new - prev_grabber_pos);
- ewl_object_place(EWL_OBJECT(w),
- CURRENT_X(p),
- grabber_pos_new,
- CURRENT_W(p),
- grabber_size);
- ewl_object_place(EWL_OBJECT(next_pane),
- CURRENT_X(p),
- grabber_pos_new + grabber_size,
- CURRENT_W(p),
- next_grabber_pos - grabber_pos_new
- - grabber_size);
+ ewl_object_place(EWL_OBJECT(prev_pane),
+ CURRENT_X(p),
+ prev_grabber_pos,
+ CURRENT_W(p),
+ grabber_pos_new - prev_grabber_pos);
+ ewl_object_place(EWL_OBJECT(w),
+ CURRENT_X(p),
+ grabber_pos_new,
+ CURRENT_W(p),
+ grabber_size);
+ ewl_object_place(EWL_OBJECT(next_pane),
+ CURRENT_X(p),
+ grabber_pos_new + grabber_size,
+ CURRENT_W(p),
+ next_grabber_pos - grabber_pos_new
+ - grabber_size);
}
/* send a value_changed callback to signal something moved */
@@ -1399,7 +1399,7 @@ ewl_paned_layout_setup(void)
horizontal_layout = NEW(Ewl_Paned_Layout, 1);
if (!horizontal_layout)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
horizontal_layout->minimum_size = ewl_object_minimum_w_get;
horizontal_layout->current_size = ewl_object_current_w_get;
@@ -1412,7 +1412,7 @@ ewl_paned_layout_setup(void)
vertical_layout = NEW(Ewl_Paned_Layout, 1);
if (!vertical_layout)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
vertical_layout->minimum_size = ewl_object_minimum_h_get;
vertical_layout->current_size = ewl_object_current_h_get;
diff --git a/src/lib/ewl_paned.h b/src/lib/ewl_paned.h
index 201a571..864e726 100644
--- a/src/lib/ewl_paned.h
+++ b/src/lib/ewl_paned.h
@@ -69,14 +69,14 @@ typedef struct Ewl_Paned Ewl_Paned;
*/
struct Ewl_Paned
{
- Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Orientation orientation; /**< The orientation of the paned */
-
- int last_pos; /**< the last position */
- int last_size; /**< the last size */
- Ewl_Widget *last_pane; /**< a pointer to the last resized pane */
- Ewl_Paned_Size_Info *info; /**< The extra infos for the children */
- int info_size; /**< The size of the info array */
+ Ewl_Container container; /**< Inherit from Ewl_Container */
+ Ewl_Orientation orientation; /**< The orientation of the paned */
+
+ int last_pos; /**< the last position */
+ int last_size; /**< the last size */
+ Ewl_Widget *last_pane; /**< a pointer to the last resized pane */
+ Ewl_Paned_Size_Info *info; /**< The extra infos for the children */
+ int info_size; /**< The size of the info array */
unsigned short updating_grabbers:1; /**< are we updating the grabbers */
unsigned short new_panes:1; /**< are there new visible panes */
};
@@ -84,31 +84,31 @@ struct Ewl_Paned
Ewl_Widget *ewl_paned_new(void);
Ewl_Widget *ewl_hpaned_new(void);
Ewl_Widget *ewl_vpaned_new(void);
-int ewl_paned_init(Ewl_Paned *p);
+int ewl_paned_init(Ewl_Paned *p);
-void ewl_paned_orientation_set(Ewl_Paned *p, Ewl_Orientation o);
+void ewl_paned_orientation_set(Ewl_Paned *p, Ewl_Orientation o);
Ewl_Orientation ewl_paned_orientation_get(Ewl_Paned *p);
-void ewl_paned_initial_size_set(Ewl_Paned *p, Ewl_Widget *child,
- int size);
-int ewl_paned_initial_size_get(Ewl_Paned *p, Ewl_Widget *child);
+void ewl_paned_initial_size_set(Ewl_Paned *p, Ewl_Widget *child,
+ int size);
+int ewl_paned_initial_size_get(Ewl_Paned *p, Ewl_Widget *child);
-void ewl_paned_fixed_size_set(Ewl_Paned *p, Ewl_Widget *child,
- unsigned int fixed);
+void ewl_paned_fixed_size_set(Ewl_Paned *p, Ewl_Widget *child,
+ unsigned int fixed);
unsigned int ewl_paned_fixed_size_get(Ewl_Paned *p, Ewl_Widget *child);
-void ewl_paned_arrange(Ewl_Paned *p, int pane_num);
+void ewl_paned_arrange(Ewl_Paned *p, int pane_num);
/*
* Internal functions. Override at your risk.
*/
Ewl_Paned_Size_Info *ewl_paned_size_info_add(Ewl_Paned *p, Ewl_Widget *w);
Ewl_Paned_Size_Info *ewl_paned_size_info_get(Ewl_Paned *p, Ewl_Widget *w);
-void ewl_paned_size_info_del(Ewl_Paned *p, Ewl_Widget *w);
+void ewl_paned_size_info_del(Ewl_Paned *p, Ewl_Widget *w);
void ewl_paned_cb_child_add(Ewl_Container *c, Ewl_Widget *w);
void ewl_paned_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx);
void ewl_paned_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_paned_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
void ewl_paned_cb_child_hide(Ewl_Container *c, Ewl_Widget *w);
void ewl_paned_cb_configure(Ewl_Widget *w, void *ev, void *data);
@@ -146,19 +146,19 @@ typedef struct Ewl_Paned_Grabber Ewl_Paned_Grabber;
*/
struct Ewl_Paned_Grabber
{
- Ewl_Separator separator; /**< Inherit from the separator */
- unsigned int placed:1; /**< Has the grabber been placed already? */
+ Ewl_Separator separator; /**< Inherit from the separator */
+ unsigned int placed:1; /**< Has the grabber been placed already? */
};
Ewl_Widget *ewl_paned_grabber_new(void);
-int ewl_paned_grabber_init(Ewl_Paned_Grabber *g);
+int ewl_paned_grabber_init(Ewl_Paned_Grabber *g);
-void ewl_paned_grabber_paned_orientation_set(Ewl_Paned_Grabber *g,
- Ewl_Orientation o);
+void ewl_paned_grabber_paned_orientation_set(Ewl_Paned_Grabber *g,
+ Ewl_Orientation o);
Ewl_Orientation ewl_paned_grabber_orientation_get(Ewl_Paned_Grabber *g);
-void ewl_paned_grabber_show_cursor_for(Ewl_Paned_Grabber *g,
- unsigned int dir);
+void ewl_paned_grabber_show_cursor_for(Ewl_Paned_Grabber *g,
+ unsigned int dir);
/**
* @}
diff --git a/src/lib/ewl_popup.c b/src/lib/ewl_popup.c
index 4a72bd4..30b43ba 100644
--- a/src/lib/ewl_popup.c
+++ b/src/lib/ewl_popup.c
@@ -25,11 +25,11 @@ ewl_popup_new(void)
p = NEW(Ewl_Popup, 1);
if (!p)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_popup_init(p)) {
- ewl_widget_destroy(EWL_WIDGET(p));
- p = NULL;
+ ewl_widget_destroy(EWL_WIDGET(p));
+ p = NULL;
}
DRETURN_PTR(EWL_WIDGET(p), DLEVEL_STABLE);
@@ -53,7 +53,7 @@ ewl_popup_init(Ewl_Popup *p)
w = EWL_WIDGET(p);
if (!ewl_window_init(EWL_WINDOW(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_POPUP_TYPE);
ewl_widget_appearance_set(w, EWL_POPUP_TYPE);
@@ -62,9 +62,9 @@ ewl_popup_init(Ewl_Popup *p)
ewl_window_override_set(EWL_WINDOW(p), TRUE);
ewl_container_show_notify_set(EWL_CONTAINER(p),
- ewl_popup_cb_child_show);
+ ewl_popup_cb_child_show);
ewl_container_resize_notify_set(EWL_CONTAINER(p),
- ewl_popup_cb_child_resize);
+ ewl_popup_cb_child_resize);
/*
* add the callbacks
@@ -72,9 +72,9 @@ ewl_popup_init(Ewl_Popup *p)
ewl_callback_append(w, EWL_CALLBACK_SHOW, ewl_popup_cb_show, NULL);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_popup_cb_show, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, ewl_popup_cb_mouse_move,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_popup_cb_destroy,
- NULL);
+ NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -129,21 +129,21 @@ ewl_popup_follow_set(Ewl_Popup *p, Ewl_Widget *w)
DCHECK_TYPE(p, EWL_POPUP_TYPE);
if (p->follow == w)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (p->follow) {
- ewl_callback_del_with_data(p->follow, EWL_CALLBACK_DESTROY,
- ewl_popup_cb_follow_destroy, p);
- ewl_callback_del_with_data(p->follow, EWL_CALLBACK_CONFIGURE,
- ewl_popup_cb_follow_configure,
- p);
+ ewl_callback_del_with_data(p->follow, EWL_CALLBACK_DESTROY,
+ ewl_popup_cb_follow_destroy, p);
+ ewl_callback_del_with_data(p->follow, EWL_CALLBACK_CONFIGURE,
+ ewl_popup_cb_follow_configure,
+ p);
}
if (w) {
- ewl_callback_prepend(w, EWL_CALLBACK_DESTROY,
- ewl_popup_cb_follow_destroy, p);
- ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_popup_cb_follow_configure, p);
+ ewl_callback_prepend(w, EWL_CALLBACK_DESTROY,
+ ewl_popup_cb_follow_destroy, p);
+ ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
+ ewl_popup_cb_follow_configure, p);
}
p->follow = w;
@@ -251,7 +251,7 @@ ewl_popup_offset_set(Ewl_Popup *p, int x, int y)
*/
void
ewl_popup_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -261,34 +261,34 @@ ewl_popup_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
ewl_popup_position_check(EWL_POPUP(w));
if (ewl_window_pointer_grab_get(EWL_WINDOW(w)))
- ewl_window_pointer_grab_set(EWL_WINDOW(w), TRUE);
+ ewl_window_pointer_grab_set(EWL_WINDOW(w), TRUE);
if (ewl_window_keyboard_grab_get(EWL_WINDOW(w)))
- ewl_window_keyboard_grab_set(EWL_WINDOW(w), TRUE);
+ ewl_window_keyboard_grab_set(EWL_WINDOW(w), TRUE);
/* Popups should be flagged as transient for their parent windows */
if (EWL_POPUP(w)->follow) {
- Ewl_Embed *emb;
- emb = ewl_embed_widget_find(EWL_POPUP(w)->follow);
- if (emb) {
- void *pwin = NULL;
- /*
- * If the followed window is transient, defer to that
- * window's parent
- */
- if (EWL_WINDOW_IS(emb)) {
- Ewl_Window *win = EWL_WINDOW(emb);
-
- if (win->flags & EWL_WINDOW_TRANSIENT)
- pwin = win->transient.ewl->window;
- else if (win->flags & EWL_WINDOW_TRANSIENT_FOREIGN)
- pwin = win->transient.foreign;
- }
-
- if (!pwin)
- pwin = emb->canvas_window;
- ewl_window_transient_for_foreign(EWL_WINDOW(w), pwin);
- }
+ Ewl_Embed *emb;
+ emb = ewl_embed_widget_find(EWL_POPUP(w)->follow);
+ if (emb) {
+ void *pwin = NULL;
+ /*
+ * If the followed window is transient, defer to that
+ * window's parent
+ */
+ if (EWL_WINDOW_IS(emb)) {
+ Ewl_Window *win = EWL_WINDOW(emb);
+
+ if (win->flags & EWL_WINDOW_TRANSIENT)
+ pwin = win->transient.ewl->window;
+ else if (win->flags & EWL_WINDOW_TRANSIENT_FOREIGN)
+ pwin = win->transient.foreign;
+ }
+
+ if (!pwin)
+ pwin = emb->canvas_window;
+ ewl_window_transient_for_foreign(EWL_WINDOW(w), pwin);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -304,7 +304,7 @@ ewl_popup_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_popup_cb_mouse_move(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Popup *p;
int dx, dy;
@@ -317,7 +317,7 @@ ewl_popup_cb_mouse_move(Ewl_Widget *w, void *ev_data __UNUSED__,
/* do we need to move the window? */
if (p->moving || !ewl_popup_move_direction_get(p, &dx, &dy))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* FIXME the time schouldn't be a hardcoded value */
ecore_timer_add(0.02, ewl_popup_move_timer, p);
@@ -345,8 +345,8 @@ ewl_popup_move_timer(void *data)
p = EWL_POPUP(data);
if (!ewl_popup_move_direction_get(p, &dx, &dy)) {
- ewl_popup_move_stop(p);
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ ewl_popup_move_stop(p);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
/* FIXME the velocity should be configurable and not hardcoded */
@@ -389,22 +389,22 @@ ewl_popup_move_direction_get(Ewl_Popup *p, int *dx, int *dy)
/* check if the mouse is inside of the popup */
if (x < 0 || y < 0 || x > CURRENT_W(p) || y > CURRENT_H(p))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
/* and now determine the directions of the move */
if (mx <= 0)
- *dx = 1;
+ *dx = 1;
else if (mx >= dw - 1)
- *dx = -1;
+ *dx = -1;
else
- *dx = 0;
+ *dx = 0;
if (my <= 0)
- *dy = 1;
+ *dy = 1;
else if (my >= dh - 1)
- *dy = -1;
+ *dy = -1;
else
- *dy = 0;
+ *dy = 0;
/* if both are 0 the window doesn't need to be moved */
DRETURN_INT((*dx != 0 || *dy != 0), DLEVEL_STABLE);
@@ -434,11 +434,11 @@ ewl_popup_move(Ewl_Popup *p, int dx, int dy)
p->moving = TRUE;
/* move the follow, too, if it is a popup child */
if (p->follow) {
- Ewl_Embed *e;
+ Ewl_Embed *e;
- e = ewl_embed_widget_find(EWL_WIDGET(p->follow));
- if (EWL_POPUP_IS(e))
- ewl_popup_move(EWL_POPUP(e), dx, dy);
+ e = ewl_embed_widget_find(EWL_WIDGET(p->follow));
+ if (EWL_POPUP_IS(e))
+ ewl_popup_move(EWL_POPUP(e), dx, dy);
}
ewl_window_move(EWL_WINDOW(p), x, y);
@@ -463,11 +463,11 @@ ewl_popup_move_stop(Ewl_Popup *p)
/* stop moving the follow, too, if it is a popup child */
if (p->follow) {
- Ewl_Embed *e;
+ Ewl_Embed *e;
- e = ewl_embed_widget_find(EWL_WIDGET(p->follow));
- if (EWL_POPUP_IS(e))
- ewl_popup_move_stop(EWL_POPUP(e));
+ e = ewl_embed_widget_find(EWL_WIDGET(p->follow));
+ if (EWL_POPUP_IS(e))
+ ewl_popup_move_stop(EWL_POPUP(e));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -483,7 +483,7 @@ ewl_popup_move_stop(Ewl_Popup *p)
*/
void
ewl_popup_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Popup *p;
@@ -493,8 +493,8 @@ ewl_popup_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
p = EWL_POPUP(w);
if (p->follow)
- ewl_callback_del_with_data(p->follow, EWL_CALLBACK_DESTROY,
- ewl_popup_cb_follow_destroy, p);
+ ewl_callback_del_with_data(p->follow, EWL_CALLBACK_DESTROY,
+ ewl_popup_cb_follow_destroy, p);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -509,7 +509,7 @@ ewl_popup_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_popup_cb_follow_configure(Ewl_Widget *w __UNUSED__,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
Ewl_Popup *p;
@@ -534,7 +534,7 @@ ewl_popup_cb_follow_configure(Ewl_Widget *w __UNUSED__,
*/
void
ewl_popup_cb_follow_destroy(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Popup *p;
@@ -546,7 +546,7 @@ ewl_popup_cb_follow_destroy(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
p->follow = NULL;
if (p->type != EWL_POPUP_TYPE_NONE)
- ewl_widget_hide(EWL_WIDGET(p));
+ ewl_widget_hide(EWL_WIDGET(p));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -605,59 +605,59 @@ ewl_popup_position_check(Ewl_Popup *p)
DCHECK_TYPE(p, EWL_POPUP_TYPE);
if (p->type == EWL_POPUP_TYPE_NONE || p->moving)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (p->follow) {
- Ewl_Embed *emb;
+ Ewl_Embed *emb;
- emb = ewl_embed_widget_find(p->follow);
- ewl_embed_desktop_size_get(emb, &desk_w, &desk_h);
- ewl_embed_window_position_get(emb, &win_x, &win_y);
+ emb = ewl_embed_widget_find(p->follow);
+ ewl_embed_desktop_size_get(emb, &desk_w, &desk_h);
+ ewl_embed_window_position_get(emb, &win_x, &win_y);
}
else
- ewl_embed_desktop_size_get(EWL_EMBED(p), &desk_w, &desk_h);
+ ewl_embed_desktop_size_get(EWL_EMBED(p), &desk_w, &desk_h);
if (p->type == EWL_POPUP_TYPE_MOUSE) {
- x = win_x + p->mouse.x;
- y = win_y + p->mouse.y;
-
- if (x + p->offset.x + CURRENT_W(p) > desk_w)
- x -= p->offset.x + CURRENT_W(p);
- else
- x += p->offset.x;
-
- if (y + p->offset.y + CURRENT_H(p) > desk_h)
- y -= p->offset.y + CURRENT_H(p);
- else
- y += p->offset.y;
+ x = win_x + p->mouse.x;
+ y = win_y + p->mouse.y;
+
+ if (x + p->offset.x + CURRENT_W(p) > desk_w)
+ x -= p->offset.x + CURRENT_W(p);
+ else
+ x += p->offset.x;
+
+ if (y + p->offset.y + CURRENT_H(p) > desk_h)
+ y -= p->offset.y + CURRENT_H(p);
+ else
+ y += p->offset.y;
}
else if (p->type == EWL_POPUP_TYPE_MENU_VERTICAL) {
- x = win_x + CURRENT_X(p->follow);
- y = win_y + CURRENT_Y(p->follow);
+ x = win_x + CURRENT_X(p->follow);
+ y = win_y + CURRENT_Y(p->follow);
- if (x + CURRENT_W(p) > desk_w && x > desk_w / 2)
- x = desk_w - CURRENT_W(p);
+ if (x + CURRENT_W(p) > desk_w && x > desk_w / 2)
+ x = desk_w - CURRENT_W(p);
- if (y + CURRENT_H(p->follow) + CURRENT_H(p) > desk_h
- && y > desk_h / 2)
- y -= CURRENT_H(p);
- else
- y += CURRENT_H(p->follow);
+ if (y + CURRENT_H(p->follow) + CURRENT_H(p) > desk_h
+ && y > desk_h / 2)
+ y -= CURRENT_H(p);
+ else
+ y += CURRENT_H(p->follow);
}
else if (p->type == EWL_POPUP_TYPE_MENU_HORIZONTAL) {
- x = win_x + CURRENT_X(p->follow);
- y = win_y + CURRENT_Y(p->follow);
+ x = win_x + CURRENT_X(p->follow);
+ y = win_y + CURRENT_Y(p->follow);
- if (x + CURRENT_W(p->follow) + CURRENT_W(p) > desk_w
- && x > desk_w / 2)
- x -= CURRENT_W(p);
- else
- x += CURRENT_W(p->follow);
+ if (x + CURRENT_W(p->follow) + CURRENT_W(p) > desk_w
+ && x > desk_w / 2)
+ x -= CURRENT_W(p);
+ else
+ x += CURRENT_W(p->follow);
- if (y + CURRENT_H(p) > desk_h && y > desk_h / 2)
- y = desk_h - CURRENT_H(p);
+ if (y + CURRENT_H(p) > desk_h && y > desk_h / 2)
+ y = desk_h - CURRENT_H(p);
}
ewl_window_move(EWL_WINDOW(p), x, y);
@@ -673,13 +673,13 @@ ewl_popup_size_check(Ewl_Popup *p)
DCHECK_TYPE(p, EWL_POPUP_TYPE);
if (!p->follow || p->type == EWL_POPUP_TYPE_NONE || !p->fit_to_follow)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (p->type == EWL_POPUP_TYPE_MENU_VERTICAL)
- ewl_object_w_request(EWL_OBJECT(p), CURRENT_W(p->follow));
+ ewl_object_w_request(EWL_OBJECT(p), CURRENT_W(p->follow));
else if (p->type == EWL_POPUP_TYPE_MENU_HORIZONTAL)
- ewl_object_h_request(EWL_OBJECT(p), CURRENT_H(p->follow));
+ ewl_object_h_request(EWL_OBJECT(p), CURRENT_H(p->follow));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_popup.h b/src/lib/ewl_popup.h
index be4b6ef..696a714 100644
--- a/src/lib/ewl_popup.h
+++ b/src/lib/ewl_popup.h
@@ -46,26 +46,26 @@ struct Ewl_Popup
Ewl_Window window; /**< Inherit from Ewl_Window */
Ewl_Popup_Type type; /**< The Popup type */
- Ewl_Widget *follow; /**< The object to follow */
+ Ewl_Widget *follow; /**< The object to follow */
struct {
- int x; /**< The x position */
- int y; /**< The y position */
+ int x; /**< The x position */
+ int y; /**< The y position */
} mouse, offset;
- int fit_to_follow:1; /**< if the popup fits the size to its follow*/
- int moving:1; /**< if the popup is currently moving */
+ int fit_to_follow:1; /**< if the popup fits the size to its follow*/
+ int moving:1; /**< if the popup is currently moving */
};
Ewl_Widget *ewl_popup_new(void);
-int ewl_popup_init(Ewl_Popup *p);
-void ewl_popup_type_set(Ewl_Popup *p, Ewl_Popup_Type type);
+int ewl_popup_init(Ewl_Popup *p);
+void ewl_popup_type_set(Ewl_Popup *p, Ewl_Popup_Type type);
Ewl_Popup_Type ewl_popup_type_get(Ewl_Popup *p);
-void ewl_popup_follow_set(Ewl_Popup *p, Ewl_Widget *w);
+void ewl_popup_follow_set(Ewl_Popup *p, Ewl_Widget *w);
Ewl_Widget *ewl_popup_follow_get(Ewl_Popup *p);
-void ewl_popup_fit_to_follow_set(Ewl_Popup *p, int fit);
-int ewl_popup_fit_to_follow_get(Ewl_Popup *p);
+void ewl_popup_fit_to_follow_set(Ewl_Popup *p, int fit);
+int ewl_popup_fit_to_follow_get(Ewl_Popup *p);
-void ewl_popup_mouse_position_set(Ewl_Popup *p, int x, int y);
-void ewl_popup_offset_set(Ewl_Popup *p, int x, int y);
+void ewl_popup_mouse_position_set(Ewl_Popup *p, int x, int y);
+void ewl_popup_offset_set(Ewl_Popup *p, int x, int y);
/*
* Internal, override at your own risk
@@ -74,11 +74,11 @@ void ewl_popup_cb_show(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_popup_cb_mouse_move(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_popup_cb_destroy(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_popup_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
void ewl_popup_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_popup_cb_follow_destroy(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_popup_cb_follow_configure(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @}
diff --git a/src/lib/ewl_progressbar.c b/src/lib/ewl_progressbar.c
index f39decc..fc39420 100644
--- a/src/lib/ewl_progressbar.c
+++ b/src/lib/ewl_progressbar.c
@@ -21,11 +21,11 @@ ewl_progressbar_new(void)
p = NEW(Ewl_Progressbar, 1);
if (!p)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_progressbar_init(p)) {
- ewl_widget_destroy(EWL_WIDGET(p));
- p = NULL;
+ ewl_widget_destroy(EWL_WIDGET(p));
+ p = NULL;
}
DRETURN_PTR(EWL_WIDGET(p), DLEVEL_STABLE);
@@ -47,22 +47,22 @@ ewl_progressbar_init(Ewl_Progressbar *p)
w = EWL_WIDGET(p);
if (!ewl_range_init(EWL_RANGE(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_PROGRESSBAR_TYPE);
ewl_widget_inherit(w, EWL_PROGRESSBAR_TYPE);
ewl_container_show_notify_set(EWL_CONTAINER(w),
- ewl_progressbar_cb_child_show);
+ ewl_progressbar_cb_child_show);
ewl_container_resize_notify_set(EWL_CONTAINER(w),
- ewl_progressbar_cb_child_resize);
+ ewl_progressbar_cb_child_resize);
p->bar = NEW(Ewl_Widget, 1);
if (!p->bar)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
if (!ewl_widget_init(p->bar))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(p->bar, "progressbar_bar");
ewl_container_child_append(EWL_CONTAINER(p), p->bar);
@@ -78,12 +78,12 @@ ewl_progressbar_init(Ewl_Progressbar *p)
p->auto_label = TRUE;
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_progressbar_cb_configure, NULL);
+ ewl_progressbar_cb_configure, NULL);
ewl_callback_append(w, EWL_CALLBACK_VALUE_CHANGED,
- ewl_progressbar_cb_value_changed, NULL);
+ ewl_progressbar_cb_value_changed, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_VSHRINK);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -104,7 +104,7 @@ ewl_progressbar_label_set(Ewl_Progressbar *p, char *label)
p->auto_label = FALSE;
if (label)
- ewl_label_text_set(EWL_LABEL(p->label), label);
+ ewl_label_text_set(EWL_LABEL(p->label), label);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -129,8 +129,8 @@ ewl_progressbar_custom_label_set(Ewl_Progressbar *p, char *format_string)
r = EWL_RANGE(p);
if (format_string) {
- snprintf (label, PATH_MAX, format_string, r->value, r->max_val);
- ewl_label_text_set(EWL_LABEL(p->label), label);
+ snprintf (label, PATH_MAX, format_string, r->value, r->max_val);
+ ewl_label_text_set(EWL_LABEL(p->label), label);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -183,7 +183,7 @@ ewl_progressbar_label_show (Ewl_Progressbar *p)
*/
void
ewl_progressbar_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Progressbar *p;
Ewl_Range *r;
@@ -204,13 +204,13 @@ ewl_progressbar_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
dw = dw * (r->value - r->min_val) / (r->max_val - r->min_val);
if (r->invert){
- dx += CURRENT_W(p) - dw;
+ dx += CURRENT_W(p) - dw;
}
ewl_object_geometry_request(EWL_OBJECT(p->bar), dx, CURRENT_Y(p),
- dw, CURRENT_H(p));
+ dw, CURRENT_H(p));
ewl_object_place (EWL_OBJECT(p->label), CURRENT_X(p),CURRENT_Y(p),
- CURRENT_W(p), CURRENT_H(p));
+ CURRENT_W(p), CURRENT_H(p));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -225,7 +225,7 @@ ewl_progressbar_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_progressbar_cb_value_changed(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Progressbar *p;
Ewl_Range *r;
@@ -238,13 +238,13 @@ ewl_progressbar_cb_value_changed(Ewl_Widget *w, void *ev_data __UNUSED__,
r = EWL_RANGE(p);
if (p->auto_label) {
- char c[10];
- /*
- * Do a precentage calculation as a default label.
- */
- snprintf (c, sizeof (c), "%.0lf%%", (r->value /
- (r->max_val - r->min_val)) * 100);
- ewl_label_text_set(EWL_LABEL(p->label), c);
+ char c[10];
+ /*
+ * Do a precentage calculation as a default label.
+ */
+ snprintf (c, sizeof (c), "%.0lf%%", (r->value /
+ (r->max_val - r->min_val)) * 100);
+ ewl_label_text_set(EWL_LABEL(p->label), c);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -264,17 +264,17 @@ ewl_progressbar_child_handle(Ewl_Container *c)
value = r->step / (r->max_val - r->min_val);
if (value < 0.01 || ewl_range_unknown_get(r)) {
- value = 0.01;
- ewl_widget_state_set(EWL_WIDGET(c), "range-unknown",
- EWL_STATE_PERSISTENT);
+ value = 0.01;
+ ewl_widget_state_set(EWL_WIDGET(c), "range-unknown",
+ EWL_STATE_PERSISTENT);
}
ewl_object_preferred_inner_w_set (EWL_OBJECT(c),
- ewl_object_preferred_w_get(
- EWL_OBJECT(EWL_PROGRESSBAR(c)->bar)) / value);
+ ewl_object_preferred_w_get(
+ EWL_OBJECT(EWL_PROGRESSBAR(c)->bar)) / value);
ewl_container_largest_prefer(EWL_CONTAINER(c),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -309,8 +309,8 @@ ewl_progressbar_cb_child_show(Ewl_Container *c, Ewl_Widget *w __UNUSED__)
*/
void
ewl_progressbar_cb_child_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
- int size __UNUSED__,
- Ewl_Orientation o __UNUSED__)
+ int size __UNUSED__,
+ Ewl_Orientation o __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
diff --git a/src/lib/ewl_progressbar.h b/src/lib/ewl_progressbar.h
index 25d7fdf..31d5f8e 100644
--- a/src/lib/ewl_progressbar.h
+++ b/src/lib/ewl_progressbar.h
@@ -55,30 +55,30 @@ struct Ewl_Progressbar
Ewl_Range range; /**< Inherit from Ewl_Range */
Ewl_Widget *bar; /**< The moving bar on top */
Ewl_Widget *label; /**< text label on the bar */
- int auto_label; /**< flag if user is setting label or not */
+ int auto_label; /**< flag if user is setting label or not */
};
Ewl_Widget *ewl_progressbar_new(void);
-int ewl_progressbar_init(Ewl_Progressbar *p);
+int ewl_progressbar_init(Ewl_Progressbar *p);
-void ewl_progressbar_label_set(Ewl_Progressbar *p, char *label);
-void ewl_progressbar_custom_label_set(Ewl_Progressbar *p,
- char *format_string);
+void ewl_progressbar_label_set(Ewl_Progressbar *p, char *label);
+void ewl_progressbar_custom_label_set(Ewl_Progressbar *p,
+ char *format_string);
-void ewl_progressbar_label_show(Ewl_Progressbar *p);
-void ewl_progressbar_label_hide(Ewl_Progressbar *p);
+void ewl_progressbar_label_show(Ewl_Progressbar *p);
+void ewl_progressbar_label_hide(Ewl_Progressbar *p);
/*
* Internally used callbacks, override at your own risk.
*/
void ewl_progressbar_cb_configure(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_progressbar_cb_value_changed(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_progressbar_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_progressbar_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
/**
* @}
diff --git a/src/lib/ewl_radiobutton.c b/src/lib/ewl_radiobutton.c
index 2c7d658..63f942f 100644
--- a/src/lib/ewl_radiobutton.c
+++ b/src/lib/ewl_radiobutton.c
@@ -18,11 +18,11 @@ ewl_radiobutton_new(void)
b = NEW(Ewl_Radiobutton, 1);
if (!b)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_radiobutton_init(b)) {
- ewl_widget_destroy(EWL_WIDGET(b));
- b = NULL;
+ ewl_widget_destroy(EWL_WIDGET(b));
+ b = NULL;
}
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
@@ -49,15 +49,15 @@ ewl_radiobutton_init(Ewl_Radiobutton *rb)
w = EWL_WIDGET(rb);
if (!ewl_checkbutton_init(cb))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_RADIOBUTTON_TYPE);
ewl_widget_inherit(w, EWL_RADIOBUTTON_TYPE);
ewl_widget_appearance_set(cb->check, "radio");
ewl_callback_append(w, EWL_CALLBACK_CLICKED, ewl_radiobutton_cb_clicked,
- NULL);
+ NULL);
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_radiobutton_cb_destroy,
- NULL);
+ NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -117,14 +117,14 @@ ewl_radiobutton_chain_set(Ewl_Radiobutton *rb, Ewl_Radiobutton *crb)
* If a chain doesnt exist, create one
*/
if (!crb->chain) {
- crb->chain = ecore_list_new();
+ crb->chain = ecore_list_new();
- ecore_list_append(crb->chain, rb);
- ecore_list_append(crb->chain, crb);
+ ecore_list_append(crb->chain, rb);
+ ecore_list_append(crb->chain, crb);
} else {
- if (!ecore_list_goto(crb->chain, rb))
- ecore_list_append(crb->chain, rb);
+ if (!ecore_list_goto(crb->chain, rb))
+ ecore_list_append(crb->chain, rb);
}
rb->chain = crb->chain;
@@ -149,18 +149,18 @@ ewl_radiobutton_chain_selected_get(Ewl_Radiobutton *rb)
/* if there is no chain or the chain is empty we have to
* treat it special */
if (!rb->chain || ecore_list_empty_is(rb->chain)) {
- if (ewl_checkbutton_is_checked(EWL_CHECKBUTTON(rb))) {
- DRETURN_PTR(rb, DLEVEL_STABLE);
- }
- else {
- DRETURN_PTR(NULL, DLEVEL_STABLE);
- }
+ if (ewl_checkbutton_is_checked(EWL_CHECKBUTTON(rb))) {
+ DRETURN_PTR(rb, DLEVEL_STABLE);
+ }
+ else {
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
+ }
}
ecore_list_first_goto(rb->chain);
while ((c = ecore_list_next(rb->chain))) {
- if (ewl_checkbutton_is_checked(c))
- DRETURN_PTR(c, DLEVEL_STABLE);
+ if (ewl_checkbutton_is_checked(c))
+ DRETURN_PTR(c, DLEVEL_STABLE);
}
DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -176,7 +176,7 @@ ewl_radiobutton_chain_selected_get(Ewl_Radiobutton *rb)
*/
void
ewl_radiobutton_cb_clicked(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Checkbutton *cb;
Ewl_Radiobutton *rb;
@@ -191,17 +191,17 @@ ewl_radiobutton_cb_clicked(Ewl_Widget *w, void *ev_data __UNUSED__,
oc = ewl_checkbutton_is_checked(cb);
if (rb->chain && !ecore_list_empty_is(rb->chain)) {
- Ewl_Checkbutton *c;
+ Ewl_Checkbutton *c;
- ecore_list_first_goto(rb->chain);
- while ((c = ecore_list_next(rb->chain))) {
- ewl_checkbutton_checked_set(c, 0);
- }
+ ecore_list_first_goto(rb->chain);
+ while ((c = ecore_list_next(rb->chain))) {
+ ewl_checkbutton_checked_set(c, 0);
+ }
}
ewl_checkbutton_checked_set(cb, 1);
if (oc != ewl_checkbutton_is_checked(cb))
- ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED);
+ ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -216,7 +216,7 @@ ewl_radiobutton_cb_clicked(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_radiobutton_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Radiobutton *rb;
@@ -227,13 +227,13 @@ ewl_radiobutton_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
rb = EWL_RADIOBUTTON(w);
if (!rb->chain)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ecore_list_goto(rb->chain, w);
ecore_list_remove(rb->chain);
if (ecore_list_empty_is(rb->chain))
- IF_FREE_LIST(rb->chain);
+ IF_FREE_LIST(rb->chain);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_radiobutton.h b/src/lib/ewl_radiobutton.h
index 3f981a8..f791457 100644
--- a/src/lib/ewl_radiobutton.h
+++ b/src/lib/ewl_radiobutton.h
@@ -58,12 +58,12 @@ struct Ewl_Radiobutton
};
Ewl_Widget *ewl_radiobutton_new(void);
-int ewl_radiobutton_init(Ewl_Radiobutton *rb);
+int ewl_radiobutton_init(Ewl_Radiobutton *rb);
-void ewl_radiobutton_value_set(Ewl_Radiobutton *rb, void *v);
-void *ewl_radiobutton_value_get(Ewl_Radiobutton *rb);
+void ewl_radiobutton_value_set(Ewl_Radiobutton *rb, void *v);
+void *ewl_radiobutton_value_get(Ewl_Radiobutton *rb);
-void ewl_radiobutton_chain_set(Ewl_Radiobutton *rb, Ewl_Radiobutton *crb);
+void ewl_radiobutton_chain_set(Ewl_Radiobutton *rb, Ewl_Radiobutton *crb);
Ewl_Radiobutton *ewl_radiobutton_chain_selected_get(Ewl_Radiobutton *rb);
/**
diff --git a/src/lib/ewl_range.c b/src/lib/ewl_range.c
index 58b732d..6ebf426 100644
--- a/src/lib/ewl_range.c
+++ b/src/lib/ewl_range.c
@@ -25,7 +25,7 @@ ewl_range_init(Ewl_Range *r)
w = EWL_WIDGET(r);
if (!ewl_container_init(EWL_CONTAINER(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_RANGE_TYPE);
@@ -56,15 +56,15 @@ ewl_range_value_set(Ewl_Range *r, double v)
DCHECK_TYPE(r, EWL_RANGE_TYPE);
if (r->value == v)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!r->unknown_range) {
- if (v < r->min_val)
- r->value = r->min_val;
- else if (v > r->max_val)
- r->value = r->max_val;
- else
- r->value = v;
+ if (v < r->min_val)
+ r->value = r->min_val;
+ else if (v > r->max_val)
+ r->value = r->max_val;
+ else
+ r->value = v;
}
ewl_callback_call(EWL_WIDGET(r), EWL_CALLBACK_VALUE_CHANGED);
@@ -108,7 +108,7 @@ ewl_range_minimum_value_set(Ewl_Range *r, double minv)
/* update to the min value if needed */
if (r->value < r->min_val)
- ewl_range_value_set(r, r->min_val);
+ ewl_range_value_set(r, r->min_val);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -147,7 +147,7 @@ ewl_range_maximum_value_set(Ewl_Range *r, double maxv)
/* update to max value if needed */
if (r->value > r->max_val)
- ewl_range_value_set(r, r->max_val);
+ ewl_range_value_set(r, r->max_val);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -183,7 +183,7 @@ ewl_range_step_set(Ewl_Range *r, double step)
DCHECK_TYPE(r, EWL_RANGE_TYPE);
if (step > r->max_val - r->min_val)
- step = r->max_val - r->min_val;
+ step = r->max_val - r->min_val;
r->step = step;
@@ -221,8 +221,8 @@ ewl_range_invert_set(Ewl_Range *r, unsigned int invert)
if (r->invert != !!invert)
{
- r->invert = !!invert;
- ewl_widget_configure(EWL_WIDGET(r));
+ r->invert = !!invert;
+ ewl_widget_configure(EWL_WIDGET(r));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -257,8 +257,8 @@ ewl_range_unknown_set(Ewl_Range *r, unsigned int unknown)
DCHECK_TYPE(r, EWL_RANGE_TYPE);
if (r->unknown_range != !!unknown) {
- r->unknown_range = !!unknown;
- ewl_widget_configure(EWL_WIDGET(r));
+ r->unknown_range = !!unknown;
+ ewl_widget_configure(EWL_WIDGET(r));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_range.h b/src/lib/ewl_range.h
index 62457f6..36d72d3 100644
--- a/src/lib/ewl_range.h
+++ b/src/lib/ewl_range.h
@@ -55,28 +55,28 @@ struct Ewl_Range
unsigned int unknown_range:1; /**< Unknown range */
};
-int ewl_range_init(Ewl_Range *r);
+int ewl_range_init(Ewl_Range *r);
-void ewl_range_value_set(Ewl_Range *r, double v);
-double ewl_range_value_get(Ewl_Range *r);
+void ewl_range_value_set(Ewl_Range *r, double v);
+double ewl_range_value_get(Ewl_Range *r);
-void ewl_range_minimum_value_set(Ewl_Range *r, double minv);
-double ewl_range_minimum_value_get(Ewl_Range *r);
+void ewl_range_minimum_value_set(Ewl_Range *r, double minv);
+double ewl_range_minimum_value_get(Ewl_Range *r);
-void ewl_range_maximum_value_set(Ewl_Range *r, double maxv);
-double ewl_range_maximum_value_get(Ewl_Range *r);
+void ewl_range_maximum_value_set(Ewl_Range *r, double maxv);
+double ewl_range_maximum_value_get(Ewl_Range *r);
-void ewl_range_step_set(Ewl_Range *r, double step);
-double ewl_range_step_get(Ewl_Range *r);
+void ewl_range_step_set(Ewl_Range *r, double step);
+double ewl_range_step_get(Ewl_Range *r);
-void ewl_range_unknown_set(Ewl_Range *r, unsigned int unknown);
+void ewl_range_unknown_set(Ewl_Range *r, unsigned int unknown);
unsigned int ewl_range_unknown_get(Ewl_Range *r);
-void ewl_range_invert_set(Ewl_Range *r, unsigned int invert);
+void ewl_range_invert_set(Ewl_Range *r, unsigned int invert);
unsigned int ewl_range_invert_get(Ewl_Range *r);
-void ewl_range_decrease(Ewl_Range *r);
-void ewl_range_increase(Ewl_Range *r);
+void ewl_range_decrease(Ewl_Range *r);
+void ewl_range_increase(Ewl_Range *r);
/**
* @}
diff --git a/src/lib/ewl_row.c b/src/lib/ewl_row.c
index 1e1a568..5c054da 100644
--- a/src/lib/ewl_row.c
+++ b/src/lib/ewl_row.c
@@ -20,11 +20,11 @@ ewl_row_new(void)
row = NEW(Ewl_Row, 1);
if (!row)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_row_init(EWL_ROW(row))) {
- ewl_widget_destroy(row);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(row);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(row, DLEVEL_STABLE);
@@ -44,7 +44,7 @@ ewl_row_init(Ewl_Row *row)
DCHECK_PARAM_PTR_RET(row, FALSE);
if (!ewl_container_init(EWL_CONTAINER(row)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(row), EWL_ROW_TYPE);
ewl_widget_inherit(EWL_WIDGET(row), EWL_ROW_TYPE);
@@ -52,14 +52,14 @@ ewl_row_init(Ewl_Row *row)
ewl_container_show_notify_set(EWL_CONTAINER(row), ewl_row_cb_child_show);
ewl_container_hide_notify_set(EWL_CONTAINER(row), ewl_row_cb_child_hide);
ewl_container_resize_notify_set(EWL_CONTAINER(row),
- ewl_row_cb_child_resize);
+ ewl_row_cb_child_resize);
ewl_object_fill_policy_set(EWL_OBJECT(row), EWL_FLAG_FILL_HFILL);
ewl_callback_append(EWL_WIDGET(row), EWL_CALLBACK_CONFIGURE,
- ewl_row_cb_configure, NULL);
+ ewl_row_cb_configure, NULL);
ewl_callback_append(EWL_WIDGET(row), EWL_CALLBACK_STATE_CHANGED,
- ewl_row_cb_state_changed, NULL);
+ ewl_row_cb_state_changed, NULL);
ewl_widget_focusable_set(EWL_WIDGET(row), FALSE);
@@ -83,17 +83,17 @@ ewl_row_header_set(Ewl_Row *row, Ewl_Container *header)
DCHECK_TYPE(row, EWL_ROW_TYPE);
if (row->header == header)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
row->header = header;
if (header) {
- ewl_object_fill_policy_set(EWL_OBJECT(row),
- EWL_FLAG_FILL_HFILL);
+ ewl_object_fill_policy_set(EWL_OBJECT(row),
+ EWL_FLAG_FILL_HFILL);
- ewl_widget_configure(EWL_WIDGET(header));
+ ewl_widget_configure(EWL_WIDGET(header));
}
else
- ewl_widget_configure(EWL_WIDGET(row));
+ ewl_widget_configure(EWL_WIDGET(row));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -128,7 +128,7 @@ ewl_row_column_get(Ewl_Row *row, short n)
*/
void
ewl_row_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Row *row;
Ewl_Container *c;
@@ -150,8 +150,8 @@ ewl_row_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
nodes = 0;
ewl_container_child_iterate_begin(c);
while ((child = EWL_OBJECT(ewl_container_child_next(c)))) {
- if (VISIBLE(child))
- nodes++;
+ if (VISIBLE(child))
+ nodes++;
}
ewl_container_child_iterate_begin(c);
@@ -161,90 +161,90 @@ ewl_row_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* for forming a table.
*/
if (row->header) {
- int width;
- Ewl_Container *hdr;
-
- hdr = row->header;
- ewl_container_child_iterate_begin(hdr);
-
- /*
- * Get the first child of the header.
- */
- align = EWL_OBJECT(ewl_container_child_next(hdr));
- if (align)
- x = MAX(ewl_object_current_x_get(align), CURRENT_X(w));
- else
- x = CURRENT_X(w);
-
- /*
- * Iterate over the children and position the header children.
- */
- ewl_container_child_iterate_begin(hdr);
- while ((child = EWL_OBJECT(ewl_container_child_next(c)))) {
- align = EWL_OBJECT(ewl_container_child_next(hdr));
- if (align && VISIBLE(align))
- width = ewl_object_current_x_get(align) +
- ewl_object_current_w_get(align) - x;
- else if (nodes)
- width = remains / nodes;
- else
- width = remains;
-
- /*
- * Request the necessary geometry then check what was
- * accepted to calculate remaining steps.
- */
- ewl_object_place(child, x, CURRENT_Y(w), width,
- CURRENT_H(w));
- width = ewl_object_current_w_get(child);
- x += width;
- remains -= width;
- nodes--;
- }
+ int width;
+ Ewl_Container *hdr;
+
+ hdr = row->header;
+ ewl_container_child_iterate_begin(hdr);
+
+ /*
+ * Get the first child of the header.
+ */
+ align = EWL_OBJECT(ewl_container_child_next(hdr));
+ if (align)
+ x = MAX(ewl_object_current_x_get(align), CURRENT_X(w));
+ else
+ x = CURRENT_X(w);
+
+ /*
+ * Iterate over the children and position the header children.
+ */
+ ewl_container_child_iterate_begin(hdr);
+ while ((child = EWL_OBJECT(ewl_container_child_next(c)))) {
+ align = EWL_OBJECT(ewl_container_child_next(hdr));
+ if (align && VISIBLE(align))
+ width = ewl_object_current_x_get(align) +
+ ewl_object_current_w_get(align) - x;
+ else if (nodes)
+ width = remains / nodes;
+ else
+ width = remains;
+
+ /*
+ * Request the necessary geometry then check what was
+ * accepted to calculate remaining steps.
+ */
+ ewl_object_place(child, x, CURRENT_Y(w), width,
+ CURRENT_H(w));
+ width = ewl_object_current_w_get(child);
+ x += width;
+ remains -= width;
+ nodes--;
+ }
}
/*
* In the uncommon case, we simply try to give out a fair amount of
* space.
*/
else {
- int tx = x;
- while ((child = EWL_OBJECT(ewl_container_child_next(c)))) {
- int portion;
-
- /*
- * Ask for the child to stay the current size for now.
- */
- portion = ewl_object_current_w_get(child);
- ewl_object_position_request(child, tx, CURRENT_Y(w));
- ewl_object_w_request(child, portion);
- ewl_object_h_request(child, CURRENT_H(w));
-
- remains -= portion;
- portion = ewl_object_current_w_get(child);
- tx = ewl_object_current_x_get(child) + portion;
- }
-
- /* Divvy up remaining space */
- if (remains) {
- tx = x;
- nodes = ecore_dlist_count(c->children);
- ecore_dlist_first_goto(c->children);
- while ((child = ecore_dlist_next(c->children))) {
- int portion;
- int width = ewl_object_current_w_get(child);
-
- if (nodes)
- portion = remains / nodes;
- else
- portion = remains;
- ewl_object_x_request(child, tx);
- ewl_object_w_request(child, portion + width);
- remains -= portion;
- portion = ewl_object_current_w_get(child);
- tx += portion;
- nodes--;
- }
- }
+ int tx = x;
+ while ((child = EWL_OBJECT(ewl_container_child_next(c)))) {
+ int portion;
+
+ /*
+ * Ask for the child to stay the current size for now.
+ */
+ portion = ewl_object_current_w_get(child);
+ ewl_object_position_request(child, tx, CURRENT_Y(w));
+ ewl_object_w_request(child, portion);
+ ewl_object_h_request(child, CURRENT_H(w));
+
+ remains -= portion;
+ portion = ewl_object_current_w_get(child);
+ tx = ewl_object_current_x_get(child) + portion;
+ }
+
+ /* Divvy up remaining space */
+ if (remains) {
+ tx = x;
+ nodes = ecore_dlist_count(c->children);
+ ecore_dlist_first_goto(c->children);
+ while ((child = ecore_dlist_next(c->children))) {
+ int portion;
+ int width = ewl_object_current_w_get(child);
+
+ if (nodes)
+ portion = remains / nodes;
+ else
+ portion = remains;
+ ewl_object_x_request(child, tx);
+ ewl_object_w_request(child, portion + width);
+ remains -= portion;
+ portion = ewl_object_current_w_get(child);
+ tx += portion;
+ nodes--;
+ }
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -260,7 +260,7 @@ ewl_row_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_row_cb_header_configure(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Row *row;
@@ -284,7 +284,7 @@ ewl_row_cb_header_configure(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
*/
void
ewl_row_cb_header_destroy(Ewl_Widget *w __UNUSED__,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
Ewl_Row *row;
@@ -319,7 +319,7 @@ ewl_row_cb_child_show(Ewl_Container *c, Ewl_Widget *w)
row = EWL_ROW(c);
ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
ewl_object_preferred_inner_w_set(EWL_OBJECT(c), PREFERRED_W(c) +
- ewl_object_preferred_w_get(EWL_OBJECT(w)));
+ ewl_object_preferred_w_get(EWL_OBJECT(w)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -345,7 +345,7 @@ ewl_row_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
row = EWL_ROW(c);
ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
ewl_object_preferred_inner_w_set(EWL_OBJECT(c), PREFERRED_W(c) -
- ewl_object_preferred_w_get(EWL_OBJECT(w)));
+ ewl_object_preferred_w_get(EWL_OBJECT(w)));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -361,7 +361,7 @@ ewl_row_cb_child_hide(Ewl_Container *c, Ewl_Widget *w)
*/
void
ewl_row_cb_child_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
- int size, Ewl_Orientation o)
+ int size, Ewl_Orientation o)
{
Ewl_Row *row;
@@ -371,10 +371,10 @@ ewl_row_cb_child_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
row = EWL_ROW(c);
if (o == EWL_ORIENTATION_VERTICAL)
- ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
+ ewl_container_largest_prefer(c, EWL_ORIENTATION_VERTICAL);
else
- ewl_object_preferred_inner_w_set(EWL_OBJECT(c),
- PREFERRED_W(c) + size);
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(c),
+ PREFERRED_W(c) + size);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -403,15 +403,15 @@ ewl_row_cb_state_changed(Ewl_Widget *w, void *ev, void *data __UNUSED__)
/* Only want this for selected signals */
if (!strcmp(e->state, "selected"))
- send_state = "parent,selected";
+ send_state = "parent,selected";
else if (!strcmp(e->state, "deselect"))
- send_state = "parent,deselect";
+ send_state = "parent,deselect";
else
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_container_child_iterate_begin(EWL_CONTAINER(w));
while ((o = ewl_container_child_next(EWL_CONTAINER(w))))
- ewl_widget_state_set(o, send_state, e->flag);
+ ewl_widget_state_set(o, send_state, e->flag);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_row.h b/src/lib/ewl_row.h
index a375147..7d38053 100644
--- a/src/lib/ewl_row.h
+++ b/src/lib/ewl_row.h
@@ -48,14 +48,14 @@ typedef struct Ewl_Row Ewl_Row;
*/
struct Ewl_Row
{
- Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Container *header; /**< The header row */
+ Ewl_Container container; /**< Inherit from Ewl_Container */
+ Ewl_Container *header; /**< The header row */
};
Ewl_Widget *ewl_row_new(void);
-int ewl_row_init(Ewl_Row *row);
+int ewl_row_init(Ewl_Row *row);
-void ewl_row_header_set(Ewl_Row *row, Ewl_Container *header);
+void ewl_row_header_set(Ewl_Row *row, Ewl_Container *header);
Ewl_Widget *ewl_row_column_get(Ewl_Row *row, short n);
/*
@@ -63,14 +63,14 @@ Ewl_Widget *ewl_row_column_get(Ewl_Row *row, short n);
*/
void ewl_row_cb_configure(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_row_cb_header_configure(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_row_cb_header_destroy(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_row_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_row_cb_child_hide(Ewl_Container *c, Ewl_Widget *w);
void ewl_row_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
/**
* @}
diff --git a/src/lib/ewl_scrollbar.c b/src/lib/ewl_scrollbar.c
index ff18082..0d30772 100644
--- a/src/lib/ewl_scrollbar.c
+++ b/src/lib/ewl_scrollbar.c
@@ -23,14 +23,14 @@ ewl_scrollbar_new(void)
s = NEW(Ewl_Scrollbar, 1);
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
/*
* Initialize the objects fields.
*/
if (!ewl_scrollbar_init(s)) {
- ewl_widget_destroy(EWL_WIDGET(s));
- s = NULL;
+ ewl_widget_destroy(EWL_WIDGET(s));
+ s = NULL;
}
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
@@ -49,10 +49,10 @@ ewl_hscrollbar_new(void)
s = ewl_scrollbar_new();
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_scrollbar_orientation_set(EWL_SCROLLBAR(s),
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
}
@@ -70,10 +70,10 @@ ewl_vscrollbar_new(void)
s = ewl_scrollbar_new();
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_scrollbar_orientation_set(EWL_SCROLLBAR(s),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
}
@@ -94,13 +94,13 @@ ewl_scrollbar_init(Ewl_Scrollbar *s)
w = EWL_WIDGET(s);
if (!ewl_box_init(EWL_BOX(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(w), EWL_ORIENTATION_HORIZONTAL);
ewl_widget_appearance_set(w, "hscrollbar");
ewl_widget_inherit(w, EWL_SCROLLBAR_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HSHRINK);
/*
* Create the basic widgets that are contained in the scrollbar.
@@ -108,9 +108,9 @@ ewl_scrollbar_init(Ewl_Scrollbar *s)
s->decrement = ewl_button_new();
ewl_widget_internal_set(s->decrement, TRUE);
ewl_object_alignment_set(EWL_OBJECT(s->decrement),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_object_fill_policy_set(EWL_OBJECT(s->decrement),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_widget_show(s->decrement);
/*
@@ -119,9 +119,9 @@ ewl_scrollbar_init(Ewl_Scrollbar *s)
s->increment = ewl_button_new();
ewl_widget_internal_set(s->increment, TRUE);
ewl_object_alignment_set(EWL_OBJECT(s->increment),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_object_fill_policy_set(EWL_OBJECT(s->increment),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_widget_show(s->increment);
/*
@@ -131,7 +131,7 @@ ewl_scrollbar_init(Ewl_Scrollbar *s)
ewl_widget_internal_set(s->seeker, TRUE);
ewl_object_alignment_set(EWL_OBJECT(s->seeker), EWL_FLAG_ALIGN_CENTER);
ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
ewl_widget_show(s->seeker);
/*
@@ -139,23 +139,23 @@ ewl_scrollbar_init(Ewl_Scrollbar *s)
* events.
*/
ewl_callback_append(s->increment, EWL_CALLBACK_MOUSE_DOWN,
- ewl_scrollbar_cb_scroll_start, s);
+ ewl_scrollbar_cb_scroll_start, s);
ewl_callback_append(s->increment, EWL_CALLBACK_MOUSE_UP,
- ewl_scrollbar_cb_scroll_stop, s);
+ ewl_scrollbar_cb_scroll_stop, s);
ewl_callback_append(s->decrement, EWL_CALLBACK_MOUSE_DOWN,
- ewl_scrollbar_cb_scroll_start, s);
+ ewl_scrollbar_cb_scroll_start, s);
ewl_callback_append(s->decrement, EWL_CALLBACK_MOUSE_UP,
- ewl_scrollbar_cb_scroll_stop, s);
+ ewl_scrollbar_cb_scroll_stop, s);
ewl_callback_append(s->decrement, EWL_CALLBACK_DESTROY,
- ewl_scrollbar_cb_scroll_stop, s);
+ ewl_scrollbar_cb_scroll_stop, s);
/*
* Set the default alignment for the buttons.
*/
ewl_object_alignment_set(EWL_OBJECT(s->decrement),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_object_alignment_set(EWL_OBJECT(s->increment),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
/*
* Set the default amount of space that the seeker should fill.
@@ -172,7 +172,7 @@ ewl_scrollbar_init(Ewl_Scrollbar *s)
* moves.
*/
ewl_container_callback_notify(EWL_CONTAINER(s),
- EWL_CALLBACK_VALUE_CHANGED);
+ EWL_CALLBACK_VALUE_CHANGED);
/*
* Define the maximum value that the seeker can reach, and the
@@ -188,28 +188,28 @@ ewl_scrollbar_init(Ewl_Scrollbar *s)
ewl_widget_appearance_set(s->increment, "increment");
if (s->buttons_alignment & EWL_FLAG_ALIGN_LEFT) {
- /*
- * Place in decrement, increment, seeker order.
- */
- ewl_container_child_append(EWL_CONTAINER(s), s->decrement);
- ewl_container_child_append(EWL_CONTAINER(s), s->increment);
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ /*
+ * Place in decrement, increment, seeker order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s), s->decrement);
+ ewl_container_child_append(EWL_CONTAINER(s), s->increment);
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
}
else if (s->buttons_alignment & EWL_FLAG_ALIGN_RIGHT) {
- /*
- * Place in seeker, decrement, increment order.
- */
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- ewl_container_child_append(EWL_CONTAINER(s), s->decrement);
- ewl_container_child_append(EWL_CONTAINER(s), s->increment);
+ /*
+ * Place in seeker, decrement, increment order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ ewl_container_child_append(EWL_CONTAINER(s), s->decrement);
+ ewl_container_child_append(EWL_CONTAINER(s), s->increment);
}
else {
- /*
- * Place in decrement, seeker, increment order.
- */
- ewl_container_child_append(EWL_CONTAINER(s), s->decrement);
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- ewl_container_child_append(EWL_CONTAINER(s), s->increment);
+ /*
+ * Place in decrement, seeker, increment order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s), s->decrement);
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ ewl_container_child_append(EWL_CONTAINER(s), s->increment);
}
/*
@@ -234,7 +234,7 @@ ewl_scrollbar_orientation_set(Ewl_Scrollbar *s, Ewl_Orientation o)
DCHECK_TYPE(s, EWL_SCROLLBAR_TYPE);
if (o == ewl_box_orientation_get(EWL_BOX(s)))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(s), o);
@@ -244,25 +244,25 @@ ewl_scrollbar_orientation_set(Ewl_Scrollbar *s, Ewl_Orientation o)
s->invert = -s->invert;
if (o == EWL_ORIENTATION_HORIZONTAL) {
- ewl_widget_appearance_set(EWL_WIDGET(s), "hscrollbar");
- ewl_object_fill_policy_set(EWL_OBJECT(s),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
- ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ ewl_widget_appearance_set(EWL_WIDGET(s), "hscrollbar");
+ ewl_object_fill_policy_set(EWL_OBJECT(s),
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
}
else {
- ewl_widget_appearance_set(EWL_WIDGET(s), "vscrollbar");
- ewl_object_fill_policy_set(EWL_OBJECT(s),
- EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK);
- ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
- EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK);
+ ewl_widget_appearance_set(EWL_WIDGET(s), "vscrollbar");
+ ewl_object_fill_policy_set(EWL_OBJECT(s),
+ EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK);
+ ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
+ EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK);
}
/*
* Set the alignment of the buttons to the seeker.
*/
s->buttons_alignment = ewl_theme_data_int_get(EWL_WIDGET(s),
- "button_order");
+ "button_order");
ewl_container_child_remove(EWL_CONTAINER(s), s->decrement);
ewl_container_child_remove(EWL_CONTAINER(s), s->increment);
@@ -275,68 +275,68 @@ ewl_scrollbar_orientation_set(Ewl_Scrollbar *s, Ewl_Orientation o)
* packing order.
*/
if (o == EWL_ORIENTATION_HORIZONTAL) {
- if (s->buttons_alignment & EWL_FLAG_ALIGN_LEFT) {
- /*
- * Place in decrement, increment, seeker order.
- */
- ewl_container_child_append(EWL_CONTAINER(s),
- s->decrement);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->increment);
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- }
- else if (s->buttons_alignment & EWL_FLAG_ALIGN_RIGHT) {
- /*
- * Place in seeker, decrement, increment order.
- */
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->decrement);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->increment);
- }
- else {
- /*
- * Place in decrement, seeker, increment order.
- */
- ewl_container_child_append(EWL_CONTAINER(s),
- s->decrement);
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->increment);
- }
+ if (s->buttons_alignment & EWL_FLAG_ALIGN_LEFT) {
+ /*
+ * Place in decrement, increment, seeker order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->decrement);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->increment);
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ }
+ else if (s->buttons_alignment & EWL_FLAG_ALIGN_RIGHT) {
+ /*
+ * Place in seeker, decrement, increment order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->decrement);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->increment);
+ }
+ else {
+ /*
+ * Place in decrement, seeker, increment order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->decrement);
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->increment);
+ }
}
else {
- if (s->buttons_alignment & EWL_FLAG_ALIGN_TOP) {
- /*
- * Place in increment, decrement, seeker order.
- */
- ewl_container_child_append(EWL_CONTAINER(s),
- s->increment);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->decrement);
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- }
- else if (s->buttons_alignment & EWL_FLAG_ALIGN_BOTTOM) {
- /*
- * Place in seeker, increment, decrement order.
- */
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->increment);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->decrement);
- }
- else {
- /*
- * Place in increment, seeker, decrement order.
- */
- ewl_container_child_append(EWL_CONTAINER(s),
- s->increment);
- ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
- ewl_container_child_append(EWL_CONTAINER(s),
- s->decrement);
- }
+ if (s->buttons_alignment & EWL_FLAG_ALIGN_TOP) {
+ /*
+ * Place in increment, decrement, seeker order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->increment);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->decrement);
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ }
+ else if (s->buttons_alignment & EWL_FLAG_ALIGN_BOTTOM) {
+ /*
+ * Place in seeker, increment, decrement order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->increment);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->decrement);
+ }
+ else {
+ /*
+ * Place in increment, seeker, decrement order.
+ */
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->increment);
+ ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+ ewl_container_child_append(EWL_CONTAINER(s),
+ s->decrement);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -477,7 +477,7 @@ ewl_scrollbar_step_set(Ewl_Scrollbar *s, double v)
*/
void
ewl_scrollbar_cb_scroll_start(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Scrollbar *s;
Ewl_Orientation o;
@@ -490,9 +490,9 @@ ewl_scrollbar_cb_scroll_start(Ewl_Widget *w, void *ev_data __UNUSED__,
s = EWL_SCROLLBAR(user_data);
if (w == s->increment)
- s->direction = 1;
+ s->direction = 1;
else
- s->direction = -1;
+ s->direction = -1;
/*
* Need to scroll in the opposite direction for the vertical
@@ -517,7 +517,7 @@ ewl_scrollbar_cb_scroll_start(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_scrollbar_cb_scroll_stop(Ewl_Widget *w __UNUSED__,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
Ewl_Scrollbar *s;
@@ -528,7 +528,7 @@ ewl_scrollbar_cb_scroll_stop(Ewl_Widget *w __UNUSED__,
s = EWL_SCROLLBAR(user_data);
if (s->timer)
- ecore_timer_del(s->timer);
+ ecore_timer_del(s->timer);
s->timer = NULL;
s->direction = 0;
@@ -559,16 +559,16 @@ ewl_scrollbar_timer(void *data)
*/
velocity = ewl_theme_data_int_get(EWL_WIDGET(s), "velocity");
if (velocity < 1)
- velocity = 1;
+ velocity = 1;
else if (velocity > 10)
- velocity = 10;
+ velocity = 10;
/*
* Move the value of the seeker based on the direction of it's motion
* and the velocity setting.
*/
value += (double)(s->direction) * 10 * (1 - exp(-dt)) *
- ((double)(velocity) / 100.0);
+ ((double)(velocity) / 100.0);
ewl_range_value_set(EWL_RANGE(s->seeker), value);
diff --git a/src/lib/ewl_scrollbar.h b/src/lib/ewl_scrollbar.h
index b59fafd..08385f4 100644
--- a/src/lib/ewl_scrollbar.h
+++ b/src/lib/ewl_scrollbar.h
@@ -62,43 +62,43 @@ typedef struct Ewl_Scrollbar Ewl_Scrollbar;
*/
struct Ewl_Scrollbar
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
- Ewl_Widget *seeker; /**< The internal Ewl_Seeker */
- Ewl_Widget *decrement; /**< The internal decrement button */
- Ewl_Widget *increment; /**< The internal increment button */
+ Ewl_Widget *seeker; /**< The internal Ewl_Seeker */
+ Ewl_Widget *decrement; /**< The internal decrement button */
+ Ewl_Widget *increment; /**< The internal increment button */
unsigned int buttons_alignment; /**< The ordering of buttons */
- double fill_percentage; /**< Ratio of size for draggable */
- double start_time; /**< Time scrolling began */
- Ecore_Timer *timer; /**< Repeating timer for scrolling */
- signed char direction; /**< Direction for the scrollbar */
- signed char invert; /**< Invert the scrolling direction */
+ double fill_percentage; /**< Ratio of size for draggable */
+ double start_time; /**< Time scrolling began */
+ Ecore_Timer *timer; /**< Repeating timer for scrolling */
+ signed char direction; /**< Direction for the scrollbar */
+ signed char invert; /**< Invert the scrolling direction */
};
Ewl_Widget *ewl_scrollbar_new(void);
Ewl_Widget *ewl_hscrollbar_new(void);
Ewl_Widget *ewl_vscrollbar_new(void);
-int ewl_scrollbar_init(Ewl_Scrollbar *s);
+int ewl_scrollbar_init(Ewl_Scrollbar *s);
-void ewl_scrollbar_orientation_set(Ewl_Scrollbar *s,
- Ewl_Orientation orientation);
+void ewl_scrollbar_orientation_set(Ewl_Scrollbar *s,
+ Ewl_Orientation orientation);
Ewl_Orientation ewl_scrollbar_orientation_get(Ewl_Scrollbar *s);
-char ewl_scrollbar_inverse_scroll_get(Ewl_Scrollbar *s);
-void ewl_scrollbar_inverse_scroll_set(Ewl_Scrollbar *s, char v);
-double ewl_scrollbar_value_get(Ewl_Scrollbar *s);
-void ewl_scrollbar_value_set(Ewl_Scrollbar *s, double v);
+char ewl_scrollbar_inverse_scroll_get(Ewl_Scrollbar *s);
+void ewl_scrollbar_inverse_scroll_set(Ewl_Scrollbar *s, char v);
+double ewl_scrollbar_value_get(Ewl_Scrollbar *s);
+void ewl_scrollbar_value_set(Ewl_Scrollbar *s, double v);
-double ewl_scrollbar_step_get(Ewl_Scrollbar *s);
-void ewl_scrollbar_step_set(Ewl_Scrollbar *s, double v);
+double ewl_scrollbar_step_get(Ewl_Scrollbar *s);
+void ewl_scrollbar_step_set(Ewl_Scrollbar *s, double v);
/*
* Internally used callbacks, override at your own risk.
*/
void ewl_scrollbar_cb_scroll_start(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_scrollbar_cb_scroll_stop(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @}
diff --git a/src/lib/ewl_scrollpane.c b/src/lib/ewl_scrollpane.c
index 1a4b023..c5d95c4 100644
--- a/src/lib/ewl_scrollpane.c
+++ b/src/lib/ewl_scrollpane.c
@@ -48,9 +48,9 @@ struct Ewl_Scrollpane_Scroll_Info_Embedded
struct
{
- int x;
- int y;
- double time;
+ int x;
+ int y;
+ double time;
} back[HIST_NUM];
};
@@ -60,7 +60,7 @@ static void ewl_scrollpane_cb_mouse_up_embedded(Ewl_Widget *w, void *ev, void *d
static void ewl_scrollpane_cb_mouse_move_embedded(Ewl_Widget *w, void *ev, void *data);
static int ewl_scrollpane_cb_scroll_timer_embedded(void *data);
static void ewl_scrollpane_cb_scroll(Ewl_Scrollpane *s, double x, double y,
- int *tx, int *ty);
+ int *tx, int *ty);
static void ewl_scrollpane_cb_destroy(Ewl_Widget *w, void *ev, void *data);
/**
@@ -76,11 +76,11 @@ ewl_scrollpane_new(void)
s = NEW(Ewl_Scrollpane, 1);
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_scrollpane_init(s)) {
- ewl_widget_destroy(EWL_WIDGET(s));
- s = NULL;
+ ewl_widget_destroy(EWL_WIDGET(s));
+ s = NULL;
}
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
@@ -106,7 +106,7 @@ ewl_scrollpane_init(Ewl_Scrollpane *s)
w = EWL_WIDGET(s);
if (!ewl_container_init(EWL_CONTAINER(s)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(w, EWL_SCROLLPANE_TYPE);
ewl_widget_inherit(w, EWL_SCROLLPANE_TYPE);
@@ -119,7 +119,7 @@ ewl_scrollpane_init(Ewl_Scrollpane *s)
/* Remove the default focus out callback and replace with our own */
ewl_callback_del(w, EWL_CALLBACK_FOCUS_OUT, ewl_widget_cb_focus_out);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT,
- ewl_container_cb_container_focus_out, NULL);
+ ewl_container_cb_container_focus_out, NULL);
s->hflag = EWL_SCROLLPANE_FLAG_AUTO_VISIBLE;
@@ -162,20 +162,20 @@ ewl_scrollpane_init(Ewl_Scrollpane *s)
* Append necessary callbacks for the scrollpane.
*/
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_scrollpane_cb_configure, NULL);
+ ewl_scrollpane_cb_configure, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
- ewl_scrollpane_cb_focus_jump, NULL);
+ ewl_scrollpane_cb_focus_jump, NULL);
/*
* We need to know whent he scrollbars have value changes in order to
* know when to scroll.
*/
ewl_callback_append(s->hscrollbar, EWL_CALLBACK_VALUE_CHANGED,
- ewl_scrollpane_cb_hscroll, s);
+ ewl_scrollpane_cb_hscroll, s);
ewl_callback_append(s->vscrollbar, EWL_CALLBACK_VALUE_CHANGED,
- ewl_scrollpane_cb_vscroll, s);
+ ewl_scrollpane_cb_vscroll, s);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_WHEEL,
- ewl_scrollpane_cb_wheel_scroll, NULL);
+ ewl_scrollpane_cb_wheel_scroll, NULL);
/*
* Setup kinetic scrolling info here
@@ -185,15 +185,15 @@ ewl_scrollpane_init(Ewl_Scrollpane *s)
kst = ewl_theme_data_str_get(w, "/scrollpane/kscroll_type");
if (kst && !strcmp(kst, "embedded"))
- type = EWL_KINETIC_SCROLL_EMBEDDED;
+ type = EWL_KINETIC_SCROLL_EMBEDDED;
else if (kst && !strcmp(kst, "normal"))
- type = EWL_KINETIC_SCROLL_NORMAL;
+ type = EWL_KINETIC_SCROLL_NORMAL;
else
- type = EWL_KINETIC_SCROLL_NONE;
-
+ type = EWL_KINETIC_SCROLL_NONE;
+
ewl_scrollpane_kinetic_scrolling_set(s, type);
ewl_callback_append(w, EWL_CALLBACK_DESTROY,
- ewl_scrollpane_cb_destroy, NULL);
+ ewl_scrollpane_cb_destroy, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -213,62 +213,62 @@ ewl_scrollpane_kinetic_scrolling_set(Ewl_Scrollpane *s, Ewl_Kinetic_Scroll type)
/* If set to current value we have nothing to do */
if ((s->type) && (type == s->type))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* Remove all present callbacks and free the kinfo */
if ((s->type == EWL_KINETIC_SCROLL_NORMAL) && (s->kinfo))
{
- ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
- ewl_scrollpane_cb_mouse_down_normal);
- ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_UP,
- ewl_scrollpane_cb_mouse_up_normal);
- ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
- ewl_scrollpane_cb_mouse_move_normal);
+ ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
+ ewl_scrollpane_cb_mouse_down_normal);
+ ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_UP,
+ ewl_scrollpane_cb_mouse_up_normal);
+ ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
+ ewl_scrollpane_cb_mouse_move_normal);
}
else if ((s->type == EWL_KINETIC_SCROLL_EMBEDDED) && (s->kinfo))
{
- ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
- ewl_scrollpane_cb_mouse_down_embedded);
- ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_UP,
- ewl_scrollpane_cb_mouse_up_embedded);
- ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
- ewl_scrollpane_cb_mouse_move_embedded);
+ ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
+ ewl_scrollpane_cb_mouse_down_embedded);
+ ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_UP,
+ ewl_scrollpane_cb_mouse_up_embedded);
+ ewl_callback_del(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
+ ewl_scrollpane_cb_mouse_move_embedded);
}
if (s->kinfo)
{
- IF_FREE(s->kinfo->extra)
+ IF_FREE(s->kinfo->extra)
}
else
{
- s->kinfo = NEW(Ewl_Scrollpane_Scroll_Info_Base, 1);
- s->kinfo->fps = 15;
- s->kinfo->vmax = 50.0;
- s->kinfo->vmin = 0.0;
- s->kinfo->dampen = 0.95;
+ s->kinfo = NEW(Ewl_Scrollpane_Scroll_Info_Base, 1);
+ s->kinfo->fps = 15;
+ s->kinfo->vmax = 50.0;
+ s->kinfo->vmin = 0.0;
+ s->kinfo->dampen = 0.95;
}
if (type == EWL_KINETIC_SCROLL_NORMAL)
{
- ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
- ewl_scrollpane_cb_mouse_down_normal, s);
- ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_UP,
- ewl_scrollpane_cb_mouse_up_normal, s);
- ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
- ewl_scrollpane_cb_mouse_move_normal, s);
- s->kinfo->extra = NEW(Ewl_Scrollpane_Scroll_Info_Normal, 1);
+ ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
+ ewl_scrollpane_cb_mouse_down_normal, s);
+ ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_UP,
+ ewl_scrollpane_cb_mouse_up_normal, s);
+ ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
+ ewl_scrollpane_cb_mouse_move_normal, s);
+ s->kinfo->extra = NEW(Ewl_Scrollpane_Scroll_Info_Normal, 1);
}
else if (type == EWL_KINETIC_SCROLL_EMBEDDED)
{
- ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
- ewl_scrollpane_cb_mouse_down_embedded, s);
- ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_UP,
- ewl_scrollpane_cb_mouse_up_embedded, s);
- ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
- ewl_scrollpane_cb_mouse_move_embedded, s);
-
- s->kinfo->extra = NEW(Ewl_Scrollpane_Scroll_Info_Embedded, 1);
+ ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_DOWN,
+ ewl_scrollpane_cb_mouse_down_embedded, s);
+ ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_UP,
+ ewl_scrollpane_cb_mouse_up_embedded, s);
+ ewl_callback_append(s->overlay, EWL_CALLBACK_MOUSE_MOVE,
+ ewl_scrollpane_cb_mouse_move_embedded, s);
+
+ s->kinfo->extra = NEW(Ewl_Scrollpane_Scroll_Info_Embedded, 1);
}
s->type = type;
@@ -308,10 +308,10 @@ ewl_scrollpane_hscrollbar_flag_set(Ewl_Scrollpane *s, Ewl_Scrollpane_Flags f)
s->hflag = f;
if (f & EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN) {
- unsigned int fill;
- fill = ewl_object_fill_policy_get(EWL_OBJECT(s->box));
- ewl_object_fill_policy_set(EWL_OBJECT(s->box),
- fill | EWL_FLAG_FILL_HSHRINK);
+ unsigned int fill;
+ fill = ewl_object_fill_policy_get(EWL_OBJECT(s->box));
+ ewl_object_fill_policy_set(EWL_OBJECT(s->box),
+ fill | EWL_FLAG_FILL_HSHRINK);
}
ewl_widget_configure(EWL_WIDGET(s));
@@ -337,10 +337,10 @@ ewl_scrollpane_vscrollbar_flag_set(Ewl_Scrollpane *s, Ewl_Scrollpane_Flags f)
s->vflag = f;
if (f & EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN) {
- unsigned int fill;
- fill = ewl_object_fill_policy_get(EWL_OBJECT(s->box));
- ewl_object_fill_policy_set(EWL_OBJECT(s->box),
- fill | EWL_FLAG_FILL_VSHRINK);
+ unsigned int fill;
+ fill = ewl_object_fill_policy_get(EWL_OBJECT(s->box));
+ ewl_object_fill_policy_set(EWL_OBJECT(s->box),
+ fill | EWL_FLAG_FILL_VSHRINK);
}
ewl_widget_configure(EWL_WIDGET(s));
@@ -391,7 +391,7 @@ ewl_scrollpane_hscrollbar_value_get(Ewl_Scrollpane *s)
DCHECK_TYPE_RET(s, EWL_SCROLLPANE_TYPE, 0.0);
DRETURN_FLOAT(ewl_scrollbar_value_get(EWL_SCROLLBAR(s->hscrollbar)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -407,7 +407,7 @@ ewl_scrollpane_vscrollbar_value_get(Ewl_Scrollpane *s)
DCHECK_TYPE_RET(s, EWL_SCROLLPANE_TYPE, 0.0);
DRETURN_FLOAT(ewl_scrollbar_value_get(EWL_SCROLLBAR(s->vscrollbar)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -449,7 +449,7 @@ ewl_scrollpane_vscrollbar_value_set(Ewl_Scrollpane *s, double val)
/**
* @param s: the scrollpane to retrieve its vertical scrollbar stepping
* @return Returns the value of the stepping of the vertical scrollbar
- * in @a s on success.
+ * in @a s on success.
* @brief Retrives the value of the stepping of the vertical scrollbar in @a s.
*/
double
@@ -460,13 +460,13 @@ ewl_scrollpane_hscrollbar_step_get(Ewl_Scrollpane *s)
DCHECK_TYPE_RET(s, EWL_SCROLLPANE_TYPE, 0.0);
DRETURN_FLOAT(ewl_scrollbar_step_get(EWL_SCROLLBAR(s->hscrollbar)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
* @param s: the scrollpane to retrieve its vertical scrollbar stepping
* @return Returns the value of the stepping of the vertical scrollbar
- * in @a s on success.
+ * in @a s on success.
* @brief Retrives the value of the stepping of the vertical scrollbar in @a s.
*/
double
@@ -477,7 +477,7 @@ ewl_scrollpane_vscrollbar_step_get(Ewl_Scrollpane *s)
DCHECK_TYPE_RET(s, EWL_SCROLLPANE_TYPE, 0.0);
DRETURN_FLOAT(ewl_scrollbar_step_get(EWL_SCROLLBAR(s->vscrollbar)),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
/**
@@ -490,7 +490,7 @@ ewl_scrollpane_vscrollbar_step_get(Ewl_Scrollpane *s)
*/
void
ewl_scrollpane_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Scrollpane *s;
int vs_width = 0, hs_height = 0;
@@ -524,9 +524,9 @@ ewl_scrollpane_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* with shrink fill policies.
*/
ewl_container_largest_prefer(EWL_CONTAINER(s->box),
- EWL_ORIENTATION_HORIZONTAL);
+ EWL_ORIENTATION_HORIZONTAL);
ewl_container_sum_prefer(EWL_CONTAINER(s->box),
- EWL_ORIENTATION_VERTICAL);
+ EWL_ORIENTATION_VERTICAL);
/*
* Get the preferred size of contents to scroll correctly.
@@ -538,62 +538,62 @@ ewl_scrollpane_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* Calculate initial steps.
*/
if (content_w < b_width)
- hstep = (double)content_w / (double)b_width;
+ hstep = (double)content_w / (double)b_width;
if (content_h < b_height)
- vstep = (double)content_h / (double)b_height;
+ vstep = (double)content_h / (double)b_height;
/*
* Determine visibility of scrollbars based on the flags.
*/
if (s->hflag == EWL_SCROLLPANE_FLAG_NONE ||
- (hstep < 1.0 &&
- s->hflag == EWL_SCROLLPANE_FLAG_AUTO_VISIBLE))
- ewl_widget_show(s->hscrollbar);
+ (hstep < 1.0 &&
+ s->hflag == EWL_SCROLLPANE_FLAG_AUTO_VISIBLE))
+ ewl_widget_show(s->hscrollbar);
else {
- box_fill |= EWL_FLAG_FILL_HSHRINK;
- ewl_widget_hide(s->hscrollbar);
+ box_fill |= EWL_FLAG_FILL_HSHRINK;
+ ewl_widget_hide(s->hscrollbar);
}
if (s->vflag == EWL_SCROLLPANE_FLAG_NONE ||
- (vstep < 1.0 &&
- s->vflag == EWL_SCROLLPANE_FLAG_AUTO_VISIBLE))
- ewl_widget_show(s->vscrollbar);
+ (vstep < 1.0 &&
+ s->vflag == EWL_SCROLLPANE_FLAG_AUTO_VISIBLE))
+ ewl_widget_show(s->vscrollbar);
else {
- box_fill |= EWL_FLAG_FILL_VSHRINK;
- ewl_widget_hide(s->vscrollbar);
+ box_fill |= EWL_FLAG_FILL_VSHRINK;
+ ewl_widget_hide(s->vscrollbar);
}
/*
* Adjust the step and width dependant on scrollbar visibility.
*/
if (VISIBLE(s->hscrollbar)) {
- content_h -= hs_height;
- if (content_h < b_height)
- vstep = (double)content_h / (double)b_height;
+ content_h -= hs_height;
+ if (content_h < b_height)
+ vstep = (double)content_h / (double)b_height;
}
if (VISIBLE(s->vscrollbar)) {
- content_w -= vs_width;
- if (content_w < b_width)
- hstep = (double)content_w / (double)b_width;
+ content_w -= vs_width;
+ if (content_w < b_width)
+ hstep = (double)content_w / (double)b_width;
}
/*
* Ensure the step is not negative.
*/
if (hstep == 1.0)
- b_width = content_w;
+ b_width = content_w;
if (vstep == 1.0)
- b_height = content_h;
+ b_height = content_h;
/*
* Calcuate the offset for the box position
*/
b_width = (int)(ewl_scrollbar_value_get(EWL_SCROLLBAR(s->hscrollbar)) *
- (double)(b_width - content_w));
+ (double)(b_width - content_w));
b_height = (int)(ewl_scrollbar_value_get(EWL_SCROLLBAR(s->vscrollbar)) *
- (double)(b_height - content_h));
+ (double)(b_height - content_h));
/*
* Assign the step values to the scrollbars to adjust scale.
@@ -611,28 +611,28 @@ ewl_scrollpane_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* Position the horizontal scrollbar.
*/
ewl_object_geometry_request(EWL_OBJECT(s->hscrollbar),
- CURRENT_X(w), CURRENT_Y(w) + content_h,
- content_w, hs_height);
+ CURRENT_X(w), CURRENT_Y(w) + content_h,
+ content_w, hs_height);
/*
* Position the vertical scrollbar.
*/
ewl_object_geometry_request(EWL_OBJECT(s->vscrollbar),
- CURRENT_X(w) + content_w, CURRENT_Y(w),
- vs_width, content_h);
+ CURRENT_X(w) + content_w, CURRENT_Y(w),
+ vs_width, content_h);
/*
* Now move the box into position. For the scrollpane to work we move
* the box relative to the scroll value.
*/
ewl_object_geometry_request(EWL_OBJECT(s->overlay),
- CURRENT_X(w), CURRENT_Y(w),
- content_w, content_h);
+ CURRENT_X(w), CURRENT_Y(w),
+ content_w, content_h);
ewl_object_geometry_request(EWL_OBJECT(s->box),
- CURRENT_X(w) - b_width,
- CURRENT_Y(w) - b_height,
- content_w + b_width,
- content_h + b_height);
+ CURRENT_X(w) - b_width,
+ CURRENT_Y(w) - b_height,
+ content_w + b_width,
+ content_h + b_height);
/*
* Reset the default fill policy on the box to get updated sizes..
@@ -652,7 +652,7 @@ ewl_scrollpane_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_scrollpane_cb_focus_jump(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
int endcoord = 0;
double value;
@@ -668,15 +668,15 @@ ewl_scrollpane_cb_focus_jump(Ewl_Widget *w, void *ev_data __UNUSED__,
emb = ewl_embed_widget_find(w);
if (!emb)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Get the focused widget and stop if its an internal one.
*/
focus = ewl_embed_focused_widget_get(emb);
if (!focus || !ewl_widget_parent_of(s->box, focus) ||
- ewl_widget_onscreen_is(focus))
- DRETURN(DLEVEL_STABLE);
+ ewl_widget_onscreen_is(focus))
+ DRETURN(DLEVEL_STABLE);
ewl_object_current_geometry_get(EWL_OBJECT(focus), &fx, &fy, &fw, &fh);
@@ -684,41 +684,41 @@ ewl_scrollpane_cb_focus_jump(Ewl_Widget *w, void *ev_data __UNUSED__,
* Adjust horizontally to show the focused widget
*/
if (fx < CURRENT_X(s->overlay)) {
- bar = s->hscrollbar;
- endcoord = fx;
+ bar = s->hscrollbar;
+ endcoord = fx;
}
else if (fx + fw > CURRENT_X(s->overlay) + CURRENT_W(s->overlay)) {
- bar = s->hscrollbar;
- endcoord = fx + fw;
+ bar = s->hscrollbar;
+ endcoord = fx + fw;
}
if (bar) {
- value = (double)endcoord /
- (double)(ewl_object_current_x_get(EWL_OBJECT(s->box)) +
- ewl_object_preferred_w_get(EWL_OBJECT(s->box)));
- ewl_scrollbar_value_set(EWL_SCROLLBAR(bar), value);
+ value = (double)endcoord /
+ (double)(ewl_object_current_x_get(EWL_OBJECT(s->box)) +
+ ewl_object_preferred_w_get(EWL_OBJECT(s->box)));
+ ewl_scrollbar_value_set(EWL_SCROLLBAR(bar), value);
}
/*
* Adjust vertically to show the focused widget
*/
if (fy < CURRENT_Y(s->overlay)) {
- bar = s->vscrollbar;
- endcoord = fy;
+ bar = s->vscrollbar;
+ endcoord = fy;
}
else if (fy + fh > CURRENT_Y(s->overlay) + CURRENT_H(s->overlay)) {
- bar = s->vscrollbar;
- endcoord = fy + fh;
+ bar = s->vscrollbar;
+ endcoord = fy + fh;
}
/*
* Adjust the value of the scrollbar to jump to the position
*/
if (bar) {
- value = (double)endcoord /
- (double)(ewl_object_current_y_get(EWL_OBJECT(s->box)) +
- ewl_object_preferred_h_get(EWL_OBJECT(s->box)));
- ewl_scrollbar_value_set(EWL_SCROLLBAR(bar), value);
+ value = (double)endcoord /
+ (double)(ewl_object_current_y_get(EWL_OBJECT(s->box)) +
+ ewl_object_preferred_h_get(EWL_OBJECT(s->box)));
+ ewl_scrollbar_value_set(EWL_SCROLLBAR(bar), value);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -735,7 +735,7 @@ ewl_scrollpane_cb_focus_jump(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_scrollpane_cb_hscroll(Ewl_Widget *w __UNUSED__,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(user_data);
@@ -759,7 +759,7 @@ ewl_scrollpane_cb_hscroll(Ewl_Widget *w __UNUSED__,
*/
void
ewl_scrollpane_cb_vscroll(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(user_data);
@@ -780,7 +780,7 @@ ewl_scrollpane_cb_vscroll(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
*/
void
ewl_scrollpane_cb_wheel_scroll(Ewl_Widget *cb, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Scrollpane *s;
Ewl_Event_Mouse_Wheel *ev;
@@ -792,8 +792,8 @@ ewl_scrollpane_cb_wheel_scroll(Ewl_Widget *cb, void *ev_data,
s = EWL_SCROLLPANE(cb);
ev = ev_data;
ewl_scrollpane_vscrollbar_value_set(s,
- ewl_scrollpane_vscrollbar_value_get(s) +
- ev->z * ewl_scrollpane_vscrollbar_step_get(s));
+ ewl_scrollpane_vscrollbar_value_get(s) +
+ ev->z * ewl_scrollpane_vscrollbar_step_get(s));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -891,13 +891,13 @@ ewl_scrollpane_cb_mouse_move_normal(Ewl_Widget *w, void *ev, void *data)
info = s->kinfo->extra;
if (!s->kinfo->clicked)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!s->kinfo->active)
{
- ecore_timer_add(1.0/s->kinfo->fps,
- ewl_scrollpane_cb_scroll_timer_normal, s);
- s->kinfo->active = !!TRUE;
+ ecore_timer_add(1.0/s->kinfo->fps,
+ ewl_scrollpane_cb_scroll_timer_normal, s);
+ s->kinfo->active = !!TRUE;
}
info->xc = mm->x;
@@ -906,15 +906,15 @@ ewl_scrollpane_cb_mouse_move_normal(Ewl_Widget *w, void *ev, void *data)
cy = (info->yc - info->y);
/* v = (change in position / (width or height of scroll *
- * (range of velocities) + min))
+ * (range of velocities) + min))
*/
info->vel_x = ((cx /
- (double)ewl_object_current_w_get(EWL_OBJECT(w))) *
- (s->kinfo->vmax - s->kinfo->vmin)) + s->kinfo->vmin;
+ (double)ewl_object_current_w_get(EWL_OBJECT(w))) *
+ (s->kinfo->vmax - s->kinfo->vmin)) + s->kinfo->vmin;
info->vel_y = ((cy /
- (double)ewl_object_current_h_get(EWL_OBJECT(w))) *
- (s->kinfo->vmax - s->kinfo->vmin)) + s->kinfo->vmin;
+ (double)ewl_object_current_h_get(EWL_OBJECT(w))) *
+ (s->kinfo->vmax - s->kinfo->vmin)) + s->kinfo->vmin;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -944,7 +944,7 @@ ewl_scrollpane_cb_mouse_move_embedded(Ewl_Widget *w, void *ev, void *data)
info = s->kinfo->extra;
if (!s->kinfo->clicked)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
memmove(&(info->back[1]), &(info->back[0]), sizeof(info->back[0]) * (HIST_NUM - 1));
info->back[0].x = mm->x;
@@ -1018,11 +1018,11 @@ ewl_scrollpane_cb_mouse_up_embedded(Ewl_Widget *w, void *ev, void *data)
for (i = 0; i < HIST_NUM; i++)
{
- dt = t - info->back[i].time;
- if (dt > 0.2) break;
- at = at + dt;
- ax = ax + info->back[i].x;
- ay = ay + info->back[i].y;
+ dt = t - info->back[i].time;
+ if (dt > 0.2) break;
+ at = at + dt;
+ ax = ax + info->back[i].x;
+ ay = ay + info->back[i].y;
}
ax = (ax / (i + 1));
@@ -1036,9 +1036,9 @@ ewl_scrollpane_cb_mouse_up_embedded(Ewl_Widget *w, void *ev, void *data)
info->vel_y = (double)dy / at;
if (info->vel_y < 0)
- ry = -1;
+ ry = -1;
if (info->vel_x < 0)
- rx = -1;
+ rx = -1;
/* This should do something better */
info->vel_x = sqrt(info->vel_x * rx);
@@ -1046,15 +1046,15 @@ ewl_scrollpane_cb_mouse_up_embedded(Ewl_Widget *w, void *ev, void *data)
/* Set to minimum velocity if below */
if (abs(info->vel_x) < s->kinfo->vmin)
- info->vel_x = s->kinfo->vmin;
+ info->vel_x = s->kinfo->vmin;
else if (abs(info->vel_x) > s->kinfo->vmax)
- info->vel_x = s->kinfo->vmax;
+ info->vel_x = s->kinfo->vmax;
/* Check upper velocity */
if (abs(info->vel_y) < s->kinfo->vmin)
- info->vel_y = s->kinfo->vmin;
+ info->vel_y = s->kinfo->vmin;
else if (abs(info->vel_y) > s->kinfo->vmax)
- info->vel_y = s->kinfo->vmax;
+ info->vel_y = s->kinfo->vmax;
/* Return to proper direction */
info->vel_x = info->vel_x * rx;
@@ -1089,17 +1089,17 @@ ewl_scrollpane_cb_scroll_timer_normal(void *data)
/* If the mouse is down, accelerate and check velocity */
if (!s->kinfo->clicked)
{
- info->vel_x *= s->kinfo->dampen;
- info->vel_y *= s->kinfo->dampen;
+ info->vel_x *= s->kinfo->dampen;
+ info->vel_y *= s->kinfo->dampen;
- h = info->vel_y * ((info->vel_y < 0) ? -1 : 1);
- w = info->vel_x * ((info->vel_x < 0) ? -1 : 1);
+ h = info->vel_y * ((info->vel_y < 0) ? -1 : 1);
+ w = info->vel_x * ((info->vel_x < 0) ? -1 : 1);
- if ((w < 0.5) && (h < 0.5))
- {
- s->kinfo->active = !!FALSE;
- DRETURN_INT(0, DLEVEL_STABLE);
- }
+ if ((w < 0.5) && (h < 0.5))
+ {
+ s->kinfo->active = !!FALSE;
+ DRETURN_INT(0, DLEVEL_STABLE);
+ }
}
/* Actually scroll the pane */
@@ -1107,9 +1107,9 @@ ewl_scrollpane_cb_scroll_timer_normal(void *data)
/* If at the end of a scrollbar, set x/y to current */
if (!tx)
- info->x = info->xc;
+ info->x = info->xc;
if (!ty)
- info->y = info->yc;
+ info->y = info->yc;
DRETURN_INT(1, DLEVEL_STABLE);
}
@@ -1135,15 +1135,15 @@ ewl_scrollpane_cb_scroll_timer_embedded(void *data)
info = s->kinfo->extra;
if ((s->kinfo->clicked) || (!s->kinfo->active))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
h = info->vel_y * ((info->vel_y < 0) ? -1 : 1);
w = info->vel_x * ((info->vel_x < 0) ? -1 : 1);
if ((w < 0.5) && (h < 0.5))
{
- s->kinfo->active = !!FALSE;
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ s->kinfo->active = !!FALSE;
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
t = 1.0 / (info->at * s->kinfo->fps);
@@ -1153,7 +1153,7 @@ ewl_scrollpane_cb_scroll_timer_embedded(void *data)
ewl_scrollpane_cb_scroll(s, w, h, &tx, &ty);
if (!tx && !ty)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
info->vel_x *= s->kinfo->dampen;
info->vel_y *= s->kinfo->dampen;
@@ -1173,7 +1173,7 @@ ewl_scrollpane_cb_scroll_timer_embedded(void *data)
*/
static void
ewl_scrollpane_cb_scroll(Ewl_Scrollpane *s, double x, double y,
- int *tx, int *ty)
+ int *tx, int *ty)
{
double w, h;
Ewl_Scrollbar *ry, *rx;
@@ -1186,53 +1186,53 @@ ewl_scrollpane_cb_scroll(Ewl_Scrollpane *s, double x, double y,
rx = EWL_SCROLLBAR(s->hscrollbar);
if (!((ewl_scrollpane_vscrollbar_value_get(s) == 1.0) &&
- (y > 0)) &&
- !((ewl_scrollpane_vscrollbar_value_get(s) == 0.0) &&
- (y < 0)))
+ (y > 0)) &&
+ !((ewl_scrollpane_vscrollbar_value_get(s) == 0.0) &&
+ (y < 0)))
{
- h = ewl_scrollpane_vscrollbar_value_get(s) +
- (y / (double)ewl_object_preferred_h_get(EWL_OBJECT(s->box)));
-
- /* If h is greater than possible setting, set to remainder */
- if (h > ewl_range_maximum_value_get(EWL_RANGE(ry->seeker)))
- {
- h = ewl_range_maximum_value_get(EWL_RANGE(ry->seeker));
- if (ty) *ty = FALSE;
- }
- else if (h < ewl_range_minimum_value_get(EWL_RANGE(ry->seeker)))
- {
- h = ewl_range_minimum_value_get(EWL_RANGE(ry->seeker));
- if (ty) *ty = FALSE;
- }
- else
- if (ty) *ty = TRUE;
-
- ewl_scrollpane_vscrollbar_value_set(s, h);
+ h = ewl_scrollpane_vscrollbar_value_get(s) +
+ (y / (double)ewl_object_preferred_h_get(EWL_OBJECT(s->box)));
+
+ /* If h is greater than possible setting, set to remainder */
+ if (h > ewl_range_maximum_value_get(EWL_RANGE(ry->seeker)))
+ {
+ h = ewl_range_maximum_value_get(EWL_RANGE(ry->seeker));
+ if (ty) *ty = FALSE;
+ }
+ else if (h < ewl_range_minimum_value_get(EWL_RANGE(ry->seeker)))
+ {
+ h = ewl_range_minimum_value_get(EWL_RANGE(ry->seeker));
+ if (ty) *ty = FALSE;
+ }
+ else
+ if (ty) *ty = TRUE;
+
+ ewl_scrollpane_vscrollbar_value_set(s, h);
}
if (!((ewl_scrollpane_hscrollbar_value_get(s) == 1.0) &&
- (x > 0)) &&
- !((ewl_scrollpane_hscrollbar_value_get(s) == 0.0) &&
- (x < 0)))
+ (x > 0)) &&
+ !((ewl_scrollpane_hscrollbar_value_get(s) == 0.0) &&
+ (x < 0)))
{
- w = ewl_scrollpane_hscrollbar_value_get(s) +
- (x / (double)ewl_object_preferred_w_get(EWL_OBJECT(s->box)));
-
- /* And again for the w */
- if (w > ewl_range_maximum_value_get(EWL_RANGE(rx->seeker)))
- {
- w = ewl_range_maximum_value_get(EWL_RANGE(rx->seeker));
- if (tx) *tx = FALSE;
- }
- else if (w < ewl_range_minimum_value_get(EWL_RANGE(rx->seeker)))
- {
- w = ewl_range_minimum_value_get(EWL_RANGE(rx->seeker));
- if (tx) *tx = FALSE;
- }
- else
- if (tx) *tx = TRUE;
-
- ewl_scrollpane_hscrollbar_value_set(s, w);
+ w = ewl_scrollpane_hscrollbar_value_get(s) +
+ (x / (double)ewl_object_preferred_w_get(EWL_OBJECT(s->box)));
+
+ /* And again for the w */
+ if (w > ewl_range_maximum_value_get(EWL_RANGE(rx->seeker)))
+ {
+ w = ewl_range_maximum_value_get(EWL_RANGE(rx->seeker));
+ if (tx) *tx = FALSE;
+ }
+ else if (w < ewl_range_minimum_value_get(EWL_RANGE(rx->seeker)))
+ {
+ w = ewl_range_minimum_value_get(EWL_RANGE(rx->seeker));
+ if (tx) *tx = FALSE;
+ }
+ else
+ if (tx) *tx = TRUE;
+
+ ewl_scrollpane_hscrollbar_value_set(s, w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1386,7 +1386,7 @@ ewl_scrollpane_cb_destroy(Ewl_Widget *w, void *ev, void *data)
DCHECK_TYPE(w, EWL_SCROLLPANE_TYPE);
if (EWL_SCROLLPANE(w)->kinfo)
- FREE(EWL_SCROLLPANE(w)->kinfo->extra);
+ FREE(EWL_SCROLLPANE(w)->kinfo->extra);
FREE(EWL_SCROLLPANE(w)->kinfo);
diff --git a/src/lib/ewl_scrollpane.h b/src/lib/ewl_scrollpane.h
index a92023d..2440fe8 100644
--- a/src/lib/ewl_scrollpane.h
+++ b/src/lib/ewl_scrollpane.h
@@ -48,13 +48,13 @@ typedef struct Ewl_Scrollpane_Scroll_Info_Base Ewl_Scrollpane_Scroll_Info_Base;
*/
struct Ewl_Scrollpane_Scroll_Info_Base
{
- unsigned char clicked:1; /**< If the mouse is currently clicked or not */
- unsigned char active:1; /**< If the pane is currently moving */
- int fps; /**< Number of recalculations per second */
- double vmax; /**< Maximum speed in pixels */
- double vmin; /**< Minimum speed in pixels */
- double dampen; /**< Frictional variable */
- void *extra; /**< Additional information */
+ unsigned char clicked:1; /**< If the mouse is currently clicked or not */
+ unsigned char active:1; /**< If the pane is currently moving */
+ int fps; /**< Number of recalculations per second */
+ double vmax; /**< Maximum speed in pixels */
+ double vmin; /**< Minimum speed in pixels */
+ double dampen; /**< Frictional variable */
+ void *extra; /**< Additional information */
};
/**
@@ -77,58 +77,58 @@ struct Ewl_Scrollpane
{
Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Widget *overlay; /**< Clips the enclosed widget */
- Ewl_Widget *box; /**< Lays out enclosed widget */
+ Ewl_Widget *overlay; /**< Clips the enclosed widget */
+ Ewl_Widget *box; /**< Lays out enclosed widget */
Ewl_Widget *hscrollbar; /**< Horizontal scrollbar */
Ewl_Widget *vscrollbar; /**< Vertical scrollbar */
Ewl_Scrollpane_Flags hflag; /**< Flags for horizontal scrollbar */
Ewl_Scrollpane_Flags vflag; /**< Flags for vertical scrollbar */
- Ewl_Scrollpane_Scroll_Info_Base *kinfo; /**< Kinetic scrolling info */
- Ewl_Kinetic_Scroll type; /**< If the scrollpane is to use kinetic scrolling */
+ Ewl_Scrollpane_Scroll_Info_Base *kinfo; /**< Kinetic scrolling info */
+ Ewl_Kinetic_Scroll type; /**< If the scrollpane is to use kinetic scrolling */
};
Ewl_Widget *ewl_scrollpane_new(void);
-int ewl_scrollpane_init(Ewl_Scrollpane *s);
-void ewl_scrollpane_kinetic_scrolling_set(Ewl_Scrollpane *s,
- Ewl_Kinetic_Scroll type);
+int ewl_scrollpane_init(Ewl_Scrollpane *s);
+void ewl_scrollpane_kinetic_scrolling_set(Ewl_Scrollpane *s,
+ Ewl_Kinetic_Scroll type);
Ewl_Kinetic_Scroll ewl_scrollpane_kinetic_scrolling_get(Ewl_Scrollpane *s);
-void ewl_scrollpane_kinetic_max_velocity_set(Ewl_Scrollpane *s, double v);
-double ewl_scrollpane_kinetic_max_velocity_get(Ewl_Scrollpane *s);
-void ewl_scrollpane_kinetic_min_velocity_set(Ewl_Scrollpane *s, double v);
-double ewl_scrollpane_kinetic_min_velocity_get(Ewl_Scrollpane *s);
-void ewl_scrollpane_kinetic_dampen_set(Ewl_Scrollpane *s, double d);
-double ewl_scrollpane_kinetic_dampen_get(Ewl_Scrollpane *s);
-void ewl_scrollpane_kinetic_fps_set(Ewl_Scrollpane *s, int fps);
-int ewl_scrollpane_kinetic_fps_get(Ewl_Scrollpane *s);
-
-void ewl_scrollpane_hscrollbar_flag_set(Ewl_Scrollpane *s,
- Ewl_Scrollpane_Flags f);
-void ewl_scrollpane_vscrollbar_flag_set(Ewl_Scrollpane *s,
- Ewl_Scrollpane_Flags f);
+void ewl_scrollpane_kinetic_max_velocity_set(Ewl_Scrollpane *s, double v);
+double ewl_scrollpane_kinetic_max_velocity_get(Ewl_Scrollpane *s);
+void ewl_scrollpane_kinetic_min_velocity_set(Ewl_Scrollpane *s, double v);
+double ewl_scrollpane_kinetic_min_velocity_get(Ewl_Scrollpane *s);
+void ewl_scrollpane_kinetic_dampen_set(Ewl_Scrollpane *s, double d);
+double ewl_scrollpane_kinetic_dampen_get(Ewl_Scrollpane *s);
+void ewl_scrollpane_kinetic_fps_set(Ewl_Scrollpane *s, int fps);
+int ewl_scrollpane_kinetic_fps_get(Ewl_Scrollpane *s);
+
+void ewl_scrollpane_hscrollbar_flag_set(Ewl_Scrollpane *s,
+ Ewl_Scrollpane_Flags f);
+void ewl_scrollpane_vscrollbar_flag_set(Ewl_Scrollpane *s,
+ Ewl_Scrollpane_Flags f);
Ewl_Scrollpane_Flags ewl_scrollpane_hscrollbar_flag_get(Ewl_Scrollpane *s);
Ewl_Scrollpane_Flags ewl_scrollpane_vscrollbar_flag_get(Ewl_Scrollpane *s);
-double ewl_scrollpane_hscrollbar_value_get(Ewl_Scrollpane *s);
-double ewl_scrollpane_vscrollbar_value_get(Ewl_Scrollpane *s);
+double ewl_scrollpane_hscrollbar_value_get(Ewl_Scrollpane *s);
+double ewl_scrollpane_vscrollbar_value_get(Ewl_Scrollpane *s);
-void ewl_scrollpane_hscrollbar_value_set(Ewl_Scrollpane *s, double val);
-void ewl_scrollpane_vscrollbar_value_set(Ewl_Scrollpane *s, double val);
+void ewl_scrollpane_hscrollbar_value_set(Ewl_Scrollpane *s, double val);
+void ewl_scrollpane_vscrollbar_value_set(Ewl_Scrollpane *s, double val);
-double ewl_scrollpane_hscrollbar_step_get(Ewl_Scrollpane *s);
-double ewl_scrollpane_vscrollbar_step_get(Ewl_Scrollpane *s);
+double ewl_scrollpane_hscrollbar_step_get(Ewl_Scrollpane *s);
+double ewl_scrollpane_vscrollbar_step_get(Ewl_Scrollpane *s);
/*
* Internally used callbacks, override at your own risk.
*/
void ewl_scrollpane_cb_configure(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_scrollpane_cb_focus_jump(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_scrollpane_cb_hscroll(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_scrollpane_cb_vscroll(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_scrollpane_cb_wheel_scroll(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
/**
* @}
diff --git a/src/lib/ewl_seeker.c b/src/lib/ewl_seeker.c
index d0380b6..055fe94 100644
--- a/src/lib/ewl_seeker.c
+++ b/src/lib/ewl_seeker.c
@@ -22,11 +22,11 @@ ewl_seeker_new(void)
s = NEW(Ewl_Seeker, 1);
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_seeker_init(s)) {
- ewl_widget_destroy(EWL_WIDGET(s));
- s = NULL;
+ ewl_widget_destroy(EWL_WIDGET(s));
+ s = NULL;
}
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
@@ -45,7 +45,7 @@ ewl_hseeker_new(void)
s = ewl_seeker_new();
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_seeker_orientation_set(EWL_SEEKER(s), EWL_ORIENTATION_HORIZONTAL);
@@ -65,7 +65,7 @@ ewl_vseeker_new(void)
s = ewl_seeker_new();
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_seeker_orientation_set(EWL_SEEKER(s), EWL_ORIENTATION_VERTICAL);
@@ -91,7 +91,7 @@ ewl_seeker_init(Ewl_Seeker *s)
w = EWL_WIDGET(s);
if (!ewl_range_init(EWL_RANGE(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
/*
* Initialize the widget fields and set default orientation and type
@@ -99,10 +99,10 @@ ewl_seeker_init(Ewl_Seeker *s)
ewl_widget_appearance_set(w, "hseeker");
ewl_widget_inherit(w, EWL_SEEKER_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HSHRINK);
ewl_container_show_notify_set(EWL_CONTAINER(w),
- ewl_seeker_cb_child_show);
+ ewl_seeker_cb_child_show);
/*
* Create and add the button portion of the seeker
@@ -122,36 +122,36 @@ ewl_seeker_init(Ewl_Seeker *s)
* Add necessary configuration callbacks
*/
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_seeker_cb_configure,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_seeker_cb_mouse_down, NULL);
+ ewl_seeker_cb_mouse_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP,
- ewl_seeker_cb_mouse_up, NULL);
+ ewl_seeker_cb_mouse_up, NULL);
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY,
- ewl_seeker_cb_mouse_up, NULL);
+ ewl_seeker_cb_mouse_up, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_seeker_cb_mouse_move, NULL);
+ ewl_seeker_cb_mouse_move, NULL);
ewl_callback_append(w, EWL_CALLBACK_KEY_DOWN,
- ewl_seeker_cb_key_down, NULL);
+ ewl_seeker_cb_key_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
- ewl_container_cb_widget_focus_in, NULL);
+ ewl_container_cb_widget_focus_in, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT,
- ewl_container_cb_widget_focus_out, NULL);
+ ewl_container_cb_widget_focus_out, NULL);
/*
* Append a callback for catching mouse movements on the button and
* add the button to the seeker
*/
ewl_callback_append(s->button, EWL_CALLBACK_MOUSE_DOWN,
- ewl_seeker_cb_button_mouse_down, NULL);
+ ewl_seeker_cb_button_mouse_down, NULL);
ewl_callback_append(s->button, EWL_CALLBACK_MOUSE_UP,
- ewl_seeker_cb_button_mouse_up, NULL);
+ ewl_seeker_cb_button_mouse_up, NULL);
/*
* We want to catch mouse movement events from the button.
*/
ewl_container_callback_notify(EWL_CONTAINER(s),
- EWL_CALLBACK_MOUSE_MOVE);
+ EWL_CALLBACK_MOUSE_MOVE);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -170,20 +170,20 @@ ewl_seeker_orientation_set(Ewl_Seeker *s, Ewl_Orientation o)
DCHECK_TYPE(s, EWL_SEEKER_TYPE);
if (o == s->orientation)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
s->orientation = o;
if (o == EWL_ORIENTATION_HORIZONTAL) {
- ewl_widget_appearance_set(EWL_WIDGET(s), "hseeker");
- ewl_widget_appearance_set(s->button, "hbutton");
- ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_HSHRINK);
+ ewl_widget_appearance_set(EWL_WIDGET(s), "hseeker");
+ ewl_widget_appearance_set(s->button, "hbutton");
+ ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_HFILL |
+ EWL_FLAG_FILL_HSHRINK);
}
else {
- ewl_widget_appearance_set(EWL_WIDGET(s), "vseeker");
- ewl_widget_appearance_set(s->button, "vbutton");
- ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_VFILL |
- EWL_FLAG_FILL_VSHRINK);
+ ewl_widget_appearance_set(EWL_WIDGET(s), "vseeker");
+ ewl_widget_appearance_set(s->button, "vbutton");
+ ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_VFILL |
+ EWL_FLAG_FILL_VSHRINK);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -222,17 +222,17 @@ ewl_seeker_autohide_set(Ewl_Seeker *s, int v)
DCHECK_TYPE(s, EWL_SEEKER_TYPE);
if (s->autohide == v || s->autohide == -v)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!v) {
- s->autohide = v;
- if (REALIZED(s))
- ewl_widget_show(EWL_WIDGET(s));
+ s->autohide = v;
+ if (REALIZED(s))
+ ewl_widget_show(EWL_WIDGET(s));
}
else if (s->autohide < 0)
- s->autohide = -v;
+ s->autohide = -v;
else
- s->autohide = v;
+ s->autohide = v;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -264,7 +264,7 @@ ewl_seeker_autohide_get(Ewl_Seeker *s)
*/
void
ewl_seeker_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Seeker *s;
Ewl_Range *r;
@@ -282,7 +282,7 @@ ewl_seeker_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
r = EWL_RANGE(w);
if (!s->button)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
dx = CURRENT_X(s);
dy = CURRENT_Y(s);
@@ -297,20 +297,20 @@ ewl_seeker_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
s1 = r->step / range;
if (s->autohide && s1 >= 1.0) {
- ewl_widget_hide(w);
- s->autohide = -abs(s->autohide);
+ ewl_widget_hide(w);
+ s->autohide = -abs(s->autohide);
}
if (r->invert)
- s2 = (r->max_val - r->value) / range;
+ s2 = (r->max_val - r->value) / range;
else
- s2 = (r->value - r->min_val) / range;
+ s2 = (r->value - r->min_val) / range;
if (s->orientation == EWL_ORIENTATION_VERTICAL) {
- dh *= s1;
+ dh *= s1;
}
else {
- dw *= s1;
+ dw *= s1;
}
ewl_object_size_request(EWL_OBJECT(s->button), dw, dh);
@@ -322,10 +322,10 @@ ewl_seeker_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
nh = ewl_object_current_h_get(EWL_OBJECT(s->button));
if (s->orientation == EWL_ORIENTATION_VERTICAL) {
- dy += (CURRENT_H(s) - nh) * s2;
+ dy += (CURRENT_H(s) - nh) * s2;
}
else {
- dx += (CURRENT_W(s) - nw) * s2;
+ dx += (CURRENT_W(s) - nw) * s2;
}
ewl_object_place(EWL_OBJECT(s->button), dx, dy, nw, nh);
@@ -343,7 +343,7 @@ ewl_seeker_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_seeker_cb_button_mouse_down(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Event_Mouse *ev;
Ewl_Seeker *s;
@@ -361,9 +361,9 @@ ewl_seeker_cb_button_mouse_down(Ewl_Widget *w, void *ev_data,
ewl_object_current_geometry_get(EWL_OBJECT(w), &xx, &yy, &ww, &hh);
if (s->orientation == EWL_ORIENTATION_HORIZONTAL)
- s->dragstart = ev->x - (xx + ((ww + 1) / 2));
+ s->dragstart = ev->x - (xx + ((ww + 1) / 2));
else
- s->dragstart = ev->y - (yy + ((hh + 1) / 2));
+ s->dragstart = ev->y - (yy + ((hh + 1) / 2));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -378,7 +378,7 @@ ewl_seeker_cb_button_mouse_down(Ewl_Widget *w, void *ev_data,
*/
void
ewl_seeker_cb_button_mouse_up(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -400,7 +400,7 @@ ewl_seeker_cb_button_mouse_up(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_seeker_cb_mouse_move(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Event_Mouse *ev;
Ewl_Seeker *s;
@@ -416,7 +416,7 @@ ewl_seeker_cb_mouse_move(Ewl_Widget *w, void *ev_data,
r = EWL_RANGE(w);
if (r->step == r->max_val - r->min_val)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ev = ev_data;
@@ -425,19 +425,19 @@ ewl_seeker_cb_mouse_move(Ewl_Widget *w, void *ev_data,
*/
if (!ewl_object_state_has(EWL_OBJECT(s->button), EWL_FLAG_STATE_PRESSED)) {
- if (s->orientation == EWL_ORIENTATION_HORIZONTAL) {
- if (ewl_object_state_has(EWL_OBJECT(s),
- EWL_FLAG_STATE_PRESSED)) {
- s->dragstart = ev->x;
- }
- }
- else {
- if (ewl_object_state_has(EWL_OBJECT(s),
- EWL_FLAG_STATE_PRESSED)) {
- s->dragstart = ev->y;
- }
- }
- DRETURN(DLEVEL_STABLE);
+ if (s->orientation == EWL_ORIENTATION_HORIZONTAL) {
+ if (ewl_object_state_has(EWL_OBJECT(s),
+ EWL_FLAG_STATE_PRESSED)) {
+ s->dragstart = ev->x;
+ }
+ }
+ else {
+ if (ewl_object_state_has(EWL_OBJECT(s),
+ EWL_FLAG_STATE_PRESSED)) {
+ s->dragstart = ev->y;
+ }
+ }
+ DRETURN(DLEVEL_STABLE);
}
scale = ewl_seeker_mouse_value_map(s, ev->x, ev->y);
@@ -458,7 +458,7 @@ ewl_seeker_cb_mouse_move(Ewl_Widget *w, void *ev_data,
*/
void
ewl_seeker_cb_mouse_down(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Seeker *s;
Ewl_Range *r;
@@ -476,10 +476,10 @@ ewl_seeker_cb_mouse_down(Ewl_Widget *w, void *ev_data,
r = EWL_RANGE(w);
if (ewl_object_state_has(EWL_OBJECT(s->button), EWL_FLAG_STATE_PRESSED))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_object_current_geometry_get(EWL_OBJECT(s->button),
- &xx, &yy, &ww, &hh);
+ &xx, &yy, &ww, &hh);
value = r->value;
@@ -488,24 +488,24 @@ ewl_seeker_cb_mouse_down(Ewl_Widget *w, void *ev_data,
* relative to the button and the orientation of the seeker.
*/
if (s->orientation == EWL_ORIENTATION_HORIZONTAL) {
- s->dragstart = ev->x;
- if (ev->x < xx) {
- step = -r->step;
- }
- else if (ev->x > xx + ww) {
- step = r->step;
- }
+ s->dragstart = ev->x;
+ if (ev->x < xx) {
+ step = -r->step;
+ }
+ else if (ev->x > xx + ww) {
+ step = r->step;
+ }
}
else {
- s->dragstart = ev->y;
- if (ev->y < yy)
- step = -r->step;
- else if (ev->y > yy + hh)
- step = r->step;
+ s->dragstart = ev->y;
+ if (ev->y < yy)
+ step = -r->step;
+ else if (ev->y > yy + hh)
+ step = r->step;
}
if (r->invert)
- step = -step;
+ step = -step;
value += step;
ewl_range_value_set(r, value);
@@ -526,7 +526,7 @@ ewl_seeker_cb_mouse_down(Ewl_Widget *w, void *ev_data,
*/
void
ewl_seeker_cb_mouse_up(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Seeker *s = EWL_SEEKER(w);
@@ -535,7 +535,7 @@ ewl_seeker_cb_mouse_up(Ewl_Widget *w, void *ev_data __UNUSED__,
DCHECK_TYPE(w, EWL_SEEKER_TYPE);
if (s->timer)
- ecore_timer_del(s->timer);
+ ecore_timer_del(s->timer);
s->timer = NULL;
s->start_time = 0;
@@ -554,7 +554,7 @@ ewl_seeker_cb_mouse_up(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_seeker_cb_key_down(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Range *r;
Ewl_Event_Key *ev;
@@ -572,32 +572,32 @@ ewl_seeker_cb_key_down(Ewl_Widget *w, void *ev_data,
r = EWL_RANGE(w);
if (!r->invert) {
- increase = ewl_range_increase;
- decrease = ewl_range_decrease;
- start = r->min_val;
- end = r->max_val;
+ increase = ewl_range_increase;
+ decrease = ewl_range_decrease;
+ start = r->min_val;
+ end = r->max_val;
}
else {
- increase = ewl_range_decrease;
- decrease = ewl_range_increase;
- start = r->max_val;
- end = r->min_val;
+ increase = ewl_range_decrease;
+ decrease = ewl_range_increase;
+ start = r->max_val;
+ end = r->min_val;
}
if (!strcmp(ev->keyname, "Home"))
- ewl_range_value_set(r, start);
+ ewl_range_value_set(r, start);
else if (!strcmp(ev->keyname, "End"))
- ewl_range_value_set(r, end);
+ ewl_range_value_set(r, end);
else if (!strcmp(ev->keyname, "Left")
- || !strcmp(ev->keyname, "KP_Left")
- || !strcmp(ev->keyname, "Up")
- || !strcmp(ev->keyname, "KP_Up"))
- decrease(r);
+ || !strcmp(ev->keyname, "KP_Left")
+ || !strcmp(ev->keyname, "Up")
+ || !strcmp(ev->keyname, "KP_Up"))
+ decrease(r);
else if (!strcmp(ev->keyname, "Right")
- || !strcmp(ev->keyname, "KP_Right")
- || !strcmp(ev->keyname, "Down")
- || !strcmp(ev->keyname, "KP_Down"))
- increase(r);
+ || !strcmp(ev->keyname, "KP_Right")
+ || !strcmp(ev->keyname, "Down")
+ || !strcmp(ev->keyname, "KP_Down"))
+ increase(r);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -627,9 +627,9 @@ ewl_seeker_cb_child_show(Ewl_Container *p, Ewl_Widget *w)
ph = ewl_object_preferred_h_get(EWL_OBJECT(w));
if (EWL_SEEKER(r)->orientation == EWL_ORIENTATION_HORIZONTAL)
- pw *= (r->max_val - r->min_val) / r->step;
+ pw *= (r->max_val - r->min_val) / r->step;
else
- ph *= (r->max_val - r->min_val) / r->step;
+ ph *= (r->max_val - r->min_val) / r->step;
ewl_object_preferred_inner_size_set(EWL_OBJECT(p), pw, ph);
@@ -652,19 +652,19 @@ ewl_seeker_mouse_value_map(Ewl_Seeker *s, int mx, int my)
r = EWL_RANGE(s);
if (s->orientation == EWL_ORIENTATION_HORIZONTAL) {
- m = mx;
+ m = mx;
- dc = CURRENT_X(s);
- dg = CURRENT_W(s);
+ dc = CURRENT_X(s);
+ dg = CURRENT_W(s);
- adjust = ewl_object_current_w_get(EWL_OBJECT(s->button));
+ adjust = ewl_object_current_w_get(EWL_OBJECT(s->button));
}
else {
- m = my;
- dc = CURRENT_Y(s);
- dg = CURRENT_H(s);
+ m = my;
+ dc = CURRENT_Y(s);
+ dg = CURRENT_H(s);
- adjust = ewl_object_current_h_get(EWL_OBJECT(s->button));
+ adjust = ewl_object_current_h_get(EWL_OBJECT(s->button));
}
/*
@@ -683,9 +683,9 @@ ewl_seeker_mouse_value_map(Ewl_Seeker *s, int mx, int my)
* Bounds checking on the value.
*/
if (m < dc)
- m = dc;
+ m = dc;
else if (m > dc + dg)
- m = dc + dg;
+ m = dc + dg;
/*
* Calculate the new value based on the range, sizes and new position.
@@ -693,9 +693,9 @@ ewl_seeker_mouse_value_map(Ewl_Seeker *s, int mx, int my)
scale = (r->max_val - r->min_val) * (double)(m - dc) / (double)dg;
if (!r->invert)
- scale = r->min_val + scale;
+ scale = r->min_val + scale;
else
- scale = r->max_val - scale;
+ scale = r->max_val - scale;
DRETURN_FLOAT(scale, DLEVEL_STABLE);
}
@@ -718,26 +718,26 @@ ewl_seeker_timer(void *data)
* Find the value based on mouse position
*/
posval = ewl_seeker_mouse_value_map(s, s->dragstart * 2,
- s->dragstart * 2);
+ s->dragstart * 2);
/*
* Limit the value to the intersection with the mouse.
*/
if (posval > value) {
- if (value + step > posval) {
- value = posval;
- }
- else {
- value += step;
- }
+ if (value + step > posval) {
+ value = posval;
+ }
+ else {
+ value += step;
+ }
}
else {
- if (value - step < posval) {
- value = posval;
- }
- else {
- value -= step;
- }
+ if (value - step < posval) {
+ value = posval;
+ }
+ else {
+ value -= step;
+ }
}
ewl_range_value_set(EWL_RANGE(s), value);
diff --git a/src/lib/ewl_seeker.h b/src/lib/ewl_seeker.h
index 8cd2bd9..77da96e 100644
--- a/src/lib/ewl_seeker.h
+++ b/src/lib/ewl_seeker.h
@@ -65,22 +65,22 @@ struct Ewl_Seeker
Ewl_Widget *ewl_seeker_new(void);
Ewl_Widget *ewl_hseeker_new(void);
Ewl_Widget *ewl_vseeker_new(void);
-int ewl_seeker_init(Ewl_Seeker *s);
+int ewl_seeker_init(Ewl_Seeker *s);
-void ewl_seeker_orientation_set(Ewl_Seeker *s, Ewl_Orientation o);
+void ewl_seeker_orientation_set(Ewl_Seeker *s, Ewl_Orientation o);
Ewl_Orientation ewl_seeker_orientation_get(Ewl_Seeker *s);
-void ewl_seeker_autohide_set(Ewl_Seeker *s, int v);
-int ewl_seeker_autohide_get(Ewl_Seeker *s);
+void ewl_seeker_autohide_set(Ewl_Seeker *s, int v);
+int ewl_seeker_autohide_get(Ewl_Seeker *s);
/*
* Internally used callbacks, override at your own risk.
*/
void ewl_seeker_cb_configure(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_seeker_cb_button_mouse_down(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_seeker_cb_button_mouse_up(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_seeker_cb_mouse_move(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_seeker_cb_mouse_down(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_seeker_cb_mouse_up(Ewl_Widget *w, void *ev_data, void *user_data);
diff --git a/src/lib/ewl_separator.c b/src/lib/ewl_separator.c
index 03de5b1..78ecd85 100644
--- a/src/lib/ewl_separator.c
+++ b/src/lib/ewl_separator.c
@@ -18,11 +18,11 @@ ewl_separator_new(void)
s = NEW(Ewl_Separator, 1);
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_separator_init(s)) {
- ewl_widget_destroy(EWL_WIDGET(s));
- s = NULL;
+ ewl_widget_destroy(EWL_WIDGET(s));
+ s = NULL;
}
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
@@ -41,8 +41,8 @@ ewl_hseparator_new(void)
s = ewl_separator_new();
if (s)
- ewl_separator_orientation_set(EWL_SEPARATOR(s),
- EWL_ORIENTATION_HORIZONTAL);
+ ewl_separator_orientation_set(EWL_SEPARATOR(s),
+ EWL_ORIENTATION_HORIZONTAL);
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
}
@@ -60,8 +60,8 @@ ewl_vseparator_new(void)
s = ewl_separator_new();
if (s)
- ewl_separator_orientation_set(EWL_SEPARATOR(s),
- EWL_ORIENTATION_VERTICAL);
+ ewl_separator_orientation_set(EWL_SEPARATOR(s),
+ EWL_ORIENTATION_VERTICAL);
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
}
@@ -84,12 +84,12 @@ ewl_separator_init(Ewl_Separator *s)
w = EWL_WIDGET(s);
if (!ewl_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_SEPARATOR_TYPE);
ewl_widget_appearance_set(EWL_WIDGET(s), "hseparator");
ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_SHRINK);
+ EWL_FLAG_FILL_SHRINK);
ewl_object_alignment_set(EWL_OBJECT(s), EWL_FLAG_ALIGN_LEFT);
@@ -114,21 +114,21 @@ ewl_separator_orientation_set(Ewl_Separator *s, Ewl_Orientation o)
DCHECK_TYPE(s, EWL_SEPARATOR_TYPE);
if (s->orientation == o)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
s->orientation = o;
if (o == EWL_ORIENTATION_HORIZONTAL) {
- ewl_widget_appearance_set(EWL_WIDGET(s), "hseparator");
- ewl_object_fill_policy_set(EWL_OBJECT(s),
- EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_HSHRINK);
+ ewl_widget_appearance_set(EWL_WIDGET(s), "hseparator");
+ ewl_object_fill_policy_set(EWL_OBJECT(s),
+ EWL_FLAG_FILL_HFILL |
+ EWL_FLAG_FILL_HSHRINK);
}
else {
- ewl_widget_appearance_set(EWL_WIDGET(s), "vseparator");
- ewl_object_fill_policy_set(EWL_OBJECT(s),
- EWL_FLAG_FILL_VFILL |
- EWL_FLAG_FILL_VSHRINK);
+ ewl_widget_appearance_set(EWL_WIDGET(s), "vseparator");
+ ewl_object_fill_policy_set(EWL_OBJECT(s),
+ EWL_FLAG_FILL_VFILL |
+ EWL_FLAG_FILL_VSHRINK);
}
ewl_widget_configure(EWL_WIDGET(s));
diff --git a/src/lib/ewl_separator.h b/src/lib/ewl_separator.h
index 11744f0..af9ca60 100644
--- a/src/lib/ewl_separator.h
+++ b/src/lib/ewl_separator.h
@@ -59,8 +59,8 @@ struct Ewl_Separator
Ewl_Widget *ewl_separator_new(void);
Ewl_Widget *ewl_hseparator_new(void);
Ewl_Widget *ewl_vseparator_new(void);
-int ewl_separator_init(Ewl_Separator *s);
-void ewl_separator_orientation_set(Ewl_Separator *s, Ewl_Orientation o);
+int ewl_separator_init(Ewl_Separator *s);
+void ewl_separator_orientation_set(Ewl_Separator *s, Ewl_Orientation o);
Ewl_Orientation ewl_separator_orientation_get(Ewl_Separator *s);
/**
diff --git a/src/lib/ewl_shadow.c b/src/lib/ewl_shadow.c
index 5e35447..7d407a7 100644
--- a/src/lib/ewl_shadow.c
+++ b/src/lib/ewl_shadow.c
@@ -18,12 +18,12 @@ ewl_shadow_new(void)
s = NEW(Ewl_Shadow, 1);
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_shadow_init(s))
{
- ewl_widget_destroy(EWL_WIDGET(s));
- s = NULL;
+ ewl_widget_destroy(EWL_WIDGET(s));
+ s = NULL;
}
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
@@ -41,7 +41,7 @@ ewl_shadow_init(Ewl_Shadow *s)
DCHECK_PARAM_PTR_RET(s, FALSE);
if (!ewl_box_init(EWL_BOX(s)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(s), EWL_ORIENTATION_VERTICAL);
ewl_object_fill_policy_set(EWL_OBJECT(s), EWL_FLAG_FILL_SHRINK);
diff --git a/src/lib/ewl_shadow.h b/src/lib/ewl_shadow.h
index 5415fc8..d4c5ea5 100644
--- a/src/lib/ewl_shadow.h
+++ b/src/lib/ewl_shadow.h
@@ -55,7 +55,7 @@ struct Ewl_Shadow
};
Ewl_Widget *ewl_shadow_new(void);
-int ewl_shadow_init(Ewl_Shadow *s);
+int ewl_shadow_init(Ewl_Shadow *s);
/**
* @}
diff --git a/src/lib/ewl_spacer.c b/src/lib/ewl_spacer.c
index aa38e20..9feb4ee 100644
--- a/src/lib/ewl_spacer.c
+++ b/src/lib/ewl_spacer.c
@@ -18,11 +18,11 @@ ewl_spacer_new(void)
s = NEW(Ewl_Spacer, 1);
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_spacer_init(s)) {
- ewl_widget_destroy(EWL_WIDGET(s));
- s = NULL;
+ ewl_widget_destroy(EWL_WIDGET(s));
+ s = NULL;
}
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
diff --git a/src/lib/ewl_spacer.h b/src/lib/ewl_spacer.h
index 0059708..23ec24a 100644
--- a/src/lib/ewl_spacer.h
+++ b/src/lib/ewl_spacer.h
@@ -52,7 +52,7 @@ struct Ewl_Spacer
#define EWL_SPACER(spacer) ((Ewl_Spacer *) spacer)
Ewl_Widget *ewl_spacer_new(void);
-int ewl_spacer_init(Ewl_Spacer *s);
+int ewl_spacer_init(Ewl_Spacer *s);
/**
* @}
diff --git a/src/lib/ewl_spectrum.c b/src/lib/ewl_spectrum.c
index 78f4f53..8595a48 100644
--- a/src/lib/ewl_spectrum.c
+++ b/src/lib/ewl_spectrum.c
@@ -15,28 +15,28 @@ static void ewl_spectrum_draw(Ewl_Spectrum *sp);
static void ewl_spectrum_cross_hairs_draw(Ewl_Spectrum *sp);
static void ewl_spectrum_mouse_process(Ewl_Spectrum *sp, int x, int y);
static void ewl_spectrum_hsv_to_rgb(double h, double s, double v,
- unsigned int *r, unsigned int *g,
- unsigned int *b);
+ unsigned int *r, unsigned int *g,
+ unsigned int *b);
static void ewl_spectrum_rgb_to_hsv(unsigned int r, unsigned int g, unsigned int b,
- double *h, double *s, double *v);
+ double *h, double *s, double *v);
static void ewl_spectrum_color_coord_map(Ewl_Spectrum *sp, int x, int y,
- int w, int h, unsigned int *r,
- unsigned int *g, unsigned int *b);
+ int w, int h, unsigned int *r,
+ unsigned int *g, unsigned int *b);
static void ewl_spectrum_color_coord_xy_get(Ewl_Spectrum *sp, int *x, int *y,
- int w, int h, unsigned int r,
- unsigned int g, unsigned int b);
+ int w, int h, unsigned int r,
+ unsigned int g, unsigned int b);
static void ewl_spectrum_color_coord_map_vertical(Ewl_Spectrum *sp, int y,
- int img_h, unsigned int *r,
- unsigned int *g, unsigned int *b);
+ int img_h, unsigned int *r,
+ unsigned int *g, unsigned int *b);
static void ewl_spectrum_color_coord_map_square(Ewl_Spectrum *sp, int x,
- int y, int img_w, int img_h, unsigned int *r,
- unsigned int *g, unsigned int *b);
+ int y, int img_w, int img_h, unsigned int *r,
+ unsigned int *g, unsigned int *b);
static void ewl_spectrum_color_coord_vertical_y_get(Ewl_Spectrum *sp,
- int *y, int img_h,
- unsigned int r, unsigned int g, unsigned int b);
+ int *y, int img_h,
+ unsigned int r, unsigned int g, unsigned int b);
static void ewl_spectrum_color_coord_square_xy_get(Ewl_Spectrum *sp,
- int *x, int *y, int img_w, int img_h,
- unsigned int r, unsigned int g, unsigned int b);
+ int *x, int *y, int img_w, int img_h,
+ unsigned int r, unsigned int g, unsigned int b);
/**
* @return Returns a new Ewl_Spectrum widget or NULL on failure
@@ -52,13 +52,13 @@ ewl_spectrum_new(void)
sp = NEW(Ewl_Spectrum, 1);
if (!sp)
{
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
if (!ewl_spectrum_init(EWL_SPECTRUM(sp)))
{
- ewl_widget_destroy(sp);
- sp = NULL;
+ ewl_widget_destroy(sp);
+ sp = NULL;
}
DRETURN_PTR(sp, DLEVEL_STABLE);
@@ -77,23 +77,23 @@ ewl_spectrum_init(Ewl_Spectrum *sp)
if (!ewl_container_init(EWL_CONTAINER(sp)))
{
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_widget_appearance_set(EWL_WIDGET(sp), EWL_SPECTRUM_TYPE);
ewl_widget_inherit(EWL_WIDGET(sp), EWL_SPECTRUM_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(sp), EWL_FLAG_FILL_FILL);
ewl_container_callback_intercept(EWL_CONTAINER(sp),
- EWL_CALLBACK_MOUSE_MOVE);
+ EWL_CALLBACK_MOUSE_MOVE);
ewl_container_callback_intercept(EWL_CONTAINER(sp),
- EWL_CALLBACK_MOUSE_DOWN);
+ EWL_CALLBACK_MOUSE_DOWN);
ewl_container_callback_intercept(EWL_CONTAINER(sp),
- EWL_CALLBACK_MOUSE_UP);
+ EWL_CALLBACK_MOUSE_UP);
ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_MOUSE_DOWN,
- ewl_spectrum_cb_mouse_down, NULL);
+ ewl_spectrum_cb_mouse_down, NULL);
ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_MOUSE_UP,
- ewl_spectrum_cb_mouse_up, NULL);
+ ewl_spectrum_cb_mouse_up, NULL);
sp->type = EWL_SPECTRUM_TYPE_SQUARE;
@@ -103,7 +103,7 @@ ewl_spectrum_init(Ewl_Spectrum *sp)
ewl_object_fill_policy_set(EWL_OBJECT(sp->canvas), EWL_FLAG_FILL_FILL);
ewl_widget_internal_set(sp->canvas, TRUE);
ewl_callback_append(EWL_WIDGET(sp->canvas), EWL_CALLBACK_REVEAL,
- ewl_spectrum_canvas_cb_reveal, sp);
+ ewl_spectrum_canvas_cb_reveal, sp);
ewl_widget_show(sp->canvas);
/* create the cross hairs to draw on the spectrum */
@@ -118,7 +118,7 @@ ewl_spectrum_init(Ewl_Spectrum *sp)
ewl_widget_layer_priority_set(sp->cross_hairs.vertical, 1);
ewl_callback_append(EWL_WIDGET(sp), EWL_CALLBACK_CONFIGURE,
- ewl_spectrum_cb_configure, NULL);
+ ewl_spectrum_cb_configure, NULL);
ewl_spectrum_rgb_set(sp, 255, 255, 255);
@@ -204,7 +204,7 @@ ewl_spectrum_mode_get(Ewl_Spectrum *sp)
*/
void
ewl_spectrum_rgb_set(Ewl_Spectrum *sp, unsigned int r,
- unsigned int g, unsigned int b)
+ unsigned int g, unsigned int b)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(sp);
@@ -235,7 +235,7 @@ ewl_spectrum_rgb_set(Ewl_Spectrum *sp, unsigned int r,
*/
void
ewl_spectrum_rgb_get(Ewl_Spectrum *sp, unsigned int *r,
- unsigned int *g, unsigned int *b)
+ unsigned int *g, unsigned int *b)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(sp);
@@ -315,7 +315,7 @@ ewl_spectrum_hsv_get(Ewl_Spectrum *sp, double *h, double *s, double *v)
*/
void
ewl_spectrum_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Spectrum *sp;
@@ -326,13 +326,13 @@ ewl_spectrum_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
sp = EWL_SPECTRUM(w);
if (!REALIZED(sp))
{
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
ewl_object_position_request(EWL_OBJECT(sp->canvas),
- CURRENT_X(sp), CURRENT_Y(sp));
+ CURRENT_X(sp), CURRENT_Y(sp));
ewl_object_size_request(EWL_OBJECT(sp->canvas),
- CURRENT_W(sp), CURRENT_H(sp));
+ CURRENT_W(sp), CURRENT_H(sp));
ewl_spectrum_draw(sp);
ewl_spectrum_cross_hairs_draw(sp);
@@ -368,7 +368,7 @@ ewl_spectrum_cb_mouse_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
e = ev;
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_spectrum_cb_mouse_move, NULL);
+ ewl_spectrum_cb_mouse_move, NULL);
ewl_spectrum_mouse_process(sp, e->x, e->y);
@@ -411,7 +411,7 @@ ewl_spectrum_cb_mouse_move(Ewl_Widget *w, void *ev, void *data __UNUSED__)
*/
void
ewl_spectrum_cb_mouse_up(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Spectrum *sp;
@@ -421,7 +421,7 @@ ewl_spectrum_cb_mouse_up(Ewl_Widget *w, void *ev __UNUSED__,
sp = EWL_SPECTRUM(w);
ewl_callback_del(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_spectrum_cb_mouse_move);
+ ewl_spectrum_cb_mouse_move);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -436,7 +436,7 @@ ewl_spectrum_cb_mouse_up(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_spectrum_canvas_cb_reveal(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Spectrum *sp;
@@ -465,13 +465,13 @@ ewl_spectrum_mouse_process(Ewl_Spectrum *sp, int x, int y)
y -= CURRENT_Y(sp->canvas);
if (x < 0)
- x = 0;
+ x = 0;
if (y < 0)
- y = 0;
+ y = 0;
if (x > CURRENT_W(sp->canvas))
- x = CURRENT_W(sp->canvas);
+ x = CURRENT_W(sp->canvas);
if (y > CURRENT_H(sp->canvas))
- y = CURRENT_H(sp->canvas);
+ y = CURRENT_H(sp->canvas);
evas_object_image_size_get(EWL_IMAGE(sp->canvas)->image, &img_w, &img_h);
ewl_spectrum_color_coord_map(sp, x, y, img_w, img_h, &r, &g, &b);
@@ -490,7 +490,7 @@ ewl_spectrum_hsv_from_rgb(Ewl_Spectrum *sp)
DCHECK_TYPE(sp, EWL_SPECTRUM_TYPE);
ewl_spectrum_rgb_to_hsv(sp->rgb.r, sp->rgb.g, sp->rgb.b,
- &(sp->hsv.h), &(sp->hsv.s), &(sp->hsv.v));
+ &(sp->hsv.h), &(sp->hsv.s), &(sp->hsv.v));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -503,14 +503,14 @@ ewl_spectrum_rgb_from_hsv(Ewl_Spectrum *sp)
DCHECK_TYPE(sp, EWL_SPECTRUM_TYPE);
ewl_spectrum_hsv_to_rgb(sp->hsv.h, sp->hsv.s, sp->hsv.v,
- &(sp->rgb.r), &(sp->rgb.g), &(sp->rgb.b));
+ &(sp->rgb.r), &(sp->rgb.g), &(sp->rgb.b));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_spectrum_hsv_to_rgb(double h, double s, double v,
- unsigned int *r, unsigned int *g, unsigned int *b)
+ unsigned int *r, unsigned int *g, unsigned int *b)
{
unsigned int r_tmp = 0, g_tmp = 0, b_tmp = 0;
@@ -518,70 +518,70 @@ ewl_spectrum_hsv_to_rgb(double h, double s, double v,
if (s == 0)
{
- unsigned int i;
+ unsigned int i;
- i = v * 255.0;
- r_tmp = i;
- g_tmp = i;
- b_tmp = i;
+ i = v * 255.0;
+ r_tmp = i;
+ g_tmp = i;
+ b_tmp = i;
}
else
{
- double h_tmp, v_tmp, p, q, t, vs, vsf;
- int i;
-
- if (h == 360.0) h = 0.0;
-
- h_tmp = h / 60.0;
- i = h_tmp;
-
- vs = v * s;
- vsf = vs * (h_tmp - i);
-
- p = 255.0 * (v - vs);
- q = 255.0 * (v - vsf);
- t = 255.0 * (v - vs + vsf);
-
- v_tmp = v * 255.0;
-
- switch(i)
- {
- case 0:
- r_tmp = v_tmp;
- g_tmp = t;
- b_tmp = p;
- break;
-
- case 1:
- r_tmp = q;
- g_tmp = v_tmp;
- b_tmp = p;
- break;
-
- case 2:
- r_tmp = p;
- g_tmp = v_tmp;
- b_tmp = t;
- break;
-
- case 3:
- r_tmp = p;
- g_tmp = q;
- b_tmp = v_tmp;
- break;
-
- case 4:
- r_tmp = t;
- g_tmp = p;
- b_tmp = v_tmp;
- break;
-
- case 5:
- r_tmp = v_tmp;
- g_tmp = p;
- b_tmp = q;
- break;
- }
+ double h_tmp, v_tmp, p, q, t, vs, vsf;
+ int i;
+
+ if (h == 360.0) h = 0.0;
+
+ h_tmp = h / 60.0;
+ i = h_tmp;
+
+ vs = v * s;
+ vsf = vs * (h_tmp - i);
+
+ p = 255.0 * (v - vs);
+ q = 255.0 * (v - vsf);
+ t = 255.0 * (v - vs + vsf);
+
+ v_tmp = v * 255.0;
+
+ switch(i)
+ {
+ case 0:
+ r_tmp = v_tmp;
+ g_tmp = t;
+ b_tmp = p;
+ break;
+
+ case 1:
+ r_tmp = q;
+ g_tmp = v_tmp;
+ b_tmp = p;
+ break;
+
+ case 2:
+ r_tmp = p;
+ g_tmp = v_tmp;
+ b_tmp = t;
+ break;
+
+ case 3:
+ r_tmp = p;
+ g_tmp = q;
+ b_tmp = v_tmp;
+ break;
+
+ case 4:
+ r_tmp = t;
+ g_tmp = p;
+ b_tmp = v_tmp;
+ break;
+
+ case 5:
+ r_tmp = v_tmp;
+ g_tmp = p;
+ b_tmp = q;
+ break;
+ }
}
if (r) *r = r_tmp;
@@ -593,7 +593,7 @@ ewl_spectrum_hsv_to_rgb(double h, double s, double v,
static void
ewl_spectrum_rgb_to_hsv(unsigned int r, unsigned int g, unsigned int b,
- double *h, double *s, double *v)
+ double *h, double *s, double *v)
{
unsigned int min, max;
double tmp_h, tmp_s, tmp_v;
@@ -609,18 +609,18 @@ ewl_spectrum_rgb_to_hsv(unsigned int r, unsigned int g, unsigned int b,
if (tmp_s != 0.0)
{
- unsigned int delta;
-
- delta = max - min;
- if ((unsigned int)r == max)
- tmp_h = (g - b) / (float)delta;
- else if ((unsigned int)g == max)
- tmp_h = 2.0 + ((b - r) / (float)delta);
- else if ((unsigned int)b == max)
- tmp_h = 4.0 + ((r - g) / (float)delta);
-
- tmp_h *= 60.0;
- if (tmp_h < 0.0) tmp_h += 360.0;
+ unsigned int delta;
+
+ delta = max - min;
+ if ((unsigned int)r == max)
+ tmp_h = (g - b) / (float)delta;
+ else if ((unsigned int)g == max)
+ tmp_h = 2.0 + ((b - r) / (float)delta);
+ else if ((unsigned int)b == max)
+ tmp_h = 4.0 + ((r - g) / (float)delta);
+
+ tmp_h *= 60.0;
+ if (tmp_h < 0.0) tmp_h += 360.0;
}
if (h) *h = tmp_h;
@@ -644,7 +644,7 @@ ewl_spectrum_draw(Ewl_Spectrum *sp)
DCHECK_TYPE(sp, EWL_SPECTRUM_TYPE);
if (!sp->dirty)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
img = EWL_IMAGE(sp->canvas)->image;
evas_object_image_size_set(img, CURRENT_W(sp), CURRENT_H(sp));
@@ -653,17 +653,17 @@ ewl_spectrum_draw(Ewl_Spectrum *sp)
data = evas_object_image_data_get(img, 1);
if (!data)
{
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
a = 255 << 24;
for (i = 0; i < img_h; i++)
{
- for (k = 0; k < img_w; k++)
- {
- ewl_spectrum_color_coord_map(sp, k, i, img_w, img_h, &r, &g, &b);
- data[(i * img_w) + k] = a | (r << 16) | (g << 8) | b;
- }
+ for (k = 0; k < img_w; k++)
+ {
+ ewl_spectrum_color_coord_map(sp, k, i, img_w, img_h, &r, &g, &b);
+ data[(i * img_w) + k] = a | (r << 16) | (g << 8) | b;
+ }
}
evas_object_image_data_set(img, data);
@@ -685,30 +685,30 @@ ewl_spectrum_cross_hairs_draw(Ewl_Spectrum *sp)
/* get the coords */
evas_object_image_size_get(EWL_IMAGE(sp->canvas)->image, &img_w, &img_h);
ewl_spectrum_color_coord_xy_get(sp, &x, &y, img_w, img_h,
- sp->rgb.r, sp->rgb.g, sp->rgb.b);
+ sp->rgb.r, sp->rgb.g, sp->rgb.b);
x += CURRENT_X(sp->canvas);
y += CURRENT_Y(sp->canvas);
/* place the horizontal cross hair */
y -= CURRENT_H(sp->cross_hairs.horizontal) / 2;
ewl_object_position_request(EWL_OBJECT(sp->cross_hairs.horizontal),
- CURRENT_X(sp), y);
+ CURRENT_X(sp), y);
ewl_object_w_request(EWL_OBJECT(sp->cross_hairs.horizontal),
- CURRENT_W(sp));
+ CURRENT_W(sp));
if (!VISIBLE(sp->cross_hairs.horizontal))
- ewl_widget_show(sp->cross_hairs.horizontal);
+ ewl_widget_show(sp->cross_hairs.horizontal);
/* place the vertical cross hair if needed */
if (sp->type == EWL_SPECTRUM_TYPE_SQUARE)
{
- x -= CURRENT_W(sp->cross_hairs.vertical) / 2;
- ewl_object_position_request(EWL_OBJECT(sp->cross_hairs.vertical),
- x, CURRENT_Y(sp));
- ewl_object_h_request(EWL_OBJECT(sp->cross_hairs.vertical),
- CURRENT_H(sp));
-
- if (!VISIBLE(sp->cross_hairs.vertical))
- ewl_widget_show(sp->cross_hairs.vertical);
+ x -= CURRENT_W(sp->cross_hairs.vertical) / 2;
+ ewl_object_position_request(EWL_OBJECT(sp->cross_hairs.vertical),
+ x, CURRENT_Y(sp));
+ ewl_object_h_request(EWL_OBJECT(sp->cross_hairs.vertical),
+ CURRENT_H(sp));
+
+ if (!VISIBLE(sp->cross_hairs.vertical))
+ ewl_widget_show(sp->cross_hairs.vertical);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -716,34 +716,34 @@ ewl_spectrum_cross_hairs_draw(Ewl_Spectrum *sp)
static void
ewl_spectrum_color_coord_map(Ewl_Spectrum *sp, int x, int y, int img_w, int img_h,
- unsigned int *r, unsigned int *g, unsigned int *b)
+ unsigned int *r, unsigned int *g, unsigned int *b)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(sp);
if (sp->type == EWL_SPECTRUM_TYPE_VERTICAL)
- ewl_spectrum_color_coord_map_vertical(sp, y, img_h, r, g, b);
+ ewl_spectrum_color_coord_map_vertical(sp, y, img_h, r, g, b);
else
- ewl_spectrum_color_coord_map_square(sp, x, y, img_w,
- img_h, r, g, b);
+ ewl_spectrum_color_coord_map_square(sp, x, y, img_w,
+ img_h, r, g, b);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void ewl_spectrum_color_coord_xy_get(Ewl_Spectrum *sp, int *x, int *y,
- int w, int h, unsigned int r,
- unsigned int g, unsigned int b)
+ int w, int h, unsigned int r,
+ unsigned int g, unsigned int b)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(sp);
if (sp->type == EWL_SPECTRUM_TYPE_VERTICAL) {
- ewl_spectrum_color_coord_vertical_y_get(sp, y, h, r, g, b);
- if (x) *x = 0;
+ ewl_spectrum_color_coord_vertical_y_get(sp, y, h, r, g, b);
+ if (x) *x = 0;
}
else
- ewl_spectrum_color_coord_square_xy_get(sp, x, y, w,
- h, r, g, b);
+ ewl_spectrum_color_coord_square_xy_get(sp, x, y, w,
+ h, r, g, b);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -751,7 +751,7 @@ static void ewl_spectrum_color_coord_xy_get(Ewl_Spectrum *sp, int *x, int *y,
static void
ewl_spectrum_color_coord_map_vertical(Ewl_Spectrum *sp, int y, int img_h,
- unsigned int *r, unsigned int *g, unsigned int *b)
+ unsigned int *r, unsigned int *g, unsigned int *b)
{
unsigned int r_tmp, g_tmp, b_tmp;
double h, s, v;
@@ -768,35 +768,35 @@ ewl_spectrum_color_coord_map_vertical(Ewl_Spectrum *sp, int y, int img_h,
v = 1.0;
switch (sp->mode)
{
- case EWL_COLOR_MODE_RGB_RED:
- r_tmp = 255 - ((255 * y) / img_h);
- break;
-
- case EWL_COLOR_MODE_RGB_GREEN:
- g_tmp = 255 - ((255 * y) / img_h);
- break;
- case EWL_COLOR_MODE_RGB_BLUE:
- b_tmp = 255 - ((255 * y) / img_h);
- break;
-
- case EWL_COLOR_MODE_HSV_HUE:
- h = (360.0 * y) / (double)img_h;
- s = 1.0;
- ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
- break;
-
- case EWL_COLOR_MODE_HSV_SATURATION:
- s = 1.0 - (y / (double)img_h);
- ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
- break;
-
- case EWL_COLOR_MODE_HSV_VALUE:
- v = 1.0 - (y / (double)img_h);
- ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
- break;
-
- default:
- break;
+ case EWL_COLOR_MODE_RGB_RED:
+ r_tmp = 255 - ((255 * y) / img_h);
+ break;
+
+ case EWL_COLOR_MODE_RGB_GREEN:
+ g_tmp = 255 - ((255 * y) / img_h);
+ break;
+ case EWL_COLOR_MODE_RGB_BLUE:
+ b_tmp = 255 - ((255 * y) / img_h);
+ break;
+
+ case EWL_COLOR_MODE_HSV_HUE:
+ h = (360.0 * y) / (double)img_h;
+ s = 1.0;
+ ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
+ break;
+
+ case EWL_COLOR_MODE_HSV_SATURATION:
+ s = 1.0 - (y / (double)img_h);
+ ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
+ break;
+
+ case EWL_COLOR_MODE_HSV_VALUE:
+ v = 1.0 - (y / (double)img_h);
+ ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
+ break;
+
+ default:
+ break;
}
if (r) *r = r_tmp;
@@ -808,7 +808,7 @@ ewl_spectrum_color_coord_map_vertical(Ewl_Spectrum *sp, int y, int img_h,
static void
ewl_spectrum_color_coord_map_square(Ewl_Spectrum *sp, int x, int y, int img_w, int img_h,
- unsigned int *r, unsigned int *g, unsigned int *b)
+ unsigned int *r, unsigned int *g, unsigned int *b)
{
unsigned int r_tmp, g_tmp, b_tmp;
double h, s, v;
@@ -818,47 +818,47 @@ ewl_spectrum_color_coord_map_square(Ewl_Spectrum *sp, int x, int y, int img_w, i
switch (sp->mode)
{
- case EWL_COLOR_MODE_RGB_RED:
- r_tmp = sp->rgb.r;
- g_tmp = (1.0 - (y / (double)img_h)) * 255.0;
- b_tmp = (1.0 - (x / (double)img_w)) * 255.0;
- break;
-
- case EWL_COLOR_MODE_RGB_GREEN:
- r_tmp = (1.0 - (y / (double)img_h)) * 255.0;
- g_tmp = sp->rgb.g;
- b_tmp = (1.0 - (x / (double)img_w)) * 255.0;
- break;
-
- case EWL_COLOR_MODE_RGB_BLUE:
- r_tmp = (1.0 - (y / (double)img_h)) * 255.0;
- g_tmp = (1.0 - (x / (double)img_w)) * 255.0;
- b_tmp = sp->rgb.b;
- break;
-
- case EWL_COLOR_MODE_HSV_HUE:
- h = sp->hsv.h;
- s = 1.0 - (y / (double)img_h);
- v = 1.0 - (x / (double)img_w);
- ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
- break;
-
- case EWL_COLOR_MODE_HSV_SATURATION:
- h = (x / (double)img_w) * 360.0;
- s = sp->hsv.s;
- v = 1.0 - (y / (double)img_h);
- ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
- break;
-
- case EWL_COLOR_MODE_HSV_VALUE:
- h = (x / (double)img_w) * 360.0;
- s = 1.0 - (y / (double)img_h);
- v = sp->hsv.v;
- ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
- break;
-
- default:
- break;
+ case EWL_COLOR_MODE_RGB_RED:
+ r_tmp = sp->rgb.r;
+ g_tmp = (1.0 - (y / (double)img_h)) * 255.0;
+ b_tmp = (1.0 - (x / (double)img_w)) * 255.0;
+ break;
+
+ case EWL_COLOR_MODE_RGB_GREEN:
+ r_tmp = (1.0 - (y / (double)img_h)) * 255.0;
+ g_tmp = sp->rgb.g;
+ b_tmp = (1.0 - (x / (double)img_w)) * 255.0;
+ break;
+
+ case EWL_COLOR_MODE_RGB_BLUE:
+ r_tmp = (1.0 - (y / (double)img_h)) * 255.0;
+ g_tmp = (1.0 - (x / (double)img_w)) * 255.0;
+ b_tmp = sp->rgb.b;
+ break;
+
+ case EWL_COLOR_MODE_HSV_HUE:
+ h = sp->hsv.h;
+ s = 1.0 - (y / (double)img_h);
+ v = 1.0 - (x / (double)img_w);
+ ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
+ break;
+
+ case EWL_COLOR_MODE_HSV_SATURATION:
+ h = (x / (double)img_w) * 360.0;
+ s = sp->hsv.s;
+ v = 1.0 - (y / (double)img_h);
+ ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
+ break;
+
+ case EWL_COLOR_MODE_HSV_VALUE:
+ h = (x / (double)img_w) * 360.0;
+ s = 1.0 - (y / (double)img_h);
+ v = sp->hsv.v;
+ ewl_spectrum_hsv_to_rgb(h, s, v, &r_tmp, &g_tmp, &b_tmp);
+ break;
+
+ default:
+ break;
}
if (r) *r = r_tmp;
@@ -870,7 +870,7 @@ ewl_spectrum_color_coord_map_square(Ewl_Spectrum *sp, int x, int y, int img_w, i
static void
ewl_spectrum_color_coord_vertical_y_get(Ewl_Spectrum *sp, int *y, int img_h,
- unsigned int r, unsigned int g, unsigned int b)
+ unsigned int r, unsigned int g, unsigned int b)
{
int tmp_y;
double h, s, v;
@@ -881,34 +881,34 @@ ewl_spectrum_color_coord_vertical_y_get(Ewl_Spectrum *sp, int *y, int img_h,
tmp_y = 0;
switch (sp->mode)
{
- case EWL_COLOR_MODE_RGB_RED:
- tmp_y = ((255 - r) * img_h) / 255;
- break;
-
- case EWL_COLOR_MODE_RGB_GREEN:
- tmp_y = ((255 - g) * img_h) / 255;
- break;
- case EWL_COLOR_MODE_RGB_BLUE:
- tmp_y = ((255 - b) * img_h) / 255;
- break;
-
- case EWL_COLOR_MODE_HSV_HUE:
- ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
- tmp_y = (int) (((360.0 - h) * img_h) / 360.0);
- break;
-
- case EWL_COLOR_MODE_HSV_SATURATION:
- ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
- tmp_y = (int) ((1.0 - s) * img_h);
- break;
-
- case EWL_COLOR_MODE_HSV_VALUE:
- ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
- tmp_y = (int) ((1.0 - v) * img_h);
- break;
-
- default:
- break;
+ case EWL_COLOR_MODE_RGB_RED:
+ tmp_y = ((255 - r) * img_h) / 255;
+ break;
+
+ case EWL_COLOR_MODE_RGB_GREEN:
+ tmp_y = ((255 - g) * img_h) / 255;
+ break;
+ case EWL_COLOR_MODE_RGB_BLUE:
+ tmp_y = ((255 - b) * img_h) / 255;
+ break;
+
+ case EWL_COLOR_MODE_HSV_HUE:
+ ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
+ tmp_y = (int) (((360.0 - h) * img_h) / 360.0);
+ break;
+
+ case EWL_COLOR_MODE_HSV_SATURATION:
+ ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
+ tmp_y = (int) ((1.0 - s) * img_h);
+ break;
+
+ case EWL_COLOR_MODE_HSV_VALUE:
+ ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
+ tmp_y = (int) ((1.0 - v) * img_h);
+ break;
+
+ default:
+ break;
}
if (y) *y = tmp_y;
@@ -919,7 +919,7 @@ ewl_spectrum_color_coord_vertical_y_get(Ewl_Spectrum *sp, int *y, int img_h,
static void
ewl_spectrum_color_coord_square_xy_get(Ewl_Spectrum *sp, int *x, int *y, int img_w, int img_h,
- unsigned int r, unsigned int g, unsigned int b)
+ unsigned int r, unsigned int g, unsigned int b)
{
int tmp_x, tmp_y;
double h, s, v;
@@ -932,41 +932,41 @@ ewl_spectrum_color_coord_square_xy_get(Ewl_Spectrum *sp, int *x, int *y, int img
switch (sp->mode)
{
- case EWL_COLOR_MODE_RGB_RED:
- tmp_x = (int) ((1.0 - b / 255.0) * img_w);
- tmp_y = (int) ((1.0 - g / 255.0) * img_h);
- break;
-
- case EWL_COLOR_MODE_RGB_GREEN:
- tmp_x = (int) ((1.0 - b / 255.0) * img_w);
- tmp_y = (int) ((1.0 - r / 255.0) * img_h);
- break;
-
- case EWL_COLOR_MODE_RGB_BLUE:
- tmp_x = (int) ((1.0 - g / 255.0) * img_w);
- tmp_y = (int) ((1.0 - r / 255.0) * img_h);
- break;
-
- case EWL_COLOR_MODE_HSV_HUE:
- ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
- tmp_x = (int) ((1.0 - v) * img_w);
- tmp_y = (int) ((1.0 - s) * img_h);
- break;
-
- case EWL_COLOR_MODE_HSV_SATURATION:
- ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
- tmp_x = (int) ((1.0 - (h / 360.0)) * img_w);
- tmp_y = (int) ((1.0 - v) * img_h);
- break;
-
- case EWL_COLOR_MODE_HSV_VALUE:
- ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
- tmp_x = (int) ((1.0 - (h / 360.0)) * img_w);
- tmp_y = (int) ((1.0 - s) * img_h);
- break;
-
- default:
- break;
+ case EWL_COLOR_MODE_RGB_RED:
+ tmp_x = (int) ((1.0 - b / 255.0) * img_w);
+ tmp_y = (int) ((1.0 - g / 255.0) * img_h);
+ break;
+
+ case EWL_COLOR_MODE_RGB_GREEN:
+ tmp_x = (int) ((1.0 - b / 255.0) * img_w);
+ tmp_y = (int) ((1.0 - r / 255.0) * img_h);
+ break;
+
+ case EWL_COLOR_MODE_RGB_BLUE:
+ tmp_x = (int) ((1.0 - g / 255.0) * img_w);
+ tmp_y = (int) ((1.0 - r / 255.0) * img_h);
+ break;
+
+ case EWL_COLOR_MODE_HSV_HUE:
+ ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
+ tmp_x = (int) ((1.0 - v) * img_w);
+ tmp_y = (int) ((1.0 - s) * img_h);
+ break;
+
+ case EWL_COLOR_MODE_HSV_SATURATION:
+ ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
+ tmp_x = (int) ((1.0 - (h / 360.0)) * img_w);
+ tmp_y = (int) ((1.0 - v) * img_h);
+ break;
+
+ case EWL_COLOR_MODE_HSV_VALUE:
+ ewl_spectrum_rgb_to_hsv(r, b, g, &h, &s, &v);
+ tmp_x = (int) ((1.0 - (h / 360.0)) * img_w);
+ tmp_y = (int) ((1.0 - s) * img_h);
+ break;
+
+ default:
+ break;
}
if (x) *x = tmp_x;
diff --git a/src/lib/ewl_spectrum.h b/src/lib/ewl_spectrum.h
index d46b133..f7051f4 100644
--- a/src/lib/ewl_spectrum.h
+++ b/src/lib/ewl_spectrum.h
@@ -42,50 +42,50 @@ typedef struct Ewl_Spectrum Ewl_Spectrum;
*/
struct Ewl_Spectrum
{
- Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Widget *canvas; /**< The canvas to draw on */
+ Ewl_Container container; /**< Inherit from Ewl_Container */
+ Ewl_Widget *canvas; /**< The canvas to draw on */
struct
{
- Ewl_Widget *vertical; /**< Vertical portion of the crosshairs */
- Ewl_Widget *horizontal; /**< Horizontal portion of the crosshairs */
- } cross_hairs; /**< Selection crosshairs */
+ Ewl_Widget *vertical; /**< Vertical portion of the crosshairs */
+ Ewl_Widget *horizontal; /**< Horizontal portion of the crosshairs */
+ } cross_hairs; /**< Selection crosshairs */
struct {
- unsigned int r;
- unsigned int g;
- unsigned int b;
- } rgb; /**< Current RBG colour of the spectrum */
+ unsigned int r;
+ unsigned int g;
+ unsigned int b;
+ } rgb; /**< Current RBG colour of the spectrum */
struct {
- double h; /**< The current hue */
- double s; /**< The current saturation */
- double v; /**< The current value */
- } hsv; /**< The HSV setting of the specturm */
-
- Ewl_Color_Mode mode; /**< The mode of the spectrum */
- Ewl_Spectrum_Type type; /**< The type of the spectrum */
- unsigned int dirty:1; /**< The flag to queue redraw */
+ double h; /**< The current hue */
+ double s; /**< The current saturation */
+ double v; /**< The current value */
+ } hsv; /**< The HSV setting of the specturm */
+
+ Ewl_Color_Mode mode; /**< The mode of the spectrum */
+ Ewl_Spectrum_Type type; /**< The type of the spectrum */
+ unsigned int dirty:1; /**< The flag to queue redraw */
};
Ewl_Widget *ewl_spectrum_new(void);
-int ewl_spectrum_init(Ewl_Spectrum *sp);
+int ewl_spectrum_init(Ewl_Spectrum *sp);
-void ewl_spectrum_type_set(Ewl_Spectrum *sp, Ewl_Spectrum_Type type);
+void ewl_spectrum_type_set(Ewl_Spectrum *sp, Ewl_Spectrum_Type type);
Ewl_Spectrum_Type ewl_spectrum_type_get(Ewl_Spectrum *sp);
-void ewl_spectrum_mode_set(Ewl_Spectrum *sp, Ewl_Color_Mode mode);
+void ewl_spectrum_mode_set(Ewl_Spectrum *sp, Ewl_Color_Mode mode);
Ewl_Color_Mode ewl_spectrum_mode_get(Ewl_Spectrum *sp);
-void ewl_spectrum_rgb_set(Ewl_Spectrum *sp, unsigned int r,
- unsigned int g, unsigned int b);
-void ewl_spectrum_rgb_get(Ewl_Spectrum *sp, unsigned int *r,
- unsigned int *g, unsigned int *b);
+void ewl_spectrum_rgb_set(Ewl_Spectrum *sp, unsigned int r,
+ unsigned int g, unsigned int b);
+void ewl_spectrum_rgb_get(Ewl_Spectrum *sp, unsigned int *r,
+ unsigned int *g, unsigned int *b);
-void ewl_spectrum_hsv_set(Ewl_Spectrum *sp, double h,
- double s, double v);
-void ewl_spectrum_hsv_get(Ewl_Spectrum *sp, double *h,
- double *s, double *v);
+void ewl_spectrum_hsv_set(Ewl_Spectrum *sp, double h,
+ double s, double v);
+void ewl_spectrum_hsv_get(Ewl_Spectrum *sp, double *h,
+ double *s, double *v);
/*
* Internally used callbacks, override at your own risk.
diff --git a/src/lib/ewl_spinner.c b/src/lib/ewl_spinner.c
index f98a6ba..520a1e3 100644
--- a/src/lib/ewl_spinner.c
+++ b/src/lib/ewl_spinner.c
@@ -24,11 +24,11 @@ ewl_spinner_new(void)
s = NEW(Ewl_Spinner, 1);
if (!s)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_spinner_init(s)) {
- ewl_widget_destroy(EWL_WIDGET(s));
- s = NULL;
+ ewl_widget_destroy(EWL_WIDGET(s));
+ s = NULL;
}
DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
@@ -53,49 +53,49 @@ ewl_spinner_init(Ewl_Spinner *s)
if (!ewl_range_init(EWL_RANGE(w)))
{
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_widget_appearance_set(w, EWL_SPINNER_TYPE);
ewl_widget_inherit(w, EWL_SPINNER_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_HSHRINK |
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
ewl_callback_append(w, EWL_CALLBACK_REALIZE,
- ewl_spinner_cb_realize, NULL);
+ ewl_spinner_cb_realize, NULL);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE,
- ewl_spinner_cb_configure, NULL);
+ ewl_spinner_cb_configure, NULL);
ewl_callback_append(w, EWL_CALLBACK_VALUE_CHANGED,
- ewl_spinner_cb_value_changed, NULL);
+ ewl_spinner_cb_value_changed, NULL);
ewl_callback_prepend(w, EWL_CALLBACK_DESTROY,
- ewl_spinner_cb_destroy, NULL);
+ ewl_spinner_cb_destroy, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN,
- ewl_container_cb_widget_focus_in, NULL);
+ ewl_container_cb_widget_focus_in, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT,
- ewl_container_cb_widget_focus_out, NULL);
+ ewl_container_cb_widget_focus_out, NULL);
ewl_container_show_notify_set(EWL_CONTAINER(w),
- ewl_spinner_cb_child_show);
+ ewl_spinner_cb_child_show);
ewl_container_resize_notify_set(EWL_CONTAINER(w),
- ewl_spinner_cb_child_resize);
+ ewl_spinner_cb_child_resize);
s->entry = ewl_entry_new();
ewl_text_text_set(EWL_TEXT(s->entry), "0");
ewl_container_child_append(EWL_CONTAINER(s), s->entry);
ewl_object_fill_policy_set(EWL_OBJECT(s->entry), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HSHRINK);
ewl_object_alignment_set(EWL_OBJECT(s->entry), EWL_FLAG_ALIGN_LEFT);
ewl_widget_internal_set(EWL_WIDGET(s->entry), TRUE);
ewl_callback_del(s->entry, EWL_CALLBACK_KEY_DOWN,
- ewl_entry_cb_key_down);
+ ewl_entry_cb_key_down);
ewl_callback_append(EWL_WIDGET(s), EWL_CALLBACK_KEY_DOWN,
- ewl_spinner_cb_key_down, NULL);
+ ewl_spinner_cb_key_down, NULL);
ewl_callback_append(EWL_WIDGET(s), EWL_CALLBACK_FOCUS_OUT,
- ewl_spinner_cb_focus_out, NULL);
+ ewl_spinner_cb_focus_out, NULL);
ewl_callback_append(EWL_WIDGET(s), EWL_CALLBACK_MOUSE_WHEEL,
- ewl_spinner_cb_wheel, NULL);
+ ewl_spinner_cb_wheel, NULL);
ewl_widget_show(s->entry);
@@ -109,33 +109,33 @@ ewl_spinner_init(Ewl_Spinner *s)
s->increment = ewl_button_new();
ewl_container_child_append(EWL_CONTAINER(s->vbox), s->increment);
ewl_object_alignment_set(EWL_OBJECT(s->increment),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_widget_appearance_set(s->increment, "increment");
ewl_object_fill_policy_set(EWL_OBJECT(s->increment),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_widget_internal_set(s->increment, TRUE);
ewl_callback_append(s->increment, EWL_CALLBACK_MOUSE_DOWN,
- ewl_spinner_cb_increase_value, w);
+ ewl_spinner_cb_increase_value, w);
ewl_callback_append(s->increment, EWL_CALLBACK_MOUSE_UP,
- ewl_spinner_cb_value_stop, w);
+ ewl_spinner_cb_value_stop, w);
ewl_callback_append(s->increment, EWL_CALLBACK_KEY_DOWN,
- ewl_spinner_cb_key_down, s);
+ ewl_spinner_cb_key_down, s);
ewl_widget_show(s->increment);
s->decrement = ewl_button_new();
ewl_container_child_append(EWL_CONTAINER(s->vbox), s->decrement);
ewl_object_alignment_set(EWL_OBJECT(s->decrement),
- EWL_FLAG_ALIGN_CENTER);
+ EWL_FLAG_ALIGN_CENTER);
ewl_widget_appearance_set(s->decrement, "decrement");
ewl_object_fill_policy_set(EWL_OBJECT(s->decrement),
- EWL_FLAG_FILL_NONE);
+ EWL_FLAG_FILL_NONE);
ewl_widget_internal_set(s->decrement, TRUE);
ewl_callback_append(s->decrement, EWL_CALLBACK_MOUSE_DOWN,
- ewl_spinner_cb_decrease_value, w);
+ ewl_spinner_cb_decrease_value, w);
ewl_callback_append(s->decrement, EWL_CALLBACK_MOUSE_UP,
- ewl_spinner_cb_value_stop, w);
+ ewl_spinner_cb_value_stop, w);
ewl_callback_append(s->decrement, EWL_CALLBACK_KEY_DOWN,
- ewl_spinner_cb_key_down, s);
+ ewl_spinner_cb_key_down, s);
ewl_widget_show(s->decrement);
s->digits = 2;
@@ -189,7 +189,7 @@ ewl_spinner_digits_get(Ewl_Spinner *s)
*/
void
ewl_spinner_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Spinner *s;
@@ -213,7 +213,7 @@ ewl_spinner_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_spinner_cb_value_changed(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Spinner *s;
@@ -237,7 +237,7 @@ ewl_spinner_cb_value_changed(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_spinner_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Spinner *s;
int cx, cy, cw, ch;
@@ -272,7 +272,7 @@ ewl_spinner_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_spinner_cb_key_down(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Entry *e;
Ewl_Spinner *s;
@@ -289,36 +289,36 @@ ewl_spinner_cb_key_down(Ewl_Widget *w, void *ev_data,
ev = ev_data;
if (!strcmp(ev->keyname, "Up"))
- ewl_spinner_cb_increase_value(w, NULL, s);
+ ewl_spinner_cb_increase_value(w, NULL, s);
else if (!strcmp(ev->keyname, "Down"))
- ewl_spinner_cb_decrease_value(w, NULL, s);
+ ewl_spinner_cb_decrease_value(w, NULL, s);
else if (!strcmp(ev->keyname, "Left"))
- ewl_entry_cursor_move_left(e);
+ ewl_entry_cursor_move_left(e);
else if (!strcmp(ev->keyname, "Right"))
- ewl_entry_cursor_move_right(e);
+ ewl_entry_cursor_move_right(e);
/*
else if (!strcmp(ev->keyname, "Home"))
- ewl_entry_cursor_home_move(e);
+ ewl_entry_cursor_home_move(e);
else if (!strcmp(ev->keyname, "End"))
- ewl_entry_cursor_end_move(e);
+ ewl_entry_cursor_end_move(e);
*/
else if (!strcmp(ev->keyname, "BackSpace"))
- ewl_entry_delete_left(e);
+ ewl_entry_delete_left(e);
else if (!strcmp(ev->keyname, "Delete"))
- ewl_entry_delete_right(e);
+ ewl_entry_delete_right(e);
else if (ev->keyname && (isdigit(ev->keyname[0]) ||
- ev->keyname[0] == '.' ||
- ev->keyname[0] == '-'))
+ ev->keyname[0] == '.' ||
+ ev->keyname[0] == '-'))
{
- ewl_entry_selection_clear(e);
- ewl_text_text_insert(EWL_TEXT(e), ev->keyname,
- ewl_text_cursor_position_get(EWL_TEXT(e)));
+ ewl_entry_selection_clear(e);
+ ewl_text_text_insert(EWL_TEXT(e), ev->keyname,
+ ewl_text_cursor_position_get(EWL_TEXT(e)));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -334,7 +334,7 @@ ewl_spinner_cb_key_down(Ewl_Widget *w, void *ev_data,
*/
void
ewl_spinner_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Spinner *s;
char *str;
@@ -348,11 +348,11 @@ ewl_spinner_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
str = ewl_text_text_get(EWL_TEXT(s->entry));
if (str && strlen(str)) {
- val = atof(str);
- ewl_range_value_set(EWL_RANGE(s), (double) (val));
+ val = atof(str);
+ ewl_range_value_set(EWL_RANGE(s), (double) (val));
} else if (str)
- FREE(str);
+ FREE(str);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -367,7 +367,7 @@ ewl_spinner_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_spinner_cb_wheel(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Range *r;
Ewl_Event_Mouse_Wheel *wheel;
@@ -416,7 +416,7 @@ ewl_spinner_entry_update(Ewl_Spinner *s)
*/
void
ewl_spinner_cb_increase_value(Ewl_Widget *w __UNUSED__, void *ev_data,
- void *user_data)
+ void *user_data)
{
Ewl_Spinner *s;
Ewl_Range *r;
@@ -430,15 +430,15 @@ ewl_spinner_cb_increase_value(Ewl_Widget *w __UNUSED__, void *ev_data,
ewl_spinner_cb_focus_out(EWL_WIDGET(s), NULL, NULL);
if (!r->invert)
- ewl_range_increase(r);
+ ewl_range_increase(r);
else
- ewl_range_decrease(r);
+ ewl_range_decrease(r);
if (ev_data) {
- s->direction = (!r->invert) ? 1 : -1;
- s->start_time = ecore_time_get();
- s->last_value = 0.0;
- s->timer = ecore_timer_add(0.02, ewl_spinner_timer, s);
+ s->direction = (!r->invert) ? 1 : -1;
+ s->start_time = ecore_time_get();
+ s->last_value = 0.0;
+ s->timer = ecore_timer_add(0.02, ewl_spinner_timer, s);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -454,7 +454,7 @@ ewl_spinner_cb_increase_value(Ewl_Widget *w __UNUSED__, void *ev_data,
*/
void
ewl_spinner_cb_value_stop(Ewl_Widget *w __UNUSED__,
- void *ev_data __UNUSED__, void *user_data)
+ void *ev_data __UNUSED__, void *user_data)
{
Ewl_Spinner *s;
@@ -464,11 +464,11 @@ ewl_spinner_cb_value_stop(Ewl_Widget *w __UNUSED__,
s = user_data;
if (s->timer) {
- ecore_timer_del(s->timer);
+ ecore_timer_del(s->timer);
- s->timer = NULL;
- s->direction = 0;
- s->start_time = 0;
+ s->timer = NULL;
+ s->direction = 0;
+ s->start_time = 0;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -484,7 +484,7 @@ ewl_spinner_cb_value_stop(Ewl_Widget *w __UNUSED__,
*/
void
ewl_spinner_cb_decrease_value(Ewl_Widget *w __UNUSED__, void *ev_data,
- void *user_data)
+ void *user_data)
{
Ewl_Spinner *s;
Ewl_Range *r;
@@ -499,15 +499,15 @@ ewl_spinner_cb_decrease_value(Ewl_Widget *w __UNUSED__, void *ev_data,
ewl_spinner_cb_focus_out(EWL_WIDGET(s), NULL, NULL);
if (!r->invert)
- ewl_range_decrease(r);
+ ewl_range_decrease(r);
else
- ewl_range_increase(r);
+ ewl_range_increase(r);
if (ev_data) {
- s->direction = (!r->invert) ? -1 : 1;
- s->start_time = ecore_time_get();
- s->last_value = 0.0;
- s->timer = ecore_timer_add(0.02, ewl_spinner_timer, s);
+ s->direction = (!r->invert) ? -1 : 1;
+ s->start_time = ecore_time_get();
+ s->last_value = 0.0;
+ s->timer = ecore_timer_add(0.02, ewl_spinner_timer, s);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -523,7 +523,7 @@ ewl_spinner_cb_decrease_value(Ewl_Widget *w __UNUSED__, void *ev_data,
*/
void
ewl_spinner_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Spinner *s;
@@ -533,8 +533,8 @@ ewl_spinner_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
s = EWL_SPINNER(w);
if (s->timer) {
- ecore_timer_del(s->timer);
- s->timer = NULL;
+ ecore_timer_del(s->timer);
+ s->timer = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -564,9 +564,9 @@ ewl_spinner_timer(void *data)
*/
velocity = ewl_theme_data_int_get(EWL_WIDGET(s), "velocity");
if (velocity < 1)
- velocity = 1;
+ velocity = 1;
else if (velocity > 10)
- velocity = 10;
+ velocity = 10;
/*
* Move the value of the spinner based on the direction of it's motion
@@ -575,10 +575,10 @@ ewl_spinner_timer(void *data)
dv = velocity * s->direction * 10.0 * r->step * dt*dt;
while (r->step < abs(dv - s->last_value - step)) {
- if (s->direction == 1)
- step += r->step;
- else
- step -= r->step;
+ if (s->direction == 1)
+ step += r->step;
+ else
+ step -= r->step;
}
ewl_range_value_set(r, r->value + step);
@@ -603,7 +603,7 @@ ewl_spinner_child_handle(Ewl_Spinner *s)
peh = ewl_object_preferred_h_get(EWL_OBJECT(s->entry));
ewl_object_preferred_inner_size_set(EWL_OBJECT(s), pvw + pew,
- MAX(peh, pvh));
+ MAX(peh, pvh));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -638,8 +638,8 @@ ewl_spinner_cb_child_show(Ewl_Container *c, Ewl_Widget *w __UNUSED__)
*/
void
ewl_spinner_cb_child_resize(Ewl_Container *c, Ewl_Widget *w __UNUSED__,
- int size __UNUSED__,
- Ewl_Orientation o __UNUSED__)
+ int size __UNUSED__,
+ Ewl_Orientation o __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
diff --git a/src/lib/ewl_spinner.h b/src/lib/ewl_spinner.h
index 7b8e1c4..c578586 100644
--- a/src/lib/ewl_spinner.h
+++ b/src/lib/ewl_spinner.h
@@ -51,49 +51,49 @@ typedef struct Ewl_Spinner Ewl_Spinner;
*/
struct Ewl_Spinner
{
- Ewl_Range range; /**< Inherit from Ewl_Range */
- unsigned char digits; /**< Number of digits displayed after decimal */
- Ewl_Widget *entry; /**< The Ewl_Entry displaying value */
- Ewl_Widget *vbox; /**< Ewl_Box to hold the buttons */
- Ewl_Widget *increment; /**< Ewl_Button to add value */
- Ewl_Widget *decrement; /**< Ewl_Button to subtract value */
- double start_time; /**< Time the spinner was pressed */
- double last_value; /**< The last value while spinning */
- int direction; /**< Indicate increasing/decreasing value */
- Ecore_Timer *timer; /**< Timer for tracking mouse button held down */
+ Ewl_Range range; /**< Inherit from Ewl_Range */
+ unsigned char digits; /**< Number of digits displayed after decimal */
+ Ewl_Widget *entry; /**< The Ewl_Entry displaying value */
+ Ewl_Widget *vbox; /**< Ewl_Box to hold the buttons */
+ Ewl_Widget *increment; /**< Ewl_Button to add value */
+ Ewl_Widget *decrement; /**< Ewl_Button to subtract value */
+ double start_time; /**< Time the spinner was pressed */
+ double last_value; /**< The last value while spinning */
+ int direction; /**< Indicate increasing/decreasing value */
+ Ecore_Timer *timer; /**< Timer for tracking mouse button held down */
};
Ewl_Widget *ewl_spinner_new(void);
-int ewl_spinner_init(Ewl_Spinner *s);
+int ewl_spinner_init(Ewl_Spinner *s);
-void ewl_spinner_digits_set(Ewl_Spinner *s, unsigned char digits);
+void ewl_spinner_digits_set(Ewl_Spinner *s, unsigned char digits);
unsigned char ewl_spinner_digits_get(Ewl_Spinner *s);
/*
* Internally used callbacks, override at your own risk.
*/
void ewl_spinner_cb_realize(Ewl_Widget *widget, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_value_changed(Ewl_Widget *widget, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_configure(Ewl_Widget *widget, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_key_down(Ewl_Widget *widget, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_focus_out(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_wheel(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_increase_value(Ewl_Widget *widget, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_decrease_value(Ewl_Widget *widget, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_spinner_cb_value_stop(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_spinner_cb_destroy(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_spinner_cb_child_show(Ewl_Container *c, Ewl_Widget *w);
void ewl_spinner_cb_child_resize(Ewl_Container *c, Ewl_Widget *w, int size,
- Ewl_Orientation o);
+ Ewl_Orientation o);
/**
* @}
*/
diff --git a/src/lib/ewl_statusbar.c b/src/lib/ewl_statusbar.c
index 642a942..7940222 100644
--- a/src/lib/ewl_statusbar.c
+++ b/src/lib/ewl_statusbar.c
@@ -19,11 +19,11 @@ ewl_statusbar_new(void)
sb = NEW(Ewl_Statusbar, 1);
if (!sb)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_statusbar_init(sb)) {
- ewl_widget_destroy(EWL_WIDGET(sb));
- sb = NULL;
+ ewl_widget_destroy(EWL_WIDGET(sb));
+ sb = NULL;
}
DRETURN_PTR(EWL_WIDGET(sb), DLEVEL_STABLE);
@@ -45,11 +45,11 @@ ewl_statusbar_init(Ewl_Statusbar *sb)
w = EWL_WIDGET(sb);
if (!ewl_box_init(EWL_BOX(sb))) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_object_fill_policy_set(EWL_OBJECT(w),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_box_orientation_set(EWL_BOX(sb), EWL_ORIENTATION_HORIZONTAL);
ewl_widget_appearance_set(w, EWL_STATUSBAR_TYPE);
@@ -75,12 +75,12 @@ ewl_statusbar_init(Ewl_Statusbar *sb)
ewl_widget_show(sb->right);
ewl_container_redirect_set(EWL_CONTAINER(sb),
- EWL_CONTAINER(sb->right));
+ EWL_CONTAINER(sb->right));
sb->stack = ecore_list_new();
ewl_callback_append(EWL_WIDGET(sb), EWL_CALLBACK_DESTROY,
- ewl_statusbar_cb_destroy, NULL);
+ ewl_statusbar_cb_destroy, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -172,9 +172,9 @@ ewl_statusbar_active_set(Ewl_Statusbar *sb, Ewl_Position pos)
DCHECK_TYPE(sb, EWL_STATUSBAR_TYPE);
if ((pos == EWL_POSITION_LEFT) || (pos == EWL_POSITION_TOP))
- ewl_container_redirect_set(EWL_CONTAINER(sb), EWL_CONTAINER(sb->left));
+ ewl_container_redirect_set(EWL_CONTAINER(sb), EWL_CONTAINER(sb->left));
else
- ewl_container_redirect_set(EWL_CONTAINER(sb), EWL_CONTAINER(sb->right));
+ ewl_container_redirect_set(EWL_CONTAINER(sb), EWL_CONTAINER(sb->right));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -278,8 +278,8 @@ ewl_statusbar_push(Ewl_Statusbar *sb, char *txt)
DCHECK_TYPE(sb, EWL_STATUSBAR_TYPE);
if (sb->current) {
- ewl_widget_hide(sb->current);
- // ewl_container_child_remove(EWL_CONTAINER(sb->status), sb->current);
+ ewl_widget_hide(sb->current);
+ // ewl_container_child_remove(EWL_CONTAINER(sb->status), sb->current);
}
sb->current = ewl_label_new();
@@ -309,11 +309,11 @@ ewl_statusbar_pop(Ewl_Statusbar *sb)
current = ecore_list_first_remove(sb->stack);
if (current)
- ewl_widget_destroy(current);
+ ewl_widget_destroy(current);
current = ecore_list_first_goto(sb->stack);
if (current)
- ewl_widget_show(current);
+ ewl_widget_show(current);
sb->current = current;
@@ -322,7 +322,7 @@ ewl_statusbar_pop(Ewl_Statusbar *sb)
void
ewl_statusbar_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Statusbar *sb;
diff --git a/src/lib/ewl_statusbar.h b/src/lib/ewl_statusbar.h
index 806c0b3..a5591eb 100644
--- a/src/lib/ewl_statusbar.h
+++ b/src/lib/ewl_statusbar.h
@@ -50,30 +50,30 @@ typedef struct Ewl_Statusbar Ewl_Statusbar;
*/
struct Ewl_Statusbar
{
- Ewl_Box outer_box; /**< Inherit from Ewl_Box */
- Ewl_Widget *left; /**< The left container **/
- Ewl_Widget *status; /**< The status container */
- Ewl_Widget *right; /**< The right container */
- Ecore_List *stack; /**< The stack of status' */
- Ewl_Widget *current; /**< The currently displayed status */
+ Ewl_Box outer_box; /**< Inherit from Ewl_Box */
+ Ewl_Widget *left; /**< The left container **/
+ Ewl_Widget *status; /**< The status container */
+ Ewl_Widget *right; /**< The right container */
+ Ecore_List *stack; /**< The stack of status' */
+ Ewl_Widget *current; /**< The currently displayed status */
};
Ewl_Widget *ewl_statusbar_new(void);
-int ewl_statusbar_init(Ewl_Statusbar *sb);
+int ewl_statusbar_init(Ewl_Statusbar *sb);
-void ewl_statusbar_left_hide(Ewl_Statusbar *sb);
-void ewl_statusbar_left_show(Ewl_Statusbar *sb);
-void ewl_statusbar_right_hide(Ewl_Statusbar *sb);
-void ewl_statusbar_right_show(Ewl_Statusbar *sb);
+void ewl_statusbar_left_hide(Ewl_Statusbar *sb);
+void ewl_statusbar_left_show(Ewl_Statusbar *sb);
+void ewl_statusbar_right_hide(Ewl_Statusbar *sb);
+void ewl_statusbar_right_show(Ewl_Statusbar *sb);
-void ewl_statusbar_active_set(Ewl_Statusbar *sb, Ewl_Position pos);
-void ewl_statusbar_left_append(Ewl_Statusbar *sb, Ewl_Widget *w);
-void ewl_statusbar_left_prepend(Ewl_Statusbar *sb, Ewl_Widget *w);
-void ewl_statusbar_right_append(Ewl_Statusbar *sb, Ewl_Widget *w);
-void ewl_statusbar_right_prepend(Ewl_Statusbar *sb, Ewl_Widget *w);
+void ewl_statusbar_active_set(Ewl_Statusbar *sb, Ewl_Position pos);
+void ewl_statusbar_left_append(Ewl_Statusbar *sb, Ewl_Widget *w);
+void ewl_statusbar_left_prepend(Ewl_Statusbar *sb, Ewl_Widget *w);
+void ewl_statusbar_right_append(Ewl_Statusbar *sb, Ewl_Widget *w);
+void ewl_statusbar_right_prepend(Ewl_Statusbar *sb, Ewl_Widget *w);
-void ewl_statusbar_push(Ewl_Statusbar *sb, char *txt);
-void ewl_statusbar_pop(Ewl_Statusbar *sb);
+void ewl_statusbar_push(Ewl_Statusbar *sb, char *txt);
+void ewl_statusbar_pop(Ewl_Statusbar *sb);
/*
* Internal functions
diff --git a/src/lib/ewl_stock.c b/src/lib/ewl_stock.c
index 3e377f6..b80a501 100644
--- a/src/lib/ewl_stock.c
+++ b/src/lib/ewl_stock.c
@@ -16,22 +16,22 @@ struct
const char * const image_key;
const char * const tooltip;
} ewl_stock_items[] = {
- {"Apply", EWL_ICON_DIALOG_APPLY, "Apply"},
- {/*Arrow*/"Down", EWL_ICON_GO_DOWN, "Down"},
- {/*Arrow*/"Left", EWL_ICON_GO_PREVIOUS, "Previous"},
- {/*Arrow*/"Right", EWL_ICON_GO_NEXT, "Next"},
- {/*Arrow*/"Up", EWL_ICON_GO_UP, "Up"},
- {"Cancel", EWL_ICON_DIALOG_CANCEL, "Cancel"},
- {"FF", EWL_ICON_MEDIA_SEEK_FORWARD, "Fast Forward"},
- {"Home", EWL_ICON_GO_HOME, "Home"},
- {"Ok", EWL_ICON_DIALOG_OK, "OK"},
- {"Open", EWL_ICON_DOCUMENT_OPEN, "Open"},
- {"Pause", EWL_ICON_MEDIA_PLAYBACK_PAUSE, "Pause"},
- {"Play", EWL_ICON_MEDIA_PLAYBACK_START, "Play"},
- {"Quit", EWL_ICON_SYSTEM_LOG_OUT, "Quit"},
- {"Rewind", EWL_ICON_MEDIA_SEEK_BACKWARD, "Rewind"},
- {"Save", EWL_ICON_DOCUMENT_SAVE, "Save"},
- {"Stop", EWL_ICON_MEDIA_PLAYBACK_STOP, "Stop"}
+ {"Apply", EWL_ICON_DIALOG_APPLY, "Apply"},
+ {/*Arrow*/"Down", EWL_ICON_GO_DOWN, "Down"},
+ {/*Arrow*/"Left", EWL_ICON_GO_PREVIOUS, "Previous"},
+ {/*Arrow*/"Right", EWL_ICON_GO_NEXT, "Next"},
+ {/*Arrow*/"Up", EWL_ICON_GO_UP, "Up"},
+ {"Cancel", EWL_ICON_DIALOG_CANCEL, "Cancel"},
+ {"FF", EWL_ICON_MEDIA_SEEK_FORWARD, "Fast Forward"},
+ {"Home", EWL_ICON_GO_HOME, "Home"},
+ {"Ok", EWL_ICON_DIALOG_OK, "OK"},
+ {"Open", EWL_ICON_DOCUMENT_OPEN, "Open"},
+ {"Pause", EWL_ICON_MEDIA_PLAYBACK_PAUSE, "Pause"},
+ {"Play", EWL_ICON_MEDIA_PLAYBACK_START, "Play"},
+ {"Quit", EWL_ICON_SYSTEM_LOG_OUT, "Quit"},
+ {"Rewind", EWL_ICON_MEDIA_SEEK_BACKWARD, "Rewind"},
+ {"Save", EWL_ICON_DOCUMENT_SAVE, "Save"},
+ {"Stop", EWL_ICON_MEDIA_PLAYBACK_STOP, "Stop"}
};
/**
@@ -49,7 +49,7 @@ ewl_stock_init(Ewl_Stock *s)
DCHECK_PARAM_PTR_RET(s, FALSE);
if (!ewl_box_init(EWL_BOX(s)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(s), EWL_STOCK_TYPE);
@@ -90,40 +90,40 @@ ewl_stock_type_set(Ewl_Stock *s, Ewl_Stock_Type stock)
DCHECK_TYPE(s, EWL_STOCK_TYPE);
if (stock == s->stock_type)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
s->stock_type = stock;
/* we're done if it's none */
if (s->stock_type == EWL_STOCK_NONE)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* Can't do anything without the stock funcs */
if (!s->stock_funcs)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* set the label */
if (s->stock_funcs->label_set)
- s->stock_funcs->label_set(s,
- ewl_stock_items[s->stock_type].label);
+ s->stock_funcs->label_set(s,
+ ewl_stock_items[s->stock_type].label);
/* set the image */
if (s->stock_funcs->image_set) {
- const char *data;
+ const char *data;
- /* check for an image key */
- data = ewl_icon_theme_icon_path_get(
- ewl_stock_items[s->stock_type].image_key,
- EWL_ICON_SIZE_MEDIUM);
+ /* check for an image key */
+ data = ewl_icon_theme_icon_path_get(
+ ewl_stock_items[s->stock_type].image_key,
+ EWL_ICON_SIZE_MEDIUM);
- s->stock_funcs->image_set(s, data,
- ewl_stock_items[s->stock_type].image_key);
+ s->stock_funcs->image_set(s, data,
+ ewl_stock_items[s->stock_type].image_key);
}
/* set the tooltip */
if (s->stock_funcs->tooltip_set)
- s->stock_funcs->tooltip_set(s,
- ewl_stock_items[s->stock_type].tooltip);
+ s->stock_funcs->tooltip_set(s,
+ ewl_stock_items[s->stock_type].tooltip);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_stock.h b/src/lib/ewl_stock.h
index 9e4edae..87cae6d 100644
--- a/src/lib/ewl_stock.h
+++ b/src/lib/ewl_stock.h
@@ -86,9 +86,9 @@ typedef void (*Ewl_Stock_Tooltip_Set)(Ewl_Stock *s, const char *tip);
*/
struct Ewl_Stock
{
- Ewl_Box box; /**< Inherit from the box for adding widgets */
- Ewl_Stock_Type stock_type; /**< The stock type of the stock */
- const Ewl_Stock_Funcs *stock_funcs; /**< The stock functions */
+ Ewl_Box box; /**< Inherit from the box for adding widgets */
+ Ewl_Stock_Type stock_type; /**< The stock type of the stock */
+ const Ewl_Stock_Funcs *stock_funcs; /**< The stock functions */
};
/**
@@ -97,17 +97,17 @@ struct Ewl_Stock
*/
struct Ewl_Stock_Funcs
{
- Ewl_Stock_Label_Set label_set; /**< The label set function */
- Ewl_Stock_Image_Set image_set; /**< The image set function */
- Ewl_Stock_Tooltip_Set tooltip_set; /**< The tooltip set function */
+ Ewl_Stock_Label_Set label_set; /**< The label set function */
+ Ewl_Stock_Image_Set image_set; /**< The image set function */
+ Ewl_Stock_Tooltip_Set tooltip_set; /**< The tooltip set function */
};
-int ewl_stock_init(Ewl_Stock *s);
+int ewl_stock_init(Ewl_Stock *s);
-void ewl_stock_functions_set(Ewl_Stock *s, const Ewl_Stock_Funcs * const funcs);
+void ewl_stock_functions_set(Ewl_Stock *s, const Ewl_Stock_Funcs * const funcs);
-void ewl_stock_type_set(Ewl_Stock *s, Ewl_Stock_Type stock);
+void ewl_stock_type_set(Ewl_Stock *s, Ewl_Stock_Type stock);
Ewl_Stock_Type ewl_stock_type_get(Ewl_Stock *s);
/**
diff --git a/src/lib/ewl_table.c b/src/lib/ewl_table.c
index 53b583c..9dd3418 100644
--- a/src/lib/ewl_table.c
+++ b/src/lib/ewl_table.c
@@ -23,11 +23,11 @@ ewl_table_new(int cols, int rows, char **col_headers)
t = NEW(Ewl_Table, 1);
if (!t)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_table_init(t, cols, rows, col_headers)) {
- ewl_widget_destroy(EWL_WIDGET(t));
- t = NULL;
+ ewl_widget_destroy(EWL_WIDGET(t));
+ t = NULL;
}
DRETURN_PTR(EWL_WIDGET(t), DLEVEL_STABLE);
@@ -58,7 +58,7 @@ ewl_table_init(Ewl_Table *t, int cols, int rows, char **col_headers)
* Iniitialize the tables inherited fields
*/
if (!ewl_container_init(EWL_CONTAINER(t))) {
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
ewl_widget_appearance_set(EWL_WIDGET(t), EWL_TABLE_TYPE);
ewl_widget_inherit(EWL_WIDGET(t), EWL_TABLE_TYPE);
@@ -71,9 +71,9 @@ ewl_table_init(Ewl_Table *t, int cols, int rows, char **col_headers)
*/
t->grid = (Ewl_Grid *)ewl_grid_new();
if (col_headers)
- ewl_grid_dimensions_set(t->grid, cols, rows + 1);
+ ewl_grid_dimensions_set(t->grid, cols, rows + 1);
else
- ewl_grid_dimensions_set(t->grid, cols, rows);
+ ewl_grid_dimensions_set(t->grid, cols, rows);
ewl_container_child_append(EWL_CONTAINER(t), EWL_WIDGET(t->grid));
ewl_widget_show(EWL_WIDGET(t->grid));
@@ -82,23 +82,23 @@ ewl_table_init(Ewl_Table *t, int cols, int rows, char **col_headers)
*/
if (col_headers != NULL) {
- for (i = 1; i <= cols; i++) {
- cell = (Ewl_Cell *) ewl_cell_new();
- button = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(button), col_headers[i - 1]);
- ewl_widget_disable(button);
- ewl_container_child_append(EWL_CONTAINER(cell), button);
- ewl_object_fill_policy_set(EWL_OBJECT(cell),
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
- ewl_container_child_append(EWL_CONTAINER(t->grid),
- EWL_WIDGET(cell));
- ewl_grid_child_position_set(t->grid, EWL_WIDGET(cell),
- i, i, 1, 1);
- ewl_widget_show(EWL_WIDGET(button));
- ewl_widget_show(EWL_WIDGET(cell));
- }
-
- t->col_headers = col_headers;
+ for (i = 1; i <= cols; i++) {
+ cell = (Ewl_Cell *) ewl_cell_new();
+ button = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(button), col_headers[i - 1]);
+ ewl_widget_disable(button);
+ ewl_container_child_append(EWL_CONTAINER(cell), button);
+ ewl_object_fill_policy_set(EWL_OBJECT(cell),
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
+ ewl_container_child_append(EWL_CONTAINER(t->grid),
+ EWL_WIDGET(cell));
+ ewl_grid_child_position_set(t->grid, EWL_WIDGET(cell),
+ i, i, 1, 1);
+ ewl_widget_show(EWL_WIDGET(button));
+ ewl_widget_show(EWL_WIDGET(cell));
+ }
+
+ t->col_headers = col_headers;
}
t->row_select = 0;
@@ -114,7 +114,7 @@ ewl_table_init(Ewl_Table *t, int cols, int rows, char **col_headers)
* Append callbacks
*/
ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_CONFIGURE,
- ewl_table_cb_configure, NULL);
+ ewl_table_cb_configure, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -131,7 +131,7 @@ ewl_table_init(Ewl_Table *t, int cols, int rows, char **col_headers)
*/
void
ewl_table_add(Ewl_Table *table, Ewl_Widget *w,
- int start_col, int end_col, int start_row, int end_row)
+ int start_col, int end_col, int start_row, int end_row)
{
Ewl_Cell *cell;
@@ -145,16 +145,16 @@ ewl_table_add(Ewl_Table *table, Ewl_Widget *w,
ewl_container_child_append(EWL_CONTAINER (cell), w);
ewl_container_child_append(EWL_CONTAINER(table->grid),
- EWL_WIDGET(cell));
+ EWL_WIDGET(cell));
if (table->col_headers)
- ewl_grid_child_position_set(table->grid, EWL_WIDGET(cell),
- start_col, end_col, start_row + 1, end_row + 1);
+ ewl_grid_child_position_set(table->grid, EWL_WIDGET(cell),
+ start_col, end_col, start_row + 1, end_row + 1);
else
- ewl_grid_child_position_set(table->grid, EWL_WIDGET(cell),
- start_col, end_col, start_row, end_row);
+ ewl_grid_child_position_set(table->grid, EWL_WIDGET(cell),
+ start_col, end_col, start_row, end_row);
ewl_callback_prepend(EWL_WIDGET(cell), EWL_CALLBACK_MOUSE_UP,
- ewl_table_cb_child_select, table);
+ ewl_table_cb_child_select, table);
ewl_widget_show(EWL_WIDGET(cell));
@@ -173,8 +173,8 @@ ewl_table_add(Ewl_Table *table, Ewl_Widget *w,
*/
void
ewl_table_col_row_get(Ewl_Table *t, Ewl_Cell *cell,
- int *start_col, int *end_col, int *start_row,
- int *end_row)
+ int *start_col, int *end_col, int *start_row,
+ int *end_row)
{
/*---------------------------------
@@ -200,17 +200,17 @@ ewl_table_col_row_get(Ewl_Table *t, Ewl_Cell *cell,
ecore_dlist_first_goto(children);
while ((child = ecore_dlist_next(children)) != NULL)
{
- if (child == EWL_WIDGET(cell)) {
- g_child = (Ewl_Grid_Child *) ewl_widget_data_get(child,
- (void *) t->grid);
+ if (child == EWL_WIDGET(cell)) {
+ g_child = (Ewl_Grid_Child *) ewl_widget_data_get(child,
+ (void *) t->grid);
- if (start_col) *start_col = g_child->start_col;
- if (end_col) *end_col = g_child->end_col;
- if (start_row) *start_row = g_child->start_row;
- if (end_row) *end_row = g_child->end_row;
+ if (start_col) *start_col = g_child->start_col;
+ if (end_col) *end_col = g_child->end_col;
+ if (start_row) *start_row = g_child->start_row;
+ if (end_row) *end_row = g_child->end_row;
- break;
- }
+ break;
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -227,7 +227,7 @@ ewl_table_col_row_get(Ewl_Table *t, Ewl_Cell *cell,
*/
Ecore_List *
ewl_table_find(Ewl_Table *t, int start_col, int end_col,
- int start_row, int end_row)
+ int start_row, int end_row)
{
/*---------------------------------
* DEVELOPER NOTE:
@@ -252,13 +252,13 @@ ewl_table_find(Ewl_Table *t, int start_col, int end_col,
ecore_dlist_first_goto(children);
while ((child = ecore_dlist_next(children)) != NULL) {
- gc = (Ewl_Grid_Child *) ewl_widget_data_get(child,
- (void *) t->grid);
+ gc = (Ewl_Grid_Child *) ewl_widget_data_get(child,
+ (void *) t->grid);
- if (start_col >= gc->start_col && end_col <= gc->end_col &&
- start_row >= gc->start_row && end_row <= gc->end_row) {
- ecore_list_append(list, child);
- }
+ if (start_col >= gc->start_col && end_col <= gc->end_col &&
+ start_row >= gc->start_row && end_row <= gc->end_row) {
+ ecore_list_append(list, child);
+ }
}
DRETURN_PTR(list, DLEVEL_STABLE);
@@ -364,27 +364,27 @@ ewl_table_reset(Ewl_Table *t, int cols, int rows, char **col_headers)
ewl_container_reset(EWL_CONTAINER(t->grid));
if (col_headers != NULL)
- ewl_grid_dimensions_set(EWL_GRID(t->grid), cols, rows+1);
+ ewl_grid_dimensions_set(EWL_GRID(t->grid), cols, rows+1);
else
- ewl_grid_dimensions_set(EWL_GRID(t->grid), cols, rows);
+ ewl_grid_dimensions_set(EWL_GRID(t->grid), cols, rows);
if (col_headers != NULL) {
- for (i = 1; i <= cols; i++) {
- cell = (Ewl_Cell *) ewl_cell_new();
- button = ewl_button_new();
- ewl_button_label_set(EWL_BUTTON(button), col_headers[i - 1]);
- ewl_widget_disable(button);
- ewl_container_child_append(EWL_CONTAINER(cell), button);
- ewl_container_child_append(EWL_CONTAINER(t->grid),
- EWL_WIDGET(cell));
- ewl_grid_child_position_set(t->grid, EWL_WIDGET(cell),
- i, i, 1, 1);
- ewl_widget_show(button);
- ewl_widget_show(EWL_WIDGET(cell));
- }
-
- t->col_headers = col_headers;
+ for (i = 1; i <= cols; i++) {
+ cell = (Ewl_Cell *) ewl_cell_new();
+ button = ewl_button_new();
+ ewl_button_label_set(EWL_BUTTON(button), col_headers[i - 1]);
+ ewl_widget_disable(button);
+ ewl_container_child_append(EWL_CONTAINER(cell), button);
+ ewl_container_child_append(EWL_CONTAINER(t->grid),
+ EWL_WIDGET(cell));
+ ewl_grid_child_position_set(t->grid, EWL_WIDGET(cell),
+ i, i, 1, 1);
+ ewl_widget_show(button);
+ ewl_widget_show(EWL_WIDGET(cell));
+ }
+
+ t->col_headers = col_headers;
}
ewl_widget_configure(EWL_WIDGET(t));
@@ -412,19 +412,19 @@ ewl_table_selected_get(Ewl_Table *t)
children = EWL_CONTAINER(t->grid)->children;
ecore_dlist_first_goto(children);
while ((child = ecore_dlist_next(children)) != NULL) {
- gc = (Ewl_Grid_Child *) ewl_widget_data_get(child,
- (void *) t->grid);
+ gc = (Ewl_Grid_Child *) ewl_widget_data_get(child,
+ (void *) t->grid);
- if (t->selected.start_c == gc->start_col &&
- t->selected.start_r == gc->start_row &&
- t->selected.end_c == gc->end_col &&
- t->selected.end_r == gc->end_row) {
+ if (t->selected.start_c == gc->start_col &&
+ t->selected.start_r == gc->start_row &&
+ t->selected.end_c == gc->end_col &&
+ t->selected.end_r == gc->end_row) {
- tw = (Ewl_Text *) ecore_dlist_first_goto(
- EWL_CONTAINER(child)->children);
+ tw = (Ewl_Text *) ecore_dlist_first_goto(
+ EWL_CONTAINER(child)->children);
- DRETURN_PTR(ewl_text_text_get(tw), DLEVEL_STABLE);
- }
+ DRETURN_PTR(ewl_text_text_get(tw), DLEVEL_STABLE);
+ }
}
DRETURN_PTR(strdup(""), DLEVEL_STABLE);
@@ -440,7 +440,7 @@ ewl_table_selected_get(Ewl_Table *t)
*/
void
ewl_table_cb_child_select(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Table *t;
Ewl_Grid_Child *gc;
@@ -472,7 +472,7 @@ ewl_table_cb_child_select(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_table_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
/*---------------------------------
* DEVELOPER NOTE:
@@ -490,11 +490,11 @@ ewl_table_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
table = EWL_TABLE(w);
ewl_object_geometry_request(EWL_OBJECT(table->grid),
- CURRENT_X(w), CURRENT_Y(w),
- CURRENT_W(w) - INSET_LEFT(w) +
- INSET_RIGHT(w),
- CURRENT_H(w) - INSET_TOP(w) +
- INSET_BOTTOM(w));
+ CURRENT_X(w), CURRENT_Y(w),
+ CURRENT_W(w) - INSET_LEFT(w) +
+ INSET_RIGHT(w),
+ CURRENT_H(w) - INSET_TOP(w) +
+ INSET_BOTTOM(w));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -518,7 +518,7 @@ ewl_table_cb_child_show(Ewl_Container *p, Ewl_Widget *c __UNUSED__)
table = EWL_TABLE (p);
ewl_object_preferred_inner_size_get (EWL_OBJECT (table->grid),
- &width_g, &height_g);
+ &width_g, &height_g);
ewl_object_preferred_inner_size_set (EWL_OBJECT (table), width_g, height_g);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -541,9 +541,9 @@ ewl_table_homogeneous_set(Ewl_Table *table, unsigned int h)
DCHECK_TYPE(table, EWL_TABLE_TYPE);
if (table->homogeneous_h != h)
- ewl_table_hhomogeneous_set(table, h);
+ ewl_table_hhomogeneous_set(table, h);
if (table->homogeneous_v != h)
- ewl_table_vhomogeneous_set(table, h);
+ ewl_table_vhomogeneous_set(table, h);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -567,8 +567,8 @@ ewl_table_hhomogeneous_set(Ewl_Table *table, unsigned int h)
if (table->homogeneous_h != h)
{
- table->homogeneous_h = h;
- ewl_grid_hhomogeneous_set (EWL_GRID (table->grid), h );
+ table->homogeneous_h = h;
+ ewl_grid_hhomogeneous_set (EWL_GRID (table->grid), h );
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -593,8 +593,8 @@ ewl_table_vhomogeneous_set(Ewl_Table *table, unsigned int h)
if (table->homogeneous_v != h)
{
- table->homogeneous_v = h;
- ewl_grid_vhomogeneous_set (EWL_GRID (table->grid), h );
+ table->homogeneous_v = h;
+ ewl_grid_vhomogeneous_set (EWL_GRID (table->grid), h );
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
diff --git a/src/lib/ewl_table.h b/src/lib/ewl_table.h
index 3f9789b..a898fbb 100644
--- a/src/lib/ewl_table.h
+++ b/src/lib/ewl_table.h
@@ -52,50 +52,50 @@ typedef struct Ewl_Table Ewl_Table;
*/
struct Ewl_Table
{
- Ewl_Container container; /**< Inherit from Ewl_Container */
- Ewl_Grid *grid; /**< Table uses a grid based layout */
+ Ewl_Container container; /**< Inherit from Ewl_Container */
+ Ewl_Grid *grid; /**< Table uses a grid based layout */
- char **col_headers; /**< The column headers */
- int row_select; /**< boolean: select entire rows */
+ char **col_headers; /**< The column headers */
+ int row_select; /**< boolean: select entire rows */
- unsigned int homogeneous_h; /**< Horizontal homogeneous flag */
- unsigned int homogeneous_v; /**< Vertical homogeneous flag */
+ unsigned int homogeneous_h; /**< Horizontal homogeneous flag */
+ unsigned int homogeneous_v; /**< Vertical homogeneous flag */
struct {
- int start_r; /**< Selection start row */
- int start_c; /**< Selection start column */
- int end_r; /**< Selection end row */
- int end_c; /**< Selection end column */
- } selected; /**< Currently selected rows */
+ int start_r; /**< Selection start row */
+ int start_c; /**< Selection start column */
+ int end_r; /**< Selection end row */
+ int end_c; /**< Selection end column */
+ } selected; /**< Currently selected rows */
};
Ewl_Widget *ewl_table_new(int cols, int rows, char **col_headers);
-int ewl_table_init(Ewl_Table *t, int cols, int rows,
- char **col_headers);
+int ewl_table_init(Ewl_Table *t, int cols, int rows,
+ char **col_headers);
-void ewl_table_add(Ewl_Table *table, Ewl_Widget *w, int start_col,
- int end_col, int start_row, int end_row);
-void ewl_table_reset(Ewl_Table *t, int cols, int rows,
- char **c_headers);
+void ewl_table_add(Ewl_Table *table, Ewl_Widget *w, int start_col,
+ int end_col, int start_row, int end_row);
+void ewl_table_reset(Ewl_Table *t, int cols, int rows,
+ char **c_headers);
-void ewl_table_column_w_set(Ewl_Table *table, int col, int width);
-void ewl_table_row_h_set(Ewl_Table *table, int row, int height);
+void ewl_table_column_w_set(Ewl_Table *table, int col, int width);
+void ewl_table_row_h_set(Ewl_Table *table, int row, int height);
-void ewl_table_column_w_get(Ewl_Table *table, int col, int *width);
-void ewl_table_row_h_get(Ewl_Table *table, int row, int *height);
+void ewl_table_column_w_get(Ewl_Table *table, int col, int *width);
+void ewl_table_row_h_get(Ewl_Table *table, int row, int *height);
-void ewl_table_col_row_get(Ewl_Table *table, Ewl_Cell *cell,
- int *start_col, int *end_col,
- int *start_row, int *end_row);
+void ewl_table_col_row_get(Ewl_Table *table, Ewl_Cell *cell,
+ int *start_col, int *end_col,
+ int *start_row, int *end_row);
Ecore_List *ewl_table_find(Ewl_Table *table, int start_col,
- int end_col, int start_row, int emd_row);
+ int end_col, int start_row, int emd_row);
-char *ewl_table_selected_get(Ewl_Table *table);
-void ewl_table_homogeneous_set(Ewl_Table *table, unsigned int h);
-void ewl_table_hhomogeneous_set(Ewl_Table *table, unsigned int h);
-void ewl_table_vhomogeneous_set(Ewl_Table *table, unsigned int h);
+char *ewl_table_selected_get(Ewl_Table *table);
+void ewl_table_homogeneous_set(Ewl_Table *table, unsigned int h);
+void ewl_table_hhomogeneous_set(Ewl_Table *table, unsigned int h);
+void ewl_table_vhomogeneous_set(Ewl_Table *table, unsigned int h);
unsigned int ewl_table_hhomogeneous_get(Ewl_Table *table);
unsigned int ewl_table_vhomogeneous_get(Ewl_Table *table);
diff --git a/src/lib/ewl_text.c b/src/lib/ewl_text.c
index 213789e..39e89c9 100644
--- a/src/lib/ewl_text.c
+++ b/src/lib/ewl_text.c
@@ -26,34 +26,34 @@ static const char ewl_text_trailing_bytes[32] =
(ewl_text_trailing_bytes[((unsigned char)((s)[0])) >> 3])
static void ewl_text_current_fmt_set(Ewl_Text *t, unsigned int context_mask,
- Ewl_Text_Context *change);
+ Ewl_Text_Context *change);
static void ewl_text_text_insert_private(Ewl_Text *t, const char *txt,
- unsigned int char_idx, unsigned int *char_len,
- unsigned int *byte_len);
+ unsigned int char_idx, unsigned int *char_len,
+ unsigned int *byte_len);
static int ewl_text_char_utf8_is(const char *c);
static void ewl_text_size(Ewl_Text *t);
static void ewl_text_display(Ewl_Text *t);
static void ewl_text_cb_format(Ewl_Text_Fmt_Node *node, Ewl_Text *t,
- unsigned int byte_idx);
+ unsigned int byte_idx);
static void ewl_text_plaintext_parse(Evas_Object *tb, char *txt);
static Evas_Textblock_Cursor *ewl_text_textblock_cursor_position(Ewl_Text *t,
- unsigned int char_idx);
+ unsigned int char_idx);
static unsigned int ewl_text_textblock_cursor_to_index(
- Evas_Textblock_Cursor *cursor);
+ Evas_Textblock_Cursor *cursor);
static void ewl_text_triggers_remove(Ewl_Text *t);
static void ewl_text_triggers_shift(Ewl_Text *t, unsigned int char_pos,
- unsigned int char_len, unsigned int del);
+ unsigned int char_len, unsigned int del);
static void ewl_text_trigger_position(Ewl_Text *t, Ewl_Text_Trigger *trig);
static void ewl_text_trigger_add(Ewl_Text *t, Ewl_Text_Trigger *trigger);
static Ewl_Widget *ewl_text_selection_new(Ewl_Text *t);
static void ewl_text_selection_select_to(Ewl_Text_Trigger *s,
- unsigned int char_idx);
+ unsigned int char_idx);
static void ewl_text_theme_color_get(Ewl_Text *t, Ewl_Color_Set *color, char *name);
static Ewl_Text_Context *ewl_text_context_default_create(Ewl_Text *t);
@@ -77,12 +77,12 @@ ewl_text_new(void)
w = NEW(Ewl_Text, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_text_init(EWL_TEXT(w)))
{
- ewl_widget_destroy(w);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(w);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -100,38 +100,38 @@ ewl_text_init(Ewl_Text *t)
DCHECK_PARAM_PTR_RET(t, FALSE);
if (!ewl_container_init(EWL_CONTAINER(t)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(t), EWL_TEXT_TYPE);
ewl_widget_inherit(EWL_WIDGET(t), EWL_TEXT_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_HFILL
- | EWL_FLAG_FILL_VFILL);
+ | EWL_FLAG_FILL_VFILL);
t->formatting.nodes = ewl_text_fmt_new(t);
if (!t->formatting.nodes)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
t->formatting.tx = ewl_text_context_default_create(t);
ewl_text_context_acquire(t->formatting.tx);
ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_CONFIGURE,
- ewl_text_cb_configure, NULL);
+ ewl_text_cb_configure, NULL);
ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_REVEAL,
- ewl_text_cb_reveal, NULL);
+ ewl_text_cb_reveal, NULL);
ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_OBSCURE,
- ewl_text_cb_obscure, NULL);
+ ewl_text_cb_obscure, NULL);
ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_SHOW,
- ewl_text_cb_show, NULL);
+ ewl_text_cb_show, NULL);
ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_HIDE,
- ewl_text_cb_hide, NULL);
+ ewl_text_cb_hide, NULL);
ewl_callback_prepend(EWL_WIDGET(t), EWL_CALLBACK_DESTROY,
- ewl_text_cb_destroy, NULL);
+ ewl_text_cb_destroy, NULL);
ewl_container_add_notify_set(EWL_CONTAINER(t),
- ewl_text_cb_child_add);
+ ewl_text_cb_child_add);
ewl_container_remove_notify_set(EWL_CONTAINER(t),
- ewl_text_cb_child_remove);
+ ewl_text_cb_child_remove);
t->dirty = TRUE;
@@ -176,17 +176,17 @@ ewl_text_length_maximum_set(Ewl_Text *t, unsigned int char_num)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (t->length.max_chars == char_num)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
t->length.max_chars = char_num;
if ((char_num > 0) && (char_num < t->length.max_chars))
{
- unsigned int tmp_pos;
+ unsigned int tmp_pos;
- tmp_pos = ewl_text_cursor_position_get(t);
- ewl_text_cursor_position_set(t, char_num);
- ewl_text_text_delete(t, ewl_text_length_get(t) - char_num);
- ewl_text_cursor_position_set(t, MIN(char_num, tmp_pos));
+ tmp_pos = ewl_text_cursor_position_get(t);
+ ewl_text_cursor_position_set(t, char_num);
+ ewl_text_text_delete(t, ewl_text_length_get(t) - char_num);
+ ewl_text_cursor_position_set(t, MIN(char_num, tmp_pos));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -261,8 +261,8 @@ ewl_text_offsets_set(Ewl_Text *t, int x, int y)
*/
void
ewl_text_index_geometry_map(Ewl_Text *t, unsigned int char_idx,
- int *x, int *y,
- int *w, int *h)
+ int *x, int *y,
+ int *w, int *h)
{
Evas_Coord tx = 0, ty = 0, tw = 0, th = 0;
Evas_Textblock_Cursor *cursor;
@@ -276,12 +276,12 @@ ewl_text_index_geometry_map(Ewl_Text *t, unsigned int char_idx,
/* can't do this if we don't have an evas object */
if ((!REALIZED(t)) || (!t->textblock) || (!t->text))
{
- if (x) *x = 0;
- if (y) *y = 0;
- if (w) *w = 1;
- if (h) *h = ewl_theme_data_int_get(EWL_WIDGET(t), "font_size");
+ if (x) *x = 0;
+ if (y) *y = 0;
+ if (w) *w = 1;
+ if (h) *h = ewl_theme_data_int_get(EWL_WIDGET(t), "font_size");
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
/* force a display of the text */
@@ -289,8 +289,8 @@ ewl_text_index_geometry_map(Ewl_Text *t, unsigned int char_idx,
if (char_idx >= t->length.chars)
{
- char_idx --;
- shifting = 1;
+ char_idx --;
+ shifting = 1;
}
byte_idx = ewl_text_char_to_drawn_byte(t, char_idx);
@@ -330,7 +330,7 @@ ewl_text_coord_index_map(Ewl_Text *t, int x, int y)
DCHECK_TYPE_RET(t, EWL_TEXT_TYPE, 0);
if ((!REALIZED(t)) || (!t->textblock) || (!t->text))
- DRETURN_INT(0, DLEVEL_STABLE);
+ DRETURN_INT(0, DLEVEL_STABLE);
/* force a display of the text */
if (t->dirty) ewl_text_display(t);
@@ -343,44 +343,44 @@ ewl_text_coord_index_map(Ewl_Text *t, int x, int y)
/* see if we have the mouse over a char */
if (!evas_textblock_cursor_char_coord_set(cursor, tx, ty))
{
- int line;
-
- /* if not, see if the mouse is by a line */
- line = evas_textblock_cursor_line_coord_set(cursor, ty);
- if (line >= 0)
- {
- /* if so, get the line geometry and determine start
- * or end of line */
- evas_textblock_cursor_line_geometry_get(cursor,
- &cx, &cy, &cw, &ch);
- if (x < (cx + (cw / 2)))
- evas_textblock_cursor_line_first(cursor);
- else
- {
- const char *txt;
- evas_textblock_cursor_line_last(cursor);
-
- /* we want to be past the last char so we
- * need to increment this by 1 to begin */
- txt = evas_textblock_cursor_node_format_get(cursor);
-
- /* Increment if we're on the last line */
- if (!txt || (strcmp(txt, "\n")))
- char_idx++;
- }
- }
- else
- {
- evas_textblock_cursor_line_set(cursor, 0);
- evas_textblock_cursor_line_first(cursor);
- }
+ int line;
+
+ /* if not, see if the mouse is by a line */
+ line = evas_textblock_cursor_line_coord_set(cursor, ty);
+ if (line >= 0)
+ {
+ /* if so, get the line geometry and determine start
+ * or end of line */
+ evas_textblock_cursor_line_geometry_get(cursor,
+ &cx, &cy, &cw, &ch);
+ if (x < (cx + (cw / 2)))
+ evas_textblock_cursor_line_first(cursor);
+ else
+ {
+ const char *txt;
+ evas_textblock_cursor_line_last(cursor);
+
+ /* we want to be past the last char so we
+ * need to increment this by 1 to begin */
+ txt = evas_textblock_cursor_node_format_get(cursor);
+
+ /* Increment if we're on the last line */
+ if (!txt || (strcmp(txt, "\n")))
+ char_idx++;
+ }
+ }
+ else
+ {
+ evas_textblock_cursor_line_set(cursor, 0);
+ evas_textblock_cursor_line_first(cursor);
+ }
}
else
{
- evas_textblock_cursor_char_geometry_get(cursor,
- &cx, &cy, &cw, &ch);
- if (tx > (cx + ((cw + 1) >> 1)))
- char_idx++;
+ evas_textblock_cursor_char_geometry_get(cursor,
+ &cx, &cy, &cw, &ch);
+ if (tx > (cx + ((cw + 1) >> 1)))
+ char_idx++;
}
byte_idx = ewl_text_textblock_cursor_to_index(cursor);
@@ -421,13 +421,13 @@ ewl_text_clear(Ewl_Text *t)
if (t->length.chars > 0)
{
- ewl_text_cursor_position_set(t, 0);
- ewl_text_text_delete(t, t->length.chars);
+ ewl_text_cursor_position_set(t, 0);
+ ewl_text_text_delete(t, t->length.chars);
}
t->dirty = TRUE;
if (t->formatting.tx)
- ewl_text_context_release(t->formatting.tx);
+ ewl_text_context_release(t->formatting.tx);
t->formatting.tx = ewl_text_context_default_create(t);
ewl_text_fmt_clear(t->formatting.nodes);
@@ -470,23 +470,23 @@ ewl_text_text_prepend(Ewl_Text *t, const char *text)
/* don't do anything if there is no text */
if ((!text) || (!text[0]))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* don't insert text if we already reached the maximum */
if (t->length.max_chars && t->length.chars >= t->length.max_chars)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_text_text_insert_private(t, text, 0, &char_len, &byte_len);
ewl_text_fmt_node_prepend(t->formatting.nodes,
- t->formatting.tx,
- char_len, byte_len);
+ t->formatting.tx,
+ char_len, byte_len);
if (t->formatting.tx)
{
- /* we release this here as the cursor_position_set may not
- * actually remove it if the cursor dosen't move */
- ewl_text_context_release(t->formatting.tx);
- t->formatting.tx = NULL;
+ /* we release this here as the cursor_position_set may not
+ * actually remove it if the cursor dosen't move */
+ ewl_text_context_release(t->formatting.tx);
+ t->formatting.tx = NULL;
}
ewl_text_cursor_position_set(t, char_len);
@@ -515,23 +515,23 @@ ewl_text_text_append(Ewl_Text *t, const char *text)
/* don't do anything if there is no text */
if ((!text) || (!text[0]))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* don't insert text if we already reached the maximum */
if (t->length.max_chars && t->length.chars >= t->length.max_chars)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_text_text_insert_private(t, text, t->length.chars, &char_len, &byte_len);
ewl_text_fmt_node_append(t->formatting.nodes,
- t->formatting.tx,
- char_len, byte_len);
+ t->formatting.tx,
+ char_len, byte_len);
if (t->formatting.tx)
{
- /* we free this here as the cursor_position_set may not
- * actually remove it if the cursor dosen't move */
- ewl_text_context_release(t->formatting.tx);
- t->formatting.tx = NULL;
+ /* we free this here as the cursor_position_set may not
+ * actually remove it if the cursor dosen't move */
+ ewl_text_context_release(t->formatting.tx);
+ t->formatting.tx = NULL;
}
ewl_text_cursor_position_set(t, t->length.chars);
@@ -560,15 +560,15 @@ ewl_text_text_insert(Ewl_Text *t, const char *text, unsigned int char_idx)
/* don't do anything if there is no text */
if ((!text) || (!text[0]))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* don't insert text if we already reached the maximum */
if (t->length.max_chars && t->length.chars >= t->length.max_chars)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* Limit the index to be within safe boundaries */
if (char_idx > t->length.chars + 1)
- char_idx = t->length.chars + 1;
+ char_idx = t->length.chars + 1;
/* make sure we set the position _before_ inserting the text else
* it'll fuck up the cursor_position_set call when inserting into
@@ -579,7 +579,7 @@ ewl_text_text_insert(Ewl_Text *t, const char *text, unsigned int char_idx)
ewl_text_text_insert_private(t, text, char_idx, &char_len, &byte_len);
ewl_text_fmt_node_insert(t->formatting.nodes, char_idx, tx,
- char_len, byte_len);
+ char_len, byte_len);
if (tx) ewl_text_context_release(tx);
ewl_text_cursor_position_set(t, char_idx + char_len);
@@ -593,8 +593,8 @@ ewl_text_text_insert(Ewl_Text *t, const char *text, unsigned int char_idx)
static void
ewl_text_text_insert_private(Ewl_Text *t, const char *txt,
- unsigned int char_idx, unsigned int *char_len,
- unsigned int *byte_len)
+ unsigned int char_idx, unsigned int *char_len,
+ unsigned int *byte_len)
{
unsigned int new_byte_len, clen = 0, blen = 0, bidx = 0;
unsigned int max_chars;
@@ -612,56 +612,56 @@ ewl_text_text_insert_private(Ewl_Text *t, const char *txt,
max_chars = (t->length.max_chars) ? t->length.max_chars : UINT_MAX;
while ((*tmp) && ((clen + t->length.chars) < max_chars))
{
- if (ewl_text_char_utf8_is(tmp))
- tmp = ewl_text_text_next_char(tmp, NULL);
- else
- tmp++;
+ if (ewl_text_char_utf8_is(tmp))
+ tmp = ewl_text_text_next_char(tmp, NULL);
+ else
+ tmp++;
- clen++;
+ clen++;
}
blen = tmp - txt;
new_byte_len = t->length.bytes + blen;
if ((new_byte_len + 1) >= t->total_size)
{
- int extend;
+ int extend;
- /*
- * Determine the size in blocks of EWL_TEXT_EXTEND_VAL
- */
- extend = ((new_byte_len + 1) / EWL_TEXT_EXTEND_VAL);
- extend = (extend + 1) * EWL_TEXT_EXTEND_VAL;
+ /*
+ * Determine the size in blocks of EWL_TEXT_EXTEND_VAL
+ */
+ extend = ((new_byte_len + 1) / EWL_TEXT_EXTEND_VAL);
+ extend = (extend + 1) * EWL_TEXT_EXTEND_VAL;
- t->text = realloc(t->text, extend * sizeof(char));
- t->total_size = extend;
+ t->text = realloc(t->text, extend * sizeof(char));
+ t->total_size = extend;
}
ewl_text_fmt_char_to_byte(t->formatting.nodes, char_idx,
- 0, &bidx, NULL);
+ 0, &bidx, NULL);
if (char_idx < t->length.chars)
- memmove(t->text + bidx + blen, t->text + bidx,
- t->length.bytes - bidx);
+ memmove(t->text + bidx + blen, t->text + bidx,
+ t->length.bytes - bidx);
/* copy the text over, replace invalid UTF-8 chars */
tmp = (char *)txt;
ptr = t->text + bidx;
while (*tmp && (tmp - txt) < (int)blen)
{
- if (ewl_text_char_utf8_is(tmp))
- {
- char *s;
-
- s = tmp;
- tmp = ewl_text_text_next_char(tmp, NULL);
- for ( ; s != tmp; s++, ptr++)
- *ptr = *s;
- }
- else
- {
- *ptr = '?';
- tmp++;
- }
+ if (ewl_text_char_utf8_is(tmp))
+ {
+ char *s;
+
+ s = tmp;
+ tmp = ewl_text_text_next_char(tmp, NULL);
+ for ( ; s != tmp; s++, ptr++)
+ *ptr = *s;
+ }
+ else
+ {
+ *ptr = '?';
+ tmp++;
+ }
}
/* update the text information */
@@ -692,55 +692,55 @@ ewl_text_text_delete(Ewl_Text *t, unsigned int char_len)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if ((!t->text) || (char_len == 0) ||
- (t->cursor_position >= t->length.chars))
- DRETURN(DLEVEL_STABLE);
+ (t->cursor_position >= t->length.chars))
+ DRETURN(DLEVEL_STABLE);
/* don't try to delete more then we have after the current cursor
* position */
if ((t->length.chars - t->cursor_position) < char_len)
- char_len = t->length.chars - t->cursor_position;
+ char_len = t->length.chars - t->cursor_position;
ewl_text_fmt_char_to_byte(t->formatting.nodes,
- t->cursor_position, char_len,
- &byte_idx, &byte_len);
+ t->cursor_position, char_len,
+ &byte_idx, &byte_len);
t->length.chars -= char_len;
if (t->length.chars > 0)
{
- t->length.bytes -= byte_len;
- memmove(t->text + byte_idx,
- t->text + byte_idx + byte_len,
- t->length.bytes - byte_idx);
+ t->length.bytes -= byte_len;
+ memmove(t->text + byte_idx,
+ t->text + byte_idx + byte_len,
+ t->length.bytes - byte_idx);
- t->text[t->length.bytes] = '\0';
+ t->text[t->length.bytes] = '\0';
- ewl_text_triggers_shift(t, t->cursor_position, char_len, TRUE);
+ ewl_text_triggers_shift(t, t->cursor_position, char_len, TRUE);
}
else
{
- IF_FREE(t->text);
- t->length.bytes = 0;
- t->length.chars = 0;
- t->total_size = 0;
- t->cursor_position = 0;
- ewl_text_triggers_remove(t);
-
- /* cleanup the selection */
- if (t->selection)
- ewl_widget_destroy(EWL_WIDGET(t->selection));
-
- t->selection = NULL;
+ IF_FREE(t->text);
+ t->length.bytes = 0;
+ t->length.chars = 0;
+ t->total_size = 0;
+ t->cursor_position = 0;
+ ewl_text_triggers_remove(t);
+
+ /* cleanup the selection */
+ if (t->selection)
+ ewl_widget_destroy(EWL_WIDGET(t->selection));
+
+ t->selection = NULL;
}
ewl_text_fmt_node_delete(t->formatting.nodes,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
t->dirty = TRUE;
if (ewl_text_fmt_node_count_get(t->formatting.nodes) == 0)
- t->formatting.tx = ewl_text_context_default_create(t);
+ t->formatting.tx = ewl_text_context_default_create(t);
if (t->cursor_position > t->length.chars)
- ewl_text_cursor_position_set(t, t->length.chars);
+ ewl_text_cursor_position_set(t, t->length.chars);
ewl_widget_configure(EWL_WIDGET(t));
@@ -770,19 +770,19 @@ ewl_text_obscure_set(Ewl_Text *t, const char *o)
if (!o)
{
- t->obscure = NULL;
+ t->obscure = NULL;
}
else if (ewl_text_char_utf8_is(o))
{
- size_t len;
+ size_t len;
- len = EWL_TEXT_CHAR_BYTE_LEN(o);
- t->obscure = NEW(char, len + 1);
- memcpy(t->obscure, o, len);
- t->obscure[len] = 0;
+ len = EWL_TEXT_CHAR_BYTE_LEN(o);
+ t->obscure = NEW(char, len + 1);
+ memcpy(t->obscure, o, len);
+ t->obscure[len] = 0;
}
else
- t->obscure = strdup("*");
+ t->obscure = strdup("*");
t->dirty = TRUE;
ewl_widget_configure(EWL_WIDGET(t));
@@ -821,23 +821,23 @@ ewl_text_selectable_set(Ewl_Text *t, unsigned int selectable)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (t->selectable == selectable)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
t->selectable = selectable;
if (t->selectable)
{
- ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_DOWN,
- ewl_text_cb_mouse_down, NULL);
- ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_UP,
- ewl_text_cb_mouse_up, NULL);
+ ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_DOWN,
+ ewl_text_cb_mouse_down, NULL);
+ ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_UP,
+ ewl_text_cb_mouse_up, NULL);
}
else
{
- ewl_callback_del(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_DOWN,
- ewl_text_cb_mouse_down);
- ewl_callback_del(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_UP,
- ewl_text_cb_mouse_up);
+ ewl_callback_del(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_DOWN,
+ ewl_text_cb_mouse_down);
+ ewl_callback_del(EWL_WIDGET(t), EWL_CALLBACK_MOUSE_UP,
+ ewl_text_cb_mouse_up);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -877,12 +877,12 @@ ewl_text_selection_text_get(Ewl_Text *t)
sel = EWL_TEXT_TRIGGER(t->selection);
if ((!sel) || (sel->char_len == 0))
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
ewl_text_fmt_char_to_byte(t->formatting.nodes,
- sel->char_pos,
- sel->char_len,
- &byte_pos, &byte_len);
+ sel->char_pos,
+ sel->char_len,
+ &byte_pos, &byte_len);
ret = malloc(sizeof(char) * (byte_len + 1));
if (!ret) DRETURN_PTR(NULL, DLEVEL_STABLE);
@@ -910,7 +910,7 @@ ewl_text_selection_get(Ewl_Text *t)
sel = EWL_TEXT_TRIGGER(t->selection);
if (sel && ewl_text_trigger_length_get(sel) > 0)
- DRETURN_PTR(sel, DLEVEL_STABLE);
+ DRETURN_PTR(sel, DLEVEL_STABLE);
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -928,7 +928,7 @@ ewl_text_has_selection(Ewl_Text *t)
DCHECK_TYPE_RET(t, EWL_TEXT_TYPE, FALSE);
if (ewl_text_selection_get(t))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -950,17 +950,17 @@ ewl_text_select(Ewl_Text *t, unsigned int char_idx, unsigned int char_len)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (t->length.chars == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (char_idx > t->length.chars)
- char_idx = t->length.chars;
+ char_idx = t->length.chars;
if (char_idx + char_len > t->length.chars)
- char_len = t->length.chars - char_idx;
+ char_len = t->length.chars - char_idx;
/* if we haven't already have an selection create one */
if (!t->selection)
- t->selection = ewl_text_selection_new(t);
+ t->selection = ewl_text_selection_new(t);
s = EWL_TEXT_TRIGGER(t->selection);
ewl_text_trigger_start_pos_set(s, char_idx);
@@ -1007,13 +1007,13 @@ ewl_text_cursor_position_set(Ewl_Text *t, unsigned int char_pos)
/* it's the same position, do nothing */
if (char_pos == t->cursor_position)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* clean the current context if it exists */
if (t->formatting.tx)
{
- ewl_text_context_release(t->formatting.tx);
- t->formatting.tx = NULL;
+ ewl_text_context_release(t->formatting.tx);
+ t->formatting.tx = NULL;
}
t->cursor_position = char_pos;
@@ -1060,23 +1060,23 @@ ewl_text_cursor_position_line_up_get(Ewl_Text *t)
cursor = ewl_text_textblock_cursor_position(t, byte_idx);
line = evas_textblock_cursor_char_geometry_get(cursor, &cx, NULL,
- &cw, NULL);
+ &cw, NULL);
line --;
if (evas_object_textblock_line_number_geometry_get(t->textblock,
- line, &lx, &ly, &lw, &lh))
+ line, &lx, &ly, &lw, &lh))
{
- if (!evas_textblock_cursor_char_coord_set(cursor,
- cx + (cw / 2), ly))
- {
- if (evas_textblock_cursor_line_set(cursor, line))
- {
- if ((cx + (cw / 2)) >= (lx + lw))
- evas_textblock_cursor_line_last(cursor);
- else
- evas_textblock_cursor_line_first(cursor);
- }
- }
+ if (!evas_textblock_cursor_char_coord_set(cursor,
+ cx + (cw / 2), ly))
+ {
+ if (evas_textblock_cursor_line_set(cursor, line))
+ {
+ if ((cx + (cw / 2)) >= (lx + lw))
+ evas_textblock_cursor_line_last(cursor);
+ else
+ evas_textblock_cursor_line_first(cursor);
+ }
+ }
}
@@ -1106,34 +1106,34 @@ ewl_text_cursor_position_line_down_get(Ewl_Text *t)
cur_char_idx = ewl_text_cursor_position_get(t);
ewl_text_fmt_char_to_byte(t->formatting.nodes, cur_char_idx,
- 0, &byte_idx, NULL);
+ 0, &byte_idx, NULL);
cursor = ewl_text_textblock_cursor_position(t, byte_idx);
line = evas_textblock_cursor_char_geometry_get(cursor, &cx, NULL,
- &cw, NULL);
+ &cw, NULL);
line ++;
if (evas_object_textblock_line_number_geometry_get(t->textblock,
- line, &lx, &ly, &lw, &lh))
+ line, &lx, &ly, &lw, &lh))
{
- if (!evas_textblock_cursor_char_coord_set(cursor,
- cx + (cw / 2), ly))
- {
- if (evas_textblock_cursor_line_set(cursor, line))
- {
- if ((cx + (cw / 2)) >= (lx + lw))
- evas_textblock_cursor_line_last(cursor);
- else
- evas_textblock_cursor_line_first(cursor);
- }
- }
+ if (!evas_textblock_cursor_char_coord_set(cursor,
+ cx + (cw / 2), ly))
+ {
+ if (evas_textblock_cursor_line_set(cursor, line))
+ {
+ if ((cx + (cw / 2)) >= (lx + lw))
+ evas_textblock_cursor_line_last(cursor);
+ else
+ evas_textblock_cursor_line_first(cursor);
+ }
+ }
}
byte_idx = ewl_text_textblock_cursor_to_index(cursor);
cur_char_idx = 0;
ewl_text_fmt_byte_to_char(t->formatting.nodes, byte_idx,
- 0, &cur_char_idx, NULL);
+ 0, &cur_char_idx, NULL);
DRETURN_INT(cur_char_idx, DLEVEL_STABLE);
}
@@ -1195,16 +1195,16 @@ ewl_text_font_get(Ewl_Text *t, unsigned int char_idx)
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (fmt->tx->font)
- font = strdup(fmt->tx->font);
+ if (fmt->tx->font)
+ font = strdup(fmt->tx->font);
}
else
{
- Ewl_Text_Context *tx;
+ Ewl_Text_Context *tx;
- tx = ewl_text_context_default_create(t);
- if (tx->font) font = strdup(tx->font);
- ewl_text_context_release(tx);
+ tx = ewl_text_context_default_create(t);
+ if (tx->font) font = strdup(tx->font);
+ ewl_text_context_release(tx);
}
DRETURN_PTR(font, DLEVEL_STABLE);
@@ -1252,7 +1252,7 @@ ewl_text_font_source_set(Ewl_Text *t, const char *source, const char *font)
*/
void
ewl_text_font_source_apply(Ewl_Text *t, const char *source, const char *font,
- unsigned int char_len)
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -1262,7 +1262,7 @@ ewl_text_font_source_apply(Ewl_Text *t, const char *source, const char *font,
/* if length is 0 we have nothing to do */
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
@@ -1275,7 +1275,7 @@ ewl_text_font_source_apply(Ewl_Text *t, const char *source, const char *font,
if (font) tx->font = ecore_string_instance(font);
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_FONT, tx,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -1303,16 +1303,16 @@ ewl_text_font_source_get(Ewl_Text *t, unsigned int char_idx)
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (fmt->tx->font_source)
- source = strdup(fmt->tx->font_source);
+ if (fmt->tx->font_source)
+ source = strdup(fmt->tx->font_source);
}
else
{
- Ewl_Text_Context *tx;
+ Ewl_Text_Context *tx;
- tx = ewl_text_context_default_create(t);
- if (tx->font_source) source = strdup(tx->font_source);
- ewl_text_context_release(tx);
+ tx = ewl_text_context_default_create(t);
+ if (tx->font_source) source = strdup(tx->font_source);
+ ewl_text_context_release(tx);
}
DRETURN_PTR(source, DLEVEL_STABLE);
@@ -1360,12 +1360,12 @@ ewl_text_font_size_apply(Ewl_Text *t, unsigned int size, unsigned int char_len)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->size = size;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_SIZE, tx,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -1393,15 +1393,15 @@ ewl_text_font_size_get(Ewl_Text *t, unsigned int char_idx)
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- size = fmt->tx->size;
+ size = fmt->tx->size;
}
else
{
- Ewl_Text_Context *tx;
+ Ewl_Text_Context *tx;
- tx = ewl_text_context_default_create(t);
- size = tx->size;
- ewl_text_context_release(tx);
+ tx = ewl_text_context_default_create(t);
+ size = tx->size;
+ ewl_text_context_release(tx);
}
DRETURN_INT(size, DLEVEL_STABLE);
@@ -1418,7 +1418,7 @@ ewl_text_font_size_get(Ewl_Text *t, unsigned int char_idx)
*/
void
ewl_text_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -1451,8 +1451,8 @@ ewl_text_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -1461,7 +1461,7 @@ ewl_text_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->color.r = r;
@@ -1470,7 +1470,7 @@ ewl_text_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
tx->color.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_COLOR, tx,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -1491,8 +1491,8 @@ ewl_text_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -1503,21 +1503,21 @@ ewl_text_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->color.r;
- if (g) *g = fmt->tx->color.g;
- if (b) *b = fmt->tx->color.b;
- if (a) *a = fmt->tx->color.a;
+ if (r) *r = fmt->tx->color.r;
+ if (g) *g = fmt->tx->color.g;
+ if (b) *b = fmt->tx->color.b;
+ if (a) *a = fmt->tx->color.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->color.r;
- if (g) *g = tx->color.g;
- if (b) *b = tx->color.b;
- if (a) *a = tx->color.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->color.r;
+ if (g) *g = tx->color.g;
+ if (b) *b = tx->color.b;
+ if (a) *a = tx->color.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1565,12 +1565,12 @@ ewl_text_align_apply(Ewl_Text *t, unsigned int align, unsigned int char_len)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->align = align;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_ALIGN, tx,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -1598,15 +1598,15 @@ ewl_text_align_get(Ewl_Text *t, unsigned int char_idx)
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- align = fmt->tx->align;
+ align = fmt->tx->align;
}
else
{
- Ewl_Text_Context *tx;
+ Ewl_Text_Context *tx;
- tx = ewl_text_context_default_create(t);
- align = tx->align;
- ewl_text_context_release(tx);
+ tx = ewl_text_context_default_create(t);
+ align = tx->align;
+ ewl_text_context_release(tx);
}
DRETURN_INT(align, DLEVEL_STABLE);
@@ -1654,12 +1654,12 @@ ewl_text_styles_apply(Ewl_Text *t, unsigned int styles, unsigned int char_len)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->styles = styles;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_STYLES, tx,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -1773,7 +1773,7 @@ ewl_text_style_has(Ewl_Text *t, Ewl_Text_Style style, unsigned int char_idx)
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (!fmt || !fmt->tx)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
DRETURN_INT((fmt->tx->styles & style), DLEVEL_STABLE);
}
@@ -1797,15 +1797,15 @@ ewl_text_styles_get(Ewl_Text *t, unsigned int char_idx)
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- styles = fmt->tx->styles;
+ styles = fmt->tx->styles;
}
else
{
- Ewl_Text_Context *tx;
+ Ewl_Text_Context *tx;
- tx = ewl_text_context_default_create(t);
- styles = tx->styles;
- ewl_text_context_release(tx);
+ tx = ewl_text_context_default_create(t);
+ styles = tx->styles;
+ ewl_text_context_release(tx);
}
DRETURN_INT(styles, DLEVEL_STABLE);
@@ -1830,12 +1830,12 @@ ewl_text_wrap_set(Ewl_Text *t, Ewl_Text_Wrap wrap)
change->wrap = wrap;
if (wrap == EWL_TEXT_WRAP_NONE)
- ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_HFILL
- | EWL_FLAG_FILL_VFILL);
+ ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_HFILL
+ | EWL_FLAG_FILL_VFILL);
else
- ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_HSHRINK
- | EWL_FLAG_FILL_HFILL
- | EWL_FLAG_FILL_VFILL);
+ ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_HSHRINK
+ | EWL_FLAG_FILL_HFILL
+ | EWL_FLAG_FILL_VFILL);
ewl_text_current_fmt_set(t, EWL_TEXT_CONTEXT_MASK_WRAP, change);
ewl_text_context_release(change);
@@ -1861,12 +1861,12 @@ ewl_text_wrap_apply(Ewl_Text *t, Ewl_Text_Wrap wrap, unsigned int char_len)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->wrap = wrap;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_WRAP, tx,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -1894,15 +1894,15 @@ ewl_text_wrap_get(Ewl_Text *t, unsigned int char_idx)
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- wrap = fmt->tx->wrap;
+ wrap = fmt->tx->wrap;
}
else
{
- Ewl_Text_Context *tx;
+ Ewl_Text_Context *tx;
- tx = ewl_text_context_default_create(t);
- wrap = tx->wrap;
- ewl_text_context_release(tx);
+ tx = ewl_text_context_default_create(t);
+ wrap = tx->wrap;
+ ewl_text_context_release(tx);
}
DRETURN_INT(wrap, DLEVEL_STABLE);
@@ -1919,7 +1919,7 @@ ewl_text_wrap_get(Ewl_Text *t, unsigned int char_idx)
*/
void
ewl_text_bg_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -1952,8 +1952,8 @@ ewl_text_bg_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_bg_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -1962,7 +1962,7 @@ ewl_text_bg_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->style_colors.bg.r = r;
@@ -1971,7 +1971,7 @@ ewl_text_bg_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
tx->style_colors.bg.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_BG_COLOR,
- tx, t->cursor_position, char_len);
+ tx, t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -1992,8 +1992,8 @@ ewl_text_bg_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_bg_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -2004,21 +2004,21 @@ ewl_text_bg_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->style_colors.bg.r;
- if (g) *g = fmt->tx->style_colors.bg.g;
- if (b) *b = fmt->tx->style_colors.bg.b;
- if (a) *a = fmt->tx->style_colors.bg.a;
+ if (r) *r = fmt->tx->style_colors.bg.r;
+ if (g) *g = fmt->tx->style_colors.bg.g;
+ if (b) *b = fmt->tx->style_colors.bg.b;
+ if (a) *a = fmt->tx->style_colors.bg.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->style_colors.bg.r;
- if (g) *g = tx->style_colors.bg.g;
- if (b) *b = tx->style_colors.bg.b;
- if (a) *a = tx->style_colors.bg.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->style_colors.bg.r;
+ if (g) *g = tx->style_colors.bg.g;
+ if (b) *b = tx->style_colors.bg.b;
+ if (a) *a = tx->style_colors.bg.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2035,7 +2035,7 @@ ewl_text_bg_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
*/
void
ewl_text_glow_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -2068,8 +2068,8 @@ ewl_text_glow_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_glow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -2078,7 +2078,7 @@ ewl_text_glow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->style_colors.glow.r = r;
@@ -2087,7 +2087,7 @@ ewl_text_glow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
tx->style_colors.glow.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_GLOW_COLOR, tx,
- t->cursor_position, char_len);
+ t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -2108,8 +2108,8 @@ ewl_text_glow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_glow_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -2120,21 +2120,21 @@ ewl_text_glow_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->style_colors.glow.r;
- if (g) *g = fmt->tx->style_colors.glow.g;
- if (b) *b = fmt->tx->style_colors.glow.b;
- if (a) *a = fmt->tx->style_colors.glow.a;
+ if (r) *r = fmt->tx->style_colors.glow.r;
+ if (g) *g = fmt->tx->style_colors.glow.g;
+ if (b) *b = fmt->tx->style_colors.glow.b;
+ if (a) *a = fmt->tx->style_colors.glow.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->style_colors.glow.r;
- if (g) *g = tx->style_colors.glow.g;
- if (b) *b = tx->style_colors.glow.b;
- if (a) *a = tx->style_colors.glow.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->style_colors.glow.r;
+ if (g) *g = tx->style_colors.glow.g;
+ if (b) *b = tx->style_colors.glow.b;
+ if (a) *a = tx->style_colors.glow.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2151,7 +2151,7 @@ ewl_text_glow_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
*/
void
ewl_text_outline_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -2184,8 +2184,8 @@ ewl_text_outline_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_outline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -2194,7 +2194,7 @@ ewl_text_outline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->style_colors.outline.r = r;
@@ -2203,7 +2203,7 @@ ewl_text_outline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
tx->style_colors.outline.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_OUTLINE_COLOR,
- tx, t->cursor_position, char_len);
+ tx, t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -2224,8 +2224,8 @@ ewl_text_outline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_outline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -2236,21 +2236,21 @@ ewl_text_outline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->style_colors.outline.r;
- if (g) *g = fmt->tx->style_colors.outline.g;
- if (b) *b = fmt->tx->style_colors.outline.b;
- if (a) *a = fmt->tx->style_colors.outline.a;
+ if (r) *r = fmt->tx->style_colors.outline.r;
+ if (g) *g = fmt->tx->style_colors.outline.g;
+ if (b) *b = fmt->tx->style_colors.outline.b;
+ if (a) *a = fmt->tx->style_colors.outline.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->style_colors.outline.r;
- if (g) *g = tx->style_colors.outline.g;
- if (b) *b = tx->style_colors.outline.b;
- if (a) *a = tx->style_colors.outline.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->style_colors.outline.r;
+ if (g) *g = tx->style_colors.outline.g;
+ if (b) *b = tx->style_colors.outline.b;
+ if (a) *a = tx->style_colors.outline.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2267,7 +2267,7 @@ ewl_text_outline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
*/
void
ewl_text_shadow_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -2300,8 +2300,8 @@ ewl_text_shadow_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_shadow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -2310,7 +2310,7 @@ ewl_text_shadow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->style_colors.shadow.r = r;
@@ -2319,7 +2319,7 @@ ewl_text_shadow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
tx->style_colors.shadow.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_SHADOW_COLOR,
- tx, t->cursor_position, char_len);
+ tx, t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -2340,8 +2340,8 @@ ewl_text_shadow_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_shadow_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -2352,21 +2352,21 @@ ewl_text_shadow_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->style_colors.shadow.r;
- if (g) *g = fmt->tx->style_colors.shadow.g;
- if (b) *b = fmt->tx->style_colors.shadow.b;
- if (a) *a = fmt->tx->style_colors.shadow.a;
+ if (r) *r = fmt->tx->style_colors.shadow.r;
+ if (g) *g = fmt->tx->style_colors.shadow.g;
+ if (b) *b = fmt->tx->style_colors.shadow.b;
+ if (a) *a = fmt->tx->style_colors.shadow.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->style_colors.shadow.r;
- if (g) *g = tx->style_colors.shadow.g;
- if (b) *b = tx->style_colors.shadow.b;
- if (a) *a = tx->style_colors.shadow.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->style_colors.shadow.r;
+ if (g) *g = tx->style_colors.shadow.g;
+ if (b) *b = tx->style_colors.shadow.b;
+ if (a) *a = tx->style_colors.shadow.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2383,7 +2383,7 @@ ewl_text_shadow_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
*/
void
ewl_text_strikethrough_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -2416,8 +2416,8 @@ ewl_text_strikethrough_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_strikethrough_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -2426,7 +2426,7 @@ ewl_text_strikethrough_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->style_colors.strikethrough.r = r;
@@ -2435,7 +2435,7 @@ ewl_text_strikethrough_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
tx->style_colors.strikethrough.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_STRIKETHROUGH_COLOR,
- tx, t->cursor_position, char_len);
+ tx, t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -2456,8 +2456,8 @@ ewl_text_strikethrough_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_strikethrough_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -2468,21 +2468,21 @@ ewl_text_strikethrough_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->style_colors.strikethrough.r;
- if (g) *g = fmt->tx->style_colors.strikethrough.g;
- if (b) *b = fmt->tx->style_colors.strikethrough.b;
- if (a) *a = fmt->tx->style_colors.strikethrough.a;
+ if (r) *r = fmt->tx->style_colors.strikethrough.r;
+ if (g) *g = fmt->tx->style_colors.strikethrough.g;
+ if (b) *b = fmt->tx->style_colors.strikethrough.b;
+ if (a) *a = fmt->tx->style_colors.strikethrough.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->style_colors.strikethrough.r;
- if (g) *g = tx->style_colors.strikethrough.g;
- if (b) *b = tx->style_colors.strikethrough.b;
- if (a) *a = tx->style_colors.strikethrough.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->style_colors.strikethrough.r;
+ if (g) *g = tx->style_colors.strikethrough.g;
+ if (b) *b = tx->style_colors.strikethrough.b;
+ if (a) *a = tx->style_colors.strikethrough.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2499,7 +2499,7 @@ ewl_text_strikethrough_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
*/
void
ewl_text_underline_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -2532,8 +2532,8 @@ ewl_text_underline_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -2542,7 +2542,7 @@ ewl_text_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->style_colors.underline.r = r;
@@ -2551,7 +2551,7 @@ ewl_text_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
tx->style_colors.underline.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_UNDERLINE_COLOR,
- tx, t->cursor_position, char_len);
+ tx, t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -2572,8 +2572,8 @@ ewl_text_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_underline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -2584,21 +2584,21 @@ ewl_text_underline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->style_colors.outline.r;
- if (g) *g = fmt->tx->style_colors.outline.g;
- if (b) *b = fmt->tx->style_colors.outline.b;
- if (a) *a = fmt->tx->style_colors.outline.a;
+ if (r) *r = fmt->tx->style_colors.outline.r;
+ if (g) *g = fmt->tx->style_colors.outline.g;
+ if (b) *b = fmt->tx->style_colors.outline.b;
+ if (a) *a = fmt->tx->style_colors.outline.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->style_colors.outline.r;
- if (g) *g = tx->style_colors.outline.g;
- if (b) *b = tx->style_colors.outline.b;
- if (a) *a = tx->style_colors.outline.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->style_colors.outline.r;
+ if (g) *g = tx->style_colors.outline.g;
+ if (b) *b = tx->style_colors.outline.b;
+ if (a) *a = tx->style_colors.outline.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2615,7 +2615,7 @@ ewl_text_underline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
*/
void
ewl_text_double_underline_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Text_Context *change;
@@ -2648,8 +2648,8 @@ ewl_text_double_underline_color_set(Ewl_Text *t, unsigned int r, unsigned int g,
*/
void
ewl_text_double_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len)
+ unsigned int b, unsigned int a,
+ unsigned int char_len)
{
Ewl_Text_Context *tx;
@@ -2658,7 +2658,7 @@ ewl_text_double_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tx = ewl_text_context_new();
tx->style_colors.double_underline.r = r;
@@ -2667,7 +2667,7 @@ ewl_text_double_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int
tx->style_colors.double_underline.a = a;
ewl_text_fmt_apply(t->formatting.nodes, EWL_TEXT_CONTEXT_MASK_DOUBLE_UNDERLINE_COLOR,
- tx, t->cursor_position, char_len);
+ tx, t->cursor_position, char_len);
ewl_text_context_release(tx);
t->dirty = TRUE;
@@ -2688,8 +2688,8 @@ ewl_text_double_underline_color_apply(Ewl_Text *t, unsigned int r, unsigned int
*/
void
ewl_text_double_underline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx)
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx)
{
Ewl_Text_Fmt_Node *fmt;
@@ -2700,21 +2700,21 @@ ewl_text_double_underline_color_get(Ewl_Text *t, unsigned int *r, unsigned int *
fmt = ewl_text_fmt_get(t->formatting.nodes, char_idx);
if (fmt && fmt->tx)
{
- if (r) *r = fmt->tx->style_colors.double_underline.r;
- if (g) *g = fmt->tx->style_colors.double_underline.g;
- if (b) *b = fmt->tx->style_colors.double_underline.b;
- if (a) *a = fmt->tx->style_colors.double_underline.a;
+ if (r) *r = fmt->tx->style_colors.double_underline.r;
+ if (g) *g = fmt->tx->style_colors.double_underline.g;
+ if (b) *b = fmt->tx->style_colors.double_underline.b;
+ if (a) *a = fmt->tx->style_colors.double_underline.a;
}
else
{
- Ewl_Text_Context *tx;
-
- tx = ewl_text_context_default_create(t);
- if (r) *r = tx->style_colors.double_underline.r;
- if (g) *g = tx->style_colors.double_underline.g;
- if (b) *b = tx->style_colors.double_underline.b;
- if (a) *a = tx->style_colors.double_underline.a;
- ewl_text_context_release(tx);
+ Ewl_Text_Context *tx;
+
+ tx = ewl_text_context_default_create(t);
+ if (r) *r = tx->style_colors.double_underline.r;
+ if (g) *g = tx->style_colors.double_underline.g;
+ if (b) *b = tx->style_colors.double_underline.b;
+ if (a) *a = tx->style_colors.double_underline.a;
+ ewl_text_context_release(tx);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2764,8 +2764,8 @@ ewl_text_context_default_create(Ewl_Text *t)
if (ewl_text_default_context)
{
- ewl_text_context_acquire(ewl_text_default_context);
- DRETURN_PTR(ewl_text_default_context, DLEVEL_STABLE);
+ ewl_text_context_acquire(ewl_text_default_context);
+ DRETURN_PTR(ewl_text_default_context, DLEVEL_STABLE);
}
tmp = ewl_text_context_new();
@@ -2780,65 +2780,65 @@ ewl_text_context_default_create(Ewl_Text *t)
i = ewl_theme_data_int_get(EWL_WIDGET(t), "underline");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_UNDERLINE;
- ewl_text_theme_color_get(t, &(tmp->style_colors.underline),
- "underline/color");
+ tmp->styles |= EWL_TEXT_STYLE_UNDERLINE;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.underline),
+ "underline/color");
}
i = ewl_theme_data_int_get(EWL_WIDGET(t), "double_underline");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_DOUBLE_UNDERLINE;
- ewl_text_theme_color_get(t, &(tmp->style_colors.double_underline),
- "double_underline/color");
+ tmp->styles |= EWL_TEXT_STYLE_DOUBLE_UNDERLINE;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.double_underline),
+ "double_underline/color");
}
i = ewl_theme_data_int_get(EWL_WIDGET(t), "strikethrough");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_STRIKETHROUGH;
- ewl_text_theme_color_get(t, &(tmp->style_colors.strikethrough),
- "strikethrough/color");
+ tmp->styles |= EWL_TEXT_STYLE_STRIKETHROUGH;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.strikethrough),
+ "strikethrough/color");
}
i = ewl_theme_data_int_get(EWL_WIDGET(t), "shadow");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_SHADOW;
- ewl_text_theme_color_get(t, &(tmp->style_colors.shadow),
- "shadow/color");
+ tmp->styles |= EWL_TEXT_STYLE_SHADOW;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.shadow),
+ "shadow/color");
}
i = ewl_theme_data_int_get(EWL_WIDGET(t), "soft_shadow");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_SOFT_SHADOW;
- ewl_text_theme_color_get(t, &(tmp->style_colors.shadow),
- "shadow/color");
+ tmp->styles |= EWL_TEXT_STYLE_SOFT_SHADOW;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.shadow),
+ "shadow/color");
}
i = ewl_theme_data_int_get(EWL_WIDGET(t), "far_shadow");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_FAR_SHADOW;
- ewl_text_theme_color_get(t, &(tmp->style_colors.shadow),
- "shadow/color");
+ tmp->styles |= EWL_TEXT_STYLE_FAR_SHADOW;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.shadow),
+ "shadow/color");
}
i = ewl_theme_data_int_get(EWL_WIDGET(t), "outline");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_OUTLINE;
- ewl_text_theme_color_get(t, &(tmp->style_colors.outline),
- "outline/color");
+ tmp->styles |= EWL_TEXT_STYLE_OUTLINE;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.outline),
+ "outline/color");
}
i = ewl_theme_data_int_get(EWL_WIDGET(t), "glow");
if (i)
{
- tmp->styles |= EWL_TEXT_STYLE_GLOW;
- ewl_text_theme_color_get(t, &(tmp->style_colors.glow),
- "glow/color");
+ tmp->styles |= EWL_TEXT_STYLE_GLOW;
+ ewl_text_theme_color_get(t, &(tmp->style_colors.glow),
+ "glow/color");
}
/* XXX grab the alignment and wrap data from the theme here */
@@ -2874,34 +2874,34 @@ ewl_text_char_utf8_is(const char *c)
switch (EWL_TEXT_CHAR_BYTE_LEN(t))
{
- case 2: /* 2 byte */
- if ((t[1] & 0xc0) != 0x80)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
- break;
-
- case 3: /* 3 byte */
- if (((t[1] & 0xc0) != 0x80)
- || ((t[2] & 0xc0) != 0x80))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
- break;
-
- case 4: /* 4 byte */
- if (((t[1] & 0xc0) != 0x80)
- || ((t[2] & 0xc0) != 0x80)
- || ((t[3] & 0xc0) != 0x80))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
- break;
-
- default:
- /* this is actually:
- * case 1:
- * We already checked if it is a 7-bit ASCII character,
- * so anything else with the length of 1 byte is not
- * a valid utf8 character
- * case 5: case 6:
- * Although a character sequences of the length 5 or 6
- * is possible it is not a legal utf8 character */
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ case 2: /* 2 byte */
+ if ((t[1] & 0xc0) != 0x80)
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
+ break;
+
+ case 3: /* 3 byte */
+ if (((t[1] & 0xc0) != 0x80)
+ || ((t[2] & 0xc0) != 0x80))
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
+ break;
+
+ case 4: /* 4 byte */
+ if (((t[1] & 0xc0) != 0x80)
+ || ((t[2] & 0xc0) != 0x80)
+ || ((t[3] & 0xc0) != 0x80))
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
+ break;
+
+ default:
+ /* this is actually:
+ * case 1:
+ * We already checked if it is a 7-bit ASCII character,
+ * so anything else with the length of 1 byte is not
+ * a valid utf8 character
+ * case 5: case 6:
+ * Although a character sequences of the length 5 or 6
+ * is possible it is not a legal utf8 character */
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -2962,23 +2962,23 @@ ewl_text_display(Ewl_Text *t)
evas_object_textblock_clear(t->textblock);
cursor = (Evas_Textblock_Cursor *)
- evas_object_textblock_cursor_get(t->textblock);
+ evas_object_textblock_cursor_get(t->textblock);
evas_textblock_cursor_text_append(cursor, "");
if (t->length.chars > 0)
{
- Ewl_Text_Context *cur_tx;
- unsigned int cur_pos;
+ Ewl_Text_Context *cur_tx;
+ unsigned int cur_pos;
- /* save these so we can restore the list state */
- cur_pos = ewl_text_cursor_position_get(t);
- cur_tx = t->formatting.tx;
- if (cur_tx) ewl_text_context_acquire(cur_tx);
+ /* save these so we can restore the list state */
+ cur_pos = ewl_text_cursor_position_get(t);
+ cur_tx = t->formatting.tx;
+ if (cur_tx) ewl_text_context_acquire(cur_tx);
- ewl_text_fmt_walk(t->formatting.nodes, ewl_text_cb_format);
+ ewl_text_fmt_walk(t->formatting.nodes, ewl_text_cb_format);
- ewl_text_cursor_position_set(t, cur_pos);
- t->formatting.tx = cur_tx;
+ ewl_text_cursor_position_set(t, cur_pos);
+ t->formatting.tx = cur_tx;
}
evas_object_textblock_size_formatted_get(t->textblock, &w, &h);
@@ -3006,42 +3006,42 @@ ewl_text_cb_format(Ewl_Text_Fmt_Node *node, Ewl_Text *t, unsigned int byte_idx)
/* Don't free this as it's suppost to be const ... */
cursor = (Evas_Textblock_Cursor *)
- evas_object_textblock_cursor_get(t->textblock);
+ evas_object_textblock_cursor_get(t->textblock);
/* only need to append if we aren't default */
if (node->tx != ewl_text_default_context)
- evas_textblock_cursor_format_append(cursor, node->tx->format);
+ evas_textblock_cursor_format_append(cursor, node->tx->format);
if (!t->obscure)
{
- char *ptr, tmp;
- ptr = t->text + byte_idx;
- tmp = *(ptr + node->byte_len);
- if (strlen(ptr) < node->byte_len)
- DWARNING("Byte length of node %u overruns actual"
- " text %d", node->byte_len, (int)strlen(ptr));
-
- *(ptr + node->byte_len) = '\0';
-
- ewl_text_plaintext_parse(t->textblock, ptr);
- *(ptr + node->byte_len) = tmp;
+ char *ptr, tmp;
+ ptr = t->text + byte_idx;
+ tmp = *(ptr + node->byte_len);
+ if (strlen(ptr) < node->byte_len)
+ DWARNING("Byte length of node %u overruns actual"
+ " text %d", node->byte_len, (int)strlen(ptr));
+
+ *(ptr + node->byte_len) = '\0';
+
+ ewl_text_plaintext_parse(t->textblock, ptr);
+ *(ptr + node->byte_len) = tmp;
}
else
{
- char *otxt, *ptr;
- size_t len;
- int i;
-
- len = strlen(t->obscure);
- otxt = alloca(len * node->char_len + 1);
- ptr = otxt;
- for (i = 0; i < node->char_len; i++)
- {
- memcpy(ptr, t->obscure, len);
- ptr += len;
- }
- *ptr = '\0';
- ewl_text_plaintext_parse(t->textblock, otxt);
+ char *otxt, *ptr;
+ size_t len;
+ int i;
+
+ len = strlen(t->obscure);
+ otxt = alloca(len * node->char_len + 1);
+ ptr = otxt;
+ for (i = 0; i < node->char_len; i++)
+ {
+ memcpy(ptr, t->obscure, len);
+ ptr += len;
+ }
+ *ptr = '\0';
+ ewl_text_plaintext_parse(t->textblock, otxt);
}
evas_textblock_cursor_format_append(cursor, "-");
@@ -3066,32 +3066,32 @@ ewl_text_plaintext_parse(Evas_Object *tb, char *txt)
cursor = (Evas_Textblock_Cursor *)evas_object_textblock_cursor_get(tb);
for (tmp = txt; *tmp; tmp = ewl_text_text_next_char(tmp, &idx))
{
- if (*tmp == '\n')
- {
- *tmp = '\0';
- if (*txt) evas_textblock_cursor_text_append(cursor, txt);
- evas_textblock_cursor_format_append(cursor, "\n");
- *tmp = '\n';
-
- txt = ewl_text_text_next_char(tmp, &idx);
- }
- else if (*tmp == '\r' && *(tmp + 1) == '\n')
- {
- *tmp = '\0';
- if (*txt) evas_textblock_cursor_text_append(cursor, txt);
- evas_textblock_cursor_format_append(cursor, "\n");
- *tmp = '\r';
- tmp = ewl_text_text_next_char(tmp, &idx);
- txt = ewl_text_text_next_char(tmp, &idx);
- }
- else if (*tmp == '\t')
- {
- *tmp = '\0';
- if (*txt) evas_textblock_cursor_text_append(cursor, txt);
- evas_textblock_cursor_format_append(cursor, "\t");
- *tmp = '\t';
- txt = ewl_text_text_next_char(tmp, &idx);
- }
+ if (*tmp == '\n')
+ {
+ *tmp = '\0';
+ if (*txt) evas_textblock_cursor_text_append(cursor, txt);
+ evas_textblock_cursor_format_append(cursor, "\n");
+ *tmp = '\n';
+
+ txt = ewl_text_text_next_char(tmp, &idx);
+ }
+ else if (*tmp == '\r' && *(tmp + 1) == '\n')
+ {
+ *tmp = '\0';
+ if (*txt) evas_textblock_cursor_text_append(cursor, txt);
+ evas_textblock_cursor_format_append(cursor, "\n");
+ *tmp = '\r';
+ tmp = ewl_text_text_next_char(tmp, &idx);
+ txt = ewl_text_text_next_char(tmp, &idx);
+ }
+ else if (*tmp == '\t')
+ {
+ *tmp = '\0';
+ if (*txt) evas_textblock_cursor_text_append(cursor, txt);
+ evas_textblock_cursor_format_append(cursor, "\t");
+ *tmp = '\t';
+ txt = ewl_text_text_next_char(tmp, &idx);
+ }
}
if (*txt) evas_textblock_cursor_text_append(cursor, txt);
@@ -3117,62 +3117,62 @@ ewl_text_textblock_cursor_position(Ewl_Text *t, unsigned int byte_idx)
evas_textblock_cursor_node_first(cursor);
while (TRUE)
{
- txt = evas_textblock_cursor_node_format_get(cursor);
-
- /* if we have text this is a formatting node, need to see if
- * this is a \n or \t as they are special */
- if (txt)
- {
- /* do we have a \n or \t node? */
- if ((!strcmp(txt, "\n")) || (!strcmp(txt, "\t")))
- {
- /* will this push us past the end? */
- if ((cur_byte_idx + 1) > byte_idx)
- {
- evas_textblock_cursor_pos_set(cursor,
- byte_idx - cur_byte_idx);
- break;
- }
- else cur_byte_idx++;
- }
- }
- else
- {
- int pos;
-
- /* this is a text node, so check the length of the
- * text against our current position and the idx we
- * are looking for */
- pos = evas_textblock_cursor_node_text_length_get(cursor);
-
- /* if this would move us past our index, find the
- * difference between our desired index and the
- * current index and set that */
- if ((cur_byte_idx + pos) > byte_idx)
- {
- evas_textblock_cursor_pos_set(cursor,
- byte_idx - cur_byte_idx);
- break;
- }
- cur_byte_idx += pos;
- }
-
- /* if we fail to goto the next node, just assume we're at
- * the end of the text and jump the cursor there */
- if (!evas_textblock_cursor_node_next(cursor))
- {
- evas_textblock_cursor_node_last(cursor);
- evas_textblock_cursor_char_last(cursor);
- break;
- }
-
- /* This shouldn't happen, we've moved past our index. Just
- * checking so the loop isn't (hopefully) infinite */
- if (cur_byte_idx > byte_idx)
- {
- DWARNING("This shouldn't happen, breaking loop.");
- break;
- }
+ txt = evas_textblock_cursor_node_format_get(cursor);
+
+ /* if we have text this is a formatting node, need to see if
+ * this is a \n or \t as they are special */
+ if (txt)
+ {
+ /* do we have a \n or \t node? */
+ if ((!strcmp(txt, "\n")) || (!strcmp(txt, "\t")))
+ {
+ /* will this push us past the end? */
+ if ((cur_byte_idx + 1) > byte_idx)
+ {
+ evas_textblock_cursor_pos_set(cursor,
+ byte_idx - cur_byte_idx);
+ break;
+ }
+ else cur_byte_idx++;
+ }
+ }
+ else
+ {
+ int pos;
+
+ /* this is a text node, so check the length of the
+ * text against our current position and the idx we
+ * are looking for */
+ pos = evas_textblock_cursor_node_text_length_get(cursor);
+
+ /* if this would move us past our index, find the
+ * difference between our desired index and the
+ * current index and set that */
+ if ((cur_byte_idx + pos) > byte_idx)
+ {
+ evas_textblock_cursor_pos_set(cursor,
+ byte_idx - cur_byte_idx);
+ break;
+ }
+ cur_byte_idx += pos;
+ }
+
+ /* if we fail to goto the next node, just assume we're at
+ * the end of the text and jump the cursor there */
+ if (!evas_textblock_cursor_node_next(cursor))
+ {
+ evas_textblock_cursor_node_last(cursor);
+ evas_textblock_cursor_char_last(cursor);
+ break;
+ }
+
+ /* This shouldn't happen, we've moved past our index. Just
+ * checking so the loop isn't (hopefully) infinite */
+ if (cur_byte_idx > byte_idx)
+ {
+ DWARNING("This shouldn't happen, breaking loop.");
+ break;
+ }
}
DRETURN_PTR(cursor, DLEVEL_STABLE);
@@ -3192,12 +3192,12 @@ ewl_text_textblock_cursor_to_index(Evas_Textblock_Cursor *cursor)
char_idx = evas_textblock_cursor_pos_get(cursor);
while (evas_textblock_cursor_node_prev(cursor))
{
- const char *txt;
+ const char *txt;
- txt = evas_textblock_cursor_node_format_get(cursor);
- if (!txt) char_idx += evas_textblock_cursor_node_text_length_get(cursor);
- else if (!strcmp(txt, "\n")) char_idx ++;
- else if (!strcmp(txt, "\t")) char_idx ++;
+ txt = evas_textblock_cursor_node_format_get(cursor);
+ if (!txt) char_idx += evas_textblock_cursor_node_text_length_get(cursor);
+ else if (!strcmp(txt, "\n")) char_idx ++;
+ else if (!strcmp(txt, "\t")) char_idx ++;
}
DRETURN_INT(char_idx, DLEVEL_STABLE);
@@ -3213,7 +3213,7 @@ ewl_text_textblock_cursor_to_index(Evas_Textblock_Cursor *cursor)
*/
void
ewl_text_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text *t;
@@ -3227,15 +3227,15 @@ ewl_text_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
t = EWL_TEXT(w);
if (t->textblock)
{
- ewl_text_size(t);
- if (t->dirty) ewl_text_display(t);
+ ewl_text_size(t);
+ if (t->dirty) ewl_text_display(t);
- ewl_text_triggers_place(t);
+ ewl_text_triggers_place(t);
- /* re-configure the selection to make sure it resizes
- * if needed */
- if (t->selection)
- ewl_widget_configure(EWL_WIDGET(t->selection));
+ /* re-configure the selection to make sure it resizes
+ * if needed */
+ if (t->selection)
+ ewl_widget_configure(EWL_WIDGET(t->selection));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -3264,8 +3264,8 @@ ewl_text_cb_reveal(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
t = EWL_TEXT(w);
if (t->textblock)
{
- DWARNING("We have a textblock when we shoudn't.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("We have a textblock when we shoudn't.");
+ DRETURN(DLEVEL_STABLE);
}
/* find the embed so we know the evas */
@@ -3275,43 +3275,43 @@ ewl_text_cb_reveal(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
/* create the textblock */
t->textblock = ewl_embed_object_request(emb, "textblock");
if (!t->textblock)
- t->textblock = evas_object_textblock_add(emb->canvas);
+ t->textblock = evas_object_textblock_add(emb->canvas);
if (t->textblock)
{
- char *fmt2;
- int len;
-
- ctx = ewl_text_context_default_create(t);
- ewl_text_context_format_string_create(ctx);
-
- len = strlen(ctx->format) + 12; /* 12 == DEFAULT='' + \n + \0 */
- fmt2 = NEW(char, len);
- snprintf(fmt2, len, "DEFAULT='%s'\n", ctx->format);
-
- st = evas_textblock_style_new();
- evas_textblock_style_set(st, fmt2);
- evas_object_textblock_style_set(t->textblock, st);
- evas_textblock_style_free(st);
-
- ewl_text_context_release(ctx);
- FREE(fmt2);
-
- if (EWL_CONTAINER(w)->clip_box)
- {
- evas_object_clip_set(t->textblock,
- EWL_CONTAINER(w)->clip_box);
- evas_object_show(EWL_CONTAINER(w)->clip_box);
- }
- else
- DWARNING("Text does not have a clip box!");
-
- evas_object_pass_events_set(t->textblock, 1);
- evas_object_smart_member_add(t->textblock, w->smart_object);
- if (w->fx_clip_box) evas_object_raise(t->textblock);
-
- ewl_text_display(t);
- evas_object_show(t->textblock);
+ char *fmt2;
+ int len;
+
+ ctx = ewl_text_context_default_create(t);
+ ewl_text_context_format_string_create(ctx);
+
+ len = strlen(ctx->format) + 12; /* 12 == DEFAULT='' + \n + \0 */
+ fmt2 = NEW(char, len);
+ snprintf(fmt2, len, "DEFAULT='%s'\n", ctx->format);
+
+ st = evas_textblock_style_new();
+ evas_textblock_style_set(st, fmt2);
+ evas_object_textblock_style_set(t->textblock, st);
+ evas_textblock_style_free(st);
+
+ ewl_text_context_release(ctx);
+ FREE(fmt2);
+
+ if (EWL_CONTAINER(w)->clip_box)
+ {
+ evas_object_clip_set(t->textblock,
+ EWL_CONTAINER(w)->clip_box);
+ evas_object_show(EWL_CONTAINER(w)->clip_box);
+ }
+ else
+ DWARNING("Text does not have a clip box!");
+
+ evas_object_pass_events_set(t->textblock, 1);
+ evas_object_smart_member_add(t->textblock, w->smart_object);
+ if (w->fx_clip_box) evas_object_raise(t->textblock);
+
+ ewl_text_display(t);
+ evas_object_show(t->textblock);
}
ewl_text_triggers_place(t);
@@ -3329,7 +3329,7 @@ ewl_text_cb_reveal(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
*/
void
ewl_text_cb_obscure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text *t;
@@ -3341,12 +3341,12 @@ ewl_text_cb_obscure(Ewl_Widget *w, void *ev __UNUSED__,
if (t->textblock)
{
- Ewl_Embed *emb;
+ Ewl_Embed *emb;
- emb = ewl_embed_widget_find(w);
- evas_object_textblock_clear(t->textblock);
- ewl_embed_object_cache(emb, t->textblock);
- t->textblock = NULL;
+ emb = ewl_embed_widget_find(w);
+ evas_object_textblock_clear(t->textblock);
+ ewl_embed_object_cache(emb, t->textblock);
+ t->textblock = NULL;
}
ewl_text_triggers_unrealize(t);
@@ -3374,8 +3374,8 @@ ewl_text_cb_show(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
t = EWL_TEXT(w);
if (t->textblock)
{
- evas_object_show(t->textblock);
- ewl_text_triggers_show(t);
+ evas_object_show(t->textblock);
+ ewl_text_triggers_show(t);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -3464,10 +3464,10 @@ ewl_text_cb_mouse_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
event = ev;
t = EWL_TEXT(w);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_text_cb_mouse_move, NULL);
+ ewl_text_cb_mouse_move, NULL);
if (!t->selection)
- t->selection = ewl_text_selection_new(t);
+ t->selection = ewl_text_selection_new(t);
sel = EWL_TEXT_TRIGGER(t->selection);
@@ -3475,18 +3475,18 @@ ewl_text_cb_mouse_down(Ewl_Widget *w, void *ev, void *data __UNUSED__)
modifiers = ewl_ev_modifiers_get();
if (modifiers & EWL_KEY_MODIFIER_SHIFT)
{
- ewl_text_selection_select_to(EWL_TEXT_TRIGGER(t->selection),
- char_idx);
+ ewl_text_selection_select_to(EWL_TEXT_TRIGGER(t->selection),
+ char_idx);
}
else
{
- ewl_widget_hide(t->selection);
- ewl_text_trigger_areas_cleanup(sel);
- ewl_widget_show(t->selection);
+ ewl_widget_hide(t->selection);
+ ewl_text_trigger_areas_cleanup(sel);
+ ewl_widget_show(t->selection);
- ewl_text_trigger_start_pos_set(sel, char_idx);
- ewl_text_trigger_base_set(sel, char_idx);
- ewl_text_trigger_length_set(sel, 0);
+ ewl_text_trigger_start_pos_set(sel, char_idx);
+ ewl_text_trigger_base_set(sel, char_idx);
+ ewl_text_trigger_length_set(sel, 0);
}
t->in_select = TRUE;
ewl_text_trigger_position(t, sel);
@@ -3524,11 +3524,11 @@ ewl_text_cb_mouse_up(Ewl_Widget *w, void *ev, void *data __UNUSED__)
modifiers = ewl_ev_modifiers_get();
if (modifiers & EWL_KEY_MODIFIER_SHIFT)
{
- unsigned int char_idx = 0;
+ unsigned int char_idx = 0;
- char_idx = ewl_text_coord_index_map(EWL_TEXT(w), event->x, event->y);
- ewl_text_selection_select_to(EWL_TEXT_TRIGGER(t->selection),
- char_idx);
+ char_idx = ewl_text_coord_index_map(EWL_TEXT(w), event->x, event->y);
+ ewl_text_selection_select_to(EWL_TEXT_TRIGGER(t->selection),
+ char_idx);
}
ewl_text_trigger_position(t, EWL_TEXT_TRIGGER(t->selection));
@@ -3558,11 +3558,11 @@ ewl_text_cb_mouse_move(Ewl_Widget *w, void *ev, void *data __UNUSED__)
if (t->in_select)
{
- unsigned int char_idx = 0;
+ unsigned int char_idx = 0;
- char_idx = ewl_text_coord_index_map(EWL_TEXT(w), event->x, event->y);
- ewl_text_selection_select_to(EWL_TEXT_TRIGGER(t->selection), char_idx);
- ewl_text_trigger_position(t, EWL_TEXT_TRIGGER(t->selection));
+ char_idx = ewl_text_coord_index_map(EWL_TEXT(w), event->x, event->y);
+ ewl_text_selection_select_to(EWL_TEXT_TRIGGER(t->selection), char_idx);
+ ewl_text_trigger_position(t, EWL_TEXT_TRIGGER(t->selection));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -3606,24 +3606,24 @@ ewl_text_selection_select_to(Ewl_Text_Trigger *s, unsigned int char_idx)
if (char_idx < base)
{
- ewl_text_trigger_start_pos_set(s, char_idx);
- ewl_text_trigger_length_set(s, base - char_idx);
+ ewl_text_trigger_start_pos_set(s, char_idx);
+ ewl_text_trigger_length_set(s, base - char_idx);
}
else
{
- ewl_text_trigger_start_pos_set(s, base);
- ewl_text_trigger_length_set(s, char_idx - base);
+ ewl_text_trigger_start_pos_set(s, base);
+ ewl_text_trigger_length_set(s, char_idx - base);
}
/* set the clipboard text */
txt = ewl_text_selection_text_get(EWL_TEXT(s->text_parent));
if (txt)
{
- Ewl_Embed *emb;
+ Ewl_Embed *emb;
- emb = ewl_embed_widget_find(EWL_WIDGET(s->text_parent));
- ewl_embed_selection_text_set(emb, txt);
- FREE(txt);
+ emb = ewl_embed_widget_find(EWL_WIDGET(s->text_parent));
+ ewl_embed_selection_text_set(emb, txt);
+ FREE(txt);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -3647,7 +3647,7 @@ ewl_text_cb_child_add(Ewl_Container *c, Ewl_Widget *w)
/* if this is a trigger then add it as such */
if (EWL_TEXT_TRIGGER_IS(w))
- ewl_text_trigger_add(EWL_TEXT(c), EWL_TEXT_TRIGGER(w));
+ ewl_text_trigger_add(EWL_TEXT(c), EWL_TEXT_TRIGGER(w));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -3672,26 +3672,26 @@ ewl_text_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx __UNUSED__)
/* if it is a trigger, we need to treat it special */
if (EWL_TEXT_TRIGGER_IS(w))
{
- Ewl_Text_Trigger *trigger;
-
- trigger = EWL_TEXT_TRIGGER(w);
- ewl_text_trigger_areas_cleanup(trigger);
- trigger->text_parent = NULL;
-
- if (trigger->type == EWL_TEXT_TRIGGER_TYPE_TRIGGER)
- {
- ecore_list_goto(EWL_TEXT(c)->triggers, trigger);
- ecore_list_remove(EWL_TEXT(c)->triggers);
- }
- else
- {
- /* for debug */
- if (EWL_TEXT(c)->selection != w)
- DWARNING("We are removing a selection, that"
- "isn't our own. WTF is happening?");
-
- EWL_TEXT(c)->selection = NULL;
- }
+ Ewl_Text_Trigger *trigger;
+
+ trigger = EWL_TEXT_TRIGGER(w);
+ ewl_text_trigger_areas_cleanup(trigger);
+ trigger->text_parent = NULL;
+
+ if (trigger->type == EWL_TEXT_TRIGGER_TYPE_TRIGGER)
+ {
+ ecore_list_goto(EWL_TEXT(c)->triggers, trigger);
+ ecore_list_remove(EWL_TEXT(c)->triggers);
+ }
+ else
+ {
+ /* for debug */
+ if (EWL_TEXT(c)->selection != w)
+ DWARNING("We are removing a selection, that"
+ "isn't our own. WTF is happening?");
+
+ EWL_TEXT(c)->selection = NULL;
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -3699,7 +3699,7 @@ ewl_text_cb_child_remove(Ewl_Container *c, Ewl_Widget *w, int idx __UNUSED__)
static void
ewl_text_current_fmt_set(Ewl_Text *t, unsigned int context_mask,
- Ewl_Text_Context *change)
+ Ewl_Text_Context *change)
{
Ewl_Text_Context *old = NULL, *new;
@@ -3713,22 +3713,22 @@ ewl_text_current_fmt_set(Ewl_Text *t, unsigned int context_mask,
* nodes context. */
if (t->formatting.tx)
{
- old = t->formatting.tx;
+ old = t->formatting.tx;
}
else
{
- Ewl_Text_Fmt_Node *fmt;
-
- fmt = ewl_text_fmt_get_current(t->formatting.nodes);
- if (fmt)
- {
- old = fmt->tx;
-
- /* grab on to this so releasing later doesn't screw
- * things up */
- ewl_text_context_acquire(old);
- }
- else old = ewl_text_context_default_create(t);
+ Ewl_Text_Fmt_Node *fmt;
+
+ fmt = ewl_text_fmt_get_current(t->formatting.nodes);
+ if (fmt)
+ {
+ old = fmt->tx;
+
+ /* grab on to this so releasing later doesn't screw
+ * things up */
+ ewl_text_context_acquire(old);
+ }
+ else old = ewl_text_context_default_create(t);
}
new = ewl_text_context_find(old, context_mask, change);
@@ -3753,12 +3753,12 @@ ewl_text_trigger_position(Ewl_Text *t, Ewl_Text_Trigger *trig)
DCHECK_TYPE(trig, EWL_TEXT_TRIGGER_TYPE);
if (trig->char_len == 0)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_text_trigger_areas_cleanup(trig);
ewl_text_fmt_char_to_byte(t->formatting.nodes,
- trig->char_pos, trig->char_len - 1,
- &byte_idx, &byte_len);
+ trig->char_pos, trig->char_len - 1,
+ &byte_idx, &byte_len);
cur1 = ewl_text_textblock_cursor_position(t, byte_idx);
cur2 = ewl_text_textblock_cursor_position(t, byte_idx + byte_len);
@@ -3767,15 +3767,15 @@ ewl_text_trigger_position(Ewl_Text *t, Ewl_Text_Trigger *trig)
rects = evas_textblock_cursor_range_geometry_get(cur1, cur2);
while (rects)
{
- Evas_Textblock_Rectangle *tr;
+ Evas_Textblock_Rectangle *tr;
- tr = rects->data;
- ewl_text_trigger_area_add(t, trig, tr->x + CURRENT_X(t),
- tr->y + CURRENT_Y(t),
- tr->w, tr->h);
+ tr = rects->data;
+ ewl_text_trigger_area_add(t, trig, tr->x + CURRENT_X(t),
+ tr->y + CURRENT_Y(t),
+ tr->w, tr->h);
- FREE(tr);
- rects = evas_list_remove_list(rects, rects);
+ FREE(tr);
+ rects = evas_list_remove_list(rects, rects);
}
evas_textblock_cursor_free(cur1);
evas_textblock_cursor_free(cur2);
@@ -3793,10 +3793,10 @@ ewl_text_triggers_remove(Ewl_Text *t)
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (!t->triggers)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
while ((trig = ecore_list_first_remove(t->triggers)))
- ewl_widget_destroy(EWL_WIDGET(trig));
+ ewl_widget_destroy(EWL_WIDGET(trig));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -3805,8 +3805,8 @@ ewl_text_triggers_remove(Ewl_Text *t)
* position of the current cursors so they appear in the correct positions */
static void
ewl_text_triggers_shift(Ewl_Text *t, unsigned int char_pos,
- unsigned int char_len,
- unsigned int del)
+ unsigned int char_len,
+ unsigned int del)
{
Ewl_Text_Trigger *cur;
@@ -3815,80 +3815,80 @@ ewl_text_triggers_shift(Ewl_Text *t, unsigned int char_pos,
DCHECK_TYPE(t, EWL_TEXT_TYPE);
if (!t->triggers)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ecore_list_first_goto(t->triggers);
while ((cur = ecore_list_next(t->triggers)))
{
- /* check if the change is after the trigger */
- if (char_pos >= (cur->char_pos + cur->char_len))
- continue;
-
- /* change is completely before the trigger */
- if ((char_pos + char_len) < cur->char_pos)
- {
- if (del) cur->char_pos -= char_len;
- else cur->char_pos += char_len;
- continue;
- }
-
- if (del)
- {
- /* delete the entire trigger? */
- if ((char_pos <= cur->char_pos) &&
- ((char_pos + char_len) >=
- (cur->char_pos + cur->char_len)))
- {
- int index;
-
- index = ecore_list_index(t->triggers);
- if (index == 0)
- {
- DWARNING("Is this possible?");
- }
- else
- {
- index --;
-
- /* remove the node before the
- * current one as _next will put us
- * on the next node */
- ecore_list_index_goto(t->triggers, index);
- ecore_list_remove(t->triggers);
- ecore_list_index_goto(t->triggers, index);
- }
- continue;
- }
-
- /* delete part of the start of the trigger */
- if (char_pos <= cur->char_pos)
- {
- cur->char_len -= ((char_pos + char_len) - cur->char_pos);
- continue;
- }
-
- /* delete from the center of the trigger */
- if ((char_pos >= cur->char_pos) &&
- ((char_pos + char_len) <=
- (cur->char_pos + cur->char_len)))
- {
- cur->char_len -= char_len;
- continue;
- }
-
- /* must be deleted from the end of the trigger then */
- cur->char_len = char_pos - cur->char_pos;
- }
- else
- {
- /* we are inserting, just see if we are before */
- if (char_pos < cur->char_pos)
- {
- cur->char_pos += char_len;
- continue;
- }
- cur->char_len += char_len;
- }
+ /* check if the change is after the trigger */
+ if (char_pos >= (cur->char_pos + cur->char_len))
+ continue;
+
+ /* change is completely before the trigger */
+ if ((char_pos + char_len) < cur->char_pos)
+ {
+ if (del) cur->char_pos -= char_len;
+ else cur->char_pos += char_len;
+ continue;
+ }
+
+ if (del)
+ {
+ /* delete the entire trigger? */
+ if ((char_pos <= cur->char_pos) &&
+ ((char_pos + char_len) >=
+ (cur->char_pos + cur->char_len)))
+ {
+ int index;
+
+ index = ecore_list_index(t->triggers);
+ if (index == 0)
+ {
+ DWARNING("Is this possible?");
+ }
+ else
+ {
+ index --;
+
+ /* remove the node before the
+ * current one as _next will put us
+ * on the next node */
+ ecore_list_index_goto(t->triggers, index);
+ ecore_list_remove(t->triggers);
+ ecore_list_index_goto(t->triggers, index);
+ }
+ continue;
+ }
+
+ /* delete part of the start of the trigger */
+ if (char_pos <= cur->char_pos)
+ {
+ cur->char_len -= ((char_pos + char_len) - cur->char_pos);
+ continue;
+ }
+
+ /* delete from the center of the trigger */
+ if ((char_pos >= cur->char_pos) &&
+ ((char_pos + char_len) <=
+ (cur->char_pos + cur->char_len)))
+ {
+ cur->char_len -= char_len;
+ continue;
+ }
+
+ /* must be deleted from the end of the trigger then */
+ cur->char_len = char_pos - cur->char_pos;
+ }
+ else
+ {
+ /* we are inserting, just see if we are before */
+ if (char_pos < cur->char_pos)
+ {
+ cur->char_pos += char_len;
+ continue;
+ }
+ cur->char_len += char_len;
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -3909,15 +3909,15 @@ ewl_text_triggers_place(Ewl_Text *t)
if (t->triggers)
{
- Ewl_Text_Trigger *cur;
+ Ewl_Text_Trigger *cur;
- ecore_list_first_goto(t->triggers);
- while ((cur = ecore_list_next(t->triggers)))
- ewl_text_trigger_position(t, cur);
+ ecore_list_first_goto(t->triggers);
+ while ((cur = ecore_list_next(t->triggers)))
+ ewl_text_trigger_position(t, cur);
}
if (t->selection)
- ewl_text_trigger_position(t, EWL_TEXT_TRIGGER(t->selection));
+ ewl_text_trigger_position(t, EWL_TEXT_TRIGGER(t->selection));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -3939,9 +3939,9 @@ ewl_text_triggers_unrealize(Ewl_Text *t)
if (t->triggers)
{
- ecore_list_first_goto(t->triggers);
- while ((cur = ecore_list_next(t->triggers)))
- ewl_widget_unrealize(EWL_WIDGET(cur));
+ ecore_list_first_goto(t->triggers);
+ while ((cur = ecore_list_next(t->triggers)))
+ ewl_widget_unrealize(EWL_WIDGET(cur));
}
if (t->selection) ewl_widget_unrealize(t->selection);
@@ -3966,9 +3966,9 @@ ewl_text_triggers_show(Ewl_Text *t)
if (t->triggers)
{
- ecore_list_first_goto(t->triggers);
- while ((cur = ecore_list_next(t->triggers)))
- ewl_widget_show(EWL_WIDGET(cur));
+ ecore_list_first_goto(t->triggers);
+ while ((cur = ecore_list_next(t->triggers)))
+ ewl_widget_show(EWL_WIDGET(cur));
}
if (t->selection) ewl_widget_show(t->selection);
@@ -3994,9 +3994,9 @@ ewl_text_triggers_hide(Ewl_Text *t)
/* hide the triggers */
if (t->triggers)
{
- ecore_list_first_goto(t->triggers);
- while ((cur = ecore_list_next(t->triggers)))
- ewl_widget_hide(EWL_WIDGET(cur));
+ ecore_list_first_goto(t->triggers);
+ while ((cur = ecore_list_next(t->triggers)))
+ ewl_widget_hide(EWL_WIDGET(cur));
}
/* hide the selection */
@@ -4021,54 +4021,54 @@ ewl_text_trigger_add(Ewl_Text *t, Ewl_Text_Trigger *trigger)
/* the rest will be for real triggers only */
if (trigger->type == EWL_TEXT_TRIGGER_TYPE_SELECTION)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* create the trigger list if needed */
if (!t->triggers)
- t->triggers = ecore_list_new();
+ t->triggers = ecore_list_new();
/* if we have no length, we start past the end of the text, or we
* extend past the end of the text then return an error */
if ((trigger->char_len == 0)
- || ((trigger->char_pos + trigger->char_len) > t->length.chars))
- DRETURN(DLEVEL_STABLE);
+ || ((trigger->char_pos + trigger->char_len) > t->length.chars))
+ DRETURN(DLEVEL_STABLE);
/* check now for overlapping */
ecore_list_first_goto(t->triggers);
while ((cur = ecore_list_next(t->triggers)))
{
- if (trigger->char_pos < cur->char_pos)
- {
- if ((trigger->char_pos + trigger->char_len) < cur->char_pos)
- break;
-
- DWARNING("Overlapping triggers are not allowed.");
- DRETURN(DLEVEL_STABLE);
- }
-
- if ((trigger->char_pos > (cur->char_pos + cur->char_len)))
- continue;
-
- if ((trigger->char_pos >= cur->char_pos)
- && (trigger->char_pos <= (cur->char_pos + cur->char_len)))
- {
- DWARNING("Overlapping triggers are not allowed.");
- DRETURN(DLEVEL_STABLE);
- }
+ if (trigger->char_pos < cur->char_pos)
+ {
+ if ((trigger->char_pos + trigger->char_len) < cur->char_pos)
+ break;
+
+ DWARNING("Overlapping triggers are not allowed.");
+ DRETURN(DLEVEL_STABLE);
+ }
+
+ if ((trigger->char_pos > (cur->char_pos + cur->char_len)))
+ continue;
+
+ if ((trigger->char_pos >= cur->char_pos)
+ && (trigger->char_pos <= (cur->char_pos + cur->char_len)))
+ {
+ DWARNING("Overlapping triggers are not allowed.");
+ DRETURN(DLEVEL_STABLE);
+ }
}
if (cur)
{
- /* we need to set our position to the one before the one we
- * are on because the _next call in the while will have
- * advanced us to the next node, but we want to insert
- * at the one before that */
- ecore_list_index_goto(t->triggers, ecore_list_index(t->triggers) - 1);
- ecore_list_insert(t->triggers, trigger);
+ /* we need to set our position to the one before the one we
+ * are on because the _next call in the while will have
+ * advanced us to the next node, but we want to insert
+ * at the one before that */
+ ecore_list_index_goto(t->triggers, ecore_list_index(t->triggers) - 1);
+ ecore_list_insert(t->triggers, trigger);
}
else
- ecore_list_append(t->triggers, trigger);
+ ecore_list_append(t->triggers, trigger);
DRETURN(DLEVEL_STABLE);
}
@@ -4083,16 +4083,16 @@ ewl_text_drawn_byte_to_char(Ewl_Text *t, unsigned int byte_idx)
DCHECK_TYPE_RET(t, EWL_TEXT_TYPE, 0);
if (!t->obscure)
- ewl_text_fmt_byte_to_char(t->formatting.nodes, byte_idx,
- 0, &char_idx, NULL);
+ ewl_text_fmt_byte_to_char(t->formatting.nodes, byte_idx,
+ 0, &char_idx, NULL);
else
{
- size_t len = strlen(t->obscure);
+ size_t len = strlen(t->obscure);
- if (len != 0)
- char_idx = byte_idx / len;
- else
- char_idx = ewl_text_length_get(t);
+ if (len != 0)
+ char_idx = byte_idx / len;
+ else
+ char_idx = ewl_text_length_get(t);
}
DRETURN_INT(char_idx, DLEVEL_STABLE);
@@ -4108,10 +4108,10 @@ ewl_text_char_to_drawn_byte(Ewl_Text *t, unsigned int char_idx)
DCHECK_TYPE_RET(t, EWL_TEXT_TYPE, 0);
if (!t->obscure)
- ewl_text_fmt_char_to_byte(t->formatting.nodes, char_idx,
- 0, &byte_idx, NULL);
+ ewl_text_fmt_char_to_byte(t->formatting.nodes, char_idx,
+ 0, &byte_idx, NULL);
else
- byte_idx = char_idx * strlen(t->obscure);
+ byte_idx = char_idx * strlen(t->obscure);
DRETURN_INT(byte_idx, DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_text.h b/src/lib/ewl_text.h
index e00fe5b..098bf16 100644
--- a/src/lib/ewl_text.h
+++ b/src/lib/ewl_text.h
@@ -68,228 +68,228 @@ typedef struct Ewl_Text Ewl_Text;
struct Ewl_Text
{
Ewl_Container container; /**< Inherit from Ewl_Container */
- void *textblock; /**< The Evas_Object_Textblock */
+ void *textblock; /**< The Evas_Object_Textblock */
- char *text; /**< The text itself */
+ char *text; /**< The text itself */
char *obscure; /**< The utf8 character to be displayed
- instead of the real text */
+ instead of the real text */
struct
{
- unsigned int chars; /**< Number of characters in the text */
- unsigned int bytes; /**< Number of bytes in the text */
- unsigned int max_chars; /**< Maximal number of characters in the text */
- } length; /**< Different text lengths */
+ unsigned int chars; /**< Number of characters in the text */
+ unsigned int bytes; /**< Number of bytes in the text */
+ unsigned int max_chars; /**< Maximal number of characters in the text */
+ } length; /**< Different text lengths */
- unsigned int total_size; /**< The total size we've alloc'd for text */
- unsigned int cursor_position; /**< The cursor position */
+ unsigned int total_size; /**< The total size we've alloc'd for text */
+ unsigned int cursor_position; /**< The cursor position */
struct
{
- void *nodes; /**< The formatting nodes */
- void *tx; /**< The current formatting context */
- } formatting; /**< Holds the formatting information */
+ void *nodes; /**< The formatting nodes */
+ void *tx; /**< The current formatting context */
+ } formatting; /**< Holds the formatting information */
- Ecore_List *triggers; /**< The list of triggers */
+ Ecore_List *triggers; /**< The list of triggers */
Ecore_List *areas_cache; /**< unused areas */
- Ewl_Widget *selection; /**< The current selection */
+ Ewl_Widget *selection; /**< The current selection */
struct
{
- int x; /**< X offset for layout */
- int y; /**< Y offset for layout */
- } offset; /**< Layout offset values */
+ int x; /**< X offset for layout */
+ int y; /**< Y offset for layout */
+ } offset; /**< Layout offset values */
- unsigned char delete_count; /**< Number of deletes */
- unsigned char in_select; /**< Are we in select mode? */
+ unsigned char delete_count; /**< Number of deletes */
+ unsigned char in_select; /**< Are we in select mode? */
- unsigned char selectable; /**< Is the text selectable? */
- unsigned char dirty; /**< Does the text need layout? */
+ unsigned char selectable; /**< Is the text selectable? */
+ unsigned char dirty; /**< Does the text need layout? */
};
Ewl_Widget *ewl_text_new(void);
-int ewl_text_init(Ewl_Text *t);
+int ewl_text_init(Ewl_Text *t);
unsigned int ewl_text_length_get(Ewl_Text *t);
-void ewl_text_length_maximum_set(Ewl_Text *t,
- unsigned int char_num);
+void ewl_text_length_maximum_set(Ewl_Text *t,
+ unsigned int char_num);
unsigned int ewl_text_length_maximum_get(Ewl_Text *t);
-void ewl_text_offsets_set(Ewl_Text *t, int x, int y);
-void ewl_text_offsets_get(Ewl_Text *t, int *x, int *y);
+void ewl_text_offsets_set(Ewl_Text *t, int x, int y);
+void ewl_text_offsets_get(Ewl_Text *t, int *x, int *y);
-void ewl_text_index_geometry_map(Ewl_Text *t,
- unsigned int char_idx,
- int *x, int *y,
- int *w, int *h);
+void ewl_text_index_geometry_map(Ewl_Text *t,
+ unsigned int char_idx,
+ int *x, int *y,
+ int *w, int *h);
unsigned int ewl_text_coord_index_map(Ewl_Text *t, int x, int y);
-char *ewl_text_text_get(Ewl_Text *t);
-void ewl_text_text_set(Ewl_Text *t, const char *text);
-void ewl_text_clear(Ewl_Text *t);
+char *ewl_text_text_get(Ewl_Text *t);
+void ewl_text_text_set(Ewl_Text *t, const char *text);
+void ewl_text_clear(Ewl_Text *t);
-void ewl_text_text_prepend(Ewl_Text *t, const char *text);
-void ewl_text_text_append(Ewl_Text *t, const char *text);
-void ewl_text_text_insert(Ewl_Text *t, const char *text,
- unsigned int char_idx);
-void ewl_text_text_delete(Ewl_Text *t, unsigned int length);
+void ewl_text_text_prepend(Ewl_Text *t, const char *text);
+void ewl_text_text_append(Ewl_Text *t, const char *text);
+void ewl_text_text_insert(Ewl_Text *t, const char *text,
+ unsigned int char_idx);
+void ewl_text_text_delete(Ewl_Text *t, unsigned int length);
-void ewl_text_obscure_set(Ewl_Text *t, const char *utf8_character);
+void ewl_text_obscure_set(Ewl_Text *t, const char *utf8_character);
-void ewl_text_selectable_set(Ewl_Text *t, unsigned int selectable);
+void ewl_text_selectable_set(Ewl_Text *t, unsigned int selectable);
unsigned int ewl_text_selectable_get(Ewl_Text *t);
-char *ewl_text_selection_text_get(Ewl_Text *t);
+char *ewl_text_selection_text_get(Ewl_Text *t);
unsigned int ewl_text_has_selection(Ewl_Text *t);
Ewl_Widget *ewl_text_selection_get(Ewl_Text *t);
-void ewl_text_select(Ewl_Text *t, unsigned int char_idx,
- unsigned int char_len);
-void ewl_text_all_select(Ewl_Text *t);
+void ewl_text_select(Ewl_Text *t, unsigned int char_idx,
+ unsigned int char_len);
+void ewl_text_all_select(Ewl_Text *t);
-void ewl_text_cursor_position_set(Ewl_Text *t,
- unsigned int char_pos);
+void ewl_text_cursor_position_set(Ewl_Text *t,
+ unsigned int char_pos);
unsigned int ewl_text_cursor_position_get(Ewl_Text *t);
unsigned int ewl_text_cursor_position_line_up_get(Ewl_Text *t);
unsigned int ewl_text_cursor_position_line_down_get(Ewl_Text *t);
-void ewl_text_font_set(Ewl_Text *t, const char *font);
-void ewl_text_font_apply(Ewl_Text *t, const char *font,
- unsigned int char_len);
-char *ewl_text_font_get(Ewl_Text *t, unsigned int char_idx);
-
-void ewl_text_font_source_set(Ewl_Text *t, const char *source,
- const char *font);
-void ewl_text_font_source_apply(Ewl_Text *t, const char *source,
- const char *font,
- unsigned int char_len);
-char *ewl_text_font_source_get(Ewl_Text *t, unsigned int char_idx);
-
-void ewl_text_font_size_set(Ewl_Text *t, unsigned int size);
-void ewl_text_font_size_apply(Ewl_Text *t, unsigned int size,
- unsigned int char_len);
+void ewl_text_font_set(Ewl_Text *t, const char *font);
+void ewl_text_font_apply(Ewl_Text *t, const char *font,
+ unsigned int char_len);
+char *ewl_text_font_get(Ewl_Text *t, unsigned int char_idx);
+
+void ewl_text_font_source_set(Ewl_Text *t, const char *source,
+ const char *font);
+void ewl_text_font_source_apply(Ewl_Text *t, const char *source,
+ const char *font,
+ unsigned int char_len);
+char *ewl_text_font_source_get(Ewl_Text *t, unsigned int char_idx);
+
+void ewl_text_font_size_set(Ewl_Text *t, unsigned int size);
+void ewl_text_font_size_apply(Ewl_Text *t, unsigned int size,
+ unsigned int char_len);
unsigned int ewl_text_font_size_get(Ewl_Text *t, unsigned int char_idx);
-void ewl_text_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-void ewl_text_align_set(Ewl_Text *t, unsigned int align);
-void ewl_text_align_apply(Ewl_Text *t, unsigned int align,
- unsigned int char_len);
+void ewl_text_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+void ewl_text_align_set(Ewl_Text *t, unsigned int align);
+void ewl_text_align_apply(Ewl_Text *t, unsigned int align,
+ unsigned int char_len);
unsigned int ewl_text_align_get(Ewl_Text *t, unsigned int char_idx);
-void ewl_text_styles_set(Ewl_Text *t, unsigned int styles);
-void ewl_text_styles_apply(Ewl_Text *t, unsigned int styles,
- unsigned int char_len);
+void ewl_text_styles_set(Ewl_Text *t, unsigned int styles);
+void ewl_text_styles_apply(Ewl_Text *t, unsigned int styles,
+ unsigned int char_len);
unsigned int ewl_text_styles_get(Ewl_Text *t, unsigned int char_idx);
-void ewl_text_style_add(Ewl_Text *t, Ewl_Text_Style sytle,
- unsigned int char_len);
-void ewl_text_style_del(Ewl_Text *t, Ewl_Text_Style style,
- unsigned int char_len);
-void ewl_text_style_invert(Ewl_Text *t, Ewl_Text_Style style,
- unsigned int char_len);
+void ewl_text_style_add(Ewl_Text *t, Ewl_Text_Style sytle,
+ unsigned int char_len);
+void ewl_text_style_del(Ewl_Text *t, Ewl_Text_Style style,
+ unsigned int char_len);
+void ewl_text_style_invert(Ewl_Text *t, Ewl_Text_Style style,
+ unsigned int char_len);
unsigned int ewl_text_style_has(Ewl_Text *t, Ewl_Text_Style style,
- unsigned int char_idx);
+ unsigned int char_idx);
-void ewl_text_wrap_set(Ewl_Text *t, Ewl_Text_Wrap wrap);
-void ewl_text_wrap_apply(Ewl_Text *t, Ewl_Text_Wrap wrap,
- unsigned int char_len);
+void ewl_text_wrap_set(Ewl_Text *t, Ewl_Text_Wrap wrap);
+void ewl_text_wrap_apply(Ewl_Text *t, Ewl_Text_Wrap wrap,
+ unsigned int char_len);
Ewl_Text_Wrap ewl_text_wrap_get(Ewl_Text *t, unsigned int char_idx);
-void ewl_text_bg_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_bg_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_bg_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-void ewl_text_glow_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_glow_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_glow_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-void ewl_text_outline_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_outline_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_outline_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-void ewl_text_shadow_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_shadow_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_shadow_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-void ewl_text_strikethrough_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_strikethrough_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_strikethrough_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-void ewl_text_underline_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_underline_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_underline_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-void ewl_text_double_underline_color_set(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_text_double_underline_color_apply(Ewl_Text *t,
- unsigned int r, unsigned int g,
- unsigned int b, unsigned int a,
- unsigned int char_len);
-void ewl_text_double_underline_color_get(Ewl_Text *t,
- unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a,
- unsigned int char_idx);
-
-char *ewl_text_text_next_char(const char *text, unsigned int *idx);
+void ewl_text_bg_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_bg_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_bg_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+void ewl_text_glow_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_glow_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_glow_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+void ewl_text_outline_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_outline_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_outline_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+void ewl_text_shadow_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_shadow_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_shadow_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+void ewl_text_strikethrough_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_strikethrough_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_strikethrough_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+void ewl_text_underline_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_underline_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_underline_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+void ewl_text_double_underline_color_set(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_text_double_underline_color_apply(Ewl_Text *t,
+ unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a,
+ unsigned int char_len);
+void ewl_text_double_underline_color_get(Ewl_Text *t,
+ unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a,
+ unsigned int char_idx);
+
+char *ewl_text_text_next_char(const char *text, unsigned int *idx);
/*
* Internal stuff
diff --git a/src/lib/ewl_text_context.c b/src/lib/ewl_text_context.c
index 2de4209..6e250e4 100644
--- a/src/lib/ewl_text_context.c
+++ b/src/lib/ewl_text_context.c
@@ -34,10 +34,10 @@ ewl_text_context_init(void)
if (!context_hash)
{
- context_hash = ecore_hash_new(ewl_text_context_hash_key,
- ewl_text_context_hash_cmp);
- ecore_hash_free_value_cb_set(context_hash,
- ewl_text_context_cb_free);
+ context_hash = ecore_hash_new(ewl_text_context_hash_key,
+ ewl_text_context_hash_cmp);
+ ecore_hash_free_value_cb_set(context_hash,
+ ewl_text_context_cb_free);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -86,7 +86,7 @@ ewl_text_context_new(void)
*/
Ewl_Text_Context *
ewl_text_context_find(Ewl_Text_Context *tx, unsigned int context_mask,
- Ewl_Text_Context *tx_change)
+ Ewl_Text_Context *tx_change)
{
Ewl_Text_Context tmp_tx;
Ewl_Text_Context *new_tx;
@@ -96,80 +96,80 @@ ewl_text_context_find(Ewl_Text_Context *tx, unsigned int context_mask,
/* only need the tx_change if we have a context mask */
if (context_mask > 0)
- DCHECK_PARAM_PTR_RET(tx_change, NULL);
+ DCHECK_PARAM_PTR_RET(tx_change, NULL);
memcpy(&tmp_tx, tx, sizeof(Ewl_Text_Context));
ewl_text_context_merge(&tmp_tx, context_mask, tx_change);
new_tx = ecore_hash_get(context_hash, &tmp_tx);
if (!new_tx)
{
- if ((new_tx = ewl_text_context_dup(tx)))
- {
- if (context_mask & EWL_TEXT_CONTEXT_MASK_FONT)
- {
- IF_RELEASE(new_tx->font);
- new_tx->font = ecore_string_instance(
- tx_change->font);
-
- IF_RELEASE(new_tx->font_source);
- if (tx_change->font_source)
- new_tx->font_source = ecore_string_instance(tx_change->font_source);
- }
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_SIZE)
- new_tx->size = tx_change->size;
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_STYLES)
- new_tx->styles = tx_change->styles;
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_ALIGN)
- new_tx->align = tx_change->align;
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_WRAP)
- new_tx->wrap = tx_change->wrap;
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_COLOR)
- memcpy(&(new_tx->color), &(tx_change->color),
- sizeof(Ewl_Color_Set));
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_BG_COLOR)
- memcpy(&(new_tx->style_colors.bg),
- &(tx_change->style_colors.bg),
- sizeof(Ewl_Color_Set));
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_GLOW_COLOR)
- memcpy(&(new_tx->style_colors.glow),
- &(tx_change->style_colors.glow),
- sizeof(Ewl_Color_Set));
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_OUTLINE_COLOR)
- memcpy(&(new_tx->style_colors.outline),
- &(tx_change->style_colors.outline),
- sizeof(Ewl_Color_Set));
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_SHADOW_COLOR)
- memcpy(&(new_tx->style_colors.shadow),
- &(tx_change->style_colors.shadow),
- sizeof(Ewl_Color_Set));
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_STRIKETHROUGH_COLOR)
- memcpy(&(new_tx->style_colors.strikethrough),
- &(tx_change->style_colors.strikethrough),
- sizeof(Ewl_Color_Set));
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_UNDERLINE_COLOR)
- memcpy(&(new_tx->style_colors.underline),
- &(tx_change->style_colors.underline),
- sizeof(Ewl_Color_Set));
-
- if (context_mask & EWL_TEXT_CONTEXT_MASK_DOUBLE_UNDERLINE_COLOR)
- memcpy(&(new_tx->style_colors.double_underline),
- &(tx_change->style_colors.double_underline),
- sizeof(Ewl_Color_Set));
-
- IF_RELEASE(new_tx->format);
- ecore_hash_set(context_hash, new_tx, new_tx);
- }
+ if ((new_tx = ewl_text_context_dup(tx)))
+ {
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_FONT)
+ {
+ IF_RELEASE(new_tx->font);
+ new_tx->font = ecore_string_instance(
+ tx_change->font);
+
+ IF_RELEASE(new_tx->font_source);
+ if (tx_change->font_source)
+ new_tx->font_source = ecore_string_instance(tx_change->font_source);
+ }
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_SIZE)
+ new_tx->size = tx_change->size;
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_STYLES)
+ new_tx->styles = tx_change->styles;
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_ALIGN)
+ new_tx->align = tx_change->align;
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_WRAP)
+ new_tx->wrap = tx_change->wrap;
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_COLOR)
+ memcpy(&(new_tx->color), &(tx_change->color),
+ sizeof(Ewl_Color_Set));
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_BG_COLOR)
+ memcpy(&(new_tx->style_colors.bg),
+ &(tx_change->style_colors.bg),
+ sizeof(Ewl_Color_Set));
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_GLOW_COLOR)
+ memcpy(&(new_tx->style_colors.glow),
+ &(tx_change->style_colors.glow),
+ sizeof(Ewl_Color_Set));
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_OUTLINE_COLOR)
+ memcpy(&(new_tx->style_colors.outline),
+ &(tx_change->style_colors.outline),
+ sizeof(Ewl_Color_Set));
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_SHADOW_COLOR)
+ memcpy(&(new_tx->style_colors.shadow),
+ &(tx_change->style_colors.shadow),
+ sizeof(Ewl_Color_Set));
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_STRIKETHROUGH_COLOR)
+ memcpy(&(new_tx->style_colors.strikethrough),
+ &(tx_change->style_colors.strikethrough),
+ sizeof(Ewl_Color_Set));
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_UNDERLINE_COLOR)
+ memcpy(&(new_tx->style_colors.underline),
+ &(tx_change->style_colors.underline),
+ sizeof(Ewl_Color_Set));
+
+ if (context_mask & EWL_TEXT_CONTEXT_MASK_DOUBLE_UNDERLINE_COLOR)
+ memcpy(&(new_tx->style_colors.double_underline),
+ &(tx_change->style_colors.double_underline),
+ sizeof(Ewl_Color_Set));
+
+ IF_RELEASE(new_tx->format);
+ ecore_hash_set(context_hash, new_tx, new_tx);
+ }
}
if (new_tx) ewl_text_context_acquire(new_tx);
@@ -242,19 +242,19 @@ ewl_text_context_print(Ewl_Text_Context *tx, const char *indent)
else s = tx->font_source;
printf("%sfont: %s (source: %s)\n"
- "%ssize %d\n"
- "%sstyle %d\n"
- "%salign %d\n"
- "%swrap %d\n"
- "%sred %d\n"
- "%sgreen %d\n"
- "%sblue %d\n"
- "%salpha %d",
- indent, t, s, indent, tx->size, indent,
- tx->styles, indent, tx->align,
- indent, tx->wrap, indent, tx->color.r,
- indent, tx->color.g, indent, tx->color.b,
- indent, tx->color.a);
+ "%ssize %d\n"
+ "%sstyle %d\n"
+ "%salign %d\n"
+ "%swrap %d\n"
+ "%sred %d\n"
+ "%sgreen %d\n"
+ "%sblue %d\n"
+ "%salpha %d",
+ indent, t, s, indent, tx->size, indent,
+ tx->styles, indent, tx->align,
+ indent, tx->wrap, indent, tx->color.r,
+ indent, tx->color.g, indent, tx->color.b,
+ indent, tx->color.a);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -274,9 +274,9 @@ ewl_text_context_format_string_create(Ewl_Text_Context *ctx)
int pos = 0, i;
struct
{
- const char *key;
- char *val;
- int free;
+ const char *key;
+ char *val;
+ int free;
} fmt[128];
DENTER_FUNCTION(DLEVEL_STABLE);
@@ -284,114 +284,114 @@ ewl_text_context_format_string_create(Ewl_Text_Context *ctx)
/* only do this once if possible */
if (ctx->format)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* create the style string */
if (ctx->styles != EWL_TEXT_STYLE_NONE)
{
- if ((ctx->styles & EWL_TEXT_STYLE_UNDERLINE) ||
- (ctx->styles & EWL_TEXT_STYLE_DOUBLE_UNDERLINE))
- {
- t = ((ctx->styles & EWL_TEXT_STYLE_UNDERLINE) ? "single" : "double");
-
- fmt[pos].key = "underline_color";
- fmt[pos].val = ewl_text_context_color_string_get(
- &(ctx->style_colors.underline));
- fmt[pos++].free = TRUE;
-
- if (ctx->styles & EWL_TEXT_STYLE_DOUBLE_UNDERLINE)
- {
- fmt[pos].key = "underline2_color";
- fmt[pos].val = ewl_text_context_color_string_get(
- &(ctx->style_colors.double_underline));
- fmt[pos++].free = TRUE;
- }
- }
- else t = "off";
-
- fmt[pos].key = "underline";
- fmt[pos].val = t;
- fmt[pos++].free = FALSE;
-
- if (ctx->styles & EWL_TEXT_STYLE_STRIKETHROUGH)
- {
- t = "on";
-
- fmt[pos].key = "strikethrough_color";
- fmt[pos].val = ewl_text_context_color_string_get(
- &(ctx->style_colors.strikethrough));
- fmt[pos++].free = TRUE;
- }
- else t = "off";
-
- fmt[pos].key = "strikethrough";
- fmt[pos].val = t;
- fmt[pos++].free = FALSE;
-
- if ((ctx->styles & EWL_TEXT_STYLE_SHADOW)
- || (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
- || (ctx->styles & EWL_TEXT_STYLE_FAR_SHADOW)
- || (ctx->styles & EWL_TEXT_STYLE_OUTLINE)
- || (ctx->styles & EWL_TEXT_STYLE_GLOW))
- {
- fmt[pos].key = "shadow_color";
- fmt[pos].val = ewl_text_context_color_string_get(
- &(ctx->style_colors.shadow));
- fmt[pos++].free = TRUE;
-
- if (ctx->styles & EWL_TEXT_STYLE_GLOW)
- {
- t = "glow";
-
- fmt[pos].key = "glow_color";
- fmt[pos].val = ewl_text_context_color_string_get(
- &(ctx->style_colors.glow));
- fmt[pos++].free = TRUE;
- }
- else if (ctx->styles & EWL_TEXT_STYLE_OUTLINE)
- {
- if (ctx->styles & EWL_TEXT_STYLE_SHADOW)
- t = "outline_shadow";
- else if (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
- t = "outline_soft_shadow";
- else t = "outline";
-
- fmt[pos].key = "outline_color";
- fmt[pos].val = ewl_text_context_color_string_get(
- &(ctx->style_colors.outline));
- fmt[pos++].free = TRUE;
- }
- else if (ctx->styles & EWL_TEXT_STYLE_SHADOW)
- t = "shadow";
-
- else if (ctx->styles & EWL_TEXT_STYLE_FAR_SHADOW)
- {
- if (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
- t = "far_soft_shadow";
- else t = "far_shadow";
- }
- else if (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
- t = "soft_shadow";
- }
- else t = "off";
-
- fmt[pos].key = "style";
- fmt[pos].val = t;
- fmt[pos++].free = FALSE;
+ if ((ctx->styles & EWL_TEXT_STYLE_UNDERLINE) ||
+ (ctx->styles & EWL_TEXT_STYLE_DOUBLE_UNDERLINE))
+ {
+ t = ((ctx->styles & EWL_TEXT_STYLE_UNDERLINE) ? "single" : "double");
+
+ fmt[pos].key = "underline_color";
+ fmt[pos].val = ewl_text_context_color_string_get(
+ &(ctx->style_colors.underline));
+ fmt[pos++].free = TRUE;
+
+ if (ctx->styles & EWL_TEXT_STYLE_DOUBLE_UNDERLINE)
+ {
+ fmt[pos].key = "underline2_color";
+ fmt[pos].val = ewl_text_context_color_string_get(
+ &(ctx->style_colors.double_underline));
+ fmt[pos++].free = TRUE;
+ }
+ }
+ else t = "off";
+
+ fmt[pos].key = "underline";
+ fmt[pos].val = t;
+ fmt[pos++].free = FALSE;
+
+ if (ctx->styles & EWL_TEXT_STYLE_STRIKETHROUGH)
+ {
+ t = "on";
+
+ fmt[pos].key = "strikethrough_color";
+ fmt[pos].val = ewl_text_context_color_string_get(
+ &(ctx->style_colors.strikethrough));
+ fmt[pos++].free = TRUE;
+ }
+ else t = "off";
+
+ fmt[pos].key = "strikethrough";
+ fmt[pos].val = t;
+ fmt[pos++].free = FALSE;
+
+ if ((ctx->styles & EWL_TEXT_STYLE_SHADOW)
+ || (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
+ || (ctx->styles & EWL_TEXT_STYLE_FAR_SHADOW)
+ || (ctx->styles & EWL_TEXT_STYLE_OUTLINE)
+ || (ctx->styles & EWL_TEXT_STYLE_GLOW))
+ {
+ fmt[pos].key = "shadow_color";
+ fmt[pos].val = ewl_text_context_color_string_get(
+ &(ctx->style_colors.shadow));
+ fmt[pos++].free = TRUE;
+
+ if (ctx->styles & EWL_TEXT_STYLE_GLOW)
+ {
+ t = "glow";
+
+ fmt[pos].key = "glow_color";
+ fmt[pos].val = ewl_text_context_color_string_get(
+ &(ctx->style_colors.glow));
+ fmt[pos++].free = TRUE;
+ }
+ else if (ctx->styles & EWL_TEXT_STYLE_OUTLINE)
+ {
+ if (ctx->styles & EWL_TEXT_STYLE_SHADOW)
+ t = "outline_shadow";
+ else if (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
+ t = "outline_soft_shadow";
+ else t = "outline";
+
+ fmt[pos].key = "outline_color";
+ fmt[pos].val = ewl_text_context_color_string_get(
+ &(ctx->style_colors.outline));
+ fmt[pos++].free = TRUE;
+ }
+ else if (ctx->styles & EWL_TEXT_STYLE_SHADOW)
+ t = "shadow";
+
+ else if (ctx->styles & EWL_TEXT_STYLE_FAR_SHADOW)
+ {
+ if (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
+ t = "far_soft_shadow";
+ else t = "far_shadow";
+ }
+ else if (ctx->styles & EWL_TEXT_STYLE_SOFT_SHADOW)
+ t = "soft_shadow";
+ }
+ else t = "off";
+
+ fmt[pos].key = "style";
+ fmt[pos].val = t;
+ fmt[pos++].free = FALSE;
}
else
{
- fmt[pos].key = "underline";
- fmt[pos].val = "off";
- fmt[pos++].free = FALSE;
+ fmt[pos].key = "underline";
+ fmt[pos].val = "off";
+ fmt[pos++].free = FALSE;
- fmt[pos].key = "strikethrough";
- fmt[pos].val = "off";
- fmt[pos++].free = FALSE;
+ fmt[pos].key = "strikethrough";
+ fmt[pos].val = "off";
+ fmt[pos++].free = FALSE;
- fmt[pos].key = "style";
- fmt[pos].val = "off";
- fmt[pos++].free = FALSE;
+ fmt[pos].key = "style";
+ fmt[pos].val = "off";
+ fmt[pos++].free = FALSE;
}
/* create the alignment string */
@@ -415,18 +415,18 @@ ewl_text_context_format_string_create(Ewl_Text_Context *ctx)
fmt[pos].key = "font_source";
if (ctx->font_source)
{
- fmt[pos].val = (char *)ctx->font_source;
- fmt[pos++].free = FALSE;
+ fmt[pos].val = (char *)ctx->font_source;
+ fmt[pos++].free = FALSE;
- t = strdup(ctx->font);
+ t = strdup(ctx->font);
}
else
{
- fmt[pos].val = (char *)ewl_theme_path_get();
- fmt[pos++].free = FALSE;
+ fmt[pos].val = (char *)ewl_theme_path_get();
+ fmt[pos++].free = FALSE;
- t = NEW(char, 128);
- snprintf(t, 128, "fonts/%s", ctx->font);
+ t = NEW(char, 128);
+ snprintf(t, 128, "fonts/%s", ctx->font);
}
fmt[pos].key = "font";
@@ -449,22 +449,22 @@ ewl_text_context_format_string_create(Ewl_Text_Context *ctx)
/* create the formatting string */
{
- char format[2048];
+ char format[2048];
- format[0] = '\0';
- ecore_strlcat(format, "+", sizeof(format));
+ format[0] = '\0';
+ ecore_strlcat(format, "+", sizeof(format));
- for (i = 0; i < pos; i ++)
- {
- ecore_strlcat(format, fmt[i].key, sizeof(format));
- ecore_strlcat(format, "=", sizeof(format));
- ecore_strlcat(format, fmt[i].val, sizeof(format));
- ecore_strlcat(format, " ", sizeof(format));
+ for (i = 0; i < pos; i ++)
+ {
+ ecore_strlcat(format, fmt[i].key, sizeof(format));
+ ecore_strlcat(format, "=", sizeof(format));
+ ecore_strlcat(format, fmt[i].val, sizeof(format));
+ ecore_strlcat(format, " ", sizeof(format));
- if (fmt[i].free) FREE(fmt[i].val);
- }
+ if (fmt[i].free) FREE(fmt[i].val);
+ }
- ctx->format = ecore_string_instance(format);
+ ctx->format = ecore_string_instance(format);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -501,9 +501,9 @@ ewl_text_context_hash_key(const void *ctx)
key = 0;
if (tx->font)
- key ^= ecore_str_hash(tx->font);
+ key ^= ecore_str_hash(tx->font);
if (tx->font_source)
- key ^= ecore_str_hash(tx->font_source);
+ key ^= ecore_str_hash(tx->font_source);
key ^= (tx->size << 5);
key ^= (tx->styles << 7);
@@ -536,17 +536,17 @@ ewl_text_context_hash_cmp(const void *ctx1, const void *ctx2)
KEY_COMPARE(tx1->styles, tx2->styles);
KEY_COMPARE(KEY_BUILD(tx1->color), KEY_BUILD(tx2->color));
KEY_COMPARE(KEY_BUILD(tx1->style_colors.bg),
- KEY_BUILD(tx2->style_colors.bg));
+ KEY_BUILD(tx2->style_colors.bg));
KEY_COMPARE(KEY_BUILD(tx1->style_colors.outline),
- KEY_BUILD(tx2->style_colors.outline));
+ KEY_BUILD(tx2->style_colors.outline));
KEY_COMPARE(KEY_BUILD(tx1->style_colors.shadow),
- KEY_BUILD(tx2->style_colors.shadow));
+ KEY_BUILD(tx2->style_colors.shadow));
KEY_COMPARE(KEY_BUILD(tx1->style_colors.strikethrough),
- KEY_BUILD(tx2->style_colors.strikethrough));
+ KEY_BUILD(tx2->style_colors.strikethrough));
KEY_COMPARE(KEY_BUILD(tx1->style_colors.underline),
- KEY_BUILD(tx2->style_colors.underline));
+ KEY_BUILD(tx2->style_colors.underline));
KEY_COMPARE(KEY_BUILD(tx1->style_colors.double_underline),
- KEY_BUILD(tx2->style_colors.double_underline));
+ KEY_BUILD(tx2->style_colors.double_underline));
DRETURN_INT(0, DLEVEL_STABLE);
CTX1_LARGER:
@@ -557,16 +557,16 @@ CTX2_LARGER:
static void
ewl_text_context_merge(Ewl_Text_Context *tx, unsigned int context_mask,
- Ewl_Text_Context *tx_change)
+ Ewl_Text_Context *tx_change)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(tx);
if (context_mask & EWL_TEXT_CONTEXT_MASK_FONT) {
- IF_RELEASE(tx->font);
- IF_RELEASE(tx->font_source);
- tx->font = ecore_string_instance(tx_change->font);
- tx->font = ecore_string_instance(tx_change->font);
+ IF_RELEASE(tx->font);
+ IF_RELEASE(tx->font_source);
+ tx->font = ecore_string_instance(tx_change->font);
+ tx->font = ecore_string_instance(tx_change->font);
}
tx->size = ((context_mask & EWL_TEXT_CONTEXT_MASK_SIZE) ? tx_change->size : tx->size);
tx->styles = ((context_mask & EWL_TEXT_CONTEXT_MASK_STYLES) ? tx_change->styles : tx->styles),
@@ -577,61 +577,61 @@ ewl_text_context_merge(Ewl_Text_Context *tx, unsigned int context_mask,
tx->color.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_COLOR) ? tx_change->color.b : tx->color.b);
tx->color.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_COLOR) ? tx_change->color.a : tx->color.a);
tx->style_colors.bg.r = ((context_mask & EWL_TEXT_CONTEXT_MASK_BG_COLOR) ?
- tx_change->style_colors.bg.r : tx->style_colors.bg.r);
+ tx_change->style_colors.bg.r : tx->style_colors.bg.r);
tx->style_colors.bg.g = ((context_mask & EWL_TEXT_CONTEXT_MASK_BG_COLOR) ?
- tx_change->style_colors.bg.g : tx->style_colors.bg.g);
+ tx_change->style_colors.bg.g : tx->style_colors.bg.g);
tx->style_colors.bg.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_BG_COLOR) ?
- tx_change->style_colors.bg.b : tx->style_colors.bg.b);
+ tx_change->style_colors.bg.b : tx->style_colors.bg.b);
tx->style_colors.bg.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_BG_COLOR) ?
- tx_change->style_colors.bg.a : tx->style_colors.bg.a);
+ tx_change->style_colors.bg.a : tx->style_colors.bg.a);
tx->style_colors.glow.r = ((context_mask & EWL_TEXT_CONTEXT_MASK_GLOW_COLOR) ?
- tx_change->style_colors.glow.r : tx->style_colors.glow.r);
+ tx_change->style_colors.glow.r : tx->style_colors.glow.r);
tx->style_colors.glow.g = ((context_mask & EWL_TEXT_CONTEXT_MASK_GLOW_COLOR) ?
- tx_change->style_colors.glow.g : tx->style_colors.glow.g);
+ tx_change->style_colors.glow.g : tx->style_colors.glow.g);
tx->style_colors.glow.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_GLOW_COLOR) ?
- tx_change->style_colors.glow.b : tx->style_colors.glow.b);
+ tx_change->style_colors.glow.b : tx->style_colors.glow.b);
tx->style_colors.glow.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_GLOW_COLOR) ?
- tx_change->style_colors.glow.a : tx->style_colors.glow.a);
+ tx_change->style_colors.glow.a : tx->style_colors.glow.a);
tx->style_colors.outline.r = ((context_mask & EWL_TEXT_CONTEXT_MASK_OUTLINE_COLOR) ?
- tx_change->style_colors.outline.r : tx->style_colors.outline.r);
+ tx_change->style_colors.outline.r : tx->style_colors.outline.r);
tx->style_colors.outline.g = ((context_mask & EWL_TEXT_CONTEXT_MASK_OUTLINE_COLOR) ?
- tx_change->style_colors.outline.g : tx->style_colors.outline.g);
+ tx_change->style_colors.outline.g : tx->style_colors.outline.g);
tx->style_colors.outline.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_OUTLINE_COLOR) ?
- tx_change->style_colors.outline.b : tx->style_colors.outline.b);
+ tx_change->style_colors.outline.b : tx->style_colors.outline.b);
tx->style_colors.outline.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_OUTLINE_COLOR) ?
- tx_change->style_colors.outline.a : tx->style_colors.outline.a);
+ tx_change->style_colors.outline.a : tx->style_colors.outline.a);
tx->style_colors.shadow.r = ((context_mask & EWL_TEXT_CONTEXT_MASK_SHADOW_COLOR) ?
- tx_change->style_colors.shadow.r : tx->style_colors.shadow.r);
+ tx_change->style_colors.shadow.r : tx->style_colors.shadow.r);
tx->style_colors.shadow.g = ((context_mask & EWL_TEXT_CONTEXT_MASK_SHADOW_COLOR) ?
- tx_change->style_colors.shadow.g : tx->style_colors.shadow.g);
+ tx_change->style_colors.shadow.g : tx->style_colors.shadow.g);
tx->style_colors.shadow.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_SHADOW_COLOR) ?
- tx_change->style_colors.shadow.b : tx->style_colors.shadow.b);
+ tx_change->style_colors.shadow.b : tx->style_colors.shadow.b);
tx->style_colors.shadow.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_SHADOW_COLOR) ?
- tx_change->style_colors.shadow.a : tx->style_colors.shadow.a);
+ tx_change->style_colors.shadow.a : tx->style_colors.shadow.a);
tx->style_colors.strikethrough.r = ((context_mask & EWL_TEXT_CONTEXT_MASK_STRIKETHROUGH_COLOR) ?
- tx_change->style_colors.strikethrough.r : tx->style_colors.strikethrough.r);
+ tx_change->style_colors.strikethrough.r : tx->style_colors.strikethrough.r);
tx->style_colors.strikethrough.g = ((context_mask & EWL_TEXT_CONTEXT_MASK_STRIKETHROUGH_COLOR) ?
- tx_change->style_colors.strikethrough.g : tx->style_colors.strikethrough.g);
+ tx_change->style_colors.strikethrough.g : tx->style_colors.strikethrough.g);
tx->style_colors.strikethrough.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_STRIKETHROUGH_COLOR) ?
- tx_change->style_colors.strikethrough.b : tx->style_colors.strikethrough.b);
+ tx_change->style_colors.strikethrough.b : tx->style_colors.strikethrough.b);
tx->style_colors.strikethrough.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_STRIKETHROUGH_COLOR) ?
- tx_change->style_colors.strikethrough.a : tx->style_colors.strikethrough.a);
+ tx_change->style_colors.strikethrough.a : tx->style_colors.strikethrough.a);
tx->style_colors.underline.r = ((context_mask & EWL_TEXT_CONTEXT_MASK_UNDERLINE_COLOR) ?
- tx_change->style_colors.underline.r : tx->style_colors.underline.r),
+ tx_change->style_colors.underline.r : tx->style_colors.underline.r),
tx->style_colors.underline.g = ((context_mask & EWL_TEXT_CONTEXT_MASK_UNDERLINE_COLOR) ?
- tx_change->style_colors.underline.g : tx->style_colors.underline.g),
+ tx_change->style_colors.underline.g : tx->style_colors.underline.g),
tx->style_colors.underline.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_UNDERLINE_COLOR) ?
- tx_change->style_colors.underline.b : tx->style_colors.underline.b),
+ tx_change->style_colors.underline.b : tx->style_colors.underline.b),
tx->style_colors.underline.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_UNDERLINE_COLOR) ?
- tx_change->style_colors.underline.a : tx->style_colors.underline.a),
+ tx_change->style_colors.underline.a : tx->style_colors.underline.a),
tx->style_colors.double_underline.r = ((context_mask & EWL_TEXT_CONTEXT_MASK_DOUBLE_UNDERLINE_COLOR) ?
- tx_change->style_colors.double_underline.r : tx->style_colors.double_underline.r),
+ tx_change->style_colors.double_underline.r : tx->style_colors.double_underline.r),
tx->style_colors.double_underline.g = ((context_mask & EWL_TEXT_CONTEXT_MASK_DOUBLE_UNDERLINE_COLOR) ?
- tx_change->style_colors.double_underline.g : tx->style_colors.double_underline.g),
+ tx_change->style_colors.double_underline.g : tx->style_colors.double_underline.g),
tx->style_colors.double_underline.b = ((context_mask & EWL_TEXT_CONTEXT_MASK_DOUBLE_UNDERLINE_COLOR) ?
- tx_change->style_colors.double_underline.b : tx->style_colors.double_underline.b),
+ tx_change->style_colors.double_underline.b : tx->style_colors.double_underline.b),
tx->style_colors.double_underline.a = ((context_mask & EWL_TEXT_CONTEXT_MASK_DOUBLE_UNDERLINE_COLOR) ?
- tx_change->style_colors.double_underline.a : tx->style_colors.double_underline.a);
+ tx_change->style_colors.double_underline.a : tx->style_colors.double_underline.a);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -646,7 +646,7 @@ ewl_text_context_cb_free(void *data)
tx = data;
while (ewl_text_context_release(tx) > 0)
- ;
+ ;
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_text_context.h b/src/lib/ewl_text_context.h
index e4af213..76f5a46 100644
--- a/src/lib/ewl_text_context.h
+++ b/src/lib/ewl_text_context.h
@@ -19,42 +19,42 @@ typedef struct Ewl_Text_Context Ewl_Text_Context;
*/
struct Ewl_Text_Context
{
- const char *font; /**< Font name */
- const char *font_source; /**< The font source */
- unsigned int styles; /**< Styles set in this node */
- unsigned int align; /**< Text alignment */
- Ewl_Text_Wrap wrap; /**< Text wrap setting */
- char size; /**< Font size */
- Ewl_Color_Set color; /**< Font colour */
+ const char *font; /**< Font name */
+ const char *font_source; /**< The font source */
+ unsigned int styles; /**< Styles set in this node */
+ unsigned int align; /**< Text alignment */
+ Ewl_Text_Wrap wrap; /**< Text wrap setting */
+ char size; /**< Font size */
+ Ewl_Color_Set color; /**< Font colour */
struct
{
- Ewl_Color_Set bg; /**< Background colour */
- Ewl_Color_Set glow; /**< Glow colour */
- Ewl_Color_Set outline; /**< Outline colour */
- Ewl_Color_Set shadow; /**< Shadow colour */
- Ewl_Color_Set strikethrough; /**< Strikethrough colour */
- Ewl_Color_Set underline; /**< Underline colour */
- Ewl_Color_Set double_underline; /**< Double underline colour */
- } style_colors; /**< Colour information */
+ Ewl_Color_Set bg; /**< Background colour */
+ Ewl_Color_Set glow; /**< Glow colour */
+ Ewl_Color_Set outline; /**< Outline colour */
+ Ewl_Color_Set shadow; /**< Shadow colour */
+ Ewl_Color_Set strikethrough; /**< Strikethrough colour */
+ Ewl_Color_Set underline; /**< Underline colour */
+ Ewl_Color_Set double_underline; /**< Double underline colour */
+ } style_colors; /**< Colour information */
- unsigned int ref_count; /**< Number of references to this context */
- const char *format; /**< This context's format string */
+ unsigned int ref_count; /**< Number of references to this context */
+ const char *format; /**< This context's format string */
};
-int ewl_text_context_init(void);
-void ewl_text_context_shutdown(void);
+int ewl_text_context_init(void);
+void ewl_text_context_shutdown(void);
Ewl_Text_Context *ewl_text_context_new(void);
Ewl_Text_Context *ewl_text_context_find(Ewl_Text_Context *tx,
unsigned int context_mask, Ewl_Text_Context *tx_change);
-void ewl_text_context_acquire(Ewl_Text_Context *tx);
-int ewl_text_context_release(Ewl_Text_Context *tx);
+void ewl_text_context_acquire(Ewl_Text_Context *tx);
+int ewl_text_context_release(Ewl_Text_Context *tx);
-void ewl_text_context_print(Ewl_Text_Context *tx, const char *indent);
-void ewl_text_context_format_string_create(Ewl_Text_Context *ctx);
+void ewl_text_context_print(Ewl_Text_Context *tx, const char *indent);
+void ewl_text_context_format_string_create(Ewl_Text_Context *ctx);
/**
* @}
diff --git a/src/lib/ewl_text_fmt.c b/src/lib/ewl_text_fmt.c
index 33888cf..4cd1f0d 100644
--- a/src/lib/ewl_text_fmt.c
+++ b/src/lib/ewl_text_fmt.c
@@ -26,8 +26,8 @@ ewl_text_fmt_new(Ewl_Text *t)
fmt->nodes = ecore_dlist_new();
if (!fmt->nodes)
{
- ewl_text_fmt_destroy(fmt);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_text_fmt_destroy(fmt);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
ecore_dlist_free_cb_set(fmt->nodes, ewl_text_fmt_node_free);
@@ -68,8 +68,8 @@ ewl_text_fmt_clear(Ewl_Text_Fmt *fmt)
while ((node = ecore_dlist_first_remove(fmt->nodes)))
{
- if (node->tx) ewl_text_context_release(node->tx);
- FREE(node);
+ if (node->tx) ewl_text_context_release(node->tx);
+ FREE(node);
}
fmt->current_node.char_idx = 0;
@@ -91,7 +91,7 @@ ewl_text_fmt_clear(Ewl_Text_Fmt *fmt)
*/
void
ewl_text_fmt_node_prepend(Ewl_Text_Fmt *fmt, Ewl_Text_Context *tx,
- unsigned int char_len, unsigned int byte_len)
+ unsigned int char_len, unsigned int byte_len)
{
Ewl_Text_Fmt_Node *node = NULL;
@@ -103,14 +103,14 @@ ewl_text_fmt_node_prepend(Ewl_Text_Fmt *fmt, Ewl_Text_Context *tx,
if (tx)
{
- node = ewl_text_fmt_node_new(tx, char_len, byte_len);
- ecore_dlist_prepend(fmt->nodes, node);
+ node = ewl_text_fmt_node_new(tx, char_len, byte_len);
+ ecore_dlist_prepend(fmt->nodes, node);
}
else
{
- node = ewl_text_fmt_get_first(fmt);
- node->char_len += char_len;
- node->byte_len += byte_len;
+ node = ewl_text_fmt_get_first(fmt);
+ node->char_len += char_len;
+ node->byte_len += byte_len;
}
/* we prepended so we need to add the nodes lengths to the current
@@ -131,7 +131,7 @@ ewl_text_fmt_node_prepend(Ewl_Text_Fmt *fmt, Ewl_Text_Context *tx,
*/
void
ewl_text_fmt_node_append(Ewl_Text_Fmt *fmt, Ewl_Text_Context *tx,
- unsigned int char_len, unsigned int byte_len)
+ unsigned int char_len, unsigned int byte_len)
{
Ewl_Text_Fmt_Node *node;
@@ -141,23 +141,23 @@ ewl_text_fmt_node_append(Ewl_Text_Fmt *fmt, Ewl_Text_Context *tx,
node = ewl_text_fmt_get_last(fmt);
if (tx && (!node || (node->char_len > 0)))
{
- node = ewl_text_fmt_node_new(tx, char_len, byte_len);
- ecore_dlist_append(fmt->nodes, node);
+ node = ewl_text_fmt_node_new(tx, char_len, byte_len);
+ ecore_dlist_append(fmt->nodes, node);
}
else
{
- /* if we've got a new context to use and our current
- * formatting node has no text in it replace its context
- * with the new one */
- if (tx && (node->char_len == 0))
- {
- ewl_text_context_release(node->tx);
- node->tx = tx;
- ewl_text_context_acquire(node->tx);
- }
-
- node->char_len += char_len;
- node->byte_len += byte_len;
+ /* if we've got a new context to use and our current
+ * formatting node has no text in it replace its context
+ * with the new one */
+ if (tx && (node->char_len == 0))
+ {
+ ewl_text_context_release(node->tx);
+ node->tx = tx;
+ ewl_text_context_acquire(node->tx);
+ }
+
+ node->char_len += char_len;
+ node->byte_len += byte_len;
}
fmt->length.char_len += char_len;
@@ -177,8 +177,8 @@ ewl_text_fmt_node_append(Ewl_Text_Fmt *fmt, Ewl_Text_Context *tx,
*/
void
ewl_text_fmt_node_insert(Ewl_Text_Fmt *fmt, unsigned int idx,
- Ewl_Text_Context *tx, unsigned int char_len,
- unsigned int byte_len)
+ Ewl_Text_Context *tx, unsigned int char_len,
+ unsigned int byte_len)
{
Ewl_Text_Fmt_Node *node = NULL, *cur_node, *left = NULL;
@@ -190,11 +190,11 @@ ewl_text_fmt_node_insert(Ewl_Text_Fmt *fmt, unsigned int idx,
if (!tx)
{
- node = ewl_text_fmt_get_current(fmt);
- node->char_len += char_len;
- node->byte_len += byte_len;
+ node = ewl_text_fmt_get_current(fmt);
+ node->char_len += char_len;
+ node->byte_len += byte_len;
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
node = ewl_text_fmt_node_new(tx, char_len, byte_len);
@@ -202,62 +202,62 @@ ewl_text_fmt_node_insert(Ewl_Text_Fmt *fmt, unsigned int idx,
/* insert at the current location */
if (fmt->current_node.char_idx == idx)
- ecore_dlist_insert(fmt->nodes, node);
+ ecore_dlist_insert(fmt->nodes, node);
/* insert at the end of the current node */
else if ((fmt->current_node.char_idx + cur_node->char_len) == idx)
{
- ecore_dlist_next(fmt->nodes);
- if (ecore_dlist_current(fmt->nodes))
- {
- ecore_dlist_insert(fmt->nodes, node);
-
- /* update our index as we're currently on the next node */
- fmt->current_node.char_idx += cur_node->char_len;
- fmt->current_node.byte_idx += cur_node->byte_len;
- }
- else
- {
- ecore_dlist_append(fmt->nodes, node);
- ecore_dlist_last_goto(fmt->nodes);
-
- /* we haven't incremented the sizes yet so we're at
- * the end of the last set of nodes */
- fmt->current_node.char_idx = fmt->length.char_len;
- fmt->current_node.byte_idx = fmt->length.byte_len;
- }
+ ecore_dlist_next(fmt->nodes);
+ if (ecore_dlist_current(fmt->nodes))
+ {
+ ecore_dlist_insert(fmt->nodes, node);
+
+ /* update our index as we're currently on the next node */
+ fmt->current_node.char_idx += cur_node->char_len;
+ fmt->current_node.byte_idx += cur_node->byte_len;
+ }
+ else
+ {
+ ecore_dlist_append(fmt->nodes, node);
+ ecore_dlist_last_goto(fmt->nodes);
+
+ /* we haven't incremented the sizes yet so we're at
+ * the end of the last set of nodes */
+ fmt->current_node.char_idx = fmt->length.char_len;
+ fmt->current_node.byte_idx = fmt->length.byte_len;
+ }
}
else
{
- /* insert into the middle of the current node */
- left = ewl_text_fmt_node_new(node->tx,
- idx - fmt->current_node.char_idx, 0);
- ewl_text_fmt_char_to_byte(fmt, idx,
- idx - fmt->current_node.char_idx,
- NULL, &(left->byte_len));
-
- cur_node->char_len -= left->char_len;
- cur_node->byte_len -= left->byte_len;
-
- /* insert inserts to the right, so move past the current node so we
- * can insert the two new ones. If we have a node to the left we
- * insert the left node then the new node so the new one is in the
- * middle. If there is no node to the left we insert the new node
- * then the left node. */
- ecore_dlist_next(fmt->nodes);
- if (ecore_dlist_current(fmt->nodes))
- {
- ecore_dlist_insert(fmt->nodes, left);
- ecore_dlist_insert(fmt->nodes, node);
- }
- else
- {
- ecore_dlist_append(fmt->nodes, node);
- ecore_dlist_last_goto(fmt->nodes);
- ecore_dlist_append(fmt->nodes, left);
- }
- fmt->current_node.char_idx += cur_node->char_len;
- fmt->current_node.byte_idx += cur_node->byte_len;
+ /* insert into the middle of the current node */
+ left = ewl_text_fmt_node_new(node->tx,
+ idx - fmt->current_node.char_idx, 0);
+ ewl_text_fmt_char_to_byte(fmt, idx,
+ idx - fmt->current_node.char_idx,
+ NULL, &(left->byte_len));
+
+ cur_node->char_len -= left->char_len;
+ cur_node->byte_len -= left->byte_len;
+
+ /* insert inserts to the right, so move past the current node so we
+ * can insert the two new ones. If we have a node to the left we
+ * insert the left node then the new node so the new one is in the
+ * middle. If there is no node to the left we insert the new node
+ * then the left node. */
+ ecore_dlist_next(fmt->nodes);
+ if (ecore_dlist_current(fmt->nodes))
+ {
+ ecore_dlist_insert(fmt->nodes, left);
+ ecore_dlist_insert(fmt->nodes, node);
+ }
+ else
+ {
+ ecore_dlist_append(fmt->nodes, node);
+ ecore_dlist_last_goto(fmt->nodes);
+ ecore_dlist_append(fmt->nodes, left);
+ }
+ fmt->current_node.char_idx += cur_node->char_len;
+ fmt->current_node.byte_idx += cur_node->byte_len;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -272,7 +272,7 @@ ewl_text_fmt_node_insert(Ewl_Text_Fmt *fmt, unsigned int idx,
*/
void
ewl_text_fmt_node_delete(Ewl_Text_Fmt *fmt, unsigned int idx,
- unsigned int char_len)
+ unsigned int char_len)
{
Ewl_Text_Fmt_Node *node;
@@ -281,9 +281,9 @@ ewl_text_fmt_node_delete(Ewl_Text_Fmt *fmt, unsigned int idx,
if (idx < fmt->current_node.char_idx)
{
- DWARNING("The current position (%u) is higher than the to "
- "be to remove position (%u)\n",
- fmt->current_node.char_idx, idx);
+ DWARNING("The current position (%u) is higher than the to "
+ "be to remove position (%u)\n",
+ fmt->current_node.char_idx, idx);
}
/* adjust the char length, we'll adjust the byte length later */
fmt->length.char_len -= char_len;
@@ -291,43 +291,43 @@ ewl_text_fmt_node_delete(Ewl_Text_Fmt *fmt, unsigned int idx,
node = ecore_dlist_current(fmt->nodes);
while (char_len > 0)
{
- unsigned int available;
-
- /* how much space is available in this node to be removed */
- available = node->char_len - (idx - fmt->current_node.char_idx);
- if (available > char_len) available = char_len;
-
- node->char_len -= available;
- if (node->char_len > 0)
- {
- unsigned int byte_len = 0;
-
- /* Note: we already removed the related text part
- * so it is save to use the new shorter text here */
- ewl_text_fmt_char_to_byte(fmt,
- fmt->current_node.char_idx,
- node->char_len,
- NULL, &byte_len);
-
- /* deduct the byte count */
- fmt->length.byte_len -= node->byte_len - byte_len;
- node->byte_len = byte_len;
-
- fmt->current_node.char_idx += node->char_len;
- fmt->current_node.byte_idx += node->byte_len;
- ecore_dlist_next(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
- }
- else
- {
- /* we still need to adjust the global byte count */
- fmt->length.byte_len -= node->byte_len;
-
- ecore_dlist_remove(fmt->nodes);
- ewl_text_fmt_node_free(node);
- node = ecore_dlist_current(fmt->nodes);
- }
- char_len -= available;
+ unsigned int available;
+
+ /* how much space is available in this node to be removed */
+ available = node->char_len - (idx - fmt->current_node.char_idx);
+ if (available > char_len) available = char_len;
+
+ node->char_len -= available;
+ if (node->char_len > 0)
+ {
+ unsigned int byte_len = 0;
+
+ /* Note: we already removed the related text part
+ * so it is save to use the new shorter text here */
+ ewl_text_fmt_char_to_byte(fmt,
+ fmt->current_node.char_idx,
+ node->char_len,
+ NULL, &byte_len);
+
+ /* deduct the byte count */
+ fmt->length.byte_len -= node->byte_len - byte_len;
+ node->byte_len = byte_len;
+
+ fmt->current_node.char_idx += node->char_len;
+ fmt->current_node.byte_idx += node->byte_len;
+ ecore_dlist_next(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
+ }
+ else
+ {
+ /* we still need to adjust the global byte count */
+ fmt->length.byte_len -= node->byte_len;
+
+ ecore_dlist_remove(fmt->nodes);
+ ewl_text_fmt_node_free(node);
+ node = ecore_dlist_current(fmt->nodes);
+ }
+ char_len -= available;
}
/* make sure we've still got a current node. if not reset to the
@@ -335,9 +335,9 @@ ewl_text_fmt_node_delete(Ewl_Text_Fmt *fmt, unsigned int idx,
node = ecore_dlist_current(fmt->nodes);
if (!node)
{
- ecore_dlist_first_goto(fmt->nodes);
- fmt->current_node.char_idx = 0;
- fmt->current_node.byte_idx = 0;
+ ecore_dlist_first_goto(fmt->nodes);
+ fmt->current_node.char_idx = 0;
+ fmt->current_node.byte_idx = 0;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -444,22 +444,22 @@ ewl_text_fmt_goto(Ewl_Text_Fmt *fmt, unsigned int idx)
if (fmt->length.char_len != EWL_TEXT(fmt->text)->length.chars)
{
- DWARNING("The character length of the fmt (%u) is not"
- " equal to the length of the text (%u)\n",
- fmt->length.char_len,
- EWL_TEXT(fmt->text)->length.chars);
+ DWARNING("The character length of the fmt (%u) is not"
+ " equal to the length of the text (%u)\n",
+ fmt->length.char_len,
+ EWL_TEXT(fmt->text)->length.chars);
}
if (idx >= fmt->length.char_len)
{
- node = ecore_dlist_last_goto(fmt->nodes);
+ node = ecore_dlist_last_goto(fmt->nodes);
- fmt->current_node.char_idx =
- fmt->length.char_len - node->char_len;
- fmt->current_node.byte_idx =
- fmt->length.byte_len - node->byte_len;
+ fmt->current_node.char_idx =
+ fmt->length.char_len - node->char_len;
+ fmt->current_node.byte_idx =
+ fmt->length.byte_len - node->byte_len;
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
node = ecore_dlist_first_goto(fmt->nodes);
@@ -468,85 +468,85 @@ ewl_text_fmt_goto(Ewl_Text_Fmt *fmt, unsigned int idx)
while ((fmt->current_node.char_idx + node->char_len) <= idx)
{
- fmt->current_node.char_idx += node->char_len;
- fmt->current_node.byte_idx += node->byte_len;
+ fmt->current_node.char_idx += node->char_len;
+ fmt->current_node.byte_idx += node->byte_len;
- ecore_dlist_next(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
+ ecore_dlist_next(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
}
#if 0
/* set to start of text */
if (idx == 0)
{
- fmt->current_node.char_idx = 0;
- fmt->current_node.byte_idx = 0;
- ecore_dlist_first_goto(fmt->nodes);
+ fmt->current_node.char_idx = 0;
+ fmt->current_node.byte_idx = 0;
+ ecore_dlist_first_goto(fmt->nodes);
}
/* set to end of text */
else if (idx >= fmt->length.char_len)
{
- node = ecore_dlist_last_goto(fmt->nodes);
+ node = ecore_dlist_last_goto(fmt->nodes);
- fmt->current_node.char_idx =
- fmt->length.char_len - node->char_len;
- fmt->current_node.byte_idx =
- fmt->length.byte_len - node->byte_len;
+ fmt->current_node.char_idx =
+ fmt->length.char_len - node->char_len;
+ fmt->current_node.byte_idx =
+ fmt->length.byte_len - node->byte_len;
}
/* set to after our current position
* walk forward until we cover the given position */
else if (fmt->current_node.char_idx < idx)
{
- node = ecore_dlist_current(fmt->nodes);
- while ((node->char_len + fmt->current_node.char_idx) < idx)
- {
- fmt->current_node.char_idx += node->char_len;
- fmt->current_node.byte_idx += node->byte_len;
-
- ecore_dlist_next(fmt->nodes);
- if (!(node = ecore_dlist_current(fmt->nodes)))
- {
- DWARNING("Incorrectly walked off list.\n");
- node = ecore_dlist_last_goto(fmt->nodes);
- fmt->current_node.char_idx =
- fmt->length.char_len - node->char_len;
- fmt->current_node.byte_idx =
- fmt->length.byte_len - node->byte_len;
- break;
- }
- }
+ node = ecore_dlist_current(fmt->nodes);
+ while ((node->char_len + fmt->current_node.char_idx) < idx)
+ {
+ fmt->current_node.char_idx += node->char_len;
+ fmt->current_node.byte_idx += node->byte_len;
+
+ ecore_dlist_next(fmt->nodes);
+ if (!(node = ecore_dlist_current(fmt->nodes)))
+ {
+ DWARNING("Incorrectly walked off list.\n");
+ node = ecore_dlist_last_goto(fmt->nodes);
+ fmt->current_node.char_idx =
+ fmt->length.char_len - node->char_len;
+ fmt->current_node.byte_idx =
+ fmt->length.byte_len - node->byte_len;
+ break;
+ }
+ }
}
/* set before our position
* walk back until we're less then the given position */
else
{
- while (fmt->current_node.char_idx > idx)
- {
- ecore_dlist_previous(fmt->nodes);
- if (!(node = ecore_dlist_current(fmt->nodes)))
- {
- DWARNING("Incorrectly walked off list.\n");
- node = ecore_dlist_first_goto(fmt->nodes);
- fmt->current_node.char_idx = 0;
- fmt->current_node.byte_idx = 0;
- break;
- }
-
- fmt->current_node.char_idx -= node->char_len;
- fmt->current_node.byte_idx -= node->byte_len;
- }
+ while (fmt->current_node.char_idx > idx)
+ {
+ ecore_dlist_previous(fmt->nodes);
+ if (!(node = ecore_dlist_current(fmt->nodes)))
+ {
+ DWARNING("Incorrectly walked off list.\n");
+ node = ecore_dlist_first_goto(fmt->nodes);
+ fmt->current_node.char_idx = 0;
+ fmt->current_node.byte_idx = 0;
+ break;
+ }
+
+ fmt->current_node.char_idx -= node->char_len;
+ fmt->current_node.byte_idx -= node->byte_len;
+ }
}
if (!(node = ecore_dlist_current(fmt->nodes)))
{
- DWARNING("Unable to place cursor at %d", idx);
+ DWARNING("Unable to place cursor at %d", idx);
- ecore_dlist_first_goto(fmt->nodes);
- fmt->current_node.char_idx = 0;
- fmt->current_node.byte_idx = 0;
+ ecore_dlist_first_goto(fmt->nodes);
+ fmt->current_node.char_idx = 0;
+ fmt->current_node.byte_idx = 0;
}
#endif
@@ -571,9 +571,9 @@ ewl_text_fmt_dump(Ewl_Text_Fmt *fmt)
while ((node = ecore_dlist_next(fmt->nodes)))
{
- printf("%d chars, %d bytes\n", node->char_len, node->byte_len);
- ewl_text_context_print(node->tx, " ");
- printf("\n\n");
+ printf("%d chars, %d bytes\n", node->char_len, node->byte_len);
+ ewl_text_context_print(node->tx, " ");
+ printf("\n\n");
}
ecore_dlist_goto(fmt->nodes, cur_node);
@@ -595,8 +595,8 @@ ewl_text_fmt_dump(Ewl_Text_Fmt *fmt)
* started */
void
ewl_text_fmt_char_to_byte(Ewl_Text_Fmt *fmt,
- unsigned int char_idx, unsigned int char_len,
- unsigned int *byte_idx, unsigned int *byte_len)
+ unsigned int char_idx, unsigned int char_len,
+ unsigned int *byte_idx, unsigned int *byte_len)
{
Ewl_Text *t;
Ewl_Text_Fmt_Node *current_node, *node = NULL;
@@ -614,76 +614,76 @@ ewl_text_fmt_char_to_byte(Ewl_Text_Fmt *fmt,
/* first step is to find the actual node that this text represents */
if (fmt->current_node.char_idx < char_idx)
{
- /* walk forward until we cover the given position */
- node = ecore_dlist_current(fmt->nodes);
- while ((node->char_len + cur_char_idx) < char_idx)
- {
- cur_char_idx += node->char_len;
- bidx += node->byte_len;
-
- ecore_dlist_next(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
- if (!node) break;
- }
- move = ecore_dlist_previous;
-
- if (!node)
- {
- node = ecore_dlist_last_goto(fmt->nodes);
- fmt->current_node.char_idx = fmt->length.char_len - node->char_len;
- fmt->current_node.byte_idx = fmt->length.byte_len - node->byte_len;
- }
+ /* walk forward until we cover the given position */
+ node = ecore_dlist_current(fmt->nodes);
+ while ((node->char_len + cur_char_idx) < char_idx)
+ {
+ cur_char_idx += node->char_len;
+ bidx += node->byte_len;
+
+ ecore_dlist_next(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
+ if (!node) break;
+ }
+ move = ecore_dlist_previous;
+
+ if (!node)
+ {
+ node = ecore_dlist_last_goto(fmt->nodes);
+ fmt->current_node.char_idx = fmt->length.char_len - node->char_len;
+ fmt->current_node.byte_idx = fmt->length.byte_len - node->byte_len;
+ }
}
else
{
- /* walk back until we're less then the given position */
- while (cur_char_idx > char_idx)
- {
- ecore_dlist_previous(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
- if (!node) break;
-
- cur_char_idx -= node->char_len;
- bidx -= node->byte_len;
- }
- move = ecore_dlist_next;
-
- if (!node)
- {
- node = ecore_dlist_first_goto(fmt->nodes);
- fmt->current_node.char_idx = 0;
- fmt->current_node.byte_idx = 0;
- }
+ /* walk back until we're less then the given position */
+ while (cur_char_idx > char_idx)
+ {
+ ecore_dlist_previous(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
+ if (!node) break;
+
+ cur_char_idx -= node->char_len;
+ bidx -= node->byte_len;
+ }
+ move = ecore_dlist_next;
+
+ if (!node)
+ {
+ node = ecore_dlist_first_goto(fmt->nodes);
+ fmt->current_node.char_idx = 0;
+ fmt->current_node.byte_idx = 0;
+ }
}
/* we still need to count within this node */
while (cur_char_idx < char_idx)
{
- unsigned int bytes;
+ unsigned int bytes;
- ewl_text_text_next_char(t->text + bidx, &bytes);
- bidx += bytes;
- cur_char_idx ++;
+ ewl_text_text_next_char(t->text + bidx, &bytes);
+ bidx += bytes;
+ cur_char_idx ++;
}
if (byte_len)
{
- if (char_len == 0) *byte_len = 0;
- else
- {
- char *txt;
-
- txt = t->text + bidx;
- cur_char_idx = 0;
- while (cur_char_idx < char_len)
- {
- unsigned int bytes;
-
- txt = ewl_text_text_next_char(txt, &bytes);
- *byte_len += bytes;
- cur_char_idx ++;
- }
- }
+ if (char_len == 0) *byte_len = 0;
+ else
+ {
+ char *txt;
+
+ txt = t->text + bidx;
+ cur_char_idx = 0;
+ while (cur_char_idx < char_len)
+ {
+ unsigned int bytes;
+
+ txt = ewl_text_text_next_char(txt, &bytes);
+ *byte_len += bytes;
+ cur_char_idx ++;
+ }
+ }
}
if (byte_idx) *byte_idx = bidx;
@@ -691,8 +691,8 @@ ewl_text_fmt_char_to_byte(Ewl_Text_Fmt *fmt,
node = ecore_dlist_current(fmt->nodes);
while (node != current_node)
{
- move(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
+ move(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -710,8 +710,8 @@ ewl_text_fmt_char_to_byte(Ewl_Text_Fmt *fmt,
*/
void
ewl_text_fmt_byte_to_char(Ewl_Text_Fmt *fmt,
- unsigned int byte_idx, unsigned int byte_len,
- unsigned int *char_idx, unsigned int *char_len)
+ unsigned int byte_idx, unsigned int byte_len,
+ unsigned int *char_idx, unsigned int *char_len)
{
Ewl_Text *t;
Ewl_Text_Fmt_Node *current_node, *node = NULL;
@@ -725,80 +725,80 @@ ewl_text_fmt_byte_to_char(Ewl_Text_Fmt *fmt,
current_node = ecore_dlist_current(fmt->nodes);
if (fmt->current_node.byte_idx < byte_idx)
{
- byte_count = fmt->current_node.byte_idx;
- cidx = fmt->current_node.char_idx;
-
- /* walk forward until we cover the given position */
- node = ecore_dlist_current(fmt->nodes);
- while ((node->byte_len + byte_count) < byte_idx)
- {
- byte_count += node->byte_len;
- cidx += node->char_len;
-
- ecore_dlist_next(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
- if (!node) break;
- }
-
- if (!node)
- {
- node = ecore_dlist_last_goto(fmt->nodes);
- fmt->current_node.char_idx = fmt->length.char_len - node->char_len;
- fmt->current_node.byte_idx = fmt->length.byte_len - node->byte_len;
- }
- move = ecore_dlist_previous;
+ byte_count = fmt->current_node.byte_idx;
+ cidx = fmt->current_node.char_idx;
+
+ /* walk forward until we cover the given position */
+ node = ecore_dlist_current(fmt->nodes);
+ while ((node->byte_len + byte_count) < byte_idx)
+ {
+ byte_count += node->byte_len;
+ cidx += node->char_len;
+
+ ecore_dlist_next(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
+ if (!node) break;
+ }
+
+ if (!node)
+ {
+ node = ecore_dlist_last_goto(fmt->nodes);
+ fmt->current_node.char_idx = fmt->length.char_len - node->char_len;
+ fmt->current_node.byte_idx = fmt->length.byte_len - node->byte_len;
+ }
+ move = ecore_dlist_previous;
}
else
{
- /* walk back until we're less then the given position */
- node = ecore_dlist_current(fmt->nodes);
- while (byte_count > byte_idx)
- {
- ecore_dlist_previous(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
- if (!node) break;
-
- byte_count -= node->byte_len;
- cidx -= node->char_len;
- }
-
- if (!node)
- {
- ecore_dlist_first_goto(fmt->nodes);
- fmt->current_node.char_idx = 0;
- fmt->current_node.byte_idx = 0;
- }
- move = ecore_dlist_next;
+ /* walk back until we're less then the given position */
+ node = ecore_dlist_current(fmt->nodes);
+ while (byte_count > byte_idx)
+ {
+ ecore_dlist_previous(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
+ if (!node) break;
+
+ byte_count -= node->byte_len;
+ cidx -= node->char_len;
+ }
+
+ if (!node)
+ {
+ ecore_dlist_first_goto(fmt->nodes);
+ fmt->current_node.char_idx = 0;
+ fmt->current_node.byte_idx = 0;
+ }
+ move = ecore_dlist_next;
}
/* we still need to count within this node */
while (byte_count < byte_idx)
{
- unsigned int bytes;
+ unsigned int bytes;
- ewl_text_text_next_char(t->text + byte_count, &bytes);
- byte_count += bytes;
- cidx ++;
+ ewl_text_text_next_char(t->text + byte_count, &bytes);
+ byte_count += bytes;
+ cidx ++;
}
if (char_len)
{
- if (byte_len == 0) *char_len = 0;
- else
- {
- char *txt;
-
- txt = t->text + byte_idx;
- byte_count = 0;
- while (byte_count < byte_len)
- {
- unsigned int bytes;
-
- txt = ewl_text_text_next_char(txt, &bytes);
- byte_count += bytes;
- (*char_len) ++;
- }
- }
+ if (byte_len == 0) *char_len = 0;
+ else
+ {
+ char *txt;
+
+ txt = t->text + byte_idx;
+ byte_count = 0;
+ while (byte_count < byte_len)
+ {
+ unsigned int bytes;
+
+ txt = ewl_text_text_next_char(txt, &bytes);
+ byte_count += bytes;
+ (*char_len) ++;
+ }
+ }
}
if (char_idx) *char_idx = cidx;
@@ -806,8 +806,8 @@ ewl_text_fmt_byte_to_char(Ewl_Text_Fmt *fmt,
node = ecore_dlist_current(fmt->nodes);
while (node != current_node)
{
- move(fmt->nodes);
- node = ecore_dlist_current(fmt->nodes);
+ move(fmt->nodes);
+ node = ecore_dlist_current(fmt->nodes);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -834,8 +834,8 @@ ewl_text_fmt_walk(Ewl_Text_Fmt *fmt,
ecore_dlist_first_goto(fmt->nodes);
while ((node = ecore_dlist_next(fmt->nodes)))
{
- cb(node, fmt->text, byte_idx);
- byte_idx += node->byte_len;
+ cb(node, fmt->text, byte_idx);
+ byte_idx += node->byte_len;
}
ecore_dlist_goto(fmt->nodes, current_node);
@@ -854,8 +854,8 @@ ewl_text_fmt_walk(Ewl_Text_Fmt *fmt,
*/
void
ewl_text_fmt_apply(Ewl_Text_Fmt *fmt, unsigned int context_mask,
- Ewl_Text_Context *change, unsigned int char_idx,
- unsigned int char_len)
+ Ewl_Text_Context *change, unsigned int char_idx,
+ unsigned int char_len)
{
Ewl_Text *t;
unsigned int cursor_idx;
@@ -865,7 +865,7 @@ ewl_text_fmt_apply(Ewl_Text_Fmt *fmt, unsigned int context_mask,
DCHECK_PARAM_PTR(change);
if ((char_len == 0) || (context_mask == EWL_TEXT_CONTEXT_MASK_NONE))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
cursor_idx = char_idx;
@@ -876,132 +876,132 @@ ewl_text_fmt_apply(Ewl_Text_Fmt *fmt, unsigned int context_mask,
node = ecore_dlist_current(fmt->nodes);
while (char_len > 0)
{
- /* we've walked off the end of the list */
- if (!node) break;
-
- /* covers entire node */
- if ((char_idx == fmt->current_node.char_idx)
- && (node->char_len <= char_len))
- {
- Ewl_Text_Context *new_tx;
-
- new_tx = ewl_text_context_find(node->tx,
- context_mask, change);
- ewl_text_context_release(node->tx);
- node->tx = new_tx;
-
- char_idx += node->char_len;
- char_len -= node->char_len;
- ecore_dlist_next(fmt->nodes);
-
- fmt->current_node.char_idx += node->char_len;
- fmt->current_node.byte_idx += node->byte_len;
- }
-
- /* start is the same, node is longer then needed */
- else if (char_idx == fmt->current_node.char_idx)
- {
- unsigned int blen = 0;
- Ewl_Text_Fmt_Node *new;
-
- ewl_text_fmt_char_to_byte(fmt,
- char_idx, char_len, NULL, &blen);
-
- new = ewl_text_fmt_node_new(
- ewl_text_context_find(node->tx,
- context_mask, change),
- char_len, blen);
-
- node->char_len -= new->char_len;
- node->byte_len -= new->byte_len;
-
- ecore_dlist_insert(fmt->nodes, new);
- ecore_dlist_next(fmt->nodes);
-
- fmt->current_node.char_idx += new->char_len;
- fmt->current_node.byte_idx += new->byte_len;
-
- char_idx += new->char_len;
- char_len -= new->char_len;
- }
-
- /* starts are different, need to set context on end of node */
- else
- {
- Ewl_Text_Fmt_Node *new;
- unsigned int blen = 0, right_skip;
-
- if (char_idx < fmt->current_node.char_idx)
- {
- DWARNING("Cursor index less than formatting node index");
- right_skip = 0;
- }
- else
- right_skip = char_idx - fmt->current_node.char_idx;
- ewl_text_fmt_char_to_byte(fmt, fmt->current_node.char_idx,
- right_skip, NULL, &blen);
-
- new = ewl_text_fmt_node_new(node->tx, right_skip, blen);
-
- ecore_dlist_insert(fmt->nodes, new);
- ecore_dlist_next(fmt->nodes);
- if (!ecore_dlist_current(fmt->nodes))
- ecore_dlist_last_goto(fmt->nodes);
-
- fmt->current_node.char_idx += new->char_len;
- fmt->current_node.byte_idx += new->byte_len;
-
- /* update node to be the new formatting piece */
- node->tx = ewl_text_context_find(node->tx,
- context_mask, change);
- node->char_len -= new->char_len;
- node->byte_len -= new->byte_len;
-
- /* the rest of the node is covered */
- if (node->char_len <= char_len)
- {
- char_len -= node->char_len;
- char_idx += node->char_len;
-
- ecore_dlist_next(fmt->nodes);
- fmt->current_node.char_idx += node->char_len;
- fmt->current_node.byte_idx += node->byte_len;
- }
-
- /* we need to split the node */
- else
- {
- Ewl_Text_Context *tx;
- unsigned int blen = 0;
-
- tx = new->tx;
- ewl_text_fmt_char_to_byte(fmt,
- char_idx, char_len,
- NULL, &blen);
-
- /* we create a new node which will be our
- * formatting and reset node to be original
- * formatting */
- new = ewl_text_fmt_node_new(node->tx,
- char_len, blen);
-
- ecore_dlist_insert(fmt->nodes, new);
- ecore_dlist_next(fmt->nodes);
- if (!ecore_dlist_current(fmt->nodes))
- ecore_dlist_last_goto(fmt->nodes);
-
- fmt->current_node.char_idx += new->char_len;
- fmt->current_node.byte_idx += new->byte_len;
-
- node->tx = tx;
- node->char_len -= new->char_len;
- node->byte_len -= new->byte_len;
-
- char_len -= new->char_len;
- char_idx += new->char_len;
- }
- }
- node = ecore_dlist_current(fmt->nodes);
+ /* we've walked off the end of the list */
+ if (!node) break;
+
+ /* covers entire node */
+ if ((char_idx == fmt->current_node.char_idx)
+ && (node->char_len <= char_len))
+ {
+ Ewl_Text_Context *new_tx;
+
+ new_tx = ewl_text_context_find(node->tx,
+ context_mask, change);
+ ewl_text_context_release(node->tx);
+ node->tx = new_tx;
+
+ char_idx += node->char_len;
+ char_len -= node->char_len;
+ ecore_dlist_next(fmt->nodes);
+
+ fmt->current_node.char_idx += node->char_len;
+ fmt->current_node.byte_idx += node->byte_len;
+ }
+
+ /* start is the same, node is longer then needed */
+ else if (char_idx == fmt->current_node.char_idx)
+ {
+ unsigned int blen = 0;
+ Ewl_Text_Fmt_Node *new;
+
+ ewl_text_fmt_char_to_byte(fmt,
+ char_idx, char_len, NULL, &blen);
+
+ new = ewl_text_fmt_node_new(
+ ewl_text_context_find(node->tx,
+ context_mask, change),
+ char_len, blen);
+
+ node->char_len -= new->char_len;
+ node->byte_len -= new->byte_len;
+
+ ecore_dlist_insert(fmt->nodes, new);
+ ecore_dlist_next(fmt->nodes);
+
+ fmt->current_node.char_idx += new->char_len;
+ fmt->current_node.byte_idx += new->byte_len;
+
+ char_idx += new->char_len;
+ char_len -= new->char_len;
+ }
+
+ /* starts are different, need to set context on end of node */
+ else
+ {
+ Ewl_Text_Fmt_Node *new;
+ unsigned int blen = 0, right_skip;
+
+ if (char_idx < fmt->current_node.char_idx)
+ {
+ DWARNING("Cursor index less than formatting node index");
+ right_skip = 0;
+ }
+ else
+ right_skip = char_idx - fmt->current_node.char_idx;
+ ewl_text_fmt_char_to_byte(fmt, fmt->current_node.char_idx,
+ right_skip, NULL, &blen);
+
+ new = ewl_text_fmt_node_new(node->tx, right_skip, blen);
+
+ ecore_dlist_insert(fmt->nodes, new);
+ ecore_dlist_next(fmt->nodes);
+ if (!ecore_dlist_current(fmt->nodes))
+ ecore_dlist_last_goto(fmt->nodes);
+
+ fmt->current_node.char_idx += new->char_len;
+ fmt->current_node.byte_idx += new->byte_len;
+
+ /* update node to be the new formatting piece */
+ node->tx = ewl_text_context_find(node->tx,
+ context_mask, change);
+ node->char_len -= new->char_len;
+ node->byte_len -= new->byte_len;
+
+ /* the rest of the node is covered */
+ if (node->char_len <= char_len)
+ {
+ char_len -= node->char_len;
+ char_idx += node->char_len;
+
+ ecore_dlist_next(fmt->nodes);
+ fmt->current_node.char_idx += node->char_len;
+ fmt->current_node.byte_idx += node->byte_len;
+ }
+
+ /* we need to split the node */
+ else
+ {
+ Ewl_Text_Context *tx;
+ unsigned int blen = 0;
+
+ tx = new->tx;
+ ewl_text_fmt_char_to_byte(fmt,
+ char_idx, char_len,
+ NULL, &blen);
+
+ /* we create a new node which will be our
+ * formatting and reset node to be original
+ * formatting */
+ new = ewl_text_fmt_node_new(node->tx,
+ char_len, blen);
+
+ ecore_dlist_insert(fmt->nodes, new);
+ ecore_dlist_next(fmt->nodes);
+ if (!ecore_dlist_current(fmt->nodes))
+ ecore_dlist_last_goto(fmt->nodes);
+
+ fmt->current_node.char_idx += new->char_len;
+ fmt->current_node.byte_idx += new->byte_len;
+
+ node->tx = tx;
+ node->char_len -= new->char_len;
+ node->byte_len -= new->byte_len;
+
+ char_len -= new->char_len;
+ char_idx += new->char_len;
+ }
+ }
+ node = ecore_dlist_current(fmt->nodes);
}
/* Reset to the original cursor index */
@@ -1024,7 +1024,7 @@ ewl_text_fmt_apply(Ewl_Text_Fmt *fmt, unsigned int context_mask,
*/
Ewl_Text_Fmt_Node *
ewl_text_fmt_node_new(Ewl_Text_Context *tx, unsigned int char_len,
- unsigned int byte_len)
+ unsigned int byte_len)
{
Ewl_Text_Fmt_Node *node;
diff --git a/src/lib/ewl_text_fmt.h b/src/lib/ewl_text_fmt.h
index 6a05edc..df54840 100644
--- a/src/lib/ewl_text_fmt.h
+++ b/src/lib/ewl_text_fmt.h
@@ -24,9 +24,9 @@ typedef struct Ewl_Text_Fmt_Node Ewl_Text_Fmt_Node;
*/
struct Ewl_Text_Fmt_Node
{
- Ewl_Text_Context *tx; /**< Nodes formatting context */
- unsigned int char_len; /**< Node character length */
- unsigned int byte_len; /**< Node byte length */
+ Ewl_Text_Context *tx; /**< Nodes formatting context */
+ unsigned int char_len; /**< Node character length */
+ unsigned int byte_len; /**< Node byte length */
};
/**
@@ -39,42 +39,42 @@ typedef struct Ewl_Text_Fmt Ewl_Text_Fmt;
*/
struct Ewl_Text_Fmt
{
- Ecore_DList *nodes; /**< List of formatting nodes */
- void *text; /**< Parent Ewl_Text pointer */
+ Ecore_DList *nodes; /**< List of formatting nodes */
+ void *text; /**< Parent Ewl_Text pointer */
struct
{
- unsigned int char_idx; /**< Character index of the current node pointer */
- unsigned int byte_idx; /**< Byte index of the current node pointer */
- } current_node; /**< Current node information */
+ unsigned int char_idx; /**< Character index of the current node pointer */
+ unsigned int byte_idx; /**< Byte index of the current node pointer */
+ } current_node; /**< Current node information */
struct
{
- unsigned int char_len; /**< Text character length */
- unsigned int byte_len; /**< Text byte length */
- } length; /**< Length information for this formatting list */
+ unsigned int char_len; /**< Text character length */
+ unsigned int byte_len; /**< Text byte length */
+ } length; /**< Length information for this formatting list */
};
Ewl_Text_Fmt *ewl_text_fmt_new(Ewl_Text *t);
-void ewl_text_fmt_destroy(Ewl_Text_Fmt *fmt);
-void ewl_text_fmt_clear(Ewl_Text_Fmt *fmt);
-
-void ewl_text_fmt_node_prepend(Ewl_Text_Fmt *fmt,
- Ewl_Text_Context *tx,
- unsigned int char_len,
- unsigned int byte_len);
-void ewl_text_fmt_node_append(Ewl_Text_Fmt *fmt,
- Ewl_Text_Context *tx,
- unsigned int char_len,
- unsigned int byte_len);
-void ewl_text_fmt_node_insert(Ewl_Text_Fmt *fmt,
- unsigned int char_idx,
- Ewl_Text_Context *tx,
- unsigned int char_len,
- unsigned int byte_len);
-void ewl_text_fmt_node_delete(Ewl_Text_Fmt *fmt,
- unsigned int idx,
- unsigned int char_len);
+void ewl_text_fmt_destroy(Ewl_Text_Fmt *fmt);
+void ewl_text_fmt_clear(Ewl_Text_Fmt *fmt);
+
+void ewl_text_fmt_node_prepend(Ewl_Text_Fmt *fmt,
+ Ewl_Text_Context *tx,
+ unsigned int char_len,
+ unsigned int byte_len);
+void ewl_text_fmt_node_append(Ewl_Text_Fmt *fmt,
+ Ewl_Text_Context *tx,
+ unsigned int char_len,
+ unsigned int byte_len);
+void ewl_text_fmt_node_insert(Ewl_Text_Fmt *fmt,
+ unsigned int char_idx,
+ Ewl_Text_Context *tx,
+ unsigned int char_len,
+ unsigned int byte_len);
+void ewl_text_fmt_node_delete(Ewl_Text_Fmt *fmt,
+ unsigned int idx,
+ unsigned int char_len);
unsigned int ewl_text_fmt_node_count_get(Ewl_Text_Fmt *fmt);
Ewl_Text_Fmt_Node *ewl_text_fmt_get(Ewl_Text_Fmt *fmt, unsigned int char_idx);
@@ -82,29 +82,29 @@ Ewl_Text_Fmt_Node *ewl_text_fmt_get_last(Ewl_Text_Fmt *fmt);
Ewl_Text_Fmt_Node *ewl_text_fmt_get_first(Ewl_Text_Fmt *fmt);
Ewl_Text_Fmt_Node *ewl_text_fmt_get_current(Ewl_Text_Fmt *fmt);
-void ewl_text_fmt_goto(Ewl_Text_Fmt *fmt, unsigned int idx);
+void ewl_text_fmt_goto(Ewl_Text_Fmt *fmt, unsigned int idx);
-void ewl_text_fmt_apply(Ewl_Text_Fmt *fmt, unsigned int context_mask,
- Ewl_Text_Context *change,
- unsigned int char_idx,
- unsigned int char_len);
+void ewl_text_fmt_apply(Ewl_Text_Fmt *fmt, unsigned int context_mask,
+ Ewl_Text_Context *change,
+ unsigned int char_idx,
+ unsigned int char_len);
-void ewl_text_fmt_char_to_byte(Ewl_Text_Fmt *fmt,
- unsigned int char_idx, unsigned int char_len,
- unsigned int *byte_idx, unsigned int *byte_len);
-void ewl_text_fmt_byte_to_char(Ewl_Text_Fmt *fmt,
- unsigned int byte_idx, unsigned int byte_len,
- unsigned int *char_idx, unsigned int *char_len);
+void ewl_text_fmt_char_to_byte(Ewl_Text_Fmt *fmt,
+ unsigned int char_idx, unsigned int char_len,
+ unsigned int *byte_idx, unsigned int *byte_len);
+void ewl_text_fmt_byte_to_char(Ewl_Text_Fmt *fmt,
+ unsigned int byte_idx, unsigned int byte_len,
+ unsigned int *char_idx, unsigned int *char_len);
-void ewl_text_fmt_walk(Ewl_Text_Fmt *fmt,
- void (*cb)(Ewl_Text_Fmt_Node *, Ewl_Text *,
- unsigned int byte_idx));
+void ewl_text_fmt_walk(Ewl_Text_Fmt *fmt,
+ void (*cb)(Ewl_Text_Fmt_Node *, Ewl_Text *,
+ unsigned int byte_idx));
-void ewl_text_fmt_dump(Ewl_Text_Fmt *fmt);
+void ewl_text_fmt_dump(Ewl_Text_Fmt *fmt);
Ewl_Text_Fmt_Node *ewl_text_fmt_node_new(Ewl_Text_Context *tx,
- unsigned int char_len,
+ unsigned int char_len,
unsigned int byte_len);
/**
* @}
diff --git a/src/lib/ewl_text_trigger.c b/src/lib/ewl_text_trigger.c
index d6cff74..bc1e3e5 100644
--- a/src/lib/ewl_text_trigger.c
+++ b/src/lib/ewl_text_trigger.c
@@ -35,8 +35,8 @@ typedef struct Ewl_Text_Trigger_Area Ewl_Text_Trigger_Area;
*/
struct Ewl_Text_Trigger_Area
{
- Ewl_Widget widget; /**< Inherits from Ewl_Widget */
- Ewl_Text_Trigger *trigger; /**< The parent trigger */
+ Ewl_Widget widget; /**< Inherits from Ewl_Widget */
+ Ewl_Text_Trigger *trigger; /**< The parent trigger */
};
static Ewl_Widget *ewl_text_trigger_area_new();
@@ -44,15 +44,15 @@ static int ewl_text_trigger_area_init(Ewl_Text_Trigger_Area *area);
static Ewl_Widget *ewl_text_trigger_area_cached_get(Ewl_Text *t);
static void ewl_text_trigger_area_cache(Ewl_Text *t, Ewl_Text_Trigger_Area *a);
static void ewl_text_trigger_area_type_set(Ewl_Text_Trigger_Area *area,
- Ewl_Text_Trigger_Type type);
+ Ewl_Text_Trigger_Type type);
static void ewl_text_trigger_area_cb_mouse_in(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_text_trigger_area_cb_mouse_out(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_text_trigger_area_cb_mouse_up(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_text_trigger_area_cb_mouse_down(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
/**
* @param type: The type of trigger to create
@@ -68,12 +68,12 @@ ewl_text_trigger_new(Ewl_Text_Trigger_Type type)
trigger = NEW(Ewl_Text_Trigger, 1);
if (!trigger)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_text_trigger_init(trigger, type))
{
- ewl_widget_destroy(EWL_WIDGET(trigger));
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(EWL_WIDGET(trigger));
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(trigger, DLEVEL_STABLE);
@@ -94,28 +94,28 @@ ewl_text_trigger_init(Ewl_Text_Trigger *trigger, Ewl_Text_Trigger_Type type)
DCHECK_PARAM_PTR_RET(trigger, FALSE);
if (type == EWL_TEXT_TRIGGER_TYPE_TRIGGER)
- type_str = EWL_TEXT_TRIGGER_TYPE;
+ type_str = EWL_TEXT_TRIGGER_TYPE;
else if (type == EWL_TEXT_TRIGGER_TYPE_SELECTION)
- type_str = EWL_TEXT_SELECTION_TYPE;
+ type_str = EWL_TEXT_SELECTION_TYPE;
else
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
if (!ewl_widget_init(EWL_WIDGET(trigger)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(trigger), type_str);
ewl_widget_inherit(EWL_WIDGET(trigger), EWL_TEXT_TRIGGER_TYPE);
ewl_callback_prepend(EWL_WIDGET(trigger), EWL_CALLBACK_DESTROY,
- ewl_text_trigger_cb_destroy, NULL);
+ ewl_text_trigger_cb_destroy, NULL);
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_CONFIGURE,
- ewl_text_trigger_cb_configure, NULL);
+ ewl_text_trigger_cb_configure, NULL);
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_SHOW,
- ewl_text_trigger_cb_show, NULL);
+ ewl_text_trigger_cb_show, NULL);
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_HIDE,
- ewl_text_trigger_cb_hide, NULL);
+ ewl_text_trigger_cb_hide, NULL);
ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_UNREALIZE,
- ewl_text_trigger_cb_unrealize, NULL);
+ ewl_text_trigger_cb_unrealize, NULL);
trigger->areas = ecore_list_new();
trigger->type = type;
@@ -136,7 +136,7 @@ ewl_text_trigger_init(Ewl_Text_Trigger *trigger, Ewl_Text_Trigger_Type type)
*/
void
ewl_text_trigger_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Text_Trigger *t;
@@ -218,7 +218,7 @@ ewl_text_trigger_length_set(Ewl_Text_Trigger *t, unsigned int char_len)
/* if the length is set to 0 remove the areas */
if (char_len == 0)
- ewl_text_trigger_areas_cleanup(t);
+ ewl_text_trigger_areas_cleanup(t);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -283,7 +283,7 @@ ewl_text_trigger_base_get(Ewl_Text_Trigger *t)
*/
void
ewl_text_trigger_area_add(Ewl_Text *t, Ewl_Text_Trigger *cur,
- int x, int y, int w, int h)
+ int x, int y, int w, int h)
{
Ewl_Widget *area;
@@ -321,10 +321,10 @@ ewl_text_trigger_areas_cleanup(Ewl_Text_Trigger *trig)
/* cleanup any old areas */
if (trig->areas)
{
- Ewl_Text_Trigger_Area *area;
+ Ewl_Text_Trigger_Area *area;
- while ((area = ecore_list_first_remove(trig->areas)))
- ewl_text_trigger_area_cache(trig->text_parent, area);
+ while ((area = ecore_list_first_remove(trig->areas)))
+ ewl_text_trigger_area_cache(trig->text_parent, area);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -339,7 +339,7 @@ ewl_text_trigger_areas_cleanup(Ewl_Text_Trigger *trig)
*/
void
ewl_text_trigger_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text_Trigger *trig;
Ewl_Text_Trigger_Area *area;
@@ -354,7 +354,7 @@ ewl_text_trigger_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
ecore_list_first_goto(trig->areas);
while ((area = ecore_list_next(trig->areas)))
- ewl_widget_configure(EWL_WIDGET(area));
+ ewl_widget_configure(EWL_WIDGET(area));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -368,7 +368,7 @@ ewl_text_trigger_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_text_trigger_cb_hide(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *area;
Ewl_Text_Trigger *trig;
@@ -382,7 +382,7 @@ ewl_text_trigger_cb_hide(Ewl_Widget *w, void *ev __UNUSED__,
ecore_list_first_goto(trig->areas);
while ((area = ecore_list_next(trig->areas)))
- ewl_widget_hide(area);
+ ewl_widget_hide(area);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -396,7 +396,7 @@ ewl_text_trigger_cb_hide(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_text_trigger_cb_show(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *area;
Ewl_Text_Trigger *trig;
@@ -410,7 +410,7 @@ ewl_text_trigger_cb_show(Ewl_Widget *w, void *ev __UNUSED__,
ecore_list_first_goto(trig->areas);
while ((area = ecore_list_next(trig->areas)))
- ewl_widget_show(area);
+ ewl_widget_show(area);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -424,7 +424,7 @@ ewl_text_trigger_cb_show(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_text_trigger_cb_unrealize(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -454,12 +454,12 @@ ewl_text_trigger_area_new(void)
area = NEW(Ewl_Text_Trigger_Area, 1);
if (!area)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_text_trigger_area_init(area))
{
- ewl_widget_destroy(EWL_WIDGET(area));
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(EWL_WIDGET(area));
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(area, DLEVEL_STABLE);
@@ -482,20 +482,20 @@ ewl_text_trigger_area_init(Ewl_Text_Trigger_Area *area)
w = EWL_WIDGET(area);
if (!ewl_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_TEXT_TRIGGER_AREA_TYPE);
ewl_widget_focusable_set(w, FALSE);
ewl_widget_internal_set(w, TRUE);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_IN,
- ewl_text_trigger_area_cb_mouse_in, NULL);
+ ewl_text_trigger_area_cb_mouse_in, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_OUT,
- ewl_text_trigger_area_cb_mouse_out, NULL);
+ ewl_text_trigger_area_cb_mouse_out, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_text_trigger_area_cb_mouse_down, NULL);
+ ewl_text_trigger_area_cb_mouse_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP,
- ewl_text_trigger_area_cb_mouse_up, NULL);
+ ewl_text_trigger_area_cb_mouse_up, NULL);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -509,20 +509,20 @@ ewl_text_trigger_area_init(Ewl_Text_Trigger_Area *area)
*/
static void
ewl_text_trigger_area_type_set(Ewl_Text_Trigger_Area *area,
- Ewl_Text_Trigger_Type type)
+ Ewl_Text_Trigger_Type type)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(area);
DCHECK_TYPE(area, EWL_TEXT_TRIGGER_AREA_TYPE);
ewl_widget_appearance_set(EWL_WIDGET(area),
- ((type == EWL_TEXT_TRIGGER_TYPE_SELECTION) ?
- "selection_area" : "trigger_area"));
+ ((type == EWL_TEXT_TRIGGER_TYPE_SELECTION) ?
+ "selection_area" : "trigger_area"));
if (type == EWL_TEXT_TRIGGER_TYPE_TRIGGER)
- ewl_widget_color_set(EWL_WIDGET(area), 0, 0, 0, 0);
+ ewl_widget_color_set(EWL_WIDGET(area), 0, 0, 0, 0);
else
- ewl_widget_color_set(EWL_WIDGET(area), 255, 255, 255, 255);
+ ewl_widget_color_set(EWL_WIDGET(area), 255, 255, 255, 255);
DRETURN(DLEVEL_STABLE);
}
@@ -542,10 +542,10 @@ ewl_text_trigger_area_cached_get(Ewl_Text *t)
DCHECK_TYPE_RET(t, EWL_TEXT_TYPE, NULL);
if (t->areas_cache && !ecore_list_empty_is(t->areas_cache))
- area = ecore_list_first_remove(t->areas_cache);
+ area = ecore_list_first_remove(t->areas_cache);
else {
- area = ewl_text_trigger_area_new();
- ewl_container_child_append(EWL_CONTAINER(t), area);
+ area = ewl_text_trigger_area_new();
+ ewl_container_child_append(EWL_CONTAINER(t), area);
}
DRETURN_PTR(area, DLEVEL_STABLE);
@@ -564,10 +564,10 @@ ewl_text_trigger_area_cache(Ewl_Text *t, Ewl_Text_Trigger_Area *area)
ewl_widget_hide(EWL_WIDGET(area));
if (DESTROYED(t) || DESTROYED(area))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (!t->areas_cache)
- t->areas_cache = ecore_list_new();
+ t->areas_cache = ecore_list_new();
ecore_list_append(t->areas_cache, area);
@@ -584,7 +584,7 @@ ewl_text_trigger_area_cache(Ewl_Text *t, Ewl_Text_Trigger_Area *area)
*/
void
ewl_text_trigger_area_cb_mouse_in(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text_Trigger_Area *a;
@@ -594,8 +594,8 @@ ewl_text_trigger_area_cb_mouse_in(Ewl_Widget *w, void *ev,
a = EWL_TEXT_TRIGGER_AREA(w);
if (a->trigger)
- ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
- EWL_CALLBACK_MOUSE_IN, ev);
+ ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
+ EWL_CALLBACK_MOUSE_IN, ev);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -610,7 +610,7 @@ ewl_text_trigger_area_cb_mouse_in(Ewl_Widget *w, void *ev,
*/
void
ewl_text_trigger_area_cb_mouse_out(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text_Trigger_Area *a;
@@ -620,8 +620,8 @@ ewl_text_trigger_area_cb_mouse_out(Ewl_Widget *w, void *ev,
a = EWL_TEXT_TRIGGER_AREA(w);
if (a->trigger)
- ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
- EWL_CALLBACK_MOUSE_OUT, ev);
+ ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
+ EWL_CALLBACK_MOUSE_OUT, ev);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -636,7 +636,7 @@ ewl_text_trigger_area_cb_mouse_out(Ewl_Widget *w, void *ev,
*/
void
ewl_text_trigger_area_cb_mouse_up(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text_Trigger_Area *a;
@@ -646,8 +646,8 @@ ewl_text_trigger_area_cb_mouse_up(Ewl_Widget *w, void *ev,
a = EWL_TEXT_TRIGGER_AREA(w);
if (a->trigger)
- ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
- EWL_CALLBACK_MOUSE_UP, ev);
+ ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
+ EWL_CALLBACK_MOUSE_UP, ev);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -662,7 +662,7 @@ ewl_text_trigger_area_cb_mouse_up(Ewl_Widget *w, void *ev,
*/
void
ewl_text_trigger_area_cb_mouse_down(Ewl_Widget *w, void *ev,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Text_Trigger_Area *a;
@@ -672,8 +672,8 @@ ewl_text_trigger_area_cb_mouse_down(Ewl_Widget *w, void *ev,
a = EWL_TEXT_TRIGGER_AREA(w);
if (a->trigger)
- ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
- EWL_CALLBACK_MOUSE_DOWN, ev);
+ ewl_callback_call_with_event_data(EWL_WIDGET(a->trigger),
+ EWL_CALLBACK_MOUSE_DOWN, ev);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_text_trigger.h b/src/lib/ewl_text_trigger.h
index 5cad130..b7b3348 100644
--- a/src/lib/ewl_text_trigger.h
+++ b/src/lib/ewl_text_trigger.h
@@ -38,15 +38,15 @@ typedef struct Ewl_Text_Trigger Ewl_Text_Trigger;
*/
struct Ewl_Text_Trigger
{
- Ewl_Widget widget; /**< Inherit from widget */
- Ewl_Text_Trigger_Type type; /**< Trigger type */
+ Ewl_Widget widget; /**< Inherit from widget */
+ Ewl_Text_Trigger_Type type; /**< Trigger type */
- unsigned int char_pos; /**< Trigger start position */
- unsigned int char_len; /**< Trigger length */
- unsigned int char_base; /**< Used for the selection. Start position */
+ unsigned int char_pos; /**< Trigger start position */
+ unsigned int char_len; /**< Trigger length */
+ unsigned int char_base; /**< Used for the selection. Start position */
- Ewl_Text *text_parent; /**< The parent text area */
- Ecore_List *areas; /**< The list of objects for the trigger */
+ Ewl_Text *text_parent; /**< The parent text area */
+ Ecore_List *areas; /**< The list of objects for the trigger */
};
/**
@@ -56,26 +56,26 @@ struct Ewl_Text_Trigger
#define EWL_TEXT_TRIGGER(trigger) ((Ewl_Text_Trigger *) trigger)
Ewl_Widget *ewl_text_trigger_new(Ewl_Text_Trigger_Type type);
-int ewl_text_trigger_init(Ewl_Text_Trigger *trigger,
- Ewl_Text_Trigger_Type type);
+int ewl_text_trigger_init(Ewl_Text_Trigger *trigger,
+ Ewl_Text_Trigger_Type type);
Ewl_Text_Trigger_Type ewl_text_trigger_type_get(Ewl_Text_Trigger *t);
-void ewl_text_trigger_start_pos_set(Ewl_Text_Trigger *t,
- unsigned int char_pos);
+void ewl_text_trigger_start_pos_set(Ewl_Text_Trigger *t,
+ unsigned int char_pos);
unsigned int ewl_text_trigger_start_pos_get(Ewl_Text_Trigger *t);
-void ewl_text_trigger_base_set(Ewl_Text_Trigger *t,
- unsigned int char_pos);
+void ewl_text_trigger_base_set(Ewl_Text_Trigger *t,
+ unsigned int char_pos);
unsigned int ewl_text_trigger_base_get(Ewl_Text_Trigger *t);
-void ewl_text_trigger_length_set(Ewl_Text_Trigger *t,
- unsigned int char_len);
+void ewl_text_trigger_length_set(Ewl_Text_Trigger *t,
+ unsigned int char_len);
unsigned int ewl_text_trigger_length_get(Ewl_Text_Trigger *t);
-void ewl_text_trigger_area_add(Ewl_Text *t, Ewl_Text_Trigger *cur,
- int x, int y, int w, int h);
-void ewl_text_trigger_areas_cleanup(Ewl_Text_Trigger *trig);
+void ewl_text_trigger_area_add(Ewl_Text *t, Ewl_Text_Trigger *cur,
+ int x, int y, int w, int h);
+void ewl_text_trigger_areas_cleanup(Ewl_Text_Trigger *trig);
/*
* Internal stuff
diff --git a/src/lib/ewl_theme.c b/src/lib/ewl_theme.c
index d6dbdff..778f17d 100644
--- a/src/lib/ewl_theme.c
+++ b/src/lib/ewl_theme.c
@@ -37,12 +37,12 @@ ewl_theme_init(void)
theme = ewl_config_string_get(ewl_config, EWL_CONFIG_THEME_NAME);
if (!ewl_theme_theme_set(theme))
{
- if ((!strcmp(theme, DEFAULT_THEME)) ||
- (!ewl_theme_theme_set(DEFAULT_THEME)))
- {
- DWARNING("No usable theme found, exiting.");
- DRETURN_INT(FALSE, DLEVEL_STABLE);
- }
+ if ((!strcmp(theme, DEFAULT_THEME)) ||
+ (!ewl_theme_theme_set(DEFAULT_THEME)))
+ {
+ DWARNING("No usable theme found, exiting.");
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
+ }
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -86,14 +86,14 @@ ewl_theme_theme_set(const char *theme_name)
ewl_theme_def_data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
if (!ewl_theme_def_data)
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ecore_hash_free_key_cb_set(ewl_theme_def_data, ewl_theme_data_free);
ecore_hash_free_value_cb_set(ewl_theme_def_data, ewl_theme_data_free);
/* clean up the font path list */
if (ewl_theme_font_paths)
- ecore_list_clear(ewl_theme_font_paths);
+ ecore_list_clear(ewl_theme_font_paths);
/* get the new theme path and setup the font path */
IF_FREE(ewl_theme_path);
@@ -108,13 +108,13 @@ ewl_theme_theme_set(const char *theme_name)
ecore_list_first_goto(ewl_embed_list);
while ((w = ecore_list_next(ewl_embed_list)))
{
- int vis;
+ int vis;
- vis = REALIZED(w);
+ vis = REALIZED(w);
- ewl_widget_hide(w);
- ewl_widget_unrealize(w);
- if (vis) ewl_widget_realize(w);
+ ewl_widget_hide(w);
+ ewl_widget_unrealize(w);
+ if (vis) ewl_widget_realize(w);
}
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -160,7 +160,7 @@ ewl_theme_widget_shutdown(Ewl_Widget *w)
* We destroy ewl_theme_def_data from else where..
*/
if (w->theme && w->theme != ewl_theme_def_data)
- IF_FREE_HASH(w->theme);
+ IF_FREE_HASH(w->theme);
w->theme = NULL;
@@ -233,12 +233,12 @@ ewl_theme_image_get(Ewl_Widget *w, char *k)
data = ewl_theme_data_str_get(w, k);
if (!data)
{
- if (!ewl_theme_path)
- {
- DRETURN_PTR(NULL, DLEVEL_STABLE);
- }
- else
- data = ewl_theme_path;
+ if (!ewl_theme_path)
+ {
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
+ }
+ else
+ data = ewl_theme_path;
}
/*
@@ -249,13 +249,13 @@ ewl_theme_image_get(Ewl_Widget *w, char *k)
#else
if (*(data + 1) != ':') {
#endif /* _WIN32 */
- char path[PATH_MAX];
+ char path[PATH_MAX];
- snprintf(path, PATH_MAX, "%s/%s", ewl_theme_path, data);
- data = strdup(path);
+ snprintf(path, PATH_MAX, "%s/%s", ewl_theme_path, data);
+ data = strdup(path);
}
else
- data = strdup(data);
+ data = strdup(data);
DRETURN_PTR(data, DLEVEL_STABLE);
}
@@ -287,25 +287,25 @@ ewl_theme_lookup_key(Ecore_Hash *cache, const char *path, const char *k)
ret = ecore_hash_get(cache, k);
if (!ret) {
- char *tmp = NULL;
-
- /*
- * Resort to looking in the edje.
- */
- if (path)
- tmp = edje_file_data_get(path, k);
-
- /*
- * Get a string instance for the value so we can treat the
- * return type consistently and not leak memory.
- */
- if (tmp) {
- ret = ecore_string_instance(tmp);
- FREE(tmp);
- }
+ char *tmp = NULL;
+
+ /*
+ * Resort to looking in the edje.
+ */
+ if (path)
+ tmp = edje_file_data_get(path, k);
+
+ /*
+ * Get a string instance for the value so we can treat the
+ * return type consistently and not leak memory.
+ */
+ if (tmp) {
+ ret = ecore_string_instance(tmp);
+ FREE(tmp);
+ }
}
else
- ret = ecore_string_instance(ret);
+ ret = ecore_string_instance(ret);
DRETURN_PTR(ret, DLEVEL_STABLE);
}
@@ -348,35 +348,35 @@ ewl_theme_data_str_get(Ewl_Widget *w, char *k)
* Use the widget's appearance string to build a relative theme key.
*/
if (w) {
- int len;
- char *tmp;
-
- len = ewl_widget_appearance_path_size_get(w);
- tmp = alloca(len);
- if (tmp) {
- int used;
-
- used = ewl_widget_appearance_path_copy(w, tmp, len);
- if (used == (len - 1)) {
- used = ecore_strlcpy(key, tmp, PATH_MAX);
- if (used < PATH_MAX) {
- *(key + used) = '/';
- used++;
- }
-
- ecore_strlcpy(key + used, k, PATH_MAX - used);
- }
- }
- else {
- len += strlen(k) + 1;
- ecore_strlcpy(key, k, len);
- }
+ int len;
+ char *tmp;
+
+ len = ewl_widget_appearance_path_size_get(w);
+ tmp = alloca(len);
+ if (tmp) {
+ int used;
+
+ used = ewl_widget_appearance_path_copy(w, tmp, len);
+ if (used == (len - 1)) {
+ used = ecore_strlcpy(key, tmp, PATH_MAX);
+ if (used < PATH_MAX) {
+ *(key + used) = '/';
+ used++;
+ }
+
+ ecore_strlcpy(key + used, k, PATH_MAX - used);
+ }
+ }
+ else {
+ len += strlen(k) + 1;
+ ecore_strlcpy(key, k, len);
+ }
} else
- snprintf(key, PATH_MAX, "%s", k);
+ snprintf(key, PATH_MAX, "%s", k);
if (ewl_config_cache.print_keys)
- printf("%s\n", key);
+ printf("%s\n", key);
/*
* Loop up the widget heirarchy looking for this key.
@@ -384,49 +384,49 @@ ewl_theme_data_str_get(Ewl_Widget *w, char *k)
temp = key;
while (w && temp && !ret) {
- /*
- * Find a widget with theme data.
- */
- while (w && !w->theme)
- w = w->parent;
-
- if (w && w->theme)
- ret = ewl_theme_lookup_key(w->theme, w->theme_path, temp);
-
- if (ret) {
- cache = w->theme;
- break;
- }
-
- temp++;
- temp = strchr(temp, '/');
- if (!temp && w && w->parent) {
- temp = key;
- w = w->parent;
- }
+ /*
+ * Find a widget with theme data.
+ */
+ while (w && !w->theme)
+ w = w->parent;
+
+ if (w && w->theme)
+ ret = ewl_theme_lookup_key(w->theme, w->theme_path, temp);
+
+ if (ret) {
+ cache = w->theme;
+ break;
+ }
+
+ temp++;
+ temp = strchr(temp, '/');
+ if (!temp && w && w->parent) {
+ temp = key;
+ w = w->parent;
+ }
}
/*
* No key found in widgets, look in the default theme and edje.
*/
if (!ret) {
- temp = key;
- while (temp && !ret) {
- ret = ewl_theme_lookup_key(ewl_theme_def_data,
- ewl_theme_path, temp);
- if (ret) {
- cache = ewl_theme_def_data;
- break;
- }
-
- temp++;
- temp = strchr(temp, '/');
- }
+ temp = key;
+ while (temp && !ret) {
+ ret = ewl_theme_lookup_key(ewl_theme_def_data,
+ ewl_theme_path, temp);
+ if (ret) {
+ cache = ewl_theme_def_data;
+ break;
+ }
+
+ temp++;
+ temp = strchr(temp, '/');
+ }
}
if (!cache)
- cache = ewl_theme_def_data;
+ cache = ewl_theme_def_data;
/*
* Mark all keys matched and unmatched in the cache.
@@ -437,7 +437,7 @@ ewl_theme_data_str_get(Ewl_Widget *w, char *k)
* Fixup unmatched keys in the cache.
*/
if (ret == EWL_THEME_KEY_NOMATCH)
- ret = NULL;
+ ret = NULL;
DRETURN_PTR(ret, DLEVEL_STABLE);
}
@@ -481,22 +481,22 @@ ewl_theme_data_str_set(Ewl_Widget *w, char *k, char *v)
DCHECK_PARAM_PTR(k);
if (!w->theme || w->theme == ewl_theme_def_data) {
- w->theme = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+ w->theme = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(w->theme, ewl_theme_data_free);
- ecore_hash_free_value_cb_set(w->theme, ewl_theme_data_free);
+ ecore_hash_free_key_cb_set(w->theme, ewl_theme_data_free);
+ ecore_hash_free_value_cb_set(w->theme, ewl_theme_data_free);
}
if (v && v != EWL_THEME_KEY_NOMATCH)
- ecore_hash_set(w->theme, (void *)ecore_string_instance(k),
- (void *)ecore_string_instance(v));
+ ecore_hash_set(w->theme, (void *)ecore_string_instance(k),
+ (void *)ecore_string_instance(v));
else
- ecore_hash_set(w->theme, (void *)ecore_string_instance(k),
- EWL_THEME_KEY_NOMATCH);
+ ecore_hash_set(w->theme, (void *)ecore_string_instance(k),
+ EWL_THEME_KEY_NOMATCH);
if (REALIZED(w)) {
- ewl_widget_unrealize(w);
- ewl_widget_realize(w);
+ ewl_widget_unrealize(w);
+ ewl_widget_realize(w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -548,9 +548,9 @@ ewl_theme_path_find(const char *name)
*/
home = getenv("HOME");
if (!home) {
- DERROR("Environment variable HOME not defined\n"
- "Try export HOME=/home/user in a bash like environemnt or\n"
- "setenv HOME=/home/user in a csh like environment.\n");
+ DERROR("Environment variable HOME not defined\n"
+ "Try export HOME=/home/user in a bash like environemnt or\n"
+ "setenv HOME=/home/user in a csh like environment.\n");
}
/*
@@ -558,40 +558,40 @@ ewl_theme_path_find(const char *name)
* available.
*/
if (home) {
- snprintf(theme_tmp_path, PATH_MAX, "%s/.ewl/themes/%s.edj",
- home, name);
- if (((stat(theme_tmp_path, &st)) == 0) && S_ISREG(st.st_mode))
- theme_found_path = strdup(theme_tmp_path);
+ snprintf(theme_tmp_path, PATH_MAX, "%s/.ewl/themes/%s.edj",
+ home, name);
+ if (((stat(theme_tmp_path, &st)) == 0) && S_ISREG(st.st_mode))
+ theme_found_path = strdup(theme_tmp_path);
}
/*
* No user theme, so we try the system-wide theme.
*/
if (!theme_found_path) {
- snprintf(theme_tmp_path, PATH_MAX, PACKAGE_DATA_DIR
- "/ewl/themes/%s.edj", name);
- if (((stat(theme_tmp_path, &st)) == 0) && S_ISREG(st.st_mode))
- theme_found_path = strdup(theme_tmp_path);
+ snprintf(theme_tmp_path, PATH_MAX, PACKAGE_DATA_DIR
+ "/ewl/themes/%s.edj", name);
+ if (((stat(theme_tmp_path, &st)) == 0) && S_ISREG(st.st_mode))
+ theme_found_path = strdup(theme_tmp_path);
}
/*
* see if they gave a full path to the theme
*/
if (!theme_found_path) {
- if (name[0] != '/') {
- char *cwd;
+ if (name[0] != '/') {
+ char *cwd;
- cwd = getenv("PWD");
- if (cwd != NULL)
- snprintf(theme_tmp_path, PATH_MAX, "%s/%s", cwd, name);
- else
- snprintf(theme_tmp_path, PATH_MAX, "%s", name);
+ cwd = getenv("PWD");
+ if (cwd != NULL)
+ snprintf(theme_tmp_path, PATH_MAX, "%s/%s", cwd, name);
+ else
+ snprintf(theme_tmp_path, PATH_MAX, "%s", name);
- } else
- snprintf(theme_tmp_path, PATH_MAX, "%s", name);
+ } else
+ snprintf(theme_tmp_path, PATH_MAX, "%s", name);
- if (((stat(theme_tmp_path, &st)) == 0) && S_ISREG(st.st_mode))
- theme_found_path = strdup(theme_tmp_path);
+ if (((stat(theme_tmp_path, &st)) == 0) && S_ISREG(st.st_mode))
+ theme_found_path = strdup(theme_tmp_path);
}
DRETURN_PTR(theme_found_path, DLEVEL_STABLE);
@@ -614,29 +614,29 @@ ewl_theme_font_path_init(void)
*/
ewl_theme_font_paths = ecore_list_new();
if (!ewl_theme_font_paths)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ecore_list_free_cb_set(ewl_theme_font_paths, free);
font_path = ewl_theme_data_str_get(NULL, "/theme/font_path");
if (!font_path)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (*font_path == '/')
- ecore_list_append(ewl_theme_font_paths, strdup(font_path));
+ ecore_list_append(ewl_theme_font_paths, strdup(font_path));
else {
- int len;
- char *tmp;
+ int len;
+ char *tmp;
- len = strlen(ewl_theme_path);
- tmp = ewl_theme_path + len - 4;
+ len = strlen(ewl_theme_path);
+ tmp = ewl_theme_path + len - 4;
- if (strcmp(tmp, ".edj"))
- snprintf(key, PATH_MAX, "%s/%s",
- ewl_theme_path, font_path);
- else
- snprintf(key, PATH_MAX, "%s", ewl_theme_path);
+ if (strcmp(tmp, ".edj"))
+ snprintf(key, PATH_MAX, "%s/%s",
+ ewl_theme_path, font_path);
+ else
+ snprintf(key, PATH_MAX, "%s", ewl_theme_path);
- ecore_list_append(ewl_theme_font_paths, strdup(key));
+ ecore_list_append(ewl_theme_font_paths, strdup(key));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -651,7 +651,7 @@ ewl_theme_data_free(void *data)
DENTER_FUNCTION(DLEVEL_STABLE);
if (!data || data == (void *)EWL_THEME_KEY_NOMATCH)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
IF_RELEASE(data);
diff --git a/src/lib/ewl_theme.h b/src/lib/ewl_theme.h
index 3daa6f5..98319cd 100644
--- a/src/lib/ewl_theme.h
+++ b/src/lib/ewl_theme.h
@@ -10,27 +10,27 @@
* @{
*/
-int ewl_theme_init(void);
-void ewl_theme_shutdown(void);
+int ewl_theme_init(void);
+void ewl_theme_shutdown(void);
-int ewl_theme_widget_init(Ewl_Widget *w);
-void ewl_theme_widget_shutdown(Ewl_Widget *w);
+int ewl_theme_widget_init(Ewl_Widget *w);
+void ewl_theme_widget_shutdown(Ewl_Widget *w);
const char *ewl_theme_path_get(void);
-int ewl_theme_theme_set(const char *theme);
+int ewl_theme_theme_set(const char *theme);
Ecore_List *ewl_theme_font_path_get(void);
-void ewl_theme_font_path_add(char *path);
+void ewl_theme_font_path_add(char *path);
-char *ewl_theme_image_get(Ewl_Widget *w, char *k);
+char *ewl_theme_image_get(Ewl_Widget *w, char *k);
-void ewl_theme_data_reset(Ewl_Widget *w);
+void ewl_theme_data_reset(Ewl_Widget *w);
const char *ewl_theme_data_str_get(Ewl_Widget *w, char *k);
-void ewl_theme_data_str_set(Ewl_Widget *w, char *k, char *v);
+void ewl_theme_data_str_set(Ewl_Widget *w, char *k, char *v);
-int ewl_theme_data_int_get(Ewl_Widget *w, char *k);
-void ewl_theme_data_int_set(Ewl_Widget *w, char *k, int v);
+int ewl_theme_data_int_get(Ewl_Widget *w, char *k);
+void ewl_theme_data_int_set(Ewl_Widget *w, char *k, int v);
/**
* @internal
diff --git a/src/lib/ewl_toolbar.c b/src/lib/ewl_toolbar.c
index faf4aa3..37689ad 100644
--- a/src/lib/ewl_toolbar.c
+++ b/src/lib/ewl_toolbar.c
@@ -19,11 +19,11 @@ ewl_toolbar_new(void)
t = NEW(Ewl_Toolbar, 1);
if (!t)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_toolbar_init(t)) {
- ewl_widget_destroy(EWL_WIDGET(t));
- t = NULL;
+ ewl_widget_destroy(EWL_WIDGET(t));
+ t = NULL;
}
DRETURN_PTR(EWL_WIDGET(t), DLEVEL_STABLE);
@@ -54,8 +54,8 @@ ewl_vtoolbar_new(void)
t = ewl_toolbar_new();
if (t)
- ewl_toolbar_orientation_set(EWL_TOOLBAR(t),
- EWL_ORIENTATION_VERTICAL);
+ ewl_toolbar_orientation_set(EWL_TOOLBAR(t),
+ EWL_ORIENTATION_VERTICAL);
DRETURN_PTR(t, DLEVEL_STABLE);
}
@@ -78,18 +78,18 @@ ewl_toolbar_init(Ewl_Toolbar *t)
w = EWL_WIDGET(t);
if (!ewl_menubar_init(EWL_MENUBAR(t)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(w, EWL_TOOLBAR_TYPE);
ewl_widget_appearance_set(w, "htoolbar");
ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_HFILL |
- EWL_FLAG_FILL_SHRINK);
+ EWL_FLAG_FILL_SHRINK);
ewl_object_alignment_set(EWL_OBJECT(t), EWL_FLAG_ALIGN_LEFT |
- EWL_FLAG_ALIGN_TOP);
+ EWL_FLAG_ALIGN_TOP);
ewl_container_add_notify_set(EWL_CONTAINER(EWL_MENUBAR(t)->inner_box),
- ewl_toolbar_cb_child_add);
+ ewl_toolbar_cb_child_add);
t->hidden = EWL_ICON_PART_NONE;
DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -110,9 +110,9 @@ ewl_toolbar_orientation_set(Ewl_Toolbar *t, Ewl_Orientation o)
ewl_menubar_orientation_set(EWL_MENUBAR(t), o);
if (o == EWL_ORIENTATION_HORIZONTAL)
- ewl_widget_appearance_set(EWL_WIDGET(t), "htoolbar");
+ ewl_widget_appearance_set(EWL_WIDGET(t), "htoolbar");
else
- ewl_widget_appearance_set(EWL_WIDGET(t), "vtoolbar");
+ ewl_widget_appearance_set(EWL_WIDGET(t), "vtoolbar");
ewl_widget_configure(EWL_WIDGET(t));
@@ -150,14 +150,14 @@ ewl_toolbar_icon_part_hide(Ewl_Toolbar *t, Ewl_Icon_Part part)
DCHECK_TYPE(t, EWL_TOOLBAR_TYPE);
if (t->hidden == part)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
t->hidden = part;
ewl_container_child_iterate_begin(EWL_CONTAINER(t));
while ((child = ewl_container_child_next(EWL_CONTAINER(t)))) {
- if (EWL_ICON_IS(child))
- ewl_icon_part_hide(EWL_ICON(child), part);
+ if (EWL_ICON_IS(child))
+ ewl_icon_part_hide(EWL_ICON(child), part);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -185,7 +185,7 @@ ewl_toolbar_cb_child_add(Ewl_Container *c, Ewl_Widget *w)
t = EWL_TOOLBAR(EWL_WIDGET(c)->parent);
if (EWL_ICON_IS(w))
- ewl_icon_part_hide(EWL_ICON(w), t->hidden);
+ ewl_icon_part_hide(EWL_ICON(w), t->hidden);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_tree.c b/src/lib/ewl_tree.c
index 235db3e..e04f65e 100644
--- a/src/lib/ewl_tree.c
+++ b/src/lib/ewl_tree.c
@@ -29,13 +29,13 @@ struct Ewl_Tree_Expansions_List
static void ewl_tree_build_tree(Ewl_Tree *tree);
static void ewl_tree_build_tree_rows(Ewl_Tree *tree,
- const Ewl_Model *model, const Ewl_View *view,
- void *data, int colour, Ewl_Container *parent,
- int hidden);
+ const Ewl_Model *model, const Ewl_View *view,
+ void *data, int colour, Ewl_Container *parent,
+ int hidden);
static void ewl_tree_headers_build(Ewl_Tree *tree, const Ewl_Model *model,
- void *mvc_data);
+ void *mvc_data);
static void ewl_tree_cb_header_changed(Ewl_Widget *w, void *ev,
- void *data);
+ void *data);
static void ewl_tree_cb_row_clicked(Ewl_Widget *w, void *ev, void *data);
static void ewl_tree_cb_row_highlight(Ewl_Widget *w, void *ev, void *data);
@@ -43,7 +43,7 @@ static void ewl_tree_cb_row_unhighlight(Ewl_Widget *w, void *ev, void *data);
static void ewl_tree_cb_cell_clicked(Ewl_Widget *w, void *ev, void *data);
static void ewl_tree_cb_selected_change(Ewl_MVC *mvc);
static Ewl_Widget *ewl_tree_widget_at(Ewl_MVC *mvc, void *data,
- unsigned int row, unsigned int column);
+ unsigned int row, unsigned int column);
static void ewl_tree_expansions_hash_create(Ewl_Tree *tree);
@@ -64,12 +64,12 @@ ewl_tree_new(void)
w = NEW(Ewl_Tree, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_tree_init(EWL_TREE(w)))
{
- ewl_widget_destroy(w);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ ewl_widget_destroy(w);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -89,13 +89,13 @@ ewl_tree_init(Ewl_Tree *tree)
DCHECK_PARAM_PTR_RET(tree, FALSE);
if (!ewl_mvc_init(EWL_MVC(tree)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(tree), EWL_TREE_TYPE);
ewl_widget_inherit(EWL_WIDGET(tree), EWL_TREE_TYPE);
ewl_mvc_selected_change_cb_set(EWL_MVC(tree),
- ewl_tree_cb_selected_change);
+ ewl_tree_cb_selected_change);
ewl_object_fill_policy_set(EWL_OBJECT(tree), EWL_FLAG_FILL_ALL);
@@ -105,9 +105,9 @@ ewl_tree_init(Ewl_Tree *tree)
ewl_container_child_append(EWL_CONTAINER(tree), tree->header);
ewl_widget_appearance_set(EWL_WIDGET(tree->header), "tree_header");
ewl_object_fill_policy_set(EWL_OBJECT(tree->header),
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
ewl_callback_append(tree->header, EWL_CALLBACK_VALUE_CHANGED,
- ewl_tree_cb_header_changed, tree);
+ ewl_tree_cb_header_changed, tree);
ewl_widget_show(tree->header);
/* set the default row view */
@@ -119,9 +119,9 @@ ewl_tree_init(Ewl_Tree *tree)
ewl_tree_alternate_row_colors_set(tree, TRUE);
ewl_callback_append(EWL_WIDGET(tree), EWL_CALLBACK_CONFIGURE,
- ewl_tree_cb_configure, NULL);
+ ewl_tree_cb_configure, NULL);
ewl_callback_prepend(EWL_WIDGET(tree), EWL_CALLBACK_DESTROY,
- ewl_tree_cb_destroy, NULL);
+ ewl_tree_cb_destroy, NULL);
ewl_widget_focusable_set(EWL_WIDGET(tree), FALSE);
@@ -142,14 +142,14 @@ ewl_tree_headers_visible_set(Ewl_Tree *tree, unsigned char visible)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (tree->headers_visible == !!visible)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tree->headers_visible = !!visible;
if (!tree->headers_visible)
- ewl_widget_hide(tree->header);
+ ewl_widget_hide(tree->header);
else
- ewl_widget_show(tree->header);
+ ewl_widget_show(tree->header);
ewl_mvc_dirty_set(EWL_MVC(tree), TRUE);
@@ -185,7 +185,7 @@ ewl_tree_alternate_row_colors_set(Ewl_Tree *tree, unsigned char alternate)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (tree->row_color_alternate == !!alternate)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tree->row_color_alternate = !!alternate;
ewl_mvc_dirty_set(EWL_MVC(tree), TRUE);
@@ -224,18 +224,18 @@ ewl_tree_column_count_set(Ewl_Tree *tree, unsigned int count)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (tree->columns == count)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tree->columns = count;
ewl_container_reset(EWL_CONTAINER(tree->header));
for (i = 0; i < tree->columns; i++) {
- Ewl_Widget *h;
+ Ewl_Widget *h;
- h = ewl_hbox_new();
- ewl_container_child_append(EWL_CONTAINER(tree->header), h);
- ewl_widget_appearance_set(h, "header");
- ewl_widget_show(h);
+ h = ewl_hbox_new();
+ ewl_container_child_append(EWL_CONTAINER(tree->header), h);
+ ewl_widget_appearance_set(h, "header");
+ ewl_widget_show(h);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -258,12 +258,12 @@ ewl_tree_column_fixed_size_set(Ewl_Tree *tree, unsigned int col, unsigned int fi
if (col >= tree->columns)
{
- DWARNING("parameter col is out of bounds (%i >= %i)",
- col, tree->columns);
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter col is out of bounds (%i >= %i)",
+ col, tree->columns);
+ DRETURN(DLEVEL_STABLE);
}
- box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
+ box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
ewl_paned_fixed_size_set(EWL_PANED(tree->header), box, fixed);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -286,12 +286,12 @@ ewl_tree_column_fixed_size_get(Ewl_Tree *tree, unsigned int col)
if (col >= tree->columns)
{
- DWARNING("parameter col is out of bounds (%i >= %i)",
- col, tree->columns);
- DRETURN_INT(ret, DLEVEL_STABLE);
+ DWARNING("parameter col is out of bounds (%i >= %i)",
+ col, tree->columns);
+ DRETURN_INT(ret, DLEVEL_STABLE);
}
- box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
+ box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
ret = ewl_paned_fixed_size_get(EWL_PANED(tree->header), box);
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -314,12 +314,12 @@ ewl_tree_column_initial_size_set(Ewl_Tree *tree, unsigned int col, int size)
if (col >= tree->columns)
{
- DWARNING("parameter col is out of bounds (%i >= %i)",
- col, tree->columns);
- DRETURN(DLEVEL_STABLE);
+ DWARNING("parameter col is out of bounds (%i >= %i)",
+ col, tree->columns);
+ DRETURN(DLEVEL_STABLE);
}
- box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
+ box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
ewl_paned_initial_size_set(EWL_PANED(tree->header), box, size);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -342,12 +342,12 @@ ewl_tree_column_initial_size_get(Ewl_Tree *tree, unsigned int col)
if (col >= tree->columns)
{
- DWARNING("parameter col is out of bounds (%i >= %i)",
- col, tree->columns);
- DRETURN_INT(ret, DLEVEL_STABLE);
+ DWARNING("parameter col is out of bounds (%i >= %i)",
+ col, tree->columns);
+ DRETURN_INT(ret, DLEVEL_STABLE);
}
- box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
+ box = ewl_container_child_get(EWL_CONTAINER(tree->header), col);
ret = ewl_paned_initial_size_get(EWL_PANED(tree->header), box);
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -383,7 +383,7 @@ ewl_tree_content_view_set(Ewl_Tree *tree, const Ewl_View *view)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (tree->content_view == view)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tree->content_view = view;
@@ -426,7 +426,7 @@ ewl_tree_selection_type_get(Ewl_Tree *tree)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(tree, EWL_TREE_SELECTION_TYPE_CELL);
DCHECK_TYPE_RET(tree, EWL_TREE_TYPE,
- EWL_TREE_SELECTION_TYPE_CELL);
+ EWL_TREE_SELECTION_TYPE_CELL);
DRETURN_INT(tree->type, DLEVEL_STABLE);
}
@@ -445,7 +445,7 @@ ewl_tree_selection_type_set(Ewl_Tree *tree, Ewl_Tree_Selection_Type type)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (tree->type == type)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tree->type = type;
@@ -470,7 +470,7 @@ ewl_tree_fixed_rows_set(Ewl_Tree *tree, unsigned int fixed)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (tree->fixed == !!fixed)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tree->fixed = !!fixed;
ewl_mvc_dirty_set(EWL_MVC(tree), TRUE);
@@ -531,18 +531,18 @@ ewl_tree_row_expand(Ewl_Tree *tree, void *data, unsigned int row)
if (ewl_tree_row_expanded_is(tree, data, row)) DRETURN(DLEVEL_STABLE);
if (!tree->expansions)
- ewl_tree_expansions_hash_create(tree);
+ ewl_tree_expansions_hash_create(tree);
exp = ecore_hash_get(tree->expansions, data);
if (!exp)
{
- DWARNING("We did not find a expansion list. This should not"
- " happen, ever.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("We did not find a expansion list. This should not"
+ " happen, ever.");
+ DRETURN(DLEVEL_STABLE);
}
exp->expanded = realloc(exp->expanded,
- (++exp->size) * sizeof(unsigned int));
+ (++exp->size) * sizeof(unsigned int));
exp->expanded[exp->size - 1] = row;
node = ewl_container_child_get(exp->c, row);
@@ -585,13 +585,13 @@ ewl_tree_row_collapse(Ewl_Tree *tree, void *data, unsigned int row)
/* we found the item so we can remove it */
for (i = 0; exp->expanded[i] != row; i++)
- ;
+ ;
memmove(exp->expanded + i, exp->expanded + i + 1,
- sizeof(unsigned int) * (exp->size - i - 1));
+ sizeof(unsigned int) * (exp->size - i - 1));
exp->size--;
exp->expanded = realloc(exp->expanded,
- sizeof(unsigned int) * exp->size);
+ sizeof(unsigned int) * exp->size);
node = ewl_container_child_get(exp->c, row);
ewl_tree_node_collapse(EWL_TREE_NODE(node));
@@ -627,7 +627,7 @@ ewl_tree_row_expanded_is(Ewl_Tree *tree, void *data, unsigned int row)
/* search for this row in the expansions */
for (i = 0; i < exp->size && exp->expanded[i] != row; i++)
- ;
+ ;
DRETURN_INT(exp->expanded && exp->expanded[i] == row, DLEVEL_STABLE);
}
@@ -665,7 +665,7 @@ ewl_tree_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
*/
void
ewl_tree_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Tree *tree;
@@ -677,16 +677,16 @@ ewl_tree_cb_configure(Ewl_Widget *w, void *ev __UNUSED__,
if (!tree->headers_visible)
{
- /* Since the header is invisible we need to tell it its
- * position and its size to arrange correctly */
- ewl_object_x_request(EWL_OBJECT(tree->header), CURRENT_X(w));
- ewl_object_w_request(EWL_OBJECT(tree->header), CURRENT_W(w));
- ewl_paned_arrange(EWL_PANED(tree->header), tree->columns);
+ /* Since the header is invisible we need to tell it its
+ * position and its size to arrange correctly */
+ ewl_object_x_request(EWL_OBJECT(tree->header), CURRENT_X(w));
+ ewl_object_w_request(EWL_OBJECT(tree->header), CURRENT_W(w));
+ ewl_paned_arrange(EWL_PANED(tree->header), tree->columns);
}
/* if the tree isn't dirty we're done */
if (!ewl_mvc_dirty_get(EWL_MVC(tree)))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_tree_build_tree(tree);
ewl_tree_cb_selected_change(EWL_MVC(tree));
@@ -720,8 +720,8 @@ ewl_tree_cb_column_sort(Ewl_Widget *w, void *ev __UNUSED__, void *data)
/* sanity check */
if (!model || !model->sort)
{
- DWARNING("In ewl_tree_cb_column_sort without a sort cb.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("In ewl_tree_cb_column_sort without a sort cb.");
+ DRETURN(DLEVEL_STABLE);
}
/* update our sort information and call the sort function, skipping
@@ -731,7 +731,7 @@ ewl_tree_cb_column_sort(Ewl_Widget *w, void *ev __UNUSED__, void *data)
if (!tree->sort.direction) tree->sort.direction ++;
model->sort(ewl_mvc_data_get(EWL_MVC(tree)), tree->sort.column,
- tree->sort.direction);
+ tree->sort.direction);
ewl_mvc_dirty_set(EWL_MVC(tree), TRUE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -739,8 +739,8 @@ ewl_tree_cb_column_sort(Ewl_Widget *w, void *ev __UNUSED__, void *data)
static void
ewl_tree_header_build(Ewl_Tree *tree, Ewl_Container *box,
- const Ewl_Model *model, const Ewl_View *view,
- void *mvc_data, unsigned int column)
+ const Ewl_Model *model, const Ewl_View *view,
+ void *mvc_data, unsigned int column)
{
Ewl_Widget *c;
@@ -756,47 +756,47 @@ ewl_tree_header_build(Ewl_Tree *tree, Ewl_Container *box,
if (!view->header_fetch)
{
- DWARNING("Missing header_fetch callback.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Missing header_fetch callback.");
+ DRETURN(DLEVEL_STABLE);
}
if (model->header)
- c = view->header_fetch(model->header(mvc_data, column),
- column);
+ c = view->header_fetch(model->header(mvc_data, column),
+ column);
else
- c = view->header_fetch(NULL, column);
+ c = view->header_fetch(NULL, column);
/* XXX is this really a good idea to override the user's flags ? */
ewl_object_fill_policy_set(EWL_OBJECT(c),
- EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_HFILL);
ewl_container_child_append(box, c);
ewl_widget_show(c);
/* display the sort arrow if needed */
if (model->sortable && model->sortable(mvc_data, column))
{
- const char *state_str;
-
- ewl_callback_append(EWL_WIDGET(box), EWL_CALLBACK_CLICKED,
- ewl_tree_cb_column_sort,
- (unsigned int *)column);
-
- c = ewl_button_new();
- ewl_container_child_append(box, c);
-
- if ((column == tree->sort.column)
- && (tree->sort.direction == EWL_SORT_DIRECTION_ASCENDING))
- state_str = "ascending";
- else if ((column == tree->sort.column)
- && (tree->sort.direction == EWL_SORT_DIRECTION_DESCENDING))
- state_str = "descending";
- else
- state_str = "default";
-
- ewl_widget_state_set(c, state_str, EWL_STATE_PERSISTENT);
- ewl_object_fill_policy_set(EWL_OBJECT(c), EWL_FLAG_FILL_SHRINK);
- ewl_object_alignment_set(EWL_OBJECT(c), EWL_FLAG_ALIGN_RIGHT);
- ewl_widget_show(c);
+ const char *state_str;
+
+ ewl_callback_append(EWL_WIDGET(box), EWL_CALLBACK_CLICKED,
+ ewl_tree_cb_column_sort,
+ (unsigned int *)column);
+
+ c = ewl_button_new();
+ ewl_container_child_append(box, c);
+
+ if ((column == tree->sort.column)
+ && (tree->sort.direction == EWL_SORT_DIRECTION_ASCENDING))
+ state_str = "ascending";
+ else if ((column == tree->sort.column)
+ && (tree->sort.direction == EWL_SORT_DIRECTION_DESCENDING))
+ state_str = "descending";
+ else
+ state_str = "default";
+
+ ewl_widget_state_set(c, state_str, EWL_STATE_PERSISTENT);
+ ewl_object_fill_policy_set(EWL_OBJECT(c), EWL_FLAG_FILL_SHRINK);
+ ewl_object_alignment_set(EWL_OBJECT(c), EWL_FLAG_ALIGN_RIGHT);
+ ewl_widget_show(c);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -804,9 +804,9 @@ ewl_tree_header_build(Ewl_Tree *tree, Ewl_Container *box,
static void
ewl_tree_column_build(Ewl_Row *row, const Ewl_Model *model,
- const Ewl_View *view,
- void *mvc_data, unsigned int r,
- unsigned int c, Ewl_Widget *node)
+ const Ewl_View *view,
+ void *mvc_data, unsigned int r,
+ unsigned int c, Ewl_Widget *node)
{
Ewl_Widget *cell;
Ewl_Widget *child;
@@ -823,17 +823,17 @@ ewl_tree_column_build(Ewl_Row *row, const Ewl_Model *model,
ewl_object_fill_policy_set(EWL_OBJECT(cell), EWL_FLAG_FILL_ALL);
ewl_container_child_append(EWL_CONTAINER(row), cell);
ewl_callback_append(cell, EWL_CALLBACK_CLICKED,
- ewl_tree_cb_cell_clicked, node);
+ ewl_tree_cb_cell_clicked, node);
ewl_widget_show(cell);
val = model->fetch(mvc_data, r, c);
if (!val)
{
- child = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(child), " ");
+ child = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(child), " ");
}
else
- child = view->fetch(val, r, c);
+ child = view->fetch(val, r, c);
ewl_container_child_append(EWL_CONTAINER(cell), child);
ewl_widget_show(child);
@@ -861,8 +861,8 @@ ewl_tree_build_tree(Ewl_Tree *tree)
/* setup the content */
ewl_container_reset(EWL_CONTAINER(tree->rows));
ewl_tree_build_tree_rows(tree, model,
- ewl_mvc_view_get(EWL_MVC(tree)), mvc_data,
- 0, EWL_CONTAINER(tree->rows), FALSE);
+ ewl_mvc_view_get(EWL_MVC(tree)), mvc_data,
+ 0, EWL_CONTAINER(tree->rows), FALSE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -882,16 +882,16 @@ ewl_tree_headers_build(Ewl_Tree *tree, const Ewl_Model *model, void *mvc_data)
ewl_container_child_iterate_begin(header);
for (i = 0; i < tree->columns; i++)
{
- Ewl_Widget *h = ewl_container_child_next(header);
-
- ewl_container_reset(EWL_CONTAINER(h));
- /* remove it here since the column may be not sortable
- * anymore */
- ewl_callback_del(h, EWL_CALLBACK_CLICKED,
- ewl_tree_cb_column_sort);
- ewl_tree_header_build(tree, EWL_CONTAINER(h), model,
- ewl_mvc_view_get(EWL_MVC(tree)),
- mvc_data, i);
+ Ewl_Widget *h = ewl_container_child_next(header);
+
+ ewl_container_reset(EWL_CONTAINER(h));
+ /* remove it here since the column may be not sortable
+ * anymore */
+ ewl_callback_del(h, EWL_CALLBACK_CLICKED,
+ ewl_tree_cb_column_sort);
+ ewl_tree_header_build(tree, EWL_CONTAINER(h), model,
+ ewl_mvc_view_get(EWL_MVC(tree)),
+ mvc_data, i);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -899,8 +899,8 @@ ewl_tree_headers_build(Ewl_Tree *tree, const Ewl_Model *model, void *mvc_data)
static void
ewl_tree_build_tree_rows(Ewl_Tree *tree, const Ewl_Model *model,
- const Ewl_View *view, void *data, int colour,
- Ewl_Container *parent, int hidden)
+ const Ewl_View *view, void *data, int colour,
+ Ewl_Container *parent, int hidden)
{
unsigned int i = 0, row_count = 0;
unsigned int column;
@@ -915,82 +915,82 @@ ewl_tree_build_tree_rows(Ewl_Tree *tree, const Ewl_Model *model,
while (TRUE)
{
- Ewl_Widget *row, *node;
-
- node = ewl_tree_node_new();
- EWL_TREE_NODE(node)->tree = EWL_WIDGET(tree);
- EWL_TREE_NODE(node)->row_num = i;
- ewl_mvc_model_set(EWL_MVC(node), model);
- ewl_mvc_data_set(EWL_MVC(node), data);
- ewl_mvc_view_set(EWL_MVC(node), view);
-
- ewl_container_child_append(parent, node);
- if (!hidden) ewl_widget_show(node);
-
- row = ewl_row_new();
- ewl_row_header_set(EWL_ROW(row), EWL_CONTAINER(tree->header));
- ewl_tree_node_row_set(EWL_TREE_NODE(node), EWL_ROW(row));
- ewl_container_child_append(EWL_CONTAINER(node), row);
- ewl_callback_append(row, EWL_CALLBACK_CLICKED,
- ewl_tree_cb_row_clicked, node);
- ewl_widget_show(row);
-
- if (!model->highlight || model->highlight(data, i))
- {
- ewl_callback_append(row, EWL_CALLBACK_MOUSE_IN,
- ewl_tree_cb_row_highlight, NULL);
- ewl_callback_append(row, EWL_CALLBACK_MOUSE_OUT,
- ewl_tree_cb_row_unhighlight, NULL);
- }
-
- if (tree->row_color_alternate)
- {
- if (colour)
- ewl_widget_state_set(row, "odd",
- EWL_STATE_PERSISTENT);
- else
- ewl_widget_state_set(row, "even",
- EWL_STATE_PERSISTENT);
- }
-
- colour = (colour + 1) % 2;
-
- /* do the current branch */
- for (column = 0; column < tree->columns; column++)
- ewl_tree_column_build(EWL_ROW(row), model, view,
- data, i, column, node);
-
- /* check if this is an expansion point */
- if (model->expansion.is && model->expansion.is(data, i))
- {
- int hidden = TRUE;
-
- if (!model->expansion.data)
- {
- DWARNING("In ewl_tree_build_tree_rows, "
- "model expandable but without "
- "expansion_data_fetch cb.");
- DRETURN(DLEVEL_STABLE);
- }
-
- ewl_tree_node_expandable_set(EWL_TREE_NODE(node), TRUE);
-
- if (model->expansion.data &&
- ewl_tree_row_expanded_is(tree, data, i))
- {
- ewl_tree_node_expand(EWL_TREE_NODE(node));
- hidden = FALSE;
- }
- }
- else
- ewl_tree_node_expandable_set(EWL_TREE_NODE(node), FALSE);
-
- i++;
-
- /*
- * Finished the rows at this level? Jump back up a level.
- */
- if (i >= row_count) break;
+ Ewl_Widget *row, *node;
+
+ node = ewl_tree_node_new();
+ EWL_TREE_NODE(node)->tree = EWL_WIDGET(tree);
+ EWL_TREE_NODE(node)->row_num = i;
+ ewl_mvc_model_set(EWL_MVC(node), model);
+ ewl_mvc_data_set(EWL_MVC(node), data);
+ ewl_mvc_view_set(EWL_MVC(node), view);
+
+ ewl_container_child_append(parent, node);
+ if (!hidden) ewl_widget_show(node);
+
+ row = ewl_row_new();
+ ewl_row_header_set(EWL_ROW(row), EWL_CONTAINER(tree->header));
+ ewl_tree_node_row_set(EWL_TREE_NODE(node), EWL_ROW(row));
+ ewl_container_child_append(EWL_CONTAINER(node), row);
+ ewl_callback_append(row, EWL_CALLBACK_CLICKED,
+ ewl_tree_cb_row_clicked, node);
+ ewl_widget_show(row);
+
+ if (!model->highlight || model->highlight(data, i))
+ {
+ ewl_callback_append(row, EWL_CALLBACK_MOUSE_IN,
+ ewl_tree_cb_row_highlight, NULL);
+ ewl_callback_append(row, EWL_CALLBACK_MOUSE_OUT,
+ ewl_tree_cb_row_unhighlight, NULL);
+ }
+
+ if (tree->row_color_alternate)
+ {
+ if (colour)
+ ewl_widget_state_set(row, "odd",
+ EWL_STATE_PERSISTENT);
+ else
+ ewl_widget_state_set(row, "even",
+ EWL_STATE_PERSISTENT);
+ }
+
+ colour = (colour + 1) % 2;
+
+ /* do the current branch */
+ for (column = 0; column < tree->columns; column++)
+ ewl_tree_column_build(EWL_ROW(row), model, view,
+ data, i, column, node);
+
+ /* check if this is an expansion point */
+ if (model->expansion.is && model->expansion.is(data, i))
+ {
+ int hidden = TRUE;
+
+ if (!model->expansion.data)
+ {
+ DWARNING("In ewl_tree_build_tree_rows, "
+ "model expandable but without "
+ "expansion_data_fetch cb.");
+ DRETURN(DLEVEL_STABLE);
+ }
+
+ ewl_tree_node_expandable_set(EWL_TREE_NODE(node), TRUE);
+
+ if (model->expansion.data &&
+ ewl_tree_row_expanded_is(tree, data, i))
+ {
+ ewl_tree_node_expand(EWL_TREE_NODE(node));
+ hidden = FALSE;
+ }
+ }
+ else
+ ewl_tree_node_expandable_set(EWL_TREE_NODE(node), FALSE);
+
+ i++;
+
+ /*
+ * Finished the rows at this level? Jump back up a level.
+ */
+ if (i >= row_count) break;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -998,7 +998,7 @@ ewl_tree_build_tree_rows(Ewl_Tree *tree, const Ewl_Model *model,
static void
ewl_tree_cb_header_changed(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Tree *tree;
@@ -1014,7 +1014,7 @@ ewl_tree_cb_header_changed(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
static void
ewl_tree_cb_row_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Tree *tree;
Ewl_Tree_Node *node;
@@ -1026,18 +1026,18 @@ ewl_tree_cb_row_clicked(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
node = data;
tree = EWL_TREE(node->tree);
if (tree->type != EWL_TREE_SELECTION_TYPE_ROW)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_mvc_handle_click(EWL_MVC(tree), ewl_mvc_model_get(EWL_MVC(node)),
- ewl_mvc_data_get(EWL_MVC(node)),
- node->row_num, 0);
+ ewl_mvc_data_get(EWL_MVC(node)),
+ node->row_num, 0);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static void
ewl_tree_cb_row_highlight(Ewl_Widget *w, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -1078,15 +1078,15 @@ ewl_tree_cb_cell_clicked(Ewl_Widget *w, void *ev __UNUSED__, void *data)
node = EWL_TREE_NODE(data);
tree = EWL_TREE(node->tree);
if (tree->type != EWL_TREE_SELECTION_TYPE_CELL)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
column = ewl_container_child_index_get(EWL_CONTAINER(row), w);
if (column < 0) DRETURN(DLEVEL_STABLE);
ewl_mvc_handle_click(EWL_MVC(node->tree),
- ewl_mvc_model_get(EWL_MVC(node)),
- ewl_mvc_data_get(EWL_MVC(node)),
- node->row_num, column);
+ ewl_mvc_model_get(EWL_MVC(node)),
+ ewl_mvc_data_get(EWL_MVC(node)),
+ node->row_num, column);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1099,14 +1099,14 @@ ewl_tree_cb_selected_change(Ewl_MVC *mvc)
DCHECK_TYPE(mvc, EWL_MVC_TYPE);
ewl_mvc_highlight(mvc, EWL_CONTAINER(EWL_TREE(mvc)->rows),
- ewl_tree_widget_at);
+ ewl_tree_widget_at);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
static Ewl_Widget *
ewl_tree_widget_at(Ewl_MVC *mvc, void *data, unsigned int row,
- unsigned int column)
+ unsigned int column)
{
Ewl_Widget *r, *w;
Ewl_Container *c;
@@ -1121,16 +1121,16 @@ ewl_tree_widget_at(Ewl_MVC *mvc, void *data, unsigned int row,
/* get the container that holds the wished row */
if (ewl_mvc_data_get(mvc) == data)
- c = EWL_CONTAINER(tree->rows);
+ c = EWL_CONTAINER(tree->rows);
else
{
- Ewl_Tree_Expansions_List *exp;
+ Ewl_Tree_Expansions_List *exp;
- exp = ecore_hash_get(tree->expansions, data);
- if (!exp)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ exp = ecore_hash_get(tree->expansions, data);
+ if (!exp)
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
- c = exp->c;
+ c = exp->c;
}
/* find the row in the container */
@@ -1138,12 +1138,12 @@ ewl_tree_widget_at(Ewl_MVC *mvc, void *data, unsigned int row,
r = EWL_WIDGET(EWL_TREE_NODE(r)->row);
if (tree->type == EWL_TREE_SELECTION_TYPE_ROW)
- w = r;
+ w = r;
else
{
- /* infact our row is a node so we have to get the row
- * to search for the right container */
- w = ewl_container_child_get(EWL_CONTAINER(r), column);
+ /* infact our row is a node so we have to get the row
+ * to search for the right container */
+ w = ewl_container_child_get(EWL_CONTAINER(r), column);
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -1159,11 +1159,11 @@ ewl_tree_expansions_hash_create(Ewl_Tree *tree)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (tree->expansions)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
tree->expansions = ecore_hash_new(NULL, NULL);
ecore_hash_free_value_cb_set(tree->expansions,
- ECORE_FREE_CB(ewl_tree_expansions_list_destroy));
+ ECORE_FREE_CB(ewl_tree_expansions_list_destroy));
exp = ewl_tree_expansions_list_new();
exp->c = EWL_CONTAINER(tree->rows);
@@ -1181,7 +1181,7 @@ ewl_tree_expansions_list_new(void)
el = NEW(Ewl_Tree_Expansions_List, 1);
if (!el)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
DRETURN_PTR(el, DLEVEL_STABLE);
}
@@ -1210,12 +1210,12 @@ ewl_tree_node_new(void)
w = NEW(Ewl_Tree_Node, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_tree_node_init(EWL_TREE_NODE(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -1228,34 +1228,34 @@ ewl_tree_node_init(Ewl_Tree_Node *node)
DCHECK_PARAM_PTR_RET(node, FALSE);
if (!ewl_mvc_init(EWL_MVC(node)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(node), EWL_TREE_NODE_TYPE);
ewl_widget_inherit(EWL_WIDGET(node), EWL_TREE_NODE_TYPE);
ewl_container_show_notify_set(EWL_CONTAINER(node),
- ewl_tree_cb_node_child_show);
+ ewl_tree_cb_node_child_show);
ewl_container_hide_notify_set(EWL_CONTAINER(node),
- ewl_tree_cb_node_child_hide);
+ ewl_tree_cb_node_child_hide);
ewl_container_resize_notify_set(EWL_CONTAINER(node),
- ewl_tree_cb_node_resize);
+ ewl_tree_cb_node_resize);
ewl_container_add_notify_set(EWL_CONTAINER(node),
- ewl_tree_cb_node_child_add);
+ ewl_tree_cb_node_child_add);
ewl_container_remove_notify_set(EWL_CONTAINER(node),
- ewl_tree_cb_node_child_del);
+ ewl_tree_cb_node_child_del);
/* we don't want the mvc to unref our data since the data is owned
* by the tree or the parent node */
ewl_callback_del(EWL_WIDGET(node), EWL_CALLBACK_DESTROY,
- ewl_mvc_cb_data_unref);
+ ewl_mvc_cb_data_unref);
ewl_object_fill_policy_set(EWL_OBJECT(node),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
ewl_callback_del(EWL_WIDGET(node), EWL_CALLBACK_CONFIGURE,
- ewl_box_cb_configure);
+ ewl_box_cb_configure);
ewl_callback_append(EWL_WIDGET(node), EWL_CALLBACK_CONFIGURE,
- ewl_tree_cb_node_configure, NULL);
+ ewl_tree_cb_node_configure, NULL);
node->expanded = EWL_TREE_NODE_COLLAPSED;
ewl_widget_focusable_set(EWL_WIDGET(node), FALSE);
@@ -1276,32 +1276,32 @@ ewl_tree_node_expandable_set(Ewl_Tree_Node *node, unsigned int expandable)
* a function to query for expandability */
if (!node->handle && model->expansion.is)
{
- node->handle = ewl_expansion_new();
- ewl_container_child_prepend(EWL_CONTAINER(node), node->handle);
- ewl_widget_internal_set(EWL_WIDGET(node->handle), TRUE);
- ewl_widget_show(node->handle);
+ node->handle = ewl_expansion_new();
+ ewl_container_child_prepend(EWL_CONTAINER(node), node->handle);
+ ewl_widget_internal_set(EWL_WIDGET(node->handle), TRUE);
+ ewl_widget_show(node->handle);
}
if (!node->handle)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (expandable)
{
- ewl_callback_append(node->handle, EWL_CALLBACK_VALUE_CHANGED,
- ewl_tree_cb_node_toggle, node);
- ewl_callback_append(EWL_WIDGET(node), EWL_CALLBACK_DESTROY,
- ewl_tree_cb_node_data_unref, NULL);
- ewl_widget_enable(node->handle);
- ewl_expansion_expandable_set(EWL_EXPANSION(node->handle), TRUE);
+ ewl_callback_append(node->handle, EWL_CALLBACK_VALUE_CHANGED,
+ ewl_tree_cb_node_toggle, node);
+ ewl_callback_append(EWL_WIDGET(node), EWL_CALLBACK_DESTROY,
+ ewl_tree_cb_node_data_unref, NULL);
+ ewl_widget_enable(node->handle);
+ ewl_expansion_expandable_set(EWL_EXPANSION(node->handle), TRUE);
}
else
{
- ewl_callback_del(node->handle, EWL_CALLBACK_VALUE_CHANGED,
- ewl_tree_cb_node_toggle);
- ewl_callback_del(EWL_WIDGET(node), EWL_CALLBACK_DESTROY,
- ewl_tree_cb_node_data_unref);
- ewl_widget_disable(node->handle);
- ewl_expansion_expandable_set(EWL_EXPANSION(node->handle), FALSE);
+ ewl_callback_del(node->handle, EWL_CALLBACK_VALUE_CHANGED,
+ ewl_tree_cb_node_toggle);
+ ewl_callback_del(EWL_WIDGET(node), EWL_CALLBACK_DESTROY,
+ ewl_tree_cb_node_data_unref);
+ ewl_widget_disable(node->handle);
+ ewl_expansion_expandable_set(EWL_EXPANSION(node->handle), FALSE);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1315,7 +1315,7 @@ ewl_tree_node_expandable_get(Ewl_Tree_Node *node)
DCHECK_TYPE_RET(node, EWL_TREE_NODE_TYPE, FALSE);
DRETURN_INT((node->handle) &&
- ewl_expansion_is_expandable(EWL_EXPANSION(node->handle)), DLEVEL_STABLE);
+ ewl_expansion_is_expandable(EWL_EXPANSION(node->handle)), DLEVEL_STABLE);
}
void
@@ -1331,7 +1331,7 @@ ewl_tree_node_expand(Ewl_Tree_Node *node)
DCHECK_TYPE(node, EWL_TREE_NODE_TYPE);
if (node->expanded == EWL_TREE_NODE_EXPANDED)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Queue the parent tree for configure, this handles the issue of
@@ -1347,13 +1347,13 @@ ewl_tree_node_expand(Ewl_Tree_Node *node)
ecore_dlist_first_goto(EWL_CONTAINER(node)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(node)->children)))
{
- if ((child != node->handle) && (child != EWL_WIDGET(node->row))
- && !UNMANAGED(child))
- ecore_list_append(tmp, child);
+ if ((child != node->handle) && (child != EWL_WIDGET(node->row))
+ && !UNMANAGED(child))
+ ecore_list_append(tmp, child);
}
while ((child = ecore_list_first_remove(tmp)))
- ewl_widget_show(child);
+ ewl_widget_show(child);
IF_FREE_LIST(tmp);
@@ -1361,42 +1361,42 @@ ewl_tree_node_expand(Ewl_Tree_Node *node)
data = ewl_mvc_data_get(EWL_MVC(node));
if (model->expansion.data && !node->built_children)
{
- const Ewl_View *view, *tmp_view = NULL;
- const Ewl_Model *tmp_model;
-
- if (!node->expansion.data)
- {
- Ewl_Tree_Expansions_List *exp;
-
- node->expansion.data =
- model->expansion.data(data, node->row_num);
-
- /* Put the node into the expansions hash */
- exp = ewl_tree_expansions_list_new();
- exp->c = EWL_CONTAINER(node);
- ecore_hash_set(EWL_TREE(node->tree)->expansions,
- node->expansion.data, exp);
- }
-
- if (!node->expansion.model && model->expansion.model)
- node->expansion.model =
- model->expansion.model(data, node->row_num);
-
- /* We only save the model reference here to unref it on destroy.
- * We don't need to save the parent model to unref */
- if (!node->expansion.model) tmp_model = model;
- else tmp_model = node->expansion.model;
-
- view = ewl_mvc_view_get(EWL_MVC(node));
- if (view->expansion)
- tmp_view = view->expansion(data, node->row_num);
-
- if (!tmp_view) tmp_view = view;
-
- ewl_tree_build_tree_rows(EWL_TREE(node->tree), tmp_model,
- tmp_view, node->expansion.data,
- 0, EWL_CONTAINER(node), FALSE);
- node->built_children = TRUE;
+ const Ewl_View *view, *tmp_view = NULL;
+ const Ewl_Model *tmp_model;
+
+ if (!node->expansion.data)
+ {
+ Ewl_Tree_Expansions_List *exp;
+
+ node->expansion.data =
+ model->expansion.data(data, node->row_num);
+
+ /* Put the node into the expansions hash */
+ exp = ewl_tree_expansions_list_new();
+ exp->c = EWL_CONTAINER(node);
+ ecore_hash_set(EWL_TREE(node->tree)->expansions,
+ node->expansion.data, exp);
+ }
+
+ if (!node->expansion.model && model->expansion.model)
+ node->expansion.model =
+ model->expansion.model(data, node->row_num);
+
+ /* We only save the model reference here to unref it on destroy.
+ * We don't need to save the parent model to unref */
+ if (!node->expansion.model) tmp_model = model;
+ else tmp_model = node->expansion.model;
+
+ view = ewl_mvc_view_get(EWL_MVC(node));
+ if (view->expansion)
+ tmp_view = view->expansion(data, node->row_num);
+
+ if (!tmp_view) tmp_view = view;
+
+ ewl_tree_build_tree_rows(EWL_TREE(node->tree), tmp_model,
+ tmp_view, node->expansion.data,
+ 0, EWL_CONTAINER(node), FALSE);
+ node->built_children = TRUE;
}
node->expanded = EWL_TREE_NODE_EXPANDED;
@@ -1414,7 +1414,7 @@ ewl_tree_node_collapse(Ewl_Tree_Node *node)
DENTER_FUNCTION(DLEVEL_STABLE);
if (node->expanded == EWL_TREE_NODE_COLLAPSED)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Queue the parent tree for configure, this handles the issue of
@@ -1430,13 +1430,13 @@ ewl_tree_node_collapse(Ewl_Tree_Node *node)
ecore_dlist_first_goto(EWL_CONTAINER(node)->children);
while ((child = ecore_dlist_next(EWL_CONTAINER(node)->children)))
{
- if ((child != node->handle) && (child != EWL_WIDGET(node->row))
- && !UNMANAGED(child))
- ecore_list_append(tmp, child);
+ if ((child != node->handle) && (child != EWL_WIDGET(node->row))
+ && !UNMANAGED(child))
+ ecore_list_append(tmp, child);
}
while ((child = ecore_list_first_remove(tmp)))
- ewl_widget_hide(child);
+ ewl_widget_hide(child);
IF_FREE_LIST(tmp);
@@ -1452,7 +1452,7 @@ ewl_tree_node_expanded_is(Ewl_Tree_Node *node)
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(node, FALSE);
- DRETURN_INT((node->expanded == EWL_TREE_NODE_EXPANDED), DLEVEL_STABLE);
+ DRETURN_INT((node->expanded == EWL_TREE_NODE_EXPANDED), DLEVEL_STABLE);
}
void
@@ -1472,7 +1472,7 @@ ewl_tree_node_row_set(Ewl_Tree_Node *node, Ewl_Row *row)
void
ewl_tree_cb_node_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Tree_Node *node;
Ewl_Container *c;
@@ -1494,11 +1494,11 @@ ewl_tree_cb_node_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
if (node->handle)
{
- ewl_object_geometry_request(EWL_OBJECT(node->handle),
- CURRENT_X(w), CURRENT_Y(w), CURRENT_W(w),
- CURRENT_H(w));
- hw = ewl_object_current_w_get(EWL_OBJECT(node->handle));
- x += hw;
+ ewl_object_geometry_request(EWL_OBJECT(node->handle),
+ CURRENT_X(w), CURRENT_Y(w), CURRENT_W(w),
+ CURRENT_H(w));
+ hw = ewl_object_current_w_get(EWL_OBJECT(node->handle));
+ x += hw;
}
/*
@@ -1507,13 +1507,13 @@ ewl_tree_cb_node_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
ecore_dlist_first_goto(c->children);
while ((child = ecore_dlist_next(c->children)))
{
- if (VISIBLE(child) && EWL_WIDGET(child) != node->handle
- && !UNMANAGED(child))
- {
- ewl_object_geometry_request(child, x, y, CURRENT_W(w) - hw,
- ewl_object_preferred_h_get(child));
- y += ewl_object_current_h_get(child);
- }
+ if (VISIBLE(child) && EWL_WIDGET(child) != node->handle
+ && !UNMANAGED(child))
+ {
+ ewl_object_geometry_request(child, x, y, CURRENT_W(w) - hw,
+ ewl_object_preferred_h_get(child));
+ y += ewl_object_current_h_get(child);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1521,7 +1521,7 @@ ewl_tree_cb_node_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
void
ewl_tree_cb_node_data_unref(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Tree_Node *node;
const Ewl_Model *model;
@@ -1533,15 +1533,15 @@ ewl_tree_cb_node_data_unref(Ewl_Widget *w, void *ev_data __UNUSED__,
node = EWL_TREE_NODE(w);
if (!node->expansion.data)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (node->expansion.model)
- model = node->expansion.model;
+ model = node->expansion.model;
else
- model = ewl_mvc_model_get(EWL_MVC(w));
+ model = ewl_mvc_model_get(EWL_MVC(w));
if (model->unref)
- model->unref(node->expansion.data);
+ model->unref(node->expansion.data);
node->expansion.data = NULL;
@@ -1550,7 +1550,7 @@ ewl_tree_cb_node_data_unref(Ewl_Widget *w, void *ev_data __UNUSED__,
void
ewl_tree_cb_node_toggle(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
- void *data)
+ void *data)
{
Ewl_Tree_Node *node;
void *parent_data;
@@ -1563,14 +1563,14 @@ ewl_tree_cb_node_toggle(Ewl_Widget *w __UNUSED__, void *ev_data __UNUSED__,
parent_data = ewl_mvc_data_get(EWL_MVC(node));
if (!ewl_tree_node_expandable_get(node))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_tree_node_expanded_is(node))
- ewl_tree_row_collapse(EWL_TREE(node->tree), parent_data,
- node->row_num);
+ ewl_tree_row_collapse(EWL_TREE(node->tree), parent_data,
+ node->row_num);
else
- ewl_tree_row_expand(EWL_TREE(node->tree), parent_data,
- node->row_num);
+ ewl_tree_row_expand(EWL_TREE(node->tree), parent_data,
+ node->row_num);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1586,23 +1586,23 @@ ewl_tree_cb_node_child_show(Ewl_Container *c, Ewl_Widget *w __UNUSED__)
node = EWL_TREE_NODE(c);
if (node->handle && node->expanded) {
- ewl_container_sum_prefer(c, EWL_ORIENTATION_VERTICAL);
- if (REALIZED(node->handle) && VISIBLE(node->handle))
- ewl_object_preferred_inner_h_set(EWL_OBJECT(c),
- PREFERRED_H(c) -
- ewl_object_preferred_h_get(EWL_OBJECT(node->handle)));
+ ewl_container_sum_prefer(c, EWL_ORIENTATION_VERTICAL);
+ if (REALIZED(node->handle) && VISIBLE(node->handle))
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(c),
+ PREFERRED_H(c) -
+ ewl_object_preferred_h_get(EWL_OBJECT(node->handle)));
}
else
- ewl_object_preferred_inner_h_set(EWL_OBJECT(c),
- ewl_object_preferred_h_get(EWL_OBJECT(node->row)));
+ ewl_object_preferred_inner_h_set(EWL_OBJECT(c),
+ ewl_object_preferred_h_get(EWL_OBJECT(node->row)));
ewl_container_largest_prefer(c, EWL_ORIENTATION_HORIZONTAL);
if (node->handle && REALIZED(node->handle) && VISIBLE(node->handle))
- ewl_object_preferred_inner_w_set(EWL_OBJECT(c), PREFERRED_W(c) +
- ewl_object_preferred_w_get(EWL_OBJECT(node->handle)));
+ ewl_object_preferred_inner_w_set(EWL_OBJECT(c), PREFERRED_W(c) +
+ ewl_object_preferred_w_get(EWL_OBJECT(node->handle)));
if (!node->expanded && node->handle)
- ewl_widget_hide(node->handle);
+ ewl_widget_hide(node->handle);
ewl_widget_configure(node->tree);
@@ -1623,27 +1623,27 @@ ewl_tree_cb_node_child_hide(Ewl_Container *c, Ewl_Widget *w)
node = EWL_TREE_NODE(c);
if (w == node->handle)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ecore_dlist_count(c->children) < 3)
{
- if (node->handle && VISIBLE(node->handle))
- ewl_widget_hide(node->handle);
+ if (node->handle && VISIBLE(node->handle))
+ ewl_widget_hide(node->handle);
}
ewl_object_preferred_inner_h_set(EWL_OBJECT(c),
- PREFERRED_H(c) - ewl_object_preferred_h_get(EWL_OBJECT(w)));
+ PREFERRED_H(c) - ewl_object_preferred_h_get(EWL_OBJECT(w)));
width = ewl_object_preferred_w_get(EWL_OBJECT(w));
if (PREFERRED_W(c) >= width)
- ewl_container_largest_prefer(c, EWL_ORIENTATION_HORIZONTAL);
+ ewl_container_largest_prefer(c, EWL_ORIENTATION_HORIZONTAL);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void
ewl_tree_cb_node_resize(Ewl_Container *c, Ewl_Widget *w, int size __UNUSED__,
- Ewl_Orientation o __UNUSED__)
+ Ewl_Orientation o __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(c);
@@ -1669,12 +1669,12 @@ ewl_tree_cb_node_child_add(Ewl_Container *c, Ewl_Widget *w __UNUSED__)
if (ecore_dlist_count(c->children) > 2)
{
- /* XXX what do we do if !node->handle? */
- if (node->handle && HIDDEN(node->handle))
- ewl_widget_show(node->handle);
+ /* XXX what do we do if !node->handle? */
+ if (node->handle && HIDDEN(node->handle))
+ ewl_widget_show(node->handle);
}
else if (node->handle && VISIBLE(node->handle))
- ewl_widget_hide(node->handle);
+ ewl_widget_hide(node->handle);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1705,11 +1705,11 @@ ewl_tree_kinetic_scrolling_set(Ewl_Tree *tree, Ewl_Kinetic_Scroll type)
DCHECK_TYPE(tree, EWL_TREE_TYPE);
if (!type)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ewl_scrollpane_kinetic_scrolling_set(EWL_SCROLLPANE(scroll), type);
+ ewl_scrollpane_kinetic_scrolling_set(EWL_SCROLLPANE(scroll), type);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1731,7 +1731,7 @@ ewl_tree_kinetic_scrolling_get(Ewl_Tree *tree)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- type = ewl_scrollpane_kinetic_scrolling_get(scroll);
+ type = ewl_scrollpane_kinetic_scrolling_get(scroll);
DRETURN_INT(type, DLEVEL_STABLE);
}
@@ -1753,7 +1753,7 @@ ewl_tree_kinetic_max_velocity_set(Ewl_Tree *tree, double v)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ewl_scrollpane_kinetic_max_velocity_set(scroll, v);
+ ewl_scrollpane_kinetic_max_velocity_set(scroll, v);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1775,7 +1775,7 @@ ewl_tree_kinetic_max_velocity_get(Ewl_Tree *tree)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ret = ewl_scrollpane_kinetic_max_velocity_get(scroll);
+ ret = ewl_scrollpane_kinetic_max_velocity_get(scroll);
DRETURN_INT(ret, DLEVEL_STABLE);
}
@@ -1797,7 +1797,7 @@ ewl_tree_kinetic_min_velocity_set(Ewl_Tree *tree, double v)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ewl_scrollpane_kinetic_min_velocity_set(scroll, v);
+ ewl_scrollpane_kinetic_min_velocity_set(scroll, v);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1819,7 +1819,7 @@ ewl_tree_kinetic_min_velocity_get(Ewl_Tree *tree)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ret = ewl_scrollpane_kinetic_min_velocity_get(scroll);
+ ret = ewl_scrollpane_kinetic_min_velocity_get(scroll);
DRETURN_INT(ret, DLEVEL_STABLE);
}
@@ -1841,7 +1841,7 @@ ewl_tree_kinetic_dampen_set(Ewl_Tree *tree, double d)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ewl_scrollpane_kinetic_dampen_set(scroll, d);
+ ewl_scrollpane_kinetic_dampen_set(scroll, d);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1863,7 +1863,7 @@ ewl_tree_kinetic_dampen_get(Ewl_Tree *tree)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ret = ewl_scrollpane_kinetic_dampen_get(scroll);
+ ret = ewl_scrollpane_kinetic_dampen_get(scroll);
DRETURN_INT(ret, DLEVEL_STABLE);
}
@@ -1885,7 +1885,7 @@ ewl_tree_kinetic_fps_set(Ewl_Tree *tree, int fps)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ewl_scrollpane_kinetic_fps_set(scroll, fps);
+ ewl_scrollpane_kinetic_fps_set(scroll, fps);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1907,7 +1907,7 @@ ewl_tree_kinetic_fps_get(Ewl_Tree *tree)
scroll = ewl_tree_kinetic_scrollpane_get(tree);
if (scroll)
- ret = ewl_scrollpane_kinetic_fps_get(scroll);
+ ret = ewl_scrollpane_kinetic_fps_get(scroll);
DRETURN_INT(ret, DLEVEL_STABLE);
}
@@ -1933,14 +1933,14 @@ ewl_tree_kinetic_scrollpane_get(Ewl_Tree *tree)
while (!ewl_widget_type_is(EWL_WIDGET(scroll), EWL_SCROLLPANE_TYPE))
{
- temp = scroll;
- scroll = ewl_container_redirect_get(temp);
-
- if (!scroll)
- {
- DWARNING("No scrollpane to use for kinetic scrolling");
- DRETURN_PTR(NULL, DLEVEL_STABLE);
- }
+ temp = scroll;
+ scroll = ewl_container_redirect_get(temp);
+
+ if (!scroll)
+ {
+ DWARNING("No scrollpane to use for kinetic scrolling");
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
+ }
}
DRETURN_PTR(EWL_SCROLLPANE(scroll), DLEVEL_STABLE);
diff --git a/src/lib/ewl_tree.h b/src/lib/ewl_tree.h
index 96a2416..aba6f36 100644
--- a/src/lib/ewl_tree.h
+++ b/src/lib/ewl_tree.h
@@ -96,26 +96,26 @@ typedef struct Ewl_Tree Ewl_Tree;
*/
struct Ewl_Tree
{
- Ewl_MVC mvc; /**< Inherit from ewl_mvc. */
+ Ewl_MVC mvc; /**< Inherit from ewl_mvc. */
- const Ewl_View *content_view; /**< View for the content widget */
+ const Ewl_View *content_view; /**< View for the content widget */
- Ewl_Widget *header; /**< The tree header */
- Ewl_Widget *rows; /**< The rows of the tree */
+ Ewl_Widget *header; /**< The tree header */
+ Ewl_Widget *rows; /**< The rows of the tree */
unsigned int *rowcache; /**< Cache of row sizes */
- Ewl_Tree_Selection_Type type; /**< The selection type of the tree */
+ Ewl_Tree_Selection_Type type; /**< The selection type of the tree */
- Ecore_Hash *expansions; /**< Hash of expanded rows */
+ Ecore_Hash *expansions; /**< Hash of expanded rows */
struct
{
- unsigned int column; /**< The sort column */
- Ewl_Sort_Direction direction; /**< Sort direction */
- } sort; /**< The sort information */
+ unsigned int column; /**< The sort column */
+ Ewl_Sort_Direction direction; /**< Sort direction */
+ } sort; /**< The sort information */
- unsigned int columns; /**< Number of columns in the tree */
+ unsigned int columns; /**< Number of columns in the tree */
unsigned char fixed:1; /**< Rows are fixed height */
unsigned char headers_visible:1; /**< Are the headers visible? */
unsigned char row_color_alternate:1; /**< Are the rows alternating? */
@@ -125,59 +125,59 @@ struct Ewl_Tree
* Tree view/controller manipulation
*/
Ewl_Widget *ewl_tree_new(void);
-int ewl_tree_init(Ewl_Tree *tree);
+int ewl_tree_init(Ewl_Tree *tree);
-void ewl_tree_column_count_set(Ewl_Tree *tree,
- unsigned int count);
+void ewl_tree_column_count_set(Ewl_Tree *tree,
+ unsigned int count);
unsigned int ewl_tree_column_count_get(Ewl_Tree *tree);
-void ewl_tree_column_fixed_size_set(Ewl_Tree *tree,
- unsigned int col, unsigned int fixed);
+void ewl_tree_column_fixed_size_set(Ewl_Tree *tree,
+ unsigned int col, unsigned int fixed);
unsigned int ewl_tree_column_fixed_size_get(Ewl_Tree *tree,
- unsigned int col);
-void ewl_tree_column_initial_size_set(Ewl_Tree *tree,
- unsigned int col, int size);
-int ewl_tree_column_initial_size_get(Ewl_Tree *tree,
- unsigned int col);
-
-void ewl_tree_headers_visible_set(Ewl_Tree *tree,
- unsigned char visible);
+ unsigned int col);
+void ewl_tree_column_initial_size_set(Ewl_Tree *tree,
+ unsigned int col, int size);
+int ewl_tree_column_initial_size_get(Ewl_Tree *tree,
+ unsigned int col);
+
+void ewl_tree_headers_visible_set(Ewl_Tree *tree,
+ unsigned char visible);
unsigned int ewl_tree_headers_visible_get(Ewl_Tree *tree);
-void ewl_tree_content_view_set(Ewl_Tree *tree, const Ewl_View *view);
+void ewl_tree_content_view_set(Ewl_Tree *tree, const Ewl_View *view);
Ewl_View *ewl_tree_content_view_get(Ewl_Tree *tree);
Ewl_Tree_Selection_Type ewl_tree_selection_type_get(Ewl_Tree *tree);
-void ewl_tree_selection_type_set(Ewl_Tree *tree,
- Ewl_Tree_Selection_Type type);
+void ewl_tree_selection_type_set(Ewl_Tree *tree,
+ Ewl_Tree_Selection_Type type);
-void ewl_tree_fixed_rows_set(Ewl_Tree *tree, unsigned int fixed);
+void ewl_tree_fixed_rows_set(Ewl_Tree *tree, unsigned int fixed);
unsigned int ewl_tree_fixed_rows_get(Ewl_Tree *tree);
-void ewl_tree_alternate_row_colors_set(Ewl_Tree *tree,
- unsigned char alternate);
+void ewl_tree_alternate_row_colors_set(Ewl_Tree *tree,
+ unsigned char alternate);
unsigned int ewl_tree_alternate_row_colors_get(Ewl_Tree *tree);
Ewl_Widget *ewl_tree_content_widget_get(Ewl_Tree *tree);
-void ewl_tree_row_expand(Ewl_Tree *tree, void *data,
- unsigned int row);
-void ewl_tree_row_collapse(Ewl_Tree *tree, void *data,
- unsigned int row);
+void ewl_tree_row_expand(Ewl_Tree *tree, void *data,
+ unsigned int row);
+void ewl_tree_row_collapse(Ewl_Tree *tree, void *data,
+ unsigned int row);
unsigned int ewl_tree_row_expanded_is(Ewl_Tree *tree, void *data,
- unsigned int row);
+ unsigned int row);
-void ewl_tree_kinetic_scrolling_set(Ewl_Tree *tree,
- Ewl_Kinetic_Scroll type);
+void ewl_tree_kinetic_scrolling_set(Ewl_Tree *tree,
+ Ewl_Kinetic_Scroll type);
Ewl_Kinetic_Scroll ewl_tree_kinetic_scrolling_get(Ewl_Tree *tree);
-void ewl_tree_kinetic_max_velocity_set(Ewl_Tree *tree, double v);
-double ewl_tree_kinetic_max_velocity_get(Ewl_Tree *tree);
-void ewl_tree_kinetic_min_velocity_set(Ewl_Tree *tree, double v);
-double ewl_tree_kinetic_min_velocity_get(Ewl_Tree *tree);
-void ewl_tree_kinetic_dampen_set(Ewl_Tree *tree, double d);
-double ewl_tree_kinetic_dampen_get(Ewl_Tree *tree);
-void ewl_tree_kinetic_fps_set(Ewl_Tree *tree, int fps);
-int ewl_tree_kinetic_fps_get(Ewl_Tree *tree);
+void ewl_tree_kinetic_max_velocity_set(Ewl_Tree *tree, double v);
+double ewl_tree_kinetic_max_velocity_get(Ewl_Tree *tree);
+void ewl_tree_kinetic_min_velocity_set(Ewl_Tree *tree, double v);
+double ewl_tree_kinetic_min_velocity_get(Ewl_Tree *tree);
+void ewl_tree_kinetic_dampen_set(Ewl_Tree *tree, double d);
+double ewl_tree_kinetic_dampen_get(Ewl_Tree *tree);
+void ewl_tree_kinetic_fps_set(Ewl_Tree *tree, int fps);
+int ewl_tree_kinetic_fps_get(Ewl_Tree *tree);
/*
* Internal stuff.
@@ -212,34 +212,34 @@ struct Ewl_Tree_Node
{
Ewl_MVC mvc;
- Ewl_Widget *tree; /**< The parent tree */
- Ewl_Widget *handle; /**< the expansion handle */
- Ewl_Row *row; /**< The row this node is for */
+ Ewl_Widget *tree; /**< The parent tree */
+ Ewl_Widget *handle; /**< the expansion handle */
+ Ewl_Row *row; /**< The row this node is for */
struct
{
- const Ewl_Model *model; /**< The model of the expansion */
- void *data; /**< The data of the expansion */
+ const Ewl_Model *model; /**< The model of the expansion */
+ void *data; /**< The data of the expansion */
} expansion;
- unsigned int row_num; /**< The row number of this row */
+ unsigned int row_num; /**< The row number of this row */
Ewl_Tree_Node_Flags expanded;
- unsigned char built_children:1; /**< Have we generated child nodes */
+ unsigned char built_children:1; /**< Have we generated child nodes */
};
Ewl_Widget *ewl_tree_node_new(void);
-int ewl_tree_node_init(Ewl_Tree_Node *node);
+int ewl_tree_node_init(Ewl_Tree_Node *node);
-void ewl_tree_node_expandable_set(Ewl_Tree_Node *node,
- unsigned int expandable);
+void ewl_tree_node_expandable_set(Ewl_Tree_Node *node,
+ unsigned int expandable);
unsigned int ewl_tree_node_expandable_get(Ewl_Tree_Node *node);
-void ewl_tree_node_expand(Ewl_Tree_Node *node);
-void ewl_tree_node_collapse(Ewl_Tree_Node *node);
+void ewl_tree_node_expand(Ewl_Tree_Node *node);
+void ewl_tree_node_collapse(Ewl_Tree_Node *node);
unsigned int ewl_tree_node_expanded_is(Ewl_Tree_Node *node);
-void ewl_tree_node_row_set(Ewl_Tree_Node *node, Ewl_Row *row);
+void ewl_tree_node_row_set(Ewl_Tree_Node *node, Ewl_Row *row);
/*
* Internally used callbacks, override at your own risk.
diff --git a/src/lib/ewl_tree_view.c b/src/lib/ewl_tree_view.c
index 728aae4..90493ae 100644
--- a/src/lib/ewl_tree_view.c
+++ b/src/lib/ewl_tree_view.c
@@ -14,7 +14,7 @@ int
ewl_tree_view_init(Ewl_Tree_View *v)
{
if (!ewl_box_init(EWL_BOX(v)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(v), EWL_TREE_VIEW_TYPE);
ewl_box_orientation_set(EWL_BOX(v), EWL_ORIENTATION_VERTICAL);
diff --git a/src/lib/ewl_tree_view.h b/src/lib/ewl_tree_view.h
index 1bcf9f7..ec4ed4c 100644
--- a/src/lib/ewl_tree_view.h
+++ b/src/lib/ewl_tree_view.h
@@ -46,8 +46,8 @@ typedef struct Ewl_Tree_View Ewl_Tree_View;
*/
struct Ewl_Tree_View
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
- Ewl_Tree *parent; /**< The tree parent */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Tree *parent; /**< The tree parent */
};
int ewl_tree_view_init(Ewl_Tree_View *v);
diff --git a/src/lib/ewl_tree_view_freebox.c b/src/lib/ewl_tree_view_freebox.c
index 1238cc4..dfbe174 100644
--- a/src/lib/ewl_tree_view_freebox.c
+++ b/src/lib/ewl_tree_view_freebox.c
@@ -9,8 +9,8 @@
static Ewl_View *ewl_tree_view_freebox_view = NULL;
static Ewl_Widget *ewl_tree_view_freebox_cb_widget_fetch(void *data,
- unsigned int col,
- unsigned int row);
+ unsigned int col,
+ unsigned int row);
/**
* @return Returns the view for this widget
@@ -23,9 +23,9 @@ ewl_tree_view_freebox_get(void)
if (!ewl_tree_view_freebox_view)
{
- ewl_tree_view_freebox_view = ewl_view_new();
- ewl_view_widget_fetch_set(ewl_tree_view_freebox_view,
- ewl_tree_view_freebox_cb_widget_fetch);
+ ewl_tree_view_freebox_view = ewl_view_new();
+ ewl_view_widget_fetch_set(ewl_tree_view_freebox_view,
+ ewl_tree_view_freebox_cb_widget_fetch);
}
DRETURN_PTR(ewl_tree_view_freebox_view, DLEVEL_STABLE);
@@ -33,8 +33,8 @@ ewl_tree_view_freebox_get(void)
static Ewl_Widget *
ewl_tree_view_freebox_cb_widget_fetch(void *data __UNUSED__,
- unsigned int col __UNUSED__,
- unsigned int row __UNUSED__)
+ unsigned int col __UNUSED__,
+ unsigned int row __UNUSED__)
{
Ewl_Widget *tree;
@@ -59,12 +59,12 @@ ewl_tree_view_freebox_new(void)
w = NEW(Ewl_Tree_View_Freebox, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_tree_view_freebox_init(EWL_TREE_VIEW_FREEBOX(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -82,7 +82,7 @@ ewl_tree_view_freebox_init(Ewl_Tree_View_Freebox *tv)
DCHECK_PARAM_PTR_RET(tv, FALSE);
if (!ewl_tree_view_init(EWL_TREE_VIEW(tv)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(tv), EWL_ORIENTATION_VERTICAL);
ewl_widget_inherit(EWL_WIDGET(tv), EWL_TREE_VIEW_FREEBOX_TYPE);
@@ -95,12 +95,12 @@ ewl_tree_view_freebox_init(Ewl_Tree_View_Freebox *tv)
tv->fbox = ewl_vfreebox_new();
ewl_freebox_layout_type_set(EWL_FREEBOX(tv->fbox),
- EWL_FREEBOX_LAYOUT_AUTO);
+ EWL_FREEBOX_LAYOUT_AUTO);
ewl_container_child_append(EWL_CONTAINER(tv->scroll), tv->fbox);
ewl_widget_show(tv->fbox);
ewl_container_redirect_set(EWL_CONTAINER(tv),
- EWL_CONTAINER(tv->fbox));
+ EWL_CONTAINER(tv->fbox));
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_tree_view_freebox.h b/src/lib/ewl_tree_view_freebox.h
index 1078ae2..56386e1 100644
--- a/src/lib/ewl_tree_view_freebox.h
+++ b/src/lib/ewl_tree_view_freebox.h
@@ -40,14 +40,14 @@ typedef struct Ewl_Tree_View_Freebox Ewl_Tree_View_Freebox;
*/
struct Ewl_Tree_View_Freebox
{
- Ewl_Tree_View view; /**< Inherit from Ewl_Tree_View */
- Ewl_Widget *fbox; /**< The freebox region */
- Ewl_Widget *scroll; /**< The scroll region */
+ Ewl_Tree_View view; /**< Inherit from Ewl_Tree_View */
+ Ewl_Widget *fbox; /**< The freebox region */
+ Ewl_Widget *scroll; /**< The scroll region */
};
const Ewl_View *ewl_tree_view_freebox_get(void);
Ewl_Widget *ewl_tree_view_freebox_new(void);
-int ewl_tree_view_freebox_init(Ewl_Tree_View_Freebox *tv);
+int ewl_tree_view_freebox_init(Ewl_Tree_View_Freebox *tv);
/**
* @}
diff --git a/src/lib/ewl_tree_view_plain.c b/src/lib/ewl_tree_view_plain.c
index be4cbcc..fe96b01 100644
--- a/src/lib/ewl_tree_view_plain.c
+++ b/src/lib/ewl_tree_view_plain.c
@@ -6,8 +6,8 @@
#include "ewl_debug.h"
static Ewl_Widget *ewl_tree_view_plain_cb_widget_fetch(void *data,
- unsigned int row,
- unsigned int col);
+ unsigned int row,
+ unsigned int col);
static Ewl_View *ewl_tree_view_plain_view = NULL;
@@ -22,9 +22,9 @@ ewl_tree_view_plain_get(void)
if (!ewl_tree_view_plain_view)
{
- ewl_tree_view_plain_view = ewl_view_new();
- ewl_view_widget_fetch_set(ewl_tree_view_plain_view,
- ewl_tree_view_plain_cb_widget_fetch);
+ ewl_tree_view_plain_view = ewl_view_new();
+ ewl_view_widget_fetch_set(ewl_tree_view_plain_view,
+ ewl_tree_view_plain_cb_widget_fetch);
}
DRETURN_PTR(ewl_tree_view_plain_view, DLEVEL_STABLE);
@@ -32,8 +32,8 @@ ewl_tree_view_plain_get(void)
static Ewl_Widget *
ewl_tree_view_plain_cb_widget_fetch(void *data __UNUSED__,
- unsigned int row __UNUSED__,
- unsigned int col __UNUSED__)
+ unsigned int row __UNUSED__,
+ unsigned int col __UNUSED__)
{
Ewl_Widget *plain;
@@ -58,12 +58,12 @@ ewl_tree_view_plain_new(void)
w = NEW(Ewl_Tree_View_Plain, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_tree_view_plain_init(EWL_TREE_VIEW_PLAIN(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -81,7 +81,7 @@ ewl_tree_view_plain_init(Ewl_Tree_View_Plain *tv)
DCHECK_PARAM_PTR_RET(tv, FALSE);
if (!ewl_tree_view_init(EWL_TREE_VIEW(tv)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_inherit(EWL_WIDGET(tv), EWL_TREE_VIEW_PLAIN_TYPE);
diff --git a/src/lib/ewl_tree_view_plain.h b/src/lib/ewl_tree_view_plain.h
index c1a6e1f..f6205a5 100644
--- a/src/lib/ewl_tree_view_plain.h
+++ b/src/lib/ewl_tree_view_plain.h
@@ -44,13 +44,13 @@ typedef struct Ewl_Tree_View_Plain Ewl_Tree_View_Plain;
*/
struct Ewl_Tree_View_Plain
{
- Ewl_Tree_View view; /**< Inherit from Ewl_Tree_View */
+ Ewl_Tree_View view; /**< Inherit from Ewl_Tree_View */
};
const Ewl_View *ewl_tree_view_plain_get(void);
Ewl_Widget *ewl_tree_view_plain_new(void);
-int ewl_tree_view_plain_init(Ewl_Tree_View_Plain *tv);
+int ewl_tree_view_plain_init(Ewl_Tree_View_Plain *tv);
/**
* @}
diff --git a/src/lib/ewl_tree_view_scrolled.c b/src/lib/ewl_tree_view_scrolled.c
index f31f3b5..5536dc5 100644
--- a/src/lib/ewl_tree_view_scrolled.c
+++ b/src/lib/ewl_tree_view_scrolled.c
@@ -9,7 +9,7 @@
static Ewl_View *ewl_tree_view_scrolled_view = NULL;
static Ewl_Widget * ewl_tree_view_cb_widget_fetch(void *data, unsigned int col,
- unsigned int row);
+ unsigned int row);
/**
* @return Returns the view for this widget
@@ -22,9 +22,9 @@ ewl_tree_view_scrolled_get(void)
if (!ewl_tree_view_scrolled_view)
{
- ewl_tree_view_scrolled_view = ewl_view_new();
- ewl_view_widget_fetch_set(ewl_tree_view_scrolled_view,
- ewl_tree_view_cb_widget_fetch);
+ ewl_tree_view_scrolled_view = ewl_view_new();
+ ewl_view_widget_fetch_set(ewl_tree_view_scrolled_view,
+ ewl_tree_view_cb_widget_fetch);
}
DRETURN_PTR(ewl_tree_view_scrolled_view, DLEVEL_STABLE);
@@ -32,8 +32,8 @@ ewl_tree_view_scrolled_get(void)
static Ewl_Widget *
ewl_tree_view_cb_widget_fetch(void *data __UNUSED__,
- unsigned int col __UNUSED__,
- unsigned int row __UNUSED__)
+ unsigned int col __UNUSED__,
+ unsigned int row __UNUSED__)
{
Ewl_Widget *tree;
@@ -58,12 +58,12 @@ ewl_tree_view_scrolled_new(void)
w = NEW(Ewl_Tree_View_Scrolled, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_tree_view_scrolled_init(EWL_TREE_VIEW_SCROLLED(w)))
{
- ewl_widget_destroy(w);
- w = NULL;
+ ewl_widget_destroy(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -81,7 +81,7 @@ ewl_tree_view_scrolled_init(Ewl_Tree_View_Scrolled *tv)
DCHECK_PARAM_PTR_RET(tv, FALSE);
if (!ewl_tree_view_init(EWL_TREE_VIEW(tv)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_box_orientation_set(EWL_BOX(tv), EWL_ORIENTATION_VERTICAL);
ewl_widget_inherit(EWL_WIDGET(tv), EWL_TREE_VIEW_SCROLLED_TYPE);
@@ -106,7 +106,7 @@ ewl_tree_view_scrolled_init(Ewl_Tree_View_Scrolled *tv)
*/
void
ewl_tree_view_scrolled_scroll_headers_set(Ewl_Tree_View *view,
- unsigned int scroll)
+ unsigned int scroll)
{
Ewl_Tree_View_Scrolled *vs;
@@ -116,22 +116,22 @@ ewl_tree_view_scrolled_scroll_headers_set(Ewl_Tree_View *view,
if (!view->parent)
{
- DWARNING("Need parent tree before setting headers scrolled.");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("Need parent tree before setting headers scrolled.");
+ DRETURN(DLEVEL_STABLE);
}
vs = EWL_TREE_VIEW_SCROLLED(view);
if (vs->scroll_header == scroll)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
vs->scroll_header = scroll;
if (vs->scroll_header)
- ewl_container_child_prepend(EWL_CONTAINER(vs),
- view->parent->header);
+ ewl_container_child_prepend(EWL_CONTAINER(vs),
+ view->parent->header);
else
- ewl_container_child_prepend(EWL_CONTAINER(view->parent),
- view->parent->header);
+ ewl_container_child_prepend(EWL_CONTAINER(view->parent),
+ view->parent->header);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
diff --git a/src/lib/ewl_tree_view_scrolled.h b/src/lib/ewl_tree_view_scrolled.h
index 90946de..08b4555 100644
--- a/src/lib/ewl_tree_view_scrolled.h
+++ b/src/lib/ewl_tree_view_scrolled.h
@@ -44,20 +44,20 @@ typedef struct Ewl_Tree_View_Scrolled Ewl_Tree_View_Scrolled;
*/
struct Ewl_Tree_View_Scrolled
{
- Ewl_Box box; /**< Inherit from Ewl_Box */
- Ewl_Widget *scroll; /**< The scroll region */
+ Ewl_Box box; /**< Inherit from Ewl_Box */
+ Ewl_Widget *scroll; /**< The scroll region */
- unsigned char scroll_header:1; /**< Do we scroll headers */
- unsigned char scroll_visible:1; /**< Do we we show the headers */
+ unsigned char scroll_header:1; /**< Do we scroll headers */
+ unsigned char scroll_visible:1; /**< Do we we show the headers */
};
const Ewl_View *ewl_tree_view_scrolled_get(void);
Ewl_Widget *ewl_tree_view_scrolled_new(void);
-int ewl_tree_view_scrolled_init(Ewl_Tree_View_Scrolled *tv);
+int ewl_tree_view_scrolled_init(Ewl_Tree_View_Scrolled *tv);
-void ewl_tree_view_scrolled_scroll_headers_set(Ewl_Tree_View *view,
- unsigned int scroll);
+void ewl_tree_view_scrolled_scroll_headers_set(Ewl_Tree_View *view,
+ unsigned int scroll);
unsigned int ewl_tree_view_scrolled_scroll_headers_get(Ewl_Tree_View *view);
/**
diff --git a/src/lib/ewl_view.c b/src/lib/ewl_view.c
index e3bfda9..6d642d2 100644
--- a/src/lib/ewl_view.c
+++ b/src/lib/ewl_view.c
@@ -19,8 +19,8 @@ ewl_view_new(void)
view = NEW(Ewl_View, 1);
if (!ewl_view_init(view))
{
- FREE(view);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(view);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
DRETURN_PTR(view, DLEVEL_STABLE);
@@ -41,8 +41,8 @@ ewl_view_clone(const Ewl_View *src)
view = NEW(Ewl_View, 1);
if (!ewl_view_init(view))
{
- FREE(view);
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ FREE(view);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
}
memcpy(view, src, sizeof(Ewl_View));
diff --git a/src/lib/ewl_view.h b/src/lib/ewl_view.h
index 8e3edda..31dfad4 100644
--- a/src/lib/ewl_view.h
+++ b/src/lib/ewl_view.h
@@ -21,7 +21,7 @@
* A typedef to shorten the definition of the view_widget_fetch callbacks.
*/
typedef Ewl_Widget *(*Ewl_View_Widget_Fetch)(void *data, unsigned int row,
- unsigned int col);
+ unsigned int col);
/**
* @def EWL_VIEW_HEADER_GET(f)
@@ -56,32 +56,32 @@ typedef struct Ewl_View Ewl_View;
* callbacks.
*/
typedef Ewl_View *(*Ewl_View_Expansion_View_Fetch)(void *data,
- unsigned int row);
+ unsigned int row);
/**
* @brief The view function pointers
*/
struct Ewl_View
{
- Ewl_View_Widget_Fetch fetch; /**< Get a new widget for display */
- Ewl_View_Header_Fetch header_fetch; /**< Get the header for the given column */
+ Ewl_View_Widget_Fetch fetch; /**< Get a new widget for display */
+ Ewl_View_Header_Fetch header_fetch; /**< Get the header for the given column */
Ewl_View_Expansion_View_Fetch expansion; /**< Get a view for displaying expansion data */
};
-Ewl_View *ewl_view_new(void);
-int ewl_view_init(Ewl_View *view);
-Ewl_View *ewl_view_clone(const Ewl_View *src);
+Ewl_View *ewl_view_new(void);
+int ewl_view_init(Ewl_View *view);
+Ewl_View *ewl_view_clone(const Ewl_View *src);
-void ewl_view_widget_fetch_set(Ewl_View *view,
- Ewl_View_Widget_Fetch construct);
+void ewl_view_widget_fetch_set(Ewl_View *view,
+ Ewl_View_Widget_Fetch construct);
Ewl_View_Widget_Fetch ewl_view_widget_fetch_get(const Ewl_View *view);
-void ewl_view_header_fetch_set(Ewl_View *v,
- Ewl_View_Header_Fetch f);
+void ewl_view_header_fetch_set(Ewl_View *v,
+ Ewl_View_Header_Fetch f);
Ewl_View_Header_Fetch ewl_view_header_fetch_get(const Ewl_View *v);
-void ewl_view_expansion_view_fetch_set(Ewl_View *v,
- Ewl_View_Expansion_View_Fetch f);
+void ewl_view_expansion_view_fetch_set(Ewl_View *v,
+ Ewl_View_Expansion_View_Fetch f);
Ewl_View_Expansion_View_Fetch ewl_view_expansion_view_fetch_get(const Ewl_View *v);
/**
diff --git a/src/lib/ewl_widget.c b/src/lib/ewl_widget.c
index 5db6a47..2e5567d 100644
--- a/src/lib/ewl_widget.c
+++ b/src/lib/ewl_widget.c
@@ -12,11 +12,11 @@ static Ecore_Hash *ewl_widget_data_table = NULL;
static Evas_Smart *widget_smart = NULL;
static void ewl_widget_theme_padding_get(Ewl_Widget *w, int *l, int *r,
- int *t, int *b);
+ int *t, int *b);
static void ewl_widget_theme_insets_get(Ewl_Widget *w, int *l, int *r,
- int *t, int *b);
+ int *t, int *b);
static void ewl_widget_appearance_part_text_apply(Ewl_Widget *w,
- const char *part, const char *text);
+ const char *part, const char *text);
static void ewl_widget_layer_stack_add(Ewl_Widget *w);
static void ewl_widget_layer_update(Ewl_Widget *w);
static Evas_Object *ewl_widget_layer_neighbor_find_above(Ewl_Widget *w);
@@ -40,11 +40,11 @@ ewl_widget_new(void)
w = NEW(Ewl_Widget, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_widget_init(w)) {
- FREE(w);
- w = NULL;
+ FREE(w);
+ w = NULL;
}
DRETURN_PTR(w, DLEVEL_STABLE);
@@ -70,13 +70,13 @@ ewl_widget_init(Ewl_Widget *w)
* Set size fields on the object
*/
if (!ewl_object_init(EWL_OBJECT(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
/*
* Set up the necessary theme structures
*/
if (!ewl_theme_widget_init(w))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAGS_STATE_MASK);
@@ -87,33 +87,33 @@ ewl_widget_init(Ewl_Widget *w)
ewl_callback_append(w, EWL_CALLBACK_HIDE, ewl_widget_cb_hide, NULL);
ewl_callback_append(w, EWL_CALLBACK_REVEAL, ewl_widget_cb_reveal, NULL);
ewl_callback_append(w, EWL_CALLBACK_OBSCURE, ewl_widget_cb_obscure,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_REALIZE, ewl_widget_cb_realize,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_UNREALIZE, ewl_widget_cb_unrealize,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_widget_cb_configure,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_REPARENT, ewl_widget_cb_reparent,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_WIDGET_ENABLE, ewl_widget_cb_enable,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_WIDGET_DISABLE,
- ewl_widget_cb_disable, NULL);
+ ewl_widget_cb_disable, NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN, ewl_widget_cb_focus_in,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_FOCUS_OUT, ewl_widget_cb_focus_out,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_IN, ewl_widget_cb_mouse_in,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_OUT, ewl_widget_cb_mouse_out,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_DOWN,
- ewl_widget_cb_mouse_down, NULL);
+ ewl_widget_cb_mouse_down, NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, ewl_widget_cb_mouse_up,
- NULL);
+ NULL);
ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE,
- ewl_widget_cb_mouse_move, NULL);
+ ewl_widget_cb_mouse_move, NULL);
/* widgets can take focus by default */
ewl_widget_focusable_set(w, TRUE);
@@ -138,18 +138,18 @@ ewl_widget_name_set(Ewl_Widget *w, const char *name)
if (!ewl_widget_name_table)
{
- ewl_widget_name_table = ecore_hash_new(ecore_str_hash,
- ecore_str_compare);
- ecore_hash_free_key_cb_set(ewl_widget_name_table,
- ECORE_FREE_CB(free));
- ewl_shutdown_add(ewl_widget_name_table_shutdown);
+ ewl_widget_name_table = ecore_hash_new(ecore_str_hash,
+ ecore_str_compare);
+ ecore_hash_free_key_cb_set(ewl_widget_name_table,
+ ECORE_FREE_CB(free));
+ ewl_shutdown_add(ewl_widget_name_table_shutdown);
}
t = (name ? strdup(name) : NULL);
ewl_attach_name_set(w, t);
if (ewl_widget_name_table)
- ecore_hash_set(ewl_widget_name_table, t, w);
+ ecore_hash_set(ewl_widget_name_table, t, w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -183,8 +183,8 @@ ewl_widget_name_find(const char *name)
DCHECK_PARAM_PTR_RET(name, NULL);
if (ewl_widget_name_table)
- match = EWL_WIDGET(ecore_hash_get(ewl_widget_name_table,
- (void *)name));
+ match = EWL_WIDGET(ecore_hash_get(ewl_widget_name_table,
+ (void *)name));
DRETURN_PTR(match, DLEVEL_STABLE);
}
@@ -204,32 +204,32 @@ ewl_widget_realize(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (REALIZED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_object_queued_has(EWL_OBJECT(w), EWL_FLAG_QUEUED_SCHEDULED_REVEAL)
- && !ewl_object_queued_has(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_PROCESS_REVEAL))
- ewl_realize_cancel_request(w);
+ && !ewl_object_queued_has(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_PROCESS_REVEAL))
+ ewl_realize_cancel_request(w);
/*
* The parent's realize function will get us here again.
*/
if (w->parent && !REALIZED(w->parent))
- ewl_widget_realize(w->parent);
+ ewl_widget_realize(w->parent);
/*
* The parent should be realized at this point, and we can handle
* realizing ourselves.
*/
if (w->parent || ewl_object_toplevel_get(EWL_OBJECT(w))) {
- ewl_object_queued_add(EWL_OBJECT(w), EWL_FLAG_QUEUED_PROCESS_REVEAL);
- ewl_callback_call(w, EWL_CALLBACK_REALIZE);
- ewl_object_queued_remove(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_PROCESS_REVEAL);
-
- ewl_object_visible_add(EWL_OBJECT(w),
- EWL_FLAG_VISIBLE_REALIZED);
- ewl_widget_obscure(w);
+ ewl_object_queued_add(EWL_OBJECT(w), EWL_FLAG_QUEUED_PROCESS_REVEAL);
+ ewl_callback_call(w, EWL_CALLBACK_REALIZE);
+ ewl_object_queued_remove(EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_PROCESS_REVEAL);
+
+ ewl_object_visible_add(EWL_OBJECT(w),
+ EWL_FLAG_VISIBLE_REALIZED);
+ ewl_widget_obscure(w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -250,10 +250,10 @@ ewl_widget_unrealize(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (ewl_object_queued_has(EWL_OBJECT(w), EWL_FLAG_QUEUED_SCHEDULED_REVEAL))
- ewl_realize_cancel_request(w);
+ ewl_realize_cancel_request(w);
if (!REALIZED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_widget_obscure(w);
@@ -282,15 +282,15 @@ ewl_widget_reveal(Ewl_Widget *w)
* unless the are already queued for reveal, ie. in the realize process.
*/
if (REVEALED(w) || (!REALIZED(w) && !ewl_object_queued_has(
- EWL_OBJECT(w),
- EWL_FLAG_QUEUED_PROCESS_REVEAL)))
- DRETURN(DLEVEL_STABLE);
+ EWL_OBJECT(w),
+ EWL_FLAG_QUEUED_PROCESS_REVEAL)))
+ DRETURN(DLEVEL_STABLE);
ewl_object_visible_add(EWL_OBJECT(w), EWL_FLAG_VISIBLE_REVEALED);
emb = ewl_embed_widget_find(w);
if (emb && emb->canvas)
- ewl_callback_call(w, EWL_CALLBACK_REVEAL);
+ ewl_callback_call(w, EWL_CALLBACK_REVEAL);
ewl_widget_configure(w);
@@ -308,13 +308,13 @@ void ewl_widget_obscure(Ewl_Widget *w)
DCHECK_PARAM_PTR(w);
if (!REVEALED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_object_visible_remove(EWL_OBJECT(w), EWL_FLAG_VISIBLE_REVEALED);
if (REALIZED(w) || ewl_object_queued_has(EWL_OBJECT(w),
- EWL_FLAG_QUEUED_SCHEDULED_REVEAL))
- ewl_callback_call(w, EWL_CALLBACK_OBSCURE);
+ EWL_FLAG_QUEUED_SCHEDULED_REVEAL))
+ ewl_callback_call(w, EWL_CALLBACK_OBSCURE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -339,7 +339,7 @@ ewl_widget_show(Ewl_Widget *w)
* Nothing to do if already visible.
*/
if (VISIBLE(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Flag that this is a visible widget
@@ -350,9 +350,9 @@ ewl_widget_show(Ewl_Widget *w)
* If realized, go about our business, otherwise queue for realize.
*/
if (REALIZED(w))
- ewl_callback_call(w, EWL_CALLBACK_SHOW);
+ ewl_callback_call(w, EWL_CALLBACK_SHOW);
else
- ewl_realize_request(w);
+ ewl_realize_request(w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -375,13 +375,13 @@ ewl_widget_hide(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (ewl_object_queued_has(EWL_OBJECT(w), EWL_FLAG_QUEUED_SCHEDULED_REVEAL))
- ewl_realize_cancel_request(w);
+ ewl_realize_cancel_request(w);
/*
* Already hidden? Then no work to be done.
*/
if (HIDDEN(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
emb = ewl_embed_widget_find(w);
if (emb) ewl_embed_info_widgets_cleanup(emb, w);
@@ -389,7 +389,7 @@ ewl_widget_hide(Ewl_Widget *w)
ewl_object_visible_remove(EWL_OBJECT(w), EWL_FLAG_VISIBLE_SHOWN);
if (REALIZED(w))
- ewl_callback_call(w, EWL_CALLBACK_HIDE);
+ ewl_callback_call(w, EWL_CALLBACK_HIDE);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -413,7 +413,7 @@ ewl_widget_destroy(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DESTROYED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
emb = ewl_embed_widget_find(w);
if (emb) ewl_embed_info_widgets_cleanup(emb, w);
@@ -443,8 +443,8 @@ ewl_widget_destroy(Ewl_Widget *w)
*/
for (i = 0; i < (EWL_CALLBACK_MAX + 1); i++)
{
- if (i == EWL_CALLBACK_DESTROY) continue;
- ewl_callback_del_type(w, i);
+ if (i == EWL_CALLBACK_DESTROY) continue;
+ ewl_callback_del_type(w, i);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -466,7 +466,7 @@ ewl_widget_configure(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if ((!VISIBLE(w)) || (w->parent && !REVEALED(w->parent)))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_configure_request(w);
@@ -514,12 +514,12 @@ ewl_widget_data_set(Ewl_Widget *w, void *k, void *v)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!ewl_widget_data_table)
- ewl_widget_data_table = ecore_hash_new(NULL, NULL);
+ ewl_widget_data_table = ecore_hash_new(NULL, NULL);
w_data = ecore_hash_get(ewl_widget_data_table, w);
if (!w_data) {
- w_data = ecore_hash_new(NULL, NULL);
- ecore_hash_set(ewl_widget_data_table, w, w_data);
+ w_data = ecore_hash_new(NULL, NULL);
+ ecore_hash_set(ewl_widget_data_table, w, w_data);
}
ecore_hash_set(w_data, k, v);
@@ -551,7 +551,7 @@ ewl_widget_data_del(Ewl_Widget *w, void *k)
/* none of the widgets have data attached */
if (!ewl_widget_data_table)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
w_data = ecore_hash_get(ewl_widget_data_table, w);
@@ -561,11 +561,11 @@ ewl_widget_data_del(Ewl_Widget *w, void *k)
data = ecore_hash_remove(w_data, k);
if (ecore_hash_count(w_data) == 0) {
- ecore_hash_remove(ewl_widget_data_table, w);
- IF_FREE_HASH(w_data);
+ ecore_hash_remove(ewl_widget_data_table, w);
+ IF_FREE_HASH(w_data);
- if (ecore_hash_count(ewl_widget_data_table) == 0)
- IF_FREE_HASH(ewl_widget_data_table);
+ if (ecore_hash_count(ewl_widget_data_table) == 0)
+ IF_FREE_HASH(ewl_widget_data_table);
}
DRETURN_PTR(data, DLEVEL_STABLE);
@@ -592,7 +592,7 @@ ewl_widget_data_get(Ewl_Widget *w, void *k)
/* no widgets have data */
if (!ewl_widget_data_table)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
w_data = ecore_hash_get(ewl_widget_data_table, w);
if (w_data) data = ecore_hash_get(w_data, k);
@@ -619,7 +619,7 @@ ewl_widget_appearance_set(Ewl_Widget *w, const char *appearance)
/* make sure we have something to do */
if (w->appearance && !strcmp(appearance, w->appearance))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* The base appearance is used for determining the theme key of the
@@ -628,14 +628,14 @@ ewl_widget_appearance_set(Ewl_Widget *w, const char *appearance)
*/
w->appearance = ecore_string_instance(appearance);
if (!w->appearance)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Recreate the visible components of the widget if necessary.
*/
if (REALIZED(w)) {
- ewl_widget_unrealize(w);
- ewl_widget_realize(w);
+ ewl_widget_unrealize(w);
+ ewl_widget_realize(w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -679,8 +679,8 @@ ewl_widget_appearance_path_size_get(Ewl_Widget *w)
*/
size = 0;
while (w) {
- size += (w->appearance ? strlen(w->appearance) : 0) + 1;
- w = w->parent;
+ size += (w->appearance ? strlen(w->appearance) : 0) + 1;
+ w = w->parent;
}
size++;
@@ -705,15 +705,15 @@ ewl_widget_appearance_path_copy(Ewl_Widget *w, char *buf, int size)
len = (w->appearance ? strlen(w->appearance) : 0);
if (w->parent) {
- used += ewl_widget_appearance_path_copy(w->parent, buf,
- size - len);
+ used += ewl_widget_appearance_path_copy(w->parent, buf,
+ size - len);
}
*(buf + used) = '/';
used++;
used += ecore_strlcpy(buf + used,
- (w->appearance ? w->appearance : ""),
- size - used);
+ (w->appearance ? w->appearance : ""),
+ size - used);
DRETURN_INT(used, DLEVEL_STABLE);
}
@@ -766,14 +766,14 @@ ewl_widget_state_set(Ewl_Widget *w, const char *state, Ewl_State_Type flag)
* reference cached for later re-use.
*/
if (flag == EWL_STATE_PERSISTENT)
- w->theme_state = ecore_string_instance((char *)state);
+ w->theme_state = ecore_string_instance((char *)state);
if (w->theme_object) {
- if (ewl_config_cache.print_signals)
- printf("Emitting: %s to %p (%s)\n", state, w,
- w->appearance);
+ if (ewl_config_cache.print_signals)
+ printf("Emitting: %s to %p (%s)\n", state, w,
+ w->appearance);
- edje_object_signal_emit(w->theme_object, state, "EWL");
+ edje_object_signal_emit(w->theme_object, state, "EWL");
}
ev.state = state;
@@ -807,7 +807,7 @@ ewl_widget_parent_set(Ewl_Widget *w, Ewl_Widget *p)
/* check if our new parent is the same as our old parent */
op = EWL_CONTAINER(w->parent);
if (op == EWL_CONTAINER(p))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* if no parent, obsure the widget */
if (!p) ewl_widget_obscure(w);
@@ -820,11 +820,11 @@ ewl_widget_parent_set(Ewl_Widget *w, Ewl_Widget *p)
*/
tmp = p;
while (tmp) {
- if (tmp == w) {
- DWARNING("ERROR: Recursivly nested widgets.");
- DRETURN(DLEVEL_STABLE);
- }
- tmp = tmp->parent;
+ if (tmp == w) {
+ DWARNING("ERROR: Recursivly nested widgets.");
+ DRETURN(DLEVEL_STABLE);
+ }
+ tmp = tmp->parent;
}
/* set the parent to NULL before doing the child remove */
@@ -882,13 +882,13 @@ ewl_widget_appearance_part_text_apply(Ewl_Widget *w, const char *part, const cha
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!w->theme_object)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Fill in the default part to use when the key is NULL.
*/
if (!part || !*part)
- part = ewl_theme_data_str_get(w, "textpart");
+ part = ewl_theme_data_str_get(w, "textpart");
/*
* Set the text to empty if text is NULL. Edje defaults to using the
@@ -926,64 +926,64 @@ ewl_widget_appearance_part_text_set(Ewl_Widget *w, const char *part, const char
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (part && !*part)
- part = NULL;
+ part = NULL;
/*
* Check for an existing instance of the part key.
*/
if (w->theme_text.list) {
- if (w->theme_text.direct) {
- match = EWL_PAIR(w->theme_text.list);
- if (part != match->key ||
- (part && strcmp(part, match->key)))
- match = NULL;
- }
- else {
- for (i = 0; i < w->theme_text.len; i++) {
- Ewl_Pair *current = w->theme_text.list[i];
- if (part == current->key ||
- (part && !strcmp(current->key, part))) {
- match = current;
- break;
- }
- }
- }
+ if (w->theme_text.direct) {
+ match = EWL_PAIR(w->theme_text.list);
+ if (part != match->key ||
+ (part && strcmp(part, match->key)))
+ match = NULL;
+ }
+ else {
+ for (i = 0; i < w->theme_text.len; i++) {
+ Ewl_Pair *current = w->theme_text.list[i];
+ if (part == current->key ||
+ (part && !strcmp(current->key, part))) {
+ match = current;
+ break;
+ }
+ }
+ }
}
/*
* Part key exists and the value is the same as the current value.
*/
if (match) {
- if (text && match->value && !strcmp(text, match->value))
- DRETURN(DLEVEL_STABLE);
+ if (text && match->value && !strcmp(text, match->value))
+ DRETURN(DLEVEL_STABLE);
- IF_FREE(match->value);
+ IF_FREE(match->value);
}
else {
- match = NEW(Ewl_Pair, 1);
- if (!match) DRETURN(DLEVEL_STABLE);
-
- if (part) match->key = ecore_string_instance(part);
- else match->key = NULL;
- w->theme_text.len++;
-
- if (!w->theme_text.list) {
- w->theme_text.direct = 1;
- w->theme_text.list = (Ewl_Pair **)match;
- }
- else {
- if (w->theme_text.direct) {
- Ewl_Pair *old = EWL_PAIR(w->theme_text.list);
- w->theme_text.list = NEW(Ewl_Pair *, 2);
- w->theme_text.list[0] = old;
- }
- else {
- w->theme_text.list = realloc(w->theme_text.list,
- sizeof(Ewl_Pair) *
- w->theme_text.len);
- }
- w->theme_text.list[w->theme_text.len - 1] = match;
- }
+ match = NEW(Ewl_Pair, 1);
+ if (!match) DRETURN(DLEVEL_STABLE);
+
+ if (part) match->key = ecore_string_instance(part);
+ else match->key = NULL;
+ w->theme_text.len++;
+
+ if (!w->theme_text.list) {
+ w->theme_text.direct = 1;
+ w->theme_text.list = (Ewl_Pair **)match;
+ }
+ else {
+ if (w->theme_text.direct) {
+ Ewl_Pair *old = EWL_PAIR(w->theme_text.list);
+ w->theme_text.list = NEW(Ewl_Pair *, 2);
+ w->theme_text.list[0] = old;
+ }
+ else {
+ w->theme_text.list = realloc(w->theme_text.list,
+ sizeof(Ewl_Pair) *
+ w->theme_text.len);
+ }
+ w->theme_text.list[w->theme_text.len - 1] = match;
+ }
}
/*
@@ -1023,24 +1023,24 @@ ewl_widget_appearance_part_text_get(Ewl_Widget *w, const char *part)
* Check for an existing instance of the part key.
*/
if (w->theme_text.list) {
- if (w->theme_text.direct) {
- match = EWL_PAIR(w->theme_text.list);
- if (part != match->key &&
- (part && match->key &&
- strcmp(part, match->key)))
- match = NULL;
- }
- else {
- for (i = 0; i < w->theme_text.len; i++) {
- Ewl_Pair *current = w->theme_text.list[i];
- if (part == match->key ||
- (part && match->key &&
- !strcmp(part, match->key))) {
- match = current;
- break;
- }
- }
- }
+ if (w->theme_text.direct) {
+ match = EWL_PAIR(w->theme_text.list);
+ if (part != match->key &&
+ (part && match->key &&
+ strcmp(part, match->key)))
+ match = NULL;
+ }
+ else {
+ for (i = 0; i < w->theme_text.len; i++) {
+ Ewl_Pair *current = w->theme_text.list[i];
+ if (part == match->key ||
+ (part && match->key &&
+ !strcmp(part, match->key))) {
+ match = current;
+ break;
+ }
+ }
+ }
}
DRETURN_PTR((match ? match->value : NULL), DLEVEL_STABLE);
@@ -1109,9 +1109,9 @@ ewl_widget_enable(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DISABLED(w)) {
- ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAGS_STATE_MASK);
- ewl_object_state_add(EWL_OBJECT(w), EWL_FLAG_STATE_NORMAL);
- ewl_callback_call(w, EWL_CALLBACK_WIDGET_ENABLE);
+ ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAGS_STATE_MASK);
+ ewl_object_state_add(EWL_OBJECT(w), EWL_FLAG_STATE_NORMAL);
+ ewl_callback_call(w, EWL_CALLBACK_WIDGET_ENABLE);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1132,9 +1132,9 @@ ewl_widget_disable(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!DISABLED(w)) {
- ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAGS_STATE_MASK);
- ewl_object_state_add(EWL_OBJECT(w), EWL_FLAG_STATE_DISABLED);
- ewl_callback_call(w, EWL_CALLBACK_WIDGET_DISABLE);
+ ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAGS_STATE_MASK);
+ ewl_object_state_add(EWL_OBJECT(w), EWL_FLAG_STATE_DISABLED);
+ ewl_callback_call(w, EWL_CALLBACK_WIDGET_DISABLE);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1193,13 +1193,13 @@ ewl_widget_layer_top_set(Ewl_Widget *w, int top)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (w->toplayered == top)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
w->toplayered = top;
if (REALIZED(w)) {
- ewl_widget_layer_stack_add(w);
- ewl_widget_layer_update(w);
+ ewl_widget_layer_stack_add(w);
+ ewl_widget_layer_update(w);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1372,13 +1372,13 @@ ewl_widget_ignore_focus_change_set(Ewl_Widget *w, unsigned int val)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (val)
- ewl_object_flags_add(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
- EWL_FLAGS_PROPERTY_MASK);
+ ewl_object_flags_add(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
+ EWL_FLAGS_PROPERTY_MASK);
else
- ewl_object_flags_remove(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
- EWL_FLAGS_PROPERTY_MASK);
+ ewl_object_flags_remove(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
+ EWL_FLAGS_PROPERTY_MASK);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1396,9 +1396,9 @@ ewl_widget_ignore_focus_change_get(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, FALSE);
if (ewl_object_flags_has(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
- EWL_FLAGS_PROPERTY_MASK))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
+ EWL_FLAGS_PROPERTY_MASK))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -1417,13 +1417,13 @@ ewl_widget_focusable_set(Ewl_Widget *w, unsigned int val)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (val)
- ewl_object_flags_add(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_FOCUSABLE,
- EWL_FLAGS_PROPERTY_MASK);
+ ewl_object_flags_add(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_FOCUSABLE,
+ EWL_FLAGS_PROPERTY_MASK);
else
- ewl_object_flags_remove(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_FOCUSABLE,
- EWL_FLAGS_PROPERTY_MASK);
+ ewl_object_flags_remove(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_FOCUSABLE,
+ EWL_FLAGS_PROPERTY_MASK);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1441,9 +1441,9 @@ ewl_widget_focusable_get(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, FALSE);
if (ewl_object_flags_has(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_FOCUSABLE,
- EWL_FLAGS_PROPERTY_MASK))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ EWL_FLAG_PROPERTY_FOCUSABLE,
+ EWL_FLAGS_PROPERTY_MASK))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -1463,13 +1463,13 @@ ewl_widget_tree_print(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
while (w) {
- for (j = 0; j < i; j++)
- printf("\t");
+ for (j = 0; j < i; j++)
+ printf("\t");
- ewl_widget_print(w);
+ ewl_widget_print(w);
- w = w->parent;
- i++;
+ w = w->parent;
+ i++;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1488,15 +1488,15 @@ ewl_widget_print(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
printf("%p:%s geometry (%d, %d) %d x %d\n\t%s, %s, %s, %s\n",
- w, w->appearance,
- ewl_object_current_x_get(EWL_OBJECT(w)),
- ewl_object_current_y_get(EWL_OBJECT(w)),
- ewl_object_current_w_get(EWL_OBJECT(w)),
- ewl_object_current_h_get(EWL_OBJECT(w)),
- (VISIBLE(w) ? "visible" : "not visible"),
- (REALIZED(w) ? "realized" : "not realized"),
- (DESTROYED(w) ? "destroyed" : "not destroyed"),
- (DISABLED(w) ? "disabled" : "enabled"));
+ w, w->appearance,
+ ewl_object_current_x_get(EWL_OBJECT(w)),
+ ewl_object_current_y_get(EWL_OBJECT(w)),
+ ewl_object_current_w_get(EWL_OBJECT(w)),
+ ewl_object_current_h_get(EWL_OBJECT(w)),
+ (VISIBLE(w) ? "visible" : "not visible"),
+ (REALIZED(w) ? "realized" : "not realized"),
+ (DESTROYED(w) ? "destroyed" : "not destroyed"),
+ (DISABLED(w) ? "disabled" : "enabled"));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1519,41 +1519,41 @@ ewl_widget_print_verbose(Ewl_Widget *w)
ewl_widget_print(w);
printf("\tPreferred size: %dx%d",
- ewl_object_preferred_w_get(EWL_OBJECT(w)),
- ewl_object_preferred_h_get(EWL_OBJECT(w)));
+ ewl_object_preferred_w_get(EWL_OBJECT(w)),
+ ewl_object_preferred_h_get(EWL_OBJECT(w)));
printf("\tMinimum size: %dx%d",
- ewl_object_minimum_w_get(EWL_OBJECT(w)),
- ewl_object_minimum_h_get(EWL_OBJECT(w)));
+ ewl_object_minimum_w_get(EWL_OBJECT(w)),
+ ewl_object_minimum_h_get(EWL_OBJECT(w)));
printf("\tMaximum size: %dx%d\n",
- ewl_object_maximum_w_get(EWL_OBJECT(w)),
- ewl_object_maximum_h_get(EWL_OBJECT(w)));
+ ewl_object_maximum_w_get(EWL_OBJECT(w)),
+ ewl_object_maximum_h_get(EWL_OBJECT(w)));
printf("\tInsets: %d, %d, %d, %d\n",
- ewl_object_insets_left_get(EWL_OBJECT(w)),
- ewl_object_insets_right_get(EWL_OBJECT(w)),
- ewl_object_insets_top_get(EWL_OBJECT(w)),
- ewl_object_insets_bottom_get(EWL_OBJECT(w)));
+ ewl_object_insets_left_get(EWL_OBJECT(w)),
+ ewl_object_insets_right_get(EWL_OBJECT(w)),
+ ewl_object_insets_top_get(EWL_OBJECT(w)),
+ ewl_object_insets_bottom_get(EWL_OBJECT(w)));
printf("\tPadding: %d, %d, %d, %d\n",
- ewl_object_padding_left_get(EWL_OBJECT(w)),
- ewl_object_padding_right_get(EWL_OBJECT(w)),
- ewl_object_padding_top_get(EWL_OBJECT(w)),
- ewl_object_padding_bottom_get(EWL_OBJECT(w)));
+ ewl_object_padding_left_get(EWL_OBJECT(w)),
+ ewl_object_padding_right_get(EWL_OBJECT(w)),
+ ewl_object_padding_top_get(EWL_OBJECT(w)),
+ ewl_object_padding_bottom_get(EWL_OBJECT(w)));
printf("\tFill policy:");
if (!flags)
- printf(" NONE");
+ printf(" NONE");
else {
- if (flags & EWL_FLAG_FILL_HSHRINK)
- printf(" HSHRINK");
+ if (flags & EWL_FLAG_FILL_HSHRINK)
+ printf(" HSHRINK");
- if (flags & EWL_FLAG_FILL_HFILL)
- printf(" HFILL");
+ if (flags & EWL_FLAG_FILL_HFILL)
+ printf(" HFILL");
- if (flags & EWL_FLAG_FILL_VSHRINK)
- printf(" VSHRINK");
+ if (flags & EWL_FLAG_FILL_VSHRINK)
+ printf(" VSHRINK");
- if (flags & EWL_FLAG_FILL_VFILL)
- printf(" VFILL");
+ if (flags & EWL_FLAG_FILL_VFILL)
+ printf(" VFILL");
}
printf("\n");
@@ -1561,20 +1561,20 @@ ewl_widget_print_verbose(Ewl_Widget *w)
printf("\tAlignment:");
if (!flags)
- printf(" CENTER");
+ printf(" CENTER");
else {
- if (flags & EWL_FLAG_ALIGN_LEFT)
- printf(" LEFT");
+ if (flags & EWL_FLAG_ALIGN_LEFT)
+ printf(" LEFT");
- if (flags & EWL_FLAG_ALIGN_RIGHT)
- printf(" RIGHT");
+ if (flags & EWL_FLAG_ALIGN_RIGHT)
+ printf(" RIGHT");
- if (flags & EWL_FLAG_ALIGN_TOP)
- printf(" TOP");
+ if (flags & EWL_FLAG_ALIGN_TOP)
+ printf(" TOP");
- if (flags & EWL_FLAG_ALIGN_BOTTOM)
- printf(" BOTTOM");
+ if (flags & EWL_FLAG_ALIGN_BOTTOM)
+ printf(" BOTTOM");
}
printf("\n");
@@ -1601,12 +1601,12 @@ ewl_widget_internal_set(Ewl_Widget *w, unsigned int val)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (val)
- ewl_object_flags_add(EWL_OBJECT(w), EWL_FLAG_PROPERTY_INTERNAL,
- EWL_FLAGS_PROPERTY_MASK);
+ ewl_object_flags_add(EWL_OBJECT(w), EWL_FLAG_PROPERTY_INTERNAL,
+ EWL_FLAGS_PROPERTY_MASK);
else
- ewl_object_flags_remove(EWL_OBJECT(w),
- EWL_FLAG_PROPERTY_INTERNAL,
- EWL_FLAGS_PROPERTY_MASK);
+ ewl_object_flags_remove(EWL_OBJECT(w),
+ EWL_FLAG_PROPERTY_INTERNAL,
+ EWL_FLAGS_PROPERTY_MASK);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1635,9 +1635,9 @@ ewl_widget_unmanaged_set(Ewl_Widget *w, unsigned int val)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (w->parent) {
- DWARNING("It is not possible to change the unmanage state "
- "of a widget that has already a parent!\n");
- DRETURN(DLEVEL_STABLE);
+ DWARNING("It is not possible to change the unmanage state "
+ "of a widget that has already a parent!\n");
+ DRETURN(DLEVEL_STABLE);
}
w->unmanaged = !!val;
@@ -1671,29 +1671,29 @@ ewl_widget_inherit(Ewl_Widget *widget, const char *inherit)
tmp = alloca(sizeof(char) * len);
if (tmp) {
- size_t used = 0;
+ size_t used = 0;
- /* Copy the existing inherited types */
- if (tmp2) used = ecore_strlcpy(tmp, tmp2, len);
+ /* Copy the existing inherited types */
+ if (tmp2) used = ecore_strlcpy(tmp, tmp2, len);
- /* Insert the leading colon */
- if (used < len - 1) {
- *(tmp + used) = ':';
- used++;
- }
+ /* Insert the leading colon */
+ if (used < len - 1) {
+ *(tmp + used) = ':';
+ used++;
+ }
- /* Copy newly inherited type */
- if (used < len)
- used += ecore_strlcpy(tmp + used, inherit, len - used);
+ /* Copy newly inherited type */
+ if (used < len)
+ used += ecore_strlcpy(tmp + used, inherit, len - used);
- /* Insert trailing colon */
- if (used < len - 1) {
- *(tmp + used) = ':';
- used++;
- }
+ /* Insert trailing colon */
+ if (used < len - 1) {
+ *(tmp + used) = ':';
+ used++;
+ }
- /* Terminate the string */
- *(tmp + used) = '\0';
+ /* Terminate the string */
+ *(tmp + used) = '\0';
}
/*
@@ -1724,34 +1724,34 @@ ewl_widget_type_is(Ewl_Widget *widget, const char *type)
if (widget->inheritance)
{
- char *match, *end;
-
- match = (char *)widget->inheritance;
- end = match + 1;
-
- while (*end != '\0')
- {
- int count = 0;
-
- /* while the type still matches the current part of
- * the string */
- while ((*end != ':') && (*(type + count) == *end))
- {
- count ++;
- end ++;
- }
-
- /* if we ended with the : then this is a match */
- if ((*end == ':') && (*(type + count) == '\0'))
- {
- found = TRUE;
- break;
- }
-
- /* move to the next set of :s and then move past it */
- while ((*end != '\0') && (*end != ':')) end ++;
- if ((*end == ':') && (*(++end) == ':')) end++;
- }
+ char *match, *end;
+
+ match = (char *)widget->inheritance;
+ end = match + 1;
+
+ while (*end != '\0')
+ {
+ int count = 0;
+
+ /* while the type still matches the current part of
+ * the string */
+ while ((*end != ':') && (*(type + count) == *end))
+ {
+ count ++;
+ end ++;
+ }
+
+ /* if we ended with the : then this is a match */
+ if ((*end == ':') && (*(type + count) == '\0'))
+ {
+ found = TRUE;
+ break;
+ }
+
+ /* move to the next set of :s and then move past it */
+ while ((*end != '\0') && (*end != ':')) end ++;
+ if ((*end == ':') && (*(++end) == ':')) end++;
+ }
}
DRETURN_INT(found, DLEVEL_STABLE);
@@ -1771,8 +1771,8 @@ ewl_widget_internal_is(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, FALSE);
if (ewl_object_flags_has(EWL_OBJECT(w), EWL_FLAG_PROPERTY_INTERNAL,
- EWL_FLAGS_PROPERTY_MASK))
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ EWL_FLAGS_PROPERTY_MASK))
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
DRETURN_INT(FALSE, DLEVEL_STABLE);
}
@@ -1821,67 +1821,67 @@ ewl_widget_onscreen_is(Ewl_Widget *w)
* top level container.
*/
if (w->parent) {
- int x = 0, y = 0;
- int width = 0, height = 0;
- Ewl_Widget *p = w->parent;
-
- /*
- * Check if widget is right of the visible area.
- */
- x = ewl_object_current_x_get(EWL_OBJECT(w));
- if (x > (CURRENT_X(p) + CURRENT_W(p)))
- onscreen = FALSE;
-
- if (onscreen) {
- if (x > (CURRENT_X(emb) + CURRENT_W(emb)))
- onscreen = FALSE;
- }
-
- /*
- * Check if widget is below the visible area.
- */
- if (onscreen) {
- y = ewl_object_current_y_get(EWL_OBJECT(w));
- if (y > (CURRENT_Y(p) + CURRENT_H(p)))
- onscreen = FALSE;
- }
-
- if (onscreen) {
- if (y > (CURRENT_Y(emb) + CURRENT_H(emb)))
- onscreen = FALSE;
- }
-
- /*
- * Check if widget is left of visible area.
- */
- if (onscreen) {
- width = ewl_object_current_w_get(EWL_OBJECT(w));
- if ((x + width) < CURRENT_X(p))
- onscreen = FALSE;
- }
-
- if (onscreen) {
- if ((x + width) < CURRENT_X(emb))
- onscreen = FALSE;
- }
-
- /*
- * Check if widget is above visible area.
- */
- if (onscreen) {
- height = ewl_object_current_h_get(EWL_OBJECT(w));
- if ((y + height) < CURRENT_Y(p))
- onscreen = FALSE;
- }
-
- if (onscreen) {
- if ((y + height) < CURRENT_Y(emb))
- onscreen = FALSE;
- }
+ int x = 0, y = 0;
+ int width = 0, height = 0;
+ Ewl_Widget *p = w->parent;
+
+ /*
+ * Check if widget is right of the visible area.
+ */
+ x = ewl_object_current_x_get(EWL_OBJECT(w));
+ if (x > (CURRENT_X(p) + CURRENT_W(p)))
+ onscreen = FALSE;
+
+ if (onscreen) {
+ if (x > (CURRENT_X(emb) + CURRENT_W(emb)))
+ onscreen = FALSE;
+ }
+
+ /*
+ * Check if widget is below the visible area.
+ */
+ if (onscreen) {
+ y = ewl_object_current_y_get(EWL_OBJECT(w));
+ if (y > (CURRENT_Y(p) + CURRENT_H(p)))
+ onscreen = FALSE;
+ }
+
+ if (onscreen) {
+ if (y > (CURRENT_Y(emb) + CURRENT_H(emb)))
+ onscreen = FALSE;
+ }
+
+ /*
+ * Check if widget is left of visible area.
+ */
+ if (onscreen) {
+ width = ewl_object_current_w_get(EWL_OBJECT(w));
+ if ((x + width) < CURRENT_X(p))
+ onscreen = FALSE;
+ }
+
+ if (onscreen) {
+ if ((x + width) < CURRENT_X(emb))
+ onscreen = FALSE;
+ }
+
+ /*
+ * Check if widget is above visible area.
+ */
+ if (onscreen) {
+ height = ewl_object_current_h_get(EWL_OBJECT(w));
+ if ((y + height) < CURRENT_Y(p))
+ onscreen = FALSE;
+ }
+
+ if (onscreen) {
+ if ((y + height) < CURRENT_Y(emb))
+ onscreen = FALSE;
+ }
}
if (onscreen == TRUE && w->parent) {
- if ((ewl_widget_onscreen_is(w->parent) == FALSE)) onscreen = FALSE;
+ if ((ewl_widget_onscreen_is(w->parent) == FALSE)) onscreen = FALSE;
}
DRETURN_INT(onscreen, DLEVEL_STABLE);
@@ -1901,30 +1901,30 @@ ewl_widget_clipped_set(Ewl_Widget *w, unsigned int val)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (val)
- ewl_object_flags_remove(EWL_OBJECT(w), EWL_FLAG_VISIBLE_NOCLIP,
- EWL_FLAGS_VISIBLE_MASK);
+ ewl_object_flags_remove(EWL_OBJECT(w), EWL_FLAG_VISIBLE_NOCLIP,
+ EWL_FLAGS_VISIBLE_MASK);
else
- ewl_object_flags_add(EWL_OBJECT(w), EWL_FLAG_VISIBLE_NOCLIP,
- EWL_FLAGS_VISIBLE_MASK);
+ ewl_object_flags_add(EWL_OBJECT(w), EWL_FLAG_VISIBLE_NOCLIP,
+ EWL_FLAGS_VISIBLE_MASK);
if (!REALIZED(w) || (val && w->fx_clip_box) ||
- (!val && !w->fx_clip_box))
- DRETURN(DLEVEL_STABLE);
+ (!val && !w->fx_clip_box))
+ DRETURN(DLEVEL_STABLE);
if (val) {
- Ewl_Embed *emb;
+ Ewl_Embed *emb;
- emb = ewl_embed_widget_find(w);
- if (!emb || !emb->canvas)
- DRETURN(DLEVEL_STABLE);
+ emb = ewl_embed_widget_find(w);
+ if (!emb || !emb->canvas)
+ DRETURN(DLEVEL_STABLE);
- w->fx_clip_box = evas_object_rectangle_add(emb->canvas);
- evas_object_pass_events_set(w->fx_clip_box, TRUE);
- ewl_widget_configure(w);
+ w->fx_clip_box = evas_object_rectangle_add(emb->canvas);
+ evas_object_pass_events_set(w->fx_clip_box, TRUE);
+ ewl_widget_configure(w);
}
else {
- ewl_canvas_object_destroy(w->fx_clip_box);
- w->fx_clip_box = NULL;
+ ewl_canvas_object_destroy(w->fx_clip_box);
+ w->fx_clip_box = NULL;
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1943,8 +1943,8 @@ ewl_widget_clipped_is(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, FALSE);
if (ewl_object_flags_has(EWL_OBJECT(w), EWL_FLAG_VISIBLE_NOCLIP,
- EWL_FLAGS_VISIBLE_MASK))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ EWL_FLAGS_VISIBLE_MASK))
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
DRETURN_INT(TRUE, DLEVEL_STABLE);
}
@@ -1968,8 +1968,8 @@ ewl_widget_parent_of(Ewl_Widget *c, Ewl_Widget *w)
parent = w;
while ((parent = parent->parent)) {
- if (parent == c)
- DRETURN_INT(TRUE, DLEVEL_STABLE);
+ if (parent == c)
+ DRETURN_INT(TRUE, DLEVEL_STABLE);
}
DRETURN_INT(FALSE, DLEVEL_STABLE);
@@ -2027,7 +2027,7 @@ ewl_widget_focused_get(void)
*/
void
ewl_widget_color_set(Ewl_Widget *w, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a)
+ unsigned int b, unsigned int a)
{
Ewl_Color_Set *color;
@@ -2043,7 +2043,7 @@ ewl_widget_color_set(Ewl_Widget *w, unsigned int r, unsigned int g,
ewl_attach_color_set(w, color);
if (w->fx_clip_box)
- evas_object_color_set(w->fx_clip_box, r, g, b, a);
+ evas_object_color_set(w->fx_clip_box, r, g, b, a);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2059,7 +2059,7 @@ ewl_widget_color_set(Ewl_Widget *w, unsigned int r, unsigned int g,
*/
void
ewl_widget_color_get(Ewl_Widget *w, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a)
+ unsigned int *b, unsigned int *a)
{
Ewl_Color_Set *color;
@@ -2088,27 +2088,27 @@ ewl_widget_layer_stack_add(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (w->parent && !REVEALED(w->parent))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (w->parent && !w->toplayered)
- smart_parent = w->parent->smart_object;
+ smart_parent = w->parent->smart_object;
else {
- Ewl_Embed *emb;
+ Ewl_Embed *emb;
- emb = ewl_embed_widget_find(w);
- smart_parent = emb->smart;
+ emb = ewl_embed_widget_find(w);
+ smart_parent = emb->smart;
}
evas_object_smart_member_add(w->smart_object, smart_parent);
if (w->theme_object)
- evas_object_smart_member_add(w->theme_object, w->smart_object);
+ evas_object_smart_member_add(w->theme_object, w->smart_object);
if (w->fx_clip_box)
- evas_object_smart_member_add(w->fx_clip_box, w->smart_object);
+ evas_object_smart_member_add(w->fx_clip_box, w->smart_object);
if (w->theme_object && w->fx_clip_box)
- evas_object_stack_below(w->theme_object, w->fx_clip_box);
+ evas_object_stack_below(w->theme_object, w->fx_clip_box);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2124,38 +2124,38 @@ ewl_widget_layer_update(Ewl_Widget *w)
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (!(p = w->parent))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/* check first if the widget should be on the top */
if (w->toplayered)
{
- evas_object_raise(w->smart_object);
- DRETURN(DLEVEL_STABLE);
+ evas_object_raise(w->smart_object);
+ DRETURN(DLEVEL_STABLE);
}
layer = ewl_widget_layer_priority_get(w);
if (layer == 0)
- evas_object_stack_above(w->smart_object, p->fx_clip_box);
+ evas_object_stack_above(w->smart_object, p->fx_clip_box);
else if (layer > 0) {
- Evas_Object *above;
-
- if (!(above = ewl_widget_layer_neighbor_find_above(w)))
- {
- DWARNING("No object to stack above.");
- DRETURN(DLEVEL_STABLE);
- }
- evas_object_stack_above(w->smart_object, above);
+ Evas_Object *above;
+
+ if (!(above = ewl_widget_layer_neighbor_find_above(w)))
+ {
+ DWARNING("No object to stack above.");
+ DRETURN(DLEVEL_STABLE);
+ }
+ evas_object_stack_above(w->smart_object, above);
}
else {
- Evas_Object *below;
-
- if (!(below = ewl_widget_layer_neighbor_find_below(w)))
- {
- DWARNING("No object to stack below.");
- DRETURN(DLEVEL_STABLE);
- }
- evas_object_stack_below(w->smart_object, below);
+ Evas_Object *below;
+
+ if (!(below = ewl_widget_layer_neighbor_find_below(w)))
+ {
+ DWARNING("No object to stack below.");
+ DRETURN(DLEVEL_STABLE);
+ }
+ evas_object_stack_below(w->smart_object, below);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2171,26 +2171,26 @@ ewl_widget_layer_neighbor_find_above(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, NULL);
if (!w->parent)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
o = ol = w->parent->fx_clip_box;
while ((o = evas_object_above_get(o)))
{
- Ewl_Widget *found;
-
- found = evas_object_data_get(o, "EWL");
- /*
- * Perhaps it is a cached object so no reason to stop iterating
- */
- if (found) {
- /* ignore the widget itself */
- if (w == found) continue;
- if (ewl_widget_layer_priority_get(w) <=
- ewl_widget_layer_priority_get(found))
- break;
- ol = o;
- }
+ Ewl_Widget *found;
+
+ found = evas_object_data_get(o, "EWL");
+ /*
+ * Perhaps it is a cached object so no reason to stop iterating
+ */
+ if (found) {
+ /* ignore the widget itself */
+ if (w == found) continue;
+ if (ewl_widget_layer_priority_get(w) <=
+ ewl_widget_layer_priority_get(found))
+ break;
+ ol = o;
+ }
}
DRETURN_PTR(ol, DLEVEL_STABLE);
@@ -2206,26 +2206,26 @@ ewl_widget_layer_neighbor_find_below(Ewl_Widget *w)
DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, NULL);
if (!w->parent)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
o = ol = w->parent->fx_clip_box;
while ((o = evas_object_below_get(o)))
{
- Ewl_Widget *found;
-
- found = evas_object_data_get(o, "EWL");
- /*
- * Perhaps it is a cached object so no reason to stop iterating
- */
- if (found) {
- /* ignore the widget itself */
- if (w == found) continue;
- if (ewl_widget_layer_priority_get(w) >=
- ewl_widget_layer_priority_get(found))
- break;
- ol = o;
- }
+ Ewl_Widget *found;
+
+ found = evas_object_data_get(o, "EWL");
+ /*
+ * Perhaps it is a cached object so no reason to stop iterating
+ */
+ if (found) {
+ /* ignore the widget itself */
+ if (w == found) continue;
+ if (ewl_widget_layer_priority_get(w) >=
+ ewl_widget_layer_priority_get(found))
+ break;
+ ol = o;
+ }
}
DRETURN_PTR(ol, DLEVEL_STABLE);
@@ -2249,9 +2249,9 @@ ewl_widget_free(Ewl_Widget *w)
*/
if (w->attach)
{
- ewl_attach_list_del(w->attach, EWL_ATTACH_TYPE_TOOLTIP);
- ewl_attach_list_del(w->attach, EWL_ATTACH_TYPE_COLOR);
- ewl_attach_list_del(w->attach, EWL_ATTACH_TYPE_NAME);
+ ewl_attach_list_del(w->attach, EWL_ATTACH_TYPE_TOOLTIP);
+ ewl_attach_list_del(w->attach, EWL_ATTACH_TYPE_COLOR);
+ ewl_attach_list_del(w->attach, EWL_ATTACH_TYPE_NAME);
}
/*
@@ -2264,30 +2264,30 @@ ewl_widget_free(Ewl_Widget *w)
IF_RELEASE(w->theme_state);
if (w->theme_text.list) {
- if (w->theme_text.direct) {
- Ewl_Pair *pair = EWL_PAIR(w->theme_text.list);
- IF_RELEASE(pair->key);
- FREE(EWL_PAIR(w->theme_text.list)->value);
- }
- else {
- unsigned int i;
- for (i = 0; i < w->theme_text.len; i++) {
- Ewl_Pair *pair = EWL_PAIR(w->theme_text.list[i]);
- IF_RELEASE(pair->key);
- FREE(w->theme_text.list[i]->value);
- FREE(w->theme_text.list[i]);
- }
- }
-
- FREE(w->theme_text.list);
- w->theme_text.len = 0;
+ if (w->theme_text.direct) {
+ Ewl_Pair *pair = EWL_PAIR(w->theme_text.list);
+ IF_RELEASE(pair->key);
+ FREE(EWL_PAIR(w->theme_text.list)->value);
+ }
+ else {
+ unsigned int i;
+ for (i = 0; i < w->theme_text.len; i++) {
+ Ewl_Pair *pair = EWL_PAIR(w->theme_text.list[i]);
+ IF_RELEASE(pair->key);
+ FREE(w->theme_text.list[i]->value);
+ FREE(w->theme_text.list[i]);
+ }
+ }
+
+ FREE(w->theme_text.list);
+ w->theme_text.len = 0;
}
if (ewl_widget_data_table) {
- Ecore_Hash *w_data;
+ Ecore_Hash *w_data;
- w_data = ecore_hash_remove(ewl_widget_data_table, w);
- IF_FREE_HASH(w_data);
+ w_data = ecore_hash_remove(ewl_widget_data_table, w);
+ IF_FREE_HASH(w_data);
}
FREE(w);
@@ -2305,7 +2305,7 @@ ewl_widget_free(Ewl_Widget *w)
*/
void
ewl_widget_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Container *pc;
@@ -2335,7 +2335,7 @@ ewl_widget_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_hide(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Container *pc;
Ewl_Embed *emb;
@@ -2368,7 +2368,7 @@ ewl_widget_cb_hide(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *emb;
@@ -2377,124 +2377,124 @@ ewl_widget_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
emb = ewl_embed_widget_find(w);
if (!emb || !emb->canvas)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Increment the dnd awareness counter on the embed.
*/
if (ewl_object_flags_has(EWL_OBJECT(w), EWL_FLAG_PROPERTY_DND_TARGET,
- EWL_FLAGS_PROPERTY_MASK))
- ewl_embed_dnd_aware_set(emb);
+ EWL_FLAGS_PROPERTY_MASK))
+ ewl_embed_dnd_aware_set(emb);
/*
* Smart Object allocation
*/
if (!w->smart_object) {
- /*
- * Attempt to load a cached object first, fallback to adding a
- * new one.
- */
- w->smart_object = ewl_embed_object_request(emb, "Ewl Widget Smart Object");
- if (!w->smart_object) {
- if (!widget_smart) {
- static const Evas_Smart_Class sc = {
- "Ewl Widget Smart Object",
- EVAS_SMART_CLASS_VERSION,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL
- };
- widget_smart = evas_smart_class_new(&sc);
- }
- w->smart_object = evas_object_smart_add(emb->canvas, widget_smart);
- }
- evas_object_data_set(w->smart_object, "EWL", w);
+ /*
+ * Attempt to load a cached object first, fallback to adding a
+ * new one.
+ */
+ w->smart_object = ewl_embed_object_request(emb, "Ewl Widget Smart Object");
+ if (!w->smart_object) {
+ if (!widget_smart) {
+ static const Evas_Smart_Class sc = {
+ "Ewl Widget Smart Object",
+ EVAS_SMART_CLASS_VERSION,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL
+ };
+ widget_smart = evas_smart_class_new(&sc);
+ }
+ w->smart_object = evas_object_smart_add(emb->canvas, widget_smart);
+ }
+ evas_object_data_set(w->smart_object, "EWL", w);
}
/*
* No object allocated yet for this widget
*/
if (!w->theme_object && w->theme_path && w->theme_group) {
- /*
- * Attempt to load a cached object first, fallback to adding a
- * new one.
- */
- w->theme_object = ewl_embed_object_request(emb, "edje");
- if (!w->theme_object)
- w->theme_object = edje_object_add(emb->canvas);
-
- /*
- * Attempt to load the theme object
- */
- evas_object_repeat_events_set(w->theme_object, 1);
- if (!edje_object_file_set(w->theme_object, w->theme_path, w->theme_group))
- DWARNING("Error setting edje object %s, %s.",
- w->theme_path, w->theme_group);
-
- /*
- * If the file failed to load, destroy the unnecessary evas
- * object.
- */
- if (edje_object_load_error_get(w->theme_object)) {
- evas_object_del(w->theme_object);
- w->theme_object = NULL;
- }
-
- /*
- * Set the state of the theme object
- */
- if (w->theme_state)
- ewl_widget_state_set(w, (char *)w->theme_state,
- EWL_STATE_PERSISTENT);
-
- if (DISABLED(w))
- ewl_widget_state_set(w, "disabled",
- EWL_STATE_PERSISTENT);
-
- /*
- * Apply any text overrides
- */
- if (w->theme_object && w->theme_text.list) {
- const char *key;
- char *value;
-
- if (w->theme_text.direct) {
- key = EWL_PAIR(w->theme_text.list)->key;
- value = EWL_PAIR(w->theme_text.list)->value;
- ewl_widget_appearance_part_text_apply(w, key, value);
- }
- else {
- unsigned int i;
- for (i = 0; i < w->theme_text.len; i++) {
- key = w->theme_text.list[i]->key;
- value = w->theme_text.list[i]->value;
- ewl_widget_appearance_part_text_apply(w, key, value);
- }
- }
- }
+ /*
+ * Attempt to load a cached object first, fallback to adding a
+ * new one.
+ */
+ w->theme_object = ewl_embed_object_request(emb, "edje");
+ if (!w->theme_object)
+ w->theme_object = edje_object_add(emb->canvas);
+
+ /*
+ * Attempt to load the theme object
+ */
+ evas_object_repeat_events_set(w->theme_object, 1);
+ if (!edje_object_file_set(w->theme_object, w->theme_path, w->theme_group))
+ DWARNING("Error setting edje object %s, %s.",
+ w->theme_path, w->theme_group);
+
+ /*
+ * If the file failed to load, destroy the unnecessary evas
+ * object.
+ */
+ if (edje_object_load_error_get(w->theme_object)) {
+ evas_object_del(w->theme_object);
+ w->theme_object = NULL;
+ }
+
+ /*
+ * Set the state of the theme object
+ */
+ if (w->theme_state)
+ ewl_widget_state_set(w, (char *)w->theme_state,
+ EWL_STATE_PERSISTENT);
+
+ if (DISABLED(w))
+ ewl_widget_state_set(w, "disabled",
+ EWL_STATE_PERSISTENT);
+
+ /*
+ * Apply any text overrides
+ */
+ if (w->theme_object && w->theme_text.list) {
+ const char *key;
+ char *value;
+
+ if (w->theme_text.direct) {
+ key = EWL_PAIR(w->theme_text.list)->key;
+ value = EWL_PAIR(w->theme_text.list)->value;
+ ewl_widget_appearance_part_text_apply(w, key, value);
+ }
+ else {
+ unsigned int i;
+ for (i = 0; i < w->theme_text.len; i++) {
+ key = w->theme_text.list[i]->key;
+ value = w->theme_text.list[i]->value;
+ ewl_widget_appearance_part_text_apply(w, key, value);
+ }
+ }
+ }
}
/*
* Create clip box if necessary
*/
if (!w->fx_clip_box && !ewl_object_flags_get(EWL_OBJECT(w),
- EWL_FLAG_VISIBLE_NOCLIP)) {
- w->fx_clip_box = ewl_embed_object_request(emb, "rectangle");
- if (!w->fx_clip_box)
- w->fx_clip_box = evas_object_rectangle_add(emb->canvas);
+ EWL_FLAG_VISIBLE_NOCLIP)) {
+ w->fx_clip_box = ewl_embed_object_request(emb, "rectangle");
+ if (!w->fx_clip_box)
+ w->fx_clip_box = evas_object_rectangle_add(emb->canvas);
- evas_object_pass_events_set(w->fx_clip_box, TRUE);
+ evas_object_pass_events_set(w->fx_clip_box, TRUE);
}
if (w->theme_object && w->fx_clip_box)
- evas_object_clip_set(w->theme_object, w->fx_clip_box);
+ evas_object_clip_set(w->theme_object, w->fx_clip_box);
/*
* Setup the appropriate clippings.
*/
if (w->parent && EWL_CONTAINER(w->parent)->clip_box && w->fx_clip_box) {
- evas_object_clip_set(w->fx_clip_box,
- EWL_CONTAINER(w->parent)->clip_box);
- evas_object_show(EWL_CONTAINER(w->parent)->clip_box);
+ evas_object_clip_set(w->fx_clip_box,
+ EWL_CONTAINER(w->parent)->clip_box);
+ evas_object_show(EWL_CONTAINER(w->parent)->clip_box);
}
/*
@@ -2503,23 +2503,23 @@ ewl_widget_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
ewl_widget_layer_stack_add(w);
if (w->parent && REVEALED(w->parent))
- ewl_widget_layer_update(w);
+ ewl_widget_layer_update(w);
if (w->fx_clip_box) {
- Ewl_Color_Set *color;
+ Ewl_Color_Set *color;
- color = ewl_attach_color_get(w);
- if (color)
- evas_object_color_set(w->fx_clip_box, color->r,
- color->g, color->b, color->a);
+ color = ewl_attach_color_get(w);
+ if (color)
+ evas_object_color_set(w->fx_clip_box, color->r,
+ color->g, color->b, color->a);
}
/*
* Show the theme and clip box if widget is visible
*/
if (VISIBLE(w)) {
- if (w->fx_clip_box) evas_object_show(w->fx_clip_box);
- if (w->theme_object) evas_object_show(w->theme_object);
+ if (w->fx_clip_box) evas_object_show(w->fx_clip_box);
+ if (w->theme_object) evas_object_show(w->theme_object);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2535,7 +2535,7 @@ ewl_widget_cb_reveal(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *emb;
Ewl_Container *pc;
@@ -2552,16 +2552,16 @@ ewl_widget_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
* Decrement the dnd awareness counter on the embed.
*/
if (ewl_object_flags_has(EWL_OBJECT(w), EWL_FLAG_PROPERTY_DND_TARGET,
- EWL_FLAGS_PROPERTY_MASK))
- ewl_embed_dnd_aware_remove(emb);
+ EWL_FLAGS_PROPERTY_MASK))
+ ewl_embed_dnd_aware_remove(emb);
/*
* Remove all properties on the edje and hand it back to the embed for
* caching.
*/
if (w->theme_object) {
- ewl_embed_object_cache(emb, w->theme_object);
- w->theme_object = NULL;
+ ewl_embed_object_cache(emb, w->theme_object);
+ w->theme_object = NULL;
}
/*
@@ -2570,22 +2570,22 @@ ewl_widget_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
* will be a white rectangle displayed.
*/
if (w->fx_clip_box) {
- ewl_embed_object_cache(emb, w->fx_clip_box);
- w->fx_clip_box = NULL;
+ ewl_embed_object_cache(emb, w->fx_clip_box);
+ w->fx_clip_box = NULL;
}
if (w->smart_object) {
- evas_object_data_del(w->smart_object, "EWL");
- ewl_embed_object_cache(emb, w->smart_object);
- w->smart_object = NULL;
+ evas_object_data_del(w->smart_object, "EWL");
+ ewl_embed_object_cache(emb, w->smart_object);
+ w->smart_object = NULL;
}
/*
* This has to happen last to be sure we've removed all clipped parts
*/
if (pc && pc->clip_box) {
- if (!evas_object_clipees_get(pc->clip_box))
- evas_object_hide(pc->clip_box);
+ if (!evas_object_clipees_get(pc->clip_box))
+ evas_object_hide(pc->clip_box);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2601,7 +2601,7 @@ ewl_widget_cb_obscure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
int l = 0, r = 0, t = 0, b = 0;
int i_l = 0, i_r = 0, i_t = 0, i_b = 0;
@@ -2623,17 +2623,17 @@ ewl_widget_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
i = ewl_theme_image_get(w, "file");
if (i) {
- const char *t;
+ const char *t;
- t = w->theme_path;
- w->theme_path = ecore_string_instance(i);
+ t = w->theme_path;
+ w->theme_path = ecore_string_instance(i);
- /* free this after, if it's the same string we dont' want to
- * release all references on it */
- IF_RELEASE(t);
+ /* free this after, if it's the same string we dont' want to
+ * release all references on it */
+ IF_RELEASE(t);
} else {
- IF_RELEASE(w->theme_path);
+ IF_RELEASE(w->theme_path);
}
/*
@@ -2641,17 +2641,17 @@ ewl_widget_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
group = ewl_theme_data_str_get(w, "group");
if (group) {
- const char *t;
+ const char *t;
- t = w->theme_group;
- w->theme_group = ecore_string_instance(group);
+ t = w->theme_group;
+ w->theme_group = ecore_string_instance(group);
- /* free this after, if it's the same string we dont' want to
- * release all references on it */
- IF_RELEASE(t);
+ /* free this after, if it's the same string we dont' want to
+ * release all references on it */
+ IF_RELEASE(t);
} else {
- IF_RELEASE(w->theme_group);
+ IF_RELEASE(w->theme_group);
}
IF_FREE(i);
@@ -2668,70 +2668,70 @@ ewl_widget_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
* Set up the theme object on the widgets evas
*/
if (w->theme_object) {
- ewl_widget_theme_insets_get(w, &i_l, &i_r, &i_t, &i_b);
- ewl_widget_theme_padding_get(w, &p_l, &p_r, &p_t, &p_b);
-
- ewl_object_insets_get(EWL_OBJECT(w), &l, &r, &t, &b);
-
- /*
- * Use previously set insets and padding if available.
- */
- if (l) i_l = l;
- if (r) i_r = r;
- if (t) i_t = t;
- if (b) i_b = b;
-
- ewl_object_padding_get(EWL_OBJECT(w), &l, &r, &t, &b);
-
- if (l) p_l = l;
- if (r) p_r = r;
- if (t) p_t = t;
- if (b) p_b = b;
-
- /*
- * Assign the relevant insets and padding.
- */
- ewl_object_insets_set(EWL_OBJECT(w), i_l, i_r, i_t, i_b);
- ewl_object_padding_set(EWL_OBJECT(w), p_l, p_r, p_t, p_b);
-
- i_l = CURRENT_X(w);
- i_t = CURRENT_Y(w);
- ewl_object_x_request(EWL_OBJECT(w), i_l);
- ewl_object_y_request(EWL_OBJECT(w), i_t);
-
- /*
- * Propagate minimum sizes from the bit theme to the widget.
- */
- edje_object_size_min_get(w->theme_object, &width, &height);
- i_l = (int)(width);
- i_t = (int)(height);
-
- if (i_l > 0 && MINIMUM_W(w) == EWL_OBJECT_MIN_SIZE
- && i_l > EWL_OBJECT_MIN_SIZE
- && i_l <= EWL_OBJECT_MAX_SIZE)
- ewl_object_minimum_w_set(EWL_OBJECT(w), i_l);
-
- if (i_t > 0 && MINIMUM_H(w) == EWL_OBJECT_MIN_SIZE
- && i_t > EWL_OBJECT_MIN_SIZE
- && i_t <= EWL_OBJECT_MAX_SIZE)
- ewl_object_minimum_h_set(EWL_OBJECT(w), i_t);
-
- /*
- * Propagate maximum sizes from the bit theme to the widget.
- */
- edje_object_size_max_get(w->theme_object, &width, &height);
- i_l = (int)(width);
- i_t = (int)(height);
-
- if (i_l > 0 && MAXIMUM_W(w) == EWL_OBJECT_MAX_SIZE
- && i_l >= EWL_OBJECT_MIN_SIZE
- && i_l < EWL_OBJECT_MAX_SIZE)
- ewl_object_maximum_w_set(EWL_OBJECT(w), i_l);
-
- if (i_t > 0 && MAXIMUM_H(w) == EWL_OBJECT_MAX_SIZE
- && i_t >= EWL_OBJECT_MIN_SIZE
- && i_t < EWL_OBJECT_MAX_SIZE)
- ewl_object_maximum_h_set(EWL_OBJECT(w), i_t);
+ ewl_widget_theme_insets_get(w, &i_l, &i_r, &i_t, &i_b);
+ ewl_widget_theme_padding_get(w, &p_l, &p_r, &p_t, &p_b);
+
+ ewl_object_insets_get(EWL_OBJECT(w), &l, &r, &t, &b);
+
+ /*
+ * Use previously set insets and padding if available.
+ */
+ if (l) i_l = l;
+ if (r) i_r = r;
+ if (t) i_t = t;
+ if (b) i_b = b;
+
+ ewl_object_padding_get(EWL_OBJECT(w), &l, &r, &t, &b);
+
+ if (l) p_l = l;
+ if (r) p_r = r;
+ if (t) p_t = t;
+ if (b) p_b = b;
+
+ /*
+ * Assign the relevant insets and padding.
+ */
+ ewl_object_insets_set(EWL_OBJECT(w), i_l, i_r, i_t, i_b);
+ ewl_object_padding_set(EWL_OBJECT(w), p_l, p_r, p_t, p_b);
+
+ i_l = CURRENT_X(w);
+ i_t = CURRENT_Y(w);
+ ewl_object_x_request(EWL_OBJECT(w), i_l);
+ ewl_object_y_request(EWL_OBJECT(w), i_t);
+
+ /*
+ * Propagate minimum sizes from the bit theme to the widget.
+ */
+ edje_object_size_min_get(w->theme_object, &width, &height);
+ i_l = (int)(width);
+ i_t = (int)(height);
+
+ if (i_l > 0 && MINIMUM_W(w) == EWL_OBJECT_MIN_SIZE
+ && i_l > EWL_OBJECT_MIN_SIZE
+ && i_l <= EWL_OBJECT_MAX_SIZE)
+ ewl_object_minimum_w_set(EWL_OBJECT(w), i_l);
+
+ if (i_t > 0 && MINIMUM_H(w) == EWL_OBJECT_MIN_SIZE
+ && i_t > EWL_OBJECT_MIN_SIZE
+ && i_t <= EWL_OBJECT_MAX_SIZE)
+ ewl_object_minimum_h_set(EWL_OBJECT(w), i_t);
+
+ /*
+ * Propagate maximum sizes from the bit theme to the widget.
+ */
+ edje_object_size_max_get(w->theme_object, &width, &height);
+ i_l = (int)(width);
+ i_t = (int)(height);
+
+ if (i_l > 0 && MAXIMUM_W(w) == EWL_OBJECT_MAX_SIZE
+ && i_l >= EWL_OBJECT_MIN_SIZE
+ && i_l < EWL_OBJECT_MAX_SIZE)
+ ewl_object_maximum_w_set(EWL_OBJECT(w), i_l);
+
+ if (i_t > 0 && MAXIMUM_H(w) == EWL_OBJECT_MAX_SIZE
+ && i_t >= EWL_OBJECT_MIN_SIZE
+ && i_t < EWL_OBJECT_MAX_SIZE)
+ ewl_object_maximum_h_set(EWL_OBJECT(w), i_t);
}
DRETURN(DLEVEL_STABLE);
@@ -2747,44 +2747,44 @@ ewl_widget_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (w->theme_object) {
- int i_l, i_r, i_t, i_b;
- int p_l, p_r, p_t, p_b;
- int l, r, t, b;
-
- ewl_widget_theme_insets_get(w, &l, &r, &t, &b);
-
- ewl_object_insets_get(EWL_OBJECT(w), &i_l, &i_r, &i_t, &i_b);
- ewl_object_padding_get(EWL_OBJECT(w), &p_l, &p_r, &p_t, &p_b);
-
- /*
- * If the inset/padding values have been changed in code we
- * want to leave the code set values. Otherwise, if the
- * widget is using the theme set values, we reset to the
- * default of 0 for padding/insets
- */
- if (l == i_l) i_l = 0;
- if (r == i_r) i_r = 0;
- if (t == i_t) i_t = 0;
- if (b == i_b) i_b = 0;
-
- ewl_widget_theme_padding_get(w, &l, &r, &t, &b);
- if (l == p_l) p_l = 0;
- if (r == p_r) p_r = 0;
- if (t == p_t) p_t = 0;
- if (b == p_b) p_b = 0;
-
- /*
- * Assign the relevant insets and padding.
- */
- ewl_object_insets_set(EWL_OBJECT(w), i_l, i_r, i_t, i_b);
- ewl_object_padding_set(EWL_OBJECT(w), p_l, p_r, p_t, p_b);
+ int i_l, i_r, i_t, i_b;
+ int p_l, p_r, p_t, p_b;
+ int l, r, t, b;
+
+ ewl_widget_theme_insets_get(w, &l, &r, &t, &b);
+
+ ewl_object_insets_get(EWL_OBJECT(w), &i_l, &i_r, &i_t, &i_b);
+ ewl_object_padding_get(EWL_OBJECT(w), &p_l, &p_r, &p_t, &p_b);
+
+ /*
+ * If the inset/padding values have been changed in code we
+ * want to leave the code set values. Otherwise, if the
+ * widget is using the theme set values, we reset to the
+ * default of 0 for padding/insets
+ */
+ if (l == i_l) i_l = 0;
+ if (r == i_r) i_r = 0;
+ if (t == i_t) i_t = 0;
+ if (b == i_b) i_b = 0;
+
+ ewl_widget_theme_padding_get(w, &l, &r, &t, &b);
+ if (l == p_l) p_l = 0;
+ if (r == p_r) p_r = 0;
+ if (t == p_t) p_t = 0;
+ if (b == p_b) p_b = 0;
+
+ /*
+ * Assign the relevant insets and padding.
+ */
+ ewl_object_insets_set(EWL_OBJECT(w), i_l, i_r, i_t, i_b);
+ ewl_object_padding_set(EWL_OBJECT(w), p_l, p_r, p_t, p_b);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2800,7 +2800,7 @@ ewl_widget_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -2810,24 +2810,24 @@ ewl_widget_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
* Adjust the clip box to display the widget.
*/
if (w->fx_clip_box) {
- evas_object_move(w->fx_clip_box,
- CURRENT_X(w) - INSET_LEFT(w),
- CURRENT_Y(w) - INSET_TOP(w));
- evas_object_resize(w->fx_clip_box,
- CURRENT_W(w) + INSET_LEFT(w) + INSET_RIGHT(w),
- CURRENT_H(w) + INSET_TOP(w) + INSET_BOTTOM(w));
+ evas_object_move(w->fx_clip_box,
+ CURRENT_X(w) - INSET_LEFT(w),
+ CURRENT_Y(w) - INSET_TOP(w));
+ evas_object_resize(w->fx_clip_box,
+ CURRENT_W(w) + INSET_LEFT(w) + INSET_RIGHT(w),
+ CURRENT_H(w) + INSET_TOP(w) + INSET_BOTTOM(w));
}
/*
* Move the base theme object to the correct size and position
*/
if (w->theme_object) {
- evas_object_move(w->theme_object,
- CURRENT_X(w) - INSET_LEFT(w),
- CURRENT_Y(w) - INSET_TOP(w));
- evas_object_resize(w->theme_object,
- CURRENT_W(w) + INSET_LEFT(w) + INSET_RIGHT(w),
- CURRENT_H(w) + INSET_TOP(w) + INSET_BOTTOM(w));
+ evas_object_move(w->theme_object,
+ CURRENT_X(w) - INSET_LEFT(w),
+ CURRENT_Y(w) - INSET_TOP(w));
+ evas_object_resize(w->theme_object,
+ CURRENT_W(w) + INSET_LEFT(w) + INSET_RIGHT(w),
+ CURRENT_H(w) + INSET_TOP(w) + INSET_BOTTOM(w));
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -2843,7 +2843,7 @@ ewl_widget_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Container *pc;
@@ -2853,10 +2853,10 @@ ewl_widget_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
pc = EWL_CONTAINER(w->parent);
if (REALIZED(w))
- ewl_widget_unrealize(w);
+ ewl_widget_unrealize(w);
if (pc && REALIZED(pc) && VISIBLE(w) && !REALIZED(w))
- ewl_realize_request(w);
+ ewl_realize_request(w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -2872,7 +2872,7 @@ ewl_widget_cb_reparent(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_enable(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -2893,7 +2893,7 @@ ewl_widget_cb_enable(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_disable(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
@@ -2914,14 +2914,14 @@ ewl_widget_cb_disable(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_focus_in(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_widget_state_set(w, "focus,in", EWL_STATE_TRANSIENT);
@@ -2938,14 +2938,14 @@ ewl_widget_cb_focus_in(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_widget_state_set(w, "focus,out", EWL_STATE_TRANSIENT);
@@ -2962,14 +2962,14 @@ ewl_widget_cb_focus_out(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_mouse_in(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_widget_state_set(w, "mouse,in", EWL_STATE_TRANSIENT);
@@ -2986,14 +2986,14 @@ ewl_widget_cb_mouse_in(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_mouse_out(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_widget_state_set(w, "mouse,out", EWL_STATE_TRANSIENT);
@@ -3010,7 +3010,7 @@ ewl_widget_cb_mouse_out(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_widget_cb_mouse_down(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Event_Mouse_Down *e = ev_data;
char state[14];
@@ -3020,7 +3020,7 @@ ewl_widget_cb_mouse_down(Ewl_Widget *w, void *ev_data,
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
snprintf(state, sizeof(state), "mouse,down,%i", e->button);
ewl_widget_state_set(w, state, EWL_STATE_TRANSIENT);
@@ -3038,7 +3038,7 @@ ewl_widget_cb_mouse_down(Ewl_Widget *w, void *ev_data,
*/
void
ewl_widget_cb_mouse_up(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Event_Mouse_Up *e = ev_data;
char state[14];
@@ -3048,32 +3048,32 @@ ewl_widget_cb_mouse_up(Ewl_Widget *w, void *ev_data,
DCHECK_TYPE(w, EWL_WIDGET_TYPE);
if (DISABLED(w))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (ewl_object_state_has(EWL_OBJECT(w), EWL_FLAG_STATE_DND)) {
- ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAG_STATE_DND);
- ewl_dnd_drag_drop(w);
+ ewl_object_state_remove(EWL_OBJECT(w), EWL_FLAG_STATE_DND);
+ ewl_dnd_drag_drop(w);
}
snprintf(state, sizeof(state), "mouse,up,%i", e->button);
ewl_widget_state_set(w, state, EWL_STATE_TRANSIENT);
if (ewl_object_state_has(EWL_OBJECT(w), EWL_FLAG_STATE_MOUSE_IN)) {
- int x, y;
-
- ewl_widget_state_set(w, "mouse,in", EWL_STATE_TRANSIENT);
- x = e->base.x - (CURRENT_X(w) - INSET_LEFT(w));
- y = e->base.y - (CURRENT_Y(w) - INSET_TOP(w));
- if ((x > 0) && (x < CURRENT_W(w) + INSET_HORIZONTAL(w)) &&
- (y > 0) && (y < CURRENT_H(w) + INSET_VERTICAL(w))) {
- ewl_callback_call_with_event_data(w,
- EWL_CALLBACK_CLICKED, ev_data);
- }
- else
- ewl_embed_mouse_move_feed(ewl_embed_widget_find(w),
- e->base.x, e->base.y, e->base.modifiers);
+ int x, y;
+
+ ewl_widget_state_set(w, "mouse,in", EWL_STATE_TRANSIENT);
+ x = e->base.x - (CURRENT_X(w) - INSET_LEFT(w));
+ y = e->base.y - (CURRENT_Y(w) - INSET_TOP(w));
+ if ((x > 0) && (x < CURRENT_W(w) + INSET_HORIZONTAL(w)) &&
+ (y > 0) && (y < CURRENT_H(w) + INSET_VERTICAL(w))) {
+ ewl_callback_call_with_event_data(w,
+ EWL_CALLBACK_CLICKED, ev_data);
+ }
+ else
+ ewl_embed_mouse_move_feed(ewl_embed_widget_find(w),
+ e->base.x, e->base.y, e->base.modifiers);
} else
- ewl_widget_state_set(w, "mouse,out", EWL_STATE_TRANSIENT);
+ ewl_widget_state_set(w, "mouse,out", EWL_STATE_TRANSIENT);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -3088,7 +3088,7 @@ ewl_widget_cb_mouse_up(Ewl_Widget *w, void *ev_data,
*/
void
ewl_widget_cb_mouse_move(Ewl_Widget *w, void *ev_data,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Embed *embed;
Ewl_Object *o;
@@ -3102,25 +3102,25 @@ ewl_widget_cb_mouse_move(Ewl_Widget *w, void *ev_data,
ewl_widget_state_set(w, "mouse,move", EWL_STATE_TRANSIENT);
if (ewl_object_state_has(o, EWL_FLAG_STATE_PRESSED) &&
- ewl_object_flags_has(o, EWL_FLAG_PROPERTY_DND_SOURCE,
- EWL_FLAGS_PROPERTY_MASK)) {
-
- embed = ewl_embed_widget_find(w);
- if (!ewl_object_state_has(o, EWL_FLAG_STATE_DND)) {
- ewl_object_state_add(o, EWL_FLAG_STATE_DND);
- embed->last.drag_widget = w;
- ewl_dnd_drag_start(w);
- }
-
- if (ev && (ev->x > CURRENT_X(embed) &&
- ev->y > CURRENT_Y(embed) &&
- ev->x < CURRENT_X(embed) + CURRENT_W(embed) &&
- ev->y < CURRENT_Y(embed) + CURRENT_H(embed))) {
- ewl_embed_dnd_position_feed(EWL_EMBED(embed),
- ev->x, ev->y,
- NULL, NULL,
- NULL, NULL);
- }
+ ewl_object_flags_has(o, EWL_FLAG_PROPERTY_DND_SOURCE,
+ EWL_FLAGS_PROPERTY_MASK)) {
+
+ embed = ewl_embed_widget_find(w);
+ if (!ewl_object_state_has(o, EWL_FLAG_STATE_DND)) {
+ ewl_object_state_add(o, EWL_FLAG_STATE_DND);
+ embed->last.drag_widget = w;
+ ewl_dnd_drag_start(w);
+ }
+
+ if (ev && (ev->x > CURRENT_X(embed) &&
+ ev->y > CURRENT_Y(embed) &&
+ ev->x < CURRENT_X(embed) + CURRENT_W(embed) &&
+ ev->y < CURRENT_Y(embed) + CURRENT_H(embed))) {
+ ewl_embed_dnd_position_feed(EWL_EMBED(embed),
+ ev->x, ev->y,
+ NULL, NULL,
+ NULL, NULL);
+ }
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -3140,12 +3140,12 @@ ewl_widget_theme_padding_get(Ewl_Widget *w, int *l, int *r, int *t, int *b)
*/
key = edje_object_data_get(w->theme_object, "pad");
if (key) {
- int val = atoi(key);
+ int val = atoi(key);
- if (l) *l = val;
- if (r) *r = val;
- if (t) *t = val;
- if (b) *b = val;
+ if (l) *l = val;
+ if (r) *r = val;
+ if (t) *t = val;
+ if (b) *b = val;
}
key = edje_object_data_get(w->theme_object, "pad/left");
@@ -3177,12 +3177,12 @@ ewl_widget_theme_insets_get(Ewl_Widget *w, int *l, int *r, int *t, int *b)
*/
key = edje_object_data_get(w->theme_object, "inset");
if (key) {
- int val = atoi(key);
+ int val = atoi(key);
- if (l) *l = val;
- if (r) *r = val;
- if (t) *t = val;
- if (b) *b = val;
+ if (l) *l = val;
+ if (r) *r = val;
+ if (t) *t = val;
+ if (b) *b = val;
}
key = edje_object_data_get(w->theme_object, "inset/left");
diff --git a/src/lib/ewl_widget.h b/src/lib/ewl_widget.h
index e95c570..d2808f5 100644
--- a/src/lib/ewl_widget.h
+++ b/src/lib/ewl_widget.h
@@ -41,9 +41,9 @@ typedef struct Ewl_Attach_List Ewl_Attach_List;
*/
struct Ewl_Attach_List
{
- void **list; /**< The attachment list */
- unsigned int direct:1; /**< Is this a direct pointer to an attached item */
- unsigned int len:31; /**< Number of things in the attachment list */
+ void **list; /**< The attachment list */
+ unsigned int direct:1; /**< Is this a direct pointer to an attached item */
+ unsigned int len:31; /**< Number of things in the attachment list */
};
/**
@@ -63,7 +63,7 @@ typedef struct Ewl_Pair Ewl_Pair;
struct Ewl_Pair
{
const char *key; /**< The key */
- char *value; /**< The value */
+ char *value; /**< The value */
};
/**
@@ -76,9 +76,9 @@ typedef struct Ewl_Pair_List Ewl_Pair_List;
*/
struct Ewl_Pair_List
{
- Ewl_Pair **list; /**< The key/value list */
- unsigned int direct:1; /**< Does this list point directly to a pair */
- unsigned int len:31; /**< Length of the list */
+ Ewl_Pair **list; /**< The key/value list */
+ unsigned int direct:1; /**< Does this list point directly to a pair */
+ unsigned int len:31; /**< Length of the list */
};
/**
@@ -91,10 +91,10 @@ typedef struct Ewl_Callback_Chain Ewl_Callback_Chain;
*/
struct Ewl_Callback_Chain
{
- void **list; /**< The callback list */
- unsigned char mask; /**< The callback mask */
- unsigned char len; /**< Length of the list */
- unsigned char index; /**< Current list index */
+ void **list; /**< The callback list */
+ unsigned char mask; /**< The callback mask */
+ unsigned char len; /**< Length of the list */
+ unsigned char index; /**< Current list index */
};
/**
@@ -107,10 +107,10 @@ typedef struct Ewl_Color_Set Ewl_Color_Set;
*/
struct Ewl_Color_Set
{
- unsigned char r, /**< The red value */
- g, /**< The green value */
- b, /**< The blue value */
- a; /**< The alpha value */
+ unsigned char r, /**< The red value */
+ g, /**< The green value */
+ b, /**< The blue value */
+ a; /**< The alpha value */
};
/**
@@ -140,7 +140,7 @@ struct Ewl_Widget
Ewl_Widget *parent; /**< The parent widget, actually a container */
Ewl_Callback_Chain callbacks[EWL_CALLBACK_MAX + 1];
- /**< Callback chain array */
+ /**< Callback chain array */
Ewl_Attach_List *attach; /**< List of attachments on the widget */
void *smart_object; /**< Smart Object for the layer stuff */
@@ -152,105 +152,105 @@ struct Ewl_Widget
const char *theme_state; /**< State of the appearance */
const char *appearance; /**< Key to lookup appearance in theme */
const char *inheritance; /**< Inheritance of path widget */
- int layer; /**< the layer relative to the parent */
+ int layer; /**< the layer relative to the parent */
- Ecore_Hash *theme; /**< Overriding theme settings */
- Ewl_Pair_List theme_text; /**< Overriding text in theme */
+ Ecore_Hash *theme; /**< Overriding theme settings */
+ Ewl_Pair_List theme_text; /**< Overriding text in theme */
- unsigned char toplayered:1; /**< Indicates if the widget should
- be on the top of the layer stack */
+ unsigned char toplayered:1; /**< Indicates if the widget should
+ be on the top of the layer stack */
unsigned char unmanaged:1;
};
Ewl_Widget *ewl_widget_new(void);
-int ewl_widget_init(Ewl_Widget *w);
-void ewl_widget_free(Ewl_Widget *w);
+int ewl_widget_init(Ewl_Widget *w);
+void ewl_widget_free(Ewl_Widget *w);
-void ewl_widget_name_set(Ewl_Widget *w, const char *name);
+void ewl_widget_name_set(Ewl_Widget *w, const char *name);
const char *ewl_widget_name_get(Ewl_Widget *w);
Ewl_Widget *ewl_widget_name_find(const char *name);
-void ewl_widget_reparent(Ewl_Widget *widget);
-void ewl_widget_realize(Ewl_Widget *widget);
-void ewl_widget_unrealize(Ewl_Widget *w);
-void ewl_widget_reveal(Ewl_Widget *w);
-void ewl_widget_obscure(Ewl_Widget *w);
-void ewl_widget_show(Ewl_Widget *widget);
-void ewl_widget_hide(Ewl_Widget *widget);
-void ewl_widget_destroy(Ewl_Widget *widget);
-void ewl_widget_configure(Ewl_Widget *widget);
-
-void ewl_widget_data_set(Ewl_Widget *w, void *k, void *v);
-void *ewl_widget_data_del(Ewl_Widget *w, void *k);
-void *ewl_widget_data_get(Ewl_Widget *w, void *k);
-
-void ewl_widget_state_set(Ewl_Widget *w, const char *state,
- Ewl_State_Type flag);
-
-void ewl_widget_appearance_set(Ewl_Widget *w, const char *appearance);
-char *ewl_widget_appearance_get(Ewl_Widget *w);
-char *ewl_widget_appearance_path_get(Ewl_Widget *w);
-int ewl_widget_appearance_path_size_get(Ewl_Widget *w);
-int ewl_widget_appearance_path_copy(Ewl_Widget *w, char *buf,
- int size);
-void ewl_widget_appearance_part_text_set(Ewl_Widget *w, const char *part,
- const char *text);
+void ewl_widget_reparent(Ewl_Widget *widget);
+void ewl_widget_realize(Ewl_Widget *widget);
+void ewl_widget_unrealize(Ewl_Widget *w);
+void ewl_widget_reveal(Ewl_Widget *w);
+void ewl_widget_obscure(Ewl_Widget *w);
+void ewl_widget_show(Ewl_Widget *widget);
+void ewl_widget_hide(Ewl_Widget *widget);
+void ewl_widget_destroy(Ewl_Widget *widget);
+void ewl_widget_configure(Ewl_Widget *widget);
+
+void ewl_widget_data_set(Ewl_Widget *w, void *k, void *v);
+void *ewl_widget_data_del(Ewl_Widget *w, void *k);
+void *ewl_widget_data_get(Ewl_Widget *w, void *k);
+
+void ewl_widget_state_set(Ewl_Widget *w, const char *state,
+ Ewl_State_Type flag);
+
+void ewl_widget_appearance_set(Ewl_Widget *w, const char *appearance);
+char *ewl_widget_appearance_get(Ewl_Widget *w);
+char *ewl_widget_appearance_path_get(Ewl_Widget *w);
+int ewl_widget_appearance_path_size_get(Ewl_Widget *w);
+int ewl_widget_appearance_path_copy(Ewl_Widget *w, char *buf,
+ int size);
+void ewl_widget_appearance_part_text_set(Ewl_Widget *w, const char *part,
+ const char *text);
const char *ewl_widget_appearance_part_text_get(Ewl_Widget *w, const char *part);
-void ewl_widget_appearance_text_set(Ewl_Widget *w, const char *text);
+void ewl_widget_appearance_text_set(Ewl_Widget *w, const char *text);
const char *ewl_widget_appearance_text_get(Ewl_Widget *w);
-void ewl_widget_inherit(Ewl_Widget *widget, const char *type);
+void ewl_widget_inherit(Ewl_Widget *widget, const char *type);
unsigned int ewl_widget_type_is(Ewl_Widget *widget, const char *type);
unsigned int ewl_widget_onscreen_is(Ewl_Widget *widget);
-void ewl_widget_parent_set(Ewl_Widget *w, Ewl_Widget *p);
+void ewl_widget_parent_set(Ewl_Widget *w, Ewl_Widget *p);
Ewl_Widget *ewl_widget_parent_get(Ewl_Widget *w);
-void ewl_widget_enable(Ewl_Widget *w);
-void ewl_widget_disable(Ewl_Widget *w);
+void ewl_widget_enable(Ewl_Widget *w);
+void ewl_widget_disable(Ewl_Widget *w);
-void ewl_widget_print(Ewl_Widget *w);
-void ewl_widget_print_verbose(Ewl_Widget *w);
-void ewl_widget_tree_print(Ewl_Widget *w);
+void ewl_widget_print(Ewl_Widget *w);
+void ewl_widget_print_verbose(Ewl_Widget *w);
+void ewl_widget_tree_print(Ewl_Widget *w);
-void ewl_widget_layer_top_set(Ewl_Widget *w, int top);
-int ewl_widget_layer_top_get(Ewl_Widget *w);
-void ewl_widget_layer_priority_set(Ewl_Widget *w, int layer);
-int ewl_widget_layer_priority_get(Ewl_Widget *w);
+void ewl_widget_layer_top_set(Ewl_Widget *w, int top);
+int ewl_widget_layer_top_get(Ewl_Widget *w);
+void ewl_widget_layer_priority_set(Ewl_Widget *w, int layer);
+int ewl_widget_layer_priority_get(Ewl_Widget *w);
-void ewl_widget_internal_set(Ewl_Widget *w, unsigned int val);
+void ewl_widget_internal_set(Ewl_Widget *w, unsigned int val);
unsigned int ewl_widget_internal_is(Ewl_Widget *w);
-void ewl_widget_unmanaged_set(Ewl_Widget *w, unsigned int val);
+void ewl_widget_unmanaged_set(Ewl_Widget *w, unsigned int val);
unsigned int ewl_widget_unmanaged_is(Ewl_Widget *w);
-void ewl_widget_clipped_set(Ewl_Widget *w, unsigned int val);
+void ewl_widget_clipped_set(Ewl_Widget *w, unsigned int val);
unsigned int ewl_widget_clipped_is(Ewl_Widget *w);
-void ewl_widget_focus_send(Ewl_Widget *w);
+void ewl_widget_focus_send(Ewl_Widget *w);
Ewl_Widget *ewl_widget_focused_get(void);
-void ewl_widget_tab_order_append(Ewl_Widget *w);
-void ewl_widget_tab_order_prepend(Ewl_Widget *w);
-void ewl_widget_tab_order_insert(Ewl_Widget *w, unsigned int idx);
-void ewl_widget_tab_order_insert_before(Ewl_Widget *w, Ewl_Widget *before);
-void ewl_widget_tab_order_insert_after(Ewl_Widget *w, Ewl_Widget *after);
-void ewl_widget_tab_order_remove(Ewl_Widget *w);
+void ewl_widget_tab_order_append(Ewl_Widget *w);
+void ewl_widget_tab_order_prepend(Ewl_Widget *w);
+void ewl_widget_tab_order_insert(Ewl_Widget *w, unsigned int idx);
+void ewl_widget_tab_order_insert_before(Ewl_Widget *w, Ewl_Widget *before);
+void ewl_widget_tab_order_insert_after(Ewl_Widget *w, Ewl_Widget *after);
+void ewl_widget_tab_order_remove(Ewl_Widget *w);
-void ewl_widget_focusable_set(Ewl_Widget *w, unsigned int val);
+void ewl_widget_focusable_set(Ewl_Widget *w, unsigned int val);
unsigned int ewl_widget_focusable_get(Ewl_Widget *w);
-void ewl_widget_ignore_focus_change_set(Ewl_Widget *w, unsigned int val);
+void ewl_widget_ignore_focus_change_set(Ewl_Widget *w, unsigned int val);
unsigned int ewl_widget_ignore_focus_change_get(Ewl_Widget *w);
-void ewl_widget_color_set(Ewl_Widget *w, unsigned int r, unsigned int g,
- unsigned int b, unsigned int a);
-void ewl_widget_color_get(Ewl_Widget *w, unsigned int *r, unsigned int *g,
- unsigned int *b, unsigned int *a);
+void ewl_widget_color_set(Ewl_Widget *w, unsigned int r, unsigned int g,
+ unsigned int b, unsigned int a);
+void ewl_widget_color_get(Ewl_Widget *w, unsigned int *r, unsigned int *g,
+ unsigned int *b, unsigned int *a);
-int ewl_widget_parent_of(Ewl_Widget *c, Ewl_Widget *w);
+int ewl_widget_parent_of(Ewl_Widget *c, Ewl_Widget *w);
#define UNMANAGED(w) (((const Ewl_Widget *)(w))->unmanaged)
diff --git a/src/lib/ewl_window.c b/src/lib/ewl_window.c
index 8facae8..1ff4188 100644
--- a/src/lib/ewl_window.c
+++ b/src/lib/ewl_window.c
@@ -21,11 +21,11 @@ ewl_window_new(void)
w = NEW(Ewl_Window, 1);
if (!w)
- DRETURN_PTR(NULL, DLEVEL_STABLE);
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
if (!ewl_window_init(w)) {
- ewl_widget_destroy(EWL_WIDGET(w));
- w = NULL;
+ ewl_widget_destroy(EWL_WIDGET(w));
+ w = NULL;
}
DRETURN_PTR(EWL_WIDGET(w), DLEVEL_STABLE);
@@ -48,32 +48,32 @@ ewl_window_init(Ewl_Window *w)
* Initialize the fields of the inherited container class
*/
if (!ewl_embed_init(EWL_EMBED(w)))
- DRETURN_INT(FALSE, DLEVEL_STABLE);
+ DRETURN_INT(FALSE, DLEVEL_STABLE);
ewl_widget_appearance_set(EWL_WIDGET(w), EWL_WINDOW_TYPE);
ewl_widget_inherit(EWL_WIDGET(w), EWL_WINDOW_TYPE);
ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_FILL);
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_REALIZE,
- ewl_window_cb_realize, NULL);
+ ewl_window_cb_realize, NULL);
ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_REALIZE,
- ewl_window_cb_postrealize, NULL);
+ ewl_window_cb_postrealize, NULL);
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_UNREALIZE,
- ewl_window_cb_unrealize, NULL);
+ ewl_window_cb_unrealize, NULL);
ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_SHOW,
- ewl_window_cb_show, NULL);
+ ewl_window_cb_show, NULL);
ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_EXPOSE,
- ewl_window_cb_expose, NULL);
+ ewl_window_cb_expose, NULL);
ewl_callback_append(EWL_WIDGET(w), EWL_CALLBACK_HIDE,
- ewl_window_cb_hide, NULL);
+ ewl_window_cb_hide, NULL);
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_DESTROY,
- ewl_window_cb_destroy, NULL);
+ ewl_window_cb_destroy, NULL);
/*
* Override the default configure callbacks since the window
* has special needs for placement.
*/
ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE,
- ewl_window_cb_configure, NULL);
+ ewl_window_cb_configure, NULL);
ecore_list_append(ewl_window_list, w);
@@ -95,8 +95,8 @@ ewl_window_window_find(void *window)
ecore_list_first_goto(ewl_window_list);
while ((retwin = ecore_list_next(ewl_window_list)))
- if (retwin->window == window)
- DRETURN_PTR(retwin, DLEVEL_STABLE);
+ if (retwin->window == window)
+ DRETURN_PTR(retwin, DLEVEL_STABLE);
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -118,8 +118,8 @@ ewl_window_title_set(Ewl_Window *win, const char *title)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if ((!title) || (!win->title) || (strcmp(win->title, title))) {
- IF_FREE(win->title);
- win->title = ((title && *title) ? strdup(title) : NULL);
+ IF_FREE(win->title);
+ win->title = ((title && *title) ? strdup(title) : NULL);
}
ewl_engine_window_title_set(win);
@@ -162,8 +162,8 @@ ewl_window_name_set(Ewl_Window *win, const char *name)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if ((!name) || (!win->name) || (strcmp(win->name, name))) {
- IF_FREE(win->name);
- win->name = ((name && *name) ? strdup(name) : NULL);
+ IF_FREE(win->name);
+ win->name = ((name && *name) ? strdup(name) : NULL);
}
ewl_engine_window_name_class_set(win);
@@ -206,11 +206,11 @@ ewl_window_class_set(Ewl_Window *win, const char *classname)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if ((!classname) || (!win->classname)
- || (strcmp(win->classname, classname)))
+ || (strcmp(win->classname, classname)))
{
- IF_FREE(win->classname);
- win->classname = ((classname && *classname) ?
- strdup(classname) : NULL);
+ IF_FREE(win->classname);
+ win->classname = ((classname && *classname) ?
+ strdup(classname) : NULL);
}
ewl_engine_window_name_class_set(win);
@@ -255,7 +255,7 @@ ewl_window_borderless_set(Ewl_Window *win, unsigned int border)
/* do nothing if already set */
if (border == ewl_window_borderless_get(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (border) win->flags |= EWL_WINDOW_BORDERLESS;
else win->flags &= ~EWL_WINDOW_BORDERLESS;
@@ -299,12 +299,12 @@ ewl_window_dialog_set(Ewl_Window *win, int dialog)
/* do nothing if already set */
if (dialog == ewl_window_dialog_get(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (dialog)
- win->flags |= EWL_WINDOW_DIALOG;
+ win->flags |= EWL_WINDOW_DIALOG;
else
- win->flags &= ~EWL_WINDOW_DIALOG;
+ win->flags &= ~EWL_WINDOW_DIALOG;
ewl_engine_window_dialog_set(win);
@@ -342,12 +342,12 @@ ewl_window_fullscreen_set(Ewl_Window *win, unsigned int fullscreen)
/* do nothing if already set */
if (fullscreen == ewl_window_fullscreen_get(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (fullscreen)
- win->flags |= EWL_WINDOW_FULLSCREEN;
+ win->flags |= EWL_WINDOW_FULLSCREEN;
else
- win->flags &= ~EWL_WINDOW_FULLSCREEN;
+ win->flags &= ~EWL_WINDOW_FULLSCREEN;
ewl_engine_window_states_set(win);
@@ -384,12 +384,12 @@ ewl_window_skip_taskbar_set(Ewl_Window *win, unsigned int skip)
/* do nothing if already set */
if (skip == ewl_window_skip_taskbar_get(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (skip)
- win->flags |= EWL_WINDOW_SKIP_TASKBAR;
+ win->flags |= EWL_WINDOW_SKIP_TASKBAR;
else
- win->flags &= ~EWL_WINDOW_SKIP_TASKBAR;
+ win->flags &= ~EWL_WINDOW_SKIP_TASKBAR;
ewl_engine_window_states_set(win);
@@ -399,7 +399,7 @@ ewl_window_skip_taskbar_set(Ewl_Window *win, unsigned int skip)
/**
* @param win: The window to work with
* @return Returns TRUE if the window is to be skipped for the taskbar,
- * FALSE otherwise
+ * FALSE otherwise
* @brief Retrieve the skip taskbar setting for the window
*/
unsigned int
@@ -427,12 +427,12 @@ ewl_window_skip_pager_set(Ewl_Window *win, unsigned int skip)
/* do nothing if already set */
if (skip == ewl_window_skip_pager_get(win))
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
if (skip)
- win->flags |= EWL_WINDOW_SKIP_PAGER;
+ win->flags |= EWL_WINDOW_SKIP_PAGER;
else
- win->flags &= ~EWL_WINDOW_SKIP_PAGER;
+ win->flags &= ~EWL_WINDOW_SKIP_PAGER;
ewl_engine_window_states_set(win);
@@ -442,7 +442,7 @@ ewl_window_skip_pager_set(Ewl_Window *win, unsigned int skip)
/**
* @param win: The window to work with
* @return Returns TRUE if the window is to be skipped for the pager,
- * FALSE otherwise
+ * FALSE otherwise
* @brief Retrieve the skip pager setting for the window
*/
unsigned int
@@ -562,9 +562,9 @@ ewl_window_urgent_set(Ewl_Window *win, unsigned int urgent)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (urgent)
- win->flags |= EWL_WINDOW_URGENT;
+ win->flags |= EWL_WINDOW_URGENT;
else
- win->flags &= ~EWL_WINDOW_URGENT;
+ win->flags &= ~EWL_WINDOW_URGENT;
ewl_engine_window_hints_set(win);
@@ -606,23 +606,23 @@ ewl_window_transient_for(Ewl_Window *win, Ewl_Window *forwin)
/* if there is no forwin remove the transient for state
* and update the window, if it already exists */
if (!forwin) {
- win->flags &= ~EWL_WINDOW_TRANSIENT;
- if (win->window)
- ewl_engine_window_transient_for(win);
+ win->flags &= ~EWL_WINDOW_TRANSIENT;
+ if (win->window)
+ ewl_engine_window_transient_for(win);
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
win->flags |= EWL_WINDOW_TRANSIENT;
if (win->window) {
- if (forwin->window)
- ewl_engine_window_transient_for(win);
- else
- ewl_callback_append(EWL_WIDGET(forwin),
- EWL_CALLBACK_REALIZE,
- ewl_window_cb_realize_parent,
- win);
+ if (forwin->window)
+ ewl_engine_window_transient_for(win);
+ else
+ ewl_callback_append(EWL_WIDGET(forwin),
+ EWL_CALLBACK_REALIZE,
+ ewl_window_cb_realize_parent,
+ win);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -646,7 +646,7 @@ ewl_window_transient_for_foreign(Ewl_Window *win, Ewl_Embed_Window *forwin)
win->flags &= ~EWL_WINDOW_TRANSIENT;
if (win->window)
- ewl_engine_window_transient_for(win);
+ ewl_engine_window_transient_for(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -671,27 +671,27 @@ ewl_window_leader_set(Ewl_Window *win, Ewl_Window *leader)
/* if there is no leader remove the leader for state
* and update the window, if it already exists */
if (!leader) {
- win->flags &= ~EWL_WINDOW_LEADER;
- if (win->window) {
- ewl_engine_window_leader_set(win);
- ewl_engine_window_hints_set(win);
- }
+ win->flags &= ~EWL_WINDOW_LEADER;
+ if (win->window) {
+ ewl_engine_window_leader_set(win);
+ ewl_engine_window_hints_set(win);
+ }
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
}
win->flags |= EWL_WINDOW_LEADER;
if (win->window) {
- if (leader->window) {
- ewl_engine_window_leader_set(win);
- ewl_engine_window_hints_set(win);
- }
- else
- ewl_callback_append(EWL_WIDGET(leader),
- EWL_CALLBACK_REALIZE,
- ewl_window_cb_realize_parent,
- win);
+ if (leader->window) {
+ ewl_engine_window_leader_set(win);
+ ewl_engine_window_hints_set(win);
+ }
+ else
+ ewl_callback_append(EWL_WIDGET(leader),
+ EWL_CALLBACK_REALIZE,
+ ewl_window_cb_realize_parent,
+ win);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -716,13 +716,13 @@ ewl_window_leader_foreign_set(Ewl_Window *win, Ewl_Embed_Window *leader)
/* if there is no leader remove the leader for state
* and update the window, if it already exists */
if (!leader)
- win->flags &= ~EWL_WINDOW_LEADER_FOREIGN;
+ win->flags &= ~EWL_WINDOW_LEADER_FOREIGN;
else
- win->flags |= EWL_WINDOW_LEADER_FOREIGN;
+ win->flags |= EWL_WINDOW_LEADER_FOREIGN;
if (win->window) {
- ewl_engine_window_leader_set(win);
- ewl_engine_window_hints_set(win);
+ ewl_engine_window_leader_set(win);
+ ewl_engine_window_hints_set(win);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -744,7 +744,7 @@ ewl_window_leader_get(Ewl_Window *win)
DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, NULL);
if (win->flags & EWL_WINDOW_LEADER)
- DRETURN_PTR(win->leader.ewl, DLEVEL_STABLE);
+ DRETURN_PTR(win->leader.ewl, DLEVEL_STABLE);
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -765,7 +765,7 @@ ewl_window_leader_foreign_get(Ewl_Window *win)
DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, NULL);
if (win->flags & EWL_WINDOW_LEADER_FOREIGN)
- DRETURN_PTR(win->leader.foreign, DLEVEL_STABLE);
+ DRETURN_PTR(win->leader.foreign, DLEVEL_STABLE);
DRETURN_PTR(NULL, DLEVEL_STABLE);
}
@@ -799,9 +799,9 @@ ewl_window_modal_set(Ewl_Window *win, int modal)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (modal)
- win->flags |= EWL_WINDOW_MODAL;
+ win->flags |= EWL_WINDOW_MODAL;
else
- win->flags &= ~EWL_WINDOW_MODAL;
+ win->flags &= ~EWL_WINDOW_MODAL;
ewl_engine_window_states_set(win);
@@ -822,9 +822,9 @@ ewl_window_keyboard_grab_set(Ewl_Window *win, int grab)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (grab)
- win->flags |= EWL_WINDOW_GRAB_KEYBOARD;
+ win->flags |= EWL_WINDOW_GRAB_KEYBOARD;
else
- win->flags &= ~EWL_WINDOW_GRAB_KEYBOARD;
+ win->flags &= ~EWL_WINDOW_GRAB_KEYBOARD;
ewl_engine_keyboard_grab(win);
@@ -846,9 +846,9 @@ ewl_window_keyboard_grab_get(Ewl_Window *win)
DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, FALSE);
if (win->flags & EWL_WINDOW_GRAB_KEYBOARD)
- grab = TRUE;
+ grab = TRUE;
else
- grab = FALSE;
+ grab = FALSE;
DRETURN_INT(grab, DLEVEL_STABLE);
}
@@ -867,9 +867,9 @@ ewl_window_pointer_grab_set(Ewl_Window *win, int grab)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (grab)
- win->flags |= EWL_WINDOW_GRAB_POINTER;
+ win->flags |= EWL_WINDOW_GRAB_POINTER;
else
- win->flags &= ~EWL_WINDOW_GRAB_POINTER;
+ win->flags &= ~EWL_WINDOW_GRAB_POINTER;
ewl_engine_pointer_grab(win);
@@ -891,9 +891,9 @@ ewl_window_pointer_grab_get(Ewl_Window *win)
DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, FALSE);
if (win->flags & EWL_WINDOW_GRAB_POINTER)
- grab = TRUE;
+ grab = TRUE;
else
- grab = FALSE;
+ grab = FALSE;
DRETURN_INT(grab, DLEVEL_STABLE);
}
@@ -912,9 +912,9 @@ ewl_window_override_set(Ewl_Window *win, int override)
DCHECK_TYPE(win, EWL_WINDOW_TYPE);
if (override)
- win->flags |= EWL_WINDOW_OVERRIDE;
+ win->flags |= EWL_WINDOW_OVERRIDE;
else
- win->flags &= ~EWL_WINDOW_OVERRIDE;
+ win->flags &= ~EWL_WINDOW_OVERRIDE;
/* FIXME: Should probably unrealize and re-realize here. */
@@ -936,9 +936,9 @@ ewl_window_override_get(Ewl_Window *win)
DCHECK_TYPE_RET(win, EWL_WINDOW_TYPE, FALSE);
if (win->flags & EWL_WINDOW_OVERRIDE)
- override = TRUE;
+ override = TRUE;
else
- override = FALSE;
+ override = FALSE;
DRETURN_INT(override, DLEVEL_STABLE);
}
@@ -953,7 +953,7 @@ ewl_window_override_get(Ewl_Window *win)
*/
void
ewl_window_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Window *window;
int width, height;
@@ -977,15 +977,15 @@ ewl_window_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
height = ewl_object_maximum_h_get(EWL_OBJECT(window));
if ((width == EWL_OBJECT_MAX_SIZE) && (width == height))
{
- ewl_engine_window_geometry_get(window, TRUE, &width, &height);
- if (width > 1 && height > 1)
- ewl_object_maximum_size_set(EWL_OBJECT(window), width,
- height);
+ ewl_engine_window_geometry_get(window, TRUE, &width, &height);
+ if (width > 1 && height > 1)
+ ewl_object_maximum_size_set(EWL_OBJECT(window), width,
+ height);
}
ewl_engine_embed_dnd_aware_set(EWL_EMBED(window));
ewl_engine_canvas_setup(window, ewl_config_int_get(ewl_config,
- EWL_CONFIG_DEBUG_EVAS_RENDER));
+ EWL_CONFIG_DEBUG_EVAS_RENDER));
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1000,18 +1000,18 @@ ewl_window_cb_realize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_window_cb_postrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR(w);
DCHECK_TYPE(w, EWL_WINDOW_TYPE);
if (EWL_WINDOW(w)->flags & EWL_WINDOW_TRANSIENT)
- ewl_window_transient_for(EWL_WINDOW(w),
- EWL_WINDOW(w)->transient.ewl);
+ ewl_window_transient_for(EWL_WINDOW(w),
+ EWL_WINDOW(w)->transient.ewl);
else if (EWL_WINDOW(w)->flags & EWL_WINDOW_TRANSIENT_FOREIGN)
- ewl_window_transient_for_foreign(EWL_WINDOW(w),
- EWL_WINDOW(w)->transient.foreign);
+ ewl_window_transient_for_foreign(EWL_WINDOW(w),
+ EWL_WINDOW(w)->transient.foreign);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1026,7 +1026,7 @@ ewl_window_cb_postrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_window_cb_realize_parent(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data)
+ void *user_data)
{
Ewl_Window *win;
@@ -1041,19 +1041,19 @@ ewl_window_cb_realize_parent(Ewl_Widget *w, void *ev_data __UNUSED__,
* Is the window transient for the realized window.
*/
if (EWL_WIDGET(win->transient.ewl) == w)
- ewl_window_transient_for(win, EWL_WINDOW(w));
+ ewl_window_transient_for(win, EWL_WINDOW(w));
/*
* Is the window a client of the realized leader window.
*/
if (EWL_WIDGET(win->leader.ewl) == w)
- ewl_window_leader_set(win, EWL_WINDOW(w));
+ ewl_window_leader_set(win, EWL_WINDOW(w));
/*
* Both windows realized so no need to keep the callback.
*/
ewl_callback_del(EWL_WIDGET(win), EWL_CALLBACK_REALIZE,
- ewl_window_cb_realize_parent);
+ ewl_window_cb_realize_parent);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1068,7 +1068,7 @@ ewl_window_cb_realize_parent(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_window_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Window *win;
Ewl_Embed *embed;
@@ -1086,8 +1086,8 @@ ewl_window_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
if (REALIZED(w))
{
- ewl_engine_window_hide(win);
- ewl_engine_window_destroy(win);
+ ewl_engine_window_hide(win);
+ ewl_engine_window_destroy(win);
}
DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -1103,7 +1103,7 @@ ewl_window_cb_unrealize(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_window_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Window *win;
@@ -1113,7 +1113,7 @@ ewl_window_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
win = EWL_WINDOW(w);
if (!win->window)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
ewl_engine_window_borderless_set(win);
@@ -1121,14 +1121,14 @@ ewl_window_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
* Now give the windows the appropriate size
*/
if (win->flags & EWL_WINDOW_USER_CONFIGURE)
- win->flags &= ~EWL_WINDOW_USER_CONFIGURE;
+ win->flags &= ~EWL_WINDOW_USER_CONFIGURE;
else
- ewl_engine_window_resize(win);
+ ewl_engine_window_resize(win);
ewl_engine_window_show(win);
if (win->flags & EWL_WINDOW_OVERRIDE)
- ewl_widget_configure(w);
+ ewl_widget_configure(w);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1143,7 +1143,7 @@ ewl_window_cb_show(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_window_cb_expose(Ewl_Widget *w, void *ev __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Window *win;
@@ -1169,7 +1169,7 @@ ewl_window_cb_expose(Ewl_Widget *w, void *ev __UNUSED__,
*/
void
ewl_window_cb_hide(Ewl_Widget *widget, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Window *win;
@@ -1181,10 +1181,10 @@ ewl_window_cb_hide(Ewl_Widget *widget, void *ev_data __UNUSED__,
ewl_engine_window_hide(win);
if (win->flags & EWL_WINDOW_GRAB_KEYBOARD)
- ewl_engine_keyboard_ungrab(win);
+ ewl_engine_keyboard_ungrab(win);
if (win->flags & EWL_WINDOW_GRAB_POINTER)
- ewl_engine_pointer_ungrab(win);
+ ewl_engine_pointer_ungrab(win);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1199,7 +1199,7 @@ ewl_window_cb_hide(Ewl_Widget *widget, void *ev_data __UNUSED__,
*/
void
ewl_window_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Window *win;
@@ -1214,7 +1214,7 @@ ewl_window_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
IF_FREE(win->classname);
if ((win = ecore_list_goto(ewl_window_list, win)))
- ecore_list_remove(ewl_window_list);
+ ecore_list_remove(ewl_window_list);
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
@@ -1229,7 +1229,7 @@ ewl_window_cb_destroy(Ewl_Widget *w, void *ev_data __UNUSED__,
*/
void
ewl_window_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
- void *user_data __UNUSED__)
+ void *user_data __UNUSED__)
{
Ewl_Window *win;
@@ -1240,22 +1240,22 @@ ewl_window_cb_configure(Ewl_Widget *w, void *ev_data __UNUSED__,
win = EWL_WINDOW(w);
if (!win->window)
- DRETURN(DLEVEL_STABLE);
+ DRETURN(DLEVEL_STABLE);
/*
* Now give the windows the appropriate size and adjust the evas as
* well.
*/
if (win->flags & EWL_WINDOW_USER_CONFIGURE)
- win->flags &= ~EWL_WINDOW_USER_CONFIGURE;
+ win->flags &= ~EWL_WINDOW_USER_CONFIGURE;
else
- ewl_engine_window_resize(win);
+ ewl_engine_window_resize(win);
ewl_engine_canvas_output_set(EWL_EMBED(win),
- ewl_object_current_x_get(EWL_OBJECT(win)),
- ewl_object_current_y_get(EWL_OBJECT(win)),
- ewl_object_current_w_get(EWL_OBJECT(win)),
- ewl_object_current_h_get(EWL_OBJECT(win)));
+ ewl_object_current_x_get(EWL_OBJECT(win)),
+ ewl_object_current_y_get(EWL_OBJECT(win)),
+ ewl_object_current_w_get(EWL_OBJECT(win)),
+ ewl_object_current_h_get(EWL_OBJECT(win)));
/*
* Adjust the minimum and maximum window bounds to match the widget.
diff --git a/src/lib/ewl_window.h b/src/lib/ewl_window.h
index 870ad70..0c221b2 100644
--- a/src/lib/ewl_window.h
+++ b/src/lib/ewl_window.h
@@ -54,12 +54,12 @@ struct Ewl_Window
void *window; /**< Provides a window for drawing */
union {
- Ewl_Window *ewl;
- Ewl_Embed_Window *foreign;
+ Ewl_Window *ewl;
+ Ewl_Embed_Window *foreign;
} transient; /**< Window to be transient for */
union {
- Ewl_Window *ewl;
- Ewl_Embed_Window *foreign;
+ Ewl_Window *ewl;
+ Ewl_Embed_Window *foreign;
} leader; /**< the leader of the window group */
char *title; /**< The current title on the provided window */
@@ -74,49 +74,49 @@ extern unsigned int EWL_CALLBACK_EXPOSE; /**< Triggered when the window needs re
extern unsigned int EWL_CALLBACK_DELETE_WINDOW; /**< The window is being closed */
Ewl_Widget *ewl_window_new(void);
-int ewl_window_init(Ewl_Window *win);
+int ewl_window_init(Ewl_Window *win);
Ewl_Window *ewl_window_window_find(void *window);
-void ewl_window_title_set(Ewl_Window *win, const char *title);
+void ewl_window_title_set(Ewl_Window *win, const char *title);
const char *ewl_window_title_get(Ewl_Window *win);
-void ewl_window_name_set(Ewl_Window *win, const char *name);
+void ewl_window_name_set(Ewl_Window *win, const char *name);
const char *ewl_window_name_get(Ewl_Window *win);
-void ewl_window_class_set(Ewl_Window *win, const char *classname);
+void ewl_window_class_set(Ewl_Window *win, const char *classname);
const char *ewl_window_class_get(Ewl_Window *win);
-void ewl_window_borderless_set(Ewl_Window *win, unsigned int border);
+void ewl_window_borderless_set(Ewl_Window *win, unsigned int border);
unsigned int ewl_window_borderless_get(Ewl_Window *win);
-void ewl_window_dialog_set(Ewl_Window *win, int dialog);
-int ewl_window_dialog_get(Ewl_Window *win);
-void ewl_window_fullscreen_set(Ewl_Window *win,
- unsigned int fullscreen);
+void ewl_window_dialog_set(Ewl_Window *win, int dialog);
+int ewl_window_dialog_get(Ewl_Window *win);
+void ewl_window_fullscreen_set(Ewl_Window *win,
+ unsigned int fullscreen);
unsigned int ewl_window_fullscreen_get(Ewl_Window *win);
-void ewl_window_skip_taskbar_set(Ewl_Window *win,
- unsigned int skip);
+void ewl_window_skip_taskbar_set(Ewl_Window *win,
+ unsigned int skip);
unsigned int ewl_window_skip_taskbar_get(Ewl_Window *win);
-void ewl_window_skip_pager_set(Ewl_Window *win,
- unsigned int skip);
+void ewl_window_skip_pager_set(Ewl_Window *win,
+ unsigned int skip);
unsigned int ewl_window_skip_pager_get(Ewl_Window *win);
-void ewl_window_attention_demand(Ewl_Window *win);
-void ewl_window_urgent_set(Ewl_Window *win, unsigned int urgent);
+void ewl_window_attention_demand(Ewl_Window *win);
+void ewl_window_urgent_set(Ewl_Window *win, unsigned int urgent);
unsigned int ewl_window_urgent_get(Ewl_Window *win);
-void ewl_window_move(Ewl_Window *win, int x, int y);
-void ewl_window_raise(Ewl_Window *win);
-void ewl_window_lower(Ewl_Window *win);
-void ewl_window_transient_for(Ewl_Window *win, Ewl_Window *forwin);
-void ewl_window_transient_for_foreign(Ewl_Window *win,
- Ewl_Embed_Window *forwin);
-void ewl_window_leader_set(Ewl_Window *win, Ewl_Window *leader);
-void ewl_window_leader_foreign_set(Ewl_Window *win,
- Ewl_Embed_Window *leader);
+void ewl_window_move(Ewl_Window *win, int x, int y);
+void ewl_window_raise(Ewl_Window *win);
+void ewl_window_lower(Ewl_Window *win);
+void ewl_window_transient_for(Ewl_Window *win, Ewl_Window *forwin);
+void ewl_window_transient_for_foreign(Ewl_Window *win,
+ Ewl_Embed_Window *forwin);
+void ewl_window_leader_set(Ewl_Window *win, Ewl_Window *leader);
+void ewl_window_leader_foreign_set(Ewl_Window *win,
+ Ewl_Embed_Window *leader);
Ewl_Window *ewl_window_leader_get(Ewl_Window *win);
Ewl_Embed_Window *ewl_window_leader_foreign_get(Ewl_Window *win);
-int ewl_window_modal_get(Ewl_Window *win);
-void ewl_window_modal_set(Ewl_Window *win, int modal);
-void ewl_window_keyboard_grab_set(Ewl_Window *win, int grab);
-int ewl_window_keyboard_grab_get(Ewl_Window *win);
-void ewl_window_pointer_grab_set(Ewl_Window *win, int grab);
-int ewl_window_pointer_grab_get(Ewl_Window *win);
-void ewl_window_override_set(Ewl_Window *win, int override);
-int ewl_window_override_get(Ewl_Window *win);
+int ewl_window_modal_get(Ewl_Window *win);
+void ewl_window_modal_set(Ewl_Window *win, int modal);
+void ewl_window_keyboard_grab_set(Ewl_Window *win, int grab);
+int ewl_window_keyboard_grab_get(Ewl_Window *win);
+void ewl_window_pointer_grab_set(Ewl_Window *win, int grab);
+int ewl_window_pointer_grab_get(Ewl_Window *win);
+void ewl_window_override_set(Ewl_Window *win, int override);
+int ewl_window_override_get(Ewl_Window *win);
/*
* Internally used callbacks, override at your own risk.
@@ -124,7 +124,7 @@ int ewl_window_override_get(Ewl_Window *win);
void ewl_window_cb_realize(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_window_cb_postrealize(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_window_cb_realize_parent(Ewl_Widget *w, void *ev_data,
- void *user_data);
+ void *user_data);
void ewl_window_cb_unrealize(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_window_cb_show(Ewl_Widget *w, void *ev_data, void *user_data);
void ewl_window_cb_expose(Ewl_Widget *w, void *ev, void *user_data);
diff --git a/src/plugins/ewl_io_manager_image_plugin.c b/src/plugins/ewl_io_manager_image_plugin.c
index 2612ada..8e48cd7 100644
--- a/src/plugins/ewl_io_manager_image_plugin.c
+++ b/src/plugins/ewl_io_manager_image_plugin.c
@@ -44,7 +44,7 @@ ewl_io_manager_plugin_uri_write(Ewl_Widget *data, const char *uri)
img = EWL_IMAGE(data);
if (!img->image)
- DRETURN_INT(ret, DLEVEL_STABLE);
+ DRETURN_INT(ret, DLEVEL_STABLE);
ret = evas_object_image_save(img->image, uri, NULL, NULL);
@@ -53,7 +53,7 @@ ewl_io_manager_plugin_uri_write(Ewl_Widget *data, const char *uri)
int
ewl_io_manager_plugin_string_write(Ewl_Widget *data,
- const char **string __UNUSED__)
+ const char **string __UNUSED__)
{
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET(data, FALSE);
diff --git a/src/plugins/ewl_io_manager_text_c_plugin.c b/src/plugins/ewl_io_manager_text_c_plugin.c
index 57714d2..8e2d6b0 100644
--- a/src/plugins/ewl_io_manager_text_c_plugin.c
+++ b/src/plugins/ewl_io_manager_text_c_plugin.c
@@ -73,10 +73,10 @@ setup_hash()
key2 = ecore_hash_new(ecore_str_hash, ecore_str_compare);
for (i = 0; keywords1[i] != NULL; i++)
- ecore_hash_set(key1, keywords1[i], keywords1[i]);
+ ecore_hash_set(key1, keywords1[i], keywords1[i]);
for (i = 0; keywords2[i] != NULL; i++)
- ecore_hash_set(key2, keywords2[i], keywords2[i]);
+ ecore_hash_set(key2, keywords2[i], keywords2[i]);
}
Ewl_Widget *
@@ -89,26 +89,26 @@ ewl_io_manager_plugin_uri_read(const char *uri)
DCHECK_PARAM_PTR_RET(uri, NULL);
if (!key1)
- setup_hash();
+ setup_hash();
file = fopen(uri, "r");
if (file)
{
- struct stat buf;
- char *str;
+ struct stat buf;
+ char *str;
- ret = ewl_text_new();
- ewl_text_font_set(EWL_TEXT(ret), "ewl/monospace");
+ ret = ewl_text_new();
+ ewl_text_font_set(EWL_TEXT(ret), "ewl/monospace");
- stat(uri, &buf);
- str = malloc(sizeof(char) * (buf.st_size + 1));
- fread(str, buf.st_size, 1, file);
- str[buf.st_size] = '\0';
- fclose(file);
+ stat(uri, &buf);
+ str = malloc(sizeof(char) * (buf.st_size + 1));
+ fread(str, buf.st_size, 1, file);
+ str[buf.st_size] = '\0';
+ fclose(file);
- text_set(EWL_TEXT(ret), str);
- FREE(str);
+ text_set(EWL_TEXT(ret), str);
+ FREE(str);
}
DRETURN_PTR(ret, DLEVEL_STABLE);
@@ -123,7 +123,7 @@ ewl_io_manager_plugin_string_read(const char *string)
DENTER_FUNCTION(DLEVEL_STABLE);
if (!key1)
- setup_hash();
+ setup_hash();
ret = ewl_text_new();
ewl_text_font_set(EWL_TEXT(ret), "ewl/monospace");
@@ -148,15 +148,15 @@ ewl_io_manager_plugin_uri_write(Ewl_Widget *data, const char *uri)
file = fopen(uri, "w");
if (file)
{
- char *txt;
+ char *txt;
- txt = ewl_text_text_get(EWL_TEXT(data));
- fwrite(txt, sizeof(char), strlen(txt), file);
+ txt = ewl_text_text_get(EWL_TEXT(data));
+ fwrite(txt, sizeof(char), strlen(txt), file);
- FREE(txt);
- fclose(file);
+ FREE(txt);
+ fclose(file);
- ret = TRUE;
+ ret = TRUE;
}
DRETURN_INT(ret, DLEVEL_STABLE);
@@ -181,7 +181,7 @@ string_is_keyword(Ecore_Hash *keys, const char *string)
DCHECK_PARAM_PTR_RET(string, FALSE);
DRETURN_INT(((ecore_hash_get(keys, string) != NULL) ? TRUE : FALSE),
- DLEVEL_STABLE);
+ DLEVEL_STABLE);
}
static void
@@ -192,111 +192,111 @@ text_set(Ewl_Text *t, char *text)
tx1 = tx2 = text;
while (*tx1)
{
- int mode;
- char remc = '\0';
-
- /* decide what case we are dealing with */
- if (isalpha(*tx1) || (*tx1 == '_'))
- mode = COMMAND;
-
- else if ((*tx1 == '/') && (*(tx1 + 1) == '*'))
- mode = C_COMMENT;
-
- else if ((*tx1 == '/') && (*(tx1 + 1) == '/'))
- mode = CPP_COMMENT;
-
- else if (*tx1 == '#')
- mode = PREPROCESSOR;
-
- else if (isdigit(*tx1))
- mode = NUMBER;
-
- else if (*tx1 == '\"' && !( tx1 != text && *(tx1 - 1) == '\\'))
- mode = STRING;
-
- else
- mode = REST;
-
- /*
- * finde the end of the mode
- */
- tx2++;
- switch (mode)
- {
- case NUMBER:
- case COMMAND:
- while(isalnum(*tx2) || (*tx2 == '_'))
- tx2++;
- break;
-
- case C_COMMENT:
- while((*tx2 != '\0') &&
- (!((*tx2 == '*')
- && (*(tx2 + 1) == '/'))))
- tx2++;
-
- /* skip over the * and / characters */
- if (*tx2) tx2 += 2;
- break;
-
- case PREPROCESSOR:
- case CPP_COMMENT:
- while((*tx2 != '\0') && (*tx2 != '\n'))
- tx2++;
- break;
-
- case STRING:
- while((*tx2 != '\0')
- && !((*tx2 == '\"')
- && (*(tx2 - 1) != '\\')))
- tx2++;
-
- if (*tx2) tx2++;
- break;
-
- case REST:
- while(!isalnum(*tx2) && (*tx2 != '\0')
- && (*tx2 != '#')
- && (*tx2 != '/')
- && (*tx2 != '\"'))
- tx2++;
- break;
-
- default:
- break;
- }
-
- /* append the text */
- remc = *tx2;
- *tx2 = '\0';
-
- if (mode == COMMAND && ((tx2 - tx1) < 8) &&
- string_is_keyword(key1, tx1))
- ewl_text_color_set(t, 68, 144, 169, 255);
-
- else if ((mode == COMMAND) && ((tx2 - tx1) < 8) &&
- string_is_keyword(key2, tx1))
- ewl_text_color_set(t, 26, 117, 3, 255);
-
- else if (mode == STRING)
- ewl_text_color_set(t, 217, 0, 0, 255);
-
- else if ((mode == C_COMMENT) || (mode == CPP_COMMENT))
- ewl_text_color_set(t, 106, 15, 159, 255);
-
- else if (mode == PREPROCESSOR)
- ewl_text_color_set(t, 153, 85, 29, 255);
-
- else if (mode == NUMBER)
- ewl_text_color_set(t, 255, 114, 0, 255);
-
- else
- ewl_text_color_set(t, 0, 0, 0, 255);
-
- ewl_text_text_append(t, tx1);
-
- *tx2 = remc;
- tx1 = tx2;
+ int mode;
+ char remc = '\0';
+
+ /* decide what case we are dealing with */
+ if (isalpha(*tx1) || (*tx1 == '_'))
+ mode = COMMAND;
+
+ else if ((*tx1 == '/') && (*(tx1 + 1) == '*'))
+ mode = C_COMMENT;
+
+ else if ((*tx1 == '/') && (*(tx1 + 1) == '/'))
+ mode = CPP_COMMENT;
+
+ else if (*tx1 == '#')
+ mode = PREPROCESSOR;
+
+ else if (isdigit(*tx1))
+ mode = NUMBER;
+
+ else if (*tx1 == '\"' && !( tx1 != text && *(tx1 - 1) == '\\'))
+ mode = STRING;
+
+ else
+ mode = REST;
+
+ /*
+ * finde the end of the mode
+ */
+ tx2++;
+ switch (mode)
+ {
+ case NUMBER:
+ case COMMAND:
+ while(isalnum(*tx2) || (*tx2 == '_'))
+ tx2++;
+ break;
+
+ case C_COMMENT:
+ while((*tx2 != '\0') &&
+ (!((*tx2 == '*')
+ && (*(tx2 + 1) == '/'))))
+ tx2++;
+
+ /* skip over the * and / characters */
+ if (*tx2) tx2 += 2;
+ break;
+
+ case PREPROCESSOR:
+ case CPP_COMMENT:
+ while((*tx2 != '\0') && (*tx2 != '\n'))
+ tx2++;
+ break;
+
+ case STRING:
+ while((*tx2 != '\0')
+ && !((*tx2 == '\"')
+ && (*(tx2 - 1) != '\\')))
+ tx2++;
+
+ if (*tx2) tx2++;
+ break;
+
+ case REST:
+ while(!isalnum(*tx2) && (*tx2 != '\0')
+ && (*tx2 != '#')
+ && (*tx2 != '/')
+ && (*tx2 != '\"'))
+ tx2++;
+ break;
+
+ default:
+ break;
+ }
+
+ /* append the text */
+ remc = *tx2;
+ *tx2 = '\0';
+
+ if (mode == COMMAND && ((tx2 - tx1) < 8) &&
+ string_is_keyword(key1, tx1))
+ ewl_text_color_set(t, 68, 144, 169, 255);
+
+ else if ((mode == COMMAND) && ((tx2 - tx1) < 8) &&
+ string_is_keyword(key2, tx1))
+ ewl_text_color_set(t, 26, 117, 3, 255);
+
+ else if (mode == STRING)
+ ewl_text_color_set(t, 217, 0, 0, 255);
+
+ else if ((mode == C_COMMENT) || (mode == CPP_COMMENT))
+ ewl_text_color_set(t, 106, 15, 159, 255);
+
+ else if (mode == PREPROCESSOR)
+ ewl_text_color_set(t, 153, 85, 29, 255);
+
+ else if (mode == NUMBER)
+ ewl_text_color_set(t, 255, 114, 0, 255);
+
+ else
+ ewl_text_color_set(t, 0, 0, 0, 255);
+
+ ewl_text_text_append(t, tx1);
+
+ *tx2 = remc;
+ tx1 = tx2;
}
}
diff --git a/src/plugins/ewl_io_manager_text_plugin.c b/src/plugins/ewl_io_manager_text_plugin.c
index f7622d1..c5e5a4f 100644
--- a/src/plugins/ewl_io_manager_text_plugin.c
+++ b/src/plugins/ewl_io_manager_text_plugin.c
@@ -17,19 +17,19 @@ ewl_io_manager_plugin_uri_read(const char *uri)
file = fopen(uri, "r");
if (file)
{
- struct stat buf;
- char *str;
+ struct stat buf;
+ char *str;
- ret = ewl_text_new();
+ ret = ewl_text_new();
- stat(uri, &buf);
- str = malloc(sizeof(char) * (buf.st_size + 1));
- fread(str, buf.st_size, 1, file);
- str[buf.st_size] = '\0';
- fclose(file);
+ stat(uri, &buf);
+ str = malloc(sizeof(char) * (buf.st_size + 1));
+ fread(str, buf.st_size, 1, file);
+ str[buf.st_size] = '\0';
+ fclose(file);
- ewl_text_text_set(EWL_TEXT(ret), str);
- FREE(str);
+ ewl_text_text_set(EWL_TEXT(ret), str);
+ FREE(str);
}
DRETURN_PTR(ret, DLEVEL_STABLE);
@@ -62,15 +62,15 @@ ewl_io_manager_plugin_uri_write(Ewl_Widget *data, const char *uri)
file = fopen(uri, "w");
if (file)
{
- char *txt;
+ char *txt;
- txt = ewl_text_text_get(EWL_TEXT(data));
- fwrite(txt, sizeof(char), strlen(txt), file);
+ txt = ewl_text_text_get(EWL_TEXT(data));
+ fwrite(txt, sizeof(char), strlen(txt), file);
- FREE(txt);
- fclose(file);
+ FREE(txt);
+ fclose(file);
- ret = TRUE;
+ ret = TRUE;
}
DRETURN_INT(ret, DLEVEL_STABLE);
diff --git a/tools/ewl_config/ewl_config.c b/tools/ewl_config/ewl_config.c
index fef4b9b..48c832f 100644
--- a/tools/ewl_config/ewl_config.c
+++ b/tools/ewl_config/ewl_config.c
@@ -57,92 +57,92 @@ main(int argc, char ** argv)
if (!ewl_init(&argc, argv))
{
- fprintf(stderr, "Unable to init ewl.\n");
- goto EXIT;
+ fprintf(stderr, "Unable to init ewl.\n");
+ goto EXIT;
}
for (i = 1; i < argc; i++)
{
- if ((!strncmp(argv[i], "-s", 2))
- || (!strncmp(argv[i], "-set", 4)))
- {
- if (++i < argc)
- {
- char *t, *key, *val;
-
- t = strdup(argv[i]);
- key = t;
- val = strchr(t, '=');
-
- if (!val)
- {
- usage();
- goto EWL_SHUTDOWN;
- }
-
- *val = '\0';
- val++;
-
- ewl_config_string_set(ewl_config, key, val,
- EWL_STATE_PERSISTENT);
- free(t);
-
- did_something = 1;
- }
- else
- {
- usage();
- goto EWL_SHUTDOWN;
- }
- }
- else if ((!strncmp(argv[i], "-g", 2))
- || (!strncmp(argv[i], "-get", 4)))
- {
- if (++i < argc)
- {
- const char *val;
-
- val = ewl_config_string_get(ewl_config, argv[i]);
- printf("%s = %s\n", argv[i], val);
-
- did_something = 1;
- }
- else
- {
- usage();
- goto EWL_SHUTDOWN;
- }
- }
- else if (!strncmp(argv[i], "-r", 2))
- {
- if (!ewl_config_can_save_system(ewl_config))
- {
- fprintf(stderr, "Insufficient permission to save "
- "system configuration.\n");
- goto EWL_SHUTDOWN;
- }
- save_system = 1;
- }
- else if ((!strncmp(argv[i], "-h", 2))
- || (!strncasecmp(argv[i], "--help", 6)))
- {
- usage();
- ret = 0;
- goto EWL_SHUTDOWN;
- }
+ if ((!strncmp(argv[i], "-s", 2))
+ || (!strncmp(argv[i], "-set", 4)))
+ {
+ if (++i < argc)
+ {
+ char *t, *key, *val;
+
+ t = strdup(argv[i]);
+ key = t;
+ val = strchr(t, '=');
+
+ if (!val)
+ {
+ usage();
+ goto EWL_SHUTDOWN;
+ }
+
+ *val = '\0';
+ val++;
+
+ ewl_config_string_set(ewl_config, key, val,
+ EWL_STATE_PERSISTENT);
+ free(t);
+
+ did_something = 1;
+ }
+ else
+ {
+ usage();
+ goto EWL_SHUTDOWN;
+ }
+ }
+ else if ((!strncmp(argv[i], "-g", 2))
+ || (!strncmp(argv[i], "-get", 4)))
+ {
+ if (++i < argc)
+ {
+ const char *val;
+
+ val = ewl_config_string_get(ewl_config, argv[i]);
+ printf("%s = %s\n", argv[i], val);
+
+ did_something = 1;
+ }
+ else
+ {
+ usage();
+ goto EWL_SHUTDOWN;
+ }
+ }
+ else if (!strncmp(argv[i], "-r", 2))
+ {
+ if (!ewl_config_can_save_system(ewl_config))
+ {
+ fprintf(stderr, "Insufficient permission to save "
+ "system configuration.\n");
+ goto EWL_SHUTDOWN;
+ }
+ save_system = 1;
+ }
+ else if ((!strncmp(argv[i], "-h", 2))
+ || (!strncasecmp(argv[i], "--help", 6)))
+ {
+ usage();
+ ret = 0;
+ goto EWL_SHUTDOWN;
+ }
}
if (did_something)
{
- if (save_system)
- ewl_config_system_save(ewl_config);
- else
- ewl_config_user_save(ewl_config);
+ if (save_system)
+ ewl_config_system_save(ewl_config);
+ else
+ ewl_config_user_save(ewl_config);
}
else
{
- ec_main_win(save_system);
- ewl_main();
+ ec_main_win(save_system);
+ ewl_main();
}
ret = 0;
@@ -157,11 +157,11 @@ static void
usage(void)
{
printf("\n"
- "ewl_config [OPTIONS] [-set key=value] [-get key]\n"
- " OPTIONS\n"
- " -r \t - Save the system configuration file\n"
- " -h|--help \t - Print help information\n"
- "\n");
+ "ewl_config [OPTIONS] [-set key=value] [-get key]\n"
+ " OPTIONS\n"
+ " -r \t - Save the system configuration file\n"
+ " -h|--help \t - Print help information\n"
+ "\n");
}
static void
@@ -176,7 +176,7 @@ ec_main_win(int save_system)
ewl_object_size_request(EWL_OBJECT(o), 450, 250);
ewl_widget_name_set(o, EC_WIN_MAIN);
ewl_callback_append(o, EWL_CALLBACK_DELETE_WINDOW,
- ec_cb_delete_window, NULL);
+ ec_cb_delete_window, NULL);
ewl_widget_show(o);
box = ewl_vbox_new();
@@ -187,7 +187,7 @@ ec_main_win(int save_system)
ewl_container_child_append(EWL_CONTAINER(box), o);
ec_menubar_setup(EWL_MENUBAR(o));
ewl_object_fill_policy_set(EWL_OBJECT(o),
- EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
+ EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VSHRINK);
ewl_widget_show(o);
o = ewl_notebook_new();
@@ -214,9 +214,9 @@ ec_main_win(int save_system)
o = ewl_button_new();
ewl_button_label_set(EWL_BUTTON(o), "Revert");
ewl_button_image_set(EWL_BUTTON(o),
- ewl_icon_theme_icon_path_get(EWL_ICON_DIALOG_CANCEL,
- EWL_ICON_SIZE_MEDIUM),
- EWL_ICON_DIALOG_CANCEL);
+ ewl_icon_theme_icon_path_get(EWL_ICON_DIALOG_CANCEL,
+ EWL_ICON_SIZE_MEDIUM),
+ EWL_ICON_DIALOG_CANCEL);
ewl_container_child_append(EWL_CONTAINER(o2), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED, ec_cb_revert, NULL);
ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_VFILL);
@@ -243,12 +243,12 @@ ec_main_win(int save_system)
ewl_widget_show(o);
if (!ewl_config_can_save_system(ewl_config))
- ewl_widget_disable(o);
+ ewl_widget_disable(o);
}
static void
ec_cb_delete_window(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
ewl_main_quit();
}
@@ -261,41 +261,41 @@ ec_menubar_setup(Ewl_Menubar *m)
int i;
Ewl_Menu_Info file_menu[] = {
- {"Save", EC_ICON(DOCUMENT_SAVE), ec_cb_apply},
- {"Revert", EC_ICON(DOCUMENT_REVERT), ec_cb_revert},
- {"Quit", EC_ICON(APPLICATION_EXIT), ec_cb_delete_window},
- {NULL, NULL, NULL}
+ {"Save", EC_ICON(DOCUMENT_SAVE), ec_cb_apply},
+ {"Revert", EC_ICON(DOCUMENT_REVERT), ec_cb_revert},
+ {"Quit", EC_ICON(APPLICATION_EXIT), ec_cb_delete_window},
+ {NULL, NULL, NULL}
};
Ewl_Menu_Info help_menu[] = {
- {"About", EC_ICON(HELP_ABOUT), ec_cb_about},
- {NULL, NULL, NULL}
+ {"About", EC_ICON(HELP_ABOUT), ec_cb_about},
+ {NULL, NULL, NULL}
};
Ec_Gui_Menu menus[] = {
- {"File", file_menu},
- {"Help", help_menu},
- {NULL, NULL}
+ {"File", file_menu},
+ {"Help", help_menu},
+ {NULL, NULL}
};
for (i = 0; menus[i].name != NULL; i++)
{
- /* pack in a spacer before the help text */
- if (menus[i + 1].name == NULL)
- {
- o = ewl_spacer_new();
- ewl_container_child_append(EWL_CONTAINER(m), o);
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_FILL);
- ewl_widget_show(o);
- }
-
- menu = ewl_menu_new();
- ewl_button_label_set(EWL_BUTTON(menu), menus[i].name);
- ewl_container_child_append(EWL_CONTAINER(m), menu);
- ewl_object_fill_policy_set(EWL_OBJECT(menu),
- EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
- ewl_menu_from_info(EWL_MENU(menu), menus[i].info);
- ewl_widget_show(menu);
+ /* pack in a spacer before the help text */
+ if (menus[i + 1].name == NULL)
+ {
+ o = ewl_spacer_new();
+ ewl_container_child_append(EWL_CONTAINER(m), o);
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_FILL);
+ ewl_widget_show(o);
+ }
+
+ menu = ewl_menu_new();
+ ewl_button_label_set(EWL_BUTTON(menu), menus[i].name);
+ ewl_container_child_append(EWL_CONTAINER(m), menu);
+ ewl_object_fill_policy_set(EWL_OBJECT(menu),
+ EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_VFILL);
+ ewl_menu_from_info(EWL_MENU(menu), menus[i].info);
+ ewl_widget_show(menu);
}
}
@@ -337,11 +337,11 @@ ec_theme_page_setup(Ewl_Notebook *n)
rep = opendir(PACKAGE_DATA_DIR "/ewl/themes");
if (rep)
{
- int ret;
+ int ret;
- ret = ec_themes_get(rep, list, v);
- if (ret >= 0)
- sel = ret;
+ ret = ec_themes_get(rep, list, v);
+ if (ret >= 0)
+ sel = ret;
}
closedir(rep);
@@ -350,16 +350,16 @@ ec_theme_page_setup(Ewl_Notebook *n)
rep = opendir(path);
if (rep)
{
- int ret;
+ int ret;
- ret = ec_themes_get(rep, list, v);
- if (ret >= 0)
- sel = ret;
+ ret = ec_themes_get(rep, list, v);
+ if (ret >= 0)
+ sel = ret;
}
closedir(rep);
if (sel >= 0)
- ewl_mvc_selected_set(EWL_MVC(o), NULL, list, sel, 0);
+ ewl_mvc_selected_set(EWL_MVC(o), NULL, list, sel, 0);
ewl_mvc_dirty_set(EWL_MVC(o), TRUE);
o2 = ewl_border_new();
@@ -382,7 +382,7 @@ ec_theme_page_setup(Ewl_Notebook *n)
ewl_widget_name_set(o, EC_ICON_THEME);
ewl_container_child_append(EWL_CONTAINER(box), o);
ewl_text_text_set(EWL_TEXT(o),
- ewl_config_string_get(ewl_config, EWL_CONFIG_THEME_ICON_THEME));
+ ewl_config_string_get(ewl_config, EWL_CONFIG_THEME_ICON_THEME));
ewl_widget_show(o);
o = ewl_label_new();
@@ -428,7 +428,7 @@ ec_engine_page_setup(Ewl_Notebook *n)
o = ewl_entry_new();
ewl_widget_name_set(o, EC_ENGINE_NAME);
ewl_text_text_set(EWL_TEXT(o),
- ewl_config_string_get(ewl_config, EWL_CONFIG_ENGINE_NAME));
+ ewl_config_string_get(ewl_config, EWL_CONFIG_ENGINE_NAME));
ewl_container_child_append(EWL_CONTAINER(o2), o);
ewl_widget_show(o);
@@ -441,7 +441,7 @@ ec_engine_page_setup(Ewl_Notebook *n)
o = ewl_entry_new();
ewl_widget_name_set(o, EC_EVAS_FONT_CACHE);
ewl_text_text_set(EWL_TEXT(o),
- ewl_config_string_get(ewl_config, EWL_CONFIG_CACHE_EVAS_FONT));
+ ewl_config_string_get(ewl_config, EWL_CONFIG_CACHE_EVAS_FONT));
ewl_container_child_append(EWL_CONTAINER(o2), o);
ewl_widget_show(o);
@@ -454,7 +454,7 @@ ec_engine_page_setup(Ewl_Notebook *n)
o = ewl_entry_new();
ewl_widget_name_set(o, EC_EVAS_IMAGE_CACHE);
ewl_text_text_set(EWL_TEXT(o),
- ewl_config_string_get(ewl_config, EWL_CONFIG_CACHE_EVAS_IMAGE));
+ ewl_config_string_get(ewl_config, EWL_CONFIG_CACHE_EVAS_IMAGE));
ewl_container_child_append(EWL_CONTAINER(o2), o);
ewl_widget_show(o);
}
@@ -467,20 +467,20 @@ ec_debug_page_setup(Ewl_Notebook *n)
struct
{
- char *label;
- char *key;
- char *name;
- int spinner;
+ char *label;
+ char *key;
+ char *name;
+ int spinner;
} buttons[] = {
- {"Enabled", EWL_CONFIG_DEBUG_ENABLE, EC_DEBUG_ENABLE, 0},
- {"Level", EWL_CONFIG_DEBUG_LEVEL, EC_DEBUG_LEVEL, 1},
- {"Segv", EWL_CONFIG_DEBUG_SEGV, EC_DEBUG_SEGV, 0},
- {"Backtrace", EWL_CONFIG_DEBUG_BACKTRACE, EC_DEBUG_BACKTRACE, 0},
- {"Evas rendering", EWL_CONFIG_DEBUG_EVAS_RENDER, EC_DEBUG_EVAS_RENDER, 0},
- {"Garbage Collection", EWL_CONFIG_DEBUG_GC_REAP, EC_DEBUG_GARBAGE, 0},
- {"Print theme keys", EWL_CONFIG_THEME_PRINT_KEYS, EC_THEME_KEYS, 0},
- {"Print theme signals", EWL_CONFIG_THEME_PRINT_SIGNALS, EC_THEME_SIGNALS, 0},
- {NULL, NULL, NULL, 0}
+ {"Enabled", EWL_CONFIG_DEBUG_ENABLE, EC_DEBUG_ENABLE, 0},
+ {"Level", EWL_CONFIG_DEBUG_LEVEL, EC_DEBUG_LEVEL, 1},
+ {"Segv", EWL_CONFIG_DEBUG_SEGV, EC_DEBUG_SEGV, 0},
+ {"Backtrace", EWL_CONFIG_DEBUG_BACKTRACE, EC_DEBUG_BACKTRACE, 0},
+ {"Evas rendering", EWL_CONFIG_DEBUG_EVAS_RENDER, EC_DEBUG_EVAS_RENDER, 0},
+ {"Garbage Collection", EWL_CONFIG_DEBUG_GC_REAP, EC_DEBUG_GARBAGE, 0},
+ {"Print theme keys", EWL_CONFIG_THEME_PRINT_KEYS, EC_THEME_KEYS, 0},
+ {"Print theme signals", EWL_CONFIG_THEME_PRINT_SIGNALS, EC_THEME_SIGNALS, 0},
+ {NULL, NULL, NULL, 0}
};
box = ewl_vbox_new();
@@ -492,62 +492,62 @@ ec_debug_page_setup(Ewl_Notebook *n)
ewl_grid_vhomogeneous_set(EWL_GRID(o2), TRUE);
ewl_container_child_append(EWL_CONTAINER(box), o2);
ewl_object_fill_policy_set(EWL_OBJECT(o2), EWL_FLAG_FILL_HSHRINK |
- EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_HFILL);
ewl_widget_show(o2);
for (i = 0; buttons[i].label != NULL; i++)
{
- Ewl_Widget *o;
-
- if (buttons[i].spinner)
- {
- Ewl_Widget *s;
-
- o = ewl_hbox_new();
- ewl_widget_show(o);
-
- s = ewl_label_new();
- ewl_label_text_set(EWL_LABEL(s), buttons[i].label);
- ewl_container_child_append(EWL_CONTAINER(o), s);
- ewl_widget_show(s);
-
- s = ewl_spinner_new();
- ewl_widget_name_set(s, buttons[i].name);
- ewl_spinner_digits_set(EWL_SPINNER(s), 0);
- ewl_range_minimum_value_set(EWL_RANGE(s), 0);
- ewl_range_maximum_value_set(EWL_RANGE(s), 100);
- ewl_range_step_set(EWL_RANGE(s), 1);
- ewl_range_value_set(EWL_RANGE(s),
- ewl_config_int_get(ewl_config, buttons[i].key));
- ewl_container_child_append(EWL_CONTAINER(o), s);
- ewl_widget_show(s);
- }
- else
- {
- o = ewl_checkbutton_new();
- ewl_widget_name_set(o, buttons[i].name);
- ewl_object_alignment_set(EWL_OBJECT(o),
- EWL_FLAG_ALIGN_LEFT);
- ewl_button_label_set(EWL_BUTTON(o), buttons[i].label);
- ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o),
- ewl_config_int_get(ewl_config, buttons[i].key));
- ewl_widget_show(o);
- }
- ewl_container_child_append(EWL_CONTAINER(o2), o);
+ Ewl_Widget *o;
+
+ if (buttons[i].spinner)
+ {
+ Ewl_Widget *s;
+
+ o = ewl_hbox_new();
+ ewl_widget_show(o);
+
+ s = ewl_label_new();
+ ewl_label_text_set(EWL_LABEL(s), buttons[i].label);
+ ewl_container_child_append(EWL_CONTAINER(o), s);
+ ewl_widget_show(s);
+
+ s = ewl_spinner_new();
+ ewl_widget_name_set(s, buttons[i].name);
+ ewl_spinner_digits_set(EWL_SPINNER(s), 0);
+ ewl_range_minimum_value_set(EWL_RANGE(s), 0);
+ ewl_range_maximum_value_set(EWL_RANGE(s), 100);
+ ewl_range_step_set(EWL_RANGE(s), 1);
+ ewl_range_value_set(EWL_RANGE(s),
+ ewl_config_int_get(ewl_config, buttons[i].key));
+ ewl_container_child_append(EWL_CONTAINER(o), s);
+ ewl_widget_show(s);
+ }
+ else
+ {
+ o = ewl_checkbutton_new();
+ ewl_widget_name_set(o, buttons[i].name);
+ ewl_object_alignment_set(EWL_OBJECT(o),
+ EWL_FLAG_ALIGN_LEFT);
+ ewl_button_label_set(EWL_BUTTON(o), buttons[i].label);
+ ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o),
+ ewl_config_int_get(ewl_config, buttons[i].key));
+ ewl_widget_show(o);
+ }
+ ewl_container_child_append(EWL_CONTAINER(o2), o);
}
}
static void
ec_cb_about(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *about, *o;
about = ewl_widget_name_find(EC_WIN_ABOUT);
if (about)
{
- ewl_widget_show(about);
- return;
+ ewl_widget_show(about);
+ return;
}
about = ewl_dialog_new();
@@ -556,9 +556,9 @@ ec_cb_about(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
ewl_window_class_set(EWL_WINDOW(about), "ewl_config");
ewl_widget_name_set(about, EC_WIN_ABOUT);
ewl_window_transient_for(EWL_WINDOW(about),
- EWL_WINDOW(ewl_widget_name_find(EC_WIN_MAIN)));
+ EWL_WINDOW(ewl_widget_name_find(EC_WIN_MAIN)));
ewl_callback_append(about, EWL_CALLBACK_DELETE_WINDOW,
- ec_cb_win_hide, about);
+ ec_cb_win_hide, about);
ewl_widget_show(about);
ewl_dialog_active_area_set(EWL_DIALOG(about), EWL_POSITION_TOP);
@@ -601,7 +601,7 @@ ec_cb_win_hide(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__, void *data)
static void
ec_cb_revert(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *o;
Ecore_List *list;
@@ -610,29 +610,29 @@ ec_cb_revert(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
struct
{
- char *name;
- char *key;
+ char *name;
+ char *key;
} checks[] = {
- {EC_DEBUG_ENABLE, EWL_CONFIG_DEBUG_ENABLE},
- {EC_DEBUG_SEGV, EWL_CONFIG_DEBUG_SEGV},
- {EC_DEBUG_BACKTRACE, EWL_CONFIG_DEBUG_BACKTRACE},
- {EC_DEBUG_EVAS_RENDER, EWL_CONFIG_DEBUG_EVAS_RENDER},
- {EC_DEBUG_GARBAGE, EWL_CONFIG_DEBUG_GC_REAP},
- {EC_THEME_KEYS, EWL_CONFIG_THEME_PRINT_KEYS},
- {EC_THEME_SIGNALS, EWL_CONFIG_THEME_PRINT_SIGNALS},
- {NULL, NULL}
+ {EC_DEBUG_ENABLE, EWL_CONFIG_DEBUG_ENABLE},
+ {EC_DEBUG_SEGV, EWL_CONFIG_DEBUG_SEGV},
+ {EC_DEBUG_BACKTRACE, EWL_CONFIG_DEBUG_BACKTRACE},
+ {EC_DEBUG_EVAS_RENDER, EWL_CONFIG_DEBUG_EVAS_RENDER},
+ {EC_DEBUG_GARBAGE, EWL_CONFIG_DEBUG_GC_REAP},
+ {EC_THEME_KEYS, EWL_CONFIG_THEME_PRINT_KEYS},
+ {EC_THEME_SIGNALS, EWL_CONFIG_THEME_PRINT_SIGNALS},
+ {NULL, NULL}
};
struct
{
- char *name;
- char *key;
+ char *name;
+ char *key;
} strings[] = {
- {EC_ICON_THEME, EWL_CONFIG_THEME_ICON_THEME},
- {EC_ENGINE_NAME, EWL_CONFIG_ENGINE_NAME},
- {EC_EVAS_IMAGE_CACHE, EWL_CONFIG_CACHE_EVAS_IMAGE},
- {EC_EVAS_FONT_CACHE, EWL_CONFIG_CACHE_EVAS_FONT},
- {NULL, NULL}
+ {EC_ICON_THEME, EWL_CONFIG_THEME_ICON_THEME},
+ {EC_ENGINE_NAME, EWL_CONFIG_ENGINE_NAME},
+ {EC_EVAS_IMAGE_CACHE, EWL_CONFIG_CACHE_EVAS_IMAGE},
+ {EC_EVAS_FONT_CACHE, EWL_CONFIG_CACHE_EVAS_FONT},
+ {NULL, NULL}
};
o = ewl_widget_name_find(EC_EWL_THEME);
@@ -642,9 +642,9 @@ ec_cb_revert(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
ecore_list_first_goto(list);
while ((lval = ecore_list_next(list)))
{
- if (!strcmp(v, lval))
- break;
- sel++;
+ if (!strcmp(v, lval))
+ break;
+ sel++;
}
ewl_mvc_selected_set(EWL_MVC(o), NULL, list, sel, 0);
@@ -654,26 +654,26 @@ ec_cb_revert(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
for (sel = 0; strings[sel].name != NULL; sel++)
{
- o = ewl_widget_name_find(strings[sel].name);
- ewl_text_text_set(EWL_TEXT(o),
- ewl_config_string_get(ewl_config, strings[sel].key));
+ o = ewl_widget_name_find(strings[sel].name);
+ ewl_text_text_set(EWL_TEXT(o),
+ ewl_config_string_get(ewl_config, strings[sel].key));
}
o = ewl_widget_name_find(EC_DEBUG_LEVEL);
ewl_range_value_set(EWL_RANGE(o),
- ewl_config_int_get(ewl_config, EWL_CONFIG_DEBUG_LEVEL));
+ ewl_config_int_get(ewl_config, EWL_CONFIG_DEBUG_LEVEL));
for (sel = 0; checks[sel].name != NULL; sel++)
{
- o = ewl_widget_name_find(checks[sel].name);
- ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o),
- ewl_config_int_get(ewl_config, checks[sel].key));
+ o = ewl_widget_name_find(checks[sel].name);
+ ewl_checkbutton_checked_set(EWL_CHECKBUTTON(o),
+ ewl_config_int_get(ewl_config, checks[sel].key));
}
}
static void
ec_cb_apply(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
- void *data __UNUSED__)
+ void *data __UNUSED__)
{
Ewl_Widget *o;
Ecore_List *list;
@@ -683,72 +683,72 @@ ec_cb_apply(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
struct
{
- char *name;
- char *key;
+ char *name;
+ char *key;
} checks[] = {
- {EC_DEBUG_ENABLE, EWL_CONFIG_DEBUG_ENABLE},
- {EC_DEBUG_SEGV, EWL_CONFIG_DEBUG_SEGV},
- {EC_DEBUG_BACKTRACE, EWL_CONFIG_DEBUG_BACKTRACE},
- {EC_DEBUG_EVAS_RENDER, EWL_CONFIG_DEBUG_EVAS_RENDER},
- {EC_DEBUG_GARBAGE, EWL_CONFIG_DEBUG_GC_REAP},
- {EC_THEME_KEYS, EWL_CONFIG_THEME_PRINT_KEYS},
- {EC_THEME_SIGNALS, EWL_CONFIG_THEME_PRINT_SIGNALS},
- {NULL, NULL}
+ {EC_DEBUG_ENABLE, EWL_CONFIG_DEBUG_ENABLE},
+ {EC_DEBUG_SEGV, EWL_CONFIG_DEBUG_SEGV},
+ {EC_DEBUG_BACKTRACE, EWL_CONFIG_DEBUG_BACKTRACE},
+ {EC_DEBUG_EVAS_RENDER, EWL_CONFIG_DEBUG_EVAS_RENDER},
+ {EC_DEBUG_GARBAGE, EWL_CONFIG_DEBUG_GC_REAP},
+ {EC_THEME_KEYS, EWL_CONFIG_THEME_PRINT_KEYS},
+ {EC_THEME_SIGNALS, EWL_CONFIG_THEME_PRINT_SIGNALS},
+ {NULL, NULL}
};
struct
{
- char *name;
- char *key;
+ char *name;
+ char *key;
} strings[] = {
- {EC_ICON_THEME, EWL_CONFIG_THEME_ICON_THEME},
- {EC_ENGINE_NAME, EWL_CONFIG_ENGINE_NAME},
- {EC_EVAS_IMAGE_CACHE, EWL_CONFIG_CACHE_EVAS_IMAGE},
- {EC_EVAS_FONT_CACHE, EWL_CONFIG_CACHE_EVAS_FONT},
- {NULL, NULL}
+ {EC_ICON_THEME, EWL_CONFIG_THEME_ICON_THEME},
+ {EC_ENGINE_NAME, EWL_CONFIG_ENGINE_NAME},
+ {EC_EVAS_IMAGE_CACHE, EWL_CONFIG_CACHE_EVAS_IMAGE},
+ {EC_EVAS_FONT_CACHE, EWL_CONFIG_CACHE_EVAS_FONT},
+ {NULL, NULL}
};
for (i = 0; checks[i].name != NULL; i++)
{
- o = ewl_widget_name_find(checks[i].name);
- if (ewl_checkbutton_is_checked(EWL_CHECKBUTTON(o)) !=
- ewl_config_int_get(ewl_config, checks[i].key))
- ewl_config_int_set(ewl_config, checks[i].key,
- ewl_checkbutton_is_checked(EWL_CHECKBUTTON(o)),
- EWL_STATE_PERSISTENT);
+ o = ewl_widget_name_find(checks[i].name);
+ if (ewl_checkbutton_is_checked(EWL_CHECKBUTTON(o)) !=
+ ewl_config_int_get(ewl_config, checks[i].key))
+ ewl_config_int_set(ewl_config, checks[i].key,
+ ewl_checkbutton_is_checked(EWL_CHECKBUTTON(o)),
+ EWL_STATE_PERSISTENT);
}
for (i = 0; strings[i].name != NULL; i++)
{
- char *new;
-
- o = ewl_widget_name_find(strings[i].name);
- new = ewl_text_text_get(EWL_TEXT(o));
- if (strcmp(new, ewl_config_string_get(ewl_config,
- strings[i].key)))
- {
- ewl_config_string_set(ewl_config,
- strings[i].key, new,
- EWL_STATE_PERSISTENT);
- }
+ char *new;
+
+ o = ewl_widget_name_find(strings[i].name);
+ new = ewl_text_text_get(EWL_TEXT(o));
+ if (strcmp(new, ewl_config_string_get(ewl_config,
+ strings[i].key)))
+ {
+ ewl_config_string_set(ewl_config,
+ strings[i].key, new,
+ EWL_STATE_PERSISTENT);
+ }
}
o = ewl_widget_name_find(EC_DEBUG_LEVEL);
if (ewl_range_value_get(EWL_RANGE(o)) !=
- ewl_config_int_get(ewl_config, EWL_CONFIG_DEBUG_LEVEL))
+ ewl_config_int_get(ewl_config, EWL_CONFIG_DEBUG_LEVEL))
{
- ewl_config_int_set(ewl_config, EWL_CONFIG_DEBUG_LEVEL,
- ewl_range_value_get(EWL_RANGE(o)),
- EWL_STATE_PERSISTENT);
+ ewl_config_int_set(ewl_config, EWL_CONFIG_DEBUG_LEVEL,
+ ewl_range_value_get(EWL_RANGE(o)),
+ EWL_STATE_PERSISTENT);
}
o = ewl_widget_name_find(EC_ICON_SIZE);
val = ewl_range_value_get(EWL_RANGE(o));
if (val != ewl_config_int_get(ewl_config, EWL_CONFIG_THEME_ICON_SIZE))
{
- ewl_config_int_set(ewl_config,
- EWL_CONFIG_THEME_ICON_SIZE, val,
- EWL_STATE_PERSISTENT);
+ ewl_config_int_set(ewl_config,
+ EWL_CONFIG_THEME_ICON_SIZE, val,
+ EWL_STATE_PERSISTENT);
}
o = ewl_widget_name_find(EC_EWL_THEME);
@@ -756,28 +756,28 @@ ec_cb_apply(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
idx = ewl_mvc_selected_get(EWL_MVC(o));
if (idx)
{
- ecore_list_index_goto(list, idx->row);
- v = ecore_list_current(list);
-
- if (strcmp(v, ewl_config_string_get(ewl_config,
- EWL_CONFIG_THEME_NAME)))
- {
- ewl_config_string_set(ewl_config,
- EWL_CONFIG_THEME_NAME, v,
- EWL_STATE_PERSISTENT);
- }
+ ecore_list_index_goto(list, idx->row);
+ v = ecore_list_current(list);
+
+ if (strcmp(v, ewl_config_string_get(ewl_config,
+ EWL_CONFIG_THEME_NAME)))
+ {
+ ewl_config_string_set(ewl_config,
+ EWL_CONFIG_THEME_NAME, v,
+ EWL_STATE_PERSISTENT);
+ }
}
o = ewl_widget_name_find(EC_SAVE_SYSTEM);
if (ewl_checkbutton_is_checked(EWL_CHECKBUTTON(o)))
{
- if (!ewl_config_can_save_system(ewl_config))
- fprintf(stderr, "Cannot save system config.\n");
- else
- ewl_config_system_save(ewl_config);
+ if (!ewl_config_can_save_system(ewl_config))
+ fprintf(stderr, "Cannot save system config.\n");
+ else
+ ewl_config_system_save(ewl_config);
}
else
- ewl_config_user_save(ewl_config);
+ ewl_config_user_save(ewl_config);
}
int
@@ -788,23 +788,23 @@ ec_themes_get(DIR *rep, Ecore_List *list, const char *v)
while ((file = readdir(rep)))
{
- int len;
+ int len;
- len = strlen(file->d_name);
+ len = strlen(file->d_name);
- if ((len >= 4) &&
- (!strcmp(file->d_name + len - 4, ".edj")))
- {
- char *t;
+ if ((len >= 4) &&
+ (!strcmp(file->d_name + len - 4, ".edj")))
+ {
+ char *t;
- t = strdup(file->d_name);
- *(t + len - 4) = '\0';
+ t = strdup(file->d_name);
+ *(t + len - 4) = '\0';
- ecore_list_append(list, t);
+ ecore_list_append(list, t);
- if (!strcmp(t, v))
- z = ecore_list_count(list) - 1;
- }
+ if (!strcmp(t, v))
+ z = ecore_list_count(list) - 1;
+ }
}
return z;
diff --git a/tools/ewl_edb_ed/ewl_edb_ed.c b/tools/ewl_edb_ed/ewl_edb_ed.c
index 7d764e2..1fa3fac 100644
--- a/tools/ewl_edb_ed/ewl_edb_ed.c
+++ b/tools/ewl_edb_ed/ewl_edb_ed.c
@@ -60,13 +60,13 @@ int main(int argc, char ** argv) {
/* create the tree */
{
- char * headers [] = {
- "type", "key", "value"
- };
+ char * headers [] = {
+ "type", "key", "value"
+ };
tree = ewl_tree_new(3);
ewl_container_child_append(EWL_CONTAINER(hbox), tree);
- ewl_object_padding_set(EWL_OBJECT(tree), 2, 0, 0, 0);
- ewl_tree_headers_set(EWL_TREE(tree), headers);
+ ewl_object_padding_set(EWL_OBJECT(tree), 2, 0, 0, 0);
+ ewl_tree_headers_set(EWL_TREE(tree), headers);
ewl_widget_show(tree);
}
@@ -83,22 +83,22 @@ int main(int argc, char ** argv) {
{
o = ewl_menu_item_new(NULL, "int");
ewl_container_child_append(EWL_CONTAINER(combo), o);
- ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_INT);
+ ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_INT);
ewl_widget_show(o);
o = ewl_menu_item_new(NULL, "str");
ewl_container_child_append(EWL_CONTAINER(combo), o);
- ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_STR);
+ ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_STR);
ewl_widget_show(o);
o = ewl_menu_item_new(NULL, "float");
ewl_container_child_append(EWL_CONTAINER(combo), o);
- ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_FLOAT);
+ ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_FLOAT);
ewl_widget_show(o);
o = ewl_menu_item_new(NULL, "data");
ewl_container_child_append(EWL_CONTAINER(combo), o);
- ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_DATA);
+ ewl_callback_append(o, EWL_CALLBACK_SELECT, type_sel_cb, (int *)EWL_EDB_TYPE_DATA);
ewl_widget_show(o);
}
@@ -110,23 +110,23 @@ int main(int argc, char ** argv) {
/* add/delete buttons on right */
{
- Ewl_Widget *add_del_box = ewl_hbox_new();
- ewl_container_child_append(EWL_CONTAINER(box2), add_del_box);
- ewl_widget_show(add_del_box);
-
- o = ewl_button_new("add");
- ewl_container_child_append(EWL_CONTAINER(add_del_box), o);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED, add_cb, NULL);
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
- ewl_object_padding_set(EWL_OBJECT(o), 5, 5, 2, 2);
- ewl_widget_show(o);
-
- o = ewl_button_new("delete");
- ewl_container_child_append(EWL_CONTAINER(add_del_box), o);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED, delete_cb, NULL);
- ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
- ewl_object_padding_set(EWL_OBJECT(o), 0, 5, 2, 2);
- ewl_widget_show(o);
+ Ewl_Widget *add_del_box = ewl_hbox_new();
+ ewl_container_child_append(EWL_CONTAINER(box2), add_del_box);
+ ewl_widget_show(add_del_box);
+
+ o = ewl_button_new("add");
+ ewl_container_child_append(EWL_CONTAINER(add_del_box), o);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED, add_cb, NULL);
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
+ ewl_object_padding_set(EWL_OBJECT(o), 5, 5, 2, 2);
+ ewl_widget_show(o);
+
+ o = ewl_button_new("delete");
+ ewl_container_child_append(EWL_CONTAINER(add_del_box), o);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED, delete_cb, NULL);
+ ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_SHRINK);
+ ewl_object_padding_set(EWL_OBJECT(o), 0, 5, 2, 2);
+ ewl_widget_show(o);
}
/* create the menu */
@@ -141,12 +141,12 @@ int main(int argc, char ** argv) {
o = ewl_menu_item_new(NULL, "open");
ewl_container_child_append(EWL_CONTAINER(file), o);
- ewl_callback_append(o, EWL_CALLBACK_SELECT, open_cb, NULL);
+ ewl_callback_append(o, EWL_CALLBACK_SELECT, open_cb, NULL);
ewl_widget_show(o);
o = ewl_menu_item_new(NULL, "save");
ewl_container_child_append(EWL_CONTAINER(file), o);
- ewl_callback_append(o, EWL_CALLBACK_SELECT, save_cb, NULL);
+ ewl_callback_append(o, EWL_CALLBACK_SELECT, save_cb, NULL);
ewl_widget_show(o);
o = ewl_menu_item_new(NULL, "quit");
@@ -168,7 +168,7 @@ int main(int argc, char ** argv) {
box2 = ewl_hbox_new();
ewl_container_child_append(EWL_CONTAINER(box), box2);
ewl_object_fill_policy_set(EWL_OBJECT(box2),
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
ewl_object_alignment_set(EWL_OBJECT(box2), EWL_FLAG_ALIGN_RIGHT);
ewl_widget_show(box2);
@@ -187,7 +187,7 @@ int main(int argc, char ** argv) {
ewl_widget_show(o);
if (argc > 1)
- open_file_cb(NULL, argv[1], NULL);
+ open_file_cb(NULL, argv[1], NULL);
ewl_main();
return 1;
@@ -210,55 +210,55 @@ void open_file_cb(Ewl_Widget *w, void *event, void *data) {
fd_win_del_cb(NULL, NULL, fd_win);
if (file == NULL)
- return;
+ return;
db_file = e_db_open(file);
if (db_file == NULL) {
- printf("Unable to open file %s\n", file);
- return;
+ printf("Unable to open file %s\n", file);
+ return;
}
key_list = e_db_dump_key_list(file, &num_ret);
{
- int i = 0;
+ int i = 0;
- for(i = 0; i < num_ret; i++) {
- if (key_list[i] != NULL) {
- Ewl_Widget * widgets[3];
- char *type = e_db_type_get(db_file, key_list[i]);
- char val[512];
+ for(i = 0; i < num_ret; i++) {
+ if (key_list[i] != NULL) {
+ Ewl_Widget * widgets[3];
+ char *type = e_db_type_get(db_file, key_list[i]);
+ char val[512];
- if (!strcmp(type, "str")) {
- snprintf(val, sizeof(val), "%s", e_db_str_get(db_file, key_list[i]));
+ if (!strcmp(type, "str")) {
+ snprintf(val, sizeof(val), "%s", e_db_str_get(db_file, key_list[i]));
- } else if (!strcmp(type, "float")) {
- float f = 0.0;
- e_db_float_get(db_file, key_list[i], &f);
- snprintf(val, sizeof(val), "%.2f", f);
+ } else if (!strcmp(type, "float")) {
+ float f = 0.0;
+ e_db_float_get(db_file, key_list[i], &f);
+ snprintf(val, sizeof(val), "%.2f", f);
- } else if (!strcmp(type, "data")) {
- snprintf(val, sizeof(val), "Data not shown");
+ } else if (!strcmp(type, "data")) {
+ snprintf(val, sizeof(val), "Data not shown");
- } else if (!strcmp(type, "int")) {
- int integer = 0;
- e_db_int_get(db_file, key_list[i], &integer);
- snprintf(val, sizeof(val), "%d", integer);
- }
+ } else if (!strcmp(type, "int")) {
+ int integer = 0;
+ e_db_int_get(db_file, key_list[i], &integer);
+ snprintf(val, sizeof(val), "%d", integer);
+ }
- widgets[0] = ewl_text_new(type);
- ewl_widget_show(widgets[0]);
+ widgets[0] = ewl_text_new(type);
+ ewl_widget_show(widgets[0]);
- widgets[1] = ewl_text_new(key_list[i]);
- ewl_widget_show(widgets[1]);
+ widgets[1] = ewl_text_new(key_list[i]);
+ ewl_widget_show(widgets[1]);
- widgets[2] = ewl_text_new(val);
- ewl_widget_show(widgets[2]);
+ widgets[2] = ewl_text_new(val);
+ ewl_widget_show(widgets[2]);
- ewl_tree_row_add(EWL_TREE(tree), NULL, widgets);
- free(key_list[i]);
- }
- }
+ ewl_tree_row_add(EWL_TREE(tree), NULL, widgets);
+ free(key_list[i]);
+ }
+ }
}
free(key_list);
@@ -302,7 +302,7 @@ void open_cb(Ewl_Widget *w, void *event, void *data) {
void save_cb(Ewl_Widget *w, void *event, void *data) {
if (db_file == NULL)
- return;
+ return;
e_db_close(db_file);
db_file = NULL;
@@ -328,44 +328,44 @@ void add_cb(Ewl_Widget *w, void *event, void *data) {
Ewl_Widget *widgets[3];
if ((key == NULL) || (val == NULL))
- return;
+ return;
switch(current_type) {
- case EWL_EDB_TYPE_INT:
- {
- int ival = atoi(val);
- widgets[0] = ewl_text_new("int");
- ewl_widget_show(widgets[0]);
- e_db_int_set(db_file, key, ival);
- }
- break;
-
- case EWL_EDB_TYPE_STR:
- widgets[0] = ewl_text_new("str");
- ewl_widget_show(widgets[0]);
- e_db_str_set(db_file, key, val);
- break;
-
- case EWL_EDB_TYPE_FLOAT:
- {
- float fval = atof(val);
- widgets[0] = ewl_text_new("float");
- ewl_widget_show(widgets[0]);
- e_db_float_set(db_file, key, fval);
- }
- break;
-
- case EWL_EDB_TYPE_DATA:
- widgets[0] = ewl_text_new("data");
- ewl_widget_show(widgets[0]);
- e_db_data_set(db_file, key, val, strlen(val));
- free(val);
- val = strdup("");
- break;
-
- default:
- printf("No type selected\n");
- break;
+ case EWL_EDB_TYPE_INT:
+ {
+ int ival = atoi(val);
+ widgets[0] = ewl_text_new("int");
+ ewl_widget_show(widgets[0]);
+ e_db_int_set(db_file, key, ival);
+ }
+ break;
+
+ case EWL_EDB_TYPE_STR:
+ widgets[0] = ewl_text_new("str");
+ ewl_widget_show(widgets[0]);
+ e_db_str_set(db_file, key, val);
+ break;
+
+ case EWL_EDB_TYPE_FLOAT:
+ {
+ float fval = atof(val);
+ widgets[0] = ewl_text_new("float");
+ ewl_widget_show(widgets[0]);
+ e_db_float_set(db_file, key, fval);
+ }
+ break;
+
+ case EWL_EDB_TYPE_DATA:
+ widgets[0] = ewl_text_new("data");
+ ewl_widget_show(widgets[0]);
+ e_db_data_set(db_file, key, val, strlen(val));
+ free(val);
+ val = strdup("");
+ break;
+
+ default:
+ printf("No type selected\n");
+ break;
}
widgets[1] = ewl_text_new(key);
@@ -387,7 +387,7 @@ void delete_cb(Ewl_Widget *w, void *event, void *data) {
// char *current_key = ewl_table_get_selected(EWL_TABLE(table));
if (current_key == NULL)
- return;
+ return;
e_db_data_del(db_file, current_key);
--
Enlightenment DR17 toolkit based (based on the EFL)
More information about the Pkg-e-commits
mailing list