summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2015-12-19 14:22:40 +0200
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2015-12-19 14:44:44 +0200
commitc76e01fdbd47c50efd8771723666ae90b46dd7c3 (patch)
tree3c2e67c065e42ebcda82aecafecae1b6bfdca207
parentd7dddf0b9abd582637ae3b0456950e6a92b4c722 (diff)
Factory: Remove previous widgets creation mechanismdevs/jackdanielz/dev
-rw-r--r--src/bin/gui/egui_logic.c82
1 files changed, 0 insertions, 82 deletions
diff --git a/src/bin/gui/egui_logic.c b/src/bin/gui/egui_logic.c
index b49a411..d372e8d 100644
--- a/src/bin/gui/egui_logic.c
+++ b/src/bin/gui/egui_logic.c
@@ -1139,44 +1139,6 @@ egui_start(const char *filename)
1139#endif 1139#endif
1140 1140
1141 _factory_session = session_new(MODE_SIMULATOR, EINA_TRUE); 1141 _factory_session = session_new(MODE_SIMULATOR, EINA_TRUE);
1142#define FACTORY_CREATE(widget, parent, x, y, w, h) \
1143 { \
1144 Eo *eo_parent = g_main_wdgs->main_win->parent; \
1145 Eid *box_id = gui_context_eid_get_by_name(global_context_get(), "_fctr_box_template"); \
1146 Eo *box = simulator_widget_create(_factory_session, wdg_get(box_id), eo_parent); \
1147 Eid *obj_id = gui_context_eid_get_by_name(global_context_get(), #widget); \
1148 Eo *obj = simulator_widget_create(_factory_session, wdg_get(obj_id), box); \
1149 Evas_Coord ow, oh; \
1150 evas_object_geometry_get(obj, NULL, NULL, &ow, &oh); \
1151 if (ow > 80) ow = 80; \
1152 if (oh > 80) oh = 80; \
1153 Eid *proxy_id = gui_context_eid_get_by_name(global_context_get(), "_fctr_proxy_template"); \
1154 Eo *proxy = simulator_widget_create(_factory_session, wdg_get(proxy_id), box); \
1155 eo_do(proxy, evas_obj_image_source_set(obj), \
1156 evas_obj_size_hint_min_set(ow, oh), \
1157 evas_obj_image_source_visible_set(EINA_FALSE)); \
1158 eo_do(box, elm_obj_box_pack_end(proxy), \
1159 eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_DOWN, _factory_tt_mouse_down, NULL)); \
1160 elm_object_tooltip_text_set(box, #widget); \
1161 eo_do(eo_parent, elm_obj_table_pack(box, x, y, w, h)); \
1162 drag_add(box, NULL, obj_id); \
1163 _factory_widgets_list = eina_list_append(_factory_widgets_list, box); \
1164 }
1165#define FACTORY_IMG_CREATE(widget, image_path, parent, x, y, w, h) \
1166 { \
1167 Eo *eo_parent = g_main_wdgs->main_win->parent; \
1168 Eid *wdg_id = gui_context_eid_get_by_name(global_context_get(), "_fctr_image_template"); \
1169 Gui_Widget *wdg = wdg_get(wdg_id); \
1170 Eo *o = simulator_widget_create(_factory_session, wdg, eo_parent); \
1171 char path[100]; \
1172 sprintf(path, "%s/%s", EGUI_LAYOUT_IMAGES_PATH, image_path); \
1173 eo_do(o, efl_file_set(path, NULL)); \
1174 elm_object_tooltip_text_set(o, #widget); \
1175 eo_do(o, eo_event_callback_add(EVAS_OBJECT_EVENT_MOUSE_DOWN, _factory_tt_mouse_down, NULL)); \
1176 eo_do(eo_parent, elm_obj_table_pack(o, x, y, w, h)); \
1177 wdg_id = gui_context_eid_get_by_name(global_context_get(), #widget); \
1178 drag_add(o, path, wdg_id); \
1179 }
1180 1142
1181 Eo *grid = g_main_wdgs->main_win->fctr_grid; 1143 Eo *grid = g_main_wdgs->main_win->fctr_grid;
1182 Elm_Gengrid_Item_Class *gic = elm_gengrid_item_class_new(); 1144 Elm_Gengrid_Item_Class *gic = elm_gengrid_item_class_new();
@@ -1224,50 +1186,6 @@ egui_start(const char *filename)
1224 elm_gengrid_item_class_free(gic); 1186 elm_gengrid_item_class_free(gic);
1225 elm_gengrid_item_class_free(ggic); 1187 elm_gengrid_item_class_free(ggic);
1226 1188
1227 FACTORY_IMG_CREATE(Snippet_Win, "factory_layout.png", fctr_table_snippets, 0, 0, 1, 1);
1228
1229 FACTORY_IMG_CREATE(Win, "factory_layout.png", fctr_table, 0, 0, 1, 1);
1230 FACTORY_IMG_CREATE(Bg, "factory_bg.png", fctr_table, 1, 0, 1, 1);
1231 FACTORY_CREATE(Button, fctr_table, 2, 0, 1, 1);
1232 FACTORY_CREATE(Label, fctr_table, 0, 1, 1, 1);
1233 FACTORY_CREATE(Check, fctr_table, 1, 1, 1, 1);
1234 FACTORY_CREATE(Radio, fctr_table, 2, 1, 1, 1);
1235 FACTORY_IMG_CREATE(Icon, "factory_icon.png", fctr_table, 0, 2, 1, 1);
1236 FACTORY_IMG_CREATE(Image, "factory_image.png", fctr_table, 1, 2, 1, 1);
1237 FACTORY_CREATE(Entry, fctr_table, 2, 2, 1, 1);
1238 FACTORY_CREATE(Clock, fctr_table, 0, 3, 1, 1);
1239 FACTORY_CREATE(ColorSelector, fctr_table, 1, 3, 1, 1);
1240 FACTORY_CREATE(Calendar, fctr_table, 2, 3, 1, 1);
1241 FACTORY_CREATE(Bubble, fctr_table, 0, 4, 1, 1);
1242 FACTORY_IMG_CREATE(Flip, "factory_flip.png", fctr_table, 1, 4, 1, 1);
1243 FACTORY_CREATE(Frame, fctr_table, 2, 4, 1, 1);
1244 FACTORY_CREATE(FileSelector, fctr_table, 0, 5, 1, 2);
1245 FACTORY_CREATE(FileSelectorEntry, fctr_table, 1, 5, 2, 1);
1246 FACTORY_CREATE(FileSelectorButton, fctr_table, 1, 6, 2, 1);
1247 FACTORY_CREATE(ActionSlider, fctr_table, 0, 7, 2, 1);
1248 FACTORY_CREATE(Hoversel, fctr_table, 2, 7, 1, 1);
1249 FACTORY_CREATE(ProgressBar, fctr_table, 0, 8, 2, 1);
1250 FACTORY_CREATE(Separator, fctr_table, 2, 8, 1, 1);
1251 FACTORY_CREATE(Slider, fctr_table, 0, 9, 3, 1);
1252 FACTORY_CREATE(DaySelector, fctr_table, 0, 10, 3, 1);
1253
1254 FACTORY_CREATE(Box, fctr_table_containers, 0, 0, 1, 1);
1255 FACTORY_CREATE(Table, fctr_table_containers, 1, 0, 1, 1);
1256 FACTORY_IMG_CREATE(Grid, "factory_grid.png", fctr_table_containers, 2, 0, 1, 1);
1257 FACTORY_IMG_CREATE(Layout, "factory_layout.png", fctr_table_containers, 0, 1, 1, 1);
1258 FACTORY_CREATE(Naviframe, fctr_table_containers, 1, 1, 1, 1);
1259 FACTORY_CREATE(Panes, fctr_table_containers, 2, 1, 1, 1);
1260 FACTORY_IMG_CREATE(Conformant, "factory_conformant.png", fctr_table_containers, 0, 2, 1, 1);
1261 FACTORY_IMG_CREATE(Genlist, "factory_genlist.png", fctr_table_containers, 1, 2, 1, 1);
1262 FACTORY_IMG_CREATE(Gengrid, "factory_gengrid.png", fctr_table_containers, 2, 2, 1, 1);
1263
1264 FACTORY_IMG_CREATE(Toolbar, "factory_toolbar.png", fctr_table_item_widgets, 0, 0, 1, 1);
1265 FACTORY_CREATE(DiskSelector, fctr_table_item_widgets, 1, 0, 1, 1);
1266 FACTORY_IMG_CREATE(CtxPopup, "factory_ctxpopup.png", fctr_table_item_widgets, 0, 1, 1, 1);
1267 FACTORY_IMG_CREATE(Menu, "factory_menu.png", fctr_table_item_widgets, 1, 1, 1, 1);
1268
1269 FACTORY_IMG_CREATE(EvasImage, "factory_image.png", fctr_table_evas, 0, 0, 1, 1);
1270
1271 /*FIXME: Need to unpack inline image, so pass it into delete callback*/ 1189 /*FIXME: Need to unpack inline image, so pass it into delete callback*/
1272 evas_object_smart_callback_add(g_main_wdgs->main_win->main_win, "delete,request", _main_win_del_cb, NULL); 1190 evas_object_smart_callback_add(g_main_wdgs->main_win->main_win, "delete,request", _main_win_del_cb, NULL);
1273 _egui_project_open(filename); 1191 _egui_project_open(filename);