Commit Graph

21 Commits

Author SHA1 Message Date
Larry 597a142622 elm_layout: moved Elm_Layout_Part_Alias_Description to elm_layout.eo 2016-02-22 10:38:26 -03:00
Daniel Juyung Seo e110dccae4 layout: Add more description for layout's internal smart data members. 2015-06-26 10:30:21 +09:00
Shinwoo Kim 3a80bbcb41 [layout] support mirrored set for layout which is using elm_layout_file_set()
Summary: mirroed mode does not work, if layout uses elm_layout_file_set().

Test Plan:
the following is test code.
[test.edc]
collections {

   group {
      name: "layout/test";

      parts {

         part {
            name: "bg";
            type: RECT;
               description {
               state: "default" 0.0;
               color: 255 255 0 100;
            }
         }

         part {
            name: "test.rect";
            type: RECT;
               description {
               state: "default" 0.0;
               color: 255 0 0 255;
               rel1.to: bg;
               rel1.relative: 0.2 0.1;
               rel2.to: bg;
               rel2.relative: 0.5 0.2;
            }
         }

      } /* parts */
   } /* group */
} /* collections */

[test.c]
//Compile with:
//gcc -g test.c -o test `pkg-config --cflags --libs elementary`

#include <Elementary.h>
#include <Ecore_X.h>

static void
_bt_click(void *data, Evas_Object *obj, void *event_info)
{
   Eina_Bool mirrored;
   Evas_Object *layout;

   layout = data;

   mirrored = elm_config_mirrored_get();
   mirrored = !mirrored;
   printf("mirred: %d\n", mirrored);
   elm_config_mirrored_set(mirrored);
}

EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *box, *layout, *bt, *check;
   char buf[PATH_MAX];

   elm_app_info_set(elm_main, "elementary", "./test.edj");
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_add(NULL, "Layout", ELM_WIN_BASIC);
   elm_win_autodel_set(win, EINA_TRUE);

   box = elm_box_add(win);
   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   // Adding layout and filling it with widgets
   layout = elm_layout_add(win);
   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
   snprintf(buf, sizeof(buf), "./test.edj");
   elm_layout_file_set(layout, buf, "layout/test");
   elm_box_pack_end(box, layout);
   evas_object_show(layout);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "mirrored");
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_smart_callback_add(bt, "clicked", _bt_click, layout);
   elm_box_pack_end(box, bt);
   evas_object_show(bt);

   check = elm_check_add(win);
   elm_object_text_set(check, "test");
   evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box, check);
   evas_object_show(check);

   evas_object_resize(win, 500, 500);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
ELM_MAIN()

Reviewers: seoz, raster, tasn, Hermet

Subscribers: seoz, cedric

Differential Revision: https://phab.enlightenment.org/D2142
2015-06-09 14:05:58 +01:00
Daniel Juyung Seo 5a4ca7008f widget: added warnings to internal headers.
These headers are installed in the system but not officially supported
as they are considered as internal headers.
The reason why they still need to be installed is that
   - they were exposed even in the previous releases.
   - they are needed for widget customization (unofficially)
   - or it will break ewe.

Special thanks to Stefan for the reporting.
2014-08-08 01:29:39 +09:00
Tom Hacohen efa41c7d75 Elm: Update code to use the new class names generated by eolian. 2014-06-03 11:54:44 +01:00
Lukasz Stanislawski e62b07f779 layout: remove sizing_eval call when layout is already destructed. @fix
Summary:
Layout's sub_object_del function calls sizing_eval even if layout's smart_del
function has already been called (Due to widget_smart_del impl).
This patch adds 'destructed_is' flag to Elm_Layout_Smart_Data and prevents unneeded
sizing_eval calls when object is already destructed.
Patch also fixes SIGSEGV in layout derived entry widget caused by calling
sizing_eval after entry_smart_del destructor.

Added entry test to avoid regression for SIGSEGV bug.

Test Plan: run tests/elm_test_entry

Reviewers: raster, seoz, tasn, cedric

