From: Enlightenment C. <no...@cv...> - 2007-08-21 15:06:21
|
Enlightenment CVS committal Author : moom Project : e17 Module : libs/etk Dir : e17/libs/etk/src/lib Modified Files: Etk.h etk_alignment.c etk_alignment.h etk_argument.c etk_argument.h etk_bin.c etk_box.c etk_box.h etk_button.c etk_button.h etk_cache.c etk_cache.h etk_canvas.c etk_colorpicker.c etk_colorpicker.h etk_combobox.c etk_combobox.h etk_combobox_entry.c etk_combobox_entry.h etk_config.c etk_config.h etk_container.c etk_container.h etk_dialog.c etk_dnd.c etk_dnd.h etk_drag.c etk_drag.h etk_editable.c etk_embed.c etk_embed.h etk_engine.c etk_engine.h etk_entry.c etk_entry.h etk_event.c etk_event.h etk_filechooser_widget.c etk_filechooser_widget.h etk_fixed.c etk_fixed.h etk_frame.c etk_iconbox.c etk_iconbox.h etk_image.c etk_image.h etk_label.c etk_main.c etk_menu.c etk_menu.h etk_menu_bar.c etk_menu_bar.h etk_menu_item.c etk_menu_item.h etk_menu_shell.c etk_menu_shell.h etk_message_dialog.c etk_message_dialog.h etk_notebook.c etk_notebook.h etk_object.c etk_object.h etk_paned.c etk_popup_window.c etk_popup_window.h etk_progress_bar.c etk_progress_bar.h etk_property.c etk_radio_button.c etk_range.c etk_scrollbar.c etk_scrolled_view.c etk_scrolled_view.h etk_selection.c etk_selection.h etk_separator.c etk_shadow.h etk_signal.c etk_signal_callback.c etk_slider.c etk_slider.h etk_spinner.c etk_spinner.h etk_statusbar.c etk_statusbar.h etk_stock.c etk_stock.h etk_string.c etk_string.h etk_table.c etk_table.h etk_text_view.c etk_text_view.h etk_textblock.c etk_textblock.h etk_theme.c etk_toggle_button.c etk_toggle_button.h etk_tool_button.c etk_toolbar.c etk_toolbar.h etk_tooltips.c etk_tooltips.h etk_toplevel.c etk_toplevel.h etk_tree.c etk_tree.h etk_tree_model.c etk_tree_model.h etk_type.c etk_utils.c etk_utils.h etk_viewport.c etk_widget.c etk_widget.h etk_window.c etk_window.h Log Message: * [Etk_Tree] Add etk_tree_alternating_row_colors_set() * Remove trailing spaces... =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/Etk.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -3 -r1.50 -r1.51 --- Etk.h 20 Jul 2007 22:45:27 -0000 1.50 +++ Etk.h 21 Aug 2007 15:04:54 -0000 1.51 @@ -31,7 +31,7 @@ #include "etk_check_button.h" #include "etk_colorpicker.h" #include "etk_combobox.h" -#include "etk_combobox_entry.h" +#include "etk_combobox_entry.h" #include "etk_dialog.h" #include "etk_dnd.h" #include "etk_drag.h" =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_alignment.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- etk_alignment.c 14 Mar 2007 05:40:21 -0000 1.12 +++ etk_alignment.c 21 Aug 2007 15:04:54 -0000 1.13 @@ -49,7 +49,7 @@ ETK_PROPERTY_FLOAT, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_float(1.0)); etk_type_property_add(alignment_type, "yscale", ETK_ALIGNMENT_YSCALE_PROPERTY, ETK_PROPERTY_FLOAT, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_float(1.0)); - + alignment_type->property_set = _etk_alignment_property_set; alignment_type->property_get = _etk_alignment_property_get; } @@ -277,18 +277,18 @@ * @prop_type Float * @prop_rw * @prop_val 0.5 - * \par + * \par * @prop_name "yalign": Vertical alignment of the child in the available space, from 0.0 (top) to 1.0 (bottom). * @prop_type Float * @prop_rw * @prop_val 0.5 - * \par + * \par * @prop_name "xscale": How much of the horizontal space the child should use, * from 0.0 (none, the child does not expand) to 1.0 (the child fills all the horizontal space). * @prop_type Float * @prop_rw * @prop_val 1.0 - * \par + * \par * @prop_name "yscale": How much of the vertical space the child should use, * from 0.0 (none, the child does not expand) to 1.0 (the child fills all the vertical space). * @prop_type Float =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_alignment.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- etk_alignment.h 2 Apr 2007 09:48:29 -0000 1.6 +++ etk_alignment.h 21 Aug 2007 15:04:54 -0000 1.7 @@ -11,7 +11,7 @@ * one child which can be aligned and scaled inside the container * @{ */ - + /** Gets the type of an alignment */ #define ETK_ALIGNMENT_TYPE (etk_alignment_type_get()) /** Casts the object to an Etk_Alignment */ =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_argument.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- etk_argument.c 22 Feb 2007 22:24:25 -0000 1.13 +++ etk_argument.c 21 Aug 2007 15:04:54 -0000 1.14 @@ -32,15 +32,15 @@ char *arg; int arg_len; int i, j; - + if (!argc || !argv) return ETK_FALSE; - + for (i = 0; i < *argc; i++) { if (!(arg = ((*argv)[i]))) continue; - + arg_len = strlen(arg); if ((arg_len == 2) && (arg[0] == '-') && (arg[1] == short_name)) is_set = ETK_TRUE; @@ -49,7 +49,7 @@ if (long_name && (strcmp(&arg[2], long_name) == 0)) is_set = ETK_TRUE; } - + if (is_set) { if (remove) @@ -61,7 +61,7 @@ return ETK_TRUE; } } - + return ETK_FALSE; } @@ -85,21 +85,21 @@ char *arg, *next, *value_ptr = NULL; int arg_len, long_name_len; int i, j; - + if (!argc || !argv || !value) return ETK_FALSE; - + long_name_len = long_name ? strlen(long_name) : 0; - + for (i = 0; i < *argc; i++) { if (!(arg = (*argv)[i])) continue; - + arg_len = strlen(arg); if (arg_len < 2 || arg[0] != '-') continue; - + /* Short argument */ if (arg[1] != '-') { @@ -144,7 +144,7 @@ } } } - + if (value_ptr) { /* A value has been found */ @@ -158,7 +158,7 @@ return ETK_TRUE; } } - + return ETK_FALSE; } =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_argument.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- etk_argument.h 6 Oct 2006 17:04:14 -0000 1.10 +++ etk_argument.h 21 Aug 2007 15:04:54 -0000 1.11 @@ -3,7 +3,7 @@ #define _ETK_ARGUMENT_H_ #include "etk_types.h" - + /** * @defgroup Etk_Argument Argument parser * @brief A couple of functions to parse the arguments of a program =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_bin.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- etk_bin.c 25 Mar 2007 18:22:00 -0000 1.22 +++ etk_bin.c 21 Aug 2007 15:04:54 -0000 1.23 @@ -44,10 +44,10 @@ { bin_type = etk_type_new("Etk_Bin", ETK_CONTAINER_TYPE, sizeof(Etk_Bin), ETK_CONSTRUCTOR(_etk_bin_constructor), NULL); - + etk_type_property_add(bin_type, "child", ETK_BIN_CHILD_PROPERTY, ETK_PROPERTY_POINTER, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_pointer(NULL)); - + bin_type->property_set = _etk_bin_property_set; bin_type->property_get = _etk_bin_property_get; } @@ -72,7 +72,7 @@ { etk_widget_parent_set(child, ETK_WIDGET(bin)); bin->child = child; - + etk_signal_emit_by_name("child-added", ETK_OBJECT(bin), NULL, child); etk_object_notify(ETK_OBJECT(bin), "child"); } @@ -163,7 +163,7 @@ } else etk_widget_size_request(bin->child, size); - + size->w += 2 * etk_container_border_width_get(container); size->h += 2 * etk_container_border_width_get(container); } @@ -178,7 +178,7 @@ if (!(bin = ETK_BIN(widget))) return; container = ETK_CONTAINER(widget); - + if (bin->child) { border = etk_container_border_width_get(container); @@ -216,14 +216,14 @@ { Etk_Bin *bin; Evas_List *children; - + if (!(bin = ETK_BIN(container))) return NULL; - + children = NULL; if (bin->child) children = evas_list_append(children, bin->child); - + return children; } =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_box.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- etk_box.c 10 Jul 2007 07:51:20 -0000 1.25 +++ etk_box.c 21 Aug 2007 15:04:54 -0000 1.26 @@ -56,12 +56,12 @@ { box_type = etk_type_new("Etk_Box", ETK_CONTAINER_TYPE, sizeof(Etk_Box), ETK_CONSTRUCTOR(_etk_box_constructor), ETK_DESTRUCTOR(_etk_box_destructor)); - + etk_type_property_add(box_type, "spacing", ETK_BOX_SPACING_PROPERTY, ETK_PROPERTY_INT, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_int(0)); etk_type_property_add(box_type, "homogeneous", ETK_BOX_HOMOGENEOUS_PROPERTY, ETK_PROPERTY_BOOL, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_bool(ETK_FALSE)); - + box_type->property_set = _etk_box_property_set; box_type->property_get = _etk_box_property_get; } @@ -169,10 +169,10 @@ void etk_box_insert(Etk_Box *box, Etk_Widget *child, Etk_Box_Group group, Etk_Widget *after, Etk_Box_Fill_Policy fill_policy, int padding) { Etk_Box_Cell *after_cell; - + if (!box || !child) return; - + after_cell = _etk_box_cell_get(after); _etk_box_insert_after_cell(box, child, group, after_cell, fill_policy, padding); } @@ -191,17 +191,17 @@ void etk_box_insert_at(Etk_Box *box, Etk_Widget *child, Etk_Box_Group group, int pos, Etk_Box_Fill_Policy fill_policy, int padding) { Etk_Box_Cell *after_cell; - + if (!box || !child) return; - + if (pos <= 0) after_cell = NULL; else if (pos >= box->cells_count[group]) after_cell = box->last_cell[group]; else after_cell = _etk_box_cell_nth_get(box, group, pos - 1); - + _etk_box_insert_after_cell(box, child, group, after_cell, fill_policy, padding); } @@ -215,10 +215,10 @@ Etk_Widget *etk_box_child_get_at(Etk_Box *box, Etk_Box_Group group, int pos) { Etk_Box_Cell *cell; - + if (!box) return NULL; - + if (!(cell = _etk_box_cell_nth_get(box, group, pos))) return NULL; else @@ -242,7 +242,7 @@ if (!box || !child || !(cell = _etk_box_cell_get(child))) return; - + padding = cell->padding; fill_policy = cell->fill_policy; etk_widget_parent_set(child, NULL); @@ -261,13 +261,13 @@ { Etk_Box_Cell *cell, *c; int i; - + if (!box || !child) return ETK_FALSE; - + if (!(cell = _etk_box_cell_get(child))) return ETK_FALSE; - + for (i = 0, c = box->first_cell[cell->group]; c; i++, c = c->next) { if (cell == c) @@ -292,10 +292,10 @@ void etk_box_child_packing_set(Etk_Box *box, Etk_Widget *child, Etk_Box_Fill_Policy fill_policy, int padding) { Etk_Box_Cell *cell; - + if (!box || !child) return; - + if ((cell = _etk_box_cell_get(child))) { cell->fill_policy = fill_policy; @@ -315,10 +315,10 @@ Etk_Bool etk_box_child_packing_get(Etk_Box *box, Etk_Widget *child, Etk_Box_Fill_Policy *fill_policy, int *padding) { Etk_Box_Cell *cell; - + if (!box || !child) return ETK_FALSE; - + if ((cell = _etk_box_cell_get(child))) { if (fill_policy) @@ -327,7 +327,7 @@ *padding = cell->padding; return ETK_TRUE; } - + return ETK_FALSE; } @@ -418,7 +418,7 @@ { Etk_Box_Cell *cell, *next; int i; - + if (!box) return; @@ -489,7 +489,7 @@ if (!(box = ETK_BOX(container)) || !widget) return; - + if ((cell = _etk_box_cell_get(widget))) { if (cell->prev) @@ -501,11 +501,11 @@ if (cell == box->last_cell[cell->group]) box->last_cell[cell->group] = cell->prev; box->cells_count[cell->group]--; - + ETK_WIDGET(box)->focus_order = evas_list_remove_list(ETK_WIDGET(box)->focus_order, cell->focus_node); etk_object_data_set(ETK_OBJECT(widget), "_Etk_Box::Cell", NULL); free(cell); - + etk_widget_size_recalc_queue(ETK_WIDGET(box)); etk_signal_emit_by_name("child-removed", ETK_OBJECT(box), NULL, widget); } @@ -518,17 +518,17 @@ Evas_List *children; Etk_Box_Cell *cell; int i; - + if (!(box = ETK_BOX(container))) return NULL; - + children = NULL; for (i = 0; i < 2; i++) { for (cell = box->first_cell[i]; cell; cell = cell->next) children = evas_list_append(children, cell->child); } - + return children; } @@ -566,7 +566,7 @@ size->w = 0; size->h = 0; num_visible_children = 0; - + for (i = 0; i < 2; i++) { box->request_sizes[i] = realloc(box->request_sizes[i], box->cells_count[i] * sizeof(int)); @@ -574,12 +574,12 @@ { child = cell->child; box->request_sizes[i][j] = 0; - + if (!etk_widget_is_visible(child)) continue; - + etk_widget_size_request(child, &child_size); - + if (box->homogeneous) { if (size->w < child_size.w + 2 * cell->padding) @@ -590,10 +590,10 @@ box->request_sizes[i][j] = child_size.w + 2 * cell->padding; size->w += box->request_sizes[i][j]; } - + if (size->h < child_size.h) size->h = child_size.h; - + num_visible_children++; } } @@ -640,10 +640,10 @@ requested_size.h -= 2 * container->border_width; allocated_size.w = geometry.w - 2 * container->border_width; allocated_size.h = geometry.h - 2 * container->border_width; - + start_offset = container->border_width; end_offset = container->border_width; - + if (allocated_size.w <= requested_size.w) { float ratio; @@ -656,7 +656,7 @@ while (cell) { child = cell->child; - + if (etk_widget_is_visible(child)) { width = box->request_sizes[i][j] * ratio; @@ -674,16 +674,16 @@ child_geometry.x = geometry.x + geometry.w - end_offset - child_geometry.w; end_offset += width + box->spacing; } - + child_geometry.x += cell->padding; child_geometry.w -= 2 * cell->padding; - + etk_container_child_space_fill(child, &child_geometry, cell->fill_policy & ETK_BOX_FILL, !(cell->fill_policy & ETK_BOX_SHRINK_OPPOSITE), 0.5, 0.5); etk_widget_size_allocate(child, child_geometry); } - + cell = (i == ETK_BOX_START) ? cell->next : cell->prev; j = (i == ETK_BOX_START) ? (j + 1) : (j - 1); } @@ -698,10 +698,10 @@ for (cell = box->first_cell[i]; cell; cell = cell->next) { child = cell->child; - + if (!etk_widget_is_visible(child)) continue; - + if (cell->fill_policy & ETK_BOX_EXPAND) num_children_to_expand++; } @@ -719,7 +719,7 @@ while (cell) { child = cell->child; - + if (etk_widget_is_visible(child)) { width = box->request_sizes[i][j]; @@ -742,13 +742,13 @@ child_geometry.x += cell->padding; child_geometry.w -= 2 * cell->padding; - + etk_container_child_space_fill(child, &child_geometry, cell->fill_policy & ETK_BOX_FILL, - !(cell->fill_policy & ETK_BOX_SHRINK_OPPOSITE), 0.5, 0.5); + !(cell->fill_policy & ETK_BOX_SHRINK_OPPOSITE), 0.5, 0.5); etk_widget_size_allocate(child, child_geometry); } - + cell = (i == ETK_BOX_START) ? cell->next : cell->prev; j = (i == ETK_BOX_START) ? (j + 1) : (j - 1); } @@ -790,7 +790,7 @@ size->w = 0; size->h = 0; num_visible_children = 0; - + for (i = 0; i < 2; i++) { box->request_sizes[i] = realloc(box->request_sizes[i], box->cells_count[i] * sizeof(int)); @@ -798,12 +798,12 @@ { child = cell->child; box->request_sizes[i][j] = 0; - + if (!etk_widget_is_visible(child)) continue; - + etk_widget_size_request(child, &child_size); - + if (box->homogeneous) { if (size->h < child_size.h + 2 * cell->padding) @@ -817,7 +817,7 @@ if (size->w < child_size.w) size->w = child_size.w; - + num_visible_children++; } } @@ -864,10 +864,10 @@ requested_size.h -= 2 * container->border_width; allocated_size.w = geometry.w - 2 * container->border_width; allocated_size.h = geometry.h - 2 * container->border_width; - + start_offset = container->border_width; end_offset = container->border_width; - + if (allocated_size.h <= requested_size.h) { float ratio; @@ -880,7 +880,7 @@ while (cell) { child = cell->child; - + if (etk_widget_is_visible(child)) { height = box->request_sizes[i][j] * ratio; @@ -898,16 +898,16 @@ child_geometry.y = geometry.y + geometry.h - end_offset - child_geometry.h; end_offset += height + box->spacing; } - + child_geometry.y += cell->padding; child_geometry.h -= 2 * cell->padding; - + etk_container_child_space_fill(child, &child_geometry, !(cell->fill_policy & ETK_BOX_SHRINK_OPPOSITE), cell->fill_policy & ETK_BOX_FILL, 0.5, 0.5); etk_widget_size_allocate(child, child_geometry); } - + cell = (i == ETK_BOX_START) ? cell->next : cell->prev; j = (i == ETK_BOX_START) ? (j + 1) : (j - 1); } @@ -922,10 +922,10 @@ for (cell = box->first_cell[i]; cell; cell = cell->next) { child = cell->child; - + if (!etk_widget_is_visible(child)) continue; - + if (cell->fill_policy & ETK_BOX_EXPAND) num_children_to_expand++; } @@ -943,7 +943,7 @@ while (cell) { child = cell->child; - + if (etk_widget_is_visible(child)) { height = box->request_sizes[i][j]; @@ -966,13 +966,13 @@ child_geometry.y += cell->padding; child_geometry.h -= 2 * cell->padding; - + etk_container_child_space_fill(child, &child_geometry, !(cell->fill_policy & ETK_BOX_SHRINK_OPPOSITE), - cell->fill_policy & ETK_BOX_FILL, 0.5, 0.5); + cell->fill_policy & ETK_BOX_FILL, 0.5, 0.5); etk_widget_size_allocate(child, child_geometry); } - + cell = (i == ETK_BOX_START) ? cell->next : cell->prev; j = (i == ETK_BOX_START) ? (j + 1) : (j - 1); } @@ -991,7 +991,7 @@ { Etk_Box_Cell *cell; Etk_Widget *box_widget; - + if (!(box_widget = ETK_WIDGET(box)) || !child) return; if (after && after->group != group) @@ -1000,7 +1000,7 @@ "do not belong to the same child-group"); return; } - + cell = malloc(sizeof(Etk_Box_Cell)); cell->prev = NULL; cell->next = NULL; @@ -1009,7 +1009,7 @@ cell->group = group; cell->fill_policy = fill_policy; cell->padding = padding; - + if (after) { cell->prev = after; @@ -1019,7 +1019,7 @@ else box->last_cell[group] = cell; after->next = cell; - + box_widget->focus_order = evas_list_append_relative_list(box_widget->focus_order, child, after->focus_node); cell->focus_node = evas_list_next(after->focus_node); } @@ -1031,7 +1031,7 @@ else box->last_cell[group] = cell; box->first_cell[group] = cell; - + if (group == ETK_BOX_START || !box->last_cell[ETK_BOX_START]) { box_widget->focus_order = evas_list_prepend(box_widget->focus_order, child); @@ -1045,7 +1045,7 @@ } } box->cells_count[group]++; - + etk_widget_parent_set(child, ETK_WIDGET(box)); etk_object_data_set(ETK_OBJECT(child), "_Etk_Box::Cell", cell); etk_signal_emit_by_name("child-added", ETK_OBJECT(box), NULL, child); @@ -1064,10 +1064,10 @@ { Etk_Box_Cell *cell; int i; - + if (!box || box->cells_count[group] <= 0) return NULL; - + if (n < (box->cells_count[group] / 2)) { cell = box->first_cell[group]; @@ -1080,7 +1080,7 @@ for (i = 0; i < (box->cells_count[group] - n - 1) && cell->prev; i++) cell = cell->prev; } - + return cell; } @@ -1102,7 +1102,7 @@ * end-group are packed at the end of the box (right for the hbox, bottom for the vbox). @n * Widgets can be packed with the functions etk_box_prepend(), etk_box_append(), etk_box_insert() and * etk_box_insert_at(). - * + * * \par Object Hierarchy: * - Etk_Object * - Etk_Widget @@ -1116,7 +1116,7 @@ * @prop_type Boolean * @prop_rw * @prop_val ETK_FALSE - * \par + * \par * @prop_name "spacing": The amount of space between two children * @prop_type Integer * @prop_rw =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_box.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- etk_box.h 27 Jul 2007 16:24:13 -0000 1.13 +++ etk_box.h 21 Aug 2007 15:04:54 -0000 1.14 @@ -36,7 +36,7 @@ /** @brief The two groups where the children can be packed: the start-group and the end-group */ -typedef enum +typedef enum { ETK_BOX_START, /**< The start-group of children: the children in this group are displayed * at the start (left or top) of the box */ @@ -67,7 +67,7 @@ /* private: */ Etk_Box_Cell *prev; Etk_Box_Cell *next; - + Etk_Widget *child; Evas_List *focus_node; Etk_Box_Group group; =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_button.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- etk_button.c 2 Apr 2007 20:13:50 -0000 1.42 +++ etk_button.c 21 Aug 2007 15:04:54 -0000 1.43 @@ -130,7 +130,7 @@ Etk_Widget *etk_button_new_from_stock(Etk_Stock_Id stock_id) { Etk_Widget *button; - + button = etk_button_new(); etk_button_set_from_stock(ETK_BUTTON(button), stock_id); @@ -145,7 +145,7 @@ { if (!button || button->is_pressed) return; - + button->is_pressed = ETK_TRUE; etk_signal_emit(_etk_button_signals[ETK_BUTTON_PRESSED_SIGNAL], ETK_OBJECT(button), NULL); } @@ -158,7 +158,7 @@ { if (!button || !button->is_pressed) return; - + button->is_pressed = ETK_FALSE; etk_signal_emit(_etk_button_signals[ETK_BUTTON_RELEASED_SIGNAL], ETK_OBJECT(button), NULL); } @@ -186,7 +186,7 @@ if (!button) return; - + etk_label_set(ETK_LABEL(button->label), label); /* Rebuild the button only if necessary (i.e. if the label is currently not packed into the button) */ @@ -199,7 +199,7 @@ break; } } - + if (rebuild) _etk_button_rebuild(button); else @@ -209,7 +209,7 @@ else etk_widget_show(button->label); } - + etk_object_notify(ETK_OBJECT(button), "label"); } @@ -237,7 +237,7 @@ { if (!button || button->image == image) return; - + if (button->image) { button->ignore_image_remove = ETK_TRUE; @@ -278,7 +278,7 @@ label = etk_stock_label_get(stock_id); etk_button_label_set(button, label); - + image = etk_image_new_from_stock(stock_id, button->stock_size); etk_widget_internal_set(image, ETK_TRUE); etk_button_image_set(ETK_BUTTON(button), ETK_IMAGE(image)); @@ -303,7 +303,7 @@ button->ignore_image_remove = ETK_FALSE; button->box = NULL; } - + _etk_button_rebuild(button); etk_object_notify(ETK_OBJECT(button), "style"); } @@ -328,19 +328,19 @@ void etk_button_stock_size_set(Etk_Button *button, Etk_Stock_Size size) { Etk_Stock_Id stock_id; - + if (!button || button->stock_size == size) return; button->stock_size = size; - + if (button->image) { etk_image_stock_get(button->image, &stock_id, NULL); if (stock_id != ETK_STOCK_NO_STOCK) etk_image_set_from_stock(button->image, stock_id, size); } - + etk_object_notify(ETK_OBJECT(button), "stock-size"); } @@ -378,7 +378,7 @@ { Etk_Alignment *child_alignment = ETK_ALIGNMENT(child); float xscale, yscale; - + etk_alignment_get(child_alignment, NULL, NULL, &xscale, &yscale); etk_alignment_set(child_alignment, xalign, yalign, xscale, yscale); } @@ -427,7 +427,7 @@ button->alignment = NULL; button->style = ETK_BUTTON_BOTH_HORIZ; button->stock_size = ETK_STOCK_SMALL; - + button->label = etk_label_new(NULL); etk_label_alignment_set(ETK_LABEL(button->label), 0.5, 0.5); etk_widget_internal_set(button->label, ETK_TRUE); @@ -525,7 +525,7 @@ static void _etk_button_theme_signal_emit(Etk_Widget *widget, const char *signal, Etk_Bool size_recalc) { Etk_Button *button; - + if (!(button = ETK_BUTTON(widget))) return; etk_widget_theme_signal_emit(button->label, signal, size_recalc); @@ -541,10 +541,10 @@ static void _etk_button_realized_cb(Etk_Object *object, void *data) { Etk_Button *button; - + if (!(button = ETK_BUTTON(object))) return; - + if (button->is_pressed) etk_widget_theme_signal_emit(ETK_WIDGET(button), "etk,state,pressed", ETK_FALSE); } @@ -553,10 +553,10 @@ static void _etk_button_label_realized_cb(Etk_Object *object, void *data) { Etk_Button *button; - + if (!(button = ETK_BUTTON(data))) return; - + if (button->is_pressed) etk_widget_theme_signal_emit(button->label, "etk,state,pressed", ETK_FALSE); if (etk_widget_disabled_get(ETK_WIDGET(button))) @@ -572,7 +572,7 @@ if (!(button = ETK_BUTTON(data)) || (child != ETK_WIDGET(button->image))) return; - + if (!button->ignore_image_remove) { button->image = NULL; @@ -691,12 +691,12 @@ static void _etk_button_rebuild(Etk_Button *button) { const char *text; - + if (!button) return; button->ignore_image_remove = ETK_TRUE; - + /* Rebuild the containers containing the label and image */ if (button->image) { @@ -722,7 +722,7 @@ } else etk_container_remove_all(ETK_CONTAINER(button->box)); - + etk_box_append(ETK_BOX(button->box), ETK_WIDGET(button->image), ETK_BOX_START, ETK_BOX_NONE, 0); etk_box_append(ETK_BOX(button->box), button->label, ETK_BOX_START, ETK_BOX_NONE, 0); etk_widget_pass_mouse_events_set(ETK_WIDGET(button->image), ETK_TRUE); @@ -734,23 +734,23 @@ etk_object_destroy(ETK_OBJECT(button->alignment)); button->alignment = NULL; button->box = NULL; - + etk_label_alignment_set(ETK_LABEL(button->label), button->xalign, button->yalign); etk_container_add(ETK_CONTAINER(button), button->label); } - + /* Show/hide the label and the image */ text = etk_label_get(ETK_LABEL(button->label)); if (button->style != ETK_BUTTON_ICON && text && *text != '\0') etk_widget_show(button->label); else etk_widget_hide(button->label); - + if (button->style != ETK_BUTTON_TEXT) etk_widget_show(ETK_WIDGET(button->image)); else etk_widget_hide(ETK_WIDGET(button->image)); - + button->ignore_image_remove = ETK_FALSE; } @@ -799,28 +799,28 @@ * @prop_type String (char *) * @prop_rw * @prop_val NULL - * \par + * \par * @prop_name "image": The image packed on the left of the label, inside the button * @prop_type Pointer (Etk_Image *) * @prop_rw * @prop_val NULL - * \par + * \par * @prop_name "style": The style of the button (icon, text, both vertically, both horizontally) * @prop_type Integer (Etk_Button_Style) * @prop_rw * @prop_val ETK_BUTTON_BOTH_HORIZ - * \par + * \par * @prop_name "stock_size": The stock-size of the image of the button * @prop_type Integer (Etk_Stock_Size) * @prop_rw * @prop_val ETK_STOCK_SMALL - * \par + * \par * @prop_name "xalign": The horizontal alignment of the child of the button, * from 0.0 (left aligned) to 1.0 (right aligned) * @prop_type Float * @prop_rw * @prop_val 0.5 - * \par + * \par * @prop_name "yalign": The vertical alignment of the child of the button, * from 0.0 (top aligned) to 1.0 (bottom aligned) * @prop_type Float =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_button.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- etk_button.h 27 Jul 2007 16:24:13 -0000 1.18 +++ etk_button.h 21 Aug 2007 15:04:54 -0000 1.19 @@ -44,7 +44,7 @@ Etk_Widget *box; Etk_Image *image; Etk_Widget *label; - + void (*pressed_handler)(Etk_Button *button); void (*released_handler)(Etk_Button *button); void (*clicked_handler)(Etk_Button *button); =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_cache.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- etk_cache.c 14 Mar 2007 05:40:21 -0000 1.16 +++ etk_cache.c 21 Aug 2007 15:04:54 -0000 1.17 @@ -10,7 +10,7 @@ */ static void _etk_cache_object_deleted_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); - + typedef struct Etk_Cache_Item { char *filename; @@ -35,13 +35,13 @@ Etk_Cache *etk_cache_new(int size) { Etk_Cache *cache; - + cache = malloc(sizeof(Etk_Cache)); cache->cached_objects = NULL; cache->size = ETK_MAX(0, size); cache->free_cb = NULL; cache->free_cb_data = NULL; - + return cache; } @@ -53,7 +53,7 @@ { if (!cache) return; - + etk_cache_clear(cache); free(cache); } @@ -65,10 +65,10 @@ void etk_cache_clear(Etk_Cache *cache) { Etk_Cache_Item *item; - + if (!cache) return; - + while (cache->cached_objects) { item = cache->cached_objects->data; @@ -88,7 +88,7 @@ { if (!cache) return; - + cache->free_cb = free_cb; cache->free_cb_data = data; } @@ -103,13 +103,13 @@ { Etk_Cache_Item *item; int num_objects; - + if (!cache) return; - + cache->size = ETK_MAX(0, size); num_objects = etk_cache_size_get(cache); - + /* Destroys the objects that can't fit anymore */ while (cache->cached_objects && num_objects > cache->size) { @@ -158,10 +158,10 @@ { Etk_Cache_Item *item; Evas_List *l; - + if (!cache || !object || cache->size <= 0 || !filename) return; - + /* If the object is already cached, we move it at the end of the cache */ if ((l = evas_object_data_get(object, "_Etk_Cache::Node"))) { @@ -181,23 +181,23 @@ evas_object_data_set(item->object, "_Etk_Cache::Node", evas_list_last(cache->cached_objects)); return; } - + /* If no more space is available, we remove the oldest object of the cache */ if (evas_list_count(cache->cached_objects) >= cache->size) { item = cache->cached_objects->data; evas_object_del(item->object); } - + /* We create a new cache-item for the object and we add it to the cache */ item = malloc(sizeof(Etk_Cache_Item)); item->filename = strdup(filename); item->key = key ? strdup(key) : NULL; item->object = object; - + evas_object_hide(object); evas_object_event_callback_add(object, EVAS_CALLBACK_FREE, _etk_cache_object_deleted_cb, cache); - + cache->cached_objects = evas_list_append(cache->cached_objects, item); evas_object_data_set(item->object, "_Etk_Cache::Node", evas_list_last(cache->cached_objects)); } @@ -211,20 +211,20 @@ { Etk_Cache_Item *item; Evas_List *l; - + if (!cache || !object) return; - + if ((l = evas_object_data_get(object, "_Etk_Cache::Node"))) { item = l->data; - + evas_object_data_del(object, "_Etk_Cache::Node"); evas_object_event_callback_del(object, EVAS_CALLBACK_FREE, _etk_cache_object_deleted_cb); free(item->filename); free(item->key); free(item); - + cache->cached_objects = evas_list_remove_list(cache->cached_objects, l); } } @@ -243,28 +243,28 @@ Etk_Cache_Item *item; Evas_List *l; Evas_Object *object; - + if (!cache || !filename) return NULL; - + for (l = cache->cached_objects; l; l = l->next) { item = l->data; if (strcmp(item->filename, filename) == 0 && (strcmp(item->key ? item->key : "", key ? key : "") == 0)) { object = item->object; - + evas_object_data_del(object, "_Etk_Cache::Node"); evas_object_event_callback_del(object, EVAS_CALLBACK_FREE, _etk_cache_object_deleted_cb); free(item->filename); free(item->key); free(item); - + cache->cached_objects = evas_list_remove(cache->cached_objects, item); return object; } } - + return NULL; } @@ -278,10 +278,10 @@ static void _etk_cache_object_deleted_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Etk_Cache *cache; - + if (!(cache = data)) return; - + etk_cache_remove(cache, obj); if (cache->free_cb) cache->free_cb(obj, cache->free_cb_data); =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_cache.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- etk_cache.h 2 Apr 2007 09:48:29 -0000 1.8 +++ etk_cache.h 21 Aug 2007 15:04:54 -0000 1.9 @@ -21,11 +21,11 @@ /* private: */ Evas_List *cached_objects; int size; - + void (*free_cb)(Evas_Object *object, void *data); void *free_cb_data; }; - + Etk_Cache *etk_cache_new(int size); void etk_cache_destroy(Etk_Cache *cache); =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_canvas.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- etk_canvas.c 22 Mar 2007 19:36:51 -0000 1.20 +++ etk_canvas.c 21 Aug 2007 15:04:54 -0000 1.21 @@ -79,7 +79,7 @@ evas_object_move(object, cx, cy); evas_object_clip_set(object, canvas->clip); evas_object_show(canvas->clip); - + evas_object_event_callback_add(object, EVAS_CALLBACK_FREE, _etk_canvas_object_deleted_cb, canvas); canvas->objects = evas_list_append(canvas->objects, object); } @@ -95,16 +95,16 @@ void etk_canvas_object_remove(Etk_Canvas *canvas, Evas_Object *object) { Evas_List *l; - + if (!canvas || !object) return; - + if ((l = evas_list_find_list(canvas->objects, object))) { etk_widget_member_object_del(ETK_WIDGET(canvas), object); evas_object_clip_unset(object); evas_object_hide(object); - + evas_object_event_callback_del(object, EVAS_CALLBACK_FREE, _etk_canvas_object_deleted_cb); canvas->objects = evas_list_remove_list(canvas->objects, l); if (!canvas->objects) @@ -124,10 +124,10 @@ void etk_canvas_object_move(Etk_Canvas *canvas, Evas_Object *object, int x, int y) { int cx, cy; - + if (!canvas || !object) return; - + etk_widget_geometry_get(ETK_WIDGET(canvas), &cx, &cy, NULL, NULL); evas_object_move(object, cx + x, cy + y); } @@ -148,10 +148,10 @@ void etk_canvas_object_geometry_get(Etk_Canvas *canvas, Evas_Object *object, int *x, int *y, int *w, int *h) { int cx, cy; - + if (!canvas || !object) return; - + etk_widget_geometry_get(ETK_WIDGET(canvas), &cx, &cy, NULL, NULL); evas_object_geometry_get(object, x, y, w, h); if (x) *x -= cx; @@ -173,7 +173,7 @@ canvas->clip = NULL; canvas->objects = NULL; ETK_WIDGET(canvas)->size_allocate = _etk_canvas_size_allocate; - + etk_signal_connect("realized", ETK_OBJECT(canvas), ETK_CALLBACK(_etk_canvas_realized_cb), NULL); etk_signal_connect("unrealized", ETK_OBJECT(canvas), ETK_CALLBACK(_etk_canvas_unrealized_cb), NULL); } @@ -182,10 +182,10 @@ static void _etk_canvas_size_allocate(Etk_Widget *widget, Etk_Geometry geometry) { Etk_Canvas *canvas; - + if (!(canvas = ETK_CANVAS(widget))) return; - + evas_object_move(canvas->clip, geometry.x, geometry.y); evas_object_resize(canvas->clip, geometry.w, geometry.h); } @@ -206,10 +206,10 @@ if (!(canvas = ETK_CANVAS(object)) || !(evas = etk_widget_toplevel_evas_get(ETK_WIDGET(canvas)))) return; - + canvas->clip = evas_object_rectangle_add(evas); etk_widget_member_object_add(ETK_WIDGET(canvas), canvas->clip); - + for (l = canvas->objects; l; l = l->next) { obj = l->data; @@ -222,10 +222,10 @@ static void _etk_canvas_unrealized_cb(Etk_Object *object, void *data) { Etk_Canvas *canvas; - + if (!(canvas = ETK_CANVAS(object))) return; - + canvas->clip = NULL; evas_list_free(canvas->objects); canvas->objects = NULL; @@ -235,10 +235,10 @@ static void _etk_canvas_object_deleted_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Etk_Canvas *canvas; - + if (!(canvas = ETK_CANVAS(data)) || !obj) return; - + canvas->objects = evas_list_remove(canvas->objects, obj); if (!canvas->objects) evas_object_hide(canvas->clip); @@ -272,7 +272,7 @@ * etk_canvas_object_add(canvas, obj); * } * @endcode @n - * + * * Once an object is added to the canvas, you can use any @a evas_object_*() functions to control it. @n * You just have to keep in mind that calling evas_object_move() on an object belonging to the canvas will move * the object relatively to the top-left corner of the window, and not to the top corner of the canvas itself. @n =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_colorpicker.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- etk_colorpicker.c 4 Aug 2007 14:46:21 -0000 1.33 +++ etk_colorpicker.c 21 Aug 2007 15:04:54 -0000 1.34 @@ -111,15 +111,15 @@ { cp_type = etk_type_new("Etk_Colorpicker", ETK_WIDGET_TYPE, sizeof(Etk_Colorpicker), ETK_CONSTRUCTOR(_etk_colorpicker_constructor), ETK_DESTRUCTOR(_etk_colorpicker_destructor)); - + _etk_colorpicker_signals[ETK_CP_COLOR_CHANGED_SIGNAL] = etk_signal_new("color-changed", cp_type, -1, etk_marshaller_VOID__VOID, NULL, NULL); - + etk_type_property_add(cp_type, "color-mode", ETK_CP_MODE_PROPERTY, ETK_PROPERTY_INT, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_int(ETK_COLORPICKER_H)); etk_type_property_add(cp_type, "use-alpha", ETK_CP_USE_ALPHA_PROPERTY, ETK_PROPERTY_BOOL, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_bool(ETK_FALSE)); - + cp_type->property_set = _etk_colorpicker_property_set; cp_type->property_get = _etk_colorpicker_property_get; } @@ -145,7 +145,7 @@ { if (!cp || (cp->mode == mode)) return; - + switch (mode) { case ETK_COLORPICKER_H: @@ -175,7 +175,7 @@ default: break; } - + cp->mode = mode; _etk_colorpicker_update_from_sliders(cp, mode, ETK_TRUE, ETK_TRUE); etk_object_notify(ETK_OBJECT(cp), "color-mode"); @@ -203,14 +203,14 @@ if (cp->current_color.r == color.r && cp->current_color.g == color.g && cp->current_color.b == color.b && cp->current_color.a == color.a) return; - + cp->ignore_value_changed = ETK_TRUE; etk_range_value_set(ETK_RANGE(cp->sliders[ETK_COLORPICKER_R]), color.r); etk_range_value_set(ETK_RANGE(cp->sliders[ETK_COLORPICKER_G]), color.g); etk_range_value_set(ETK_RANGE(cp->sliders[ETK_COLORPICKER_B]), color.b); etk_range_value_set(ETK_RANGE(cp->alpha_slider), color.a); cp->ignore_value_changed = ETK_FALSE; - + _etk_colorpicker_update_from_sliders(cp, ETK_COLORPICKER_R, ETK_TRUE, ETK_TRUE); etk_signal_emit(_etk_colorpicker_signals[ETK_CP_COLOR_CHANGED_SIGNAL], ETK_OBJECT(cp), NULL); } @@ -227,7 +227,7 @@ Etk_Color black = { .r = 0, .g = 0, .b = 0, .a = 255 }; return black; } - + return cp->current_color; } @@ -241,7 +241,7 @@ { if (!cp || cp->use_alpha == use_alpha) return; - + cp->use_alpha = use_alpha; if (cp->use_alpha) { @@ -285,17 +285,17 @@ if (!cp) return; - + cp->mode = ETK_COLORPICKER_H; cp->use_alpha = ETK_FALSE; cp->sp_xcomponent = ETK_COLORPICKER_V; cp->sp_ycomponent = ETK_COLORPICKER_S; - + cp->current_color.r = 0; cp->current_color.g = 0; cp->current_color.b = 0; cp->current_color.a = 255; - + cp->sp_object = NULL; cp->sp_image = NULL; cp->sp_hcursor = NULL; @@ -303,15 +303,15 @@ cp->sp_res = 64; cp->sp_xpos = 0.0; cp->sp_ypos = 0.0; - + cp->vp_object = NULL; cp->vp_image = NULL; cp->vp_cursor = NULL; cp->vp_res = 256; cp->vp_pos = 0.0; - + cp->current_color_rect = NULL; - + cp->sliders_res = 256; cp->sp_dragging = ETK_FALSE; cp->vp_dragging = ETK_FALSE; @@ -321,24 +321,24 @@ cp->vp_cursor_needs_update = ETK_FALSE; cp->sliders_need_update = ETK_FALSE; cp->ignore_value_changed = ETK_FALSE; - - + + /* We create the widgets */ cp->main_table = etk_table_new(2, 2, ETK_TABLE_NOT_HOMOGENEOUS); etk_widget_internal_set(cp->main_table, ETK_TRUE); etk_widget_parent_set(cp->main_table, ETK_WIDGET(cp)); etk_widget_show(cp->main_table); - + cp->picker_widget = etk_widget_new(ETK_WIDGET_TYPE, "theme-group", "picker", "theme-parent", cp, NULL); etk_widget_internal_set(cp->picker_widget, ETK_TRUE); etk_table_attach_default(ETK_TABLE(cp->main_table), cp->picker_widget, 0, 0, 0, 0); etk_widget_show(cp->picker_widget); - + cp->component_table = etk_table_new(2, 7, ETK_TABLE_NOT_HOMOGENEOUS); etk_widget_internal_set(cp->component_table, ETK_TRUE); etk_table_attach_default(ETK_TABLE(cp->main_table), cp->component_table, 1, 1, 0, 0); etk_widget_show(cp->component_table); - + /* Radios, sliders and labels for each component */ for (i = 0; i < 6; i++) { @@ -350,7 +350,7 @@ etk_table_attach(ETK_TABLE(cp->component_table), cp->radios[i], 0, 0, i, i, ETK_TABLE_HFILL | ETK_TABLE_VEXPAND, 0, 0); etk_widget_show(cp->radios[i]); - + cp->sliders[i] = etk_hslider_new(0.0, _etk_colorpicker_max_values[i], 0.0, steps[i], steps[i] * 5); etk_slider_label_set(ETK_SLIDER(cp->sliders[i]), "%.0f"); etk_widget_theme_parent_set(cp->sliders[i], ETK_WIDGET(cp)); @@ -358,9 +358,9 @@ etk_table_attach(ETK_TABLE(cp->component_table), cp->sliders[i], 1, 1, i, i, ETK_TABLE_HFILL | ETK_TABLE_EXPAND, 0, 0); etk_widget_show(cp->sliders[i]); - + cp->sliders_image[i] = NULL; - + etk_signal_connect("toggled", ETK_OBJECT(cp->radios[i]), ETK_CALLBACK(_etk_colorpicker_radio_toggled_cb), cp); etk_signal_connect("realized", ETK_OBJECT(cp->sliders[i]), @@ -370,24 +370,24 @@ etk_signal_connect("value-changed", ETK_OBJECT(cp->sliders[i]), ETK_CALLBACK(_etk_colorpicker_slider_value_changed_cb), cp); } - + /* Alpha slider */ { cp->alpha_label = etk_label_new(_("Alpha")); etk_widget_internal_set(cp->alpha_label, ETK_TRUE); etk_table_attach(ETK_TABLE(cp->component_table), cp->alpha_label, 0, 0, 6, 6, ETK_TABLE_HFILL | ETK_TABLE_VEXPAND, 0, 0); - + cp->alpha_slider = etk_hslider_new(0.0, 255.0, 255.0, 10, 5.0); etk_slider_label_set(ETK_SLIDER(cp->alpha_slider), "%.0f"); etk_widget_internal_set(cp->alpha_slider, ETK_TRUE); etk_table_attach(ETK_TABLE(cp->component_table), cp->alpha_slider, 1, 1, 6, 6, ETK_TABLE_HFILL | ETK_TABLE_EXPAND, 0, 0); - + etk_signal_connect("value-changed", ETK_OBJECT(cp->alpha_slider), ETK_CALLBACK(_etk_colorpicker_alpha_slider_value_changed_cb), cp); } - + /* We create the widgets for the color preview */ cp->color_table = etk_table_new(2, 1, ETK_TABLE_VHOMOGENEOUS); etk_widget_padding_set(cp->color_table, 3, 3, 3, 3); @@ -395,21 +395,21 @@ etk_table_attach(ETK_TABLE(cp->main_table), cp->color_table, 0, 0, 1, 1, ETK_TABLE_FILL | ETK_TABLE_HEXPAND, 0, 0); etk_widget_show(cp->color_table); - + /* Current color preview */ cp->current_color_label = etk_label_new(_("Current")); etk_widget_internal_set(cp->current_color_label, ETK_TRUE); etk_table_attach(ETK_TABLE(cp->color_table), cp->current_color_label, 0, 0, 0, 0, ETK_TABLE_HFILL, 0, 0); etk_widget_show(cp->current_color_label); - + cp->current_color_widget = etk_widget_new(ETK_WIDGET_TYPE, "theme-group", "color_preview", NULL); etk_widget_theme_parent_set(cp->current_color_widget, ETK_WIDGET(cp)); etk_widget_internal_set(cp->current_color_widget, ETK_TRUE); etk_table_attach(ETK_TABLE(cp->color_table), cp->current_color_widget, 1, 1, 0, 0, ETK_TABLE_HFILL | ETK_TABLE_HEXPAND, 0, 0); etk_widget_show(cp->current_color_widget); - + etk_signal_connect("realized", ETK_OBJECT(cp->picker_widget), ETK_CALLBACK(_etk_colorpicker_realized_cb), cp); etk_signal_connect("unrealized", ETK_OBJECT(cp->picker_widget), @@ -418,8 +418,8 @@ ETK_CALLBACK(_etk_colorpicker_current_color_realized_cb), cp); etk_signal_connect("unrealized", ETK_OBJECT(cp->current_color_widget), ETK_CALLBACK(_etk_colorpicker_current_color_unrealized_cb), cp); - - + + ETK_WIDGET(cp)->size_request = _etk_colorpicker_size_request; ETK_WIDGET(cp)->size_allocate = _etk_colorpicker_size_allocate; } @@ -428,10 +428,10 @@ static void _etk_colorpicker_destructor(Etk_Colorpicker *cp) { int i; - + if (!cp) return; - + for (i = 0; i < 6; i++) etk_signal_disconnect("toggled", ETK_OBJECT(cp->radios[i]), ETK_CALLBACK(_etk_colorpicker_radio_toggled_cb)); } @@ -482,7 +482,7 @@ static void _etk_colorpicker_size_request(Etk_Widget *widget, Etk_Size *size) { Etk_Colorpicker *cp; - + if (!(cp = ETK_COLORPICKER(widget)) || !size) return; etk_widget_size_request(cp->main_table, size); @@ -492,10 +492,10 @@ static void _etk_colorpicker_size_allocate(Etk_Widget *widget, Etk_Geometry geometry) { Etk_Colorpicker *cp; - + if (!(cp = ETK_COLORPICKER(widget))) return; - + /* First, update the data of the images if needed */ if (cp->sp_image_needs_update) _etk_colorpicker_sp_image_update(cp); @@ -507,12 +507,12 @@ _etk_colorpicker_vp_cursor_update(cp); if (cp->sliders_need_update) _etk_colorpicker_sliders_update(cp); - + /* Then, we move and resize the main table and we replace the cursors of the pickers */ etk_widget_size_allocate(cp->main_table, geometry); _etk_colorpicker_sp_cursor_replace(cp); _etk_colorpicker_vp_cursor_replace(cp); - + cp->sp_image_needs_update = ETK_FALSE; cp->sp_cursor_needs_update = ETK_FALSE; cp->vp_image_needs_update = ETK_FALSE; @@ -532,55 +532,55 @@ Etk_Colorpicker *cp; Etk_Colorpicker_Picker_SD *picker_sd; Evas *evas; - + if (!(cp = ETK_COLORPICKER(data)) || !(evas = etk_widget_toplevel_evas_get(ETK_WIDGET(cp)))) return; - + /* Square picker objects */ cp->sp_object = _etk_colorpicker_picker_object_add(evas, cp, _etk_colorpicker_sp_move_resize); etk_widget_swallow_object(cp->picker_widget, "etk.swallow.square_picker", cp->sp_object); picker_sd = evas_object_smart_data_get(cp->sp_object); - + cp->sp_image = evas_object_image_add(evas); evas_object_image_alpha_set(cp->sp_image, 0); evas_object_image_size_set(cp->sp_image, cp->sp_res, cp->sp_res); evas_object_smart_member_add(cp->sp_image, cp->sp_object); picker_sd->objects = evas_list_append(picker_sd->objects, cp->sp_image); - + cp->sp_hcursor = evas_object_image_add(evas); evas_object_image_alpha_set(cp->sp_hcursor, 0); evas_object_image_size_set(cp->sp_hcursor, cp->sp_res, 1); evas_object_pass_events_set(cp->sp_hcursor, 1); evas_object_smart_member_add(cp->sp_hcursor, cp->sp_object); picker_sd->objects = evas_list_append(picker_sd->objects, cp->sp_hcursor); - + cp->sp_vcursor = evas_object_image_add(evas); evas_object_image_alpha_set(cp->sp_vcursor, 0); evas_object_image_size_set(cp->sp_vcursor, 1, cp->sp_res); evas_object_pass_events_set(cp->sp_vcursor, 1); evas_object_smart_member_add(cp->sp_vcursor, cp->sp_object); picker_sd->objects = evas_list_append(picker_sd->objects, cp->sp_vcursor); - + evas_object_show(cp->sp_object); - + /* Vertical picker objects */ cp->vp_object = _etk_colorpicker_picker_object_add(evas, cp, _etk_colorpicker_vp_move_resize); etk_widget_swallow_object(cp->picker_widget, "etk.swallow.vertical_picker", cp->vp_object); picker_sd = evas_object_smart_data_get(cp->vp_object); - + cp->vp_image = evas_object_image_add(evas); evas_object_image_alpha_set(cp->vp_image, 0); evas_object_image_size_set(cp->vp_image, 1, cp->vp_res); evas_object_smart_member_add(cp->vp_image, cp->sp_object); picker_sd->objects = evas_list_append(picker_sd->objects, cp->vp_image); - + cp->vp_cursor = evas_object_rectangle_add(evas); evas_object_pass_events_set(cp->vp_cursor, 1); evas_object_smart_member_add(cp->vp_cursor, cp->sp_object); picker_sd->objects = evas_list_append(picker_sd->objects, cp->vp_cursor); - + evas_object_show(cp->vp_object); - + /* Adds the mouse callbacks */ evas_object_event_callback_add(cp->sp_image, EVAS_CALLBACK_MOUSE_DOWN, _etk_colorpicker_sp_mouse_down_cb, cp); evas_object_event_callback_add(cp->sp_image, EVAS_CALLBACK_MOUSE_UP, _etk_colorpicker_sp_mouse_up_cb, cp); @@ -588,7 +588,7 @@ evas_object_event_callback_add(cp->vp_image, EVAS_CALLBACK_MOUSE_DOWN, _etk_colorpicker_vp_mouse_down_cb, cp); evas_object_event_callback_add(cp->vp_image, EVAS_CALLBACK_MOUSE_UP, _etk_colorpicker_vp_mouse_up_cb, cp); evas_object_event_callback_add(cp->vp_image, EVAS_CALLBACK_MOUSE_MOVE, _etk_colorpicker_vp_mouse_move_cb, cp); - + /* Updates the colorpicker */ _etk_colorpicker_update(cp, ETK_TRUE, ETK_TRUE, ETK_TRUE, ETK_TRUE); } @@ -597,13 +597,13 @@ static void _etk_colorpicker_unrealized_cb(Etk_Object *object, void *data) { Etk_Colorpicker *cp; - + if (!(cp = ETK_COLORPICKER(data))) return; - + evas_object_del(cp->sp_object); evas_object_del(cp->vp_object); - + cp->sp_object = NULL; cp->sp_image = NULL; cp->sp_hcursor = NULL; @@ -620,12 +620,12 @@ Etk_Colorpicker *cp; Evas *evas; int i; - + if (!(slider = ETK_WIDGET(object)) || !(cp = ETK_COLORPICKER(data))) return; if (!(evas = etk_widget_toplevel_evas_get(slider))) return; - + for (i = 0; i < 6; i++) { if (cp->sliders[i] == slider) @@ -637,7 +637,7 @@ evas_object_event_callback_add(cp->sliders_image[i], EVAS_CALLBACK_RESIZE, _etk_colorpicker_slider_image_resize_cb, NULL); etk_widget_swallow_object(slider, "etk.swallow.image", cp->sliders_image[i]); - + _etk_colorpicker_update(cp, ETK_FALSE, ETK_FALSE, ETK_FALSE, ETK_FALSE); return; } @@ -650,10 +650,10 @@ Etk_Widget *slider; Etk_Colorpicker *cp; int i; - + if (!(slider = ETK_WIDGET(object)) || !(cp = ETK_COLORPICKER(data))) return; - + for (i = 0; i < 6; i++) { if (cp->sliders[i] == slider) @@ -670,14 +670,14 @@ Etk_Colorpicker *cp; Etk_Color color; Evas *evas; - + if (!(cp = ETK_COLORPICKER(data)) || !(evas = etk_widget_toplevel_evas_get(ETK_WIDGET(cp)))) return; - + cp->current_color_rect = evas_object_rectangle_add(evas); etk_widget_swallow_object(cp->current_color_widget, "etk.swallow.preview", cp->current_color_rect); evas_object_show(cp->current_color_rect); - + color = cp->current_color; evas_color_argb_premul(color.a, &color.r, &color.g, &color.b); evas_object_color_set(cp->current_color_rect, color.r, color.g, color.b, color.a); @@ -687,10 +687,10 @@ static void _etk_colorpicker_current_color_unrealized_cb(Etk_Object *object, void *data) { Etk_Colorpicker *cp; - + if (!(cp = ETK_COLORPICKER(data))) return; - + evas_object_del(cp->current_color_rect); cp->current_color_rect = NULL; } @@ -703,12 +703,12 @@ Etk_Bool update_sp; Etk_Bool update_vp; int i; - + if (!(slider = ETK_WIDGET(object)) || !(cp = ETK_COLORPICKER(data))) return; if (cp->ignore_value_changed) return; - + for (i = 0; i < 6; i++) { if (cp->sliders[i] == slider) @@ -728,18 +728,18 @@ Etk_Colorpicker *cp; Etk_Widget *slider; Etk_Color color; - + if (!(slider = ETK_WIDGET(object)) || !(cp = ETK_COLORPICKER(data))) return; - + color.r = cp->current_color.r; color.g = cp->current_color.g; color.b = cp->current_color.b; - + cp->current_color.a = value; evas_color_argb_premul(cp->current_color.a, &color.r, &color.g, &color.b); evas_object_color_set(cp->current_color_rect, color.r, color.g, color.b, cp->current_color.a); - + if (!cp->ignore_value_changed) etk_signal_emit(_etk_colorpicker_signals[ETK_CP_COLOR_CHANGED_SIGNAL], ETK_OBJECT(cp), NULL); } @@ -750,12 +750,12 @@ Etk_Colorpicker *cp; Etk_Widget *radio; int i; - + if (!(radio = ETK_WIDGET(object)) || !(cp = ETK_COLORPICKER(data))) return; if (!etk_toggle_button_active_get(ETK_TOGGLE_BUTTON(radio))) return; - + for (i = 0; i < 6; i++) { if (cp->radios[i] == radio) @@ -773,14 +773,14 @@ Evas_Event_Mouse_Down *event; int x, y, w, h; float xpercent, ypercent; - + if (!(cp = ETK_COLORPICKER(data)) || !(event = event_info)) return; - + evas_object_geometry_get(cp->sp_image, &x, &y, &w, &h); xpercent = ETK_CLAMP((float)(event->canvas.x - x) / w, 0.0, 1.0); ypercent = 1.0 - ETK_CLAMP((float)(event->canvas.y - y) / h, 0.0, 1.0); - + _etk_colorpicker_sp_cursor_move(cp, xpercent, ypercent); cp->sp_dragging = ETK_TRUE; } @@ -789,7 +789,7 @@ static void _etk_colorpicker_sp_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Etk_Colorpicker *cp; - + if (!(cp = ETK_COLORPICKER(data))) return; cp->sp_dragging = ETK_FALSE; @@ -802,14 +802,14 @@ Evas_Event_Mouse_Move *event; int x, y, w, h; float xpercent, ypercent; - + if (!(cp = ETK_COLORPICKER(data)) || !(event = event_info) || !cp->sp_dragging) return; - + evas_object_geometry_get(cp->sp_image, &x, &y, &w, &h); xpercent = ETK_CLAMP((float)(event->cur.canvas.x - x) / w, 0.0, 1.0); ypercent = 1.0 - ETK_CLAMP((float)(event->cur.canvas.y - y) / h, 0.0, 1.0); - + _etk_colorpicker_sp_cursor_move(cp, xpercent, ypercent); } @@ -820,13 +820,13 @@ Evas_Event_Mouse_Down *event; int y, h; float percent; - + if (!(cp = ETK_COLORPICKER(data)) || !(event = event_info)) return; - + evas_object_geometry_get(cp->vp_image, NULL, &y, NULL, &h); percent = 1.0 - ETK_CLAMP((float)(event->canvas.y - y) / h, 0.0, 1.0); - + etk_range_value_set(ETK_RANGE(cp->sliders[cp->mode]), percent * _etk_colorpicker_max_values[cp->mode]); cp->vp_dragging = ETK_TRUE; } @@ -835,7 +835,7 @@ static void _etk_colorpicker_vp_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Etk_Colorpicker *cp; - + if (!(cp = ETK_COLORPICKER(data))) return; cp->vp_dragging = ETK_FALSE; @@ -848,13 +848,13 @@ Evas_Event_Mouse_Move *event; int y, h; float percent; - + if (!(cp = ETK_COLORPICKER(data)) || !(event = event_info) || !cp->vp_dragging) return; - + evas_object_geometry_get(cp->vp_image, NULL, &y, NULL, &h); percent = 1.0 - ETK_CLAMP((float)(event->cur.canvas.y - y) / h, 0.0, 1.0); - + etk_range_value_set(ETK_RANGE(cp->sliders[cp->mode]), percent * _etk_colorpicker_max_values[cp->mode]); } @@ -862,10 +862,10 @@ static void _etk_colorpicker_slider_image_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Coord w, h; - + if (!obj) return; - + evas_object_geometry_get(obj, NULL, NULL, &w, &h); evas_object_image_fill_set(obj, 0, 0, w, h); } @@ -881,10 +881,10 @@ { Evas_Object *obj; Etk_Colorpicker_Picker_SD *picker_sd; - + if (!evas || !cp) return NULL; - + if (!_etk_colorpicker_picker_smart) { static const Evas_Smart_Class sc = @@ -906,12 +906,12 @@ _etk_colorpicker_picker_smart_use = 0; } _etk_colorpicker_picker_smart_use++; - + obj = evas_object_smart_add(evas, _etk_colorpicker_picker_smart); picker_sd = evas_object_smart_data_get(obj); picker_sd->cp = cp; picker_sd->move_resize = move_resize; - + return obj; } @@ -920,10 +920,10 @@ { Etk_Colorpicker_Picker_SD *picker_sd; Evas *evas; - + if (!obj || !(evas = evas_object_evas_get(obj))) return; - + picker_sd = malloc(sizeof(Etk_Colorpicker_Picker_SD)); picker_sd->objects = NULL; picker_sd->cp = NULL; @@ -935,7 +935,7 @@ static void _etk_colorpicker_picker_smart_del(Evas_Object *obj) { Etk_Colorpicker_Picker_SD *picker_sd; - + if (!obj || !(picker_sd = evas_object_smart_data_get(obj))) return; @@ -945,7 +945,7 @@ picker_sd->objects = evas_list_remove_list(picker_sd->objects, picker_sd->objects); } free(picker_sd); - + _etk_colorpicker_picker_smart_use--; if (_etk_colorpicker_picker_smart_use <= 0 && _etk_colorpicker_picker_smart) { @@ -959,7 +959,7 @@ { Etk_Colorpicker_Picker_SD *picker_sd; Evas_Coord w, h; - + if (!obj || !(picker_sd = evas_object_smart_data_get(obj))) return; @@ -973,7 +973,7 @@ { Etk_Colorpicker_Picker_SD *picker_sd; Evas_Coord x, y; - + if (!obj || !(picker_sd = evas_object_smart_data_get(obj))) return; @@ -987,7 +987,7 @@ { Etk_Colorpicker_Picker_SD *picker_sd; Evas_List *l; - + if (!obj || !(picker_sd = evas_object_smart_data_get(obj))) return; @@ -1000,7 +1000,7 @@ { Etk_Colorpicker_Picker_SD *picker_sd; Evas_List *l; - + if (!obj || !(picker_sd = evas_object_smart_data_get(obj))) return; @@ -1013,7 +1013,7 @@ { Etk_Colorpicker_Picker_SD *picker_sd; Evas_List *l; - + if (!obj || !(picker_sd = evas_object_smart_data_get(obj))) return; @@ -1026,7 +1026,7 @@ { Etk_Colorpicker_Picker_SD *picker_sd; Evas_List *l; - + if (!obj || !(picker_sd = evas_object_smart_data_get(obj))) return; @@ -1045,11 +1045,11 @@ { if (!cp || !cp->sp_image) return; - + evas_object_move(cp->sp_image, x, y); evas_object_resize(cp->sp_image... [truncated message content] |