aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-01-21 20:04:33 +1000
committerDavid Walter Seikel2016-01-21 20:04:33 +1000
commit6e7b1ad395d543bc7218d5d030dda8303d97c49e (patch)
tree4bc4831ac8a99a11157aa5d8f772a46f842e74e7
parentRewrite the layers description. (diff)
downloadSledjHamr-6e7b1ad395d543bc7218d5d030dda8303d97c49e.zip
SledjHamr-6e7b1ad395d543bc7218d5d030dda8303d97c49e.tar.gz
SledjHamr-6e7b1ad395d543bc7218d5d030dda8303d97c49e.tar.bz2
SledjHamr-6e7b1ad395d543bc7218d5d030dda8303d97c49e.tar.xz
Rejig the structure of windows a lot.
-rw-r--r--src/GuiLua/GuiLua.c2
-rw-r--r--src/extantz/extantz.c77
-rw-r--r--src/extantz/files.c12
-rw-r--r--src/extantz/woMan.c4
-rw-r--r--src/libraries/winFang.c69
-rw-r--r--src/libraries/winFang.edc121
-rw-r--r--src/libraries/winFang.h8
-rw-r--r--src/purkle/purkle.c2
8 files changed, 165 insertions, 130 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c
index cb8d070..06180f7 100644
--- a/src/GuiLua/GuiLua.c
+++ b/src/GuiLua/GuiLua.c
@@ -300,7 +300,7 @@ static int window(lua_State *L)
300 world = gl->world; 300 world = gl->world;
301 } 301 }
302 302
303 win = winFangAdd(parent, 5, 26, w, h, title, name, world); 303 win = winFangAdd(parent, 5, 52, w, h, title, name, world);
304 win->module = strdup(module); 304 win->module = strdup(module);
305 if (gl) 305 if (gl)
306 { 306 {
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)
467 it = elm_toolbar_item_append(tb, NoIcon, NULL, NULL, NULL); elm_toolbar_item_separator_set(it, EINA_TRUE); 467 it = elm_toolbar_item_append(tb, NoIcon, NULL, NULL, NULL); elm_toolbar_item_separator_set(it, EINA_TRUE);
468 it = elm_toolbar_item_append(tb, NoIcon, "date time:o'clock", NULL, NULL); 468 it = elm_toolbar_item_append(tb, NoIcon, "date time:o'clock", NULL, NULL);
469 469
470 elm_layout_box_prepend(me->layout, WF_BOX, tb);
471
472 return me; 470 return me;
473} 471}
474 472
@@ -588,7 +586,6 @@ static Eina_Bool _makeSkang(void *data)
588EAPI_MAIN int elm_main(int argc, char **argv) 586EAPI_MAIN int elm_main(int argc, char **argv)
589{ 587{
590 GLData *gld = NULL; 588 GLData *gld = NULL;
591 char buf[PATH_MAX * 2];
592// Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. 589// Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't.
593 590
594 logDom = HamrTime(argv[0], elm_main, logDom); 591 logDom = HamrTime(argv[0], elm_main, logDom);
@@ -658,16 +655,19 @@ EAPI_MAIN int elm_main(int argc, char **argv)
658 ELM_WIN_BASIC 655 ELM_WIN_BASIC
659 ELM_LAYOUT_CLASS WF_LAYOUT 656 ELM_LAYOUT_CLASS WF_LAYOUT
660 winFang.edc 657 winFang.edc
661 IMAGE background - semi transparent dark purple image. 658 SWALLOW WF_BACKGROUND
662? SWALLOW underlay 659 SWALLOW WF_UNDERLAY
663 SWALLOW title 660 SWALLOW WF_TITLE
664 Details change if it's internal. 661 Only visible if it's internal.
665 BOX box 662 SWALLOW WF_TOOLBAR
666 Details change if it's internal. 663 Only visible if it's got a menu.
667? SWALLOW content 664 SWALLOW WF_BOX
668? ELM_GRID_CLASS WF_SWALLOW 665 Vertical box.
669 666 SWALLOW WF_GRID
670? ELM_BG_CLASS Sky background image. 667 ELM_BG_CLASS Evas_3D specific background, attached directly to window, not swallowed.
668 ELM_BOX_CLASS Swallowed by WF_BOX
669 isMain signal sent to layout.
670 ELM_GRID_CLASS Swallowed by WF_GRID
671 671
672 Extra stuff added here by init_evas_gl() if we are doing gears or Irrlicht. 672 Extra stuff added here by init_evas_gl() if we are doing gears or Irrlicht.
673? Elm glview Irrlicht / gears target GLView. 673? Elm glview Irrlicht / gears target GLView.
@@ -684,8 +684,10 @@ EAPI_MAIN int elm_main(int argc, char **argv)
684 require skang by default 684 require skang by default
685 require skang 685 require skang
686? require purkle 686? require purkle
687 Eventually uses WF_GRID for widget layout, though could in future use WF_BOX for some of them.
687 files.c 688 files.c
688 winFang A normally hidden window with a file requestor, and other Elm widgets. 689 winFang A normally hidden window with a file requestor, and other Elm widgets.
690? elm_layout_box_append(me->win, WF_BOX, vbox);
689 scenriAdd() 691 scenriAdd()
690 3D scene and node stuff 692 3D scene and node stuff
691 ELM_IMAGE_CLASS Evas_3D render target. 693 ELM_IMAGE_CLASS Evas_3D render target.
@@ -701,6 +703,8 @@ EAPI_MAIN int elm_main(int argc, char **argv)
701 winFang World manager internal window, with it's own menu and toolbar stuff. 703 winFang World manager internal window, with it's own menu and toolbar stuff.
702 Uses the same menu code as the main menus below. 704 Uses the same menu code as the main menus below.
703 But with added pager stuff. 705 But with added pager stuff.
706 elm_layout_box_append(me->win, WF_BOX, nf); Elm naviframe for the tab pages.
707 elm_layout_box_append(me->win, WF_BOX, bt); Elm Login button.
704 love 708 love
705 main menus 709 main menus
706 makeMainMenu() 710 makeMainMenu()
@@ -710,8 +714,9 @@ EAPI_MAIN int elm_main(int argc, char **argv)
710 elm_toolbar_item_append() 714 elm_toolbar_item_append()
711 elm_menu_item_add() 715 elm_menu_item_add()
712 makeMainMenuFinish() 716 makeMainMenuFinish()
713? elm_layout_box_append(win->win, WF_BOX, tb); 717 elm_object_part_content_set(win->layout, WF_TOOLBAR, tb);
714 718 isToolbar signal sent to layout.
719 elm_toolbar_item_append()
715 720
716 721
717 Internal windows are - 722 Internal windows are -
@@ -721,39 +726,25 @@ EAPI_MAIN int elm_main(int argc, char **argv)
721 ELM_LAYOUT_CLASS WF_LAYOUT 726 ELM_LAYOUT_CLASS WF_LAYOUT
722 This layout becomes our window object. 727 This layout becomes our window object.
723 winFang.edc 728 winFang.edc
724 IMAGE background - semi transparent dark purple image. 729 ELM_BG_CLASS Internal window background, swallowed by WF_BACKGROUND.
725 SWALLOW underlay 730 Semi transparent dark purple image.
726 SWALLOW title 731 ELM_BOX_CLASS Swallowed by WF_BOX
727 Details change if it's internal.
728 BOX box
729 Details change if it's internal.
730 SWALLOW content
731 "isInternal" signal sent.
732 EVAS_RECTANGLE_CLASS Invisible click catcher, for moving windows. 732 EVAS_RECTANGLE_CLASS Invisible click catcher, for moving windows.
733 WF_UNDERLAY 733 Swallowed by WF_UNDERLAY
734 EVAS_IMAGE_CLASS Corner "handles" x 4. 734 EVAS_IMAGE_CLASS Corner "handles" x 4.
735 ELM_LABEL_CLASS Window title. 735 ELM_LABEL_CLASS Window title.
736 ELM_GRID_CLASS WF_SWALLOW 736 Swallowed by WF_TITLE
737 737 ELM_GRID_CLASS Swallowed by WF_GRID
738 */
739 738
739 widgetAdd Will either append it to WF_BOX, or pack it into WF_GRID using supplied coords and size.
740 Used by skang for creating widgets.
741 Used by purkle for it's main widgets (in C), in WF_BOX.
742? Used by files for WT_FILES, but not the rest, this ends up inside WF_BOX, though it has it's own vbox.
743?? This vbox is an ELM_BOX_CLASS, er but -
744??? elm_obj_box_horizontal_set(EINA_TRUE)
745 TODO - what happens when we mix BOX and GRID widgets? Perhaps GRID should live inside BOX?
740 746
741 // Create the background image 747 */
742#if 1
743 snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get());
744 ourGlobals.mainWindow->bg = eo_add(ELM_BG_CLASS, ourGlobals.mainWindow->win,
745 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
746 efl_file_set(buf, NULL),
747 efl_gfx_visible_set(EINA_TRUE)
748 );
749 elm_win_resize_object_add(ourGlobals.mainWindow->win, ourGlobals.mainWindow->bg);
750#else
751 snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get());
752 eo_do(ourGlobals.mainWindow->bg,
753 efl_file_set(buf, NULL),
754 efl_gfx_color_set(255, 255, 255, 255)
755 );
756#endif
757 748
758 init_evas_gl(&ourGlobals); 749 init_evas_gl(&ourGlobals);
759 750
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
197 ); 197 );
198 elm_object_text_set(hoversel, "sorting"); 198 elm_object_text_set(hoversel, "sorting");
199 elm_box_pack_end(vbox, hoversel); 199 elm_box_pack_end(vbox, hoversel);
200// eo_unref(hoversel);
201 200
202 hoversel = eo_add(ELM_HOVERSEL_CLASS, vbox, 201 hoversel = eo_add(ELM_HOVERSEL_CLASS, vbox,
203 elm_obj_hoversel_hover_parent_set(me->win), 202 elm_obj_hoversel_hover_parent_set(me->win),
@@ -212,7 +211,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa
212 elm_box_pack_end(vbox, hoversel); 211 elm_box_pack_end(vbox, hoversel);
213 // Make sure it starts off as small, works around "hitting grid mode before hitting size not showing anything" bug. 212 // Make sure it starts off as small, works around "hitting grid mode before hitting size not showing anything" bug.
214 _small_icon_clicked(fs, hoversel, NULL); 213 _small_icon_clicked(fs, hoversel, NULL);
215// eo_unref(hoversel);
216 214
217 215
218 bt = eo_add(ELM_CHECK_CLASS, vbox, 216 bt = eo_add(ELM_CHECK_CLASS, vbox,
@@ -222,7 +220,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa
222 elm_object_text_set(bt, "hidden"); 220 elm_object_text_set(bt, "hidden");
223 evas_object_smart_callback_add(bt, "changed", _hidden_clicked, fs); 221 evas_object_smart_callback_add(bt, "changed", _hidden_clicked, fs);
224 elm_box_pack_end(vbox, bt); 222 elm_box_pack_end(vbox, bt);
225// eo_unref(bt);
226 223
227 rdg = rd = eo_add(ELM_RADIO_CLASS, vbox, 224 rdg = rd = eo_add(ELM_RADIO_CLASS, vbox,
228 elm_obj_radio_state_value_set(ELM_FILESELECTOR_GRID), 225 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
233 evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); 230 evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs);
234 // Make it start in grid mode. It defaults to list mode, so this swaps it over. 231 // Make it start in grid mode. It defaults to list mode, so this swaps it over.
235 _mode_changed_cb(fs, rd, NULL); 232 _mode_changed_cb(fs, rd, NULL);
236// eo_unref(rd);
237 233
238 rd = eo_add(ELM_RADIO_CLASS, vbox, 234 rd = eo_add(ELM_RADIO_CLASS, vbox,
239 elm_obj_radio_state_value_set(ELM_FILESELECTOR_LIST), 235 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
243 elm_object_text_set(rd, "list"); 239 elm_object_text_set(rd, "list");
244 elm_box_pack_end(vbox, rd); 240 elm_box_pack_end(vbox, rd);
245 evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); 241 evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs);
246// eo_unref(rd);
247 // No need to unref this, it's taken care of already.
248 //eo_unref(rdg);
249 242
250 bt = eo_add(ELM_BUTTON_CLASS, me->win, 243 bt = eo_add(ELM_BUTTON_CLASS, me->win,
251 efl_gfx_visible_set(EINA_TRUE) 244 efl_gfx_visible_set(EINA_TRUE)
@@ -253,7 +246,6 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa
253 elm_object_text_set(bt, "OK"); 246 elm_object_text_set(bt, "OK");
254 evas_object_smart_callback_add(bt, "clicked", _OK_clicked, me); 247 evas_object_smart_callback_add(bt, "clicked", _OK_clicked, me);
255 elm_box_pack_end(vbox, bt); 248 elm_box_pack_end(vbox, bt);
256// eo_unref(bt);
257 249
258 bt = eo_add(ELM_BUTTON_CLASS, me->win, 250 bt = eo_add(ELM_BUTTON_CLASS, me->win,
259 efl_gfx_visible_set(EINA_TRUE) 251 efl_gfx_visible_set(EINA_TRUE)
@@ -261,11 +253,9 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa
261 elm_object_text_set(bt, "CANCEL"); 253 elm_object_text_set(bt, "CANCEL");
262 evas_object_smart_callback_add(bt, "clicked", _CANCEL_clicked, me); 254 evas_object_smart_callback_add(bt, "clicked", _CANCEL_clicked, me);
263 elm_box_pack_end(vbox, bt); 255 elm_box_pack_end(vbox, bt);
264// eo_unref(bt);
265 256
266 elm_layout_box_append(me->win, WF_BOX, vbox); 257 elm_box_pack_end(me->box, vbox);
267 evas_object_show(vbox); 258 evas_object_show(vbox);
268// eo_unref(vbox);
269 winFangCalcMinSize(me); 259 winFangCalcMinSize(me);
270 260
271 winFangHide(me); 261 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)
254 // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away. 254 // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away.
255 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); 255 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);
256 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); 256 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);
257 elm_layout_box_append(me->win, WF_BOX, nf); 257 elm_box_pack_end(me->box, nf);
258 258
259 bt = eo_add(ELM_BUTTON_CLASS, me->win, 259 bt = eo_add(ELM_BUTTON_CLASS, me->win,
260// evas_obj_text_set("Login"), 260// evas_obj_text_set("Login"),
@@ -264,7 +264,7 @@ winFang *woMan_add(globals *ourGlobals)
264 ); 264 );
265 elm_object_text_set(bt, "Login"); // No eo interface for this that I can find. 265 elm_object_text_set(bt, "Login"); // No eo interface for this that I can find.
266// evas_object_smart_callback_add(bt, "clicked", NULL, NULL); 266// evas_object_smart_callback_add(bt, "clicked", NULL, NULL);
267 elm_layout_box_append(me->win, WF_BOX, bt); 267 elm_box_pack_end(me->box, bt);
268 268
269 winFangCalcMinSize(me); 269 winFangCalcMinSize(me);
270 270
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c
index 7c18919..718e710 100644
--- a/src/libraries/winFang.c
+++ b/src/libraries/winFang.c
@@ -202,6 +202,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
202 } 202 }
203 else 203 else
204 { 204 {
205 // This is our main window, so create it.
205 result->win = elm_win_add(NULL, name, ELM_WIN_BASIC); 206 result->win = elm_win_add(NULL, name, ELM_WIN_BASIC);
206 evas_object_smart_callback_add(result->win, "delete,request", _on_done, NULL); 207 evas_object_smart_callback_add(result->win, "delete,request", _on_done, NULL);
207 evas_object_resize(result->win, result->w, result->h); 208 evas_object_resize(result->win, result->w, result->h);
@@ -213,6 +214,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
213 x = 0; y = 0; 214 x = 0; y = 0;
214 } 215 }
215 216
217 // Create the layout, and add the Edje to it.
216 snprintf(buf, sizeof(buf), "%s/winFang.edj", prefix_data_get()); 218 snprintf(buf, sizeof(buf), "%s/winFang.edj", prefix_data_get());
217 result->layout = eo_add(ELM_LAYOUT_CLASS, obj, 219 result->layout = eo_add(ELM_LAYOUT_CLASS, obj,
218 efl_gfx_size_set(w, h), 220 efl_gfx_size_set(w, h),
@@ -223,8 +225,30 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
223 ); 225 );
224 result->e = evas_object_evas_get(result->layout); 226 result->e = evas_object_evas_get(result->layout);
225 227
226// result->bg = edje_object_part_object_get(elm_layout_edje_get(result->layout), WF_BACKGROUND); 228 // Sort out the background.
229 if (result->parent)
230 snprintf(buf, sizeof(buf), "%s/sky_04.jpg", prefix_data_get());
231 else
232 snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get());
233 result->bg = eo_add(ELM_BG_CLASS, obj,
234 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
235 efl_file_set(buf, NULL),
236 efl_gfx_visible_set(EINA_TRUE)
237 );
238 elm_win_resize_object_add(result->win, result->bg);
239
240 if (result->parent)
241 {
242// // RGBA, so this is purple, and semi transparent.
243// color: 50 0 100 100; // pre multiplied R = (r * a) / 255
244// color: 126 0 255 100; // r = (R * 255) / a
245 eo_do(result->bg, efl_gfx_color_set(50, 0, 100, 100));
246 // This is how fragile things are, internal windows wont show background unless swallowed into the layout,
247 // but Evas_3D is fussy about it's background image, and wont work with a layout swallowed one.
248 elm_object_part_content_set(result->layout, WF_BACKGROUND, result->bg);
249 }
227 250
251 // Evil hacks for no icons, until toolbars get fixed.
228 if (0 == NoIcon[0]) 252 if (0 == NoIcon[0])
229 snprintf(NoIcon, sizeof(NoIcon), "%s/spacer.png", prefix_data_get()); 253 snprintf(NoIcon, sizeof(NoIcon), "%s/spacer.png", prefix_data_get());
230/* This aint doing shit. B-( 254/* This aint doing shit. B-(
@@ -234,10 +258,18 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
234 elm_image_file_set(obj, NoIcon, NULL); 258 elm_image_file_set(obj, NoIcon, NULL);
235*/ 259*/
236 260
261 // Create our box, the default for where content goes.
262 result->box = eo_add(ELM_BOX_CLASS, result->layout,
263 elm_obj_box_homogeneous_set(EINA_FALSE),
264 elm_obj_box_horizontal_set(EINA_FALSE),
265 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL),
266 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
267 );
268 elm_object_part_content_set(result->layout, WF_BOX, result->box);
269
237 if (result->parent) 270 if (result->parent)
238 { 271 {
239 result->win = result->layout; 272 result->win = result->layout;
240 elm_layout_signal_emit(result->layout, "isInternal", "isInternal");
241 273
242 // Something to catch clicks on the background, for moving the window. 274 // Something to catch clicks on the background, for moving the window.
243 // Coz Elm is uncooperative with this sort of thing, so we need to stick in a rectangle. 275 // Coz Elm is uncooperative with this sort of thing, so we need to stick in a rectangle.
@@ -250,7 +282,6 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
250 ); 282 );
251 elm_object_part_content_set(result->layout, WF_UNDERLAY, obj); 283 elm_object_part_content_set(result->layout, WF_UNDERLAY, obj);
252 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, _onBgClick, result); 284 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, _onBgClick, result);
253// eo_unref(obj);
254 285
255 // Create corner handles. 286 // Create corner handles.
256 snprintf(buf, sizeof(buf), "%s/pt.png", prefix_data_get()); 287 snprintf(buf, sizeof(buf), "%s/pt.png", prefix_data_get());
@@ -269,29 +300,37 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch
269 efl_gfx_visible_set(EINA_TRUE) 300 efl_gfx_visible_set(EINA_TRUE)
270 ); 301 );
271 evas_object_event_callback_add(result->hand[i], EVAS_CALLBACK_MOUSE_MOVE, _onHandleMove, result); 302 evas_object_event_callback_add(result->hand[i], EVAS_CALLBACK_MOUSE_MOVE, _onHandleMove, result);
272// eo_unref(result->hand[i]);
273 } 303 }
274 304
305 // Create our window title.
275 result->title = eo_add(ELM_LABEL_CLASS, result->layout, 306 result->title = eo_add(ELM_LABEL_CLASS, result->layout,
276 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), 307 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL),
277 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 308 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0),
278 efl_gfx_visible_set(EINA_TRUE) 309 efl_gfx_visible_set(EINA_TRUE)
279 ); 310 );
280 elm_object_style_set(result->title, "marker"); 311 elm_object_style_set(result->title, "marker");
281 elm_object_text_set(result->title, title); 312 elm_object_text_set(result->title, title);
282 elm_object_part_content_set(result->layout, WF_TITLE, result->title); 313 elm_object_part_content_set(result->layout, WF_TITLE, result->title);
283// eo_unref(result->title); 314 }
315 else
316 {
317 // Hide the window title.
318 elm_layout_signal_emit(result->layout, "isMain", "isMain");
284 } 319 }
285 320
321 // Create our grid, where things go if you supply coords.
286 result->grid = eo_add(ELM_GRID_CLASS, result->layout, 322 result->grid = eo_add(ELM_GRID_CLASS, result->layout,
287 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), 323 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL),
288 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 324 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
289 evas_obj_name_set(WF_SWALLOW), 325 evas_obj_name_set(WF_GRID),
290 // TODO - Actually, this should be minus the size of the title stuff.
291 elm_obj_grid_size_set(result->w, result->h), 326 elm_obj_grid_size_set(result->w, result->h),
292 efl_gfx_visible_set(EINA_TRUE) 327 efl_gfx_visible_set(EINA_TRUE)
293 ); 328 );
294 elm_object_part_content_set(result->layout, WF_SWALLOW, result->grid); 329
330 // This could live inside the box, but then we have to keep track of the size of it's contents.
331 // For now we simply track the position and size of the box.
332// elm_layout_box_append(result->layout, WF_BOX, result->grid);
333 elm_object_part_content_set(result->layout, WF_GRID, result->grid);
295 334
296 elm_layout_sizing_eval(result->layout); 335 elm_layout_sizing_eval(result->layout);
297 336
@@ -332,7 +371,7 @@ void winFangCalcMinSize(winFang *win)
332 if (w > win->mw) win->mw = w; 371 if (w > win->mw) win->mw = w;
333 if (h > win->mh) win->mh = h; 372 if (h > win->mh) win->mh = h;
334 // SWALLOW just returns 0. 373 // SWALLOW just returns 0.
335 evas_object_size_hint_min_get(edje_object_part_object_get(edje, WF_SWALLOW), &w, &h); 374 evas_object_size_hint_min_get(edje_object_part_object_get(edje, WF_GRID), &w, &h);
336 if (w > win->mw) win->mw = w; 375 if (w > win->mw) win->mw = w;
337 if (h > win->mh) win->mh = h; 376 if (h > win->mh) win->mh = h;
338 if (win->title) 377 if (win->title)
@@ -342,6 +381,7 @@ void winFangCalcMinSize(winFang *win)
342 if (w > win->mw) win->mw = w; 381 if (w > win->mw) win->mw = w;
343 win->mh += h; 382 win->mh += h;
344 } 383 }
384 // TODO - should peek and poke at the Edje sizes as well.
345} 385}
346 386
347void winFangDel(winFang *win) 387void winFangDel(winFang *win)
@@ -441,9 +481,9 @@ Widget *widgetAdd(winFang *win, char *type , char *title, int x, int y, int w, i
441 } 481 }
442 482
443 if (x < 0) 483 if (x < 0)
444 elm_layout_box_append(win->layout, WF_BOX, result->obj); 484 elm_box_pack_end(win->box, result->obj); // WF_BOX
445 else 485 else
446 elm_grid_pack(win->grid, result->obj, x, y, w, h); 486 elm_grid_pack(win->grid, result->obj, x, y, w, h); // WF_GRID
447 487
448 if (title) 488 if (title)
449 { 489 {
@@ -529,7 +569,7 @@ elm_cnp.h seems to be the only docs, not actually linked to the rest of Elm docs
529Evas_Object *makeMainMenu(winFang *win) 569Evas_Object *makeMainMenu(winFang *win)
530{ 570{
531 // A toolbar thingy. 571 // A toolbar thingy.
532 return eo_add(ELM_TOOLBAR_CLASS, win->win, 572 return eo_add(ELM_TOOLBAR_CLASS, win->layout,
533 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), 573 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0),
534 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), 574 evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL),
535 elm_obj_toolbar_shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU), 575 elm_obj_toolbar_shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU),
@@ -577,7 +617,8 @@ Evas_Object *menuAdd(winFang *win, Evas_Object *tb, char *label)
577void makeMainMenuFinish(winFang *win, Evas_Object *tb) 617void makeMainMenuFinish(winFang *win, Evas_Object *tb)
578{ 618{
579 // The toolbar needs to be packed into the box AFTER the menus are added. 619 // The toolbar needs to be packed into the box AFTER the menus are added.
580 elm_layout_box_append(win->win, WF_BOX, tb); 620 elm_object_part_content_set(win->layout, WF_TOOLBAR, tb);
621 elm_layout_signal_emit(win->layout, "isToolbar", "isToolbar");
581 evas_object_show(tb); 622 evas_object_show(tb);
582 623
583 // Bump the menu above the windows. 624 // Bump the menu above the windows.
diff --git a/src/libraries/winFang.edc b/src/libraries/winFang.edc
index 6942aef..2b409ef 100644
--- a/src/libraries/winFang.edc
+++ b/src/libraries/winFang.edc
@@ -19,20 +19,13 @@ collections
19 { 19 {
20 part 20 part
21 { name: "winFang/background"; 21 { name: "winFang/background";
22 type: IMAGE; 22 type: SWALLOW;
23 // Ignore mouse events. 23 mouse_events: 1;
24 mouse_events: 0; 24
25 // Each part has one or more descriptions, or states.
26 // They all have to have at least this default state.
27 description 25 description
28 { state: "default" 0.0; 26 { state: "default" 0.0;
29 // RGBA, so this is purple, and semi transparent.
30// color: 50 0 100 100; // pre multiplied R = (r * a) / 255
31 color: 126 0 255 100; // r = (R * 255) / a
32 aspect_preference: HORIZONTAL;
33 image{normal: "sky_04.jpg";}
34 } 27 }
35 } 28 } // winFang/background
36 29
37 part 30 part
38 { name: "winFang/underlay"; 31 { name: "winFang/underlay";
@@ -41,16 +34,6 @@ collections
41 34
42 description 35 description
43 { state: "default" 0.0; 36 { state: "default" 0.0;
44 rel1
45 {
46 relative: 0.0 0.0;
47 to: "winFang/background";
48 }
49 rel2
50 {
51 relative: 1.0 1.0;
52 to: "winFang/background";
53 }
54 } 37 }
55 } // winFang/underlay 38 } // winFang/underlay
56 39
@@ -61,14 +44,7 @@ collections
61 44
62 description 45 description
63 { state: "default" 0.0; 46 { state: "default" 0.0;
64 fixed: 0 1; 47 fixed: 1 0;
65 visible: 0;
66 }
67
68 description
69 { state: "internal" 0.0;
70 inherit: "default" 0;
71 visible: 1;
72 rel1 48 rel1
73 { 49 {
74 relative: 0.0 0.0; 50 relative: 0.0 0.0;
@@ -77,59 +53,87 @@ collections
77 rel2 53 rel2
78 { 54 {
79 relative: 1.0 0.0; 55 relative: 1.0 0.0;
56 offset: 0 20;
57 to: "winFang/background";
58 }
59 }
60 description
61 { state: "main" 0.0;
62 inherit: "default";
63 visible: 0;
64 rel2
65 {
66 relative: 1.0 0.0;
67 offset: 0 0;
80 to: "winFang/background"; 68 to: "winFang/background";
81 offset: 0 15;
82 } 69 }
83 } 70 }
84 } 71 }
85 72
86 part 73 part
87 { name: "winFang/box"; 74 { name: "winFang/toolbar";
88 type: BOX; 75 type: SWALLOW;
89 mouse_events: 1; 76 mouse_events: 1;
90 77
91 description 78 description
92 { 79 { state: "default" 0.0;
93 state: "default" 0.0; 80 fixed: 1 0;
94 fixed: 0 0; 81 visible: 0;
95 box{layout: "vertical";}
96 rel1 82 rel1
97 { 83 {
98 relative: 0.0 0.0; 84 relative: 0.0 1.0;
99 to: "winFang/background"; 85 to: "winFang/title";
100 } 86 }
101 rel2 87 rel2
102 { 88 {
103 relative: 1.0 1.0; 89 relative: 1.0 1.0;
104 to: "winFang/background"; 90 offset: 0 0;
91 to: "winFang/title";
92 }
93 }
94 description
95 { state: "toolbar" 0.0;
96 inherit: "default";
97 visible: 1;
98 rel2
99 {
100 relative: 1.0 1.0;
101 offset: 0 50;
102 to: "winFang/title";
105 } 103 }
106 } 104 }
105 }
106
107 part
108 { name: "winFang/box";
109 type: SWALLOW;
110 mouse_events: 1;
107 111
108 description 112 description
109 { state: "internal" 0.0; 113 {
110 inherit: "default" 0; 114 state: "default" 0.0;
115 fixed: 0 1;
111 rel1 116 rel1
112 { 117 {
113 relative: 0.0 0.0; 118 relative: 0.0 1.0;
114 to: "winFang/title"; 119 to: "winFang/toolbar";
115 offset: 0 15;
116 } 120 }
117 rel2 121 rel2
118 { 122 {
119 relative: 1.0 1.0; 123 relative: 1.0 1.0;
120 to: "winFang/background"; 124 to: "winFang/background";
121 } 125 }
122 } 126 }
123 } // winFang/box 127 } // winFang/box
124 128
125 part 129 part
126 { name: "winFang/content"; 130 { name: "winFang/grid";
127 type: SWALLOW; 131 type: SWALLOW;
128 mouse_events: 1; 132 mouse_events: 1;
129 133
130 description 134 description
131 { state: "default" 0.0; 135 { state: "default" 0.0;
132 fixed: 0 0; 136 fixed: 0 1;
133 rel1 137 rel1
134 { 138 {
135 relative: 0.0 0.0; 139 relative: 0.0 0.0;
@@ -141,20 +145,27 @@ collections
141 to: "winFang/box"; 145 to: "winFang/box";
142 } 146 }
143 } 147 }
144 } // winFang/content 148 } // winFang/grid
145 149
146 programs 150 programs
147 { 151 {
148 program 152 program
149 { name: "isInternal"; 153 { name: "isToolbar";
150 signal: "isInternal"; 154 signal: "isToolbar";
151 source: "isInternal"; 155 source: "isToolbar";
152 action: STATE_SET "internal" 0.0; 156 action: STATE_SET "toolbar" 0.0;
157 target: "winFang/toolbar";
158 }
159
160 program
161 { name: "isMain";
162 signal: "isMain";
163 source: "isMain";
164 action: STATE_SET "main" 0.0;
153 target: "winFang/title"; 165 target: "winFang/title";
154 target: "winFang/box"; 166 }
155 }
156 } 167 }
157
158 } 168 }
159 } 169 }
160} 170}
171
diff --git a/src/libraries/winFang.h b/src/libraries/winFang.h
index 1885ca1..4a83bc6 100644
--- a/src/libraries/winFang.h
+++ b/src/libraries/winFang.h
@@ -6,12 +6,13 @@
6#include <EPhysics.h> 6#include <EPhysics.h>
7 7
8 8
9#define WF_BACKGROUND "winFang/background"
10#define WF_LAYOUT "winFang/layout" 9#define WF_LAYOUT "winFang/layout"
10#define WF_BACKGROUND "winFang/background"
11#define WF_UNDERLAY "winFang/underlay" 11#define WF_UNDERLAY "winFang/underlay"
12#define WF_TITLE "winFang/title" 12#define WF_TITLE "winFang/title"
13#define WF_TOOLBAR "winFang/toolbar"
13#define WF_BOX "winFang/box" 14#define WF_BOX "winFang/box"
14#define WF_SWALLOW "winFang/content" 15#define WF_GRID "winFang/grid"
15 16
16// Evil hack around ELM's problem with lack of toolbar item icons. 17// Evil hack around ELM's problem with lack of toolbar item icons.
17char NoIcon[PATH_MAX]; 18char NoIcon[PATH_MAX];
@@ -44,9 +45,10 @@ typedef struct _winFang
44 Evas *e; 45 Evas *e;
45 struct _winFang *parent; 46 struct _winFang *parent;
46 Evas_Object *win; 47 Evas_Object *win;
48 Evas_Object *bg;
47 Evas_Object *layout; 49 Evas_Object *layout;
48 Evas_Object *title; 50 Evas_Object *title;
49 Evas_Object *bg; 51 Evas_Object *box;
50 Evas_Object *grid; 52 Evas_Object *grid;
51 EPhysics_Body *body; 53 EPhysics_Body *body;
52 Eina_Clist widgets; 54 Eina_Clist widgets;
diff --git a/src/purkle/purkle.c b/src/purkle/purkle.c
index 97253cf..378879f 100644
--- a/src/purkle/purkle.c
+++ b/src/purkle/purkle.c
@@ -12,7 +12,7 @@ static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world)
12{ 12{
13 winFang *me; 13 winFang *me;
14 14
15 me = winFangAdd(parent, 300, 26, w, h, "chatter box", "purkle", world); 15 me = winFangAdd(parent, 300, 52, w, h, "chatter box", "purkle", world);
16 16
17 history = widgetAdd(me, WT_TEXTBOX, "", -1, -1, -1, -1); 17 history = widgetAdd(me, WT_TEXTBOX, "", -1, -1, -1, -1);
18 entry = widgetAdd(me, WT_ENTRY, "", -1, -1, -1, -1); 18 entry = widgetAdd(me, WT_ENTRY, "", -1, -1, -1, -1);