Differential Revision: https://phab.enlightenment.org/D823
2014-05-14 12:02:10 +09:00
Tom Hacohen 794f95d7c8 layout: expose a typedef that needs to be public (Content_Alias).
This typedef is used in publicly exposed APIs.
2014-04-10 03:41:52 +01:00
Ryuan Choi 37ffb188bb elm_widget_xxx.h: Adopt EINA_UNLIKELY and fix indentation in FOO_DATA_GET macros. 2014-01-16 03:34:55 +09:00
Daniel Juyung Seo 97be76ca61 layout: Moved internal smart data member to a correct place.
can_access is used only by layout.
2014-01-02 09:23:03 +09:00
Iván Briano 6f36d30153 Restricted sizing eval for layout
This allows to select an axis that the layout will use its current size
to restrict the min size calculation of the inner edje, possibly helping
with textblock min size issues
2013-10-25 14:51:33 -02:00
Daniel Juyung Seo 3a10554b11 elm_layout: Internal refactoring about layout frozen check.
1. Moved frozen variable to more proper position. Elm_Widget_Smart_Data -> Elm_Layout_Smart_Data.
2. Check frozen at one place. This makes codes cleaner and reduces human mistakes.
2013-10-05 17:59:58 +09:00
Daniel Zaoui 187d6bf8de Elementary: replace eo_data_get for objects data referencing. 2013-05-01 11:04:09 +03:00
Yakov Goldberg 5c98343198 We have ported to Eo all the widgets of elementary. We didn't change the inheritance itself, only the mechanism, as done previously in Evas, Ecore and Edje. We removed totally the previous inheritance mechanism.
Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 79668
2012-11-26 06:32:53 +00:00
Tom Hacohen 47d2139e0f Elm layout: remove !obj check from ELM_LAYOUT_CHECK.
This is already handled in elm_widget_type_check, and there it actually
prints an error message, like it should.
Patch by Daniel Zaoui.

SVN revision: 76461
2012-09-11 14:25:30 +00:00
Gustavo Lima Chaves 72fa126e71 [elm] Inheritance tweeks on layout.
SVN revision: 74677
2012-07-31 22:05:38 +00:00
Daniel Juyung Seo 92aad7f156 elm elm_widget.h elm_widget_layout.h: Fixed typo.
SVN revision: 71611
2012-05-31 23:02:54 +00:00
Daniel Juyung Seo 741ada7b0b elm headers: Fixed typo.
SVN revision: 71589
2012-05-31 17:55:07 +00:00
Gustavo Lima Chaves 87b422c93a [elm] Small fixes on class headers.
SVN revision: 71428
2012-05-25 19:53:51 +00:00
Gustavo Lima Chaves f4e29b50ee [Elm] 2nd specialization of Elm's new base smart
class: elm_layout.
This will be, besides the codebase for the elm_layout widget, a common
base for all other widgets which got an edje layout as a basis for
their decoration.

From now on, all elm_layout_* namespaced fuctions will function
on objects inheriting from this base:

- elm_layout_content_set
- elm_layout_content_get
- elm_layout_content_unset
- elm_layout_text_set
- elm_layout_text_get

(recovered from deprecated header -> not anymore)

- elm_layout_sizing_eval
- elm_layout_data_get
- elm_layout_edje_get

- elm_layout_file_set
- elm_layout_theme_set

- elm_layout_box_append
- elm_layout_box_prepend
- elm_layout_box_insert_before
- elm_layout_box_insert_at
- elm_layout_box_remove
- elm_layout_box_remove_all
- elm_layout_table_pack
- elm_layout_table_unpack
- elm_layout_table_clear

Three missing functions on layouts were added, then:

- elm_layout_signal_emit
- elm_layout_signal_callback_add
- elm_layout_signal_callback_del

Naturally, the elm_object_ namespaced counterparts of those will also
function (they will be deprecated on the future).



SVN revision: 70708
2012-05-03 22:41:26 +00:00
Carsten Haitzler c0f2f4be91 REVERT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
this breaks theme api. so NO! come back with a version that doesn't
break it.



SVN revision: 70679
2012-05-03 01:19:05 +00:00
Gustavo Lima Chaves e6ab50005c [Elm] 2nd specialization of Elm's new base smart
class: elm_layout.
This will be, besides the codebase for the elm_layout widget, a common
base for all other widgets which got an edje layout as a basis for
their decoration.

From now on, all elm_layout_* namespaced fuctions will function
on objects inheriting from this base:

- elm_layout_content_set
- elm_layout_content_get
- elm_layout_content_unset
- elm_layout_text_set
- elm_layout_text_get

(recovered from deprecated header -> not anymore)

- elm_layout_sizing_eval
- elm_layout_data_get
- elm_layout_edje_get

- elm_layout_file_set
- elm_layout_theme_set

- elm_layout_box_append
- elm_layout_box_prepend
- elm_layout_box_insert_before
- elm_layout_box_insert_at
- elm_layout_box_remove
- elm_layout_box_remove_all
- elm_layout_table_pack
- elm_layout_table_unpack
- elm_layout_table_clear

Three missing functions on layouts were added, then:

- elm_layout_signal_emit
- elm_layout_signal_callback_add
- elm_layout_signal_callback_del

Naturally, the elm_object_ namespaced counterparts of those will also
function (they will be deprecated on the future).



SVN revision: 70631
2012-05-02 16:58:10 +00:00