From 6e7b1ad395d543bc7218d5d030dda8303d97c49e Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 21 Jan 2016 20:04:33 +1000 Subject: Rejig the structure of windows a lot. --- src/extantz/extantz.c | 77 +++++++++++++++++++++++---------------------------- src/extantz/files.c | 12 +------- src/extantz/woMan.c | 4 +-- 3 files changed, 37 insertions(+), 56 deletions(-) (limited to 'src/extantz') diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index bb67e62..7fc2d81 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -467,8 +467,6 @@ static winFang *_makeMainMenu(globals *ourGlobals) it = elm_toolbar_item_append(tb, NoIcon, NULL, NULL, NULL); elm_toolbar_item_separator_set(it, EINA_TRUE); it = elm_toolbar_item_append(tb, NoIcon, "date time:o'clock", NULL, NULL); - elm_layout_box_prepend(me->layout, WF_BOX, tb); - return me; } @@ -588,7 +586,6 @@ static Eina_Bool _makeSkang(void *data) EAPI_MAIN int elm_main(int argc, char **argv) { GLData *gld = NULL; - char buf[PATH_MAX * 2]; // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. logDom = HamrTime(argv[0], elm_main, logDom); @@ -658,16 +655,19 @@ EAPI_MAIN int elm_main(int argc, char **argv) ELM_WIN_BASIC ELM_LAYOUT_CLASS WF_LAYOUT winFang.edc - IMAGE background - semi transparent dark purple image. -? SWALLOW underlay - SWALLOW title - Details change if it's internal. - BOX box - Details change if it's internal. -? SWALLOW content -? ELM_GRID_CLASS WF_SWALLOW - -? ELM_BG_CLASS Sky background image. + SWALLOW WF_BACKGROUND + SWALLOW WF_UNDERLAY + SWALLOW WF_TITLE + Only visible if it's internal. + SWALLOW WF_TOOLBAR + Only visible if it's got a menu. + SWALLOW WF_BOX + Vertical box. + SWALLOW WF_GRID + ELM_BG_CLASS Evas_3D specific background, attached directly to window, not swallowed. + ELM_BOX_CLASS Swallowed by WF_BOX + isMain signal sent to layout. + ELM_GRID_CLASS Swallowed by WF_GRID Extra stuff added here by init_evas_gl() if we are doing gears or Irrlicht. ? Elm glview Irrlicht / gears target GLView. @@ -684,8 +684,10 @@ EAPI_MAIN int elm_main(int argc, char **argv) require skang by default require skang ? require purkle + Eventually uses WF_GRID for widget layout, though could in future use WF_BOX for some of them. files.c winFang A normally hidden window with a file requestor, and other Elm widgets. +? elm_layout_box_append(me->win, WF_BOX, vbox); scenriAdd() 3D scene and node stuff ELM_IMAGE_CLASS Evas_3D render target. @@ -701,6 +703,8 @@ EAPI_MAIN int elm_main(int argc, char **argv) winFang World manager internal window, with it's own menu and toolbar stuff. Uses the same menu code as the main menus below. But with added pager stuff. + elm_layout_box_append(me->win, WF_BOX, nf); Elm naviframe for the tab pages. + elm_layout_box_append(me->win, WF_BOX, bt); Elm Login button. love main menus makeMainMenu() @@ -710,8 +714,9 @@ EAPI_MAIN int elm_main(int argc, char **argv) elm_toolbar_item_append() elm_menu_item_add() makeMainMenuFinish() -? elm_layout_box_append(win->win, WF_BOX, tb); - + elm_object_part_content_set(win->layout, WF_TOOLBAR, tb); + isToolbar signal sent to layout. + elm_toolbar_item_append() Internal windows are - @@ -721,39 +726,25 @@ EAPI_MAIN int elm_main(int argc, char **argv) ELM_LAYOUT_CLASS WF_LAYOUT This layout becomes our window object. winFang.edc - IMAGE background - semi transparent dark purple image. - SWALLOW underlay - SWALLOW title - Details change if it's internal. - BOX box - Details change if it's internal. - SWALLOW content - "isInternal" signal sent. + ELM_BG_CLASS Internal window background, swallowed by WF_BACKGROUND. + Semi transparent dark purple image. + ELM_BOX_CLASS Swallowed by WF_BOX EVAS_RECTANGLE_CLASS Invisible click catcher, for moving windows. - WF_UNDERLAY + Swallowed by WF_UNDERLAY EVAS_IMAGE_CLASS Corner "handles" x 4. ELM_LABEL_CLASS Window title. - ELM_GRID_CLASS WF_SWALLOW - - */ + Swallowed by WF_TITLE + ELM_GRID_CLASS Swallowed by WF_GRID + widgetAdd Will either append it to WF_BOX, or pack it into WF_GRID using supplied coords and size. + Used by skang for creating widgets. + Used by purkle for it's main widgets (in C), in WF_BOX. +? Used by files for WT_FILES, but not the rest, this ends up inside WF_BOX, though it has it's own vbox. +?? This vbox is an ELM_BOX_CLASS, er but - +??? elm_obj_box_horizontal_set(EINA_TRUE) + TODO - what happens when we mix BOX and GRID widgets? Perhaps GRID should live inside BOX? - // Create the background image -#if 1 - snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get()); - ourGlobals.mainWindow->bg = eo_add(ELM_BG_CLASS, ourGlobals.mainWindow->win, - evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_file_set(buf, NULL), - efl_gfx_visible_set(EINA_TRUE) - ); - elm_win_resize_object_add(ourGlobals.mainWindow->win, ourGlobals.mainWindow->bg); -#else - snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get()); - eo_do(ourGlobals.mainWindow->bg, - efl_file_set(buf, NULL), - efl_gfx_color_set(255, 255, 255, 255) - ); -#endif + */ init_evas_gl(&ourGlobals); diff --git a/src/extantz/files.c b/src/extantz/files.c index a2d26df..c27cd9c 100644 --- a/src/extantz/files.c +++ b/src/extantz/files.c @@ -197,7 +197,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa ); elm_object_text_set(hoversel, "sorting"); elm_box_pack_end(vbox, hoversel); -// eo_unref(hoversel); hoversel = eo_add(ELM_HOVERSEL_CLASS, vbox, elm_obj_hoversel_hover_parent_set(me->win), @@ -212,7 +211,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa elm_box_pack_end(vbox, hoversel); // Make sure it starts off as small, works around "hitting grid mode before hitting size not showing anything" bug. _small_icon_clicked(fs, hoversel, NULL); -// eo_unref(hoversel); bt = eo_add(ELM_CHECK_CLASS, vbox, @@ -222,7 +220,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa elm_object_text_set(bt, "hidden"); evas_object_smart_callback_add(bt, "changed", _hidden_clicked, fs); elm_box_pack_end(vbox, bt); -// eo_unref(bt); rdg = rd = eo_add(ELM_RADIO_CLASS, vbox, elm_obj_radio_state_value_set(ELM_FILESELECTOR_GRID), @@ -233,7 +230,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); // Make it start in grid mode. It defaults to list mode, so this swaps it over. _mode_changed_cb(fs, rd, NULL); -// eo_unref(rd); rd = eo_add(ELM_RADIO_CLASS, vbox, elm_obj_radio_state_value_set(ELM_FILESELECTOR_LIST), @@ -243,9 +239,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa elm_object_text_set(rd, "list"); elm_box_pack_end(vbox, rd); evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); -// eo_unref(rd); - // No need to unref this, it's taken care of already. - //eo_unref(rdg); bt = eo_add(ELM_BUTTON_CLASS, me->win, efl_gfx_visible_set(EINA_TRUE) @@ -253,7 +246,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa elm_object_text_set(bt, "OK"); evas_object_smart_callback_add(bt, "clicked", _OK_clicked, me); elm_box_pack_end(vbox, bt); -// eo_unref(bt); bt = eo_add(ELM_BUTTON_CLASS, me->win, efl_gfx_visible_set(EINA_TRUE) @@ -261,11 +253,9 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa elm_object_text_set(bt, "CANCEL"); evas_object_smart_callback_add(bt, "clicked", _CANCEL_clicked, me); elm_box_pack_end(vbox, bt); -// eo_unref(bt); - elm_layout_box_append(me->win, WF_BOX, vbox); + elm_box_pack_end(me->box, vbox); evas_object_show(vbox); -// eo_unref(vbox); winFangCalcMinSize(me); winFangHide(me); diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index c867241..7ff1c28 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c @@ -254,7 +254,7 @@ winFang *woMan_add(globals *ourGlobals) // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away. tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NoIcon, "Landmarks", _promote, tab_it); tab = gridList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NoIcon, "Grids", _promote, tab_it); - elm_layout_box_append(me->win, WF_BOX, nf); + elm_box_pack_end(me->box, nf); bt = eo_add(ELM_BUTTON_CLASS, me->win, // evas_obj_text_set("Login"), @@ -264,7 +264,7 @@ winFang *woMan_add(globals *ourGlobals) ); elm_object_text_set(bt, "Login"); // No eo interface for this that I can find. // evas_object_smart_callback_add(bt, "clicked", NULL, NULL); - elm_layout_box_append(me->win, WF_BOX, bt); + elm_box_pack_end(me->box, bt); winFangCalcMinSize(me); -- cgit v1.1