diff options
Diffstat (limited to 'src/libraries/winFang.c')
-rw-r--r-- | src/libraries/winFang.c | 102 |
1 files changed, 50 insertions, 52 deletions
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index 718e710..4e4e51c 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c | |||
@@ -28,7 +28,8 @@ static void _checkWindowBounds(winFang *win, Evas_Coord x, Evas_Coord y, Evas_Co | |||
28 | } | 28 | } |
29 | if (2 <= i) | 29 | if (2 <= i) |
30 | { | 30 | { |
31 | return; | 31 | // TODO - Something in the last EFL update broke this check. |
32 | // return; | ||
32 | } | 33 | } |
33 | 34 | ||
34 | // Check if we are outside the parent window. | 35 | // Check if we are outside the parent window. |
@@ -115,6 +116,7 @@ static void _onBgMove(void *data, Evas *evas, Evas_Object *obj, void *event_info | |||
115 | // Looks like ePhysics wont cooperate about coords and other things, so plan B. | 116 | // Looks like ePhysics wont cooperate about coords and other things, so plan B. |
116 | 117 | ||
117 | evas_object_geometry_get(win->layout, &x, &y, &w, &h); | 118 | evas_object_geometry_get(win->layout, &x, &y, &w, &h); |
119 | //printf("_onBgMove() MOVED %f %f %f %f\n", x, y, w, h); | ||
118 | _checkWindowBounds(win, x + ev->cur.canvas.x - ev->prev.output.x, y + ev->cur.canvas.y - ev->prev.output.y, w, h); | 120 | _checkWindowBounds(win, x + ev->cur.canvas.x - ev->prev.output.x, y + ev->cur.canvas.y - ev->prev.output.y, w, h); |
119 | } | 121 | } |
120 | 122 | ||
@@ -217,11 +219,11 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
217 | // Create the layout, and add the Edje to it. | 219 | // Create the layout, and add the Edje to it. |
218 | snprintf(buf, sizeof(buf), "%s/winFang.edj", prefix_data_get()); | 220 | snprintf(buf, sizeof(buf), "%s/winFang.edj", prefix_data_get()); |
219 | result->layout = eo_add(ELM_LAYOUT_CLASS, obj, | 221 | result->layout = eo_add(ELM_LAYOUT_CLASS, obj, |
220 | efl_gfx_size_set(w, h), | 222 | efl_gfx_size_set(eoid, w, h), |
221 | efl_gfx_position_set(x, y), | 223 | efl_gfx_position_set(eoid, x, y), |
222 | evas_obj_name_set(WF_LAYOUT), | 224 | evas_obj_name_set(eoid, WF_LAYOUT), |
223 | efl_file_set(buf, WF_LAYOUT), | 225 | efl_file_set(eoid, buf, WF_LAYOUT), |
224 | efl_gfx_visible_set(EINA_TRUE) | 226 | efl_gfx_visible_set(eoid, EINA_TRUE) |
225 | ); | 227 | ); |
226 | result->e = evas_object_evas_get(result->layout); | 228 | result->e = evas_object_evas_get(result->layout); |
227 | 229 | ||
@@ -231,9 +233,9 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
231 | else | 233 | else |
232 | snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get()); | 234 | snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get()); |
233 | result->bg = eo_add(ELM_BG_CLASS, obj, | 235 | result->bg = eo_add(ELM_BG_CLASS, obj, |
234 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 236 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
235 | efl_file_set(buf, NULL), | 237 | efl_file_set(eoid, buf, NULL), |
236 | efl_gfx_visible_set(EINA_TRUE) | 238 | efl_gfx_visible_set(eoid, EINA_TRUE) |
237 | ); | 239 | ); |
238 | elm_win_resize_object_add(result->win, result->bg); | 240 | elm_win_resize_object_add(result->win, result->bg); |
239 | 241 | ||
@@ -242,7 +244,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
242 | // // RGBA, so this is purple, and semi transparent. | 244 | // // RGBA, so this is purple, and semi transparent. |
243 | // color: 50 0 100 100; // pre multiplied R = (r * a) / 255 | 245 | // color: 50 0 100 100; // pre multiplied R = (r * a) / 255 |
244 | // color: 126 0 255 100; // r = (R * 255) / a | 246 | // color: 126 0 255 100; // r = (R * 255) / a |
245 | eo_do(result->bg, efl_gfx_color_set(50, 0, 100, 100)); | 247 | efl_gfx_color_set(result->bg, 50, 0, 100, 100); |
246 | // This is how fragile things are, internal windows wont show background unless swallowed into the layout, | 248 | // 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. | 249 | // 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); | 250 | elm_object_part_content_set(result->layout, WF_BACKGROUND, result->bg); |
@@ -260,10 +262,10 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
260 | 262 | ||
261 | // Create our box, the default for where content goes. | 263 | // Create our box, the default for where content goes. |
262 | result->box = eo_add(ELM_BOX_CLASS, result->layout, | 264 | result->box = eo_add(ELM_BOX_CLASS, result->layout, |
263 | elm_obj_box_homogeneous_set(EINA_FALSE), | 265 | elm_obj_box_homogeneous_set(eoid, EINA_FALSE), |
264 | elm_obj_box_horizontal_set(EINA_FALSE), | 266 | elm_obj_box_horizontal_set(eoid, EINA_FALSE), |
265 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 267 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL), |
266 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND) | 268 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND) |
267 | ); | 269 | ); |
268 | elm_object_part_content_set(result->layout, WF_BOX, result->box); | 270 | elm_object_part_content_set(result->layout, WF_BOX, result->box); |
269 | 271 | ||
@@ -274,12 +276,12 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
274 | // Something to catch clicks on the background, for moving the window. | 276 | // Something to catch clicks on the background, for moving the window. |
275 | // Coz Elm is uncooperative with this sort of thing, so we need to stick in a rectangle. | 277 | // Coz Elm is uncooperative with this sort of thing, so we need to stick in a rectangle. |
276 | obj = eo_add(EVAS_RECTANGLE_CLASS, result->layout, | 278 | obj = eo_add(EVAS_RECTANGLE_CLASS, result->layout, |
277 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 279 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL), |
278 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 280 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
279 | evas_obj_name_set(WF_UNDERLAY), | 281 | evas_obj_name_set(eoid, WF_UNDERLAY), |
280 | efl_gfx_color_set(0, 0, 0, 0), | 282 | efl_gfx_color_set(eoid, 0, 0, 0, 0), |
281 | efl_gfx_visible_set(EINA_TRUE) | 283 | efl_gfx_visible_set(eoid, EINA_TRUE) |
282 | ); | 284 | ); |
283 | elm_object_part_content_set(result->layout, WF_UNDERLAY, obj); | 285 | elm_object_part_content_set(result->layout, WF_UNDERLAY, obj); |
284 | evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, _onBgClick, result); | 286 | evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, _onBgClick, result); |
285 | 287 | ||
@@ -293,21 +295,21 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
293 | else if (i == 2) {cx += result->w; cy += result->h;} | 295 | else if (i == 2) {cx += result->w; cy += result->h;} |
294 | else if (i == 3) cy += result->h; | 296 | else if (i == 3) cy += result->h; |
295 | result->hand[i] = eo_add(EVAS_IMAGE_CLASS, result->e, | 297 | result->hand[i] = eo_add(EVAS_IMAGE_CLASS, result->e, |
296 | evas_obj_image_filled_set(EINA_TRUE), | 298 | evas_obj_image_filled_set(eoid, EINA_TRUE), |
297 | efl_file_set(buf, NULL), | 299 | efl_file_set(eoid, buf, NULL), |
298 | efl_gfx_size_set(31, 31), | 300 | efl_gfx_size_set(eoid, 31, 31), |
299 | efl_gfx_position_set(cx - 15, cy - 15), | 301 | efl_gfx_position_set(eoid, cx - 15, cy - 15), |
300 | efl_gfx_visible_set(EINA_TRUE) | 302 | efl_gfx_visible_set(eoid, EINA_TRUE) |
301 | ); | 303 | ); |
302 | evas_object_event_callback_add(result->hand[i], EVAS_CALLBACK_MOUSE_MOVE, _onHandleMove, result); | 304 | evas_object_event_callback_add(result->hand[i], EVAS_CALLBACK_MOUSE_MOVE, _onHandleMove, result); |
303 | } | 305 | } |
304 | 306 | ||
305 | // Create our window title. | 307 | // Create our window title. |
306 | result->title = eo_add(ELM_LABEL_CLASS, result->layout, | 308 | result->title = eo_add(ELM_LABEL_CLASS, result->layout, |
307 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 309 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL), |
308 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | 310 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, 0.0), |
309 | efl_gfx_visible_set(EINA_TRUE) | 311 | efl_gfx_visible_set(eoid, EINA_TRUE) |
310 | ); | 312 | ); |
311 | elm_object_style_set(result->title, "marker"); | 313 | elm_object_style_set(result->title, "marker"); |
312 | elm_object_text_set(result->title, title); | 314 | elm_object_text_set(result->title, title); |
313 | elm_object_part_content_set(result->layout, WF_TITLE, result->title); | 315 | elm_object_part_content_set(result->layout, WF_TITLE, result->title); |
@@ -320,11 +322,11 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
320 | 322 | ||
321 | // Create our grid, where things go if you supply coords. | 323 | // Create our grid, where things go if you supply coords. |
322 | result->grid = eo_add(ELM_GRID_CLASS, result->layout, | 324 | result->grid = eo_add(ELM_GRID_CLASS, result->layout, |
323 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 325 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL), |
324 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 326 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
325 | evas_obj_name_set(WF_GRID), | 327 | evas_obj_name_set(eoid, WF_GRID), |
326 | elm_obj_grid_size_set(result->w, result->h), | 328 | elm_obj_grid_size_set(eoid, result->w, result->h), |
327 | efl_gfx_visible_set(EINA_TRUE) | 329 | efl_gfx_visible_set(eoid, EINA_TRUE) |
328 | ); | 330 | ); |
329 | 331 | ||
330 | // This could live inside the box, but then we have to keep track of the size of it's contents. | 332 | // This could live inside the box, but then we have to keep track of the size of it's contents. |
@@ -459,25 +461,21 @@ Widget *widgetAdd(winFang *win, char *type , char *title, int x, int y, int w, i | |||
459 | result->win = win; | 461 | result->win = win; |
460 | 462 | ||
461 | result->obj = eo_add(klass, win->win, | 463 | result->obj = eo_add(klass, win->win, |
462 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 464 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
463 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 465 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL), |
464 | efl_gfx_visible_set(EINA_TRUE), | 466 | efl_gfx_visible_set(eoid, EINA_TRUE), |
465 | eo_key_data_set("Widget", result) | 467 | eo_key_data_set(eoid, "Widget", result) |
466 | ); | 468 | ); |
467 | 469 | ||
468 | if (strcmp(WT_ENTRY, type) == 0) | 470 | if (strcmp(WT_ENTRY, type) == 0) |
469 | { | 471 | { |
470 | eo_do(result->obj, | 472 | elm_obj_entry_scrollable_set(result->obj, EINA_TRUE); |
471 | elm_obj_entry_scrollable_set(EINA_TRUE), | 473 | elm_obj_entry_editable_set(result->obj, EINA_TRUE); |
472 | elm_obj_entry_editable_set(EINA_TRUE) | ||
473 | ); | ||
474 | } | 474 | } |
475 | else if (strcmp(WT_TEXTBOX, type) == 0) | 475 | else if (strcmp(WT_TEXTBOX, type) == 0) |
476 | { | 476 | { |
477 | eo_do(result->obj, | 477 | elm_obj_entry_scrollable_set(result->obj, EINA_TRUE); |
478 | elm_obj_entry_scrollable_set(EINA_TRUE), | 478 | elm_obj_entry_editable_set(result->obj, EINA_FALSE); |
479 | elm_obj_entry_editable_set(EINA_FALSE) | ||
480 | ); | ||
481 | } | 479 | } |
482 | 480 | ||
483 | if (x < 0) | 481 | if (x < 0) |
@@ -570,12 +568,12 @@ Evas_Object *makeMainMenu(winFang *win) | |||
570 | { | 568 | { |
571 | // A toolbar thingy. | 569 | // A toolbar thingy. |
572 | return eo_add(ELM_TOOLBAR_CLASS, win->layout, | 570 | return eo_add(ELM_TOOLBAR_CLASS, win->layout, |
573 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | 571 | evas_obj_size_hint_weight_set(eoid, EVAS_HINT_EXPAND, 0.0), |
574 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 572 | evas_obj_size_hint_align_set(eoid, EVAS_HINT_FILL, EVAS_HINT_FILL), |
575 | elm_obj_toolbar_shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU), | 573 | elm_obj_toolbar_shrink_mode_set(eoid, ELM_TOOLBAR_SHRINK_MENU), |
576 | efl_gfx_position_set(0, 0), | 574 | efl_gfx_position_set(eoid, 0, 0), |
577 | elm_obj_toolbar_align_set(0.0) | 575 | elm_obj_toolbar_align_set(eoid, 0.0) |
578 | ); | 576 | ); |
579 | } | 577 | } |
580 | 578 | ||
581 | //static void _on_menu_focus(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) | 579 | //static void _on_menu_focus(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) |