void etk_entropy_delete_dialog_cb(Etk_Object* w, void* user_data) { Etk_Widget* window = NULL; int result = (int)user_data; entropy_generic_file* file; Ecore_List* files; entropy_gui_component_instance* instance; window = etk_object_data_get(ETK_OBJECT(w), "window"); files= etk_object_data_get(ETK_OBJECT(window), "files"); instance = etk_object_data_get(ETK_OBJECT(window), "instance"); switch (result) { case ENTROPY_USER_INTERACTION_RESPONSE_YES: { ecore_list_first_goto(files); while ((file = ecore_list_first_remove(files))) { entropy_plugin_filesystem_file_remove(file, instance); } } break; case ENTROPY_USER_INTERACTION_RESPONSE_NO: { } break; default: break; } ecore_list_destroy(files); etk_object_destroy(ETK_OBJECT(window)); }
void etk_entropy_user_interaction_dialog_cb(Etk_Object* w, void* user_data) { long id = (long)etk_object_data_get(ETK_OBJECT(w),"operation"); Etk_Widget* window = NULL; entropy_plugin_operation_respond( id, (int)user_data ); window = etk_object_data_get(ETK_OBJECT(w), "window"); etk_object_destroy(ETK_OBJECT(window)); }
static void evolve_gui_property_spinner_value_changed_cb(Etk_Range *range, double value) { Etk_Spinner *spinner; Evolve_Property *prop; Evolve_Widget *widget; char value_str[64]; if (!(spinner = ETK_SPINNER(range))) return; prop = etk_object_data_get(ETK_OBJECT(spinner), "prop"); widget = etk_object_data_get(ETK_OBJECT(spinner), "widget"); snprintf(value_str, sizeof(value_str), "%f", value); evolve_widget_property_set(widget, prop->name, value_str, prop->type); }
/** * @brief Gets the response-id associated to the button * @param button a button * @return Returns the response-id associated to the button, or ETK_RESPONSE_NONE if the button is not packed in a * dialog */ int etk_dialog_button_response_id_get(Etk_Button *button) { int *id; if (!button || !(id = (int *)etk_object_data_get(ETK_OBJECT(button), "_Etk_Dialog::Response_Id"))) return ETK_RESPONSE_NONE; return *id; }
static void evolve_gui_property_entry_text_changed_cb(Etk_Object *object, void *data) { Evolve_Widget *widget; Evolve_Property *prop; prop = etk_object_data_get(object, "prop"); widget = data; evolve_widget_property_set(widget, prop->name, (char*)etk_entry_text_get(ETK_ENTRY(object)), prop->type); }
/* Removes the child from the table */ static void _etk_table_child_remove(Etk_Container *container, Etk_Widget *widget) { Etk_Table *table; Etk_Table_Cell *cell; if (!(table = ETK_TABLE(container)) || !widget) return; if (!(cell = etk_object_data_get(ETK_OBJECT(widget), "_Etk_Table::Cell"))) return; etk_table_cell_clear(table, cell->left_attach, cell->top_attach); }
void etk_local_viewer_cb(Etk_Object* obj, void* data) { entropy_gui_component_instance* local; entropy_gui_component_instance* instance = data; /*Get the local viewer they want..*/ local = etk_object_data_get(ETK_OBJECT(obj), "VISUAL"); if (local) { entropy_layout_etk_simple_local_view_set(instance, local); } else { printf("Local is null!\n"); } }
/** * @brief Gets a context-id corresponding to the context description * @param statusbar a statusbar * @param context the description of the context * @return Returns the context-id corresponding to the context description, or -1 on failure */ int etk_statusbar_context_id_get(Etk_Statusbar *statusbar, const char *context) { char *key; int *context_id; if (!statusbar || !context) return -1; key = malloc(strlen("_Etk_Statusbar::") + strlen(context) + 1); sprintf(key, "_Etk_Statusbar::%s", context); if (!(context_id = etk_object_data_get(ETK_OBJECT(statusbar), key))) { context_id = malloc(sizeof(int)); *context_id = statusbar->next_context_id++; etk_object_data_set_full(ETK_OBJECT(statusbar), key, context_id, free); } free(key); return *context_id; }
/* Gets the cell of the box containing the widget */ static Etk_Box_Cell *_etk_box_cell_get(Etk_Widget *widget) { if (!widget) return NULL; return etk_object_data_get(ETK_OBJECT(widget), "_Etk_Box::Cell"); }