From: WooHyun Jung Date: Tue, 11 Jan 2011 14:15:52 +0000 (+0900) Subject: Repackage for fixing bug of elm_pager X-Git-Tag: REL_I9200_20110603-1~495 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7fd3a5a9a29fb71e9e356ad9680633c791a1ff6a;p=framework%2Fuifw%2Felementary.git Repackage for fixing bug of elm_pager --- diff --git a/TC/elm_ts/slider/Makefile b/TC/elm_ts/slider/Makefile index b6dfb5f..89e587b 100644 --- a/TC/elm_ts/slider/Makefile +++ b/TC/elm_ts/slider/Makefile @@ -23,6 +23,7 @@ TARGETS = utc_UIFW_elm_slider_add_func \ utc_UIFW_elm_slider_span_size_set_func \ utc_UIFW_elm_slider_unit_format_get_func \ utc_UIFW_elm_slider_unit_format_set_func \ + utc_UIFW_elm_slider_value_animated_set_func \ utc_UIFW_elm_slider_value_get_func \ utc_UIFW_elm_slider_value_set_func diff --git a/TC/elm_ts/slider/tslist b/TC/elm_ts/slider/tslist index d3d13fa..bba9ba5 100644 --- a/TC/elm_ts/slider/tslist +++ b/TC/elm_ts/slider/tslist @@ -21,5 +21,6 @@ /elm_ts/slider/utc_UIFW_elm_slider_span_size_set_func /elm_ts/slider/utc_UIFW_elm_slider_unit_format_get_func /elm_ts/slider/utc_UIFW_elm_slider_unit_format_set_func +/elm_ts/slider/utc_UIFW_elm_slider_value_animated_set_func /elm_ts/slider/utc_UIFW_elm_slider_value_get_func /elm_ts/slider/utc_UIFW_elm_slider_value_set_func diff --git a/configure.ac b/configure.ac index 765767e..b86a6be 100755 --- a/configure.ac +++ b/configure.ac @@ -508,7 +508,6 @@ src/lib/Elementary.h src/bin/Makefile src/modules/Makefile src/modules/test_entry/Makefile -src/modules/test_map/Makefile src/modules/ctxpopup_copypasteUI/Makefile src/modules/popup_copypasteUI/Makefile src/edje_externals/Makefile diff --git a/data/objects/Makefile.am b/data/objects/Makefile.am index 0f80b6c..8d936c8 100644 --- a/data/objects/Makefile.am +++ b/data/objects/Makefile.am @@ -6,15 +6,11 @@ EDJE_FLAGS = -v -id $(top_srcdir)/data/objects -fd $(top_srcdir)/data/objects filesdir = $(datadir)/elementary/objects -files_DATA = test.edj multip.edj colorpreview.edj cursors.edj font_preview.edj +files_DATA = test.edj multip.edj EXTRA_DIST = \ test.edc \ multip.edc \ -colorpreview.edc \ -cursors.edc \ -font_preview.edc \ -grid_bg.png \ over.png \ under.png \ sky.jpg \ @@ -25,26 +21,11 @@ test.edj: Makefile $(EXTRA_DIST) $(EDJE_CC) $(EDJE_FLAGS) \ $(top_srcdir)/data/objects/test.edc \ $(top_builddir)/data/objects/test.edj - + multip.edj: Makefile $(EXTRA_DIST) $(EDJE_CC) $(EDJE_FLAGS) \ $(top_srcdir)/data/objects/multip.edc \ $(top_builddir)/data/objects/multip.edj - -colorpreview.edj: Makefile $(EXTRA_DIST) - $(EDJE_CC) $(EDJE_FLAGS) \ - $(top_srcdir)/data/objects/colorpreview.edc \ - $(top_builddir)/data/objects/colorpreview.edj - -cursors.edj: Makefile $(EXTRA_DIST) - $(EDJE_CC) $(EDJE_FLAGS) \ - $(top_srcdir)/data/objects/cursors.edc \ - $(top_builddir)/data/objects/cursors.edj - -font_preview.edj: Makefile $(EXTRA_DIST) - $(EDJE_CC) $(EDJE_FLAGS) \ - $(top_srcdir)/data/objects/font_preview.edc \ - $(top_builddir)/data/objects/font_preview.edj - + clean-local: rm -f *.edj diff --git a/data/objects/colorpreview.edc b/data/objects/colorpreview.edc deleted file mode 100644 index 77d1441..0000000 --- a/data/objects/colorpreview.edc +++ /dev/null @@ -1,22 +0,0 @@ -images { - image: "grid_bg.png" COMP; -} - -collections { - group { name: "main"; - parts { - part { name: "Grid"; - type: IMAGE; - description { state: "default" 0; - image.normal: "grid_bg.png"; - } - } - part { name: "ColorPreview"; - type: SWALLOW; - mouse_events: 0; - description { state: "default" 0; - } - } - } - } -} diff --git a/data/objects/cursors.edc b/data/objects/cursors.edc deleted file mode 100644 index a943037..0000000 --- a/data/objects/cursors.edc +++ /dev/null @@ -1,80 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// CURSOR -///////////////////////////////////////////////////////////////////////////// -collections { - group { name: "elm/cursor/hand2/default"; - min: 30 30; - max: 30 30; - data { - item: "hot_x" "0"; - item: "hot_y" "0"; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 0 255 0 255; - } - } - } - } - - group { name: "elm/cursor/hand3/default"; - min: 30 30; - max: 30 30; - data { - item: "hot_x" "0"; - item: "hot_y" "0"; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 0 0 255; - } - description { state: "blue" 0.0; - color: 0 0 255 255; - } - } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - after: "go_blue"; - } - program { name: "go_blue"; - action: STATE_SET "blue" 0.0; - transition: LINEAR 1; - target: "base"; - after: "go_red"; - } - program { name: "go_red"; - action: STATE_SET "default" 0.0; - transition: LINEAR 1; - target: "base"; - after: "go_blue"; - } - } - } - - group { name: "elm/cursor/hand3/transparent"; - min: 30 30; - max: 30 30; - data { - item: "hot_x" "0"; - item: "hot_y" "0"; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 0 0 120; - } - } - } - } -} diff --git a/data/objects/font_preview.edc b/data/objects/font_preview.edc deleted file mode 100644 index 302c2e8..0000000 --- a/data/objects/font_preview.edc +++ /dev/null @@ -1,40 +0,0 @@ -color_classes { - color_class { - name: "entry_text"; - color: 0 0 0 255; - } -} - -collections { - - group { name: "font_preview"; - parts { - - /* some fonts have weird alignments, thus they overflow badly */ - part { name: "clipper"; - type: RECT; - description { - state: "default" 0.0; - } - } - - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { - state: "default" 0.0; - color_class: "entry_text"; - text { - font: "Sans"; - min: 0 1; - size: 10; - align: 0.5 0.5; - text_class: "font_preview"; - } - } - } - } - } -} diff --git a/data/objects/grid_bg.png b/data/objects/grid_bg.png deleted file mode 100644 index 7141658..0000000 Binary files a/data/objects/grid_bg.png and /dev/null differ diff --git a/data/objects/test.edc b/data/objects/test.edc index 44b532c..e694f6e 100644 --- a/data/objects/test.edc +++ b/data/objects/test.edc @@ -40,26 +40,6 @@ collections { image.normal: "under.png"; } } - part { name: "text"; - type: TEXT; - clip_to: "clip"; - description { state: "default" 0.0; - color: 255 255 0 255; - rel1 { - relative: 0.3 0.02; - } - rel2 { - relative: 0.6 0.12; - } - align: 0.5 0.5; - text { - font: "Sans:style=Bold"; - size: 14; - min: 1 1; - text: "some edje text here"; - } - } - } part { name: "element1"; type: SWALLOW; clip_to: "clip"; @@ -425,108 +405,5 @@ collections { } } } - group { name: "twolines"; - parts { - part { name: "clip"; - type: RECT; - description { state: "default" 0.0; - } - } - part { name: "under"; - mouse_events: 0; - clip_to: "clip"; - type: RECT; - description { state: "default" 0.0; - color: 0 128 200 30; - } - } - part { name: "element1"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 0.5; - offset: -5 -3; - } - } - } - part { name: "element2"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - relative: 0.0 0.5; - offset: 4 2; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - } - } - } - group { name: "bg_overlay"; - images { - image: "clo.png" LOSSY 60; - } - parts { - part { name: "clip"; - type: RECT; - description { state: "default" 0.0; - } - } - part { name: "clo"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - fill { - smooth: 0; - origin { - relative: 0.0 0.0; - offset: 0 0; - } - size { - relative: 1.84722 1.0; - offset: 0 0; - } - } - image.normal: "clo.png"; - } - description { state: "drift" 0.0; - inherit: "default" 0.0; - fill { - origin { - relative: 1.84722 0.0; - offset: 0 0; - } - size { - relative: 1.84722 1.0; - offset: 0 0; - } - } - } - } - } - programs { - program { name: "anim1"; - signal: "load"; - source: ""; - action: STATE_SET "drift" 0.0; - transition: LINEAR 10.0; - target: "clo"; - after: "anim2"; - } - program { name: "anim2"; - action: STATE_SET "default" 0.0; - target: "clo"; - after: "anim1"; - } - } - } } diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index 20120f6..4f8309a 100644 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -5,14 +5,12 @@ EDJE_CC = @edje_cc@ EDJE_FLAGS = -v -id $(top_srcdir)/data/themes -fd $(top_srcdir)/data/themes filesdir = $(datadir)/elementary/themes -files_DATA = default.edj default-desktop.edj +files_DATA = default.edj EXTRA_DIST = \ default.edc \ -default-desktop.edc \ arrow_down.png \ arrow_up.png \ -bar_shine.png \ bt_base1.png \ bt_base2.png \ bt_bases.png \ @@ -59,8 +57,6 @@ flip_base_shad.png \ flip_pmb.png \ flip_pmt.png \ flip_shad.png \ -flip_t.png \ -flip_b.png \ head.png \ sb_runnerh.png \ sb_runnerv.png \ @@ -107,17 +103,13 @@ icon_refresh.png \ icon_folder.png \ icon_file.png \ ilist_1.png \ -ilist_1_h.png \ ilist_2.png \ -ilist_2_h.png \ ilist_item_shadow.png \ -ilist_item_shadow_h.png \ sl_bg.png \ sl_bg_over.png \ sl_bt_0.png \ sl_bt_1.png \ sl_bt_2.png \ -sl_bt_3.png \ sl_bt2_0_0.png \ sl_bt2_0_1.png \ sl_bt2_0_2.png \ @@ -197,36 +189,12 @@ emo-wtf.png \ map_item.png \ map_item_2.png \ shadow.png \ -black.png \ -tooltip-corner-top-left-tip.png \ -tooltip-base.png \ -tooltip-corner-bottom-left-tip.png \ -tooltip-edge-top-tip.png \ -tooltip-corner-bottom-right-tip.png \ -tooltip-edge-left-tip.png \ -tooltip-edge-bottom-tip.png \ -tooltip-edge-right-tip.png \ -tooltip-corner-top-right-tip.png \ -color_picker_alpha.png \ -color_picker_alpha_bg.png \ -color_picker_brightness.png \ -color_picker_color.png \ -color_picker_opacity.png \ -icon_arrow_down_left.png \ -icon_arrow_down_right.png \ -icon_arrow_up_left.png \ -icon_arrow_up_right.png \ -thumb_shadow.png +black.png default.edj: Makefile $(EXTRA_DIST) $(EDJE_CC) $(EDJE_FLAGS) \ $(top_srcdir)/data/themes/default.edc \ $(top_builddir)/data/themes/default.edj -default-desktop.edj: Makefile $(EXTRA_DIST) - $(EDJE_CC) $(EDJE_FLAGS) \ - $(top_srcdir)/data/themes/default-desktop.edc \ - $(top_builddir)/data/themes/default-desktop.edj - clean-local: rm -f *.edj diff --git a/data/themes/bar_shine.png b/data/themes/bar_shine.png deleted file mode 100644 index 95df605..0000000 Binary files a/data/themes/bar_shine.png and /dev/null differ diff --git a/data/themes/color_picker_alpha.png b/data/themes/color_picker_alpha.png deleted file mode 100644 index 09cbe77..0000000 Binary files a/data/themes/color_picker_alpha.png and /dev/null differ diff --git a/data/themes/color_picker_alpha_bg.png b/data/themes/color_picker_alpha_bg.png deleted file mode 100644 index 6d144d7..0000000 Binary files a/data/themes/color_picker_alpha_bg.png and /dev/null differ diff --git a/data/themes/color_picker_brightness.png b/data/themes/color_picker_brightness.png deleted file mode 100644 index b2bbf5d..0000000 Binary files a/data/themes/color_picker_brightness.png and /dev/null differ diff --git a/data/themes/color_picker_color.png b/data/themes/color_picker_color.png deleted file mode 100644 index 1c609f8..0000000 Binary files a/data/themes/color_picker_color.png and /dev/null differ diff --git a/data/themes/color_picker_opacity.png b/data/themes/color_picker_opacity.png deleted file mode 100644 index 370ea1c..0000000 Binary files a/data/themes/color_picker_opacity.png and /dev/null differ diff --git a/data/themes/default-desktop.edc b/data/themes/default-desktop.edc deleted file mode 100644 index c8d1feb..0000000 --- a/data/themes/default-desktop.edc +++ /dev/null @@ -1,1351 +0,0 @@ -externals.external: "elm"; - -#define SCROLLBARS_ADD() \ - images { \ - image: "bt_sm_base2.png" COMP; \ - image: "bt_sm_shine.png" COMP; \ - image: "bt_sm_hilight.png" COMP; \ - image: "sb_runnerh.png" COMP; \ - image: "sb_runnerv.png" COMP; \ - image: "arrow_up.png" COMP; \ - image: "arrow_down.png" COMP; \ - image: "arrow_right.png" COMP; \ - image: "arrow_left.png" COMP; \ - } \ - script { \ - public sbvis_v, sbvis_h; \ - } \ - part { name: "elm.scrollbar.base"; \ - type: SWALLOW; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - min: 0 0; \ - fixed: 1 1; \ - align: 0.0 0.0; \ - rel1.relative: 1.0 1.0; \ - } \ - description { state: "vertical" 0.0; \ - inherit: "default" 0.0; \ - min: 17 0; \ - align: 1.0 0.0; \ - } \ - description { state: "horizontal" 0.0; \ - inherit: "default" 0.0; \ - min: 0 17; \ - align: 0.0 1.0; \ - } \ - description { state: "both" 0.0; \ - inherit: "default" 0.0; \ - min: 17 17; \ - align: 1.0 1.0; \ - } \ - } \ - part { name: "sb_vbar_clip_master"; \ - type: RECT; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - } \ - description { state: "hidden" 0.0; \ - visible: 0; \ - } \ - } \ - part { name: "sb_vbar_clip"; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "sb_vbar_clip_master"; \ - description { state: "default" 0.0; \ - rel1.to: "sb_vbar_clip_master"; \ - rel2.to: "sb_vbar_clip_master"; \ - } \ - description { state: "hidden" 0.0; \ - inherit: "default" 0.0; \ - visible: 0; \ - max: 0 99999; \ - } \ - } \ - part { name: "sb_vbar"; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - min: 17 0; \ - fixed: 1 1; \ - color: 0 0 0 0; \ - align: 0.5 0.5; \ - rel1 { \ - to_y: "sb_vbar_a1"; \ - to_x: "elm.scrollbar.base"; \ - relative: 0.0 1.0; \ - offset: 0 -1; \ - } \ - rel2 { \ - to_y: "sb_vbar_a2"; \ - relative: 1.0 0.0; \ - offset: -1 -2; \ - } \ - } \ - } \ - part { name: "sb_vbar_runner"; \ - mouse_events: 0; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - min: 3 0; \ - max: 3 99999; \ - fixed: 1 1; \ - align: 1.0 0.5; \ - rel1 { \ - to: "sb_vbar"; \ - relative: 0.5 0.0; \ - offset: 0 2; \ - } \ - rel2 { \ - to: "sb_vbar"; \ - relative: 0.5 1.0; \ - offset: 0 -2; \ - } \ - image { \ - normal: "sb_runnerv.png"; \ - border: 0 0 4 4; \ - } \ - fill.smooth: 0; \ - } \ - } \ - part { name: "sb_vbar_p1"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - fixed: 1 1; \ - rel1 { \ - to: "sb_vbar_a1"; \ - relative: 0.0 1.0; \ - } \ - rel2 { \ - to: "elm.dragable.vbar"; \ - relative: 1.0 0.0; \ - } \ - } \ - } \ - part { name: "sb_vbar_p2"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - fixed: 1 1; \ - rel1 { \ - to: "elm.dragable.vbar"; \ - relative: 0.0 1.0; \ - } \ - rel2 { \ - to: "sb_vbar_a2"; \ - relative: 1.0 0.0; \ - } \ - } \ - } \ - part { name: "sb_vbar_a1"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - min: 17 17; \ - fixed: 1 1; \ - align: 0.5 0.0; \ - aspect: 1.0 1.0; \ - aspect_preference: HORIZONTAL; \ - color: 0 0 0 0; \ - rel1 { \ - to_y: "sb_vbar_clip"; \ - to_x: "elm.scrollbar.base"; \ - relative: 0.0 0.0; \ - offset: 0 1; \ - } \ - rel2 { \ - to: "elm.scrollbar.base"; \ - relative: 1.0 0.0; \ - offset: -1 -2; \ - } \ - } \ - } \ - part { name: "sb_vbar_a1_arrow"; \ - mouse_events: 0; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - rel1.to: "sb_vbar_a1"; \ - rel2.to: "sb_vbar_a1"; \ - image.normal: "arrow_up.png"; \ - } \ - description { state: "clicked" 0.0; \ - inherit: "default" 0.0; \ - rel1.offset: 0 -1; \ - rel2.offset: -1 -2; \ - } \ - } \ - part { name: "sb_vbar_a2"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - min: 17 17; \ - fixed: 1 1; \ - align: 0.5 1.0; \ - aspect: 1.0 1.0; \ - aspect_preference: HORIZONTAL; \ - color: 0 0 0 0; \ - rel1.to: "elm.scrollbar.base"; \ - rel2 { \ - to: "elm.scrollbar.base"; \ - relative: 1.0 0.0; \ - } \ - } \ - } \ - part { name: "sb_vbar_a2_arrow"; \ - mouse_events: 0; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - rel1.to: "sb_vbar_a2"; \ - rel2.to: "sb_vbar_a2"; \ - image.normal: "arrow_down.png"; \ - } \ - description { state: "clicked" 0.0; \ - inherit: "default" 0.0; \ - rel1.offset: 0 1; \ - rel2.offset: -1 0; \ - } \ - } \ - part { name: "elm.dragable.vbar"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_vbar_clip"; \ - dragable { \ - x: 0 0 0; \ - y: 1 1 0; \ - confine: "sb_vbar"; \ - } \ - description { state: "default" 0.0; \ - min: 17 17; \ - fixed: 1 1; \ - aspect: 1.0 0.5; \ - aspect_preference: VERTICAL; \ - align: 0.5 0.0; \ - color: 0 0 0 0; \ - rel1 { \ - to_y: "sb_vbar"; \ - to_x: "elm.scrollbar.base"; \ - relative: 0.0 0.0; \ - } \ - rel2.to_y: "sb_vbar"; \ - } \ - } \ - part { name: "elm.dragable.vbar.image"; \ - mouse_events: 0; \ - clip_to: "sb_vbar_clip"; \ - description { state: "default" 0.0; \ - rel1.to: "elm.dragable.vbar"; \ - rel2.to: "elm.dragable.vbar"; \ - image { \ - normal: "bt_sm_base2.png"; \ - border: 6 6 6 6; \ - } \ - } \ - } \ - part { name: "sb_vbar_over1"; \ - clip_to: "sb_vbar_clip"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - rel1.to: "elm.dragable.vbar.image"; \ - rel2 { \ - to: "elm.dragable.vbar.image"; \ - relative: 1.0 0.5; \ - } \ - image { \ - normal: "bt_sm_hilight.png"; \ - border: 6 6 6 0; \ - } \ - } \ - } \ - part { name: "sb_vbar_over2"; \ - clip_to: "sb_vbar_clip"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - rel1.to: "elm.dragable.vbar.image"; \ - rel2.to: "elm.dragable.vbar.image"; \ - image { \ - normal: "bt_sm_shine.png"; \ - border: 6 6 6 0; \ - } \ - } \ - } \ - part { name: "sb_hbar_clip_master"; \ - type: RECT; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - } \ - description { state: "hidden" 0.0; \ - visible: 0; \ - } \ - } \ - part { name: "sb_hbar_clip"; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "sb_hbar_clip_master"; \ - description { state: "default" 0.0; \ - rel1.to: "sb_hbar_clip_master"; \ - rel2.to: "sb_hbar_clip_master"; \ - } \ - description { state: "hidden" 0.0; \ - inherit: "default" 0.0; \ - visible: 0; \ - max: 99999 0; \ - } \ - } \ - part { name: "sb_hbar"; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - min: 0 17; \ - fixed: 1 1; \ - color: 0 0 0 0; \ - align: 0.5 0.5; \ - rel1 { \ - to_x: "sb_hbar_a1"; \ - to_y: "elm.scrollbar.base"; \ - relative: 1.0 0.0; \ - offset: -1 0; \ - } \ - rel2 { \ - to_x: "sb_hbar_a2"; \ - relative: 0.0 1.0; \ - offset: -2 -1; \ - } \ - } \ - } \ - part { name: "sb_hbar_runner"; \ - mouse_events: 0; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - min: 0 3; \ - max: 99999 3; \ - fixed: 1 1; \ - align: 0.5 0.5; \ - rel1 { \ - to: "sb_hbar"; \ - relative: 0.0 0.5; \ - offset: 2 0; \ - } \ - rel2 { \ - to: "sb_hbar"; \ - relative: 1.0 0.5; \ - offset: -2 0; \ - } \ - image { \ - normal: "sb_runnerh.png"; \ - border: 4 4 0 0; \ - } \ - fill.smooth: 0; \ - } \ - } \ - part { name: "elm.dragable.hbar"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_hbar_clip"; \ - dragable { \ - x: 1 1 0; \ - y: 0 0 0; \ - confine: "sb_hbar"; \ - } \ - description { state: "default" 0.0; \ - min: 17 17; \ - fixed: 1 1; \ - aspect_preference: HORIZONTAL; \ - align: 0.0 1.0; \ - color: 0 0 0 0; \ - rel1 { \ - to_x: "sb_hbar"; \ - relative: 0.0 1.0; \ - } \ - rel2.to_x: "sb_hbar"; \ - } \ - } \ - part { name: "elm.dragable.hbar.image"; \ - mouse_events: 0; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - rel1.to: "elm.dragable.hbar"; \ - rel2.to: "elm.dragable.hbar"; \ - image { \ - normal: "bt_sm_base2.png"; \ - border: 6 6 6 6; \ - } \ - } \ - } \ - part { name: "sb_hbar_over1"; \ - clip_to: "sb_hbar_clip"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - rel1.to: "elm.dragable.hbar.image"; \ - rel2 { \ - to: "elm.dragable.hbar.image"; \ - relative: 1.0 0.5; \ - } \ - image { \ - normal: "bt_sm_hilight.png"; \ - border: 6 6 6 0; \ - } \ - } \ - } \ - part { name: "sb_hbar_over2"; \ - clip_to: "sb_hbar_clip"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - rel1.to: "elm.dragable.hbar.image"; \ - rel2.to: "elm.dragable.hbar.image"; \ - image { \ - normal: "bt_sm_shine.png"; \ - border: 6 6 6 0; \ - } \ - } \ - } \ - part { name: "sb_hbar_p1"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - fixed: 1 1; \ - rel1 { \ - to: "sb_hbar_a1"; \ - relative: 1.0 0.0; \ - } \ - rel2 { \ - to: "elm.dragable.hbar"; \ - relative: 0.0 1.0; \ - } \ - } \ - } \ - part { name: "sb_hbar_p2"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - fixed: 1 1; \ - rel1 { \ - to: "elm.dragable.hbar"; \ - relative: 1.0 0.0; \ - } \ - rel2 { \ - to: "sb_hbar_a2"; \ - relative: 0.0 1.0; \ - } \ - } \ - } \ - part { name: "sb_hbar_a1"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - min: 17 17; \ - fixed: 1 1; \ - align: 0.0 1.0; \ - aspect: 1.0 1.0; \ - aspect_preference: VERTICAL; \ - color: 0 0 0 0; \ - rel1 { \ - to_x: "sb_hbar_clip"; \ - to_y: "elm.scrollbar.base"; \ - relative: 0.0 0.0; \ - } \ - rel2 { \ - to: "elm.scrollbar.base"; \ - relative: 0.0 1.0; \ - offset: -1 -1; \ - } \ - } \ - } \ - part { name: "sb_hbar_a1_arrow"; \ - mouse_events: 0; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - rel1.to: "sb_hbar_a1"; \ - rel2.to: "sb_hbar_a1"; \ - image.normal: "arrow_left.png"; \ - } \ - description { state: "clicked" 0.0; \ - inherit: "default" 0.0; \ - rel1.offset: -1 0; \ - rel2.offset: -2 -1; \ - } \ - } \ - part { name: "sb_hbar_a2"; \ - type: RECT; \ - mouse_events: 1; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - min: 17 17; \ - align: 1.0 1.0; \ - aspect: 1.0 1.0; \ - fixed: 1 1; \ - aspect_preference: VERTICAL; \ - color: 0 0 0 0; \ - rel1 { \ - to: "elm.scrollbar.base"; \ - relative: 1.0 0.0; \ - } \ - rel2 { \ - to: "elm.scrollbar.base"; \ - relative: 0.0 1.0; \ - } \ - } \ - } \ - part { name: "sb_hbar_a2_arrow"; \ - mouse_events: 0; \ - clip_to: "sb_hbar_clip"; \ - description { state: "default" 0.0; \ - rel1.to: "sb_hbar_a2"; \ - rel2.to: "sb_hbar_a2"; \ - image.normal: "arrow_right.png"; \ - } \ - description { state: "clicked" 0.0; \ - inherit: "default" 0.0; \ - rel1.offset: 1 0; \ - rel2.offset: 0 -1; \ - } \ - } \ - part { name: "disabler"; \ - type: RECT; \ - description { state: "default" 0.0; \ - rel1.to: "clipper"; \ - rel2.to: "clipper"; \ - color: 0 0 0 0; \ - visible: 0; \ - } \ - description { state: "disabled" 0.0; \ - inherit: "default" 0.0; \ - visible: 1; \ - color: 128 128 128 128; \ - } \ - } \ - programs { \ - program { name: "load"; \ - signal: "load"; \ - source: ""; \ - script { \ - set_state(PART:"sb_hbar_clip", "hidden", 0.0); \ - set_state(PART:"sb_vbar_clip", "hidden", 0.0); \ - set_int(sbvis_h, 0); \ - set_int(sbvis_v, 0); \ - } \ - } \ - program { name: "vbar_show"; \ - signal: "elm,action,show,vbar"; \ - source: "elm"; \ - script { \ - set_state(PART:"sb_vbar_clip_master", "default", 0.0); \ - set_int(sbvis_v, 1); \ - if (get_int(sbvis_h)) \ - set_state(PART:"elm.scrollbar.base", "both", 0.0); \ - else \ - set_state(PART:"elm.scrollbar.base", "vertical", 0.0); \ - emit("do-show-vbar", ""); \ - } \ - } \ - program { name: "vbar_hide"; \ - signal: "elm,action,hide,vbar"; \ - source: "elm"; \ - script { \ - set_state(PART:"sb_vbar_clip_master", "hidden", 0.0); \ - set_int(sbvis_v, 0); \ - if (get_int(sbvis_h)) \ - set_state(PART:"elm.scrollbar.base", "horizontal", 0.0); \ - else \ - set_state(PART:"elm.scrollbar.base", "default", 0.0); \ - emit("do-hide-vbar", ""); \ - } \ - } \ - program { name: "sb_vbar_down"; \ - signal: "mouse,down,1"; \ - source: "elm.dragable.vbar"; \ - action: STATE_SET "clicked" 0.0; \ - target: "elm.dragable.vbar"; \ - } \ - program { name: "sb_vbar_up"; \ - signal: "mouse,up,1"; \ - source: "elm.dragable.vbar"; \ - action: STATE_SET "default" 0.0; \ - target: "elm.dragable.vbar"; \ - } \ - program { name: "sb_vbar_show"; \ - signal: "do-show-vbar"; \ - source: ""; \ - action: STATE_SET "default" 0.0; \ - transition: LINEAR 0.1; \ - target: "sb_vbar_clip"; \ - } \ - program { name: "sb_vbar_hide"; \ - signal: "do-hide-vbar"; \ - source: ""; \ - action: STATE_SET "hidden" 0.0; \ - transition: LINEAR 1.0; \ - target: "sb_vbar_clip"; \ - } \ - program { name: "sb_vbar_a1_down"; \ - signal: "mouse,down,1"; \ - source: "sb_vbar_a1"; \ - action: STATE_SET "clicked" 0.0; \ - target: "sb_vbar_a1_arrow"; \ - } \ - program { name: "sb_vbar_a1_down2"; \ - signal: "mouse,down,1"; \ - source: "sb_vbar_a1"; \ - action: DRAG_VAL_STEP 0.0 -1.0; \ - target: "elm.dragable.vbar"; \ - } \ - program { name: "sb_vbar_a1_up"; \ - signal: "mouse,up,1"; \ - source: "sb_vbar_a1"; \ - action: STATE_SET "default" 0.0; \ - target: "sb_vbar_a1_arrow"; \ - } \ - program { name: "sb_vbar_a2_down"; \ - signal: "mouse,down,1"; \ - source: "sb_vbar_a2"; \ - action: STATE_SET "clicked" 0.0; \ - target: "sb_vbar_a2_arrow"; \ - } \ - program { name: "sb_vbar_a2_down2"; \ - signal: "mouse,down,1"; \ - source: "sb_vbar_a2"; \ - action: DRAG_VAL_STEP 0.0 1.0; \ - target: "elm.dragable.vbar"; \ - } \ - program { name: "sb_vbar_a2_up"; \ - signal: "mouse,up,1"; \ - source: "sb_vbar_a2"; \ - action: STATE_SET "default" 0.0; \ - target: "sb_vbar_a2_arrow"; \ - } \ - program { name: "sb_vbar_p1_down"; \ - signal: "mouse,down,1"; \ - source: "sb_vbar_p1"; \ - action: DRAG_VAL_PAGE 0.0 -1.0; \ - target: "elm.dragable.vbar"; \ - } \ - program { name: "sb_vbar_p2_down"; \ - signal: "mouse,down,1"; \ - source: "sb_vbar_p2"; \ - action: DRAG_VAL_PAGE 0.0 1.0; \ - target: "elm.dragable.vbar"; \ - } \ - program { name: "hbar_show"; \ - signal: "elm,action,show,hbar"; \ - source: "elm"; \ - script { \ - set_state(PART:"sb_hbar_clip_master", "default", 0.0); \ - set_int(sbvis_h, 1); \ - if (get_int(sbvis_v)) \ - set_state(PART:"elm.scrollbar.base", "both", 0.0); \ - else \ - set_state(PART:"elm.scrollbar.base", "horizontal", 0.0); \ - emit("do-show-hbar", ""); \ - } \ - } \ - program { name: "hbar_hide"; \ - signal: "elm,action,hide,hbar"; \ - source: "elm"; \ - script { \ - set_state(PART:"sb_hbar_clip_master", "hidden", 0.0); \ - set_int(sbvis_h, 0); \ - if (get_int(sbvis_v)) \ - set_state(PART:"elm.scrollbar.base", "vertical", 0.0); \ - else \ - set_state(PART:"elm.scrollbar.base", "default", 0.0); \ - emit("do-hide-hbar", ""); \ - } \ - } \ - program { name: "sb_hbar_down"; \ - signal: "mouse,down,1"; \ - source: "elm.dragable.hbar"; \ - action: STATE_SET "clicked" 0.0; \ - target: "elm.dragable.hbar"; \ - } \ - program { name: "sb_hbar_up"; \ - signal: "mouse,up,1"; \ - source: "elm.dragable.hbar"; \ - action: STATE_SET "default" 0.0; \ - target: "elm.dragable.hbar"; \ - } \ - program { name: "sb_hbar_show"; \ - signal: "do-show-hbar"; \ - source: ""; \ - action: STATE_SET "default" 0.0; \ - transition: LINEAR 0.1; \ - target: "sb_hbar_clip"; \ - } \ - program { name: "sb_hbar_hide"; \ - signal: "do-hide-hbar"; \ - source: ""; \ - action: STATE_SET "hidden" 0.0; \ - transition: LINEAR 1.0; \ - target: "sb_hbar_clip"; \ - } \ - program { name: "sb_hbar_a1_down"; \ - signal: "mouse,down,1"; \ - source: "sb_hbar_a1"; \ - action: STATE_SET "clicked" 0.0; \ - target: "sb_hbar_a1_arrow"; \ - } \ - program { name: "sb_hbar_a1_down2"; \ - signal: "mouse,down,1"; \ - source: "sb_hbar_a1"; \ - action: DRAG_VAL_STEP -1.0 0.0; \ - target: "elm.dragable.hbar"; \ - } \ - program { name: "sb_hbar_a1_up"; \ - signal: "mouse,up,1"; \ - source: "sb_hbar_a1"; \ - action: STATE_SET "default" 0.0; \ - target: "sb_hbar_a1_arrow"; \ - } \ - program { name: "sb_hbar_a2_down"; \ - signal: "mouse,down,1"; \ - source: "sb_hbar_a2"; \ - action: STATE_SET "clicked" 0.0; \ - target: "sb_hbar_a2_arrow"; \ - } \ - program { name: "sb_hbar_a2_down2"; \ - signal: "mouse,down,1"; \ - source: "sb_hbar_a2"; \ - action: DRAG_VAL_STEP 1.0 0.0; \ - target: "elm.dragable.hbar"; \ - } \ - program { name: "sb_hbar_a2_up"; \ - signal: "mouse,up,1"; \ - source: "sb_hbar_a2"; \ - action: STATE_SET "default" 0.0; \ - target: "sb_hbar_a2_arrow"; \ - } \ - program { name: "sb_hbar_p1_down"; \ - signal: "mouse,down,1"; \ - source: "sb_hbar_p1"; \ - action: DRAG_VAL_PAGE -1.0 0.0; \ - target: "elm.dragable.hbar"; \ - } \ - program { name: "sb_hbar_p2_down"; \ - signal: "mouse,down,1"; \ - source: "sb_hbar_p2"; \ - action: DRAG_VAL_PAGE 1.0 0.0; \ - target: "elm.dragable.hbar"; \ - } \ - program { name: "disable"; \ - signal: "elm,state,disabled"; \ - source: "elm"; \ - action: STATE_SET "disabled" 0.0; \ - target: "disabler"; \ - } \ - program { name: "enable"; \ - signal: "elm,state,enabled"; \ - source: "elm"; \ - action: STATE_SET "default" 0.0; \ - target: "disabler"; \ - } \ - } \ - -collections { - - group { name: "elm/scroller/base/default"; - alias: "elm/list/base/default"; - alias: "elm/genlist/base/default"; - alias: "elm/carousel/base/default"; - alias: "elm/gengrid/base/default"; - - data { - item: "focus_highlight" "on"; - } - - images { - image: "shelf_inset.png" COMP; - image: "sl_bt2_2.png" COMP; - } - - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - rel2 { - to_x: "sb_vbar"; - to_y: "sb_hbar"; - relative: 0.0 0.0; - offset: -1 -1; - } - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth: 0; - } - } - part { name: "focus_highlight"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -1 -1; - rel2.offset: 0 0; - image { - normal: "sl_bt2_2.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth: 0; - color: 200 155 0 0; - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; - } - } - SCROLLBARS_ADD() - } - } - - group { name: "elm/scroller/entry/default"; - - data { - item: "focus_highlight" "on"; - } - - images { - image: "shelf_inset.png" COMP; - image: "sl_bt2_2.png" COMP; - } - - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 255; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "content.clipper"; - type: RECT; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1 { - to: "elm.swallow.icon"; - relative: 1.0 0.0; - } - rel2 { - to: "elm.swallow.end"; - relative: 0.0 1.0; - } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - rel1 { - to: "bg"; - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - to: "bg"; - relative: 0.0 1.0; - offset: -1 -1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.swallow.end"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - rel1 { - to: "bg"; - relative: 1.0 0.0; - offset: 0 0; - } - rel2 { - to_x: "elm.dragable.vbar"; - to_y: "elm.dragable.hbar"; - relative: 0.0 0.0; - offset: -1 -1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "content.clipper"; - description { state: "default" 0.0; - rel1 { - to: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -5 -5; - } - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth: 0; - } - } - part { name: "focus_highlight"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -1 -1; - rel2.offset: 0 0; - image { - normal: "sl_bt2_2.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth: 0; - color: 200 155 0 0; - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; - } - } - SCROLLBARS_ADD() - } - programs { - program { name: "icon_show"; - signal: "elm,action,show,icon"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { name: "icon_hide"; - signal: "elm,action,hide,icon"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - program { name: "end_show"; - signal: "elm,action,show,end"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.end"; - } - program { name: "end_hide"; - signal: "elm,action,hide,end"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.end"; - } - program { name: "highlight_show"; - signal: "elm,action,focus_highlight,show"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - transition: ACCELERATE 0.3; - target: "focus_highlight"; - target: "conf_over"; - } - program { name: "highlight_hide"; - signal: "elm,action,focus_highlight,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "focus_highlight"; - target: "conf_over"; - } - } - } - - group { name: "elm/photocam/base/default"; - - images { - image: "shelf_inset.png" COMP; - image: "busy-1.png" COMP; - image: "busy-2.png" COMP; - image: "busy-3.png" COMP; - image: "busy-4.png" COMP; - image: "busy-5.png" COMP; - image: "busy-6.png" COMP; - image: "busy-7.png" COMP; - image: "busy-8.png" COMP; - image: "busy-9.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - } - } - part { name: "busy_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { state: "active" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "busy"; - clip_to: "busy_clip"; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - min: 32 32; - aspect: 1.0 1.0; - align: 1.0 1.0; - aspect_preference: BOTH; - rel1 { - relative: 0.9 0.9; - offset: -9 -9; - } - rel2 { - relative: 0.9 0.9; - offset: -9 -9; - } - image { - normal: "busy-9.png"; - tween: "busy-1.png"; - tween: "busy-2.png"; - tween: "busy-3.png"; - tween: "busy-4.png"; - tween: "busy-5.png"; - tween: "busy-6.png"; - tween: "busy-7.png"; - tween: "busy-8.png"; - } - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 0 0; - rel2.offset: -1 -1; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - } - } - SCROLLBARS_ADD() - } - programs { - program { name: "go1"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - } - program { name: "go2"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "busy"; - after: "go2"; - } - program { name: "stop1"; - signal: "elm,state,busy,stop"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - after: "stop2"; - } - program { name: "stop2"; - action: ACTION_STOP; - target: "go2"; - } - } - } - - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/map/base/default"; - images { - image: "shelf_inset.png" COMP; - image: "busy-1.png" COMP; - image: "busy-2.png" COMP; - image: "busy-3.png" COMP; - image: "busy-4.png" COMP; - image: "busy-5.png" COMP; - image: "busy-6.png" COMP; - image: "busy-7.png" COMP; - image: "busy-8.png" COMP; - image: "busy-9.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - } - } - part { name: "busy_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { state: "active" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "busy"; - clip_to: "busy_clip"; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - min: 32 32; - aspect: 1.0 1.0; - align: 1.0 1.0; - aspect_preference: BOTH; - rel1 { - relative: 0.9 0.9; - offset: -9 -9; - } - rel2 { - relative: 0.9 0.9; - offset: -9 -9; - } - image { - normal: "busy-9.png"; - tween: "busy-1.png"; - tween: "busy-2.png"; - tween: "busy-3.png"; - tween: "busy-4.png"; - tween: "busy-5.png"; - tween: "busy-6.png"; - tween: "busy-7.png"; - tween: "busy-8.png"; - } - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 0 0; - rel2.offset: -1 -1; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - } - } - SCROLLBARS_ADD() - } - programs { - program { name: "go1"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - } - program { name: "go2"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "busy"; - after: "go2"; - } - program { name: "stop1"; - signal: "elm,state,busy,stop"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - after: "stop2"; - } - program { name: "stop2"; - action: ACTION_STOP; - target: "go2"; - } - } - } - - group { name: "elm/list/base/hoverlist"; - data { - item: "focus_highlight" "on"; - } - images { - image: "sl_bt2_2.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 2 2; - rel2.offset: -3 -3; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "bg"; - offset: 2 2; - } - rel2 { - to: "bg"; - offset: -3 -3; - } - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { - to: "bg"; - offset: 2 2; - } - rel2 { - to: "bg"; - offset: -3 -3; - } - } - } - part { name: "focus_highlight"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -1 -1; - rel2.offset: 0 0; - image { - normal: "sl_bt2_2.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - color: 200 155 0 0; - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; - } - } - SCROLLBARS_ADD() - } - programs { - program { name: "highlight_show"; - signal: "elm,action,focus_highlight,show"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - transition: ACCELERATE 0.3; - target: "focus_highlight"; - } - program { name: "highlight_hide"; - signal: "elm,action,focus_highlight,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "focus_highlight"; - } - } - } -} diff --git a/data/themes/default.edc b/data/themes/default.edc index 358863a..617092a 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -6,243 +6,9 @@ // public-domain. This means you can take, use, re-license and otherwise // have zero restrictions on using this file as a base for your theme. -externals.external: "elm"; - collections { /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/focus_highlight/top/default"; - images { - image: "emo-unhappy.png" COMP; - } - - data { - item: "animate" "on"; - } - - script { - public s_x, s_y, s_w, s_h; /* source */ - public difx, dify, difw, difh; - public rot_dir; - - public animator1(val, Float:pos) { - new x, y, w, h, dx, dy, dw, dh, Float:rot; - - dx = round(float_mul(float(get_int(difx)), pos)); - x = get_int(s_x) + dx; - dy = round(float_mul(float(get_int(dify)), pos)); - y = get_int(s_y) + dy; - dw = round(float_mul(float(get_int(difw)), pos)); - w = get_int(s_w) + dw; - dy = round(float_mul(float(get_int(difh)), pos)); - h = get_int(s_h) + dh; - - update_offset(x, y, w, h); - - rot = 360.0 * pos * float(get_int(rot_dir)); - set_state_val(PART:"shine", STATE_MAP_ROT_Z, rot); - - if (pos >= 1.0) { - emit("elm,action,focus,anim,end", ""); - set_state(PART:"shine", "default", 0.0); - } - } - - public update_offset(x, y, w, h) { - new x1, y1, x2, y2; - x1 = x + w - 15; - y1 = y - 15; - x2 = x + w + 14; - y2 = y + 14; - set_state_val(PART:"shine", STATE_REL1_OFFSET, x1, y1); - set_state_val(PART:"shine", STATE_REL2_OFFSET, x2, y2); - } - - public message(Msg_Type:type, id, ...) { - if ((type == MSG_INT_SET) && (id == 1)) { - new x1, y1, w1, h1; - new x2, y2, w2, h2; - new px1, px2, py1, py2; - new rd; - - x1 = getarg(2); - y1 = getarg(3); - w1 = getarg(4); - h1 = getarg(5); - x2 = getarg(6); - y2 = getarg(7); - w2 = getarg(8); - h2 = getarg(9); - - set_int(s_x, x1); - set_int(s_y, y1); - set_int(s_w, w1); - set_int(s_h, h1); - set_int(difx, x2 - x1); - set_int(dify, y2 - y1); - set_int(difw, w2 - w1); - set_int(difh, h2 - h1); - - px1 = x1 + w1; - px2 = x2 + w2; - py1 = y1 + h1; - py2 = y2 + h2; - if (px2 > px1) { - rd = 1; - } else if (px1 > px2) { - rd = -1; - } else { - if (py2 > py1) { - rd = 1; - } else { - rd = -1; - } - } - set_int(rot_dir, rd); - - custom_state(PART:"shine", "default", 0.0); - set_state_val(PART:"shine", STATE_REL1, 0.0, 0.0); - set_state_val(PART:"shine", STATE_REL2, 0.0, 0.0); - set_state_val(PART:"shine", STATE_MAP_ON, 1); - set_state_val(PART:"shine", STATE_MAP_ROT_Z, 0.0); - update_offset(x1, y1, w1, h1); - set_state(PART:"shine", "custom", 0.0); - - anim(0.2, "animator1", 1); - } - } - } - - parts { - part { name: "base"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - visible: 0; - } - } - part { name: "shine"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - image { - normal: "emo-unhappy.png"; - } - rel1.to: "base"; - rel1.relative: 1.0 0.0; - rel1.offset: -15 -15; - rel2.to: "base"; - rel2.relative: 1.0 0.0; - rel2.offset: 14 14; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 0; - } - } - - program { name: "show"; - signal: "elm,action,focus,show"; - source: "elm"; - action: ACTION_STOP; - target: "hide"; - target: "hide_start"; - target: "hide_end"; - after: "show_start"; - } - program { name: "show_start"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.2; - target: "shine"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,focus,show,end" ""; - } - program { name: "hide"; - signal: "elm,action,focus,hide"; - source: "elm"; - action: ACTION_STOP; - target: "show"; - target: "show_start"; - target: "show_end"; - after: "hide_start"; - } - program { name: "hide_start"; - action: STATE_SET "disabled" 0.0; - transition: LINEAR 0.2; - target: "shine"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,focus,hide,end" ""; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/focus_highlight/bottom/default"; - parts { - part { name: "shine"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 255 0 50; - rel1.offset: 0 0; - rel2.offset: 0 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 0; - } - } - - program { name: "show"; - signal: "elm,action,focus,show"; - source: "elm"; - action: ACTION_STOP; - target: "hide"; - target: "hide_start"; - target: "hide_end"; - after: "show_start"; - } - program { name: "show_start"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.2; - target: "shine"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,focus,show,end" ""; - } - program { name: "hide"; - signal: "elm,action,focus,hide"; - source: "elm"; - action: ACTION_STOP; - target: "show"; - target: "show_start"; - target: "show_end"; - after: "hide_start"; - } - program { name: "hide_start"; - action: STATE_SET "disabled" 0.0; - transition: LINEAR 0.2; - target: "shine"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,focus,hide,end" ""; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// group { name: "elm/bg/base/default"; images { image: "dia_grad.png" COMP; @@ -263,11 +29,6 @@ collections { } } } - part { name: "elm.swallow.rectangle"; - type: SWALLOW; - description { state: "default" 0.0; - } - } part { name: "elm.swallow.background"; type: SWALLOW; description { state: "default" 0.0; @@ -292,7 +53,7 @@ collections { mouse_events: 0; description { state: "default" 0.0; rel1.relative: 0.0 1.0; - rel1.offset: 0 -9; + rel1.offset: 0 -4; image.normal: "dia_botshad.png"; fill { smooth: 0; @@ -306,6 +67,8 @@ collections { part { name: "elm.swallow.content"; type: SWALLOW; description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; } } } @@ -319,10 +82,6 @@ collections { alias: "elm/carousel/base/default"; alias: "elm/gengrid/base/default"; - data { - item: "focus_highlight" "on"; - } - script { public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; public timer0(val) { @@ -352,7 +111,8 @@ collections { image: "bt_sm_base2.png" COMP; image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; - image: "sl_bt2_2.png" COMP; + image: "sb_runnerh.png" COMP; + image: "sb_runnerv.png" COMP; } parts { part { name: "bg"; @@ -395,29 +155,7 @@ collections { } fill.smooth : 0; } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; - } - } - part { name: "focus_highlight"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -1 -1; - rel2.offset: 0 0; - image { - normal: "sl_bt2_2.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - color: 200 155 0 0; - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; - } - } + } part { name: "sb_vbar_clip_master"; type: RECT; mouse_events: 0; @@ -445,22 +183,35 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 10 17; + min: 17 17; align: 1.0 0.0; rel1 { relative: 1.0 0.0; - offset: 0 2; + offset: -2 2; to_y: "elm.swallow.content"; - to_x: "elm.swallow.content"; } rel2 { relative: 1.0 0.0; - offset: -1 -1; + offset: -2 -1; to_y: "sb_hbar"; - to_x: "elm.swallow.content"; } } } + part { name: "sb_vbar_runner"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + min: 3 3; + max: 3 99999; + rel1.to: "sb_vbar"; + rel2.to: "sb_vbar"; + image { + normal: "sb_runnerv.png"; + border: 0 0 4 4; + } + fill.smooth: 0; + } + } part { name: "elm.dragable.vbar"; clip_to: "sb_vbar_clip"; mouse_events: 0; @@ -471,8 +222,7 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 10 17; - max: 10 99999; + min: 17 17; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -486,8 +236,8 @@ collections { image { normal: "bt_sm_base2.png"; border: 6 6 6 6; - middle: SOLID; } + image.middle: SOLID; } } part { name: "sb_vbar_over1"; @@ -543,22 +293,35 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 10; + min: 17 17; align: 0.0 1.0; rel1 { relative: 0.0 1.0; - offset: 2 0; + offset: 2 -2; to_x: "elm.swallow.content"; - to_y: "elm.swallow.content"; } rel2 { relative: 0.0 1.0; - offset: -1 -1; + offset: -1 -2; to_x: "sb_vbar"; - to_y: "elm.swallow.content"; } } } + part { name: "sb_hbar_runner"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + min: 3 3; + max: 99999 3; + rel1.to: "sb_hbar"; + rel2.to: "sb_hbar"; + image { + normal: "sb_runnerh.png"; + border: 4 4 0 0; + } + fill.smooth: 0; + } + } part { name: "elm.dragable.hbar"; clip_to: "sb_hbar_clip"; mouse_events: 0; @@ -569,8 +332,7 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 17 10; - max: 99999 10; + min: 17 17; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -583,9 +345,9 @@ collections { } image { normal: "bt_sm_base2.png"; - border: 4 4 4 4; - middle: SOLID; + border: 6 6 6 6; } + image.middle: SOLID; } } part { name: "sb_hbar_over1"; @@ -597,7 +359,7 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_hilight.png"; - border: 4 4 4 0; + border: 6 6 6 0; } } } @@ -609,24 +371,10 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_shine.png"; - border: 4 4 4 0; + border: 6 6 6 0; } } } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 128 128 128 128; - } - } } programs { program { name: "load"; @@ -689,14 +437,14 @@ collections { signal: "do-show-vbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_vbar_clip"; } program { name: "sb_vbar_hide"; signal: "do-hide-vbar"; source: ""; action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_vbar_clip"; } @@ -746,14 +494,14 @@ collections { signal: "do-show-hbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_hbar_clip"; } program { name: "sb_hbar_hide"; signal: "do-hide-hbar"; source: ""; action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_hbar_clip"; } @@ -776,1226 +524,1007 @@ collections { } v = get_int(sbvis_timer); if (v > 0) cancel_timer(v); - v = timer(1.0, "timer0", 0); + v = timer(2.0, "timer0", 0); set_int(sbvis_timer, v); } } + } + } - program { name: "highlight_show"; - signal: "elm,action,focus_highlight,show"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - transition: ACCELERATE 0.3; - target: "focus_highlight"; - target: "conf_over"; - } - program { name: "highlight_hide"; - signal: "elm,action,focus_highlight,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "focus_highlight"; - target: "conf_over"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disabler"; +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/label/base/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + styles { + style { name: "textblock_style"; + base: "font=Sans font_size=10 color=#000 wrap=word"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=Sans:style=Bold"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "tab" "\t"; + } + } + parts { + part { name: "label.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } + } } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disabler"; + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + text { + style: "textblock_style"; + min: 1 1; + } + } } } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/scroller/entry/default"; - - data { - item: "focus_highlight" "on"; + group { name: "elm/label/base_wrap/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "label.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + text { + style: "textblock_style"; + min: 0 1; + } + } + } } + } - script { - public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } + group { name: "elm/label/base_wrap_ellipsis/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "label.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - v = get_int(sbvis_h); - if (v) { - v = get_int(sbalways_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } + } + + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + // FIXME : fixed for multiline ellipsis. + // does it need to make another ellipsis style? + fixed: 0 1; + text { + style: "textblock_style"; + min: 0 1; + } } - set_int(sbvis_timer, 0); - return 0; } } - images { - image: "shelf_inset.png" COMP; - image: "bt_sm_base2.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "sl_bt2_2.png" COMP; + } + + group { name: "elm/label/base/marker"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + styles { + style { name: "textblock_style2"; + base: "font=Sans:style=Bold font_size=10 align=center color=#fff wrap=word"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ color=#ffff"; + tag: "b" "+ color=#ffff"; + tag: "tab" "\t"; + } } parts { - part { name: "bg"; - type: RECT; + part { name: "label.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; description { state: "default" 0.0; - rel1.offset: 2 2; - rel2.offset: -3 -3; + text { + style: "textblock_style2"; + min: 1 1; + } } } - part { name: "clipper"; - type: RECT; + } + } + + group { name: "elm/label/base_wrap/marker"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "label.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } + } + } + part { name: "elm.text"; + type: TEXTBLOCK; mouse_events: 0; + scale: 1; description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - rel1.offset: 2 2; - rel2.offset: -3 -3; + text { + style: "textblock_style2"; + min: 0 1; + } } } - part { name: "contentclipper"; - type: RECT; - mouse_events: 0; - clip_to: "clipper"; + } + } + +/////////////////////////////////////////////////////////////////////////////// + + group { name: "elm/button/base/default"; + images { + image: "bt_base1.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "button_image"; + mouse_events: 1; description { state: "default" 0.0; - rel1.to: "elm.swallow.icon"; - rel1.relative: 1.0 0.0; - rel2.to: "elm.swallow.end"; - rel2.relative: 0.0 1.0; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + image.middle: SOLID; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } } - part { name: "elm.swallow.icon"; + part { name: "elm.swallow.content"; type: SWALLOW; - clip_to: "clipper"; description { state: "default" 0.0; - fixed: 1 1; - rel1 { - to: "bg"; - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - to: "bg"; - relative: 0.0 1.0; - offset: -1 -1; - } + fixed: 1 0; visible: 0; + align: 0.0 0.5; + rel1.offset: 4 4; + rel2.offset: 3 -5; + rel2.relative: 0.0 1.0; } description { state: "visible" 0.0; - fixed: 1 1; - align: 0.0 1.0; - rel1 { - to: "bg"; - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - to: "bg"; - relative: 0.0 1.0; - offset: -1 -1; - } + inherit: "default" 0.0; + fixed: 1 0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 4 -5; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + fixed: 0 0; visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel2.offset: -5 -5; + rel2.relative: 1.0 1.0; + aspect_preference: VERTICAL; } } - part { name: "elm.swallow.end"; - type: SWALLOW; - clip_to: "clipper"; + part { + name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; description { state: "default" 0.0; - fixed: 1 1; - rel1 { - to: "bg"; - relative: 1.0 0.0; - offset: 0 0; - } - rel2 { - to: "bg"; - relative: 1.0 1.0; - offset: -1 -1; - } visible: 0; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: 0 4; + rel2.offset: -5 -5; + color: 224 224 224 255; + color3: 0 0 0 64; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; + } } description { state: "visible" 0.0; - fixed: 1 1; - align: 1.0 1.0; - rel1 { - to: "bg"; - relative: 1.0 0.0; - offset: 0 0; - } - rel2 { - to: "bg"; - relative: 1.0 1.0; - offset: -1 -1; - } + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; visible: 1; + text.min: 1 1; } } - part { name: "elm.swallow.content"; - clip_to: "contentclipper"; - type: SWALLOW; + part { name: "over1"; + mouse_events: 0; description { state: "default" 0.0; - rel1 { - to: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 4 4; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; } - rel2 { - to: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -5 -5; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; } } } - part { name: "conf_over"; - mouse_events: 0; + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; image { - normal: "shelf_inset.png"; + normal: "bt_shine.png"; border: 7 7 7 7; - middle: 0; } - fill.smooth : 0; } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; - } - } - part { name: "focus_highlight"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -1 -1; - rel2.offset: 0 0; - image { - normal: "sl_bt2_2.png"; - border: 7 7 7 7; - middle: 0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; } - fill.smooth : 0; - color: 200 155 0 0; + fill.smooth : 0; } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - part { name: "sb_vbar_clip_master"; + } + part { name: "disabler"; type: RECT; - mouse_events: 0; description { state: "default" 0.0; - } - description { state: "hidden" 0.0; + color: 0 0 0 0; visible: 0; - color: 255 255 255 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; + } + programs { + program { + name: "button_click"; + signal: "mouse,down,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + } + program { + name: "button_click_anim"; + action: STATE_SET "clicked" 0.0; + target: "button_image"; + } + program { + name: "button_unclick"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + } + program { + name: "button_unclick_anim"; + action: STATE_SET "default" 0.0; + target: "button_image"; + } + program { + name: "button_click2"; + signal: "mouse,down,1"; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; + } + program { + name: "button_unclick2"; + signal: "mouse,up,1"; + source: "over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "over3"; + } + program { + name: "button_unclick3"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "icononly")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"elm.text", "visible", 0.0); } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "icononly", 0.0); + set_state(PART:"elm.text", "default", 0.0); } } - part { name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 10 17; - align: 1.0 0.0; - rel1 { - relative: 0.0 0.0; - offset: -2 2; - to_y: "elm.swallow.content"; - to_x: "elm.swallow.end"; - } - rel2 { - relative: 0.0 0.0; - offset: -2 -1; - to_y: "sb_hbar"; - to_x: "elm.swallow.end"; - } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + else + set_state(PART:"elm.swallow.content", "icononly", 0.0); } } - part { name: "elm.dragable.vbar"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "button_image"; + target: "over1"; + target: "over2"; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "button_image"; + target: "over1"; + target: "over2"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); } + } + } + } + + group { name: "elm/button/base/hoversel_vertical/default"; + alias: "elm/button/base/hoversel_vertical/entry"; + alias: "elm/button/base/hoversel_horizontal/default"; + alias: "elm/button/base/hoversel_horizontal/entry"; + images { + image: "bt_base1.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "updown.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "button_image"; + mouse_events: 1; description { state: "default" 0.0; - fixed: 1 1; - min: 10 17; - max: 10 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } image { - normal: "bt_sm_base2.png"; - border: 6 6 6 6; - middle: SOLID; + normal: "bt_base2.png"; + border: 7 7 7 7; } + image.middle: SOLID; } - } - part { name: "sb_vbar_over1"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.vbar"; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + normal: "bt_dis_base.png"; + border: 4 4 4 4; } } } - part { name: "sb_vbar_over2"; - clip_to: "sb_vbar_clip"; + part { name: "arrow"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } + image.normal: "updown.png"; + aspect: 0.6666666666 0.6666666666; + aspect_preference: VERTICAL; + rel1.offset: 6 7; + rel2.offset: 6 -7; + rel2.relative: 0.0 1.0; + align: 0.0 0.5; + } } - - part { name: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; + part { name: "elm.swallow.content"; + type: SWALLOW; description { state: "default" 0.0; - } - description { state: "hidden" 0.0; + fixed: 1 0; visible: 0; - color: 255 255 255 0; + align: 0.0 0.5; + rel1 { + to_x: "arrow"; + offset: 2 4; + relative: 1.0 0.0; + } + rel2 { + to_x: "arrow"; + offset: 1 -5; + relative: 1.0 1.0; + } } - } - part { name: "sb_hbar_clip"; - clip_to: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 0 0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 2 -5; } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; + description { state: "icononly" 0.0; + inherit: "default" 0.0; + fixed: 0 0; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { + to_x: "button_image"; + offset: -5 -5; + relative: 1.0 1.0; + } + aspect_preference: VERTICAL; } } - part { name: "sb_hbar"; - type: RECT; - mouse_events: 0; + part { + name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; description { state: "default" 0.0; - fixed: 1 1; visible: 0; - min: 17 10; - align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - offset: 2 0; - to_x: "elm.swallow.content"; - to_y: "elm.swallow.content"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to_x: "sb_vbar"; - to_y: "elm.swallow.content"; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: 0 4; + rel2.offset: -5 -5; + color: 224 224 224 255; + color3: 0 0 0 64; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; } } - } - part { name: "elm.dragable.hbar"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar"; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; } - description { state: "default" 0.0; - fixed: 1 1; - min: 17 10; - max: 99999 10; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 4 4 4 4; - middle: SOLID; - } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + visible: 1; + text.min: 1 1; } } - part { name: "sb_hbar_over1"; - clip_to: "sb_hbar_clip"; + part { name: "over1"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.hbar"; image { - normal: "bt_sm_hilight.png"; + normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; border: 4 4 4 0; } } } - part { name: "sb_hbar_over2"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.to: "elm.dragable.hbar"; image { - normal: "bt_sm_shine.png"; - border: 4 4 4 0; + normal: "bt_shine.png"; + border: 7 7 7 7; } } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbalways_h, 0); - set_int(sbvis_timer, 0); + part { name: "over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; } } - program { name: "icon_show"; - signal: "elm,action,show,icon"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; + } + programs { + program { + name: "button_click"; + signal: "mouse,down,1"; + source: "over2"; + action: STATE_SET "clicked" 0.0; + target: "button_image"; } - program { name: "icon_hide"; - signal: "elm,action,hide,icon"; - source: "elm"; + program { + name: "button_unclick"; + signal: "mouse,up,1"; + source: "over2"; action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; + target: "button_image"; } - program { name: "end_show"; - signal: "elm,action,show,end"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.end"; + program { + name: "button_click2"; + signal: "mouse,down,1"; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; } - program { name: "end_hide"; - signal: "elm,action,hide,end"; - source: "elm"; + program { + name: "button_unclick2"; + signal: "mouse,up,1"; + source: "over3"; action: STATE_SET "default" 0.0; - target: "elm.swallow.end"; + transition: DECELERATE 0.5; + target: "over3"; } - program { name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; + program { + name: "button_unclick3"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,click" ""; } - program { name: "vbar_hide"; - signal: "elm,action,hide,vbar"; + program { name: "text_show"; + signal: "elm,state,text,visible"; source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "icononly")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"elm.text", "visible", 0.0); + } } - program { name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; + program { name: "text_hide"; + signal: "elm,state,text,hidden"; source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - program { name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - program { name: "sb_vbar_show"; - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "sb_vbar_hide"; - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "icononly", 0.0); + set_state(PART:"elm.text", "default", 0.0); + } } - - program { name: "hbar_show"; - signal: "elm,action,show,hbar"; + program { name: "icon_show"; + signal: "elm,state,icon,visible"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_clip_master"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + else + set_state(PART:"elm.swallow.content", "icononly", 0.0); + } } - program { name: "hbar_hide"; - signal: "elm,action,hide,hbar"; + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar_clip_master"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; } - program { name: "hbar_show_always"; - signal: "elm,action,show_always,hbar"; + program { name: "disable"; + signal: "elm,state,disabled"; source: "elm"; - script { - new v; - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - set_int(sbalways_h, 1); - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - } + action: STATE_SET "disabled" 0.0; + target: "button_image"; + target: "over1"; + target: "over2"; + target: "disabler"; + after: "disable_text"; } - program { name: "hbar_show_notalways"; - signal: "elm,action,show_notalways,hbar"; + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; source: "elm"; - script { - new v; - v = get_int(sbalways_h); - if (v) { - set_int(sbalways_h, 0); - v = get_int(sbvis_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - } - } - program { name: "sb_hbar_show"; - signal: "do-show-hbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "sb_hbar_hide"; - signal: "do-hide-hbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; + action: STATE_SET "default" 0.0; + target: "button_image"; + target: "over1"; + target: "over2"; + target: "disabler"; + after: "enable_text"; } - - program { name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; + program { name: "enable_text"; script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(1.0, "timer0", 0); - set_int(sbvis_timer, v); + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); } - } - - program { name: "highlight_show"; - signal: "elm,action,focus_highlight,show"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - transition: ACCELERATE 0.3; - target: "focus_highlight"; - target: "conf_over"; - } - program { name: "highlight_hide"; - signal: "elm,action,focus_highlight,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "focus_highlight"; - target: "conf_over"; } } } -/////////////////////////////////////////////////////////////////////////////// -#define TEXT_SLIDE_DURATION 10 - - group { name: "elm/label/base/default"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - styles { - style { name: "textblock_style"; - base: "font=Sans font_size=10 color=#000 wrap=word text_class=label"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font=Sans:style=Bold"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "tab" "\t"; - } - } + group { name: "elm/button/base/hoversel_vertical_entry/default"; + alias: "elm/button/base/hoversel_vertical_entry/entry"; + alias: "elm/button/base/hoversel_horizontal_entry/default"; + alias: "elm/button/base/hoversel_horizontal_entry/entry"; + images { + image: "hoversel_entry_bg.png" COMP; + } parts { - part { name: "label.swallow.background"; - type: SWALLOW; + part { name: "button_image"; + mouse_events: 1; description { state: "default" 0.0; - visible: 1; + color: 255 255 255 0; + image.normal: "hoversel_entry_bg.png"; + image.border: 0 0 2 2; + fill.smooth: 0; } - } - part { name: "label.text.clip"; - type: RECT; - description { state: "default" 0.0; - rel1 { relative: 0 0; to: "label.swallow.background"; } - rel2 { relative: 1 1; to: "label.swallow.background"; } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; } } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "label.text.clip"; + part { name: "elm.swallow.content"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - text { - style: "textblock_style"; - min: 1 0; - } + visible: 0; + align: 0.0 0.5; + rel1.offset: 4 4; + rel2.offset: 3 -5; + rel2.relative: 0.0 1.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 4 -5; + } + description { state: "icononly" 0.0; + inherit: "default" 0.0; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel2.offset: -5 -5; + rel2.relative: 1.0 1.0; + aspect_preference: VERTICAL; } } - } - } - - group { name: "elm/label/base_wrap/default"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - parts { - part { name: "label.swallow.background"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 1; - rel1 { relative: 0 0; to: "elm.text"; } - rel2 { relative: 1 1; to: "elm.text"; } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; + part { name: "textvis"; + type: RECT; mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - text { - style: "textblock_style"; - min: 0 1; - } - } - } - } - } - - group { name: "elm/label/base_wrap_ellipsis/default"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - parts { - part { name: "label.swallow.background"; - type: SWALLOW; description { state: "default" 0.0; + visible: 0; + } + description { state: "visible" 0.0; visible: 1; - rel1 { relative: 0 0; to: "elm.text"; } - rel2 { relative: 1 1; to: "elm.text"; } } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; + } + part { + name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; scale: 1; - multiline: 1; + clip_to: "textvis"; description { state: "default" 0.0; - fixed: 0 1; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: 0 4; + rel2.offset: -5 -5; + color: 224 224 224 255; + color3: 0 0 0 64; text { - style: "textblock_style"; - min: 0 1; + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; } } + description { state: "visible" 0.0; + inherit: "default" 0.0; + text.min: 1 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + text.min: 1 1; + color: 0 0 0 255; + color3: 0 0 0 0; + } } - } - } - - group { name: "elm/label/base/marker"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - styles { - style { name: "textblock_style2"; - base: "font=Sans:style=Bold font_size=10 align=center color=#fff wrap=word text_class=label"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ color=#ffff"; - tag: "b" "+ color=#ffff"; - tag: "tab" "\t"; - } - } - parts { - part { name: "label.swallow.background"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 1; - rel1 { relative: 0 0; to: "elm.text"; } - rel2 { relative: 1 1; to: "elm.text"; } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; + part { name: "over2"; + type: RECT; + mouse_events: 1; description { state: "default" 0.0; - text { - style: "textblock_style2"; - min: 1 1; - } + color: 0 0 0 0; } } } - } - - group { name: "elm/label/base_wrap/marker"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - parts { - part { name: "label.swallow.background"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 1; - rel1 { relative: 0 0; to: "elm.text"; } - rel2 { relative: 1 1; to: "elm.text"; } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - text { - style: "textblock_style2"; - min: 0 1; - } + programs { + program { + name: "button_click"; + signal: "mouse,down,1"; + source: "over2"; + action: STATE_SET "clicked" 0.0; + target: "button_image"; + target: "elm.text"; + } + program { + name: "button_unclick"; + signal: "mouse,up,1"; + source: "over2"; + action: STATE_SET "default" 0.0; + target: "button_image"; + target: "elm.text"; + } + program { + name: "button_unclick3"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "icononly")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + set_state(PART:"textvis", "visible", 0.0); + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "icononly", 0.0); + set_state(PART:"textvis", "default", 0.0); + set_state(PART:"elm.text", "default", 0.0); + } + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"textvis", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + else + set_state(PART:"elm.swallow.content", "icononly", 0.0); } } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } } } - group { name: "elm/label/base/slide_long"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - - script { - public g_duration, g_stopslide, g_timer_id, g_anim_id; - - public message(Msg_Type:type, id, ...) { - if ((type == MSG_FLOAT_SET) && (id == 0)) { - new Float:duration; - duration = getarg(2); - set_float(g_duration, duration); - } - } - public slide_to_end_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_begin", 1); - set_int(g_timer_id, id); - } - } - public slide_to_end() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_end_anim", 1); - set_int(g_anim_id, id); - } - public slide_to_begin() { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_state(PART:"elm.text", "slide_begin", 0.0); - id = timer(0.5, "slide_to_end", 1); - set_int(g_timer_id, id); - } - public start_slide() { - set_int(g_stopslide, 0); - set_state(PART:"elm.text", "slide_begin", 0.0); - slide_to_end(); - } - public stop_slide() { - new id; - set_int(g_stopslide, 1); - id = get_int(g_anim_id); - cancel_anim(id); - id = get_int(g_timer_id); - cancel_timer(id); - set_state(PART:"elm.text", "default", 0.0); - } + group { name: "elm/button/base/anchor"; + images { + image: "bt_base1.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; } - parts { - part { name: "label.swallow.background"; - type: SWALLOW; + part { name: "button_image"; + mouse_events: 1; description { state: "default" 0.0; - visible: 1; + color: 255 255 255 0; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + image.middle: SOLID; } - } - part { name: "label.text.clip"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { relative: 0 0; to: "label.swallow.background"; } - rel2 { relative: 1 1; to: "label.swallow.background"; } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + inherit: "visible" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + inherit: "visible" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "label.text.clip"; + part { name: "elm.swallow.content"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "textblock_style"; - min: 1 0; - } - } - description { state: "slide_end" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 0.0 1.0; - align: 1.0 0.0; - } - description { state: "slide_begin" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - } - } - } - programs { - program { name: "start_slide"; - source: "elm"; - signal: "elm,state,slide,start"; - script - { - start_slide(); - } - } - program { name: "stop_slide"; - source: "elm"; - signal: "elm,state,slide,stop"; - script - { - stop_slide(); - } - } - } - } - - - group { name: "elm/label/base/slide_short"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - - script { - public g_duration, g_stopslide, g_timer_id, g_anim_id; - - public message(Msg_Type:type, id, ...) { - if ((type == MSG_FLOAT_SET) && (id == 0)) { - new Float:duration; - duration = getarg(2); - set_float(g_duration, duration); - } - } - public slide_to_end_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_begin", 1); - set_int(g_timer_id, id); - } - } - public slide_to_end() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_end_anim", 1); - set_int(g_anim_id, id); - } - public slide_to_begin() { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_state(PART:"elm.text", "slide_begin", 0.0); - id = timer(0.5, "slide_to_end", 1); - set_int(g_timer_id, id); - } - public start_slide() { - set_int(g_stopslide, 0); - set_state(PART:"elm.text", "slide_begin", 0.0); - slide_to_end(); - } - public stop_slide() { - new id; - set_int(g_stopslide, 1); - id = get_int(g_anim_id); - cancel_anim(id); - id = get_int(g_timer_id); - cancel_timer(id); - set_state(PART:"elm.text", "default", 0.0); - } - } - - parts { - part { name: "label.swallow.background"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 1; - } - } - part { name: "label.text.clip"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { relative: 0 0; to: "label.swallow.background"; } - rel2 { relative: 1 1; to: "label.swallow.background"; } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "label.text.clip"; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "textblock_style"; - min: 1 0; - } - } - description { state: "slide_end" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 1.0 1.0; - align: 1.0 0.0; - } - description { state: "slide_begin" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 0.0 1.0; - align: 0.0 0.0; - } - } - } - programs { - program { name: "start_slide"; - source: "elm"; - signal: "elm,state,slide,start"; - script - { - start_slide(); - } - } - program { name: "stop_slide"; - source: "elm"; - signal: "elm,state,slide,stop"; - script - { - stop_slide(); - } - } - } - } - - group { name: "elm/label/base/slide_bounce"; - data.item: "default_font_size" "10"; - data.item: "min_font_size" "6"; - data.item: "max_font_size" "60"; - - script { - public g_duration, g_stopslide, g_timer_id, g_anim_id; - - public message(Msg_Type:type, id, ...) { - if ((type == MSG_FLOAT_SET) && (id == 0)) { - new Float:duration; - duration = getarg(2); - set_float(g_duration, duration); - } - } - public slide_to_end_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_begin", 1); - set_int(g_timer_id, id); - } - } - public slide_to_end() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_end_anim", 1); - set_int(g_anim_id, id); - } - public slide_to_begin_anim(val, Float:pos) { - new stopflag; - new id; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - set_tween_state(PART:"elm.text", pos, "slide_end", 0.0, "slide_begin", 0.0); - if (pos >= 1.0) { - id = timer(0.5, "slide_to_end", 1); - set_int(g_timer_id, id); - } - } - public slide_to_begin() { - new stopflag; - new id; - new Float:duration; - stopflag = get_int(g_stopslide); - if (stopflag == 1) return; - duration = get_float(g_duration); - id = anim(duration, "slide_to_begin_anim", 1); - set_int(g_anim_id, id); - } - public start_slide() { - set_int(g_stopslide, 0); - set_state(PART:"elm.text", "slide_begin", 0.0); - slide_to_end(); - } - public stop_slide() { - new id; - set_int(g_stopslide, 1); - id = get_int(g_anim_id); - cancel_anim(id); - id = get_int(g_timer_id); - cancel_timer(id); - set_state(PART:"elm.text", "default", 0.0); - } - } - - parts { - part { name: "label.swallow.background"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 1; - } - } - part { name: "label.text.clip"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { relative: 0 0; to: "label.swallow.background"; } - rel2 { relative: 1 1; to: "label.swallow.background"; } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "label.text.clip"; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "textblock_style"; - min: 1 0; - } - } - description { state: "slide_end" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 1.0 1.0; - align: 1.0 0.0; - } - description { state: "slide_begin" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 0.0 1.0; - align: 0.0 0.0; - } - } - } - programs { - program { name: "start_slide"; - source: "elm"; - signal: "elm,state,slide,start"; - script - { - start_slide(); - } - } - program { name: "stop_slide"; - source: "elm"; - signal: "elm,state,slide,stop"; - script - { - stop_slide(); - } - } - } - } - - -/////////////////////////////////////////////////////////////////////////////// - - group { name: "elm/button/base/default"; - images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - min: 15 15; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - visible: 0; - align: 0.0 0.5; - rel1.offset: 4 4; - rel2.offset: 3 -5; - rel2.relative: 0.0 1.0; + fixed: 1 0; + visible: 0; + align: 0.0 0.5; + rel1.offset: 4 4; + rel2.offset: 3 -5; + rel2.relative: 0.0 1.0; } description { state: "visible" 0.0; inherit: "default" 0.0; fixed: 1 0; visible: 1; aspect: 1.0 1.0; -// aspect_preference: VERTICAL; + aspect_preference: VERTICAL; rel2.offset: 4 -5; } description { state: "icononly" 0.0; @@ -2003,10 +1532,10 @@ collections { fixed: 0 0; visible: 1; align: 0.5 0.5; -// aspect: 1.0 1.0; + aspect: 1.0 1.0; rel2.offset: -5 -5; rel2.relative: 1.0 1.0; -// aspect_preference: VERTICAL; + aspect_preference: VERTICAL; } } part { @@ -2028,7 +1557,6 @@ collections { size: 10; min: 0 0; align: 0.5 0.5; - text_class: "button"; } } description { state: "visible" 0.0; @@ -2052,14 +1580,20 @@ collections { part { name: "over1"; mouse_events: 0; description { state: "default" 0.0; + color: 255 255 255 0; rel2.relative: 1.0 0.5; image { normal: "bt_hilight.png"; border: 7 7 7 0; } } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } description { state: "disabled" 0.0; inherit: "default" 0.0; + inherit: "visible" 0.0; image { normal: "bt_dis_hilight.png"; border: 4 4 4 0; @@ -2094,6 +1628,7 @@ collections { } description { state: "clicked" 0.0; inherit: "default" 0.0; + visible: 1; color: 255 255 255 255; } } @@ -2110,44 +1645,29 @@ collections { } } programs { - program { - name: "button_click"; - signal: "mouse,down,1"; + program { + name: "button_mouse_in"; + signal: "mouse,in"; source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { - name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - } - program { - name: "button_unclick"; - signal: "mouse,up,1"; - source: "over3"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - after: "button_unclick_anim"; - } - program { - name: "button_pressed_anim"; - signal: "elm,anim,activate"; - source: "elm"; - action: STATE_SET "clicked" 0.0; + action: STATE_SET "visible" 0.0; target: "button_image"; - target: "over3"; - after: "button_unpressed_anim"; + target: "over1"; + transition: DECELERATE 0.5; } program { - name: "button_unpressed_anim"; + name: "button_mouse_out"; + signal: "mouse,out"; + source: "over2"; action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; target: "button_image"; - target: "over3"; + target: "over1"; + transition: DECELERATE 0.5; } program { - name: "button_unclick_anim"; - action: STATE_SET "default" 0.0; + name: "button_unclick"; + signal: "mouse,up,1"; + source: "over2"; + action: STATE_SET "visible" 0.0; target: "button_image"; } program { @@ -2167,7 +1687,7 @@ collections { } program { name: "button_unclick3"; - signal: "mouse,clicked,1"; + signal: "mouse,up,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,click" ""; } @@ -2259,267 +1779,354 @@ collections { } } - group { name: "elm/button/base/hoversel_vertical/default"; - alias: "elm/button/base/hoversel_vertical/entry"; - alias: "elm/button/base/hoversel_horizontal/default"; - alias: "elm/button/base/hoversel_horizontal/entry"; +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/toggle/base/default"; images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "updown.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; + image: "shelf_inset.png" COMP; + image: "bt_basew.png" COMP; + image: "bt_bases.png" COMP; + image: "bt_hilightw.png" COMP; + image: "tog_base.png" COMP; + image: "tog_dis_base.png" COMP; } parts { - part { name: "button_image"; - mouse_events: 1; + part { name: "bg"; + type: RECT; + mouse_events: 0; + scale: 1; description { state: "default" 0.0; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } + rel1.relative: 1.0 0.0; + rel1.offset: -4 3; + rel2.offset: -4 -4; + align: 1.0 0.5; + min: 96 16; + max: 96 16; + aspect: 4.0 4.0; + aspect_preference: VERTICAL; + color: 255 255 255 255; } } - part { name: "arrow"; + part { name: "clipper"; + type: RECT; mouse_events: 0; description { state: "default" 0.0; - image.normal: "updown.png"; - aspect: 0.6666666666 0.6666666666; - aspect_preference: VERTICAL; - rel1.offset: 6 7; - rel2.offset: 6 -7; - rel2.relative: 0.0 1.0; - align: 0.0 0.5; + rel1.to: "bg"; + rel2.to: "bg"; + color: 255 255 255 255; } } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - visible: 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - offset: 2 4; - relative: 1.0 0.0; - } - rel2 { - to_x: "arrow"; - offset: 1 -5; - relative: 1.0 1.0; - } + part { name: "button"; + type: RECT; + scale: 1; + clip_to: "clipper"; + mouse_events: 1; + dragable { + x: 1 1 0; + y: 0 0 0; + confine: "bg"; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - fixed: 0 0; - visible: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "bg"; + rel2.to: "bg"; + min: 16 16; + max: 16 16; aspect: 1.0 1.0; aspect_preference: VERTICAL; - rel2.offset: 2 -5; + color: 0 0 0 0; } - description { state: "icononly" 0.0; + } + part { name: "button_events"; + type: RECT; + dragable { + events: "button"; + } + description { state: "default" 0.0; + rel1.to_x: "bg"; + rel1.offset: 0 0; + rel1.relative: 0.0 0.0; + rel2.to_x: "bg"; + rel2.offset: -1 -1; + rel2.relative: 1.0 1.0; + color: 0 0 0 0; + } + } + part { name: "onrect"; + type: RECT; + scale: 1; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button"; + rel1.relative: -5.0 0.0; + rel2.to: "button"; + rel2.relative: 0.0 1.0; + color: 0 0 0 0; + } + } + part { name: "offrect"; + type: RECT; + scale: 1; + clip_to: "clipper"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button"; + rel1.relative: 1.0 0.0; + rel2.to: "button"; + rel2.relative: 6.0 1.0; + color: 0 0 0 0; + } + } + part { name: "togbase"; + mouse_events: 0; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1.to: "onrect"; + rel2.to: "offrect"; + image.normal: "tog_base.png"; + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - fixed: 0 0; - visible: 1; - align: 0.5 0.5; - aspect: 1.0 1.0; - rel1 { - to_x: "button_image"; - offset: -5 -5; - relative: 1.0 1.0; - } - aspect_preference: VERTICAL; + image.normal: "tog_dis_base.png"; } } - part { - name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; + part { name: "elm.offtext"; + type: TEXT; mouse_events: 0; scale: 1; + clip_to: "clipper"; description { state: "default" 0.0; - visible: 0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 4; - rel2.offset: -5 -5; - color: 224 224 224 255; - color3: 0 0 0 64; + fixed: 1 1; + rel1.to_x: "offrect"; + rel2.to_x: "offrect"; + color: 0 0 0 255; text { font: "Sans,Edje-Vera"; size: 10; - min: 0 0; + min: 0 1; align: 0.5 0.5; - text_class: "button"; + text: "OFF"; } } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - } description { state: "disabled" 0.0; inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; + color: 128 128 128 128; } - description { state: "disabled_visible" 0.0; + } + part { name: "elm.ontext"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + clip_to: "clipper"; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to_x: "onrect"; + rel1.offset: 1 1; + rel2.to_x: "onrect"; + rel2.offset: 0 0; + color: 224 224 224 255; + color3: 0 0 0 64; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 1; + align: 0.5 0.5; + text: "ON"; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; + color: 128 128 128 128; + color3: 0 0 0 24; } } - part { name: "over1"; - mouse_events: 0; + part { name: "conf_over"; + mouse_events: 0; description { state: "default" 0.0; - rel2.relative: 1.0 0.5; + rel1.offset: -1 -1; + rel1.to: "bg"; + rel2.offset: 0 0; + rel2.to: "bg"; image { - normal: "bt_hilight.png"; - border: 7 7 7 0; + normal: "shelf_inset.png"; + border: 7 7 7 7; + middle: 0; } + fill.smooth : 0; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + } + part { name: "button0"; + mouse_events: 0; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1.to: "button2"; + rel1.offset: -4 -4; + rel2.to: "button2"; + rel2.offset: 3 3; image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; + normal: "bt_bases.png"; + border: 11 11 11 11; } + image.middle: SOLID; + color: 255 255 255 128; } } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; + part { name: "button2"; + mouse_events: 0; + clip_to: "clipper"; description { state: "default" 0.0; + rel1.to: "button"; + rel1.offset: -2 -2; + rel2.to: "button"; + rel2.offset: 1 1; image { - normal: "bt_shine.png"; + normal: "bt_basew.png"; border: 7 7 7 7; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; + image.middle: SOLID; } } - part { name: "over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disabler"; - type: RECT; + part { name: "button3"; + mouse_events: 0; + clip_to: "clipper"; description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; + rel1.to: "button2"; + rel2.to: "button2"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilightw.png"; + border: 4 4 4 0; + } } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + visible: 0; + align: 0.0 0.5; + rel1.offset: 4 4; + rel2.relative: 0.0 1.0; + rel2.offset: 3 -5; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 1 1; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 4 -5; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + fixed: 1 1; + visible: 1; + aspect: 1.0 1.0; + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: 0 4; + rel2.to_x: "bg"; + rel2.relative: 0.0 1.0; + rel2.offset: -5 -5; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + visible: 1; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; visible: 1; } } } programs { - program { - name: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - } - program { - name: "button_unclick"; + program { name: "drag_end"; signal: "mouse,up,1"; - source: "over2"; - action: STATE_SET "default" 0.0; - target: "button_image"; - } - program { - name: "button_click2"; - signal: "mouse,down,1"; - source: "over3"; - action: STATE_SET "clicked" 0.0; - target: "over3"; + source: "button"; + script { + new Float:dx, Float:dy; + get_drag(PART:"button", dx, dy); + if (dx > 0.5) + { + set_drag(PART:"button", 1.0, 0.0); + emit("elm,action,toggle,on", ""); + } + else + { + set_drag(PART:"button", 0.0, 0.0); + emit("elm,action,toggle,off", ""); + } + } } - program { - name: "button_unclick2"; - signal: "mouse,up,1"; - source: "over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "over3"; + program { name: "toggle_on"; + signal: "elm,state,toggle,on"; + source: "elm"; + script { + set_drag(PART:"button", 100.0, 0.0); + } } - program { - name: "button_unclick3"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; + program { name: "toggle_off"; + signal: "elm,state,toggle,off"; + source: "elm"; + script { + set_drag(PART:"button", 0.0, 0.0); + } } program { name: "text_show"; signal: "elm,state,text,visible"; source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"elm.text", "visible", 0.0); - } + action: STATE_SET "visible" 0.0; + target: "elm.text"; } program { name: "text_hide"; signal: "elm,state,text,hidden"; source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"elm.text", "default", 0.0); - } + action: STATE_SET "default" 0.0; + target: "elm.text"; } program { name: "icon_show"; signal: "elm,state,icon,visible"; source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - else - set_state(PART:"elm.swallow.content", "icononly", 0.0); - } + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; } program { name: "icon_hide"; signal: "elm,state,icon,hidden"; @@ -2531,9 +2138,9 @@ collections { signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "over1"; - target: "over2"; + target: "togbase"; + target: "elm.offtext"; + target: "elm.ontext"; target: "disabler"; after: "disable_text"; } @@ -2546,15 +2153,18 @@ collections { set_state(PART:"elm.text", "disabled_visible", 0.0); else set_state(PART:"elm.text", "disabled", 0.0); + + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); + else + set_state(PART:"elm.swallow.content", "disabled", 0.0); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; action: STATE_SET "default" 0.0; - target: "button_image"; - target: "over1"; - target: "over2"; target: "disabler"; after: "enable_text"; } @@ -2567,925 +2177,638 @@ collections { set_state(PART:"elm.text", "visible", 0.0); else set_state(PART:"elm.text", "default", 0.0); + + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + else + set_state(PART:"elm.swallow.content", "default", 0.0); } } } } - group { name: "elm/button/base/hoversel_vertical_entry/default"; - alias: "elm/button/base/hoversel_vertical_entry/entry"; - alias: "elm/button/base/hoversel_horizontal_entry/default"; - alias: "elm/button/base/hoversel_horizontal_entry/entry"; +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/clock/flipdigit/default"; images { - image: "hoversel_entry_bg.png" COMP; + image: "flip_base.png" COMP; + image: "flip_base_shad.png" COMP; + image: "flip_shad.png" COMP; + image: "flip_0t.png" COMP; + image: "flip_0b.png" COMP; + image: "flip_1t.png" COMP; + image: "flip_1b.png" COMP; + image: "flip_2t.png" COMP; + image: "flip_2b.png" COMP; + image: "flip_3t.png" COMP; + image: "flip_3b.png" COMP; + image: "flip_4t.png" COMP; + image: "flip_4b.png" COMP; + image: "flip_5t.png" COMP; + image: "flip_5b.png" COMP; + image: "flip_6t.png" COMP; + image: "flip_6b.png" COMP; + image: "flip_7t.png" COMP; + image: "flip_7b.png" COMP; + image: "flip_8t.png" COMP; + image: "flip_8b.png" COMP; + image: "flip_9t.png" COMP; + image: "flip_9b.png" COMP; + image: "arrow_up.png" COMP; + image: "arrow_down.png" COMP; } - parts { - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - image.normal: "hoversel_entry_bg.png"; - image.border: 0 0 2 2; - fill.smooth: 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1.offset: 4 4; - rel2.offset: 3 -5; - rel2.relative: 0.0 1.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel2.offset: 4 -5; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.5 0.5; - aspect: 1.0 1.0; - rel2.offset: -5 -5; - rel2.relative: 1.0 1.0; - aspect_preference: VERTICAL; - } - } - part { name: "textvis"; - type: RECT; + script { + public v0_cur, v0_pre, v0_lock, v0_next; + + public animator2(val, Float:pos) { + new st1[11], st2[11], v; + + v = get_int(v0_cur); + snprintf(st1, 10, "%ih", v); + snprintf(st2, 10, "%i", v); + set_tween_state(PART:"bot", pos, st1, 0.0, st2, 0.0); + set_tween_state(PART:"sh", pos, "half", 0.0, "full", 0.0); + if (pos >= 1.0) { + set_state(PART:"sh", "default", 0.0); + set_int(v0_lock, 0); + v = get_int(v0_next); + if (v >= 0) { + set_int(v0_next, -1); + message(MSG_INT, 1, v); + } + } + } + public animator1(val, Float:pos) { + new st1[11], st2[11], v; + + v = get_int(v0_pre); + snprintf(st1, 10, "%i", v); + snprintf(st2, 10, "%ih", v); + set_tween_state(PART:"top", pos, st1, 0.0, st2, 0.0); + set_tween_state(PART:"sh", pos, "default", 0.0, "half", 0.0); + if (pos >= 1.0) anim(0.2, "animator2", val); + } + public message(Msg_Type:type, id, ...) { + if ((type == MSG_INT) && (id == 1)) { + new value, v, buf[11]; + + value = getarg(2); + if (get_int(v0_lock) == 1) { + set_int(v0_next, value); + return; + } + v = get_int(v0_cur); + set_int(v0_pre, v); + set_int(v0_cur, value); + set_int(v0_lock, 1); + snprintf(buf, 10, "%i", get_int(v0_pre)); + set_state(PART:"bot0", buf, 0.0); + snprintf(buf, 10, "%ih", get_int(v0_cur)); + set_state(PART:"bot", buf, 0.0); + snprintf(buf, 10, "%i", get_int(v0_cur)); + set_state(PART:"top0", buf, 0.0); + snprintf(buf, 10, "%i", get_int(v0_pre)); + set_state(PART:"top", buf, 0.0); + set_state(PART:"sh", "default", 0.0); + anim(0.2, "animator1", 1); + } + } + } + parts { + part { name: "shad"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - } - description { state: "visible" 0.0; - visible: 1; + rel1.offset: -4 -4; + rel1.to: "base"; + rel2.offset: 3 3; + rel2.to: "base"; + image { + normal: "flip_base_shad.png"; + border: 8 8 8 8; + } } } - part { - name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; + part { name: "base"; scale: 1; - clip_to: "textvis"; description { state: "default" 0.0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 4; + rel1.offset: 4 4; rel2.offset: -5 -5; - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - text_class: "button"; - } + // FIXME 48x96 should be the native pixel design, right now + // its 80x160. fix int he artwork later + min: 24 48; + aspect: 0.5 0.5; +// max: 24 48; + image.normal: "flip_base.png"; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - text.min: 1 1; + } + part { name: "b"; + type: RECT; + mouse_events: 1; + description { state: "default" 0.0; + visible: 0; + rel1.to: "base"; + rel1.relative: 0.0 0.5; + rel2.to: "base"; + color: 0 0 0 0; } - description { state: "clicked" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; - text.min: 1 1; - color: 0 0 0 255; - color3: 0 0 0 0; + visible: 1; } } - part { name: "over2"; - type: RECT; + part { name: "t"; + type: RECT; mouse_events: 1; description { state: "default" 0.0; - color: 0 0 0 0; + visible: 0; + rel1.to: "base"; + rel2.to: "base"; + rel2.relative: 1.0 0.5; + color: 0 0 0 0; } - } - } - programs { - program { - name: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { - name: "button_unclick"; - signal: "mouse,up,1"; - source: "over2"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { - name: "button_unclick3"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"textvis", "visible", 0.0); - set_state(PART:"elm.text", "visible", 0.0); + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"textvis", "default", 0.0); - set_state(PART:"elm.text", "default", 0.0); + part { name: "bot0"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "b"; + rel2.to: "b"; + image.normal: "flip_0b.png"; } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"textvis", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - else - set_state(PART:"elm.swallow.content", "icononly", 0.0); + description { state: "0" 0.0; + inherit: "default" 0.0; + image.normal: "flip_0b.png"; } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - } - } - - group { name: "elm/button/base/anchor"; - images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - min: 15 15; - color: 255 255 255 0; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; + description { state: "1" 0.0; + inherit: "default" 0.0; + image.normal: "flip_1b.png"; } - description { state: "visible" 0.0; + description { state: "2" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + image.normal: "flip_2b.png"; } - description { state: "clicked" 0.0; + description { state: "3" 0.0; inherit: "default" 0.0; - inherit: "visible" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; + image.normal: "flip_3b.png"; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - inherit: "visible" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } + description { state: "4" 0.0; + inherit: "default" 0.0; + image.normal: "flip_4b.png"; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; + description { state: "5" 0.0; + inherit: "default" 0.0; + image.normal: "flip_5b.png"; + } + description { state: "6" 0.0; + inherit: "default" 0.0; + image.normal: "flip_6b.png"; + } + description { state: "7" 0.0; + inherit: "default" 0.0; + image.normal: "flip_7b.png"; + } + description { state: "8" 0.0; + inherit: "default" 0.0; + image.normal: "flip_8b.png"; + } + description { state: "9" 0.0; + inherit: "default" 0.0; + image.normal: "flip_9b.png"; + } + } + part { name: "sh"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "b"; + rel2.to: "b"; + rel2.relative: 1.0 0.0; + image.normal: "flip_shad.png"; + } + description { state: "half" 0.0; + inherit: "default" 0.0; + rel2.relative: 1.0 0.5; + } + description { state: "full" 0.0; + inherit: "default" 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "bot"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + rel1.to: "b"; + rel2.to: "b"; + image.normal: "flip_0b.png"; + } + description { state: "0" 0.0; + inherit: "default" 0.0; + visible: 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_0b.png"; + } + description { state: "0h" 0.0; + inherit: "default" 0.0; visible: 0; - align: 0.0 0.5; - rel1.offset: 4 4; - rel2.offset: 3 -5; - rel2.relative: 0.0 1.0; + rel2.relative: 1.0 0.0; + image.normal: "flip_0b.png"; } - description { state: "visible" 0.0; + description { state: "1" 0.0; inherit: "default" 0.0; - fixed: 1 0; visible: 1; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel2.offset: 4 -5; + rel2.relative: 1.0 1.0; + image.normal: "flip_1b.png"; } - description { state: "icononly" 0.0; + description { state: "1h" 0.0; + inherit: "default" 0.0; + visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_1b.png"; + } + description { state: "2" 0.0; inherit: "default" 0.0; - fixed: 0 0; visible: 1; - align: 0.5 0.5; - aspect: 1.0 1.0; - rel2.offset: -5 -5; rel2.relative: 1.0 1.0; - aspect_preference: VERTICAL; + image.normal: "flip_2b.png"; } - } - part { - name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; + description { state: "2h" 0.0; + inherit: "default" 0.0; visible: 0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 4; - rel2.offset: -5 -5; - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - text_class: "button"; - } + rel2.relative: 1.0 0.0; + image.normal: "flip_2b.png"; } - description { state: "visible" 0.0; + description { state: "3" 0.0; inherit: "default" 0.0; visible: 1; - text.min: 1 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_3b.png"; } - description { state: "disabled" 0.0; + description { state: "3h" 0.0; inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; + visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_3b.png"; } - description { state: "disabled_visible" 0.0; + description { state: "4" 0.0; inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; visible: 1; - text.min: 1 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_4b.png"; } - } - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 0; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } + description { state: "4h" 0.0; + inherit: "default" 0.0; + visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_4b.png"; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + description { state: "5" 0.0; + inherit: "default" 0.0; + visible: 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_5b.png"; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - inherit: "visible" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + description { state: "5h" 0.0; + inherit: "default" 0.0; + visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_5b.png"; } - } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } + description { state: "6" 0.0; + inherit: "default" 0.0; + visible: 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_6b.png"; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + description { state: "6h" 0.0; + inherit: "default" 0.0; visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_6b.png"; } - } - part { name: "over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; + description { state: "7" 0.0; + inherit: "default" 0.0; + visible: 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_7b.png"; + } + description { state: "7h" 0.0; + inherit: "default" 0.0; visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_7b.png"; } - description { state: "disabled" 0.0; + description { state: "8" 0.0; inherit: "default" 0.0; visible: 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_8b.png"; + } + description { state: "8h" 0.0; + inherit: "default" 0.0; + visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_8b.png"; + } + description { state: "9" 0.0; + inherit: "default" 0.0; + visible: 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_9b.png"; + } + description { state: "9h" 0.0; + inherit: "default" 0.0; + visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_9b.png"; } } - } - programs { - program { - name: "button_mouse_in"; - signal: "mouse,in"; - source: "over2"; - action: STATE_SET "visible" 0.0; - target: "button_image"; - target: "over1"; - transition: DECELERATE 0.5; - } - program { - name: "button_mouse_out"; - signal: "mouse,out"; - source: "over2"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "over1"; - transition: DECELERATE 0.5; - } - program { - name: "button_unclick"; - signal: "mouse,up,1"; - source: "over2"; - action: STATE_SET "visible" 0.0; - target: "button_image"; - } - program { - name: "button_click2"; - signal: "mouse,down,1"; - source: "over3"; - action: STATE_SET "clicked" 0.0; - target: "over3"; - } - program { - name: "button_unclick2"; - signal: "mouse,up,1"; - source: "over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "over3"; - } - program { - name: "button_unclick3"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"elm.text", "default", 0.0); + part { name: "top0"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "t"; + rel2.to: "t"; + image.normal: "flip_0t.png"; } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - else - set_state(PART:"elm.swallow.content", "icononly", 0.0); + description { state: "0" 0.0; + inherit: "default" 0.0; + image.normal: "flip_0t.png"; } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "over1"; - target: "over2"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "disabled_visible", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); + description { state: "1" 0.0; + inherit: "default" 0.0; + image.normal: "flip_1t.png"; } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "over1"; - target: "over2"; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); + description { state: "2" 0.0; + inherit: "default" 0.0; + image.normal: "flip_2t.png"; } - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/toggle/base/default"; - images { - image: "shelf_inset.png" COMP; - image: "bt_basew.png" COMP; - image: "bt_bases.png" COMP; - image: "bt_hilightw.png" COMP; - image: "tog_base.png" COMP; - image: "tog_dis_base.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.relative: 1.0 0.0; - rel1.offset: -4 3; - rel2.offset: -4 -4; - align: 1.0 0.5; - min: 96 16; - max: 96 16; - aspect: 4.0 4.0; - aspect_preference: VERTICAL; - color: 255 255 255 255; + description { state: "3" 0.0; + inherit: "default" 0.0; + image.normal: "flip_3t.png"; } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - color: 255 255 255 255; + description { state: "4" 0.0; + inherit: "default" 0.0; + image.normal: "flip_4t.png"; } - } - part { name: "button"; - type: RECT; - scale: 1; - clip_to: "clipper"; - mouse_events: 1; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "bg"; + description { state: "5" 0.0; + inherit: "default" 0.0; + image.normal: "flip_5t.png"; } - description { state: "default" 0.0; - fixed: 1 1; - rel1.to: "bg"; - rel2.to: "bg"; - min: 16 16; - max: 16 16; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - color: 0 0 0 0; + description { state: "6" 0.0; + inherit: "default" 0.0; + image.normal: "flip_6t.png"; } - } - part { name: "button_events"; - type: RECT; - dragable { - events: "button"; + description { state: "7" 0.0; + inherit: "default" 0.0; + image.normal: "flip_7t.png"; } - description { state: "default" 0.0; - rel1.to_x: "bg"; - rel1.offset: 0 0; - rel1.relative: 0.0 0.0; - rel2.to_x: "bg"; - rel2.offset: -1 -1; - rel2.relative: 1.0 1.0; - color: 0 0 0 0; + description { state: "8" 0.0; + inherit: "default" 0.0; + image.normal: "flip_8t.png"; } - } - part { name: "onrect"; - type: RECT; - scale: 1; - clip_to: "clipper"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button"; - rel1.relative: -5.0 0.0; - rel2.to: "button"; - rel2.relative: 0.0 1.0; - color: 0 0 0 0; + description { state: "9" 0.0; + inherit: "default" 0.0; + image.normal: "flip_9t.png"; } } - part { name: "offrect"; - type: RECT; - scale: 1; - clip_to: "clipper"; + part { name: "top"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "button"; - rel1.relative: 1.0 0.0; - rel2.to: "button"; - rel2.relative: 6.0 1.0; - color: 0 0 0 0; - } - } - part { name: "togbase"; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1.to: "onrect"; - rel2.to: "offrect"; - image.normal: "tog_base.png"; + visible: 1; + rel1.to: "t"; + rel2.to: "t"; + image.normal: "flip_0t.png"; } - description { state: "disabled" 0.0; + description { state: "0" 0.0; inherit: "default" 0.0; - image.normal: "tog_dis_base.png"; + visible: 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_0t.png"; } - } - part { name: "elm.offtext"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - rel1.to_x: "offrect"; - rel2.to_x: "offrect"; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 1; - align: 0.5 0.5; - text: "OFF"; - } + description { state: "0h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_0t.png"; } - description { state: "disabled" 0.0; + description { state: "1" 0.0; inherit: "default" 0.0; - color: 128 128 128 128; + visible: 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_1t.png"; } - } - part { name: "elm.ontext"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - rel1.to_x: "onrect"; - rel1.offset: 1 1; - rel2.to_x: "onrect"; - rel2.offset: 0 0; - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 1; - align: 0.5 0.5; - text: "ON"; - } + description { state: "1h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_1t.png"; } - description { state: "disabled" 0.0; + description { state: "2" 0.0; inherit: "default" 0.0; - color: 128 128 128 128; - color3: 0 0 0 24; + visible: 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_2t.png"; } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -1 -1; - rel1.to: "bg"; - rel2.offset: 0 0; - rel2.to: "bg"; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; + description { state: "2h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_2t.png"; } - } - part { name: "button0"; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1.to: "button2"; - rel1.offset: -4 -4; - rel2.to: "button2"; - rel2.offset: 3 3; - image { - normal: "bt_bases.png"; - border: 11 11 11 11; - } - image.middle: SOLID; - color: 255 255 255 128; + description { state: "3" 0.0; + inherit: "default" 0.0; + visible: 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_3t.png"; } - } - part { name: "button2"; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1.to: "button"; - rel1.offset: -2 -2; - rel2.to: "button"; - rel2.offset: 1 1; - image { - normal: "bt_basew.png"; - border: 7 7 7 7; - } - image.middle: SOLID; + description { state: "3h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_3t.png"; } - } - part { name: "button3"; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1.to: "button2"; - rel2.to: "button2"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilightw.png"; - border: 4 4 4 0; - } + description { state: "4" 0.0; + inherit: "default" 0.0; + visible: 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_4t.png"; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; + description { state: "4h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; visible: 0; - align: 0.0 0.5; - rel1.offset: 4 4; - rel2.relative: 0.0 1.0; - rel2.offset: 3 -5; + rel1.relative: 0.0 1.0; + image.normal: "flip_4t.png"; } - description { state: "visible" 0.0; + description { state: "5" 0.0; inherit: "default" 0.0; visible: 1; - aspect: 1.0 1.0; - rel2.offset: 4 -5; + rel1.relative: 0.0 0.0; + image.normal: "flip_5t.png"; } - description { state: "disabled" 0.0; + description { state: "5h" 0.0; inherit: "default" 0.0; - color: 128 128 128 128; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_5t.png"; } - description { state: "disabled_visible" 0.0; + description { state: "6" 0.0; inherit: "default" 0.0; - color: 128 128 128 128; visible: 1; - aspect: 1.0 1.0; + rel1.relative: 0.0 0.0; + image.normal: "flip_6t.png"; } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; + description { state: "6h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; visible: 0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 4; - rel2.to_x: "bg"; - rel2.relative: 0.0 1.0; - rel2.offset: -5 -5; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.0 0.5; - } + rel1.relative: 0.0 1.0; + image.normal: "flip_6t.png"; } - description { state: "visible" 0.0; + description { state: "7" 0.0; inherit: "default" 0.0; visible: 1; - text.min: 1 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_7t.png"; } - description { state: "disabled" 0.0; + description { state: "7h" 0.0; inherit: "default" 0.0; - color: 128 128 128 128; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_7t.png"; } - description { state: "disabled_visible" 0.0; + description { state: "8" 0.0; inherit: "default" 0.0; - color: 128 128 128 128; visible: 1; - text.min: 1 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_8t.png"; + } + description { state: "8h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_8t.png"; + } + description { state: "9" 0.0; + inherit: "default" 0.0; + visible: 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_9t.png"; + } + description { state: "9h" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + image.normal: "flip_9t.png"; } } - part { name: "disabler"; - type: RECT; + part { name: "atop"; + mouse_events: 0; + scale: 1; description { state: "default" 0.0; - color: 0 0 0 0; visible: 0; + min: 15 15; + max: 15 15; + align: 0.5 0.0; + rel1.to: "t"; + rel2.to: "t"; + image.normal: "arrow_up.png"; } - description { state: "disabled" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; } } - } - programs { - program { name: "drag_end"; - signal: "mouse,up,1"; - source: "button"; - script { - new Float:dx, Float:dy; - get_drag(PART:"button", dx, dy); - if (dx > 0.5) - { - set_drag(PART:"button", 1.0, 0.0); - emit("elm,action,toggle,on", ""); - } - else - { - set_drag(PART:"button", 0.0, 0.0); - emit("elm,action,toggle,off", ""); - } + part { name: "abot"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 15 15; + max: 15 15; + align: 0.5 1.0; + rel1.to: "b"; + rel2.to: "b"; + image.normal: "arrow_down.png"; } - } - program { name: "toggle_on"; - signal: "elm,state,toggle,on"; - source: "elm"; - script { - set_drag(PART:"button", 100.0, 0.0); + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - program { name: "toggle_off"; - signal: "elm,state,toggle,off"; - source: "elm"; + } + programs { + program { name: "load"; + signal: "load"; + source: ""; script { - set_drag(PART:"button", 0.0, 0.0); + set_int(v0_cur, 0); + set_int(v0_pre, 0); + set_int(v0_lock, 0); + set_int(v0_next, -1); } } - program { name: "text_show"; - signal: "elm,state,text,visible"; + program { name: "edit_on"; + signal: "elm,state,edit,on"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; + action: STATE_SET "visible" 0.0; + target: "atop"; + target: "abot"; + target: "t"; + target: "b"; } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; + program { name: "edit_off"; + signal: "elm,state,edit,off"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; + action: STATE_SET "default" 0.0; + target: "atop"; + target: "abot"; + target: "t"; + target: "b"; } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.content"; + program { name: "up"; + signal: "mouse,down,1"; + source: "t"; + action: SIGNAL_EMIT "elm,action,up,start" ""; } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; + program { name: "up,stop"; + signal: "mouse,up,1"; + source: "t"; + action: SIGNAL_EMIT "elm,action,up,stop" ""; } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "togbase"; - target: "elm.offtext"; - target: "elm.ontext"; - target: "disabler"; - after: "disable_text"; + program { name: "down"; + signal: "mouse,down,1"; + source: "b"; + action: SIGNAL_EMIT "elm,action,down,start" ""; } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "disabled_visible", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); - else - set_state(PART:"elm.swallow.content", "disabled", 0.0); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disabler"; - after: "enable_text"; + program { name: "down,stop"; + signal: "mouse,up,1"; + source: "b"; + action: SIGNAL_EMIT "elm,action,down,stop" ""; } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); - - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - else - set_state(PART:"elm.swallow.content", "default", 0.0); - } - } } } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/clock/flipdigit/default"; + group { name: "elm/clock/flipampm/default"; images { image: "flip_base.png" COMP; image: "flip_base_shad.png" COMP; image: "flip_shad.png" COMP; - image: "flip_0t.png" COMP; - image: "flip_0b.png" COMP; - image: "flip_1t.png" COMP; - image: "flip_1b.png" COMP; - image: "flip_2t.png" COMP; - image: "flip_2b.png" COMP; - image: "flip_3t.png" COMP; - image: "flip_3b.png" COMP; - image: "flip_4t.png" COMP; - image: "flip_4b.png" COMP; - image: "flip_5t.png" COMP; - image: "flip_5b.png" COMP; - image: "flip_6t.png" COMP; - image: "flip_6b.png" COMP; - image: "flip_7t.png" COMP; - image: "flip_7b.png" COMP; - image: "flip_8t.png" COMP; - image: "flip_8b.png" COMP; - image: "flip_9t.png" COMP; - image: "flip_9b.png" COMP; + image: "flip_amt.png" COMP; + image: "flip_amb.png" COMP; + image: "flip_pmt.png" COMP; + image: "flip_pmb.png" COMP; image: "arrow_up.png" COMP; image: "arrow_down.png" COMP; } @@ -3561,14 +2884,15 @@ collections { } } part { name: "base"; + mouse_events: 0; scale: 1; description { state: "default" 0.0; rel1.offset: 4 4; rel2.offset: -5 -5; // FIXME 48x96 should be the native pixel design, right now // its 80x160. fix int he artwork later - min: 24 48; aspect: 0.5 0.5; + min: 24 48; // max: 24 48; image.normal: "flip_base.png"; } @@ -3577,78 +2901,36 @@ collections { type: RECT; mouse_events: 1; description { state: "default" 0.0; - visible: 0; rel1.to: "base"; rel1.relative: 0.0 0.5; rel2.to: "base"; color: 0 0 0 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } } part { name: "t"; type: RECT; mouse_events: 1; description { state: "default" 0.0; - visible: 0; rel1.to: "base"; rel2.to: "base"; rel2.relative: 1.0 0.5; color: 0 0 0 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } } part { name: "bot0"; mouse_events: 0; description { state: "default" 0.0; rel1.to: "b"; rel2.to: "b"; - image.normal: "flip_0b.png"; + image.normal: "flip_amb.png"; } description { state: "0" 0.0; inherit: "default" 0.0; - image.normal: "flip_0b.png"; + image.normal: "flip_amb.png"; } description { state: "1" 0.0; inherit: "default" 0.0; - image.normal: "flip_1b.png"; - } - description { state: "2" 0.0; - inherit: "default" 0.0; - image.normal: "flip_2b.png"; - } - description { state: "3" 0.0; - inherit: "default" 0.0; - image.normal: "flip_3b.png"; - } - description { state: "4" 0.0; - inherit: "default" 0.0; - image.normal: "flip_4b.png"; - } - description { state: "5" 0.0; - inherit: "default" 0.0; - image.normal: "flip_5b.png"; - } - description { state: "6" 0.0; - inherit: "default" 0.0; - image.normal: "flip_6b.png"; - } - description { state: "7" 0.0; - inherit: "default" 0.0; - image.normal: "flip_7b.png"; - } - description { state: "8" 0.0; - inherit: "default" 0.0; - image.normal: "flip_8b.png"; - } - description { state: "9" 0.0; - inherit: "default" 0.0; - image.normal: "flip_9b.png"; + image.normal: "flip_pmb.png"; } } part { name: "sh"; @@ -3674,175 +2956,47 @@ collections { visible: 1; rel1.to: "b"; rel2.to: "b"; - image.normal: "flip_0b.png"; + image.normal: "flip_amb.png"; } description { state: "0" 0.0; inherit: "default" 0.0; visible: 1; rel2.relative: 1.0 1.0; - image.normal: "flip_0b.png"; + image.normal: "flip_amb.png"; } description { state: "0h" 0.0; inherit: "default" 0.0; visible: 0; rel2.relative: 1.0 0.0; - image.normal: "flip_0b.png"; + image.normal: "flip_amb.png"; } description { state: "1" 0.0; inherit: "default" 0.0; visible: 1; rel2.relative: 1.0 1.0; - image.normal: "flip_1b.png"; + image.normal: "flip_pmb.png"; } description { state: "1h" 0.0; inherit: "default" 0.0; visible: 0; rel2.relative: 1.0 0.0; - image.normal: "flip_1b.png"; + image.normal: "flip_pmb.png"; } - description { state: "2" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_2b.png"; + } + part { name: "top0"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "t"; + rel2.to: "t"; + image.normal: "flip_amt.png"; } - description { state: "2h" 0.0; + description { state: "0" 0.0; inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_2b.png"; + image.normal: "flip_amt.png"; } - description { state: "3" 0.0; + description { state: "1" 0.0; inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_3b.png"; - } - description { state: "3h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_3b.png"; - } - description { state: "4" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_4b.png"; - } - description { state: "4h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_4b.png"; - } - description { state: "5" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_5b.png"; - } - description { state: "5h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_5b.png"; - } - description { state: "6" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_6b.png"; - } - description { state: "6h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_6b.png"; - } - description { state: "7" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_7b.png"; - } - description { state: "7h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_7b.png"; - } - description { state: "8" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_8b.png"; - } - description { state: "8h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_8b.png"; - } - description { state: "9" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_9b.png"; - } - description { state: "9h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_9b.png"; - } - } - part { name: "top0"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "flip_0t.png"; - } - description { state: "0" 0.0; - inherit: "default" 0.0; - image.normal: "flip_0t.png"; - } - description { state: "1" 0.0; - inherit: "default" 0.0; - image.normal: "flip_1t.png"; - } - description { state: "2" 0.0; - inherit: "default" 0.0; - image.normal: "flip_2t.png"; - } - description { state: "3" 0.0; - inherit: "default" 0.0; - image.normal: "flip_3t.png"; - } - description { state: "4" 0.0; - inherit: "default" 0.0; - image.normal: "flip_4t.png"; - } - description { state: "5" 0.0; - inherit: "default" 0.0; - image.normal: "flip_5t.png"; - } - description { state: "6" 0.0; - inherit: "default" 0.0; - image.normal: "flip_6t.png"; - } - description { state: "7" 0.0; - inherit: "default" 0.0; - image.normal: "flip_7t.png"; - } - description { state: "8" 0.0; - inherit: "default" 0.0; - image.normal: "flip_8t.png"; - } - description { state: "9" 0.0; - inherit: "default" 0.0; - image.normal: "flip_9t.png"; + image.normal: "flip_pmt.png"; } } part { name: "top"; @@ -3851,137 +3005,33 @@ collections { visible: 1; rel1.to: "t"; rel2.to: "t"; - image.normal: "flip_0t.png"; + image.normal: "flip_amt.png"; } description { state: "0" 0.0; inherit: "default" 0.0; visible: 1; rel1.relative: 0.0 0.0; - image.normal: "flip_0t.png"; + image.normal: "flip_amt.png"; } description { state: "0h" 0.0; inherit: "default" 0.0; color: 128 128 128 255; visible: 0; rel1.relative: 0.0 1.0; - image.normal: "flip_0t.png"; + image.normal: "flip_amt.png"; } description { state: "1" 0.0; inherit: "default" 0.0; visible: 1; rel1.relative: 0.0 0.0; - image.normal: "flip_1t.png"; + image.normal: "flip_pmt.png"; } description { state: "1h" 0.0; inherit: "default" 0.0; color: 128 128 128 255; visible: 0; rel1.relative: 0.0 1.0; - image.normal: "flip_1t.png"; - } - description { state: "2" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_2t.png"; - } - description { state: "2h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_2t.png"; - } - description { state: "3" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_3t.png"; - } - description { state: "3h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_3t.png"; - } - description { state: "4" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_4t.png"; - } - description { state: "4h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_4t.png"; - } - description { state: "5" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_5t.png"; - } - description { state: "5h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_5t.png"; - } - description { state: "6" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_6t.png"; - } - description { state: "6h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_6t.png"; - } - description { state: "7" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_7t.png"; - } - description { state: "7h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_7t.png"; - } - description { state: "8" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_8t.png"; - } - description { state: "8h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_8t.png"; - } - description { state: "9" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_9t.png"; - } - description { state: "9h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_9t.png"; + image.normal: "flip_pmt.png"; } } part { name: "atop"; @@ -4036,18 +3086,16 @@ collections { action: STATE_SET "visible" 0.0; target: "atop"; target: "abot"; - target: "t"; - target: "b"; } +/* program { name: "edit_off"; signal: "elm,state,edit,off"; source: "elm"; action: STATE_SET "default" 0.0; target: "atop"; target: "abot"; - target: "t"; - target: "b"; } + */ program { name: "up"; signal: "mouse,down,1"; source: "t"; @@ -4071,529 +3119,208 @@ collections { } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/clock/flipampm/default"; - images { - image: "flip_base.png" COMP; - image: "flip_base_shad.png" COMP; - image: "flip_shad.png" COMP; - image: "flip_amt.png" COMP; - image: "flip_amb.png" COMP; - image: "flip_pmt.png" COMP; - image: "flip_pmb.png" COMP; - image: "arrow_up.png" COMP; - image: "arrow_down.png" COMP; - } - script { - public v0_cur, v0_pre, v0_lock, v0_next; - - public animator2(val, Float:pos) { - new st1[11], st2[11], v; - - v = get_int(v0_cur); - snprintf(st1, 10, "%ih", v); - snprintf(st2, 10, "%i", v); - set_tween_state(PART:"bot", pos, st1, 0.0, st2, 0.0); - set_tween_state(PART:"sh", pos, "half", 0.0, "full", 0.0); - if (pos >= 1.0) { - set_state(PART:"sh", "default", 0.0); - set_int(v0_lock, 0); - v = get_int(v0_next); - if (v >= 0) { - set_int(v0_next, -1); - message(MSG_INT, 1, v); - } - } + /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/menu/item/default"; + images { + image: "bt_base1.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; } - public animator1(val, Float:pos) { - new st1[11], st2[11], v; - - v = get_int(v0_pre); - snprintf(st1, 10, "%i", v); - snprintf(st2, 10, "%ih", v); - set_tween_state(PART:"top", pos, st1, 0.0, st2, 0.0); - set_tween_state(PART:"sh", pos, "default", 0.0, "half", 0.0); - if (pos >= 1.0) anim(0.2, "animator2", val); + script { + public menu_text_visible; //0:hide (default), 1:visible + public menu_disable; //0:enable, 1:disable } - public message(Msg_Type:type, id, ...) { - if ((type == MSG_INT) && (id == 1)) { - new value, v, buf[11]; - - value = getarg(2); - if (get_int(v0_lock) == 1) { - set_int(v0_next, value); - return; - } - v = get_int(v0_cur); - set_int(v0_pre, v); - set_int(v0_cur, value); - set_int(v0_lock, 1); - snprintf(buf, 10, "%i", get_int(v0_pre)); - set_state(PART:"bot0", buf, 0.0); - snprintf(buf, 10, "%ih", get_int(v0_cur)); - set_state(PART:"bot", buf, 0.0); - snprintf(buf, 10, "%i", get_int(v0_cur)); - set_state(PART:"top0", buf, 0.0); - snprintf(buf, 10, "%i", get_int(v0_pre)); - set_state(PART:"top", buf, 0.0); - set_state(PART:"sh", "default", 0.0); - anim(0.2, "animator1", 1); - } + parts { + part { name: "item_image"; + mouse_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + image.middle: SOLID; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + inherit: "visible" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + } + } + part { name: "item_image_disabled"; + mouse_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + visible: 1; + align: 0.0 0.5; + rel1.offset: 4 4; + rel2.offset: 3 -5; + rel2.relative: 0.0 1.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 4 -5; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: 5 7; + rel2.offset: -10 -8; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 1 1; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + inherit: "visible" 0.0; + color: 254 254 254 255; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + inherit: "visible" 0.0; + color: 0 0 0 128; + } + } + part { name: "over1"; + mouse_events: 0; + description { state: "default" 0.0; + color: 255 255 255 0; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + } + } + part { name: "over_disabled"; + mouse_events: 0; + description { state: "default" 0.0; + color: 255 255 255 0; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } } - } - parts { - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -4 -4; - rel1.to: "base"; - rel2.offset: 3 3; - rel2.to: "base"; - image { - normal: "flip_base_shad.png"; - border: 8 8 8 8; - } - } - } - part { name: "base"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - // FIXME 48x96 should be the native pixel design, right now - // its 80x160. fix int he artwork later - aspect: 0.5 0.5; - min: 24 48; -// max: 24 48; - image.normal: "flip_base.png"; - } - } - part { name: "b"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel1.relative: 0.0 0.5; - rel2.to: "base"; - color: 0 0 0 0; - } - } - part { name: "t"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - rel2.relative: 1.0 0.5; - color: 0 0 0 0; - } - } - part { name: "bot0"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "b"; - rel2.to: "b"; - image.normal: "flip_amb.png"; - } - description { state: "0" 0.0; - inherit: "default" 0.0; - image.normal: "flip_amb.png"; - } - description { state: "1" 0.0; - inherit: "default" 0.0; - image.normal: "flip_pmb.png"; - } - } - part { name: "sh"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "b"; - rel2.to: "b"; - rel2.relative: 1.0 0.0; - image.normal: "flip_shad.png"; - } - description { state: "half" 0.0; - inherit: "default" 0.0; - rel2.relative: 1.0 0.5; - } - description { state: "full" 0.0; - inherit: "default" 0.0; - rel2.relative: 1.0 1.0; - } - } - part { name: "bot"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 1; - rel1.to: "b"; - rel2.to: "b"; - image.normal: "flip_amb.png"; - } - description { state: "0" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_amb.png"; - } - description { state: "0h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_amb.png"; - } - description { state: "1" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_pmb.png"; - } - description { state: "1h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_pmb.png"; - } - } - part { name: "top0"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "flip_amt.png"; - } - description { state: "0" 0.0; - inherit: "default" 0.0; - image.normal: "flip_amt.png"; - } - description { state: "1" 0.0; - inherit: "default" 0.0; - image.normal: "flip_pmt.png"; - } - } - part { name: "top"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 1; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "flip_amt.png"; - } - description { state: "0" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_amt.png"; - } - description { state: "0h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_amt.png"; - } - description { state: "1" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_pmt.png"; - } - description { state: "1h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_pmt.png"; - } - } - part { name: "atop"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - min: 15 15; - max: 15 15; - align: 0.5 0.0; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "arrow_up.png"; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "abot"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - min: 15 15; - max: 15 15; - align: 0.5 1.0; - rel1.to: "b"; - rel2.to: "b"; - image.normal: "arrow_down.png"; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_int(v0_cur, 0); - set_int(v0_pre, 0); - set_int(v0_lock, 0); - set_int(v0_next, -1); - } - } - program { name: "edit_on"; - signal: "elm,state,edit,on"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "atop"; - target: "abot"; - } -/* - program { name: "edit_off"; - signal: "elm,state,edit,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "atop"; - target: "abot"; - } - */ - program { name: "up"; - signal: "mouse,down,1"; - source: "t"; - action: SIGNAL_EMIT "elm,action,up,start" ""; - } - program { name: "up,stop"; - signal: "mouse,up,1"; - source: "t"; - action: SIGNAL_EMIT "elm,action,up,stop" ""; - } - program { name: "down"; - signal: "mouse,down,1"; - source: "b"; - action: SIGNAL_EMIT "elm,action,down,start" ""; - } - program { name: "down,stop"; - signal: "mouse,up,1"; - source: "b"; - action: SIGNAL_EMIT "elm,action,down,stop" ""; - } - } - } - - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/menu/item/default"; - images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - script { - public menu_text_visible; //0:hide (default), 1:visible - public menu_disable; //0:enable, 1:disable - } - parts { - part { name: "item_image"; - mouse_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - inherit: "visible" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - } - } - part { name: "item_image_disabled"; - mouse_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - visible: 1; - align: 0.0 0.5; - rel1.offset: 4 4; - rel2.offset: 3 -5; - rel2.relative: 0.0 1.0; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel2.offset: 4 -5; - } - } - part { - name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 5 7; - rel2.offset: -10 -8; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 1 1; - align: 0.0 0.5; - text_class: "menu_item"; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - inherit: "visible" 0.0; - color: 254 254 254 255; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - inherit: "visible" 0.0; - color: 0 0 0 128; - } - } - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 0; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - } - } - part { name: "over_disabled"; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 0; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - // - program { - name: "item_mouse_in"; - signal: "mouse,in"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,activate" ""; - after: "item_mouse_in_2"; - after: "item_mouse_in_3"; - } - program { - name: "item_mouse_in_2"; - transition: DECELERATE 0.5; - script { - new v, d; - v = get_int(menu_text_visible); - d = get_int(menu_disable); + programs { + // + program { + name: "item_mouse_in"; + signal: "mouse,in"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,activate" ""; + after: "item_mouse_in_2"; + after: "item_mouse_in_3"; + } + program { + name: "item_mouse_in_2"; + transition: DECELERATE 0.5; + script { + new v, d; + v = get_int(menu_text_visible); + d = get_int(menu_disable); if (v==1 && d==0) run_program(PROGRAM:"selected_text"); @@ -4840,7 +3567,6 @@ collections { size: 10; min: 1 1; align: 0.0 0.5; - text_class: "menu_item"; } } description { state: "visible" 0.0; @@ -5730,503 +4456,9 @@ collections { } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/label/base/tooltip"; - styles { - style { name: "tooltip_style"; - base: "font=Sans font_size=8 color=#666 wrap=word"; - tag: "br" "\n"; - tag: "hilight" "+ font=Sans:style=Bold"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "tab" "\t"; - } - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - text { - style: "tooltip_style"; - min: 1 1; - } - } - } - } - } - - group { name: "elm/tooltip/base/default"; - min: 30 30; - data { - item: "pad_x" "20"; - item: "pad_y" "20"; - item: "pad_border_x" "10"; - item: "pad_border_y" "10"; - item: "hide_timeout" "0.35"; /**< tooltip is hidden after this amount, keep in sync with hide animations */ - } - images { - image: "tooltip-base.png" COMP; - image: "tooltip-corner-top-left-tip.png" COMP; - image: "tooltip-corner-top-right-tip.png" COMP; - image: "tooltip-corner-bottom-left-tip.png" COMP; - image: "tooltip-corner-bottom-right-tip.png" COMP; - image: "tooltip-edge-left-tip.png" COMP; - image: "tooltip-edge-right-tip.png" COMP; - image: "tooltip-edge-bottom-tip.png" COMP; - image: "tooltip-edge-top-tip.png" COMP; - } - script { - hide_corners() { - set_state(PART:"corner-top-left", "default", 0.0); - set_state(PART:"corner-top-right", "default", 0.0); - set_state(PART:"corner-bottom-left", "default", 0.0); - set_state(PART:"corner-bottom-right", "default", 0.0); - } - hide_edges() { - set_state(PART:"clipper-edge-left", "default", 0.0); - set_state(PART:"clipper-edge-right", "default", 0.0); - set_state(PART:"clipper-edge-top", "default", 0.0); - set_state(PART:"clipper-edge-bottom", "default", 0.0); - } - - show_corner_top_left() { - set_state(PART:"corner-top-left", "visible", 0.0); - - set_state(PART:"corner-top-right", "default", 0.0); - set_state(PART:"corner-bottom-left", "default", 0.0); - set_state(PART:"corner-bottom-right", "default", 0.0); - hide_edges(); - } - show_corner_top_right() { - set_state(PART:"corner-top-right", "visible", 0.0); - - set_state(PART:"corner-top-left", "default", 0.0); - set_state(PART:"corner-bottom-left", "default", 0.0); - set_state(PART:"corner-bottom-right", "default", 0.0); - hide_edges(); - } - - show_corner_bottom_left() { - set_state(PART:"corner-bottom-left", "visible", 0.0); - - set_state(PART:"corner-bottom-right", "default", 0.0); - set_state(PART:"corner-top-left", "default", 0.0); - set_state(PART:"corner-top-right", "default", 0.0); - hide_edges(); - } - show_corner_bottom_right() { - set_state(PART:"corner-bottom-right", "visible", 0.0); - - set_state(PART:"corner-bottom-left", "default", 0.0); - set_state(PART:"corner-top-left", "default", 0.0); - set_state(PART:"corner-top-right", "default", 0.0); - hide_edges(); - } - - show_edge_left(Float:val) { - set_state(PART:"clipper-edge-left", "visible", 0.0); - set_drag(PART:"edge-drag-left", 0.0, val); - - set_state(PART:"clipper-edge-right", "default", 0.0); - set_state(PART:"clipper-edge-top", "default", 0.0); - set_state(PART:"clipper-edge-bottom", "default", 0.0); - hide_corners(); - } - show_edge_right(Float:val) { - set_state(PART:"clipper-edge-right", "visible", 0.0); - set_drag(PART:"edge-drag-right", 0.0, val); - - set_state(PART:"clipper-edge-left", "default", 0.0); - set_state(PART:"clipper-edge-top", "default", 0.0); - set_state(PART:"clipper-edge-bottom", "default", 0.0); - hide_corners(); - } - - show_edge_top(Float:val) { - set_state(PART:"clipper-edge-top", "visible", 0.0); - set_drag(PART:"edge-drag-top", val, 0.0); - - set_state(PART:"clipper-edge-bottom", "default", 0.0); - set_state(PART:"clipper-edge-left", "default", 0.0); - set_state(PART:"clipper-edge-right", "default", 0.0); - hide_corners(); - } - show_edge_bottom(Float:val) { - set_state(PART:"clipper-edge-bottom", "visible", 0.0); - set_drag(PART:"edge-drag-bottom", val, 0.0); - - set_state(PART:"clipper-edge-top", "default", 0.0); - set_state(PART:"clipper-edge-left", "default", 0.0); - set_state(PART:"clipper-edge-right", "default", 0.0); - hide_corners(); - } - - public message(Msg_Type:type, id, ...) { - if ((type == MSG_FLOAT_SET) && (id == 1)) { - new Float:x, Float:y; - - x = getfarg(2); - y = getfarg(3); - - if (x < 0.0) - { - if (y < 0.0) show_corner_top_left(); - else if (y > 1.0) show_corner_bottom_left(); - else show_edge_left(y); - } - else if (x > 1.0) - { - if (y < 0.0) show_corner_top_right(); - else if (y > 1.0) show_corner_bottom_right(); - else show_edge_right(y); - } - else - { - if (y < 0.0) show_edge_top(x); - else if (y > 1.0) show_edge_bottom(x); - else - { - hide_corners(); - hide_edges(); - } - } - } - } - } - parts { - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "pop"; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - min: 30 30; - rel1 { - to: "elm.swallow.content"; - offset: -15 -15; - } - rel2 { - to: "elm.swallow.content"; - offset: 14 14; - } - image { - normal: "tooltip-base.png"; - border: 14 14 14 14; - } - image.middle: SOLID; - } - } - -#define TT_CORNER(name_, rx, ry, ax, ay, ox, oy) \ - part { name: "corner-"name_; \ - type: IMAGE; \ - mouse_events: 0; \ - clip_to: "clipper"; \ - description { state: "default" 0.0; \ - color: 255 255 255 0; \ - visible: 0; \ - min: 14 14; \ - max: 14 14; \ - align: ax ay; \ - fixed: 1 1; \ - rel1 { \ - relative: rx ry; \ - offset: ox oy; \ - to: "elm.swallow.content"; \ - } \ - rel2 { \ - relative: rx ry; \ - offset: ox oy; \ - to: "elm.swallow.content"; \ - } \ - image.normal: "tooltip-corner-"name_"-tip.png"; \ - } \ - description { state: "visible" 0.0; \ - inherit: "default" 0.0; \ - color: 255 255 255 255; \ - visible: 1; \ - } \ - } - TT_CORNER("top-left", 0, 0, 1, 1, 4, 4); - TT_CORNER("top-right", 1, 0, 0, 1, -5, 4); - TT_CORNER("bottom-left", 0, 1, 1, 0, 4, -5); - TT_CORNER("bottom-right", 1, 1, 0, 0, -5, -5); -#undef TT_CORNER - -#define TT_EDGE_VERT(name_, rx, ax, ox) \ - part { name: "clipper-edge-"name_; \ - type: RECT; \ - clip_to: "clipper"; \ - description { state: "default" 0.0; \ - color: 255 255 255 0; \ - visible: 0; \ - min: 14 14; \ - align: ax 0.5; \ - fixed: 1 1; \ - rel1 { \ - relative: rx 0.0; \ - offset: ox 0; \ - to: "elm.swallow.content"; \ - } \ - rel2 { \ - relative: rx 1.0; \ - offset: ox 0; \ - to: "elm.swallow.content"; \ - } \ - } \ - description { state: "visible" 0.0; \ - inherit: "default" 0.0; \ - color: 255 255 255 255; \ - visible: 1; \ - } \ - } \ - part { name: "edge-area-"name_; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "clipper-edge-"name_; \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - min: 14 14; \ - align: ax 0.5; \ - fixed: 1 1; \ - rel1 { \ - relative: rx 0.0; \ - offset: ox 0; \ - to: "elm.swallow.content"; \ - } \ - rel2 { \ - relative: rx 1.0; \ - offset: ox 0; \ - to: "elm.swallow.content"; \ - } \ - } \ - } \ - part { name: "edge-drag-"name_; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "clipper-edge-"name_; \ - dragable { \ - x: 0 0 0; \ - y: 1 1 0; \ - confine: "edge-area-"name_; \ - } \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - min: 14 14; \ - rel1.to: "edge-area-"name_; \ - rel2.to: "edge-area-"name_; \ - } \ - } \ - part { name: "edge-img-"name_; \ - type: IMAGE; \ - mouse_events: 0; \ - clip_to: "clipper-edge-"name_; \ - description { state: "default" 0.0; \ - min: 14 14; \ - max: 14 14; \ - align: ax 0.5; \ - fixed: 1 1; \ - rel1.to: "edge-drag-"name_; \ - rel2.to: "edge-drag-"name_; \ - image.normal: "tooltip-edge-"name_"-tip.png"; \ - } \ - } - TT_EDGE_VERT("left", 0, 1, -2); - TT_EDGE_VERT("right", 1, 0, 1); -#undef TT_EDGE_VERT - -#define TT_EDGE_HORIZ(name_, ry, ay, oy) \ - part { name: "clipper-edge-"name_; \ - type: RECT; \ - clip_to: "clipper"; \ - description { state: "default" 0.0; \ - color: 255 255 255 0; \ - visible: 0; \ - min: 14 14; \ - align: 0.5 ay; \ - fixed: 1 1; \ - rel1 { \ - relative: 0.0 ry; \ - offset: 0 oy; \ - to: "elm.swallow.content"; \ - } \ - rel2 { \ - relative: 1.0 ry; \ - offset: 0 oy; \ - to: "elm.swallow.content"; \ - } \ - } \ - description { state: "visible" 0.0; \ - inherit: "default" 0.0; \ - color: 255 255 255 255; \ - visible: 1; \ - } \ - } \ - part { name: "edge-area-"name_; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "clipper-edge-"name_; \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - min: 14 14; \ - align: 0.5 ay; \ - fixed: 1 1; \ - rel1 { \ - relative: 0.0 ry; \ - offset: 0 oy; \ - to: "elm.swallow.content"; \ - } \ - rel2 { \ - relative: 1.0 ry; \ - offset: 0 oy; \ - to: "elm.swallow.content"; \ - } \ - } \ - } \ - part { name: "edge-drag-"name_; \ - type: RECT; \ - mouse_events: 0; \ - clip_to: "clipper-edge-"name_; \ - dragable { \ - x: 1 1 0; \ - y: 0 0 0; \ - confine: "edge-area-"name_; \ - } \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - min: 14 14; \ - rel1.to: "edge-area-"name_; \ - rel2.to: "edge-area-"name_; \ - } \ - } \ - part { name: "edge-img-"name_; \ - type: IMAGE; \ - mouse_events: 0; \ - clip_to: "clipper-edge-"name_; \ - description { state: "default" 0.0; \ - min: 14 14; \ - max: 14 14; \ - align: 0.5 ay; \ - fixed: 1 1; \ - rel1.to: "edge-drag-"name_; \ - rel2.to: "edge-drag-"name_; \ - image.normal: "tooltip-edge-"name_"-tip.png"; \ - } \ - } - TT_EDGE_HORIZ("top", 0, 1, -2); - TT_EDGE_HORIZ("bottom", 1, 0, 1); -#undef TT_EDGE_HORIZ - - part { name: "clipper_content"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper_content"; - description { state: "default" 0.0; } - } - programs { - program { - name: "show0"; - signal: "elm,action,show"; - source: "elm"; - action: ACTION_STOP; - target: "hide0"; - target: "hide1"; - target: "hide2"; - target: "hide3"; - after: "show1"; - after: "show2"; - } - program { - name: "show1"; - action: STATE_SET "visible" 0.0; - transition: LINEAR 0.15; - target: "clipper"; - } - program { - name: "show2"; - in: 0.1 0.0; - action: STATE_SET "visible" 0.0; - transition: LINEAR 0.15; - target: "clipper_content"; - } - - program { - name: "hide0"; - signal: "elm,action,hide"; - source: "elm"; - action: ACTION_STOP; - target: "show0"; - target: "show1"; - target: "show2"; - after: "hide1"; - after: "hide2"; - after: "hide3"; - } - program { - name: "hide1"; - script { - hide_corners(); - hide_edges(); - } - } - program { - name: "hide2"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.1; - target: "clipper_content"; - } - program { - name: "hide3"; - in: 0.1 0.0; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.1; - target: "clipper"; - } - } - } - } - group { name: "elm/tooltip/base/transparent"; - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; } - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - - /* TODO: replicate diagonal swallow slots to the other hover styles */ - group { name: "elm/hover/base/default"; - images { - image: "shad_circ.png" COMP; + group { name: "elm/hover/base/default"; + images { + image: "shad_circ.png" COMP; } parts { part { name: "elm.swallow.offset"; @@ -6288,42 +4520,6 @@ collections { rel2.offset: -1 -1; } } - part { name: "elm.swallow.slot.top-left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 -1; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top-right"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - } - } part { name: "elm.swallow.slot.right"; type: SWALLOW; description { state: "default" 0.0; @@ -6336,15 +4532,15 @@ collections { rel2.offset: 0 -1; } } - part { name: "elm.swallow.slot.bottom-right"; + part { name: "elm.swallow.slot.top"; type: SWALLOW; description { state: "default" 0.0; - align: 0.0 0.0; + align: 0.5 1.0; rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 1.0; - rel1.offset: 0 0; + rel1.relative: 0.0 0.0; + rel1.offset: 0 -1; rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 1.0; + rel2.relative: 1.0 0.0; rel2.offset: -1 -1; } } @@ -6360,18 +4556,6 @@ collections { rel2.offset: -1 0; } } - part { name: "elm.swallow.slot.bottom-left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 1.0; - rel2.offset: -1 0; - } - } part { name: "elm.swallow.slot.middle"; type: SWALLOW; description { state: "default" 0.0; @@ -7408,1953 +5592,1274 @@ collections { } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/hover/base/ctxpopup/default"; - images { - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "icon_arrow_left.png" COMP; - image: "icon_arrow_up_left.png" COMP; - image: "icon_arrow_up.png" COMP; - image: "icon_arrow_up_right.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down_right.png" COMP; - image: "icon_arrow_down.png" COMP; - image: "icon_arrow_down_left.png" COMP; +// emoticon images from: +// Tanya - Latvia +// http://lazycrazy.deviantart.com/ +// http://lazycrazy.deviantart.com/art/Very-Emotional-Emoticons-144461621 + group { name: "elm/entry/emoticon/angry/default"; images.image: + "emo-angry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-angry.png"; } } } } + group { name: "elm/entry/emoticon/angry-shout/default"; images.image: + "emo-angry-shout.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-angry-shout.png"; } } } } + group { name: "elm/entry/emoticon/crazy-laugh/default"; images.image: + "emo-crazy-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-crazy-laugh.png"; } } } } + group { name: "elm/entry/emoticon/evil-laugh/default"; images.image: + "emo-evil-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-evil-laugh.png"; } } } } + group { name: "elm/entry/emoticon/evil/default"; images.image: + "emo-evil.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-evil.png"; } } } } + group { name: "elm/entry/emoticon/goggle-smile/default"; images.image: + "emo-goggle-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-goggle-smile.png"; } } } } + group { name: "elm/entry/emoticon/grumpy/default"; images.image: + "emo-grumpy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-grumpy.png"; } } } } + group { name: "elm/entry/emoticon/grumpy-smile/default"; images.image: + "emo-grumpy-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-grumpy-smile.png"; } } } } + group { name: "elm/entry/emoticon/guilty/default"; images.image: + "emo-guilty.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-guilty.png"; } } } } + group { name: "elm/entry/emoticon/guilty-smile/default"; images.image: + "emo-guilty-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-guilty-smile.png"; } } } } + group { name: "elm/entry/emoticon/haha/default"; images.image: + "emo-haha.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-haha.png"; } } } } + group { name: "elm/entry/emoticon/half-smile/default"; images.image: + "emo-half-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-half-smile.png"; } } } } + group { name: "elm/entry/emoticon/happy-panting/default"; images.image: + "emo-happy-panting.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-happy-panting.png"; } } } } + group { name: "elm/entry/emoticon/happy/default"; images.image: + "emo-happy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-happy.png"; } } } } + group { name: "elm/entry/emoticon/indifferent/default"; images.image: + "emo-indifferent.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-indifferent.png"; } } } } + group { name: "elm/entry/emoticon/kiss/default"; images.image: + "emo-kiss.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-kiss.png"; } } } } + group { name: "elm/entry/emoticon/knowing-grin/default"; images.image: + "emo-knowing-grin.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-knowing-grin.png"; } } } } + group { name: "elm/entry/emoticon/laugh/default"; images.image: + "emo-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-laugh.png"; } } } } + group { name: "elm/entry/emoticon/little-bit-sorry/default"; images.image: + "emo-little-bit-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-little-bit-sorry.png"; } } } } + group { name: "elm/entry/emoticon/love-lots/default"; images.image: + "emo-love-lots.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-love-lots.png"; } } } } + group { name: "elm/entry/emoticon/love/default"; images.image: + "emo-love.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-love.png"; } } } } + group { name: "elm/entry/emoticon/minimal-smile/default"; images.image: + "emo-minimal-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-minimal-smile.png"; } } } } + group { name: "elm/entry/emoticon/not-happy/default"; images.image: + "emo-not-happy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-not-happy.png"; } } } } + group { name: "elm/entry/emoticon/not-impressed/default"; images.image: + "emo-not-impressed.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-not-impressed.png"; } } } } + group { name: "elm/entry/emoticon/omg/default"; images.image: + "emo-omg.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-omg.png"; } } } } + group { name: "elm/entry/emoticon/opensmile/default"; images.image: + "emo-opensmile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-opensmile.png"; } } } } + group { name: "elm/entry/emoticon/smile/default"; images.image: + "emo-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-smile.png"; } } } } + group { name: "elm/entry/emoticon/sorry/default"; images.image: + "emo-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-sorry.png"; } } } } + group { name: "elm/entry/emoticon/squint-laugh/default"; images.image: + "emo-squint-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-squint-laugh.png"; } } } } + group { name: "elm/entry/emoticon/surprised/default"; images.image: + "emo-surprised.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-surprised.png"; } } } } + group { name: "elm/entry/emoticon/suspicious/default"; images.image: + "emo-suspicious.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-suspicious.png"; } } } } + group { name: "elm/entry/emoticon/tongue-dangling/default"; images.image: + "emo-tongue-dangling.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-tongue-dangling.png"; } } } } + group { name: "elm/entry/emoticon/tongue-poke/default"; images.image: + "emo-tongue-poke.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-tongue-poke.png"; } } } } + group { name: "elm/entry/emoticon/uh/default"; images.image: + "emo-uh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-uh.png"; } } } } + group { name: "elm/entry/emoticon/unhappy/default"; images.image: + "emo-unhappy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-unhappy.png"; } } } } + group { name: "elm/entry/emoticon/very-sorry/default"; images.image: + "emo-very-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-very-sorry.png"; } } } } + group { name: "elm/entry/emoticon/what/default"; images.image: + "emo-what.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-what.png"; } } } } + group { name: "elm/entry/emoticon/wink/default"; images.image: + "emo-wink.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-wink.png"; } } } } + group { name: "elm/entry/emoticon/worried/default"; images.image: + "emo-worried.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-worried.png"; } } } } + group { name: "elm/entry/emoticon/wtf/default"; images.image: + "emo-wtf.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: + "emo-wtf.png"; } } } } +//------------------------------------------------------------ + group { name: "elm/entry/base/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + styles + { + style { name: "entry_textblock_style"; + base: "font=Sans font_size=10 color=#000 wrap=word"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=Sans:style=Oblique"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "link" "+ color=#800 underline=on underline_color=#8008"; + tag: "hilight" "+ font=Sans:style=Bold"; + } + style { name: "entry_textblock_disabled_style"; + base: "font=Sans font_size=10 color=#00000080 wrap=word"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=Sans:style=Oblique"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; + tag: "hilight" "+ font=Sans:style=Bold"; + } + } + data { +// item: context_menu_orientation "horizontal"; } parts { - part { name: "elm.swallow.offset"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 0.0 0.0; + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - } - part { name: "elm.swallow.size"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.to: "elm.swallow.offset"; - rel1.relative: 1.0 1.0; - rel2.to: "elm.swallow.offset"; - rel2.relative: 1.0 1.0; - } - } - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "top-left" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.top-left"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.top-left"; - rel2.offset: 1 7; - } - description { state: "top" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: EDITABLE; + select_mode: EXPLICIT; + multiline: 1; + source: "elm/entry/selection/default"; // selection under +// source2: "X"; // selection over +// source3: "X"; // cursor under + source4: "elm/entry/cursor/default"; // cursorover + source5: "elm/entry/anchor/default"; // anchor under +// source6: "X"; // anchor over + description { state: "default" 0.0; + /* we gotta use 0 0 here, because of scrolled entries */ + fixed: 0 0; + text { + style: "entry_textblock_style"; + min: 0 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.top"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.top"; - rel2.offset: 1 7; + text { + style: "entry_textblock_disabled_style"; + min: 0 1; + } + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + } + } + + group { name: "elm/entry/base-charwrap/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + styles + { + style { name: "entry_textblock_style_charwrap"; + base: "font=Sans font_size=10 color=#000 wrap=char"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=Sans:style=Oblique"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "link" "+ color=#800 underline=on underline_color=#8008"; + tag: "hilight" "+ font=Sans:style=Bold"; + } + style { name: "entry_textblock_disabled_style_charwrap"; + base: "font=Sans font_size=10 color=#00000080 wrap=char"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=Sans:style=Oblique"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; + tag: "hilight" "+ font=Sans:style=Bold"; + } + } + parts { + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - description { state: "top-right" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: EDITABLE; + select_mode: EXPLICIT; + multiline: 1; + source: "elm/entry/selection/default"; // selection under +// source2: "X"; // selection over +// source3: "X"; // cursor under + source4: "elm/entry/cursor/default"; // cursorover + source5: "elm/entry/anchor/default"; // anchor under +// source6: "X"; // anchor over + description { state: "default" 0.0; + fixed: 1 0; + text { + style: "entry_textblock_style_charwrap"; + min: 0 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.top-right"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.top-right"; - rel2.offset: 1 7; + text { + style: "entry_textblock_disabled_style_charwrap"; + min: 0 1; + } + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + } + } + + + group { name: "elm/entry/base-nowrap/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - description { state: "right" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: EDITABLE; + select_mode: EXPLICIT; + multiline: 1; + source: "elm/entry/selection/default"; // selection under + source4: "elm/entry/cursor/default"; // cursorover + source5: "elm/entry/anchor/default"; // anchor under + description { state: "default" 0.0; + text { + style: "entry_textblock_style"; + min: 1 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.right"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.right"; - rel2.offset: 1 7; - } - description { state: "bottom-right" 0.0; + text { + style: "entry_textblock_disabled_style"; + min: 0 1; + } + } + } +/* + part { name: "sel"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + align: 1.0 1.0; + max: 16 16; + aspect: 1.0 1.0; + color: 255 0 0 0; + } + description { state: "visible" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.bottom-right"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.bottom-right"; - rel2.offset: 1 7; + color: 255 0 0 50; } - description { state: "bottom" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.bottom"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.bottom"; - rel2.offset: 1 7; + } + */ + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } +/* + program { name: "selmode0"; + signal: "elm,state,select,on"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "sel"; + } + program { name: "selmode1"; + signal: "elm,state,select,off"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "sel"; + } + */ + } + } + + group { name: "elm/entry/base-single/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + styles + { + style { name: "entry_single_textblock_style"; + base: "font=Sans font_size=10 color=#000 wrap=none"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=Sans:style=Oblique"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "link" "+ color=#800 underline=on underline_color=#8008"; + tag: "hilight" "+ font=Sans:style=Bold"; + } + style { name: "entry_single_textblock_disabled_style"; + base: "font=Sans font_size=10 color=#00000080 wrap=none"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "tab" "\t"; + tag: "em" "+ font=Sans:style=Oblique"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; + tag: "hilight" "+ font=Sans:style=Bold"; + } + } + parts { + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - description { state: "bottom-left" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: EDITABLE; + select_mode: EXPLICIT; + multiline: 0; + source: "elm/entry/selection/default"; // selection under + source4: "elm/entry/cursor/default"; // cursorover + source5: "elm/entry/anchor/default"; // anchor under + description { state: "default" 0.0; + text { + style: "entry_single_textblock_style"; + min: 1 1; + max: 0 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.bottom-left"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.bottom-left"; - rel2.offset: 1 7; + text { + style: "entry_single_textblock_disabled_style"; + } + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + } + } + + group { name: "elm/entry/base-single-noedit/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - description { state: "left" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: PLAIN; + select_mode: EXPLICIT; + multiline: 0; + source: "elm/entry/selection/default"; // selection under + source5: "elm/entry/anchor/default"; // anchor under + description { state: "default" 0.0; + text { + style: "entry_single_textblock_style"; + min: 1 1; + max: 0 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.left"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.left"; - rel2.offset: 1 7; - } - } - part { name: "base"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - inherit: "default" 1.0; - color: 0 0 0 64; - } - } - part { name: "elm.swallow.slot.left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: -1 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 1.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top-left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 -1; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top-right"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.right"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.5; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 1.0; - rel2.offset: 0 -1; - } - } - part { name: "elm.swallow.slot.bottom-right"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.bottom"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 0; - } - } - part { name: "elm.swallow.slot.bottom-left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 1.0; - rel2.offset: -1 0; - } - } - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2.to: "button_image"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2.to: "button_image"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - } - part { name: "elm.swallow.slot.middle"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "elm.swallow.size"; - rel2.to: "elm.swallow.size"; - } - } - part { name: "arrow"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - min: 40 40; - max: 40 40; - } - description { state: "left" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 0.5; - rel1.to: "elm.swallow.slot.left"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.left"; - rel2.relative: 1.0 1.0; - rel2.offset: 0 -1; - image.normal: "icon_arrow_right.png"; - } - description { state: "top-left" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 0.0; - rel1.to: "elm.swallow.slot.top-left"; - rel1.relative: 1.0 1.0; - rel1.offset: -5 5; - rel2.to: "elm.swallow.slot.top-left"; - rel2.relative: 1.0 1.0; - rel2.offset: -4 4; - image.normal: "icon_arrow_down_right.png"; - } - description { state: "top" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.5 0.0; - rel1.to: "elm.swallow.slot.top"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.top"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 0; - image.normal: "icon_arrow_down.png"; - } - description { state: "top-right" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1.0 0.0; - rel1.to: "elm.swallow.slot.top-right"; - rel1.relative: 0.0 1.0; - rel1.offset: 5 5; - rel2.to: "elm.swallow.slot.top-right"; - rel2.relative: 0.0 1.0; - rel2.offset: 4 4; - image.normal: "icon_arrow_down_left.png"; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1.0 0.5; - rel1.to: "elm.swallow.slot.right"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.right"; - rel2.relative: 0.0 1.0; - rel2.offset: 0 -1; - image.normal: "icon_arrow_left.png"; - } - description { state: "bottom-right" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1.0 1.0; - rel1.to: "elm.swallow.slot.bottom-right"; - rel1.relative: 0.0 0.0; - rel1.offset: 5 5; - rel2.to: "elm.swallow.slot.bottom-right"; - rel2.relative: 0.0 0.0; - rel2.offset: 4 4; - image.normal: "icon_arrow_up_left.png"; - } - description { state: "bottom" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.5 1.0; - rel1.to: "elm.swallow.slot.bottom"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 -1; - rel2.to: "elm.swallow.slot.bottom"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - image.normal: "icon_arrow_up.png"; - } - description { state: "bottom-left" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 1.0; - rel1.to: "elm.swallow.slot.bottom-left"; - rel1.relative: 1.0 0.0; - rel1.offset: -5 5; - rel2.to: "elm.swallow.slot.bottom-left"; - rel2.relative: 1.0 0.0; - rel2.offset: -4 4; - image.normal: "icon_arrow_up_right.png"; - } - } + text { + style: "entry_single_textblock_disabled_style"; + } + } + } } programs { - program { name: "end"; - signal: "mouse,up,1"; - source: "base"; - action: SIGNAL_EMIT "elm,action,dismiss" ""; - } - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "all-hide"; - action: STATE_SET "default" 0.0; - target: "button_image"; - } - program { name: "top-left-show"; - signal: "elm,action,slot,top-left,show"; - source: "elm"; - action: STATE_SET "top-left" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "top-show"; - signal: "elm,action,slot,top,show"; - source: "elm"; - action: STATE_SET "top" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "top-right-show"; - signal: "elm,action,slot,top-right,show"; - source: "elm"; - action: STATE_SET "top-right" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "right-show"; - signal: "elm,action,slot,right,show"; - source: "elm"; - action: STATE_SET "right" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "bottom-right-show"; - signal: "elm,action,slot,bottom-right,show"; - source: "elm"; - action: STATE_SET "bottom-right" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "bottom-show"; - signal: "elm,action,slot,bottom,show"; - source: "elm"; - action: STATE_SET "bottom" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "bottom-left-show"; - signal: "elm,action,slot,bottom-left,show"; - source: "elm"; - action: STATE_SET "bottom-left" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "left-show"; - signal: "elm,action,slot,left,show"; - source: "elm"; - action: STATE_SET "left" 0.0; - target: "arrow"; - target: "button_image"; - } + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/list/item/ctxpopup"; - alias: "elm/list/item_odd/ctxpopup"; - alias: "elm/list/h_item/ctxpopup"; - alias: "elm/list/h_item_odd/ctxpopup"; + group { name: "elm/entry/base-noedit/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; parts { - part { name: "button_image"; - mouse_events: 1; - clip_to: "disclip"; - description { state: "default" 0.0; - color: 255 255 255 0; - image.normal: "hoversel_entry_bg.png"; - image.border: 0 0 2 2; - fill.smooth: 0; + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - description { state: "selected" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: PLAIN; + select_mode: EXPLICIT; + multiline: 1; + source: "elm/entry/selection/default"; // selection under + source5: "elm/entry/anchor/default"; // anchor under + description { state: "default" 0.0; + fixed: 1 0; + text { + style: "entry_textblock_style"; + min: 0 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + text { + style: "entry_textblock_disabled_style"; + } + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + } + } + + group { name: "elm/entry/base-noedit-charwrap/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - clip_to: "disclip"; - description { state: "default" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: PLAIN; + select_mode: EXPLICIT; + multiline: 1; + source: "elm/entry/selection/default"; // selection under + source5: "elm/entry/anchor/default"; // anchor under + description { state: "default" 0.0; fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - clip_to: "disclip"; - description { - state: "default" 0.0; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - offset: -5 -5; - } - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 1 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; + text { + style: "entry_textblock_style_charwrap"; + min: 0 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - text.min: 1 1; - color: 0 0 0 255; - color3: 0 0 0 0; - } - } - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "disclip"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "event"; - rel2.to: "event"; + text { + style: "entry_textblock_disabled_style_charwrap"; + } + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + } + } + + group { name: "elm/entry/base-nowrap-noedit/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - description { state: "disabled" 0.0; + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: PLAIN; + select_mode: EXPLICIT; + multiline: 1; + source: "elm/entry/selection/default"; // selection under + source5: "elm/entry/anchor/default"; // anchor under + description { state: "default" 0.0; + text { + style: "entry_textblock_style"; + min: 1 1; + } + } + description { state: "disabled" 0.0; inherit: "default" 0.0; - color: 255 255 255 64; - } - } + text { + style: "entry_textblock_disabled_style"; + } + } + } } programs { - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "elm.text"; - target: "button_image"; - } - program { - name: "item_unclick"; - signal: "mouse,up,1"; - source: "event"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "button_image"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/list/base/ctxpopup"; - data { - item: "focus_highlight" "on"; - } - script { - public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - v = get_int(sbvis_h); - if (v) { - v = get_int(sbalways_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } + group { name: "elm/entry/base-password/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; + parts { + part { name: "entry.swallow.background"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to: "elm.text"; } + rel2 { relative: 1 1; to: "elm.text"; } } - set_int(sbvis_timer, 0); - return 0; - } + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: PASSWORD; + select_mode: EXPLICIT; + multiline: 0; + source: "elm/entry/selection/default"; // selection under + source4: "elm/entry/cursor/default"; // cursorover + source5: "elm/entry/anchor/default"; // anchor under + description { state: "default" 0.0; + text { + style: "entry_single_textblock_style"; + repch: "*"; + min: 1 1; + max: 0 1; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_single_textblock_disabled_style"; + } + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } } + } + + group { name: "elm/entry/cursor/default"; + data.item: "default_font_size" "24"; + data.item: "min_font_size" "8"; + data.item: "max_font_size" "60"; images { - image: "bt_sm_base2.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "sl_bt2_2.png" COMP; + image: "cur_box.png" COMP; + image: "cur_hi.png" COMP; + image: "cur_shad.png" COMP; + image: "cur_shine.png" COMP; + image: "cur_glow.png" COMP; } parts { + part { name: "clip2"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "clip"; + rel2.to: "clip"; + visible: 0; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "clip"; + type: RECT; + mouse_events: 0; + clip_to: "clip2"; + description { state: "default" 0.0; + rel1.offset: -10 0; + rel2.offset: 9 9; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 2 2; - rel2.offset: -3 -3; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - rel1.offset: 2 2; - rel2.offset: -3 -3; - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - rel1.offset: 2 2; - rel2.offset: -3 -3; - } - } - part { name: "focus_highlight"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -1 -1; - rel2.offset: 0 0; - image { - normal: "sl_bt2_2.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - color: 200 155 0 0; - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - color: 200 155 0 255; - } - } - part { name: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 10 17; - align: 1.0 0.0; - rel1 { - relative: 1.0 0.0; - offset: 0 2; - to_y: "elm.swallow.content"; - to_x: "elm.swallow.content"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to_y: "sb_hbar"; - to_x: "elm.swallow.content"; - } - } - } - part { name: "elm.dragable.vbar"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 10 17; - max: 10 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 6 6 6 6; - middle: SOLID; - } - } - } - part { name: "sb_vbar_over1"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - } - part { name: "sb_vbar_over2"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - } - part { name: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar_clip"; - clip_to: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 17 10; - align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - offset: 2 0; - to_x: "elm.swallow.content"; - to_y: "elm.swallow.content"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to_x: "sb_vbar"; - to_y: "elm.swallow.content"; - } - } - } - part { name: "elm.dragable.hbar"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 17 10; - max: 99999 10; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 4 4 4 4; - middle: SOLID; - } - } - } - part { name: "sb_hbar_over1"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - } - part { name: "sb_hbar_over2"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - } + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + rel1.to: "base"; + rel1.offset: -2 0; + rel2.to: "base"; + rel2.offset: 1 1; + image.border: 2 2 2 2; + image.normal: "cur_shad.png"; + } + } + part { name: "base"; + mouse_events: 0; + scale: 1; + clip_to: "clip"; + description { state: "default" 0.0; + min: 2 2; + align: 0.5 1.0; + rel1.relative: 0.0 1.0; + rel1.offset: 0 -1; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -1; + image.normal: "cur_box.png"; + } + } + part { name: "hi"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + rel2.relative: 1.0 0.5; + image.normal: "cur_hi.png"; + } + } + part { name: "shine"; + mouse_events: 0; + clip_to: "clip"; + clip_to: "clip2"; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + rel2.relative: 1.0 0.75; + image.border: 2 2 1 0; + image.normal: "cur_shine.png"; + fill.smooth: 0; + } + } + part { name: "glow"; + mouse_events: 0; + clip_to: "clip2"; + description { state: "default" 0.0; + rel1.to: "base"; + rel1.relative: 0.0 -2.0; + rel1.offset: -2 0; + rel2.to: "base"; + rel2.relative: 1.0 0.0; + rel2.offset: 1 1; + image.border: 2 2 0 4; + image.normal: "cur_glow.png"; + fill.smooth: 0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + } + } } programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbalways_h, 0); - set_int(sbvis_timer, 0); - } - } - program { name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_hide"; - signal: "elm,action,hide,vbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - program { name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - program { name: "sb_vbar_show"; - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "sb_vbar_hide"; - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "hbar_show"; - signal: "elm,action,show,hbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_hide"; - signal: "elm,action,hide,hbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_show_always"; - signal: "elm,action,show_always,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - set_int(sbalways_h, 1); - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - } - } - program { name: "hbar_show_notalways"; - signal: "elm,action,show_notalways,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_h); - if (v) { - set_int(sbalways_h, 0); - v = get_int(sbvis_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - } - } - program { name: "sb_hbar_show"; - signal: "do-show-hbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "sb_hbar_hide"; - signal: "do-hide-hbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(1.0, "timer0", 0); - set_int(sbvis_timer, v); - } - } - program { name: "highlight_show"; - signal: "elm,action,focus_highlight,show"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - transition: ACCELERATE 0.3; - target: "focus_highlight"; - } - program { name: "highlight_hide"; - signal: "elm,action,focus_highlight,hide"; - source: "elm"; + program { name: "show"; + signal: "show"; + source: ""; + action: STATE_SET "hidden" 0.0; + in: 1.0 0.0; + transition: DECELERATE 2.0; + target: "glow"; + after: "show2"; + } + program { name: "show2"; + action: STATE_SET "hidden" 0.0; + in: 0.2 0.0; + target: "clip"; + after: "show3"; + } + program { name: "show3"; action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "focus_highlight"; - } + in: 0.5 0.0; + target: "clip"; + after: "show4"; + } + program { name: "show4"; + action: STATE_SET "default" 0.0; + in: 0.5 0.0; + transition: DECELERATE 0.5; + target: "glow"; + after: "show"; + } + program { name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + action: STATE_SET "focused" 0.0; + target: "clip2"; + } + program { name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "clip2"; + } } } -/////////////////////////////////////////////////////////////////////////////// -// emoticon images from: -// Tanya - Latvia -// http://lazycrazy.deviantart.com/ -// http://lazycrazy.deviantart.com/art/Very-Emotional-Emoticons-144461621 - group { name: "elm/entry/emoticon/angry/default"; images.image: - "emo-angry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-angry.png"; } } } } - group { name: "elm/entry/emoticon/angry-shout/default"; images.image: - "emo-angry-shout.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-angry-shout.png"; } } } } - group { name: "elm/entry/emoticon/crazy-laugh/default"; images.image: - "emo-crazy-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-crazy-laugh.png"; } } } } - group { name: "elm/entry/emoticon/evil-laugh/default"; images.image: - "emo-evil-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-evil-laugh.png"; } } } } - group { name: "elm/entry/emoticon/evil/default"; images.image: - "emo-evil.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-evil.png"; } } } } - group { name: "elm/entry/emoticon/goggle-smile/default"; images.image: - "emo-goggle-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-goggle-smile.png"; } } } } - group { name: "elm/entry/emoticon/grumpy/default"; images.image: - "emo-grumpy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-grumpy.png"; } } } } - group { name: "elm/entry/emoticon/grumpy-smile/default"; images.image: - "emo-grumpy-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-grumpy-smile.png"; } } } } - group { name: "elm/entry/emoticon/guilty/default"; images.image: - "emo-guilty.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-guilty.png"; } } } } - group { name: "elm/entry/emoticon/guilty-smile/default"; images.image: - "emo-guilty-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-guilty-smile.png"; } } } } - group { name: "elm/entry/emoticon/haha/default"; images.image: - "emo-haha.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-haha.png"; } } } } - group { name: "elm/entry/emoticon/half-smile/default"; images.image: - "emo-half-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-half-smile.png"; } } } } - group { name: "elm/entry/emoticon/happy-panting/default"; images.image: - "emo-happy-panting.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-happy-panting.png"; } } } } - group { name: "elm/entry/emoticon/happy/default"; images.image: - "emo-happy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-happy.png"; } } } } - group { name: "elm/entry/emoticon/indifferent/default"; images.image: - "emo-indifferent.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-indifferent.png"; } } } } - group { name: "elm/entry/emoticon/kiss/default"; images.image: - "emo-kiss.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-kiss.png"; } } } } - group { name: "elm/entry/emoticon/knowing-grin/default"; images.image: - "emo-knowing-grin.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-knowing-grin.png"; } } } } - group { name: "elm/entry/emoticon/laugh/default"; images.image: - "emo-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-laugh.png"; } } } } - group { name: "elm/entry/emoticon/little-bit-sorry/default"; images.image: - "emo-little-bit-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-little-bit-sorry.png"; } } } } - group { name: "elm/entry/emoticon/love-lots/default"; images.image: - "emo-love-lots.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-love-lots.png"; } } } } - group { name: "elm/entry/emoticon/love/default"; images.image: - "emo-love.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-love.png"; } } } } - group { name: "elm/entry/emoticon/minimal-smile/default"; images.image: - "emo-minimal-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-minimal-smile.png"; } } } } - group { name: "elm/entry/emoticon/not-happy/default"; images.image: - "emo-not-happy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-not-happy.png"; } } } } - group { name: "elm/entry/emoticon/not-impressed/default"; images.image: - "emo-not-impressed.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-not-impressed.png"; } } } } - group { name: "elm/entry/emoticon/omg/default"; images.image: - "emo-omg.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-omg.png"; } } } } - group { name: "elm/entry/emoticon/opensmile/default"; images.image: - "emo-opensmile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-opensmile.png"; } } } } - group { name: "elm/entry/emoticon/smile/default"; images.image: - "emo-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-smile.png"; } } } } - group { name: "elm/entry/emoticon/sorry/default"; images.image: - "emo-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-sorry.png"; } } } } - group { name: "elm/entry/emoticon/squint-laugh/default"; images.image: - "emo-squint-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-squint-laugh.png"; } } } } - group { name: "elm/entry/emoticon/surprised/default"; images.image: - "emo-surprised.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-surprised.png"; } } } } - group { name: "elm/entry/emoticon/suspicious/default"; images.image: - "emo-suspicious.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-suspicious.png"; } } } } - group { name: "elm/entry/emoticon/tongue-dangling/default"; images.image: - "emo-tongue-dangling.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-tongue-dangling.png"; } } } } - group { name: "elm/entry/emoticon/tongue-poke/default"; images.image: - "emo-tongue-poke.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-tongue-poke.png"; } } } } - group { name: "elm/entry/emoticon/uh/default"; images.image: - "emo-uh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-uh.png"; } } } } - group { name: "elm/entry/emoticon/unhappy/default"; images.image: - "emo-unhappy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-unhappy.png"; } } } } - group { name: "elm/entry/emoticon/very-sorry/default"; images.image: - "emo-very-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-very-sorry.png"; } } } } - group { name: "elm/entry/emoticon/what/default"; images.image: - "emo-what.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-what.png"; } } } } - group { name: "elm/entry/emoticon/wink/default"; images.image: - "emo-wink.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-wink.png"; } } } } - group { name: "elm/entry/emoticon/worried/default"; images.image: - "emo-worried.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-worried.png"; } } } } - group { name: "elm/entry/emoticon/wtf/default"; images.image: - "emo-wtf.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal: - "emo-wtf.png"; } } } } -//------------------------------------------------------------ - group { name: "elm/entry/base/default"; - styles - { - style { name: "entry_textblock_style"; - base: "font=Sans font_size=10 color=#000 wrap=word text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Sans:style=Oblique"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Sans:style=Bold"; - } - style { name: "entry_textblock_disabled_style"; - base: "font=Sans font_size=10 color=#00000080 wrap=word text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Sans:style=Oblique"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Sans:style=Bold"; - } - } - data { -// item: context_menu_orientation "horizontal"; + group { name: "elm/entry/selection/default"; + parts { + part { name: "bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 128 128 128 128; + } + } } + } + + group { name: "elm/entry/anchor/default"; parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: EXPLICIT; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - // source2: "X"; // selection over - // source3: "X"; // cursor under - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - // source6: "X"; // anchor over - description { state: "default" 0.0; - /* we gotta use 0 0 here, because of scrolled entries */ - fixed: 0 0; - text { - style: "entry_textblock_style"; - min: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } + part { name: "bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 128 0 0 64; + } + } } } - group { name: "elm/entry/base-charwrap/default"; - styles - { - style { name: "entry_textblock_style_charwrap"; - base: "font=Sans font_size=10 color=#000 wrap=char text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Sans:style=Oblique"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Sans:style=Bold"; - } - style { name: "entry_textblock_disabled_style_charwrap"; - base: "font=Sans font_size=10 color=#00000080 wrap=char text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Sans:style=Oblique"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Sans:style=Bold"; - } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/bubble/top_left/default"; + alias: "elm/bubble/base/default"; + images { + image: "bubble_3.png" COMP; + image: "bubble_shine3.png" COMP; + } + parts { + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + align: 0.0 0.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + to_y: "elm.text"; + relative: 0.0 1.0; + offset: 4 -1; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: EXPLICIT; - multiline: 1; - source: "elm/entry/selection/default"; // selection under -// source2: "X"; // selection over -// source3: "X"; // cursor under - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under -// source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_style_charwrap"; - min: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style_charwrap"; - min: 0 1; - } - } - } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "elm.info"; + relative: 0.0 0.0; + offset: -5 4; + } + color: 0 0 0 255; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 0 1; + max: 0 1; + align: 0.0 0.0; + } + } } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } + part { name: "elm.info"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 1.0 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 0.0; + offset: -5 4; + } + color: 0 0 0 64; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + max: 1 1; + align: 1.0 0.0; + } + } } - } - - group { name: "elm/entry/base-nowrap/default"; - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: EXPLICIT; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_textblock_style"; - min: 1 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - min: 0 1; - } - } - } -/* - part { name: "sel"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - max: 16 16; - aspect: 1.0 1.0; - color: 255 0 0 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 0 0 50; - } - } - */ + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; + offset: 0 0; + } + image { + normal: "bubble_3.png"; + border: 36 11 18 9; + } + image.middle: SOLID; + fill.smooth: 0; + } } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } -/* - program { name: "selmode0"; - signal: "elm,state,select,on"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "sel"; - } - program { name: "selmode1"; - signal: "elm,state,select,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sel"; - } - */ + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 9 16; + } + rel2 { + to: "base0"; + offset: -10 -9; + } + } } - } - - group { name: "elm/entry/base-single/default"; - styles - { - style { name: "entry_single_textblock_style"; - base: "font=Sans font_size=10 color=#000 wrap=none text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Sans:style=Oblique"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Sans:style=Bold"; - } - style { name: "entry_single_textblock_disabled_style"; - base: "font=Sans font_size=10 color=#00000080 wrap=none text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Sans:style=Oblique"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Sans:style=Bold"; - } + part { name: "shine"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 5 4; + } + rel2 { + to: "base0"; + relative: 1.0 0.5; + offset: -6 7; + } + image { + normal: "bubble_shine3.png"; + border: 36 5 14 0; + } + fill.smooth: 0; + } } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: EXPLICIT; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } + } + programs { + program { + name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.icon"; } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } + program { + name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.icon"; } - } + } + } - group { name: "elm/entry/base-single-noedit/default"; - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: EXPLICIT; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } + group { name: "elm/bubble/top_right/default"; + images { + image: "bubble_4.png" COMP; + image: "bubble_shine4.png" COMP; + } + parts { + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + align: 1.0 0.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + to_y: "elm.text"; + relative: 1.0 1.0; + offset: -5 -1; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 0 1; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "elm.info"; + relative: 0.0 0.0; + offset: -5 4; + } + color: 0 0 0 255; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 0 1; + max: 0 1; + align: 0.0 0.0; + } + } } - } - - group { name: "elm/entry/base-noedit/default"; - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: EXPLICIT; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_style"; - min: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } + part { name: "elm.info"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 1.0 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + to_x: "elm.swallow.icon"; + relative: 0.0 0.0; + offset: -5 4; + } + color: 0 0 0 64; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + max: 1 1; + align: 1.0 0.0; + } + } } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; + offset: 0 0; + } + image { + normal: "bubble_4.png"; + border: 11 36 18 9; + } + image.middle: SOLID; + fill.smooth: 0; + } } - } - - group { name: "elm/entry/base-noedit-charwrap/default"; - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: EXPLICIT; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_style_charwrap"; - min: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style_charwrap"; - } - } - } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 9 16; + } + rel2 { + to: "base0"; + offset: -10 -9; + } + } } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } + part { name: "shine"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base0"; + offset: 5 4; + } + rel2 { + to: "base0"; + relative: 1.0 0.5; + offset: -6 7; + } + image { + normal: "bubble_shine4.png"; + border: 5 36 14 0; + } + fill.smooth: 0; + } } - } - - group { name: "elm/entry/base-nowrap-noedit/default"; - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: EXPLICIT; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_textblock_style"; - min: 1 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/base-password/default"; - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PASSWORD; - select_mode: EXPLICIT; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_style"; - repch: "*"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/custom-password/default"; - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PASSWORD_SHOW_LAST_CHARACTER; - select_mode: EXPLICIT; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_style"; - repch: "*"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "password_stop"; - signal: "cursor,changed"; - source: "elm.text"; - action: ACTION_STOP; - target: "password_start"; - after: "password_start"; - } - program { name: "password_start"; - in: 2.0 0.0; - action: HIDE_VISIBLE_PASSWORD; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/cursor/default"; - images { - image: "cur_box.png" COMP; - image: "cur_hi.png" COMP; - image: "cur_shad.png" COMP; - image: "cur_shine.png" COMP; - image: "cur_glow.png" COMP; - } - parts { - part { name: "clip2"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "clip"; - rel2.to: "clip"; - visible: 0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "clip"; - type: RECT; - mouse_events: 0; - clip_to: "clip2"; - description { state: "default" 0.0; - rel1.offset: -10 0; - rel2.offset: 9 9; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "bg"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - rel1.to: "base"; - rel1.offset: -2 0; - rel2.to: "base"; - rel2.offset: 1 1; - image.border: 2 2 2 2; - image.normal: "cur_shad.png"; - } - } - part { name: "base"; - mouse_events: 0; - scale: 1; - clip_to: "clip"; - description { state: "default" 0.0; - min: 2 2; - align: 0.5 1.0; - rel1.relative: 0.0 1.0; - rel1.offset: 0 -1; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -1; - image.normal: "cur_box.png"; - } - } - part { name: "hi"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - rel2.relative: 1.0 0.5; - image.normal: "cur_hi.png"; - } - } - part { name: "shine"; - mouse_events: 0; - clip_to: "clip"; - clip_to: "clip2"; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - rel2.relative: 1.0 0.75; - image.border: 2 2 1 0; - image.normal: "cur_shine.png"; - fill.smooth: 0; - } - } - part { name: "glow"; - mouse_events: 0; - clip_to: "clip2"; - description { state: "default" 0.0; - rel1.to: "base"; - rel1.relative: 0.0 -2.0; - rel1.offset: -2 0; - rel2.to: "base"; - rel2.relative: 1.0 0.0; - rel2.offset: 1 1; - image.border: 2 2 0 4; - image.normal: "cur_glow.png"; - fill.smooth: 0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - } - } - } - programs { - program { name: "show"; - signal: "show"; - source: ""; - action: STATE_SET "hidden" 0.0; - in: 1.0 0.0; - transition: DECELERATE 2.0; - target: "glow"; - after: "show2"; - } - program { name: "show2"; - action: STATE_SET "hidden" 0.0; - in: 0.2 0.0; - target: "clip"; - after: "show3"; - } - program { name: "show3"; - action: STATE_SET "default" 0.0; - in: 0.5 0.0; - target: "clip"; - after: "show4"; - } - program { name: "show4"; - action: STATE_SET "default" 0.0; - in: 0.5 0.0; - transition: DECELERATE 0.5; - target: "glow"; - after: "show"; - } - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "focused" 0.0; - target: "clip2"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "clip2"; - } - } - } - - group { name: "elm/entry/selection/default"; - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 128 128 128 128; - } - } + } + programs { + program { + name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.icon"; } - } - - group { name: "elm/entry/anchor/default"; - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 128 0 0 64; - } - } + program { + name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.icon"; } - } + } + } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/bubble/top_left/default"; - alias: "elm/bubble/base/default"; + group { name: "elm/bubble/bottom_left/default"; images { - image: "bubble_3.png" COMP; - image: "bubble_shine3.png" COMP; + image: "bubble_1.png" COMP; + image: "bubble_shine.png" COMP; } parts { - part { name: "event"; - type: RECT; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } part { name: "elm.swallow.icon"; type: SWALLOW; description { state: "default" 0.0; fixed: 1 1; visible: 0; - align: 0.0 0.0; + align: 0.0 1.0; aspect: 1.0 1.0; aspect_preference: VERTICAL; rel1 { + to_y: "elm.text"; relative: 0.0 0.0; - offset: 4 4; + offset: 4 0; } rel2 { - to_y: "elm.text"; relative: 0.0 1.0; - offset: 4 -1; + offset: 4 -5; } } description { state: "visible" 0.0; @@ -9367,17 +6872,17 @@ collections { mouse_events: 0; scale: 1; description { state: "default" 0.0; - align: 0.0 0.0; + align: 0.0 1.0; fixed: 0 1; rel1 { to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 4 4; + relative: 1.0 1.0; + offset: 4 -5; } rel2 { to_x: "elm.info"; - relative: 0.0 0.0; - offset: -5 4; + relative: 0.0 1.0; + offset: -5 -5; } color: 0 0 0 255; text { @@ -9385,7 +6890,7 @@ collections { size: 10; min: 0 1; max: 0 1; - align: 0.0 0.0; + align: 0.0 1.0; } } } @@ -9394,170 +6899,15 @@ collections { mouse_events: 0; scale: 1; description { state: "default" 0.0; - align: 1.0 0.0; - fixed: 1 1; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 0.0; - offset: -5 4; - } - color: 0 0 0 64; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 1 1; - max: 1 1; - align: 1.0 0.0; - } - } - } - part { name: "base0"; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to_y: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 0 0; - } - image { - normal: "bubble_3.png"; - border: 36 11 18 9; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 9 16; - } - rel2 { - to: "base0"; - offset: -10 -9; - } - } - } - part { name: "shine"; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 5 4; - } - rel2 { - to: "base0"; - relative: 1.0 0.5; - offset: -6 7; - } - image { - normal: "bubble_shine3.png"; - border: 36 5 14 0; - } - fill.smooth: 0; - } - } - } - programs { - program { - name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { - name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - } - } - - group { name: "elm/bubble/top_right/default"; - images { - image: "bubble_4.png" COMP; - image: "bubble_shine4.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; + align: 1.0 1.0; fixed: 1 1; - visible: 0; - align: 1.0 0.0; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - to_y: "elm.text"; relative: 1.0 1.0; - offset: -5 -1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 0 1; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "elm.info"; - relative: 0.0 0.0; - offset: -5 4; - } - color: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 0 1; - max: 0 1; - align: 0.0 0.0; - } - } - } - part { name: "elm.info"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 1.0 0.0; - fixed: 1 1; - rel1 { - relative: 1.0 0.0; - offset: -5 4; + offset: -5 -5; } rel2 { - to_x: "elm.swallow.icon"; - relative: 0.0 0.0; - offset: -5 4; + relative: 1.0 1.0; + offset: -5 -5; } color: 0 0 0 64; text { @@ -9565,21 +6915,21 @@ collections { size: 10; min: 1 1; max: 1 1; - align: 1.0 0.0; + align: 1.0 1.0; } } } part { name: "base0"; mouse_events: 0; description { state: "default" 0.0; - rel1 { + rel2 { to_y: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 0 0; + relative: 1.0 0.0; + offset: -1 -1; } image { - normal: "bubble_4.png"; - border: 11 36 18 9; + normal: "bubble_1.png"; + border: 36 11 10 19; } image.middle: SOLID; fill.smooth: 0; @@ -9590,11 +6940,11 @@ collections { description { state: "default" 0.0; rel1 { to: "base0"; - offset: 9 16; + offset: 9 8; } rel2 { to: "base0"; - offset: -10 -9; + offset: -10 -17; } } } @@ -9608,11 +6958,11 @@ collections { rel2 { to: "base0"; relative: 1.0 0.5; - offset: -6 7; + offset: -6 -16; } image { - normal: "bubble_shine4.png"; - border: 5 36 14 0; + normal: "bubble_shine.png"; + border: 5 5 5 0; } fill.smooth: 0; } @@ -9636,35 +6986,28 @@ collections { } } - group { name: "elm/bubble/bottom_left/default"; + group { name: "elm/bubble/bottom_right/default"; images { - image: "bubble_1.png" COMP; + image: "bubble_2.png" COMP; image: "bubble_shine.png" COMP; } parts { - part { name: "event"; - type: RECT; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } part { name: "elm.swallow.icon"; type: SWALLOW; description { state: "default" 0.0; fixed: 1 1; - visible: 0; - align: 0.0 1.0; + visible: 0.0; + align: 1.0 1.0; aspect: 1.0 1.0; aspect_preference: VERTICAL; rel1 { to_y: "elm.text"; - relative: 0.0 0.0; - offset: 4 0; + relative: 1.0 0.0; + offset: -5 0; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + relative: 1.0 1.0; + offset: -5 -5; } } description { state: "visible" 0.0; @@ -9680,8 +7023,7 @@ collections { align: 0.0 1.0; fixed: 0 1; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 1.0; + relative: 0.0 1.0; offset: 4 -5; } rel2 { @@ -9711,7 +7053,8 @@ collections { offset: -5 -5; } rel2 { - relative: 1.0 1.0; + to_x: "elm.swallow.icon"; + relative: 0.0 1.0; offset: -5 -5; } color: 0 0 0 64; @@ -9733,8 +7076,8 @@ collections { offset: -1 -1; } image { - normal: "bubble_1.png"; - border: 36 11 10 19; + normal: "bubble_2.png"; + border: 11 36 10 19; } image.middle: SOLID; fill.smooth: 0; @@ -9791,168 +7134,13 @@ collections { } } - group { name: "elm/bubble/bottom_right/default"; - images { - image: "bubble_2.png" COMP; - image: "bubble_shine.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0.0; - align: 1.0 1.0; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - to_y: "elm.text"; - relative: 1.0 0.0; - offset: -5 0; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.0 1.0; - fixed: 0 1; - rel1 { - relative: 0.0 1.0; - offset: 4 -5; - } - rel2 { - to_x: "elm.info"; - relative: 0.0 1.0; - offset: -5 -5; - } - color: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 0 1; - max: 0 1; - align: 0.0 1.0; - } - } - } - part { name: "elm.info"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 1.0 1.0; - fixed: 1 1; - rel1 { - relative: 1.0 1.0; - offset: -5 -5; - } - rel2 { - to_x: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: -5 -5; - } - color: 0 0 0 64; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 1 1; - max: 1 1; - align: 1.0 1.0; - } - } - } - part { name: "base0"; - mouse_events: 0; - description { state: "default" 0.0; - rel2 { - to_y: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: -1 -1; - } - image { - normal: "bubble_2.png"; - border: 11 36 10 19; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 9 8; - } - rel2 { - to: "base0"; - offset: -10 -17; - } - } - } - part { name: "shine"; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 5 4; - } - rel2 { - to: "base0"; - relative: 1.0 0.5; - offset: -6 -16; - } - image { - normal: "bubble_shine.png"; - border: 5 5 5 0; - } - fill.smooth: 0; - } - } - } - programs { - program { - name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { - name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/photo/base/default"; - images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; - image: "head.png" COMP; +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/photo/base/default"; + images { + image: "frame_1.png" COMP; + image: "frame_2.png" COMP; + image: "dia_grad.png" COMP; + image: "head.png" COMP; } parts { part { name: "base0"; @@ -10063,7 +7251,7 @@ collections { rel1.to: "size"; rel2.to: "size"; rel1.relative: -0.06 -0.06; - rel2.relative: 1.07 1.07; + rel2.relative: 1.07 1.07; image.normal: "shadow.png"; } } @@ -10216,185 +7404,60 @@ collections { } } - group { name: "elm/thumb/base/noframe"; - images { - image: "busy-1.png" COMP; - image: "busy-2.png" COMP; - image: "busy-3.png" COMP; - image: "busy-4.png" COMP; - image: "busy-5.png" COMP; - image: "busy-6.png" COMP; - image: "busy-7.png" COMP; - image: "busy-8.png" COMP; - image: "busy-9.png" COMP; - } - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - } - } - part { name: "progress"; - mouse_events: 0; - description { state: "default" 0.0; - min: 32 32; - max: 32 32; - visible: 0; - aspect: 1.0 1.0; - aspect_preference: BOTH; - } - description { state: "pulse" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: "busy-9.png"; - tween: "busy-1.png"; - tween: "busy-2.png"; - tween: "busy-3.png"; - tween: "busy-4.png"; - tween: "busy-5.png"; - tween: "busy-6.png"; - tween: "busy-7.png"; - tween: "busy-8.png"; - border: 7 7 7 7; - } - } - } - programs { - program { name: "start_pulse"; - signal: "elm,state,pulse,start"; - source: "elm"; - action: STATE_SET "pulse" 0.0; - target: "progress"; - transition: LINEAR 0.5; - after: "start_pulse"; - } - program { name: "stop_pulse"; - signal: "elm,state,pulse,stop"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "progress"; - } - } - } - } - - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/icon/home/default"; alias: "elm/icon/toolbar/home/default"; min: 32 32; - images.image: "icon_home.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_home.png"; } } } } - group { name: "elm/icon/close/default"; alias: "elm/icon/toolbar/close/default"; min: 32 32; - images.image: "icon_close.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_close.png"; } } } } - group { name: "elm/icon/apps/default"; alias: "elm/icon/toolbar/apps/default"; min: 32 32; - images.image: "icon_apps.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_apps.png"; } } } } - group { name: "elm/icon/arrow_up/default"; alias: "elm/icon/toolbar/arrow_up/default"; min: 32 32; - images.image: "icon_arrow_up.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_arrow_up.png"; } } } } - group { name: "elm/icon/arrow_down/default"; - alias: "elm/icon/toolbar/arrow_down/default"; - alias: "elm/icon/toolbar/more_menu/default"; min: 32 32; - images.image: "icon_arrow_down.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_arrow_down.png"; } } } } - group { name: "elm/icon/arrow_left/default"; alias: "elm/icon/toolbar/arrow_left/default"; min: 32 32; - images.image: "icon_arrow_left.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_arrow_left.png"; } } } } - group { name: "elm/icon/arrow_right/default"; alias: "elm/icon/toolbar/arrow_right/default"; min: 32 32; - images.image: "icon_arrow_right.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_arrow_right.png"; } } } } - group { name: "elm/icon/chat/default"; alias: "elm/icon/toolbar/chat/default"; min: 32 32; - images.image: "icon_chat.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_chat.png"; } } } } - group { name: "elm/icon/clock/default"; alias: "elm/icon/toolbar/clock/default"; min: 32 32; - images.image: "icon_clock.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_clock.png"; } } } } - group { name: "elm/icon/delete/default"; alias: "elm/icon/toolbar/delete/default"; min: 32 32; - images.image: "icon_delete.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_delete.png"; } } } } - group { name: "elm/icon/edit/default"; alias: "elm/icon/toolbar/edit/default"; min: 32 32; - images.image: "icon_edit.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_edit.png"; } } } } - group { name: "elm/icon/refresh/default"; alias: "elm/icon/toolbar/refresh/default"; min: 32 32; - images.image: "icon_refresh.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_refresh.png"; } } } } - group { name: "elm/icon/folder/default"; alias: "elm/icon/toolbar/folder/default"; min: 32 32; - images.image: "icon_folder.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_folder.png"; } } } } - group { name: "elm/icon/file/default"; alias: "elm/icon/toolbar/file/default"; min: 32 32; - images.image: "icon_file.png" COMP; parts { part { name: "base"; - description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; - image.normal: "icon_file.png"; } } } } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/icon/menu/home/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/home/default"; min: 32 32; images.image: "icon_home.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_home.png"; } } } } - group { name: "elm/icon/menu/close/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/close/default"; min: 32 32; images.image: "icon_close.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_close.png"; } } } } - group { name: "elm/icon/menu/apps/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/apps/default"; min: 32 32; images.image: "icon_apps.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_apps.png"; } } } } - group { name: "elm/icon/menu/arrow_up/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/arrow_up/default"; min: 32 32; images.image: "icon_arrow_up.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_arrow_up.png"; } } } } - group { name: "elm/icon/menu/arrow_down/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/arrow_down/default"; min: 32 32; images.image: "icon_arrow_down.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_arrow_down.png"; } } } } - group { name: "elm/icon/menu/arrow_left/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/arrow_left/default"; min: 32 32; images.image: "icon_arrow_left.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_arrow_left.png"; } } } } - group { name: "elm/icon/menu/arrow_right/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/arrow_right/default"; min: 32 32; images.image: "icon_arrow_right.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_arrow_right.png"; } } } } - group { name: "elm/icon/menu/chat/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/chat/default"; min: 32 32; images.image: "icon_chat.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_chat.png"; } } } } - group { name: "elm/icon/menu/clock/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/clock/default"; min: 32 32; images.image: "icon_clock.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_clock.png"; } } } } - group { name: "elm/icon/menu/delete/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/delete/default"; min: 32 32; images.image: "icon_delete.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_delete.png"; } } } } - group { name: "elm/icon/menu/edit/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/edit/default"; min: 32 32; images.image: "icon_edit.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_edit.png"; } } } } - group { name: "elm/icon/menu/refresh/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/refresh/default"; min: 32 32; images.image: "icon_refresh.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_refresh.png"; } } } } - group { name: "elm/icon/menu/folder/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/folder/default"; min: 32 32; images.image: "icon_folder.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_folder.png"; } } } } - group { name: "elm/icon/menu/file/default"; min: 24 24; max: 24 24; + group { name: "elm/icon/file/default"; min: 32 32; images.image: "icon_file.png" COMP; parts { part { name: "base"; description { state: "default" 0.0; aspect: 1.0 1.0; aspect_preference: BOTH; image.normal: "icon_file.png"; } } } } @@ -10537,13 +7600,11 @@ collections { images { image: "toolbar_sel.png" COMP; } - data.item: "transition_animation_on" "1"; parts { part { name: "label2"; type: TEXT; mouse_events: 0; scale: 1; - clip_to: "elm.text.clipper"; description { state: "default" 0.0; align: 0.5 1.0; fixed: 0 1; @@ -10556,44 +7617,6 @@ collections { size: 10; min: 1 1; align: 0.5 0.5; - text_class: "toolbar_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; - } - } - part { name: "label2_new"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "elm.text_new.clipper"; - description { state: "default" 0.0; - align: 0.5 1.0; - fixed: 0 1; - rel1.to: "elm.text_new"; - rel2.to: "elm.text_new"; - color: 0 0 0 255; - text { - font: "Sans"; - text_source: "elm.text_new"; - size: 10; - min: 1 1; - align: 0.5 0.5; - text_class: "toolbar_item"; } } description { state: "selected" 0.0; @@ -10638,10 +7661,11 @@ collections { } part { name: "elm.swallow.icon"; type: SWALLOW; - clip_to: "elm.icon.clipper"; description { state: "default" 0.0; align: 0.5 0.5; fixed: 0 0; + //aspect: 1.0 1.0; + //aspect_preference: VERTICAL; rel1 { relative: 0.0 0.0; offset: 2 2; @@ -10654,80 +7678,11 @@ collections { color: 0 0 0 0; } } - part { name: "elm.swallow.icon_new"; - type: SWALLOW; - clip_to: "elm.icon_new.clipper"; - description { state: "default" 0.0; - align: 0.5 0.5; - fixed: 0 0; - rel1 { - relative: 0.0 0.0; - offset: 2 2; - } - rel2 { - to_y: "elm.text_new"; - relative: 1.0 0.0; - offset: -3 -1; - } - color: 0 0 0 0; - } - } part { name: "elm.text"; type: TEXT; effect: SOFT_SHADOW; mouse_events: 0; scale: 1; - clip_to: "elm.text.clipper"; - description { state: "default" 0.0; - align: 0.5 1.0; - fixed: 0 1; - rel1 { - relative: 0.0 1.0; - offset: 0 -1; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - visible: 0; - color: 224 224 224 255; - color3: 0 0 0 32; - text { - font: "Sans:style=Bold"; - size: 10; - min: 1 1; - align: 0.5 0.5; - text_class: "toolbar_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; - } - } - part { name: "elm.text_new"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - clip_to: "elm.text_new.clipper"; - scale: 1; description { state: "default" 0.0; align: 0.5 1.0; fixed: 0 1; @@ -10747,7 +7702,6 @@ collections { size: 10; min: 1 1; align: 0.5 0.5; - text_class: "toolbar_item"; } } description { state: "selected" 0.0; @@ -10772,42 +7726,6 @@ collections { text.min: 1 1; } } - part { name: "elm.text.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "animation" 0.0; - color: 255 255 255 0; - } - } - part { name: "elm.text_new.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - description { state: "animation" 0.0; - color: 255 255 255 255; - } - } - part { name: "elm.icon.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "animation" 0.0; - color: 255 255 255 0; - } - } - part { name: "elm.icon_new.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - description { state: "animation" 0.0; - color: 255 255 255 255; - } - } part { name: "event"; type: RECT; mouse_events: 1; @@ -10825,8 +7743,6 @@ collections { target: "bg"; target: "elm.text"; target: "label2"; - target: "elm.text_new"; - target: "label2_new"; transition: LINEAR 0.2; } program { name: "go_passive"; @@ -10836,8 +7752,6 @@ collections { target: "bg"; target: "elm.text"; target: "label2"; - target: "elm.text_new"; - target: "label2_new"; transition: LINEAR 0.1; } program { name: "go"; @@ -10845,22 +7759,11 @@ collections { source: "event"; action: SIGNAL_EMIT "elm,action,click" "elm"; } - program { name: "mouse,in"; - signal: "mouse,in"; - source: "event"; - action: SIGNAL_EMIT "elm,mouse,in" "elm"; - } - program { name: "mouse,out"; - signal: "mouse,out"; - source: "event"; - action: SIGNAL_EMIT "elm,mouse,out" "elm"; - } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "label2"; - target: "label2_new"; target: "bg"; after: "disable_text"; } @@ -10870,15 +7773,9 @@ collections { new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) - { - set_state(PART:"elm.text", "disabled_visible", 0.0); - set_state(PART:"elm.text_new", "disabled_visible", 0.0); - } + set_state(PART:"elm.text", "disabled_visible", 0.0); else - { - set_state(PART:"elm.text", "disabled", 0.0); - set_state(PART:"elm.text_new", "disabled", 0.0); - } + set_state(PART:"elm.text", "disabled", 0.0); } } program { name: "enable"; @@ -10886,7 +7783,6 @@ collections { source: "elm"; action: STATE_SET "default" 0.0; target: "label2"; - target: "label2_new"; target: "bg"; after: "enable_text"; } @@ -10896,74 +7792,10 @@ collections { new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "disabled_visible")) - { - set_state(PART:"elm.text", "visible", 0.0); - set_state(PART:"elm.text_new", "visible", 0.0); - } + set_state(PART:"elm.text", "visible", 0.0); else - { - set_state(PART:"elm.text", "default", 0.0); - set_state(PART:"elm.text_new", "default", 0.0); - } - } - } - program { name: "label_set,animation,forward"; - signal: "elm,state,label_set,forward"; - source: "elm"; - after: "label_set,animation"; - } - program { name: "label_set,animation,backward"; - signal: "elm,state,label_set,backward"; - source: "elm"; - after: "label_set,animation"; - } - program { name: "label_set,animation"; - signal: "elm,state,label_set"; - source: "elm"; - action: STATE_SET "animation" 0.0; - target: "elm.text.clipper"; - target: "elm.text_new.clipper"; - transition: LINEAR 0.2; - after: "label_set,animation,done"; - } - program { name: "label_set,animation,done"; - action: SIGNAL_EMIT "elm,state,label_set,done" "elm"; - } - program { name: "label,reset"; - signal: "elm,state,label,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text.clipper"; - target: "elm.text_new.clipper"; - } - program { name: "icon_set,animation,forward"; - signal: "elm,state,icon_set,forward"; - source: "elm"; - after: "icon_set,animation"; - } - program { name: "icon_set,animation,backward"; - signal: "elm,state,icon_set,backward"; - source: "elm"; - after: "icon_set,animation"; - } - program { name: "icon_set,animation"; - signal: "elm,state,icon_set"; - source: "elm"; - action: STATE_SET "animation" 0.0; - target: "elm.icon.clipper"; - target: "elm.icon_new.clipper"; - transition: LINEAR 0.2; - after: "icon_set,animation,done"; - } - program { name: "icon_set,animation,done"; - action: SIGNAL_EMIT "elm,state,icon_set,done" "elm"; - } - program { name: "icon,reset"; - signal: "elm,state,icon,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.icon.clipper"; - target: "elm.icon_new.clipper"; + set_state(PART:"elm.text", "default", 0.0); + } } } } @@ -12494,7 +9326,7 @@ collections { /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////// group { name: "elm/list/item/default"; data.item: "stacking" "above"; images { @@ -12639,7 +9471,6 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -12833,7 +9664,6 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -12916,15 +9746,6 @@ collections { } parts { part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "base_sh"; mouse_events: 0; description { state: "default" 0.0; @@ -13048,7 +9869,6 @@ collections { // min: 1 1; min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -13094,6 +9914,15 @@ collections { color: 255 255 255 255; } } + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } } programs { program { @@ -13130,15 +9959,6 @@ collections { } parts { part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "base"; mouse_events: 0; description { @@ -13240,7 +10060,6 @@ collections { // min: 1 1; min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -13286,6 +10105,15 @@ collections { color: 255 255 255 255; } } + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } } programs { program { @@ -13313,1087 +10141,984 @@ collections { } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/list/h_item/default"; - data.item: "stacking" "above"; + group { name: "elm/slider/horizontal/default"; images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1_h.png" COMP; - image: "ilist_item_shadow_h.png" COMP; + image: "sl_bg.png" COMP; + image: "sl_bg_over.png" COMP; + image: "sl_bt_0.png" COMP; + image: "sl_bt_1.png" COMP; + image: "sl_bt_2.png" COMP; + image: "sl_bt2_0_0.png" COMP; + image: "sl_bt2_0_1.png" COMP; + image: "sl_bt2_0_2.png" COMP; + image: "sl_bt2_1.png" COMP; + image: "sl_bt2_2.png" COMP; + image: "sl_units.png" COMP; } parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; + part { name: "base"; mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 10 0; - fixed: 1 1; - rel1 { - to: "base"; - relative: 1.0 0.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: 0 -1; + description { state: "default" 0.0; + max: 99999 6; + min: 0 6; + rel1 { to: "bg"; + offset: 1 0; } - image { - normal: "ilist_item_shadow_h.png"; + rel2 { to: "bg"; + offset: -2 -1; } + image.normal: "sl_bg.png"; fill.smooth: 0; } } - part { - name: "base"; + part { name: "level"; + type: RECT; mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1_h.png"; - border: 2 2 2 2; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "base"; + rel2 { + to_y: "base"; + to_x: "elm.dragable.slider"; + relative: 0.5 1.0; } - fill.smooth: 0; + color: 255 0 0 200; + } + description { state: "inverted" 0.0; + inherit: "default" 0.0; + visible: 0; } } - part { name: "bg"; + part { name: "level2"; + type: RECT; mouse_events: 0; description { state: "default" 0.0; + fixed: 1 1; visible: 0; - color: 255 255 255 0; rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + to_y: "base"; + to_x: "elm.dragable.slider"; + relative: 0.5 0.0; } - image.middle: SOLID; + rel2.to: "base"; + color: 255 0 0 200; } - description { state: "selected" 0.0; + description { state: "inverted" 0.0; inherit: "default" 0.0; visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } } } - part { name: "elm.swallow.icon"; - type: SWALLOW; + part { + name: "base_over"; + mouse_events: 0; description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 0.0; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 0.0; - offset: -5 4; + rel1.to: "base"; + rel1.offset: -1 -1; + rel2.to: "base"; + rel2.offset: 0 0; + image { + normal: "sl_bg_over.png"; + border: 3 3 3 3; } + fill.smooth: 0; } } - part { name: "elm.swallow.end"; - type: SWALLOW; + part { name: "bg"; + type: RECT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + rel1.to: "elm.swallow.bar"; + rel2.to: "elm.swallow.bar"; + color: 0 0 0 0; + } + } + part { name: "elm.swallow.bar"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: 48 24; + max: 99999 24; + align: 1.0 0.5; + rel1 { + to_x: "elm.text"; + relative: 1.0 0.0; + offset: 8 0; + } + rel2 { + to_x: "elm.units"; + relative: 0.0 1.0; + offset: -10 -1; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 0; + align: 0.0 0.5; + rel1 { + offset: 4 0; + to_y: "elm.swallow.bar"; + } + rel2 { + offset: 3 -1; + relative: 0.0 1.0; + to_y: "elm.swallow.bar"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 4 -1; + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + fixed: 1 1; + align: 0.0 0.5; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: -1 4; + rel2.to_x: "elm.swallow.content"; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -5; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + rel1.offset: 0 4; + rel2.offset: 0 -5; + } + } + part { name: "units"; + mouse_events: 0; description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 1.0; + visible: 0; rel1 { - relative: 0.0 1.0; - offset: 4 -5; + to_x: "elm.units"; + offset: 0 5; } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + image { + normal: "sl_units.png"; + border: 0 5 3 8; } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; + part { name: "elm.units"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + fixed: 1 1; + align: 1.0 0.5; + rel1.relative: 1.0 0.0; + rel1.offset: 0 8; + rel2.relative: 1.0 1.0; + rel2.offset: 0 -9; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 1 1; + visible: 1; + text.min: 1 1; + rel1.offset: -5 0; + rel2.offset: -5 -1; + } + } + part { name: "elm.dragable.slider"; + type: RECT; mouse_events: 0; scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; + dragable { + x: 1 1 0; + y: 0 0 0; + confine: "bg"; + } + description { state: "default" 0.0; + min: 0 24; + max: 0 24; + fixed: 1 1; rel1 { - to_x: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 4 4; + relative: 0.5 0.0; + to_x: "bg"; } rel2 { - to_x: "elm.swallow.end"; - relative: 1.0 0.0; - offset: -5 -1; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; - align: 0.5 0.5; - text_class: "list_item"; + relative: 0.5 1.0; + to_x: "bg"; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + color: 255 0 0 100; } } - part { name: "fg1"; + part { name: "button_events"; + type: RECT; + dragable { + events: "elm.dragable.slider"; + } + mouse_events: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 16 16; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1.to_x: "elm.dragable.slider"; + rel2.to_x: "elm.dragable.slider"; + color: 0 0 0 0; + } + } + part { name: "button0"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; + fixed: 1 1; + max: 17 999; + min: 17 24; + rel1.to: "elm.dragable.slider"; + rel2.to: "elm.dragable.slider"; image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + normal: "sl_bt_0.png"; + border: 5 5 5 10; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + fill.smooth: 0; } } - part { name: "fg2"; + part { name: "button1"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; + rel1.to: "button0"; + rel2 { + to: "button0"; + relative: 1.0 0.5; + offset: -1 -5; + } image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + normal: "sl_bt_1.png"; + border: 5 5 5 0; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; + part { name: "button2"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "button0"; + rel2.to: "button0"; + image { + normal: "sl_bt_2.png"; + border: 5 5 5 10; + } + fill.smooth: 0; + } } - } - } - group { name: "elm/list/h_item_odd/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2_h.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2_h.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; + part { name: "button3"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; + fixed: 1 1; + visible: 0; + min: 8 32; + align: 1.0 0.5; rel1 { + to_x: "elm.indicator"; + to_y: "button4"; relative: 0.0 0.0; - offset: -5 -5; + offset: -7 0; } rel2 { - relative: 1.0 1.0; - offset: 4 4; + to: "button4"; + relative: 0.0 1.0; + offset: -1 -1; } image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + normal: "sl_bt2_0_0.png"; + border: 6 0 6 12; } - image.middle: SOLID; + fill.smooth: 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { - name: "elm.swallow.icon"; - type: SWALLOW; + part { name: "button4"; + mouse_events: 0; description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 0.0; + visible: 0; + max: 15 999; + min: 15 32; rel1 { - relative: 0.0 0.0; - offset: 4 4; + to_x: "button0"; + to_y: "elm.indicator"; + offset: 0 0; } - rel2 { - relative: 1.0 0.0; - offset: -5 4; + rel2.to: "button0"; + image { + normal: "sl_bt2_0_1.png"; + border: 0 0 6 12; } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { - name: "elm.swallow.end"; - type: SWALLOW; + part { name: "button5"; + mouse_events: 0; description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 1.0; + fixed: 1 1; + visible: 0; + min: 8 32; + align: 0.0 0.5; rel1 { - relative: 0.0 1.0; - offset: 4 -5; + to: "button4"; + relative: 1.0 0.0; + offset: 0 0; } rel2 { + to_x: "elm.indicator"; + to_y: "button4"; relative: 1.0 1.0; - offset: -5 -5; + offset: 6 -1; } + image { + normal: "sl_bt2_0_2.png"; + border: 0 6 6 12; + } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "elm.text"; - type: TEXT; + part { name: "elm.indicator"; + type: TEXT; + mouse_events: 0; effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; + scale: 1; + description { state: "default" 0.0; + visible: 0; fixed: 1 1; - rel1 { - to_x: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 4 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 1.0 0.0; - offset: -5 -1; + align: 0.5 1.0; + rel1 { + to: "button0"; + relative: 0.0 -0.25; + offset: 0 0; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; - align: 0.5 0.5; - text_class: "list_item"; + rel2 { + to_x: "button0"; + relative: 1.0 -0.25; + offset: -1 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; + color: 224 224 224 255; + color3: 0 0 0 64; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + rel1.offset: 0 -1; + rel2.offset: -1 -1; + } + } + part { name: "button6"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; + visible: 0; + rel1.to: "button3"; + rel2 { + to: "button5"; + relative: 1.0 0.3; + offset: -1 -1; + } image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + normal: "sl_bt2_1.png"; + border: 5 5 5 0; } + fill.smooth: 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "fg2"; + part { name: "button7"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; + visible: 0; + rel1.to: "button3"; + rel2.to: "button5"; image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + normal: "sl_bt2_2.png"; + border: 5 5 5 0; + middle: 0; } + fill.smooth: 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } } programs { - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - } - } - group { name: "elm/list/h_item_compress/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1_h.png" COMP; - image: "ilist_item_shadow_h.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.0 0.0; - min: 10 0; - rel1 { - to: "base"; - relative: 1.0 0.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: 0 -1; - } - image { - normal: "ilist_item_shadow_h.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1_h.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "units_show"; + signal: "elm,state,units,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.units"; + target: "units"; + } + program { name: "units_hide"; + signal: "elm,state,units,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.units"; + target: "units"; + } + program { name: "invert_on"; + signal: "elm,state,inverted,on"; + source: "elm"; + action: STATE_SET "inverted" 0.0; + target: "level"; + target: "level2"; + } + program { name: "invert_off"; + signal: "elm,state,inverted,off"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "level"; + target: "level2"; + } + program { name: "val_show"; + signal: "mouse,down,*"; + source: "elm.dragable.slider"; + action: STATE_SET "visible" 0.0; + target: "elm.indicator"; + target: "button3"; + target: "button4"; + target: "button5"; + target: "button6"; + target: "button7"; + } + program { name: "val_hide"; + signal: "mouse,up,*"; + source: "elm.dragable.slider"; + action: STATE_SET "default" 0.0; + target: "elm.indicator"; + target: "button3"; + target: "button4"; + target: "button5"; + target: "button6"; + target: "button7"; + } + } + } + + group { name: "elm/slider/vertical/default"; + images { + image: "slv_bg.png" COMP; + image: "slv_bg_over.png" COMP; + + image: "sl_bt_0.png" COMP; + image: "sl_bt_1.png" COMP; + image: "sl_bt_2.png" COMP; + image: "sl_bt2_0_0.png" COMP; + image: "sl_bt2_0_1.png" COMP; + image: "sl_bt2_0_2.png" COMP; + image: "sl_bt2_1.png" COMP; + image: "sl_bt2_2.png" COMP; + + image: "slv_units.png" COMP; + } + parts { + part { name: "base"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 0.0; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 0.0; - offset: -5 4; - } - } - } - part { name: "elm.swallow.end"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 1.0; - rel1 { - relative: 0.0 1.0; - offset: 4 -5; + max: 6 99999; + min: 6 0; + rel1 { to: "bg"; + offset: 1 0; } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + rel2 { to: "bg"; + offset: -2 -1; } + image.normal: "slv_bg.png"; + fill.smooth: 0; } } - part { - name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; + part { name: "level"; + type: RECT; mouse_events: 0; - scale: 1; description { state: "default" 0.0; fixed: 1 1; - rel1 { - to_x: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 4 4; - } + rel1.to: "base"; rel2 { - to_x: "elm.swallow.end"; - relative: 1.0 0.0; - offset: -5 -1; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; - align: 0.5 0.5; - text_class: "list_item"; + to_x: "base"; + to_y: "elm.dragable.slider"; + relative: 1.0 0.5; } + color: 255 0 0 200; } - description { state: "selected" 0.0; + description { state: "inverted" 0.0; inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + visible: 0; } } - part { name: "fg1"; + part { name: "level2"; + type: RECT; mouse_events: 0; description { state: "default" 0.0; + fixed: 1 1; visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + rel1 { + to_x: "base"; + to_y: "elm.dragable.slider"; + relative: 0.0 0.5; } + rel2.to: "base"; + color: 255 0 0 200; } - description { state: "selected" 0.0; + description { state: "inverted" 0.0; inherit: "default" 0.0; visible: 1; - color: 255 255 255 255; } } - part { name: "fg2"; + part { + name: "base_over"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; + rel1.to: "base"; + rel1.offset: -1 -1; + rel2.to: "base"; + rel2.offset: 0 0; image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + normal: "slv_bg_over.png"; + border: 3 3 3 3; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - } - } - group { name: "elm/list/h_item_compress_odd/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2_h.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2_h.png"; - border: 2 2 2 2; - } - fill.smooth: 0; + fill.smooth: 0; } } part { name: "bg"; + type: RECT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + rel1.to: "elm.swallow.bar"; + rel2.to: "elm.swallow.bar"; + color: 0 0 0 0; + } + } + part { name: "elm.swallow.bar"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: 24 48; + max: 24 9999; + align: 0.5 1.0; + rel1 { + to_y: "elm.text"; + relative: 0.0 1.0; + offset: 0 10; + } + rel2 { + to_y: "elm.units"; + relative: 1.0 0.0; + offset: -1 -8; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + rel1 { + offset: 0 4; + to_x: "elm.swallow.bar"; + } + rel2 { + offset: -1 3; + relative: 1.0 0.0; + to_x: "elm.swallow.bar"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + rel2.offset: -1 4; + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + fixed: 1 1; + align: 0.5 0.0; + rel1.to_y: "elm.swallow.content"; + rel1.relative: 0.5 1.0; + rel1.offset: 0 -1; + rel2.to_y: "elm.swallow.content"; + rel2.relative: 0.5 1.0; + rel2.offset: -1 -1; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + rel1.offset: 4 0; + rel2.offset: -5 0; + } + } + part { name: "units"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; + visible: 0; rel1 { - relative: 0.0 0.0; - offset: -5 -5; + to: "elm.units"; + offset: -8 0; } rel2 { - relative: 1.0 1.0; - offset: 4 4; + to: "elm.units"; + offset: 7 8; } image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + normal: "slv_units.png"; + border: 8 8 0 9; } - image.middle: SOLID; + fill.smooth: 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "elm.swallow.icon"; - type: SWALLOW; + part { name: "elm.units"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.0 1.0; + rel1.offset: 8 0; + rel2.relative: 1.0 1.0; + rel2.offset: -9 0; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 1 1; + visible: 1; + text.min: 1 1; + rel1.offset: 8 -9; + rel2.offset: -9 -9; + } + } + part { name: "elm.dragable.slider"; + type: RECT; + mouse_events: 0; + scale: 1; + dragable { + x: 0 0 0; + y: 1 1 0; + confine: "bg"; + } description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 0.0; + min: 24 0; + max: 24 0; + fixed: 1 1; rel1 { - relative: 0.0 0.0; - offset: 4 4; + relative: 0.5 0.0; + to_y: "bg"; } rel2 { - relative: 1.0 0.0; - offset: -5 4; + relative: 0.5 1.0; + to_y: "bg"; } + color: 0 0 0 0; } } - part { name: "elm.swallow.end"; - type: SWALLOW; + part { name: "button_events"; + type: RECT; + dragable { + events: "elm.dragable.slider"; + } + mouse_events: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 16 16; + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + rel1.to_y: "elm.dragable.slider"; + rel2.to_y: "elm.dragable.slider"; + color: 0 0 0 0; + } + } + part { name: "button0"; + mouse_events: 0; description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 1.0; - rel1 { - relative: 0.0 1.0; - offset: 4 -5; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + fixed: 1 1; + max: 17 999; + min: 17 24; + rel1.to: "elm.dragable.slider"; + rel2.to: "elm.dragable.slider"; + image { + normal: "sl_bt_0.png"; + border: 5 5 5 10; } + fill.smooth: 0; } } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; + part { name: "button1"; mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - fixed: 1 1; - rel1 { - to_x: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 4 4; - } + description { state: "default" 0.0; + rel1.to: "button0"; rel2 { - to_x: "elm.swallow.end"; - relative: 1.0 0.0; - offset: -5 -1; + to: "button0"; + relative: 1.0 0.5; + offset: -1 -5; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; - align: 0.5 0.5; - text_class: "list_item"; + image { + normal: "sl_bt_1.png"; + border: 5 5 5 0; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } } - part { name: "fg1"; + part { name: "button2"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; + rel1.to: "button0"; + rel2.to: "button0"; image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + normal: "sl_bt_2.png"; + border: 5 5 5 10; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + fill.smooth: 0; } } - part { name: "fg2"; + part { name: "button3"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + visible: 0; + min: 8 32; + align: 1.0 0.5; + rel1 { + to_x: "elm.indicator"; + to_y: "button4"; + relative: 0.0 0.0; + offset: -7 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/slider/horizontal/default"; - alias: "elm/slider/horizontal/disabled"; - images { - image: "sl_bg.png" COMP; - image: "sl_bg_over.png" COMP; - image: "sl_bt_0.png" COMP; - image: "sl_bt_1.png" COMP; - image: "sl_bt_2.png" COMP; - image: "sl_bt_3.png" COMP; - image: "sl_bt2_0_0.png" COMP; - image: "sl_bt2_0_1.png" COMP; - image: "sl_bt2_0_2.png" COMP; - image: "sl_bt2_1.png" COMP; - image: "sl_bt2_2.png" COMP; - image: "sl_units.png" COMP; - } - script { - public value_hide = 0; - public set_value_show() { - set_int(value_hide, 0); - } - public set_value_hide() { - set_int(value_hide, 1); - } - public thumb_down() { - if (get_int(value_hide) == 1) { - set_state(PART:"elm.indicator", "default", 0.0); - set_state(PART:"button3", "default", 0.0); - set_state(PART:"button4", "default", 0.0); - set_state(PART:"button5", "default", 0.0); - set_state(PART:"button6", "default", 0.0); - set_state(PART:"button7", "default", 0.0); - } else { - set_state(PART:"elm.indicator", "visible", 0.0); - set_state(PART:"button3", "visible", 0.0); - set_state(PART:"button4", "visible", 0.0); - set_state(PART:"button5", "visible", 0.0); - set_state(PART:"button6", "visible", 0.0); - set_state(PART:"button7", "visible", 0.0); - } - } - public thumb_up() { - set_state(PART:"elm.indicator", "default", 0.0); - set_state(PART:"button3", "default", 0.0); - set_state(PART:"button4", "default", 0.0); - set_state(PART:"button5", "default", 0.0); - set_state(PART:"button6", "default", 0.0); - set_state(PART:"button7", "default", 0.0); - } - } - parts { - part { name: "base"; - mouse_events: 0; - description { state: "default" 0.0; - max: 99999 6; - min: 0 6; - rel1 { to: "bg"; - offset: 1 0; + rel2 { + to: "button4"; + relative: 0.0 1.0; + offset: -1 -1; } - rel2 { to: "bg"; - offset: -2 -1; + image { + normal: "sl_bt2_0_0.png"; + border: 6 0 6 12; } - image.normal: "sl_bg.png"; fill.smooth: 0; } - } - part { name: "level"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - rel1.to: "base"; - rel2 { - to_y: "base"; - to_x: "elm.dragable.slider"; - relative: 0.5 1.0; - } - color: 255 0 0 200; - } - description { state: "inverted" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 0 0 100; - } - description { state: "disabled_inverted" 0.0; - inherit: "default" 0.0; - visible: 0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "level2"; - type: RECT; + part { name: "button4"; mouse_events: 0; description { state: "default" 0.0; + visible: 0; + max: 15 999; + min: 15 32; fixed: 1 1; - visible: 0; rel1 { - to_y: "base"; - to_x: "elm.dragable.slider"; - relative: 0.5 0.0; + to_x: "button0"; + to_y: "elm.indicator"; + offset: 0 -7; } - rel2.to: "base"; - color: 255 0 0 200; - } - description { state: "inverted" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + rel2.to: "button0"; + image { + normal: "sl_bt2_0_1.png"; + border: 0 0 6 12; + } + fill.smooth: 0; } - description { state: "disabled_inverted" 0.0; - inherit: "default" 0.0; - color: 255 0 0 100; - visible: 1; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { - name: "base_over"; + part { name: "button5"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "base"; - rel1.offset: -1 -1; - rel2.to: "base"; - rel2.offset: 0 0; + visible: 0; + min: 8 32; + align: 0.0 0.5; + rel1 { + to: "button4"; + relative: 1.0 0.0; + offset: 0 0; + } + rel2 { + to_x: "elm.indicator"; + to_y: "button4"; + relative: 1.0 1.0; + offset: 6 -1; + } image { - normal: "sl_bg_over.png"; - border: 3 3 3 3; + normal: "sl_bt2_0_2.png"; + border: 0 6 6 12; } fill.smooth: 0; } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } } - part { name: "bg"; - type: RECT; + part { name: "elm.indicator"; + type: TEXT; mouse_events: 0; + effect: SOFT_SHADOW; scale: 1; description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.bar"; - rel2.to: "elm.swallow.bar"; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.bar"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - min: 48 24; - max: 99999 24; - align: 1.0 0.5; - rel1 { - to_x: "elm.text"; - relative: 1.0 0.0; - offset: 8 0; - } - rel2 { - to_x: "elm.units"; - relative: 0.0 1.0; - offset: -10 -1; - } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; visible: 0; - align: 0.0 0.5; + fixed: 1 1; + align: 0.5 1.0; rel1 { - offset: 4 0; - to_y: "elm.swallow.bar"; + to: "button0"; + relative: 0.0 -1.0; + offset: 0 0; } rel2 { - offset: 3 -1; - relative: 0.0 1.0; - to_y: "elm.swallow.bar"; + to: "button0"; + relative: 1.0 -1.0; + offset: -1 0; } + color: 224 224 224 255; + color3: 0 0 0 64; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; + } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel2.offset: 4 -1; + text.min: 1 1; + rel1.offset: 0 -1; + rel2.offset: -1 -1; } } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; + part { name: "button6"; + mouse_events: 0; + description { state: "default" 0.0; visible: 0; - fixed: 1 1; - align: 0.0 0.5; - rel1.to_x: "elm.swallow.icon"; - rel1.relative: 1.0 0.0; - rel1.offset: -1 4; - rel2.to_x: "elm.swallow.icon"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -5; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.0 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - rel1.offset: 0 4; - rel2.offset: 0 -5; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 128 128 128; - visible: 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; - } - } - part { - name: "elm.swallow.end"; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 0; - align: 1.0 0.5; - rel1 { - offset: -4 0; - relative: 1.0 0.0; - to_y: "elm.swallow.bar"; + rel1.to: "button3"; + rel2 { + to: "button5"; + relative: 1.0 0.3; + offset: -1 -1; } - rel2 { - offset: -3 -1; - to_y: "elm.swallow.bar"; + image { + normal: "sl_bt2_1.png"; + border: 5 5 5 0; } - } + fill.smooth: 0; + } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel2.offset: -4 -1; - } - } - part { name: "units"; + } + } + part { name: "button7"; mouse_events: 0; description { state: "default" 0.0; visible: 0; - rel1 { - to_x: "elm.units"; - offset: 0 5; - } - rel2 { - to_x: "elm.units"; - offset: 5 -3; - } + rel1.to: "button3"; + rel2.to: "button5"; image { - normal: "sl_units.png"; - border: 0 5 3 8; + normal: "sl_bt2_2.png"; + border: 5 5 5 0; + middle: 0; } fill.smooth: 0; } @@ -14402,1625 +11127,1132 @@ collections { visible: 1; } } - part { name: "elm.units"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 1.0 0.5; - rel1.to_x: "elm.swallow.end"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 8; - rel2.to_x: "elm.swallow.end"; - rel2.relative: 0.0 1.0; - rel2.offset: 0 -9; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.0 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - fixed: 1 1; - visible: 1; - text.min: 1 1; - rel1.offset: -5 0; - rel2.offset: -5 -1; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 128 128 128; - visible: 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; - } + } + programs { + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; } - part { name: "elm.dragable.slider"; - type: RECT; - mouse_events: 0; - scale: 1; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "bg"; + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "units_show"; + signal: "elm,state,units,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.units"; + target: "units"; + } + program { name: "units_hide"; + signal: "elm,state,units,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.units"; + target: "units"; + } + program { name: "invert_on"; + signal: "elm,state,inverted,on"; + source: "elm"; + action: STATE_SET "inverted" 0.0; + target: "level"; + target: "level2"; + } + program { name: "invert_off"; + signal: "elm,state,inverted,off"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "level"; + target: "level2"; + } + program { name: "val_show"; + signal: "mouse,down,*"; + source: "elm.dragable.slider"; + action: STATE_SET "visible" 0.0; + target: "elm.indicator"; + target: "button3"; + target: "button4"; + target: "button5"; + target: "button6"; + target: "button7"; + } + program { name: "val_hide"; + signal: "mouse,up,*"; + source: "elm.dragable.slider"; + action: STATE_SET "default" 0.0; + target: "elm.indicator"; + target: "button3"; + target: "button4"; + target: "button5"; + target: "button6"; + target: "button7"; + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/genlist/item/default/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; } - description { state: "default" 0.0; - min: 0 24; - max: 0 24; + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; fixed: 1 1; rel1 { - relative: 0.5 0.0; - to_x: "bg"; + to: "base"; + relative: 0.0 1.0; + offset: 0 0; } rel2 { - relative: 0.5 1.0; - to_x: "bg"; + to: "base"; + relative: 1.0 1.0; + offset: -1 0; } - color: 255 0 0 100; - } - } - part { name: "button_events"; - type: RECT; - dragable { - events: "elm.dragable.slider"; - } - mouse_events: 1; - description { state: "default" 0.0; - fixed: 1 1; - min: 16 16; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1.to_x: "elm.dragable.slider"; - rel2.to_x: "elm.dragable.slider"; - color: 0 0 0 0; - } - } - part { name: "button0"; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - max: 17 999; - min: 17 24; - rel1.to: "elm.dragable.slider"; - rel2.to: "elm.dragable.slider"; image { - normal: "sl_bt_0.png"; - border: 5 5 5 10; + normal: "ilist_item_shadow.png"; } fill.smooth: 0; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; image { - normal: "sl_bt_3.png"; - border: 5 5 5 10; + normal: "ilist_1.png"; + border: 2 2 2 2; } + fill.smooth: 0; } } - part { name: "button1"; + part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "button0"; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } rel2 { - to: "button0"; - relative: 1.0 0.5; - offset: -1 -5; + relative: 1.0 1.0; + offset: 4 4; } image { - normal: "sl_bt_1.png"; - border: 5 5 5 0; + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; } } } - part { name: "button2"; - mouse_events: 0; + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; - rel1.to: "button0"; - rel2.to: "button0"; - image { - normal: "sl_bt_2.png"; - border: 5 5 5 10; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; } - fill.smooth: 0; } } - part { name: "button3"; - mouse_events: 0; + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 8 32; - align: 1.0 0.5; + fixed: 1 0; + align: 0.0 0.5; rel1 { - to_x: "elm.indicator"; - to_y: "button4"; - relative: 0.0 0.0; - offset: -7 0; + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } rel2 { - to: "button4"; - relative: 0.0 1.0; - offset: -1 -1; - } - image { - normal: "sl_bt2_0_0.png"; - border: 6 0 6 12; + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } - fill.smooth: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; } } - part { name: "button4"; - mouse_events: 0; + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - max: 15 999; - min: 15 32; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; rel1 { - to_x: "button0"; - to_y: "elm.indicator"; - offset: 0 0; + relative: 1.0 0.0; + offset: -5 4; } - rel2.to: "button0"; - image { - normal: "sl_bt2_0_1.png"; - border: 0 0 6 12; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - fill.smooth: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; } } - part { name: "button5"; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 8 32; - align: 0.0 0.5; + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; rel1 { - to: "button4"; - relative: 1.0 0.0; - offset: 0 0; + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; } rel2 { - to_x: "elm.indicator"; - to_y: "button4"; - relative: 1.0 1.0; - offset: 6 -1; + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; } - image { - normal: "sl_bt2_0_2.png"; - border: 0 6 6 12; + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; } - fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; } } - part { name: "elm.indicator"; - type: TEXT; - mouse_events: 0; - effect: SOFT_SHADOW; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 1.0; - rel1 { - to: "button0"; - relative: 0.0 -0.25; - offset: 0 0; - } - rel2 { - to_x: "button0"; - relative: 1.0 -0.25; - offset: -1 0; - } - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - rel1.offset: 0 -1; - rel2.offset: -1 -1; - } - } - part { name: "button6"; + part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - rel1.to: "button3"; - rel2 { - to: "button5"; - relative: 1.0 0.3; - offset: -1 -1; - } + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; image { - normal: "sl_bt2_1.png"; - border: 5 5 5 0; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "button7"; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - rel1.to: "button3"; - rel2.to: "button5"; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; image { - normal: "sl_bt2_2.png"; - border: 5 5 5 0; - middle: 0; + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; } } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } } programs { - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - program { name: "end_show"; - signal: "elm,state,end,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.end"; - } - program { name: "end_hide"; - signal: "elm,state,end,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.end"; - } - program { name: "units_show"; - signal: "elm,state,units,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.units"; - target: "units"; - } - program { name: "units_hide"; - signal: "elm,state,units,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.units"; - target: "units"; - } - program { name: "invert_on"; - signal: "elm,state,inverted,on"; - source: "elm"; - action: STATE_SET "inverted" 0.0; - target: "level"; - target: "level2"; - } - program { name: "invert_off"; - signal: "elm,state,inverted,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "level"; - target: "level2"; - } - program { name: "set_val_show"; - signal: "elm,state,val,show"; - source: "elm"; - script { - set_value_show(); - } - } - program { name: "set_val_hide"; - signal: "elm,state,val,hide"; - source: "elm"; - script { - set_value_hide(); - } - } - program { name: "val_show"; - signal: "mouse,down,*"; - source: "elm.dragable.slider"; - script { - thumb_down(); - } - - } - program { name: "val_hide"; - signal: "mouse,up,*"; - source: "elm.dragable.slider"; - script { - thumb_up(); - } - } + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } program { name: "go_disabled"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; - target: "button0"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "disabled_visible", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - - get_state(PART:"elm.units", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.units", "disabled_visible", 0.0); - else - set_state(PART:"elm.units", "disabled", 0.0); - - get_state(PART:"level2", st, 30, vl); - if (!strcmp(st, "inverted")) - { - set_state(PART:"level", "disabled_inverted", 0.0); - set_state(PART:"level2", "disabled_inverted", 0.0); - } - else - { - set_state(PART:"level", "disabled", 0.0); - set_state(PART:"level2", "disabled", 0.0); - } - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button0"; - target: "disabler"; - after: "enable_text"; + target: "disclip"; } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); - - get_state(PART:"elm.units", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.units", "visible", 0.0); - else - set_state(PART:"elm.units", "default", 0.0); - - get_state(PART:"level2", st, 30, vl); - if (!strcmp(st, "disabled_inverted")) - { - set_state(PART:"level", "inverted", 0.0); - set_state(PART:"level2", "inverted", 0.0); - } - else - { - set_state(PART:"level", "default", 0.0); - set_state(PART:"level2", "default", 0.0); - } - } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; } } } - - group { name: "elm/slider/vertical/default"; + group { name: "elm/genlist/item_compress/default/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; images { - image: "slv_bg.png" COMP; - image: "slv_bg_over.png" COMP; - - image: "sl_bt_0.png" COMP; - image: "sl_bt_1.png" COMP; - image: "sl_bt_2.png" COMP; - image: "sl_bt_3.png" COMP; - image: "sl_bt2_0_0.png" COMP; - image: "sl_bt2_0_1.png" COMP; - image: "sl_bt2_0_2.png" COMP; - image: "sl_bt2_1.png" COMP; - image: "sl_bt2_2.png" COMP; - - image: "slv_units.png" COMP; - } - script { - public value_hide = 0; - public set_value_show() { - set_int(value_hide, 0); - } - public set_value_hide() { - set_int(value_hide, 1); - } - public thumb_down() { - if (get_int(value_hide) == 1) { - set_state(PART:"elm.indicator", "default", 0.0); - set_state(PART:"button3", "default", 0.0); - set_state(PART:"button4", "default", 0.0); - set_state(PART:"button5", "default", 0.0); - set_state(PART:"button6", "default", 0.0); - set_state(PART:"button7", "default", 0.0); - } else { - set_state(PART:"elm.indicator", "visible", 0.0); - set_state(PART:"button3", "visible", 0.0); - set_state(PART:"button4", "visible", 0.0); - set_state(PART:"button5", "visible", 0.0); - set_state(PART:"button6", "visible", 0.0); - set_state(PART:"button7", "visible", 0.0); - } - } - public thumb_up() { - set_state(PART:"elm.indicator", "default", 0.0); - set_state(PART:"button3", "default", 0.0); - set_state(PART:"button4", "default", 0.0); - set_state(PART:"button5", "default", 0.0); - set_state(PART:"button6", "default", 0.0); - set_state(PART:"button7", "default", 0.0); - } + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; } parts { - part { name: "base"; + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + part { + name: "base_sh"; mouse_events: 0; - description { state: "default" 0.0; - max: 6 99999; - min: 6 0; - rel1 { to: "bg"; - offset: 1 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; } - rel2 { to: "bg"; - offset: -2 -1; + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; } - image.normal: "slv_bg.png"; fill.smooth: 0; } } - part { name: "level"; - type: RECT; + part { + name: "base"; mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - rel1.to: "base"; - rel2 { - to_x: "base"; - to_y: "elm.dragable.slider"; - relative: 1.0 0.5; + description { + state: "default" 0.0; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; } - color: 255 0 0 200; - } - description { state: "inverted" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 0 0 100; - } - description { state: "disabled_inverted" 0.0; - inherit: "default" 0.0; - visible: 0; + fill.smooth: 0; } } - part { name: "level2"; - type: RECT; + part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - fixed: 1 1; visible: 0; + color: 255 255 255 0; rel1 { - to_x: "base"; - to_y: "elm.dragable.slider"; - relative: 0.0 0.5; + relative: 0.0 0.0; + offset: -5 -5; } - rel2.to: "base"; - color: 255 0 0 200; - } - description { state: "inverted" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 0 0 100; + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; } - description { state: "disabled_inverted" 0.0; + description { state: "selected" 0.0; inherit: "default" 0.0; - color: 255 0 0 100; visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } } } - part { - name: "base_over"; - mouse_events: 0; + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; - rel1.to: "base"; - rel1.offset: -1 -1; - rel2.to: "base"; - rel2.offset: 0 0; - image { - normal: "slv_bg_over.png"; - border: 3 3 3 3; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; } - fill.smooth: 0; } } - part { name: "bg"; - type: RECT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.bar"; - rel2.to: "elm.swallow.bar"; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.bar"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - min: 24 48; - max: 24 9999; - align: 0.5 1.0; - rel1 { - to_y: "elm.text"; - relative: 0.0 1.0; - offset: 0 10; + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } - rel2 { - to_y: "elm.units"; - relative: 1.0 0.0; - offset: -1 -8; + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - rel1 { - offset: 0 4; - to_x: "elm.swallow.bar"; + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; } - rel2 { - offset: -1 3; - relative: 1.0 0.0; - to_x: "elm.swallow.bar"; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - rel2.offset: -1 4; - } - } + } + } part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 0 1; - align: 0.5 0.0; - rel1.to_y: "elm.swallow.icon"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 -1; - rel2.to_y: "elm.swallow.icon"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -1; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - rel1.offset: 4 0; - rel2.offset: -5 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 128 128 128; - visible: 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; - } - } - part { - name: "elm.swallow.end"; - type: SWALLOW; - description { + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; - visible: 0; - align: 0.5 1.0; - rel1 { - offset: 0 -4; - relative: 0.0 1.0; - to_x: "elm.swallow.bar"; - } - rel2 { - offset: -1 -3; - to_x: "elm.swallow.bar"; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - rel2.offset: -1 -4; - } - } - part { name: "units"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; +// min: 16 16; rel1 { - to: "elm.units"; - offset: -8 0; + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; } rel2 { - to: "elm.units"; - offset: 7 8; + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; + min: 0 1; +// min: 1 1; + align: 0.0 0.5; } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; image { - normal: "slv_units.png"; - border: 8 8 0 9; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "elm.units"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 1.0; - rel1.relative: 0.0 0.0; - rel1.to_y: "elm.swallow.end"; - rel1.offset: 8 0; - rel2.relative: 1.0 0.0; - rel2.to_y: "elm.swallow.end"; - rel2.offset: -9 0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - fixed: 1 1; - visible: 1; - text.min: 1 1; - rel1.offset: 8 -9; - rel2.offset: -9 -9; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - fixed: 1 1; - visible: 1; - text.min: 1 1; - rel1.offset: 8 -9; - rel2.offset: -9 -9; - color: 0 0 0 128; - color3: 0 0 0 0; - } - } - part { name: "elm.dragable.slider"; - type: RECT; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; - scale: 1; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "bg"; - } description { state: "default" 0.0; - min: 24 0; - max: 24 0; - fixed: 1 1; - rel1 { - relative: 0.5 0.0; - to_y: "bg"; - } - rel2 { - relative: 0.5 1.0; - to_y: "bg"; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - color: 0 0 0 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "button_events"; - type: RECT; - dragable { - events: "elm.dragable.slider"; - } - mouse_events: 1; - description { state: "default" 0.0; - fixed: 1 1; - min: 16 16; - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - rel1.to_y: "elm.dragable.slider"; - rel2.to_y: "elm.dragable.slider"; - color: 0 0 0 0; - } - } - part { name: "button0"; - mouse_events: 0; + part { name: "disclip"; + type: RECT; description { state: "default" 0.0; - fixed: 1 1; - max: 17 999; - min: 17 24; - rel1.to: "elm.dragable.slider"; - rel2.to: "elm.dragable.slider"; - image { - normal: "sl_bt_0.png"; - border: 5 5 5 10; - } - fill.smooth: 0; + rel1.to: "bg"; + rel2.to: "bg"; } description { state: "disabled" 0.0; inherit: "default" 0.0; - image { - normal: "sl_bt_3.png"; - border: 5 5 5 10; - } + color: 255 255 255 64; } } - part { name: "button1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button0"; - rel2 { - to: "button0"; - relative: 1.0 0.5; - offset: -1 -5; - } - image { - normal: "sl_bt_1.png"; - border: 5 5 5 0; - } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } + group { name: "elm/genlist/item_odd/default/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_2.png" COMP; + } + parts { + part { name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; } } - part { name: "button2"; + part { + name: "base"; mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button0"; - rel2.to: "button0"; + description { + state: "default" 0.0; image { - normal: "sl_bt_2.png"; - border: 5 5 5 10; + normal: "ilist_2.png"; + border: 2 2 2 2; } fill.smooth: 0; } } - part { name: "button3"; + part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - min: 8 32; - align: 1.0 0.5; + visible: 0; + color: 255 255 255 0; rel1 { - to_x: "elm.indicator"; - to_y: "button4"; relative: 0.0 0.0; - offset: -7 0; + offset: -5 -5; } rel2 { - to: "button4"; - relative: 0.0 1.0; - offset: -1 -1; + relative: 1.0 1.0; + offset: 4 4; } image { - normal: "sl_bt2_0_0.png"; - border: 6 0 6 12; + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - fill.smooth: 0; + image.middle: SOLID; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } } } - part { name: "button4"; - mouse_events: 0; + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - max: 15 999; - min: 15 32; - fixed: 1 1; + fixed: 1 0; + align: 0.0 0.5; rel1 { - to_x: "button0"; - to_y: "elm.indicator"; - offset: 0 -7; + relative: 0.0 0.0; + offset: 4 4; } - rel2.to: "button0"; - image { - normal: "sl_bt2_0_1.png"; - border: 0 0 6 12; + rel2 { + relative: 0.0 1.0; + offset: 4 -5; } - fill.smooth: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; } } - part { name: "button5"; - mouse_events: 0; + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - min: 8 32; + fixed: 1 0; align: 0.0 0.5; rel1 { - to: "button4"; - relative: 1.0 0.0; - offset: 0 0; + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } rel2 { - to_x: "elm.indicator"; - to_y: "button4"; - relative: 1.0 1.0; - offset: 6 -1; - } - image { - normal: "sl_bt2_0_2.png"; - border: 0 6 6 12; + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } - fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } } } - part { name: "elm.indicator"; - type: TEXT; - mouse_events: 0; - effect: SOFT_SHADOW; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 1.0; - rel1 { - to: "button0"; - relative: 0.0 -1.0; - offset: 0 0; + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; } - rel2 { - to: "button0"; - relative: 1.0 -1.0; - offset: -1 0; + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; } - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - rel1.offset: 0 -1; - rel2.offset: -1 -1; - } - } - part { name: "button6"; + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - rel1.to: "button3"; - rel2 { - to: "button5"; - relative: 1.0 0.3; - offset: -1 -1; - } + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; image { - normal: "sl_bt2_1.png"; - border: 5 5 5 0; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "button7"; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - rel1.to: "button3"; - rel2.to: "button5"; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; image { - normal: "sl_bt2_2.png"; - border: 5 5 5 0; - middle: 0; + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + } programs { - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - program { name: "end_show"; - signal: "elm,state,end,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.end"; - } - program { name: "end_hide"; - signal: "elm,state,end,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.end"; - } - program { name: "units_show"; - signal: "elm,state,units,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.units"; - target: "units"; - } - program { name: "units_hide"; - signal: "elm,state,units,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.units"; - target: "units"; - } - program { name: "invert_on"; - signal: "elm,state,inverted,on"; - source: "elm"; - action: STATE_SET "inverted" 0.0; - target: "level"; - target: "level2"; - } - program { name: "invert_off"; - signal: "elm,state,inverted,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "level"; - target: "level2"; - } - program { name: "set_val_show"; - signal: "elm,state,val,show"; - source: "elm"; - script { - set_value_show(); - } - } - program { name: "set_val_hide"; - signal: "elm,state,val,hide"; - source: "elm"; - script { - set_value_hide(); - } - } - program { name: "val_show"; - signal: "mouse,down,*"; - source: "elm.dragable.slider"; - script { - thumb_down(); - } - } - program { name: "val_hide"; - signal: "mouse,up,*"; - source: "elm.dragable.slider"; - script { - thumb_up(); - } - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button0"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "disabled_visible", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - - get_state(PART:"elm.units", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.units", "disabled_visible", 0.0); - else - set_state(PART:"elm.units", "disabled", 0.0); - - get_state(PART:"level2", st, 30, vl); - if (!strcmp(st, "inverted")) - { - set_state(PART:"level", "disabled_inverted", 0.0); - set_state(PART:"level2", "disabled_inverted", 0.0); - } - else - { - set_state(PART:"level", "disabled", 0.0); - set_state(PART:"level2", "disabled", 0.0); - } - } - } - - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button0"; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); - - get_state(PART:"elm.units", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.units", "visible", 0.0); - else - set_state(PART:"elm.units", "default", 0.0); - - get_state(PART:"level2", st, 30, vl); - if (!strcmp(st, "disabled_inverted")) - { - set_state(PART:"level", "inverted", 0.0); - set_state(PART:"level2", "inverted", 0.0); - } - else - { - set_state(PART:"level", "default", 0.0); - set_state(PART:"level2", "default", 0.0); - } - } - } + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } } } - -//////////////////////////////////////////////////////////////////////////////// -// actionslider -//////////////////////////////////////////////////////////////////////////////// - group { name: "elm/actionslider/base/default"; - + group { name: "elm/genlist/item_compress_odd/default/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; images { - image: "shelf_inset.png" COMP; - image: "ilist_1.png" COMP; - image: "bt_bases.png" COMP; - image: "bt_basew.png" COMP; - image: "bt_hilightw.png" COMP; + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_2.png" COMP; } - parts { + part { name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } part { name: "base"; mouse_events: 0; description { state: "default" 0.0; - min: 75 25; - rel1.offset: 1 1; - rel2.offset: -2 -2; image { - normal: "ilist_1.png"; + normal: "ilist_2.png"; border: 2 2 2 2; } fill.smooth: 0; } } - part { name: "conf_over"; - mouse_events: 0; + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - fill.smooth : 0; } } - part { name: "icon.dragable.area"; - type: RECT; - mouse_events: 0; + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - rel1.to: "base"; - rel2.to: "base"; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } } } - part { name: "elm.text.left"; - type: TEXT; - mouse_events: 0; - scale: 1; + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; description { state: "default" 0.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - align: 0.05 0.5; - min: 1 1; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; + } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } } } - part { name: "elm.text.center"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - align: 0.5 0.5; - min: 1 1; + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } } } - part { name: "elm.text.right"; - type: TEXT; - mouse_events: 0; + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; scale: 1; - description { state: "default" 0.0; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } color: 0 0 0 255; + color3: 0 0 0 0; text { - font: "Sans,Edje-Vera"; + font: "Sans"; size: 10; - align: 0.95 0.5; - min: 1 1; + min: 0 1; +// min: 1 1; + align: 0.0 0.5; } } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } } - part { name: "elm.drag_button_base"; - type: SWALLOW; + part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; - scale: 1; description { state: "default" 0.0; - fixed: 1 1; - min: 50 25; - align: 0.5 0.5; - rel1.to: "icon.dragable.area"; - rel2 { - relative: 0.0 1.0; - to: "icon.dragable.area"; - } - } - dragable { - confine: "icon.dragable.area"; - x: 1 1 0; - y: 0 0 0; - } - } - part { name: "elm.drag_button"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - min: 50 25; + visible: 0; color: 255 255 255 0; - rel1.to_x: "elm.drag_button_base"; - rel1.to_y: "icon.dragable.area"; - rel2.to_x: "elm.drag_button_base"; - rel2.to_y: "icon.dragable.area"; - } - dragable { - events: "elm.drag_button_base"; - } - } - part { name: "button0"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button2"; - rel1.offset: -4 -4; - rel2.to: "button2"; - rel2.offset: 3 3; - image { - normal: "bt_bases.png"; - border: 11 11 11 11; - middle: SOLID; - } - color: 255 255 255 128; - } - } - part { name: "button2"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.drag_button"; - rel2.to: "elm.drag_button"; - image { - normal: "bt_basew.png"; - border: 7 7 7 7; - middle: SOLID; - } - color: 255 255 255 210; - } - } - part { name: "button3"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button2"; - rel2.to: "button2"; + rel1.to: "bg"; rel2.relative: 1.0 0.5; + rel2.to: "bg"; image { - normal: "bt_hilightw.png"; - border: 4 4 4 0; - } - color: 255 255 255 190; - } - } - } - programs { - program { name: "elm.drag_button,mouse,up"; - signal: "mouse,up,1"; - source: "elm.drag_button"; - action: SIGNAL_EMIT "elm.drag_button,mouse,up" ""; - } - program { name: "elm.drag_button,mouse,down"; - signal: "mouse,down,1"; - source: "elm.drag_button"; - action: SIGNAL_EMIT "elm.drag_button,mouse,down" ""; - } - program { name: "elm.drag_button,mouse,move"; - signal: "mouse,move"; - source: "elm.drag_button_base"; - action: SIGNAL_EMIT "elm.drag_button,mouse,move" ""; - } - } - } - - group { name: "elm/actionslider/base/bar"; - - images { - image: "shelf_inset.png" COMP; - image: "ilist_1.png" COMP; - image: "bt_bases.png" COMP; - image: "bt_basew.png" COMP; - image: "bt_hilightw.png" COMP; - } - - parts { - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - min: 150 30; - rel1.offset: 1 1; - rel2.offset: -2 -2; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - fill.smooth: 0; } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "icon.dragable.area"; - type: RECT; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; - rel1.to: "base"; - rel2.to: "base"; - } - } - part { name: "elm.text.left"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - align: 0.05 0.5; - min: 1 1; - } - } - } - part { name: "elm.text.center"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - align: 0.5 0.5; - min: 1 1; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } } - } - part { name: "elm.text.right"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - align: 0.95 0.5; - min: 1 1; - } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "bar"; + part { name: "disclip"; type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "base"; - rel1.offset: 0 2; - rel2 { - relative: 0 1; - offset: 3 -3; - to_x: "elm.drag_button_base"; - to_y: "base"; - } - color: 0 0 0 180; - } - } - part { name: "elm.drag_button_base"; - type: SWALLOW; - mouse_events: 1; - scale: 1; description { state: "default" 0.0; - fixed: 1 1; - min: 50 25; - align: 0.5 0.5; - rel1.to: "icon.dragable.area"; - rel2 { - relative: 0.0 1.0; - to: "icon.dragable.area"; - } + rel1.to: "bg"; + rel2.to: "bg"; } - dragable { - confine: "icon.dragable.area"; - x: 1 1 0; - y: 0 0 0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; } } - part { name: "elm.drag_button"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - min: 50 25; - color: 255 255 255 0; - rel1.to_x: "elm.drag_button_base"; - rel1.to_y: "icon.dragable.area"; - rel2.to_x: "elm.drag_button_base"; - rel2.to_y: "icon.dragable.area"; - } - dragable { - events: "elm.drag_button_base"; - } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; } - part { name: "button0"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button2"; - rel1.offset: -4 -4; - rel2.to: "button2"; - rel2.offset: 3 3; - image { - normal: "bt_bases.png"; - border: 11 11 11 11; - middle: SOLID; - } - color: 255 255 255 128; - } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; } - part { name: "button2"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.drag_button"; - rel2.to: "elm.drag_button"; - image { - normal: "bt_basew.png"; - border: 7 7 7 7; - middle: SOLID; - } - color: 255 255 255 210; - } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; } - part { name: "button3"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button2"; - rel2.to: "button2"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilightw.png"; - border: 4 4 4 0; - } - color: 255 255 255 190; - } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; } } - programs { - program { name: "elm.drag_button,mouse,up"; - signal: "mouse,up,1"; - source: "elm.drag_button"; - action: SIGNAL_EMIT "elm.drag_button,mouse,up" ""; - } - program { name: "elm.drag_button,mouse,down"; - signal: "mouse,down,1"; - source: "elm.drag_button"; - action: SIGNAL_EMIT "elm.drag_button,mouse,down" ""; - } - program { name: "elm.drag_button,mouse,move"; - signal: "mouse,move"; - source: "elm.drag_button_base"; - action: SIGNAL_EMIT "elm.drag_button,mouse,move" ""; - } - } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/genlist/item/default/default"; + group { name: "elm/genlist/tree/default/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; data.item: "labels" "elm.text"; @@ -16033,6 +12265,8 @@ collections { image: "bt_sm_hilight.png" COMP; image: "ilist_1.png" COMP; image: "ilist_item_shadow.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; } parts { part { @@ -16129,12 +12363,13 @@ collections { } } } - part { name: "elm.swallow.icon"; + part { name: "arrow"; clip_to: "disclip"; - type: SWALLOW; + ignore_flags: ON_HOLD; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; + aspect: 1.0 1.0; rel1 { to_x: "elm.swallow.pad"; relative: 1.0 0.0; @@ -16145,19 +12380,42 @@ collections { relative: 1.0 1.0; offset: -1 -5; } + image.normal: "icon_arrow_right.png"; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; } } - part { name: "elm.swallow.end"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; + align: 0.0 0.5; rel1 { + to_x: "arrow"; relative: 1.0 0.0; - offset: -5 4; + offset: 4 4; + } + rel2 { + to_x: "arrow"; + relative: 1.0 1.0; + offset: 4 -5; + } + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; } rel2 { relative: 1.0 1.0; @@ -16192,7 +12450,6 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -16293,10 +12550,29 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } } } - group { name: "elm/genlist/item/group_index/default"; - alias: "elm/genlist/item_odd/group_index/default"; + group { name: "elm/genlist/tree_compress/default/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; data.item: "labels" "elm.text"; @@ -16307,14 +12583,16 @@ collections { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; image: "ilist_item_shadow.png" COMP; - image: "group_index.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; } parts { part { - name: "event"; - type: RECT; - repeat_events: 0; + name: "event"; + type: RECT; + repeat_events: 1; description { state: "default" 0.0; color: 0 0 0 0; @@ -16350,7 +12628,7 @@ collections { description { state: "default" 0.0; image { - normal: "group_index.png"; + normal: "ilist_1.png"; border: 2 2 2 2; } fill.smooth: 0; @@ -16397,29 +12675,53 @@ collections { align: 0.0 0.5; rel1 { relative: 0.0 0.0; - offset: 4 4; + offset: 4 4; } rel2 { relative: 0.0 1.0; - offset: 4 -5; + offset: 4 -5; } } } - part { name: "elm.swallow.icon"; + part { name: "arrow"; clip_to: "disclip"; - type: SWALLOW; + ignore_flags: ON_HOLD; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; + aspect: 1.0 1.0; rel1 { to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + relative: 1.0 0.0; + offset: -1 4; } rel2 { to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + relative: 1.0 1.0; + offset: -1 -5; + } + image.normal: "icon_arrow_right.png"; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "arrow"; + relative: 1.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "arrow"; + relative: 1.0 1.0; + offset: 4 -5; } } } @@ -16432,43 +12734,42 @@ collections { aspect: 1.0 1.0; aspect_preference: VERTICAL; rel1 { - relative: 1.0 0.0; - offset: -5 4; + relative: 1.0 0.0; + offset: -5 4; } rel2 { - relative: 1.0 1.0; - offset: -5 -5; + relative: 1.0 1.0; + offset: -5 -5; } } } part { name: "elm.text"; clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; scale: 1; description { state: "default" 0.0; // min: 16 16; rel1 { - to_x: "elm.swallow.icon"; + to_x: "elm.swallow.icon"; relative: 1.0 0.0; - offset: 0 4; + offset: 0 4; } rel2 { - to_x: "elm.swallow.end"; + to_x: "elm.swallow.end"; relative: 0.0 1.0; - offset: -1 -5; + offset: -1 -5; } color: 0 0 0 255; color3: 0 0 0 0; text { font: "Sans"; size: 10; - min: 1 1; -// min: 0 1; +// min: 1 1; + min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -16569,37 +12870,44 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } } } - group { name: "elm/genlist/item_compress/message/default"; - data.item: "stacking" "above"; + group { name: "elm/genlist/tree_odd/default/default"; + data.item: "stacking" "below"; data.item: "selectraise" "on"; - data.item: "labels" "elm.title.1 elm.title.2 elm.text"; -// data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; data.item: "treesize" "20"; // data.item: "states" ""; images { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - styles { - style { name: "genlist_textblock_style"; - base: "font=Sans font_size=10 color=#000 wrap=char text_class=list_item"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - } - style { name: "genlist_textblock_style2"; - base: "font=Sans font_size=10 color=#fff wrap=char text_class=list_item"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - } + image: "ilist_2.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; } - parts { + parts { part { name: "event"; type: RECT; @@ -16610,36 +12918,12 @@ collections { } } part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { name: "base"; mouse_events: 0; description { state: "default" 0.0; image { - normal: "ilist_1.png"; + normal: "ilist_2.png"; border: 2 2 2 2; } fill.smooth: 0; @@ -16679,111 +12963,114 @@ collections { } } } - part { name: "elm.title.1"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; -// min: 16 16; + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; rel1 { relative: 0.0 0.0; - offset: 4 4; + offset: 4 4; } rel2 { - relative: 1.0 0.0; - offset: -5 4; - } - color: 0 0 0 255; - color3: 0 0 0 0; - align: 0.0 0.0; - text { - font: "Sans"; - size: 10; - min: 0 1; -// min: 1 1; - align: 0.0 0.0; - text_class: "list_item"; + relative: 0.0 1.0; + offset: 4 -5; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } } - part { name: "elm.title.2"; + part { name: "arrow"; clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; -// min: 16 16; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + aspect: 1.0 1.0; rel1 { - to_y: "elm.title.1"; - relative: 0.0 1.0; - offset: 4 0; + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } rel2 { - to_y: "elm.title.1"; + to_x: "elm.swallow.pad"; relative: 1.0 1.0; - offset: -5 0; - } - color: 0 0 0 255; - color3: 0 0 0 0; - align: 0.0 0.0; - text { - font: "Sans"; - size: 10; - min: 0 1; -// min: 1 1; - align: 0.0 0.0; - text_class: "list_item"; + offset: -1 -5; } + image.normal: "icon_arrow_right.png"; } - description { state: "selected" 0.0; + description { state: "active" 0.0; inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + image.normal: "icon_arrow_down.png"; } } - part { name: "elm.text"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// fixed: 0 1; -// min: 16 16; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; rel1 { - to_y: "elm.title.2"; - relative: 0.0 1.0; - offset: 4 0; + to_x: "arrow"; + relative: 1.0 0.0; + offset: 4 4; } rel2 { + to_x: "arrow"; relative: 1.0 1.0; - offset: -5 -5; + offset: 4 -5; } - align: 0.0 0.0; + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } + color: 0 0 0 255; + color3: 0 0 0 0; text { - style: "genlist_textblock_style"; - min: 0 1; -// min: 1 1; - align: 0.0 0.0; + font: "Sans"; + size: 10; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; } } description { state: "selected" 0.0; inherit: "default" 0.0; - text { - style: "genlist_textblock_style2"; - } + color: 224 224 224 255; + color3: 0 0 0 64; } } part { name: "fg1"; @@ -16851,8 +13138,6 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.title.1"; - target: "elm.title.2"; target: "elm.text"; } program { @@ -16863,8 +13148,6 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.title.1"; - target: "elm.title.2"; target: "elm.text"; transition: LINEAR 0.1; } @@ -16882,13 +13165,33 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } } } - group { name: "elm/genlist/item_compress_odd/message/default"; + group { name: "elm/genlist/tree_compress_odd/default/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; - data.item: "labels" "elm.title.1 elm.title.2 elm.text"; -// data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; data.item: "treesize" "20"; // data.item: "states" ""; images { @@ -16896,10 +13199,13 @@ collections { image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; image: "ilist_2.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; } parts { - part { name: "event"; - type: RECT; + part { + name: "event"; + type: RECT; repeat_events: 1; description { state: "default" 0.0; @@ -16952,111 +13258,114 @@ collections { } } } - part { name: "elm.title.1"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; -// min: 16 16; + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; rel1 { relative: 0.0 0.0; - offset: 4 4; + offset: 4 4; } rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } + } + } + part { name: "arrow"; + clip_to: "disclip"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + aspect: 1.0 1.0; + rel1 { + to_x: "elm.swallow.pad"; relative: 1.0 0.0; - offset: -5 4; + offset: -1 4; } - color: 0 0 0 255; - color3: 0 0 0 0; - align: 0.0 0.0; - text { - font: "Sans"; - size: 10; - min: 0 1; -// min: 1 1; - align: 0.0 0.0; - text_class: "list_item"; + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } + image.normal: "icon_arrow_right.png"; } - description { state: "selected" 0.0; + description { state: "active" 0.0; inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + image.normal: "icon_arrow_down.png"; } } - part { name: "elm.title.2"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; -// min: 16 16; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; rel1 { - to_y: "elm.title.1"; - relative: 0.0 1.0; - offset: 4 0; + to_x: "arrow"; + relative: 1.0 0.0; + offset: 4 4; } rel2 { - to_y: "elm.title.1"; + to_x: "arrow"; relative: 1.0 1.0; - offset: -5 0; - } - color: 0 0 0 255; - color3: 0 0 0 0; - align: 0.0 0.0; - text { - font: "Sans"; - size: 10; - min: 0 1; -// min: 1 1; - align: 0.0 0.0; - text_class: "list_item"; + offset: 4 -5; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } } } part { name: "elm.text"; clip_to: "disclip"; - type: TEXTBLOCK; + type: TEXT; + effect: SOFT_SHADOW; mouse_events: 0; scale: 1; description { state: "default" 0.0; -// fixed: 0 1; // min: 16 16; rel1 { - to_y: "elm.title.2"; - relative: 0.0 1.0; - offset: 4 0; + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; } rel2 { - relative: 1.0 1.0; - offset: -5 -5; + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; } - align: 0.0 0.0; + color: 0 0 0 255; + color3: 0 0 0 0; text { - style: "genlist_textblock_style"; - min: 0 1; + font: "Sans"; + size: 10; // min: 1 1; - align: 0.0 0.0; + min: 0 1; + align: 0.0 0.5; } } description { state: "selected" 0.0; inherit: "default" 0.0; - text { - style: "genlist_textblock_style2"; - } + color: 224 224 224 255; + color3: 0 0 0 64; } } part { name: "fg1"; @@ -17124,8 +13433,6 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.title.1"; - target: "elm.title.2"; target: "elm.text"; } program { @@ -17136,8 +13443,6 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.title.1"; - target: "elm.title.2"; target: "elm.text"; transition: LINEAR 0.1; } @@ -17155,786 +13460,1186 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } } } - group { name: "elm/genlist/item_compress/default/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; -// data.item: "states" ""; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; + + group { name: "elm/genlist/item/default_style/default"; + styles + { + style { name: "genlist_style"; + base: "font=Sans font_size=10 align=left valign=0.5 color=#000"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=Sans:style=Bold"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "tab" "\t"; + } + style { name: "genlist_selected_style"; + base: "font=Sans font_size=10 align=left valign=0.5 color=#fff"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=Sans:style=Bold"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "tab" "\t"; + } + } + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; } - image { - normal: "ilist_item_shadow.png"; + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; + } + fill.smooth: 0; } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 16 28; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; + } + fill.smooth: 0; } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; + } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; + } } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + to_y: "base"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + to_y: "base"; + relative: 0.0 0.5; + offset: -1 -5; + } + text { + style: "genlist_style"; + min: 1 1; + } } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "genlist_selected_style"; + } } - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 0 4; + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; -// min: 1 1; - align: 0.0 0.5; - text_class: "list_item"; + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } + group { name: "elm/genlist/item_odd/default_style/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_2.png" COMP; + } + parts { + part { name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 16 28; + image { + normal: "ilist_2.png"; + border: 2 2 2 2; + } + fill.smooth: 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - group { name: "elm/genlist/item_odd/default/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; -// data.item: "states" ""; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; + } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; + } } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + to_y: "base"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + to_y: "base"; + relative: 0.0 0.5; + offset: -1 -5; + } + text { + style: "genlist_style"; + min: 1 1; + } } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "genlist_selected_style"; + } } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 0 4; + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } + + group { name: "elm/genlist/tree/default_style/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; + } + fill.smooth: 0; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 16 28; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; + } + fill.smooth: 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - group { name: "elm/genlist/item_compress_odd/default/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; -// data.item: "states" ""; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; + } + part { name: "arrow"; + clip_to: "disclip"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + aspect: 1.0 1.0; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; + } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; + } + image.normal: "icon_arrow_right.png"; } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "arrow"; + relative: 1.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "arrow"; + relative: 1.0 1.0; + offset: 4 -5; + } } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + to_y: "base"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + to_y: "base"; + relative: 0.0 0.5; + offset: -1 -5; + } + text { + style: "genlist_style"; + min: 1 1; + } } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "genlist_selected_style"; + } } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } } - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 0 4; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } + } + } + group { name: "elm/genlist/tree_odd/default_style/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_2.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; -// min: 1 1; - align: 0.0 0.5; - text_class: "list_item"; + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 16 28; + image { + normal: "ilist_2.png"; + border: 2 2 2 2; + } + fill.smooth: 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } + } + } + part { name: "arrow"; + clip_to: "disclip"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + aspect: 1.0 1.0; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; + } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; + } + image.normal: "icon_arrow_right.png"; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "arrow"; + relative: 1.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "arrow"; + relative: 1.0 1.0; + offset: 4 -5; + } + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + to_y: "base"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + to_y: "base"; + relative: 0.0 0.5; + offset: -1 -5; + } + text { + style: "genlist_style"; + min: 1 1; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "genlist_selected_style"; + } + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } + } } - group { name: "elm/genlist/tree/default/default"; + + group { name: "elm/genlist/item/double_label/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; + data.item: "labels" "elm.text elm.text.sub"; data.item: "icons" "elm.swallow.icon elm.swallow.end"; data.item: "treesize" "20"; // data.item: "states" ""; @@ -17944,8 +14649,6 @@ collections { image: "bt_sm_hilight.png" COMP; image: "ilist_1.png" COMP; image: "ilist_item_shadow.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; } parts { part { @@ -18042,13 +14745,12 @@ collections { } } } - part { name: "arrow"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; - ignore_flags: ON_HOLD; + type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; - aspect: 1.0 1.0; rel1 { to_x: "elm.swallow.pad"; relative: 1.0 0.0; @@ -18059,29 +14761,6 @@ collections { relative: 1.0 1.0; offset: -1 -5; } - image.normal: "icon_arrow_right.png"; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } } } part { name: "elm.swallow.end"; @@ -18118,7 +14797,7 @@ collections { } rel2 { to_x: "elm.swallow.end"; - relative: 0.0 1.0; + relative: 0.0 0.5; offset: -1 -5; } color: 0 0 0 255; @@ -18129,7 +14808,6 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -18138,6 +14816,40 @@ collections { color3: 0 0 0 64; } } + part { name: "elm.text.sub"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } + color: 0 0 0 128; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 8; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + color3: 0 0 0 32; + } + } part { name: "fg1"; clip_to: "disclip"; mouse_events: 0; @@ -18204,6 +14916,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; } program { name: "go_passive"; @@ -18214,6 +14927,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -18230,32 +14944,12 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } } } - group { name: "elm/genlist/tree_compress/default/default"; + group { name: "elm/genlist/item_compress/double_label/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; + data.item: "labels" "elm.text elm.text.sub"; data.item: "icons" "elm.swallow.icon elm.swallow.end"; data.item: "treesize" "20"; // data.item: "states" ""; @@ -18265,8 +14959,6 @@ collections { image: "bt_sm_hilight.png" COMP; image: "ilist_1.png" COMP; image: "ilist_item_shadow.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; } parts { part { @@ -18363,13 +15055,12 @@ collections { } } } - part { name: "arrow"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; - ignore_flags: ON_HOLD; + type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; - aspect: 1.0 1.0; rel1 { to_x: "elm.swallow.pad"; relative: 1.0 0.0; @@ -18380,29 +15071,6 @@ collections { relative: 1.0 1.0; offset: -1 -5; } - image.normal: "icon_arrow_right.png"; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } } } part { name: "elm.swallow.end"; @@ -18439,7 +15107,7 @@ collections { } rel2 { to_x: "elm.swallow.end"; - relative: 0.0 1.0; + relative: 0.0 0.5; offset: -1 -5; } color: 0 0 0 255; @@ -18450,7 +15118,6 @@ collections { // min: 1 1; min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -18459,6 +15126,40 @@ collections { color3: 0 0 0 64; } } + part { name: "elm.text.sub"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } + color: 0 0 0 128; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 8; +// min: 1 1; + min: 0 1; + align: 0.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + color3: 0 0 0 32; + } + } part { name: "fg1"; clip_to: "disclip"; mouse_events: 0; @@ -18525,6 +15226,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; } program { name: "go_passive"; @@ -18535,6 +15237,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -18551,32 +15254,12 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } } } - group { name: "elm/genlist/tree_odd/default/default"; + group { name: "elm/genlist/item_odd/double_label/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; + data.item: "labels" "elm.text elm.text.sub"; data.item: "icons" "elm.swallow.icon elm.swallow.end"; data.item: "treesize" "20"; // data.item: "states" ""; @@ -18585,13 +15268,10 @@ collections { image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; image: "ilist_2.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; } parts { - part { - name: "event"; - type: RECT; + part { name: "event"; + type: RECT; repeat_events: 1; description { state: "default" 0.0; @@ -18659,13 +15339,12 @@ collections { } } } - part { name: "arrow"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; - ignore_flags: ON_HOLD; + type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; - aspect: 1.0 1.0; rel1 { to_x: "elm.swallow.pad"; relative: 1.0 0.0; @@ -18676,37 +15355,14 @@ collections { relative: 1.0 1.0; offset: -1 -5; } - image.normal: "icon_arrow_right.png"; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } } } part { name: "elm.swallow.end"; clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; + type: SWALLOW; + description { state: "default" 0.0; fixed: 1 0; - align: 1.0 0.5; + align: 1.0 0.5; aspect: 1.0 1.0; aspect_preference: VERTICAL; rel1 { @@ -18735,7 +15391,7 @@ collections { } rel2 { to_x: "elm.swallow.end"; - relative: 0.0 1.0; + relative: 0.0 0.5; offset: -1 -5; } color: 0 0 0 255; @@ -18746,7 +15402,6 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -18755,29 +15410,63 @@ collections { color3: 0 0 0 64; } } - part { name: "fg1"; + part { name: "elm.text.sub"; clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.5; + offset: 0 4; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } + color: 0 0 0 128; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 8; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + color3: 0 0 0 32; + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; description { state: "default" 0.0; visible: 0; color: 255 255 255 0; @@ -18821,6 +15510,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; } program { name: "go_passive"; @@ -18831,6 +15521,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -18847,32 +15538,12 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } } } - group { name: "elm/genlist/tree_compress_odd/default/default"; + group { name: "elm/genlist/item_compress_odd/double_label/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; + data.item: "labels" "elm.text elm.text.sub"; data.item: "icons" "elm.swallow.icon elm.swallow.end"; data.item: "treesize" "20"; // data.item: "states" ""; @@ -18881,13 +15552,10 @@ collections { image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; image: "ilist_2.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; } parts { - part { - name: "event"; - type: RECT; + part { name: "event"; + type: RECT; repeat_events: 1; description { state: "default" 0.0; @@ -18955,13 +15623,12 @@ collections { } } } - part { name: "arrow"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; - ignore_flags: ON_HOLD; + type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; - aspect: 1.0 1.0; rel1 { to_x: "elm.swallow.pad"; relative: 1.0 0.0; @@ -18972,37 +15639,14 @@ collections { relative: 1.0 1.0; offset: -1 -5; } - image.normal: "icon_arrow_right.png"; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } } } part { name: "elm.swallow.end"; clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; + type: SWALLOW; + description { state: "default" 0.0; fixed: 1 0; - align: 1.0 0.5; + align: 1.0 0.5; aspect: 1.0 1.0; aspect_preference: VERTICAL; rel1 { @@ -19031,7 +15675,7 @@ collections { } rel2 { to_x: "elm.swallow.end"; - relative: 0.0 1.0; + relative: 0.0 0.5; offset: -1 -5; } color: 0 0 0 255; @@ -19042,7 +15686,6 @@ collections { // min: 1 1; min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -19051,6 +15694,40 @@ collections { color3: 0 0 0 64; } } + part { name: "elm.text.sub"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } + color: 0 0 0 128; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 8; +// min: 1 1; + min: 0 1; + align: 0.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + color3: 0 0 0 32; + } + } part { name: "fg1"; clip_to: "disclip"; mouse_events: 0; @@ -19117,6 +15794,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; } program { name: "go_passive"; @@ -19127,6 +15805,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -19143,1289 +15822,829 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } } } - group { name: "elm/genlist/item/default_style/default"; - styles - { - style { name: "genlist_style"; - base: "font=Sans font_size=10 align=left valign=0.5 color=#000 text_class=list_item"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font=Sans:style=Bold"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "tab" "\t"; - } - style { name: "genlist_selected_style"; - base: "font=Sans font_size=10 align=left valign=0.5 color=#fff text_class=list_item"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font=Sans:style=Bold"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "tab" "\t"; - } - } - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; + group { name: "elm/genlist/tree/double_label/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text elm.text.sub"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - min: 16 28; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } + image { + normal: "ilist_item_shadow.png"; } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } + fill.smooth: 0; + } + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } + fill.smooth: 0; + } + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } + rel2 { + relative: 1.0 1.0; + offset: 4 4; } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.5; - fixed: 0 1; - rel1 { - to_x: "elm.swallow.icon"; - to_y: "base"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - to_y: "base"; - relative: 0.0 0.5; - offset: -1 -5; - } - text { - style: "genlist_style"; - min: 1 1; - } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - text { - style: "genlist_selected_style"; - } + image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + } + } + part { name: "arrow"; + clip_to: "disclip"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + aspect: 1.0 1.0; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; + image.normal: "icon_arrow_right.png"; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "arrow"; + relative: 1.0 0.0; + offset: 4 4; } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - group { name: "elm/genlist/item_odd/default_style/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; + rel2 { + to_x: "arrow"; + relative: 1.0 1.0; + offset: 4 -5; } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - min: 16 28; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; - } - fill.smooth: 0; + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 0.5; + offset: -1 -5; } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "elm.text.sub"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.5; + offset: 0 4; } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.5; - fixed: 0 1; - rel1 { - to_x: "elm.swallow.icon"; - to_y: "base"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - to_y: "base"; - relative: 0.0 0.5; - offset: -1 -5; - } - text { - style: "genlist_style"; - min: 1 1; - } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - text { - style: "genlist_selected_style"; - } + color: 0 0 0 128; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 8; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + color3: 0 0 0 32; + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + target: "elm.text.sub"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + target: "elm.text.sub"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } + } + } + group { name: "elm/genlist/tree_compress/double_label/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text elm.text.sub"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + image { + normal: "ilist_item_shadow.png"; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; + fill.smooth: 0; + } + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - - group { name: "elm/genlist/tree/default_style/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; + fill.smooth: 0; + } + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; + rel2 { + relative: 1.0 1.0; + offset: 4 4; } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - min: 16 28; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; + image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } + } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; } - } - part { name: "arrow"; - clip_to: "disclip"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - aspect: 1.0 1.0; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } - image.normal: "icon_arrow_right.png"; + rel2 { + relative: 0.0 1.0; + offset: 4 -5; } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; + } + } + part { name: "arrow"; + clip_to: "disclip"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + aspect: 1.0 1.0; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXTBLOCK; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.5; - fixed: 0 1; - rel1 { - to_x: "elm.swallow.icon"; - to_y: "base"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - to_y: "base"; - relative: 0.0 0.5; - offset: -1 -5; - } - text { - style: "genlist_style"; - min: 1 1; - } + image.normal: "icon_arrow_right.png"; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "arrow"; + relative: 1.0 0.0; + offset: 4 4; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - text { - style: "genlist_selected_style"; - } + rel2 { + to_x: "arrow"; + relative: 1.0 1.0; + offset: 4 -5; } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 0.5; + offset: -1 -5; } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; +// min: 1 1; + min: 0 1; + align: 0.0 0.5; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "elm.text.sub"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.5; + offset: 0 4; } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } - } - } - group { name: "elm/genlist/tree_odd/default_style/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - min: 16 28; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; - } - fill.smooth: 0; + color: 0 0 0 128; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 8; +// min: 1 1; + min: 0 1; + align: 0.0 0.5; } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + color3: 0 0 0 32; + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + target: "elm.text.sub"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + target: "elm.text.sub"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } + } + } + group { name: "elm/genlist/tree_odd/double_label/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text elm.text.sub"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_2.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "ilist_2.png"; + border: 2 2 2 2; } - } - part { name: "arrow"; - clip_to: "disclip"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - aspect: 1.0 1.0; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } - image.normal: "icon_arrow_right.png"; + fill.smooth: 0; + } + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; + rel2 { + relative: 1.0 1.0; + offset: 4 4; } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXTBLOCK; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.5; - fixed: 0 1; - rel1 { - to_x: "elm.swallow.icon"; - to_y: "base"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - to_y: "base"; - relative: 0.0 0.5; - offset: -1 -5; - } - text { - style: "genlist_style"; - min: 1 1; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - text { - style: "genlist_selected_style"; - } - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } - } - } - - - group { name: "elm/genlist/item/double_label/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text elm.text.sub"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; -// data.item: "states" ""; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; + image.middle: SOLID; } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; + relative: 0.0 0.0; + offset: -2 -2; } rel2 { - to: "base"; relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; + offset: 1 1; } - fill.smooth: 0; } } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; } - fill.smooth: 0; } } - part { name: "bg"; + part { name: "arrow"; clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; + ignore_flags: ON_HOLD; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; + aspect: 1.0 1.0; rel1 { - relative: 0.0 0.0; - offset: 4 4; + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } + image.normal: "icon_arrow_right.png"; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; } } part { name: "elm.swallow.icon"; @@ -20435,14 +16654,14 @@ collections { fixed: 1 0; align: 0.0 0.5; rel1 { - to_x: "elm.swallow.pad"; + to_x: "arrow"; relative: 1.0 0.0; - offset: -1 4; + offset: 4 4; } rel2 { - to_x: "elm.swallow.pad"; + to_x: "arrow"; relative: 1.0 1.0; - offset: -1 -5; + offset: 4 -5; } } } @@ -20491,7 +16710,6 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -20526,7 +16744,6 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -20629,13 +16846,34 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } } } - group { name: "elm/genlist/item_compress/double_label/default"; + + group { name: "elm/genlist/item/icon_top_text_bottom/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text elm.text.sub"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon"; data.item: "treesize" "20"; // data.item: "states" ""; images { @@ -20735,8 +16973,8 @@ collections { offset: 4 4; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + relative: 1.0 1.0; + offset: -4 -5; } } } @@ -20745,10 +16983,10 @@ collections { type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; - align: 0.0 0.5; + align: 0.5 0.5; rel1 { to_x: "elm.swallow.pad"; - relative: 1.0 0.0; + relative: 0.0 0.0; offset: -1 4; } rel2 { @@ -20758,24 +16996,6 @@ collections { } } } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - } part { name: "elm.text"; clip_to: "disclip"; type: TEXT; @@ -20786,24 +17006,22 @@ collections { state: "default" 0.0; // min: 16 16; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; offset: 0 4; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 0.5; - offset: -1 -5; + relative: 1.0 1.0; + offset: -5 -5; } color: 0 0 0 255; color3: 0 0 0 0; text { font: "Sans"; size: 10; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; + min: 1 1; +// min: 0 1; + align: 0.5 0.5; } } description { state: "selected" 0.0; @@ -20812,41 +17030,6 @@ collections { color3: 0 0 0 64; } } - part { name: "elm.text.sub"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } part { name: "fg1"; clip_to: "disclip"; mouse_events: 0; @@ -20913,7 +17096,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; } program { name: "go_passive"; @@ -20924,7 +17106,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -20943,11 +17124,11 @@ collections { } } } - group { name: "elm/genlist/item_odd/double_label/default"; + group { name: "elm/genlist/item_odd/icon_top_text_bottom/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text elm.text.sub"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon"; data.item: "treesize" "20"; // data.item: "states" ""; images { @@ -21021,8 +17202,8 @@ collections { offset: 4 4; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + relative: 1.0 1.0; + offset: -4 -5; } } } @@ -21031,10 +17212,10 @@ collections { type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; - align: 0.0 0.5; + align: 0.5 0.5; rel1 { to_x: "elm.swallow.pad"; - relative: 1.0 0.0; + relative: 0.0 0.0; offset: -1 4; } rel2 { @@ -21044,24 +17225,6 @@ collections { } } } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - } part { name: "elm.text"; clip_to: "disclip"; type: TEXT; @@ -21070,16 +17233,15 @@ collections { scale: 1; description { state: "default" 0.0; -// min: 16 16; +// min: 16 16; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; offset: 0 4; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 0.5; - offset: -1 -5; + relative: 1.0 1.0; + offset: -5 -5; } color: 0 0 0 255; color3: 0 0 0 0; @@ -21088,8 +17250,7 @@ collections { size: 10; min: 1 1; // min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; + align: 0.5 0.5; } } description { state: "selected" 0.0; @@ -21098,41 +17259,6 @@ collections { color3: 0 0 0 64; } } - part { name: "elm.text.sub"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 1 1; -// min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } part { name: "fg1"; clip_to: "disclip"; mouse_events: 0; @@ -21199,7 +17325,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; } program { name: "go_passive"; @@ -21210,7 +17335,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -21229,22 +17353,27 @@ collections { } } } - group { name: "elm/genlist/item_compress_odd/double_label/default"; - data.item: "stacking" "below"; + + group { name: "elm/genlist/tree/icon_top_text_bottom/default"; + data.item: "stacking" "above"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text elm.text.sub"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon"; data.item: "treesize" "20"; // data.item: "states" ""; images { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; } parts { - part { name: "event"; - type: RECT; + part { + name: "event"; + type: RECT; repeat_events: 1; description { state: "default" 0.0; @@ -21252,12 +17381,36 @@ collections { } } part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; + } + fill.smooth: 0; + } + } + part { name: "base"; mouse_events: 0; description { state: "default" 0.0; image { - normal: "ilist_2.png"; + normal: "ilist_1.png"; border: 2 2 2 2; } fill.smooth: 0; @@ -21312,12 +17465,13 @@ collections { } } } - part { name: "elm.swallow.icon"; + part { name: "arrow"; clip_to: "disclip"; - type: SWALLOW; + ignore_flags: ON_HOLD; description { state: "default" 0.0; fixed: 1 0; align: 0.0 0.5; + aspect: 1.0 1.0; rel1 { to_x: "elm.swallow.pad"; relative: 1.0 0.0; @@ -21328,23 +17482,27 @@ collections { relative: 1.0 1.0; offset: -1 -5; } + image.normal: "icon_arrow_right.png"; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; } } - part { name: "elm.swallow.end"; + part { name: "elm.swallow.icon"; clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; + type: SWALLOW; + description { state: "default" 0.0; fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; + align: 0.5 0.5; rel1 { + to_x: "arrow"; relative: 1.0 0.0; - offset: -5 4; + offset: 4 4; } rel2 { relative: 1.0 1.0; - offset: -5 -5; + offset: -4 -5; } } } @@ -21358,24 +17516,22 @@ collections { state: "default" 0.0; // min: 16 16; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; offset: 0 4; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 0.5; - offset: -1 -5; + relative: 1.0 1.0; + offset: -5 -5; } color: 0 0 0 255; color3: 0 0 0 0; text { font: "Sans"; size: 10; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; + min: 1 1; +// min: 0 1; + align: 0.5 0.5; } } description { state: "selected" 0.0; @@ -21384,41 +17540,6 @@ collections { color3: 0 0 0 64; } } - part { name: "elm.text.sub"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } part { name: "fg1"; clip_to: "disclip"; mouse_events: 0; @@ -21485,7 +17606,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; } program { name: "go_passive"; @@ -21496,7 +17616,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -21513,22 +17632,40 @@ collections { action: STATE_SET "default" 0.0; target: "disclip"; } + program { + name: "expand"; + signal: "mouse,up,1"; + source: "arrow"; + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + } + program { + name: "go_expanded"; + signal: "elm,state,expanded"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "arrow"; + } + program { + name: "go_contracted"; + signal: "elm,state,contracted"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow"; + } } } - - group { name: "elm/genlist/tree/double_label/default"; - data.item: "stacking" "above"; + group { name: "elm/genlist/tree_odd/icon_top_text_bottom/default"; + data.item: "stacking" "below"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text elm.text.sub"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon"; data.item: "treesize" "20"; // data.item: "states" ""; images { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; + image: "ilist_2.png" COMP; image: "icon_arrow_right.png" COMP; image: "icon_arrow_down.png" COMP; } @@ -21543,36 +17680,12 @@ collections { } } part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { name: "base"; mouse_events: 0; description { state: "default" 0.0; image { - normal: "ilist_1.png"; + normal: "ilist_2.png"; border: 2 2 2 2; } fill.smooth: 0; @@ -21656,34 +17769,15 @@ collections { type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; - align: 0.0 0.5; + align: 0.5 0.5; rel1 { to_x: "arrow"; relative: 1.0 0.0; offset: 4 4; } rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { relative: 1.0 1.0; - offset: -5 -5; + offset: -4 -5; } } } @@ -21697,14 +17791,13 @@ collections { state: "default" 0.0; // min: 16 16; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; + to_y: "elm.swallow.icon"; + relative: 0.0 1.0; offset: 0 4; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 0.5; - offset: -1 -5; + relative: 1.0 1.0; + offset: -5 -5; } color: 0 0 0 255; color3: 0 0 0 0; @@ -21713,8 +17806,7 @@ collections { size: 10; min: 1 1; // min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; + align: 0.5 0.5; } } description { state: "selected" 0.0; @@ -21723,41 +17815,6 @@ collections { color3: 0 0 0 64; } } - part { name: "elm.text.sub"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 1 1; -// min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } part { name: "fg1"; clip_to: "disclip"; mouse_events: 0; @@ -21824,7 +17881,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; } program { name: "go_passive"; @@ -21835,7 +17891,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -21874,365 +17929,478 @@ collections { } } } - group { name: "elm/genlist/tree_compress/double_label/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text elm.text.sub"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; -// data.item: "states" ""; + + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/check/base/default"; images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; + image: "check_base.png" COMP; + image: "check.png" COMP; + image: "check2.png" COMP; } parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.offset: 1 1; + rel2.relative: 0.0 1.0; + rel2.offset: 1 -2; + align: 0.0 0.5; + min: 16 16; + max: 16 16; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + normal: "check_base.png"; + border: 5 5 5 5; + middle: 0; } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + fill.smooth : 0; + } + } + part { name: "check"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; + to: "bg"; offset: 1 1; } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "arrow"; - clip_to: "disclip"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - aspect: 1.0 1.0; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + to: "bg"; + offset: -2 -2; } - image.normal: "icon_arrow_right.png"; - } - description { state: "active" 0.0; + visible: 0; + color: 255 255 255 255; + image.normal: "check.png"; + } + description { state: "visible" 0.0; inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } + visible: 1; } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 128 128 128 128; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + visible: 1; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - } + visible: 0; + color: 255 255 255 255; + align: 0.0 0.5; + rel1.to_x: "bg"; + rel1.relative: 1.0 0.0; + rel1.offset: 1 1; + rel2.to_x: "bg"; + rel2.relative: 1.0 1.0; + rel2.offset: 2 -2; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 1 1; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + fixed: 1 1; + visible: 1; + aspect: 1.0 1.0; + } + } part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 0.5; - offset: -1 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "elm.text.sub"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: 1 1; + rel2.relative: 1.0 1.0; + rel2.offset: -2 -2; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + visible: 1; + text.min: 1 1; + } + } + part { name: "events"; + type: RECT; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "click"; + signal: "mouse,up,1"; + source: "events"; + action: SIGNAL_EMIT "elm,action,check,toggle" ""; + } + program { name: "check_on"; + signal: "elm,state,check,on"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "check"; + } + program { name: "check_off"; + signal: "elm,state,check,off"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "check"; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); + else + set_state(PART:"elm.swallow.content", "disabled", 0.0); + + get_state(PART:"check", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"check", "disabled_visible", 0.0); + else + set_state(PART:"check", "disabled", 0.0); + } } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + else + set_state(PART:"elm.swallow.content", "default", 0.0); + + get_state(PART:"check", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"check", "visible", 0.0); + else + set_state(PART:"check", "default", 0.0); + } } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; + } + } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/radio/base/default"; + images { + image: "radio_base.png" COMP; + image: "radio.png" COMP; + image: "radio2.png" COMP; + } + parts { + part { name: "bg"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.offset: 1 1; + rel2.relative: 0.0 1.0; + rel2.offset: 1 -2; + align: 0.0 0.5; + min: 16 16; + max: 16 16; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + image.normal: "radio_base.png"; + } + } + part { name: "radio"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; rel1.to: "bg"; rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; + visible: 0; + image.normal: "radio.png"; + } + description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; - color: 255 255 255 255; } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + visible: 0; + align: 0.0 0.5; + color: 0 0 0 0; + rel1.to_x: "bg"; + rel1.relative: 1.0 0.0; + rel1.offset: 1 1; + rel2.to_x: "bg"; + rel2.relative: 1.0 1.0; + rel2.offset: 2 -2; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 1 1; + visible: 1; + color: 255 255 255 255; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + visible: 1; + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: 1 1; + rel2.relative: 1.0 1.0; + rel2.offset: -2 -2; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + visible: 1; + text.min: 1 1; + } + } + part { name: "events"; + type: RECT; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } } programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - target: "elm.text.sub"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - target: "elm.text.sub"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; + program { name: "click"; + signal: "mouse,up,1"; + source: "events"; + action: SIGNAL_EMIT "elm,action,radio,toggle" ""; + } + program { name: "radio_on"; + signal: "elm,state,radio,on"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "radio"; + } + program { name: "radio_off"; + signal: "elm,state,radio,off"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "radio"; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); + else + set_state(PART:"elm.swallow.content", "disabled", 0.0); + } } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + else + set_state(PART:"elm.swallow.content", "default", 0.0); + } } } } - group { name: "elm/genlist/tree_odd/double_label/default"; + group { name: "elm/genlist/tree_compress_odd/double_label/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; data.item: "labels" "elm.text elm.text.sub"; @@ -22402,10 +18570,9 @@ collections { text { font: "Sans"; size: 10; - min: 1 1; -// min: 0 1; +// min: 1 1; + min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -22437,10 +18604,9 @@ collections { text { font: "Sans"; size: 8; - min: 1 1; -// min: 0 1; +// min: 1 1; + min: 0 1; align: 0.0 0.5; - text_class: "list_item"; } } description { state: "selected" 0.0; @@ -22566,11315 +18732,4405 @@ collections { } } - group { name: "elm/genlist/item/icon_top_text_bottom/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon"; - data.item: "treesize" "20"; -// data.item: "states" ""; +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/pager/base/default"; + data.item: "onshow" "raise"; +// other options +// data.item: "onhide" "lower"; +// data.item: "onshow" "lower"; images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; + image: "frame_1.png" COMP; + image: "frame_2.png" COMP; + image: "dia_grad.png" COMP; } parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { + part { name: "clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "base"; - relative: 0.0 1.0; - offset: 0 0; + offset: -9999 -9999; } - rel2 { + rel2 { to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + offset: 9999 9999; } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 1.0; - offset: -4 -5; - } - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 0.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_y: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 0 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.5 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; + } + description { state: "visible" 0.0; inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; + } + description { state: "hidden" 0.0; inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; + visible: 0; + } + } + part { name: "base0"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + image.normal: "dia_grad.png"; + rel1.to: "over"; + rel2.to: "over"; + fill { + smooth: 0; + size { + relative: 0.0 1.0; + offset: 64 0; + } + } + } + } + part { name: "base"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + image { + normal: "frame_2.png"; + border: 5 5 32 26; + middle: 0; + } + fill.smooth : 0; + } + description { state: "hidden" 0.0; inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "visible" 0.0; inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - group { name: "elm/genlist/item_odd/icon_top_text_bottom/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon"; - data.item: "treesize" "20"; -// data.item: "states" ""; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "over"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; offset: 4 4; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 1.0; - offset: -4 -5; - } - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 0.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_y: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 0 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.5 0.5; - text_class: "list_item"; + rel2 { + to: "base"; + offset: -5 -5; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + image { + normal: "frame_1.png"; + border: 2 2 28 22; + middle: 0; + } + fill.smooth : 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: 8 8; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + rel2 { + to: "base"; + offset: -9 -9; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } + } + } } programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } + program { name: "push_start"; + signal: "elm,action,push"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "base"; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "base"; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "show_end"; + } + program { name: "show_end"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pop_start"; + signal: "elm,action,pop"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + target: "clip"; + after: "hide_start2"; + } + program { name: "hide_start"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + target: "clip"; + after: "hide_start2"; + } + program { name: "hide_start2"; + action: STATE_SET "hidden" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "hide_end"; + } + program { name: "hide_end"; + action: SIGNAL_EMIT "elm,action,hide,finished" ""; + } + program { name: "reset"; + signal: "elm,action,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + target: "clip"; + } } } - group { name: "elm/genlist/tree/icon_top_text_bottom/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon"; - data.item: "treesize" "20"; -// data.item: "states" ""; + group { name: "elm/pager/base/slide"; images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; + image: "frame_1.png" COMP; + image: "frame_2.png" COMP; + image: "dia_grad.png" COMP; } parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "arrow"; - clip_to: "disclip"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - aspect: 1.0 1.0; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } - image.normal: "icon_arrow_right.png"; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 1.0; - offset: -4 -5; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_y: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 0 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.5 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } + part { name: "clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: -9999 -9999; + } + rel2 { + to: "base"; + offset: 9999 9999; + } + color: 255 255 255 255; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; + } + description { state: "hidden2" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; + } + } + part { name: "base0"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + image.normal: "dia_grad.png"; + rel1.to: "over"; + rel2.to: "over"; + fill { + smooth: 0; + size { + relative: 0.0 1.0; + offset: 64 0; + } + } + } + } + part { name: "base"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + image { + normal: "frame_2.png"; + border: 5 5 32 26; + middle: 0; + } + fill.smooth : 0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "hidden2" 0.0; + inherit: "default" 0.0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "over"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: 4 4; + } + rel2 { + to: "base"; + offset: -5 -5; + } + image { + normal: "frame_1.png"; + border: 2 2 28 22; + middle: 0; + } + fill.smooth : 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: 8 8; + } + rel2 { + to: "base"; + offset: -9 -9; + } + } + } } programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } - } - } - group { name: "elm/genlist/tree_odd/icon_top_text_bottom/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon"; - data.item: "treesize" "20"; -// data.item: "states" ""; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; + program { name: "push_start"; + signal: "elm,action,push"; + source: "elm"; + action: STATE_SET "hidden2" 0.0; + target: "base"; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "base"; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "show_end"; + } + program { name: "show_end"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pop_start"; + signal: "elm,action,pop"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + target: "clip"; + after: "pop_start2"; + } + program { name: "pop_start2"; + action: STATE_SET "hidden2" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "hide_end"; + } + program { name: "hide_start"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + target: "clip"; + after: "hide_start2"; + } + program { name: "hide_start2"; + action: STATE_SET "hidden" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "hide_end"; + } + program { name: "hide_end"; + action: SIGNAL_EMIT "elm,action,hide,finished" ""; + } + program { name: "reset"; + signal: "elm,action,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + target: "clip"; + } } + } + group { name: "elm/pager/base/slide_invisible"; parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; + part { name: "clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: -9999 -9999; + } + rel2 { + to: "base"; + offset: 9999 9999; + } + color: 255 255 255 255; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; + } + description { state: "hidden2" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; + } + } + part { name: "base"; + type: RECT; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + color: 0 0 0 0; + } + description { state: "hidden" 0.0; + color: 0 0 0 0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "hidden2" 0.0; + color: 0 0 0 0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + description { state: "visible" 0.0; + color: 0 0 0 0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "push_start"; + signal: "elm,action,push"; + source: "elm"; + action: STATE_SET "hidden2" 0.0; + target: "base"; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "base"; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "show_end"; + } + program { name: "show_end"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pop_start"; + signal: "elm,action,pop"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + target: "clip"; + after: "pop_start2"; + } + program { name: "pop_start2"; + action: STATE_SET "hidden2" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "hide_end"; + } + program { name: "hide_start"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + target: "clip"; + after: "hide_start2"; + } + program { name: "hide_start2"; + action: STATE_SET "hidden" 0.0; + transition: DECELERATE 0.5; + target: "base"; + target: "clip"; + after: "hide_end"; + } + program { name: "hide_end"; + action: SIGNAL_EMIT "elm,action,hide,finished" ""; + } + program { name: "reset"; + signal: "elm,action,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + target: "clip"; + } + } + } + + group { name: "elm/pager/base/fade"; + data.item: "onshow" "raise"; + // other options + // data.item: "onhide" "lower"; + // data.item: "onshow" "lower"; + images { + image: "frame_1.png" COMP; + image: "frame_2.png" COMP; + image: "dia_grad.png" COMP; + } + parts { + part { name: "clip_base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: -9999 -9999; + } + rel2 { + to: "base"; + offset: 9999 9999; + } + color: 255 255 255 120; } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; + description { state: "visible" 0.0; + inherit: "default" 0.0; } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + part { name: "clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: -9999 -9999; + } + rel2 { + to: "base"; + offset: 9999 9999; + } + color: 255 255 255 255; } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; + description { state: "visible" 0.0; + inherit: "default" 0.0; } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; + } + part { name: "base0"; + mouse_events: 0; + clip_to: "clip_base"; + description { state: "default" 0.0; + image.normal: "dia_grad.png"; + rel1.to: "over"; + rel2.to: "over"; + fill { + smooth: 0; + size { + relative: 0.0 1.0; + offset: 64 0; + } + } } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; + } + part { name: "base"; + mouse_events: 0; + clip_to: "clip_base"; + description { state: "default" 0.0; + image { + normal: "frame_2.png"; + border: 5 5 32 26; + middle: 0; + } + fill.smooth : 0; } - } - } - part { name: "arrow"; - clip_to: "disclip"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - aspect: 1.0 1.0; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + } + part { name: "over"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: 4 4; + } + rel2 { + to: "base"; + offset: -5 -5; + } + image { + normal: "frame_1.png"; + border: 2 2 28 22; + middle: 0; + } + fill.smooth : 0; } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: 8 8; + } + rel2 { + to: "base"; + offset: -9 -9; + } } - image.normal: "icon_arrow_right.png"; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; + } + } + programs { + program { name: "push_start"; + signal: "elm,action,push"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "clip"; + target: "clip_base"; + after: "show_start2"; + } + program { name: "show_start"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "clip"; + target: "clip_base"; + after: "show_start2"; + } + program { name: "show_start2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + target: "clip_base"; + after: "show_end"; + } + program { name: "show_end"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pop_start"; + signal: "elm,action,pop"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "clip"; + target: "clip_base"; + after: "hide_start2"; + } + program { name: "hide_start"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "clip"; + target: "clip_base"; + after: "hide_start2"; + } + program { name: "hide_start2"; + action: STATE_SET "hidden" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + target: "clip_base"; + after: "hide_end"; + } + program { name: "hide_end"; + action: SIGNAL_EMIT "elm,action,hide,finished" ""; + } + program { name: "reset"; + signal: "elm,action,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "clip_base"; + target: "clip"; + } + } + } + group { name: "elm/pager/base/fade_translucide"; + data.item: "onshow" "raise"; + // other options + // data.item: "onhide" "lower"; + // data.item: "onshow" "lower"; + images { + image: "frame_1.png" COMP; + image: "frame_2.png" COMP; + image: "dia_grad.png" COMP; + } + parts { + part { name: "clip_base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: -9999 -9999; + } + rel2 { + to: "base"; + offset: 9999 9999; + } + color: 255 255 255 120; } - rel2 { - relative: 1.0 1.0; - offset: -4 -5; + description { state: "visible" 0.0; + inherit: "default" 0.0; } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_y: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 0 4; + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + } + part { name: "clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: -9999 -9999; + } + rel2 { + to: "base"; + offset: 9999 9999; + } + color: 255 255 255 255; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.5 0.5; - text_class: "list_item"; + description { state: "visible" 0.0; + inherit: "default" 0.0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + } + part { name: "base0"; + mouse_events: 0; + clip_to: "clip_base"; + description { state: "default" 0.0; + image.normal: "dia_grad.png"; + rel1.to: "over"; + rel2.to: "over"; + fill { + smooth: 0; + size { + relative: 0.0 1.0; + offset: 64 0; + } + } } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; - } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; - } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow"; - } - } - } - - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/check/base/default"; - images { - image: "check_base.png" COMP; - image: "check.png" COMP; - image: "check2.png" COMP; - } - parts { - part { name: "bg"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.relative: 0.0 1.0; - rel2.offset: 1 -2; - align: 0.0 0.5; - min: 16 16; - max: 16 16; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - image { - normal: "check_base.png"; - border: 5 5 5 5; - middle: 0; + } + part { name: "base"; + mouse_events: 0; + clip_to: "clip_base"; + description { state: "default" 0.0; + image { + normal: "frame_2.png"; + border: 5 5 32 26; + middle: 0; + } + fill.smooth : 0; } - fill.smooth : 0; - } - } - part { name: "check"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1 { - to: "bg"; - offset: 1 1; + } + part { name: "over"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: 4 4; + } + rel2 { + to: "base"; + offset: -5 -5; + } + image { + normal: "frame_1.png"; + border: 2 2 28 22; + middle: 0; + } + fill.smooth : 0; } - rel2 { - to: "bg"; - offset: -2 -2; + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "base"; + offset: 8 8; + } + rel2 { + to: "base"; + offset: -9 -9; + } } + } + } + programs { + program { name: "push_start"; + signal: "elm,action,push"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "clip"; + target: "clip_base"; + after: "show_start2"; + } + program { name: "show_start"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "clip"; + target: "clip_base"; + after: "show_start2"; + } + program { name: "show_start2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + target: "clip_base"; + after: "show_end"; + } + program { name: "show_end"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pop_start"; + signal: "elm,action,pop"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "clip"; + target: "clip_base"; + after: "hide_start2"; + } + program { name: "hide_start"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "clip"; + target: "clip_base"; + after: "hide_start2"; + } + program { name: "hide_start2"; + action: STATE_SET "hidden" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + target: "clip_base"; + after: "hide_end"; + } + program { name: "hide_end"; + action: SIGNAL_EMIT "elm,action,hide,finished" ""; + } + program { name: "reset"; + signal: "elm,action,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "clip_base"; + target: "clip"; + } + } + } + group { name: "elm/pager/base/fade_invisible"; + data.item: "onshow" "raise"; + // other options + // data.item: "onhide" "lower"; + // data.item: "onshow" "lower"; + parts { + part { name: "clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + offset: -9999 -9999; + } + rel2 { + offset: 9999 9999; + } + color: 255 255 255 255; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + visible: 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + offset: 8 8; + } + rel2 { + offset: -9 -9; + } + } + } + } + programs { + program { name: "push_start"; + signal: "elm,action,push"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "clip"; + after: "show_start2"; + } + program { name: "show_start2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + after: "show_end"; + } + program { name: "show_end"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pop_start"; + signal: "elm,action,pop"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "clip"; + after: "hide_start2"; + } + program { name: "hide_start"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "clip"; + after: "hide_start2"; + } + program { name: "hide_start2"; + action: STATE_SET "hidden" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + after: "hide_end"; + } + program { name: "hide_end"; + action: SIGNAL_EMIT "elm,action,hide,finished" ""; + } + program { name: "reset"; + signal: "elm,action,reset"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "clip"; + } + } + } + + + +/////////////////////////////////////////////////////////////////////////////// +// FIXME: this doesn't look too hot. need to fix it up + group { name: "elm/progressbar/horizontal/default"; + images { + image: "shelf_inset.png" COMP; + image: "bt_sm_base2.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "bt_sm_shine.png" COMP; + } + parts { + part { name: "elm.background.progressbar"; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + } + } + } + part { name: "elm.swallow.bar"; + mouse_events: 0; + type: SWALLOW; + description { + min: 48 28; + max: 99999 28; + state: "default" 0.0; + rel1 { + to_x: "elm.text"; + to_y: "elm.background.progressbar"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.background.progressbar"; + relative: 1.0 1.0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; visible: 0; - color: 255 255 255 255; - image.normal: "check.png"; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - color: 128 128 128 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - visible: 1; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - visible: 0; - align: 0.0 0.5; - rel1.to_x: "bg"; - rel1.relative: 1.0 0.0; - rel1.offset: 1 1; - rel2.to_x: "bg"; - rel2.offset: 1 -2; - rel2.relative: 1.0 1.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - fixed: 1 0; - visible: 1; - aspect: 1.0 1.0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - fixed: 1 0; - visible: 1; - aspect: 1.0 1.0; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 1 1; - rel2.relative: 1.0 1.0; - rel2.offset: -2 -2; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 1; - align: 0.0 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; - } - } - part { name: "events"; - type: RECT; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "click"; - signal: "mouse,up,1"; - source: "events"; - action: SIGNAL_EMIT "elm,action,check,toggle" ""; - } - program { name: "check_on"; - signal: "elm,state,check,on"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "check"; - } - program { name: "check_off"; - signal: "elm,state,check,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "check"; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.content"; - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "disabled_visible", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); - else - set_state(PART:"elm.swallow.content", "disabled", 0.0); - - get_state(PART:"check", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"check", "disabled_visible", 0.0); - else - set_state(PART:"check", "disabled", 0.0); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); - - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - else - set_state(PART:"elm.swallow.content", "default", 0.0); - - get_state(PART:"check", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"check", "visible", 0.0); - else - set_state(PART:"check", "default", 0.0); - } + align: 0.0 0.5; + rel1 { + offset: 4 0; + to_y: "elm.background.progressbar"; + } + rel2 { + offset: 3 -1; + relative: 0.0 1.0; + to_y: "elm.background.progressbar"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 4 -1; + } } - } - } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/radio/base/default"; - images { - image: "radio_base.png" COMP; - image: "radio.png" COMP; - image: "radio2.png" COMP; - } - parts { - part { name: "bg"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.relative: 0.0 1.0; - rel2.offset: 1 -2; - align: 0.0 0.5; - min: 16 16; - max: 16 16; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - image.normal: "radio_base.png"; - } - } - part { name: "radio"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; visible: 0; - image.normal: "radio.png"; - } - description { state: "visible" 0.0; + fixed: 1 1; + align: 0.0 0.5; + rel1.to_x: "elm.swallow.content"; + rel1.relative: 1.0 0.0; + rel1.offset: -1 4; + rel2.to_x: "elm.swallow.content"; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -5; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.0 0.5; + } + } + description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; + text.min: 1 1; + rel1.offset: 0 4; + rel2.offset: 0 -5; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - visible: 0; - align: 0.0 0.5; - color: 0 0 0 0; - rel1.to_x: "bg"; - rel1.relative: 1.0 0.0; - rel1.offset: 1 1; - rel2.to_x: "bg"; - rel2.relative: 1.0 1.0; - rel2.offset: 2 -2; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - aspect: 1.0 1.0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 128 128 128 128; - visible: 1; - aspect: 1.0 1.0; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: 1 1; - rel2.relative: 1.0 1.0; - rel2.offset: -2 -2; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.0 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - visible: 1; - text.min: 1 1; - } - } - part { name: "events"; - type: RECT; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "click"; - signal: "mouse,up,1"; - source: "events"; - action: SIGNAL_EMIT "elm,action,radio,toggle" ""; - } - program { name: "radio_on"; - signal: "elm,state,radio,on"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "radio"; - } - program { name: "radio_off"; - signal: "elm,state,radio,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "radio"; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.content"; - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "disabled_visible", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); - else - set_state(PART:"elm.swallow.content", "disabled", 0.0); - } } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_visible")) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.swallow.content", "visible", 0.0); - else - set_state(PART:"elm.swallow.content", "default", 0.0); - } - } - } - } - group { name: "elm/genlist/tree_compress_odd/double_label/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text elm.text.sub"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - data.item: "treesize" "20"; -// data.item: "states" ""; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; + part { name: "background"; mouse_events: 0; + clip_to: "elm.background.progressbar"; description { state: "default" 0.0; + rel1 { + to: "elm.swallow.bar"; + relative: 0.0 0.0; + } + rel2 { + to: "elm.swallow.bar"; + relative: 1.0 1.0; + offset: -1 -1; + } image { - normal: "ilist_2.png"; - border: 2 2 2 2; + normal: "shelf_inset.png"; + border: 7 7 7 7; } - fill.smooth: 0; } } - part { name: "bg"; - clip_to: "disclip"; + + part { name: "elm.text.status"; + type: TEXT; mouse_events: 0; description { state: "default" 0.0; + fixed: 1 1; + visible: 1; + rel1 { + to: "background"; + relative: 0.5 0.5; + } + rel2 { + to: "background"; + relative: 0.5 0.5; + } + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + align: 0.5 0.0; + } + color: 0 0 0 255; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; visible: 0; - color: 255 255 255 0; + text.min: 0 0; + } + } + + part { name: "elm.progress.progressbar"; + mouse_events: 0; + clip_to: "elm.background.progressbar"; + description { + state: "default" 0.0; + min: 14 28; + fixed: 1 1; rel1 { + to: "elm.swallow.bar"; relative: 0.0 0.0; - offset: -5 -5; } rel2 { - relative: 1.0 1.0; - offset: 4 4; + to_y: "elm.swallow.bar"; + to_x: "elm.cur.progressbar"; + offset: -1 -1; } image { - normal: "bt_sm_base1.png"; + normal: "bt_sm_base2.png"; border: 6 6 6 6; } - image.middle: SOLID; } - description { state: "selected" 0.0; + description { + state: "invert" 0.0; inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; rel1 { - relative: 0.0 0.0; - offset: -2 -2; + to_y: "elm.swallow.bar"; + to_x: "elm.cur.progressbar"; } rel2 { + to: "elm.swallow.bar"; relative: 1.0 1.0; - offset: 1 1; } } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; + description { + state: "state_begin" 0.0; + inherit: "default" 0.0; rel1 { - relative: 0.0 0.0; - offset: 4 4; + to: "elm.swallow.bar"; + relative: 0.0 0.0; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "arrow"; - clip_to: "disclip"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - aspect: 1.0 1.0; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + to: "elm.swallow.bar"; + relative: 0.1 1.0; } - image.normal: "icon_arrow_right.png"; } - description { state: "active" 0.0; + description { + state: "state_end" 0.0; inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "arrow"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; rel1 { - relative: 1.0 0.0; - offset: -5 4; + to: "elm.swallow.bar"; + relative: 0.9 0.0; } rel2 { - relative: 1.0 1.0; - offset: -5 -5; + to: "elm.swallow.bar"; + relative: 1.0 1.0; } } } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; + part { name: "text-bar"; + type: TEXT; + mouse_events: 0; + clip_to: "progress-rect"; + effect: SOFT_SHADOW; scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 0.5; - offset: -1 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 1 1; + visible: 1; + rel1.to: "elm.text.status"; + rel1.offset: -1 -1; + rel2.to: "elm.text.status"; text { - font: "Sans"; + text_source: "elm.text.status"; + font: "Sans:style=Bold,Edje-Vera-Bold"; size: 10; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; + min: 1 1; + align: 0.0 0.0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; color: 224 224 224 255; color3: 0 0 0 64; } - } - part { name: "elm.text.sub"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; + description { state: "hidden" 0.0; inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; + visible: 0; + text.min: 0 0; } } - part { name: "fg1"; - clip_to: "disclip"; + + part { name: "over1"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; + rel1.to: "elm.progress.progressbar"; + rel2.to: "elm.progress.progressbar"; rel2.relative: 1.0 0.5; - rel2.to: "bg"; image { normal: "bt_sm_hilight.png"; border: 6 6 6 0; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; + + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; + rel1.to: "elm.progress.progressbar"; + rel2.to: "elm.progress.progressbar"; image { normal: "bt_sm_shine.png"; border: 6 6 6 0; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + + part { name: "elm.cur.progressbar"; + mouse_events: 0; + dragable { + confine: "background"; + x: 1 1 1; + y: 0 0 0; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; + description { state: "default" 0.0; + min: 14 28; + fixed: 1 1; + visible: 0; + rel1 { + to: "background"; + relative: 0 0; + } + rel2.to: "background"; + } + } + part { name: "progress-rect"; + mouse_events: 0; + description { + state: "default" 0.0; + rel1.to: "elm.progress.progressbar"; + rel2.to: "elm.progress.progressbar"; } } } programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - target: "elm.text.sub"; + program { name: "label_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; + program { name: "label_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - target: "elm.text.sub"; - transition: LINEAR 0.1; + target: "elm.text"; } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; action: STATE_SET "default" 0.0; - target: "disclip"; + target: "elm.swallow.content"; } - program { - name: "expand"; - signal: "mouse,up,1"; - source: "arrow"; - action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; + program { name: "units_show"; + signal: "elm,state,units,visible"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "text-bar"; + target: "elm.text.status"; } - program { - name: "go_expanded"; - signal: "elm,state,expanded"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "arrow"; + program { name: "units_hide"; + signal: "elm,state,units,hidden"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "text-bar"; + target: "elm.text.status"; } - program { - name: "go_contracted"; - signal: "elm,state,contracted"; - source: "elm"; + program { name: "slide_to_end"; + action: STATE_SET "state_end" 0.0; + transition: LINEAR 0.5; + target: "elm.progress.progressbar"; + after: "slide_to_begin"; + } + program { name: "slide_to_begin"; + signal: "elm,state,slide,begin"; + action: STATE_SET "state_begin" 0.0; + target: "elm.progress.progressbar"; + transition: LINEAR 0.5; + after: "slide_to_end"; + } + program { name: "start_pulse"; + signal: "elm,state,pulse,start"; + source: "elm"; + after: "slide_to_end"; + } + program { name: "stop_pulse"; + signal: "elm,state,pulse,stop"; + source: "elm"; + action: ACTION_STOP; + target: "slide_to_begin"; + target: "slide_to_end"; + target: "start_pulse"; + after: "state_pulse"; + } + program { name: "state_pulse"; + signal: "elm,state,pulse"; + source: "elm"; + action: STATE_SET "state_begin" 0.0; + target: "elm.progress.progressbar"; + after: "units_hide"; + } + program { name: "state_fraction"; + signal: "elm,state,fraction"; + source: "elm"; + action: ACTION_STOP; + target: "slide_to_begin"; + target: "slide_to_end"; + target: "start_pulse"; + action: STATE_SET "default" 0.0; + target: "elm.progress.progressbar"; + } + program { name: "set_invert_on"; + signal: "elm,state,inverted,on"; + source: "elm"; + action: STATE_SET "invert" 0.0; + target: "elm.progress.progressbar"; + } + program { name: "set_invert_off"; + signal: "elm,state,inverted,off"; + source: "elm"; action: STATE_SET "default" 0.0; - target: "arrow"; + target: "elm.progress.progressbar"; } } } - group { name: "elm/genlist/item_compress/media/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text.title elm.text.album-artist"; - data.item: "treesize" "20"; +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/progressbar/vertical/default"; images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; + image: "shelf_inset.png" COMP; + image: "bt_sm_base2.png" COMP; image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; + image: "bt_sm_shine.png" COMP; } parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; + part { name: "elm.background.progressbar"; + type: RECT; mouse_events: 0; description { state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; rel1 { - to: "base"; - relative: 0.0 1.0; + relative: 0.0 0.0; offset: 0 0; } rel2 { - to: "base"; relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; + offset: -1 -1; } - fill.smooth: 0; } } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; + part { name: "elm.swallow.bar"; + type: SWALLOW; + scale: 1; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + min: 28 48; + max: 28 9999; + align: 0.5 1.0; rel1 { - relative: 0.0 0.0; - offset: -2 -2; + to_y: "elm.text"; + relative: 0.0 1.0; + offset: 0 2; } rel2 { - relative: 1.0 1.0; - offset: 1 1; + to_y: "elm.text.box"; + relative: 1.0 0.0; + offset: -1 -3; } } } - part { name: "elm.swallow.pad"; + part { name: "elm.swallow.content"; type: SWALLOW; description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; + visible: 0; + align: 0.5 0.0; rel1 { - relative: 0.0 0.0; - offset: 4 4; + offset: 0 4; + to_x: "elm.swallow.bar"; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + offset: -1 3; + relative: 1.0 0.0; + to_x: "elm.swallow.bar"; } } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + rel2.offset: -1 4; + } } - part { name: "elm.text.title"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; scale: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 0.5; - offset: -1 -5; - } + description { state: "default" 0.0; + visible: 0; + fixed: 1 1; + align: 0.5 0.0; + rel1.to_y: "elm.swallow.content"; + rel1.relative: 0.5 1.0; + rel1.offset: 0 -1; + rel2.to_y: "elm.swallow.content"; + rel2.relative: 0.5 1.0; + rel2.offset: -1 -1; color: 0 0 0 255; - color3: 0 0 0 0; text { - font: "Sans"; + font: "Sans,Edje-Vera"; size: 10; - min: 0 1; - align: 0.0 0.5; + min: 0 0; + align: 0.5 0.0; } } - description { state: "selected" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + visible: 1; + text.min: 1 1; + rel1.offset: 4 0; + rel2.offset: -5 0; } } - part { name: "elm.text.album-artist"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; + + part { name: "background"; + mouse_events: 0; + clip_to: "elm.background.progressbar"; description { state: "default" 0.0; rel1 { - relative: 0.0 0.5; - offset: 4 4; + to: "elm.swallow.bar"; + relative: 0.0 0.0; } rel2 { - relative: 1.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 0 1; - align: 0.0 0.5; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + to: "elm.swallow.bar"; + relative: 1.0 1.0; + offset: -1 -1; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + normal: "shelf_inset.png"; + border: 7 7 7 7; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.album-artist"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.album-artist"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - group { name: "elm/genlist/item_compress_odd/media/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text.title elm.text.album-artist"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; + + part { name: "elm.progress.progressbar"; mouse_events: 0; + clip_to: "elm.background.progressbar"; description { state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; + min: 28 14; + fixed: 1 1; rel1 { + to: "elm.swallow.bar"; relative: 0.0 0.0; - offset: -5 -5; } rel2 { - relative: 1.0 1.0; - offset: 4 4; + to_x: "elm.swallow.bar"; + to_y: "elm.cur.progressbar"; + offset: -1 -1; } image { - normal: "bt_sm_base1.png"; + normal: "bt_sm_base2.png"; border: 6 6 6 6; } - image.middle: SOLID; } - description { state: "selected" 0.0; + description { + state: "invert" 0.0; inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; rel1 { - relative: 0.0 0.0; - offset: -2 -2; + to_x: "elm.swallow.bar"; + to_y: "elm.cur.progressbar"; } rel2 { + to: "elm.swallow.bar"; relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; } } - } - part { name: "elm.text.title"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; description { - state: "default" 0.0; + state: "state_begin" 0.0; + inherit: "default" 0.0; rel1 { - relative: 0.0 0.0; - offset: 4 4; + to: "elm.swallow.bar"; + relative: 0.0 0.0; } rel2 { - relative: 1.0 0.5; - offset: -1 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.0 0.5; + to: "elm.swallow.bar"; + relative: 1.0 0.1; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "elm.text.album-artist"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; description { - state: "default" 0.0; + state: "state_end" 0.0; + inherit: "default" 0.0; rel1 { - relative: 0.0 0.5; - offset: 4 4; + to: "elm.swallow.bar"; + relative: 0.0 0.9; } rel2 { - relative: 1.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 0 1; - align: 0.0 0.5; + to: "elm.swallow.bar"; + relative: 1.0 1.0; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } } - part { name: "fg1"; - clip_to: "disclip"; + + part { name: "over1"; mouse_events: 0; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; + rel1.to: "elm.progress.progressbar"; + rel2.to: "elm.progress.progressbar"; rel2.relative: 1.0 0.5; - rel2.to: "bg"; image { normal: "bt_sm_hilight.png"; border: 6 6 6 0; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; + + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; + rel1.to: "elm.progress.progressbar"; + rel2.to: "elm.progress.progressbar"; image { normal: "bt_sm_shine.png"; border: 6 6 6 0; } } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.album-artist"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.album-artist"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; } - } - } - group { name: "elm/genlist/item_compress/media-album/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text.title elm.text.trackno elm.text.length"; - data.item: "states" "elm.state.trackno"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - script { - public dot_visible; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; + part { name: "elm.cur.progressbar"; mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; + dragable { + confine: "background"; + x: 0 0 0; + y: 1 1 1; + } + description { state: "default" 0.0; + min: 28 14; fixed: 1 1; + visible: 0; rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; + to: "background"; + relative: 0 0; } - fill.smooth: 0; - } + rel2.to: "background"; + } } - part { name: "bg"; - clip_to: "disclip"; + + part { name: "elm.text.box"; mouse_events: 0; + type: RECT; description { state: "default" 0.0; visible: 0; - color: 255 255 255 0; rel1 { - relative: 0.0 0.0; - offset: -5 -5; + to: "elm.text.status"; + offset: -2 -2; } rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + to: "elm.text.status"; + offset: 2 2; } - image.middle: SOLID; + color: 255 255 255 0; } - description { state: "selected" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } } } - part { - name: "elm.text.trackno"; + part { name: "elm.text.status"; type: TEXT; - scale: 1; mouse_events: 0; - description { - state: "default" 0.0; - color: 255 255 255 255; - align: 0.0 0.0; - fixed: 1 0; - rel1 { - to_y: "elm.text.title"; - relative: 0.0 0.0; - offset: 5 0; - } - rel2 { - to_y: "elm.text.title"; - relative: 0.0 1.0; - offset: 20 0; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; - align: 1.0 0.5; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { - name: "dot"; - type: TEXT; scale: 1; - mouse_events: 0; - description { - state: "default" 0.0; - color: 255 255 255 255; + description { state: "default" 0.0; visible: 0; fixed: 1 1; - align: 0.0 0.0; - rel1 { - to_x: "elm.text.trackno"; - to_y: "elm.text.title"; - relative: 1.0 0.0; - offset: 1 0; - } - rel2 { - to_x: "elm.text.trackno"; - to_y: "elm.text.title"; - relative: 1.0 1.0; - offset: 1 0; - - } + align: 0.5 1.0; + rel1.relative: 0.0 1.0; + rel1.offset: 2 0; + rel2.relative: 1.0 1.0; + rel2.offset: -2 0; color: 0 0 0 255; - color3: 0 0 0 0; text { - font: "Sans"; + font: "Sans:style=Bold,Edje-Vera-Bold"; size: 10; - min: 1 1; - align: 0.0 0.5; - text: "."; + min: 0 0; + align: 0.5 0.0; } } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "selected" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + fixed: 1 1; visible: 1; + text.min: 1 1; + rel1.offset: 8 -9; + rel2.offset: -9 -9; } } - programs { - program { - signal: "elm,state,elm.state.trackno,active"; - source: "elm"; - script { - set_state(PART:"dot", "visible", 0.0); - set_int(dot_visible, 1); - } - } - } - part { name: "elm.text.title"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - to_x: "dot"; - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 1.0 0.5; - offset: -1 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.0 0.5; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } + } + programs { + program { name: "label_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; } - part { name: "elm.text.length"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.5; - offset: 4 4; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -5; - } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 0 1; - align: 0.0 0.5; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } + program { name: "label_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } + program { name: "units_show"; + signal: "elm,state,units,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text.status"; + target: "elm.text.box"; } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.trackno"; - target: "elm.text.length"; - after: "dot_active"; + program { name: "units_hide"; + signal: "elm,state,units,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.status"; + target: "elm.text.box"; } - program { - name: "dot_active"; - script { - if (get_int(dot_visible) == 1) - set_state(PART:"dot", "selected", 0.0); - } + program { name: "slide_to_end"; + action: STATE_SET "state_end" 0.0; + transition: LINEAR 0.5; + target: "elm.progress.progressbar"; + after: "slide_to_begin"; } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.length"; - target: "elm.text.trackno"; - transition: LINEAR 0.1; - after: "dot_passive"; + program { name: "slide_to_begin"; + action: STATE_SET "state_begin" 0.0; + target: "elm.progress.progressbar"; + transition: LINEAR 0.5; + after: "slide_to_end"; } - program { - name: "dot_passive"; - script { - if (get_int(dot_visible) == 1) - set_state(PART:"dot", "visible", 0.0); - } + program { name: "start_pulse"; + signal: "elm,state,pulse,start"; + source: "elm"; + action: STATE_SET "state_begin" 0.0; + target: "elm.progress.progressbar"; + after: "slide_to_end"; } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; + program { name: "stop_pulse"; + signal: "elm,state,pulse,stop"; + source: "elm"; + action: ACTION_STOP; + target: "slide_to_begin"; + target: "slide_to_end"; + target: "start_pulse"; + after: "state_pulse"; } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; + program { name: "state_pulse"; + signal: "elm,state,pulse"; + source: "elm"; + action: STATE_SET "state_begin" 0.0; + target: "elm.progress.progressbar"; + after: "units_hide"; + } + program { name: "state_fraction"; + signal: "elm,state,fraction"; + source: "elm"; + action: ACTION_STOP; + target: "slide_to_begin"; + target: "slide_to_end"; + target: "start_pulse"; + action: STATE_SET "default" 0.0; + target: "elm.progress.progressbar"; + } + program { name: "set_invert_on"; + signal: "elm,state,inverted,on"; + source: "elm"; + action: STATE_SET "invert" 0.0; + target: "elm.progress.progressbar"; + target: "elm.cur.progressbar"; + } + program { name: "set_invert_off"; + signal: "elm,state,inverted,off"; + source: "elm"; action: STATE_SET "default" 0.0; - target: "disclip"; + target: "elm.progress.progressbar"; + target: "elm.cur.progressbar"; } } } - group { name: "elm/genlist/item_compress_odd/media-album/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text.title elm.text.trackno elm.text.length"; - data.item: "states" "elm.state.trackno"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - } - script { - public dot_visible; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/separator/horizontal/default"; + images { + image: "separator_h.png" COMP; + } + parts { + part { name: "separator"; // separator group + description { state: "default" 0.0; + min: 2 2; + rel1.offset: 4 4; + rel2.offset: -5 -5; + image { + normal: "separator_h.png"; + } + fill { + smooth: 0; + } } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; + } + } + } + + /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/separator/vertical/default"; + images { + image: "separator_v.png" COMP; + } + parts { + part { name: "separator"; // separator group + description { state: "default" 0.0; + min: 2 2; + rel1.offset: 4 4; + rel2.offset: -5 -5; + image { + normal: "separator_v.png"; + } + fill { + smooth: 0; + } } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + } + } + } + + group { name: "elm/progressbar/horizontal/wheel"; + images { + image: "busy-1.png" COMP; + image: "busy-2.png" COMP; + image: "busy-3.png" COMP; + image: "busy-4.png" COMP; + image: "busy-5.png" COMP; + image: "busy-6.png" COMP; + image: "busy-7.png" COMP; + image: "busy-8.png" COMP; + image: "busy-9.png" COMP; + } + parts { + part { name: "elm.background.progressbar"; + mouse_events: 0; + type: RECT; + description { + state: "default" 0.0; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + part { name: "elm.swallow.bar"; + mouse_events: 0; + type: SWALLOW; + description { state: "default" 0.0; + min: 0 0; + max: 0 0; + visible: 0; } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + min: 0 0; + max: 0 0; + visible: 0; } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + } + part { name: "background"; + mouse_events: 0; + clip_to: "elm.background.progressbar"; + description { + state: "default" 0.0; + min: 32 32; + max: 32 32; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: BOTH; + image { + normal: "busy-9.png"; + border: 7 7 7 7; + } } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; + description { + state: "pulse" 0.0; + inherit: "default" 0.0; + image { + normal: "busy-9.png"; + tween: "busy-1.png"; + tween: "busy-2.png"; + tween: "busy-3.png"; + tween: "busy-4.png"; + tween: "busy-5.png"; + tween: "busy-6.png"; + tween: "busy-7.png"; + tween: "busy-8.png"; + border: 7 7 7 7; + } } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; + } + } + programs { + program { name: "start_pulse"; + signal: "elm,state,pulse,start"; + source: "elm"; + action: STATE_SET "pulse" 0.0; + target: "background"; + transition: LINEAR 0.5; + after: "start_pulse"; + } + program { name: "stop_pulse"; + signal: "elm,state,pulse,stop"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "background"; + } + } + } + + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/spinner/base/default"; + images { + image: "shelf_inset.png" COMP; + image: "bt_base1.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + image: "sp_bt_l.png" COMP; + image: "sp_bt_r.png" COMP; + } + parts { + part { name: "bg"; + type: RECT; + description { state: "default" 0.0; + max: 99999 30; + min: 0 30; + rel1.offset: 1 1; + rel2.offset: -2 -2; + color: 255 255 255 0; } - } - } - part { - name: "elm.text.trackno"; - type: TEXT; - scale: 1; - mouse_events: 0; - description { - state: "default" 0.0; - color: 255 255 255 255; - align: 0.0 0.0; - fixed: 1 0; - rel1 { - to_y: "elm.text.title"; - relative: 0.0 0.0; - offset: 5 0; + } + part { name: "conf_over"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "shelf_inset.png"; + border: 7 7 7 7; + middle: 0; + } + fill.smooth : 0; } - rel2 { - to_y: "elm.text.title"; - relative: 0.0 1.0; - offset: 20 0; + } + part { name: "left_bt"; + mouse_events: 1; + description { state: "default" 0.0; + rel1 { to: "bg"; + offset: 2 2; + } + rel2 { to: "bg"; + offset: -3 -3; + } + align: 0.0 0.5; + min: 24 24; + max: 24 24; + image { + normal: "bt_base1.png"; + border: 6 6 6 6; + } + fill.smooth : 0; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; - align: 1.0 0.5; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { - name: "dot"; - type: TEXT; - scale: 1; - mouse_events: 0; - description { - state: "default" 0.0; - color: 255 255 255 255; - visible: 0; - fixed: 1 1; - align: 0.0 0.0; - rel1 { - to_x: "elm.text.trackno"; - to_y: "elm.text.title"; - relative: 1.0 0.0; - offset: 1 0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } - rel2 { - to_x: "elm.text.trackno"; - to_y: "elm.text.title"; - relative: 1.0 1.0; - offset: 1 0; - + } + part { name: "left_over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "left_bt"; + rel2 { to: "left_bt"; + relative: 1.0 0.5; + } + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 1 1; - align: 0.0 0.5; - text: "."; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - visible: 1; - } - } - programs { - program { - signal: "elm,state,elm.state.trackno,active"; - source: "elm"; - script { - set_state(PART:"dot", "visible", 0.0); - set_int(dot_visible, 1); + } + part { name: "left_over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + rel1.to: "left_bt"; + rel2.to: "left_bt"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } } - } - } - part { name: "elm.text.title"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - to_x: "dot"; - relative: 1.0 0.0; - offset: 4 4; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; } - rel2 { - relative: 1.0 0.5; - offset: -1 -5; + } + part { name: "left_over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "left_bt"; + rel2.to: "left_bt"; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.0 0.5; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "elm.text.length"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.5; - offset: 4 4; + } + part { name: "right_bt"; + mouse_events: 1; + description { state: "default" 0.0; + rel1 { to: "bg"; + offset: -27 3; + } + rel2 { to: "bg"; + offset: -3 -3; + } + align: 1.0 0.5; + min: 24 24; + max: 24 24; + image { + normal: "bt_base1.png"; + border: 5 5 4 12; + } + fill.smooth : 0; } - rel2 { - relative: 1.0 1.0; - offset: -1 -5; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 0 1; - align: 0.0 0.5; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + } + part { name: "right_over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "right_bt"; + rel2 { to: "right_bt"; + relative: 1.0 0.5; + } + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.length"; - target: "elm.text.trackno"; - after: "dot_active"; - } - program { - name: "dot_active"; - script { - if (get_int(dot_visible) == 1) - set_state(PART:"dot", "selected", 0.0); - } - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.length"; - target: "elm.text.trackno"; - transition: LINEAR 0.1; - after: "dot_passive"; - } - program { - name: "dot_passive"; - script { - if (get_int(dot_visible) == 1) - set_state(PART:"dot", "visible", 0.0); - } - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - - group { name: "elm/genlist/item_compress/media-preview/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text.title elm.text.artist"; - data.item: "icons" "elm.swallow.preview"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; + } + part { name: "right_over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + rel1.to: "right_bt"; + rel2.to: "right_bt"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; } - image { - normal: "ilist_item_shadow.png"; + } + part { name: "right_over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "right_bt"; + rel2.to: "right_bt"; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; + } + part { name: "left_bt_icon"; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "left_bt"; + rel2.to: "left_bt"; + align: 0.5 0.5; + min: 16 16; + max: 16 16; + image.normal: "sp_bt_l.png"; } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + } + part { name: "right_bt_icon"; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "right_bt"; + rel2.to: "right_bt"; + align: 0.5 0.5; + min: 16 16; + max: 16 16; + image.normal: "sp_bt_r.png"; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; + offset: 3 2; + to_x: "left_bt"; + to_y: "bg"; + } + rel2 { relative: 0.0 1.0; + offset: -3 -2; + to_x: "right_bt"; + to_y: "bg"; + } + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; + description { state: "active" 0.0; + inherit: "default" 0.0; + visible: 0; } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + description { state: "disabled_active" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; + } + part { name: "elm.dragable.slider"; + type: RECT; + mouse_events: 0; + scale: 1; + dragable { + x: 1 1 0; + y: 0 0 0; } - } - } - part { name: "elm.swallow.preview"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - min: 68 68; - max: 68 68; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + fixed: 1 1; + color: 0 0 0 0; } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + } + part { name: "button_events"; + type: RECT; + dragable { + events: "elm.dragable.slider"; } - } - } - part { name: "elm.text.title"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - to_x: "elm.swallow.preview"; - relative: 1.0 0.0; - offset: 4 4; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.text"; + rel2.to: "elm.text"; + color: 0 0 0 0; } - rel2 { - relative: 1.0 0.5; - offset: -1 -5; + } + part { name: "elm.swallow.entry"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.5; + rel1 { relative: 1.0 0.5; + offset: 3 2; + to_x: "left_bt"; + to_y: "bg"; + } + rel2 { relative: 0.0 0.5; + offset: -3 -2; + to_x: "right_bt"; + to_y: "bg"; + } + fixed: 1 1; + color: 0 0 0 0; } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.0 0.5; + description { state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "elm.text.artist"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - to_x: "elm.swallow.preview"; - relative: 1.0 0.5; - offset: 4 4; + description { state: "disabled_active" 0.0; + inherit: "default" 0.0; + visible: 0; } - rel2 { - relative: 1.0 1.0; - offset: -1 -5; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 0 1; - align: 0.0 0.5; + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + } + } + programs { + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "dec"; + signal: "mouse,down,1"; + source: "left_bt"; + action: SIGNAL_EMIT "elm,action,decrement,start" ""; + } + program { name: "dec2"; + signal: "mouse,up,1"; + source: "left_bt"; + action: SIGNAL_EMIT "elm,action,decrement,stop" ""; + } + program { name: "inc"; + signal: "mouse,down,1"; + source: "right_bt"; + action: SIGNAL_EMIT "elm,action,increment,start" ""; + } + program { name: "inc2"; + signal: "mouse,up,1"; + source: "right_bt"; + action: SIGNAL_EMIT "elm,action,increment,stop" ""; + } + program { + name: "left_bt_click"; + signal: "mouse,down,1"; + source: "left_over2"; + action: STATE_SET "clicked" 0.0; + target: "left_bt"; + } + program { + name: "left_bt_unclick"; + signal: "mouse,up,1"; + source: "left_over2"; + action: STATE_SET "default" 0.0; + target: "left_bt"; + } + program { + name: "left_bt_click2"; + signal: "mouse,down,1"; + source: "left_over3"; + action: STATE_SET "clicked" 0.0; + target: "left_over3"; + } + program { + name: "left_bt_unclick2"; + signal: "mouse,up,1"; + source: "left_over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "left_over3"; + } + program { + name: "left_bt_unclick3"; + signal: "mouse,up,1"; + source: "left_over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + + program { + name: "right_bt_click"; + signal: "mouse,down,1"; + source: "right_over2"; + action: STATE_SET "clicked" 0.0; + target: "right_bt"; + } + program { + name: "right_bt_unclick"; + signal: "mouse,up,1"; + source: "right_over2"; + action: STATE_SET "default" 0.0; + target: "right_bt"; + } + program { + name: "right_bt_click2"; + signal: "mouse,down,1"; + source: "right_over3"; + action: STATE_SET "clicked" 0.0; + target: "right_over3"; + } + program { + name: "right_bt_unclick2"; + signal: "mouse,up,1"; + source: "right_over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "right_over3"; + } + program { + name: "right_bt_unclick3"; + signal: "mouse,up,1"; + source: "right_over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "left_bt"; + target: "left_over1"; + target: "left_over2"; + target: "right_bt"; + target: "right_over1"; + target: "right_over2"; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "active")) + set_state(PART:"elm.text", "disabled_active", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + + get_state(PART:"elm.swallow.entry", st, 30, vl); + if (!strcmp(st, "active")) + set_state(PART:"elm.swallow.entry", "disabled_active", 0.0); + else + set_state(PART:"elm.swallow.entry", "disabled", 0.0); } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.artist"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.artist"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "left_bt"; + target: "left_over1"; + target: "left_over2"; + target: "right_bt"; + target: "right_over1"; + target: "right_over2"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_active")) + set_state(PART:"elm.text", "active", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + + get_state(PART:"elm.swallow.entry", st, 30, vl); + if (!strcmp(st, "disabled_active")) + set_state(PART:"elm.swallow.entry", "active", 0.0); + else + set_state(PART:"elm.swallow.entry", "default", 0.0); + } + } + program { name: "active"; + signal: "elm,state,active"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "elm.text"; + target: "elm.swallow.entry"; + } + program { name: "inactive"; + signal: "elm,state,inactive"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "elm.swallow.entry"; + } + program { name: "toggle_text"; + signal: "mouse,up,1"; + source: "button_events"; + action: SIGNAL_EMIT "elm,action,entry,toggle" ""; + } + } } - group { name: "elm/genlist/item_compress_odd/media-preview/default"; - data.item: "stacking" "below"; - data.item: "selectraise" "on"; - data.item: "labels" "elm.text.title elm.text.artist"; - data.item: "icons" "elm.swallow.preview"; - data.item: "treesize" "20"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_2.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/spinner/base/vertical"; + images { + image: "shelf_inset.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + image: "up.png" COMP; + image: "down.png" COMP; + image: "bt_spinner_up.png" COMP; + image: "bt_spinner_down.png" COMP; + image: "bt_spinner_hilight.png" COMP; + } + parts { + part { name: "bg"; + type: RECT; + description { state: "default" 0.0; + max: 99999 30; + min: 0 30; + rel1.offset: 1 1; + rel2.offset: -2 -2; + color: 255 255 255 0; } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; + } + part { name: "conf_over"; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "bg"; + relative: 0.0 0.0; + } + rel2 { + to_x: "down_bt"; + offset: -22 -1; + } + rel2 { + to_y: "bg"; + } + image { + normal: "shelf_inset.png"; + border: 7 7 7 7; + middle: 0; + } + fill.smooth : 0; } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + } + part { name: "down_bt"; + mouse_events: 1; + description { state: "default" 0.0; + rel1 { + to_x: "bg"; + to_y: "up_bt"; + relative: 1 1; + offset: 0 1; + } + rel2 { to: "bg"; + relative: 1 1; + offset: -1 -1; + } + align: 1.0 0.5; + min: 24 16; + max: 24 16; + image { + normal: "bt_spinner_down.png"; + border: 6 6 6 6; + } + fill.smooth : 0; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_spinner_down.png"; + image.middle: SOLID; } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + } + part { name: "down_over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "down_bt"; + rel2.to: "down_bt"; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; + } + part { name: "up_bt"; + mouse_events: 1; + description { state: "default" 0.0; + rel1 { to: "bg"; + relative: 0 0; + offset: 0 0; + } + rel2 { to: "bg"; + relative: 1 0.5; + offset: -1 -1; + } + align: 1.0 0.5; + min: 24 16; + max: 24 16; + image { + normal: "bt_spinner_up.png"; + border: 6 6 6 6; + } + fill.smooth : 0; } - } - } - part { name: "elm.swallow.preview"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - min: 68 68; - max: 68 68; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_spinner_up.png"; + image.middle: SOLID; } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } - } - } - part { name: "elm.text.title"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - to_x: "elm.swallow.preview"; - relative: 1.0 0.0; - offset: 4 4; + } + part { name: "up_over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "up_bt"; + rel2 { to: "up_bt"; + relative: 1.0 0.5; + } + image { + normal: "bt_spinner_hilight.png"; + border: 7 7 7 0; + } } - rel2 { - relative: 1.0 0.5; - offset: -1 -5; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.0 0.5; + } + part { name: "up_over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "up_bt"; + rel2.to: "up_bt"; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "elm.text.artist"; - clip_to: "disclip"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - rel1 { - to_x: "elm.swallow.preview"; - relative: 1.0 0.5; - offset: 4 4; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - rel2 { - relative: 1.0 1.0; - offset: -1 -5; + } + part { name: "down_bt_icon"; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "down_bt"; + rel2.to: "down_bt"; + align: 0.5 0.5; + min: 14 12; + max: 14 12; + image.normal: "down.png"; } - color: 0 0 0 128; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 8; - min: 0 1; - align: 0.0 0.5; + } + part { name: "up_bt_icon"; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "up_bt"; + rel2.to: "up_bt"; + align: 0.5 0.5; + min: 14 12; + max: 14 12; + image.normal: "up.png"; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - color3: 0 0 0 32; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + rel1 { relative: 0.0 0.0; + offset: 3 2; + to_x: "bg"; + to_y: "bg"; + } + rel2 { relative: 0.0 1.0; + offset: -3 -2; + to_x: "bg"; + to_y: "bg"; + } + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; + description { state: "active" 0.0; + inherit: "default" 0.0; + visible: 0; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.artist"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text.title"; - target: "elm.text.artist"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/pager/base/default"; - data.item: "onshow" "raise"; -// other options -// data.item: "onhide" "lower"; -// data.item: "onshow" "lower"; - images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; - } - parts { - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: -9999 -9999; + description { state: "disabled_active" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; } - rel2 { - to: "base"; - offset: 9999 9999; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; } - color: 255 255 255 255; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "base0"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - image.normal: "dia_grad.png"; - rel1.to: "over"; - rel2.to: "over"; - fill { - smooth: 0; - size { - relative: 0.0 1.0; - offset: 64 0; - } - } - } - } - part { name: "base"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - fill.smooth : 0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - } - } - part { name: "over"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 4 4; + } + part { name: "elm.dragable.slider"; + type: RECT; + mouse_events: 0; + scale: 1; + dragable { + x: 1 1 0; + y: 0 0 0; } - rel2 { - to: "base"; - offset: -5 -5; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + fixed: 1 1; + color: 0 0 0 0; } - image { - normal: "frame_1.png"; - border: 2 2 28 22; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 8 8; + } + part { name: "button_events"; + type: RECT; + dragable { + events: "elm.dragable.slider"; } - rel2 { - to: "base"; - offset: -9 -9; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.text"; + rel2.to: "elm.text"; + color: 0 0 0 0; } - } - } - } - programs { - program { name: "push_start"; - signal: "elm,action,push"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "base"; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "base"; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pop_start"; - signal: "elm,action,pop"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - target: "clip"; - after: "hide_start2"; - } - program { name: "hide_start"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - target: "clip"; - after: "hide_start2"; - } - program { name: "hide_start2"; - action: STATE_SET "hidden" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - program { name: "reset"; - signal: "elm,action,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - target: "clip"; - } - } - } - - group { name: "elm/pager/base/slide"; - images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; - } - parts { - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: -9999 -9999; - } - rel2 { - to: "base"; - offset: 9999 9999; - } - color: 255 255 255 255; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - description { state: "hidden2" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "base0"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - image.normal: "dia_grad.png"; - rel1.to: "over"; - rel2.to: "over"; - fill { - smooth: 0; - size { - relative: 0.0 1.0; - offset: 64 0; - } - } - } - } - part { name: "base"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - fill.smooth : 0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - } - description { state: "hidden2" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - } - } - part { name: "over"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 4 4; - } - rel2 { - to: "base"; - offset: -5 -5; - } - image { - normal: "frame_1.png"; - border: 2 2 28 22; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 8 8; - } - rel2 { - to: "base"; - offset: -9 -9; - } - } - } - } - programs { - program { name: "push_start"; - signal: "elm,action,push"; - source: "elm"; - action: STATE_SET "hidden2" 0.0; - target: "base"; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "base"; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pop_start"; - signal: "elm,action,pop"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - target: "clip"; - after: "pop_start2"; - } - program { name: "pop_start2"; - action: STATE_SET "hidden2" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "hide_end"; - } - program { name: "hide_start"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - target: "clip"; - after: "hide_start2"; - } - program { name: "hide_start2"; - action: STATE_SET "hidden" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - program { name: "reset"; - signal: "elm,action,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - target: "clip"; - } - } - } - group { name: "elm/pager/base/slide_invisible"; - parts { - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: -9999 -9999; - } - rel2 { - to: "base"; - offset: 9999 9999; - } - color: 255 255 255 255; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - description { state: "hidden2" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "base"; - type: RECT; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - color: 0 0 0 0; - } - description { state: "hidden" 0.0; - color: 0 0 0 0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - } - description { state: "hidden2" 0.0; - color: 0 0 0 0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; - } - description { state: "visible" 0.0; - color: 0 0 0 0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - } - } - } - programs { - program { name: "push_start"; - signal: "elm,action,push"; - source: "elm"; - action: STATE_SET "hidden2" 0.0; - target: "base"; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "base"; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pop_start"; - signal: "elm,action,pop"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - target: "clip"; - after: "pop_start2"; - } - program { name: "pop_start2"; - action: STATE_SET "hidden2" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "hide_end"; - } - program { name: "hide_start"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - target: "clip"; - after: "hide_start2"; - } - program { name: "hide_start2"; - action: STATE_SET "hidden" 0.0; - transition: DECELERATE 0.5; - target: "base"; - target: "clip"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - program { name: "reset"; - signal: "elm,action,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - target: "clip"; - } - } - } - - group { name: "elm/pager/base/fade"; - data.item: "onshow" "raise"; - // other options - // data.item: "onhide" "lower"; - // data.item: "onshow" "lower"; - images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; - } - parts { - part { name: "clip_base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: -9999 -9999; - } - rel2 { - to: "base"; - offset: 9999 9999; - } - color: 255 255 255 120; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: -9999 -9999; - } - rel2 { - to: "base"; - offset: 9999 9999; - } - color: 255 255 255 255; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "base0"; - mouse_events: 0; - clip_to: "clip_base"; - description { state: "default" 0.0; - image.normal: "dia_grad.png"; - rel1.to: "over"; - rel2.to: "over"; - fill { - smooth: 0; - size { - relative: 0.0 1.0; - offset: 64 0; - } - } - } - } - part { name: "base"; - mouse_events: 0; - clip_to: "clip_base"; - description { state: "default" 0.0; - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "over"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 4 4; - } - rel2 { - to: "base"; - offset: -5 -5; - } - image { - normal: "frame_1.png"; - border: 2 2 28 22; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 8 8; - } - rel2 { - to: "base"; - offset: -9 -9; - } - } - } - } - programs { - program { name: "push_start"; - signal: "elm,action,push"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "clip"; - target: "clip_base"; - after: "show_start2"; - } - program { name: "show_start"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "clip"; - target: "clip_base"; - after: "show_start2"; - } - program { name: "show_start2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - target: "clip_base"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pop_start"; - signal: "elm,action,pop"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "clip"; - target: "clip_base"; - after: "hide_start2"; - } - program { name: "hide_start"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "clip"; - target: "clip_base"; - after: "hide_start2"; - } - program { name: "hide_start2"; - action: STATE_SET "hidden" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - target: "clip_base"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - program { name: "reset"; - signal: "elm,action,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "clip_base"; - target: "clip"; - } - } - } - group { name: "elm/pager/base/fade_translucide"; - data.item: "onshow" "raise"; - // other options - // data.item: "onhide" "lower"; - // data.item: "onshow" "lower"; - images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; - } - parts { - part { name: "clip_base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: -9999 -9999; - } - rel2 { - to: "base"; - offset: 9999 9999; - } - color: 255 255 255 120; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: -9999 -9999; - } - rel2 { - to: "base"; - offset: 9999 9999; - } - color: 255 255 255 255; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "base0"; - mouse_events: 0; - clip_to: "clip_base"; - description { state: "default" 0.0; - image.normal: "dia_grad.png"; - rel1.to: "over"; - rel2.to: "over"; - fill { - smooth: 0; - size { - relative: 0.0 1.0; - offset: 64 0; - } - } - } - } - part { name: "base"; - mouse_events: 0; - clip_to: "clip_base"; - description { state: "default" 0.0; - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "over"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 4 4; - } - rel2 { - to: "base"; - offset: -5 -5; - } - image { - normal: "frame_1.png"; - border: 2 2 28 22; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "base"; - offset: 8 8; - } - rel2 { - to: "base"; - offset: -9 -9; - } - } - } - } - programs { - program { name: "push_start"; - signal: "elm,action,push"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "clip"; - target: "clip_base"; - after: "show_start2"; - } - program { name: "show_start"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "clip"; - target: "clip_base"; - after: "show_start2"; - } - program { name: "show_start2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - target: "clip_base"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pop_start"; - signal: "elm,action,pop"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "clip"; - target: "clip_base"; - after: "hide_start2"; - } - program { name: "hide_start"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "clip"; - target: "clip_base"; - after: "hide_start2"; - } - program { name: "hide_start2"; - action: STATE_SET "hidden" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - target: "clip_base"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - program { name: "reset"; - signal: "elm,action,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "clip_base"; - target: "clip"; - } - } - } - group { name: "elm/pager/base/fade_invisible"; - data.item: "onshow" "raise"; - // other options - // data.item: "onhide" "lower"; - // data.item: "onshow" "lower"; - parts { - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - offset: -9999 -9999; - } - rel2 { - offset: 9999 9999; - } - color: 255 255 255 255; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - offset: 8 8; - } - rel2 { - offset: -9 -9; - } - } - } - } - programs { - program { name: "push_start"; - signal: "elm,action,push"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "clip"; - after: "show_start2"; - } - program { name: "show_start2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - after: "show_end"; - } - program { name: "show_end"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pop_start"; - signal: "elm,action,pop"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "clip"; - after: "hide_start2"; - } - program { name: "hide_start"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "clip"; - after: "hide_start2"; - } - program { name: "hide_start2"; - action: STATE_SET "hidden" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - after: "hide_end"; - } - program { name: "hide_end"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - program { name: "reset"; - signal: "elm,action,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "clip"; - } - } - } - - group { name: "elm/pager/base/flip"; - data.item: "onshow" "raise"; - images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; - } - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - map { - on: 1; - smooth: 1; - backface_cull: 1; - perspective_on: 1; - } - perspective { - zplane: 0; - focal: 1000; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - map.rotation.y: 90.0; - } - description { state: "before_hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - map.rotation.y: -90.0; - } - } - } - programs { - program { name: "push_start"; - signal: "elm,action,push"; - source: "elm"; - after: "push1"; - } - program { name: "push1"; - action: STATE_SET "hidden" 0.0; - target: "elm.swallow.content"; - after: "push2"; - } - program { name: "push2"; - action: STATE_SET "default" 0.0; - in: 0.5 0.0; - transition: LINEAR 0.5; - target: "elm.swallow.content"; - after: "push3"; - } - program { name: "push3"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - - program { name: "show_start"; - signal: "elm,action,show"; - source: "elm"; - after: "show1"; - } - program { name: "show1"; - action: STATE_SET "before_hidden" 0.0; - target: "elm.swallow.content"; - after: "show2"; - } - program { name: "show2"; - action: STATE_SET "default" 0.0; - in: 0.5 0.0; - transition: LINEAR 0.5; - target: "elm.swallow.content"; - after: "show3"; - } - program { name: "show3"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - - program { name: "pop_start"; - signal: "elm,action,pop"; - source: "elm"; - after: "pop1"; - } - program { name: "pop1"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - after: "pop2"; - } - program { name: "pop2"; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "elm.swallow.content"; - after: "pop3"; - } - program { name: "pop3"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - - program { name: "hide_start"; - signal: "elm,action,hide"; - source: "elm"; - after: "hide1"; - } - program { name: "hide1"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - after: "hide2"; - } - program { name: "hide2"; - action: STATE_SET "before_hidden" 0.0; - transition: LINEAR 0.5; - target: "elm.swallow.content"; - after: "hide3"; - } - program { name: "hide3"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - - program { name: "reset"; - signal: "elm,action,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - } - } - - - -/////////////////////////////////////////////////////////////////////////////// -// FIXME: this doesn't look too hot. need to fix it up - group { name: "elm/progressbar/horizontal/default"; - images { - image: "shelf_inset.png" COMP; - image: "bt_sm_base2.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "bt_sm_shine.png" COMP; - } - parts { - part { name: "elm.background.progressbar"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - } - } - } - part { name: "elm.swallow.bar"; - mouse_events: 0; - type: SWALLOW; - description { - min: 48 28; - max: 99999 28; - state: "default" 0.0; - rel1 { - to_x: "elm.text"; - to_y: "elm.background.progressbar"; - relative: 1.0 0.0; - } - rel2 { - to: "elm.background.progressbar"; - relative: 1.0 1.0; - } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - offset: 4 0; - to_y: "elm.background.progressbar"; - } - rel2 { - offset: 3 -1; - relative: 0.0 1.0; - to_y: "elm.background.progressbar"; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel2.offset: 4 -1; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.0 0.5; - rel1.to_x: "elm.swallow.content"; - rel1.relative: 1.0 0.0; - rel1.offset: -1 4; - rel2.to_x: "elm.swallow.content"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -5; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.0 0.5; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - rel1.offset: 0 4; - rel2.offset: 0 -5; - } - } - - part { name: "background"; - mouse_events: 0; - clip_to: "elm.background.progressbar"; - description { - state: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.0; - } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - } - } - } - - part { name: "elm.text.status"; - type: TEXT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 1; - rel1 { - to: "background"; - relative: 0.5 0.5; - } - rel2 { - to: "background"; - relative: 0.5 0.5; - } - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 1 1; - align: 0.5 0.0; - } - color: 0 0 0 255; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - text.min: 0 0; - } - } - - part { name: "elm.progress.progressbar"; - mouse_events: 0; - clip_to: "elm.background.progressbar"; - description { - state: "default" 0.0; - min: 14 28; - fixed: 1 1; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.0; - } - rel2 { - to_y: "elm.swallow.bar"; - to_x: "elm.cur.progressbar"; - offset: -1 -1; - } - image { - normal: "bt_sm_base2.png"; - border: 6 6 6 6; - } - } - description { - state: "invert" 0.0; - inherit: "default" 0.0; - rel1 { - to_y: "elm.swallow.bar"; - to_x: "elm.cur.progressbar"; - } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; - } - } - description { - state: "state_begin" 0.0; - inherit: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.0; - } - rel2 { - to: "elm.swallow.bar"; - relative: 0.1 1.0; - } - } - description { - state: "state_end" 0.0; - inherit: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.9 0.0; - } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; - } - } - } - part { name: "text-bar"; - type: TEXT; - mouse_events: 0; - clip_to: "progress-rect"; - effect: SOFT_SHADOW; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - visible: 1; - rel1.to: "elm.text.status"; - rel1.offset: -1 -1; - rel2.to: "elm.text.status"; - text { - text_source: "elm.text.status"; - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 1 1; - align: 0.0 0.0; - } - color: 224 224 224 255; - color3: 0 0 0 64; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - text.min: 0 0; - } - } - - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.progress.progressbar"; - rel2.to: "elm.progress.progressbar"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - } - - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.progress.progressbar"; - rel2.to: "elm.progress.progressbar"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - } - - part { name: "elm.cur.progressbar"; - mouse_events: 0; - dragable { - confine: "background"; - x: 1 1 1; - y: 0 0 0; - } - description { state: "default" 0.0; - min: 14 28; - fixed: 1 1; - visible: 0; - rel1 { - to: "background"; - relative: 0 0; - } - rel2.to: "background"; - } - } - part { name: "progress-rect"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1.to: "elm.progress.progressbar"; - rel2.to: "elm.progress.progressbar"; - } - } - } - programs { - program { name: "label_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "label_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.content"; - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - program { name: "units_show"; - signal: "elm,state,units,visible"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "text-bar"; - target: "elm.text.status"; - } - program { name: "units_hide"; - signal: "elm,state,units,hidden"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "text-bar"; - target: "elm.text.status"; - } - program { name: "slide_to_end"; - action: STATE_SET "state_end" 0.0; - transition: LINEAR 0.5; - target: "elm.progress.progressbar"; - after: "slide_to_begin"; - } - program { name: "slide_to_begin"; - signal: "elm,state,slide,begin"; - action: STATE_SET "state_begin" 0.0; - target: "elm.progress.progressbar"; - transition: LINEAR 0.5; - after: "slide_to_end"; - } - program { name: "start_pulse"; - signal: "elm,state,pulse,start"; - source: "elm"; - after: "slide_to_end"; - } - program { name: "stop_pulse"; - signal: "elm,state,pulse,stop"; - source: "elm"; - action: ACTION_STOP; - target: "slide_to_begin"; - target: "slide_to_end"; - target: "start_pulse"; - after: "state_pulse"; - } - program { name: "state_pulse"; - signal: "elm,state,pulse"; - source: "elm"; - action: STATE_SET "state_begin" 0.0; - target: "elm.progress.progressbar"; - after: "units_hide"; - } - program { name: "state_fraction"; - signal: "elm,state,fraction"; - source: "elm"; - action: ACTION_STOP; - target: "slide_to_begin"; - target: "slide_to_end"; - target: "start_pulse"; - action: STATE_SET "default" 0.0; - target: "elm.progress.progressbar"; - } - program { name: "set_invert_on"; - signal: "elm,state,inverted,on"; - source: "elm"; - action: STATE_SET "invert" 0.0; - target: "elm.progress.progressbar"; - } - program { name: "set_invert_off"; - signal: "elm,state,inverted,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.progress.progressbar"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/progressbar/vertical/default"; - images { - image: "shelf_inset.png" COMP; - image: "bt_sm_base2.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "bt_sm_shine.png" COMP; - } - parts { - part { name: "elm.background.progressbar"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - } - } - part { name: "elm.swallow.bar"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - min: 28 48; - max: 28 9999; - align: 0.5 1.0; - rel1 { - to_y: "elm.text"; - relative: 0.0 1.0; - offset: 0 2; - } - rel2 { - to_y: "elm.text.box"; - relative: 1.0 0.0; - offset: -1 -3; - } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - rel1 { - offset: 0 4; - to_x: "elm.swallow.bar"; - } - rel2 { - offset: -1 3; - relative: 1.0 0.0; - to_x: "elm.swallow.bar"; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - rel2.offset: -1 4; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.0; - rel1.to_y: "elm.swallow.content"; - rel1.relative: 0.5 1.0; - rel1.offset: 0 -1; - rel2.to_y: "elm.swallow.content"; - rel2.relative: 0.5 1.0; - rel2.offset: -1 -1; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; - rel1.offset: 4 0; - rel2.offset: -5 0; - } - } - - part { name: "background"; - mouse_events: 0; - clip_to: "elm.background.progressbar"; - description { - state: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.0; - } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - } - } - } - - part { name: "elm.progress.progressbar"; - mouse_events: 0; - clip_to: "elm.background.progressbar"; - description { - state: "default" 0.0; - min: 28 14; - fixed: 1 1; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.0; - } - rel2 { - to_x: "elm.swallow.bar"; - to_y: "elm.cur.progressbar"; - offset: -1 -1; - } - image { - normal: "bt_sm_base2.png"; - border: 6 6 6 6; - } - } - description { - state: "invert" 0.0; - inherit: "default" 0.0; - rel1 { - to_x: "elm.swallow.bar"; - to_y: "elm.cur.progressbar"; - } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; - } - } - description { - state: "state_begin" 0.0; - inherit: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.0; - } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 0.1; - } - } - description { - state: "state_end" 0.0; - inherit: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.9; - } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; - } - } - } - - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.progress.progressbar"; - rel2.to: "elm.progress.progressbar"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - } - - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.progress.progressbar"; - rel2.to: "elm.progress.progressbar"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - } - - part { name: "elm.cur.progressbar"; - mouse_events: 0; - dragable { - confine: "background"; - x: 0 0 0; - y: 1 1 1; - } - description { state: "default" 0.0; - min: 28 14; - fixed: 1 1; - visible: 0; - rel1 { - to: "background"; - relative: 0 0; - } - rel2.to: "background"; - } - } - - part { name: "elm.text.box"; - mouse_events: 0; - type: RECT; - description { state: "default" 0.0; - visible: 0; - rel1 { - to: "elm.text.status"; - offset: -2 -2; - } - rel2 { - to: "elm.text.status"; - offset: 2 2; - } - color: 255 255 255 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.text.status"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 1.0; - rel1.relative: 0.0 1.0; - rel1.offset: 2 0; - rel2.relative: 1.0 1.0; - rel2.offset: -2 0; - color: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 0 0; - align: 0.5 0.0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - fixed: 1 1; - visible: 1; - text.min: 1 1; - rel1.offset: 8 -9; - rel2.offset: -9 -9; - } - } - } - programs { - program { name: "label_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "label_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.content"; - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - } - program { name: "units_show"; - signal: "elm,state,units,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text.status"; - target: "elm.text.box"; - } - program { name: "units_hide"; - signal: "elm,state,units,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text.status"; - target: "elm.text.box"; - } - program { name: "slide_to_end"; - action: STATE_SET "state_end" 0.0; - transition: LINEAR 0.5; - target: "elm.progress.progressbar"; - after: "slide_to_begin"; - } - program { name: "slide_to_begin"; - action: STATE_SET "state_begin" 0.0; - target: "elm.progress.progressbar"; - transition: LINEAR 0.5; - after: "slide_to_end"; - } - program { name: "start_pulse"; - signal: "elm,state,pulse,start"; - source: "elm"; - action: STATE_SET "state_begin" 0.0; - target: "elm.progress.progressbar"; - after: "slide_to_end"; - } - program { name: "stop_pulse"; - signal: "elm,state,pulse,stop"; - source: "elm"; - action: ACTION_STOP; - target: "slide_to_begin"; - target: "slide_to_end"; - target: "start_pulse"; - after: "state_pulse"; - } - program { name: "state_pulse"; - signal: "elm,state,pulse"; - source: "elm"; - action: STATE_SET "state_begin" 0.0; - target: "elm.progress.progressbar"; - after: "units_hide"; - } - program { name: "state_fraction"; - signal: "elm,state,fraction"; - source: "elm"; - action: ACTION_STOP; - target: "slide_to_begin"; - target: "slide_to_end"; - target: "start_pulse"; - action: STATE_SET "default" 0.0; - target: "elm.progress.progressbar"; - } - program { name: "set_invert_on"; - signal: "elm,state,inverted,on"; - source: "elm"; - action: STATE_SET "invert" 0.0; - target: "elm.progress.progressbar"; - target: "elm.cur.progressbar"; - } - program { name: "set_invert_off"; - signal: "elm,state,inverted,off"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.progress.progressbar"; - target: "elm.cur.progressbar"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/separator/horizontal/default"; - images { - image: "separator_h.png" COMP; - } - parts { - part { name: "separator"; // separator group - description { state: "default" 0.0; - min: 2 2; - rel1.offset: 4 4; - rel2.offset: -5 -5; - image { - normal: "separator_h.png"; - } - fill { - smooth: 0; - } - } - } - } - } - - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/separator/vertical/default"; - images { - image: "separator_v.png" COMP; - } - parts { - part { name: "separator"; // separator group - description { state: "default" 0.0; - min: 2 2; - rel1.offset: 4 4; - rel2.offset: -5 -5; - image { - normal: "separator_v.png"; - } - fill { - smooth: 0; - } - } - } - } - } - - group { name: "elm/progressbar/horizontal/wheel"; - images { - image: "busy-1.png" COMP; - image: "busy-2.png" COMP; - image: "busy-3.png" COMP; - image: "busy-4.png" COMP; - image: "busy-5.png" COMP; - image: "busy-6.png" COMP; - image: "busy-7.png" COMP; - image: "busy-8.png" COMP; - image: "busy-9.png" COMP; - } - parts { - part { name: "elm.background.progressbar"; - mouse_events: 0; - type: RECT; - description { - state: "default" 0.0; - } - } - part { name: "elm.swallow.bar"; - mouse_events: 0; - type: SWALLOW; - description { state: "default" 0.0; - min: 0 0; - max: 0 0; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - min: 0 0; - max: 0 0; - visible: 0; - } - } - part { name: "background"; - mouse_events: 0; - clip_to: "elm.background.progressbar"; - description { - state: "default" 0.0; - min: 32 32; - max: 32 32; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: BOTH; - image { - normal: "busy-9.png"; - border: 7 7 7 7; - } - } - description { - state: "pulse" 0.0; - inherit: "default" 0.0; - image { - normal: "busy-9.png"; - tween: "busy-1.png"; - tween: "busy-2.png"; - tween: "busy-3.png"; - tween: "busy-4.png"; - tween: "busy-5.png"; - tween: "busy-6.png"; - tween: "busy-7.png"; - tween: "busy-8.png"; - border: 7 7 7 7; - } - } - } - } - programs { - program { name: "start_pulse"; - signal: "elm,state,pulse,start"; - source: "elm"; - action: STATE_SET "pulse" 0.0; - target: "background"; - transition: LINEAR 0.5; - after: "start_pulse"; - } - program { name: "stop_pulse"; - signal: "elm,state,pulse,stop"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "background"; - } - } - } - - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/spinner/base/default"; - images { - image: "shelf_inset.png" COMP; - image: "bt_base1.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - image: "sp_bt_l.png" COMP; - image: "sp_bt_r.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - min: 0 30; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 0; - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "left_bt"; - mouse_events: 1; - description { state: "default" 0.0; - rel1 { to: "bg"; - offset: 3 3; - } - rel2 { to: "bg"; - offset: -4 -4; - } - align: 0.0 0.5; - min: 24 24; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - image { - normal: "bt_base1.png"; - border: 6 6 6 6; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part { name: "left_over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "left_bt"; - rel2 { to: "left_bt"; - relative: 1.0 0.5; - } - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "left_over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "left_bt"; - rel2.to: "left_bt"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "left_over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "left_bt"; - rel2.to: "left_bt"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "right_bt"; - mouse_events: 1; - description { state: "default" 0.0; - rel1 { to: "bg"; - offset: -26 3; - } - rel2 { to: "bg"; - offset: -4 -4; - } - align: 1.0 0.5; - min: 24 24; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - image { - normal: "bt_base1.png"; - border: 5 5 4 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part { name: "right_over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "right_bt"; - rel2 { to: "right_bt"; - relative: 1.0 0.5; - } - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "right_over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "right_bt"; - rel2.to: "right_bt"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "right_over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "right_bt"; - rel2.to: "right_bt"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "left_bt_icon"; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "left_bt"; - rel1.offset: 4 4; - rel2.to: "left_bt"; - rel2.offset: -5 -5; - align: 0.5 0.5; - min: 16 16; - aspect: 1.0 1.0; - aspect_preference: BOTH; - image.normal: "sp_bt_l.png"; - } - } - part { name: "right_bt_icon"; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "right_bt"; - rel1.offset: 4 4; - rel2.to: "right_bt"; - rel2.offset: -5 -5; - align: 0.5 0.5; - min: 16 16; - aspect: 1.0 1.0; - aspect_preference: BOTH; - image.normal: "sp_bt_r.png"; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 1; - align: 0.0 0.5; - rel1 { relative: 1.0 0.0; - offset: 3 2; - to_x: "left_bt"; - to_y: "bg"; - } - rel2 { relative: 0.0 1.0; - offset: -3 -2; - to_x: "right_bt"; - to_y: "bg"; - } - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 1 1; - align: 0.5 0.5; - } - } - description { state: "active" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { state: "disabled_active" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - } - part { name: "elm.dragable.slider"; - type: RECT; - mouse_events: 0; - scale: 1; - dragable { - x: 1 1 0; - y: 0 0 0; - } - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - fixed: 1 1; - color: 0 0 0 0; - } - } - part { name: "button_events"; - type: RECT; - dragable { - events: "elm.dragable.slider"; - } - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.text"; - rel2.to: "elm.text"; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.entry"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.5; - rel1 { relative: 1.0 0.5; - offset: 3 2; - to_x: "left_bt"; - to_y: "bg"; - } - rel2 { relative: 0.0 0.5; - offset: -3 -2; - to_x: "right_bt"; - to_y: "bg"; - } - fixed: 1 1; - color: 0 0 0 0; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { state: "disabled_active" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "dec"; - signal: "mouse,down,1"; - source: "left_bt"; - action: SIGNAL_EMIT "elm,action,decrement,start" ""; - } - program { name: "dec2"; - signal: "mouse,up,1"; - source: "left_bt"; - action: SIGNAL_EMIT "elm,action,decrement,stop" ""; - } - program { name: "inc"; - signal: "mouse,down,1"; - source: "right_bt"; - action: SIGNAL_EMIT "elm,action,increment,start" ""; - } - program { name: "inc2"; - signal: "mouse,up,1"; - source: "right_bt"; - action: SIGNAL_EMIT "elm,action,increment,stop" ""; - } - program { - name: "left_bt_click"; - signal: "mouse,down,1"; - source: "left_over2"; - action: STATE_SET "clicked" 0.0; - target: "left_bt"; - } - program { - name: "left_bt_unclick"; - signal: "mouse,up,1"; - source: "left_over2"; - action: STATE_SET "default" 0.0; - target: "left_bt"; - } - program { - name: "left_bt_click2"; - signal: "mouse,down,1"; - source: "left_over3"; - action: STATE_SET "clicked" 0.0; - target: "left_over3"; - } - program { - name: "left_bt_unclick2"; - signal: "mouse,up,1"; - source: "left_over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "left_over3"; - } - program { - name: "left_bt_unclick3"; - signal: "mouse,up,1"; - source: "left_over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { - name: "left_bt_pressed_anim"; - signal: "elm,left,anim,activate"; - source: "elm"; - action: STATE_SET "clicked" 0.0; - target: "left_bt"; - target: "left_over3"; - after: "left_bt_unpressed_anim"; - } - program { - name: "left_bt_unpressed_anim"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "left_bt"; - target: "left_over3"; - } - - program { - name: "right_bt_click"; - signal: "mouse,down,1"; - source: "right_over2"; - action: STATE_SET "clicked" 0.0; - target: "right_bt"; - } - program { - name: "right_bt_unclick"; - signal: "mouse,up,1"; - source: "right_over2"; - action: STATE_SET "default" 0.0; - target: "right_bt"; - } - program { - name: "right_bt_click2"; - signal: "mouse,down,1"; - source: "right_over3"; - action: STATE_SET "clicked" 0.0; - target: "right_over3"; - } - program { - name: "right_bt_unclick2"; - signal: "mouse,up,1"; - source: "right_over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "right_over3"; - } - program { - name: "right_bt_unclick3"; - signal: "mouse,up,1"; - source: "right_over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { - name: "right_bt_pressed_anim"; - signal: "elm,right,anim,activate"; - source: "elm"; - action: STATE_SET "clicked" 0.0; - target: "right_bt"; - target: "right_over3"; - after: "right_bt_unpressed_anim"; - } - program { - name: "right_bt_unpressed_anim"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "right_bt"; - target: "right_over3"; - } - - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "left_bt"; - target: "left_over1"; - target: "left_over2"; - target: "right_bt"; - target: "right_over1"; - target: "right_over2"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "active")) - set_state(PART:"elm.text", "disabled_active", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - - get_state(PART:"elm.swallow.entry", st, 30, vl); - if (!strcmp(st, "active")) - set_state(PART:"elm.swallow.entry", "disabled_active", 0.0); - else - set_state(PART:"elm.swallow.entry", "disabled", 0.0); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "left_bt"; - target: "left_over1"; - target: "left_over2"; - target: "right_bt"; - target: "right_over1"; - target: "right_over2"; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_active")) - set_state(PART:"elm.text", "active", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); - - get_state(PART:"elm.swallow.entry", st, 30, vl); - if (!strcmp(st, "disabled_active")) - set_state(PART:"elm.swallow.entry", "active", 0.0); - else - set_state(PART:"elm.swallow.entry", "default", 0.0); - } - } - program { name: "active"; - signal: "elm,state,active"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "elm.text"; - target: "elm.swallow.entry"; - } - program { name: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "elm.swallow.entry"; - } - program { name: "toggle_text"; - signal: "mouse,up,1"; - source: "button_events"; - action: SIGNAL_EMIT "elm,action,entry,toggle" ""; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/spinner/base/vertical"; - images { - image: "shelf_inset.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - image: "up.png" COMP; - image: "down.png" COMP; - image: "bt_spinner_up.png" COMP; - image: "bt_spinner_down.png" COMP; - image: "bt_spinner_hilight.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - min: 0 30; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 0; - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "bg"; - relative: 0.0 0.0; - } - rel2 { - to: "bg"; - } - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "down_bt"; - mouse_events: 1; - description { state: "default" 0.0; - fixed: 1 1; - rel1 { - to: "up_bt"; - relative: 0 1; - offset: 0 1; - } - rel2 { - to_y: "bg"; - to_x: "up_bt"; - relative: 1 1; - offset: -1 -4; - } - align: 1.0 0.5; - min: 24 16; - image { - normal: "bt_spinner_down.png"; - border: 6 6 6 6; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_spinner_down.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part { name: "down_over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "down_bt"; - rel2.to: "down_bt"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "up_bt"; - mouse_events: 1; - description { state: "default" 0.0; - fixed: 1 0; - rel1 { to: "bg"; - relative: 0 0; - offset: 0 2; - } - rel2 { to: "bg"; - relative: 1 0.5; - offset: -3 0; - } - align: 1.0 0.5; - min: 24 16; - aspect: 1.5 1.0; - aspect_preference: BOTH; - image { - normal: "bt_spinner_up.png"; - border: 6 6 6 6; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_spinner_up.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part { name: "up_over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "up_bt"; - rel2 { to: "up_bt"; - relative: 1.0 0.5; - } - image { - normal: "bt_spinner_hilight.png"; - border: 7 7 7 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "up_over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "up_bt"; - rel2.to: "up_bt"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "down_bt_icon"; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "down_bt"; - rel1.offset: 5 3; - rel2.to: "down_bt"; - rel2.offset: -6 -3; - align: 0.5 0.5; - image.normal: "down.png"; - } - } - part { name: "up_bt_icon"; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "up_bt"; - rel1.offset: 5 3; - rel2.to: "up_bt"; - rel2.offset: -6 -3; - align: 0.5 0.5; - image.normal: "up.png"; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 1; - align: 0.0 0.5; - rel1 { relative: 0.0 0.0; - offset: 3 2; - to_x: "bg"; - to_y: "bg"; - } - rel2 { relative: 0.0 1.0; - offset: -3 -2; - to_x: "down_bt"; - to_y: "bg"; - } - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 1 1; - align: 0.5 0.5; - } - } - description { state: "active" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { state: "disabled_active" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; - } - } - part { name: "elm.dragable.slider"; - type: RECT; - mouse_events: 0; - scale: 1; - dragable { - x: 1 1 0; - y: 0 0 0; - } - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - fixed: 1 1; - color: 0 0 0 0; - } - } - part { name: "button_events"; - type: RECT; - dragable { - events: "elm.dragable.slider"; - } - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.text"; - rel2.to: "elm.text"; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.entry"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.5; - rel1 { relative: 0.0 0.5; - offset: 3 2; - to: "bg"; - } - rel2 { relative: 1.0 0.5; - offset: -3 -2; - to: "bg"; - } - fixed: 1 1; - color: 0 0 0 0; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { state: "disabled_active" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "dec"; - signal: "mouse,down,1"; - source: "down_bt"; - action: SIGNAL_EMIT "elm,action,decrement,start" ""; - } - program { name: "dec2"; - signal: "mouse,up,1"; - source: "down_bt"; - action: SIGNAL_EMIT "elm,action,decrement,stop" ""; - } - program { name: "inc"; - signal: "mouse,down,1"; - source: "up_bt"; - action: SIGNAL_EMIT "elm,action,increment,start" ""; - } - program { name: "inc2"; - signal: "mouse,up,1"; - source: "up_bt"; - action: SIGNAL_EMIT "elm,action,increment,stop" ""; - } - program { - name: "down_bt_click2"; - signal: "mouse,down,1"; - source: "down_over3"; - action: STATE_SET "clicked" 0.0; - target: "down_over3"; - } - program { - name: "down_bt_unclick2"; - signal: "mouse,up,1"; - source: "down_over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "down_over3"; - } - program { - name: "up_bt_click2"; - signal: "mouse,down,1"; - source: "up_over3"; - action: STATE_SET "clicked" 0.0; - target: "up_over3"; - } - program { - name: "up_bt_unclick2"; - signal: "mouse,up,1"; - source: "up_over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "up_over3"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "down_bt"; - target: "up_bt"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "active")) - set_state(PART:"elm.text", "disabled_active", 0.0); - else - set_state(PART:"elm.text", "disabled", 0.0); - - get_state(PART:"elm.swallow.entry", st, 30, vl); - if (!strcmp(st, "active")) - set_state(PART:"elm.swallow.entry", "disabled_active", 0.0); - else - set_state(PART:"elm.swallow.entry", "disabled", 0.0); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "down_bt"; - target: "up_bt"; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "disabled_active")) - set_state(PART:"elm.text", "active", 0.0); - else - set_state(PART:"elm.text", "default", 0.0); - - get_state(PART:"elm.swallow.entry", st, 30, vl); - if (!strcmp(st, "disabled_active")) - set_state(PART:"elm.swallow.entry", "active", 0.0); - else - set_state(PART:"elm.swallow.entry", "default", 0.0); - } - } - program { name: "active"; - signal: "elm,state,active"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "elm.text"; - target: "elm.swallow.entry"; - } - program { name: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "elm.swallow.entry"; - } - program { name: "toggle_text"; - signal: "mouse,up,1"; - source: "button_events"; - action: SIGNAL_EMIT "elm,action,entry,toggle" ""; - } - } - } - - - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/index/base/vertical/default"; - images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - } - parts { - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { state: "active" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "clip2"; - type: RECT; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { state: "active" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "elm.swallow.index.0"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - fixed: 1 1; - rel1 { - relative: 1.0 0.5; - offset: -1 5; - } - rel2 { - relative: 1.0 0.5; - offset: -1 -6; - } - } - } - part { name: "button_image"; - mouse_events: 1; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "elm.text.body"; - offset: -5 -5; - } - rel2 { - to: "elm.text"; - offset: 4 4; - } - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - } - part { name: "elm.text.body"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - clip_to: "clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - fixed: 1 1; - rel1 { - to: "elm.text"; - relative: 0.0 0.0; - offset: 5 0; - } - rel2 { - to: "elm.text"; - relative: 0.0 1.0; - offset: 5 -1; - } - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 20; - min: 1 1; - align: 1.0 0.5; - } - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - clip_to: "clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - fixed: 1 1; - rel1 { - to_x: "elm.swallow.event.0"; - to_y: "elm.dragable.pointer"; - relative: 0.0 0.5; - offset: -16 0; - } - rel2 { - to_x: "elm.swallow.event.0"; - to_y: "elm.dragable.pointer"; - relative: 0.0 0.5; - offset: -16 -1; - } - color: 255 0 0 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 20; - min: 1 1; - align: 1.0 0.5; - } - } - } - part { name: "over1"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "button_image"; - } - rel2 { - to: "button_image"; - relative: 1.0 0.5; - } - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - to: "button_image"; - } - rel2 { - to: "button_image"; - } - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - } - part { name: "elm.dragable.pointer"; - type: RECT; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 1 1 0; - } - clip_to: "clip"; - description { state: "default" 0.0; - fixed: 1 1; - min: 8 8; - max: 8 8; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 0.0 0.0; - offset: 0 0; - } - color: 0 0 255 128; - } - } - part { name: "elm.swallow.event.0"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.5; - fixed: 1 1; - rel1 { - relative: 1.0 0.0; - offset: -1 0; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - } - } - } - programs { - program { name: "active"; - signal: "elm,state,active"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - } - program { name: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - } - } - } - - group { name: "elm/index/item/vertical/default"; - data.item: "stacking" "above"; - data.item: "selectraise" "on"; - images { - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - parts { - part { - name: "base_sh"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - rel1 { - offset: -16 0; - } - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - // min: 16 16; - rel1 { - to: "base"; - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -5 -5; - } - color: 0 0 0 128; - text { - font: "Sans"; - size: 10; - min: 1 1; - // min: 0 1; - align: 0.0 0.5; - } - } - description { state: "active" 0.0; - inherit: "default" 0.0; - color: 0 0 0 255; - } - } - } - programs { - program { name: "active"; - signal: "elm,state,active"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: DECELERATE 0.5; - target: "elm.text"; - target: "base"; - } - program { name: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "elm.text"; - target: "base"; - } - } - } - - group { name: "elm/index/item_odd/vertical/default"; - data.item: "stacking" "below"; - images { - image: "ilist_2.png" COMP; - } - parts { - part { - name: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - image { - normal: "ilist_2.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - description { state: "active" 0.0; - inherit: "default" 0.0; - rel1 { - offset: -16 0; - } - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - // min: 16 16; - rel1 { - to: "base"; - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -5 -5; - } - color: 0 0 0 128; - text { - font: "Sans"; - size: 10; - min: 1 1; - // min: 0 1; - align: 0.0 0.5; - } - } - description { state: "active" 0.0; - inherit: "default" 0.0; - color: 0 0 0 255; - } - } - } - programs { - program { name: "active"; - signal: "elm,state,active"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: DECELERATE 0.5; - target: "elm.text"; - target: "base"; - } - program { name: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "elm.text"; - target: "base"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/gengrid/item/default/default"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "base_sh"; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { name: "base"; - mouse_events: 0; - description { state: "default" 0.0; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 1.0; - offset: 0 -10; - } - rel2 { - to_y: "elm.text"; - relative: 0.0 0.0; - offset: -1 -1; - } - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; - rel1 { - relative: 0.0 0.0; - offset: -1 4; - } - rel2 { - to_y: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 -5; - } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.0; - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - rel1 { - relative: 1.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 5 5; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.5 0.0; - text_class: "grid_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - group { name: "elm/gengrid/item/default_style/default"; - styles - { - style { name: "gengrid_style"; - base: "font=Sans font_size=10 align=left valign=0.5 color=#000 text_class=grid_item"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font=Sans:style=Bold"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "tab" "\t"; - } - style { name: "gengrid_selected_style"; - base: "font=Sans font_size=10 align=left valign=0.5 color=#fff text_class=grid_item"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font=Sans:style=Bold"; - tag: "b" "+ font=Sans:style=Bold"; - tag: "tab" "\t"; - } - } - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon elm.swallow.end"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_item_shadow.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "base_sh"; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; - rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; - } - fill.smooth: 0; - } - } - part { name: "base"; - mouse_events: 0; - description { state: "default" 0.0; - min: 16 28; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -5 -5; - } - rel2 { - relative: 1.0 1.0; - offset: 4 4; - } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - } - image.middle: SOLID; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - rel1 { - relative: 0.0 0.0; - offset: -2 -2; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } - } - } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; - } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; - } - } - } - part { name: "elm.swallow.end"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.5; - fixed: 0 1; - rel1 { - to_x: "elm.swallow.icon"; - to_y: "base"; - relative: 1.0 0.5; - offset: 0 4; - } - rel2 { - to_x: "elm.swallow.end"; - to_y: "base"; - relative: 0.0 0.5; - offset: -1 -5; - } - text { - style: "gengrid_style"; - min: 1 1; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - text { - style: "gengrid_selected_style"; - } - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.relative: 1.0 0.5; - rel2.to: "bg"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - // signal: elm,state,%s,active - // a "check" item named %s went active - // signal: elm,state,%s,passive - // a "check" item named %s went passive - // default is passive - program { name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - - group { name: "elm/gengrid/item/up/default"; - data.item: "labels" "elm.text"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "arrow_up.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2.offset: 2 2; - image { normal: "bt_sm_base1.png"; - border: 6 6 6 6; - middle: SOLID; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "image"; - type: IMAGE; - mouse_events: 0; - description { state: "default" 0.0; - aspect_preference: BOTH; - aspect: 1.0 1.0; - image.normal: "arrow_up.png"; - rel2 { - to_y: "elm.text"; - relative: 1.0 0.0; - offset: -1 -2; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1 { - relative: 0.0 1.0; - offset: 20 -25; - } - rel2 { - relative: 1.0 1.0; - offset: -21 -3; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.5 0.0; - text_class: "grid_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2 { - relative: 1.0 0.5; - offset: 2 -1; - } - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2.offset: 2 2; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - program { name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - - group { name: "elm/gengrid/item/album-preview/default"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon.1 elm.swallow.icon.2 elm.swallow.icon.3 elm.swallow.icon.4"; - data.item: "states" "have_files"; - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "icon_folder.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2.offset: 2 2; - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - middle: SOLID; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "image"; - type: IMAGE; - mouse_events: 0; - description { state: "default" 0.0; - aspect_preference: BOTH; - aspect: 1.0 1.0; - image.normal: "icon_folder.png"; - rel2 { - to_y: "elm.text"; - relative: 1.0 0.0; - offset: -1 -2; - } - } - } - part { name: "have-files-clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - visible: 1; - } - } - part { name: "icon_box_margin"; - type: RECT; - mouse_events: 0; - clip_to: "have-files-clipper"; - description { state: "default" 0.0; - color: 0 0 0 255; - rel1 { - to: "icon_box"; - offset: -1 -1; - } - rel2 { - to: "icon_box"; - offset: 0 0; - } - } - } - part { name: "icon_box"; - type: RECT; - mouse_events: 0; - clip_to: "have-files-clipper"; - description { state: "default" 0.0; - color: 255 255 255 255; - align: 1.0 1.0; - min: 32 32; - rel1 { - relative: 0.25 0.25; - offset: 0 0; - } - rel2 { - relative: 1.0 0.0; - offset: -11 -4; - to_y: "elm.text"; - } - } - } - part { name: "elm.swallow.icon.1"; - type: SWALLOW; - mouse_events: 0; - clip_to: "have-files-clipper"; - description { state: "default" 0.0; - rel1 { - relative: 0.0 0.0; - to: "icon_box"; - } - rel2 { - relative: 0.5 0.5; - offset: -1 -1; - to: "icon_box"; - } - } - } - part { name: "elm.swallow.icon.2"; - type: SWALLOW; - mouse_events: 0; - clip_to: "have-files-clipper"; - description { state: "default" 0.0; - rel1 { - relative: 0.5 0.0; - to: "icon_box"; - } - rel2 { - relative: 1.0 0.5; - offset: -1 -1; - to: "icon_box"; - } - } - } - part { name: "elm.swallow.icon.3"; - type: SWALLOW; - mouse_events: 0; - clip_to: "have-files-clipper"; - description { state: "default" 0.0; - rel1 { - relative: 0.0 0.5; - to: "icon_box"; - } - rel2 { - relative: 0.5 1.0; - offset: -1 -1; - to: "icon_box"; - } - } - } - part { name: "elm.swallow.icon.4"; - type: SWALLOW; - mouse_events: 0; - clip_to: "have-files-clipper"; - description { state: "default" 0.0; - rel1 { - relative: 0.5 0.5; - to: "icon_box"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - to: "icon_box"; - } - } - } - part { name: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1 { - relative: 0.0 1.0; - offset: 20 -30; - } - rel2 { - relative: 1.0 1.0; - offset: -21 -15; - } - color: 0 0 0 255; - color3: 0 0 0 0; - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.5 0.0; - text_class: "grid_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "fg1"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2 { - relative: 1.0 0.5; - offset: 2 -1; - } - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2.offset: 2 2; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - program { name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - } - program { name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; - transition: LINEAR 0.1; - } - program { name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - program { - signal: "elm,state,have_files,active"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "have-files-clipper"; - } - } - } - - group { name: "elm/gengrid/item/thumb/default"; - data { - item: "icons" "elm.swallow.icon"; - item: "labels" "elm.text"; - } - images { - image: "bt_sm_base1.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "thumb_shadow.png" COMP; - } - parts { - part { name: "event"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "bg"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2.offset: 2 2; - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; - middle: SOLID; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "border-shadow"; - type: IMAGE; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "elm.swallow.icon"; - offset: -18 -18; - } - rel2 { - to_x: "elm.swallow.icon"; - to_y: "elm.text"; - offset: 17 17; - } - image { - normal: "thumb_shadow.png"; - border: 17 17 17 17; - middle: NONE; - } - } - } - part { name: "border"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - to: "border-shadow"; - offset: 16 16; - } - rel2 { - to: "border-shadow"; - offset: -15 -15; - } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - mouse_events: 0; - description { state: "default" 0.0; - aspect_preference: BOTH; - aspect: 1.0 1.0; - rel1.offset: 0 8; - rel2 { - to_y: "elm.text"; - relative: 1.0 0.0; - offset: -1 -2; - } - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - color: 0 0 0 255; - color3: 0 0 0 0; - align: 0.5 1.0; - rel1 { - relative: 0.0 1.0; - offset: 20 -30; - } - rel2 { - relative: 1.0 1.0; - offset: -21 -15; - } - text { - font: "Sans"; - size: 10; - min: 0 1; - align: 0.5 0.0; - text_class: "grid_item"; - } - } - } - part { name: "fg1"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2 { - relative: 1.0 0.5; - offset: 2 -1; - } - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "fg2"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1.offset: -3 -3; - rel2.offset: 2 2; - image { - image: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - } - program { - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - transition: LINEAR 0.1; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/photocam/base/default"; - script { - public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - v = get_int(sbvis_h); - if (v) { - v = get_int(sbalways_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - set_int(sbvis_timer, 0); - return 0; - } - } - images { - image: "shelf_inset.png" COMP; - image: "bt_sm_base2.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "busy-1.png" COMP; - image: "busy-2.png" COMP; - image: "busy-3.png" COMP; - image: "busy-4.png" COMP; - image: "busy-5.png" COMP; - image: "busy-6.png" COMP; - image: "busy-7.png" COMP; - image: "busy-8.png" COMP; - image: "busy-9.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - } - } - part { name: "busy_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { state: "active" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "busy"; - clip_to: "busy_clip"; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - min: 32 32; - aspect: 1.0 1.0; - align: 1.0 1.0; - aspect_preference: BOTH; - rel1 { - relative: 0.9 0.9; - offset: -9 -9; - } - rel2 { - relative: 0.9 0.9; - offset: -9 -9; - } - image { - normal: "busy-9.png"; - tween: "busy-1.png"; - tween: "busy-2.png"; - tween: "busy-3.png"; - tween: "busy-4.png"; - tween: "busy-5.png"; - tween: "busy-6.png"; - tween: "busy-7.png"; - tween: "busy-8.png"; - } - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 0 0; - rel2.offset: -1 -1; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 10 17; - align: 1.0 0.0; - rel1 { - relative: 1.0 0.0; - offset: -2 0; - } - rel2 { - relative: 1.0 0.0; - offset: -2 -1; - to_y: "sb_hbar"; - } - } - } - part { name: "elm.dragable.vbar"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 10 17; - max: 10 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 6 6 6 6; - middle: SOLID; - } - } - } - part { name: "sb_vbar_over1"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - } - part { name: "sb_vbar_over2"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - } - - part { name: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar_clip"; - clip_to: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 17 10; - align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - offset: 0 -2; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -2; - to_x: "sb_vbar"; - } - } - } - part { name: "elm.dragable.hbar"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 17 10; - max: 99999 10; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 4 4 4 4; - middle: SOLID; - } - } - } - part { name: "sb_hbar_over1"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "sb_hbar_over2"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_shine.png"; - border: 4 4 4 0; - } - } - } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbalways_h, 0); - set_int(sbvis_timer, 0); - } - } - - program { name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_hide"; - signal: "elm,action,hide,vbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - program { name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - program { name: "sb_vbar_show"; - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "sb_vbar_hide"; - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - - program { name: "hbar_show"; - signal: "elm,action,show,hbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_hide"; - signal: "elm,action,hide,hbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_show_always"; - signal: "elm,action,show_always,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - set_int(sbalways_h, 1); - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - } - } - program { name: "hbar_show_notalways"; - signal: "elm,action,show_notalways,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_h); - if (v) { - set_int(sbalways_h, 0); - v = get_int(sbvis_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - } - } - program { name: "sb_hbar_show"; - signal: "do-show-hbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "sb_hbar_hide"; - signal: "do-hide-hbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - - program { name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(1.0, "timer0", 0); - set_int(sbvis_timer, v); - } - } - program { name: "go1"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - } - program { name: "go2"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "busy"; - after: "go2"; - } - program { name: "stop1"; - signal: "elm,state,busy,stop"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - after: "stop2"; - } - program { name: "stop2"; - action: ACTION_STOP; - target: "go2"; - } - } - } - - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/map/base/default"; - script { - public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - v = get_int(sbvis_h); - if (v) { - v = get_int(sbalways_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - set_int(sbvis_timer, 0); - return 0; - } - } - images { - image: "shelf_inset.png" COMP; - image: "bt_sm_base2.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "busy-1.png" COMP; - image: "busy-2.png" COMP; - image: "busy-3.png" COMP; - image: "busy-4.png" COMP; - image: "busy-5.png" COMP; - image: "busy-6.png" COMP; - image: "busy-7.png" COMP; - image: "busy-8.png" COMP; - image: "busy-9.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.offset: 1 1; - rel2.offset: -2 -2; - } - } - part { name: "busy_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { state: "active" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "busy"; - clip_to: "busy_clip"; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - min: 32 32; - aspect: 1.0 1.0; - align: 1.0 1.0; - aspect_preference: BOTH; - rel1 { - relative: 0.9 0.9; - offset: -9 -9; - } - rel2 { - relative: 0.9 0.9; - offset: -9 -9; - } - image { - normal: "busy-9.png"; - tween: "busy-1.png"; - tween: "busy-2.png"; - tween: "busy-3.png"; - tween: "busy-4.png"; - tween: "busy-5.png"; - tween: "busy-6.png"; - tween: "busy-7.png"; - tween: "busy-8.png"; - } - } - } - part { name: "conf_over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 0 0; - rel2.offset: -1 -1; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 10 17; - align: 1.0 0.0; - rel1 { - relative: 1.0 0.0; - offset: -2 0; - } - rel2 { - relative: 1.0 0.0; - offset: -2 -1; - to_y: "sb_hbar"; - } - } - } - part { name: "elm.dragable.vbar"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 10 17; - max: 10 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 6 6 6 6; - middle: SOLID; - } - } - } - part { name: "sb_vbar_over1"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_hilight.png"; - border: 6 6 6 0; - } - } - } - part { name: "sb_vbar_over2"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.vbar"; - rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_shine.png"; - border: 6 6 6 0; - } - } - } - - part { name: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar_clip"; - clip_to: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 17 10; - align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - offset: 0 -2; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -2; - to_x: "sb_vbar"; - } - } - } - part { name: "elm.dragable.hbar"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 17 10; - max: 99999 10; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 4 4 4 4; - middle: SOLID; - } - } - } - part { name: "sb_hbar_over1"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "sb_hbar_over2"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_shine.png"; - border: 4 4 4 0; - } - } - } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbalways_h, 0); - set_int(sbvis_timer, 0); - } - } - - program { name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_hide"; - signal: "elm,action,hide,vbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - program { name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - program { name: "sb_vbar_show"; - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "sb_vbar_hide"; - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - - program { name: "hbar_show"; - signal: "elm,action,show,hbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_hide"; - signal: "elm,action,hide,hbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_show_always"; - signal: "elm,action,show_always,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - set_int(sbalways_h, 1); - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - } - } - program { name: "hbar_show_notalways"; - signal: "elm,action,show_notalways,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_h); - if (v) { - set_int(sbalways_h, 0); - v = get_int(sbvis_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - } - } - program { name: "sb_hbar_show"; - signal: "do-show-hbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "sb_hbar_hide"; - signal: "do-hide-hbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - - program { name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(1.0, "timer0", 0); - set_int(sbvis_timer, v); - } - } - program { name: "go1"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - } - program { name: "go2"; - signal: "elm,state,busy,start"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "busy"; - after: "go2"; - } - program { name: "stop1"; - signal: "elm,state,busy,stop"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: SINUSOIDAL 1.0; - target: "busy_clip"; - after: "stop2"; - } - program { name: "stop2"; - action: ACTION_STOP; - target: "go2"; - } - } - } - group { name: "elm/map/marker/radio/default"; - data { - item: size_w 24; - item: size_h 24; - item: size_max_w 58; - item: size_max_h 58; - } - images { - image: "map_item.png" COMP; - } - parts { - part { name: "whole"; - description { state: "default" 0.0; - } - } - part { name: "base"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - image.normal: "map_item.png"; - } - } - part { name: "elm.icon"; - type: SWALLOW; - clip_to: "whole"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.relative: 0.27 0.27; - rel2.relative: 0.73 0.73; - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.5 0.5; - color: 224 224 224 255; - color3: 0 0 0 64; - rel1.relative: 0.28 0.25; - rel2.relative: 0.75 0.75; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - } - } - } - } - programs { - program { name: "open"; - signal: "mouse,clicked,1"; - source: "base"; - action: SIGNAL_EMIT "open" "elm"; - } - program { name: "bringin"; - signal: "mouse,down,1,double"; - source: "base"; - action: SIGNAL_EMIT "bringin" "elm"; - } - } - } - group { name: "elm/map/marker/radio2/default"; - data { - item: size_w 24; - item: size_h 24; - item: size_max_w 58; - item: size_max_h 58; - } - images { - image: "map_item_2.png" COMP; - } - parts { - part { name: "base"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - image.normal: "map_item_2.png"; - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.5 0.5; - color: 224 224 224 255; - color3: 0 0 0 64; - rel1.relative: 0.28 0.25; - rel2.relative: 0.75 0.75; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - } - } - } - } - programs { - program { name: "open"; - signal: "mouse,clicked,1"; - source: "base"; - action: SIGNAL_EMIT "open" "elm"; - } - program { name: "bringin"; - signal: "mouse,down,1,double"; - source: "base"; - action: SIGNAL_EMIT "bringin" "elm"; - } - } - } - group { name: "elm/map/marker/empty/default"; - data { - item: size_w 22; - item: size_h 22; - item: size_max_w 64; - item: size_max_h 64; - } - parts { - part { name: "whole"; - description { state: "default" 0.0; - } - } - part { name: "base"; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - } - } - part { name: "elm.icon"; - type: SWALLOW; - clip_to: "whole"; - mouse_events: 0; - description { state: "default" 0.0; - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.5 0.5; - color: 224 224 224 255; - color3: 0 0 0 64; - rel1.relative: 0.28 0.25; - rel2.relative: 0.75 0.75; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - } - } - } - } - programs { - program { name: "open"; - signal: "mouse,clicked,1"; - source: "base"; - action: SIGNAL_EMIT "open" "elm"; - } - program { name: "bringin"; - signal: "mouse,down,1,double"; - source: "base"; - action: SIGNAL_EMIT "bringin" "elm"; - } - } - } - group { name: "elm/map/marker_bubble/default"; - images { - image: "bubble.png" COMP; - image: "bubble_shine.png" COMP; - } - data { - item: size_w 400; - item: size_h 100; - } - parts { - part { name: "clipper"; - mouse_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "base0"; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - image { - normal: "bubble.png"; - border: 11 36 10 19; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - align: 0.5 0.5; - rel1 { - offset: 9 8; - } - rel2 { - offset: -10 -17; - } - } - } - part { name: "shine"; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1 { - to: "base0"; - } - rel2 { - to: "base0"; - relative: 1.0 0.5; - } - image { - normal: "bubble_shine.png"; - border: 5 5 5 0; - } - fill.smooth: 0; - } - } - } - programs { - program { name: "show"; - signal: "show"; - action: STATE_SET "show" 0.0; - target: "clipper"; - transition: ACCELERATE 0.5; - } - } - } - -///////////////////////////////////////////////////////////////////////////// -// PANES -///////////////////////////////////////////////////////////////////////////// - group { - name: "elm/panes/vertical/default"; - images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - image: "arrow_right.png" COMP; - image: "arrow_left.png" COMP; - } - script { - public state_pair = 0; //0:both content are not set, 1:both content are set - } - parts - { - part - { - name: "whole"; - type: RECT; - mouse_events: 1; - description - { - state: "default" 0.0; - visible: 0; - } - } - - //2 contents - part - { - name: "whole_left"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - rel2.to_x: "elm.bar"; - rel2.relative: 0.0 1.0; - visible: 1; - } - } - part - { - name: "elm.swallow.left"; - type: SWALLOW; - clip_to: "whole_left"; - description - { - state: "default" 0.0; - rel1.to: "whole_left"; - rel2.to: "whole_left"; - } - } - - part - { - name: "whole_right"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1.to_x: "elm.bar"; - rel1.relative: 1.0 0.0; - visible: 1; - } - } - part - { - name: "elm.swallow.right"; - type: SWALLOW; - clip_to: "whole_right"; - description - { - state: "default" 0.0; - rel1.to: "whole_right"; - rel2.to: "whole_right"; - } - } - //BAR - part { name: "elm.bar"; - mouse_events: 1; - dragable { - confine: "whole"; - x: 1 1 1; - y: 0 0 0; - } - description { state: "default" 0.0; - max: 0 999; - min: 0 100; - rel1.relative: 0.0 0.5; - rel2.relative: 1.0 0.5; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "default" 0.1; - inherit: "default" 0.0; - max: 15 999; - min: 15 100; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "clicked" 0.1; - inherit: "default" 0.1; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - description { state: "disabled" 0.1; - inherit: "default" 0.1; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - - //Arrow - part { - name: "arrow_right"; - mouse_events: 0; - description { state: "default" 0.0; - min: 45 45; - max: 45 45; - color: 255 255 255 0; - - rel1.relative: 1.0 0.5; - rel1.to_x: "elm.bar"; - rel1.offset: 45/2 -45/2; - - rel2.relative: 1.0 0.5; - rel2.to_x: "elm.bar"; - rel2.offset: 45/2 45/2; - - image.normal: "arrow_right.png"; - - fixed: 1 1; - } - description { state: "anim_1" 0.0; - inherit: "default" 0.0; - color: 255 255 255 200; - rel1.offset: (45/2 + 10) -45/2; - rel2.offset: (45/2 +10) 45/2; - } - description { state: "anim_2" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - rel1.offset: (45/2 + 20) -45/2; - rel2.offset: (45/2 + 20) 45/2; - } - } - part { - name: "arrow_left"; - mouse_events: 0; - description { state: "default" 0.0; - min: 45 45; - max: 45 45; - color: 255 255 255 0; - - rel1.relative: 0.0 0.5; - rel1.to_x: "elm.bar"; - rel1.offset: -45/2 -45/2; - - rel2.relative: 0.0 0.5; - rel2.to_x: "elm.bar"; - rel2.offset: -45/2 45/2; - - image.normal: "arrow_left.png"; - - fixed: 1 1; - } - description { state: "anim_1" 0.0; - inherit: "default" 0.0; - color: 255 255 255 200; - rel1.offset: (-45/2 - 10) -45/2; - rel2.offset: (-45/2 - 10) 45/2; - } - description { state: "anim_2" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - rel1.offset: (-45/2 - 20) -45/2; - rel2.offset: (-45/2 - 20) 45/2; - } - } - part { name: "movement.decider"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - } - programs { - program { - name: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - after: "arrow_anim_start"; - } - program { - name: "button_click_anim"; - script { - if(get_int(state_pair) == 1) - set_state(PART:"elm.bar", "clicked", 0.1); - else - set_state(PART:"elm.bar", "clicked", 0.0); - } - } - program { - name: "button_unclick"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - after: "button_unclick_anim"; - after: "arrow_anim_stop"; - } - program { - name: "button_unclick_anim"; - script { - if(get_int(state_pair) == 1) - set_state(PART:"elm.bar", "default", 0.1); - else - set_state(PART:"elm.bar", "default", 0.0); - } - } - program { - name: "button_click2"; - signal: "mouse,down,1"; - source: "over3"; - action: STATE_SET "clicked" 0.0; - target: "over3"; - } - program { - name: "button_unclick2"; - signal: "mouse,up,1"; - source: "over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "over3"; - } - program { - name: "button_unclick3"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { - name: "button_down_double"; - signal: "mouse,down,1,double"; - source: "over3"; - action: SIGNAL_EMIT "elm,action,click,double" ""; - } - - //arrows animation - program { - name: "arrow_anim_start"; - action: STATE_SET "anim_1" 0.0; - target: "arrow_right"; - target: "arrow_left"; - transition: LINEAR 0.6; - after: "arrow_anim_1"; - } - program { - name: "arrow_anim_1"; - action: STATE_SET "anim_2" 0.0; - target: "arrow_right"; - target: "arrow_left"; - transition: LINEAR 0.6; - after: "arrow_anim_2"; - } - program { - name: "arrow_anim_2"; - action: STATE_SET "default" 0.0; - target: "arrow_right"; - target: "arrow_left"; - after: "arrow_anim_start"; - } - program { - name: "arrow_anim_stop"; - action: ACTION_STOP; - target: "arrow_anim_start"; - target: "arrow_anim_1"; - target: "arrow_anim_2"; - after: "arrow_anim_stop_1"; - } - program { - name: "arrow_anim_stop_1"; - action: STATE_SET "default" 0.0; - target: "arrow_right"; - target: "arrow_left"; - transition: DECELERATE 0.4; - } - //fix the pane - program { - name: "panes_fixed"; - signal: "elm.panes.fixed"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "movement.decider"; - target: "elm.bar"; - } - //allow the movement by interaction - program { - name: "panes_unfixed"; - signal: "elm.panes.unfixed"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "movement.decider"; - target: "elm.bar"; - } - program { - name: "panes_pair"; - signal: "elm.panes.pair"; - source: "elm"; - script { - new st[31]; - new Float:vl; - set_int(state_pair, 1); - get_state(PART:"elm.bar", st, 30, vl); - set_state(PART:"elm.bar", st, 0.1); - } - } - program { - name: "panes_unpair"; - signal: "elm.panes.unpair"; - source: "elm"; - script { - new st[31]; - new Float:vl; - set_int(state_pair, 0); - get_state(PART:"elm.bar", st, 30, vl); - set_state(PART:"elm.bar", st, 0.0); - } - } - } - } - - group { - name: "elm/panes/horizontal/default"; - images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - image: "arrow_up.png" COMP; - image: "arrow_down.png" COMP; - } - script { - public state_pair = 0; //0:both content are not set, 1:both content are set - } - parts - { - part - { - name: "whole"; - type: RECT; - mouse_events: 1; - description - { - state: "default" 0.0; - visible: 0; - } - } - - //2 contents - part - { - name: "whole_left"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - rel2.to_y: "elm.bar"; - rel2.relative: 1.0 0.0; - visible: 1; - } - } - part - { - name: "elm.swallow.left"; - type: SWALLOW; - clip_to: "whole_left"; - description - { - state: "default" 0.0; - rel1.to: "whole_left"; - rel2.to: "whole_left"; - } - } - - part - { - name: "whole_right"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1.to_y: "elm.bar"; - rel1.relative: 0.0 1.0; - visible: 1; - } - } - part - { - name: "elm.swallow.right"; - type: SWALLOW; - clip_to: "whole_right"; - description - { - state: "default" 0.0; - rel1.to: "whole_right"; - rel2.to: "whole_right"; - } - } - //BAR - part { name: "elm.bar"; - mouse_events: 1; - dragable { - confine: "whole"; - x: 0 0 0; - y: 1 1 1; - } - description { state: "default" 0.0; - max: 999 0; - min: 100 0; - rel1.relative: 0.5 0.0; - rel2.relative: 0.5 1.0; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "default" 0.1; - inherit: "default" 0.0; - max: 999 15; - min: 100 15; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "clicked" 0.1; - inherit: "default" 0.1; - image.normal: "bt_base1.png"; - image.middle: SOLID; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - description { state: "disabled" 0.1; - inherit: "default" 0.1; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - - //Arrow - part { - name: "arrow_right"; - mouse_events: 0; - description { state: "default" 0.0; - min: 45 45; - max: 45 45; - color: 255 255 255 0; - - rel1.relative: 0.5 1.0; - rel1.to_y: "elm.bar"; - rel1.offset: -45/2 45/2; - - rel2.relative: 0.5 1.0; - rel2.to_y: "elm.bar"; - rel2.offset: 45/2 45/2; - - image.normal: "arrow_down.png"; - - fixed: 1 1; - } - description { state: "anim_1" 0.0; - inherit: "default" 0.0; - color: 255 255 255 200; - rel1.offset: -45/2 (45/2 +10); - rel2.offset: 45/2 (45/2 +10); - } - description { state: "anim_2" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - rel1.offset: -45/2 (45/2 + 20); - rel2.offset: 45/2 (45/2 + 20); - } - } - part { - name: "arrow_left"; - mouse_events: 0; - description { state: "default" 0.0; - min: 45 45; - max: 45 45; - color: 255 255 255 0; - - rel1.relative: 0.5 0.0; - rel1.to_y: "elm.bar"; - rel1.offset: -45/2 -45/2; - - rel2.relative: 0.5 0.0; - rel2.to_y: "elm.bar"; - rel2.offset: 45/2 -45/2; - - image.normal: "arrow_up.png"; - - fixed: 1 1; - } - description { state: "anim_1" 0.0; - inherit: "default" 0.0; - color: 255 255 255 200; - rel1.offset: -45/2 (-45/2 - 10); - rel2.offset: 45/2 (-45/2 - 10); - } - description { state: "anim_2" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - rel1.offset: -45/2 (-45/2 - 20); - rel2.offset: 45/2 (-45/2 - 20); - } - } - part { - name: "movement.decider"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.bar"; - rel2.to: "elm.bar"; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - } - programs { - program { - name: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - after: "arrow_anim_start"; - } - program { - name: "button_click_anim"; - script { - if(get_int(state_pair) == 1) - set_state(PART:"elm.bar", "clicked", 0.1); - else - set_state(PART:"elm.bar", "clicked", 0.0); - } - } - program { - name: "button_unclick"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - after: "button_unclick_anim"; - after: "arrow_anim_stop"; - } - program { - name: "button_unclick_anim"; - script { - if(get_int(state_pair) == 1) - set_state(PART:"elm.bar", "default", 0.1); - else - set_state(PART:"elm.bar", "default", 0.0); - } - } - program { - name: "button_click2"; - signal: "mouse,down,1"; - source: "over3"; - action: STATE_SET "clicked" 0.0; - target: "over3"; - } - program { - name: "button_unclick2"; - signal: "mouse,up,1"; - source: "over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "over3"; - } - program { - name: "button_unclick3"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { - name: "button_down_double"; - signal: "mouse,down,1,double"; - source: "over3"; - action: SIGNAL_EMIT "elm,action,click,double" ""; - } - - //arrows animation - program { - name: "arrow_anim_start"; - action: STATE_SET "anim_1" 0.0; - target: "arrow_right"; - target: "arrow_left"; - transition: LINEAR 0.6; - after: "arrow_anim_1"; - } - program { - name: "arrow_anim_1"; - action: STATE_SET "anim_2" 0.0; - target: "arrow_right"; - target: "arrow_left"; - transition: LINEAR 0.6; - after: "arrow_anim_2"; - } - program { - name: "arrow_anim_2"; - action: STATE_SET "default" 0.0; - target: "arrow_right"; - target: "arrow_left"; - after: "arrow_anim_start"; - } - program { - name: "arrow_anim_stop"; - action: ACTION_STOP; - target: "arrow_anim_start"; - target: "arrow_anim_1"; - target: "arrow_anim_2"; - after: "arrow_anim_stop_1"; - } - program { - name: "arrow_anim_stop_1"; - action: STATE_SET "default" 0.0; - target: "arrow_right"; - target: "arrow_left"; - transition: DECELERATE 0.4; - } - //fix the pane - program { - name: "panes_fixed"; - signal: "elm.panes.fixed"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "movement.decider"; - target: "elm.bar"; - } - //allow the movement by interaction - program { - name: "panes_unfixed"; - signal: "elm.panes.unfixed"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "movement.decider"; - target: "elm.bar"; - } - program { - name: "panes_pair"; - signal: "elm.panes.pair"; - source: "elm"; - script { - new st[31]; - new Float:vl; - set_int(state_pair, 1); - get_state(PART:"elm.bar", st, 30, vl); - set_state(PART:"elm.bar", st, 0.1); - } - } - program { - name: "panes_unpair"; - signal: "elm.panes.unpair"; - source: "elm"; - script { - new st[31]; - new Float:vl; - set_int(state_pair, 0); - get_state(PART:"elm.bar", st, 30, vl); - set_state(PART:"elm.bar", st, 0.0); - } - } - } - } - - - -///////////////////////////////////////////////////////////////////////////// -// PANEL -///////////////////////////////////////////////////////////////////////////// - group { - name: "elm/panel/base/left"; - alias: "elm/panel/base/top"; - images - { - image: "bt_base1.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "icon_arrow_left.png" COMP; - image: "icon_arrow_right.png" COMP; - } - data { - item: "focus_highlight" "on"; - } - parts - { - part { name: "focus_highlight"; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - to: "btn"; - offset: -8 -8; - } - rel2 { - to: "btn"; - offset: 7 7; - } - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part - { - name: "bg"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - color: 255 255 255 0; - rel1.relative: 0.0 0.0; - rel1.offset: 0 0; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -1; - } - description - { - state: "hidden" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel1.offset: 21 0; - rel2.relative: 0.0 1.0; - rel2.offset: 20 -1; - } - } - part - { - name: "base"; - type: IMAGE; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - rel2.offset: -20 -1; - image - { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part - { - name: "clipper"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1 - { - offset: 4 4; - to: "base"; - } - rel2 - { - offset: -5 -5; - to: "base"; - } - } - } - part - { - name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - description - { - state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - } - } - part - { - name: "btn"; - type: IMAGE; - mouse_events: 1; - description - { - state: "default" 0.0; - max: 32 48; - fixed: 1 1; - align: 0.0 0.5; - rel1 - { - relative: 1.0 0.0; - offset: -3 0; - to_x: "base"; - } - rel2.to_x: "bg"; - image - { - normal: "bt_base1.png"; - border: 0 5 4 12; - } - fill.smooth: 0; - } - description - { - state: "clicked" 0.0; - inherit: "default" 0.0; - } - } - part - { - name: "btn_over"; - type: IMAGE; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1.to: "btn"; - rel2 - { - relative: 1.0 0.5; - to: "btn"; - } - image - { - normal: "bt_hilight.png"; - border: 0 7 7 0; - } - } - } - part - { - name: "btn_over2"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description - { - state: "default" 0.0; - rel1.to: "btn"; - rel2.to: "btn"; - image - { - normal: "bt_shine.png"; - border: 0 7 7 7; - } - } - } - part - { - name: "btn_over3"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - description - { - state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "btn"; - rel2.to: "btn"; - image - { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth: 0; - } - description - { - state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part - { - name: "btn_icon"; - type: IMAGE; - repeat_events: 1; - description - { - state: "default" 0.0; - rel1.to: "btn"; - rel2.to: "btn"; - align: 0.5 0.5; - min: 16 16; - max: 16 16; - image.normal: "icon_arrow_left.png"; - } - description - { - state: "hidden" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_right.png"; - } - } - } - programs - { - program - { - name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "btn_icon"; - transition: LINEAR 0.5; - } - program - { - name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "bg"; - target: "btn_icon"; - transition: LINEAR 0.5; - } - program - { - name: "btn_click"; - signal: "mouse,down,1"; - source: "btn_over2"; - action: STATE_SET "clicked" 0.0; - target: "btn"; - } - program - { - name: "btn_unclick"; - signal: "mouse,up,1"; - source: "btn_over2"; - action: STATE_SET "default" 0.0; - target: "btn"; - } - program - { - name: "btn_click2"; - signal: "mouse,down,1"; - source: "btn_over3"; - action: STATE_SET "clicked" 0.0; - target: "btn_over3"; - } - program - { - name: "btn_unclick2"; - signal: "mouse,up,1"; - source: "btn_over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "btn_over3"; - } - program - { - name: "btn_unclick3"; - signal: "mouse,clicked,1"; - source: "btn_over2"; - action: SIGNAL_EMIT "elm,action,panel,toggle" ""; - } - program { name: "highlight_show"; - signal: "elm,action,focus_highlight,show"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - transition: ACCELERATE 0.3; - target: "focus_highlight"; - } - program { name: "highlight_hide"; - signal: "elm,action,focus_highlight,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "focus_highlight"; - } - } - } - - group { - name: "elm/panel/base/right"; - alias: "elm/panel/base/bottom"; - images - { - image: "bt_base1.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "icon_arrow_left.png" COMP; - image: "icon_arrow_right.png" COMP; - } - parts - { - part { name: "focus_highlight"; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - to: "btn"; - offset: -8 -8; - } - rel2 { - to: "btn"; - offset: 7 7; - } - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part - { - name: "bg"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - color: 255 255 255 0; - rel1.relative: 0.0 0.0; - rel1.offset: 0 0; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -1; - } - description - { - state: "hidden" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel1.offset: -22 0; - rel2.relative: 2.0 1.0; - rel2.offset: -23 -1; - } - } - part - { - name: "base"; - type: IMAGE; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1.to: "bg"; - rel1.offset: 20 0; - rel2.to: "bg"; - image - { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - } - } - part - { - name: "clipper"; - type: RECT; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1 - { - offset: 4 4; - to: "base"; - } - rel2 - { - offset: -5 -5; - to: "base"; - } - } - } - part - { - name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - description - { - state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - } - } - part - { - name: "btn"; - type: IMAGE; - mouse_events: 1; - description - { - state: "default" 0.0; - max: 32 48; - fixed: 1 1; - align: 1 0.5; - rel1 - { - to_x: "bg"; - } - rel2 - { - offset: 2 0; - relative: 0.0 1; - to_x: "base"; - } - image - { - normal: "bt_base1.png"; - border: 5 0 4 12; - } - fill.smooth: 0; - } - description - { - state: "clicked" 0.0; - inherit: "default" 0.0; - } - } - part - { - name: "btn_over"; - type: IMAGE; - mouse_events: 0; - description - { - state: "default" 0.0; - rel1.to: "btn"; - rel2 - { - relative: 1.0 0.5; - to: "btn"; - } - image - { - normal: "bt_hilight.png"; - border: 7 0 7 0; - } - } - } - part - { - name: "btn_over2"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description - { - state: "default" 0.0; - rel1.to: "btn"; - rel2.to: "btn"; - image - { - normal: "bt_shine.png"; - border: 7 0 7 7; - } - } - } - part - { - name: "btn_over3"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - description - { - state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "btn"; - rel2.to: "btn"; - image - { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth: 0; - } - description - { - state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part - { - name: "btn_icon"; - type: IMAGE; - repeat_events: 1; - description - { - state: "default" 0.0; - rel1.to: "btn"; - rel2.to: "btn"; - align: 0.5 0.5; - min: 16 16; - max: 16 16; - image.normal: "icon_arrow_right.png"; - } - description - { - state: "hidden" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_left.png"; - } - } - } - programs - { - program - { - name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "btn_icon"; - transition: LINEAR 0.5; - } - program - { - name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "bg"; - target: "btn_icon"; - transition: LINEAR 0.5; - } - program - { - name: "btn_click"; - signal: "mouse,down,1"; - source: "btn_over2"; - action: STATE_SET "clicked" 0.0; - target: "btn"; - } - program - { - name: "btn_unclick"; - signal: "mouse,up,1"; - source: "btn_over2"; - action: STATE_SET "default" 0.0; - target: "btn"; - } - program - { - name: "btn_click2"; - signal: "mouse,down,1"; - source: "btn_over3"; - action: STATE_SET "clicked" 0.0; - target: "btn_over3"; - } - program - { - name: "btn_unclick2"; - signal: "mouse,up,1"; - source: "btn_over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "btn_over3"; - } - program - { - name: "btn_unclick3"; - signal: "mouse,up,1"; - source: "btn_over2"; - action: SIGNAL_EMIT "elm,action,panel,toggle" ""; - } - program { name: "highlight_show"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - transition: ACCELERATE 0.3; - target: "focus_highlight"; - } - program { name: "highlight_hide"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "focus_highlight"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/conformant/base/default"; - parts { - part { name: "elm.swallow.shelf"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.0 0.0; - rel2.relative: 1.0 0.0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 0.5; - rel1.relative: 0.0 1.0; - rel1.to_y: "elm.swallow.shelf"; - rel2.relative: 1.0 0.0; - rel2.to_y: "elm.swallow.virtualkeypad"; - } - } - part { name: "elm.swallow.virtualkeypad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 0 1; - align: 0.0 1.0; - rel1.relative: 0.0 0.0; - rel1.to_y: "elm.swallow.panel"; - rel2.relative: 1.0 0.0; - rel2.to_y: "elm.swallow.panel"; - } - } - part { name: "elm.swallow.panel"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.0 1.0; - rel1.relative: 0.0 1.0; - } - } - } - } - -///////////////////////////////////////////////////////////////////////////// -// CALENDAR -///////////////////////////////////////////////////////////////////////////// -#define CH(_pos) \ - part { name: "ch_"#_pos".base"; \ - type: RECT; \ - description { state: "default" 0.0; \ - rel1 { \ - relative: (_pos % 7 * 7 / 8 / 6) 0; \ - to: "header"; \ - } \ - rel2 { \ - relative: (_pos % 7 * 7 / 8 / 6 + 1 / 8) 1; \ - to: "header"; \ - } \ - color: 0 0 0 0; \ - visible: 0; \ - } \ - } \ - part { name: "ch_"#_pos".text"; \ - type: TEXT; \ - effect: SOFT_SHADOW; \ - mouse_events: 0; \ - scale: 1; \ - clip_to: "ch_"#_pos".clipper"; \ - description { \ - state: "default" 0.0; \ - rel1.to: "ch_"#_pos".base"; \ - rel2.to: "ch_"#_pos".base"; \ - color: 0 0 0 255; \ - color3: 0 0 0 0; \ - text { \ - font: "Sans"; \ - size: 10; \ - min: 1 1; \ - align: 0.5 0.5; \ - } \ - } \ - } \ - part { name: "ch_"#_pos".clipper"; \ - type: RECT; \ - description { state: "default" 0.0; \ - rel1.to: "ch_"#_pos".base"; \ - rel2.to: "ch_"#_pos".base"; \ - } \ - } - -#define CIT(_pos) \ - part { name: "cit_"#_pos".rect"; \ - type: RECT; \ - description { state: "default" 0.0; \ - rel1 { \ - relative: (_pos % 7 * 7 / 8 / 6) \ - (_pos / 8 / 5 - _pos % 7 / 8 / 5); \ - to: "base"; \ - } \ - rel2 { \ - relative: (_pos % 7 * 7 / 8 / 6 + 1 / 8) \ - (_pos / 8 / 5 - _pos % 7 / 8 / 5 + 1 / 8); \ - to: "base"; \ - } \ - color: 0 0 0 0; \ - visible: 0; \ - } \ - } \ - part { \ - name: "cit_"#_pos".event"; \ - type: RECT; \ - repeat_events: 1; \ - description { \ - rel1.to: "cit_"#_pos".rect"; \ - rel2.to: "cit_"#_pos".rect"; \ - state: "default" 0.0; \ - color: 0 0 0 0; \ - } \ - } \ - part { name: "cit_"#_pos".shelf"; \ - type: RECT; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - rel1 { \ - to: "cit_"#_pos".bg"; \ - offset: -1 -1; \ - } \ - rel2 { \ - to: "cit_"#_pos".bg"; \ - } \ - color: 200 200 200 255; \ - } \ - } \ - part { name: "cit_"#_pos".hd"; \ - type: RECT; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - rel1 { \ - to: "cit_"#_pos".bg"; \ - offset: -1 -1; \ - } \ - rel2 { \ - to: "cit_"#_pos".bg"; \ - } \ - visible: 0; \ - color: 160 0 0 255; \ - } \ - description { state: "visible" 0.0; \ - inherit: "default" 0.0; \ - visible: 1; \ - } \ - } \ - part { \ - name: "cit_"#_pos".base_sh"; \ - mouse_events: 0; \ - description { \ - state: "default" 0.0; \ - align: 0.0 0.0; \ - min: 0 1; \ - rel1 { \ - to: "cit_"#_pos".base"; \ - relative: 0.0 1.0; \ - offset: 0 0; \ - } \ - rel2 { \ - to: "cit_"#_pos".base"; \ - relative: 1.0 1.05; \ - offset: -1 0; \ - } \ - image { \ - normal: "ilist_item_shadow.png"; \ - } \ - fill.smooth: 0; \ - } \ - } \ - part { \ - name: "cit_"#_pos".base"; \ - mouse_events: 0; \ - description { \ - state: "default" 0.0; \ - rel1.to: "cit_"#_pos".rect"; \ - rel2.to: "cit_"#_pos".rect"; \ - rel2.offset: -1 -1; \ - image { \ - normal: "ilist_1.png"; \ - border: 2 2 2 2; \ - } \ - fill.smooth: 0; \ - } \ - description { \ - state: "today" 0.0; \ - inherit: "default" 0.0; \ - image.normal: "ilist_2.png"; \ - color: 240 240 240 255; \ - } \ - } \ - part { name: "cit_"#_pos".bg"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - visible: 0; \ - color: 255 255 255 0; \ - rel1 { \ - to: "cit_"#_pos".rect"; \ - relative: 0.0 0.0; \ - } \ - rel2 { \ - to: "cit_"#_pos".rect"; \ - relative: 1.0 1.0; \ - offset: -1 -1; \ - } \ - image { \ - normal: "bt_sm_base1.png"; \ - border: 6 6 6 6; \ - } \ - image.middle: SOLID; \ - } \ - description { state: "selected" 0.0; \ - inherit: "default" 0.0; \ - visible: 1; \ - color: 255 255 255 255; \ - } \ - } \ - part { name: "cit_"#_pos".text"; \ - type: TEXT; \ - effect: SOFT_SHADOW; \ - mouse_events: 0; \ - scale: 1; \ - description { \ - state: "default" 0.0; \ - rel1.to: "cit_"#_pos".bg"; \ - rel2.to: "cit_"#_pos".bg"; \ - color: 0 0 0 255; \ - color3: 0 0 0 0; \ - text { \ - font: "Sans"; \ - size: 10; \ - min: 1 1; \ - align: 0.5 0.5; \ - } \ - } \ - description { state: "selected" 0.0; \ - inherit: "default" 0.0; \ - color: 224 224 224 255; \ - color3: 0 0 0 64; \ - } \ - } \ - part { name: "cit_"#_pos".fg1"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - visible: 0; \ - color: 255 255 255 0; \ - rel1.to: "cit_"#_pos".bg"; \ - rel2.relative: 1.0 0.5; \ - rel2.to: "cit_"#_pos".bg"; \ - image { \ - normal: "bt_sm_hilight.png"; \ - border: 6 6 6 0; \ - } \ - } \ - description { state: "selected" 0.0; \ - inherit: "default" 0.0; \ - visible: 1; \ - color: 255 255 255 255; \ - } \ - } \ - part { name: "cit_"#_pos".fg2"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - visible: 0; \ - color: 255 255 255 0; \ - rel1.to: "cit_"#_pos".bg"; \ - rel2.to: "cit_"#_pos".bg"; \ - image { \ - normal: "bt_sm_shine.png"; \ - border: 6 6 6 0; \ - } \ - } \ - description { state: "selected" 0.0; \ - inherit: "default" 0.0; \ - visible: 1; \ - color: 255 255 255 255; \ - } \ - } \ - part { name: "cit_"#_pos".check"; \ - mouse_events: 0; \ - description { state: "default" 0.0; \ - rel1 { \ - to: "cit_"#_pos".bg"; \ - relative: 0.7 0.6; \ - offset: 1 1; \ - } \ - rel2 { \ - to: "cit_"#_pos".bg"; \ - relative: 1.1 1.2; \ - offset: -2 -2; \ - } \ - aspect: 1 1; \ - visible: 0; \ - color: 255 0 0 255; \ - image.normal: "check.png"; \ - } \ - description { state: "visible" 0.0; \ - inherit: "default" 0.0; \ - visible: 1; \ - } \ - } \ - programs { \ - program { \ - name: "cit_"#_pos".go_active"; \ - signal: "cit_"#_pos",selected"; \ - source: "elm"; \ - action: STATE_SET "selected" 0.0; \ - target: "cit_"#_pos".bg"; \ - target: "cit_"#_pos".fg1"; \ - target: "cit_"#_pos".fg2"; \ - target: "cit_"#_pos".text"; \ - } \ - program { \ - name: "cit_"#_pos".go_passive"; \ - signal: "cit_"#_pos",unselected"; \ - source: "elm"; \ - action: STATE_SET "default" 0.0; \ - target: "cit_"#_pos".bg"; \ - target: "cit_"#_pos".fg1"; \ - target: "cit_"#_pos".fg2"; \ - target: "cit_"#_pos".text"; \ - } \ - program { \ - name: "cit_"#_pos".is_today"; \ - signal: "cit_"#_pos",today"; \ - source: "elm"; \ - action: STATE_SET "today" 0.0; \ - target: "cit_"#_pos".base"; \ - } \ - program { \ - name: "cit_"#_pos".not_today"; \ - signal: "cit_"#_pos",not_today"; \ - source: "elm"; \ - action: STATE_SET "default" 0.0; \ - target: "cit_"#_pos".base"; \ - } \ - program { \ - source: "cit_"#_pos".clicked"; \ - signal: "mouse,clicked,1"; \ - source: "cit_"#_pos".event"; \ - action: SIGNAL_EMIT "elm,action,selected" #_pos; \ - } \ - program { \ - name: "cit_"#_pos".clear"; \ - signal: "cit_"#_pos",clear"; \ - source: "elm"; \ - action: STATE_SET "default" 0.0; \ - target: "cit_"#_pos".check"; \ - target: "cit_"#_pos".hd"; \ - } \ - program { \ - name: "cit_"#_pos".checked"; \ - signal: "cit_"#_pos",checked"; \ - source: "elm"; \ - action: STATE_SET "visible" 0.0; \ - target: "cit_"#_pos".check"; \ - } \ - program { \ - name: "cit_"#_pos".holiday"; \ - signal: "cit_"#_pos",holiday"; \ - source: "elm"; \ - action: STATE_SET "visible" 0.0; \ - target: "cit_"#_pos".hd"; \ - } \ + } + part { name: "elm.swallow.entry"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.5; + rel1 { relative: 0.0 0.5; + offset: 3 2; + to: "bg"; + } + rel2 { relative: 1.0 0.5; + offset: -3 -2; + to: "bg"; + } + fixed: 1 1; + color: 0 0 0 0; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "disabled_active" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "dec"; + signal: "mouse,down,1"; + source: "down_bt"; + action: SIGNAL_EMIT "elm,action,decrement,start" ""; + } + program { name: "dec2"; + signal: "mouse,up,1"; + source: "down_bt"; + action: SIGNAL_EMIT "elm,action,decrement,stop" ""; + } + program { name: "inc"; + signal: "mouse,down,1"; + source: "up_bt"; + action: SIGNAL_EMIT "elm,action,increment,start" ""; + } + program { name: "inc2"; + signal: "mouse,up,1"; + source: "up_bt"; + action: SIGNAL_EMIT "elm,action,increment,stop" ""; + } + program { + name: "down_bt_click2"; + signal: "mouse,down,1"; + source: "down_over3"; + action: STATE_SET "clicked" 0.0; + target: "down_over3"; + } + program { + name: "down_bt_unclick2"; + signal: "mouse,up,1"; + source: "down_over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "down_over3"; + } + program { + name: "up_bt_click2"; + signal: "mouse,down,1"; + source: "up_over3"; + action: STATE_SET "clicked" 0.0; + target: "up_over3"; + } + program { + name: "up_bt_unclick2"; + signal: "mouse,up,1"; + source: "up_over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "up_over3"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "down_bt"; + target: "up_bt"; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "active")) + set_state(PART:"elm.text", "disabled_active", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + + get_state(PART:"elm.swallow.entry", st, 30, vl); + if (!strcmp(st, "active")) + set_state(PART:"elm.swallow.entry", "disabled_active", 0.0); + else + set_state(PART:"elm.swallow.entry", "disabled", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "down_bt"; + target: "up_bt"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_active")) + set_state(PART:"elm.text", "active", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + + get_state(PART:"elm.swallow.entry", st, 30, vl); + if (!strcmp(st, "disabled_active")) + set_state(PART:"elm.swallow.entry", "active", 0.0); + else + set_state(PART:"elm.swallow.entry", "default", 0.0); + } + } + program { name: "active"; + signal: "elm,state,active"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "elm.text"; + target: "elm.swallow.entry"; + } + program { name: "inactive"; + signal: "elm,state,inactive"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "elm.swallow.entry"; + } + program { name: "toggle_text"; + signal: "mouse,up,1"; + source: "button_events"; + action: SIGNAL_EMIT "elm,action,entry,toggle" ""; + } + } + } + + + /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/index/base/vertical/default"; + images { + image: "bt_base1.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + } + parts { + part { name: "clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + description { state: "active" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "clip2"; + type: RECT; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + description { state: "active" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.index.0"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.5; + offset: -1 5; + } + rel2 { + relative: 1.0 0.5; + offset: -1 -6; + } + } + } + part { name: "button_image"; + mouse_events: 1; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "elm.text.body"; + offset: -5 -5; + } + rel2 { + to: "elm.text"; + offset: 4 4; + } + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + image.middle: SOLID; + } + } + part { name: "elm.text.body"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + clip_to: "clip"; + description { state: "default" 0.0; + align: 1.0 0.5; + rel1 { + to: "elm.text"; + relative: 0.0 0.0; + offset: 5 0; + } + rel2 { + to: "elm.text"; + relative: 0.0 1.0; + offset: 5 -1; + } + color: 224 224 224 255; + color3: 0 0 0 64; + text { + font: "Sans,Edje-Vera"; + size: 20; + min: 1 1; + align: 1.0 0.5; + } + } + } + part { name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + clip_to: "clip"; + description { state: "default" 0.0; + align: 1.0 0.5; + rel1 { + to_x: "elm.swallow.event.0"; + to_y: "elm.dragable.pointer"; + relative: 0.0 0.5; + offset: -16 0; + } + rel2 { + to_x: "elm.swallow.event.0"; + to_y: "elm.dragable.pointer"; + relative: 0.0 0.5; + offset: -16 -1; + } + color: 255 0 0 255; + color3: 0 0 0 64; + text { + font: "Sans,Edje-Vera"; + size: 20; + min: 1 1; + align: 1.0 0.5; + } + } + } + part { name: "over1"; + mouse_events: 0; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "button_image"; + } + rel2 { + to: "button_image"; + relative: 1.0 0.5; + } + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + } + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + clip_to: "clip"; + description { state: "default" 0.0; + rel1 { + to: "button_image"; + } + rel2 { + to: "button_image"; + } + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } + } + } + part { name: "elm.dragable.pointer"; + type: RECT; + mouse_events: 0; + dragable { + x: 1 1 0; + y: 1 1 0; + } + clip_to: "clip"; + description { state: "default" 0.0; + fixed: 1 1; + min: 8 8; + max: 8 8; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 0.0 0.0; + offset: 0 0; + } + color: 0 0 255 128; + } + } + part { name: "elm.swallow.event.0"; + type: SWALLOW; + description { state: "default" 0.0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.0; + offset: -1 0; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -1; + } + } + } + } + programs { + program { name: "active"; + signal: "elm,state,active"; + source: "elm"; + action: STATE_SET "active" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + } + program { name: "inactive"; + signal: "elm,state,inactive"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + } + } + } + + group { name: "elm/index/item/vertical/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + images { + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + } + parts { + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; + } + fill.smooth: 0; + } + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; + } + fill.smooth: 0; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + rel1 { + offset: -16 0; + } + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + // min: 16 16; + rel1 { + to: "base"; + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -5 -5; + } + color: 0 0 0 128; + text { + font: "Sans"; + size: 10; + min: 1 1; + // min: 0 1; + align: 0.0 0.5; + } + } + description { state: "active" 0.0; + inherit: "default" 0.0; + color: 0 0 0 255; + } + } + } + programs { + program { name: "active"; + signal: "elm,state,active"; + source: "elm"; + action: STATE_SET "active" 0.0; + transition: DECELERATE 0.5; + target: "elm.text"; + target: "base"; + } + program { name: "inactive"; + signal: "elm,state,inactive"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "elm.text"; + target: "base"; + } + } + } + + group { name: "elm/index/item_odd/vertical/default"; + data.item: "stacking" "below"; + images { + image: "ilist_2.png" COMP; + } + parts { + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "ilist_2.png"; + border: 2 2 2 2; + } + fill.smooth: 0; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + rel1 { + offset: -16 0; + } + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + // min: 16 16; + rel1 { + to: "base"; + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -5 -5; + } + color: 0 0 0 128; + text { + font: "Sans"; + size: 10; + min: 1 1; + // min: 0 1; + align: 0.0 0.5; + } + } + description { state: "active" 0.0; + inherit: "default" 0.0; + color: 0 0 0 255; + } + } + } + programs { + program { name: "active"; + signal: "elm,state,active"; + source: "elm"; + action: STATE_SET "active" 0.0; + transition: DECELERATE 0.5; + target: "elm.text"; + target: "base"; + } + program { name: "inactive"; + signal: "elm,state,inactive"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "elm.text"; + target: "base"; + } + } + } + + /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/gengrid/item/default/default"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; + } + fill.smooth: 0; + } + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; + } + fill.smooth: 0; + } + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } + } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 1.0; + offset: 0 -10; + } + rel2 { + to_y: "elm.text"; + relative: 0.0 0.0; + offset: -1 -1; + } + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.5 0.5; + rel1 { + relative: 0.0 0.0; + offset: -1 4; + } + rel2 { + to_y: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 -5; + } + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.0; + aspect: 1.0 1.0; + aspect_preference: HORIZONTAL; + rel1 { + relative: 1.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 5 5; + } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; + min: 0 1; + align: 0.5 0.0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } + group { name: "elm/gengrid/item/default_style/default"; + styles + { + style { name: "gengrid_style"; + base: "font=Sans font_size=10 align=left valign=0.5 color=#000"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=Sans:style=Bold"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "tab" "\t"; + } + style { name: "gengrid_selected_style"; + base: "font=Sans font_size=10 align=left valign=0.5 color=#fff"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=Sans:style=Bold"; + tag: "b" "+ font=Sans:style=Bold"; + tag: "tab" "\t"; + } + } + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; + } + fill.smooth: 0; + } + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + min: 16 28; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; + } + fill.smooth: 0; + } + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } + } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; + } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; + } + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + to_y: "base"; + relative: 1.0 0.5; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + to_y: "base"; + relative: 0.0 0.5; + offset: -1 -5; + } + text { + style: "gengrid_style"; + min: 1 1; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "gengrid_selected_style"; + } + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } + + /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/photocam/base/default"; + script { + public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; + public timer0(val) { + new v; + v = get_int(sbvis_v); + if (v) { + v = get_int(sbalways_v); + if (!v) { + emit("do-hide-vbar", ""); + set_int(sbvis_v, 0); + } + } + v = get_int(sbvis_h); + if (v) { + v = get_int(sbalways_h); + if (!v) { + emit("do-hide-hbar", ""); + set_int(sbvis_h, 0); + } + } + set_int(sbvis_timer, 0); + return 0; + } + } + images { + image: "shelf_inset.png" COMP; + image: "bt_sm_base2.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "sb_runnerh.png" COMP; + image: "sb_runnerv.png" COMP; + image: "busy-1.png" COMP; + image: "busy-2.png" COMP; + image: "busy-3.png" COMP; + image: "busy-4.png" COMP; + image: "busy-5.png" COMP; + image: "busy-6.png" COMP; + image: "busy-7.png" COMP; + image: "busy-8.png" COMP; + image: "busy-9.png" COMP; + } + parts { + part { name: "bg"; + type: RECT; + description { state: "default" 0.0; + rel1.offset: 1 1; + rel2.offset: -2 -2; + color: 255 255 255 0; + } + } + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + } + part { name: "elm.swallow.content"; + clip_to: "clipper"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.offset: 1 1; + rel2.offset: -2 -2; + } + } + part { name: "busy_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + description { state: "active" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "busy"; + clip_to: "busy_clip"; + mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + min: 32 32; + aspect: 1.0 1.0; + align: 1.0 1.0; + aspect_preference: BOTH; + rel1 { + relative: 0.9 0.9; + offset: -9 -9; + } + rel2 { + relative: 0.9 0.9; + offset: -9 -9; + } + image { + normal: "busy-9.png"; + tween: "busy-1.png"; + tween: "busy-2.png"; + tween: "busy-3.png"; + tween: "busy-4.png"; + tween: "busy-5.png"; + tween: "busy-6.png"; + tween: "busy-7.png"; + tween: "busy-8.png"; + } + } + } + part { name: "conf_over"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.offset: 0 0; + rel2.offset: -1 -1; + image { + normal: "shelf_inset.png"; + border: 7 7 7 7; + middle: 0; + } + fill.smooth : 0; + } + } + part { name: "sb_vbar_clip_master"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; + } + } + part { name: "sb_vbar_clip"; + clip_to: "sb_vbar_clip_master"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; + } + } + part { name: "sb_vbar"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + min: 17 17; + align: 1.0 0.0; + rel1 { + relative: 1.0 0.0; + offset: -2 0; + } + rel2 { + relative: 1.0 0.0; + offset: -2 -1; + to_y: "sb_hbar"; + } + } + } + part { name: "sb_vbar_runner"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + min: 3 3; + max: 3 99999; + rel1.to: "sb_vbar"; + rel2.to: "sb_vbar"; + image { + normal: "sb_runnerv.png"; + border: 0 0 4 4; + } + fill.smooth: 0; + } + } + part { name: "elm.dragable.vbar"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; + dragable { + x: 0 0 0; + y: 1 1 0; + confine: "sb_vbar"; + } + description { state: "default" 0.0; + fixed: 1 1; + min: 17 17; + rel1 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_vbar"; + } + rel2 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_vbar"; + } + image { + normal: "bt_sm_base2.png"; + border: 6 6 6 6; + } + image.middle: SOLID; + } + } + part { name: "sb_vbar_over1"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.dragable.vbar"; + rel2.relative: 1.0 0.5; + rel2.to: "elm.dragable.vbar"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } + } + } + part { name: "sb_vbar_over2"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.dragable.vbar"; + rel2.to: "elm.dragable.vbar"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } + } + } + + part { name: "sb_hbar_clip_master"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; + } + } + part { name: "sb_hbar_clip"; + clip_to: "sb_hbar_clip_master"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; + } + } + part { name: "sb_hbar"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + min: 17 17; + align: 0.0 1.0; + rel1 { + relative: 0.0 1.0; + offset: 0 -2; + } + rel2 { + relative: 0.0 1.0; + offset: -1 -2; + to_x: "sb_vbar"; + } + } + } + part { name: "sb_hbar_runner"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + min: 3 3; + max: 99999 3; + rel1.to: "sb_hbar"; + rel2.to: "sb_hbar"; + image { + normal: "sb_runnerh.png"; + border: 4 4 0 0; + } + fill.smooth: 0; + } + } + part { name: "elm.dragable.hbar"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; + dragable { + x: 1 1 0; + y: 0 0 0; + confine: "sb_hbar"; + } + description { state: "default" 0.0; + fixed: 1 1; + min: 17 17; + rel1 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_hbar"; + } + rel2 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_hbar"; + } + image { + normal: "bt_sm_base2.png"; + border: 6 6 6 6; + } + image.middle: SOLID; + } + } + part { name: "sb_hbar_over1"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.dragable.hbar"; + rel2.relative: 1.0 0.5; + rel2.to: "elm.dragable.hbar"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } + } + } + part { name: "sb_hbar_over2"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.dragable.hbar"; + rel2.to: "elm.dragable.hbar"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } + } + } + } + programs { + program { name: "load"; + signal: "load"; + source: ""; + script { + set_state(PART:"sb_hbar_clip", "hidden", 0.0); + set_state(PART:"sb_vbar_clip", "hidden", 0.0); + set_int(sbvis_h, 0); + set_int(sbvis_v, 0); + set_int(sbalways_v, 0); + set_int(sbalways_h, 0); + set_int(sbvis_timer, 0); + } + } + + program { name: "vbar_show"; + signal: "elm,action,show,vbar"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "sb_vbar_clip_master"; + } + program { name: "vbar_hide"; + signal: "elm,action,hide,vbar"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "sb_vbar_clip_master"; + } + program { name: "vbar_show_always"; + signal: "elm,action,show_always,vbar"; + source: "elm"; + script { + new v; + v = get_int(sbvis_v); + v |= get_int(sbalways_v); + if (!v) { + set_int(sbalways_v, 1); + emit("do-show-vbar", ""); + set_int(sbvis_v, 1); + } + } + } + program { name: "vbar_show_notalways"; + signal: "elm,action,show_notalways,vbar"; + source: "elm"; + script { + new v; + v = get_int(sbalways_v); + if (v) { + set_int(sbalways_v, 0); + v = get_int(sbvis_v); + if (!v) { + emit("do-hide-vbar", ""); + set_int(sbvis_v, 0); + } + } + } + } + program { name: "sb_vbar_show"; + signal: "do-show-vbar"; + source: ""; + action: STATE_SET "default" 0.0; + transition: LINEAR 1.0; + target: "sb_vbar_clip"; + } + program { name: "sb_vbar_hide"; + signal: "do-hide-vbar"; + source: ""; + action: STATE_SET "hidden" 0.0; + transition: LINEAR 1.0; + target: "sb_vbar_clip"; + } + + program { name: "hbar_show"; + signal: "elm,action,show,hbar"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "sb_hbar_clip_master"; + } + program { name: "hbar_hide"; + signal: "elm,action,hide,hbar"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "sb_hbar_clip_master"; + } + program { name: "hbar_show_always"; + signal: "elm,action,show_always,hbar"; + source: "elm"; + script { + new v; + v = get_int(sbvis_h); + v |= get_int(sbalways_h); + if (!v) { + set_int(sbalways_h, 1); + emit("do-show-hbar", ""); + set_int(sbvis_h, 1); + } + } + } + program { name: "hbar_show_notalways"; + signal: "elm,action,show_notalways,hbar"; + source: "elm"; + script { + new v; + v = get_int(sbalways_h); + if (v) { + set_int(sbalways_h, 0); + v = get_int(sbvis_h); + if (!v) { + emit("do-hide-hbar", ""); + set_int(sbvis_h, 0); + } + } + } + } + program { name: "sb_hbar_show"; + signal: "do-show-hbar"; + source: ""; + action: STATE_SET "default" 0.0; + transition: LINEAR 1.0; + target: "sb_hbar_clip"; + } + program { name: "sb_hbar_hide"; + signal: "do-hide-hbar"; + source: ""; + action: STATE_SET "hidden" 0.0; + transition: LINEAR 1.0; + target: "sb_hbar_clip"; + } + + program { name: "scroll"; + signal: "elm,action,scroll"; + source: "elm"; + script { + new v; + v = get_int(sbvis_v); + v |= get_int(sbalways_v); + if (!v) { + emit("do-show-vbar", ""); + set_int(sbvis_v, 1); + } + v = get_int(sbvis_h); + v |= get_int(sbalways_h); + if (!v) { + emit("do-show-hbar", ""); + set_int(sbvis_h, 1); + } + v = get_int(sbvis_timer); + if (v > 0) cancel_timer(v); + v = timer(2.0, "timer0", 0); + set_int(sbvis_timer, v); + } + } + program { name: "go1"; + signal: "elm,state,busy,start"; + source: "elm"; + action: STATE_SET "active" 0.0; + transition: SINUSOIDAL 1.0; + target: "busy_clip"; + } + program { name: "go2"; + signal: "elm,state,busy,start"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.5; + target: "busy"; + after: "go2"; + } + program { name: "stop1"; + signal: "elm,state,busy,stop"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: SINUSOIDAL 1.0; + target: "busy_clip"; + after: "stop2"; + } + program { name: "stop2"; + action: ACTION_STOP; + target: "go2"; + } } + } - group { name: "elm/calendar/base/default"; + /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/map/base/default"; + script { + public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; + public timer0(val) { + new v; + v = get_int(sbvis_v); + if (v) { + v = get_int(sbalways_v); + if (!v) { + emit("do-hide-vbar", ""); + set_int(sbvis_v, 0); + } + } + v = get_int(sbvis_h); + if (v) { + v = get_int(sbalways_h); + if (!v) { + emit("do-hide-hbar", ""); + set_int(sbvis_h, 0); + } + } + set_int(sbvis_timer, 0); + return 0; + } + } images { image: "shelf_inset.png" COMP; - image: "bt_base1.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "bt_glow.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - image: "sp_bt_l.png" COMP; - image: "sp_bt_r.png" COMP; - image: "bt_sm_base1.png" COMP; + image: "bt_sm_base2.png" COMP; image: "bt_sm_shine.png" COMP; image: "bt_sm_hilight.png" COMP; - image: "ilist_1.png" COMP; - image: "ilist_2.png" COMP; - image: "ilist_item_shadow.png" COMP; - image: "check.png" COMP; + image: "sb_runnerh.png" COMP; + image: "sb_runnerv.png" COMP; + image: "busy-1.png" COMP; + image: "busy-2.png" COMP; + image: "busy-3.png" COMP; + image: "busy-4.png" COMP; + image: "busy-5.png" COMP; + image: "busy-6.png" COMP; + image: "busy-7.png" COMP; + image: "busy-8.png" COMP; + image: "busy-9.png" COMP; } parts { part { name: "bg"; type: RECT; description { state: "default" 0.0; - min: 0 30; rel1.offset: 1 1; rel2.offset: -2 -2; color: 255 255 255 0; - align: 0.0 0.5; } } - part { name: "spinner-base"; + part { name: "clipper"; type: RECT; mouse_events: 0; description { state: "default" 0.0; - min: 24 24; - max: 999999 24; rel1.to: "bg"; - rel1.offset: 6 6; rel2.to: "bg"; - rel2.offset: -7 -7; + } + } + part { name: "elm.swallow.content"; + clip_to: "clipper"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.offset: 1 1; + rel2.offset: -2 -2; + } + } + part { name: "busy_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; color: 255 255 255 0; - align: 0.0 0.0; + } + description { state: "active" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "busy"; + clip_to: "busy_clip"; + mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + min: 32 32; + aspect: 1.0 1.0; + align: 1.0 1.0; + aspect_preference: BOTH; + rel1 { + relative: 0.9 0.9; + offset: -9 -9; + } + rel2 { + relative: 0.9 0.9; + offset: -9 -9; + } + image { + normal: "busy-9.png"; + tween: "busy-1.png"; + tween: "busy-2.png"; + tween: "busy-3.png"; + tween: "busy-4.png"; + tween: "busy-5.png"; + tween: "busy-6.png"; + tween: "busy-7.png"; + tween: "busy-8.png"; + } } } - part { name: "conf_over_spinner"; + part { name: "conf_over"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "spinner-base"; - rel1.offset: -3 -3; - rel2.to: "spinner-base"; - rel2.offset: 2 2; + rel1.offset: 0 0; + rel2.offset: -1 -1; image { normal: "shelf_inset.png"; border: 7 7 7 7; @@ -33883,2496 +23139,2647 @@ collections { fill.smooth : 0; } } - part { name: "table-base"; + part { name: "sb_vbar_clip_master"; type: RECT; mouse_events: 0; description { state: "default" 0.0; - min: 256 220; - rel1.to_x: "bg"; - rel1.to_y: "spinner-base"; - rel1.offset: 6 6; - rel1.relative: 0 1; - rel2.to: "bg"; - rel2.offset: -7 -7; + } + description { state: "hidden" 0.0; + visible: 0; color: 255 255 255 0; } } - part { name: "conf_over_table"; - mouse_events: 0; + part { name: "sb_vbar_clip"; + clip_to: "sb_vbar_clip_master"; + type: RECT; + mouse_events: 0; description { state: "default" 0.0; - rel1.to: "table-base"; - rel1.offset: -3 -3; - rel2.to: "table-base"; - rel2.offset: 2 2; - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; + } + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; } } - part { name: "header"; + part { name: "sb_vbar"; type: RECT; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "table-base"; - rel1.relative: 0 0; - rel2.to: "table-base"; - rel2.relative: 1 0.1; - color: 255 255 255 0; + fixed: 1 1; + visible: 0; + min: 17 17; + align: 1.0 0.0; + rel1 { + relative: 1.0 0.0; + offset: -2 0; + } + rel2 { + relative: 1.0 0.0; + offset: -2 -1; + to_y: "sb_hbar"; + } } } - part { name: "base"; - type: RECT; + part { name: "sb_vbar_runner"; + clip_to: "sb_vbar_clip"; mouse_events: 0; description { state: "default" 0.0; - rel1.to_x: "table-base"; - rel1.to_y: "header"; - rel1.relative: 0 1; - rel1.offset: 3 0; - rel2.to: "table-base"; - rel2.offset: -3 0; - color: 255 255 255 0; + min: 3 3; + max: 3 99999; + rel1.to: "sb_vbar"; + rel2.to: "sb_vbar"; + image { + normal: "sb_runnerv.png"; + border: 0 0 4 4; + } + fill.smooth: 0; } } - part { name: "left_bt"; - mouse_events: 1; + part { name: "elm.dragable.vbar"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; + dragable { + x: 0 0 0; + y: 1 1 0; + confine: "sb_vbar"; + } description { state: "default" 0.0; - rel1 { to: "spinner-base"; - offset: 2 2; + fixed: 1 1; + min: 17 17; + rel1 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_vbar"; } - rel2 { to: "spinner-base"; - offset: -3 -3; + rel2 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_vbar"; } - align: 0.0 0.5; - min: 24 24; - max: 24 24; - fixed: 1 1; image { - normal: "bt_base1.png"; + normal: "bt_sm_base2.png"; border: 6 6 6 6; } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; image.middle: SOLID; } } - part { name: "left_over1"; + part { name: "sb_vbar_over1"; + clip_to: "sb_vbar_clip"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "left_bt"; - rel2 { to: "left_bt"; - relative: 1.0 0.5; - } + rel1.to: "elm.dragable.vbar"; + rel2.relative: 1.0 0.5; + rel2.to: "elm.dragable.vbar"; image { - normal: "bt_hilight.png"; - border: 7 7 7 0; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } } } - part { name: "left_over2"; - mouse_events: 1; - repeat_events: 1; + part { name: "sb_vbar_over2"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.to: "left_bt"; - rel2.to: "left_bt"; + rel1.to: "elm.dragable.vbar"; + rel2.to: "elm.dragable.vbar"; image { - normal: "bt_shine.png"; - border: 7 7 7 7; + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } } } - part { name: "left_over3"; - mouse_events: 1; - repeat_events: 1; + + part { name: "sb_hbar_clip_master"; + type: RECT; + mouse_events: 0; description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "left_bt"; - rel2.to: "left_bt"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; } } - part { name: "right_bt"; - mouse_events: 1; + part { name: "sb_hbar_clip"; + clip_to: "sb_hbar_clip_master"; + type: RECT; + mouse_events: 0; description { state: "default" 0.0; - rel1 { to: "spinner-base"; - offset: -27 3; - } - rel2 { to: "spinner-base"; - offset: -3 -3; - } - align: 1.0 0.5; - min: 24 24; - max: 24 24; - fixed: 1 1; - image { - normal: "bt_base1.png"; - border: 5 5 4 12; - } - fill.smooth : 0; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; } } - part { name: "right_over1"; + part { name: "sb_hbar"; + type: RECT; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "right_bt"; - rel2 { to: "right_bt"; - relative: 1.0 0.5; + fixed: 1 1; + visible: 0; + min: 17 17; + align: 0.0 1.0; + rel1 { + relative: 0.0 1.0; + offset: 0 -2; } - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; + rel2 { + relative: 0.0 1.0; + offset: -1 -2; + to_x: "sb_vbar"; } } } - part { name: "right_over2"; - mouse_events: 1; - repeat_events: 1; + part { name: "sb_hbar_runner"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.to: "right_bt"; - rel2.to: "right_bt"; + min: 3 3; + max: 99999 3; + rel1.to: "sb_hbar"; + rel2.to: "sb_hbar"; image { - normal: "bt_shine.png"; - border: 7 7 7 7; + normal: "sb_runnerh.png"; + border: 4 4 0 0; } + fill.smooth: 0; } } - part { name: "right_over3"; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "right_bt"; - rel2.to: "right_bt"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth : 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + part { name: "elm.dragable.hbar"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; + dragable { + x: 1 1 0; + y: 0 0 0; + confine: "sb_hbar"; } - } - part { name: "left_bt_icon"; - repeat_events: 1; description { state: "default" 0.0; - rel1.to: "left_bt"; - rel2.to: "left_bt"; - align: 0.5 0.5; - min: 16 16; - max: 16 16; - image.normal: "sp_bt_l.png"; + fixed: 1 1; + min: 17 17; + rel1 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_hbar"; + } + rel2 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_hbar"; + } + image { + normal: "bt_sm_base2.png"; + border: 6 6 6 6; + } + image.middle: SOLID; } } - part { name: "right_bt_icon"; - repeat_events: 1; + part { name: "sb_hbar_over1"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.to: "right_bt"; - rel2.to: "right_bt"; - align: 0.5 0.5; - min: 16 16; - max: 16 16; - image.normal: "sp_bt_r.png"; + rel1.to: "elm.dragable.hbar"; + rel2.relative: 1.0 0.5; + rel2.to: "elm.dragable.hbar"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } } } - part { name: "month_text"; - type: TEXT; + part { name: "sb_hbar_over2"; + clip_to: "sb_hbar_clip"; mouse_events: 0; - scale: 1; description { state: "default" 0.0; - align: 0 0.5; - fixed: 1 1; - rel1 { relative: 1.0 0.0; - offset: 3 2; - to: "left_bt"; - to_y: "spinner-base"; - } - rel2 { relative: 0.0 1.0; - offset: -3 -2; - to_x: "right_bt"; - to_y: "spinner-base"; - } - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 12; - min: 1 1; - align: 0.5 0.5; + rel1.to: "elm.dragable.hbar"; + rel2.to: "elm.dragable.hbar"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } } } - CH(0) CH(1) CH(2) CH(3) CH(4) CH(5) CH(6) - CIT(0) CIT(1) CIT(2) CIT(3) CIT(4) CIT(5) CIT(6) - CIT(7) CIT(8) CIT(9) CIT(10) CIT(11) CIT(12) CIT(13) - CIT(14) CIT(15) CIT(16) CIT(17) CIT(18) CIT(19) CIT(20) - CIT(21) CIT(22) CIT(23) CIT(24) CIT(25) CIT(26) CIT(27) - CIT(28) CIT(29) CIT(30) CIT(31) CIT(32) CIT(33) CIT(34) - CIT(35) CIT(36) CIT(37) CIT(38) CIT(39) CIT(40) CIT(41) } programs { - program { name: "dec_start"; - signal: "mouse,down,1"; - source: "left_bt"; - action: SIGNAL_EMIT "elm,action,decrement,start" ""; + program { name: "load"; + signal: "load"; + source: ""; + script { + set_state(PART:"sb_hbar_clip", "hidden", 0.0); + set_state(PART:"sb_vbar_clip", "hidden", 0.0); + set_int(sbvis_h, 0); + set_int(sbvis_v, 0); + set_int(sbalways_v, 0); + set_int(sbalways_h, 0); + set_int(sbvis_timer, 0); + } } - program { name: "dec_stop"; - signal: "mouse,up,1"; - source: "left_bt"; - action: SIGNAL_EMIT "elm,action,stop" ""; + + program { name: "vbar_show"; + signal: "elm,action,show,vbar"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "sb_vbar_clip_master"; } - program { name: "inc_start"; - signal: "mouse,down,1"; - source: "right_bt"; - action: SIGNAL_EMIT "elm,action,increment,start" ""; + program { name: "vbar_hide"; + signal: "elm,action,hide,vbar"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "sb_vbar_clip_master"; } - program { name: "inc_stop"; - signal: "mouse,up,1"; - source: "right_bt"; - action: SIGNAL_EMIT "elm,action,stop" ""; + program { name: "vbar_show_always"; + signal: "elm,action,show_always,vbar"; + source: "elm"; + script { + new v; + v = get_int(sbvis_v); + v |= get_int(sbalways_v); + if (!v) { + set_int(sbalways_v, 1); + emit("do-show-vbar", ""); + set_int(sbvis_v, 1); + } + } } - program { - name: "left_bt_click"; - signal: "mouse,down,1"; - source: "left_over2"; - action: STATE_SET "clicked" 0.0; - target: "left_bt"; + program { name: "vbar_show_notalways"; + signal: "elm,action,show_notalways,vbar"; + source: "elm"; + script { + new v; + v = get_int(sbalways_v); + if (v) { + set_int(sbalways_v, 0); + v = get_int(sbvis_v); + if (!v) { + emit("do-hide-vbar", ""); + set_int(sbvis_v, 0); + } + } + } } - program { - name: "left_bt_unclick"; - signal: "mouse,up,1"; - source: "left_over2"; - action: STATE_SET "default" 0.0; - target: "left_bt"; + program { name: "sb_vbar_show"; + signal: "do-show-vbar"; + source: ""; + action: STATE_SET "default" 0.0; + transition: LINEAR 1.0; + target: "sb_vbar_clip"; } - program { - name: "left_bt_click2"; - signal: "mouse,down,1"; - source: "left_over3"; - action: STATE_SET "clicked" 0.0; - target: "left_over3"; + program { name: "sb_vbar_hide"; + signal: "do-hide-vbar"; + source: ""; + action: STATE_SET "hidden" 0.0; + transition: LINEAR 1.0; + target: "sb_vbar_clip"; } - program { - name: "left_bt_unclick2"; - signal: "mouse,up,1"; - source: "left_over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "left_over3"; + + program { name: "hbar_show"; + signal: "elm,action,show,hbar"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "sb_hbar_clip_master"; } - program { - name: "right_bt_click"; - signal: "mouse,down,1"; - source: "right_over2"; - action: STATE_SET "clicked" 0.0; - target: "right_bt"; + program { name: "hbar_hide"; + signal: "elm,action,hide,hbar"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "sb_hbar_clip_master"; } - program { - name: "right_bt_unclick"; - signal: "mouse,up,1"; - source: "right_over2"; - action: STATE_SET "default" 0.0; - target: "right_bt"; + program { name: "hbar_show_always"; + signal: "elm,action,show_always,hbar"; + source: "elm"; + script { + new v; + v = get_int(sbvis_h); + v |= get_int(sbalways_h); + if (!v) { + set_int(sbalways_h, 1); + emit("do-show-hbar", ""); + set_int(sbvis_h, 1); + } + } + } + program { name: "hbar_show_notalways"; + signal: "elm,action,show_notalways,hbar"; + source: "elm"; + script { + new v; + v = get_int(sbalways_h); + if (v) { + set_int(sbalways_h, 0); + v = get_int(sbvis_h); + if (!v) { + emit("do-hide-hbar", ""); + set_int(sbvis_h, 0); + } + } + } + } + program { name: "sb_hbar_show"; + signal: "do-show-hbar"; + source: ""; + action: STATE_SET "default" 0.0; + transition: LINEAR 1.0; + target: "sb_hbar_clip"; + } + program { name: "sb_hbar_hide"; + signal: "do-hide-hbar"; + source: ""; + action: STATE_SET "hidden" 0.0; + transition: LINEAR 1.0; + target: "sb_hbar_clip"; + } + + program { name: "scroll"; + signal: "elm,action,scroll"; + source: "elm"; + script { + new v; + v = get_int(sbvis_v); + v |= get_int(sbalways_v); + if (!v) { + emit("do-show-vbar", ""); + set_int(sbvis_v, 1); + } + v = get_int(sbvis_h); + v |= get_int(sbalways_h); + if (!v) { + emit("do-show-hbar", ""); + set_int(sbvis_h, 1); + } + v = get_int(sbvis_timer); + if (v > 0) cancel_timer(v); + v = timer(2.0, "timer0", 0); + set_int(sbvis_timer, v); + } + } + program { name: "go1"; + signal: "elm,state,busy,start"; + source: "elm"; + action: STATE_SET "active" 0.0; + transition: SINUSOIDAL 1.0; + target: "busy_clip"; } - program { - name: "right_bt_click2"; - signal: "mouse,down,1"; - source: "right_over3"; - action: STATE_SET "clicked" 0.0; - target: "right_over3"; + program { name: "go2"; + signal: "elm,state,busy,start"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.5; + target: "busy"; + after: "go2"; } - program { - name: "right_bt_unclick2"; - signal: "mouse,up,1"; - source: "right_over3"; + program { name: "stop1"; + signal: "elm,state,busy,stop"; + source: "elm"; action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "right_over3"; + transition: SINUSOIDAL 1.0; + target: "busy_clip"; + after: "stop2"; } - } - } - -#undef CIT -#undef CH - -//////////////////////////////////////////////////////////////////////////////// -// colorselector -//////////////////////////////////////////////////////////////////////////////// - group { name: "elm/colorselector/bg/default"; - parts { - part { name: "elm.colorbar_0"; - type: SWALLOW; - mouse_events: 1; - description { state: "default" 0.0; - min: 120 30; - rel1.relative: 0.0 0.00653594771; - rel2.relative: 1.0 0.254901961; - } - } - part { name: "elm.colorbar_1"; - type: SWALLOW; - mouse_events: 1; - description { state: "default" 0.0; - min: 120 30; - rel1.relative: 0.0 0.254901961; - rel2.relative: 1.0 0.503267974; - } - } - part { name: "elm.colorbar_2"; - type: SWALLOW; - mouse_events: 1; - description { state: "default" 0.0; - min: 120 30; - rel1.relative: 0.0 0.503267974; - rel2.relative: 1.0 0.751633987; - } - } - part { name: "elm.colorbar_3"; - type: SWALLOW; - mouse_events: 1; - description { state: "default" 0.0; - min: 120 30; - rel1.relative: 0.0 0.751633987; - rel2.relative: 1.0 1.0; - } + program { name: "stop2"; + action: ACTION_STOP; + target: "go2"; } } } - - group { name: "elm/colorselector/base/default"; - parts { - part { name: "elm.bar_bg"; - type: SWALLOW; - mouse_events: 0; - description { state: "default" 0.0; - min: 60 22; - rel1 { - relative: 0.0 0.8; - to_x: "elm.arrow_bg"; - to_y: "elm.arrow_icon"; - offset: 0 0; - } - rel2 { - relative: 1.0 0.83; - to_x: "elm.arrow_bg"; - offset: 0 0; - } - } - } - part { name: "elm.bar"; - type: SWALLOW; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.bar_bg"; - rel2.to: "elm.bar_bg"; + group { name: "elm/map/marker/radio/default"; + data { + item: size_w 24; + item: size_h 24; + item: size_max_w 58; + item: size_max_h 58; + } + images { + image: "map_item.png" COMP; + } + parts { + part { name: "whole"; + description { state: "default" 0.0; + } } - } - part { name: "elm.arrow_bg"; - type: SWALLOW; - mouse_events: 1; - description { state: "default" 0.0; - rel1 { - relative: 1.0 0.17; - offset: 3 0; - to_x: "elm.l_button"; - } - rel2 { - relative: 0.0 0.83; - offset: -4 0; - to_x: "elm.r_button"; - } + part { name: "base"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + image.normal: "map_item.png"; + } } - } - part { name: "elm.arrow"; - type: RECT; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - min: 1 1; - fixed: 1 1; - align: 0 0; - rel1 { - to_x: "elm.arrow_bg"; - } - rel2 { - relative: 0.0 0.17; - to_x: "elm.arrow_bg"; - } - color: 0 0 0 0; - visible: 0; + part { name: "elm.icon"; + type: SWALLOW; + clip_to: "whole"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.relative: 0.27 0.27; + rel2.relative: 0.73 0.73; + } } - dragable { - confine: "elm.arrow_bg"; - x: 1 1 0; - y: 0 0 0; + part { name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.5 0.5; + color: 224 224 224 255; + color3: 0 0 0 64; + rel1.relative: 0.28 0.25; + rel2.relative: 0.75 0.75; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; + } + } } - } - part { name: "elm.arrow_icon"; - type: SWALLOW; - mouse_events: 0; - description { state: "default" 0.0; - min: 25 15; - max: 25 15; - fixed: 1 1; - align: 0.5 0; - rel1 { - to_x: "elm.arrow"; - } - rel2 { - relative: 1.0 0.0; - offset: 0 10; - to_x: "elm.arrow"; - } + } + programs { + program { name: "open"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "open" "elm"; } - } - part { name: "event"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - rel1 { - to: "elm.arrow_icon"; - } - rel2 { - to_x: "elm.arrow_icon"; - to_y: "elm.arrow_bg"; - offset: 0 0; - } - color: 0 0 0 0; + program { name: "bringin"; + signal: "mouse,down,1,double"; + source: "base"; + action: SIGNAL_EMIT "bringin" "elm"; } - dragable { - events: "elm.arrow"; + } + } + group { name: "elm/map/marker/radio2/default"; + data { + item: size_w 24; + item: size_h 24; + item: size_max_w 58; + item: size_max_h 58; + } + images { + image: "map_item_2.png" COMP; + } + parts { + part { name: "base"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + image.normal: "map_item_2.png"; + } } - } - part { name: "elm.l_button"; - type: SWALLOW; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - min: 24 24; - fixed: 1 1; - rel1 { - relative: 0.0 0.0; - to_y: "elm.bar_bg"; - } - rel2 { - relative: 0.0 1.0; - to_y: "elm.bar_bg"; - } - align: 0.0 0.5; + part { name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.5 0.5; + color: 224 224 224 255; + color3: 0 0 0 64; + rel1.relative: 0.28 0.25; + rel2.relative: 0.75 0.75; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; + } + } } - } - part { name: "elm.r_button"; - type: SWALLOW; - mouse_events: 1; - scale: 1; - description { - state: "default" 0.0; - min: 24 24; - fixed: 1 1; - rel1 { - relative: 1.0 0.0; - to_y: "elm.bar_bg"; - } - rel2 { - relative: 1.0 1.0; - to_y: "elm.bar_bg"; - } - align: 1.0 0.5; + } + programs { + program { name: "open"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "open" "elm"; } - } - } - } - - group{ name: "elm/colorselector/image/colorbar_0"; - images { - image: "color_picker_color.png" COMP; - } - parts { - part { name: "colorbar_0_image"; - type: IMAGE; - mouse_events: 1; - description { state: "default" 0.0; - rel2.offset: -1 -1; - image.normal: "color_picker_color.png"; + program { name: "bringin"; + signal: "mouse,down,1,double"; + source: "base"; + action: SIGNAL_EMIT "bringin" "elm"; } - } - } + } } - - group { name: "elm/colorselector/image/colorbar_1"; - images { - image: "color_picker_opacity.png" COMP; - } - parts { - part { name: "colorbar_1_image"; - type: IMAGE; - mouse_events: 1; - description { state: "default" 0.0; - rel2.offset: -1 -1; - image.normal: "color_picker_opacity.png"; + group { name: "elm/map/marker/empty/default"; + data { + item: size_w 22; + item: size_h 22; + item: size_max_w 64; + item: size_max_h 64; + } + parts { + part { name: "whole"; + description { state: "default" 0.0; + } } - } - } - } - - group { name: "elm/colorselector/image/colorbar_2"; - images { - image: "color_picker_brightness.png" COMP; - } - parts { - part { name: "colorbar_2_image"; - type: IMAGE; - mouse_events: 1; - description { state: "default" 0.0; - rel2.offset: -1 -1; - image.normal: "color_picker_brightness.png"; + part { name: "base"; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + } } - } - } - } - - group { name: "elm/colorselector/image/colorbar_3"; - images { - image: "color_picker_alpha.png" COMP; - } - parts { - part { name: "colorbar_3_image"; - type: IMAGE; - mouse_events: 1; - description { state: "default" 0.0; - rel2.offset: -1 -1; - image.normal: "color_picker_alpha.png"; + part { name: "elm.icon"; + type: SWALLOW; + clip_to: "whole"; + mouse_events: 0; + description { state: "default" 0.0; + } } - } - } - } - - group { name: "elm/colorselector/bg_image/colorbar_3"; - images { - image: "color_picker_alpha_bg.png" COMP; - } - parts { - part { name: "colorbar_3_image"; - type: IMAGE; - mouse_events: 1; - description { state: "default" 0.0; - rel2.offset: -1 -1; - image.normal: "color_picker_alpha_bg.png"; + part { name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.5 0.5; + color: 224 224 224 255; + color3: 0 0 0 64; + rel1.relative: 0.28 0.25; + rel2.relative: 0.75 0.75; + text { + font: "Sans,Edje-Vera"; + size: 10; + min: 0 0; + align: 0.5 0.5; + } + } } - } - } - } - - group { name: "elm/colorselector/image/updown"; - images { - image: "icon_arrow_down.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; + } + programs { + program { name: "open"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "open" "elm"; } - } - part { name: "arrow_image"; - type: IMAGE; - mouse_events: 1; - description { state: "default" 0.0; - image.normal: "icon_arrow_down.png"; + program { name: "bringin"; + signal: "mouse,down,1,double"; + source: "base"; + action: SIGNAL_EMIT "bringin" "elm"; } - } - } + } } + group { name: "elm/map/marker_bubble/default"; + images { + image: "bubble.png" COMP; + image: "bubble_shine.png" COMP; + } + data { + item: size_w 400; + item: size_h 100; + } + parts { + part { name: "clipper"; + mouse_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "base0"; + mouse_events: 0; + clip_to: "clipper"; + description { state: "default" 0.0; + image { + normal: "bubble.png"; + border: 11 36 10 19; + } + image.middle: SOLID; + fill.smooth: 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + description { state: "default" 0.0; + align: 0.5 0.5; + rel1 { + offset: 9 8; + } + rel2 { + offset: -10 -17; + } + } + } + part { name: "shine"; + mouse_events: 0; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1 { + to: "base0"; + } + rel2 { + to: "base0"; + relative: 1.0 0.5; + } + image { + normal: "bubble_shine.png"; + border: 5 5 5 0; + } + fill.smooth: 0; + } + } + } + programs { + program { name: "show"; + signal: "show"; + action: STATE_SET "show" 0.0; + target: "clipper"; + transition: ACCELERATE 0.5; + } + } + } - group { name: "elm/colorselector/button/left"; +///////////////////////////////////////////////////////////////////////////// +// PANES +///////////////////////////////////////////////////////////////////////////// + group { + name: "elm/panes/vertical/default"; images { - image: "bt_base1.png" COMP; - image: "bt_shine.png" COMP; - image: "sp_bt_l.png" COMP; + image: "bt_base1.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + image: "arrow_right.png" COMP; + image: "arrow_left.png" COMP; } - parts { - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - image.normal: "bt_base1.png"; - image.border: 6 6 6 6; - image.middle: SOLID; + parts + { + part + { + name: "whole"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + visible: 0; + } } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_shine.png"; - image.border: 6 6 6 6; - image.middle: SOLID; - } - } - part { name: "btn_over"; - type: IMAGE; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2 { - relative: 1.0 0.5; - to: "button_image"; - } - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } + //2 contents + part + { + name: "whole_left"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + rel2.to_x: "elm.bar"; + rel2.relative: 0.0 1.0; + visible: 1; + } } - } - part { name: "btn_over2"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2.to: "button_image"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } + part + { + name: "elm.swallow.left"; + type: SWALLOW; + clip_to: "whole_left"; + description + { + state: "default" 0.0; + rel1.to: "whole_left"; + rel2.to: "whole_left"; + } } - } - part { name: "focus_image"; - type: IMAGE; - description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "button_image"; - rel2.to: "button_image"; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; - } - fill.smooth: 0; + part + { + name: "whole_right"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1.to_x: "elm.bar"; + rel1.relative: 1.0 0.0; + visible: 1; + } } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + part + { + name: "elm.swallow.right"; + type: SWALLOW; + clip_to: "whole_right"; + description + { + state: "default" 0.0; + rel1.to: "whole_right"; + rel2.to: "whole_right"; + } } - } - part { name: "left_arrow"; - mouse_events: 1; - description { state: "default" 0.0; - min: 16 16; - max: 16 16; - image.normal: "sp_bt_l.png"; + //BAR + part { name: "elm.bar"; + mouse_events: 1; + dragable { + confine: "whole"; + x: 1 1 1; + y: 0 0 0; } - } - } - - programs { - program { - name: "button_down"; - signal: "elm,state,left,button,down"; - source: "left_button"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - target: "focus_image"; - } - program { - name: "button_up"; - signal: "elm,state,left,button,up"; - source: "left_button"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "focus_image"; - } - } - } - - group { name: "elm/colorselector/button/right"; - images { - image: "bt_base1.png" COMP; - image: "bt_shine.png" COMP; - image: "sp_bt_r.png" COMP; - } - parts { - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - image.normal: "bt_base1.png"; - image.border: 6 6 6 6; + description { state: "default" 0.0; + max: 15 9999; + min: 15 100; + rel1.relative: 0.0 0.5; + rel2.relative: 1.0 0.5; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } image.middle: SOLID; - } - - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_shine.png"; - image.border: 6 6 6 6; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; image.middle: SOLID; - } - } - part { name: "btn_over"; - type: IMAGE; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2 { - relative: 1.0 0.5; - to: "button_image"; - } - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - } - part { name: "btn_over2"; - type: IMAGE; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + } + } + part { name: "over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.bar"; + rel2.to: "elm.bar"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + rel1.to: "elm.bar"; + rel2.to: "elm.bar"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "over3"; mouse_events: 1; repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2.to: "button_image"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - } - part { name: "focus_image"; - type: IMAGE; description { state: "default" 0.0; color: 255 255 255 0; - rel1.to: "button_image"; - rel2.to: "button_image"; + rel1.to: "elm.bar"; + rel2.to: "elm.bar"; image { normal: "bt_glow.png"; border: 12 12 12 12; } - fill.smooth: 0; - + fill.smooth : 0; } description { state: "clicked" 0.0; - inherit: "default" 0.0; + inherit: "default" 0.0; visible: 1; color: 255 255 255 255; } } - part { name: "right_arrow"; - mouse_events: 1; - description { state: "default" 0.0; - min: 16 16; - max: 16 16; - image.normal: "sp_bt_r.png"; - } - } - } - - programs { - program { - name: "button_down"; - signal: "elm,state,right,button,down"; - source: "right_button"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - target: "focus_image"; - } - program { - name: "button_up"; - signal: "elm,state,right,button,up"; - source: "right_button"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "focus_image"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// -#define FLIP_PICKER_MAX_LEN (50) -#define FLIP_PICKER_MAX_LEN_STR "50" - - group { name: "elm/flipselector/base/default"; - images { - image: "flip_base.png" COMP; - image: "flip_base_shad.png" COMP; - image: "flip_shad.png" COMP; - image: "arrow_up.png" COMP; - image: "arrow_down.png" COMP; - image: "flip_t.png" COMP; - image: "flip_b.png" COMP; - } - data { - item: "max_len" FLIP_PICKER_MAX_LEN_STR; - } - - //FIXME: quick successive clicks on, say, up, lead to nastiness - script { - public cur, prev, next, lock; + //Arrow + part { + name: "arrow_right"; + description { state: "default" 0.0; + min: 45 45; + max: 45 45; + color: 255 255 255 0; - public animator_bottom_down(val, Float:pos) { - new tmp[FLIP_PICKER_MAX_LEN]; + rel1.relative: 1.0 0.5; + rel1.to_x: "elm.bar"; + rel1.offset: 45/2 -45/2; - set_tween_state(PART:"bottom", pos, "shrink", 0.0, "default", 0.0); - set_tween_state(PART:"bottom_sheet", pos, "shrink", 0.0, "default", - 0.0); - set_tween_state(PART:"shadow", pos, "half", 0.0, "full", - 0.0); + rel2.relative: 1.0 0.5; + rel2.to_x: "elm.bar"; + rel2.offset: 45/2 45/2; - if (pos >= 1.0) { - set_state(PART:"shadow", "default", 0.0); - set_int(lock, 0); + image.normal: "arrow_right.png"; - fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN); - if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) { - replace_str(next, 0, ""); - message(MSG_STRING, 1, tmp); - } + fixed: 1 1; } - } - - public animator_top_down(val, Float:pos) { - set_tween_state(PART:"top", pos, "default", 0.0, "shrink", 0.0); - set_tween_state(PART:"top_sheet", pos, "default", 0.0, "shrink", - 0.0); - set_tween_state(PART:"shadow", pos, "default", 0.0, "half", - 0.0); - - if (pos >= 1.0) - anim(0.2, "animator_bottom_down", val); - } - - public animator_bottom_up(val, Float:pos) { - set_tween_state(PART:"bottom", pos, "default", 0.0, "shrink", 0.0); - set_tween_state(PART:"bottom_sheet", pos, "default", 0.0, "shrink", - 0.0); - set_tween_state(PART:"shadow", pos, "full", 0.0, "half", - 0.0); - - if (pos >= 1.0) - anim(0.2, "animator_top_up", val); - } - - public animator_top_up(val, Float:pos) { - new tmp[FLIP_PICKER_MAX_LEN]; - - set_tween_state(PART:"top", pos, "shrink", 0.0, "default", 0.0); - set_tween_state(PART:"top_sheet", pos, "shrink", 0.0, "default", - 0.0); - set_tween_state(PART:"shadow", pos, "half", 0.0, "default", - 0.0); - - if (pos >= 1.0) { - set_state(PART:"shadow", "default", 0.0); - set_int(lock, 0); - - fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN); - if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) { - replace_str(next, 0, ""); - message(MSG_STRING, 2, tmp); - } + description { state: "anim_1" 0.0; + inherit: "default" 0.0; + color: 255 255 255 200; + rel1.offset: (45/2 + 10) -45/2; + rel2.offset: (45/2 +10) 45/2; } - } - - public message(Msg_Type:type, id, ...) { - /* flip down */ - if ((type == MSG_STRING) && (id == 1)) { - new value[FLIP_PICKER_MAX_LEN], tmp[FLIP_PICKER_MAX_LEN]; - - snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2)); - - if (get_int(lock) == 1) { - replace_str(next, 0, value); - return; - } - - fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN); - - set_text(PART:"bottom_b", tmp); - - set_state(PART:"top", "shrink", 0.0); - set_text(PART:"top", tmp); - set_state(PART:"top", "default", 0.0); - set_text(PART:"top", tmp); - - replace_str(prev, 0, tmp); - - set_state(PART:"bottom", "default", 0.0); - set_text(PART:"bottom", value); - set_state(PART:"bottom", "shrink", 0.0); - set_text(PART:"bottom", value); - - set_text(PART:"top_b", value); - - replace_str(cur, 0, value); - - set_state(PART:"bottom_sheet", "shrink", 0.0); - set_state(PART:"top_sheet", "default", 0.0); - - set_int(lock, 1); - set_state(PART:"shadow", "default", 0.0); - anim(0.2, "animator_top_down", 1); + description { state: "anim_2" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + rel1.offset: (45/2 + 20) -45/2; + rel2.offset: (45/2 + 20) 45/2; } + } + part { + name: "arrow_left"; + description { state: "default" 0.0; + min: 45 45; + max: 45 45; + color: 255 255 255 0; - /* flip up */ - if ((type == MSG_STRING) && (id == 2)) { - new value[FLIP_PICKER_MAX_LEN], tmp[FLIP_PICKER_MAX_LEN]; - - snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2)); - - if (get_int(lock) == 1) { - replace_str(next, 0, value); - return; - } - - fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN); - - set_text(PART:"top_b", tmp); - - set_state(PART:"bottom", "shrink", 0.0); - set_text(PART:"bottom", tmp); - set_state(PART:"bottom", "default", 0.0); - set_text(PART:"bottom", tmp); - - replace_str(prev, 0, tmp); - - set_state(PART:"top", "default", 0.0); - set_text(PART:"top", value); - set_state(PART:"top", "shrink", 0.0); - set_text(PART:"top", value); - - set_text(PART:"bottom_b", value); + rel1.relative: 0.0 0.5; + rel1.to_x: "elm.bar"; + rel1.offset: -45/2 -45/2; - replace_str(cur, 0, value); + rel2.relative: 0.0 0.5; + rel2.to_x: "elm.bar"; + rel2.offset: -45/2 45/2; - set_state(PART:"bottom_sheet", "default", 0.0); - set_state(PART:"top_sheet", "shrink", 0.0); + image.normal: "arrow_left.png"; - set_int(lock, 1); - set_state(PART:"shadow", "full", 0.0); - anim(0.2, "animator_bottom_up", 1); + fixed: 1 1; + } + description { state: "anim_1" 0.0; + inherit: "default" 0.0; + color: 255 255 255 200; + rel1.offset: (-45/2 - 10) -45/2; + rel2.offset: (-45/2 - 10) 45/2; + } + description { state: "anim_2" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + rel1.offset: (-45/2 - 20) -45/2; + rel2.offset: (-45/2 - 20) 45/2; } } - } - parts { - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: -4 -4; - rel1.to: "base"; - rel2.offset: 3 3; - rel2.to: "base"; - image { - normal: "flip_base_shad.png"; - border: 8 8 8 8; - } - } + } + programs { + program { + name: "button_click"; + signal: "mouse,down,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + after: "arrow_anim_start"; } - - part { name: "base"; - scale: 1; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - min: 24 48; - image.normal: "flip_base.png"; - } + program { + name: "button_click_anim"; + action: STATE_SET "clicked" 0.0; + target: "elm.bar"; } - - part { name: "b"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel1.relative: 0.0 0.5; - rel2.to: "base"; - color: 0 0 0 0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } + program { + name: "button_unclick"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + after: "arrow_anim_stop"; } - - part { name: "t"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - rel2.relative: 1.0 0.5; - color: 0 0 0 0; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } + program { + name: "button_unclick_anim"; + action: STATE_SET "default" 0.0; + target: "elm.bar"; + } + program { + name: "button_click2"; + signal: "mouse,down,1"; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; + } + program { + name: "button_unclick2"; + signal: "mouse,up,1"; + source: "over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "over3"; + } + program { + name: "button_unclick3"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { + name: "button_down_double"; + signal: "mouse,down,1,double"; + source: "over3"; + action: SIGNAL_EMIT "elm,action,click,double" ""; } - part { name: "bottom_sheet_static"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 1; - rel1.to: "b"; - rel2.to: "b"; - image.normal: "flip_b.png"; - } + //arrows animation + program { + name: "arrow_anim_start"; + action: STATE_SET "anim_1" 0.0; + target: "arrow_right"; + target: "arrow_left"; + transition: LINEAR 0.6; + after: "arrow_anim_1"; } - - part { name: "bottom_b"; - mouse_events: 0; - clip_to: "bottom_clipper"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - color: 0 0 0 255; - color2: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 30; - min: 1 1; - align: 0.5 0.5; - } - } + program { + name: "arrow_anim_1"; + action: STATE_SET "anim_2" 0.0; + target: "arrow_right"; + target: "arrow_left"; + transition: LINEAR 0.6; + after: "arrow_anim_2"; } - - part { name: "shadow"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "b"; - rel2.to: "b"; - rel2.relative: 1.0 0.0; - image.normal: "flip_shad.png"; - } - description { state: "half" 0.0; - inherit: "default" 0.0; - rel2.relative: 1.0 0.5; - } - description { state: "full" 0.0; - inherit: "default" 0.0; - rel2.relative: 1.0 1.0; - } - } - - part { name: "bottom_sheet"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 1; - rel1.to: "b"; - rel2.to: "b"; - image.normal: "flip_b.png"; - } - description { state: "shrink" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - } + program { + name: "arrow_anim_2"; + action: STATE_SET "default" 0.0; + target: "arrow_right"; + target: "arrow_left"; + after: "arrow_anim_start"; } - - part { name: "bottom"; - mouse_events: 0; - clip_to: "bottom_clipper"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - color: 0 0 0 255; - color2: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 30; - min: 1 1; - align: 0.5 0.5; - } - } - description { state: "shrink" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel2.relative: 1.0 0.5; /* FIXME: same visual effect? --> MAP! */ - } + program { + name: "arrow_anim_stop"; + action: ACTION_STOP; + target: "arrow_anim_start"; + target: "arrow_anim_1"; + target: "arrow_anim_2"; + after: "arrow_anim_stop_1"; } + program { + name: "arrow_anim_stop_1"; + action: STATE_SET "default" 0.0; + target: "arrow_right"; + target: "arrow_left"; + transition: DECELERATE 0.4; + } + } + } - part { name: "top_sheet_static"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 1; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "flip_t.png"; - } - } + group { + name: "elm/panes/horizontal/default"; + images { + image: "bt_base1.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + image: "arrow_up.png" COMP; + image: "arrow_down.png" COMP; + } + parts + { + part + { + name: "whole"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + visible: 0; + } + } - part { name: "top_b"; - mouse_events: 0; - clip_to: "top_clipper"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - color: 0 0 0 255; - color2: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 30; - min: 1 1; - align: 0.5 0.5; - source: "top"; - } + //2 contents + part + { + name: "whole_left"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + rel2.to_y: "elm.bar"; + rel2.relative: 1.0 0.0; + visible: 1; + } + } + part + { + name: "elm.swallow.left"; + type: SWALLOW; + clip_to: "whole_left"; + description + { + state: "default" 0.0; + rel1.to: "whole_left"; + rel2.to: "whole_left"; + } } - } - part { name: "top_sheet"; - mouse_events: 0; + part + { + name: "whole_right"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1.to_y: "elm.bar"; + rel1.relative: 0.0 1.0; + visible: 1; + } + } + part + { + name: "elm.swallow.right"; + type: SWALLOW; + clip_to: "whole_right"; + description + { + state: "default" 0.0; + rel1.to: "whole_right"; + rel2.to: "whole_right"; + } + } + //BAR + part { name: "elm.bar"; + mouse_events: 1; + dragable { + confine: "whole"; + x: 0 0 0; + y: 1 1 1; + } description { state: "default" 0.0; - visible: 1; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "flip_t.png"; + max: 999 15; + min: 100 15; + rel1.relative: 0.5 0.0; + rel2.relative: 0.5 1.0; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + image.middle: SOLID; } - description { state: "shrink" 0.0; + description { state: "clicked" 0.0; inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - } - - part { name: "top"; - mouse_events: 0; - clip_to: "top_clipper"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - color: 0 0 0 255; - color2: 0 0 0 255; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 30; - min: 1 1; - align: 0.5 0.5; - } - } - description { state: "shrink" 0.0; - inherit: "default" 0.0; - visible: 0; - rel1.relative: 0.0 0.5; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } - } - - part { name: "arrow_top"; + } + part { name: "over1"; mouse_events: 0; - scale: 1; description { state: "default" 0.0; - min: 15 15; - max: 15 15; - align: 0.5 0.0; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "arrow_up.png"; + rel1.to: "elm.bar"; + rel2.to: "elm.bar"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } } - part { name: "arrow_bottom"; - mouse_events: 0; - scale: 1; + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; description { state: "default" 0.0; - min: 15 15; - max: 15 15; - align: 0.5 1.0; - rel1.to: "b"; - rel2.to: "b"; - image.normal: "arrow_down.png"; + rel1.to: "elm.bar"; + rel2.to: "elm.bar"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } } - description { state: "hidden" 0.0; - inherit: "default" 0.0; + description { state: "disabled" 0.0; + inherit: "default" 0.0; visible: 0; } } - - part { - type: RECT; - mouse_events: 0; - name: "top_clipper"; - description { - state: "default" 0.0; - rel1.to: "t"; - rel2.to: "t"; + part { name: "over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "elm.bar"; + rel2.to: "elm.bar"; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; visible: 1; + color: 255 255 255 255; } } + //Arrow part { - type: RECT; - mouse_events: 0; - name: "bottom_clipper"; - description { - state: "default" 0.0; - rel1.to: "b"; - rel2.to: "b"; - visible: 1; + name: "arrow_right"; + description { state: "default" 0.0; + min: 45 45; + max: 45 45; + color: 255 255 255 0; + + rel1.relative: 0.5 1.0; + rel1.to_y: "elm.bar"; + rel1.offset: -45/2 45/2; + + rel2.relative: 0.5 1.0; + rel2.to_y: "elm.bar"; + rel2.offset: 45/2 45/2; + + image.normal: "arrow_down.png"; + + fixed: 1 1; + } + description { state: "anim_1" 0.0; + inherit: "default" 0.0; + color: 255 255 255 200; + rel1.offset: -45/2 (45/2 +10); + rel2.offset: 45/2 (45/2 +10); + } + description { state: "anim_2" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + rel1.offset: -45/2 (45/2 + 20); + rel2.offset: 45/2 (45/2 + 20); } } - } + part { + name: "arrow_left"; + description { state: "default" 0.0; + min: 45 45; + max: 45 45; + color: 255 255 255 0; - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - append_str(cur, ""); - append_str(prev, ""); - append_str(next, ""); - set_int(lock, 0); - } - } + rel1.relative: 0.5 0.0; + rel1.to_y: "elm.bar"; + rel1.offset: -45/2 -45/2; - program { name: "hide_arrows"; - signal: "elm,state,button,hidden"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "arrow_top"; - target: "arrow_bottom"; - target: "t"; - target: "b"; - } + rel2.relative: 0.5 0.0; + rel2.to_y: "elm.bar"; + rel2.offset: 45/2 -45/2; - program { name: "show_arrows"; - signal: "elm,state,button,visible"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "arrow_top"; - target: "arrow_bottom"; - target: "t"; - target: "b"; + image.normal: "arrow_up.png"; + + fixed: 1 1; + } + description { state: "anim_1" 0.0; + inherit: "default" 0.0; + color: 255 255 255 200; + rel1.offset: -45/2 (-45/2 - 10); + rel2.offset: 45/2 (-45/2 - 10); + } + description { state: "anim_2" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + rel1.offset: -45/2 (-45/2 - 20); + rel2.offset: 45/2 (-45/2 - 20); + } } - program { name: "up"; + } + programs { + program { + name: "button_click"; signal: "mouse,down,1"; - source: "t"; - action: SIGNAL_EMIT "elm,action,up,start" ""; + source: "over2"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + after: "arrow_anim_start"; } - program { name: "up,stop"; + program { + name: "button_click_anim"; + action: STATE_SET "clicked" 0.0; + target: "elm.bar"; + } + program { + name: "button_unclick"; signal: "mouse,up,1"; - source: "t"; - action: SIGNAL_EMIT "elm,action,up,stop" ""; + source: "over2"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + after: "arrow_anim_stop"; } - program { name: "down"; + program { + name: "button_unclick_anim"; + action: STATE_SET "default" 0.0; + target: "elm.bar"; + } + program { + name: "button_click2"; signal: "mouse,down,1"; - source: "b"; - action: SIGNAL_EMIT "elm,action,down,start" ""; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; } - program { name: "down,stop"; + program { + name: "button_unclick2"; signal: "mouse,up,1"; - source: "b"; - action: SIGNAL_EMIT "elm,action,down,stop" ""; + source: "over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "over3"; + } + program { + name: "button_unclick3"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { + name: "button_down_double"; + signal: "mouse,down,1,double"; + source: "over3"; + action: SIGNAL_EMIT "elm,action,click,double" ""; } - } - } - -//////////////////////////////////////////////////////////////////////////////// -// diskselector -//////////////////////////////////////////////////////////////////////////////// - group { name: "elm/diskselector/base/default"; - images { - image: "bar_shine.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 0 0 0 255; - } - } - part { name: "shine_left"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel1.relative: -0.1 0; - rel2.to: "bg"; - rel2.relative: 0.1 1; - image.normal: "bar_shine.png"; - color: 255 255 255 120; - } - } - part { name: "shine_center"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel1.relative: 0.2 0; - rel2.to: "bg"; - rel2.relative: 0.8 1; - image.normal: "bar_shine.png"; - color: 255 255 255 180; - } + //arrows animation + program { + name: "arrow_anim_start"; + action: STATE_SET "anim_1" 0.0; + target: "arrow_right"; + target: "arrow_left"; + transition: LINEAR 0.6; + after: "arrow_anim_1"; } - part { name: "shine_right"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel1.relative: 0.9 0; - rel2.to: "bg"; - rel2.relative: 1.1 1; - image.normal: "bar_shine.png"; - color: 255 255 255 120; - } + program { + name: "arrow_anim_1"; + action: STATE_SET "anim_2" 0.0; + target: "arrow_right"; + target: "arrow_left"; + transition: LINEAR 0.6; + after: "arrow_anim_2"; } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - rel1.offset: 2 2; - rel2.offset: -3 -3; - } + program { + name: "arrow_anim_2"; + action: STATE_SET "default" 0.0; + target: "arrow_right"; + target: "arrow_left"; + after: "arrow_anim_start"; } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } + program { + name: "arrow_anim_stop"; + action: ACTION_STOP; + target: "arrow_anim_start"; + target: "arrow_anim_1"; + target: "arrow_anim_2"; + after: "arrow_anim_stop_1"; } + program { + name: "arrow_anim_stop_1"; + action: STATE_SET "default" 0.0; + target: "arrow_right"; + target: "arrow_left"; + transition: DECELERATE 0.4; + } } - } + } - group { name: "elm/diskselector/item/default"; - data { - item: "len_threshold" "14"; - } - parts { - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0 0; - offset: 4 4; - } - rel2 { - relative: 0 1; - offset: 4 -5; - } +///////////////////////////////////////////////////////////////////////////// +// PANEL +///////////////////////////////////////////////////////////////////////////// + group { + name: "elm/panel/base/left"; + images + { + image: "bt_base1.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "icon_arrow_left.png" COMP; + image: "icon_arrow_right.png" COMP; + } + parts + { + part + { + name: "bg"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + color: 255 255 255 0; + rel1.offset: 30 0; + rel2.relative: 0.0 1.0; + } + description + { + state: "visible" 0.0; + inherit: "default" 0.0; + rel2.relative: 1.0 1.0; + } } - description { state: "show" 0.0; - inherit: "default" 0.0; + part + { + name: "base"; + type: IMAGE; + mouse_events: 0; + description + { + state: "default" 0.0; + rel2 + { + offset: -20 -1; + to_x: "bg"; + } + image + { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + } } - description { state: "default_small" 0.0; - inherit: "default" 0.0; - rel1.relative: 0 0.2; - rel2.relative: 0 0.8; + part + { + name: "clipper"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1 + { + offset: 4 4; + to: "base"; + } + rel2 + { + offset: -5 -5; + to: "base"; + } + } + } + part + { + name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + description + { + state: "default" 0.0; + rel1.to: "clipper"; + rel2.to: "clipper"; + } + } + part + { + name: "btn"; + type: IMAGE; + mouse_events: 1; + description + { + state: "default" 0.0; + max: 32 48; + fixed: 1 1; + align: 0.0 0.5; + rel1 + { + relative: 1.0 0.0; + offset: -3 0; + to_x: "base"; + } + rel2.to_x: "bg"; + image + { + normal: "bt_base1.png"; + border: 0 5 4 12; + } + fill.smooth: 0; + } + description + { + state: "clicked" 0.0; + inherit: "default" 0.0; + } } - description { state: "left_side" 0.0; - inherit: "default" 0.0; - rel1.relative: 0 0.2; - rel2.relative: 0 0.8; - color: 255 255 255 160; + part + { + name: "btn_over"; + type: IMAGE; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1.to: "btn"; + rel2 + { + relative: 1.0 0.5; + to: "btn"; + } + image + { + normal: "bt_hilight.png"; + border: 0 7 7 0; + } + } } - description { state: "right_side" 0.0; - inherit: "left_side" 0.0; - rel1.relative: 0.4 0.2; - rel2.relative: 0.4 0.8; - color: 255 255 255 160; + part + { + name: "btn_over2"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description + { + state: "default" 0.0; + rel1.to: "btn"; + rel2.to: "btn"; + image + { + normal: "bt_shine.png"; + border: 0 7 7 7; + } + } } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.relative: 1 0.0; - rel1.to_x: "elm.swallow.icon"; - rel2.relative: 1.0 1.0; - color: 255 255 255 255; - visible: 0; - text { - font: "Sans,Edje-Vera"; - size: 13; - align: 0.5 0.5; - min: 0 1; + part + { + name: "btn_over3"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + description + { + state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "btn"; + rel2.to: "btn"; + image + { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth: 0; + } + description + { + state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "default_small" 0.0; - inherit: "default" 0.0; - visible: 1; - text.size: 10; - } - description { state: "left_side" 0.0; - inherit: "default" 0.0; - color: 172 172 172 255; - text.size: 10; - visible: 1; - text.align: 0.2 0.5; - } - description { state: "right_side" 0.0; - inherit: "default" 0.0; - color: 172 172 172 255; - visible: 1; - text.size: 10; - text.align: 0.8 0.5; + part + { + name: "btn_icon"; + type: IMAGE; + repeat_events: 1; + description + { + state: "default" 0.0; + rel1.to: "btn"; + rel2.to: "btn"; + align: 0.5 0.5; + min: 16 16; + max: 16 16; + image.normal: "icon_arrow_right.png"; + } + description + { + state: "visible" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_left.png"; + } } - } - } - - programs { - program { name: "center_text"; - signal: "elm,state,center"; - source: "elm"; - action: STATE_SET "show" 0.0; - target: "elm.text"; - target: "elm.swallow.icon"; - } - program { name: "center_small_text"; - signal: "elm,state,center_small"; - source: "elm"; - action: STATE_SET "default_small" 0.0; - target: "elm.text"; - target: "elm.swallow.icon"; - } - program { name: "l_side_text"; - signal: "elm,state,left_side"; - source: "elm"; - action: STATE_SET "left_side" 0.0; - target: "elm.text"; - target: "elm.swallow.icon"; - } - program { name: "r_side_text"; - signal: "elm,state,right_side"; - source: "elm"; - action: STATE_SET "right_side" 0.0; - target: "elm.text"; - target: "elm.swallow.icon"; - } - } - } - - group { name: "elm/entry/path/separator/default"; - images.image: "arrow_right.png" COMP; - parts { - part { name: "icon"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "arrow_right.png"; - max: 64 64; - aspect: 1.0 1.0; + } + programs + { + program + { + name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "bg"; + target: "btn_icon"; + transition: LINEAR 0.5; } - } - } - } - - group { name: "elm/fileselector/base/default"; - data { - item: "path_separator" ""; - } - parts { - part { name: "elm.swallow.up"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - min: 10 10; - fixed: 1 1; - rel2 { - relative: 0.0 0.0; - offset: 0 0; - } + program + { + name: "show2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "btn_icon"; + after: "show3"; } - } - part { name: "elm.swallow.home"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - min: 10 10; - fixed: 1 1; - rel1 { - to: "elm.swallow.up"; - relative: 1.0 0.0; - offset: 5 0; - } - rel2 { - to: "elm.swallow.up"; - relative: 1.0 1.0; - offset: 20 -1; - } + program + { + name: "show3"; + action: STATE_SET "visible" 0.0; + target: "bg"; + target: "btn_icon"; + transition: LINEAR 0.5; } - } - part { name: "elm.swallow.files"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.0; - min: 10 10; - fixed: 1 1; - rel1 { - to_y: "elm.swallow.home"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - to_y: "elm.swallow.path"; - relative: 1.0 0.0; - offset: -1 -1; - } + program + { + name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "btn_icon"; + transition: LINEAR 0.5; } - } - part { name: "elm.swallow.path"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 1.0; - fixed: 1 1; - rel1 { - to_y: "elm.swallow.filename"; - relative: 0.0 0.0; - offset: 0 -1; - } - rel2 { - to_y: "elm.swallow.filename"; - relative: 1.0 0.0; - offset: -1 -1; - } + program + { + name: "btn_click"; + signal: "mouse,down,1"; + source: "btn_over2"; + action: STATE_SET "clicked" 0.0; + target: "btn"; } - } - part { name: "elm.swallow.filename"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 1.0; - fixed: 1 1; - rel1 { - to_y: "elm.swallow.ok"; - relative: 0.0 0.0; - offset: 0 -1; - } - rel2 { - to_y: "elm.swallow.ok"; - relative: 1.0 0.0; - offset: -1 -1; - } + program + { + name: "btn_unclick"; + signal: "mouse,up,1"; + source: "btn_over2"; + action: STATE_SET "default" 0.0; + target: "btn"; } - } - part { name: "elm.swallow.cancel"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 1.0; - fixed: 1 1; - rel1 { - to: "elm.swallow.ok"; - relative: 0.0 0.0; - offset: -3 0; - } - rel2 { - to: "elm.swallow.ok"; - relative: 0.0 1.0; - offset: -3 -1; - } + program + { + name: "btn_click2"; + signal: "mouse,down,1"; + source: "btn_over3"; + action: STATE_SET "clicked" 0.0; + target: "btn_over3"; } - } - part { name: "elm.swallow.ok"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 1.0; - fixed: 1 1; - rel1 { - relative: 1.0 1.0; - offset: -1 -1; - } + program + { + name: "btn_unclick2"; + signal: "mouse,up,1"; + source: "btn_over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "btn_over3"; } - } - } - } + program + { + name: "btn_unclick3"; + signal: "mouse,up,1"; + source: "btn_over2"; + action: SIGNAL_EMIT "elm,action,panel,toggle" ""; + } + } + } - group { name: "elm/fileselector_entry/base/default"; - parts { - part { name: "elm.swallow.entry"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - min: 50 10; - rel2 { to_x: "elm.swallow.button"; - relative: 0.0 1.0; - offset: -1 -1; - } + group { + name: "elm/panel/base/right"; + images + { + image: "bt_base1.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "icon_arrow_left.png" COMP; + image: "icon_arrow_right.png" COMP; + } + parts + { + part + { + name: "bg"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + color: 255 255 255 0; + rel1.relative: 1 0; + rel2.offset: -31 0; + } + description + { + state: "visible" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0; + } } - } - part { name: "elm.swallow.button"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.0; - min: 10 10; - fixed: 1 1; - rel1 { - relative: 1.0 0.0; - offset: -21 0; - } + part + { + name: "base"; + type: IMAGE; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1 + { + offset: 20 0; + to_x: "bg"; + } + rel2.offset: -1 -1; + image + { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + } } - } - } - } - -//////////////////////////////////////////////////////////////////////// -// Standard layouts to be used // -//////////////////////////////////////////////////////////////////////// - /* application with toolbar and main content area */ - group { name: "elm/layout/application/toolbar-content"; - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { to_y: "elm.external.toolbar"; - relative: 0.0 1.0; - offset: -1 1; - } + part + { + name: "clipper"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1 + { + offset: 4 4; + to: "base"; + } + rel2 + { + offset: -5 -5; + to: "base"; + } + } } - } - - part { name: "elm.external.toolbar"; - type: EXTERNAL; - source: "elm/toolbar"; - description { state: "default" 0.0; - align: 0.5 0.0; - fixed: 0 1; - rel2 { - relative: 1.0 0.0; - offset: -1 47; - } + part + { + name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clipper"; + description + { + state: "default" 0.0; + rel1.to: "clipper"; + rel2.to: "clipper"; + } } - } - } - } - - /* application with toolbar and main content area with a back button and title area */ - group { name: "elm/layout/application/toolbar-content-back"; - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { to_y: "title_clipper"; - relative: 0.0 1.0; - offset: -1 1; - } + part + { + name: "btn"; + type: IMAGE; + mouse_events: 1; + description + { + state: "default" 0.0; + max: 32 48; + fixed: 1 1; + align: 1 0.5; + rel1 + { + to_x: "bg"; + } + rel2 + { + offset: 2 0; + relative: 0.0 1; + to_x: "base"; + } + image + { + normal: "bt_base1.png"; + border: 5 0 4 12; + } + fill.smooth: 0; + } + description + { + state: "clicked" 0.0; + inherit: "default" 0.0; + } } - } - - part { name: "elm.external.toolbar"; - type: EXTERNAL; - source: "elm/toolbar"; - description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 0.0; - rel2 { - relative: 1.0 0.0; - offset: -1 47; - } + part + { + name: "btn_over"; + type: IMAGE; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1.to: "btn"; + rel2 + { + relative: 1.0 0.5; + to: "btn"; + } + image + { + normal: "bt_hilight.png"; + border: 7 0 7 0; + } + } } - } - part { name: "title_clipper"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - rel1 { - to_y: "back"; - } - rel2 { - to_y: "back"; + part + { + name: "btn_over2"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description + { + state: "default" 0.0; + rel1.to: "btn"; + rel2.to: "btn"; + image + { + normal: "bt_shine.png"; + border: 7 0 7 7; + } + } + } + part + { + name: "btn_over3"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + description + { + state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "btn"; + rel2.to: "btn"; + image + { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth: 0; } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2 { - relative: 1.0 0.0; + description + { + state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - } - part { name: "back_clipper"; - type: RECT; - clip_to: "title_clipper"; - description { state: "default" 0.0; - visible: 1; + part + { + name: "btn_icon"; + type: IMAGE; + repeat_events: 1; + description + { + state: "default" 0.0; + rel1.to: "btn"; + rel2.to: "btn"; + align: 0.5 0.5; + min: 16 16; + max: 16 16; + image.normal: "icon_arrow_left.png"; + } + description + { + state: "visible" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_right.png"; + } } - description { state: "hidden" 0.0; - visible: 0; + } + programs + { + program + { + name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "bg"; + target: "btn_icon"; + transition: LINEAR 0.5; } - } - part { name: "back"; - type: EXTERNAL; - source: "elm/button"; - clip_to: "back_clipper"; - description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - rel1 { to_y: "elm.external.toolbar"; - relative: 0.0 1.0; - offset: 0 1; - } - rel2 { to_y: "elm.external.toolbar"; - relative: 0.0 1.0; - offset: 50 32; - } - params.string: "label" "Back"; + program + { + name: "show2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "btn_icon"; + after: "show3"; } - } - programs { - program { - signal: "clicked"; - source: "back"; - action: SIGNAL_EMIT "elm,action,back" ""; + program + { + name: "show3"; + action: STATE_SET "visible" 0.0; + target: "bg"; + target: "btn_icon"; + transition: LINEAR 0.5; } - program { - signal: "elm,back,hide"; + program + { + name: "hide"; + signal: "elm,action,hide"; source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "back_clipper"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "btn_icon"; + transition: LINEAR 0.5; } - program { - signal: "elm,back,show"; - source: "elm"; + program + { + name: "btn_click"; + signal: "mouse,down,1"; + source: "btn_over2"; + action: STATE_SET "clicked" 0.0; + target: "btn"; + } + program + { + name: "btn_unclick"; + signal: "mouse,up,1"; + source: "btn_over2"; action: STATE_SET "default" 0.0; - target: "back_clipper"; + target: "btn"; } - program { - signal: "elm,title,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.1; - target: "title_clipper"; + program + { + name: "btn_click2"; + signal: "mouse,down,1"; + source: "btn_over3"; + action: STATE_SET "clicked" 0.0; + target: "btn_over3"; } - program { - signal: "elm,title,show"; - source: "elm"; + program + { + name: "btn_unclick2"; + signal: "mouse,up,1"; + source: "btn_over3"; action: STATE_SET "default" 0.0; - target: "title_clipper"; + transition: DECELERATE 0.5; + target: "btn_over3"; } - } - - part { name: "elm.swallow.end"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.0; - fixed: 1 1; - rel1 { to_y: "elm.external.toolbar"; - relative: 1.0 1.0; - offset: -2 1; - } - rel2 { to_y: "elm.external.toolbar"; - relative: 1.0 1.0; - offset: -1 32; - } + program + { + name: "btn_unclick3"; + signal: "mouse,up,1"; + source: "btn_over2"; + action: SIGNAL_EMIT "elm,action,panel,toggle" ""; } - } + } + } - part { name: "elm.text.title"; - type: TEXT; - effect: SOFT_SHADOW; - scale: 1; - description { state: "default" 0.0; - rel1 { to_y: "elm.external.toolbar"; - to_x: "back"; - relative: 1.0 1.0; - offset: 2 1; - } - rel2 { to_y: "back"; - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -3 -1; - } - text { - font: "Sans:style=Bold"; - size: 12; - } - } - } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/conformant/base/default"; + parts { + part { name: "elm.swallow.shelf"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 0.0; + rel2.relative: 1.0 0.0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + align: 0.5 0.5; + rel1.relative: 0.0 1.0; + rel1.to_y: "elm.swallow.shelf"; + rel2.relative: 1.0 0.0; + rel2.to_y: "elm.swallow.panel"; + } + } + part { name: "elm.swallow.panel"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 1.0; + rel1.relative: 0.0 1.0; + } + } + } + } + + +///////////////////////////////////////////////////////////////////////////// +// CALENDAR +///////////////////////////////////////////////////////////////////////////// +#define CH(_pos) \ + part { name: "ch_"#_pos".base"; \ + type: RECT; \ + description { state: "default" 0.0; \ + rel1 { \ + relative: (_pos % 7 * 7 / 8 / 6) 0; \ + to: "header"; \ + } \ + rel2 { \ + relative: (_pos % 7 * 7 / 8 / 6 + 1 / 8) 1; \ + to: "header"; \ + } \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + } \ + part { name: "ch_"#_pos".text"; \ + type: TEXT; \ + effect: SOFT_SHADOW; \ + mouse_events: 0; \ + scale: 1; \ + clip_to: "ch_"#_pos".clipper"; \ + description { \ + state: "default" 0.0; \ + rel1.to: "ch_"#_pos".base"; \ + rel2.to: "ch_"#_pos".base"; \ + color: 0 0 0 255; \ + color3: 0 0 0 0; \ + text { \ + font: "Sans"; \ + size: 10; \ + min: 1 1; \ + align: 0.5 0.5; \ + } \ + } \ + } \ + part { name: "ch_"#_pos".clipper"; \ + type: RECT; \ + description { state: "default" 0.0; \ + rel1.to: "ch_"#_pos".base"; \ + rel2.to: "ch_"#_pos".base"; \ + } \ + } + +#define CIT(_pos) \ + part { name: "cit_"#_pos".rect"; \ + type: RECT; \ + description { state: "default" 0.0; \ + rel1 { \ + relative: (_pos % 7 * 7 / 8 / 6) \ + (_pos / 8 / 5 - _pos % 7 / 8 / 5); \ + to: "base"; \ + } \ + rel2 { \ + relative: (_pos % 7 * 7 / 8 / 6 + 1 / 8) \ + (_pos / 8 / 5 - _pos % 7 / 8 / 5 + 1 / 8); \ + to: "base"; \ + } \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + } \ + part { \ + name: "cit_"#_pos".event"; \ + type: RECT; \ + repeat_events: 1; \ + description { \ + rel1.to: "cit_"#_pos".rect"; \ + rel2.to: "cit_"#_pos".rect"; \ + state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "cit_"#_pos".shelf"; \ + type: RECT; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1 { \ + to: "cit_"#_pos".bg"; \ + offset: -1 -1; \ + } \ + rel2 { \ + to: "cit_"#_pos".bg"; \ + } \ + color: 200 200 200 255; \ + } \ + } \ + part { name: "cit_"#_pos".hd"; \ + type: RECT; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1 { \ + to: "cit_"#_pos".bg"; \ + offset: -1 -1; \ + } \ + rel2 { \ + to: "cit_"#_pos".bg"; \ + } \ + visible: 0; \ + color: 160 0 0 255; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { \ + name: "cit_"#_pos".base_sh"; \ + mouse_events: 0; \ + description { \ + state: "default" 0.0; \ + align: 0.0 0.0; \ + min: 0 1; \ + rel1 { \ + to: "cit_"#_pos".base"; \ + relative: 0.0 1.0; \ + offset: 0 0; \ + } \ + rel2 { \ + to: "cit_"#_pos".base"; \ + relative: 1.0 1.05; \ + offset: -1 0; \ + } \ + image { \ + normal: "ilist_item_shadow.png"; \ + } \ + fill.smooth: 0; \ + } \ + } \ + part { \ + name: "cit_"#_pos".base"; \ + mouse_events: 0; \ + description { \ + state: "default" 0.0; \ + rel1.to: "cit_"#_pos".rect"; \ + rel2.to: "cit_"#_pos".rect"; \ + rel2.offset: -1 -1; \ + image { \ + normal: "ilist_1.png"; \ + border: 2 2 2 2; \ + } \ + fill.smooth: 0; \ + } \ + description { \ + state: "today" 0.0; \ + inherit: "default" 0.0; \ + image.normal: "ilist_2.png"; \ + color: 240 240 240 255; \ + } \ + } \ + part { name: "cit_"#_pos".bg"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + color: 255 255 255 0; \ + rel1 { \ + to: "cit_"#_pos".rect"; \ + relative: 0.0 0.0; \ + } \ + rel2 { \ + to: "cit_"#_pos".rect"; \ + relative: 1.0 1.0; \ + offset: -1 -1; \ + } \ + image { \ + normal: "bt_sm_base1.png"; \ + border: 6 6 6 6; \ + } \ + image.middle: SOLID; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: 255 255 255 255; \ + } \ + } \ + part { name: "cit_"#_pos".text"; \ + type: TEXT; \ + effect: SOFT_SHADOW; \ + mouse_events: 0; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + rel1.to: "cit_"#_pos".bg"; \ + rel2.to: "cit_"#_pos".bg"; \ + color: 0 0 0 255; \ + color3: 0 0 0 0; \ + text { \ + font: "Sans"; \ + size: 10; \ + min: 1 1; \ + align: 0.5 0.5; \ + } \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: 224 224 224 255; \ + color3: 0 0 0 64; \ + } \ + } \ + part { name: "cit_"#_pos".fg1"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + color: 255 255 255 0; \ + rel1.to: "cit_"#_pos".bg"; \ + rel2.relative: 1.0 0.5; \ + rel2.to: "cit_"#_pos".bg"; \ + image { \ + normal: "bt_sm_hilight.png"; \ + border: 6 6 6 0; \ + } \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: 255 255 255 255; \ + } \ + } \ + part { name: "cit_"#_pos".fg2"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + color: 255 255 255 0; \ + rel1.to: "cit_"#_pos".bg"; \ + rel2.to: "cit_"#_pos".bg"; \ + image { \ + normal: "bt_sm_shine.png"; \ + border: 6 6 6 0; \ + } \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: 255 255 255 255; \ + } \ + } \ + part { name: "cit_"#_pos".check"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1 { \ + to: "cit_"#_pos".bg"; \ + relative: 0.7 0.6; \ + offset: 1 1; \ + } \ + rel2 { \ + to: "cit_"#_pos".bg"; \ + relative: 1.1 1.2; \ + offset: -2 -2; \ + } \ + aspect: 1 1; \ + visible: 0; \ + color: 255 0 0 255; \ + image.normal: "check.png"; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + programs { \ + program { \ + name: "cit_"#_pos".go_active"; \ + signal: "cit_"#_pos",selected"; \ + source: "elm"; \ + action: STATE_SET "selected" 0.0; \ + target: "cit_"#_pos".bg"; \ + target: "cit_"#_pos".fg1"; \ + target: "cit_"#_pos".fg2"; \ + target: "cit_"#_pos".text"; \ + } \ + program { \ + name: "cit_"#_pos".go_passive"; \ + signal: "cit_"#_pos",unselected"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "cit_"#_pos".bg"; \ + target: "cit_"#_pos".fg1"; \ + target: "cit_"#_pos".fg2"; \ + target: "cit_"#_pos".text"; \ + } \ + program { \ + name: "cit_"#_pos".is_today"; \ + signal: "cit_"#_pos",today"; \ + source: "elm"; \ + action: STATE_SET "today" 0.0; \ + target: "cit_"#_pos".base"; \ + } \ + program { \ + name: "cit_"#_pos".not_today"; \ + signal: "cit_"#_pos",not_today"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "cit_"#_pos".base"; \ + } \ + program { \ + source: "cit_"#_pos".clicked"; \ + signal: "mouse,clicked,1"; \ + source: "cit_"#_pos".event"; \ + action: SIGNAL_EMIT "elm,action,selected" #_pos; \ + } \ + program { \ + name: "cit_"#_pos".clear"; \ + signal: "cit_"#_pos",clear"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "cit_"#_pos".check"; \ + target: "cit_"#_pos".hd"; \ + } \ + program { \ + name: "cit_"#_pos".checked"; \ + signal: "cit_"#_pos",checked"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "cit_"#_pos".check"; \ + } \ + program { \ + name: "cit_"#_pos".holiday"; \ + signal: "cit_"#_pos",holiday"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "cit_"#_pos".hd"; \ + } \ } - } - - /* application with toolbar and main content area with a back and next buttons and title area */ - group { name: "elm/layout/application/toolbar-content-back-next"; - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { to_y: "title_clipper"; - relative: 0.0 1.0; - offset: -1 1; - } - } - } - part { name: "elm.external.toolbar"; - type: EXTERNAL; - source: "elm/toolbar"; - description { state: "default" 0.0; - fixed: 0 1; - align: 0.5 0.0; - rel2 { - relative: 1.0 0.0; - offset: -1 47; - } - } - } - part { name: "title_clipper"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - rel1 { - to_y: "back"; - } - rel2 { - to_y: "back"; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2 { - relative: 1.0 0.0; - } - } - } - part { name: "back"; - type: EXTERNAL; - source: "elm/button"; - clip_to: "back_clipper"; - description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - rel1 { to_y: "elm.external.toolbar"; - relative: 0.0 1.0; - offset: 0 1; - } - rel2 { to_y: "elm.external.toolbar"; - relative: 0.0 1.0; - offset: 50 32; - } - params.string: "label" "Back"; - } - } - part { name: "back_clipper"; - type: RECT; - clip_to: "title_clipper"; - description { state: "default" 0.0; - visible: 1; - } - description { state: "hidden" 0.0; - visible: 0; - } - } - part { name: "next"; - type: EXTERNAL; - source: "elm/button"; - clip_to: "next_clipper"; - description { state: "default" 0.0; - align: 1.0 0.0; - fixed: 1 1; - rel1 { to_y: "elm.external.toolbar"; - relative: 1.0 1.0; - offset: -2 1; - } - rel2 { to_y: "elm.external.toolbar"; - relative: 1.0 1.0; - offset: -1 32; + group { name: "elm/calendar/base/default"; + images { + image: "shelf_inset.png" COMP; + image: "bt_base1.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "bt_glow.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + image: "sp_bt_l.png" COMP; + image: "sp_bt_r.png" COMP; + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_1.png" COMP; + image: "ilist_2.png" COMP; + image: "ilist_item_shadow.png" COMP; + image: "check.png" COMP; + } + parts { + part { name: "bg"; + type: RECT; + description { state: "default" 0.0; + min: 0 30; + rel1.offset: 1 1; + rel2.offset: -2 -2; + color: 255 255 255 0; + align: 0.0 0.5; } - params.string: "label" "Next"; } - } - part { name: "next_clipper"; - type: RECT; - clip_to: "title_clipper"; - description { state: "default" 0.0; - visible: 1; - } - description { state: "hidden" 0.0; - visible: 0; - } - } - programs { - program { - signal: "clicked"; - source: "back"; - action: SIGNAL_EMIT "elm,action,back" ""; - } - program { - signal: "elm,title,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.1; - target: "title_clipper"; - } - program { - signal: "elm,title,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "title_clipper"; - } - program { - signal: "elm,back,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "back_clipper"; - } - program { - signal: "elm,back,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "back_clipper"; - } - program { - signal: "clicked"; - source: "next"; - action: SIGNAL_EMIT "elm,action,next" ""; - } - program { - signal: "elm,next,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "next_clipper"; - } - program { - signal: "elm,next,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "next_clipper"; - } - } - part { name: "elm.text.title"; - type: TEXT; - effect: SOFT_SHADOW; - scale: 1; - clip_to: "title_clipper"; - description { state: "default" 0.0; - rel1 { to_y: "elm.external.toolbar"; - to_x: "back"; - relative: 1.0 1.0; - offset: 2 1; - } - rel2 { to_y: "back"; - to_x: "next"; - relative: 0.0 1.0; - offset: -3 -1; - } - text { - font: "Sans:style=Bold"; - size: 12; - } - } - } - } - } - /* application with a main content area with a back button and title area */ - group { name: "elm/layout/application/content-back"; - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { to_y: "title_clipper"; - relative: 0.0 1.0; - offset: -1 1; - } - } - } - part { name: "title_clipper"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - rel1 { - to_y: "back"; - } - rel2 { - to_y: "back"; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2 { - relative: 1.0 0.0; - } - } - } - part { name: "back_clipper"; - type: RECT; - clip_to: "title_clipper"; - description { state: "default" 0.0; - visible: 1; - } - description { state: "hidden" 0.0; - visible: 0; - } - } - part { name: "back"; - type: EXTERNAL; - source: "elm/button"; - clip_to: "back_clipper"; - description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - rel1 { - relative: 0.0 0.0; - offset: 0 1; - } - rel2 { - relative: 0.0 0.0; - offset: 50 32; - } - params.string: "label" "Back"; - } - } - programs { - program { - signal: "clicked"; - source: "back"; - action: SIGNAL_EMIT "elm,action,back" ""; - } - program { - signal: "elm,back,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "back_clipper"; - } - program { - signal: "elm,back,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "back_clipper"; - } - program { - signal: "elm,title,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.1; - target: "title_clipper"; - } - program { - signal: "elm,title,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "title_clipper"; - } - } - - part { name: "elm.swallow.end"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.0; - fixed: 1 1; - rel1 { - relative: 1.0 0.0; - offset: -2 1; - } - rel2 { - relative: 1.0 1.0; - offset: -1 32; - } - } - } - - part { name: "elm.text.title"; - type: TEXT; - effect: SOFT_SHADOW; - scale: 1; - description { state: "default" 0.0; - rel1 { - to_x: "back"; - relative: 1.0 0.0; - offset: 2 1; - } - rel2 { to_y: "back"; - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -3 -1; - } - text { - font: "Sans:style=Bold"; - size: 12; - } - } - } - } - } - - /* application with a main content area with a back and next buttons and title area */ - group { name: "elm/layout/application/content-back-next"; - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { to_y: "title_clipper"; - relative: 0.0 1.0; - offset: -1 1; - } - } - } - - part { name: "title_clipper"; - type: RECT; - description { state: "default" 0.0; - visible: 1; - rel1 { - to_y: "back"; - } - rel2 { - to_y: "back"; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2 { - relative: 1.0 0.0; - } - } - } - part { name: "back"; - type: EXTERNAL; - source: "elm/button"; - clip_to: "back_clipper"; - description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - rel1 { - relative: 0.0 0.0; - offset: 0 1; + part { name: "spinner-base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + min: 24 24; + max: 999999 24; + rel1.to: "bg"; + rel1.offset: 6 6; + rel2.to: "bg"; + rel2.offset: -7 -7; + color: 255 255 255 0; + align: 0.0 0.0; } - rel2 { - relative: 0.0 0.0; - offset: 50 32; + } + part { name: "conf_over_spinner"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "spinner-base"; + rel1.offset: -3 -3; + rel2.to: "spinner-base"; + rel2.offset: 2 2; + image { + normal: "shelf_inset.png"; + border: 7 7 7 7; + middle: 0; + } + fill.smooth : 0; } - params.string: "label" "Back"; - } - } - part { name: "back_clipper"; - type: RECT; - clip_to: "title_clipper"; - description { state: "default" 0.0; - visible: 1; - } - description { state: "hidden" 0.0; - visible: 0; - } - } - part { name: "next"; - type: EXTERNAL; - source: "elm/button"; - clip_to: "next_clipper"; - description { state: "default" 0.0; - align: 1.0 0.0; - fixed: 1 1; - rel1 { - relative: 1.0 0.0; - offset: -2 1; + } + part { name: "table-base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + min: 256 220; + rel1.to_x: "bg"; + rel1.to_y: "spinner-base"; + rel1.offset: 6 6; + rel1.relative: 0 1; + rel2.to: "bg"; + rel2.offset: -7 -7; + color: 255 255 255 0; } - rel2 { - relative: 1.0 0.0; - offset: -1 32; + } + part { name: "conf_over_table"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "table-base"; + rel1.offset: -3 -3; + rel2.to: "table-base"; + rel2.offset: 2 2; + image { + normal: "shelf_inset.png"; + border: 7 7 7 7; + middle: 0; + } + fill.smooth : 0; } - params.string: "label" "Next"; } - } - part { name: "next_clipper"; - type: RECT; - clip_to: "title_clipper"; - description { state: "default" 0.0; - visible: 1; - } - description { state: "hidden" 0.0; - visible: 0; - } - } - programs { - program { - signal: "clicked"; - source: "back"; - action: SIGNAL_EMIT "elm,action,back" ""; - } - program { - signal: "elm,title,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.1; - target: "title_clipper"; - } - program { - signal: "elm,title,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "title_clipper"; - } - program { - signal: "elm,back,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "back_clipper"; - } - program { - signal: "elm,back,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "back_clipper"; - } - program { - signal: "clicked"; - source: "next"; - action: SIGNAL_EMIT "elm,action,next" ""; - } - program { - signal: "elm,next,hide"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "next_clipper"; - } - program { - signal: "elm,next,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "next_clipper"; - } - } - part { name: "elm.text.title"; - type: TEXT; - effect: SOFT_SHADOW; - scale: 1; - clip_to: "title_clipper"; - description { state: "default" 0.0; - rel1 { - to_x: "back"; - relative: 1.0 0.0; - offset: 2 1; + part { name: "header"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "table-base"; + rel1.relative: 0 0; + rel2.to: "table-base"; + rel2.relative: 1 0.1; + color: 255 255 255 0; } - rel2 { to_y: "back"; - to_x: "next"; - relative: 0.0 1.0; - offset: -3 -1; + } + part { name: "base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to_x: "table-base"; + rel1.to_y: "header"; + rel1.relative: 0 1; + rel1.offset: 3 0; + rel2.to: "table-base"; + rel2.offset: -3 0; + color: 255 255 255 0; } - text { - font: "Sans:style=Bold"; - size: 12; + } + part { name: "left_bt"; + mouse_events: 1; + description { state: "default" 0.0; + rel1 { to: "spinner-base"; + offset: 2 2; + } + rel2 { to: "spinner-base"; + offset: -3 -3; + } + align: 0.0 0.5; + min: 24 24; + max: 24 24; + fixed: 1 1; + image { + normal: "bt_base1.png"; + border: 6 6 6 6; + } + fill.smooth : 0; } - } - } - } - } - - /* application with toolbar and main content area as a vertical box */ - group { name: "elm/layout/application/toolbar-vbox"; - parts { - part { name: "elm.box.content"; - type: BOX; - description { state: "default" 0.0; - rel1 { to_y: "elm.external.toolbar"; - relative: 0.0 1.0; - offset: -1 1; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - box.layout: "vertical"; - } - } - - part { name: "elm.external.toolbar"; - type: EXTERNAL; - source: "elm/toolbar"; - description { state: "default" 0.0; - align: 0.5 0.0; - fixed: 0 1; - rel2 { - relative: 1.0 0.0; - offset: -1 47; + } + part { name: "left_over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "left_bt"; + rel2 { to: "left_bt"; + relative: 1.0 0.5; + } + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } } - } - } - } - } - - /* application with toolbar and main content area as a table */ - group { name: "elm/layout/application/toolbar-table"; - parts { - part { name: "elm.table.content"; - type: TABLE; - description { state: "default" 0.0; - rel1 { to_y: "elm.external.toolbar"; - relative: 0.0 1.0; - offset: -1 1; + } + part { name: "left_over2"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "left_bt"; + rel2.to: "left_bt"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } } - } - } - - part { name: "elm.external.toolbar"; - type: EXTERNAL; - source: "elm/toolbar"; - description { state: "default" 0.0; - align: 0.5 0.0; - fixed: 0 1; - rel2 { - relative: 1.0 0.0; - offset: -1 47; + } + part { name: "left_over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "left_bt"; + rel2.to: "left_bt"; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; } - } - } - } - } - - /* a simple title layout, with a label and two icons */ - group { name: "elm/layout/application/titlebar"; - images { - image: "toolbar_sel.png" COMP; - } - parts { - part { name: "base"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - min: 0 33; - max: 99999 33; - align: 0.5 0.0; - rel1.offset: -1 0; - rel2.offset: 1 0; - image { - normal: "toolbar_sel.png"; - border: 3 3 0 0; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 1; - rel1 { - to: "base"; - relative: 0.0 1.0; + } + part { name: "right_bt"; + mouse_events: 1; + description { state: "default" 0.0; + rel1 { to: "spinner-base"; + offset: -27 3; + } + rel2 { to: "spinner-base"; + offset: -3 -3; + } + align: 1.0 0.5; + min: 24 24; + max: 24 24; + fixed: 1 1; + image { + normal: "bt_base1.png"; + border: 5 5 4 12; + } + fill.smooth : 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.0 0.0; - rel1 { - to: "base"; - relative: 0.0 0.0; - offset: 4 0; + } + part { name: "right_over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "right_bt"; + rel2 { to: "right_bt"; + relative: 1.0 0.5; + } + image { + normal: "bt_hilight.png"; + border: 7 7 7 0; + } } - rel2 { - to: "base"; - relative: 0.0 1.0; + } + part { name: "right_over2"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "right_bt"; + rel2.to: "right_bt"; + image { + normal: "bt_shine.png"; + border: 7 7 7 7; + } } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.swallow.end"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 1.0 0.0; - rel1 { - to: "base"; - relative: 1.0 0.0; - offset: 0 0; + } + part { name: "right_over3"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + rel1.to: "right_bt"; + rel2.to: "right_bt"; + image { + normal: "bt_glow.png"; + border: 12 12 12 12; + } + fill.smooth : 0; } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -5 -1; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - rel1 { - to_x: "elm.swallow.icon"; - to_y: "base"; - relative: 1.0 0.0; + } + part { name: "left_bt_icon"; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "left_bt"; + rel2.to: "left_bt"; + align: 0.5 0.5; + min: 16 16; + max: 16 16; + image.normal: "sp_bt_l.png"; } - rel2 { - to_x: "elm.swallow.end"; - to_y: "base"; - relative: 0.0 1.0; + } + part { name: "right_bt_icon"; + repeat_events: 1; + description { state: "default" 0.0; + rel1.to: "right_bt"; + rel2.to: "right_bt"; + align: 0.5 0.5; + min: 16 16; + max: 16 16; + image.normal: "sp_bt_r.png"; } - text { - font: "Sans"; - size: 12; - min: 0 0; - align: 0.5 0.5; - text_class: "title_bar"; + } + part { name: "month_text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0 0.5; + fixed: 1 1; + rel1 { relative: 1.0 0.0; + offset: 3 2; + to: "left_bt"; + to_y: "spinner-base"; + } + rel2 { relative: 0.0 1.0; + offset: -3 -2; + to_x: "right_bt"; + to_y: "spinner-base"; + } + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 12; + min: 1 1; + align: 0.5 0.5; + } } - } - } - } - programs { - program { name: "show_icon"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { name: "hide_icon"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - program { name: "show_end"; - signal: "elm,state,end,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.end"; - } - program { name: "hide_end"; - signal: "elm,state,end,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.end"; - } - } + } + CH(0) CH(1) CH(2) CH(3) CH(4) CH(5) CH(6) + CIT(0) CIT(1) CIT(2) CIT(3) CIT(4) CIT(5) CIT(6) + CIT(7) CIT(8) CIT(9) CIT(10) CIT(11) CIT(12) CIT(13) + CIT(14) CIT(15) CIT(16) CIT(17) CIT(18) CIT(19) CIT(20) + CIT(21) CIT(22) CIT(23) CIT(24) CIT(25) CIT(26) CIT(27) + CIT(28) CIT(29) CIT(30) CIT(31) CIT(32) CIT(33) CIT(34) + CIT(35) CIT(36) CIT(37) CIT(38) CIT(39) CIT(40) CIT(41) + } + programs { + program { name: "dec_start"; + signal: "mouse,down,1"; + source: "left_bt"; + action: SIGNAL_EMIT "elm,action,decrement,start" ""; + } + program { name: "dec_stop"; + signal: "mouse,up,1"; + source: "left_bt"; + action: SIGNAL_EMIT "elm,action,stop" ""; + } + program { name: "inc_start"; + signal: "mouse,down,1"; + source: "right_bt"; + action: SIGNAL_EMIT "elm,action,increment,start" ""; + } + program { name: "inc_stop"; + signal: "mouse,up,1"; + source: "right_bt"; + action: SIGNAL_EMIT "elm,action,stop" ""; + } + program { + name: "left_bt_click"; + signal: "mouse,down,1"; + source: "left_over2"; + action: STATE_SET "clicked" 0.0; + target: "left_bt"; + } + program { + name: "left_bt_unclick"; + signal: "mouse,up,1"; + source: "left_over2"; + action: STATE_SET "default" 0.0; + target: "left_bt"; + } + program { + name: "left_bt_click2"; + signal: "mouse,down,1"; + source: "left_over3"; + action: STATE_SET "clicked" 0.0; + target: "left_over3"; + } + program { + name: "left_bt_unclick2"; + signal: "mouse,up,1"; + source: "left_over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "left_over3"; + } + program { + name: "right_bt_click"; + signal: "mouse,down,1"; + source: "right_over2"; + action: STATE_SET "clicked" 0.0; + target: "right_bt"; + } + program { + name: "right_bt_unclick"; + signal: "mouse,up,1"; + source: "right_over2"; + action: STATE_SET "default" 0.0; + target: "right_bt"; + } + program { + name: "right_bt_click2"; + signal: "mouse,down,1"; + source: "right_over3"; + action: STATE_SET "clicked" 0.0; + target: "right_over3"; + } + program { + name: "right_bt_unclick2"; + signal: "mouse,up,1"; + source: "right_over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "right_over3"; + } + } } -} + +#undef CIT +#undef CH diff --git a/data/themes/flip_b.png b/data/themes/flip_b.png deleted file mode 100644 index bb7c7e7..0000000 Binary files a/data/themes/flip_b.png and /dev/null differ diff --git a/data/themes/flip_t.png b/data/themes/flip_t.png deleted file mode 100644 index 74ed50d..0000000 Binary files a/data/themes/flip_t.png and /dev/null differ diff --git a/data/themes/group_index.png b/data/themes/group_index.png deleted file mode 100644 index 7df0680..0000000 Binary files a/data/themes/group_index.png and /dev/null differ diff --git a/data/themes/icon_arrow_down_left.png b/data/themes/icon_arrow_down_left.png deleted file mode 100644 index 2f1d2ed..0000000 Binary files a/data/themes/icon_arrow_down_left.png and /dev/null differ diff --git a/data/themes/icon_arrow_down_right.png b/data/themes/icon_arrow_down_right.png deleted file mode 100644 index 0439e88..0000000 Binary files a/data/themes/icon_arrow_down_right.png and /dev/null differ diff --git a/data/themes/icon_arrow_up_left.png b/data/themes/icon_arrow_up_left.png deleted file mode 100644 index 711bef8..0000000 Binary files a/data/themes/icon_arrow_up_left.png and /dev/null differ diff --git a/data/themes/icon_arrow_up_right.png b/data/themes/icon_arrow_up_right.png deleted file mode 100644 index 7a9f495..0000000 Binary files a/data/themes/icon_arrow_up_right.png and /dev/null differ diff --git a/data/themes/ilist_1_h.png b/data/themes/ilist_1_h.png deleted file mode 100644 index bd2fd15..0000000 Binary files a/data/themes/ilist_1_h.png and /dev/null differ diff --git a/data/themes/ilist_2_h.png b/data/themes/ilist_2_h.png deleted file mode 100644 index 6ab252e..0000000 Binary files a/data/themes/ilist_2_h.png and /dev/null differ diff --git a/data/themes/ilist_item_shadow_h.png b/data/themes/ilist_item_shadow_h.png deleted file mode 100644 index fb21bc5..0000000 Binary files a/data/themes/ilist_item_shadow_h.png and /dev/null differ diff --git a/data/themes/sl_bt_3.png b/data/themes/sl_bt_3.png deleted file mode 100644 index 8be95f5..0000000 Binary files a/data/themes/sl_bt_3.png and /dev/null differ diff --git a/data/themes/thumb_shadow.png b/data/themes/thumb_shadow.png deleted file mode 100644 index 8e66670..0000000 Binary files a/data/themes/thumb_shadow.png and /dev/null differ diff --git a/data/themes/tooltip-base.png b/data/themes/tooltip-base.png deleted file mode 100644 index 3ab8e0f..0000000 Binary files a/data/themes/tooltip-base.png and /dev/null differ diff --git a/data/themes/tooltip-corner-bottom-left-tip.png b/data/themes/tooltip-corner-bottom-left-tip.png deleted file mode 100644 index f60787b..0000000 Binary files a/data/themes/tooltip-corner-bottom-left-tip.png and /dev/null differ diff --git a/data/themes/tooltip-corner-bottom-right-tip.png b/data/themes/tooltip-corner-bottom-right-tip.png deleted file mode 100644 index 4d715f3..0000000 Binary files a/data/themes/tooltip-corner-bottom-right-tip.png and /dev/null differ diff --git a/data/themes/tooltip-corner-top-left-tip.png b/data/themes/tooltip-corner-top-left-tip.png deleted file mode 100644 index 3f74c58..0000000 Binary files a/data/themes/tooltip-corner-top-left-tip.png and /dev/null differ diff --git a/data/themes/tooltip-corner-top-right-tip.png b/data/themes/tooltip-corner-top-right-tip.png deleted file mode 100644 index c9dbaa2..0000000 Binary files a/data/themes/tooltip-corner-top-right-tip.png and /dev/null differ diff --git a/data/themes/tooltip-edge-bottom-tip.png b/data/themes/tooltip-edge-bottom-tip.png deleted file mode 100644 index 49fd2b0..0000000 Binary files a/data/themes/tooltip-edge-bottom-tip.png and /dev/null differ diff --git a/data/themes/tooltip-edge-left-tip.png b/data/themes/tooltip-edge-left-tip.png deleted file mode 100644 index 6cf071e..0000000 Binary files a/data/themes/tooltip-edge-left-tip.png and /dev/null differ diff --git a/data/themes/tooltip-edge-right-tip.png b/data/themes/tooltip-edge-right-tip.png deleted file mode 100644 index cd541a6..0000000 Binary files a/data/themes/tooltip-edge-right-tip.png and /dev/null differ diff --git a/data/themes/tooltip-edge-top-tip.png b/data/themes/tooltip-edge-top-tip.png deleted file mode 100644 index a341a21..0000000 Binary files a/data/themes/tooltip-edge-top-tip.png and /dev/null differ diff --git a/debian/changelog b/debian/changelog index c1e63fa..e40816a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +elementary (1.0.0+svn.51480slp2+build89) unstable; urgency=low + + * Packaging for fixing elm_pager + * Git: 165.213.180.234:slp/pkgs/e/elementary + * Tag: elementary_1.0.0+svn.51480slp2+build89 + + -- WooHyun Jung Tue, 11 Jan 2011 23:11:48 +0900 + elementary (1.0.0+svn.51480slp2+build88) unstable; urgency=low * Packaging for fixing ctx_popup and elm_config(preload) diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 2672432..cfae1c5 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -78,8 +78,7 @@ test_multi.c \ test_floating.c \ test_launcher.c \ test_anim.c \ -test_calendar.c \ -test_diskselector.c +test_calendar.c elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la @ELEMENTARY_EWEATHER_LIBS@ elementary_test_LDFLAGS = diff --git a/src/bin/config.c b/src/bin/config.c index 8bc8ed4..a01afb2 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -1,2901 +1,628 @@ #include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif #ifndef ELM_LIB_QUICKLAUNCH -typedef struct _Theme Theme; -typedef struct _Fonts_Data Fonts_Data; -typedef struct _Elm_Text_Class_Data Elm_Text_Class_Data; -typedef struct _Elm_Font_Size_Data Elm_Font_Size_Data; - -struct _Theme -{ - const char *label; - const char *name; - const char *path; - Eina_Bool in_search_path; -}; - -static Theme *tsel = NULL; -static Eina_List *themes = NULL; - -struct _Elm_Text_Class_Data -{ - const char *name; - const char *desc; - const char *font; - const char *style; - Evas_Font_Size size; -}; - -struct _Elm_Font_Size_Data -{ - const char *size_str; - Evas_Font_Size size; -}; - -struct _Fonts_Data -{ - Eina_List *text_classes; - - Eina_Hash *font_hash; - Eina_List *font_px_list; - Eina_List *font_scale_list; - - const char *cur_font; - const char *cur_style; - double cur_size; -}; - -#define ELM_LIST_DISABLE(list) \ - do \ - { \ - const Eina_List *l = elm_list_items_get(list); \ - if (l) \ - { \ - elm_list_item_show(eina_list_data_get(l)); \ - elm_object_disabled_set(list, EINA_TRUE); \ - } \ - } \ - while (0) - -#define ELM_LIST_ENABLE(list) \ - do \ - { \ - elm_object_disabled_set(list, EINA_FALSE); \ - } \ - while (0) - -#define LABEL_FRAME_ADD(label) \ - do \ - { \ - pd = elm_frame_add(win); \ - evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0); \ - evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); \ - elm_object_style_set(pd, "pad_medium"); \ - elm_box_pack_end(bx, pd); \ - evas_object_show(pd); \ - \ - lb = elm_label_add(win); \ - evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0); \ - evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); \ - elm_label_label_set(lb, label); \ - elm_frame_content_set(pd, lb); \ - evas_object_show(lb); \ - } \ - while (0) - static int quiet = 0; static int interactive = 1; static const char *theme_set = NULL; static const char *finger_size_set = NULL; static const char *scale_set = NULL; -static Fonts_Data fdata = {NULL, NULL, NULL, NULL, NULL, NULL, 0.0}; static void -_font_styles_list_sel(void *data __UNUSED__, - Evas_Object *obj, - void *event_info); - -static void -config_exit(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +my_win_del(void *data, Evas_Object *obj, void *event_info) { - Elm_Text_Class_Data *tc_data; - Elm_Font_Size_Data *sd; - - EINA_LIST_FREE(fdata.text_classes, tc_data) - { - eina_stringshare_del(tc_data->name); - eina_stringshare_del(tc_data->desc); - eina_stringshare_del(tc_data->font); - eina_stringshare_del(tc_data->style); - free(tc_data); - } - - elm_font_available_hash_del(fdata.font_hash); - - EINA_LIST_FREE(fdata.font_px_list, sd) - { - eina_stringshare_del(sd->size_str); - free(sd); - } - - EINA_LIST_FREE(fdata.font_scale_list, sd) - { - eina_stringshare_del(sd->size_str); - free(sd); - } - - if (fdata.cur_font) eina_stringshare_del(fdata.cur_font); - if (fdata.cur_style) eina_stringshare_del(fdata.cur_style); - - elm_config_save(); + /* called when my_win_main is requested to be deleted */ elm_exit(); /* exit the program's main loop that runs in elm_run() */ } static void -sb_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - Eina_Bool val = elm_check_state_get(obj); - Eina_Bool sb = elm_scroll_bounce_enabled_get(); - - if (val == sb) return; - elm_scroll_bounce_enabled_all_set(val); - - /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/ -} - -static void -bf_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); -} - -static void -bf_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double bf = elm_scroll_bounce_friction_get(); - double val = elm_slider_value_get(obj); - - if (bf == val) return; - elm_scroll_bounce_friction_all_set(val); -} - -static void -ps_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); -} - -static void -ps_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double ps = elm_scroll_page_scroll_friction_get(); - double val = elm_slider_value_get(obj); - - if (ps == val) return; - elm_scroll_page_scroll_friction_all_set(val); -} - -static void -bis_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); -} - -static void -bis_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double bis = elm_scroll_bring_in_scroll_friction_get(); - double val = elm_slider_value_get(obj); - - if (bis == val) return; - elm_scroll_bring_in_scroll_friction_all_set(val); -} - -static void -zf_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); -} - -static void -zf_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double zf = elm_scroll_zoom_friction_get(); - double val = elm_slider_value_get(obj); - - if (zf == val) return; - elm_scroll_zoom_friction_all_set(val); -} - -static void -ts_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - Eina_Bool val = elm_check_state_get(obj); - Eina_Bool sb = elm_scroll_bounce_enabled_get(); - - if (val == sb) return; - elm_scroll_thumbscroll_enabled_all_set(val); - - /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/ -} - -static void -tst_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +sc_round(void *data, Evas_Object *obj, void *event_info) { double val = elm_slider_value_get(obj); double v; - + v = ((double)((int)(val * 10.0))) / 10.0; if (v != val) elm_slider_value_set(obj, v); } static void -tst_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +sc_change(void *data, Evas_Object *obj, void *event_info) { - double tst = elm_scroll_thumbscroll_threshold_get(); + double scale = elm_scale_get(); double val = elm_slider_value_get(obj); - - if (tst == val) return; - elm_scroll_thumbscroll_threshold_all_set(val); + + if (scale == val) return; + elm_scale_all_set(val); } static void -tsmt_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +fs_round(void *data, Evas_Object *obj, void *event_info) { double val = elm_slider_value_get(obj); double v; - - v = ((double)((int)(val * 10.0))) / 10.0; + + v = ((double)((int)(val * 5.0))) / 5.0; if (v != val) elm_slider_value_set(obj, v); } static void -tsmt_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +fs_change(void *data, Evas_Object *obj, void *event_info) { - double tsmt = elm_scroll_thumbscroll_momentum_threshold_get(); + double scale = elm_scale_get(); double val = elm_slider_value_get(obj); - - if (tsmt == val) return; - elm_scroll_thumbscroll_momentum_threshold_all_set(val); + + if (scale == val) return; + elm_finger_size_all_set(val); } static void -tsf_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_status_basic(Evas_Object *win, Evas_Object *bx0) { - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + Evas_Object *lb, *fr; + + fr = elm_frame_add(win); + evas_object_size_hint_weight_set(fr, 1.0, 1.0); + elm_frame_label_set(fr, "Information"); + elm_box_pack_end(bx0, fr); + evas_object_show(fr); + + lb = elm_label_add(win); + elm_label_label_set(lb, + "Applying configuration change" + ); + elm_frame_content_set(fr, lb); + evas_object_show(lb); } static void -tsf_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_status_config(Evas_Object *win, Evas_Object *bx0) { - double tsf = elm_scroll_thumbscroll_friction_get(); - double val = elm_slider_value_get(obj); - - if (tsf == val) return; - elm_scroll_thumbscroll_friction_all_set(val); + Evas_Object *lb, *pd, *bx2, *fr, *sl, *sp; + + fr = elm_frame_add(win); + evas_object_size_hint_weight_set(fr, 1.0, 1.0); + evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_frame_label_set(fr, "Sizing"); + elm_box_pack_end(bx0, fr); + evas_object_show(fr); + + bx2 = elm_box_add(win); + evas_object_size_hint_weight_set(bx2, 1.0, 0.0); + evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, 0.5); + + pd = elm_frame_add(win); + evas_object_size_hint_weight_set(pd, 1.0, 0.0); + evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); + elm_object_style_set(pd, "pad_medium"); + elm_box_pack_end(bx2, pd); + evas_object_show(pd); + + lb = elm_label_add(win); + evas_object_size_hint_weight_set(lb, 1.0, 0.0); + evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); + elm_label_label_set(lb,"Scale"); + elm_frame_content_set(pd, lb); + evas_object_show(lb); + + sl = elm_slider_add(win); + evas_object_size_hint_weight_set(sl, 1.0, 0.0); + evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); + elm_slider_span_size_set(sl, 120); + elm_slider_unit_format_set(sl, "%1.2f"); + elm_slider_indicator_format_set(sl, "%1.2f"); + elm_slider_min_max_set(sl, 0.25, 5.0); + elm_slider_value_set(sl, elm_scale_get()); + elm_box_pack_end(bx2, sl); + evas_object_show(sl); + + evas_object_smart_callback_add(sl, "changed", sc_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL); + + sp = elm_separator_add(win); + elm_separator_horizontal_set(sp, 1); + evas_object_size_hint_weight_set(sp, 1.0, 0.0); + evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); + elm_box_pack_end(bx2, sp); + evas_object_show(sp); + + pd = elm_frame_add(win); + evas_object_size_hint_weight_set(pd, 1.0, 0.0); + evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); + elm_object_style_set(pd, "pad_medium"); + elm_box_pack_end(bx2, pd); + evas_object_show(pd); + + lb = elm_label_add(win); + evas_object_size_hint_weight_set(lb, 1.0, 0.0); + evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); + elm_label_label_set(lb, "Finger Size
"); + elm_frame_content_set(pd, lb); + evas_object_show(lb); + + sl = elm_slider_add(win); + evas_object_size_hint_weight_set(sl, 1.0, 0.0); + evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); + elm_slider_span_size_set(sl, 120); + elm_slider_unit_format_set(sl, "%1.0f"); + elm_slider_indicator_format_set(sl, "%1.0f"); + elm_slider_min_max_set(sl, 5, 200); + elm_slider_value_set(sl, elm_finger_size_get()); + elm_box_pack_end(bx2, sl); + evas_object_show(sl); + + evas_object_smart_callback_add(sl, "changed", fs_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL); + + // FIXME: add theme selector (basic mode and advanced for fallbacks) + // FIXME: save config + // FIXME: profile selector / creator etc. + // + elm_frame_content_set(fr, bx2); + evas_object_show(bx2); } static void -tsbf_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_flip_to(Evas_Object *win, const char *name) { - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + Evas_Object *wid, *fl, *holder, *front, *back; + int front_vis; + wid = evas_object_data_get(win, name); + fl = evas_object_data_get(win, "flip"); + holder = evas_object_data_get(win, "holder"); + front_vis = elm_flip_front_get(fl); + if (front_vis) + { + front = elm_flip_content_front_get(fl); + back = elm_flip_content_back_get(fl); + elm_table_pack(holder, back, 0, 0, 1, 1); + evas_object_hide(back); +// elm_table_unpack(holder, wid); // this should NOT be needed - but in evas_table/elm_table + elm_flip_content_back_set(fl, wid); + } + else + { + front = elm_flip_content_front_get(fl); + back = elm_flip_content_back_get(fl); + elm_table_pack(holder, front, 0, 0, 1, 1); + evas_object_hide(front); +// elm_table_unpack(holder, wid); // this should NOT be needed - but in evas_table/elm_table + elm_flip_content_front_set(fl, wid); + } + + evas_object_show(wid); + elm_flip_go(fl, ELM_FLIP_ROTATE_Y_CENTER_AXIS); } static void -tsbf_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_cf_sizing(void *data, Evas_Object *obj, void *event_info) { - double tsbf = elm_scroll_thumbscroll_border_friction_get(); - double val = elm_slider_value_get(obj); - - if (tsbf == val) return; - elm_scroll_thumbscroll_border_friction_all_set(val); + _flip_to(data, "sizing"); } static void -cf_enable(void *data, - Evas_Object *obj, - void *event_info __UNUSED__) +_cf_themes(void *data, Evas_Object *obj, void *event_info) { - Eina_Bool cf = elm_cache_flush_enmabled_get(); - Eina_Bool val = elm_check_state_get(obj); - - if (cf == val) return; - elm_object_disabled_set((Evas_Object *)data, !val); - elm_cache_flush_enabled_all_set(val); + _flip_to(data, "themes"); } static void -cf_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_cf_fonts(void *data, Evas_Object *obj, void *event_info) { - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 5.0))) / 5.0; - if (v != val) elm_slider_value_set(obj, v); + _flip_to(data, "fonts"); } static void -cf_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_cf_profiles(void *data, Evas_Object *obj, void *event_info) { - double cf = elm_cache_flush_interval_get(); - double val = elm_slider_value_get(obj); - - if (cf == val) return; - elm_cache_flush_interval_all_set(val); + _flip_to(data, "profiles"); } static void -fc_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_cf_scrolling(void *data, Evas_Object *obj, void *event_info) { - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + _flip_to(data, "scrolling"); } static void -fc_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_cf_rendering(void *data, Evas_Object *obj, void *event_info) { - double font_cache = elm_font_cache_get(); - double val = elm_slider_value_get(obj); - - if (font_cache == val) return; - elm_font_cache_all_set(val * 1024); + _flip_to(data, "rendering"); } static void -ic_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_cf_caches(void *data, Evas_Object *obj, void *event_info) { - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + _flip_to(data, "caches"); } static void -ic_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_theme_use(void *data, Evas_Object *obj, void *event_info) { - double image_cache = elm_image_cache_get(); - double val = elm_slider_value_get(obj); - - if (image_cache == val) return; - elm_image_cache_all_set(val * 1024); + printf("not implemented\n"); } static void -sc_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_theme_browse(void *data, Evas_Object *obj, void *event_info) { - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + printf("not implemented\n"); } static void -sc_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_status_config_sizing(Evas_Object *win, Evas_Object *holder) { - double scale = elm_scale_get(); - double val = elm_slider_value_get(obj); - - if (scale == val) return; - elm_scale_all_set(val); -} - -static void -fs_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 5.0))) / 5.0; - if (v != val) elm_slider_value_set(obj, v); -} - -static void -fs_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double fs = elm_finger_size_get(); - double val = elm_slider_value_get(obj); - - if (fs == val) return; - elm_finger_size_all_set(val); -} - -static void -efc_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 5.0))) / 5.0; - if (v != val) elm_slider_value_set(obj, v); -} - -static void -efc_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double efc = elm_edje_file_cache_get(); - double val = elm_slider_value_get(obj); - - if (efc == val) return; - elm_edje_file_cache_all_set(val); -} - -static void -ecc_round(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double val = elm_slider_value_get(obj); - double v; - - v = ((double)((int)(val * 5.0))) / 5.0; - if (v != val) elm_slider_value_set(obj, v); -} - -static void -ecc_change(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - double ecc = elm_edje_collection_cache_get(); - double val = elm_slider_value_get(obj); - - if (ecc == val) return; - elm_edje_collection_cache_all_set(val); -} - -static void -_status_basic(Evas_Object *win, - Evas_Object *bx0) -{ - Evas_Object *lb, *fr; - - fr = elm_frame_add(win); - evas_object_size_hint_weight_set(fr, 1.0, 1.0); - elm_frame_label_set(fr, "Information"); - elm_box_pack_end(bx0, fr); - evas_object_show(fr); - + Evas_Object *lb, *pd, *bx2, *sl, *sp; + + bx2 = elm_box_add(win); + evas_object_size_hint_weight_set(bx2, 1.0, 0.0); + evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, 0.5); + + pd = elm_frame_add(win); + evas_object_size_hint_weight_set(pd, 1.0, 0.0); + evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); + elm_object_style_set(pd, "pad_medium"); + elm_box_pack_end(bx2, pd); + evas_object_show(pd); + lb = elm_label_add(win); - elm_label_label_set(lb, - "Applying configuration change" - ); - elm_frame_content_set(fr, lb); + evas_object_size_hint_weight_set(lb, 1.0, 0.0); + evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); + elm_label_label_set(lb,"Scale"); + elm_frame_content_set(pd, lb); evas_object_show(lb); -} - -static void -_status_config(Evas_Object *win, - Evas_Object *bx0) -{ - Evas_Object *lb, *pd, *bx, *fr, *sl, *sp; - - fr = elm_frame_add(win); - evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_label_set(fr, "Sizing"); - elm_box_pack_end(bx0, fr); - evas_object_show(fr); - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5); - - LABEL_FRAME_ADD("Scale"); - + sl = elm_slider_add(win); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_weight_set(sl, 1.0, 0.0); evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); elm_slider_span_size_set(sl, 120); elm_slider_unit_format_set(sl, "%1.2f"); elm_slider_indicator_format_set(sl, "%1.2f"); elm_slider_min_max_set(sl, 0.25, 5.0); elm_slider_value_set(sl, elm_scale_get()); - elm_box_pack_end(bx, sl); + elm_box_pack_end(bx2, sl); evas_object_show(sl); - + evas_object_smart_callback_add(sl, "changed", sc_round, NULL); evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL); - + sp = elm_separator_add(win); elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_weight_set(sp, 1.0, 0.0); evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); + elm_box_pack_end(bx2, sp); evas_object_show(sp); - - LABEL_FRAME_ADD("Finger Size
"); - + + pd = elm_frame_add(win); + evas_object_size_hint_weight_set(pd, 1.0, 0.0); + evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); + elm_object_style_set(pd, "pad_medium"); + elm_box_pack_end(bx2, pd); + evas_object_show(pd); + + lb = elm_label_add(win); + evas_object_size_hint_weight_set(lb, 1.0, 0.0); + evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); + elm_label_label_set(lb, "Finger Size
"); + elm_frame_content_set(pd, lb); + evas_object_show(lb); + sl = elm_slider_add(win); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_weight_set(sl, 1.0, 0.0); evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); elm_slider_span_size_set(sl, 120); elm_slider_unit_format_set(sl, "%1.0f"); elm_slider_indicator_format_set(sl, "%1.0f"); elm_slider_min_max_set(sl, 5, 200); elm_slider_value_set(sl, elm_finger_size_get()); - elm_box_pack_end(bx, sl); + elm_box_pack_end(bx2, sl); evas_object_show(sl); - + evas_object_smart_callback_add(sl, "changed", fs_round, NULL); evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL); - // FIXME: add theme selector (basic mode and advanced for fallbacks) - // FIXME: save config - // FIXME: profile selector / creator etc. - elm_frame_content_set(fr, bx); - evas_object_show(bx); -} - -static void -_flip_to(Evas_Object *win, - const char *name) -{ - Evas_Object *wid, *pager; - wid = evas_object_data_get(win, name); - pager = evas_object_data_get(win, "pager"); - elm_pager_content_promote(pager, wid); -} - -static void -_cf_sizing(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - _flip_to(data, "sizing"); -} - -static void -_cf_themes(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - _flip_to(data, "themes"); -} - -static void -_cf_fonts(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - _flip_to(data, "fonts"); -} - -static void -_cf_profiles(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - _flip_to(data, "profiles"); -} - -static void -_cf_scrolling(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - _flip_to(data, "scrolling"); -} - -static void -_cf_rendering(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - _flip_to(data, "rendering"); -} - -static void -_cf_caches(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - _flip_to(data, "caches"); -} - -const char * -_elm_theme_current_get(const char *theme_search_order) -{ - const char *ret; - const char *p; - - if (!theme_search_order) - return NULL; - - for (p = theme_search_order;; p++) - { - if ((*p == ':') || (!*p)) - { - if (p > theme_search_order) - { - char *n = malloc(p - theme_search_order + 1); - if (!n) - return NULL; - - strncpy(n, theme_search_order, p - theme_search_order); - n[p - theme_search_order] = 0; - ret = eina_stringshare_add(n); - free(n); - break; - } - } - } - - return ret; -} - -static void -_font_overlay_set_all(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes; - Elm_Text_Class_Data *tc_data, *tc; - Elm_List_Item *it; - Eina_List *l; - - win = data; - - fclasses = evas_object_data_get(win, "font_classes_list"); - it = elm_list_selected_item_get(fclasses); - if (!it) return; - tc_data = elm_list_item_data_get(it); - - fnames = evas_object_data_get(win, "font_names_list"); - fstyles = evas_object_data_get(win, "font_styles_list"); - fsizes = evas_object_data_get(win, "font_sizes_list"); - - EINA_LIST_FOREACH(fdata.text_classes, l, tc) - { - eina_stringshare_replace(&tc->font, tc_data->font); - eina_stringshare_replace(&tc->style, tc_data->style); - tc->size = tc_data->size; - } - - elm_config_save(); -} - -static void -_font_overlay_reset(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes; - Elm_Text_Class_Data *tc_data; - Elm_List_Item *it; - - win = data; - - fclasses = evas_object_data_get(win, "font_classes_list"); - it = elm_list_selected_item_get(fclasses); - if (!it) return; - tc_data = elm_list_item_data_get(it); - - fnames = evas_object_data_get(win, "font_names_list"); - fstyles = evas_object_data_get(win, "font_styles_list"); - fsizes = evas_object_data_get(win, "font_sizes_list"); - - elm_font_overlay_unset(tc_data->name); - - eina_stringshare_replace(&fdata.cur_font, NULL); - eina_stringshare_replace(&tc_data->font, NULL); - eina_stringshare_replace(&fdata.cur_style, NULL); - eina_stringshare_replace(&tc_data->style, NULL); - fdata.cur_size = 0.0; - tc_data->size = 0.0; - - ELM_LIST_DISABLE(fnames); - ELM_LIST_DISABLE(fstyles); - ELM_LIST_DISABLE(fsizes); - - elm_config_save(); -} - -static void -_font_overlay_reset_all(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes; - Elm_Text_Class_Data *tc_data; - Elm_List_Item *it; - Eina_List *l; - - win = data; - eina_stringshare_replace(&fdata.cur_font, NULL); - eina_stringshare_replace(&fdata.cur_style, NULL); - fdata.cur_size = 0.0; - - EINA_LIST_FOREACH(fdata.text_classes, l, tc_data) - { - elm_font_overlay_unset(tc_data->name); - - eina_stringshare_replace(&tc_data->font, NULL); - eina_stringshare_replace(&tc_data->style, NULL); - tc_data->size = 0.0; - } - - fclasses = evas_object_data_get(win, "font_classes_list"); - fnames = evas_object_data_get(win, "font_names_list"); - fstyles = evas_object_data_get(win, "font_styles_list"); - fsizes = evas_object_data_get(win, "font_sizes_list"); - - it = elm_list_selected_item_get(fclasses); - if (it) elm_list_item_selected_set(it, EINA_FALSE); - - ELM_LIST_DISABLE(fnames); - ELM_LIST_DISABLE(fstyles); - ELM_LIST_DISABLE(fsizes); - - elm_config_save(); -} - -static void -_font_overlay_change(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Elm_Text_Class_Data *tc_data; - Eina_List *l; - - EINA_LIST_FOREACH(fdata.text_classes, l, tc_data) - { - if (tc_data->font) - { - const char *name; - - name = elm_font_fontconfig_name_get(tc_data->font, - tc_data->style); - elm_font_overlay_set(tc_data->name, name, - tc_data->size ? tc_data->size : -100); - elm_font_fontconfig_name_free(name); - } - else - elm_font_overlay_unset(tc_data->name); - } - - elm_config_save(); - elm_font_overlay_all_apply(); - - /* TODO: apply hinting */ -} - -static void -_profile_change_do(Evas_Object *win, - const char *profile) -{ - int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould; - double scale, s_bounce_friction, ts_momentum_threshold, ts_friction, - ts_border_friction, page_friction, bring_in_friction, zoom_friction; - const char *curr_theme, *curr_engine; - const Eina_List *l_items, *l; - Eina_Bool s_bounce, ts; - Elm_List_Item *it; - Elm_Theme *th; - int fs; - - elm_profile_all_set(profile); - - scale = elm_scale_get(); - fs = elm_finger_size_get(); - flush_interval = elm_cache_flush_interval_get(); - font_c = elm_font_cache_get(); - image_c = elm_image_cache_get(); - edje_file_c = elm_edje_file_cache_get(); - edje_col_c = elm_edje_collection_cache_get(); - - s_bounce = elm_scroll_bounce_enabled_get(); - s_bounce_friction = elm_scroll_bounce_friction_get(); - ts = elm_scroll_thumbscroll_enabled_get(); - ts_threshould = elm_scroll_thumbscroll_threshold_get(); - ts_momentum_threshold = elm_scroll_thumbscroll_momentum_threshold_get(); - ts_friction = elm_scroll_thumbscroll_friction_get(); - ts_border_friction = elm_scroll_thumbscroll_border_friction_get(); - page_friction = elm_scroll_page_scroll_friction_get(); - bring_in_friction = elm_scroll_bring_in_scroll_friction_get(); - zoom_friction = elm_scroll_zoom_friction_get(); - - /* gotta update root windows' atoms */ - elm_scale_all_set(scale); - elm_slider_value_set(evas_object_data_get(win, "scale_slider"), scale); - elm_finger_size_all_set(fs); - elm_slider_value_set(evas_object_data_get(win, "fs_slider"), fs); - - elm_cache_flush_interval_all_set(flush_interval); - elm_slider_value_set(evas_object_data_get(win, - "cache_flush_interval_slider"), - flush_interval); - elm_font_cache_all_set(font_c); - elm_slider_value_set(evas_object_data_get(win, "font_cache_slider"), - font_c / 1024.0); - elm_image_cache_all_set(image_c); - elm_slider_value_set(evas_object_data_get(win, "image_cache_slider"), - image_c / 1024.0); - elm_edje_file_cache_all_set(edje_file_c); - elm_slider_value_set(evas_object_data_get(win, "edje_file_cache_slider"), - edje_file_c); - elm_edje_collection_cache_all_set(edje_col_c); - elm_slider_value_set(evas_object_data_get(win, - "edje_collection_cache_slider"), - edje_col_c); - - elm_scroll_bounce_enabled_all_set(s_bounce); - elm_check_state_set(evas_object_data_get(win, "scroll_bounce_check"), - s_bounce); - elm_scroll_bounce_friction_all_set(s_bounce_friction); - elm_slider_value_set(evas_object_data_get(win, "bounce_friction_slider"), - s_bounce_friction); - elm_scroll_thumbscroll_enabled_all_set(ts); - elm_check_state_set(evas_object_data_get(win, "thumbscroll_check"), ts); - elm_scroll_thumbscroll_threshold_all_set(ts_threshould); - elm_slider_value_set(evas_object_data_get(win, - "thumbscroll_threshold_slider"), - ts_threshould); - elm_scroll_thumbscroll_momentum_threshold_all_set(ts_momentum_threshold); - elm_slider_value_set(evas_object_data_get(win, - "ts_momentum_threshold_slider"), - ts_momentum_threshold); - elm_scroll_thumbscroll_friction_all_set(ts_friction); - elm_slider_value_set(evas_object_data_get(win, - "thumbscroll_friction_slider"), - ts_friction); - elm_scroll_thumbscroll_border_friction_all_set(ts_border_friction); - elm_slider_value_set(evas_object_data_get(win, "ts_border_friction_slider"), - ts_border_friction); - elm_scroll_page_scroll_friction_all_set(page_friction); - elm_slider_value_set(evas_object_data_get(win, - "page_scroll_friction_slider"), - page_friction); - elm_scroll_bring_in_scroll_friction_all_set(bring_in_friction); - elm_slider_value_set(evas_object_data_get(win, - "bring_in_scroll_friction_slider"), - bring_in_friction); - elm_scroll_zoom_friction_all_set(zoom_friction); - elm_slider_value_set(evas_object_data_get(win, - "zoom_scroll_friction_slider"), - zoom_friction); - - curr_theme = _elm_theme_current_get(elm_theme_get(NULL)); - elm_theme_all_set(curr_theme); - - th = elm_theme_new(); - elm_theme_set(th, curr_theme); - elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th); - elm_theme_free(th); - eina_stringshare_del(curr_theme); - - curr_engine = elm_engine_current_get(); - l_items = elm_list_items_get(evas_object_data_get(win, "engines_list")); - EINA_LIST_FOREACH(l_items, l, it) - { - if (!strcmp(elm_list_item_data_get(it), curr_engine)) - { - elm_list_item_selected_set(it, EINA_TRUE); - break; - } - } -} - -static void -_engine_use(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Evas_Object *li; - const char *selection; - - li = data; - selection = elm_list_item_data_get(elm_list_selected_item_get(li)); - - if (!strcmp(elm_engine_current_get(), selection)) - return; - - elm_engine_set(selection); - elm_config_save(); /* make sure new engine has its data dir */ -} - -static void -_profile_use(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Evas_Object *li; - const char *selection; - const char *profile; - - li = data; - selection = elm_list_item_data_get(elm_list_selected_item_get(li)); - profile = elm_profile_current_get(); - - if (!profile) - { - fprintf(stderr, "No profile currently set!\n"); /* FIXME: log domain */ - return; - } - - if (!strcmp(profile, selection)) - return; - - elm_config_save(); /* dump config into old profile's data dir */ - elm_profile_set(selection); /* just here to update info for getters below */ - - _profile_change_do(elm_object_top_widget_get(li), selection); - elm_config_save(); /* make sure new profile has its data dir */ -} - -static void -_btn_todo(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - printf("To be done!\n"); -} - -static void -_profile_reset(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - const char *selection, *curr; - const char *pdir; - Evas_Object *li; - - li = data; - selection = elm_list_item_data_get(elm_list_selected_item_get(li)); - curr = elm_profile_current_get(); - - elm_config_save(); /* dump config into old profile's data dir */ - - pdir = elm_profile_dir_get(selection, EINA_TRUE); - if (!pdir) - return; - - ecore_file_recursive_rm(pdir); - elm_profile_dir_free(pdir); - - elm_config_reload(); - - _profile_change_do(elm_object_top_widget_get(li), curr); - elm_config_save(); /* make sure new profile has its data dir */ -} - -static void -_theme_use(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - const char *defth; - char *newth; - Theme *t = tsel; - - if (!t) return; - defth = elm_theme_get(NULL); - newth = malloc(strlen(defth) + 1 + strlen(t->name) + 1); - if (newth) - { - char *rest; - - newth[0] = 0; - rest = strchr(defth, ':'); - if (!rest) - strcpy(newth, t->name); - else - { - strcpy(newth, t->name); - strcat(newth, rest); - } - elm_theme_all_set(newth); - free(newth); - } -} - -static void -_theme_sel(void *data, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - Theme *t = data; - Evas_Object *win = elm_object_top_widget_get(obj); - Evas_Object *sample = evas_object_data_get(win, "theme_preview"); - Elm_Theme *th; - const char *defth; - char *newth; - - tsel = t; - defth = elm_theme_get(NULL); - newth = malloc(strlen(defth) + 1 + strlen(t->name) + 1); - th = elm_theme_new(); - if (newth) - { - char *rest; - - newth[0] = 0; - rest = strchr(defth, ':'); - if (!rest) - strcpy(newth, t->name); - else - { - strcpy(newth, t->name); - strcat(newth, rest); - } - elm_theme_set(th, newth); - free(newth); - } - elm_object_theme_set(sample, th); - elm_theme_free(th); -} - -/*static void - _theme_browse(void *data, Evas_Object *obj, void *event_info) - { - printf("not implemented\n"); - }*/ - -static void -_status_config_sizing(Evas_Object *win, - Evas_Object *pager) -{ - Evas_Object *lb, *pd, *bx, *sl, *sp; - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5); - - LABEL_FRAME_ADD("Scale"); - - sl = elm_slider_add(win); - evas_object_data_set(win, "scale_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.2f"); - elm_slider_indicator_format_set(sl, "%1.2f"); - elm_slider_min_max_set(sl, 0.25, 5.0); - elm_slider_value_set(sl, elm_scale_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", sc_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - LABEL_FRAME_ADD("Finger Size
"); - - sl = elm_slider_add(win); - evas_object_data_set(win, "fs_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.0f"); - elm_slider_indicator_format_set(sl, "%1.0f"); - elm_slider_min_max_set(sl, 5, 200); - elm_slider_value_set(sl, elm_finger_size_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", fs_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL); - - evas_object_data_set(win, "sizing", bx); - - elm_pager_content_push(pager, bx); -} - -static Evas_Object * -_sample_theme_new(Evas_Object *win) -{ - Evas_Object *base, *bg, *bt, *ck, *rd, *rdg, *sl, *fr, *li, *rc, *sp; - - base = elm_table_add(win); - evas_object_size_hint_weight_set(base, 1.0, 1.0); - evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL); - - bg = elm_bg_add(win); - evas_object_size_hint_weight_set(bg, 1.0, 1.0); - evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_table_pack(base, bg, 0, 0, 2, 5); - evas_object_show(bg); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Button"); - elm_table_pack(base, bt, 0, 0, 1, 1); - evas_object_show(bt); - - ck = elm_check_add(win); - elm_check_label_set(ck, "Check"); - elm_table_pack(base, ck, 0, 1, 1, 1); - evas_object_show(ck); - - rd = elm_radio_add(win); - elm_radio_state_value_set(rd, 0); - elm_radio_label_set(rd, "Radio 1"); - elm_table_pack(base, rd, 1, 0, 1, 1); - evas_object_show(rd); - rdg = rd; - - rd = elm_radio_add(win); - elm_radio_state_value_set(rd, 1); - elm_radio_label_set(rd, "Radio 2"); - elm_radio_group_add(rd, rdg); - elm_table_pack(base, rd, 1, 1, 1, 1); - evas_object_show(rd); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, 1.0, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_table_pack(base, sp, 0, 2, 2, 1); - evas_object_show(sp); - - sl = elm_slider_add(win); - elm_slider_label_set(sl, "Slider"); - elm_slider_span_size_set(sl, 120); - elm_slider_min_max_set(sl, 1, 10); - elm_slider_value_set(sl, 4); - evas_object_size_hint_weight_set(sl, 1.0, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_table_pack(base, sl, 0, 3, 2, 1); - evas_object_show(sl); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Frame"); - elm_table_pack(base, fr, 0, 4, 2, 1); - evas_object_size_hint_weight_set(fr, 1.0, 1.0); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(fr); - - li = elm_list_add(win); - evas_object_size_hint_weight_set(li, 1.0, 1.0); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); - evas_object_show(li); - - elm_list_item_append(li, "List Item 1", NULL, NULL, NULL, NULL); - elm_list_item_append(li, "Second Item", NULL, NULL, NULL, NULL); - elm_list_item_append(li, "Third Item", NULL, NULL, NULL, NULL); - elm_list_go(li); - - rc = evas_object_rectangle_add(evas_object_evas_get(win)); - evas_object_size_hint_min_set(rc, 160, 120); - elm_table_pack(base, rc, 0, 4, 2, 1); - - return base; -} - -static void -_status_config_themes(Evas_Object *win, - Evas_Object *pager) -{ - Evas_Object *tb, *rc, *sc, *sp, *li, *pd, *fr, *bt, *sample; - Eina_List *list, *l; - char *th, *s, *ext; - - tb = elm_table_add(win); - evas_object_size_hint_weight_set(tb, 1.0, 1.0); - evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); - - rc = evas_object_rectangle_add(evas_object_evas_get(win)); - evas_object_size_hint_min_set(rc, 0, 130); - elm_table_pack(tb, rc, 0, 0, 1, 1); - - rc = evas_object_rectangle_add(evas_object_evas_get(win)); - evas_object_size_hint_min_set(rc, 0, 200); - elm_table_pack(tb, rc, 0, 1, 1, 1); - - ///////////////////////////////////////////// - - pd = elm_frame_add(win); - elm_object_style_set(pd, "pad_medium"); - evas_object_size_hint_weight_set(pd, 1.0, 1.0); - evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_table_pack(tb, pd, 0, 0, 1, 1); - evas_object_show(pd); - - li = elm_list_add(win); - evas_object_size_hint_weight_set(li, 1.0, 1.0); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(pd, li); - evas_object_show(li); - - list = elm_theme_name_available_list_new(); - EINA_LIST_FOREACH(list, l, th) - { - Theme *t; - - t = calloc(1, sizeof(Theme)); - t->name = eina_stringshare_add(th); - s = elm_theme_list_item_path_get(th, &(t->in_search_path)); - if (s) - { - t->path = eina_stringshare_add(s); - free(s); - } - if (t->in_search_path) - { - s = strdup(th); - if (s) - { - s[0] = toupper(s[0]); - t->label = eina_stringshare_add(s); - free(s); - } - else - t->label = eina_stringshare_add(s); - } - else - { - s = strdup(ecore_file_file_get(th)); - if (s) - { - s[0] = toupper(s[0]); - ext = strrchr(s, '.'); - if (ext) *ext = 0; - t->label = eina_stringshare_add(s); - free(s); - } - else - t->label = eina_stringshare_add(s); - } - themes = eina_list_append(themes, t); - elm_list_item_append(li, t->label, NULL, NULL, _theme_sel, t); - } - elm_theme_name_available_list_free(list); - - elm_list_go(li); - - pd = elm_frame_add(win); - elm_object_style_set(pd, "pad_medium"); - evas_object_size_hint_weight_set(pd, 1.0, 1.0); - evas_object_size_hint_align_set(pd, 0.9, 0.9); - elm_table_pack(tb, pd, 0, 0, 1, 1); - evas_object_show(pd); - - /* FIXME: not implemented yet - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _theme_browse, win); - elm_button_label_set(bt, "Browse..."); - evas_object_size_hint_weight_set(bt, 1.0, 1.0); - evas_object_size_hint_align_set(bt, 0.9, 0.9); - elm_frame_content_set(pd, bt); - evas_object_show(bt); - */ - pd = elm_frame_add(win); - elm_object_style_set(pd, "pad_medium"); - evas_object_size_hint_weight_set(pd, 1.0, 0.0); - evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_table_pack(tb, pd, 0, 1, 1, 1); - evas_object_show(pd); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Preview"); - evas_object_size_hint_weight_set(fr, 1.0, 1.0); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(pd, fr); - evas_object_show(fr); - - sc = elm_scroller_add(win); - elm_scroller_bounce_set(sc, 0, 0); - evas_object_size_hint_weight_set(sc, 1.0, 1.0); - evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, sc); - evas_object_show(sc); - - sample = _sample_theme_new(win); - elm_scroller_content_set(sc, sample); - evas_object_show(sample); - evas_object_data_set(win, "theme_preview", sample); - - ///////////////////////////////////////////// - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, 1.0, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_table_pack(tb, sp, 0, 2, 1, 1); - evas_object_show(sp); - - pd = elm_frame_add(win); - elm_object_style_set(pd, "pad_medium"); - evas_object_size_hint_weight_set(pd, 0.0, 0.0); - evas_object_size_hint_align_set(pd, 0.5, 0.5); - elm_table_pack(tb, pd, 0, 3, 1, 1); - evas_object_show(pd); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _theme_use, win); - elm_button_label_set(bt, "Use Theme"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_frame_content_set(pd, bt); - evas_object_show(bt); - - evas_object_data_set(win, "themes", tb); - elm_pager_content_push(pager, tb); -} - -static void -_font_preview_update(Evas_Object *win) -{ - Evas_Font_Size sz; - const char *name; - - if (!fdata.cur_font) - return; - - name = elm_font_fontconfig_name_get(fdata.cur_font, fdata.cur_style); - sz = fdata.cur_size; - - if (sz < 0) - sz = (-sz * 10) / 100; - if (sz == 0) - sz = 10; - - edje_object_text_class_set(evas_object_data_get(win, "font_preview"), - "font_preview", name, sz); - - elm_font_fontconfig_name_free(name); -} - -static void -_font_classes_list_sel(void *data __UNUSED__, - Evas_Object *obj, - void *event_info) -{ - const Eina_List *f_names_items, *l; - Elm_Text_Class_Data *tc_data; - Evas_Object *f_names_list; - Elm_List_Item *it; - - tc_data = elm_list_item_data_get(event_info); - - f_names_list = evas_object_data_get(elm_object_top_widget_get(obj), - "font_names_list"); - ELM_LIST_ENABLE(f_names_list); - - f_names_items = elm_list_items_get(f_names_list); - - EINA_LIST_FOREACH(f_names_items, l, it) - { - const char *l; - - l = elm_list_item_label_get(it); - - if (tc_data->font && !strcmp(l, tc_data->font)) - { - elm_list_item_selected_set(it, EINA_TRUE); - elm_list_item_show(it); - break; - } - } -} - -static void -_font_names_list_sel(void *data __UNUSED__, - Evas_Object *obj, - void *event_info) -{ - Evas_Object *style_list, *cls_list, *sizes_list, *win; - const char *style, *sel_font; - Elm_Text_Class_Data *tc_data; - Elm_List_Item *it, *fc_it; - Elm_Font_Properties *efp; - const Eina_List *l; - - it = event_info; - sel_font = elm_list_item_label_get(it); - - win = elm_object_top_widget_get(obj); - style_list = evas_object_data_get(win, "font_styles_list"); - cls_list = evas_object_data_get(win, "font_classes_list"); - sizes_list = evas_object_data_get(win, "font_sizes_list"); - - fc_it = elm_list_selected_item_get(cls_list); - if (!fc_it) return; /* should not happen, fonts list disabled in - * this case */ - - eina_stringshare_replace(&fdata.cur_font, sel_font); - - tc_data = elm_list_item_data_get(fc_it); - if (tc_data->font) eina_stringshare_del(tc_data->font); - if (fdata.cur_font) tc_data->font = eina_stringshare_ref(fdata.cur_font); - - /* load styles list */ - efp = eina_hash_find(fdata.font_hash, sel_font); - - ELM_LIST_ENABLE(style_list); - elm_list_clear(style_list); - - evas_event_freeze(evas_object_evas_get(style_list)); - edje_freeze(); - - it = NULL; - - EINA_LIST_FOREACH(efp->styles, l, style) - { - Elm_List_Item *i; - - i = elm_list_item_append(style_list, style, NULL, NULL, - _font_styles_list_sel, NULL); - - if (tc_data->style && (!strcmp(style, tc_data->style))) - it = i; - } - - elm_list_go(style_list); - - edje_thaw(); - evas_event_thaw(evas_object_evas_get(style_list)); - - if (it) - elm_list_item_selected_set(it, EINA_TRUE); - - _font_preview_update(win); -} - -static void -_font_styles_list_sel(void *data __UNUSED__, - Evas_Object *obj, - void *event_info) -{ - Evas_Object *fc_list, *fs_list, *win; - Elm_Text_Class_Data *tc_data; - const Eina_List *l; - Elm_List_Item *it; - - win = elm_object_top_widget_get(obj); - fc_list = evas_object_data_get(win, "font_classes_list"); - fs_list = evas_object_data_get(win, "font_sizes_list"); - - it = elm_list_selected_item_get(fc_list); - if (!it) return; /* should not happen */ - - eina_stringshare_replace(&fdata.cur_style, - elm_list_item_label_get(event_info)); - ELM_LIST_ENABLE(fs_list); - - tc_data = elm_list_item_data_get(it); - eina_stringshare_del(tc_data->style); - tc_data->style = eina_stringshare_ref(fdata.cur_style); - - evas_event_freeze(evas_object_evas_get(fs_list)); - edje_freeze(); - - EINA_LIST_FOREACH(elm_list_items_get(fs_list), l, it) - { - Elm_Font_Size_Data *sdata; - - sdata = elm_list_item_data_get(it); - elm_list_item_selected_set(l->data, EINA_FALSE); - - if (tc_data->size == sdata->size) - { - elm_list_item_selected_set(it, EINA_TRUE); - elm_list_item_show(it); - break; - } - } - - edje_thaw(); - evas_event_thaw(evas_object_evas_get(fs_list)); - - _font_preview_update(win); -} - -static void -_font_sizes_list_sel(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - Elm_Text_Class_Data *tc_data; - Evas_Object *fc_list, *win; - Elm_Font_Size_Data *sd; - Elm_List_Item *it; - - win = elm_object_top_widget_get(obj); - fc_list = evas_object_data_get(win, "font_classes_list"); - - it = elm_list_selected_item_get(fc_list); - if (!it) return; /* should not happen */ - - sd = elm_list_item_data_get(event_info); - fdata.cur_size = sd->size; - - tc_data = elm_list_item_data_get(it); - tc_data->size = fdata.cur_size; - - _font_preview_update(win); -} - -static void -_fstyle_list_unselect_cb(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - Evas_Object *sizes_list, *win; - - if (elm_list_selected_item_get(obj)) return; - - win = elm_object_top_widget_get(obj); - - sizes_list = evas_object_data_get(win, "font_sizes_list"); - ELM_LIST_DISABLE(sizes_list); -} - -static void -_fc_list_unselect_cb(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - Evas_Object *font_names_list, *styles_list, *sizes_list, *win; - - if (elm_list_selected_item_get(obj)) return; - - win = elm_object_top_widget_get(obj); - - font_names_list = evas_object_data_get(win, "font_names_list"); - ELM_LIST_DISABLE(font_names_list); - - styles_list = evas_object_data_get(win, "font_styles_list"); - ELM_LIST_DISABLE(styles_list); - - sizes_list = evas_object_data_get(win, "font_sizes_list"); - ELM_LIST_DISABLE(sizes_list); -} - -static void -_font_classes_list_load(Evas_Object *li) -{ - Elm_Text_Class_Data *tc_data; - Eina_List *l; - Evas *evas; - - evas = evas_object_evas_get(li); - evas_event_freeze(evas); - edje_freeze(); - - EINA_LIST_FOREACH(fdata.text_classes, l, tc_data) - elm_list_item_append(li, tc_data->desc, NULL, NULL, - _font_classes_list_sel, tc_data); - - evas_object_smart_callback_add(li, "unselected", _fc_list_unselect_cb, - NULL); - - elm_list_go(li); - edje_thaw(); - evas_event_thaw(evas); -} - -static void -_fonts_data_fill(Evas *evas) -{ - const Eina_List *fo_list, *text_classes, *l; - Elm_Text_Class_Data *tc_data; - Elm_Font_Size_Data *sd; - Elm_Font_Overlay *efo; - Eina_List *evas_fonts; - Elm_Text_Class *etc; - int i; - - evas_fonts = evas_font_available_list(evas); - fdata.font_hash = elm_font_available_hash_add(evas_fonts); - evas_font_available_list_free(evas, evas_fonts); - - text_classes = elm_text_classes_list_get(); - fo_list = elm_font_overlay_list_get(); - - EINA_LIST_FOREACH(text_classes, l, etc) - { - const Eina_List *ll; - - tc_data = calloc(1, sizeof(*tc_data)); - tc_data->name = eina_stringshare_add(etc->name); - tc_data->desc = eina_stringshare_add(etc->desc); - - EINA_LIST_FOREACH(fo_list, ll, efo) - { - if (strcmp(tc_data->name, efo->text_class)) - continue; - - if (efo->font) - { - Elm_Font_Properties *efp; - - efp = elm_font_properties_get(efo->font); - if (efp) - { - tc_data->font = eina_stringshare_add(efp->name); - /* we're sure we recorded with only 1 style selected */ - tc_data->style = eina_stringshare_add(efp->styles->data); - elm_font_properties_free(efp); - } - } - tc_data->size = efo->size; - } - - fdata.text_classes = eina_list_append(fdata.text_classes, tc_data); - } - - elm_text_classes_list_free(text_classes); - - /* FIXME: hinting later */ - /* fdata.hinting = e_config->font_hinting; */ - - sd = calloc(1, sizeof(Elm_Font_Size_Data)); - sd->size_str = eina_stringshare_add("Tiny"); - sd->size = -50; - fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd); - - sd = calloc(1, sizeof(Elm_Font_Size_Data)); - sd->size_str = eina_stringshare_add("Small"); - sd->size = -80; - fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd); - - sd = calloc(1, sizeof(Elm_Font_Size_Data)); - sd->size_str = eina_stringshare_add("Normal"); - sd->size = -100; - fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd); - - sd = calloc(1, sizeof(Elm_Font_Size_Data)); - sd->size_str = eina_stringshare_add("Big"); - sd->size = -150; - fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd); - - sd = calloc(1, sizeof(Elm_Font_Size_Data)); - sd->size_str = eina_stringshare_add("Really Big"); - sd->size = -190; - fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd); - - sd = calloc(1, sizeof(Elm_Font_Size_Data)); - sd->size_str = eina_stringshare_add("Huge"); - sd->size = -250; - fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd); - - for (i = 5; i < 51; i++) - { - char str[16]; - - str[0] = 0; - snprintf(str, sizeof(str), "%d pixels", i); - - sd = calloc(1, sizeof(Elm_Font_Size_Data)); - sd->size_str = eina_stringshare_add(str); - sd->size = i; - fdata.font_px_list = eina_list_append(fdata.font_px_list, sd); - } -} - -static int -_font_sort_cb(const void *data1, - const void *data2) -{ - if (!data1) return 1; - if (!data2) return -1; - return strcmp(data1, data2); -} - -static void -_font_sizes_list_load(Evas_Object *size_list) -{ - Elm_Font_Size_Data *size_data; - Eina_List *l; - Evas *evas; - - evas = evas_object_evas_get(size_list); - evas_event_freeze(evas); - edje_freeze(); - - EINA_LIST_FOREACH(fdata.font_scale_list, l, size_data) - elm_list_item_append(size_list, size_data->size_str, NULL, NULL, - _font_sizes_list_sel, size_data); - - EINA_LIST_FOREACH(fdata.font_px_list, l, size_data) - elm_list_item_append(size_list, size_data->size_str, NULL, NULL, - _font_sizes_list_sel, size_data); - - elm_list_go(size_list); - edje_thaw(); - evas_event_thaw(evas); -} - -static void -_fnames_list_unselect_cb(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - Evas_Object *styles_list, *sizes_list, *win; - - if (elm_list_selected_item_get(obj)) return; - - win = elm_object_top_widget_get(obj); - - styles_list = evas_object_data_get(win, "font_styles_list"); - ELM_LIST_DISABLE(styles_list); - - sizes_list = evas_object_data_get(win, "font_sizes_list"); - ELM_LIST_DISABLE(sizes_list); -} - -static Eina_Bool -_font_list_fill(const Eina_Hash *hash __UNUSED__, - const void *key __UNUSED__, - void *data, - void *fdata) -{ - Elm_Font_Properties *efp; - Eina_List **flist; - - flist = fdata; - efp = data; - - *flist = eina_list_append(*flist, efp->name); - - return EINA_TRUE; -} - -static void -_font_names_list_load(Evas_Object *flist) -{ - Eina_List *l, *names_list = NULL; - const char *font; - Evas *evas; - - evas = evas_object_evas_get(flist); - evas_event_freeze(evas); - edje_freeze(); - - eina_hash_foreach(fdata.font_hash, _font_list_fill, &names_list); - names_list = eina_list_sort(names_list, eina_list_count(names_list), - _font_sort_cb); - - EINA_LIST_FOREACH(names_list, l, font) - elm_list_item_append(flist, font, NULL, NULL, _font_names_list_sel, NULL); - - EINA_LIST_FREE(names_list, font) ; - - evas_object_smart_callback_add(flist, "unselected", - _fnames_list_unselect_cb, NULL); - - elm_list_go(flist); - - edje_thaw(); - evas_event_thaw(evas); -} - -static void -_status_config_fonts(Evas_Object *win, - Evas_Object *pager) -{ - Evas_Object *base, *fr, *li, *rc, *preview, *sp, *pd, *bt, *bx; - char buf[PATH_MAX]; - - _fonts_data_fill(evas_object_evas_get(win)); - - base = elm_table_add(win); - evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL); - - /* yeah, dummy rectangles are ugly as hell, but no good way yet of - fixing sizes */ - rc = evas_object_rectangle_add(evas_object_evas_get(win)); - evas_object_size_hint_min_set(rc, 70, 170); - elm_table_pack(base, rc, 1, 0, 1, 1); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Font Class"); - elm_table_pack(base, fr, 0, 0, 1, 2); - evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(fr); - - /* FIXME: no multiselection for this list, for now */ - li = elm_list_add(win); - evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); - evas_object_show(li); - - evas_object_data_set(win, "font_classes_list", li); - _font_classes_list_load(li); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Font"); - elm_table_pack(base, fr, 1, 0, 1, 2); - evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(fr); - - li = elm_list_add(win); - evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); - evas_object_show(li); - - evas_object_data_set(win, "font_names_list", li); - _font_names_list_load(li); - ELM_LIST_DISABLE(li); - - rc = evas_object_rectangle_add(evas_object_evas_get(win)); - evas_object_size_hint_min_set(rc, 70, 130); - elm_table_pack(base, rc, 1, 2, 1, 1); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Style"); - elm_table_pack(base, fr, 0, 2, 1, 1); - evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(fr); - ELM_LIST_DISABLE(li); - - li = elm_list_add(win); - evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); - evas_object_show(li); - - evas_object_data_set(win, "font_styles_list", li); - evas_object_smart_callback_add(li, "unselected", _fstyle_list_unselect_cb, - NULL); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Size"); - elm_table_pack(base, fr, 1, 2, 1, 1); - evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(fr); - - li = elm_list_add(win); - evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, li); - evas_object_show(li); - - evas_object_data_set(win, "font_sizes_list", li); - _font_sizes_list_load(li); - ELM_LIST_DISABLE(li); - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_table_pack(base, bx, 0, 3, 2, 1); - evas_object_show(bx); - - /* FIXME: what to do here? dedicated widget? some new entry API set? */ - snprintf(buf, sizeof(buf), "%s/objects/font_preview.edj", PACKAGE_DATA_DIR); - preview = elm_layout_add(win); - elm_layout_file_set(preview, buf, "font_preview"); - elm_layout_text_set(preview, "elm.text", "Preview Text — 我真的会写中文"); - evas_object_size_hint_weight_set(preview, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(preview, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(preview); - - elm_box_pack_end(bx, preview); - evas_object_data_set(win, "font_preview", elm_layout_edje_get(preview)); - - ///////////////////////////////////////////// - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, EINA_TRUE); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_table_pack(base, sp, 0, 4, 2, 1); - evas_object_show(sp); - - pd = elm_frame_add(win); - elm_object_style_set(pd, "pad_medium"); - evas_object_size_hint_weight_set(pd, 0.0, 0.0); - evas_object_size_hint_align_set(pd, 0.5, 0.5); - elm_table_pack(base, pd, 0, 5, 2, 1); - evas_object_show(pd); - - bx = elm_box_add(win); - elm_box_horizontal_set(bx, EINA_TRUE); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(bx); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _font_overlay_set_all, win); - elm_button_label_set(bt, "Set to All"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset, win); - elm_button_label_set(bt, "Reset"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset_all, win); - elm_button_label_set(bt, "Reset All"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _font_overlay_change, win); - elm_button_label_set(bt, "Apply"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(bx, bt); - evas_object_show(bt); - - elm_frame_content_set(pd, bx); - - evas_object_data_set(win, "fonts", base); - - elm_pager_content_push(pager, base); -} - -static void -_engines_list_item_del_cb(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - free(data); -} - -static void -_profiles_list_item_del_cb(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - free(data); -} - -static void -_profiles_list_selected_cb(void *data, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - const char *cur_profile = NULL; - const char *sel_profile, *pdir; - Eina_Bool cur_selected; - const char *prof_name; - char buf[PATH_MAX]; - Evas_Object *en; -#ifdef ELM_EFREET - Efreet_Desktop *desk = NULL; -#endif - - sel_profile = data; - if (!sel_profile) - return; - - cur_profile = elm_profile_current_get(); - cur_selected = !strcmp(cur_profile, sel_profile); - - pdir = elm_profile_dir_get(sel_profile, EINA_FALSE); -#ifdef ELM_EFREET - snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir); - desk = efreet_desktop_new(buf); - if ((desk) && (desk->name)) prof_name = desk->name; - else -#endif - prof_name = cur_profile; - - if (!pdir) - elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"), - EINA_TRUE); - else - { - elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"), - EINA_TRUE); - elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"), - EINA_FALSE); - elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"), - EINA_FALSE); - elm_profile_dir_free(pdir); - } - - snprintf(buf, sizeof(buf), "Selected profile: %s
", - prof_name); - elm_label_label_set(evas_object_data_get(obj, "prof_name_lbl"), buf); - - en = evas_object_data_get(obj, "prof_desc_entry"); -#ifdef ELM_EFREET - if (desk) elm_scrolled_entry_entry_set(en, desk->comment); - else -#endif - elm_scrolled_entry_entry_set(en, "Unknown"); - -#ifdef ELM_EFREET - if (desk) efreet_desktop_free(desk); -#endif -} - -static void -_profiles_list_fill(Evas_Object *l_widget, - Eina_List *p_names) -{ - const char *cur_profile = NULL; - const char *profile; - void *sel_it = NULL; - Eina_List *l; - - if (!p_names) - return; - - elm_list_clear(l_widget); - - cur_profile = elm_profile_current_get(); - - EINA_LIST_FOREACH(p_names, l, profile) - { -#ifdef ELM_EFREET - Efreet_Desktop *desk = NULL; -#endif - const char *label, *ext, *pdir; - char buf[PATH_MAX]; - Elm_List_Item *it; - Evas_Object *ic; - - pdir = elm_profile_dir_get(profile, EINA_FALSE); - label = profile; - -#ifdef ELM_EFREET - snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir); - desk = efreet_desktop_new(buf); - if ((desk) && (desk->name)) label = desk->name; -#endif - - buf[0] = 0; - if (pdir) snprintf(buf, sizeof(buf), "%s/icon.edj", pdir); -#ifdef ELM_EFREET - if ((desk) && (desk->icon) && (pdir)) - snprintf(buf, sizeof(buf), "%s/%s", pdir, desk->icon); -#endif - ic = elm_icon_add(l_widget); - ext = strrchr(buf, '.'); - if (ext) - { - if (!strcmp(ext, ".edj")) elm_icon_file_set(ic, buf, "icon"); - else elm_icon_file_set(ic, buf, NULL); - } - - evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, - 1, 1); - evas_object_show(ic); - - it = elm_list_item_append(l_widget, label, ic, NULL, - _profiles_list_selected_cb, strdup(profile)); - elm_list_item_del_cb_set(it, _profiles_list_item_del_cb); - if (cur_profile && !strcmp(profile, cur_profile)) - sel_it = it; - - elm_profile_dir_free(pdir); - -#ifdef ELM_EFREET - if (desk) efreet_desktop_free(desk); -#endif - } - - if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE); - elm_list_go(l_widget); -} - -static void -_profiles_list_unselect_cb(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) -{ - if (elm_list_selected_item_get(obj)) return; - elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"), - EINA_TRUE); - elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"), - EINA_TRUE); - elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"), - EINA_TRUE); -} - -static void -_status_config_profiles(Evas_Object *win, - Evas_Object *pager) -{ - Evas_Object *li, *bx, *fr_bx1, *fr_bx2, *btn_bx, *fr, *lb, *en, *sp, *pd, - *bt; - Eina_List *profs; - Evas *evas; - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); - - fr_bx1 = elm_box_add(win); - evas_object_size_hint_weight_set(fr_bx1, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr_bx1, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_box_homogenous_set(fr_bx1, EINA_TRUE); - evas_object_show(fr_bx1); - - fr_bx2 = elm_box_add(win); - evas_object_size_hint_weight_set(fr_bx2, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr_bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(fr_bx2); - - fr = elm_frame_add(win); - elm_frame_label_set(fr, "Available Profiles"); - evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_frame_content_set(fr, fr_bx1); - elm_box_pack_end(bx, fr); - evas_object_show(fr); - - li = elm_list_add(win); - evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_smart_callback_add(li, "unselected", _profiles_list_unselect_cb, - NULL); - - profs = elm_profile_list_get(); - - evas_object_show(li); - elm_box_pack_end(fr_bx2, li); - - lb = elm_label_add(win); - evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); - - evas_object_show(lb); - - en = elm_scrolled_entry_add(win); - elm_scrolled_entry_editable_set(en, EINA_FALSE); - evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(en); - - evas_object_data_set(li, "prof_name_lbl", lb); - evas_object_data_set(li, "prof_desc_entry", en); - - elm_box_pack_end(fr_bx2, lb); - elm_box_pack_end(fr_bx1, fr_bx2); - elm_box_pack_end(fr_bx1, en); - - ///////////////////////////////////////////// - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, EINA_TRUE); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - pd = elm_frame_add(win); - elm_object_style_set(pd, "pad_medium"); - evas_object_size_hint_weight_set(pd, 0.0, 0.0); - evas_object_size_hint_align_set(pd, 0.5, 0.5); - elm_box_pack_end(bx, pd); - evas_object_show(pd); - - btn_bx = elm_box_add(win); - elm_box_horizontal_set(btn_bx, EINA_TRUE); - evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(btn_bx); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _profile_use, li); - elm_button_label_set(bt, "Use"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(btn_bx, bt); - evas_object_show(bt); - - evas_object_data_set(li, "prof_use_btn", bt); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */ - elm_button_label_set(bt, "Delete"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(btn_bx, bt); - evas_object_show(bt); - - evas_object_data_set(li, "prof_del_btn", bt); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _profile_reset, li); - elm_button_label_set(bt, "Reset"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(btn_bx, bt); - evas_object_show(bt); - - evas_object_data_set(li, "prof_reset_btn", bt); - - bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */ - elm_button_label_set(bt, "Add new"); - evas_object_size_hint_weight_set(bt, 0.0, 0.0); - evas_object_size_hint_align_set(bt, 0.5, 0.5); - elm_box_pack_end(btn_bx, bt); - evas_object_show(bt); - - elm_frame_content_set(pd, btn_bx); - - evas = evas_object_evas_get(li); - evas_event_freeze(evas); - edje_freeze(); - - _profiles_list_fill(li, profs); - - elm_profile_list_free(profs); - - edje_thaw(); - evas_event_thaw(evas); - - evas_object_data_set(win, "profiles", bx); - elm_pager_content_push(pager, bx); -} - -static void -_status_config_scrolling(Evas_Object *win, - Evas_Object *pager) -{ - Evas_Object *lb, *pd, *bx, *sl, *sp, *ck, *sc; - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5); - - sc = elm_scroller_add(win); - evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE); - evas_object_show(sc); - elm_scroller_content_set(sc, bx); - - ck = elm_check_add(win); - elm_object_tooltip_text_set(ck, "Set whether scrollers should bounce
" - "when they reach their viewport's edge
" - "during a scroll"); - elm_check_label_set(ck, "Enable scroll bounce"); - evas_object_data_set(win, "scroll_bounce_check", ck); - evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); - elm_check_state_set(ck, elm_scroll_bounce_enabled_get()); - elm_box_pack_end(bx, ck); - evas_object_show(ck); - - evas_object_smart_callback_add(ck, "changed", sb_change, NULL); - - LABEL_FRAME_ADD("Scroll bounce friction"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the amount of inertia a
" - "scroller will impose at bounce animations"); - evas_object_data_set(win, "bounce_friction_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.2f"); - elm_slider_indicator_format_set(sl, "%1.2f"); - elm_slider_min_max_set(sl, 0.0, 4.0); - elm_slider_value_set(sl, elm_scroll_bounce_friction_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", bf_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", bf_change, NULL); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, EINA_TRUE); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - ck = elm_check_add(win); - elm_object_tooltip_text_set(ck, "Set whether scrollers should be
" - "draggable from any point in their views"); - elm_check_label_set(ck, "Enable thumb scroll"); - evas_object_data_set(win, "thumbscroll_check", ck); - evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); - elm_check_state_set(ck, elm_scroll_thumbscroll_enabled_get()); - elm_box_pack_end(bx, ck); - evas_object_show(ck); - - evas_object_smart_callback_add(ck, "changed", ts_change, NULL); - - LABEL_FRAME_ADD("Thumb scroll threshold"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the number of pixels one should
" - "travel while dragging a scroller's view
" - "to actually trigger scrolling"); - evas_object_data_set(win, "thumbscroll_threshold_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.0f pixels"); - elm_slider_indicator_format_set(sl, "%1.0f"); - elm_slider_min_max_set(sl, 8.0, 50.0); - elm_slider_value_set(sl, elm_scroll_thumbscroll_threshold_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", tst_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", tst_change, NULL); - - LABEL_FRAME_ADD("Thumb scroll momentum threshold"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse
" - "cursor movement which will trigger
" - "list self scrolling animation after a
" - "mouse up event (pixels/second)"); - evas_object_data_set(win, "ts_momentum_threshold_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.0f pixels/s"); - elm_slider_indicator_format_set(sl, "%1.0f"); - elm_slider_min_max_set(sl, 10.0, 200.0); - elm_slider_value_set(sl, elm_scroll_thumbscroll_momentum_threshold_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", tsmt_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", tsmt_change, - NULL); - - LABEL_FRAME_ADD("Thumb scroll friction"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the amount of inertia a
" - "scroller will impose at self scrolling
" - "animations"); - evas_object_data_set(win, "thumbscroll_friction_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.1f"); - elm_slider_indicator_format_set(sl, "%1.1f"); - elm_slider_min_max_set(sl, 0.0, 15.0); - elm_slider_value_set(sl, elm_scroll_thumbscroll_friction_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", tsf_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", tsf_change, NULL); - - LABEL_FRAME_ADD("Thumb scroll border friction"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the amount of lag between your
" - "actual mouse cursor dragging movement
" - "and a scroller's view movement itself,
" - "while pushing it into bounce state
" - "manually"); - evas_object_data_set(win, "ts_border_friction_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.2f"); - elm_slider_indicator_format_set(sl, "%1.2f"); - elm_slider_min_max_set(sl, 0.0, 1.0); - elm_slider_value_set(sl, elm_scroll_thumbscroll_border_friction_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", tsbf_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", tsbf_change, NULL); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, EINA_TRUE); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - LABEL_FRAME_ADD("Page scroll friction"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the amount of inertia a
" - "paged scroller will impose at
" - "page fitting animations"); - evas_object_data_set(win, "page_scroll_friction_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.1f"); - elm_slider_indicator_format_set(sl, "%1.1f"); - elm_slider_min_max_set(sl, 0.0, 5.0); - elm_slider_value_set(sl, elm_scroll_page_scroll_friction_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", ps_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", ps_change, NULL); - - LABEL_FRAME_ADD("Bring in scroll friction"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the amount of inertia a
" - "scroller will impose at region bring
" - "animations"); - evas_object_data_set(win, "bring_in_scroll_friction_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.1f"); - elm_slider_indicator_format_set(sl, "%1.1f"); - elm_slider_min_max_set(sl, 0.0, 5.0); - elm_slider_value_set(sl, elm_scroll_bring_in_scroll_friction_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", bis_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", bis_change, NULL); - - LABEL_FRAME_ADD("Zoom scroll friction"); - - sl = elm_slider_add(win); - elm_object_tooltip_text_set(sl, "This is the amount of inertia
" - "scrollers will impose at animations
" - "triggered by Elementary widgets'
" - "zooming API"); - evas_object_data_set(win, "zoom_scroll_friction_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.1f"); - elm_slider_indicator_format_set(sl, "%1.1f"); - elm_slider_min_max_set(sl, 0.0, 5.0); - elm_slider_value_set(sl, elm_scroll_zoom_friction_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", zf_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", zf_change, NULL); - - evas_object_data_set(win, "scrolling", sc); - - elm_pager_content_push(pager, sc); -} - -static char * -_engine_name_prettify(const char *engine) -{ - char *ret, *ptr; - - ret = strdup(engine); - ret[0] -= 0x20; - - while ((ptr = strpbrk(ret, "_"))) - { - *ptr = ' '; - } - - return ret; -} - -/* FIXME! ideally, we would trim elm_config.c's _elm_engines list at - build time, making a getter for is as in ecore-evas. */ -static Eina_Bool -_elm_engine_supported(const char *engine) -{ - const char *engines[] = { - "software_x11", - "fb", - "directfb", - "software_16_x11", - "software_8_x11", - "xrender_x11", - "opengl_x11", - "software_gdi", - "software_16_wince_gdi", - "sdl", - "software_16_sdl", - "opengl_sdl", - NULL - }; - - unsigned int i; - - for (i = 0; engines[i]; i++) - { -#define ENGINE_COMPARE(name) (!strcmp(engines[i], name)) - if (ENGINE_COMPARE(engine)) - return EINA_TRUE; -#undef ENGINE_COMPARE - } - - return EINA_FALSE; -} - -static void -_engines_list_fill(Evas_Object *l_widget, - Eina_List *e_names) -{ - const char *engine, *cur_engine; - void *sel_it = NULL; - Eina_List *l; - - if (!e_names) - return; - - cur_engine = elm_engine_current_get(); - - EINA_LIST_FOREACH(e_names, l, engine) - { - const char *label; - Elm_List_Item *it; - - if (!_elm_engine_supported(engine)) - continue; - - label = _engine_name_prettify(engine); - - it = elm_list_item_append(l_widget, label, NULL, NULL, NULL, - strdup(engine)); - elm_list_item_del_cb_set(it, _engines_list_item_del_cb); - free((void *)label); - - if (!strcmp(cur_engine, engine)) - sel_it = it; - } - - if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE); - elm_list_go(l_widget); + evas_object_data_set(win, "sizing", bx2); + + elm_table_pack(holder, bx2, 0, 0, 1, 1); } -static void -_status_config_rendering(Evas_Object *win, - Evas_Object *pager) +static Evas_Object * +_sample_theme_new(Evas_Object *win) { - Evas_Object *li, *bx, *fr, *sp, *pd, *bt; - Eina_List *engines; + Evas_Object *base, *bg, *bt, *ck, *rd, *rdg, *sl, *fr, *li, *rc, *sp; + + base = elm_table_add(win); + evas_object_size_hint_weight_set(base, 1.0, 1.0); + evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL); + + bg = elm_bg_add(win); + evas_object_size_hint_weight_set(bg, 1.0, 1.0); + evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(base, bg, 0, 0, 2, 4); + evas_object_show(bg); + + bt = elm_button_add(win); + elm_button_label_set(bt, "Button"); + elm_table_pack(base, bt, 0, 0, 1, 1); + evas_object_show(bt); - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); + ck = elm_check_add(win); + elm_check_label_set(ck, "Check"); + elm_table_pack(base, ck, 0, 1, 1, 1); + evas_object_show(ck); + + rd = elm_radio_add(win); + elm_radio_state_value_set(rd, 0); + elm_radio_label_set(rd, "Radio 1"); + elm_table_pack(base, rd, 1, 0, 1, 1); + evas_object_show(rd); + rdg = rd; + + rd = elm_radio_add(win); + elm_radio_state_value_set(rd, 1); + elm_radio_label_set(rd, "Radio 2"); + elm_radio_group_add(rd, rdg); + elm_table_pack(base, rd, 1, 1, 1, 1); + evas_object_show(rd); + + sp = elm_separator_add(win); + elm_separator_horizontal_set(sp, 1); + evas_object_size_hint_weight_set(sp, 1.0, 0.0); + evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); + elm_table_pack(base, sp, 0, 2, 2, 1); + evas_object_show(sp); + + sl = elm_slider_add(win); + elm_slider_label_set(sl, "Slider"); + elm_slider_span_size_set(sl, 120); + elm_slider_min_max_set(sl, 1, 10); + elm_slider_value_set(sl, 4); + evas_object_size_hint_weight_set(sl, 1.0, 0.0); + evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(base, sl, 0, 3, 2, 1); + evas_object_show(sl); fr = elm_frame_add(win); - elm_frame_label_set(fr, "Available Engines"); - evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_frame_label_set(fr, "Frame"); + elm_table_pack(base, fr, 0, 4, 2, 1); + evas_object_size_hint_weight_set(fr, 1.0, 1.0); evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_box_pack_end(bx, fr); evas_object_show(fr); - + li = elm_list_add(win); - elm_frame_content_set(fr, li); - evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_weight_set(li, 1.0, 1.0); evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_frame_content_set(fr, li); + evas_object_show(li); + + elm_list_item_append(li, "List Item 1", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "Second Item", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "Third Item", NULL, NULL, NULL, NULL); + elm_list_go(li); + + rc = evas_object_rectangle_add(evas_object_evas_get(win)); + evas_object_size_hint_min_set(rc, 120, 120); + elm_table_pack(base, rc, 0, 4, 2, 1); + + return base; +} - engines = ecore_evas_engines_get(); - _engines_list_fill(li, engines); - ecore_evas_engines_free(engines); +static void +_status_config_themes(Evas_Object *win, Evas_Object *holder) +{ + Evas_Object *tb, *rc, *sc, *sp, *li, *pd, *fr, *bt, *sample; + + tb = elm_table_add(win); + evas_object_size_hint_weight_set(tb, 1.0, 1.0); + evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); + + rc = evas_object_rectangle_add(evas_object_evas_get(win)); + evas_object_size_hint_min_set(rc, 240, 120); + elm_table_pack(tb, rc, 0, 0, 1, 1); + rc = evas_object_rectangle_add(evas_object_evas_get(win)); + evas_object_size_hint_min_set(rc, 240, 240); + elm_table_pack(tb, rc, 0, 1, 1, 1); + + ///////////////////////////////////////////// + + pd = elm_frame_add(win); + elm_object_style_set(pd, "pad_medium"); + evas_object_size_hint_weight_set(pd, 1.0, 1.0); + evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(tb, pd, 0, 0, 1, 1); + evas_object_show(pd); + + li = elm_list_add(win); + evas_object_size_hint_weight_set(li, 1.0, 1.0); + evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_frame_content_set(pd, li); evas_object_show(li); - evas_object_data_set(win, "engines_list", li); + + // FIXME: list all themes: + // ~/.elementary/themes/*.edj + // $PREFIX/datadir/themes/*.edj + + elm_list_item_append(li, "theme 1", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "theme 2", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "theme 3", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "theme 4", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "theme 5", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "theme 6", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "theme 7", NULL, NULL, NULL, NULL); + + elm_list_go(li); + + pd = elm_frame_add(win); + elm_object_style_set(pd, "pad_medium"); + evas_object_size_hint_weight_set(pd, 1.0, 1.0); + evas_object_size_hint_align_set(pd, 0.9, 0.9); + elm_table_pack(tb, pd, 0, 0, 1, 1); + evas_object_show(pd); + + bt = elm_button_add(win); + evas_object_smart_callback_add(bt, "clicked", _theme_browse, win); + elm_button_label_set(bt, "Browse..."); + evas_object_size_hint_weight_set(bt, 1.0, 1.0); + evas_object_size_hint_align_set(bt, 0.9, 0.9); + elm_frame_content_set(pd, bt); + evas_object_show(bt); + + pd = elm_frame_add(win); + elm_object_style_set(pd, "pad_medium"); + evas_object_size_hint_weight_set(pd, 1.0, 0.0); + evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(tb, pd, 0, 1, 1, 1); + evas_object_show(pd); + fr = elm_frame_add(win); + elm_frame_label_set(fr, "Preview"); + evas_object_size_hint_weight_set(fr, 1.0, 1.0); + evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_frame_content_set(pd, fr); + evas_object_show(fr); + + sc = elm_scroller_add(win); + elm_scroller_bounce_set(sc, 0, 0); + evas_object_size_hint_weight_set(sc, 1.0, 1.0); + evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_frame_content_set(fr, sc); + evas_object_show(sc); + + sample = _sample_theme_new(win); + elm_scroller_content_set(sc, sample); + evas_object_show(sample); + evas_object_data_set(win, "sample", sample); + ///////////////////////////////////////////// sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, EINA_TRUE); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); + elm_separator_horizontal_set(sp, 1); + evas_object_size_hint_weight_set(sp, 1.0, 0.0); evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); + elm_table_pack(tb, sp, 0, 2, 1, 1); evas_object_show(sp); - + pd = elm_frame_add(win); elm_object_style_set(pd, "pad_medium"); evas_object_size_hint_weight_set(pd, 0.0, 0.0); evas_object_size_hint_align_set(pd, 0.5, 0.5); - elm_box_pack_end(bx, pd); + elm_table_pack(tb, pd, 0, 3, 1, 1); evas_object_show(pd); - + bt = elm_button_add(win); - evas_object_smart_callback_add(bt, "clicked", _engine_use, li); - elm_button_label_set(bt, "Use Engine"); + evas_object_smart_callback_add(bt, "clicked", _theme_use, win); + elm_button_label_set(bt, "Use Theme"); evas_object_size_hint_weight_set(bt, 0.0, 0.0); evas_object_size_hint_align_set(bt, 0.5, 0.5); elm_frame_content_set(pd, bt); evas_object_show(bt); - - evas_object_data_set(win, "rendering", bx); - elm_pager_content_push(pager, bx); + + evas_object_data_set(win, "themes", tb); + + elm_table_pack(holder, tb, 0, 0, 1, 1); } static void -_status_config_caches(Evas_Object *win, - Evas_Object *pager) +_unimplemented(Evas_Object *win, Evas_Object *holder, const char *name) { - Evas_Object *lb, *pd, *bx, *sl, *sp, *ck; - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5); - - LABEL_FRAME_ADD("Cache Flush Interval (8 ticks pre second)"); - - sl = elm_slider_add(win); - evas_object_data_set(win, "cache_flush_interval_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.0f ticks"); - elm_slider_indicator_format_set(sl, "%1.0f"); - elm_slider_min_max_set(sl, 8.0, 4096.0); - elm_slider_value_set(sl, elm_cache_flush_interval_get()); - elm_object_disabled_set(sl, !elm_cache_flush_enmabled_get()); - - ck = elm_check_add(win); - evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); - elm_check_label_set(ck, "Enable Flushing"); - elm_check_state_set(ck, elm_cache_flush_enmabled_get()); - evas_object_smart_callback_add(ck, "changed", cf_enable, sl); - elm_box_pack_end(bx, ck); - evas_object_show(ck); + Evas_Object *lb, *pd, *bx2; - elm_box_pack_end(bx, sl); - evas_object_show(sl); + bx2 = elm_box_add(win); + evas_object_size_hint_weight_set(bx2, 1.0, 0.0); + evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, 0.5); - evas_object_smart_callback_add(sl, "changed", cf_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", cf_change, NULL); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - LABEL_FRAME_ADD("Font Cache Size"); - - sl = elm_slider_add(win); - evas_object_data_set(win, "font_cache_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.1f MB"); - elm_slider_indicator_format_set(sl, "%1.1f"); - elm_slider_min_max_set(sl, 0.0, 4.0); - elm_slider_value_set(sl, (double)elm_font_cache_get() / 1024.0); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", fc_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", fc_change, NULL); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - LABEL_FRAME_ADD("Image Cache Size"); - - sl = elm_slider_add(win); - evas_object_data_set(win, "image_cache_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.0f MB"); - elm_slider_indicator_format_set(sl, "%1.0f"); - elm_slider_min_max_set(sl, 0, 32); - elm_slider_value_set(sl, (double)elm_image_cache_get() / 1024.0); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", ic_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", ic_change, NULL); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - LABEL_FRAME_ADD("Number of Edje Files to Cache"); - - sl = elm_slider_add(win); - evas_object_data_set(win, "edje_file_cache_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.0f files"); - elm_slider_indicator_format_set(sl, "%1.0f"); - elm_slider_min_max_set(sl, 0, 32); - elm_slider_value_set(sl, elm_edje_file_cache_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); - - evas_object_smart_callback_add(sl, "changed", efc_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", efc_change, NULL); - - sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, sp); - evas_object_show(sp); - - LABEL_FRAME_ADD("Number of Edje Collections to Cache"); + pd = elm_frame_add(win); + evas_object_size_hint_weight_set(pd, 0.0, 0.0); + evas_object_size_hint_align_set(pd, 0.5, 0.5); + elm_object_style_set(pd, "pad_medium"); + elm_box_pack_end(bx2, pd); + evas_object_show(pd); + + lb = elm_label_add(win); + evas_object_size_hint_weight_set(lb, 0.0, 0.0); + evas_object_size_hint_align_set(lb, 0.5, 0.5); + elm_label_label_set(lb,"Not implemented yet"); + elm_frame_content_set(pd, lb); + evas_object_show(lb); + + evas_object_data_set(win, name, bx2); + + elm_table_pack(holder, bx2, 0, 0, 1, 1); +} - sl = elm_slider_add(win); - evas_object_data_set(win, "edje_collection_cache_slider", sl); - evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); - elm_slider_span_size_set(sl, 120); - elm_slider_unit_format_set(sl, "%1.0f collections"); - elm_slider_indicator_format_set(sl, "%1.0f"); - elm_slider_min_max_set(sl, 0, 128); - elm_slider_value_set(sl, elm_edje_collection_cache_get()); - elm_box_pack_end(bx, sl); - evas_object_show(sl); +static void +_status_config_fonts(Evas_Object *win, Evas_Object *holder) +{ + _unimplemented(win, holder, "fonts"); +} - evas_object_smart_callback_add(sl, "changed", ecc_round, NULL); - evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL); +static void +_status_config_profiles(Evas_Object *win, Evas_Object *holder) +{ + _unimplemented(win, holder, "profiles"); +} - evas_object_data_set(win, "caches", bx); +static void +_status_config_scrolling(Evas_Object *win, Evas_Object *holder) +{ + _unimplemented(win, holder, "scrolling"); +} - elm_pager_content_push(pager, bx); +static void +_status_config_rendering(Evas_Object *win, Evas_Object *holder) +{ + _unimplemented(win, holder, "rendering"); } static void -_status_config_full(Evas_Object *win, - Evas_Object *bx0) +_status_config_caches(Evas_Object *win, Evas_Object *holder) { - Evas_Object *tb, *pager; - Elm_Toolbar_Item *sizing, *it; + _unimplemented(win, holder, "caches"); +} +static void +_status_config_full(Evas_Object *win, Evas_Object *bx0) +{ + Evas_Object *tb, *holder, *fl; + Elm_Toolbar_Item *it; + tb = elm_toolbar_add(win); - elm_toolbar_menu_parent_set(tb, win); elm_toolbar_homogenous_set(tb, 0); evas_object_size_hint_weight_set(tb, 1.0, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); - sizing = elm_toolbar_item_append(tb, "zoom-fit-best", "Sizing", - _cf_sizing, win); - elm_toolbar_item_priority_set(sizing, 100); - - it = elm_toolbar_item_append(tb, "preferences-desktop-theme", "Theme", - _cf_themes, win); - elm_toolbar_item_priority_set(it, 90); - - elm_toolbar_item_append(tb, "preferences-desktop-font", "Fonts", - _cf_fonts, win); - - it = elm_toolbar_item_append(tb, "system-users", "Profiles", - _cf_profiles, win); - elm_toolbar_item_priority_set(it, 90); - - elm_toolbar_item_append(tb, "system-run", "Scrolling", _cf_scrolling, win); - elm_toolbar_item_append(tb, "video-display", "Rendering", - _cf_rendering, win); - elm_toolbar_item_append(tb, "appointment-new", "Caches", _cf_caches, win); - + it = elm_toolbar_item_add(tb, NULL, "Sizing", _cf_sizing, win); + elm_toolbar_item_add(tb, NULL, "Theme", _cf_themes, win); + + elm_toolbar_item_add(tb, NULL, "Fonts", _cf_fonts, win); + elm_toolbar_item_add(tb, NULL, "Profiles", _cf_profiles, win); + elm_toolbar_item_add(tb, NULL, "Scrolling", _cf_scrolling, win); + elm_toolbar_item_add(tb, NULL, "Rendering", _cf_rendering, win); + elm_toolbar_item_add(tb, NULL, "Caches", _cf_caches, win); elm_box_pack_end(bx0, tb); evas_object_show(tb); - - pager = elm_pager_add(win); - evas_object_size_hint_align_set(pager, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(pager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_data_set(win, "pager", pager); - - _status_config_themes(win, pager); - _status_config_fonts(win, pager); - _status_config_profiles(win, pager); - _status_config_rendering(win, pager); - _status_config_scrolling(win, pager); - _status_config_caches(win, pager); - _status_config_sizing(win, pager); - - // FIXME uncomment after flip style fix, please - //elm_object_style_set(pager, "flip"); - elm_toolbar_item_selected_set(sizing, EINA_TRUE); - elm_box_pack_end(bx0, pager); - evas_object_show(pager); + + holder = elm_table_add(win); + evas_object_size_hint_align_set(holder, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(holder, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(bx0, holder); + evas_object_show(holder); + evas_object_data_set(win, "holder", holder); + + _status_config_sizing(win, holder); + _status_config_themes(win, holder); + _status_config_fonts(win, holder); + _status_config_profiles(win, holder); + _status_config_rendering(win, holder); + _status_config_scrolling(win, holder); + _status_config_caches(win, holder); + + fl = elm_flip_add(win); + evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_table_pack(holder, fl, 0, 0, 1, 1); + evas_object_show(fl); + evas_object_data_set(win, "flip", fl); + + elm_toolbar_item_select(it); } static void @@ -2906,7 +633,7 @@ status_win(void) win = elm_win_add(NULL, "main", ELM_WIN_BASIC); elm_win_title_set(win, "Elementary Config"); - evas_object_smart_callback_add(win, "delete,request", config_exit, NULL); + evas_object_smart_callback_add(win, "delete,request", my_win_del, NULL); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, 1.0, 1.0); elm_win_resize_object_add(win, bg); @@ -2918,30 +645,27 @@ status_win(void) evas_object_show(bx0); if (!interactive) _status_basic(win, bx0); - else if (0) - _status_config(win, bx0); +// else _status_config(win, bx0); else _status_config_full(win, bx0); - - evas_object_resize(win, 320, 480); + evas_object_show(win); } static Eina_Bool -_exit_timer(void *data __UNUSED__) +_exit_timer(void *data) { elm_exit(); return ECORE_CALLBACK_CANCEL; } -/* this is your elementary main function - it MUST be called IMMEDIATELY - * after elm_init() and MUST be passed argc and argv, and MUST be called +/* this is your elementary main function - it MUSt be called IMMEDIATELY + * after elm_init() and MUSt be passed argc and argv, and MUST be called * elm_main and not be static - must be a visible symbol with EAPI infront */ EAPI int -elm_main(int argc, - char **argv) +elm_main(int argc, char **argv) { int i; - + for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-h")) @@ -2978,12 +702,9 @@ elm_main(int argc, interactive = 0; } } - /* put here any init code specific to this app like parsing args, etc. */ + /* put here any init specific to this app like parsing args etc. */ if (!quiet) { -#ifdef ELM_EFREET - elm_need_efreet(); -#endif status_win(); /* create main window */ if (!interactive) ecore_timer_add(2.0, _exit_timer, NULL); @@ -3007,13 +728,12 @@ elm_main(int argc, elm_exit(); } } - elm_run(); /* and run the program now and handle all events, etc. */ - /* if the mainloop that elm_run() runs exists, we exit the app */ + elm_run(); /* and run the program now and handle all events etc. */ + /* if the mainloop that elm_run() runs exist - we exit the app */ elm_shutdown(); /* clean up and shut down */ /* exit code */ return 0; } - #endif -/* All emelentary apps should use this. Put it right after elm_main() */ +/* all emeentary apps should use this. but it right after elm_main() */ ELM_MAIN() diff --git a/src/bin/test.c b/src/bin/test.c index dcc6f32..44c5c8f 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -41,8 +41,6 @@ void test_genlist4(void *data, Evas_Object *obj, void *event_info); void test_genlist5(void *data, Evas_Object *obj, void *event_info); void test_genlist6(void *data, Evas_Object *obj, void *event_info); void test_genlist7(void *data, Evas_Object *obj, void *event_info); -void test_genlist8(void *data, Evas_Object *obj, void *event_info); -void test_genlist9(void *data, Evas_Object *obj, void *event_info); void test_table(void *data, Evas_Object *obj, void *event_info); void test_gengrid(void *data, Evas_Object *obj, void *event_info); void test_pager(void *data, Evas_Object *obj, void *event_info); @@ -81,7 +79,6 @@ void test_launcher(void *data, Evas_Object *obj, void *event_info); void test_launcher2(void *data, Evas_Object *obj, void *event_info); void test_launcher3(void *data, Evas_Object *obj, void *event_info); void test_anim(void *data, Evas_Object *obj, void *event_info); -void test_diskselector(void *data, Evas_Object *obj, void *event_info); struct elm_test { @@ -241,8 +238,6 @@ my_win_main(void) ADD_TEST("Genlist 5", test_genlist5); ADD_TEST("Genlist 7", test_genlist7); ADD_TEST("Genlist Tree", test_genlist6); - ADD_TEST("Genlist Group", test_genlist8); - ADD_TEST("Genlist Group Tree", test_genlist9); ADD_TEST("GenGrid", test_gengrid); ADD_TEST("Checks", test_check); ADD_TEST("Radios", test_radio); @@ -282,7 +277,6 @@ my_win_main(void) ADD_TEST("Animation", test_anim); ADD_TEST("Calendar", test_calendar); ADD_TEST("Calendar 2", test_calendar2); - ADD_TEST("Disk Selector", test_diskselector); #undef ADD_TEST if (tests) diff --git a/src/bin/test_button.c b/src/bin/test_button.c index caf9a05..ea07666 100644 --- a/src/bin/test_button.c +++ b/src/bin/test_button.c @@ -1,40 +1,21 @@ #include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif #ifndef ELM_LIB_QUICKLAUNCH static void -_bt_repeated(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) -{ - static int count; - char buf[16]; - - snprintf(buf, sizeof(buf), "count=%d", count++); - if (count >= 10000) - count = 0; - elm_button_label_set(obj, buf); -} - -static void -_bt_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - int param = (int)(data); - - printf("clicked event on Button:%d\n", param); -} - -static void -_bt_unpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_bt_repeated(void *data, Evas_Object *obj, void *event_info) { - int param = (int)(data); + static int count; + char buf[16]; - printf("unpressed event on Button:%d\n", param); + snprintf(buf, sizeof(buf), "count=%d", count++); + if (count >= 10000) + count = 0; + elm_button_label_set(obj, buf); } void -test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_button(void *data, Evas_Object *obj, void *event_info) { - Evas_Object *win, *bg, *scr, *bx, *ic, *bt; + Evas_Object *win, *bg, *bx, *ic, *bt; char buf[PATH_MAX]; win = elm_win_add(NULL, "buttons", ELM_WIN_BASIC); @@ -46,16 +27,9 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); - scr = elm_scroller_add(win); - elm_scroller_bounce_set(scr, EINA_FALSE, EINA_TRUE); - elm_scroller_policy_set(scr, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - elm_win_resize_object_add(win, scr); - evas_object_show(scr); - evas_object_size_hint_weight_set(scr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_scroller_content_set(scr, bx); + elm_win_resize_object_add(win, bx); evas_object_show(bx); ic = elm_icon_add(win); @@ -65,21 +39,17 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info bt = elm_button_add(win); elm_button_label_set(bt, "Icon sized to button"); elm_button_icon_set(bt, ic); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)1); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)1); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); - ic = elm_icon_add(bx); + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_icon_scale_set(ic, 0, 0); bt = elm_button_add(win); elm_button_label_set(bt, "Icon no scale"); elm_button_icon_set(bt, ic); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)2); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)2); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); @@ -92,8 +62,6 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_button_label_set(bt, "Disabled Button"); elm_button_icon_set(bt, ic); elm_object_disabled_set(bt, 1); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)3); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)3); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); @@ -105,16 +73,12 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info bt = elm_button_add(win); elm_button_icon_set(bt, ic); elm_object_disabled_set(bt, 1); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)4); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)4); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); bt = elm_button_add(win); elm_button_label_set(bt, "Label Only"); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)5); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)5); elm_box_pack_end(bx, bt); evas_object_smart_callback_add(bt, "repeated", _bt_repeated, NULL); elm_button_autorepeat_set(bt, 1); @@ -128,17 +92,14 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_icon_scale_set(ic, 0, 0); bt = elm_button_add(win); elm_button_icon_set(bt, ic); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)6); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)6); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); + bt = elm_button_add(win); elm_object_style_set(bt, "anchor"); elm_button_label_set(bt, "Anchor style"); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)7); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)7); elm_box_pack_end(bx, bt); evas_object_show(bt); @@ -149,12 +110,11 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info bt = elm_button_add(win); elm_object_style_set(bt, "anchor"); elm_button_icon_set(bt, ic); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)8); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)8); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -163,12 +123,10 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_object_style_set(bt, "anchor"); elm_button_icon_set(bt, ic); elm_object_disabled_set(bt, 1); - evas_object_smart_callback_add(bt, "clicked", _bt_clicked, (void *)9); - evas_object_smart_callback_add(bt, "unpressed", _bt_unpressed, (void *)9); elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); - evas_object_resize(win, 320, 480); + evas_object_show(win); } #endif diff --git a/src/bin/test_diskselector.c b/src/bin/test_diskselector.c deleted file mode 100644 index 9312c2b..0000000 --- a/src/bin/test_diskselector.c +++ /dev/null @@ -1,131 +0,0 @@ -#include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif -#ifndef ELM_LIB_QUICKLAUNCH - -static void -_disk_sel(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *event_info) -{ - Elm_Diskselector_Item *it = event_info; - printf("Equinox: %s\n", elm_diskselector_item_label_get(it)); -} - -static void -_disk_next(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *event_info) -{ - Elm_Diskselector_Item *next, *prev, *it = event_info; - prev = elm_diskselector_item_prev_get(it); - next = elm_diskselector_item_next_get(it); - printf("Prev: %s, Next: %s\n", elm_diskselector_item_label_get(prev), - elm_diskselector_item_label_get(next)); -} - -static void -_print_disk_info_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Diskselector_Item *it = event_info; - printf("Selected label: %s\n", elm_diskselector_item_label_get(it)); -} - -static Evas_Object * -_disk_create(Evas_Object *win, Eina_Bool round) -{ - Elm_Diskselector_Item *it; - Evas_Object *di; - - di = elm_diskselector_add(win); - - elm_diskselector_item_append(di, "January", NULL, NULL, NULL); - elm_diskselector_item_append(di, "February", NULL, _disk_next, NULL); - elm_diskselector_item_append(di, "March", NULL, _disk_sel, NULL); - elm_diskselector_item_append(di, "April", NULL, NULL, NULL); - elm_diskselector_item_append(di, "May", NULL, NULL, NULL); - elm_diskselector_item_append(di, "June", NULL, NULL, NULL); - elm_diskselector_item_append(di, "July", NULL, NULL, NULL); - it = elm_diskselector_item_append(di, "August", NULL, NULL, NULL); - elm_diskselector_item_append(di, "September", NULL, _disk_sel, NULL); - elm_diskselector_item_append(di, "October", NULL, NULL, NULL); - elm_diskselector_item_append(di, "November", NULL, NULL, NULL); - elm_diskselector_item_append(di, "December", NULL, NULL, NULL); - - elm_diskselector_item_selected_set(it, EINA_TRUE); - elm_diskselector_round_set(di, round); - - return di; -} - -void -test_diskselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *bx, *disk, *ic; - Elm_Diskselector_Item *it; - char buf[PATH_MAX]; - - win = elm_win_add(NULL, "diskselector", ELM_WIN_BASIC); - elm_win_title_set(win, "Disk Selector"); - elm_win_autodel_set(win, 1); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(bg); - - bx = elm_box_add(win); - elm_win_resize_object_add(win, bx); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(bx); - - disk = _disk_create(win, EINA_TRUE); - evas_object_size_hint_weight_set(disk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(disk, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, disk); - evas_object_show(disk); - evas_object_smart_callback_add(disk, "selected", _print_disk_info_cb, NULL); - it = elm_diskselector_selected_item_get(disk); - elm_diskselector_item_selected_set(it, EINA_FALSE); - - disk = _disk_create(win, EINA_FALSE); - evas_object_size_hint_weight_set(disk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(disk, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, disk); - evas_object_show(disk); - evas_object_smart_callback_add(disk, "selected", _print_disk_info_cb, NULL); - it = elm_diskselector_first_item_get(disk); - it = elm_diskselector_item_next_get(it); - elm_diskselector_item_selected_set(it, EINA_TRUE); - - disk = _disk_create(win, EINA_FALSE); - evas_object_size_hint_weight_set(disk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(disk, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, disk); - evas_object_show(disk); - evas_object_smart_callback_add(disk, "selected", _print_disk_info_cb, NULL); - elm_diskselector_side_label_lenght_set(disk, 4); - - disk = elm_diskselector_add(win); - ic = elm_icon_add(win); - snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); - elm_icon_file_set(ic, buf, NULL); - elm_icon_scale_set(ic, 1, 1); - elm_diskselector_item_append(disk, "Sunday", ic, NULL, NULL); - elm_diskselector_item_append(disk, "Monday", NULL, NULL, NULL); - elm_diskselector_item_append(disk, "Tuesday", NULL, NULL, NULL); - elm_diskselector_item_append(disk, "Wednesday", NULL, NULL, NULL); - elm_diskselector_item_append(disk, "Thursday", NULL, NULL, NULL); - elm_diskselector_item_append(disk, "Friday", NULL, NULL, NULL); - elm_diskselector_item_append(disk, "Saturday", NULL, NULL, NULL); - elm_diskselector_round_set(disk, EINA_TRUE); - evas_object_size_hint_weight_set(disk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(disk, EVAS_HINT_FILL, 0.5); - elm_box_pack_end(bx, disk); - evas_object_show(disk); - evas_object_smart_callback_add(disk, "selected", _print_disk_info_cb, NULL); - - evas_object_resize(win, 320, 480); - evas_object_show(win); -} - -#endif diff --git a/src/bin/test_flip.c b/src/bin/test_flip.c index 74f850f..6ce92a3 100644 --- a/src/bin/test_flip.c +++ b/src/bin/test_flip.c @@ -1,74 +1,68 @@ #include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif #ifndef ELM_LIB_QUICKLAUNCH void -my_fl_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_1(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_Y_CENTER_AXIS); } void -my_fl_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_2(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_X_CENTER_AXIS); } void -my_fl_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_3(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_XZ_CENTER_AXIS); } void -my_fl_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_4(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_YZ_CENTER_AXIS); } void -my_fl_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_5(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_LEFT); } void -my_fl_6(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_6(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_RIGHT); } void -my_fl_7(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_7(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_UP); } - void -my_fl_8(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_fl_8(void *data, Evas_Object *obj, void *event_info) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_DOWN); } - void -test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_flip(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *ly; char buf[PATH_MAX]; win = elm_win_add(NULL, "flip", ELM_WIN_BASIC); elm_win_title_set(win, "Flip"); - elm_win_focus_highlight_enabled_set(win, EINA_TRUE); elm_win_autodel_set(win, 1); bg = elm_bg_add(win); @@ -158,12 +152,10 @@ test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _ elm_box_pack_end(bx, bx2); evas_object_show(bx2); - bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0); - bt = elm_button_add(win); elm_button_label_set(bt, "5"); evas_object_smart_callback_add(bt, "clicked", my_fl_5, fl); @@ -179,7 +171,6 @@ test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - bt = elm_button_add(win); elm_button_label_set(bt, "7"); evas_object_smart_callback_add(bt, "clicked", my_fl_7, fl); @@ -187,7 +178,6 @@ test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - bt = elm_button_add(win); elm_button_label_set(bt, "8"); evas_object_smart_callback_add(bt, "clicked", my_fl_8, fl); @@ -204,9 +194,9 @@ test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _ } void -test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_flip2(void *data, Evas_Object *obj, void *event_info) { - Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *tb, *li, *en; + Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *tb, *ic, *li; char buf[PATH_MAX]; win = elm_win_add(NULL, "flip2", ELM_WIN_BASIC); @@ -239,10 +229,25 @@ test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(tb, 0.0, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); - elm_toolbar_item_append(tb, "arrow_left", "Hello", NULL, NULL); - elm_toolbar_item_append(tb, "arrow_right", "Out", NULL, NULL); - elm_toolbar_item_append(tb, "home", "There", NULL, NULL); - elm_toolbar_item_append(tb, "refresh", "World", NULL, NULL); + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "Hello", NULL, NULL); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "Out", NULL, NULL); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "There", NULL, NULL); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "World", NULL, NULL); elm_box_pack_end(o, tb); evas_object_show(tb); @@ -269,46 +274,19 @@ test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_flip_content_front_set(fl, o); evas_object_show(o); - - en = elm_scrolled_entry_add(win); - elm_scrolled_entry_line_wrap_set(en, EINA_FALSE); - snprintf(buf, sizeof(buf), - "This is an entry widget in this window that
" - "uses markup like this for styling and
" - "formatting like this, as well as
" - "links in the text, so enter text
" - "in here to edit it. By the way, links are
" - "called Anchors so you will need
" - "to refer to them this way.
" - "
" - - "Also you can stick in items with (relsize + ascent): " - "" - " (full) " - "" - " (to the left)
" - - "Also (size + ascent): " - "" - " (full) " - "" - " (before this)
" - - "And as well (absize + ascent): " - "" - " (full) " - "" - " or even paths to image files on disk too like: " - "" - " ... end." - , PACKAGE_DATA_DIR - ); - elm_scrolled_entry_entry_set(en, buf); - evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_flip_content_back_set(fl, en); - evas_object_show(en); + + li = elm_list_add(win); + evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_list_item_append(li, "This is a list", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "Second item", NULL, NULL, NULL, NULL); + elm_list_item_append(li, "3rd", NULL, NULL, NULL, NULL); + + elm_list_go(li); + + elm_flip_content_back_set(fl, li); + evas_object_show(li); evas_object_show(fl); @@ -373,7 +351,7 @@ test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info } void -test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_flip3(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bx2, *fl, *fl_f, *fl_b, *o, *bt, *fr; char buf[PATH_MAX]; @@ -404,13 +382,13 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_flip_content_front_set(fl, fr); evas_object_show(fr); - + fl_f = elm_flip_add(win); evas_object_size_hint_align_set(fl_f, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(fl_f, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_frame_content_set(fr, fl_f); evas_object_show(fl_f); - + o = elm_bg_add(win); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -419,6 +397,9 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_flip_content_front_set(fl_f, o); evas_object_show(o); + + + o = elm_bg_add(win); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -429,17 +410,21 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info fr = elm_frame_add(win); elm_frame_label_set(fr, "Back"); + + + evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_flip_content_back_set(fl, fr); + evas_object_show(fr); - + fl_b = elm_flip_add(win); evas_object_size_hint_align_set(fl_b, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(fl_b, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_frame_content_set(fr, fl_b); evas_object_show(fl_b); - + o = elm_bg_add(win); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -448,6 +433,9 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_flip_content_front_set(fl_b, o); evas_object_show(o); + + + o = elm_bg_add(win); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -456,6 +444,12 @@ test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_flip_content_back_set(fl_b, o); evas_object_show(o); + + + + + + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c index 95b9f14..30d7063 100644 --- a/src/bin/test_genlist.c +++ b/src/bin/test_genlist.c @@ -222,14 +222,12 @@ my_gl_insert_before(void *data, Evas_Object *obj, void *event_info) return ; } - elm_genlist_item_insert_before(gl, &itc1, - (void *)(long)i/* item data */, - NULL/* parent */, + gli = elm_genlist_item_insert_before(gl, &itc1, + (void *)i/* item data */, gli_selected /* item before */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)(long)(i * 10)/* func data */); - + (void *)(i * 10)/* func data */); i++; } @@ -254,14 +252,12 @@ my_gl_insert_after(void *data, Evas_Object *obj, void *event_info) return ; } - elm_genlist_item_insert_after(gl, &itc1, - (void *)(long)i/* item data */, - NULL/* parent */, + gli = elm_genlist_item_insert_after(gl, &itc1, + (void *)i/* item data */, gli_selected /* item after */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)(long)(i * 10)/* func data */); - + (void *)(i * 10)/* func data */); i++; } @@ -391,12 +387,11 @@ test_genlist2(void *data, Evas_Object *obj, void *event_info) (void *)1005/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, (void *)1005/* func data */); gli[5] = elm_genlist_item_insert_before(gl, &itc1, - (void *)1006/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, - gl_sel/* func */, (void *)1006/* func data */); + (void *)1006/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1006/* func data */); gli[6] = elm_genlist_item_insert_after(gl, &itc1, - (void *)1007/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, - gl_sel/* func */, (void *)1007/* func data */); - + (void *)1007/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1007/* func data */); elm_box_pack_end(bx, gl); @@ -1336,318 +1331,4 @@ test_genlist7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_resize(win, 320, 320); evas_object_show(win); } -/*************/ - -static Elm_Genlist_Item_Class itc_group; -char *gl8_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) -{ - char buf[256]; - snprintf(buf, sizeof(buf), "Group Index # %i (Item # %i)", (int)((long)data / 10), (int)(long)data); - return strdup(buf); -} - -static void -_bt_show_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - elm_genlist_item_top_show(data); - //elm_genlist_item_show(data); - //elm_genlist_item_middle_show(data); -} -static void -_bt_bring_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - elm_genlist_item_top_bring_in(data); - //elm_genlist_item_bring_in(data); - //elm_genlist_item_middle_bring_in(data); -} - -void -test_genlist8(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *gl, *bt[8], *bx, *bx2, *bx3; - Evas_Object *over; - Elm_Genlist_Item *gli, *git; - int i, bt_count, bt_num; - - win = elm_win_add(NULL, "genlist-group", ELM_WIN_BASIC); - elm_win_title_set(win, "Genlist Group"); - elm_win_autodel_set(win, 1); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bg); - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_resize_object_add(win, bx); - evas_object_show(bx); - - gl = elm_genlist_add(win); - evas_object_smart_callback_add(gl, "selected", _gl_selected, NULL); - evas_object_smart_callback_add(gl, "clicked", _gl_clicked, NULL); - evas_object_smart_callback_add(gl, "longpressed", _gl_longpress, NULL); - evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_box_pack_end(bx, gl); - evas_object_show(gl); - - itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; - itc1.func.icon_get = gl_icon_get; - itc1.func.state_get = gl_state_get; - itc1.func.del = gl_del; - - itc_group.item_style = "group_title"; - itc_group.func.label_get = gl8_label_get; - itc_group.func.icon_get = NULL; - itc_group.func.state_get = NULL; - itc_group.func.del = gl_del; - - bx2 = elm_box_add(win); - elm_box_horizontal_set(bx2, EINA_TRUE); - elm_box_homogenous_set(bx2, EINA_TRUE); - evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); - - bt_num = 0; - bt[bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Show 0"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx2, bt[bt_num]); - - bt[++bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Show 26"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx2, bt[bt_num]); - - bt[++bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Show 101"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx2, bt[bt_num]); - - bt[++bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Show 480"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx2, bt[bt_num]); - - elm_box_pack_end(bx, bx2); - evas_object_show(bx2); - - bx3 = elm_box_add(win); - elm_box_horizontal_set(bx3, EINA_TRUE); - elm_box_homogenous_set(bx3, EINA_TRUE); - evas_object_size_hint_weight_set(bx3, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(bx3, EVAS_HINT_FILL, EVAS_HINT_FILL); - - bt[++bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Bring top 0"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx3, bt[bt_num]); - - bt[++bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Bring top 31"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx3, bt[bt_num]); - - bt[++bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Bring top 239"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx3, bt[bt_num]); - - bt[++bt_num] = elm_button_add(win); - elm_button_label_set(bt[bt_num], "Bring top 477"); - evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); - evas_object_show(bt[bt_num]); - elm_box_pack_end(bx3, bt[bt_num]); - - elm_box_pack_end(bx, bx3); - evas_object_show(bx3); - - bt_count = 0; - for (i = 0; i < 500; i++) - { - if (!(i % 10)) - { - gli = git = elm_genlist_item_append(gl, &itc_group, - (void *)(long)i/* item data */, - NULL/* parent */, - ELM_GENLIST_ITEM_GROUP, - gl_sel/* func */, - (void *)(long)(i * 10)/* func data */); - } - else if (git) - { - gli = elm_genlist_item_append(gl, &itc1, - (void *)(long)i/* item data */, - git/* parent */, - ELM_GENLIST_ITEM_NONE, - gl_sel/* func */, - (void *)(long)(i * 10)/* func data */); - } - //elm_genlist_item_display_only_set(gli, EINA_TRUE); - switch (i) - { - case 0: - evas_object_smart_callback_add(bt[0], "clicked", _bt_show_cb, gli); - evas_object_smart_callback_add(bt[4], "clicked", _bt_bring_cb, gli); - break; - case 26: - evas_object_smart_callback_add(bt[1], "clicked", _bt_show_cb, gli); - break; - case 31: - evas_object_smart_callback_add(bt[5], "clicked", _bt_bring_cb, gli); - break; - case 101: - evas_object_smart_callback_add(bt[2], "clicked", _bt_show_cb, gli); - break; - case 239: - evas_object_smart_callback_add(bt[6], "clicked", _bt_bring_cb, gli); - break; - case 477: - evas_object_smart_callback_add(bt[7], "clicked", _bt_bring_cb, gli); - break; - case 480: - evas_object_smart_callback_add(bt[3], "clicked", _bt_show_cb, gli); - break; - } - } - - evas_object_resize(win, 480, 800); - evas_object_show(win); -} - -/*************/ - -static void -gl9_exp(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Genlist_Item *it = event_info; - Evas_Object *gl = elm_genlist_item_genlist_get(it); - int val = (int)(long)elm_genlist_item_data_get(it); - val *= 10; - elm_genlist_item_append(gl, &itc1, - (void *)(long)(val + 1)/* item data */, it/* parent */, - ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)(long)(val + 2)/* item data */, it/* parent */, - ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)(long)(val + 3)/* item data */, it/* parent */, - ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); -} -static void -gl9_con(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Genlist_Item *it = event_info; - elm_genlist_item_subitems_clear(it); -} - -static void -gl9_exp_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Genlist_Item *it = event_info; - elm_genlist_item_expanded_set(it, EINA_TRUE); -} -static void -gl9_con_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Genlist_Item *it = event_info; - elm_genlist_item_expanded_set(it, EINA_FALSE); -} - -void -test_genlist9(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *gl, *bt[8], *bx, *bx2, *bx3; - Evas_Object *over; - Elm_Genlist_Item *git; - - win = elm_win_add(NULL, "genlist-group-tree", ELM_WIN_BASIC); - elm_win_title_set(win, "Genlist Group Tree"); - elm_win_autodel_set(win, 1); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bg); - - bx = elm_box_add(win); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_resize_object_add(win, bx); - evas_object_show(bx); - - gl = elm_genlist_add(win); - evas_object_smart_callback_add(gl, "selected", _gl_selected, NULL); - evas_object_smart_callback_add(gl, "clicked", _gl_clicked, NULL); - evas_object_smart_callback_add(gl, "longpressed", _gl_longpress, NULL); - evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_box_pack_end(bx, gl); - evas_object_show(gl); - - itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; - itc1.func.icon_get = gl_icon_get; - itc1.func.state_get = gl_state_get; - itc1.func.del = gl_del; - - itc_group.item_style = "group_title"; - itc_group.func.label_get = gl8_label_get; - itc_group.func.icon_get = NULL; - itc_group.func.state_get = NULL; - itc_group.func.del = gl_del; - - git = elm_genlist_item_append(gl, &itc_group, - (void *)0/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)1/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)2/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)3/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); - git = elm_genlist_item_append(gl, &itc_group, - (void *)4/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)5/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)6/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc1, - (void *)7/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); - - evas_object_smart_callback_add(gl, "expand,request", gl9_exp_req, gl); - evas_object_smart_callback_add(gl, "contract,request", gl9_con_req, gl); - evas_object_smart_callback_add(gl, "expanded", gl9_exp, gl); - evas_object_smart_callback_add(gl, "contracted", gl9_con, gl); - - evas_object_resize(win, 480, 800); - evas_object_show(win); -} - #endif diff --git a/src/bin/test_map.c b/src/bin/test_map.c index 58f628a..4adbb1f 100644 --- a/src/bin/test_map.c +++ b/src/bin/test_map.c @@ -1,7 +1,4 @@ #include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif #ifndef ELM_LIB_QUICKLAUNCH typedef struct Marker_Data @@ -31,101 +28,121 @@ Marker_Data data11= {PACKAGE_DATA_DIR"/images/wood_01.jpg"}; Marker_Data data_parking= {PACKAGE_DATA_DIR"/images/parking.png"}; static void -my_map_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_clicked(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("clicked\n"); } static void -my_map_press(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_press(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("press\n"); } static void -my_map_longpressed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_longpressed(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("longpressed\n"); } static void -my_map_clicked_double(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_clicked_double(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("clicked,double\n"); } static void -my_map_load_detail(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_load(void *data, Evas_Object *obj, void *event_info) +{ + //Evas_Object *win = data; + printf("load\n"); +} + +static void +my_map_loaded(void *data, Evas_Object *obj, void *event_info) +{ + //Evas_Object *win = data; + printf("loaded\n"); +} + +static void +my_map_load_details(void *data, Evas_Object *obj, void *event_info) { - printf("load,detail\n"); + //Evas_Object *win = data; + printf("load,details\n"); } static void -my_map_loaded_detail(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_loaded_details(void *data, Evas_Object *obj, void *event_info) { - printf("loaded,detail\n"); + //Evas_Object *win = data; + printf("loaded,details\n"); } static void -my_map_zoom_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_zoom_start(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("zoom,start\n"); } static void -my_map_zoom_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_zoom_stop(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("zoom,stop\n"); } static void -my_map_zoom_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_zoom_change(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("zoom,change\n"); } static void -my_map_anim_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_anim_start(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("anim,start\n"); } static void -my_map_anim_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_anim_stop(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("anim,stop\n"); } static void -my_map_drag_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_drag_start(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("drag,start\n"); } static void -my_map_drag_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_map_drag_stop(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; printf("drag_stop\n"); } static void -my_map_scroll(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +my_map_scroll(void *data, Evas_Object *obj, void *event_info) { + //Evas_Object *win = data; double lon, lat; elm_map_geo_region_get(obj, &lon, &lat); printf("scroll longitude : %f latitude : %f\n", lon, lat); } static void -my_map_downloaded(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - int try_num, finish_num; - elm_map_utils_downloading_status_get(data, &try_num, &finish_num); - printf("downloaded : %d / %d\n", finish_num, try_num); -} - -static void -my_bt_show_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_show_reg(void *data, Evas_Object *obj, void *event_info) { Eina_Bool b = elm_map_paused_get(data); elm_map_paused_set(data, EINA_TRUE); @@ -136,13 +153,13 @@ my_bt_show_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSE } static void -my_bt_bring_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_bring_reg(void *data, Evas_Object *obj, void *event_info) { elm_map_geo_region_bring_in(data, 2.352, 48.857); } static void -my_bt_zoom_in(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_zoom_in(void *data, Evas_Object *obj, void *event_info) { double zoom; @@ -153,7 +170,7 @@ my_bt_zoom_in(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED } static void -my_bt_zoom_out(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_zoom_out(void *data, Evas_Object *obj, void *event_info) { double zoom; @@ -164,61 +181,55 @@ my_bt_zoom_out(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSE } static void -my_bt_pause(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_pause(void *data, Evas_Object *obj, void *event_info) { elm_map_paused_set(data, !elm_map_paused_get(data)); } static void -my_bt_markers_pause(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_markers_pause(void *data, Evas_Object *obj, void *event_info) { elm_map_paused_markers_set(data, !elm_map_paused_markers_get(data)); } static void -my_bt_zoom_fit(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_zoom_fit(void *data, Evas_Object *obj, void *event_info) { elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FIT); } static void -my_bt_zoom_fill(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_zoom_fill(void *data, Evas_Object *obj, void *event_info) { elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FILL); } static void -my_bt_source_mapnik(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_source_mapnik(void *data, Evas_Object *obj, void *event_info) { elm_map_source_set(data, ELM_MAP_SOURCE_MAPNIK); } static void -my_bt_source_osmarender(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_source_osmarender(void *data, Evas_Object *obj, void *event_info) { elm_map_source_set(data, ELM_MAP_SOURCE_OSMARENDER); } static void -my_bt_source_cyclemap(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_source_cyclemap(void *data, Evas_Object *obj, void *event_info) { elm_map_source_set(data, ELM_MAP_SOURCE_CYCLEMAP); } static void -my_bt_source_maplint(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_source_maplint(void *data, Evas_Object *obj, void *event_info) { elm_map_source_set(data, ELM_MAP_SOURCE_MAPLINT); } static void -my_bt_source_module(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - elm_map_source_set(data, ELM_MAP_SOURCE_MODULE); -} - -static void -my_bt_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +my_bt_add(void *data, Evas_Object *obj, void *event_info) { int i; Elm_Map_Group_Class *g_clas; @@ -245,6 +256,7 @@ my_bt_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) else { m_clas = itc_parking; + g_clas = itc_group_parking; d = &data_parking; } @@ -261,7 +273,7 @@ my_bt_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) } static Evas_Object * -_marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data) +_marker_get(Evas_Object *obj, Elm_Map_Marker *marker, void *data) { Marker_Data *d = data; @@ -298,7 +310,7 @@ _marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data) } static Evas_Object * -_icon_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data) +_icon_get(Evas_Object *obj, Elm_Map_Marker *marker, void *data) { Marker_Data *d = data; @@ -322,7 +334,7 @@ _group_icon_get(Evas_Object *obj, void *data) } static void -_map_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +_map_mouse_wheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Object *map = data; Evas_Event_Mouse_Wheel *ev = (Evas_Event_Mouse_Wheel*) event_info; @@ -338,11 +350,11 @@ _map_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, zoom++; elm_map_zoom_mode_set(map, ELM_MAP_ZOOM_MODE_MANUAL); - if ((zoom >= 0) && (zoom <= 18)) elm_map_zoom_set(map, zoom); + if (zoom >= 0 && zoom <= 18) elm_map_zoom_set(map, zoom); } static void -_map_move_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_map_move_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { int x,y,w,h; @@ -352,7 +364,7 @@ _map_move_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, } void -test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_map(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *map, *tb2, *bt, *bx; @@ -393,7 +405,7 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ // itc_group1 = elm_map_group_class_new(map); - elm_map_group_class_data_set(itc_group1, (void *)PACKAGE_DATA_DIR"/images/plant_01.jpg"); + elm_map_group_class_data_set(itc_group1, PACKAGE_DATA_DIR"/images/plant_01.jpg"); itc_group2 = elm_map_group_class_new(map); elm_map_group_class_style_set(itc_group2, "radio2"); @@ -401,7 +413,7 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ itc_group_parking = elm_map_group_class_new(map); elm_map_group_class_icon_cb_set(itc_group_parking, _group_icon_get); - elm_map_group_class_data_set(itc_group_parking, (void *)PACKAGE_DATA_DIR"/images/parking.png"); + elm_map_group_class_data_set(itc_group_parking, PACKAGE_DATA_DIR"/images/parking.png"); elm_map_group_class_style_set(itc_group_parking, "empty"); elm_map_group_class_zoom_displayed_set(itc_group_parking, 5); // @@ -420,20 +432,21 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ evas_object_event_callback_add(map, EVAS_CALLBACK_MOVE, _map_move_resize_cb, map); - elm_map_marker_add(map, 2.352, 48.857, itc1, itc_group1, &data1); - elm_map_marker_add(map, 2.355, 48.857, itc1, itc_group1, &data3); - elm_map_marker_add(map, 3, 48.857, itc2, itc_group1, &data2); - elm_map_marker_add(map, 2.352, 49, itc2, itc_group1, &data1); - - elm_map_marker_add(map, 7.31451, 48.857127, itc1, itc_group1, &data10); - elm_map_marker_add(map, 7.314704, 48.857119, itc1, itc_group1, &data4); - elm_map_marker_add(map, 7.314704, 48.857119, itc2, itc_group1, &data5); - elm_map_marker_add(map, 7.31432, 48.856785, itc2, itc_group1, &data6); - elm_map_marker_add(map, 7.3148, 48.85725, itc1, itc_group2, &data7); - elm_map_marker_add(map, 7.316445, 48.8572210000694, itc1, itc_group1, &data8); - elm_map_marker_add(map, 7.316527000125, 48.85609, itc2, itc_group2, &data9); - elm_map_marker_add(map, 7.3165409990833, 48.856078, itc2, itc_group1, &data11); - elm_map_marker_add(map, 7.319812, 48.856561, itc2, itc_group2, &data10); + Elm_Map_Marker *marker = + elm_map_marker_add(map, 2.352, 48.857, itc1, itc_group1, &data1); + marker = elm_map_marker_add(map, 2.355, 48.857, itc1, itc_group1, &data3); + marker = elm_map_marker_add(map, 3, 48.857, itc2, itc_group1, &data2); + marker = elm_map_marker_add(map, 2.352, 49, itc2, itc_group1, &data1); + + marker = elm_map_marker_add(map, 7.31451, 48.857127, itc1, itc_group1, &data10); + marker = elm_map_marker_add(map, 7.314704, 48.857119, itc1, itc_group1, &data4); + marker = elm_map_marker_add(map, 7.314704, 48.857119, itc2, itc_group1, &data5); + marker = elm_map_marker_add(map, 7.31432, 48.856785, itc2, itc_group1, &data6); + marker = elm_map_marker_add(map, 7.3148, 48.85725, itc1, itc_group2, &data7); + marker = elm_map_marker_add(map, 7.316445, 48.8572210000694, itc1, itc_group1, &data8); + marker = elm_map_marker_add(map, 7.316527000125, 48.85609, itc2, itc_group2, &data9); + marker = elm_map_marker_add(map, 7.3165409990833, 48.856078, itc2, itc_group1, &data11); + marker = elm_map_marker_add(map, 7.319812, 48.856561, itc2, itc_group2, &data10); nb_elts = 13; @@ -441,8 +454,10 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ evas_object_smart_callback_add(map, "press", my_map_press, win); evas_object_smart_callback_add(map, "longpressed", my_map_longpressed, win); evas_object_smart_callback_add(map, "clicked,double", my_map_clicked_double, win); - evas_object_smart_callback_add(map, "load,detail", my_map_load_detail, win); - evas_object_smart_callback_add(map, "loaded,detail", my_map_loaded_detail, win); + evas_object_smart_callback_add(map, "load", my_map_load, win); + evas_object_smart_callback_add(map, "loaded", my_map_loaded, win); + evas_object_smart_callback_add(map, "load,details", my_map_load_details, win); + evas_object_smart_callback_add(map, "loaded,details", my_map_loaded_details, win); evas_object_smart_callback_add(map, "zoom,start", my_map_zoom_start, win); evas_object_smart_callback_add(map, "zoom,stop", my_map_zoom_stop, win); evas_object_smart_callback_add(map, "zoom,change", my_map_zoom_change, win); @@ -451,7 +466,6 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ evas_object_smart_callback_add(map, "scroll,drag,start", my_map_drag_start, win); evas_object_smart_callback_add(map, "scroll,drag,stop", my_map_drag_stop, win); evas_object_smart_callback_add(map, "scroll", my_map_scroll, win); - evas_object_smart_callback_add(map, "downloaded", my_map_downloaded, map); evas_object_show(map); @@ -585,14 +599,6 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ evas_object_size_hint_align_set(bt, 1.0, 0.9); evas_object_show(bt); elm_box_pack_end(bx, bt); - - bt = elm_button_add(win); - elm_button_label_set(bt, "Module"); - evas_object_smart_callback_add(bt, "clicked", my_bt_source_module, map); - evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(bt, 1.0, 0.9); - evas_object_show(bt); - elm_box_pack_end(bx, bt); // evas_object_show(tb2); diff --git a/src/bin/test_panel.c b/src/bin/test_panel.c index aa0493a..7320bb6 100644 --- a/src/bin/test_panel.c +++ b/src/bin/test_panel.c @@ -1,58 +1,49 @@ #include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif #ifndef ELM_LIB_QUICKLAUNCH static Elm_Genlist_Item_Class itc; static void _bstatus(void *data, Evas_Object *obj, void *event_info); static void _tstatus(void *data, Evas_Object *obj, void *event_info); -static char *_label_get(void *data, Evas_Object *obj, const char *source); -static Evas_Object *_icon_get(void *data, Evas_Object *obj, const char *source); -static Eina_Bool _state_get(void *data, Evas_Object *obj, const char *source); -static void _item_del(void *data, Evas_Object *obj); +static char *_label_get(const void *data, Evas_Object *obj, const char *source); +static Evas_Object *_icon_get(const void *data, Evas_Object *obj, const char *source); +static Eina_Bool _state_get(const void *data, Evas_Object *obj, const char *source); +static void _item_del(const void *data, Evas_Object *obj); static void _fill_list(Evas_Object *obj); static Eina_Bool _dir_has_subs(const char *path); static void -_tstatus(void *data, Evas_Object *obj, void *event_info __UNUSED__) +_tstatus(void *data, Evas_Object *obj, void *event_info) { - Elm_Toolbar_Item *sel; - const char *status; + char *status; if (elm_panel_hidden_get((Evas_Object*)data)) status = "hidden"; - else - status = "shown"; + else status = "shown"; printf("The top panel is currently %s\n", status); - sel = elm_toolbar_selected_item_get(obj); - elm_toolbar_item_selected_set(sel, EINA_FALSE); + elm_toolbar_item_unselect_all(obj); } static void -_bstatus(void *data, Evas_Object *obj, void *event_info __UNUSED__) +_bstatus(void *data, Evas_Object *obj, void *event_info) { - Elm_Toolbar_Item *sel; - const char *status; + char *status; if (elm_panel_hidden_get((Evas_Object*)data)) status = "hidden"; - else - status = "shown"; + else status = "shown"; printf("The bottom panel is currently %s\n", status); - sel = elm_toolbar_selected_item_get(obj); - elm_toolbar_item_selected_set(sel, EINA_FALSE); + elm_toolbar_item_unselect_all(obj); } static char * -_label_get(void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) +_label_get(const void *data, Evas_Object *obj, const char *source) { return strdup(ecore_file_file_get(data)); } static Evas_Object * -_icon_get(void *data, Evas_Object *obj, const char *source) +_icon_get(const void *data, Evas_Object *obj, const char *source) { if (!strcmp(source, "elm.swallow.icon")) { @@ -71,13 +62,13 @@ _icon_get(void *data, Evas_Object *obj, const char *source) } static Eina_Bool -_state_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) +_state_get(const void *data, Evas_Object *obj, const char *source) { return EINA_FALSE; } static void -_item_del(void *data, Evas_Object *obj __UNUSED__) +_item_del(const void *data, Evas_Object *obj) { eina_stringshare_del(data); } @@ -148,9 +139,10 @@ _dir_has_subs(const char *path) } void -test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_panel(void *data, Evas_Object *obj, void *event_info) { - Evas_Object *win, *bg, *panel, *bx, *vbx, *toolbar; + Evas_Object *win, *bg, *panel, *bx, *vbx, *toolbar, *ic; + char buf[PATH_MAX]; Evas_Object *list; win = elm_win_add(NULL, "panel", ELM_WIN_BASIC); @@ -181,12 +173,15 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info toolbar = elm_toolbar_add(win); elm_toolbar_homogenous_set(toolbar, 0); - elm_toolbar_mode_shrink_set(toolbar, ELM_TOOLBAR_SHRINK_NONE); + elm_toolbar_scrollable_set(toolbar, 0); evas_object_size_hint_weight_set(toolbar, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(toolbar); - elm_toolbar_item_append(toolbar, "home", "Hello", _tstatus, panel); + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(toolbar, ic, "Hello", _tstatus, panel); elm_panel_content_set(panel, toolbar); elm_box_pack_end(vbx, panel); @@ -220,7 +215,6 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_panel_orient_set(panel, ELM_PANEL_ORIENT_RIGHT); evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(panel, 1, EVAS_HINT_FILL); - elm_panel_hidden_set(panel, EINA_TRUE); list = elm_genlist_add(win); evas_object_size_hint_min_set(list, 100, -1); @@ -241,16 +235,18 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_panel_orient_set(panel, ELM_PANEL_ORIENT_BOTTOM); evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_panel_hidden_set(panel, EINA_TRUE); toolbar = elm_toolbar_add(win); elm_toolbar_homogenous_set(toolbar, 0); - elm_toolbar_mode_shrink_set(toolbar, ELM_TOOLBAR_SHRINK_NONE); + elm_toolbar_scrollable_set(toolbar, 0); evas_object_size_hint_weight_set(toolbar, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(toolbar); - elm_toolbar_item_append(toolbar, "home", "Hello", _bstatus, panel); + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(toolbar, ic, "Hello", _bstatus, panel); elm_panel_content_set(panel, toolbar); elm_box_pack_end(vbx, panel); diff --git a/src/bin/test_panes.c b/src/bin/test_panes.c index b0800d6..44db9a7 100644 --- a/src/bin/test_panes.c +++ b/src/bin/test_panes.c @@ -1,32 +1,29 @@ #include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif #ifndef ELM_LIB_QUICKLAUNCH static double size = 0.0; static void -_press(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_press(void *data, Evas_Object *obj, void *event_info) { printf("press\n"); } static void -_unpress(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +_unpress(void *data, Evas_Object *obj, void *event_info) { printf("unpress, size : %f\n", elm_panes_content_left_size_get(obj)); } static void -_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_clicked(void *data, Evas_Object *obj, void *event_info) { printf("clicked\n"); } static void -_clicked_double(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +_clicked_double(void *data, Evas_Object *obj, void *event_info) { printf("clicked double\n"); if(elm_panes_content_left_size_get(obj) > 0) @@ -40,7 +37,7 @@ _clicked_double(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUS void -test_panes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_panes(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *panes, *panes_h, *bt; @@ -51,7 +48,6 @@ test_panes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_focus_highlight_enabled_set(win, EINA_TRUE); evas_object_show(bg); panes = elm_panes_add(win); diff --git a/src/bin/test_slideshow.c b/src/bin/test_slideshow.c index 733119b..51ab2da 100644 --- a/src/bin/test_slideshow.c +++ b/src/bin/test_slideshow.c @@ -1,67 +1,66 @@ #include -#include #ifndef ELM_LIB_QUICKLAUNCH static Evas_Object *slideshow, *bt_start, *bt_stop; static Elm_Slideshow_Item_Class itc; -static const char *img1 = PACKAGE_DATA_DIR"/images/logo.png"; -static const char *img2 = PACKAGE_DATA_DIR"/images/plant_01.jpg"; -static const char *img3 = PACKAGE_DATA_DIR"/images/rock_01.jpg"; -static const char *img4 = PACKAGE_DATA_DIR"/images/rock_02.jpg"; -static const char *img5 = PACKAGE_DATA_DIR"/images/sky_01.jpg"; -static const char *img6 = PACKAGE_DATA_DIR"/images/sky_04.jpg"; -static const char *img7 = PACKAGE_DATA_DIR"/images/wood_01.jpg"; -static const char *img8 = PACKAGE_DATA_DIR"/images/mystrale.jpg"; -static const char *img9 = PACKAGE_DATA_DIR"/images/mystrale_2.jpg"; +static char *img1 = PACKAGE_DATA_DIR"/images/logo.png"; +static char *img2 = PACKAGE_DATA_DIR"/images/plant_01.jpg"; +static char *img3 = PACKAGE_DATA_DIR"/images/rock_01.jpg"; +static char *img4 = PACKAGE_DATA_DIR"/images/rock_02.jpg"; +static char *img5 = PACKAGE_DATA_DIR"/images/sky_01.jpg"; +static char *img6 = PACKAGE_DATA_DIR"/images/sky_04.jpg"; +static char *img7 = PACKAGE_DATA_DIR"/images/wood_01.jpg"; +static char *img8 = PACKAGE_DATA_DIR"/images/mystrale.jpg"; +static char *img9 = PACKAGE_DATA_DIR"/images/mystrale_2.jpg"; static void -_notify_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_notify_show(void *data, Evas *e, Evas_Object *obj, void *event_info) { evas_object_show(data); + elm_notify_timer_init(data); } static void -_next(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_next(void *data, Evas_Object *obj, void *event_info) { elm_slideshow_next(data); } static void -_previous(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_previous(void *data, Evas_Object *obj, void *event_info) { elm_slideshow_previous(data); } static void -_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) { elm_notify_timeout_set(data, 0); - evas_object_show(data); } static void -_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) { elm_notify_timeout_set(data, 3); } static void -_hv_select(void *data, Evas_Object *obj, void *event_info __UNUSED__) +_hv_select(void *data, Evas_Object *obj, void *event_info) { elm_slideshow_transition_set(slideshow, data); elm_hoversel_label_set(obj, data); } static void -_layout_select(void *data, Evas_Object *obj, void *event_info __UNUSED__) +_layout_select(void *data, Evas_Object *obj, void *event_info) { elm_slideshow_layout_set(slideshow, data); elm_hoversel_label_set(obj, data); } static void -_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_start(void *data, Evas_Object *obj, void *event_info) { elm_slideshow_timeout_set(slideshow, (int)elm_spinner_value_get(data)); @@ -70,7 +69,7 @@ _start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) } static void -_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_stop(void *data, Evas_Object *obj, void *event_info) { elm_slideshow_timeout_set(slideshow, 0); elm_object_disabled_set(bt_start, 0); @@ -78,7 +77,7 @@ _stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNU } static void -_spin(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_spin(void *data, Evas_Object *obj, void *event_info) { if (elm_slideshow_timeout_get(slideshow) > 0) elm_slideshow_timeout_set(slideshow, (int)elm_spinner_value_get(data)); @@ -102,7 +101,7 @@ _get(void *data, Evas_Object *obj) void -test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_slideshow(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin; const Eina_List *l; @@ -146,10 +145,8 @@ test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i elm_notify_content_set(notify, bx); evas_object_show(bx); - evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_IN, _mouse_in, - notify); - evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_OUT, _mouse_out, - notify); + evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_IN, _mouse_in, notify); + evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_OUT, _mouse_out, notify); bt = elm_button_add(win); elm_button_label_set(bt, "Previous"); @@ -203,10 +200,9 @@ test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i elm_object_disabled_set(bt, 1); evas_object_show(bt); - evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_UP, - _notify_show, notify); - evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_MOVE, - _notify_show, notify); + + evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_UP, _notify_show, notify); + evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_MOVE, _notify_show, notify); evas_object_resize(win, 500, 400); evas_object_show(win); diff --git a/src/bin/test_toolbar.c b/src/bin/test_toolbar.c index ca46fa4..29bc2a4 100644 --- a/src/bin/test_toolbar.c +++ b/src/bin/test_toolbar.c @@ -1,10 +1,7 @@ #include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif #ifndef ELM_LIB_QUICKLAUNCH static void -tb_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +tb_1(void *data, Evas_Object *obj, void *event_info) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/panel_01.jpg", PACKAGE_DATA_DIR); @@ -12,7 +9,7 @@ tb_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) } static void -tb_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +tb_2(void *data, Evas_Object *obj, void *event_info) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", PACKAGE_DATA_DIR); @@ -20,7 +17,7 @@ tb_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) } static void -tb_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +tb_3(void *data, Evas_Object *obj, void *event_info) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/wood_01.jpg", PACKAGE_DATA_DIR); @@ -28,21 +25,7 @@ tb_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) } static void -tb_3a(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - tb_3(data, obj, event_info); - elm_toolbar_item_state_set(event_info, elm_toolbar_item_state_next(event_info)); -} - -static void -tb_3b(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - tb_3(data, obj, event_info); - elm_toolbar_item_state_unset(event_info); -} - -static void -tb_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +tb_4(void *data, Evas_Object *obj, void *event_info) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR); @@ -50,21 +33,15 @@ tb_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) } static void -tb_4a(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - elm_toolbar_item_state_set(event_info, elm_toolbar_item_state_prev(event_info)); -} - -static void -tb_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +tb_5(void *data, Evas_Object *obj, void *event_info) { elm_photo_file_set(data, NULL); } void -test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +test_toolbar(void *data, Evas_Object *obj, void *event_info) { - Evas_Object *win, *bg, *bx, *tb, *ph, *menu; + Evas_Object *win, *bg, *bx, *tb, *ic, *ph, *menu; Evas_Object *ph1, *ph2, *ph3, *ph4; Elm_Toolbar_Item *item; Elm_Menu_Item *menu_item; @@ -86,7 +63,6 @@ test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf tb = elm_toolbar_add(win); elm_toolbar_homogenous_set(tb, 0); - elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_MENU); evas_object_size_hint_weight_set(tb, 0.0, 0.0); evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); @@ -95,32 +71,59 @@ test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf ph3 = elm_photo_add(win); ph4 = elm_photo_add(win); - item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1); + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + item = elm_toolbar_item_add(tb, ic, "Hello", tb_1, ph1); elm_toolbar_item_disabled_set(item, EINA_TRUE); - elm_toolbar_item_priority_set(item, 100); - - item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1); - elm_toolbar_item_priority_set(item, -100); - - item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4); - elm_toolbar_item_priority_set(item, 150); - item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4); - elm_toolbar_item_priority_set(item, 0); - - item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4); - elm_toolbar_item_priority_set(item, -200); - - item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL); + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "World", tb_2, ph1); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "H", tb_3, ph4); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "Comes", tb_4, ph4); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_toolbar_item_add(tb, ic, "Elementary", tb_5, ph4); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + item = elm_toolbar_item_add(tb, ic, "Menu", NULL, NULL); elm_toolbar_item_menu_set(item, 1); - elm_toolbar_item_priority_set(item, -999999); elm_toolbar_menu_parent_set(tb, win); menu = elm_toolbar_item_menu_get(item); - elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4); - menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4); - elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4); - elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4); + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_menu_item_add(menu, NULL, ic, "Here", tb_3, ph4); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + menu_item = elm_menu_item_add(menu, NULL, ic, "Comes", tb_4, ph4); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_menu_item_add(menu, menu_item, ic, "hey ho", tb_4, ph4); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + menu_item = elm_menu_item_add(menu, NULL, ic, "Elementary", tb_5, ph4); elm_box_pack_end(bx, tb); evas_object_show(tb); @@ -168,451 +171,7 @@ test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf evas_object_show(tb); evas_object_resize(win, 320, 300); - evas_object_show(win); -} - -void -test_toolbar2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *bx, *tb, *ph, *menu; - Evas_Object *ph1, *ph2, *ph3, *ph4; - Elm_Toolbar_Item *item; - Elm_Menu_Item *menu_item; - char buf[PATH_MAX]; - - win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC); - elm_win_title_set(win, "Toolbar"); - elm_win_autodel_set(win, 1); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bg); - - bx = elm_box_add(win); - elm_win_resize_object_add(win, bx); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bx); - tb = elm_toolbar_add(win); - elm_toolbar_homogenous_set(tb, 0); - elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_SCROLL); - evas_object_size_hint_weight_set(tb, 0.0, 0.0); - evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); - - ph1 = elm_photo_add(win); - ph2 = elm_photo_add(win); - ph3 = elm_photo_add(win); - ph4 = elm_photo_add(win); - - item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1); - elm_toolbar_item_disabled_set(item, EINA_TRUE); - elm_toolbar_item_priority_set(item, -100); - - item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1); - elm_toolbar_item_priority_set(item, 100); - - item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4); - elm_toolbar_item_priority_set(item, -150); - - item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4); - elm_toolbar_item_priority_set(item, -200); - - item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4); - elm_toolbar_item_priority_set(item, 0); - - item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL); - elm_toolbar_item_menu_set(item, 1); - elm_toolbar_item_priority_set(item, -999999); - elm_toolbar_menu_parent_set(tb, win); - menu = elm_toolbar_item_menu_get(item); - - elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4); - menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4); - elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4); - elm_menu_item_add(menu, NULL, "edit-delete", "Scroll", tb_5, ph4); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - tb = elm_table_add(win); - //elm_table_homogenous_set(tb, 1); - evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND); - evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); - - ph = ph1; - elm_photo_size_set(ph, 40); - snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 0, 1, 1); - evas_object_show(ph); - - ph = ph2; - elm_photo_size_set(ph, 80); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 0, 1, 1); - evas_object_show(ph); - - ph = ph3; - elm_photo_size_set(ph, 20); - snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 1, 1, 1); - evas_object_show(ph); - - ph = ph4; - elm_photo_size_set(ph, 60); - snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 1, 1, 1); - evas_object_show(ph); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - evas_object_resize(win, 320, 300); - evas_object_show(win); -} - -void -test_toolbar3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *bx, *tb, *ph, *menu; - Evas_Object *ph1, *ph2, *ph3, *ph4; - Elm_Toolbar_Item *item; - Elm_Menu_Item *menu_item; - char buf[PATH_MAX]; - - win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC); - elm_win_title_set(win, "Toolbar"); - elm_win_autodel_set(win, 1); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bg); - - bx = elm_box_add(win); - elm_win_resize_object_add(win, bx); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bx); - - tb = elm_toolbar_add(win); - elm_toolbar_homogenous_set(tb, 0); - elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_NONE); - evas_object_size_hint_weight_set(tb, 0.0, 0.0); - evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); - - ph1 = elm_photo_add(win); - ph2 = elm_photo_add(win); - ph3 = elm_photo_add(win); - ph4 = elm_photo_add(win); - - item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1); - elm_toolbar_item_disabled_set(item, EINA_TRUE); - elm_toolbar_item_priority_set(item, 0); - - item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1); - elm_toolbar_item_priority_set(item, -200); - - item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4); - elm_toolbar_item_priority_set(item, 1); - - item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4); - elm_toolbar_item_priority_set(item, -10); - - item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4); - elm_toolbar_item_priority_set(item, 50); - - item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL); - elm_toolbar_item_menu_set(item, 1); - elm_toolbar_item_priority_set(item, 999999); - elm_toolbar_menu_parent_set(tb, win); - menu = elm_toolbar_item_menu_get(item); - - elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4); - menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4); - elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4); - elm_menu_item_add(menu, NULL, "edit-delete", "None", tb_5, ph4); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - tb = elm_table_add(win); - //elm_table_homogenous_set(tb, 1); - evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND); - evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); - - ph = ph1; - elm_photo_size_set(ph, 40); - snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 0, 1, 1); - evas_object_show(ph); - - ph = ph2; - elm_photo_size_set(ph, 80); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 0, 1, 1); - evas_object_show(ph); - - ph = ph3; - elm_photo_size_set(ph, 20); - snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 1, 1, 1); - evas_object_show(ph); - - ph = ph4; - elm_photo_size_set(ph, 60); - snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 1, 1, 1); - evas_object_show(ph); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - evas_object_resize(win, 320, 300); - evas_object_show(win); -} - -/* The same test of toolbar, but using hide shrink mode instead of menu */ -void -test_toolbar4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *bx, *tb, *ph, *menu; - Evas_Object *ph1, *ph2, *ph3, *ph4; - Elm_Toolbar_Item *item; - Elm_Menu_Item *menu_item; - char buf[PATH_MAX]; - - win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC); - elm_win_title_set(win, "Toolbar 4"); - elm_win_autodel_set(win, EINA_TRUE); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bg); - - bx = elm_box_add(win); - elm_win_resize_object_add(win, bx); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bx); - - tb = elm_toolbar_add(win); - elm_toolbar_homogenous_set(tb, 0); - elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_HIDE); - evas_object_size_hint_weight_set(tb, 0.0, 0.0); - evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); - - ph1 = elm_photo_add(win); - ph2 = elm_photo_add(win); - ph3 = elm_photo_add(win); - ph4 = elm_photo_add(win); - - item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1); - elm_toolbar_item_disabled_set(item, EINA_TRUE); - elm_toolbar_item_priority_set(item, 100); - - item = elm_toolbar_item_append(tb, "folder-new", "World", tb_2, ph1); - elm_toolbar_item_priority_set(item, -100); - - item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3, ph4); - elm_toolbar_item_priority_set(item, 150); - - item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4, ph4); - elm_toolbar_item_priority_set(item, 0); - - item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4); - elm_toolbar_item_priority_set(item, -200); - - item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL); - elm_toolbar_item_menu_set(item, 1); - elm_toolbar_item_priority_set(item, -999999); - elm_toolbar_menu_parent_set(tb, win); - menu = elm_toolbar_item_menu_get(item); - - elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4); - menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4); - elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4); - elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - tb = elm_table_add(win); - evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND); - evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); - - ph = ph1; - elm_photo_size_set(ph, 40); - snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 0, 1, 1); - evas_object_show(ph); - - ph = ph2; - elm_photo_size_set(ph, 80); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 0, 1, 1); - evas_object_show(ph); - - ph = ph3; - elm_photo_size_set(ph, 20); - snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 1, 1, 1); - evas_object_show(ph); - - ph = ph4; - elm_photo_size_set(ph, 60); - snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 1, 1, 1); - evas_object_show(ph); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - evas_object_resize(win, 320, 300); - evas_object_show(win); -} - -/* Toolbar with multiple state buttons */ -void -test_toolbar5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *bx, *tb, *ph, *menu; - Evas_Object *ph1, *ph2, *ph3, *ph4; - Elm_Toolbar_Item *item; - Elm_Menu_Item *menu_item; - char buf[PATH_MAX]; - - win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC); - elm_win_title_set(win, "Toolbar"); - elm_win_autodel_set(win, 1); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bg); - - bx = elm_box_add(win); - elm_win_resize_object_add(win, bx); - evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bx); - - tb = elm_toolbar_add(win); - elm_toolbar_homogenous_set(tb, 0); - elm_toolbar_mode_shrink_set(tb, ELM_TOOLBAR_SHRINK_MENU); - evas_object_size_hint_weight_set(tb, 0.0, 0.0); - evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0); - elm_toolbar_no_select_mode_set(tb, EINA_TRUE); - - ph1 = elm_photo_add(win); - ph2 = elm_photo_add(win); - ph3 = elm_photo_add(win); - ph4 = elm_photo_add(win); - - item = elm_toolbar_item_append(tb, "document-print", "Hello", tb_1, ph1); - elm_toolbar_item_disabled_set(item, EINA_TRUE); - elm_toolbar_item_priority_set(item, 100); - - item = elm_toolbar_item_append(tb, PACKAGE_DATA_DIR"/images/icon_04.png", "World", tb_2, ph1); - elm_toolbar_item_priority_set(item, -100); - - item = elm_toolbar_item_append(tb, "object-rotate-right", "H", tb_3a, ph4); - elm_toolbar_item_state_add(item, "object-rotate-left", "H2", tb_3b, ph4); - elm_toolbar_item_priority_set(item, 150); - - item = elm_toolbar_item_append(tb, "mail-send", "Comes", tb_4a, ph4); - elm_toolbar_item_state_add(item, "emptytrash", "Comes2", tb_4a, ph4); - elm_toolbar_item_state_add(item, "trashcan_full", "Comes3", tb_4a, ph4); - elm_toolbar_item_priority_set(item, 0); - - item = elm_toolbar_item_append(tb, "clock", "Elementary", tb_5, ph4); - elm_toolbar_item_priority_set(item, -200); - - item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL); - elm_toolbar_item_menu_set(item, 1); - elm_toolbar_item_priority_set(item, -999999); - elm_toolbar_menu_parent_set(tb, win); - menu = elm_toolbar_item_menu_get(item); - - elm_menu_item_add(menu, NULL, "edit-cut", "Shrink", tb_3, ph4); - menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Mode", tb_4, ph4); - elm_menu_item_add(menu, menu_item, "edit-paste", "is set to", tb_4, ph4); - elm_menu_item_add(menu, NULL, "edit-delete", "Menu", tb_5, ph4); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - tb = elm_table_add(win); - //elm_table_homogenous_set(tb, 1); - evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND); - evas_object_size_hint_fill_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL); - - ph = ph1; - elm_photo_size_set(ph, 40); - snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 0, 1, 1); - evas_object_show(ph); - - ph = ph2; - elm_photo_size_set(ph, 80); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 0, 1, 1); - evas_object_show(ph); - - ph = ph3; - elm_photo_size_set(ph, 20); - snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 0, 1, 1, 1); - evas_object_show(ph); - - ph = ph4; - elm_photo_size_set(ph, 60); - snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); - elm_photo_file_set(ph, buf); - evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ph, 0.5, 0.5); - elm_table_pack(tb, ph, 1, 1, 1, 1); - evas_object_show(ph); - - elm_box_pack_end(bx, tb); - evas_object_show(tb); - - evas_object_resize(win, 320, 300); evas_object_show(win); } #endif diff --git a/src/edje_externals/elm_fileselector_button.c b/src/edje_externals/elm_fileselector_button.c index 6782b54..f17e6bd 100644 --- a/src/edje_externals/elm_fileselector_button.c +++ b/src/edje_externals/elm_fileselector_button.c @@ -3,7 +3,6 @@ typedef struct _Elm_Params_fileselector_button { Elm_Params base; - const char *label; Evas_Object *icon; struct { @@ -28,10 +27,10 @@ external_fileselector_button_state_set(void *data __UNUSED__, Evas_Object *obj, else if (from_params) p = from_params; else return; - if (p->label) - elm_fileselector_button_label_set(obj, p->label); + if (p->base.label) + elm_fileselector_button_label_set(obj, p->base.label); if (p->icon) elm_fileselector_button_icon_set(obj, p->icon); - if (p->fs.path) elm_fileselector_button_path_set(obj, p->fs.path); + if (p->fs.path) elm_fileselector_button_selected_set(obj, p->fs.path); if (p->fs.is_save_set) elm_fileselector_button_is_save_set(obj, p->fs.is_save); if (p->fs.folder_only_set) @@ -67,7 +66,7 @@ external_fileselector_button_param_set(void *data __UNUSED__, Evas_Object *obj, { if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) { - elm_fileselector_button_path_set(obj, param->s); + elm_fileselector_button_selected_set(obj, param->s); return EINA_TRUE; } } @@ -130,7 +129,7 @@ external_fileselector_button_param_get(void *data __UNUSED__, const Evas_Object { if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) { - param->s = elm_fileselector_button_path_get(obj); + param->s = elm_fileselector_button_selected_get(obj); return EINA_TRUE; } } @@ -174,13 +173,14 @@ external_fileselector_button_param_get(void *data __UNUSED__, const Evas_Object } static void * -external_fileselector_button_params_parse(void *data __UNUSED__, Evas_Object *obj, const Eina_List *params) +external_fileselector_button_params_parse(void *data, Evas_Object *obj, const Eina_List *params) { Elm_Params_fileselector_button *mem; Edje_External_Param *param; const Eina_List *l; - mem = calloc(1, sizeof(Elm_Params_fileselector_button)); + mem = external_common_params_parse(Elm_Params_fileselector_button, + data, obj, params); if (!mem) return NULL; @@ -210,17 +210,15 @@ external_fileselector_button_params_parse(void *data __UNUSED__, Evas_Object *ob mem->fs.inwin_mode = !!param->i; mem->fs.inwin_mode_set = EINA_TRUE; } - else if (!strcmp(param->name, "label")) - mem->label = eina_stringshare_add(param->s); } return mem; } static Evas_Object *external_fileselector_button_content_get(void *data __UNUSED__, - const Evas_Object *obj __UNUSED__, const char *content __UNUSED__) + const Evas_Object *obj, const char *content) { - ERR("No content."); + ERR("so content"); return NULL; } @@ -231,14 +229,11 @@ external_fileselector_button_params_free(void *params) if (mem->fs.path) eina_stringshare_del(mem->fs.path); - if (mem->label) - eina_stringshare_del(mem->label); - free(params); + external_common_params_free(params); } static Edje_External_Param_Info external_fileselector_button_params[] = { DEFINE_EXTERNAL_COMMON_PARAMS, - EDJE_EXTERNAL_PARAM_INFO_STRING("label"), EDJE_EXTERNAL_PARAM_INFO_STRING("icon"), EDJE_EXTERNAL_PARAM_INFO_STRING("path"), EDJE_EXTERNAL_PARAM_INFO_BOOL("save"), diff --git a/src/edje_externals/elm_list.c b/src/edje_externals/elm_list.c index a100db7..8f782af 100644 --- a/src/edje_externals/elm_list.c +++ b/src/edje_externals/elm_list.c @@ -58,7 +58,7 @@ external_list_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fro p->horizontal_mode); if (set != ELM_LIST_LAST) - elm_list_mode_set(obj, set); + elm_list_horizontal_mode_set(obj, set); } if ((p->policy_h) && (p->policy_v)) @@ -97,7 +97,7 @@ external_list_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Exte { Elm_List_Mode set = _list_horizontal_mode_setting_get(param->s); if (set == ELM_LIST_LAST) return EINA_FALSE; - elm_list_mode_set(obj, set); + elm_list_horizontal_mode_set(obj, set); return EINA_TRUE; } } @@ -193,7 +193,7 @@ external_list_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_Exte { if (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE) { - Elm_List_Mode m = elm_list_mode_get(obj); + Elm_List_Mode m = elm_list_horizontal_mode_get(obj); if (m == ELM_LIST_LAST) return EINA_FALSE; diff --git a/src/edje_externals/elm_notify.c b/src/edje_externals/elm_notify.c index 3eab33a..7a37a65 100644 --- a/src/edje_externals/elm_notify.c +++ b/src/edje_externals/elm_notify.c @@ -9,8 +9,9 @@ struct _Elm_Params_Notify { Evas_Object *content; /* part name whose obj is to be set as content */ Eina_Bool repeat_events_exists; Eina_Bool repeat_events; + Eina_Bool timer_init; Eina_Bool timeout_exists; - double timeout; + int timeout; const char *orient; }; @@ -37,7 +38,7 @@ static Elm_Notify_Orient _orient_get(const char *orient) ELM_NOTIFY_ORIENT_LAST + 1); for (i = 0; i < sizeof(orients); i++) - if (!strcmp(orient, orients[i])) return i; + if (strcmp(orient, orients[i]) == 0) return i; return ELM_NOTIFY_ORIENT_LAST; } @@ -55,10 +56,13 @@ static void external_notify_state_set(void *data __UNUSED__, if (p->content) { elm_notify_content_set(obj, p->content); } - if (p->repeat_events_exists) + if(p->repeat_events_exists) elm_notify_repeat_events_set(obj, p->repeat_events); - if (p->timeout_exists) + if(p->timeout_exists) elm_notify_timeout_set(obj, p->timeout); + if(p->timer_init) + elm_notify_timer_init(obj); + if (p->orient) { Elm_Notify_Orient set = _orient_get(p->orient); @@ -70,8 +74,8 @@ static void external_notify_state_set(void *data __UNUSED__, static Eina_Bool external_notify_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param) { - if ((!strcmp(param->name, "content")) - && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) + if (!strcmp(param->name, "content") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) { Evas_Object *content = external_common_param_edje_object_get(obj, param); if ((strcmp(param->s, "")) && (!content)) @@ -79,20 +83,26 @@ static Eina_Bool external_notify_param_set(void *data __UNUSED__, elm_notify_content_set(obj, content); return EINA_TRUE; } - else if ((!strcmp(param->name, "repeat_events")) - && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) + else if (!strcmp(param->name, "repeat_events") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) { elm_notify_repeat_events_set(obj, param->i); return EINA_TRUE; } - else if ((!strcmp(param->name, "timeout")) - && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) + else if (!strcmp(param->name, "timer_init") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) + { + elm_notify_timer_init(obj); + return EINA_TRUE; + } + else if (!strcmp(param->name, "timeout") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_INT) { - elm_notify_timeout_set(obj, param->d); + elm_notify_timeout_set(obj, param->i); return EINA_TRUE; } - else if ((!strcmp(param->name, "orient")) - && (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)) + else if (!strcmp(param->name, "orient") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE) { Elm_Notify_Orient set = _orient_get(param->s); if (set == ELM_NOTIFY_ORIENT_LAST) return EINA_FALSE; @@ -114,20 +124,20 @@ static Eina_Bool external_notify_param_get(void *data __UNUSED__, /* not easy to get content name back from live object */ return EINA_FALSE; } - else if ((!strcmp(param->name, "repeat_events")) - && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) + else if (!strcmp(param->name, "repeat_events") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) { param->i = elm_notify_repeat_events_get(obj); return EINA_TRUE; } - else if ((!strcmp(param->name, "timeout")) - && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) + else if (!strcmp(param->name, "timeout") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_INT) { - param->d = elm_notify_timeout_get(obj); + param->i = elm_notify_timeout_get(obj); return EINA_TRUE; } - else if ((!strcmp(param->name, "orient")) - && (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)) + else if (!strcmp(param->name, "orient") + && param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE) { Elm_Notify_Orient set = elm_notify_orient_get(obj); if (set == ELM_NOTIFY_ORIENT_LAST) return EINA_FALSE; @@ -141,13 +151,13 @@ static Eina_Bool external_notify_param_get(void *data __UNUSED__, return EINA_FALSE; } -static void * external_notify_params_parse(void *data __UNUSED__, Evas_Object *obj, +static void * external_notify_params_parse(void *data, Evas_Object *obj, const Eina_List *params) { Elm_Params_Notify *mem; Edje_External_Param *param; const Eina_List *l; - mem = calloc(1, sizeof(Elm_Params_Notify)); + mem = external_common_params_parse(Elm_Params_Notify, data, obj, params); if (!mem) return NULL; @@ -157,9 +167,13 @@ static void * external_notify_params_parse(void *data __UNUSED__, Evas_Object *o mem->content = external_common_param_edje_object_get(obj, param); else if (!strcmp(param->name, "timeout")) { - mem->timeout = param->d; + mem->timeout = param->i; mem->timeout_exists = EINA_TRUE; } + else if (!strcmp(param->name, "timer_init") && param->i > 0) + { + mem->timer_init = EINA_TRUE; + } else if (!strcmp(param->name, "repeat_events")) { mem->repeat_events = param->i; @@ -183,14 +197,15 @@ static Evas_Object *external_notify_content_get(void *data __UNUSED__, } static void external_notify_params_free(void *params) { - free(params); + external_common_params_free(params); } static Edje_External_Param_Info external_notify_params[] = { DEFINE_EXTERNAL_COMMON_PARAMS, EDJE_EXTERNAL_PARAM_INFO_STRING("content"), EDJE_EXTERNAL_PARAM_INFO_BOOL("repeat_events"), - EDJE_EXTERNAL_PARAM_INFO_DOUBLE("timeout"), + EDJE_EXTERNAL_PARAM_INFO_INT("timeout"), + EDJE_EXTERNAL_PARAM_INFO_BOOL("timer_init"), EDJE_EXTERNAL_PARAM_INFO_SENTINEL }; diff --git a/src/edje_externals/elm_pager.c b/src/edje_externals/elm_pager.c index 96bed66..4dfcbfe 100644 --- a/src/edje_externals/elm_pager.c +++ b/src/edje_externals/elm_pager.c @@ -18,7 +18,7 @@ external_pager_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fr else if (from_params) p = from_params; else return; - if(p->disable_animation_exists) elm_pager_animation_disabled_set(obj, p->disable_animation); + if(p->disable_animation_exists) elm_pager_animation_disable_set(obj, p->disable_animation); } static Eina_Bool @@ -28,7 +28,7 @@ external_pager_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ext { if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) { - elm_pager_animation_disabled_set(obj, param->i); + elm_pager_animation_disable_set(obj, param->i); return EINA_TRUE; } } diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 7a1d4ce..2258feb 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -4,7 +4,6 @@ */ #ifndef ELEMENTARY_H #define ELEMENTARY_H - /** * @file Elementary.h * @brief Elementary's API @@ -158,7 +157,7 @@ extern "C" { EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT; /* Objects */ - /** + /** * Emitted when policy value changed. */ EAPI extern int ELM_EVENT_POLICY_CHANGED; @@ -463,7 +462,7 @@ extern "C" { typedef enum _Elm_Win_Keyboard_Mode { - ELM_WIN_KEYBOARD_UNKNOWN, + ELM_WIN_KEYBOARD_UNKNOWN, ELM_WIN_KEYBOARD_OFF, ELM_WIN_KEYBOARD_ON, ELM_WIN_KEYBOARD_ALPHA, @@ -543,25 +542,23 @@ extern "C" { * (blank mouse, private mouse obj, defaultmouse) * */ - EAPI void elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode) EINA_ARG_NONNULL(1); - EAPI Elm_Win_Keyboard_Mode elm_win_keyboard_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_win_keyboard_win_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode); + EAPI void elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard); - EAPI void elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y) EINA_ARG_NONNULL(1); + EAPI void elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y); - EAPI Evas_Object *elm_win_inwin_add(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_win_inwin_activate(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_win_inwin_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_win_inwin_add(Evas_Object *obj); + EAPI void elm_win_inwin_activate(Evas_Object *obj); + EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj); /* available styles: * default * minimal * minimal_vertical */ + /* X specific calls - won't work on non-x engines (return 0) */ - EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj); /* smart callbacks called: * "delete,request" - the user requested to delete the window * "focus,in" - window got focus @@ -569,54 +566,19 @@ extern "C" { * "moved" - window that holds the canvas was moved */ - /* bg */ - typedef enum _Elm_Bg_Option - { - ELM_BG_OPTION_CENTER, /**< center the background */ - ELM_BG_OPTION_SCALE, /**< scale the background retaining aspect ratio */ - ELM_BG_OPTION_STRETCH, /**< stretch the background to fill */ - ELM_BG_OPTION_TILE /**< tile background at its original size */ - } Elm_Bg_Option; - - EAPI Evas_Object *elm_bg_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_bg_file_set(Evas_Object *obj, const char *file, const char *group) EINA_ARG_NONNULL(1); - EAPI void elm_bg_file_get(const Evas_Object *obj, const char **file, const char **group) EINA_ARG_NONNULL(1); - EAPI void elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option) EINA_ARG_NONNULL(1); - EAPI Elm_Bg_Option elm_bg_option_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_bg_color_set(Evas_Object *obj, int r, int g, int b) EINA_ARG_NONNULL(1); - EAPI void elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b) EINA_ARG_NONNULL(1); - EAPI void elm_bg_overlay_set(Evas_Object *obj, Evas_Object *overlay) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_bg_overlay_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_bg_overlay_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_bg_add(Evas_Object *parent); + EAPI void elm_bg_file_set(Evas_Object *obj, const char *file, const char *group); /* smart callbacks called: */ - /* icon */ - typedef enum _Elm_Icon_Lookup_Order - { - ELM_ICON_LOOKUP_FDO_THEME, /**< icon look up order: freedesktop, theme */ - ELM_ICON_LOOKUP_THEME_FDO, /**< icon look up order: theme, freedesktop */ - ELM_ICON_LOOKUP_FDO, /**< icon look up order: freedesktop */ - ELM_ICON_LOOKUP_THEME /**< icon look up order: theme */ - } Elm_Icon_Lookup_Order; - - EAPI Evas_Object *elm_icon_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) EINA_ARG_NONNULL(1, 2); - EAPI void elm_icon_file_get(const Evas_Object *obj, const char **file, const char **group) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_icon_standard_set(Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1); - EAPI const char *elm_icon_standard_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_icon_smooth_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_icon_no_scale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) EINA_ARG_NONNULL(1); - EAPI void elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) EINA_ARG_NONNULL(1); - EAPI void elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_icon_fill_outside_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_icon_prescale_set(Evas_Object *obj, int size) EINA_ARG_NONNULL(1); - EAPI int elm_icon_prescale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order) EINA_ARG_NONNULL(1); - EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_icon_add(Evas_Object *parent); + EAPI Eina_Bool elm_icon_file_set(Evas_Object *obj, const char *file, const char *group); + EAPI Eina_Bool elm_icon_standard_set(Evas_Object *obj, const char *name); + EAPI void elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth); + EAPI void elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale); + EAPI void elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down); + EAPI void elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside); + EAPI void elm_icon_prescale_set(Evas_Object *obj, int size); /* smart callbacks called: * "clicked" - the user clicked the icon */ @@ -624,64 +586,39 @@ extern "C" { /* image */ typedef enum _Elm_Image_Orient { - ELM_IMAGE_ORIENT_NONE, - ELM_IMAGE_ROTATE_90_CW, - ELM_IMAGE_ROTATE_180_CW, - ELM_IMAGE_ROTATE_90_CCW, - ELM_IMAGE_FLIP_HORIZONTAL, - ELM_IMAGE_FLIP_VERTICAL, - ELM_IMAGE_FLIP_TRANSPOSE, - ELM_IMAGE_FLIP_TRANSVERSE + ELM_IMAGE_ORIENT_NONE, + ELM_IMAGE_ROTATE_90_CW, + ELM_IMAGE_ROTATE_180_CW, + ELM_IMAGE_ROTATE_90_CCW, + ELM_IMAGE_FLIP_HORIZONTAL, + ELM_IMAGE_FLIP_VERTICAL, + ELM_IMAGE_FLIP_TRANSPOSE, + ELM_IMAGE_FLIP_TRANSVERSE } Elm_Image_Orient; - EAPI Evas_Object *elm_image_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_image_file_set(Evas_Object *obj, const char *file, const char *group) EINA_ARG_NONNULL(1, 2); - EAPI void elm_image_file_get(const Evas_Object *obj, const char **file, const char **group) EINA_ARG_NONNULL(1); - EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_image_smooth_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1); - EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) EINA_ARG_NONNULL(1); - EAPI void elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) EINA_ARG_NONNULL(1); - EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_image_prescale_set(Evas_Object *obj, int size) EINA_ARG_NONNULL(1); - EAPI int elm_image_prescale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient) EINA_ARG_NONNULL(1); - EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_image_editable_set(Evas_Object *obj, Eina_Bool set) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + + EAPI Evas_Object *elm_image_add(Evas_Object *parent); + EAPI Eina_Bool elm_image_file_set(Evas_Object *obj, const char *file, const char *group); + EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth); + EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, int *h); + EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale); + EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down); + EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside); + EAPI void elm_image_prescale_set(Evas_Object *obj, int size); + EAPI void elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient); /* smart callbacks called: * "clicked" - the user clicked the image */ - /* box */ - typedef struct _Elm_Box_Transition Elm_Box_Transition; - - EAPI Evas_Object *elm_box_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_box_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_box_homogenous_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_box_extended_mode_set(Evas_Object *obj, Eina_Bool extended) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_box_extended_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_box_pack_start(Evas_Object *obj, Evas_Object *subobj) EINA_ARG_NONNULL(1); - EAPI void elm_box_pack_end(Evas_Object *obj, Evas_Object *subobj) EINA_ARG_NONNULL(1); - EAPI void elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before) EINA_ARG_NONNULL(1); - EAPI void elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after) EINA_ARG_NONNULL(1); - EAPI void elm_box_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_box_unpack(Evas_Object *obj, Evas_Object *subobj) EINA_ARG_NONNULL(1); - EAPI void elm_box_unpack_all(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_box_children_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_box_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1); - EAPI void elm_box_padding_get(const Evas_Object *obj, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1); - EAPI void elm_box_align_set(Evas_Object *obj, double horizontal, double vertical) EINA_ARG_NONNULL(1); - EAPI void elm_box_align_get(const Evas_Object *obj, double *horizontal, double *vertical) EINA_ARG_NONNULL(1); - - EAPI void elm_box_layout_set(Evas_Object *obj, Evas_Object_Box_Layout cb, const void *data, void (*free_data)(void *data)) EINA_ARG_NONNULL(1); - EAPI void elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data); - EAPI Elm_Box_Transition *elm_box_transition_new(const double duration, Evas_Object_Box_Layout start_layout, void *start_layout_data, void(*start_layout_free_data)(void *data), Evas_Object_Box_Layout end_layout, void *end_layout_data, void(*end_layout_free_data)(void *data), void(*transition_end_cb)(void *data), void *transition_end_data) EINA_ARG_NONNULL(2, 5); - EAPI void elm_box_transition_free(void *data); + EAPI Evas_Object *elm_box_add(Evas_Object *parent); + EAPI void elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + EAPI void elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous); + EAPI void elm_box_pack_start(Evas_Object *obj, Evas_Object *subobj); + EAPI void elm_box_pack_end(Evas_Object *obj, Evas_Object *subobj); + EAPI void elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before); + EAPI void elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after); + EAPI void elm_box_clear(Evas_Object *obj); + EAPI void elm_box_unpack(Evas_Object *obj, Evas_Object *subobj); + EAPI void elm_box_unpack_all(Evas_Object *obj); /* smart callbacks called: */ typedef enum @@ -693,21 +630,39 @@ extern "C" { UIControlStateReserved } UIControlState; - /* button */ - EAPI Evas_Object *elm_button_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_button_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_button_add(Evas_Object *parent); + EAPI void elm_button_label_set(Evas_Object *obj, const char *label); EAPI void elm_button_label_set_for_state(Evas_Object *obj, const char *label, UIControlState state); - EAPI const char *elm_button_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI const char *elm_button_label_get(const Evas_Object *obj); EAPI const char *elm_button_label_get_for_state(const Evas_Object *obj, UIControlState state); - EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_button_autorepeat_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t) EINA_ARG_NONNULL(1); - EAPI double elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t) EINA_ARG_NONNULL(1); - EAPI double elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_button_icon_get(const Evas_Object *obj); + EAPI void elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on); + EAPI void elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t); + EAPI void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t); + + EAPI Evas_Object *elm_fileselector_button_add(Evas_Object *parent); + EAPI void elm_fileselector_button_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_fileselector_button_label_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_fileselector_button_icon_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_window_title_set(Evas_Object *obj, const char *title); + EAPI const char *elm_fileselector_button_window_title_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height); + EAPI void elm_fileselector_button_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height); + EAPI void elm_fileselector_button_path_set(Evas_Object *obj, const char *path); + EAPI const char *elm_fileselector_button_path_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_expandable_set(Evas_Object *obj, Eina_Bool value); + EAPI Eina_Bool elm_fileselector_button_expandable_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_folder_only_set(Evas_Object *obj, Eina_Bool value); + EAPI Eina_Bool elm_fileselector_button_folder_only_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_is_save_set(Evas_Object *obj, Eina_Bool value); + EAPI Eina_Bool elm_fileselector_button_is_save_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_inwin_mode_set(Evas_Object *obj, Eina_Bool value); + EAPI Eina_Bool elm_fileselector_button_inwin_mode_get(const Evas_Object *obj); + EAPI void elm_fileselector_button_selected_set(Evas_Object *obj, const char *path); + EAPI const char *elm_fileselector_button_selected_get(const Evas_Object *obj); + /* available styles: * default * anchor @@ -720,89 +675,32 @@ extern "C" { * "unpressed" - when the button is unpressed (released) */ - /* fileselector */ - EAPI Evas_Object *elm_fileselector_button_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_button_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_fileselector_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_fileselector_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_window_title_set(Evas_Object *obj, const char *title) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_button_window_title_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_path_set(Evas_Object *obj, const char *path) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_button_path_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_expandable_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_button_expandable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_folder_only_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_button_folder_only_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_is_save_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_button_is_save_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_button_inwin_mode_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_button_inwin_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - /* available styles: - * default - * anchor - * hoversel_vertical - * hoversel_vertical_entry - */ - /* smart callbacks called: - * "file,chosen" - the user has selected a path, whose string pointer comes - as event info - */ - - EAPI Evas_Object *elm_fileselector_entry_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_entry_button_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_button_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_fileselector_entry_button_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_fileselector_entry_button_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_window_title_set(Evas_Object *obj, const char *title) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_entry_window_title_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_path_set(Evas_Object *obj, const char *path) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_entry_path_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_expandable_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_entry_expandable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_folder_only_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_entry_folder_only_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_is_save_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_entry_is_save_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_inwin_mode_set(Evas_Object *obj, Eina_Bool value) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_entry_inwin_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_entry_selected_set(Evas_Object *obj, const char *path) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_entry_selected_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - - /* scroller policy */ typedef enum _Elm_Scroller_Policy { - ELM_SCROLLER_POLICY_AUTO = 0, - ELM_SCROLLER_POLICY_ON, - ELM_SCROLLER_POLICY_OFF, - ELM_SCROLLER_POLICY_LAST - } Elm_Scroller_Policy; - - EAPI Evas_Object *elm_scroller_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_scroller_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_scroller_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base) EINA_ARG_NONNULL(1, 2, 3); - EAPI void elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_child_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); - EAPI void elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool propagation); - EAPI Eina_Bool elm_scroller_propagate_events_get(const Evas_Object *obj); - EINA_DEPRECATED EAPI void elm_scroller_page_move_set(Evas_Object *obj, Eina_Bool set); + ELM_SCROLLER_POLICY_AUTO = 0, + ELM_SCROLLER_POLICY_ON, + ELM_SCROLLER_POLICY_OFF, + ELM_SCROLLER_POLICY_LAST + } + Elm_Scroller_Policy; + + EAPI Evas_Object *elm_scroller_add(Evas_Object *parent); + EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child); + EAPI Evas_Object *elm_scroller_content_get(const Evas_Object *obj); + EAPI Evas_Object *elm_scroller_content_unset(Evas_Object *obj); + EAPI void elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base); + EAPI void elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h); + EAPI void elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + EAPI void elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v); + EAPI void elm_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v); + EAPI void elm_scroller_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); + EAPI void elm_scroller_child_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); + EAPI void elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + EAPI void elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel); + EAPI void elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize); + EAPI void elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + EAPI void elm_scroller_page_move_set(Evas_Object *obj, Eina_Bool set); + EAPI void elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool set); /* smart callbacks called: * "edge,left" @@ -816,26 +714,25 @@ extern "C" { * "scroll,drag,stop" */ - /* label */ - EAPI Evas_Object *elm_label_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_label_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_label_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_label_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_label_line_wrap_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w) EINA_ARG_NONNULL(1); - EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_label_wrap_height_set(Evas_Object *obj, Evas_Coord h) EINA_ARG_NONNULL(1); - EAPI Evas_Coord elm_label_wrap_height_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_label_fontsize_set(Evas_Object *obj, int fontsize) EINA_ARG_NONNULL(1); - EAPI void elm_label_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a) EINA_ARG_NONNULL(1); - EAPI void elm_label_text_align_set(Evas_Object *obj, const char *alignmode) EINA_ARG_NONNULL(1); - EAPI void elm_label_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a) EINA_ARG_NONNULL(1); - EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis) EINA_ARG_NONNULL(1); - EAPI void elm_label_wrap_mode_set(Evas_Object *obj, Eina_Bool wrapmode) EINA_ARG_NONNULL(1); - EAPI void elm_label_slide_set(Evas_Object *obj, Eina_Bool slide) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_label_slide_get(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_label_slide_duration_set(Evas_Object *obj, int duration) EINA_ARG_NONNULL(1); - EAPI int elm_label_slide_duration_get(Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_label_add(Evas_Object *parent); + EAPI void elm_label_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_label_label_get(const Evas_Object *obj); + EAPI void elm_label_line_wrap_set(Evas_Object *obj, Eina_Bool wrap); + EAPI Eina_Bool elm_label_line_wrap_get(const Evas_Object *obj); + EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w); + EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj); + EAPI void elm_label_wrap_height_set(Evas_Object *obj, Evas_Coord h); + EAPI Evas_Coord elm_label_wrap_height_get(const Evas_Object *obj); + EAPI void elm_label_fontsize_set(Evas_Object *obj, int fontsize); + EAPI void elm_label_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); + EAPI void elm_label_text_align_set(Evas_Object *obj, const char *alignmode); + EAPI void elm_label_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); + EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis); + EAPI void elm_label_wrap_mode_set(Evas_Object *obj, Eina_Bool wrapmode); + EAPI void elm_label_slide_set(Evas_Object *obj, Eina_Bool slide); + EAPI Eina_Bool elm_label_slide_get(Evas_Object *obj); + EAPI void elm_label_slide_duration_set(Evas_Object *obj, int duration); + EAPI int elm_label_slide_duration_get(Evas_Object *obj); /* available styles: * default * marker @@ -843,29 +740,25 @@ extern "C" { /* smart callbacks called: */ - /* toggle */ - EAPI Evas_Object *elm_toggle_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_toggle_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_toggle_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_toggle_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_toggle_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel) EINA_ARG_NONNULL(1); - EAPI void elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel) EINA_ARG_NONNULL(1); - EAPI void elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toggle_state_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_toggle_add(Evas_Object *parent); + EAPI void elm_toggle_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_toggle_label_get(const Evas_Object *obj); + EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_toggle_icon_get(const Evas_Object *obj); + EAPI void elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel); + EAPI void elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel); + EAPI void elm_toggle_state_set(Evas_Object *obj, Eina_Bool state); + EAPI Eina_Bool elm_toggle_state_get(const Evas_Object *obj); + EAPI void elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep); /* smart callbacks called: * "changed" - the user toggled the state */ - /* frame */ - EAPI Evas_Object *elm_frame_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_frame_label_set(Evas_Object *obj, const char *label); EINA_ARG_NONNULL(1) - EAPI const char *elm_frame_label_get(const Evas_Object *obj); EINA_ARG_NONNULL(1) - EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content); EINA_ARG_NONNULL(1) - EAPI Evas_Object *elm_frame_content_get(const Evas_Object *obj); EINA_ARG_NONNULL(1) - EAPI Evas_Object *elm_frame_content_unset(Evas_Object *obj); EINA_ARG_NONNULL(1) + EAPI Evas_Object *elm_frame_add(Evas_Object *parent); + EAPI void elm_frame_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_frame_label_get(const Evas_Object *obj); + EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_frame_content_unset(Evas_Object *obj); /* available styles: * default * pad_small @@ -878,103 +771,68 @@ extern "C" { /* smart callbacks called: */ - /* table */ - EAPI Evas_Object *elm_table_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_table_homogeneous_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_table_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical) EINA_ARG_NONNULL(1); - EAPI void elm_table_padding_get(const Evas_Object *obj, Evas_Coord *horizontal, Evas_Coord *vertical) EINA_ARG_NONNULL(1); - EAPI void elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h) EINA_ARG_NONNULL(1); - EAPI void elm_table_unpack(Evas_Object *obj, Evas_Object *subobj) EINA_ARG_NONNULL(1); - EAPI void elm_table_clear(Evas_Object *obj, Eina_Bool clear) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_table_add(Evas_Object *parent); + EAPI void elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous); + EAPI void elm_table_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical); + EAPI void elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h); + EAPI void elm_table_unpack(Evas_Object *obj, Evas_Object *subobj); + EAPI void elm_table_clear(Evas_Object *obj, Eina_Bool clear); - /* gengrid */ typedef struct _Elm_Gengrid_Item_Class Elm_Gengrid_Item_Class; typedef struct _Elm_Gengrid_Item_Class_Func Elm_Gengrid_Item_Class_Func; - typedef struct _Elm_Gengrid_Item Elm_Gengrid_Item; /**< Item of Elm_Gengrid. Sub-type of Elm_Widget_Item */ - typedef char *(*GridItemLabelGetFunc) (void *data, Evas_Object *obj, const char *part); - typedef Evas_Object *(*GridItemIconGetFunc) (void *data, Evas_Object *obj, const char *part); - typedef Eina_Bool (*GridItemStateGetFunc) (void *data, Evas_Object *obj, const char *part); - typedef void (*GridItemDelFunc) (void *data, Evas_Object *obj); + typedef struct _Elm_Gengrid_Item Elm_Gengrid_Item; + typedef char *(*GridItemLabelGetFunc) (const void *data, Evas_Object *obj, const char *part); + typedef Evas_Object *(*GridItemIconGetFunc) (const void *data, Evas_Object *obj, const char *part); + typedef Eina_Bool (*GridItemStateGetFunc) (const void *data, Evas_Object *obj, const char *part); + typedef void (*GridItemDelFunc) (const void *data, Evas_Object *obj); struct _Elm_Gengrid_Item_Class { - const char *item_style; - struct _Elm_Gengrid_Item_Class_Func { - GridItemLabelGetFunc label_get; - GridItemIconGetFunc icon_get; - GridItemStateGetFunc state_get; - GridItemDelFunc del; - } func; + const char *item_style; + struct _Elm_Gengrid_Item_Class_Func + { + GridItemLabelGetFunc label_get; + GridItemIconGetFunc icon_get; + GridItemStateGetFunc state_get; + GridItemDelFunc del; + } func; }; - EAPI Evas_Object *elm_gengrid_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_align_get(const Evas_Object *obj, double *align_x, double *align_y) EINA_ARG_NONNULL(1); - - EAPI void elm_gengrid_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_gengrid_always_select_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_gengrid_no_select_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_gengrid_multi_select_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1); - - EAPI Elm_Gengrid_Item *elm_gengrid_first_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Gengrid_Item *elm_gengrid_last_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - - EAPI Elm_Gengrid_Item *elm_gengrid_item_next_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Gengrid_Item *elm_gengrid_item_prev_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_gengrid_item_gengrid_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_del(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_update(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void *elm_gengrid_item_data_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_data_set(Elm_Gengrid_Item *item, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, unsigned int *x, unsigned int *y) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, Eina_Bool selected) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI const Evas_Object *elm_gengrid_item_object_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_show(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_bring_in(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_disabled_set(Elm_Gengrid_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_gengrid_item_disabled_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - - EAPI void elm_gengrid_item_tooltip_text_set(Elm_Gengrid_Item *item, const char *text) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_tooltip_content_cb_set(Elm_Gengrid_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_tooltip_style_set(Elm_Gengrid_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_gengrid_item_tooltip_style_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_cursor_set(Elm_Gengrid_Item *item, const char *cursor) EINA_ARG_NONNULL(1); - EAPI const char *elm_gengrid_item_cursor_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_cursor_unset(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_cursor_style_set(Elm_Gengrid_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_gengrid_item_cursor_style_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_gengrid_item_cursor_engine_only_set(Elm_Gengrid_Item *item, Eina_Bool engine_only) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_gengrid_item_cursor_engine_only_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1); - - EAPI void elm_gengrid_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Gengrid_Item *elm_gengrid_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - - EAPI Elm_Gengrid_Item *elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1); - EAPI Elm_Gengrid_Item *elm_gengrid_item_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1); - EAPI Elm_Gengrid_Item *elm_gengrid_item_insert_before(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Gengrid_Item *relative, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1); - EAPI Elm_Gengrid_Item *elm_gengrid_item_insert_after(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Gengrid_Item *relative, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_gengrid_add(Evas_Object *parent); + EAPI void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); + EAPI void elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); + EAPI void elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y); + EAPI void elm_gengrid_align_get(const Evas_Object *obj, double *align_x, double *align_y); + EAPI void elm_gengrid_item_del(Elm_Gengrid_Item *item); + EAPI void elm_gengrid_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select); + EAPI Eina_Bool elm_gengrid_always_select_mode_get(const Evas_Object *obj); + EAPI void elm_gengrid_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select); + EAPI Eina_Bool elm_gengrid_no_select_mode_get(const Evas_Object *obj); + EAPI void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi); + EAPI Eina_Bool elm_gengrid_multi_select_get(const Evas_Object *obj); + EAPI void elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + EAPI void elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce); + EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting); + EAPI void elm_gengrid_clear(Evas_Object *obj); + EAPI void *elm_gengrid_item_data_get(Elm_Gengrid_Item *item); + EAPI void elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, unsigned int *x, unsigned int *y); + EAPI void elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, Eina_Bool selected); + EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Gengrid_Item *item); + EAPI const Evas_Object *elm_gengrid_item_object_get(Elm_Gengrid_Item *item); + EAPI Elm_Gengrid_Item *elm_gengrid_selected_item_get(const Evas_Object *obj); + EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj); + EAPI const Eina_List *elm_gengrid_items_get(const Evas_Object *obj); + EAPI void elm_gengrid_item_disabled_set(Elm_Gengrid_Item *item, Eina_Bool disabled); + EAPI Eina_Bool elm_gengrid_item_disabled_get(const Elm_Gengrid_Item *item); + EAPI Elm_Gengrid_Item *elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gcc, const void *data, Evas_Smart_Cb func, const void *func_data); + EAPI Elm_Gengrid_Item *elm_gengrid_item_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gcc, const void *data, Evas_Smart_Cb func, const void *func_data); + EAPI void elm_gengrid_item_update(Elm_Gengrid_Item *it); /* smart callbacks called: * * selected - User has selected a item. * unselected - User has unselected a item. * clicked - User has double-clicked a item. * realized - An evas object for a item was built. - * unrealized - An evas object for a item was deleted. - * changed - An item has been added, removed, resized or moved, - * or gengrid has been resized or horizontal property has been changed. * scroll - the content has been scrolled (moved). * "scroll,drag,start" - dragging the contents around has started. * "scroll,drag,stop" - dragging the contents around has stopped. @@ -999,157 +857,61 @@ extern "C" { ELM_CLOCK_ALL = (1 << 6) - 1 } Elm_Clock_Digedit; - EAPI Evas_Object *elm_clock_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec) EINA_ARG_NONNULL(1); - EAPI void elm_clock_time_get(const Evas_Object *obj, int *hrs, int *min, int *sec) EINA_ARG_NONNULL(1); - EAPI void elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_clock_edit_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_clock_digit_edit_set(Evas_Object *obj, Elm_Clock_Digedit digedit) EINA_ARG_NONNULL(1); - EAPI Elm_Clock_Digedit elm_clock_digit_edit_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_clock_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_clock_show_am_pm_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_clock_show_seconds_set(Evas_Object *obj, Eina_Bool seconds) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_clock_show_seconds_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_clock_interval_set(Evas_Object *obj, double interval) EINA_ARG_NONNULL(1); - EAPI double elm_clock_interval_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_clock_add(Evas_Object *parent); + EAPI void elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec); + EAPI void elm_clock_time_get(const Evas_Object *obj, int *hrs, int *min, int *sec); + EAPI void elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit); + EAPI Eina_Bool elm_clock_edit_get(const Evas_Object *obj); + EAPI void elm_clock_digit_edit_set(Evas_Object *obj, Elm_Clock_Digedit digedit); + EAPI Elm_Clock_Digedit elm_clock_digit_edit_get(const Evas_Object *obj); + EAPI void elm_clock_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm); + EAPI Eina_Bool elm_clock_show_am_pm_get(const Evas_Object *obj); + EAPI void elm_clock_show_seconds_set(Evas_Object *obj, Eina_Bool seconds); + EAPI Eina_Bool elm_clock_show_seconds_get(const Evas_Object *obj); + EAPI void elm_clock_interval_set(Evas_Object *obj, double interval); + EAPI double elm_clock_interval_get(const Evas_Object *obj); /* smart callbacks called: * "changed" - the user changed the time */ - /* layout */ - EAPI Evas_Object *elm_layout_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_layout_file_set(Evas_Object *obj, const char *file, const char *group) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, const char *style) EINA_ARG_NONNULL(1); - EAPI void elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI const Evas_Object *elm_layout_content_get(const Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_layout_content_unset(Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1); - EAPI void elm_layout_text_set(Evas_Object *obj, const char *part, const char *text) EINA_ARG_NONNULL(1); - EAPI const char *elm_layout_text_get(const Evas_Object *obj, const char *part) EINA_ARG_NONNULL(1); - EAPI void elm_layout_box_append(Evas_Object *obj, const char *part, Evas_Object *child) EINA_ARG_NONNULL(1); - EAPI void elm_layout_box_prepend(Evas_Object *obj, const char *part, Evas_Object *child) EINA_ARG_NONNULL(1); - EAPI void elm_layout_box_insert_before(Evas_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference) EINA_ARG_NONNULL(1); - EAPI void elm_layout_box_insert_at(Evas_Object *obj, const char *part, Evas_Object *child, unsigned int pos) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_layout_box_remove(Evas_Object *obj, const char *part, Evas_Object *child) EINA_ARG_NONNULL(1, 2, 3); - EAPI void elm_layout_box_remove_all(Evas_Object *obj, const char *part, Eina_Bool clear) EINA_ARG_NONNULL(1, 2); - EAPI void elm_layout_table_pack(Evas_Object *obj, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_layout_table_unpack(Evas_Object *obj, const char *part, Evas_Object *child_obj) EINA_ARG_NONNULL(1, 2, 3); - EAPI void elm_layout_table_clear(Evas_Object *obj, const char *part, Eina_Bool clear) EINA_ARG_NONNULL(1, 2); - EAPI Evas_Object *elm_layout_edje_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_layout_sizing_eval(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_layout_part_cursor_set(Evas_Object *obj, const char *part_name, const char *cursor) EINA_ARG_NONNULL(1, 2); - EAPI const char *elm_layout_part_cursor_get(const Evas_Object *obj, const char *part_name) EINA_ARG_NONNULL(1, 2); - EAPI void elm_layout_part_cursor_unset(Evas_Object *obj, const char *part_name) EINA_ARG_NONNULL(1, 2); - EAPI Eina_Bool elm_layout_part_cursor_style_set(Evas_Object *obj, const char *part_name, const char *style) EINA_ARG_NONNULL(1, 2); - EAPI const char *elm_layout_part_cursor_style_get(const Evas_Object *obj, const char *part_name) EINA_ARG_NONNULL(1, 2); - EAPI Eina_Bool elm_layout_part_cursor_engine_only_set(Evas_Object *obj, const char *part_name, Eina_Bool engine_only) EINA_ARG_NONNULL(1, 2); - EAPI Eina_Bool elm_layout_part_cursor_engine_only_get(const Evas_Object *obj, const char *part_name) EINA_ARG_NONNULL(1, 2); -/** - * @def elm_layout_icon_set - * Convienience macro to set the icon object in a layout that follows the - * Elementary naming convention for its parts. - * - * @ingroup Layout - */ -#define elm_layout_icon_set(_ly, _obj) \ - do { \ - const char *sig; \ - elm_layout_content_set((_ly), "elm.swallow.icon", (_obj)); \ - if ((_obj)) sig = "elm,state,icon,visible"; \ - else sig = "elm,state,icon,hidden"; \ - elm_object_signal_emit((_ly), sig, "elm"); \ - } while (0) - -/** - * @def elm_layout_icon_get - * Convienience macro to get the icon object from a layout that follows the - * Elementary naming convention for its parts. - * - * @ingroup Layout - */ -#define elm_layout_icon_get(_ly) \ - elm_layout_content_get((_ly), "elm.swallow.icon") - -/** - * @def elm_layout_end_set - * Convienience macro to set the end object in a layout that follows the - * Elementary naming convention for its parts. - * - * @ingroup Layout - */ -#define elm_layout_end_set(_ly, _obj) \ - do { \ - const char *sig; \ - elm_layout_content_set((_ly), "elm.swallow.end", (_obj)); \ - if ((_obj)) sig = "elm,state,end,visible"; \ - else sig = "elm,state,end,hidden"; \ - elm_object_signal_emit((_ly), sig, "elm"); \ - } while (0) - -/** - * @def elm_layout_end_get - * Convienience macro to get the end object in a layout that follows the - * Elementary naming convention for its parts. - * - * @ingroup Layout - */ -#define elm_layout_end_get(_ly) \ - elm_layout_content_get((_ly), "elm.swallow.end") - -/** - * @def elm_layout_label_set - * Convienience macro to set the label in a layout that follows the - * Elementary naming convention for its parts. - * - * @ingroup Layout - */ -#define elm_layout_label_set(_ly, _txt) \ - elm_layout_text_set((_ly), "elm.text", (_txt)) - -/** - * @def elm_layout_label_get - * Convienience macro to get the label in a layout that follows the - * Elementary naming convention for its parts. - * - * @ingroup Layout - */ -#define elm_layout_label_get(_ly) \ - elm_layout_text_get((_ly), "elm.text") - + EAPI Evas_Object *elm_layout_add(Evas_Object *parent); + EAPI Eina_Bool elm_layout_file_set(Evas_Object *obj, const char *file, const char *group); + EAPI Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, const char *style); + EAPI void elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content); + EAPI Evas_Object *elm_layout_content_unset(Evas_Object *obj, const char *swallow); + EAPI Evas_Object *elm_layout_edje_get(const Evas_Object *obj); + EAPI void elm_layout_sizing_eval(Evas_Object *obj); /* smart callbacks called: */ - /* notify */ typedef enum _Elm_Notify_Orient { - ELM_NOTIFY_ORIENT_TOP, - ELM_NOTIFY_ORIENT_CENTER, - ELM_NOTIFY_ORIENT_BOTTOM, - ELM_NOTIFY_ORIENT_LEFT, - ELM_NOTIFY_ORIENT_RIGHT, - ELM_NOTIFY_ORIENT_TOP_LEFT, - ELM_NOTIFY_ORIENT_TOP_RIGHT, - ELM_NOTIFY_ORIENT_BOTTOM_LEFT, - ELM_NOTIFY_ORIENT_BOTTOM_RIGHT, - ELM_NOTIFY_ORIENT_LAST + ELM_NOTIFY_ORIENT_TOP, + ELM_NOTIFY_ORIENT_CENTER, + ELM_NOTIFY_ORIENT_BOTTOM, + ELM_NOTIFY_ORIENT_LEFT, + ELM_NOTIFY_ORIENT_RIGHT, + ELM_NOTIFY_ORIENT_TOP_LEFT, + ELM_NOTIFY_ORIENT_TOP_RIGHT, + ELM_NOTIFY_ORIENT_BOTTOM_LEFT, + ELM_NOTIFY_ORIENT_BOTTOM_RIGHT, + ELM_NOTIFY_ORIENT_LAST } Elm_Notify_Orient; - EAPI Evas_Object *elm_notify_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_notify_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_notify_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_notify_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_notify_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient) EINA_ARG_NONNULL(1); - EAPI Elm_Notify_Orient elm_notify_orient_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_notify_timeout_set(Evas_Object *obj, double timeout) EINA_ARG_NONNULL(1); - EAPI double elm_notify_timeout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_notify_repeat_events_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_notify_add(Evas_Object *parent); + EAPI void elm_notify_content_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_notify_content_unset(Evas_Object *obj); + EAPI Evas_Object *elm_notify_content_get(const Evas_Object *obj); + EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient); + EAPI Elm_Notify_Orient elm_notify_orient_get(const Evas_Object *obj); + EAPI void elm_notify_timeout_set(Evas_Object *obj, int timeout); + EAPI int elm_notify_timeout_get(const Evas_Object *obj); + EAPI void elm_notify_timer_init(Evas_Object *obj); + EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat); + EAPI Eina_Bool elm_notify_repeat_events_get(const Evas_Object *obj); /* smart callbacks called: - * "timeout" - when timeout happens on notify and it's hidden - * "block,clicked" - when it's hidden by a click outside of the notify's view */ - /* hover */ typedef enum _Elm_Hover_Axis { ELM_HOVER_AXIS_NONE, @@ -1157,15 +919,14 @@ extern "C" { ELM_HOVER_AXIS_VERTICAL, ELM_HOVER_AXIS_BOTH } Elm_Hover_Axis; - EAPI Evas_Object *elm_hover_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_hover_target_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_hover_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_hover_content_get(const Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_hover_content_unset(Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1); - EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_hover_add(Evas_Object *parent); + EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target); + EAPI Evas_Object *elm_hover_target_get(Evas_Object *obj); + EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI Evas_Object *elm_hover_parent_get(Evas_Object *obj); + EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content); + EAPI Evas_Object *elm_hover_content_unset(Evas_Object *obj, const char *swallow); + EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis); /* available styles: * default * popout @@ -1174,17 +935,14 @@ extern "C" { */ /* smart callbacks called: * "clicked" - the user clicked the empty space in the hover to dismiss - * "smart,changed" - a content object placed under the "smart" - * policy was replaced to a new slot direction. */ - /* entry */ typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info; struct _Elm_Entry_Anchor_Info { const char *name; - int button; - Evas_Coord x, y, w, h; + int button; + Evas_Coord x, y, w, h; }; typedef enum _Elm_Icon_Type { @@ -1192,6 +950,7 @@ extern "C" { ELM_ICON_FILE, ELM_ICON_STANDARD } Elm_Icon_Type; + typedef struct _Elm_Hoversel_Item Elm_Hoversel_Item; typedef enum _Elm_Input_Panel_Layout { @@ -1215,85 +974,64 @@ extern "C" { ELM_INPUT_PANEL_LAYOUT_CUSTOM_10 } Elm_Input_Panel_Layout; - typedef struct _Elm_Hoversel_Item Elm_Hoversel_Item; /**< Item of Elm_Hoversel. Sub-type of Elm_Widget_Item */ - - EAPI Evas_Object *elm_entry_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1); - EAPI const char *elm_entry_entry_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const char *elm_entry_selection_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1); - EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) EINA_ARG_NONNULL(1); - EAPI void elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap) EINA_ARG_NONNULL(1); - EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_select_none(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_select_all(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_cursor_begin_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_cursor_end_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_cursor_selection_end(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_cursor_is_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const char *elm_entry_cursor_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_selection_cut(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_selection_copy(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_selection_paste(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_context_menu_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_entry_text_filter_append(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_entry_text_filter_prepend(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_entry_text_filter_remove(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) EINA_ARG_NONNULL(1, 2); + EAPI Evas_Object *elm_entry_add(Evas_Object *parent); + EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line); + EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj); + EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password); + EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj); + EINA_DEPRECATED EAPI void elm_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character); + + EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry); + EAPI const char *elm_entry_entry_get(const Evas_Object *obj); + EAPI const char *elm_entry_selection_get(const Evas_Object *obj); + EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry); + EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap); + EAPI void elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap); + EAPI void elm_entry_wrap_width_set(Evas_Object *obj, Evas_Coord w); + EAPI Evas_Coord elm_entry_wrap_width_get(const Evas_Object *obj); + EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable); + EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj); + EAPI void elm_entry_select_none(Evas_Object *obj); + EAPI void elm_entry_select_all(Evas_Object *obj); + EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj); + EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj); + EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj); + EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj); + EAPI void elm_entry_cursor_begin_set(Evas_Object *obj); + EAPI void elm_entry_cursor_end_set(Evas_Object *obj); + EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj); + EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj); + EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj); + EAPI void elm_entry_cursor_selection_end(Evas_Object *obj); + EAPI Eina_Bool elm_entry_cursor_is_format_get(const Evas_Object *obj); + EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Evas_Object *obj); + EAPI const char *elm_entry_cursor_content_get(const Evas_Object *obj); + EAPI void elm_entry_selection_cut(Evas_Object *obj); + EAPI void elm_entry_selection_copy(Evas_Object *obj); + EAPI void elm_entry_selection_paste(Evas_Object *obj); + EAPI void elm_entry_context_menu_clear(Evas_Object *obj); + EAPI void elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled); + EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj); + EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data); + EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data); + EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data); EAPI char *elm_entry_markup_to_utf8(const char *s); EAPI char *elm_entry_utf8_to_markup(const char *s); - EINA_DEPRECATED EAPI void elm_entry_fontsize_set(Evas_Object *obj, int fontsize); - EINA_DEPRECATED EAPI void elm_entry_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); - EINA_DEPRECATED EAPI void elm_entry_text_align_set(Evas_Object *obj, const char *alignmode); + EAPI void elm_entry_fontsize_set(Evas_Object *obj, int fontsize); + EAPI void elm_entry_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); + EAPI void elm_entry_text_align_set(Evas_Object *obj, const char *alignmode); EAPI void elm_entry_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); - EINA_DEPRECATED EAPI void elm_entry_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis); - EAPI void elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) EINA_ARG_NONNULL(1); - EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format) EINA_ARG_NONNULL(1); - EAPI void elm_entry_file_save(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_entry_autosave_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_entry_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis); + EAPI void elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool autocap); EAPI void elm_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod); EAPI void elm_entry_autoenable_returnkey_set(Evas_Object *obj, Eina_Bool on); EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled); EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout); EAPI Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj); - EINA_DEPRECATED EAPI void elm_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes); - + EAPI void elm_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes); - /* pre-made filters for entries */ - typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size; - struct _Elm_Entry_Filter_Limit_Size - { - int max_char_count; - int max_byte_count; - }; - EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text) EINA_ARG_NONNULL(1, 2, 3); - typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set; - struct _Elm_Entry_Filter_Accept_Set - { - const char *accepted; - const char *rejected; - }; - EAPI void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text) EINA_ARG_NONNULL(1, 3); /* smart callbacks called: * "changed" - the text content changed * "selection,start" - the user started selecting text @@ -1324,35 +1062,32 @@ extern "C" { /* smart callbacks called: */ - /* anchorview */ typedef struct _Elm_Entry_Anchorview_Info Elm_Entry_Anchorview_Info; struct _Elm_Entry_Anchorview_Info { - const char *name; - int button; - Evas_Object *hover; - struct { - Evas_Coord x, y, w, h; - } anchor, hover_parent; - Eina_Bool hover_left : 1; - Eina_Bool hover_right : 1; - Eina_Bool hover_top : 1; - Eina_Bool hover_bottom : 1; + const char *name; + int button; + Evas_Object *hover; + struct + { + Evas_Coord x, y, w, h; + } anchor, hover_parent; + Eina_Bool hover_left : 1; + Eina_Bool hover_right : 1; + Eina_Bool hover_top : 1; + Eina_Bool hover_bottom : 1; }; - EAPI Evas_Object *elm_anchorview_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_anchorview_text_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1); - EAPI const char *elm_anchorview_text_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - - EAPI void elm_anchorview_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_anchorview_hover_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_anchorview_hover_style_set(Evas_Object *obj, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_anchorview_hover_style_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_anchorview_hover_end(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_anchorview_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_anchorview_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_anchorview_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorview, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_anchorview_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorview, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_anchorview_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorview, const char *item), void *data) EINA_ARG_NONNULL(1, 2); + EAPI Evas_Object *elm_anchorview_add(Evas_Object *parent); + EAPI void elm_anchorview_text_set(Evas_Object *obj, const char *text); + EAPI const char *elm_anchorview_text_get(const Evas_Object *obj); + + EAPI void elm_anchorview_hover_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI void elm_anchorview_hover_style_set(Evas_Object *obj, const char *style); + EAPI void elm_anchorview_hover_end(Evas_Object *obj); + EAPI void elm_anchorview_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + EAPI void elm_anchorview_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorview, const char *item), void *data); + EAPI void elm_anchorview_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorview, const char *item), void *data); + EAPI void elm_anchorview_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorview, const char *item), void *data); /* smart callbacks called: * "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorview_Info */ @@ -1361,61 +1096,57 @@ extern "C" { typedef struct _Elm_Entry_Anchorblock_Info Elm_Entry_Anchorblock_Info; struct _Elm_Entry_Anchorblock_Info { - const char *name; - int button; - Evas_Object *hover; - struct { - Evas_Coord x, y, w, h; - } anchor, hover_parent; - Eina_Bool hover_left : 1; - Eina_Bool hover_right : 1; - Eina_Bool hover_top : 1; - Eina_Bool hover_bottom : 1; + const char *name; + int button; + Evas_Object *hover; + struct + { + Evas_Coord x, y, w, h; + } anchor, hover_parent; + Eina_Bool hover_left : 1; + Eina_Bool hover_right : 1; + Eina_Bool hover_top : 1; + Eina_Bool hover_bottom : 1; }; - EAPI Evas_Object *elm_anchorblock_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_anchorblock_text_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1); - EAPI const char *elm_anchorblock_text_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_anchorblock_hover_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_anchorblock_hover_style_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_anchorblock_hover_end(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_anchorblock_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorblock, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_anchorblock_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorblock, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_anchorblock_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorblock, const char *item), void *data) EINA_ARG_NONNULL(1, 2); + EAPI Evas_Object *elm_anchorblock_add(Evas_Object *parent); + EAPI void elm_anchorblock_text_set(Evas_Object *obj, const char *text); + EAPI const char *elm_anchorblock_text_get(const Evas_Object *obj); + EAPI void elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI void elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style); + EAPI void elm_anchorblock_hover_end(Evas_Object *obj); + EAPI void elm_anchorblock_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorblock, const char *item), void *data); + EAPI void elm_anchorblock_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorblock, const char *item), void *data); + EAPI void elm_anchorblock_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *anchorblock, const char *item), void *data); /* smart callbacks called: * "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorblock_Info */ - /* bubble */ - EAPI Evas_Object *elm_bubble_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_bubble_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_bubble_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_bubble_info_set(Evas_Object *obj, const char *info) EINA_ARG_NONNULL(1); - EAPI const char *elm_bubble_info_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - - EAPI void elm_bubble_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_bubble_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_bubble_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_bubble_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_bubble_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_bubble_sweep_layout_set(Evas_Object *obj, Evas_Object *sweep) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_bubble_sweep_layout_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_bubble_corner_set(Evas_Object *obj, const char *corner) EINA_ARG_NONNULL(1, 2); - EAPI const char *elm_bubble_corner_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_bubble_add(Evas_Object *parent); + EAPI void elm_bubble_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_bubble_label_get(const Evas_Object *obj); + EAPI void elm_bubble_info_set(Evas_Object *obj, const char *info); + EAPI const char *elm_bubble_info_get(const Evas_Object *obj); + + EAPI void elm_bubble_content_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_bubble_content_get(const Evas_Object *obj); + EAPI Evas_Object *elm_bubble_content_unset(Evas_Object *obj); + EAPI void elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_bubble_icon_get(const Evas_Object *obj); + EAPI Evas_Object *elm_bubble_icon_unset(Evas_Object *obj); + EAPI void elm_bubble_sweep_layout_set(Evas_Object *obj, Evas_Object *sweep); + EAPI Evas_Object *elm_bubble_sweep_layout_unset(Evas_Object *obj); + EAPI void elm_bubble_corner_set(Evas_Object *obj, const char *corner); /* smart callbacks called: - * "clicked" - the user clicked the bubble + * "clicked" - This is called when a user has clicked the bubble * "sweep,left,right" - when bubble is sweeped from left to right, this signal is sent. - * "sweep,right,left" - when bubble is sweeped from right to left, this signal is sent. + * "sweep,right,left" - when bubble is sweeped from right to left, this signal is sent. */ - - /* photo */ - EAPI Evas_Object *elm_photo_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_photo_file_set(Evas_Object *obj, const char *file) EINA_ARG_NONNULL(1); - EAPI void elm_photo_size_set(Evas_Object *obj, int size) EINA_ARG_NONNULL(1); - EAPI void elm_photo_fill_inside_set(Evas_Object *obj, Eina_Bool fill) EINA_ARG_NONNULL(1); - EAPI void elm_photo_editable_set(Evas_Object *obj, Eina_Bool set) EINA_ARG_NONNULL(1); + + EAPI Evas_Object *elm_photo_add(Evas_Object *parent); + EAPI Eina_Bool elm_photo_file_set(Evas_Object *obj, const char *file); + EAPI void elm_photo_size_set(Evas_Object *obj, int size); + EAPI void elm_photo_fill_inside_set(Evas_Object *obj, Eina_Bool fill); + EAPI void elm_photo_editable_set(Evas_Object *obj, Eina_Bool set); /* smart callbacks called: * "clicked" - the user clicked the icon */ @@ -1429,22 +1160,19 @@ extern "C" { ELM_THUMB_ANIMATION_LAST } Elm_Thumb_Animation_Setting; - EAPI Evas_Object *elm_thumb_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_thumb_reload(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1); - EAPI void elm_thumb_file_get(const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1); - EAPI void elm_thumb_path_get(const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1); - EAPI void elm_thumb_animate_set(Evas_Object *obj, Elm_Thumb_Animation_Setting s) EINA_ARG_NONNULL(1); - EAPI Elm_Thumb_Animation_Setting elm_thumb_animate_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void *elm_thumb_ethumb_client_get(void); - EAPI Eina_Bool elm_thumb_ethumb_client_connected(void); - EAPI Eina_Bool elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_thumb_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - /* available styles: - * default - * noframe - * - * smart callbacks called: + EAPI Evas_Object *elm_thumb_add(Evas_Object *parent); + EAPI void elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key); + EAPI void elm_thumb_file_get(const Evas_Object *obj, const char **file, const char **key); + EAPI void elm_thumb_path_get(const Evas_Object *obj, const char **file, const char **key); + EAPI void elm_thumb_animate_set(Evas_Object *obj, Elm_Thumb_Animation_Setting s); + EAPI Elm_Thumb_Animation_Setting elm_thumb_animate_get(const Evas_Object *obj); + EAPI Eina_Bool elm_thumb_ethumb_client_connected(void); +#ifdef ELM_ETHUMB + EAPI Ethumb_Client *elm_thumb_ethumb_client_get(void); +#else + EAPI void *elm_thumb_ethumb_client_get(void); +#endif + /* smart callbacks called: * "clicked" - the user clicked the thumb * "clicked,double" - the user double clicked the thumb * "press" - the user pressed the thumb @@ -1454,117 +1182,70 @@ extern "C" { * "load,error" - the thumbnail image loading failed */ - /* hoversel */ - EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_hoversel_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_hoversel_hover_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_hoversel_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_hoversel_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_hoversel_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_hover_begin(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_hover_end(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_hoversel_expanded_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_hoversel_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Hoversel_Item *elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_item_del(Elm_Hoversel_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_item_del_cb_set(Elm_Hoversel_Item *it, Evas_Smart_Cb func) EINA_ARG_NONNULL(1); - EAPI void *elm_hoversel_item_data_get(const Elm_Hoversel_Item *it) EINA_ARG_NONNULL(1); - EAPI const char *elm_hoversel_item_label_get(const Elm_Hoversel_Item *it) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_item_icon_set(Elm_Hoversel_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type) EINA_ARG_NONNULL(1); - EAPI void elm_hoversel_item_icon_get(const Elm_Hoversel_Item *it, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent); + EAPI void elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + EAPI Eina_Bool elm_hoversel_horizontal_get(const Evas_Object *obj); + EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI void elm_hoversel_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_hoversel_label_get(const Evas_Object *obj); + EAPI void elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_hoversel_icon_get(const Evas_Object *obj); + EAPI void elm_hoversel_hover_begin(Evas_Object *obj); + EAPI void elm_hoversel_hover_end(Evas_Object *obj); + EAPI Eina_Bool elm_hoversel_expanded_get(Evas_Object *obj); + EAPI void elm_hoversel_clear(Evas_Object *obj); + EAPI const Eina_List *elm_hoversel_items_get(const Evas_Object *obj); + EAPI Elm_Hoversel_Item *elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + EAPI void elm_hoversel_item_del(Elm_Hoversel_Item *item); + EAPI void elm_hoversel_item_del_cb_set(Elm_Hoversel_Item *it, Evas_Smart_Cb func); + EAPI void *elm_hoversel_item_data_get(Elm_Hoversel_Item *it); + EAPI const char *elm_hoversel_item_label_get(Elm_Hoversel_Item *it); + EAPI void elm_hoversel_item_icon_set(Elm_Hoversel_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type); + EAPI void elm_hoversel_item_icon_get(Elm_Hoversel_Item *it, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type); /* smart callbacks called: * "clicked" - the user clicked the hoversel button and popped up the sel * "selected" - an item in the hoversel list is selected * "dismissed" - the hover is dismissed */ - /* toolbar */ - typedef enum _Elm_Toolbar_Shrink_Mode - { - ELM_TOOLBAR_SHRINK_NONE, /**< set toolbar minimun size to fit all the items */ - ELM_TOOLBAR_SHRINK_HIDE, /**< hide excess items */ - ELM_TOOLBAR_SHRINK_SCROLL, /**< allow accessing excess items through a scroller */ - ELM_TOOLBAR_SHRINK_MENU /**< inserts a button to pop up a menu with excess items */ - } Elm_Toolbar_Shrink_Mode; - - typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item; /**< Item of Elm_Toolbar. Sub-type of Elm_Widget_Item */ - typedef struct _Elm_Toolbar_Item_State Elm_Toolbar_Item_State; /** State of a Elm_Toolbar_Item */ - - EAPI Evas_Object *elm_toolbar_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size) EINA_ARG_NONNULL(1); - EAPI int elm_toolbar_icon_size_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order) EINA_ARG_NONNULL(1); - EAPI Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_no_select_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_item_insert_before(Evas_Object *obj, Elm_Toolbar_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_item_insert_after(Evas_Object *obj, Elm_Toolbar_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_first_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_last_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_item_next_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_item_prev_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_toolbar_item_toolbar_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_priority_set(Elm_Toolbar_Item *item, int priority) EINA_ARG_NONNULL(1); - EAPI int elm_toolbar_item_priority_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI const char *elm_toolbar_item_icon_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI const char *elm_toolbar_item_label_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_label_set(Elm_Toolbar_Item *item, const char *label) EINA_ARG_NONNULL(1); - EAPI void *elm_toolbar_item_data_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_data_set(Elm_Toolbar_Item *item, const void *data) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item *elm_toolbar_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_icon_set(Elm_Toolbar_Item *item, const char *icon) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_del(Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_del_cb_set(Elm_Toolbar_Item *item, Evas_Smart_Cb func) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_item_disabled_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_disabled_set(Elm_Toolbar_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_separator_set(Elm_Toolbar_Item *item, Eina_Bool separator) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_mode_shrink_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_homogenous_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_toolbar_menu_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_align_set(Evas_Object *obj, double align) EINA_ARG_NONNULL(1); - EAPI double elm_toolbar_align_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_toolbar_item_menu_get(Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_add(Elm_Toolbar_Item *item, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Toolbar_Item *item, Elm_Toolbar_Item_State *state) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Toolbar_Item *it, Elm_Toolbar_Item_State *state) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_state_unset(Elm_Toolbar_Item *it) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Toolbar_Item *it) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Toolbar_Item *it) EINA_ARG_NONNULL(1); - EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Toolbar_Item *it) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_tooltip_text_set(Elm_Toolbar_Item *item, const char *text) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_tooltip_content_cb_set(Elm_Toolbar_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_tooltip_unset(Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_tooltip_style_set(Elm_Toolbar_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_toolbar_item_tooltip_style_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_cursor_set(Elm_Toolbar_Item *item, const char *cursor) EINA_ARG_NONNULL(1); - EAPI const char *elm_toolbar_item_cursor_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_cursor_unset(Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_cursor_style_set(Elm_Toolbar_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_toolbar_item_cursor_style_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_toolbar_item_cursor_engine_only_set(Elm_Toolbar_Item *item, Eina_Bool engine_only) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_toolbar_item_cursor_engine_only_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); + typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item; + EAPI Evas_Object *elm_toolbar_add(Evas_Object *parent); + EAPI void elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size); + EAPI int elm_toolbar_icon_size_get(const Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data); + EAPI Evas_Object *elm_toolbar_item_icon_get(Elm_Toolbar_Item *item); + EAPI const char *elm_toolbar_item_label_get(const Elm_Toolbar_Item *item); + EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Toolbar_Item *item); + EAPI void elm_toolbar_item_label_set(Elm_Toolbar_Item *item, const char *label); + EAPI void elm_toolbar_item_del(Elm_Toolbar_Item *item); + EAPI void elm_toolbar_item_del_cb_set(Elm_Toolbar_Item *it, Evas_Smart_Cb func); + EAPI void elm_toolbar_item_select(Elm_Toolbar_Item *item); + EAPI Eina_Bool elm_toolbar_item_disabled_get(Elm_Toolbar_Item *item); + EAPI void elm_toolbar_item_disabled_set(Elm_Toolbar_Item *item, Eina_Bool disabled); + EAPI void elm_toolbar_item_separator_set(Elm_Toolbar_Item *item, Eina_Bool separator); + EAPI Eina_Bool elm_toolbar_item_separator_get(Elm_Toolbar_Item *item); + EAPI Eina_List *elm_toolbar_item_get_all(Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_get_first(Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_get_last(Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_get_next(Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_select_next(Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_select_first(Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_select_last(Evas_Object *obj); + EAPI Elm_Toolbar_Item *elm_toolbar_item_find_by_label(Evas_Object *obj, const char *label); + EAPI void elm_toolbar_scrollable_set(Evas_Object *obj, Eina_Bool scrollable); + EAPI Eina_Bool elm_toolbar_scrollable_get(Evas_Object *obj); + EAPI void elm_toolbar_homogenous_set(Evas_Object *obj, Eina_Bool homogenous); + EAPI Eina_Bool elm_toolbar_homogenous_get(Evas_Object *obj); + EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI Evas_Object *elm_toolbar_menu_parent_get(Evas_Object *obj); + EAPI void elm_toolbar_item_unselect_all(Evas_Object *obj); + EAPI void elm_toolbar_align_set(Evas_Object *obj, double align); + EAPI double elm_toolbar_align_get(const Evas_Object *obj); + EAPI void elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu); + EAPI Evas_Object *elm_toolbar_item_menu_get(Elm_Toolbar_Item *item); /* smart callbacks called: * "clicked" - when the user clicks on a toolbar item and becomes selected */ - /* available styles: - * default - * transparent (no background or shadow, just show the provided content) - */ /* tooltip */ EAPI double elm_tooltip_delay_get(void); @@ -1589,27 +1270,25 @@ extern "C" { EAPI Eina_Bool elm_cursor_engine_only_set(int engine_only); /* menu */ - typedef struct _Elm_Menu_Item Elm_Menu_Item; /**< Item of Elm_Menu. Sub-type of Elm_Widget_Item */ - EAPI Evas_Object *elm_menu_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_menu_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_menu_object_get(const Elm_Menu_Item *it) EINA_ARG_NONNULL(1); - EAPI Elm_Menu_Item *elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_menu_item_label_set(Elm_Menu_Item *item, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_menu_item_label_get(const Elm_Menu_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_menu_item_icon_set(Elm_Menu_Item *item, const char *icon) EINA_ARG_NONNULL(1, 2); - EAPI const char *elm_menu_item_icon_get(const Elm_Menu_Item *item) EINA_ARG_NONNULL(1); - EAPI const Evas_Object *elm_menu_item_object_icon_get(const Elm_Menu_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_menu_item_disabled_set(Elm_Menu_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_menu_item_disabled_get(const Elm_Menu_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Menu_Item *elm_menu_item_separator_add(Evas_Object *obj, Elm_Menu_Item *parent) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_menu_item_is_separator(Elm_Menu_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_menu_item_del(Elm_Menu_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_menu_item_del_cb_set(Elm_Menu_Item *it, Evas_Smart_Cb func) EINA_ARG_NONNULL(1); - EAPI void *elm_menu_item_data_get(const Elm_Menu_Item *it) EINA_ARG_NONNULL(1); - EAPI void elm_menu_item_data_set(Elm_Menu_Item *item, const void *data) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_menu_item_subitems_get(const Elm_Menu_Item *item) EINA_ARG_NONNULL(1); + typedef struct _Menu_Item Elm_Menu_Item; + EAPI Evas_Object *elm_menu_add(Evas_Object *parent); + EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI void elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); + EAPI Evas_Object *elm_menu_object_get(const Elm_Menu_Item *it); + EAPI Elm_Menu_Item *elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data); + EAPI void elm_menu_item_label_set(Elm_Menu_Item *item, const char *label); + EAPI const char *elm_menu_item_label_get(Elm_Menu_Item *item); + EAPI void elm_menu_item_icon_set(Elm_Menu_Item *item, Evas_Object *icon); + EAPI Evas_Object *elm_menu_item_icon_get(Elm_Menu_Item *item); + EAPI void elm_menu_item_disabled_set(Elm_Menu_Item *item, Eina_Bool disabled); + EAPI Eina_Bool elm_menu_item_disabled_get(Elm_Menu_Item *item); + EAPI Elm_Menu_Item *elm_menu_item_separator_add(Evas_Object *obj, Elm_Menu_Item *parent); + EAPI Eina_Bool elm_menu_item_is_separator(Elm_Menu_Item *item); + EAPI void elm_menu_item_del(Elm_Menu_Item *item); + EAPI void elm_menu_item_del_cb_set(Elm_Menu_Item *it, Evas_Smart_Cb func); + EAPI void *elm_menu_item_data_get(const Elm_Menu_Item *it); + EAPI void elm_menu_item_data_set(Elm_Menu_Item *item, const void *data); + EAPI const Eina_List *elm_menu_item_subitems_get(Elm_Menu_Item *item); /* smart callbacks called: * "clicked" - the user clicked the empty space in the menu to dismiss. event_info is NULL. */ @@ -1617,79 +1296,57 @@ extern "C" { /* list */ typedef enum _Elm_List_Mode { - ELM_LIST_COMPRESS = 0, - ELM_LIST_SCROLL, - ELM_LIST_LIMIT, - ELM_LIST_EXPAND, - ELM_LIST_LAST + ELM_LIST_COMPRESS = 0, + ELM_LIST_SCROLL, + ELM_LIST_LIMIT, + ELM_LIST_LAST } Elm_List_Mode; - typedef struct _Elm_List_Item Elm_List_Item; /**< Item of Elm_List. Sub-type of Elm_Widget_Item */ - EAPI Evas_Object *elm_list_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Elm_List_Item *elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI Elm_List_Item *elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI Elm_List_Item *elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2); - EAPI Elm_List_Item *elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1, 2); - EAPI Elm_List_Item *elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func) EINA_ARG_NONNULL(1); - EAPI void elm_list_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_list_go(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_list_multi_select_set(Evas_Object *obj, Eina_Bool multi) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_list_multi_select_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_list_mode_set(Evas_Object *obj, Elm_List_Mode mode) EINA_ARG_NONNULL(1); - EAPI Elm_List_Mode elm_list_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_list_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_list_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_list_always_select_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_list_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_List_Item *elm_list_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_list_selected_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_separator_set(Elm_List_Item *it, Eina_Bool setting) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_list_item_separator_get(const Elm_List_Item *it) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_selected_set(Elm_List_Item *item, Eina_Bool selected) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_list_item_selected_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_show(Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_bring_in(Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_del(Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_del_cb_set(Elm_List_Item *item, Evas_Smart_Cb func) EINA_ARG_NONNULL(1); - EAPI void *elm_list_item_data_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_list_item_icon_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_icon_set(Elm_List_Item *item, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_list_item_end_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_end_set(Elm_List_Item *item, Evas_Object *end) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_list_item_base_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI const char *elm_list_item_label_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_label_set(Elm_List_Item *item, const char *text) EINA_ARG_NONNULL(1); - EAPI Elm_List_Item *elm_list_item_prev(const Elm_List_Item *it) EINA_ARG_NONNULL(1); - EAPI Elm_List_Item *elm_list_item_next(const Elm_List_Item *it) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_tooltip_text_set(Elm_List_Item *item, const char *text) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_tooltip_content_cb_set(Elm_List_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_tooltip_unset(Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_tooltip_style_set(Elm_List_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_list_item_tooltip_style_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_cursor_set(Elm_List_Item *item, const char *cursor) EINA_ARG_NONNULL(1); - EAPI const char *elm_list_item_cursor_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_cursor_unset(Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_cursor_style_set(Elm_List_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_list_item_cursor_style_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_cursor_engine_only_set(Elm_List_Item *item, Eina_Bool engine_only) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_list_item_cursor_engine_only_get(const Elm_List_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_list_item_disabled_get(const Elm_List_Item *it) EINA_ARG_NONNULL(1); - EAPI void elm_list_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_list_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_list_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) EINA_ARG_NONNULL(1); - EAPI void elm_list_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) EINA_ARG_NONNULL(1); - EINA_DEPRECATED EAPI void elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode); - EINA_DEPRECATED EAPI Elm_List_Mode elm_list_horizontal_mode_get(const Evas_Object *obj); + typedef struct _Elm_List_Item Elm_List_Item; + EAPI Evas_Object *elm_list_add(Evas_Object *parent); + EAPI Elm_List_Item *elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + EAPI Elm_List_Item *elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + EAPI Elm_List_Item *elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + EAPI Elm_List_Item *elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data); + EAPI Elm_List_Item *elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func); + EAPI void elm_list_clear(Evas_Object *obj); + EAPI void elm_list_go(Evas_Object *obj); + EAPI void elm_list_multi_select_set(Evas_Object *obj, Eina_Bool multi); + EAPI Eina_Bool elm_list_multi_select_get(const Evas_Object *obj); + EAPI void elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode); + EAPI Elm_List_Mode elm_list_horizontal_mode_get(const Evas_Object *obj); + EAPI void elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select); + EAPI Eina_Bool elm_list_always_select_mode_get(const Evas_Object *obj); + EAPI const Eina_List *elm_list_items_get(const Evas_Object *obj); + EAPI Elm_List_Item *elm_list_selected_item_get(const Evas_Object *obj); + EAPI const Eina_List *elm_list_selected_items_get(const Evas_Object *obj); + + EAPI void elm_list_item_separator_set(Elm_List_Item *it, Eina_Bool setting); + EAPI Eina_Bool elm_list_item_separator_get(const Elm_List_Item *it); + + EAPI void elm_list_item_selected_set(Elm_List_Item *item, Eina_Bool selected); + EAPI Eina_Bool elm_list_item_selected_get(Elm_List_Item *item); + EAPI void elm_list_item_show(Elm_List_Item *item); + EAPI void elm_list_item_del(Elm_List_Item *item); + EAPI void elm_list_item_del_cb_set(Elm_List_Item *item, Evas_Smart_Cb func); + EAPI void *elm_list_item_data_get(const Elm_List_Item *item); + EAPI Evas_Object *elm_list_item_icon_get(const Elm_List_Item *item); + EAPI void elm_list_item_icon_set(Elm_List_Item *item, Evas_Object *icon); + EAPI Evas_Object *elm_list_item_end_get(const Elm_List_Item *item); + EAPI void elm_list_item_end_set(Elm_List_Item *item, Evas_Object *end); + EAPI Evas_Object *elm_list_item_base_get(const Elm_List_Item *item); + EAPI const char *elm_list_item_label_get(const Elm_List_Item *item); + EAPI void elm_list_item_label_set(Elm_List_Item *item, const char *text); + EAPI Elm_List_Item *elm_list_item_prev(const Elm_List_Item *it); + EAPI Elm_List_Item *elm_list_item_next(const Elm_List_Item *it); + EAPI void elm_list_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + EAPI void elm_list_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v); + EAPI void elm_list_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v); + /* smart callbacks called: * "clicked" - when the user double-clicked an item * "selected" - when the user selected an item * "unselected" - when the user selected an item * "longpressed" - an item in the hoversel list is long-pressed - * "scroll,edge,top" - the list is scrolled until the top edge - * "scroll,edge,bottom" - the list is scrolled until the bottom edge - * "scroll,edge,left" - the list is scrolled until the left edge - * "scroll,edge,right" - the list is scrolled until the right edge */ // FIXME: incomplete - carousel. don't use this until this comment is removed @@ -1702,38 +1359,32 @@ extern "C" { * "clicked" - when the user clicks on a carousel item and becomes selected */ - /* slider */ - EAPI Evas_Object *elm_slider_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_slider_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_slider_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_slider_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_slider_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_end_set(Evas_Object *obj, Evas_Object *end) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_slider_end_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_slider_end_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) EINA_ARG_NONNULL(1); - EAPI Evas_Coord elm_slider_span_size_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_unit_format_set(Evas_Object *obj, const char *format) EINA_ARG_NONNULL(1); - EAPI const char *elm_slider_unit_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator) EINA_ARG_NONNULL(1); - EAPI const char *elm_slider_indicator_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(double val)) EINA_ARG_NONNULL(1); - EAPI void elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_slider_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_min_max_set(Evas_Object *obj, double min, double max) EINA_ARG_NONNULL(1); - EAPI void elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max) EINA_ARG_NONNULL(1); - EAPI void elm_slider_value_set(Evas_Object *obj, double val) EINA_ARG_NONNULL(1); - EAPI double elm_slider_value_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_slider_inverted_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_slider_indicator_show_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EINA_DEPRECATED EAPI Eina_Bool elm_slider_end_icon_set(Evas_Object *obj, Evas_Object *icon); - EINA_DEPRECATED EAPI Evas_Object *elm_slider_end_icon_get(Evas_Object *obj); - EINA_DEPRECATED EAPI void elm_slider_value_animated_set(Evas_Object *obj, double val); - EINA_DEPRECATED EAPI void elm_slider_end_label_set(Evas_Object *obj, const char *label); - EINA_DEPRECATED EAPI const char *elm_slider_end_label_get(const Evas_Object *obj); + EAPI Evas_Object *elm_slider_add(Evas_Object *parent); + EAPI void elm_slider_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_slider_label_get(const Evas_Object *obj); + EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_slider_icon_get(const Evas_Object *obj); + EAPI void elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size); + EAPI Evas_Coord elm_slider_span_size_get(const Evas_Object *obj); + EAPI void elm_slider_unit_format_set(Evas_Object *obj, const char *format); + EAPI const char *elm_slider_unit_format_get(const Evas_Object *obj); + EAPI void elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator); + EAPI const char *elm_slider_indicator_format_get(const Evas_Object *obj); + EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(double val)); + EAPI void elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + EAPI Eina_Bool elm_slider_horizontal_get(const Evas_Object *obj); + EAPI void elm_slider_min_max_set(Evas_Object *obj, double min, double max); + EAPI void elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max); + EAPI void elm_slider_value_set(Evas_Object *obj, double val); + EAPI double elm_slider_value_get(const Evas_Object *obj); + EAPI void elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted); + EAPI Eina_Bool elm_slider_inverted_get(const Evas_Object *obj); + EAPI Eina_Bool elm_slider_end_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_slider_end_icon_get(Evas_Object *obj); + EAPI void elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show); + EAPI void elm_slider_value_animated_set(Evas_Object *obj, double val); + EAPI void elm_slider_end_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_slider_end_label_get(const Evas_Object *obj); /* smart callbacks called: * "changed" - Whenever the slider value is changed by the user. * @@ -1751,8 +1402,7 @@ extern "C" { typedef enum _Elm_Genlist_Item_Flags { ELM_GENLIST_ITEM_NONE = 0, - ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), - ELM_GENLIST_ITEM_GROUP = (1 << 1) + ELM_GENLIST_ITEM_SUBITEMS = (1 << 0) } Elm_Genlist_Item_Flags; typedef enum _Elm_Genlist_Edit_Mode { @@ -1828,8 +1478,8 @@ extern "C" { /* operations to add items */ EAPI Elm_Genlist_Item *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); EAPI Elm_Genlist_Item *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); - EAPI Elm_Genlist_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent,Elm_Genlist_Item *before, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); - EAPI Elm_Genlist_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item *after, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); + EAPI Elm_Genlist_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *before, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); + EAPI Elm_Genlist_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *after, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); /* operations to retrieve existing items */ EAPI Elm_Genlist_Item *elm_genlist_selected_item_get(const Evas_Object *obj); EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj); @@ -1878,47 +1528,40 @@ extern "C" { EAPI Eina_List * elm_genlist_edit_selected_items_get(const Evas_Object *obj); EAPI void elm_genlist_item_rename_mode_set(Elm_Genlist_Item *it, int emode); + EAPI Elm_Genlist_GroupItem *elm_genlist_groupitem_add(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data); + EAPI void elm_genlist_groupitem_del( Elm_Genlist_GroupItem *git); + EAPI Elm_Genlist_Item *elm_genlist_item_append_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Elm_Genlist_GroupItem *git, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data); + EAPI Elm_Genlist_Item *elm_genlist_item_prepend_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Elm_Genlist_GroupItem *git, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data); EAPI void elm_genlist_item_move_after(Elm_Genlist_Item *it, Elm_Genlist_Item *after ); EAPI void elm_genlist_effect_set(const Evas_Object *obj, Eina_Bool emode); EAPI void elm_genlist_pinch_zoom_set(Evas_Object *obj, Eina_Bool emode); EAPI void elm_genlist_pinch_zoom_mode_set(Evas_Object *obj, Eina_Bool emode); EAPI Eina_Bool elm_genlist_pinch_zoom_mode_get(const Evas_Object *obj); - EINA_DEPRECATED EAPI void elm_genlist_queue_exception_set(const Evas_Object *obj, Eina_Bool emode); - EINA_DEPRECATED EAPI Elm_Genlist_Item *elm_genlist_groupitem_add(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data); - EINA_DEPRECATED EAPI void elm_genlist_groupitem_del(Elm_Genlist_Item *git); - EINA_DEPRECATED EAPI Elm_Genlist_Item *elm_genlist_item_append_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Elm_Genlist_Item *git, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data); - EINA_DEPRECATED EAPI Elm_Genlist_Item *elm_genlist_item_prepend_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Elm_Genlist_Item *git, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data); - - /* check */ - EAPI Evas_Object *elm_check_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_check_label_set(Evas_Object *obj, const char *label); EINA_ARG_NONNULL(1) - EAPI const char *elm_check_label_get(const Evas_Object *obj); EINA_ARG_NONNULL(1) - EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon); EINA_ARG_NONNULL(1) - EAPI Evas_Object *elm_check_icon_get(const Evas_Object *obj); EINA_ARG_NONNULL(1) - EAPI Evas_Object *elm_check_icon_unset(Evas_Object *obj); EINA_ARG_NONNULL(1) - EAPI void elm_check_state_set(Evas_Object *obj, Eina_Bool state); EINA_ARG_NONNULL(1) - EAPI Eina_Bool elm_check_state_get(const Evas_Object *obj); EINA_ARG_NONNULL(1) - EAPI void elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep); EINA_ARG_NONNULL(1) - - /* radio */ - EAPI Evas_Object *elm_radio_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_radio_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_radio_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_radio_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_radio_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_radio_group_add(Evas_Object *obj, Evas_Object *group) EINA_ARG_NONNULL(1); - EAPI void elm_radio_state_value_set(Evas_Object *obj, int value) EINA_ARG_NONNULL(1); - EAPI int elm_radio_state_value_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_radio_value_set(Evas_Object *obj, int value) EINA_ARG_NONNULL(1); - EAPI int elm_radio_value_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_radio_value_pointer_set(Evas_Object *obj, int *valuep) EINA_ARG_NONNULL(1); + + EAPI Evas_Object *elm_check_add(Evas_Object *parent); + EAPI void elm_check_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_check_label_get(const Evas_Object *obj); + EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_check_icon_get(const Evas_Object *obj); + EAPI void elm_check_state_set(Evas_Object *obj, Eina_Bool state); + EAPI Eina_Bool elm_check_state_get(const Evas_Object *obj); + EAPI void elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep); + + EAPI Evas_Object *elm_radio_add(Evas_Object *parent); + EAPI void elm_radio_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_radio_label_get(const Evas_Object *obj); + EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_radio_icon_get(const Evas_Object *obj); + EAPI void elm_radio_group_add(Evas_Object *obj, Evas_Object *group); + EAPI void elm_radio_state_value_set(Evas_Object *obj, int value); + EAPI void elm_radio_value_set(Evas_Object *obj, int value); + EAPI int elm_radio_value_get(const Evas_Object *obj); + EAPI void elm_radio_value_pointer_set(Evas_Object *obj, int *valuep); typedef struct _Elm_Segment_Item Elm_Segment_Item; EAPI Evas_Object *elm_segment_control_add(Evas_Object *parent); EAPI void elm_segment_control_item_selected_set(Elm_Segment_Item *item, Eina_Bool select); - EAPI Elm_Segment_Item * elm_segment_control_item_selected_get(const Evas_Object *obj); EAPI int elm_segment_control_item_index_get(Elm_Segment_Item *item); EAPI Evas_Object *elm_segment_control_item_object_get(Elm_Segment_Item *it); EAPI Evas_Object *elm_segment_control_item_label_object_set(Elm_Segment_Item *item, char *label); @@ -1935,15 +1578,14 @@ extern "C" { EAPI void elm_page_control_page_count_set(Evas_Object *obj, unsigned int page_count); EAPI void elm_page_control_page_id_set(Evas_Object *obj, unsigned int page_id); EAPI unsigned int elm_page_control_page_id_get(Evas_Object *obj); - /* pager */ - EAPI Evas_Object *elm_pager_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_pager_content_push(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI void elm_pager_content_pop(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_pager_content_promote(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_pager_content_bottom_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_pager_content_top_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_pager_to_content_pop(Evas_Object *obj, Evas_Object *content); EINA_ARG_NONNULL(1); - EAPI void elm_pager_animation_disabled_set(Evas_Object *obj, Eina_Bool disable); EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_pager_add(Evas_Object *parent); + EAPI void elm_pager_content_push(Evas_Object *obj, Evas_Object *content); + EAPI void elm_pager_content_pop(Evas_Object *obj); + EAPI void elm_pager_to_content_pop(Evas_Object *obj, Evas_Object *content); + EAPI void elm_pager_content_promote(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_pager_content_bottom_get(const Evas_Object *obj); + EAPI Evas_Object *elm_pager_content_top_get(const Evas_Object *obj); + EAPI void elm_pager_animation_disable_set(Evas_Object *obj, Eina_Bool disable); /* available item styles: * default @@ -1954,89 +1596,80 @@ extern "C" { typedef struct _Elm_Slideshow_Item_Class Elm_Slideshow_Item_Class; typedef struct _Elm_Slideshow_Item_Class_Func Elm_Slideshow_Item_Class_Func; - typedef struct _Elm_Slideshow_Item Elm_Slideshow_Item; /**< Item of Elm_Slideshow. Sub-type of Elm_Widget_Item */ + typedef struct _Elm_Slideshow_Item Elm_Slideshow_Item; typedef Evas_Object *(*SlideshowItemGetFunc) (void *data, Evas_Object *obj); typedef void (*SlideshowItemDelFunc) (void *data, Evas_Object *obj); struct _Elm_Slideshow_Item_Class { - struct _Elm_Slideshow_Item_Class_Func { - SlideshowItemGetFunc get; - SlideshowItemDelFunc del; - } func; + struct _Elm_Slideshow_Item_Class_Func + { + SlideshowItemGetFunc get; + SlideshowItemDelFunc del; + } func; }; - EAPI Evas_Object *elm_slideshow_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Elm_Slideshow_Item *elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_show(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_next(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_previous(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_slideshow_transitions_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_transition_set(Evas_Object *obj, const char *transition) EINA_ARG_NONNULL(1); - EAPI const char *elm_slideshow_transition_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_timeout_set(Evas_Object *obj ,int timeout) EINA_ARG_NONNULL(1); - EAPI int elm_slideshow_timeout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_slideshow_loop_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_slideshow_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_item_del(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1); - EAPI void *elm_slideshow_item_data_get(const Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Slideshow_Item *elm_slideshow_item_current_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object* elm_slideshow_item_object_get(const Elm_Slideshow_Item* item) EINA_ARG_NONNULL(1); - EAPI const char *elm_slideshow_layout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_slideshow_layout_set(Evas_Object *obj, const char *layout) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_slideshow_layouts_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - - /* file selector */ - typedef enum _Elm_Fileselector_Mode - { - ELM_FILESELECTOR_LIST = 0, - ELM_FILESELECTOR_GRID, - ELM_FILESELECTOR_LAST - } Elm_Fileselector_Mode; - - EAPI Evas_Object *elm_fileselector_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_is_save_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_folder_only_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool buttons) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_expandable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_path_set(Evas_Object *obj, const char *path) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_path_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const char *elm_fileselector_selected_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_fileselector_selected_set(Evas_Object *obj, const char *path) EINA_ARG_NONNULL(1); - EAPI void elm_fileselector_mode_set(Evas_Object *obj, Elm_Fileselector_Mode mode) EINA_ARG_NONNULL(1); - EAPI Elm_Fileselector_Mode elm_fileselector_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_slideshow_add(Evas_Object *parent); + EAPI Elm_Slideshow_Item *elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data); + EAPI void elm_slideshow_show(Elm_Slideshow_Item *item); + EAPI void elm_slideshow_next(Evas_Object *obj); + EAPI void elm_slideshow_previous(Evas_Object *obj); + EAPI const Eina_List *elm_slideshow_transitions_get(const Evas_Object *obj); + EAPI void elm_slideshow_transition_set(Evas_Object *obj, const char *); + EAPI const char *elm_slideshow_transition_get(const Evas_Object *obj); + EAPI void elm_slideshow_timeout_set(Evas_Object *obj ,int timeout); + EAPI int elm_slideshow_timeout_get(const Evas_Object *obj); + EAPI void elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop); + EAPI Eina_Bool elm_slideshow_loop_get(const Evas_Object *obj); + EAPI void elm_slideshow_clear(Evas_Object *obj); + EAPI const Eina_List *elm_slideshow_items_get(const Evas_Object *obj); + EAPI void elm_slideshow_item_del(Elm_Slideshow_Item *item); + EAPI void *elm_slideshow_item_data_get(Elm_Slideshow_Item *item); + EAPI Elm_Slideshow_Item *elm_slideshow_item_current_get(const Evas_Object *obj); + EAPI Evas_Object* elm_slideshow_item_object_get(Elm_Slideshow_Item* item); + EAPI const char *elm_slideshow_layout_get(const Evas_Object *obj); + EAPI void elm_slideshow_layout_set(Evas_Object *obj, const char *layout); + EAPI const Eina_List *elm_slideshow_layouts_get(const Evas_Object *obj); + + + EAPI Evas_Object *elm_fileselector_add(Evas_Object *parent); + EAPI void elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save); + EAPI Eina_Bool elm_fileselector_is_save_get(const Evas_Object *obj); + EAPI void elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only); + EAPI Eina_Bool elm_fileselector_folder_only_get(const Evas_Object *obj); + EAPI void elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool buttons); + EAPI Eina_Bool elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj); + EAPI Eina_Bool elm_fileselector_expandable_get(const Evas_Object *obj); + EAPI void elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand); + EAPI void elm_fileselector_path_set(Evas_Object *obj, const char *path); + EAPI const char *elm_fileselector_path_get(const Evas_Object *obj); + EAPI const char *elm_fileselector_selected_get(const Evas_Object *obj); + EAPI Eina_Bool elm_fileselector_selected_set(Evas_Object *obj, const char *path); + /* smart callbacks called: * "selected" - the user click on a file * "directory,open" - the list is populate with a new content. event_info is a directory. * "done" - the user click on the ok or cancel buttons */ - /* progressbar */ - EAPI Evas_Object *elm_progressbar_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_pulse_set(Evas_Object *obj, Eina_Bool pulse) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_progressbar_pulse_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_pulse(Evas_Object *obj, Eina_Bool state) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_value_set(Evas_Object *obj, double val) EINA_ARG_NONNULL(1); - EAPI double elm_progressbar_value_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_progressbar_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_progressbar_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_progressbar_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_span_size_set(Evas_Object *obj, Evas_Coord size) EINA_ARG_NONNULL(1); - EAPI Evas_Coord elm_progressbar_span_size_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_unit_format_set(Evas_Object *obj, const char *format) EINA_ARG_NONNULL(1); - EAPI const char *elm_progressbar_unit_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_progressbar_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_progressbar_inverted_set(Evas_Object *obj, Eina_Bool inverted) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_progressbar_inverted_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_progressbar_add(Evas_Object *parent); + EAPI void elm_progressbar_pulse_set(Evas_Object *obj, Eina_Bool pulse); + EAPI Eina_Bool elm_progressbar_pulse_get(const Evas_Object *obj); + EAPI void elm_progressbar_pulse(Evas_Object *obj, Eina_Bool state); + EAPI void elm_progressbar_value_set(Evas_Object *obj, double val); + EAPI double elm_progressbar_value_get(const Evas_Object *obj); + EAPI void elm_progressbar_label_set(Evas_Object *obj, const char *label); + EAPI const char *elm_progressbar_label_get(const Evas_Object *obj); + EAPI void elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon); + EAPI Evas_Object *elm_progressbar_icon_get(const Evas_Object *obj); + EAPI void elm_progressbar_span_size_set(Evas_Object *obj, Evas_Coord size); + EAPI Evas_Coord elm_progressbar_span_size_get(const Evas_Object *obj); + EAPI void elm_progressbar_unit_format_set(Evas_Object *obj, const char *format); + EAPI const char *elm_progressbar_unit_format_get(const Evas_Object *obj); + EAPI void elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + EAPI Eina_Bool elm_progressbar_horizontal_get(const Evas_Object *obj); + EAPI void elm_progressbar_inverted_set(Evas_Object *obj, Eina_Bool inverted); + EAPI Eina_Bool elm_progressbar_inverted_get(const Evas_Object *obj); /* smart callbacks called: */ /* available item styles: @@ -2044,30 +1677,28 @@ extern "C" { * wheel (simple style, no text, no progression, only pulse is available) */ - /* separator */ - EAPI Evas_Object *elm_separator_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_separator_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_separator_add(Evas_Object *parent); + EAPI void elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + EAPI Eina_Bool elm_separator_horizontal_get(const Evas_Object *obj); /* smart callbacks called: */ - /* spinner */ - EAPI Evas_Object *elm_spinner_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_label_format_set(Evas_Object *obj, const char *fmt) EINA_ARG_NONNULL(1); - EAPI const char *elm_spinner_label_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_min_max_set(Evas_Object *obj, double min, double max) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_min_max_get(const Evas_Object *obj, double *min, double *max) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_step_set(Evas_Object *obj, double step) EINA_ARG_NONNULL(1); - EAPI double elm_spinner_step_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_value_set(Evas_Object *obj, double val) EINA_ARG_NONNULL(1); - EAPI double elm_spinner_value_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_wrap_set(Evas_Object *obj, Eina_Bool wrap) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_spinner_wrap_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_editable_set(Evas_Object *obj, Eina_Bool editable) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_spinner_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_special_value_add(Evas_Object *obj, double value, const char *label) EINA_ARG_NONNULL(1); - EAPI void elm_spinner_interval_set(Evas_Object *obj, double interval) EINA_ARG_NONNULL(1); - EAPI double elm_spinner_interval_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_spinner_add(Evas_Object *parent); + EAPI void elm_spinner_label_format_set(Evas_Object *obj, const char *fmt); + EAPI const char *elm_spinner_label_format_get(const Evas_Object *obj); + EAPI void elm_spinner_min_max_set(Evas_Object *obj, double min, double max); + EAPI void elm_spinner_min_max_get(const Evas_Object *obj, double *min, double *max); + EAPI void elm_spinner_step_set(Evas_Object *obj, double step); + EAPI double elm_spinner_step_get(const Evas_Object *obj); + EAPI void elm_spinner_value_set(Evas_Object *obj, double val); + EAPI double elm_spinner_value_get(const Evas_Object *obj); + EAPI void elm_spinner_wrap_set(Evas_Object *obj, Eina_Bool wrap); + EAPI Eina_Bool elm_spinner_wrap_get(const Evas_Object *obj); + EAPI void elm_spinner_editable_set(Evas_Object *obj, Eina_Bool editable); + EAPI Eina_Bool elm_spinner_editable_get(const Evas_Object *obj); + EAPI void elm_spinner_special_value_add(Evas_Object *obj, double value, const char *label); + EAPI void elm_spinner_interval_set(Evas_Object *obj, double interval); + EAPI double elm_spinner_interval_get(const Evas_Object *obj); /* smart callbacks called: * "changed" - when the spinner value changes * "delay,changed" - when the spinner value changed, but a small time after a change (use this if you only want to respond to a change once the spinner is held still for a short while). @@ -2102,31 +1733,30 @@ extern "C" { * "selected" - when the user releases heir finger and selects an item */ - /* photocam */ typedef enum _Elm_Photocam_Zoom_Mode { - ELM_PHOTOCAM_ZOOM_MODE_MANUAL = 0, - ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT, - ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL, - ELM_PHOTOCAM_ZOOM_MODE_LAST + ELM_PHOTOCAM_ZOOM_MODE_MANUAL = 0, + ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT, + ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL, + ELM_PHOTOCAM_ZOOM_MODE_LAST } Elm_Photocam_Zoom_Mode; + EAPI Evas_Object *elm_photocam_add(Evas_Object *parent); + EAPI int elm_photocam_file_set(Evas_Object *obj, const char *file); + EAPI const char * elm_photocam_file_get(const Evas_Object *obj); + EAPI void elm_photocam_zoom_set(Evas_Object *obj, double zoom); + EAPI double elm_photocam_zoom_get(const Evas_Object *obj); + EAPI void elm_photocam_zoom_mode_set(Evas_Object *obj, Elm_Photocam_Zoom_Mode mode); + EAPI Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get(const Evas_Object *obj); + EAPI void elm_photocam_image_size_get(const Evas_Object *obj, int *w, int *h); + EAPI void elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h); + EAPI void elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h); + EAPI void elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h); + EAPI void elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused); + EAPI Eina_Bool elm_photocam_paused_get(const Evas_Object *obj); + EAPI Evas_Object *elm_photocam_internal_image_get(const Evas_Object *obj); + EAPI void elm_photocam_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + EAPI void elm_photocam_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce); - EAPI Evas_Object *elm_photocam_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Evas_Load_Error elm_photocam_file_set(Evas_Object *obj, const char *file) EINA_ARG_NONNULL(1); - EAPI const char *elm_photocam_file_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_zoom_set(Evas_Object *obj, double zoom) EINA_ARG_NONNULL(1); - EAPI double elm_photocam_zoom_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_zoom_mode_set(Evas_Object *obj, Elm_Photocam_Zoom_Mode mode) EINA_ARG_NONNULL(1); - EAPI Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_image_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_photocam_paused_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_photocam_internal_image_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_photocam_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1); /* smart callbacks called: * "clicked" - when image clicked * "press" - when mouse/finger held down initially on image @@ -2161,6 +1791,7 @@ extern "C" { ELM_MAP_SOURCE_OSMARENDER, ELM_MAP_SOURCE_CYCLEMAP, ELM_MAP_SOURCE_MAPLINT, + ELM_MAP_SOURCE_DECARTA, ELM_MAP_SOURCE_CUSTOM_1, ELM_MAP_SOURCE_CUSTOM_2, ELM_MAP_SOURCE_CUSTOM_3, @@ -2171,57 +1802,60 @@ extern "C" { ELM_MAP_SOURCE_LAST } Elm_Map_Sources; - typedef struct _Elm_Map_Marker Elm_Map_Marker; + typedef struct _Elm_Map_Marker Elm_Map_Marker; typedef struct _Elm_Map_Marker_Class Elm_Map_Marker_Class; - typedef struct _Elm_Map_Group_Class Elm_Map_Group_Class; + typedef struct _Elm_Map_Group_Class Elm_Map_Group_Class; typedef Evas_Object *(*ElmMapMarkerGetFunc) (Evas_Object *obj, Elm_Map_Marker *marker, void *data); typedef void (*ElmMapMarkerDelFunc) (Evas_Object *obj, Elm_Map_Marker *marker, void *data, Evas_Object *o); typedef Evas_Object *(*ElmMapMarkerIconGetFunc) (Evas_Object *obj, Elm_Map_Marker *marker, void *data); - typedef Evas_Object *(*ElmMapGroupIconGetFunc) (Evas_Object *obj, void *data); - typedef char *(*ElmMapSourceURLFunc) (Evas_Object *obj, int x, int y, int zoom); - - EAPI Evas_Object *elm_map_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1); - EAPI double elm_map_zoom_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode) EINA_ARG_NONNULL(1); - EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_map_geo_region_get(const Evas_Object *obj, double *lon, double *lat) EINA_ARG_NONNULL(1); - EAPI void elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1); - EAPI void elm_map_geo_region_show(Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1); - EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_map_paused_markers_set(Evas_Object *obj, Eina_Bool paused) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_map_paused_markers_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_map_utils_downloading_status_get(const Evas_Object *obj, int *try_num, int *finish_num) EINA_ARG_NONNULL(1, 2, 3); - EAPI void elm_map_utils_convert_coord_into_geo(const Evas_Object *obj, int x, int y, int size, double *lon, double *lat); - EAPI void elm_map_utils_convert_geo_into_coord(const Evas_Object *obj, double lon, double lat, int size, int *x, int *y); - EAPI Elm_Map_Marker *elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Class *clas, Elm_Map_Group_Class *clas_group, void *data) EINA_ARG_NONNULL(1, 4, 5); - EAPI void elm_map_max_marker_per_group_set(Evas_Object *obj, int max) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_remove(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_bring_in(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_show(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1); - EAPI void elm_map_markers_list_show(Eina_List *markers) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_map_marker_object_get(const Elm_Map_Marker *marker) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_update(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1); - EAPI void elm_map_bubbles_close(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Map_Group_Class *elm_map_group_class_new(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style) EINA_ARG_NONNULL(1); - EAPI void elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFunc icon_get) EINA_ARG_NONNULL(1); - EAPI void elm_map_group_class_data_set(Elm_Map_Group_Class *clas, void *data) EINA_ARG_NONNULL(1); - EAPI void elm_map_group_class_zoom_displayed_set(Elm_Map_Group_Class *clas, int zoom) EINA_ARG_NONNULL(1); - EAPI void elm_map_group_class_zoom_grouped_set(Elm_Map_Group_Class *clas, int zoom) EINA_ARG_NONNULL(1); - EAPI void elm_map_group_class_hide_set(Evas_Object *obj, Elm_Map_Group_Class *clas, Eina_Bool hide) EINA_ARG_NONNULL(1, 2); - EAPI Elm_Map_Marker_Class *elm_map_marker_class_new(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGetFunc icon_get) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc get) EINA_ARG_NONNULL(1); - EAPI void elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc del) EINA_ARG_NONNULL(1); - EAPI void elm_map_source_set(Evas_Object *obj, Elm_Map_Sources source) EINA_ARG_NONNULL(1); - EAPI Elm_Map_Sources elm_map_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_map_source_custom_api_set(Elm_Map_Sources source, const char *label, int zoom_min, int zoom_max, ElmMapSourceURLFunc url_cb) EINA_ARG_NONNULL(2, 5); - EAPI int elm_map_source_zoom_min_get(Elm_Map_Sources source); - EAPI int elm_map_source_zoom_max_get(Elm_Map_Sources source); - EAPI const char *elm_map_source_name_get(Elm_Map_Sources source); + typedef Evas_Object *(*ElmMapGroupIconGetFunc) (Evas_Object *obj, void *data); + typedef char *(*ElmMapSourceURLFunc) (void *data, int x, int y, int zoom); + + EAPI Evas_Object *elm_map_add(Evas_Object *parent); + EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom); + EAPI double elm_map_zoom_get(const Evas_Object *obj); + EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode); + EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj); + EAPI void elm_map_geo_region_get(const Evas_Object *obj, double *lon, double *lat); + EAPI void elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat); + EAPI void elm_map_geo_region_show(Evas_Object *obj, double lon, double lat); + EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused); + EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj); + EAPI void elm_map_paused_markers_set(Evas_Object *obj, Eina_Bool paused); + EAPI Eina_Bool elm_map_paused_markers_get(const Evas_Object *obj); + EAPI void elm_map_utils_convert_coord_into_geo(const Evas_Object *obj, int x, int y, int size, double *lon, double *lat); + EAPI void elm_map_utils_convert_geo_into_coord(const Evas_Object *obj, double lon, double lat, int size, int *x, int *y); + EAPI Elm_Map_Marker *elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Class *clas, Elm_Map_Group_Class *clas_group, void *data); + EAPI void elm_map_max_marker_per_group_set(Evas_Object *obj, int max); + EAPI void elm_map_marker_remove(Elm_Map_Marker *marker); + EAPI void elm_map_marker_bring_in(Elm_Map_Marker *marker); + EAPI void elm_map_marker_show(Elm_Map_Marker *marker); + EAPI void elm_map_markers_list_show(Eina_List *markers); + EAPI Evas_Object *elm_map_marker_object_get(Elm_Map_Marker *marker); + EAPI void elm_map_marker_update(Elm_Map_Marker *marker); + EAPI void elm_map_bubbles_close(Evas_Object *obj); + + EAPI Elm_Map_Group_Class * elm_map_group_class_new(Evas_Object *obj); + EAPI void elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style); + EAPI void elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFunc icon_get); + EAPI void elm_map_group_class_data_set(Elm_Map_Group_Class *clas, void *data); + EAPI void elm_map_group_class_zoom_displayed_set(Elm_Map_Group_Class *clas, int zoom); + EAPI void elm_map_group_class_zoom_grouped_set(Elm_Map_Group_Class *clas, int zoom); + EAPI void elm_map_group_class_hide_set(Evas_Object *obj, Elm_Map_Group_Class *clas, Eina_Bool hide); + + EAPI Elm_Map_Marker_Class * elm_map_marker_class_new(Evas_Object *obj); + EAPI void elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style); + EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGetFunc icon_get); + EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc get); + EAPI void elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc del); + + EAPI void elm_map_source_set(Evas_Object *obj, Elm_Map_Sources source); + EAPI Elm_Map_Sources elm_map_source_get(const Evas_Object *obj); + EAPI void elm_map_source_custom_api_set(Elm_Map_Sources source, const char *label, + int zoom_min, int zoom_max, ElmMapSourceURLFunc url_cb); + EAPI int elm_map_source_zoom_min_get(Elm_Map_Sources source); + EAPI int elm_map_source_zoom_max_get(Elm_Map_Sources source); + EAPI const char *elm_map_source_name_get(Elm_Map_Sources source); /* smart callbacks called: * "clicked" - when image clicked * "press" - when mouse/finger held down initially on image @@ -2247,16 +1881,15 @@ extern "C" { ELM_PANEL_ORIENT_LEFT, ELM_PANEL_ORIENT_RIGHT, } Elm_Panel_Orient; + EAPI Evas_Object *elm_panel_add(Evas_Object *parent); + EAPI void elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient); + EAPI Elm_Panel_Orient elm_panel_orient_get(Evas_Object *obj); + EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_panel_content_unset(Evas_Object *obj); + EAPI void elm_panel_hidden_set(Evas_Object *obj, Eina_Bool hidden); + EAPI Eina_Bool elm_panel_hidden_get(Evas_Object *obj); + EAPI void elm_panel_toggle(Evas_Object *obj); - EAPI Evas_Object *elm_panel_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient) EINA_ARG_NONNULL(1); - EAPI Elm_Panel_Orient elm_panel_orient_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_panel_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_panel_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_panel_hidden_set(Evas_Object *obj, Eina_Bool hidden) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_panel_hidden_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_panel_toggle(Evas_Object *obj) EINA_ARG_NONNULL(1); /* panes */ /** @@ -2265,19 +1898,20 @@ extern "C" { * Update the minimun height of the bar in the theme. No minimun should be set in the vertical theme * Add events (move, start ...) */ - EAPI Evas_Object *elm_panes_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI void elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_panes_content_left_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_panes_content_right_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_panes_content_left_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_panes_content_right_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI double elm_panes_content_left_size_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_panes_content_left_size_set(Evas_Object *obj, double size) EINA_ARG_NONNULL(1); - EAPI void elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_panes_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_panes_fixed_set(Evas_Object *obj, Eina_Bool fixed) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_panes_fixed_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_panes_add(Evas_Object *parent); + EAPI void elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content); + EAPI void elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_panes_content_left_get(const Evas_Object *obj); + EAPI Evas_Object *elm_panes_content_right_get(const Evas_Object *obj); + EAPI Evas_Object *elm_panes_content_left_unset(Evas_Object *obj); + EAPI Evas_Object *elm_panes_content_right_unset(Evas_Object *obj); + EAPI double elm_panes_content_left_size_get(const Evas_Object *obj); + EAPI void elm_panes_content_left_size_set(Evas_Object *obj, double size); + EAPI void elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + EAPI Eina_Bool elm_panes_horizontal_get(const Evas_Object *obj); + EAPI void elm_panes_fixed_set(Evas_Object *obj, Eina_Bool fixed); + EAPI Eina_Bool elm_panes_fixed_get(const Evas_Object *obj); + /* flip */ typedef enum _Elm_Flip_Mode { @@ -2291,137 +1925,81 @@ extern "C" { ELM_FLIP_CUBE_DOWN } Elm_Flip_Mode; - EAPI Evas_Object *elm_flip_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI void elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_flip_content_front_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_flip_content_back_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_flip_content_front_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_flip_content_back_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_flip_front_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1); - EAPI void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_flip_add(Evas_Object *parent); + EAPI void elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content); + EAPI void elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_flip_content_front_get(const Evas_Object *obj); + EAPI Evas_Object *elm_flip_content_back_get(const Evas_Object *obj); + EAPI Eina_Bool elm_flip_front_get(const Evas_Object *obj); + EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y); + EAPI void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode); /* smart callbacks called: * "animate,done" - when a flip animation is finished */ - /* scrolledentry */ - EAPI Evas_Object *elm_scrolled_entry_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_single_line_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_password_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1); - EAPI const char *elm_scrolled_entry_entry_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const char *elm_scrolled_entry_selection_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_editable_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_select_none(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_select_all(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_cursor_next(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_cursor_prev(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_cursor_up(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_cursor_down(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_cursor_begin_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_cursor_end_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_cursor_selection_end(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const char *elm_scrolled_entry_cursor_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_selection_cut(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_selection_copy(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_selection_paste(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_context_menu_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1, 2); - EAPI Evas_Object *elm_scrolled_entry_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_scrolled_entry_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_end_set(Evas_Object *obj, Evas_Object *end) EINA_ARG_NONNULL(1, 2); - EAPI Evas_Object *elm_scrolled_entry_end_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_scrolled_entry_end_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_scrolled_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_scrolled_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_scrolled_entry_text_filter_append(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_scrolled_entry_text_filter_prepend(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_scrolled_entry_text_filter_remove(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_scrolled_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_file_save(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_scrolled_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_scrolled_entry_autosave_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_scrolled_entry_add(Evas_Object *parent); + EAPI void elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line); + EAPI Eina_Bool elm_scrolled_entry_single_line_get(const Evas_Object *obj); + EAPI void elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password); + EAPI Eina_Bool elm_scrolled_entry_password_get(const Evas_Object *obj); + EAPI void elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry); + EAPI const char *elm_scrolled_entry_entry_get(const Evas_Object *obj); + EAPI const char *elm_scrolled_entry_selection_get(const Evas_Object *obj); + EAPI void elm_scrolled_entry_entry_insert(Evas_Object *obj, const char *entry); + EAPI void elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap); + EAPI void elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap); + EAPI void elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable); + EAPI Eina_Bool elm_scrolled_entry_editable_get(const Evas_Object *obj); + EAPI void elm_scrolled_entry_select_none(Evas_Object *obj); + EAPI void elm_scrolled_entry_select_all(Evas_Object *obj); + EAPI Eina_Bool elm_scrolled_entry_cursor_next(Evas_Object *obj); + EAPI Eina_Bool elm_scrolled_entry_cursor_prev(Evas_Object *obj); + EAPI Eina_Bool elm_scrolled_entry_cursor_up(Evas_Object *obj); + EAPI Eina_Bool elm_scrolled_entry_cursor_down(Evas_Object *obj); + EAPI void elm_scrolled_entry_cursor_begin_set(Evas_Object *obj); + EAPI void elm_scrolled_entry_cursor_end_set(Evas_Object *obj); + EAPI void elm_scrolled_entry_cursor_line_begin_set(Evas_Object *obj); + EAPI void elm_scrolled_entry_cursor_line_end_set(Evas_Object *obj); + EAPI void elm_scrolled_entry_cursor_selection_begin(Evas_Object *obj); + EAPI void elm_scrolled_entry_cursor_selection_end(Evas_Object *obj); + EAPI Eina_Bool elm_scrolled_entry_cursor_is_format_get(const Evas_Object *obj); + EAPI Eina_Bool elm_scrolled_entry_cursor_is_visible_format_get(const Evas_Object *obj); + EAPI const char *elm_scrolled_entry_cursor_content_get(const Evas_Object *obj); + EAPI void elm_scrolled_entry_selection_cut(Evas_Object *obj); + EAPI void elm_scrolled_entry_selection_copy(Evas_Object *obj); + EAPI void elm_scrolled_entry_selection_paste(Evas_Object *obj); + EAPI void elm_scrolled_entry_context_menu_clear(Evas_Object *obj); + EAPI void elm_scrolled_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + EAPI void elm_scrolled_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled); + EAPI Eina_Bool elm_scrolled_entry_context_menu_disabled_get(const Evas_Object *obj); + EAPI void elm_scrolled_entry_scrollbar_policy_set(Evas_Object *obj, Elm_Scroller_Policy h, Elm_Scroller_Policy v); + EAPI void elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + EAPI void elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes); + EINA_DEPRECATED EAPI void elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character); + EAPI void elm_scrolled_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled); EAPI void elm_scrolled_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout); EAPI Ecore_IMF_Context *elm_scrolled_entry_imf_context_get(Evas_Object *obj); EAPI void elm_scrolled_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool autocap); EAPI void elm_scrolled_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod); - EINA_DEPRECATED EAPI void elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes); - - /* conformant */ - EAPI Evas_Object *elm_conformant_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_conformant_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_conformant_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_conformant_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - - /* mapbuf */ - EAPI Evas_Object *elm_mapbuf_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_mapbuf_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_mapbuf_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_mapbuf_enabled_set(Evas_Object *obj, Eina_Bool enabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_mapbuf_enabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_mapbuf_smooth_set(Evas_Object *obj, Eina_Bool smooth) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_mapbuf_smooth_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_mapbuf_alpha_set(Evas_Object *obj, Eina_Bool alpha) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_mapbuf_alpha_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - - /* flipselector */ - typedef struct _Elm_Flipselector_Item Elm_Flipselector_Item; - - EAPI Evas_Object *elm_flipselector_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI void elm_flipselector_flip_next(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_flipselector_flip_prev(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Flipselector_Item *elm_flipselector_item_append(Evas_Object *obj, const char *label, void (*func)(void *data, Evas_Object *obj, void *event_info), void *data) EINA_ARG_NONNULL(1); - EAPI Elm_Flipselector_Item *elm_flipselector_item_prepend(Evas_Object *obj, const char *label, void (*func)(void *data, Evas_Object *obj, void *event_info), void *data) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_flipselector_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Flipselector_Item *elm_flipselector_first_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Flipselector_Item *elm_flipselector_last_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Flipselector_Item *elm_flipselector_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_flipselector_item_selected_set(Elm_Flipselector_Item *item, Eina_Bool selected) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_flipselector_item_selected_get(const Elm_Flipselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_flipselector_item_del(Elm_Flipselector_Item *item) EINA_ARG_NONNULL(1); - EAPI const char *elm_flipselector_item_label_get(const Elm_Flipselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_flipselector_item_label_set(Elm_Flipselector_Item *item, const char *label) EINA_ARG_NONNULL(1); - EAPI Elm_Flipselector_Item *elm_flipselector_item_prev_get(Elm_Flipselector_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Flipselector_Item *elm_flipselector_item_next_get(Elm_Flipselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_flipselector_interval_set(Evas_Object *obj, double interval) EINA_ARG_NONNULL(1); - EAPI double elm_flipselector_interval_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - /* smart callbacks called: - * "selected" - when flipselector selected item is changed - * "overflowed" - when flipselector item is changed to first item - * from last item - * "underflowed" - when flipselector item is changed to last item - * from first item. - */ - /* available styles: - * default - */ + + EAPI Evas_Object *elm_conformant_add(Evas_Object *parent); + EAPI void elm_conformant_content_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_conformant_content_unset(Evas_Object *obj); + + + EAPI Evas_Object *elm_mapbuf_add(Evas_Object *parent); + EAPI void elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content); + EAPI Evas_Object *elm_mapbuf_content_unset(Evas_Object *obj); + EAPI void elm_mapbuf_enabled_set(Evas_Object *obj, Eina_Bool enabled); + EAPI Eina_Bool elm_mapbuf_enabled_get(const Evas_Object *obj); + EAPI void elm_mapbuf_smooth_set(Evas_Object *obj, Eina_Bool smooth); + EAPI Eina_Bool elm_mapbuf_smooth_get(const Evas_Object *obj); + EAPI void elm_mapbuf_alpha_set(Evas_Object *obj, Eina_Bool alpha); + EAPI Eina_Bool elm_mapbuf_alpha_get(const Evas_Object *obj); /* animator */ - typedef enum + typedef enum { ELM_ANIMATOR_CURVE_LINEAR, ELM_ANIMATOR_CURVE_IN_OUT, @@ -2443,103 +2021,53 @@ extern "C" { typedef void (*Elm_Animator_Completion_Cb) (void *data); EAPI Elm_Animator* elm_animator_add(Evas_Object *parent); - EAPI void elm_animator_del(Elm_Animator *animator) EINA_ARG_NONNULL(1); - EAPI void elm_animator_duration_set(Elm_Animator *animator, double duration) EINA_ARG_NONNULL(1); - EAPI void elm_animator_operation_callback_set(Elm_Animator *animator, Elm_Animator_Operation_Cb func, void *data) EINA_ARG_NONNULL(1); - EAPI void elm_animator_completion_callback_set(Elm_Animator *animator, Elm_Animator_Completion_Cb func, void *data) EINA_ARG_NONNULL(1); - EAPI void elm_animator_stop(Elm_Animator *animator) EINA_ARG_NONNULL(1); - EAPI void elm_animator_repeat_set(Elm_Animator *animator, unsigned int repeat_cnt) EINA_ARG_NONNULL(1); - EAPI void elm_animator_animate(Elm_Animator *animator) EINA_ARG_NONNULL(1); - EAPI void elm_animator_curve_style_set(Elm_Animator *animator, Elm_Animator_Curve_Style cs) EINA_ARG_NONNULL(1); - EAPI Elm_Animator_Curve_Style elm_animator_curve_style_get(const Elm_Animator *animator); EINA_ARG_NONNULL(1); - EAPI void elm_animator_auto_reverse_set(Elm_Animator *animator, Eina_Bool reverse) EINA_ARG_NONNULL(1); + EAPI void elm_animator_del(Elm_Animator *animator); + EAPI void elm_animator_duration_set(Elm_Animator *animator, double duration); + EAPI void elm_animator_operation_callback_set(Elm_Animator *animator, Elm_Animator_Operation_Cb func, void *data); + EAPI void elm_animator_completion_callback_set(Elm_Animator *animator, Elm_Animator_Completion_Cb func, void *data); + EAPI void elm_animator_stop(Elm_Animator *animator); + EAPI void elm_animator_repeat_set(Elm_Animator *animator, unsigned int repeat_cnt); + EAPI void elm_animator_animate(Elm_Animator *animator); + EAPI void elm_animator_curve_style_set(Elm_Animator *animator, Elm_Animator_Curve_Style cs); + EAPI void elm_animator_auto_reverse_set(Elm_Animator *animator, Eina_Bool reverse); + EAPI Elm_Animator_Curve_Style elm_animator_curve_style_get(const Elm_Animator *animator) EINA_ARG_NONNULL(1); EAPI Eina_Bool elm_animator_auto_reverse_get(const Elm_Animator *animator) EINA_ARG_NONNULL(1); EAPI Eina_Bool elm_animator_operating_get(const Elm_Animator *animator) EINA_ARG_NONNULL(1); - EAPI unsigned int elm_animator_repeat_get(const Elm_Animator *animator) EINA_ARG_NONNULL(1); - EAPI void elm_animator_pause(Elm_Animator *animator) EINA_ARG_NONNULL(1); - EAPI void elm_animator_resume(Elm_Animator *animator) EINA_ARG_NONNULL(1); + EAPI unsigned int elm_animator_repeat_get(const Elm_Animator *animator); + EAPI void elm_animator_pause(Elm_Animator *animator); + EAPI void elm_animator_resume(Elm_Animator *animator); /* calendar */ - typedef enum + typedef enum { - ELM_CALENDAR_UNIQUE, + ELM_CALENDAR_UNIQUE, ELM_CALENDAR_DAILY, ELM_CALENDAR_WEEKLY, - ELM_CALENDAR_MONTHLY, + ELM_CALENDAR_MONTHLY, ELM_CALENDAR_ANNUALLY } Elm_Calendar_Mark_Repeat; typedef struct _Elm_Calendar_Mark Elm_Calendar_Mark; - EAPI Evas_Object *elm_calendar_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI const char **elm_calendar_weekdays_names_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_weekdays_names_set(Evas_Object *obj, const char *weekdays[]) EINA_ARG_NONNULL(1, 2); - EAPI double elm_calendar_interval_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_interval_set(Evas_Object *obj, double interval) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_min_max_year_get(const Evas_Object *obj, int *min, int *max) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_min_max_year_set(Evas_Object *obj, int min, int max) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_calendar_day_selection_enabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_day_selection_enabled_set(Evas_Object *obj, Eina_Bool enabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time) EINA_ARG_NONNULL(1, 2); - EAPI void elm_calendar_selected_time_set(Evas_Object *obj, struct tm *selected_time) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_format_function_set(Evas_Object *obj, char * (*format_function) (struct tm *stime)) EINA_ARG_NONNULL(1); - EAPI Elm_Calendar_Mark *elm_calendar_mark_add(Evas_Object *obj, const char *mark_type, struct tm *mark_time, Elm_Calendar_Mark_Repeat repeat) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_mark_del(Elm_Calendar_Mark *mark) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_marks_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_calendar_marks_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_calendar_marks_draw(Evas_Object *obj) EINA_ARG_NONNULL(1); - EINA_DEPRECATED EAPI void elm_calendar_text_saturday_color_set(Evas_Object *obj, int pos) EINA_ARG_NONNULL(1); - EINA_DEPRECATED EAPI void elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos) EINA_ARG_NONNULL(1); - EINA_DEPRECATED EAPI void elm_calendar_text_weekday_color_set(Evas_Object *obj, int pos) EINA_ARG_NONNULL(1); - - /* smart callbacks called: - * changed - emitted when the user select a day or change the displayed - * month. - */ - - /* diskselector */ - typedef struct _Elm_Diskselector_Item Elm_Diskselector_Item; - - EAPI Evas_Object *elm_diskselector_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_diskselector_round_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_round_set(Evas_Object *obj, Eina_Bool round) EINA_ARG_NONNULL(1); - EAPI int elm_diskselector_side_label_lenght_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_side_label_lenght_set(Evas_Object *obj, int len) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI const Eina_List *elm_diskselector_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Diskselector_Item *elm_diskselector_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_del(Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_del_cb_set(Elm_Diskselector_Item *item, Evas_Smart_Cb func) EINA_ARG_NONNULL(1); - EAPI void *elm_diskselector_item_data_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_diskselector_item_icon_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_icon_set(Elm_Diskselector_Item *item, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI const char *elm_diskselector_item_label_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_label_set(Elm_Diskselector_Item *item, const char *label) EINA_ARG_NONNULL(1); - EAPI Elm_Diskselector_Item *elm_diskselector_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_selected_set(Elm_Diskselector_Item *item, Eina_Bool selected) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_diskselector_item_selected_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Diskselector_Item *elm_diskselector_first_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Diskselector_Item *elm_diskselector_last_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Diskselector_Item *elm_diskselector_item_prev_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI Elm_Diskselector_Item *elm_diskselector_item_next_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_tooltip_text_set(Elm_Diskselector_Item *item, const char *text) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_tooltip_content_cb_set(Elm_Diskselector_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_tooltip_unset(Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_tooltip_style_set(Elm_Diskselector_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_diskselector_item_tooltip_style_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_cursor_set(Elm_Diskselector_Item *item, const char *cursor) EINA_ARG_NONNULL(1); - EAPI const char *elm_diskselector_item_cursor_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_cursor_unset(Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_cursor_style_set(Elm_Diskselector_Item *item, const char *style) EINA_ARG_NONNULL(1); - EAPI const char *elm_diskselector_item_cursor_style_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_diskselector_item_cursor_engine_only_set(Elm_Diskselector_Item *item, Eina_Bool engine_only) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_diskselector_item_cursor_engine_only_get(const Elm_Diskselector_Item *item) EINA_ARG_NONNULL(1); - /* smart callbacks called: - * "selected" - when item is selected (scroller stops) - */ + EAPI Evas_Object *elm_calendar_add(Evas_Object *parent); + EAPI const char **elm_calendar_weekdays_names_get(const Evas_Object *obj); + EAPI void elm_calendar_weekdays_names_set(Evas_Object *obj, const char *weekdays[]); + EAPI double elm_calendar_interval_get(const Evas_Object *obj); + EAPI void elm_calendar_interval_set(Evas_Object *obj, double interval); + EAPI void elm_calendar_min_max_year_get(const Evas_Object *obj, int *min, int *max); + EAPI void elm_calendar_min_max_year_set(Evas_Object *obj, int min, int max); + EAPI Eina_Bool elm_calendar_day_selection_enabled_get(const Evas_Object *obj); + EAPI void elm_calendar_day_selection_enabled_set(Evas_Object *obj, Eina_Bool enabled); + EAPI Eina_Bool elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time); + EAPI void elm_calendar_selected_time_set(Evas_Object *obj, struct tm *selected_time); + EAPI void elm_calendar_format_function_set(Evas_Object *obj, char * (*format_function) (struct tm *stime)); + EAPI Elm_Calendar_Mark *elm_calendar_mark_add(Evas_Object *obj, const char *mark_type, struct tm *mark_time, Elm_Calendar_Mark_Repeat repeat); + EAPI void elm_calendar_mark_del(Elm_Calendar_Mark *mark); + EAPI void elm_calendar_marks_clear(Evas_Object *obj); + EAPI const Eina_List *elm_calendar_marks_get(const Evas_Object *obj); + EAPI void elm_calendar_marks_draw(Evas_Object *obj); + EAPI void elm_calendar_text_weekday_color_set(const Evas_Object *obj, int pos); + EAPI void elm_calendar_text_saturday_color_set(const Evas_Object *obj, int pos); + EAPI void elm_calendar_text_sunday_color_set(const Evas_Object *obj, int pos); typedef struct _Picker_Item Elm_Picker_Item; EINA_DEPRECATED EAPI Evas_Object *elm_picker_add(Evas_Object *parent); @@ -2598,11 +2126,11 @@ extern "C" { * default */ - EINA_DEPRECATED EAPI Evas_Object *elm_timepicker_add(Evas_Object *parent); - EINA_DEPRECATED EAPI void elm_timepicker_time_set(Evas_Object *obj, int hrs, int min, int sec); - EINA_DEPRECATED EAPI void elm_timepicker_time_get(Evas_Object *obj, int *hrs, int *min, int *sec); - EINA_DEPRECATED EAPI void elm_timepicker_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm); - EINA_DEPRECATED EAPI void elm_timepicker_show_seconds_set(Evas_Object *obj, Eina_Bool seconds); + EAPI Evas_Object *elm_timepicker_add(Evas_Object *parent); + EAPI void elm_timepicker_time_set(Evas_Object *obj, int hrs, int min, int sec); + EAPI void elm_timepicker_time_get(Evas_Object *obj, int *hrs, int *min, int *sec); + EAPI void elm_timepicker_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm); + EAPI void elm_timepicker_show_seconds_set(Evas_Object *obj, Eina_Bool seconds); /* smart callback called: * "changed" - when timepicker selected item is changed */ @@ -2610,15 +2138,15 @@ extern "C" { * default */ - EINA_DEPRECATED EAPI Evas_Object *elm_datepicker_add(Evas_Object *parent); - EINA_DEPRECATED EAPI void elm_datepicker_date_set(Evas_Object *obj, int year, int month, int day); - EINA_DEPRECATED EAPI void elm_datepicker_date_get(const Evas_Object *obj, int *year, int *month, int *day); - EINA_DEPRECATED EAPI void elm_datepicker_date_min_set(Evas_Object *obj, int year, int month, int day); // Not implemented - EINA_DEPRECATED EAPI void elm_datepicker_date_min_get(const Evas_Object *obj, int *year, int *month, int *day); - EINA_DEPRECATED EAPI void elm_datepicker_date_max_set(Evas_Object *obj, int year, int month, int day); // Not implemented - EINA_DEPRECATED EAPI void elm_datepicker_date_max_get(const Evas_Object *obj, int *year, int *month, int *day); - EINA_DEPRECATED EAPI void elm_datepicker_date_format_set(Evas_Object *obj, const char *fmt); - EINA_DEPRECATED EAPI const char *elm_datepicker_date_format_get(const Evas_Object *obj); + EAPI Evas_Object *elm_datepicker_add(Evas_Object *parent); + EAPI void elm_datepicker_date_set(Evas_Object *obj, int year, int month, int day); + EAPI void elm_datepicker_date_get(const Evas_Object *obj, int *year, int *month, int *day); + EAPI void elm_datepicker_date_min_set(Evas_Object *obj, int year, int month, int day); // Not implemented + EAPI void elm_datepicker_date_min_get(const Evas_Object *obj, int *year, int *month, int *day); + EAPI void elm_datepicker_date_max_set(Evas_Object *obj, int year, int month, int day); // Not implemented + EAPI void elm_datepicker_date_max_get(const Evas_Object *obj, int *year, int *month, int *day); + EAPI void elm_datepicker_date_format_set(Evas_Object *obj, const char *fmt); + EAPI const char *elm_datepicker_date_format_get(const Evas_Object *obj); /* smart callback called: * "changed" - when datepicker selected item is changed */ @@ -2706,13 +2234,12 @@ extern "C" { EAPI Evas_Object* elm_popup_content_get(Evas_Object *obj); EAPI void elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_text, ...); EAPI Evas_Object* elm_popup_with_buttons_add(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... ); - EAPI void elm_popup_timeout_set(Evas_Object *obj, double timeout); + EAPI void elm_popup_timeout_set(Evas_Object *obj, int timeout); EAPI void elm_popup_mode_set(Evas_Object *obj, Elm_Popup_Mode mode); EAPI void elm_popup_response(Evas_Object *obj, int response_id); EAPI void elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient); EINA_DEPRECATED EAPI void elm_popup_rotation_set(Evas_Object *obj, int rot_angle); EAPI int elm_popup_run(Evas_Object *obj); - /* Contextual Popup */ typedef struct _Ctxpopup_Item Elm_Ctxpopup_Item; @@ -2729,8 +2256,8 @@ extern "C" { EAPI Eina_Bool elm_ctxpopup_horizontal_get(Evas_Object *obj); EAPI void elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon); EAPI void elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label); - EAPI Elm_Ctxpopup_Item *elm_ctxpopup_label_add(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data); - EAPI Elm_Ctxpopup_Item *elm_ctxpopup_icon_add(Evas_Object *obj, Evas_Object *icon, Evas_Smart_Cb func, void *data); + EINA_DEPRECATED EAPI Elm_Ctxpopup_Item *elm_ctxpopup_label_add(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data); + EINA_DEPRECATED EAPI Elm_Ctxpopup_Item *elm_ctxpopup_icon_add(Evas_Object *obj, Evas_Object *icon, Evas_Smart_Cb func, void *data); EAPI Elm_Ctxpopup_Item *elm_ctxpopup_item_add(Evas_Object *obj, Evas_Object *icon, const char* label, Evas_Smart_Cb func, void *data); EAPI void elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item); EAPI void elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled); @@ -2894,8 +2421,7 @@ extern "C" { EAPI const char *elm_navigationbar_subtitle_label_get(Evas_Object *obj, Evas_Object *content); EAPI void elm_navigationbar_subtitle_label_set(Evas_Object *obj, Evas_Object *content, const char *subtitle); EAPI void elm_navigationbar_title_object_list_unset(Evas_Object *obj, Evas_Object *content, Eina_List **list); - EINA_DEPRECATED EAPI void elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable); - EAPI void elm_navigationbar_animation_disabled_set(Evas_Object *obj, Eina_Bool disable); + EAPI void elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable); /* NavigationBar */ typedef enum @@ -3000,7 +2526,6 @@ extern "C" { EAPI void elm_controlbar_item_visible_set(Elm_Controlbar_Item *it, Eina_Bool bar); EAPI Eina_Bool elm_controlbar_item_visible_get(Elm_Controlbar_Item * it); EAPI void elm_controlbar_item_disable_set(Elm_Controlbar_Item * it, Eina_Bool disable); - EAPI Eina_Bool elm_controlbar_item_disable_get(Elm_Controlbar_Item * it); EAPI void elm_controlbar_item_icon_set(Elm_Controlbar_Item *it, const char *icon_path); EAPI Evas_Object *elm_controlbar_item_icon_get(Elm_Controlbar_Item *it); EAPI void elm_controlbar_item_label_set(Elm_Controlbar_Item *it, const char *label); @@ -3026,6 +2551,21 @@ extern "C" { EAPI void elm_controlbar_view_animation_set(Evas_Object *obj, const char *hide, const char *show); /*======= Just for test =======*/ + + /* diskcontroller */ + typedef struct _Elm_Diskcontroller_Item Elm_Diskcontroller_Item; + + EAPI Evas_Object *elm_diskcontroller_add(Evas_Object *parent); + EAPI void elm_diskcontroller_round_set(Evas_Object *obj, Eina_Bool round); + EAPI Elm_Diskcontroller_Item *elm_diskcontroller_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data); + EAPI void elm_diskcontroller_item_del(Elm_Diskcontroller_Item *it); + EAPI const char *elm_diskcontroller_item_label_get(Elm_Diskcontroller_Item *it); + EAPI void elm_diskcontroller_item_label_set(Elm_Diskcontroller_Item *it, const char *label); + EAPI void elm_diskcontroller_item_focus_set(Elm_Diskcontroller_Item *it); + /* smart callbacks called: + * "stop" - when scroller stop + */ + /* SearchBar */ EAPI Evas_Object *elm_searchbar_add(Evas_Object *parent); EAPI void elm_searchbar_text_set(Evas_Object *obj, const char *entry); @@ -3148,8 +2688,7 @@ extern "C" { /* actionslider */ typedef enum _Elm_Actionslider_Indicator_Pos - { - ELM_ACTIONSLIDER_INDICATOR_NONE, + { ELM_ACTIONSLIDER_INDICATOR_LEFT, ELM_ACTIONSLIDER_INDICATOR_RIGHT, ELM_ACTIONSLIDER_INDICATOR_CENTER @@ -3157,12 +2696,10 @@ extern "C" { typedef enum _Elm_Actionslider_Magnet_Pos { - ELM_ACTIONSLIDER_MAGNET_NONE = 0, - ELM_ACTIONSLIDER_MAGNET_LEFT = 1 << 0, - ELM_ACTIONSLIDER_MAGNET_CENTER = 1 << 1, - ELM_ACTIONSLIDER_MAGNET_RIGHT= 1 << 2, - ELM_ACTIONSLIDER_MAGNET_ALL = (1 << 3) -1, - ELM_ACTIONSLIDER_MAGNET_BOTH = (1 << 3) + ELM_ACTIONSLIDER_MAGNET_LEFT, + ELM_ACTIONSLIDER_MAGNET_RIGHT, + ELM_ACTIONSLIDER_MAGNET_BOTH, + ELM_ACTIONSLIDER_MAGNET_CENTER } Elm_Actionslider_Magnet_Pos; typedef enum _Elm_Actionslider_Label_Pos @@ -3173,18 +2710,11 @@ extern "C" { ELM_ACTIONSLIDER_LABEL_BUTTON } Elm_Actionslider_Label_Pos; - EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent); - EAPI void elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Indicator_Pos pos); - EAPI Elm_Actionslider_Indicator_Pos elm_actionslider_indicator_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Magnet_Pos pos); - EAPI Elm_Actionslider_Magnet_Pos elm_actionslider_magnet_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_actionslider_label_set(Evas_Object *obj, Elm_Actionslider_Label_Pos pos, const char *label); - EAPI void elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label) EINA_ARG_NONNULL(1); - EAPI void elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Magnet_Pos pos) EINA_ARG_NONNULL(1); - EAPI Elm_Actionslider_Magnet_Pos elm_actionslider_enabled_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - EAPI const char *elm_actionslider_indicator_label_get(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_actionslider_hold(Evas_Object *obj, Eina_Bool flag); + EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent); + EAPI void elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Indicator_Pos pos); + EAPI void elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Magnet_Pos pos); + EAPI void elm_actionslider_label_set(Evas_Object *obj, Elm_Actionslider_Label_Pos pos, const char *label); + EAPI void elm_actionslider_hold(Evas_Object *obj, Eina_Bool flag); /* smart callbacks called: * "indicator,position" - when a button reaches to the special position like "left", "right" and "center". */ @@ -3425,117 +2955,6 @@ extern "C" { EINA_DEPRECATED EAPI void elm_xml_animator_del(Elm_Xml_Animator *xa); EINA_DEPRECATED EAPI void elm_xml_animator_run(Elm_Xml_Animator *xa); - typedef struct _Elm_Store Elm_Store; - typedef struct _Elm_Store_Filesystem Elm_Store_Filesystem; - typedef struct _Elm_Store_Item Elm_Store_Item; - typedef struct _Elm_Store_Item_Filesystem Elm_Store_Item_Filesystem; - typedef struct _Elm_Store_Item_Info Elm_Store_Item_Info; - typedef struct _Elm_Store_Item_Info_Filesystem Elm_Store_Item_Info_Filesystem; - typedef struct _Elm_Store_Item_Mapping Elm_Store_Item_Mapping; - typedef struct _Elm_Store_Item_Mapping_Empty Elm_Store_Item_Mapping_Empty; - typedef struct _Elm_Store_Item_Mapping_Icon Elm_Store_Item_Mapping_Icon; - typedef struct _Elm_Store_Item_Mapping_Photo Elm_Store_Item_Mapping_Photo; - typedef struct _Elm_Store_Item_Mapping_Custom Elm_Store_Item_Mapping_Custom; - - typedef Eina_Bool (*Elm_Store_Item_List_Cb) (void *data, Elm_Store_Item_Info *info); - typedef void (*Elm_Store_Item_Fetch_Cb) (void *data, Elm_Store_Item *sti); - typedef void (*Elm_Store_Item_Unfetch_Cb) (void *data, Elm_Store_Item *sti); - typedef void *(*Elm_Store_Item_Mapping_Cb) (void *data, Elm_Store_Item *sti, const char *part); - - typedef enum - { - ELM_STORE_ITEM_MAPPING_NONE = 0, - ELM_STORE_ITEM_MAPPING_LABEL, // const char * -> label - ELM_STORE_ITEM_MAPPING_STATE, // Eina_Bool -> state - ELM_STORE_ITEM_MAPPING_ICON, // char * -> icon path - ELM_STORE_ITEM_MAPPING_PHOTO, // char * -> photo path - ELM_STORE_ITEM_MAPPING_CUSTOM, // item->custom(it->data, it, part) -> void * (-> any) - // can add more here as needed by common apps - ELM_STORE_ITEM_MAPPING_LAST - } Elm_Store_Item_Mapping_Type; - - struct _Elm_Store_Item_Mapping_Icon - { - // FIXME: allow edje file icons - int w, h; - Elm_Icon_Lookup_Order lookup_order; - Eina_Bool standard_name : 1; - Eina_Bool no_scale : 1; - Eina_Bool smooth : 1; - Eina_Bool scale_up : 1; - Eina_Bool scale_down : 1; - }; - - struct _Elm_Store_Item_Mapping_Empty - { - Eina_Bool dummy; - }; - - struct _Elm_Store_Item_Mapping_Photo - { - int size; - }; - - struct _Elm_Store_Item_Mapping_Custom - { - Elm_Store_Item_Mapping_Cb func; - }; - - struct _Elm_Store_Item_Mapping - { - Elm_Store_Item_Mapping_Type type; - const char *part; - int offset; - union { - Elm_Store_Item_Mapping_Empty empty; - Elm_Store_Item_Mapping_Icon icon; - Elm_Store_Item_Mapping_Photo photo; - Elm_Store_Item_Mapping_Custom custom; - // add more types here - } details; - }; - - struct _Elm_Store_Item_Info - { - Elm_Genlist_Item_Class *item_class; - const Elm_Store_Item_Mapping *mapping; - void *data; - char *sort_id; - }; - - struct _Elm_Store_Item_Info_Filesystem - { - Elm_Store_Item_Info base; - char *path; - }; - -#define ELM_STORE_ITEM_MAPPING_END { ELM_STORE_ITEM_MAPPING_NONE, NULL, 0, { .empty = { EINA_TRUE } } } -#define ELM_STORE_ITEM_MAPPING_OFFSET(st, it) offsetof(st, it) - - EAPI void elm_store_free(Elm_Store *st); - - EAPI Elm_Store *elm_store_filesystem_new(void); - EAPI void elm_store_filesystem_directory_set(Elm_Store *st, const char *dir) EINA_ARG_NONNULL(1); - EAPI const char *elm_store_filesystem_directory_get(const Elm_Store *st) EINA_ARG_NONNULL(1); - EAPI const char *elm_store_item_filesystem_path_get(const Elm_Store_Item *sti) EINA_ARG_NONNULL(1); - - EAPI void elm_store_target_genlist_set(Elm_Store *st, Evas_Object *obj) EINA_ARG_NONNULL(1); - - EAPI void elm_store_cache_set(Elm_Store *st, int max) EINA_ARG_NONNULL(1); - EAPI int elm_store_cache_get(const Elm_Store *st) EINA_ARG_NONNULL(1); - EAPI void elm_store_list_func_set(Elm_Store *st, Elm_Store_Item_List_Cb func, const void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_store_fetch_func_set(Elm_Store *st, Elm_Store_Item_Fetch_Cb func, const void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_store_fetch_thread_set(Elm_Store *st, Eina_Bool use_thread) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_store_fetch_thread_get(const Elm_Store *st) EINA_ARG_NONNULL(1); - - EAPI void elm_store_unfetch_func_set(Elm_Store *st, Elm_Store_Item_Unfetch_Cb func, const void *data) EINA_ARG_NONNULL(1, 2); - EAPI void elm_store_sorted_set(Elm_Store *st, Eina_Bool sorted) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_store_sorted_get(const Elm_Store *st) EINA_ARG_NONNULL(1); - EAPI void elm_store_item_data_set(Elm_Store_Item *sti, void *data) EINA_ARG_NONNULL(1); - EAPI void *elm_store_item_data_get(Elm_Store_Item *sti) EINA_ARG_NONNULL(1); - EAPI const Elm_Store *elm_store_item_store_get(const Elm_Store_Item *sti) EINA_ARG_NONNULL(1); - EAPI const Elm_Genlist_Item *elm_store_item_genlist_item_get(const Elm_Store_Item *sti) EINA_ARG_NONNULL(1); - #ifdef __cplusplus } #endif diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 16e7477..127e6fa 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -29,7 +29,8 @@ lib_LTLIBRARIES = libelementary.la includes_HEADERS = \ Elementary.h \ Elementary_Cursor.h \ -elm_widget.h +elm_widget.h \ +elm_priv.h includesdir = $(includedir)/elementary-@VMAJ@ libelementary_la_SOURCES = \ @@ -93,6 +94,7 @@ elm_thumb.c \ elm_config.c \ elm_titlebar.c \ elm_popup.c \ +elm_diskcontroller.c \ elm_tab.c \ elm_navigationbar.c \ elm_navigationbar_ex.c\ @@ -100,7 +102,6 @@ elm_tabbar.c \ elm_transit.c \ elm_animator.c \ elm_editfield.c \ -elm_diskselector.c \ elm_colorpicker.c \ elm_colorselector.c \ elm_colorpalette.c \ diff --git a/src/lib/elc_anchorblock.c b/src/lib/elc_anchorblock.c index 7c75062..1f233cc 100644 --- a/src/lib/elc_anchorblock.c +++ b/src/lib/elc_anchorblock.c @@ -3,6 +3,7 @@ /** * @defgroup Anchorblock Anchorblock + * @ingroup Elementary * * Anchorblock is for displaying tet that contains markup with anchors like: * \something\ in it. These will be drawn differently and will @@ -183,11 +184,8 @@ elm_anchorblock_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "anchorblock"); elm_widget_type_set(obj, "anchorblock"); @@ -195,7 +193,6 @@ elm_anchorblock_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); wd->entry = elm_entry_add(parent); elm_entry_item_provider_prepend(wd->entry, _item_provider, obj); @@ -292,26 +289,6 @@ elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent) } /** - * Get the parent of the hover popup - * - * This sgets the parent of the hover that anchorblock will create. See hover - * objects for more information on this. - * - * @param obj The anchorblock object - * @return The parent used by the hover - * - * @ingroup Anchorblock - */ -EAPI Evas_Object * -elm_anchorblock_hover_parent_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->hover_parent; -} - -/** * Set the style that the hover should use * * This sets the style for the hover that anchorblock will create. See hover @@ -332,26 +309,6 @@ elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style) } /** - * Get the style that the hover should use - * - * This gets the style for the hover that anchorblock will create. See hover - * objects for more information - * - * @param obj The anchorblock object - * @return The style defined - * - * @ingroup Anchorblock - */ -EAPI const char * -elm_anchorblock_hover_style_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->hover_style; -} - -/** * Stop the hover popup in the anchorblock * * This will stop the hover popup in the anchorblock if it is currently active. @@ -394,7 +351,7 @@ elm_anchorblock_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (voi ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; Elm_Anchorblock_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorblock_Item_Provider)); if (!ip) return; ip->func = func; @@ -420,7 +377,7 @@ elm_anchorblock_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (vo ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; Elm_Anchorblock_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorblock_Item_Provider)); if (!ip) return; ip->func = func; @@ -448,7 +405,7 @@ elm_anchorblock_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (voi Eina_List *l; Elm_Anchorblock_Item_Provider *ip; if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; EINA_LIST_FOREACH(wd->item_providers, l, ip) { if ((ip->func == func) && (ip->data == data)) diff --git a/src/lib/elc_anchorview.c b/src/lib/elc_anchorview.c index df61e53..f5495f8 100644 --- a/src/lib/elc_anchorview.c +++ b/src/lib/elc_anchorview.c @@ -3,6 +3,7 @@ /** * @defgroup Anchorview Anchorview + * @ingroup Elementary * * This is just like the Anchorblock object, but provides a scroller to hold * the text automatically. @@ -174,11 +175,8 @@ elm_anchorview_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "anchorview"); elm_widget_type_set(obj, "anchorview"); @@ -186,7 +184,6 @@ elm_anchorview_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); wd->scroller = elm_scroller_add(parent); elm_widget_resize_object_set(obj, wd->scroller); @@ -286,26 +283,6 @@ elm_anchorview_hover_parent_set(Evas_Object *obj, Evas_Object *parent) } /** - * Get the parent of the hover popup - * - * This gets the parent of the hover that anchorview will created. See hover - * objects for more information on this. - * - * @param obj The anchorview object - * @return The parent used by hover - * - * @ingroup Anchorview - */ -EAPI Evas_Object * -elm_anchorview_hover_parent_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->hover_parent; -} - -/** * Set the style that the hover should use * * This sets the style for the hover that anchorview will create. See hover @@ -326,26 +303,6 @@ elm_anchorview_hover_style_set(Evas_Object *obj, const char *style) } /** - * Get the style that the hover should use - * - * This gets the style for the hover that anchorview will create. See hover - * objects for more information - * - * @param obj The anchorview object - * @return The style defined - * - * @ingroup Anchorview - */ -EAPI const char * -elm_anchorview_hover_style_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->hover_style; -} - -/** * Stop the hover popup in the anchorview * * This will stop the hover popup in the anchorview if it is currently active. @@ -388,24 +345,6 @@ elm_anchorview_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_boun } /** - * Get the bounce mode - * - * @param obj The Anchorview object - * @param h_bounce Allow bounce horizontally - * @param v_bounce Allow bounce vertically - * - * @ingroup Anchorview - */ -EAPI void -elm_anchorview_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_scroller_bounce_get(wd->scroller, h_bounce, v_bounce); -} - -/** * This appends a custom item provider to the list for that anchorview * * This appends the given callback. The list is walked from beginning to end @@ -427,7 +366,7 @@ elm_anchorview_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; Elm_Anchorview_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorview_Item_Provider)); if (!ip) return; ip->func = func; @@ -453,7 +392,7 @@ elm_anchorview_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (voi ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; Elm_Anchorview_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorview_Item_Provider)); if (!ip) return; ip->func = func; @@ -481,7 +420,7 @@ elm_anchorview_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void Eina_List *l; Elm_Anchorview_Item_Provider *ip; if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; EINA_LIST_FOREACH(wd->item_providers, l, ip) { if ((ip->func == func) && (ip->data == data)) diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 2cf3010..105287d 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -1,26 +1,16 @@ /** * @defgroup Fileselector Fileselector + * @ingroup Elementary * - * A fileselector is a widget that allows a user to navigate through a - * tree of files. It contains buttons for Home(~) and Up(..) as well - * as cancel/ok buttons to confirm/cancel a selection. This widget is - * currently very much in progress. - * - * TODO - * child elements focusing support - * userdefined icon/label cb - * show/hide/add buttons ??? - * show/Hide hidden files - * double click to choose a file - * multiselection - * make variable/function names that are sensible - * Filter support - * + * A fileselector is a widget that allows a user to navigate through a tree + * of files. It contains buttons for Home(~) and Up(..) as well as cancel/ok + * buttons to confirm/cancel a selection. This widget is currently very much + * in progress. + * Signals that you can add callbacks for are: * * "selected" - the user clicks on a file - * "directory,open" - the list is populated with new content. - * event_info is a directory. + * "directory,open" - the list is populated with a new content. event_info is a directory. * "done" - the user clicks on the ok or cancel button */ @@ -31,55 +21,43 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { - Evas_Object *edje; - Evas_Object *filename_entry; - Evas_Object *path_entry; - Evas_Object *files_list; - Evas_Object *files_grid; - Evas_Object *up_button; - Evas_Object *home_button; - - Evas_Object *ok_button; - Evas_Object *cancel_button; - - const char *path; - const char *selection; + Evas_Object *vbox, *entry, *entry2, *list, *scr2; + const char *path; + const char *selection; + Eina_Bool only_folder; + Eina_Bool expand; Ecore_Idler *sel_idler; - const char *path_separator; - - Elm_Fileselector_Mode mode; - - Eina_Bool only_folder : 1; - Eina_Bool expand : 1; + struct + { + Evas_Object *bx; + Evas_Object *ok; + Evas_Object *cancel; + } buttons; }; struct sel_data { Evas_Object *fs; - const char *path; + const char *path; }; -Elm_Genlist_Item_Class list_itc; -Elm_Gengrid_Item_Class grid_itc; +Elm_Genlist_Item_Class itc; static const char *widtype = NULL; -static const char SIG_DIRECTORY_OPEN[] = "directory,open"; +static const char SIG_DIRECTORY_OPEN[]= "directory,open"; static const char SIG_DONE[] = "done"; static const char SIG_SELECTED[] = "selected"; static const Evas_Smart_Cb_Description _signals[] = { - {SIG_DIRECTORY_OPEN, "s"}, - {SIG_DONE, "s"}, - {SIG_SELECTED, "s"}, - {NULL, NULL} + {SIG_DIRECTORY_OPEN, "s"}, + {SIG_DONE, "s"}, + {SIG_SELECTED, "s"}, + {NULL, NULL} }; -static void _populate(Evas_Object *obj, - const char *path, - Elm_Genlist_Item *parent); -static void _do_anchors(Evas_Object *obj, - const char *path); +static void _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent); +static void _do_anchors(Evas_Object *obj, const char *path); /*** ELEMENTARY WIDGET ***/ static void @@ -95,8 +73,8 @@ _del_hook(Evas_Object *obj) if (wd->selection) eina_stringshare_del(wd->selection); if (wd->sel_idler) { - sd = ecore_idler_del(wd->sel_idler); - free(sd); + sd = ecore_idler_del(wd->sel_idler); + free(sd); } free(wd); } @@ -107,163 +85,79 @@ _sizing_eval(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; if (!wd) return; - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc(wd->edje, &minw, &minh, minw, minh); + evas_object_size_hint_min_get(wd->vbox, &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); -} - -static void -_theme_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - const char *style = elm_widget_style_get(obj); - const char *data; - char buf[1024]; - - if (!wd) return; - _elm_theme_object_set(obj, wd->edje, "fileselector", "base", style); - - if (elm_object_disabled_get(obj)) - edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm"); - - data = edje_object_data_get(wd->edje, "path_separator"); - if (data) - wd->path_separator = data; - else - wd->path_separator = "/"; - - if (!style) style = "default"; - snprintf(buf, sizeof(buf), "fileselector/%s", style); - -#define SWALLOW(part_name, object_ptn) \ - if (object_ptn) \ - { \ - elm_widget_style_set(object_ptn, buf); \ - if (edje_object_part_swallow(wd->edje, part_name, object_ptn)) \ - evas_object_show(object_ptn); \ - else \ - evas_object_hide(object_ptn); \ - } - SWALLOW("elm.swallow.up", wd->up_button); - SWALLOW("elm.swallow.home", wd->home_button); - - if (wd->mode == ELM_FILESELECTOR_LIST) - { - if (edje_object_part_swallow(wd->edje, "elm.swallow.files", - wd->files_list)) - { - evas_object_show(wd->files_list); - evas_object_hide(wd->files_grid); - } - else - evas_object_hide(wd->files_list); - } - else - { - if (edje_object_part_swallow(wd->edje, "elm.swallow.files", - wd->files_grid)) - { - evas_object_show(wd->files_grid); - evas_object_hide(wd->files_list); - } - else - evas_object_hide(wd->files_grid); - } - - SWALLOW("elm.swallow.filename", wd->filename_entry); - SWALLOW("elm.swallow.path", wd->path_entry); - - snprintf(buf, sizeof(buf), "fileselector/actions/%s", style); - SWALLOW("elm.swallow.cancel", wd->cancel_button); - SWALLOW("elm.swallow.ok", wd->ok_button); -#undef SWALLOW - - edje_object_message_signal_process(wd->edje); - edje_object_scale_set - (wd->edje, elm_widget_scale_get(obj) * _elm_config->scale); - _sizing_eval(obj); +// printf("***** SIZING EVAL [min %d %d] *************\n", minw, minh); } /*** GENLIST "MODEL" ***/ -static char * -_itc_label_get(void *data, - Evas_Object *obj __UNUSED__, - const char *source __UNUSED__) +static char* +_itc_label_get(const void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) { - return strdup(ecore_file_file_get(data)); /* NOTE this will be - * free() by the - * caller */ + //~ printf("LABEL_GET: %s\n", (char*) data); + return strdup(ecore_file_file_get(data)); // NOTE this will be free() by the caller } -static Evas_Object * -_itc_icon_get(void *data, - Evas_Object *obj, - const char *source) +static Evas_Object* +_itc_icon_get(const void *data, Evas_Object *obj, const char *source) { Evas_Object *ic; + //~ printf("ICON GET for %s (source: %s)\n", (char*)data, source); if (!strcmp(source, "elm.swallow.icon")) { - ic = elm_icon_add(obj); - if (ecore_file_is_dir((char *)data)) - elm_icon_standard_set(ic, "folder"); - else - elm_icon_standard_set(ic, "file"); - evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, - 1, 1); - evas_object_show(ic); - return ic; + ic = elm_icon_add(obj); + if (ecore_file_is_dir((char*)data)) + elm_icon_standard_set(ic, "folder"); + else + elm_icon_standard_set(ic, "file"); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + evas_object_show(ic); + return ic; } return NULL; } static Eina_Bool -_itc_state_get(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - const char *source __UNUSED__) +_itc_state_get(const void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) { return EINA_FALSE; } static void -_itc_del(void *data, - Evas_Object *obj __UNUSED__) +_itc_del(const void *data, Evas_Object *obj __UNUSED__) { + //~ printf("DEL DATA [%s]\n", (char*)data); eina_stringshare_del(data); } static void -_expand_done(void *data, - Evas_Object *obj __UNUSED__, - void *event_info) +_expand_done(void *data, Evas_Object *obj __UNUSED__, void *event_info) { Elm_Genlist_Item *it = event_info; const char *path = elm_genlist_item_data_get(it); +// printf("EXPAND %s\n", path); _populate(data, path, it); } static void -_contract_done(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info) +_contract_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_Genlist_Item *it = event_info; +// const char *path = elm_genlist_item_data_get(it); +// printf("CONTRACT %s\n", path); elm_genlist_item_subitems_clear(it); } static void -_expand_req(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info) +_expand_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_Genlist_Item *it = event_info; elm_genlist_item_expanded_set(it, 1); } static void -_contract_req(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info) +_contract_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_Genlist_Item *it = event_info; elm_genlist_item_expanded_set(it, 0); @@ -282,186 +176,144 @@ _sel_do(void *data) wd = elm_widget_data_get(sd->fs); path = sd->path; - if ((!wd->only_folder) && ecore_file_is_dir(path)) + if (ecore_file_is_dir(path)) { - if (wd->expand && wd->mode == ELM_FILESELECTOR_LIST) + // printf("SELECTED DIR: %s\n", path); + if (wd->expand) { _do_anchors(sd->fs, path); - elm_scrolled_entry_entry_set(wd->filename_entry, ""); + if (wd->entry2) elm_entry_entry_set(wd->entry2, ""); } else { - /* keep a ref to path 'couse it will be destroyed by _populate */ + // keep a ref to path 'couse it will be destroyed by _populate p = eina_stringshare_add(path); _populate(sd->fs, p, NULL); eina_stringshare_del(p); } - goto end; + goto end; } - else /* navigating through folders only or file is not a dir. */ + else { - if (wd->expand && wd->mode == ELM_FILESELECTOR_LIST) - _do_anchors(sd->fs, path); - else if (wd->only_folder) - { - /* keep a ref to path 'couse it will be destroyed by _populate */ - p = eina_stringshare_add(path); - _populate(sd->fs, p, NULL); - eina_stringshare_del(p); - } - elm_scrolled_entry_entry_set(wd->filename_entry, - ecore_file_file_get(path)); + // printf("SELECTED FILE: %s\n", path); + if (wd->entry2) + elm_entry_entry_set(wd->entry2, ecore_file_file_get(path)); } - evas_object_smart_callback_call(sd->fs, SIG_SELECTED, (void *)path); + evas_object_smart_callback_call(sd->fs, SIG_SELECTED, (void*)path); -end: + end: wd->sel_idler = NULL; free(sd); return ECORE_CALLBACK_CANCEL; } static void -_sel(void *data, - Evas_Object *obj __UNUSED__, - void *event_info) +_sel(void *data, Evas_Object *obj __UNUSED__, void *event_info) { struct sel_data *sd; Widget_Data *wd; void *old_sd; - char *dir; wd = elm_widget_data_get(data); if (!wd) return; sd = malloc(sizeof(*sd)); sd->fs = data; - sd->path = wd->mode == ELM_FILESELECTOR_LIST ? - elm_genlist_item_data_get(event_info) : - elm_gengrid_item_data_get(event_info); + sd->path = elm_genlist_item_data_get(event_info); - if (!sd->path) - { - eina_stringshare_replace(&wd->path, ""); - goto end; - } - - dir = wd->only_folder ? strdup(sd->path) : ecore_file_dir_get(sd->path); - if (dir) - { - eina_stringshare_replace(&wd->path, dir); - free(dir); - } - else - { - eina_stringshare_replace(&wd->path, ""); - } - -end: if (wd->sel_idler) { - old_sd = ecore_idler_del(wd->sel_idler); - free(old_sd); + old_sd = ecore_idler_del(wd->sel_idler); + free(old_sd); } wd->sel_idler = ecore_idler_add(_sel_do, sd); } static void -_up(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_up(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fs = data; - char *parent; - Widget_Data *wd = elm_widget_data_get(fs); if (!wd) return; - parent = ecore_file_dir_get(wd->path); + char *parent = ecore_file_dir_get(wd->path); _populate(fs, parent, NULL); free(parent); } static void -_home(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_home(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fs = data; _populate(fs, getenv("HOME"), NULL); } static void -_ok(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_ok(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fs = data; evas_object_smart_callback_call(fs, SIG_DONE, - (void *)elm_fileselector_selected_get(fs)); + (void*)elm_fileselector_selected_get(fs)); } static void -_canc(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_canc(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fs = data; evas_object_smart_callback_call(fs, SIG_DONE, NULL); } static void -_anchor_clicked(void *data, - Evas_Object *obj __UNUSED__, - void *event_info) +_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Object *fs = data; Widget_Data *wd = elm_widget_data_get(fs); Elm_Entry_Anchor_Info *info = event_info; const char *p; if (!wd) return; + //~ printf("ANCHOR CLICKED %s\n", info->name); // keep a ref to path 'couse it will be destroyed by _populate p = eina_stringshare_add(info->name); _populate(fs, p, NULL); - evas_object_smart_callback_call(data, SIG_SELECTED, (void *)p); + evas_object_smart_callback_call(data, SIG_SELECTED, (void*)p); eina_stringshare_del(p); } static void -_do_anchors(Evas_Object *obj, - const char *path) +_do_anchors(Evas_Object *obj, const char *path) { Widget_Data *wd = elm_widget_data_get(obj); - char **tok, buf[PATH_MAX * 3]; + char **tok, buf[PATH_MAX*3]; int i, j; if (!wd) return; + //~ printf("ANCHORIZE...\n"); buf[0] = '\0'; tok = eina_str_split(path, "/", 0); - eina_strlcat(buf, "root", sizeof(buf)); for (i = 0; tok[i]; i++) { - if ((!tok[i]) || (!tok[i][0])) continue; - eina_strlcat(buf, wd->path_separator, sizeof(buf)); - eina_strlcat(buf, "", sizeof(buf)); - eina_strlcat(buf, tok[i], sizeof(buf)); - eina_strlcat(buf, "", sizeof(buf)); + if (strlen(tok[i]) < 1) continue; + //~ printf("TOK: %s\n", tok[i]); + eina_strlcat(buf, "/", sizeof(buf)); + eina_strlcat(buf, tok[i], sizeof(buf)); + eina_strlcat(buf, "", sizeof(buf)); } free(tok[0]); free(tok); - elm_scrolled_entry_entry_set(wd->path_entry, buf); + //~ printf("ANCHOR: %s\n", buf); + elm_entry_entry_set(wd->entry, buf); } static void -_populate(Evas_Object *obj, - const char *path, - Elm_Genlist_Item *parent) +_populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent) { Widget_Data *wd = elm_widget_data_get(obj); DIR *dir; @@ -473,70 +325,56 @@ _populate(Evas_Object *obj, if ((!wd) || (!ecore_file_is_dir(path))) return; dir = opendir(path); if (!dir) return; - evas_object_smart_callback_call(obj, SIG_DIRECTORY_OPEN, (void *)path); + evas_object_smart_callback_call(obj, SIG_DIRECTORY_OPEN, (void*)path); if (!parent) { - elm_genlist_clear(wd->files_list); - elm_gengrid_clear(wd->files_grid); - eina_stringshare_replace(&wd->path, path); - _do_anchors(obj, path); + elm_genlist_clear(wd->list); + eina_stringshare_replace(&wd->path, path); + _do_anchors(obj, path); } - if (wd->filename_entry) elm_scrolled_entry_entry_set(wd->filename_entry, ""); + if (wd->entry2) elm_entry_entry_set(wd->entry2, ""); while ((dp = readdir(dir))) { - if (dp->d_name[0] == '.') continue; // TODO make this configurable - - snprintf(buf, sizeof(buf), "%s/%s", path, dp->d_name); - real = ecore_file_realpath(buf); /* TODO: this will resolv - * symlinks...I dont like - * it*/ - if (ecore_file_is_dir(real)) - dirs = eina_list_append(dirs, real); - else if (!wd->only_folder) - files = eina_list_append(files, real); + if (dp->d_name[0] == '.') continue; // TODO make this configurable + + snprintf(buf, sizeof(buf), "%s/%s", path, dp->d_name); + real = ecore_file_realpath(buf); //TODO this will resolv symlinks...I dont like it + if (ecore_file_is_dir(real)) + dirs = eina_list_append(dirs, real); + else if(!wd->only_folder) + files = eina_list_append(files, real); } closedir(dir); - files = eina_list_sort(files, eina_list_count(files), - EINA_COMPARE_CB(strcoll)); + files = eina_list_sort(files, eina_list_count(files), EINA_COMPARE_CB(strcoll)); dirs = eina_list_sort(dirs, eina_list_count(dirs), EINA_COMPARE_CB(strcoll)); EINA_LIST_FOREACH(dirs, l, real) { - if (wd->mode == ELM_FILESELECTOR_LIST) - elm_genlist_item_append(wd->files_list, &list_itc, - eina_stringshare_add(real), /* item data */ - parent, - wd->expand ? ELM_GENLIST_ITEM_SUBITEMS : - ELM_GENLIST_ITEM_NONE, - NULL, NULL); - else if (wd->mode == ELM_FILESELECTOR_GRID) - elm_gengrid_item_append(wd->files_grid, &grid_itc, - eina_stringshare_add(real), /* item data */ - NULL, NULL); - - free(real); + //~ printf("DIR: %s\n", real); + elm_genlist_item_append(wd->list, &itc, + eina_stringshare_add(real), /* item data */ + parent, + wd->expand ? ELM_GENLIST_ITEM_SUBITEMS : + ELM_GENLIST_ITEM_NONE, + NULL, NULL); + free(real); } eina_list_free(dirs); EINA_LIST_FOREACH(files, l, real) { - if (wd->mode == ELM_FILESELECTOR_LIST) - elm_genlist_item_append(wd->files_list, &list_itc, - eina_stringshare_add(real), /* item data */ - parent, ELM_GENLIST_ITEM_NONE, - NULL, NULL); - else if (wd->mode == ELM_FILESELECTOR_GRID) - elm_gengrid_item_append(wd->files_grid, &grid_itc, - eina_stringshare_add(real), /* item data */ - NULL, NULL); - free(real); + //~ printf("FILE: %s [%p]\n", real, wd->list); + elm_genlist_item_append(wd->list, &itc, + eina_stringshare_add(real), /* item data */ + parent, ELM_GENLIST_ITEM_NONE, + NULL, NULL); + free(real); } eina_list_free(files); } /*** API ***/ - /** * Add a new Fileselector object * @@ -548,29 +386,33 @@ _populate(Evas_Object *obj, EAPI Evas_Object * elm_fileselector_add(Evas_Object *parent) { - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - - Evas *e = evas_object_evas_get(parent); - if (!e) return NULL; - Evas_Object *obj, *ic, *bt, *li, *en, *grid; + Evas_Object *obj, *ic, *bt, *box; Widget_Data *wd; - int s; // Elementary Widget wd = ELM_NEW(Widget_Data); - wd->expand = !!_elm_config->fileselector_expand_enable; + wd->expand = EINA_FALSE; obj = elm_widget_add(evas_object_evas_get(parent)); ELM_SET_WIDTYPE(widtype, "fileselector"); elm_widget_type_set(obj, "fileselector"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); - elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); - wd->edje = edje_object_add(e); - _elm_theme_object_set(obj, wd->edje, "fileselector", "base", "default"); - elm_widget_resize_object_set(obj, wd->edje); + // TODO Do we need a bg object? a frame? + // vbox + wd->vbox = elm_box_add(parent); + evas_object_size_hint_weight_set(wd->vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_widget_resize_object_set(obj, wd->vbox); + evas_object_show(wd->vbox); + + // buttons box + box = elm_box_add(parent); + elm_box_horizontal_set(box, 1); + elm_widget_sub_object_add(obj, box); + elm_box_pack_end(wd->vbox, box); + evas_object_size_hint_align_set(box, 0.0, 0.0); + evas_object_show(box); // up btn ic = elm_icon_add(parent); @@ -580,11 +422,10 @@ elm_fileselector_add(Evas_Object *parent) elm_button_icon_set(bt, ic); elm_button_label_set(bt, "Up"); evas_object_size_hint_align_set(bt, 0.0, 0.0); - - evas_object_smart_callback_add(bt, "clicked", _up, obj); - elm_widget_sub_object_add(obj, bt); - wd->up_button = bt; + elm_box_pack_end(box, bt); + evas_object_smart_callback_add(bt, "clicked", _up, obj); + evas_object_show(bt); // home btn ic = elm_icon_add(parent); @@ -594,73 +435,63 @@ elm_fileselector_add(Evas_Object *parent) elm_button_icon_set(bt, ic); elm_button_label_set(bt, "Home"); evas_object_size_hint_align_set(bt, 0.0, 0.0); - - evas_object_smart_callback_add(bt, "clicked", _home, obj); - elm_widget_sub_object_add(obj, bt); - wd->home_button = bt; - - list_itc.item_style = grid_itc.item_style = "default"; - list_itc.func.label_get = grid_itc.func.label_get = _itc_label_get; - list_itc.func.icon_get = grid_itc.func.icon_get = _itc_icon_get; - list_itc.func.state_get = grid_itc.func.state_get = _itc_state_get; - list_itc.func.del = grid_itc.func.del = _itc_del; - - li = elm_genlist_add(parent); - evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_min_set(li, 100, 100); - - grid = elm_gengrid_add(parent); - evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - s = elm_finger_size_get() * 2; - elm_gengrid_item_size_set(grid, s, s); - elm_gengrid_align_set(grid, 0.0, 0.0); - - evas_object_smart_callback_add(li, "selected", _sel, obj); - evas_object_smart_callback_add(li, "expand,request", _expand_req, obj); - evas_object_smart_callback_add(li, "contract,request", _contract_req, obj); - evas_object_smart_callback_add(li, "expanded", _expand_done, obj); - evas_object_smart_callback_add(li, "contracted", _contract_done, obj); - - evas_object_smart_callback_add(grid, "selected", _sel, obj); - - elm_widget_sub_object_add(obj, li); - elm_widget_sub_object_add(obj, grid); - wd->files_list = li; - wd->files_grid = grid; + elm_box_pack_end(box, bt); + evas_object_smart_callback_add(bt, "clicked", _home, obj); + evas_object_show(bt); + + // genlist + itc.item_style = "default"; + itc.func.label_get = _itc_label_get; + itc.func.icon_get = _itc_icon_get; + itc.func.state_get = _itc_state_get; + itc.func.del = _itc_del; + + wd->list = elm_genlist_add(parent); + evas_object_size_hint_align_set(wd->list, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(wd->list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_min_set(wd->list, 100, 100); + elm_widget_sub_object_add(obj, wd->list); + elm_box_pack_end(wd->vbox, wd->list); + evas_object_show(wd->list); + + evas_object_smart_callback_add(wd->list, "selected", _sel, obj); + evas_object_smart_callback_add(wd->list, "expand,request", _expand_req, obj); + evas_object_smart_callback_add(wd->list, "contract,request", _contract_req, obj); + evas_object_smart_callback_add(wd->list, "expanded", _expand_done, obj); + evas_object_smart_callback_add(wd->list, "contracted", _contract_done, obj); // path entry - en = elm_scrolled_entry_add(parent); - elm_scrolled_entry_editable_set(en, EINA_FALSE); - elm_scrolled_entry_single_line_set(en, EINA_TRUE); - elm_scrolled_entry_line_char_wrap_set(en, EINA_TRUE); - evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); - - evas_object_smart_callback_add(en, "anchor,clicked", _anchor_clicked, obj); - - elm_widget_sub_object_add(obj, en); - wd->path_entry = en; - - // filename entry - en = elm_scrolled_entry_add(parent); - elm_scrolled_entry_editable_set(en, EINA_TRUE); - elm_scrolled_entry_single_line_set(en, EINA_TRUE); - elm_scrolled_entry_line_char_wrap_set(en, EINA_TRUE); - evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); - - elm_widget_sub_object_add(obj, en); - wd->filename_entry = en; - - elm_fileselector_buttons_ok_cancel_set(obj, EINA_TRUE); - elm_fileselector_is_save_set(obj, EINA_FALSE); - - _theme_hook(obj); + wd->entry = elm_entry_add(parent); + elm_widget_sub_object_add(obj, wd->entry); + elm_entry_editable_set(wd->entry, 0); + elm_entry_single_line_set(wd->entry, EINA_FALSE); + elm_entry_line_char_wrap_set(wd->entry, EINA_TRUE); + evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, 0.0); + elm_box_pack_end(wd->vbox, wd->entry); + evas_object_show(wd->entry); + evas_object_smart_callback_add(wd->entry, "anchor,clicked", _anchor_clicked, obj); + + // name entry scroller + wd->scr2 = elm_scroller_add(parent); + elm_scroller_content_min_limit(wd->scr2, 0, 1); + elm_scroller_policy_set(wd->scr2, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); + evas_object_size_hint_weight_set(wd->scr2, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(wd->scr2, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(wd->vbox, wd->scr2); + evas_object_show(wd->scr2); + + elm_fileselector_buttons_ok_cancel_set(obj, 1); + + // Is this the right way to show sub-objs ?? or use the show/hide cbs ?? + //~ evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj); + //~ evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + //~ _changed_size_hints, obj); + _sizing_eval(obj); + // TODO: convert Elementary to subclassing of Evas_Smart_Class + // TODO: and save some bytes, making descriptions per-class and not instance! evas_object_smart_callbacks_descriptions_set(obj, _signals); return obj; } @@ -675,19 +506,28 @@ elm_fileselector_add(Evas_Object *parent) * @ingroup Fileselector */ EAPI void -elm_fileselector_is_save_set(Evas_Object *obj, - Eina_Bool is_save) +elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - - elm_object_disabled_set(wd->filename_entry, is_save); - if (is_save) - edje_object_signal_emit(wd->edje, "elm,state,save,on", "elm"); + { + if (wd->entry2) return; + wd->entry2 = elm_entry_add(elm_widget_parent_get(obj)); + elm_widget_sub_object_add(obj, wd->entry2); + elm_entry_editable_set(wd->entry2, 1); + elm_entry_single_line_set(wd->entry2, EINA_TRUE); + evas_object_size_hint_weight_set(wd->entry2, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(wd->entry2, EVAS_HINT_FILL, 0.0); + elm_scroller_content_set(wd->scr2, wd->entry2); + evas_object_show(wd->entry2); + } else - edje_object_signal_emit(wd->edje, "elm,state,save,off", "elm"); + { + evas_object_del(wd->entry2); + wd->entry2 = NULL; + } } /** @@ -704,9 +544,10 @@ elm_fileselector_is_save_get(const Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; - return elm_object_disabled_get(wd->filename_entry); + return wd->entry2 ? EINA_TRUE : EINA_FALSE; } + /** * This enables/disables folder-only view in the fileselector. * @@ -717,17 +558,16 @@ elm_fileselector_is_save_get(const Evas_Object *obj) * @ingroup Fileselector */ EAPI void -elm_fileselector_folder_only_set(Evas_Object *obj, - Eina_Bool only) +elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->only_folder == only) return; - wd->only_folder = !!only; - if (wd->path) _populate(obj, wd->path, NULL); + wd->only_folder = only; } + /** * This gets the state of file display in the fileselector. * @@ -746,8 +586,10 @@ elm_fileselector_folder_only_get(const Evas_Object *obj) return wd->only_folder; } + /** - * This enables/disables the ok,cancel buttons. + * This enables/disables the file name entry box where the user can + * type in the name of a file to be selected. * * @param obj The fileselector object * @param only If true, a box containing ok and cancel buttons is created. @@ -756,45 +598,51 @@ elm_fileselector_folder_only_get(const Evas_Object *obj) * @ingroup Fileselector */ EAPI void -elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, - Eina_Bool visible) +elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool only) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *bt; + Evas_Object *box, *bt; if (!wd) return; - - if (visible) + if (only) { + if (wd->buttons.bx) return; + // buttons box + box = elm_box_add(obj); + wd->buttons.bx = box; + elm_box_horizontal_set(box, 1); + elm_widget_sub_object_add(obj, box); + elm_box_pack_end(wd->vbox, box); + evas_object_show(box); + // cancel btn bt = elm_button_add(obj); + wd->buttons.cancel = bt; elm_button_label_set(bt, "Cancel"); - - evas_object_smart_callback_add(bt, "clicked", _canc, obj); - elm_widget_sub_object_add(obj, bt); - wd->cancel_button = bt; + elm_box_pack_end(box, bt); + evas_object_smart_callback_add(bt, "clicked", _canc, obj); + evas_object_show(bt); // ok btn bt = elm_button_add(obj); + wd->buttons.ok = bt; elm_button_label_set(bt, "OK"); - - evas_object_smart_callback_add(bt, "clicked", _ok, obj); - elm_widget_sub_object_add(obj, bt); - wd->ok_button = bt; - - _theme_hook(obj); + elm_box_pack_end(box, bt); + evas_object_smart_callback_add(bt, "clicked", _ok, obj); + evas_object_show(bt); } else { - evas_object_del(wd->cancel_button); - wd->cancel_button = NULL; - evas_object_del(wd->ok_button); - wd->ok_button = NULL; + evas_object_del(wd->buttons.bx); + evas_object_del(wd->buttons.ok); + evas_object_del(wd->buttons.cancel); + wd->buttons.bx = NULL; } } + /** * This gets the state of the box containing ok and cancel buttons. * @@ -810,27 +658,22 @@ elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; - return wd->ok_button ? EINA_TRUE : EINA_FALSE; + return wd->buttons.bx ? EINA_TRUE : EINA_FALSE; } + /** - * This enables a tree view in the fileselector, if in @c - * ELM_FILESELECTOR_LIST mode. If it's in other mode, the changes - * made by this function will only be visible when one switches back - * to list mode. + * This enables tree view in the fileselector. Arrows are created on the + * sides of directories, allowing them to expand in place. * * @param obj The fileselector object * @param expand If true, tree view is enabled. * If false, tree view is disabled. * - * In a tree view, arrows are created on the sides of directories, - * allowing them to expand in place. - * * @ingroup Fileselector */ EAPI void -elm_fileselector_expandable_set(Evas_Object *obj, - Eina_Bool expand) +elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd; @@ -838,9 +681,7 @@ elm_fileselector_expandable_set(Evas_Object *obj, wd = elm_widget_data_get(obj); if (!wd) return; - wd->expand = !!expand; - - if (wd->path) _populate(obj, wd->path, NULL); + wd->expand = expand; } /** @@ -870,10 +711,8 @@ elm_fileselector_expandable_get(const Evas_Object *obj) * @ingroup Fileselector */ EAPI void -elm_fileselector_path_set(Evas_Object *obj, - const char *path) +elm_fileselector_path_set(Evas_Object *obj, const char *path) { - ELM_CHECK_WIDTYPE(obj, widtype); _populate(obj, path, NULL); } @@ -895,80 +734,6 @@ elm_fileselector_path_get(const Evas_Object *obj) } /** - * This sets the mode in which the fileselector will display files. - * - * @param obj The fileselector object - - * @param mode The mode of the fileselector, being it one of @c - * ELM_FILESELECTOR_LIST (default) or @c ELM_FILESELECTOR_GRID. The - * first one, naturally, will display the files in a list. By using - * elm_fileselector_expandable_set(), the user will trigger a tree - * view for that list. The latter will make the widget to display its - * entries in a grid form. - * - * @see elm_fileselector_expandable_set(). - * - * @ingroup Fileselector - */ -EAPI void -elm_fileselector_mode_set(Evas_Object *obj, - Elm_Fileselector_Mode mode) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - if (mode == wd->mode) return; - - if (mode == ELM_FILESELECTOR_LIST) - { - if (edje_object_part_swallow(wd->edje, "elm.swallow.files", - wd->files_list)) - { - evas_object_show(wd->files_list); - evas_object_hide(wd->files_grid); - } - else - evas_object_hide(wd->files_list); - } - else - { - if (edje_object_part_swallow(wd->edje, "elm.swallow.files", - wd->files_grid)) - { - evas_object_show(wd->files_grid); - evas_object_hide(wd->files_list); - } - else - evas_object_hide(wd->files_grid); - } - - wd->mode = mode; - - _populate(obj, wd->path, NULL); -} - -/** - * This gets the mode in which the fileselector is displaying files. - * - * @param obj The fileselector object - * @return The mode in which the fileselector is at - * - * @ingroup Fileselector - */ -EAPI Elm_Fileselector_Mode -elm_fileselector_mode_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) ELM_FILESELECTOR_LAST; - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_FILESELECTOR_LAST; - - return wd->mode; -} - -/** * This gets the currently selected path in the file selector. * * @param obj The file selector object @@ -981,33 +746,22 @@ elm_fileselector_selected_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); + Elm_Genlist_Item *it; if (!wd) return NULL; - - if (wd->filename_entry) + if (wd->entry2) { - const char *name; - char buf[PATH_MAX]; - - name = elm_scrolled_entry_entry_get(wd->filename_entry); - snprintf(buf, sizeof(buf), "%s/%s", - wd->only_folder ? ecore_file_dir_get(wd->path) : wd->path, - name); - eina_stringshare_replace(&wd->selection, buf); - return wd->selection; + const char *name; + char buf[PATH_MAX]; + + name = elm_entry_entry_get(wd->entry2); + //TODO remove
+ snprintf(buf, sizeof(buf), "%s/%s", wd->path, name); + eina_stringshare_replace(&wd->selection, buf); + return wd->selection; } - if (wd->mode == ELM_FILESELECTOR_LIST) - { - Elm_Genlist_Item *it; - it = elm_genlist_selected_item_get(wd->files_list); - if (it) return elm_genlist_item_data_get(it); - } - else - { - Elm_Gengrid_Item *it; - it = elm_gengrid_selected_item_get(wd->files_grid); - if (it) return elm_gengrid_item_data_get(it); - } + it = elm_genlist_selected_item_get(wd->list); + if (it) return elm_genlist_item_data_get(it); return wd->path; } @@ -1024,29 +778,24 @@ elm_fileselector_selected_get(const Evas_Object *obj) * @ingroup Fileselector */ EAPI Eina_Bool -elm_fileselector_selected_set(Evas_Object *obj, - const char *path) +elm_fileselector_selected_set(Evas_Object *obj, const char *path) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; - if (ecore_file_is_dir(path)) - _populate(obj, path, NULL); + if (ecore_file_is_dir(path)) _populate(obj, path, NULL); else { - if (!ecore_file_exists(path)) - return EINA_FALSE; - - _populate(obj, ecore_file_dir_get(path), NULL); - if (wd->filename_entry) - { - elm_scrolled_entry_entry_set(wd->filename_entry, - ecore_file_file_get(path)); - eina_stringshare_replace(&wd->selection, path); - } + if (!ecore_file_exists(path)) return EINA_FALSE; + + _populate(obj, ecore_file_dir_get(path), NULL); + if (wd->entry2) + { + elm_entry_entry_set(wd->entry2, ecore_file_file_get(path)); + eina_stringshare_replace(&wd->selection, path); + } } return EINA_TRUE; } - diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c index ea48d83..02cc279 100644 --- a/src/lib/elc_fileselector_button.c +++ b/src/lib/elc_fileselector_button.c @@ -1,7 +1,7 @@ #include #include "elm_priv.h" -/** + /** * @defgroup File_Selector_Button File Selector Button * @ingroup Elementary * @@ -15,40 +15,41 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { - Evas_Object *self, *btn, *fs, *fsw; - const char *window_title; - Evas_Coord w, h; - struct - { + Evas_Object *btn, *icon, *fs; + const char *window_title; + const char *btn_label; + Evas_Coord w, h; + struct { const char *path; - Eina_Bool expandable : 1; - Eina_Bool folder_only : 1; - Eina_Bool is_save : 1; + Eina_Bool expandable:1; + Eina_Bool folder_only:1; + Eina_Bool is_save:1; } fsd; - Eina_Bool inwin_mode : 1; + Eina_Bool inwin_mode:1; }; -#define DEFAULT_WINDOW_TITLE "Select a file" +static const char DEFAULT_WINDOW_TITLE[] = "Select a file"; static const char *widtype = NULL; - static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); -static void _changed_size_hints(void *data, - Evas *e, - Evas_Object *obj, - void *event_info); -static void _on_focus_hook(void *data, - Evas_Object *obj); -static void _selection_done(void *data, - Evas_Object *obj, - void *event_info); -static void _activate(Widget_Data *wd); - +static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _sub_del(void *data, Evas_Object *obj, void *event_info); +static void _signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _signal_pressed(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _signal_unpressed(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _on_focus_hook(void *data, Evas_Object *obj); +static void _selection_done(void *data, Evas_Object *obj, void *event_info); + +static const char SIG_CLICKED[] = "clicked"; +static const char SIG_UNPRESSED[] = "unpressed"; static const char SIG_FILE_CHOSEN[] = "file,chosen"; -static const Evas_Smart_Cb_Description _signals[] = { +static const Evas_Smart_Cb_Description _signals[] = +{ + {SIG_CLICKED, ""}, + {SIG_UNPRESSED, ""}, {SIG_FILE_CHOSEN, "s"}, {NULL, NULL} }; @@ -62,35 +63,54 @@ _del_hook(Evas_Object *obj) wd = elm_widget_data_get(obj); if (!wd) return; + if (wd->btn_label) eina_stringshare_del(wd->btn_label); if (wd->window_title) eina_stringshare_del(wd->window_title); if (wd->fsd.path) eina_stringshare_del(wd->fsd.path); if (wd->fs) { - win = evas_object_data_del(obj, "win"); - evas_object_del(win); + win = evas_object_data_del(obj, "win"); + evas_object_del(win); } free(wd); } static void -_on_focus_hook(void *data __UNUSED__, - Evas_Object *obj) +_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (elm_widget_focus_get(obj)) - elm_widget_focus_steal(wd->btn); + { + edje_object_signal_emit(wd->btn, "elm,action,focus", "elm"); + evas_object_focus_set(wd->btn, 1); + } + else + { + edje_object_signal_emit(wd->btn, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->btn, 0); + } } static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - char buf[4096]; if (!wd) return; - snprintf(buf, sizeof(buf), "fileselector_button/%s", - elm_widget_style_get(obj)); - elm_object_style_set(wd->btn, buf); + _elm_theme_object_set(obj, wd->btn, "button", "base", elm_widget_style_get(obj)); + if (wd->icon) + edje_object_part_swallow(wd->btn, "elm.swallow.content", wd->icon); + if (wd->btn_label) + edje_object_signal_emit(wd->btn, "elm,state,text,visible", "elm"); + else + edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm"); + if (wd->icon) + edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm"); + else + edje_object_signal_emit(wd->btn, "elm,state,icon,hidden", "elm"); + edje_object_part_text_set(wd->btn, "elm.text", wd->btn_label); + edje_object_message_signal_process(wd->btn); + edje_object_scale_set(wd->btn, + elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); } @@ -99,7 +119,10 @@ _disable_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - elm_widget_disabled_set(wd->btn, elm_widget_disabled_get(obj)); + if (elm_widget_disabled_get(obj)) + edje_object_signal_emit(wd->btn, "elm,state,disabled", "elm"); + else + edje_object_signal_emit(wd->btn, "elm,state,enabled", "elm"); } static void @@ -107,48 +130,70 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; + if (!wd) return; - evas_object_size_hint_min_get(wd->btn, &minw, &minh); - evas_object_size_hint_max_get(wd->btn, &maxw, &maxh); + elm_coords_finger_size_adjust(1, &minw, 1, &minh); + edje_object_size_min_restricted_calc(wd->btn, &minw, &minh, minw, minh); + elm_coords_finger_size_adjust(1, &minw, 1, &minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); } static void -_changed_size_hints(void *data, - Evas *e __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; + if (obj != wd->icon) return; _sizing_eval(data); } static void -_activate_hook(Evas_Object *obj) +_sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) { - Widget_Data *wd; - wd = elm_widget_data_get(obj); + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *sub = event_info; if (!wd) return; - _activate(wd); + if (sub == wd->icon) + { + edje_object_signal_emit(wd->btn, "elm,state,icon,hidden", "elm"); + evas_object_event_callback_del_full(sub, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + wd->icon = NULL; + edje_object_message_signal_process(wd->btn); + _sizing_eval(obj); + } } static void -_button_clicked(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) { - _activate(data); + Widget_Data *wd = elm_widget_data_get(data); + if (!wd) return; + + evas_object_smart_callback_call(data, SIG_CLICKED, NULL); + + /* safe guard when the theme does not emit the 'unpress' signal */ + _signal_unpressed(data, obj, emission, source); } static Evas_Object * _parent_win_get(Evas_Object *obj) { - while ((obj) && (strcmp(elm_widget_type_get(obj), "win"))) - obj = elm_object_parent_widget_get(obj); + Evas_Object *ret; - return obj; + ret = elm_object_parent_widget_get(obj); + if (!ret) return NULL; + + if (strcmp(elm_widget_type_get(ret), "win") != 0) + { + DBG("Widget type (%s) is not \"win\", going up\n", + elm_widget_type_get(ret)); + return _parent_win_get(ret); + } + + return ret; } static Evas_Object * @@ -170,69 +215,101 @@ _new_window_add(Widget_Data *wd) } static void -_activate(Widget_Data *wd) +_fs_launch(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - Eina_Bool is_inwin = EINA_FALSE; + Evas_Object *fs_btn, *win = NULL, *iw = NULL; + Eina_Bool win_fallback; + Widget_Data *wd; + fs_btn = data; + wd = elm_widget_data_get(fs_btn); + + if (!wd) return; if (wd->fs) return; + win_fallback = EINA_FALSE; if (wd->inwin_mode) { - wd->fsw = _parent_win_get(wd->self); - - if (!wd->fsw) - wd->fsw = _new_window_add(wd); - else - { - wd->fsw = elm_win_inwin_add(wd->fsw); - is_inwin = EINA_TRUE; - } + win = _parent_win_get(fs_btn); + + if (!win) + { + ERR("No elementary window found as parent of the file selector " + "button! Launching the file selector inside a new elementary" + " window, then."); + win_fallback = EINA_TRUE; + } + else + { + iw = elm_win_inwin_add(win); + evas_object_data_set(fs_btn, "win", iw); + } } - else - wd->fsw = _new_window_add(wd); - wd->fs = elm_fileselector_add(wd->fsw); + if ((!wd->inwin_mode) || (win_fallback)) + { + win = _new_window_add(wd); + evas_object_data_set(fs_btn, "win", win); + } + + wd->fs = elm_fileselector_add(win); elm_fileselector_expandable_set(wd->fs, wd->fsd.expandable); elm_fileselector_folder_only_set(wd->fs, wd->fsd.folder_only); elm_fileselector_is_save_set(wd->fs, wd->fsd.is_save); elm_fileselector_selected_set(wd->fs, wd->fsd.path); evas_object_size_hint_weight_set(wd->fs, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); + EVAS_HINT_EXPAND); evas_object_size_hint_align_set(wd->fs, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_smart_callback_add(wd->fs, "done", _selection_done, wd); + evas_object_smart_callback_add(wd->fs, "done", _selection_done, fs_btn); evas_object_show(wd->fs); - if (is_inwin) + if ((wd->inwin_mode) && (!win_fallback)) { - elm_win_inwin_content_set(wd->fsw, wd->fs); - elm_win_inwin_activate(wd->fsw); + elm_win_inwin_content_set(iw, wd->fs); + elm_win_inwin_activate(iw); } else { - elm_win_resize_object_add(wd->fsw, wd->fs); - evas_object_show(wd->fsw); + elm_win_resize_object_add(win, wd->fs); + evas_object_show(win); } } static void -_selection_done(void *data, - Evas_Object *obj __UNUSED__, - void *event_info) +_selection_done(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - const char *file = event_info; - Widget_Data *wd = data; - Evas_Object *del; + Evas_Object *fs_btn, *win; + const char *file; + Widget_Data *wd; + + file = event_info; + fs_btn = data; + + wd = elm_widget_data_get(fs_btn); if (!wd) return; + win = evas_object_data_del(fs_btn, "win"); + + evas_object_smart_callback_call(fs_btn, SIG_FILE_CHOSEN, event_info); if (file) eina_stringshare_replace(&wd->fsd.path, file); - del = wd->fsw; wd->fs = NULL; - wd->fsw = NULL; - evas_object_del(del); + evas_object_del(win); +} - evas_object_smart_callback_call(wd->self, SIG_FILE_CHOSEN, - (void *)wd->fsd.path); +static void +_signal_pressed(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +{ + Widget_Data *wd = elm_widget_data_get(data); + if (!wd) return; +} + +static void +_signal_unpressed(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +{ + Widget_Data *wd = elm_widget_data_get(data); + if (!wd) return; + evas_object_smart_callback_call(data, SIG_UNPRESSED, NULL); } /** @@ -250,39 +327,42 @@ elm_fileselector_button_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); wd->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE); wd->fsd.path = eina_stringshare_add(getenv("HOME")); - wd->fsd.expandable = _elm_config->fileselector_expand_enable; - wd->inwin_mode = _elm_config->inwin_dialogs_enable; wd->w = 400; wd->h = 400; e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "fileselector_button"); elm_widget_type_set(obj, "fileselector_button"); elm_widget_sub_object_add(parent, obj); - wd->self = obj; elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_activate_hook_set(obj, _activate_hook); - - wd->btn = elm_button_add(parent); + elm_widget_can_focus_set(obj, 1); + + wd->btn = edje_object_add(e); + _elm_theme_object_set(obj, wd->btn, "button", "base", "default"); + edje_object_signal_callback_add(wd->btn, "elm,action,click", "", + _signal_clicked, obj); + edje_object_signal_callback_add(wd->btn, "elm,action,click", "", + _fs_launch, obj); + edje_object_signal_callback_add(wd->btn, "elm,action,press", "", + _signal_pressed, obj); + edje_object_signal_callback_add(wd->btn, "elm,action,unpress", "", + _signal_unpressed, obj); elm_widget_resize_object_set(obj, wd->btn); - evas_object_event_callback_add(wd->btn, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - evas_object_smart_callback_add(wd->btn, "clicked", _button_clicked, wd); - elm_widget_sub_object_add(obj, wd->btn); - _theme_hook(obj); + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); + + _sizing_eval(obj); + + // TODO: convert Elementary to subclassing of Evas_Smart_Class + // TODO: and save some bytes, making descriptions per-class and not instance! evas_object_smart_callbacks_descriptions_set(obj, _signals); return obj; } @@ -296,30 +376,66 @@ elm_fileselector_button_add(Evas_Object *parent) * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_label_set(Evas_Object *obj, - const char *label) +elm_fileselector_button_label_set(Evas_Object *obj, const char *label) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - elm_button_label_set(wd->btn, label); + eina_stringshare_replace(&wd->btn_label, label); + if (label) + edje_object_signal_emit(wd->btn, "elm,state,text,visible", "elm"); + else + edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm"); + edje_object_message_signal_process(wd->btn); + edje_object_part_text_set(wd->btn, "elm.text", label); + _sizing_eval(obj); +} + +EAPI const char * +elm_fileselector_button_label_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + return wd->btn_label; } /** - * Get the label used in the file selector button. + * Set the path to start the button's file selector with, when clicked. * * @param obj The button object - * @return The button label + * @param path Path to a file/directory + * + * Default path is "HOME" environment variable's value. + * + * @ingroup File_Selector_Button + */ +EAPI void +elm_fileselector_button_selected_set(Evas_Object *obj, const char *path) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + eina_stringshare_replace(&wd->fsd.path, path); +} + +/** + * Get the last path which the button's file selector was set to. + * + * @param obj The button object + * @param path Path to a file/directory + * + * Default path is "HOME" environment variable's value. * * @ingroup File_Selector_Button */ EAPI const char * -elm_fileselector_button_label_get(const Evas_Object *obj) +elm_fileselector_button_selected_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - return elm_button_label_get(wd->btn); + return wd->fsd.path; } /** @@ -334,24 +450,18 @@ elm_fileselector_button_label_get(const Evas_Object *obj) * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_window_title_set(Evas_Object *obj, - const char *title) +elm_fileselector_button_window_title_set(Evas_Object *obj, const char *title) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; eina_stringshare_replace(&wd->window_title, title); - - if (wd->fsw) - elm_win_title_set(wd->fsw, wd->window_title); } /** * Get the title of the file selector button's window. * * @param obj The button object - * @return Title of the file selector button's window * * @ingroup File_Selector_Button */ @@ -360,7 +470,6 @@ elm_fileselector_button_window_title_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; return wd->window_title; } @@ -378,19 +487,13 @@ elm_fileselector_button_window_title_get(const Evas_Object *obj) * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_window_size_set(Evas_Object *obj, - Evas_Coord width, - Evas_Coord height) +elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; wd->w = width; wd->h = height; - - if (wd->fsw) - evas_object_resize(wd->fsw, wd->w, wd->h); } /** @@ -403,13 +506,10 @@ elm_fileselector_button_window_size_set(Evas_Object *obj, * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_window_size_get(const Evas_Object *obj, - Evas_Coord *width, - Evas_Coord *height) +elm_fileselector_button_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; if (width) *width = wd->w; if (height) *height = wd->h; @@ -422,22 +522,16 @@ elm_fileselector_button_window_size_get(const Evas_Object *obj, * @param path The path string * * It must be a directory path. - * Default path is "HOME" environment variable's value. * * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_path_set(Evas_Object *obj, - const char *path) +elm_fileselector_button_path_set(Evas_Object *obj, const char *path) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; eina_stringshare_replace(&wd->fsd.path, path); - - if (wd->fs) - elm_fileselector_selected_set(wd->fs, wd->fsd.path); } /** @@ -468,17 +562,12 @@ elm_fileselector_button_path_get(const Evas_Object *obj) * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_expandable_set(Evas_Object *obj, - Eina_Bool value) +elm_fileselector_button_expandable_set(Evas_Object *obj, Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; wd->fsd.expandable = value; - - if (wd->fs) - elm_fileselector_expandable_set(wd->fs, wd->fsd.expandable); } /** @@ -494,7 +583,6 @@ elm_fileselector_button_expandable_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; return wd->fsd.expandable; } @@ -509,17 +597,12 @@ elm_fileselector_button_expandable_get(const Evas_Object *obj) * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_folder_only_set(Evas_Object *obj, - Eina_Bool value) +elm_fileselector_button_folder_only_set(Evas_Object *obj, Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; wd->fsd.folder_only = value; - - if (wd->fs) - elm_fileselector_folder_only_set(wd->fs, wd->fsd.folder_only); } /** @@ -535,7 +618,6 @@ elm_fileselector_button_folder_only_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; return wd->fsd.folder_only; } @@ -550,17 +632,12 @@ elm_fileselector_button_folder_only_get(const Evas_Object *obj) * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_is_save_set(Evas_Object *obj, - Eina_Bool value) +elm_fileselector_button_is_save_set(Evas_Object *obj, Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; wd->fsd.is_save = value; - - if (wd->fs) - elm_fileselector_is_save_set(wd->fs, wd->fsd.is_save); } /** @@ -576,7 +653,6 @@ elm_fileselector_button_is_save_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; return wd->fsd.is_save; } @@ -592,12 +668,10 @@ elm_fileselector_button_is_save_get(const Evas_Object *obj) * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_inwin_mode_set(Evas_Object *obj, - Eina_Bool value) +elm_fileselector_button_inwin_mode_set(Evas_Object *obj, Eina_Bool value) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; wd->inwin_mode = value; } @@ -615,7 +689,6 @@ elm_fileselector_button_inwin_mode_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; return wd->inwin_mode; } @@ -624,33 +697,38 @@ elm_fileselector_button_inwin_mode_get(const Evas_Object *obj) * Set the icon used for the button * * Once the icon object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_fileselector_button_icon_unset() function. * * @param obj The button object - * @param icon The icon object for the button + * @param icon The image for the button * * @ingroup File_Selector_Button */ EAPI void -elm_fileselector_button_icon_set(Evas_Object *obj, - Evas_Object *icon) +elm_fileselector_button_icon_set(Evas_Object *obj, Evas_Object *icon) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) + if (!wd) return; + if (wd->icon == icon) return; + if (wd->icon) evas_object_del(wd->icon); + wd->icon = icon; + if (icon) { - evas_object_del(icon); - return; + elm_widget_sub_object_add(obj, icon); + evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->btn, "elm.swallow.content", icon); + edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm"); + edje_object_message_signal_process(wd->btn); } - elm_button_icon_set(wd->btn, icon); + _sizing_eval(obj); } /** * Get the icon used for the button * * @param obj The button object - * @return The icon object that is being used + * @return The image for the button * * @ingroup File_Selector_Button */ @@ -660,25 +738,5 @@ elm_fileselector_button_icon_get(const Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - return elm_button_icon_get(wd->btn); + return wd->icon; } - -/** - * Unset the icon used for the button - * - * Unparent and return the icon object which was set for this widget. - * - * @param obj The button object - * @return The icon object that was being used - * - * @ingroup File_Selector_Button - */ -EAPI Evas_Object * -elm_fileselector_button_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_button_icon_unset(wd->btn); -} - diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c deleted file mode 100644 index 7b0ad6d..0000000 --- a/src/lib/elc_fileselector_entry.c +++ /dev/null @@ -1,655 +0,0 @@ -#include -#include "elm_priv.h" - - /** - * @defgroup File_Selector_Entry File Selector Entry - * - * An entry that shows to enter/display path and have an associated - * button to allow selecting the file from a dialog. - * - * The button, when clicked, creates an Elementary window (or inner - * window) with an Elementary File Selector within. When a file is - * chosen, the (inner) window is closed and the selected file is - * exposed as an evas_object_smart_callback_call() of the button. - */ - -typedef struct _Widget_Data Widget_Data; - -struct _Widget_Data -{ - Evas_Object *edje; - Evas_Object *button; - Evas_Object *entry; -}; - -static const char *widtype = NULL; - -static const char SIG_CHANGED[] = "changed"; -static const char SIG_ACTIVATED[] = "activated"; -static const char SIG_PRESS[] = "press"; -static const char SIG_LONGPRESSED[] = "longpressed"; -static const char SIG_CLICKED[] = "clicked"; -static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; -static const char SIG_FOCUSED[] = "focused"; -static const char SIG_UNFOCUSED[] = "unfocused"; -static const char SIG_SELECTION_PASTE[] = "selection,paste"; -static const char SIG_SELECTION_COPY[] = "selection,copy"; -static const char SIG_SELECTION_CUT[] = "selection,cut"; -static const char SIG_UNPRESSED[] = "unpressed"; -static const char SIG_FILE_CHOSEN[] = "file,chosen"; -static const Evas_Smart_Cb_Description _signals[] = -{ - {SIG_CHANGED, ""}, - {SIG_ACTIVATED, ""}, - {SIG_PRESS, ""}, - {SIG_LONGPRESSED, ""}, - {SIG_CLICKED, ""}, - {SIG_CLICKED_DOUBLE, ""}, - {SIG_FOCUSED, ""}, - {SIG_UNFOCUSED, ""}, - {SIG_SELECTION_PASTE, ""}, - {SIG_SELECTION_COPY, ""}, - {SIG_SELECTION_CUT, ""}, - {SIG_UNPRESSED, ""}, - {SIG_FILE_CHOSEN, "s"}, - {NULL, NULL} -}; - -#define SIG_FWD(name) \ -static void \ -_##name##_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info) \ -{ \ - evas_object_smart_callback_call(data, SIG_##name, event_info); \ -} -SIG_FWD(CHANGED) -SIG_FWD(PRESS) -SIG_FWD(LONGPRESSED) -SIG_FWD(CLICKED) -SIG_FWD(CLICKED_DOUBLE) -SIG_FWD(FOCUSED) -SIG_FWD(UNFOCUSED) -SIG_FWD(SELECTION_PASTE) -SIG_FWD(SELECTION_COPY) -SIG_FWD(SELECTION_CUT) -SIG_FWD(UNPRESSED) -#undef SIG_FWD - -static void -_FILE_CHOSEN_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info) -{ - Widget_Data *wd = elm_widget_data_get(data); - const char *file = event_info; - elm_scrolled_entry_entry_set(wd->entry, file); - evas_object_smart_callback_call(data, SIG_FILE_CHOSEN, event_info); -} - -static void -_ACTIVATED_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info) -{ - Widget_Data *wd = elm_widget_data_get(data); - const char *file = elm_scrolled_entry_entry_get(wd->entry); - elm_fileselector_button_path_set(wd->button, file); - evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info); -} - -static void -_del_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - free(wd); -} - -static void -_sizing_eval(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Coord minw = -1, minh = -1; - if (!wd) return; - edje_object_size_min_calc(wd->edje, &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - -static Eina_Bool -_elm_fileselector_entry_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) - return EINA_FALSE; - - Evas_Object *chain[2]; - - /* Direction */ - if (dir == ELM_FOCUS_PREVIOUS) - { - chain[0] = wd->button; - chain[1] = wd->entry; - } - else if (dir == ELM_FOCUS_NEXT) - { - chain[0] = wd->entry; - chain[1] = wd->button; - } - else - return EINA_FALSE; - - unsigned char i = elm_widget_focus_get(chain[1]); - - if (elm_widget_focus_next_get(chain[i], dir, next)) - return EINA_TRUE; - - i = !i; - - Evas_Object *to_focus; - if (elm_widget_focus_next_get(chain[i], dir, &to_focus)) - { - *next = to_focus; - return !!i; - } - - return EINA_FALSE; -} - -static void -_theme_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - const char *style = elm_widget_style_get(obj); - char buf[1024]; - - if (!wd) return; - _elm_theme_object_set(obj, wd->edje, "fileselector_entry", "base", style); - if (elm_object_disabled_get(obj)) - edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm"); - - if (!style) style = "default"; - snprintf(buf, sizeof(buf), "fileselector_entry/%s", style); - elm_widget_style_set(wd->button, buf); - elm_widget_style_set(wd->entry, buf); - - edje_object_part_swallow(obj, "elm.swallow.button", wd->button); - edje_object_part_swallow(obj, "elm.swallow.entry", wd->entry); - - edje_object_message_signal_process(wd->edje); - edje_object_scale_set - (wd->edje, elm_widget_scale_get(obj) * _elm_config->scale); - _sizing_eval(obj); -} - -static void -_disable_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Eina_Bool val = elm_widget_disabled_get(obj); - if (!wd) return; - if (val) - edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm"); - else - edje_object_signal_emit(wd->edje, "elm,state,enabled", "elm"); - - elm_widget_disabled_set(wd->button, val); - elm_widget_disabled_set(wd->entry, val); -} - -static void -_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - _sizing_eval(data); -} - -/** - * Add a new file selector entry into the parent object. - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup File_Selector_Entry - */ -EAPI Evas_Object * -elm_fileselector_entry_add(Evas_Object *parent) -{ - Evas_Object *obj; - Evas *e = evas_object_evas_get(parent); - if (!e) return NULL; - Widget_Data *wd; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - - wd = ELM_NEW(Widget_Data); - - obj = elm_widget_add(e); - ELM_SET_WIDTYPE(widtype, "fileselector_entry"); - elm_widget_type_set(obj, "fileselector_entry"); - elm_widget_sub_object_add(parent, obj); - elm_widget_data_set(obj, wd); - elm_widget_del_hook_set(obj, _del_hook); - elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_focus_next_hook_set(obj, _elm_fileselector_entry_focus_next_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); - elm_widget_theme_hook_set(obj, _theme_hook); - - wd->edje = edje_object_add(e); - _elm_theme_object_set(obj, wd->edje, "fileselector_entry", "base", "default"); - elm_widget_resize_object_set(obj, wd->edje); - - wd->button = elm_fileselector_button_add(obj); - elm_widget_style_set(wd->button, "fileselector_entry/default"); - edje_object_part_swallow(wd->edje, "elm.swallow.button", wd->button); - elm_widget_sub_object_add(obj, wd->button); - evas_object_event_callback_add - (wd->button, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - elm_fileselector_button_expandable_set(wd->button, - _elm_config->fileselector_expand_enable); - -#define SIG_FWD(name) \ - evas_object_smart_callback_add(wd->button, SIG_##name, _##name##_fwd, obj) - SIG_FWD(CLICKED); - SIG_FWD(UNPRESSED); - SIG_FWD(FILE_CHOSEN); -#undef SIG_FWD - - wd->entry = elm_scrolled_entry_add(obj); - elm_widget_style_set(wd->entry, "fileselector_entry/default"); - elm_scrolled_entry_single_line_set(wd->entry, EINA_TRUE); - elm_scrolled_entry_editable_set(wd->entry, EINA_TRUE); - edje_object_part_swallow(wd->edje, "elm.swallow.entry", wd->entry); - elm_widget_sub_object_add(obj, wd->entry); - evas_object_event_callback_add - (wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - -#define SIG_FWD(name) \ - evas_object_smart_callback_add(wd->entry, SIG_##name, _##name##_fwd, obj) - SIG_FWD(CHANGED); - SIG_FWD(ACTIVATED); - SIG_FWD(PRESS); - SIG_FWD(LONGPRESSED); - SIG_FWD(CLICKED); - SIG_FWD(CLICKED_DOUBLE); - SIG_FWD(FOCUSED); - SIG_FWD(UNFOCUSED); - SIG_FWD(SELECTION_PASTE); - SIG_FWD(SELECTION_COPY); - SIG_FWD(SELECTION_CUT); -#undef SIG_FWD - - _sizing_eval(obj); - - // TODO: convert Elementary to subclassing of Evas_Smart_Class - // TODO: and save some bytes, making descriptions per-class and not instance! - evas_object_smart_callbacks_descriptions_set(obj, _signals); - return obj; -} - -/** - * Set the label used in the file selector entry. - * - * @param obj The entry object - * @param label The text label text to be displayed on the entry - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *label) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_label_set(wd->button, label); -} - -EAPI const char * -elm_fileselector_entry_button_label_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_fileselector_button_label_get(wd->button); -} - -/** - * Set the path to start the entry's file selector with, when clicked. - * - * @param obj The entry object - * @param path Path to a file/directory - * - * Default path is "HOME" environment variable's value. - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_selected_set(Evas_Object *obj, const char *path) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_path_set(wd->button, path); -} - -/** - * Get the last path which the entry's file selector was set to. - * - * @param obj The entry object - * @param path Path to a file/directory - * - * Default path is "HOME" environment variable's value. - * - * @ingroup File_Selector_Entry - */ -EAPI const char * -elm_fileselector_entry_selected_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_fileselector_button_path_get(wd->button); -} - -/** - * Set the title of the file selector entry's window. - * - * @param obj The entry object - * @param title The title string - * - * Note that it will only take any effect if the fileselector entry - * not at "inwin mode". - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_window_title_set(Evas_Object *obj, const char *title) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_window_title_set(wd->button, title); -} - -/** - * Get the title of the file selector entry's window. - * - * @param obj The entry object - * - * @ingroup File_Selector_Entry - */ -EAPI const char * -elm_fileselector_entry_window_title_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_fileselector_button_window_title_get(wd->button); -} - -/** - * Set the size of the file selector entry's window. - * - * @param obj The entry object - * @param width The width - * @param height The height - * - * Note that it will only take any effect if the fileselector entry not at - * "inwin mode". Default size for the window (when applicable) is 400x400. - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_window_size_set(wd->button, width, height); -} - -/** - * Get the size of the file selector entry's window. - * - * @param obj The entry object - * @param width Pointer into which to store the width value - * @param height Pointer into which to store the height value - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_window_size_get(wd->button, width, height); -} - -/** - * Set the starting path of the file selector entry's window. - * - * @param obj The entry object - * @param path The path string - * - * It must be a directory path. - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_path_set(Evas_Object *obj, const char *path) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_path_set(wd->button, path); - elm_scrolled_entry_entry_set(wd->entry, path); -} - -/** - * Get the last path of the file selector entry's window. - * - * @param obj The entry object - * - * @ingroup File_Selector_Entry - */ -EAPI const char * -elm_fileselector_entry_path_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_scrolled_entry_entry_get(wd->entry); -} - -/** - * Set whether the entry's file selector is to present itself as an - * Elementary Generic List (which will expand its entries for nested - * directories) or as canonical list, which will be rendered again - * with the contents of each selected directory. - * - * @param obj The entry object - * @param value The expandable flag - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_expandable_set(Evas_Object *obj, Eina_Bool value) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_expandable_set(wd->button, value); -} - -/** - * Get the entry's file selector expandable flag. - * - * @param obj The entry object - * @return value The expandable flag - * - * @ingroup File_Selector_Entry - */ -EAPI Eina_Bool -elm_fileselector_entry_expandable_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return elm_fileselector_button_expandable_get(wd->button); -} - -/** - * Set whether the entry's file selector list is to display folders - * only or the directory contents, as well. - * - * @param obj The entry object - * @param value The "folder only" flag - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_folder_only_set(Evas_Object *obj, Eina_Bool value) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_folder_only_set(wd->button, value); -} - -/** - * Get the entry's file selector "folder only" flag. - * - * @param obj The entry object - * @return value The "folder only" flag - * - * @ingroup File_Selector_Entry - */ -EAPI Eina_Bool -elm_fileselector_entry_folder_only_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return elm_fileselector_button_folder_only_get(wd->button); -} - -/** - * Set whether the entry's file selector has an editable text entry - * which will hold its current selection. - * - * @param obj The entry object - * @param value The "is save" flag - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_is_save_set(Evas_Object *obj, Eina_Bool value) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_is_save_set(wd->button, value); -} - -/** - * Get the entry's file selector "is save" flag. - * - * @param obj The entry object - * @return value The "is save" flag - * - * @ingroup File_Selector_Entry - */ -EAPI Eina_Bool -elm_fileselector_entry_is_save_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return elm_fileselector_button_is_save_get(wd->button); -} - -/** - * Set whether the entry's file selector will raise an Elementary - * Inner Window, instead of a dedicated Elementary Window. By default, - * it won't. - * - * @param obj The entry object - * @param value The "inwin mode" flag - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_inwin_mode_set(Evas_Object *obj, Eina_Bool value) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_inwin_mode_set(wd->button, value); -} - -/** - * Get the entry's file selector "inwin mode" flag. - * - * @param obj The entry object - * @return value The "inwin mode" flag - * - * @ingroup File_Selector_Entry - */ -EAPI Eina_Bool -elm_fileselector_entry_inwin_mode_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return elm_fileselector_button_inwin_mode_get(wd->button); -} - -/** - * Set the icon used for the entry button - * - * Once the icon object is set, a previously set one will be deleted. - * - * @param obj The entry object - * @param icon The image for the entry - * - * @ingroup File_Selector_Entry - */ -EAPI void -elm_fileselector_entry_button_icon_set(Evas_Object *obj, Evas_Object *icon) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_fileselector_button_icon_set(wd->button, icon); -} - -/** - * Get the icon used for the entry button - * - * @param obj The entry object - * @return The image for the entry - * - * @ingroup File_Selector_Entry - */ -EAPI Evas_Object * -elm_fileselector_entry_button_icon_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_fileselector_button_icon_get(wd->button); -} - -/** - * Unset the icon used for the entry button - * - * Unparent and return the icon object which was set for this widget. - * - * @param obj The entry object - * @return The icon object that was being used - * - * @ingroup File_Selector_Entry - */ -EAPI Evas_Object * -elm_fileselector_entry_button_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_fileselector_button_icon_unset(wd->button); -} diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index 2e355b5..c54ca57 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -28,24 +28,23 @@ struct _Widget_Data Evas_Object *hover_parent; Eina_List *items; Eina_Bool horizontal : 1; - Eina_Bool expanded : 1; }; struct _Elm_Hoversel_Item { - Elm_Widget_Item base; + Evas_Object *obj; const char *label; const char *icon_file; const char *icon_group; Elm_Icon_Type icon_type; Evas_Smart_Cb func; + Evas_Smart_Cb del_cb; + void *data; }; static const char *widtype = NULL; static void _del_pre_hook(Evas_Object *obj); static void _del_hook(Evas_Object *obj); -static void _activate(Evas_Object *obj); -static void _activate_hook(Evas_Object *obj); static void _disable_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -54,18 +53,18 @@ static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _del_pre_hook(Evas_Object *obj) { - Elm_Hoversel_Item *item; + Elm_Hoversel_Item *it; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_hoversel_hover_end(obj); elm_hoversel_hover_parent_set(obj, NULL); - EINA_LIST_FREE(wd->items, item) + EINA_LIST_FREE(wd->items, it) { - elm_widget_item_pre_notify_del(item); - eina_stringshare_del(item->label); - eina_stringshare_del(item->icon_file); - eina_stringshare_del(item->icon_group); - elm_widget_item_del(item); + if (it->del_cb) it->del_cb((void *)it->data, it->obj, it); + eina_stringshare_del(it->label); + eina_stringshare_del(it->icon_file); + eina_stringshare_del(it->icon_group); + free(it); } } @@ -85,11 +84,10 @@ _theme_hook(Evas_Object *obj) if (!wd) return; elm_hoversel_hover_end(obj); if (wd->horizontal) - snprintf(buf, sizeof(buf), "hoversel_horizontal/%s", elm_widget_style_get(obj)); + snprintf(buf, sizeof(buf), "hoversel_horizontal/%s", elm_widget_style_get(obj)); else - snprintf(buf, sizeof(buf), "hoversel_vertical/%s", elm_widget_style_get(obj)); + snprintf(buf, sizeof(buf), "hoversel_vertical/%s", elm_widget_style_get(obj)); elm_object_style_set(wd->btn, buf); - elm_object_disabled_set(wd->btn, elm_widget_disabled_get(obj)); } static void @@ -97,7 +95,10 @@ _disable_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - elm_object_disabled_set(wd->btn, elm_widget_disabled_get(obj)); + if (elm_widget_disabled_get(obj)) + elm_widget_disabled_set(wd->btn, 1); + else + elm_widget_disabled_set(wd->btn, 0); } static void @@ -113,15 +114,6 @@ _sizing_eval(Evas_Object *obj) } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - elm_widget_focus_steal(wd->btn); -} - -static void _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { _sizing_eval(data); @@ -136,12 +128,12 @@ _hover_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSE static void _item_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_Hoversel_Item *item = data; - Evas_Object *obj2 = item->base.widget; + Elm_Hoversel_Item *it = data; + Evas_Object *obj2 = it->obj; elm_hoversel_hover_end(obj2); - if (item->func) item->func((void *)item->base.data, obj2, item); - evas_object_smart_callback_call(obj2, "selected", item); + if (it->func) it->func(it->data, obj2, it); + evas_object_smart_callback_call(obj2, "selected", it); } static void @@ -150,17 +142,10 @@ _activate(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *bt, *bx, *ic; const Eina_List *l; - const Elm_Hoversel_Item *item; + const Elm_Hoversel_Item *it; char buf[4096]; if (!wd) return; - if (wd->expanded) - { - elm_hoversel_hover_end(obj); - return; - } - wd->expanded = EINA_TRUE; - if (elm_widget_disabled_get(obj)) return; wd->hover = elm_hover_add(obj); if (wd->horizontal) @@ -183,26 +168,26 @@ _activate(Evas_Object *obj) else snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s", elm_widget_style_get(obj)); - EINA_LIST_FOREACH(wd->items, l, item) + EINA_LIST_FOREACH(wd->items, l, it) { bt = elm_button_add(wd->hover); elm_object_style_set(bt, buf); - elm_button_label_set(bt, item->label); - if (item->icon_file) + elm_button_label_set(bt, it->label); + if (it->icon_file) { ic = elm_icon_add(obj); elm_icon_scale_set(ic, 0, 1); - if (item->icon_type == ELM_ICON_FILE) - elm_icon_file_set(ic, item->icon_file, item->icon_group); - else if (item->icon_type == ELM_ICON_STANDARD) - elm_icon_standard_set(ic, item->icon_file); + if (it->icon_type == ELM_ICON_FILE) + elm_icon_file_set(ic, it->icon_file, it->icon_group); + else if (it->icon_type == ELM_ICON_STANDARD) + elm_icon_standard_set(ic, it->icon_file); elm_button_icon_set(bt, ic); evas_object_show(ic); } evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(bx, bt); - evas_object_smart_callback_add(bt, "clicked", _item_clicked, item); + evas_object_smart_callback_add(bt, "clicked", _item_clicked, it); evas_object_show(bt); } @@ -225,12 +210,6 @@ _activate(Evas_Object *obj) } static void -_activate_hook(Evas_Object *obj) -{ - _activate(obj); -} - -static void _button_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { _activate(data); @@ -258,12 +237,10 @@ elm_hoversel_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + char buf[4096]; wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "hoversel"); elm_widget_type_set(obj, "hoversel"); @@ -273,20 +250,19 @@ elm_hoversel_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_activate_hook_set(obj, _activate_hook); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); - elm_widget_can_focus_set(obj, EINA_TRUE); wd->btn = elm_button_add(parent); - wd->expanded = EINA_FALSE; + if (wd->horizontal) + snprintf(buf, sizeof(buf), "hoversel_horizontal/%s", elm_widget_style_get(obj)); + else + snprintf(buf, sizeof(buf), "hoversel_vertical/%s", elm_widget_style_get(obj)); + elm_object_style_set(wd->btn, buf); elm_widget_resize_object_set(obj, wd->btn); evas_object_event_callback_add(wd->btn, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); evas_object_smart_callback_add(wd->btn, "clicked", _button_clicked, obj); - elm_widget_sub_object_add(obj, wd->btn); - elm_hoversel_hover_parent_set(obj, parent); - _theme_hook(obj); + _sizing_eval(obj); return obj; } @@ -317,26 +293,6 @@ elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent) } /** - * Get the Hover parent - * - * Gets the hover parent object. Should probably be the window that the hoversel - * is in. See Hover objects for more information. - * - * @param obj The hoversel object - * @return The used parent - * - * @ingroup Hoversel - */ -EAPI Evas_Object * -elm_hoversel_hover_parent_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->hover_parent; -} - -/** * Set the hoversel button label * * This sets the label of the button that is always visible (before it is @@ -414,9 +370,6 @@ elm_hoversel_horizontal_get(const Evas_Object *obj) * * Sets the icon of the button that is always visible (before it is clicked * and expanded). Also see elm_button_icon_set(). - * Once the icon object is set, a previously set one will be deleted - * If you want to keep that old content object, use the - * elm_hoversel_icon_unset() function. * * @param obj The hoversel object * @param icon The icon object @@ -453,26 +406,6 @@ elm_hoversel_icon_get(const Evas_Object *obj) } /** - * Get the icon of the hoversel button - * - * Unparent and return the icon of the button that is always visible - * (before it is clicked and expanded). Also see elm_button_icon_unset(). - * - * @param obj The hoversel object - * @return The icon object that was being used - * - * @ingroup Hoversel - */ -EAPI Evas_Object * -elm_hoversel_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->btn)) return NULL; - return elm_button_icon_unset(wd->btn); -} - -/** * This triggers the hoversel popup from code, the same as though the * user clicked the button. * @@ -504,7 +437,6 @@ elm_hoversel_hover_end(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (!wd->hover) return; - wd->expanded = EINA_FALSE; evas_object_del(wd->hover); wd->hover = NULL; evas_object_smart_callback_call(obj, "dismissed", NULL); @@ -520,7 +452,7 @@ elm_hoversel_hover_end(Evas_Object *obj) * @ingroup Hoversel */ EAPI Eina_Bool -elm_hoversel_expanded_get(const Evas_Object *obj) +elm_hoversel_expanded_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); @@ -540,12 +472,12 @@ elm_hoversel_expanded_get(const Evas_Object *obj) EAPI void elm_hoversel_clear(Evas_Object *obj) { - Elm_Hoversel_Item *item; + Elm_Hoversel_Item *it; Eina_List *l, *ll; ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_LIST_FOREACH_SAFE(wd->items, l, ll, item) elm_hoversel_item_del(item); + EINA_LIST_FOREACH_SAFE(wd->items, l, ll, it) elm_hoversel_item_del(it); } /** @@ -589,15 +521,16 @@ elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - Elm_Hoversel_Item *item = elm_widget_item_new(obj, Elm_Hoversel_Item); - if (!item) return NULL; - wd->items = eina_list_append(wd->items, item); - item->label = eina_stringshare_add(label); - item->icon_file = eina_stringshare_add(icon_file); - item->icon_type = icon_type; - item->func = func; - item->base.data = data; - return item; + Elm_Hoversel_Item *it = calloc(1, sizeof(Elm_Hoversel_Item)); + if (!it) return NULL; + wd->items = eina_list_append(wd->items, it); + it->obj = obj; + it->label = eina_stringshare_add(label); + it->icon_file = eina_stringshare_add(icon_file); + it->icon_type = icon_type; + it->func = func; + it->data = (void *)data; + return it; } /** @@ -607,23 +540,23 @@ elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file * hoversel is active; use elm_hoversel_expanded_get() * to check first). * - * @param item The item to delete + * @param it The item to delete * * @ingroup Hoversel */ EAPI void -elm_hoversel_item_del(Elm_Hoversel_Item *item) +elm_hoversel_item_del(Elm_Hoversel_Item *it) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - Widget_Data *wd = elm_widget_data_get(item->base.widget); + if (!it) return; + Widget_Data *wd = elm_widget_data_get(it->obj); + if (it->del_cb) it->del_cb((void *)it->data, it->obj, it); if (!wd) return; - elm_hoversel_hover_end(item->base.widget); - wd->items = eina_list_remove(wd->items, item); - elm_widget_item_pre_notify_del(item); - eina_stringshare_del(item->label); - eina_stringshare_del(item->icon_file); - eina_stringshare_del(item->icon_group); - elm_widget_item_del(item); + elm_hoversel_hover_end(it->obj); + wd->items = eina_list_remove(wd->items, it); + eina_stringshare_del(it->label); + eina_stringshare_del(it->icon_file); + eina_stringshare_del(it->icon_group); + free(it); } /** @@ -634,54 +567,54 @@ elm_hoversel_item_del(Elm_Hoversel_Item *item) * Evas_Object *the_item_object * Elm_Hoversel_Item *the_object_struct * - * @param item The item to set the callback on + * @param it The item to set the callback on * @param func The function called * * @ingroup Hoversel */ EAPI void -elm_hoversel_item_del_cb_set(Elm_Hoversel_Item *item, Evas_Smart_Cb func) +elm_hoversel_item_del_cb_set(Elm_Hoversel_Item *it, Evas_Smart_Cb func) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_del_cb_set(item, func); + if (!it) return; + it->del_cb = func; } /** * This returns the data pointer supplied with elm_hoversel_item_add() that * will be passed to associated function callbacks. * - * @param item The item to get the data from + * @param it The item to get the data from * @return The data pointer set with elm_hoversel_item_add() * * @ingroup Hoversel */ EAPI void * -elm_hoversel_item_data_get(const Elm_Hoversel_Item *item) +elm_hoversel_item_data_get(Elm_Hoversel_Item *it) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_data_get(item); + if (!it) return NULL; + return it->data; } /** * This returns the label text of the given hoversel item. * - * @param item The item to get the label + * @param it The item to get the label * @return The label text of the hoversel item * * @ingroup Hoversel */ EAPI const char * -elm_hoversel_item_label_get(const Elm_Hoversel_Item *item) +elm_hoversel_item_label_get(Elm_Hoversel_Item *it) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->label; + if (!it) return NULL; + return it->label; } /** * This sets the icon for the given hoversel item. The icon can be loaded from * the standard set, from an image file, or from an edje file. * - * @param item The item to set the icon + * @param it The item to set the icon * @param icon_file An image file path on disk to use for the icon or standard * icon name * @param icon_group The edje group to use if @p icon_file is an edje file. Set this @@ -691,18 +624,18 @@ elm_hoversel_item_label_get(const Elm_Hoversel_Item *item) * @ingroup Hoversel */ EAPI void -elm_hoversel_item_icon_set(Elm_Hoversel_Item *item, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type) +elm_hoversel_item_icon_set(Elm_Hoversel_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - eina_stringshare_replace(&item->icon_file, icon_file); - eina_stringshare_replace(&item->icon_group, icon_group); - item->icon_type = icon_type; + if (!it) return; + eina_stringshare_replace(&it->icon_file, icon_file); + eina_stringshare_replace(&it->icon_group, icon_group); + it->icon_type = icon_type; } /** * Get the icon object of the hoversel item * - * @param item The item to get the icon from + * @param it The item to get the icon from * @param icon_file The image file path on disk used for the icon or standard * icon name * @param icon_group The edje group used if @p icon_file is an edje file. NULL @@ -712,11 +645,11 @@ elm_hoversel_item_icon_set(Elm_Hoversel_Item *item, const char *icon_file, const * @ingroup Hoversel */ EAPI void -elm_hoversel_item_icon_get(const Elm_Hoversel_Item *item, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type) +elm_hoversel_item_icon_get(Elm_Hoversel_Item *it, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - if (icon_file) *icon_file = item->icon_file; - if (icon_group) *icon_group = item->icon_group; - if (icon_type) *icon_type = item->icon_type; + if (!it) return; + if (icon_file) *icon_file = it->icon_file; + if (icon_group) *icon_group = it->icon_group; + if (icon_type) *icon_type = it->icon_type; } diff --git a/src/lib/elc_scrolled_entry.c b/src/lib/elc_scrolled_entry.c index 8826e13..de2a4f5 100644 --- a/src/lib/elc_scrolled_entry.c +++ b/src/lib/elc_scrolled_entry.c @@ -1,8 +1,12 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include #include "elm_priv.h" /** * @defgroup Scrolled_Entry Scrolled_Entry + * @ingroup Elementary * * A scrolled entry is a convenience widget which shows * a box that the user can enter text into. Unlike an @@ -31,42 +35,15 @@ */ typedef struct _Widget_Data Widget_Data; -typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item; -typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider; -typedef struct _Elm_Entry_Text_Filter Elm_Entry_Text_Filter; struct _Widget_Data { Evas_Object *scroller; Evas_Object *entry; - Evas_Object *icon; - Evas_Object *end; Elm_Scroller_Policy policy_h, policy_v; - Eina_List *items; - Eina_List *item_providers; - Eina_List *text_filters; Eina_Bool single_line : 1; }; -struct _Elm_Entry_Context_Menu_Item -{ - Evas_Object *obj; - Evas_Smart_Cb func; - void *data; -}; - -struct _Elm_Entry_Item_Provider -{ - Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item); - void *data; -}; - -struct _Elm_Entry_Text_Filter -{ - void (*func) (void *data, Evas_Object *entry, char **text); - void *data; -}; - static const char *widtype = NULL; static const char SIG_CHANGED[] = "changed"; @@ -108,37 +85,34 @@ static const Evas_Smart_Cb_Description _signals[] = { static void _del_hook(Evas_Object *obj) { - Elm_Entry_Context_Menu_Item *ci; - Elm_Entry_Item_Provider *ip; - Elm_Entry_Text_Filter *tf; - Widget_Data *wd = elm_widget_data_get(obj); - - EINA_LIST_FREE(wd->items, ci) - free(ci); - EINA_LIST_FREE(wd->item_providers, ip) - free(ip); - EINA_LIST_FREE(wd->text_filters, tf) - free(tf); - if (!wd) return; free(wd); } static void +_theme_hook(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + elm_object_style_set(wd->entry, elm_widget_style_get(obj)); + elm_object_style_set(wd->scroller, elm_widget_style_get(obj)); +} + +static void _sizing_eval(Evas_Object *obj) { - Widget_Data *wd; + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw, minh, minw_scr, minh_scr; - wd = elm_widget_data_get(obj); if (!wd) return; - + evas_object_size_hint_min_get(obj, &minw, &minh); evas_object_size_hint_min_get(wd->scroller, &minw_scr, &minh_scr); if (minw < minw_scr) minw = minw_scr; if (minh < minh_scr) minh = minh_scr; evas_object_size_hint_min_set(obj, minw, minh); + if (wd->single_line) evas_object_size_hint_max_set(obj, -1, minh); else @@ -146,18 +120,6 @@ _sizing_eval(Evas_Object *obj) } static void -_theme_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_object_style_set(wd->entry, elm_widget_style_get(obj)); - elm_object_style_set(wd->scroller, elm_widget_style_get(obj)); - elm_object_disabled_set(wd->entry, elm_widget_disabled_get(obj)); - elm_object_disabled_set(wd->scroller, elm_widget_disabled_get(obj)); - _sizing_eval(obj); -} - -static void _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -184,169 +146,108 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) } static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_object_signal_callback_add(wd->entry, emission, source, func_cb, data); - elm_object_signal_callback_add(wd->scroller, emission, source, func_cb, - data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data __UNUSED__) -{ - Widget_Data *wd = elm_widget_data_get(obj); - elm_object_signal_callback_del(wd->entry, emission, source, func_cb); - elm_object_signal_callback_del(wd->scroller, emission, source, func_cb); -} - -static void -_on_focus_region_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) -{ - Widget_Data *wd = elm_widget_data_get(obj); - elm_widget_focus_region_get(wd->entry, x, y, w, h); -} - -static void -_changed_size_hints(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) -{ - _sizing_eval(obj); -} - -static void -_entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { _sizing_eval(data); - evas_object_smart_callback_call(data, SIG_CHANGED, event_info); + evas_object_smart_callback_call(data, SIG_CHANGED, NULL); } static void -_entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info); + evas_object_smart_callback_call(data, SIG_ACTIVATED, NULL); } static void -_entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_PRESS, event_info); + evas_object_smart_callback_call(data, SIG_PRESS, NULL); } static void -_entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_CLICKED, event_info); + evas_object_smart_callback_call(data, SIG_CLICKED, NULL); } static void -_entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, event_info); + evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL); } static void -_entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, event_info); + evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, NULL); } static void -_entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, event_info); + evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, NULL); } static void -_entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_SELECTION_START, event_info); + evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL); } static void -_entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, event_info); + evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL); } static void -_entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, event_info); + evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, NULL); } static void -_entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, event_info); + evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL); } static void -_entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_SELECTION_COPY, event_info); + evas_object_smart_callback_call(data, SIG_SELECTION_COPY, NULL); } static void -_entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_SELECTION_CUT, event_info); + evas_object_smart_callback_call(data, SIG_SELECTION_CUT, NULL); } static void -_entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_LONGPRESSED, event_info); + evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL); } static void -_entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_FOCUSED, event_info); + evas_object_smart_callback_call(data, SIG_FOCUSED, NULL); } static void -_entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, SIG_UNFOCUSED, event_info); + evas_object_smart_callback_call(data, SIG_UNFOCUSED, NULL); } static void -_context_item_wrap_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_entry_maxlength_reached(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_Entry_Context_Menu_Item *ci = data; - ci->func(ci->data, ci->obj, event_info); + evas_object_smart_callback_call(data, "maxlength,reached", NULL); } -static Evas_Object * -_item_provider_wrap_cb(void *data, Evas_Object *obj __UNUSED__, const char *item) -{ - Widget_Data *wd = elm_widget_data_get(data); - Eina_List *l; - Elm_Entry_Item_Provider *ip; - - EINA_LIST_FOREACH(wd->item_providers, l, ip) - { - Evas_Object *o; - o = ip->func(ip->data, data, item); - if (o) return o; - } - return NULL; -} - -static void -_text_filter_wrap_cb(void *data, Evas_Object *obj __UNUSED__, char **text) -{ - Widget_Data *wd = elm_widget_data_get(data); - Eina_List *l; - Elm_Entry_Text_Filter *tf; - - EINA_LIST_FOREACH(wd->text_filters, l, tf) - { - tf->func(tf->data, data, text); - if (!*text) break; - } -} /** * This adds a scrolled entry to @p parent object. @@ -363,11 +264,8 @@ elm_scrolled_entry_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "scrolled_entry"); elm_widget_type_set(obj, "scrolled_entry"); @@ -376,31 +274,22 @@ elm_scrolled_entry_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); + elm_widget_can_focus_set(obj, 1); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_on_focus_region_hook_set(obj, _on_focus_region_hook); elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - wd->scroller = elm_scroller_add(obj); - //elm_scroller_custom_widget_base_theme_set(wd->scroller, "scroller", "entry"); + wd->scroller = elm_scroller_add(parent); + elm_widget_sub_object_add(obj, wd->scroller); elm_widget_resize_object_set(obj, wd->scroller); - evas_object_size_hint_weight_set(wd->scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(wd->scroller, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_scroller_bounce_set(wd->scroller, EINA_FALSE, EINA_FALSE); - elm_scroller_propagate_events_set(wd->scroller, EINA_TRUE); - evas_object_show(wd->scroller); - - wd->entry = elm_entry_add(obj); + elm_scroller_bounce_set(wd->scroller, 0, 0); + elm_scroller_propagate_events_set(wd->scroller, 1); + + wd->entry = elm_entry_add(parent); evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_scroller_content_set(wd->scroller, wd->entry); evas_object_show(wd->entry); - elm_entry_text_filter_prepend(wd->entry, _text_filter_wrap_cb, obj); - elm_entry_item_provider_prepend(wd->entry, _item_provider_wrap_cb, obj); - evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj); evas_object_smart_callback_add(wd->entry, "activated", _entry_activated, obj); evas_object_smart_callback_add(wd->entry, "press", _entry_press, obj); @@ -417,9 +306,7 @@ elm_scrolled_entry_add(Evas_Object *parent) evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj); evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj); evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj); - - evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, NULL); + evas_object_smart_callback_add(wd->entry, "maxlength,reached", _entry_maxlength_reached, obj); _sizing_eval(obj); @@ -430,216 +317,6 @@ elm_scrolled_entry_add(Evas_Object *parent) } /** - * This sets a widget to be displayed to the left of a scrolled entry. - * - * @param obj The scrolled entry object - * @param icon The widget to display on the left side of the scrolled - * entry. - * - * @note A previously set widget will be destroyed. - * @note If the object being set does not have minimum size hints set, - * it won't get properly displayed. - * - * @ingroup Scrolled_Entry - * @see elm_scrolled_entry_end_set - */ -EAPI void -elm_scrolled_entry_icon_set(Evas_Object *obj, Evas_Object *icon) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *edje; - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(icon); - if (wd->icon == icon) return; - if (wd->icon) evas_object_del(wd->icon); - wd->icon = icon; - edje = _elm_scroller_edje_object_get(wd->scroller); - if (!edje) return; - edje_object_part_swallow(edje, "elm.swallow.icon", wd->icon); - edje_object_signal_emit(edje, "elm,action,show,icon", "elm"); - _sizing_eval(obj); -} - -/** - * Gets the leftmost widget of the scrolled entry. This object is - * owned by the scrolled entry and should not be modified. - * - * @param obj The scrolled entry object - * @return the left widget inside the scroller - * - * @ingroup Scrolled_Entry - */ -EAPI Evas_Object * -elm_scrolled_entry_icon_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->icon; -} - -/** - * Unset the leftmost widget of the scrolled entry, unparenting and - * returning it. - * - * @param obj The scrolled entry object - * @return the previously set icon sub-object of this entry, on - * success. - * - * @see elm_scrolled_entry_icon_set() - * - * @ingroup Scrolled_Entry - */ -EAPI Evas_Object * -elm_scrolled_entry_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *ret = NULL; - if (!wd) return NULL; - if (wd->icon) - { - Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller); - if (!edje) return NULL; - ret = wd->icon; - edje_object_part_unswallow(edje, wd->icon); - edje_object_signal_emit(edje, "elm,action,hide,icon", "elm"); - wd->icon = NULL; - _sizing_eval(obj); - } - return ret; -} - -/** - * Sets the visibility of the left-side widget of the scrolled entry, - * set by @elm_scrolled_entry_icon_set(). - * - * @param obj The scrolled entry object - * @param setting EINA_TRUE if the object should be displayed, - * EINA_FALSE if not. - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->icon)) return; - if (setting) - evas_object_hide(wd->icon); - else - evas_object_show(wd->icon); - _sizing_eval(obj); -} - -/** - * This sets a widget to be displayed to the end of a scrolled entry. - * - * @param obj The scrolled entry object - * @param end The widget to display on the right side of the scrolled - * entry. - * - * @note A previously set widget will be destroyed. - * @note If the object being set does not have minimum size hints set, - * it won't get properly displayed. - * - * @ingroup Scrolled_Entry - * @see elm_scrolled_entry_icon_set - */ -EAPI void -elm_scrolled_entry_end_set(Evas_Object *obj, Evas_Object *end) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *edje; - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(end); - if (wd->end == end) return; - if (wd->end) evas_object_del(wd->end); - wd->end = end; - edje = _elm_scroller_edje_object_get(wd->scroller); - if (!edje) return; - edje_object_part_swallow(edje, "elm.swallow.end", wd->end); - edje_object_signal_emit(edje, "elm,action,show,end", "elm"); - _sizing_eval(obj); -} - -/** - * Gets the endmost widget of the scrolled entry. This object is owned - * by the scrolled entry and should not be modified. - * - * @param obj The scrolled entry object - * @return the right widget inside the scroller - * - * @ingroup Scrolled_Entry - */ -EAPI Evas_Object * -elm_scrolled_entry_end_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->end; -} - -/** - * Unset the endmost widget of the scrolled entry, unparenting and - * returning it. - * - * @param obj The scrolled entry object - * @return the previously set icon sub-object of this entry, on - * success. - * - * @see elm_scrolled_entry_icon_set() - * - * @ingroup Scrolled_Entry - */ -EAPI Evas_Object * -elm_scrolled_entry_end_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *ret = NULL; - if (!wd) return NULL; - if (wd->end) - { - Evas_Object *edje = _elm_scroller_edje_object_get(wd->scroller); - if (!edje) return NULL; - ret = wd->end; - edje_object_part_unswallow(edje, wd->end); - edje_object_signal_emit(edje, "elm,action,hide,end", "elm"); - wd->end = NULL; - _sizing_eval(obj); - } - return ret; -} - -/** - * Sets the visibility of the end widget of the scrolled entry, set by - * @elm_scrolled_entry_end_set(). - * - * @param obj The scrolled entry object - * @param setting EINA_TRUE if the object should be displayed, - * EINA_FALSE if not. - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->end)) return; - if (setting) - evas_object_hide(wd->end); - else - evas_object_show(wd->end); - _sizing_eval(obj); -} - -/** * This sets the scrolled entry object not to line wrap. All input will * be on a single line, and the entry box will scroll with user input. * @@ -690,7 +367,6 @@ elm_scrolled_entry_single_line_get(const Evas_Object *obj) return elm_entry_single_line_get(wd->entry); } - /** * This sets the scrolled entry object to password mode. All text entered * and/or displayed within the widget will be replaced with asterisks (*). @@ -728,7 +404,6 @@ elm_scrolled_entry_password_get(const Evas_Object *obj) return elm_entry_password_get(wd->entry); } - /** * This sets the text displayed within the scrolled entry to @p entry. * @@ -879,7 +554,6 @@ elm_scrolled_entry_editable_get(const Evas_Object *obj) return elm_entry_editable_get(wd->entry); } - /** * This drops any existing text selection within the scrolled entry. * @@ -1211,18 +885,10 @@ elm_scrolled_entry_context_menu_clear(Evas_Object *obj) EAPI void elm_scrolled_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data) { - Elm_Entry_Context_Menu_Item *ci; ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - - ci = malloc(sizeof(Elm_Entry_Context_Menu_Item)); - if (!ci) return; - ci->func = func; - ci->data = (void *)data; - ci->obj = obj; - wd->items = eina_list_append(wd->items, ci); - elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, _context_item_wrap_cb, ci); + elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data); } /** @@ -1296,7 +962,6 @@ elm_scrolled_entry_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_ if (!wd) return; elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce); } - /** * This set's the maximum bytes that can be added in to scrolled entry. * @@ -1315,298 +980,22 @@ elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes) } /** - * Get the bounce mode - * - * @param obj The Scrolled_Entry object - * @param h_bounce Allow bounce horizontally - * @param v_bounce Allow bounce vertically - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_scroller_bounce_get(wd->scroller, h_bounce, v_bounce); -} - -/** - * This appends a custom item provider to the list for that entry - * - * This appends the given callback. The list is walked from beginning to end - * with each function called given the item href string in the text. If the - * function returns an object handle other than NULL (it should create an - * and object to do this), then this object is used to replace that item. If - * not the next provider is called until one provides an item object, or the - * default provider in entry does. - * - * @param obj The entry object - * @param func The function called to provide the item object - * @param data The data passed to @p func - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); - Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider)); - if (!ip) return; - ip->func = func; - ip->data = data; - wd->item_providers = eina_list_append(wd->item_providers, ip); -} - -/** - * This prepends a custom item provider to the list for that entry - * - * This prepends the given callback. See elm_scrolled_entry_item_provider_append() for - * more information - * - * @param obj The entry object - * @param func The function called to provide the item object - * @param data The data passed to @p func - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); - Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider)); - if (!ip) return; - ip->func = func; - ip->data = data; - wd->item_providers = eina_list_prepend(wd->item_providers, ip); -} - -/** - * This removes a custom item provider to the list for that entry - * - * This removes the given callback. See elm_scrolled_entry_item_provider_append() for - * more information - * - * @param obj The entry object - * @param func The function called to provide the item object - * @param data The data passed to @p func - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Eina_List *l; - Elm_Entry_Item_Provider *ip; - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); - EINA_LIST_FOREACH(wd->item_providers, l, ip) - { - if ((ip->func == func) && (ip->data == data)) - { - wd->item_providers = eina_list_remove_list(wd->item_providers, l); - free(ip); - return; - } - } -} - -/** - * Append a filter function for text inserted in the entry - * - * Append the given callback to the list. This functions will be called - * whenever any text is inserted into the entry, with the text to be inserted - * as a parameter. The callback function is free to alter the text in any way - * it wants, but it must remember to free the given pointer and update it. - * If the new text is to be discarded, the function can free it and set it text - * parameter to NULL. This will also prevent any following filters from being - * called. - * - * @param obj The entry object - * @param func The function to use as text filter - * @param data User data to pass to @p func - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_text_filter_append(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) -{ - Widget_Data *wd; - Elm_Entry_Text_Filter *tf; - ELM_CHECK_WIDTYPE(obj, widtype); - - wd = elm_widget_data_get(obj); - - EINA_SAFETY_ON_NULL_RETURN(func); - - tf = ELM_NEW(Elm_Entry_Text_Filter); - if (!tf) return; - tf->func = func; - tf->data = data; - wd->text_filters = eina_list_append(wd->text_filters, tf); -} - -/** - * Prepend a filter function for text insdrted in the entry - * - * Prepend the given callback to the list. See elm_scrolled_entry_text_filter_append() - * for more information - * - * @param obj The entry object - * @param func The function to use as text filter - * @param data User data to pass to @p func - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_text_filter_prepend(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) -{ - Widget_Data *wd; - Elm_Entry_Text_Filter *tf; - ELM_CHECK_WIDTYPE(obj, widtype); - - wd = elm_widget_data_get(obj); - - EINA_SAFETY_ON_NULL_RETURN(func); - - tf = ELM_NEW(Elm_Entry_Text_Filter); - if (!tf) return; - tf->func = func; - tf->data = data; - wd->text_filters = eina_list_prepend(wd->text_filters, tf); -} - -/** - * Remove a filter from the list - * - * Removes the given callback from the filter list. See elm_scrolled_entry_text_filter_append() - * for more information. - * - * @param obj The entry object - * @param func The filter function to remove - * @param data The user data passed when adding the function - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_text_filter_remove(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) -{ - Widget_Data *wd; - Eina_List *l; - Elm_Entry_Text_Filter *tf; - ELM_CHECK_WIDTYPE(obj, widtype); - - wd = elm_widget_data_get(obj); - - EINA_SAFETY_ON_NULL_RETURN(func); - - EINA_LIST_FOREACH(wd->text_filters, l, tf) - { - if ((tf->func == func) && (tf->data == data)) - { - wd->text_filters = eina_list_remove_list(wd->text_filters, l); - free(tf); - return; - } - } -} - -/** - * This sets the file (and implicitly loads it) for the text to display and - * then edit. All changes are written back to the file after a short delay if - * the entry object is set to autosave. - * - * @param obj The scrolled entry object - * @param file The path to the file to load and save - * @param format The file format - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_entry_file_set(wd->entry, file, format); -} - -/** - * Gets the file to load and save and the file format - * - * @param obj The scrolled entry object - * @param file The path to the file to load and save - * @param format The file format - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_entry_file_get(wd->entry, file, format); -} - -/** - * This function writes any changes made to the file set with - * elm_scrolled_entry_file_set() - * - * @param obj The scrolled entry object - * - * @ingroup Scrolled_Entry - */ -EAPI void -elm_scrolled_entry_file_save(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_entry_file_save(wd->entry); -} - -/** - * This sets the entry object to 'autosave' the loaded text file or not. + * This set's the scrolled entry in password mode with out masking the last character entered by user, + * and later masking the character after 2 seconds. * * @param obj The scrolled entry object - * @param autosave Autosave the loaded file or not + * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character" + * 0 for default) * * @ingroup Scrolled_Entry */ EAPI void -elm_scrolled_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave) +elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - elm_entry_autosave_set(wd->entry, autosave); -} - -/** - * This gets the entry object's 'autosave' status. - * - * @param obj The scrolled entry object - * @return Autosave the loaded file or not - * - * @ingroup Scrolled_Entry - */ -EAPI Eina_Bool -elm_scrolled_entry_autosave_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return elm_entry_autosave_get(wd->entry); + elm_entry_password_show_last_character_set(wd->entry, show_last_character); } /** @@ -1697,3 +1086,4 @@ elm_scrolled_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod) elm_entry_autoperiod_set(wd->entry, autoperiod); } + diff --git a/src/lib/elm_actionslider.c b/src/lib/elm_actionslider.c index d9eb5a1..6edf402 100644 --- a/src/lib/elm_actionslider.c +++ b/src/lib/elm_actionslider.c @@ -37,7 +37,7 @@ struct _Widget_Data Evas_Object *icon_fake; // an icon for a button or a bar // setting - Elm_Actionslider_Magnet_Pos magnet_position, enabled_position; + Elm_Actionslider_Magnet_Pos magnet_position; const char *text_left, *text_right, *text_center, *text_button; // status @@ -69,22 +69,12 @@ static Eina_Bool _icon_animation(void *data); static const char *widtype = NULL; -#define SIG_CHANGED "position" -#define SIG_SELECTED "selected" - -static const Evas_Smart_Cb_Description _signals[] = -{ - {SIG_CHANGED, ""}, - {SIG_SELECTED, ""}, - {NULL, NULL} -}; - static void _del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (wd->icon) { evas_object_del(wd->icon); @@ -109,29 +99,10 @@ _del_hook(Evas_Object *obj) } static void -_sizing_eval(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Coord minw = -1, minh = -1; - - if (!wd) return; - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(wd->icon, minw, minh); - evas_object_size_hint_max_set(wd->icon, -1, -1); - - minw = -1; - minh = -1; - elm_coords_finger_size_adjust(3, &minw, 1, &minh); - edje_object_size_min_restricted_calc(wd->as, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (edje_object_part_swallow_get(wd->as, "elm.swallow.icon") == NULL) edje_object_part_unswallow(wd->as, wd->icon); if (edje_object_part_swallow_get(wd->as, "elm.swallow.space") == NULL) @@ -164,6 +135,12 @@ _disable_hook(Evas_Object *obj) } static void +_sizing_eval(Evas_Object *obj) +{ +// Widget_Data *wd = elm_widget_data_get(obj); +} + +static void _sub_del(void *data, Evas_Object *obj, void *event_info) { // Widget_Data *wd = elm_widget_data_get(obj); @@ -191,11 +168,11 @@ _icon_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) edje_object_part_drag_value_get(wd->as, "elm.swallow.icon", &pos, NULL); if (pos == 0.0) - evas_object_smart_callback_call(as, SIG_CHANGED, "left"); + evas_object_smart_callback_call(as, "position", "left"); else if (pos == 1.0) - evas_object_smart_callback_call(as, SIG_CHANGED, "right"); + evas_object_smart_callback_call(as, "position", "right"); else if (pos >= 0.495 && pos <= 0.505) - evas_object_smart_callback_call(as, SIG_CHANGED, "center"); + evas_object_smart_callback_call(as, "position", "center"); /* * TODO @@ -277,23 +254,8 @@ _icon_animation(void *data) } edje_object_part_drag_value_set(wd->as, "elm.swallow.icon", new_position, 0.5); - if (flag_finish_animation) - { - if ((!wd->final_position) && - (wd->enabled_position & ELM_ACTIONSLIDER_MAGNET_LEFT)) - evas_object_smart_callback_call(data, SIG_SELECTED, - (void *)wd->text_left); - else if ((wd->final_position == 0.5) && - (wd->enabled_position & ELM_ACTIONSLIDER_MAGNET_CENTER)) - evas_object_smart_callback_call(data, SIG_SELECTED, - (void *)wd->text_center); - else if ((wd->final_position == 1) && - (wd->enabled_position & ELM_ACTIONSLIDER_MAGNET_RIGHT)) - evas_object_smart_callback_call(data, SIG_SELECTED, - (void *)wd->text_right); - return EINA_FALSE; - } - return EINA_TRUE; + if (flag_finish_animation == EINA_TRUE) return 0; + else return 1; } @@ -327,7 +289,6 @@ elm_actionslider_add(Evas_Object *parent) wd->mouse_down = EINA_FALSE; wd->mouse_hold = EINA_FALSE; - wd->enabled_position = ELM_ACTIONSLIDER_MAGNET_ALL; // load background edj wd->as = edje_object_add(e); @@ -412,30 +373,6 @@ elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Indicator_ } /** - * Get actionslider indicator position. - * - * @param obj The actionslider object. - * @return The position of the indicator. - * - * @ingroup Actionslider - */ -EAPI Elm_Actionslider_Indicator_Pos -elm_actionslider_indicator_pos_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) ELM_ACTIONSLIDER_INDICATOR_NONE; - Widget_Data *wd = elm_widget_data_get(obj); - double position; - if (!wd) return ELM_ACTIONSLIDER_INDICATOR_NONE; - - edje_object_part_drag_value_get(wd->as, "elm.swallow.icon", &position, NULL); - if (position < 0.3) - return ELM_ACTIONSLIDER_INDICATOR_LEFT; - else if (position < 0.7) - return ELM_ACTIONSLIDER_INDICATOR_CENTER; - else - return ELM_ACTIONSLIDER_INDICATOR_RIGHT; -} -/** * Set actionslider magnet position. * * @param[in] obj The actionslider object. @@ -454,63 +391,6 @@ elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Magnet_Pos po } /** - * Get actionslider magnet position. - * - * @param obj The actionslider object. - * @return The positions with magnet property. - * - * @ingroup Actionslider - */ -EAPI Elm_Actionslider_Magnet_Pos -elm_actionslider_magnet_pos_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) ELM_ACTIONSLIDER_MAGNET_NONE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_ACTIONSLIDER_MAGNET_NONE; - return wd->magnet_position; -} - -/** - * Set actionslider enabled position. - * - * All the positions are enabled by default. - * - * @param obj The actionslider object. - * @param pos Bit mask indicating the enabled positions. - * Example: use (ELM_ACTIONSLIDER_MAGNET_LEFT | ELM_ACTIONSLIDER_MAGNET_RIGHT) - * to enable both positions, so the user can select it. - * - * @ingroup Actionslider - */ -EAPI void -elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Magnet_Pos pos) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - wd->enabled_position = pos; -} - -/** - * Get actionslider enabled position. - * - * All the positions are enabled by default. - * - * @param obj The actionslider object. - * @return The enabled positions. - * - * @ingroup Actionslider - */ -EAPI Elm_Actionslider_Magnet_Pos -elm_actionslider_enabled_pos_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) ELM_ACTIONSLIDER_MAGNET_NONE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_ACTIONSLIDER_MAGNET_NONE; - return wd->enabled_position; -} - -/** * Set actionslider label. * * @param[in] obj The actionslider object @@ -579,66 +459,6 @@ elm_actionslider_label_set(Evas_Object *obj, Elm_Actionslider_Label_Pos pos, con } /** - * Get actionslider labels. - * - * @param obj The actionslider object - * @param left_label A char** to place the left_label of @p obj into - * @param center_label A char** to place the center_label of @p obj into - * @param right_label A char** to place the right_label of @p obj into - * - * @ingroup Actionslider - */ -EAPI void -elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label) -{ - if (left_label) *left_label= NULL; - if (center_label) *center_label= NULL; - if (right_label) *right_label= NULL; - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (left_label) *left_label = wd->text_left; - if (center_label) *center_label = wd->text_center; - if (right_label) *right_label = wd->text_right; -} - -/** - * Set the label used on the indicator object. - * - * @param obj The actionslider object - * @param label The label which is going to be set. - * - * @ingroup Actionslider - */ -EAPI void -elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - eina_stringshare_replace(&wd->text_button, label); - edje_object_part_text_set(wd->as, "elm.text.button", wd->text_button); -} - -/** - * Get the label used on the indicator object. - * - * @param obj The actionslider object - * @return The indicator label - * - * @ingroup Actionslider - */ -EAPI const char * -elm_actionslider_indicator_label_get(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->text_button; -} - -/** * Hold actionslider object movement. * * @param[in] obj The actionslider object diff --git a/src/lib/elm_autocompleteview.c b/src/lib/elm_autocompleteview.c index fd6673b..01c3ccb 100644 --- a/src/lib/elm_autocompleteview.c +++ b/src/lib/elm_autocompleteview.c @@ -196,7 +196,7 @@ elm_autocompleteview_add(Evas_Object *parent) wd->list = elm_list_add(wd->layout); evas_object_size_hint_weight_set(wd->list, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(wd->list, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_list_mode_set(wd->list, ELM_LIST_COMPRESS); + elm_list_horizontal_mode_set(wd->list, ELM_LIST_COMPRESS); elm_object_style_set(wd->list,"autocompleteview"); elm_list_go(wd->list); evas_object_smart_callback_add(wd->list, "selected", _list_click, obj); diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c index 5312615..a08a0f4 100644 --- a/src/lib/elm_bg.c +++ b/src/lib/elm_bg.c @@ -1,3 +1,5 @@ +#include + #include #include "elm_priv.h" @@ -13,13 +15,11 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { - Evas_Object *base, *rect, *img, *overlay; + Evas_Object *img, *custom_img; const char *file, *group; - Elm_Bg_Option option; }; static const char *widtype = NULL; - static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _custom_resize(void *data, Evas *a, Evas_Object *obj, void *event_info); @@ -35,87 +35,29 @@ static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - Evas_Coord w, h; - - _elm_theme_object_set(obj, wd->base, "bg", "base", - elm_widget_style_get(obj)); - - if (wd->rect) - edje_object_part_swallow(wd->base, "elm.swallow.rectangle", wd->rect); - if (wd->img) - edje_object_part_swallow(wd->base, "elm.swallow.background", wd->img); - if (wd->overlay) - edje_object_part_swallow(wd->base, "elm.swallow.content", wd->overlay); - -// FIXME: if i don't do this, bg doesnt calc correctly. why? - evas_object_geometry_get(wd->base, NULL, NULL, &w, &h); - evas_object_resize(wd->base, w, h); + _elm_theme_object_set(obj, wd->img, "bg", "base", elm_widget_style_get(obj)); } static void -_custom_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_custom_resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { - Widget_Data *wd = data; - Evas_Coord bx = 0, by = 0, bw = 0, bh = 0; - Evas_Coord iw = 0, ih = 0, mw = -1, mh = -1; - Evas_Coord fx = 0, fy = 0, fw = 0, fh = 0; - Evas_Coord nx = 0, ny = 0, nw = 0, nh = 0; - const char *p; + int iw = 0, ih = 0; + Evas_Coord x, y, w, h, ow = 0, oh = 0; - if ((!wd->img) || (!wd->file)) return; - if (((p = strrchr(wd->file, '.'))) && (!strcasecmp(p, ".edj"))) return; + evas_object_geometry_get(obj, NULL, NULL, &ow, &oh); + evas_object_image_size_get(obj, &iw, &ih); - /* grab image size */ - evas_object_image_size_get(wd->img, &iw, &ih); if ((iw < 1) || (ih < 1)) return; - - /* grab base object dimensions */ - evas_object_geometry_get(wd->base, &bx, &by, &bw, &bh); - - /* set some defaults */ - nx = bx; - ny = by; - nw = bw; - nh = bh; - - switch (wd->option) + w = ow; + h = (ih * w) / iw; + if (h < oh) { - case ELM_BG_OPTION_CENTER: - fw = nw = iw; - fh = nh = ih; - nx = ((bw - fw) / 2); - ny = ((bh - fh) / 2); - mw = iw; - mh = ih; - break; - case ELM_BG_OPTION_SCALE: - fw = bw; - fh = ((ih * fw) / iw); - if (fh < bh) - { - fh = bh; - fw = ((iw * fh) / ih); - } - fx = ((bw - fw) / 2); - fy = ((bh - fh) / 2); - break; - case ELM_BG_OPTION_TILE: - fw = iw; - fh = ih; - break; - case ELM_BG_OPTION_STRETCH: - default: - fw = bw; - fh = bh; - break; + h = oh; + w = (iw * h) / ih; } - - evas_object_move(wd->img, nx, ny); - evas_object_resize(wd->img, nw, nh); - evas_object_image_fill_set(wd->img, fx, fy, fw, fh); - - evas_object_size_hint_min_set(wd->img, mw, mh); - evas_object_size_hint_max_set(wd->img, mw, mh); + x = (ow - w) / 2; + y = (oh - h) / 2; + evas_object_image_fill_set(obj, x, y, w, h); } /** @@ -133,11 +75,8 @@ elm_bg_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "bg"); elm_widget_type_set(obj, "bg"); @@ -145,16 +84,11 @@ elm_bg_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); + elm_widget_can_focus_set(obj, 0); - wd->base = edje_object_add(e); - _elm_theme_object_set(obj, wd->base, "bg", "base", "default"); - elm_widget_resize_object_set(obj, wd->base); - - evas_object_event_callback_add(wd->base, EVAS_CALLBACK_RESIZE, - _custom_resize, wd); - - wd->option = ELM_BG_OPTION_SCALE; + wd->img = edje_object_add(e); + _elm_theme_object_set(obj, wd->img, "bg", "base", "default"); + elm_widget_resize_object_set(obj, wd->img); return obj; } @@ -167,10 +101,7 @@ elm_bg_add(Evas_Object *parent) * * This sets the image file used in the background object. The image (or edje) * will be stretched (retaining aspect if its an image file) to completely fill - * the bg object. This may mean some parts are not visible. - * - * @note Once the image of @p obj is set, a previously set one will be deleted, - * even if @p file is NULL. + * the bg object. This may mean some parts arte not visible. * * @ingroup Bg */ @@ -181,219 +112,28 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group) Widget_Data *wd = elm_widget_data_get(obj); const char *p; - if (wd->img) - { - evas_object_del(wd->img); - wd->img = NULL; - } - if (!file) + if (wd->custom_img) { - eina_stringshare_del(wd->file); - wd->file = NULL; - eina_stringshare_del(wd->group); - wd->group = NULL; - return; + evas_object_del(wd->custom_img); + wd->custom_img = NULL; } + if (!file) return; eina_stringshare_replace(&wd->file, file); eina_stringshare_replace(&wd->group, group); if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj"))) { - wd->img = edje_object_add(evas_object_evas_get(wd->base)); - edje_object_file_set(wd->img, file, group); + wd->custom_img = edje_object_add(evas_object_evas_get(wd->img)); + edje_object_file_set(wd->custom_img, file, group); } else { - wd->img = evas_object_image_add(evas_object_evas_get(wd->base)); - evas_object_image_file_set(wd->img, file, group); + wd->custom_img = evas_object_image_add(evas_object_evas_get(wd->img)); + evas_object_event_callback_add(wd->custom_img, EVAS_CALLBACK_RESIZE, + _custom_resize, wd); + evas_object_image_file_set(wd->custom_img, file, group); } - evas_object_repeat_events_set(wd->img, EINA_TRUE); - edje_object_part_swallow(wd->base, "elm.swallow.background", wd->img); - elm_widget_sub_object_add(obj, wd->img); - _custom_resize(wd, NULL, NULL, NULL); -} - -/** - * Get the file (image or edje) used for the background - * - * @param obj The bg object - * @param file The file path - * @param group Optional key (group in Edje) within the file - * - * @ingroup Bg - */ -EAPI void -elm_bg_file_get(const Evas_Object *obj, const char **file, const char **group) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (file) *file = wd->file; - if (group) *group = wd->group; -} - -/** - * Set the option used for the background image - * - * @param obj The bg object - * @param option The desired background option (TILE, SCALE) - * - * This sets the option used for manipulating the display of the background - * image. The image can be tiled or scaled. - * - * @ingroup Bg - */ -EAPI void -elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - wd->option = option; - _custom_resize(wd, NULL, NULL, NULL); -} - -/** - * Get the option used for the background image - * - * @param obj The bg object - * @return The desired background option (TILE, SCALE) - * - * @ingroup Bg - */ -EAPI Elm_Bg_Option -elm_bg_option_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0; - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - return wd->option; -} - -/** - * Set the option used for the background color - * - * @param obj The bg object - * @param r - * @param g - * @param b - * - * This sets the color used for the background rectangle. - * - * @ingroup Bg - */ -EAPI void -elm_bg_color_set(Evas_Object *obj, int r, int g, int b) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd->rect) - { - wd->rect = evas_object_rectangle_add(evas_object_evas_get(wd->base)); - edje_object_part_swallow(wd->base, "elm.swallow.rectangle", wd->rect); - elm_widget_sub_object_add(obj, wd->rect); - _custom_resize(wd, NULL, NULL, NULL); - } - evas_object_color_set(wd->rect, r, g, b, 255); -} - -/** - * Get the option used for the background color - * - * @param obj The bg object - * @param r - * @param g - * @param b - * - * @ingroup Bg - */ -EAPI void -elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - evas_object_color_get(wd->rect, r, g, b, NULL); -} - -/** - * Set the overlay object used for the background object. - * - * @param obj The bg object - * @param overlay The overlay object - * - * This provides a way for elm_bg to have an 'overlay' (such as animated fog) - * Once the over object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_bg_overlay_unset() function. - * - * @ingroup Bg - */ -EAPI void -elm_bg_overlay_set(Evas_Object *obj, Evas_Object *overlay) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->overlay) - { - evas_object_del(wd->overlay); - wd->overlay = NULL; - } - if (overlay) - { - wd->overlay = overlay; - edje_object_part_swallow(wd->base, "elm.swallow.content", wd->overlay); - elm_widget_sub_object_add(obj, wd->overlay); - } - - _custom_resize(wd, NULL, NULL, NULL); -} - -/** - * Set the overlay object used for the background object. - * - * @param obj The bg object - * @return The content that is being used - * - * Return the content object which is set for this widget - * - * @ingroup Bg - */ -EAPI Evas_Object * -elm_bg_overlay_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->overlay; -} - -/** - * Get the overlay object used for the background object. - * - * @param obj The bg object - * @return The content that was being used - * - * Unparent and return the overlay object which was set for this widget - * - * @ingroup Bg - */ -EAPI Evas_Object * -elm_bg_overlay_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *overlay; - if (!wd) return NULL; - if (!wd->overlay) return NULL; - overlay = wd->overlay; - elm_widget_sub_object_del(obj, wd->overlay); - edje_object_part_unswallow(wd->base, wd->overlay); - wd->overlay = NULL; - _custom_resize(wd, NULL, NULL, NULL); - return overlay; + elm_widget_sub_object_add(obj, wd->custom_img); + evas_object_repeat_events_set(wd->custom_img, 1); + edje_object_part_swallow(wd->img, "elm.swallow.background", wd->custom_img); + evas_object_show(wd->custom_img); } diff --git a/src/lib/elm_box.c b/src/lib/elm_box.c index 8dc59f8..2529774 100644 --- a/src/lib/elm_box.c +++ b/src/lib/elm_box.c @@ -1,9 +1,6 @@ #include #include "elm_priv.h" -#define SIG_CHILD_ADDED "child,added" -#define SIG_CHILD_REMOVED "child,removed" - /** * @defgroup Box Box * @ingroup Elementary @@ -23,7 +20,6 @@ * NOTE: Objects should not be added to box objects using _add() calls. */ typedef struct _Widget_Data Widget_Data; -typedef struct _Transition_Animation_Data Transition_Animation_Data; struct _Widget_Data { @@ -33,37 +29,6 @@ struct _Widget_Data Eina_Bool extended:1; }; -struct _Elm_Box_Transition -{ - double initial_time; - double duration; - Eina_Bool animation_ended:1; - Eina_Bool recalculate:1; - Ecore_Animator *animator; - - struct - { - Evas_Object_Box_Layout layout; - void *data; - void(*free_data)(void *data); - } start, end; - - void(*transition_end_cb)(void *data); - void *transition_end_data; - void (*transition_end_free_data)(void *data); - Eina_List *objs; - Evas_Object *box; -}; - -struct _Transition_Animation_Data -{ - Evas_Object *obj; - struct - { - Evas_Coord x, y, w, h; - } start, end; -}; - static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); @@ -88,39 +53,6 @@ _del_hook(Evas_Object *obj) free(wd); } -static void * -_elm_box_list_data_get(const Eina_List *list) -{ - Evas_Object_Box_Option *opt = eina_list_data_get(list); - return opt->obj; -} - -static Eina_Bool -_elm_box_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - const Eina_List *items; - void *(*list_data_get) (const Eina_List *list); - - if ((!wd) || (!wd->box)) - return EINA_FALSE; - - /* Focus chain */ - /* TODO: Change this to use other chain */ - if ((items = elm_widget_focus_custom_chain_get(obj))) - list_data_get = eina_list_data_get; - else - { - Evas_Object_Box_Data *bd = evas_object_smart_data_get(wd->box); - items = bd->children; - list_data_get = _elm_box_list_data_get; - - if (!items) return EINA_FALSE; - } - - return elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next); -} - static void _sizing_eval(Evas_Object *obj) { @@ -160,172 +92,6 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) _els_box_layout_ex(o, priv, wd->horizontal, wd->homogeneous, wd->extended); } -static Eina_Bool -_transition_animation(void *data) -{ - evas_object_smart_changed(data); - return ECORE_CALLBACK_RENEW; -} - -static void -_transition_layout_child_added(void *data, Evas_Object *obj __UNUSED__, void *event_info) -{ - Transition_Animation_Data *tad; - Evas_Object_Box_Option *opt = event_info; - Elm_Box_Transition *layout_data = data; - - tad = calloc(1, sizeof(Transition_Animation_Data)); - if (!tad) return; - tad->obj = opt->obj; - layout_data->objs = eina_list_append(layout_data->objs, tad); - layout_data->recalculate = EINA_TRUE; -} - -static void -_transition_layout_child_removed(void *data, Evas_Object *obj __UNUSED__, void *event_info) -{ - Eina_List *l; - Transition_Animation_Data *tad; - Elm_Box_Transition *layout_data = data; - - EINA_LIST_FOREACH(layout_data->objs, l, tad) - { - if (tad->obj == event_info) - { - free(eina_list_data_get(l)); - layout_data->objs = eina_list_remove_list(layout_data->objs, l); - layout_data->recalculate = EINA_TRUE; - break; - } - } -} - -static void -_transition_layout_obj_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Elm_Box_Transition *layout_data = data; - layout_data->recalculate = EINA_TRUE; -} - -static void -_transition_layout_calculate_coords(Evas_Object *obj, Evas_Object_Box_Data *priv, - Elm_Box_Transition *layout_data) -{ - Eina_List *l; - Transition_Animation_Data *tad; - Evas_Coord x, y, w, h; - const double curtime = ecore_loop_time_get(); - - layout_data->duration = - layout_data->duration - (curtime - layout_data->initial_time); - layout_data->initial_time = curtime; - - evas_object_geometry_get(obj, &x, &y, &w, &h); - EINA_LIST_FOREACH(layout_data->objs, l, tad) - { - evas_object_geometry_get(tad->obj, &tad->start.x, &tad->start.y, - &tad->start.w, &tad->start.h); - tad->start.x = tad->start.x - x; - tad->start.y = tad->start.y - y; - } - layout_data->end.layout(obj, priv, layout_data->end.data); - EINA_LIST_FOREACH(layout_data->objs, l, tad) - { - evas_object_geometry_get(tad->obj, &tad->end.x, &tad->end.y, - &tad->end.w, &tad->end.h); - tad->end.x = tad->end.x - x; - tad->end.y = tad->end.y - y; - } -} - -static Eina_Bool -_transition_layout_load_children_list(Evas_Object_Box_Data *priv, - Elm_Box_Transition *layout_data) -{ - Eina_List *l; - Evas_Object_Box_Option *opt; - Transition_Animation_Data *tad; - - EINA_LIST_FREE(layout_data->objs, tad) - free(tad); - - EINA_LIST_FOREACH(priv->children, l, opt) - { - tad = calloc(1, sizeof(Transition_Animation_Data)); - if (!tad) - { - EINA_LIST_FREE(layout_data->objs, tad) - free(tad); - layout_data->objs = NULL; - return EINA_FALSE; - } - tad->obj = opt->obj; - layout_data->objs = eina_list_append(layout_data->objs, tad); - } - return EINA_TRUE; -} - -static Eina_Bool -_transition_layout_animation_start(Evas_Object *obj, Evas_Object_Box_Data *priv, - Elm_Box_Transition *layout_data, Eina_Bool(*transition_animation_cb)(void *data)) -{ - layout_data->start.layout(obj, priv, layout_data->start.data); - layout_data->box = obj; - layout_data->initial_time = ecore_loop_time_get(); - - if (!_transition_layout_load_children_list(priv, layout_data)) - return EINA_FALSE; - _transition_layout_calculate_coords(obj, priv, layout_data); - - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, - _transition_layout_obj_resize_cb, layout_data); - evas_object_smart_callback_add(obj, SIG_CHILD_ADDED, - _transition_layout_child_added, layout_data); - evas_object_smart_callback_add(obj, SIG_CHILD_REMOVED, - _transition_layout_child_removed, layout_data); - if (!layout_data->animator) - layout_data->animator = ecore_animator_add(transition_animation_cb, obj); - layout_data->animation_ended = EINA_FALSE; - return EINA_TRUE; -} - -static void -_transition_layout_animation_stop(Elm_Box_Transition *layout_data) -{ - layout_data->animation_ended = EINA_TRUE; - if (layout_data->animator) - { - ecore_animator_del(layout_data->animator); - layout_data->animator = NULL; - } - - if (layout_data->transition_end_cb) - layout_data->transition_end_cb(layout_data->transition_end_data); -} - -static void -_transition_layout_animation_exec(Evas_Object *obj, Evas_Object_Box_Data *priv __UNUSED__, - Elm_Box_Transition *layout_data, const double curtime) -{ - Eina_List *l; - Transition_Animation_Data *tad; - Evas_Coord x, y, w, h; - Evas_Coord cur_x, cur_y, cur_w, cur_h; - double progress = 0.0; - - progress = (curtime - layout_data->initial_time) / layout_data->duration; - evas_object_geometry_get(obj, &x, &y, &w, &h); - - EINA_LIST_FOREACH(layout_data->objs, l, tad) - { - cur_x = x + tad->start.x + ((tad->end.x - tad->start.x) * progress); - cur_y = y + tad->start.y + ((tad->end.y - tad->start.y) * progress); - cur_w = tad->start.w + ((tad->end.w - tad->start.w) * progress); - cur_h = tad->start.h + ((tad->end.h - tad->start.h) * progress); - evas_object_move(tad->obj, cur_x, cur_y); - evas_object_resize(tad->obj, cur_w, cur_h); - } -} /** * Add a new box to the parent @@ -342,11 +108,8 @@ elm_box_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "box"); elm_widget_type_set(obj, "box"); @@ -354,9 +117,6 @@ elm_box_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_del_pre_hook_set(obj, _del_pre_hook); - elm_widget_focus_next_hook_set(obj, _elm_box_focus_next_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); - elm_widget_highlight_ignore_set(obj, EINA_TRUE); wd->box = evas_object_box_add(e); /*evas_object_box_layout_set(wd->box, evas_object_box_layout_vertical, @@ -376,7 +136,7 @@ elm_box_add(Evas_Object *parent) * Set the horizontal orientation * * By default box object arrange their contents vertically from top to bottom. - * By calling this and providing @p horizontal as true, the box will become + * By calling this and providing @p orizontal as true, the box will become * horizontal arranging contents left to right. * * @param obj The box object @@ -413,23 +173,6 @@ elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) } /** - * Get the horizontal orientation - * - * @param obj The box object - * @return If is horizontal - * - * @ingroup Box - */ -EAPI Eina_Bool -elm_box_horizontal_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->horizontal; -} - -/** * Set homogenous layout * * If enabled, homogenous layout makes all items the same size. This size is @@ -469,23 +212,6 @@ elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) } /** - * Get homogenous layout - * - * @param obj The box object - * @return If is homogenous - * - * @ingroup Box - */ -EAPI Eina_Bool -elm_box_homogenous_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->homogeneous; -} - -/** * This adds a box at the start of the box (top or left based on orientation) * * This will add the @p subobj to the box object indicated at the beginning @@ -590,7 +316,7 @@ elm_box_clear(Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - evas_object_box_remove_all(wd->box, EINA_TRUE); + evas_object_box_remove_all(wd->box, 1); } /** @@ -628,310 +354,21 @@ elm_box_unpack_all(Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - evas_object_box_remove_all(wd->box, EINA_FALSE); -} - -/** - * Set the callback layout function (@p cb) to the @p obj elm_box class. - * - * This function will use evas_object_box_layout_set() to set @p cb as the - * layout callback function for this box object. - * All layout funtions from evas_object_box can be used as @p cb. Some examples - * are evas_object_box_layout_horizontal, evas_object_box_layout_vertical and - * evas_object_box_layout_stack. elm_box_layout_transition can also be used. - * If @p cb is NULL, the default layout function from elm_box will be used. - * - * @note Changing the layout function will make horizontal/homogeneous fields - * from Widget_Data have NO further usage as they are controlled by default - * layout function. So calling elm_box_horizontal_set() or - * elm_box_homogenous_set() won't affect layout behavior. - * - * @param obj The box object - * @param cb The callback function used for layout - * @param data Data that will be passed to layout function - * @param free_data Function called to free @p data - * - * @ingroup Box - */ -EAPI void -elm_box_layout_set(Evas_Object *obj, Evas_Object_Box_Layout cb, const void *data, void (*free_data)(void *data)) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - if (cb) - evas_object_box_layout_set(wd->box, cb, data, free_data); - else - evas_object_box_layout_set(wd->box, _layout, wd, NULL); -} - -/** - * Layout function which display a transition animation from start layout to end layout. - * - * This function should no be called directly. It may be used by elm_box_layout_set() or - * evas_object_box_layout_set() as a layout function. - * The @p data passed to this function must be a Elm_Box_Transition*, that can be created - * using elm_box_transition_new() and freed with elm_box_transition_free(). - * - * Usage Example: - * @code - * Evas_Object *box = elm_box_add(parent); - * Elm_Box_Transition *t = elm_box_transition_new(...add params here...); - * elm_box_layout_set(box, elm_box_layout_transition, t, elm_box_transition_free); - * @endcode - * - * @see elm_box_transition_new - * @see elm_box_transition_free - * @see elm_box_layout_set - * - * @ingroup Box - * @warning Do not call this function directly because the @p obj is not the Widget Box - * from elm_box_add(), it is the internal Evas_Object of the Widget Box. - */ -EAPI void -elm_box_layout_transition(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data) -{ - Elm_Box_Transition *box_data = data; - const double curtime = ecore_loop_time_get(); - - if (box_data->animation_ended) - { - box_data->end.layout(obj, priv, box_data->end.data); - return; - } - - if (!box_data->animator) - { - if (!_transition_layout_animation_start(obj, priv, box_data, - _transition_animation)) - return; - } - else - { - if (box_data->recalculate) - { - _transition_layout_calculate_coords(obj, priv, box_data); - box_data->recalculate = EINA_FALSE; - } - } - - if ((curtime >= box_data->duration + box_data->initial_time)) - _transition_layout_animation_stop(box_data); - else - _transition_layout_animation_exec(obj, priv, box_data, curtime); -} - -/** - * Create a new Elm_Box_Transition setted with informed parameters. - * - * The returned instance may be used as data parameter to elm_box_layout_transition() - * and should be freed with elm_box_transition_free(). - * - * @param start_layout The layout function that will be used to start the animation - * @param start_layout_data The data to be passed the @p start_layout function - * @param start_layout_free_data Function to free @p start_layout_data - * @param end_layout The layout function that will be used to end the animation - * @param end_layout_free_data The data to be passed the @p end_layout function - * @param end_layout_free_data Function to free @p end_layout_data - * @param transition_end_cb Callback function called when animation ends - * @param transition_end_data Data to be passed to @p transition_end_cb - * @return An instance of Elm_Box_Transition setted with informed parameters - * - * @see elm_box_transition_new - * @see elm_box_layout_transition - * - * @ingroup Box - */ -EAPI Elm_Box_Transition * -elm_box_transition_new(const double duration, - Evas_Object_Box_Layout start_layout, void *start_layout_data, - void(*start_layout_free_data)(void *data), - Evas_Object_Box_Layout end_layout, void *end_layout_data, - void(*end_layout_free_data)(void *data), - void(*transition_end_cb)(void *data), - void *transition_end_data) -{ - Elm_Box_Transition *box_data; - - EINA_SAFETY_ON_NULL_RETURN_VAL(start_layout, NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(end_layout, NULL); - - box_data = calloc(1, sizeof(Elm_Box_Transition)); - if (!box_data) - return NULL; - - box_data->start.layout = start_layout; - box_data->start.data = start_layout_data; - box_data->start.free_data = start_layout_free_data; - box_data->end.layout = end_layout; - box_data->end.data = end_layout_data; - box_data->end.free_data = end_layout_free_data; - box_data->duration = duration; - box_data->transition_end_cb = transition_end_cb; - box_data->transition_end_data = transition_end_data; - return box_data; -} - -/** - * Free a Elm_Box_Transition instance created with elm_box_transition_new(). - * - * @param data The Elm_Box_Transition instance to be freed. - * - * @see elm_box_transition_new - * @see elm_box_layout_transition - * - * @ingroup Box - */ -EAPI void -elm_box_transition_free(void *data) -{ - EINA_SAFETY_ON_NULL_RETURN(data); - - Transition_Animation_Data *tad; - Elm_Box_Transition *box_data = data; - if ((box_data->start.free_data) && (box_data->start.data)) - box_data->start.free_data(box_data->start.data); - if ((box_data->end.free_data) && (box_data->end.data)) - box_data->end.free_data(box_data->end.data); - EINA_LIST_FREE(box_data->objs, tad) - free(tad); - evas_object_event_callback_del(box_data->box, EVAS_CALLBACK_RESIZE, _transition_layout_obj_resize_cb); - evas_object_smart_callback_del(box_data->box, SIG_CHILD_ADDED, _transition_layout_child_added); - evas_object_smart_callback_del(box_data->box, SIG_CHILD_REMOVED, _transition_layout_child_removed); - if (box_data->animator) - { - ecore_animator_del(box_data->animator); - box_data->animator = NULL; - } - free(data); -} - -/** - * Retrieve the list of children packed into an elm_box - * - * @param obj The Elm_Box - * - * @ingroup Box - */ -EAPI const Eina_List * -elm_box_children_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return evas_object_box_children_get(wd->box); -} - -/** - * Set the space (padding) between the box's elements. - * - * @param obj The Elm_Box - * @param horizontal The horizontal space between elements - * @param vertical The vertical space between elements - * - * @ingroup Box - */ -EAPI void -elm_box_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - evas_object_box_padding_set(wd->box, horizontal, vertical); + evas_object_box_remove_all(wd->box, 0); } -/** - * Get the space (padding) between the box's elements. - * - * @param obj The Elm_Box - * @param horizontal The horizontal space between elements - * @param vertical The vertical space between elements - * - * @ingroup Box - */ -EAPI void -elm_box_padding_get(const Evas_Object *obj, Evas_Coord *horizontal, Evas_Coord *vertical) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - evas_object_box_padding_get(wd->box, horizontal, vertical); -} -/** - * Set the alignment of the whole bouding box of contents. - * - * @param obj The Elm_Box - * @param horizontal The horizontal alignment of elements - * @param vertical The vertical alignment of elements - * - * @ingroup Box - */ EAPI void -elm_box_align_set(Evas_Object *obj, double horizontal, double vertical) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - evas_object_box_align_set(wd->box, horizontal, vertical); -} - -/** - * Get the alignment of the whole bouding box of contents. - * - * @param obj The Elm_Box - * @param horizontal The horizontal alignment of elements - * @param vertical The vertical alignment of elements - * - * @ingroup Box - */ -EAPI void -elm_box_align_get(const Evas_Object *obj, double *horizontal, double *vertical) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - evas_object_box_align_get(wd->box, horizontal, vertical); -} - -/** - * Set extended mode - * - * If enabled, box aligns all items within the box size(width). When the total min size of the items is greater than the box size, box aligns items to the next line like line wrapping in multiline text. - * - * @param obj The box object - * @param extended The extended mode flag (1 = on, 0 = off) - * - * @ingroup Box - */ -EAPI void -elm_box_extended_mode_set(Evas_Object *obj, Eina_Bool extended) +elm_box_extended_set(Evas_Object *obj, Eina_Bool extended) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->extended = !!extended; if (extended) - wd->horizontal = 1; /* Do NOT support vertical extended mode */ + wd->horizontal = 1; /* Do NOT support vertical extended mode */ evas_object_smart_calculate(wd->box); } -/** - * Get the extended mode - * - * @param obj The box object - * @return If is extended mode - * - * @ingroup Box - */ -EAPI Eina_Bool -elm_box_extended_mode_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->extended; -} diff --git a/src/lib/elm_bubble.c b/src/lib/elm_bubble.c index 3b38f55..56b9e93 100644 --- a/src/lib/elm_bubble.c +++ b/src/lib/elm_bubble.c @@ -66,11 +66,7 @@ _theme_hook(Evas_Object *obj) _elm_theme_object_set(obj, wd->bbl, "bubble", wd->corner, elm_widget_style_get(obj)); edje_object_part_text_set(wd->bbl, "elm.text", wd->label); - if (wd->label) edje_object_signal_emit(wd->bbl, "elm,state,text,visible", "elm"); - else edje_object_signal_emit(wd->bbl, "elm,state,text,hidden", "elm"); edje_object_part_text_set(wd->bbl, "elm.info", wd->info); - if (wd->info) edje_object_signal_emit(wd->bbl, "elm,state,info,visible", "elm"); - else edje_object_signal_emit(wd->bbl, "elm,state,info,hidden", "elm"); if (wd->content) { edje_object_part_swallow(wd->bbl, "elm.swallow.content", wd->content); @@ -248,10 +244,10 @@ elm_bubble_label_set(Evas_Object *obj, const char *label) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; + if (label) edje_object_signal_emit(wd->bbl, "elm,state,label,visible", "elm"); + else edje_object_signal_emit(wd->bbl, "elm,state,label,hidden", "elm"); eina_stringshare_replace(&wd->label, label); edje_object_part_text_set(wd->bbl, "elm.text", label); - if (label) edje_object_signal_emit(wd->bbl, "elm,state,text,visible", "elm"); - else edje_object_signal_emit(wd->bbl, "elm,state,text,hidden", "elm"); _sizing_eval(obj); } @@ -296,8 +292,6 @@ elm_bubble_info_set(Evas_Object *obj, const char *info) if (!wd) return; eina_stringshare_replace(&wd->info, info); edje_object_part_text_set(wd->bbl, "elm.info", info); - if (info) edje_object_signal_emit(wd->bbl, "elm,state,info,visible", "elm"); - else edje_object_signal_emit(wd->bbl, "elm,state,info,hidden", "elm"); _sizing_eval(obj); } diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c index 160035e..514570b 100644 --- a/src/lib/elm_button.c +++ b/src/lib/elm_button.c @@ -43,11 +43,6 @@ static void _signal_clicked(void *data, Evas_Object *obj, const char *emission, static void _signal_pressed(void *data, Evas_Object *obj, const char *emission, const char *source); static void _signal_unpressed(void *data, Evas_Object *obj, const char *emission, const char *source); static void _on_focus_hook(void *data, Evas_Object *obj); -static void _activate(Evas_Object *obj); -static void _activate_hook(Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); - static void _set_label(Evas_Object *obj, const char *label); static void _signal_default_text_set(void *data, Evas_Object *obj, const char *emission, const char *source); @@ -61,25 +56,6 @@ static const Evas_Smart_Cb_Description _signals[] = { {NULL, NULL} }; -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if ((strcmp(ev->keyname, "Return")) && - (strcmp(ev->keyname, "KP_Enter")) && - (strcmp(ev->keyname, "space"))) - return EINA_FALSE; - _activate(obj); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - edje_object_signal_emit(wd->btn, "elm,anim,activate", "elm"); - return EINA_TRUE; -} - static void _del_hook(Evas_Object *obj) { @@ -104,8 +80,8 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) { _set_label(obj, wd->statelabel[FOCUSED]); } - edje_object_signal_emit(wd->btn, "elm,action,focus", "elm"); - evas_object_focus_set(wd->btn, EINA_TRUE); + edje_object_signal_emit(wd->btn, "elm,action,focus", "elm"); + evas_object_focus_set(wd->btn, EINA_TRUE); } else { @@ -115,8 +91,8 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) else _set_label(obj, wd->label); #endif - edje_object_signal_emit(wd->btn, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->btn, EINA_FALSE); + edje_object_signal_emit(wd->btn, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->btn, EINA_FALSE); } } @@ -124,29 +100,27 @@ static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - const char *str; if (!wd) return; _elm_theme_object_set(obj, wd->btn, "button", "base", elm_widget_style_get(obj)); + if (wd->icon) edje_object_part_swallow(wd->btn, "elm.swallow.content", wd->icon); + if (wd->label) edje_object_signal_emit(wd->btn, "elm,state,text,visible", "elm"); else - edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm"); + edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm"); + if (wd->icon) edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm"); else edje_object_signal_emit(wd->btn, "elm,state,icon,hidden", "elm"); + edje_object_part_text_set(wd->btn, "elm.text", wd->label); if (elm_object_disabled_get(obj)) edje_object_signal_emit(wd->btn, "elm,state,disabled", "elm"); edje_object_message_signal_process(wd->btn); edje_object_scale_set(wd->btn, elm_widget_scale_get(obj) * _elm_config->scale); - str = edje_object_data_get(wd->btn, "focus_highlight"); - if ((str) && (!strcmp(str, "on"))) - elm_widget_highlight_in_theme_set(obj, EINA_TRUE); - else - elm_widget_highlight_in_theme_set(obj, EINA_FALSE); _sizing_eval(obj); } @@ -176,30 +150,6 @@ _disable_hook(Evas_Object *obj) } static void -_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - edje_object_signal_emit(wd->btn, emission, source); -} - -static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - edje_object_signal_callback_add(wd->btn, emission, source, func_cb, data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_del_full(wd->btn, emission, source, func_cb, - data); -} - -static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -235,39 +185,27 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) if (!wd) return; if (sub == wd->icon) { - edje_object_signal_emit(wd->btn, "elm,state,icon,hidden", "elm"); - evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + edje_object_signal_emit(wd->btn, "elm,state,icon,hidden", "elm"); + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - wd->icon = NULL; - edje_object_message_signal_process(wd->btn); - _sizing_eval(obj); + wd->icon = NULL; + edje_object_message_signal_process(wd->btn); + _sizing_eval(obj); } } static void -_activate(Evas_Object *obj) +_signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) { - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; if (wd->timer) { - ecore_timer_del(wd->timer); - wd->timer = NULL; + ecore_timer_del(wd->timer); + wd->timer = NULL; } wd->repeating = EINA_FALSE; - evas_object_smart_callback_call(obj, SIG_CLICKED, NULL); -} - -static void -_activate_hook(Evas_Object *obj) -{ - _activate(obj); -} - -static void -_signal_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ - _activate(data); + evas_object_smart_callback_call(data, SIG_CLICKED, NULL); } static Eina_Bool @@ -279,10 +217,9 @@ _autorepeat_send(void *data) evas_object_smart_callback_call(data, SIG_REPEATED, NULL); if (!wd->repeating) { - wd->timer = NULL; - return ECORE_CALLBACK_CANCEL; + wd->timer = NULL; + return ECORE_CALLBACK_CANCEL; } - return ECORE_CALLBACK_RENEW; } @@ -310,12 +247,12 @@ _signal_pressed(void *data, Evas_Object *obj __UNUSED__, const char *emission __ { _set_label(data, wd->statelabel[HIGHLIGHTED]); } - if ((wd->autorepeat) && (!wd->repeating)) + if (wd->autorepeat && !wd->repeating) { - if (wd->ar_threshold <= 0.0) - _autorepeat_initial_send(data); /* call immediately */ - else - wd->timer = ecore_timer_add(wd->ar_threshold, _autorepeat_initial_send, data); + if (wd->ar_threshold <= 0.0) + _autorepeat_initial_send(data); /* call immediately */ + else + wd->timer = ecore_timer_add(wd->ar_threshold, _autorepeat_initial_send, data); } } @@ -347,8 +284,8 @@ _signal_unpressed(void *data, Evas_Object *obj __UNUSED__, const char *emission if (wd->timer) { - ecore_timer_del(wd->timer); - wd->timer = NULL; + ecore_timer_del(wd->timer); + wd->timer = NULL; } wd->repeating = EINA_FALSE; evas_object_smart_callback_call(data, SIG_UNPRESSED, NULL); @@ -368,26 +305,18 @@ elm_button_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "button"); elm_widget_type_set(obj, "button"); + elm_widget_can_focus_set(obj, EINA_TRUE); elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set( obj, _on_focus_hook, NULL ); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_activate_hook_set(obj, _activate_hook); - elm_widget_event_hook_set(obj, _event_hook); - elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); wd->btn = edje_object_add(e); _elm_theme_object_set(obj, wd->btn, "button", "base", "default"); @@ -411,7 +340,7 @@ elm_button_add(Evas_Object *parent) evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - _theme_hook(obj); + _sizing_eval(obj); // TODO: convert Elementary to subclassing of Evas_Smart_Class // TODO: and save some bytes, making descriptions per-class and not instance! @@ -541,8 +470,6 @@ elm_button_label_get_for_state(const Evas_Object *obj, UIControlState state) * Set the icon used for the button * * Once the icon object is set, a previously set one will be deleted - * If you want to keep that old content object, use the - * elm_button_icon_unset() function. * * @param[in] obj The button object * @param[in] icon The image for the button @@ -560,12 +487,12 @@ elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) wd->icon = icon; if (icon) { - elm_widget_sub_object_add(obj, icon); - evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->btn, "elm.swallow.content", icon); - edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm"); - edje_object_message_signal_process(wd->btn); + elm_widget_sub_object_add(obj, icon); + evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->btn, "elm.swallow.content", icon); + edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm"); + edje_object_message_signal_process(wd->btn); } _sizing_eval(obj); } @@ -573,9 +500,8 @@ elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Get the icon used for the button * - * Return the icon object which is set for this widget. * @param[in] obj The button object - * @return The icon object that is being used + * @return The image for the button * * @ingroup Button */ @@ -589,30 +515,6 @@ elm_button_icon_get(const Evas_Object *obj) } /** - * Unset the icon used for the button - * - * Unparent and return the icon object which was set for this widget. - * - * @param[in] obj The button object - * @return The icon object that was being used - * - * @ingroup Button - */ -EAPI Evas_Object * -elm_button_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->icon) return NULL; - Evas_Object *icon = wd->icon; - elm_widget_sub_object_del(obj, wd->icon); - edje_object_part_unswallow(wd->btn, wd->icon); - wd->icon = NULL; - return icon; -} - -/** * Turn on/off the autorepeat event generated when the user keeps pressing on the button * * @param[in] obj The button object @@ -636,23 +538,6 @@ elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on) } /** - * Get if autorepeat event is on - * - * @param obj The button object - * @return If autorepeat is on - * - * @ingroup Button - */ -EAPI Eina_Bool -elm_button_autorepeat_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->autorepeat; -} - -/** * Set the initial timeout before the autorepeat event is generated * * @param[in] obj The button object @@ -669,30 +554,13 @@ elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t) if (wd->ar_threshold == t) return; if (wd->timer) { - ecore_timer_del(wd->timer); - wd->timer = NULL; + ecore_timer_del(wd->timer); + wd->timer = NULL; } wd->ar_threshold = t; } /** - * Get the initial timeout before the autorepeat event is generated - * - * @param[in] obj The button object - * @return Timeout - * - * @ingroup Button - */ -EAPI double -elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0.0; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return 0.0; - return wd->ar_threshold; -} - -/** * Set the interval between each generated autorepeat event * * @param[in] obj The button object @@ -709,22 +577,5 @@ elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t) if (wd->ar_interval == t) return; wd->ar_interval = t; - if ((wd->repeating) && (wd->timer)) ecore_timer_interval_set(wd->timer, t); -} - -/** - * Get the interval between each generated autorepeat event - * - * @param[in] obj The button object - * @return Interval - * - * @ingroup Button - */ -EAPI double -elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0.0; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return 0.0; - return wd->ar_interval; + if (wd->repeating && wd->timer) ecore_timer_interval_set(wd->timer, t); } diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c index 8656945..ff9c79b 100644 --- a/src/lib/elm_calendar.c +++ b/src/lib/elm_calendar.c @@ -1,11 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif - -#ifdef HAVE_EVIL -# include -#endif - #include #include "elm_priv.h" @@ -25,14 +17,6 @@ * changed - emitted when the user selects a day or changes the displayed * month, what actually changes the selected day as well. */ - -typedef enum _Day_Color // EINA_DEPRECATED -{ - DAY_WEEKDAY = 0, - DAY_SATURDAY = 1, - DAY_SUNDAY = 2 -} Day_Color; - typedef struct _Widget_Data Widget_Data; struct _Widget_Data @@ -46,7 +30,6 @@ struct _Widget_Data char * (*format_func) (struct tm *stime); const char *weekdays[7]; struct tm current_time, selected_time; - Day_Color day_color[42]; // EINA_DEPRECATED Eina_Bool selection_enabled : 1; }; @@ -60,7 +43,6 @@ struct _Elm_Calendar_Mark }; static const char *widtype = NULL; -static void _on_focus_hook(void *data, Evas_Object *obj); static const char *_days_abbrev[] = { @@ -117,16 +99,14 @@ _maxdays_get(struct tm *time) month = time->tm_mon; year = time->tm_year + 1900; - return _days_in_month[((!(year % 4)) && - ((!(year % 400)) || - (year % 100)))] - [month]; + return _days_in_month[(!(year % 4) && (!(year % 400) || (year % 100)))] + [month]; } static inline void _unselect(Widget_Data *wd, int selected) { - char emission[32]; + char emission[18]; snprintf(emission, sizeof(emission), "cit_%i,unselected", selected); edje_object_signal_emit(wd->calendar, emission, "elm"); } @@ -134,7 +114,7 @@ _unselect(Widget_Data *wd, int selected) static inline void _select(Widget_Data *wd, int selected) { - char emission[32]; + char emission[16]; snprintf(emission, sizeof(emission), "cit_%i,selected", selected); edje_object_signal_emit(wd->calendar, emission, "elm"); } @@ -142,7 +122,7 @@ _select(Widget_Data *wd, int selected) static inline void _not_today(Widget_Data *wd) { - char emission[32]; + char emission[17]; snprintf(emission, sizeof(emission), "cit_%i,not_today", wd->today_it); edje_object_signal_emit(wd->calendar, emission, "elm"); wd->today_it = -1; @@ -151,7 +131,7 @@ _not_today(Widget_Data *wd) static inline void _today(Widget_Data *wd, int it) { - char emission[32]; + char emission[13]; snprintf(emission, sizeof(emission), "cit_%i,today", it); edje_object_signal_emit(wd->calendar, emission, "elm"); wd->today_it = it; @@ -179,40 +159,6 @@ _weekday_get(int first_week_day, int day) return (day + first_week_day - 1) % 7; } -// EINA_DEPRECATED -static void -_text_day_color_update(Widget_Data *wd, int pos) -{ - char emission[32]; - - switch (wd->day_color[pos]) - { - case DAY_WEEKDAY: - snprintf(emission, sizeof(emission), "cit_%i,weekday", pos); - break; - case DAY_SATURDAY: - snprintf(emission, sizeof(emission), "cit_%i,saturday", pos); - break; - case DAY_SUNDAY: - snprintf(emission, sizeof(emission), "cit_%i,sunday", pos); - break; - default: - return; - } - - edje_object_signal_emit(wd->calendar, emission, "elm"); -} - -// EINA_DEPRECATED -static void -_text_day_color_set(Widget_Data *wd, Day_Color col, int pos) -{ - if ((pos < 0) || (pos >= 42)) return; - if (wd->day_color[pos] == col) return; - wd->day_color[pos] = col; - _text_day_color_update(wd, pos); -} - static void _populate(Evas_Object *obj) { @@ -222,7 +168,7 @@ _populate(Evas_Object *obj) struct tm first_day; Eina_List *l; char *buf; - Eina_Bool last_row = EINA_TRUE; + Eina_Bool last_row=1; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -237,8 +183,8 @@ _populate(Evas_Object *obj) buf = wd->format_func(&wd->selected_time); if (buf) { - edje_object_part_text_set(wd->calendar, "month_text", buf); - free(buf); + edje_object_part_text_set(wd->calendar, "month_text", buf); + free(buf); } else edje_object_part_text_set(wd->calendar, "month_text", ""); @@ -249,131 +195,130 @@ _populate(Evas_Object *obj) first_day.tm_mday = 1; mktime(&first_day); - // Layout of the calendar is changed for removing the unfilled last row. wd->first_day_it = first_day.tm_wday; - - if ((35 - wd->first_day_it) > (maxdays - 1)) last_row = EINA_FALSE; - - if (!last_row) - { - char emission[32]; - - for (i = 0; i < 5; i++) - { - snprintf(emission, sizeof(emission), "cseph_%i,row_hide", i); - edje_object_signal_emit(wd->calendar, emission, "elm"); - } - snprintf(emission, sizeof(emission), "cseph_%i,row_invisible", 5); - edje_object_signal_emit(wd->calendar, emission, "elm"); - for (i = 0; i < 35; i++) - { - snprintf(emission, sizeof(emission), "cit_%i,cell_expanded", i); - edje_object_signal_emit(wd->calendar, emission, "elm"); - } - for (i = 35; i < 42; i++) - { - snprintf(emission, sizeof(emission), "cit_%i,cell_invisible", i); - edje_object_signal_emit(wd->calendar, emission, "elm"); - } - } - else - { - char emission[32]; - - for (i = 0; i < 6; i++) - { - snprintf(emission, sizeof(emission), "cseph_%i,row_show", i); - edje_object_signal_emit(wd->calendar, emission, "elm"); - } - for (i = 0; i < 42; i++) - { - snprintf(emission, sizeof(emission), "cit_%i,cell_default", i); - edje_object_signal_emit(wd->calendar, emission, "elm"); - } - } - + + if ((35- wd->first_day_it) >(maxdays-1)) + last_row=0; + + if (last_row==0) + { + for (i = 0; i < 5; i++) + { + char emission[18]; + snprintf(emission, sizeof(emission), "cseph_%i,row_hide", i); + edje_object_signal_emit(wd->calendar, emission, "elm"); + } + char emission[23]; + snprintf(emission, sizeof(emission), "cseph_%i,row_invisible", 5); + edje_object_signal_emit(wd->calendar, emission, "elm"); + + for (i = 0; i < 35; i++) + { + char emission[21]; + snprintf(emission, sizeof(emission), "cit_%i,cell_expanded", i); + edje_object_signal_emit(wd->calendar, emission, "elm"); + } + for (i = 35; i < 42; i++) + { + char emission[22]; + snprintf(emission, sizeof(emission), "cit_%i,cell_invisible", i); + edje_object_signal_emit(wd->calendar, emission, "elm"); + } + } + else + { + for (i = 0; i < 6; i++) + { + char emission[18]; + snprintf(emission, sizeof(emission), "cseph_%i,row_show", i); + edje_object_signal_emit(wd->calendar, emission, "elm"); + } + + for (i = 0; i < 42; i++) + { + char emission[20]; + snprintf(emission, sizeof(emission), "cit_%i,cell_default", i); + edje_object_signal_emit(wd->calendar, emission, "elm"); + } + } + for (i = 0; i < 42; i++) { - _text_day_color_update(wd, i); // EINA_DEPRECATED - if ((!day) && (i == first_day.tm_wday)) day = 1; + if ((!day) && (i == first_day.tm_wday)) + day = 1; - if ((day == wd->current_time.tm_mday) - && (mon == wd->current_time.tm_mon) - && (year == wd->current_time.tm_year)) - _today(wd, i); + if ((day == wd->current_time.tm_mday)&& (mon == wd->current_time.tm_mon)&& (year == wd->current_time.tm_year)) + _today(wd, i); - if (day == wd->selected_time.tm_mday) - { - if ((wd->selected_it > -1) && (wd->selected_it != i)) - _unselect(wd, wd->selected_it); + if (day == wd->selected_time.tm_mday) + { + if ((wd->selected_it > -1) && (wd->selected_it != i)) + _unselect(wd, wd->selected_it); - if (wd->selection_enabled) _select(wd, i); + if (wd->selection_enabled) _select(wd, i); - wd->selected_it = i; - } + wd->selected_it = i; + } - if ((day) && (day <= maxdays)) - snprintf(day_s, sizeof(day_s), "%i", day++); - else + if (day && (day <= maxdays)) + snprintf(day_s, sizeof(day_s), "%d", day++); + else day_s[0] = 0; - snprintf(part, sizeof(part), "cit_%i.text", i); - edje_object_part_text_set(wd->calendar, part, day_s); - /* Clear previous marks */ - _cit_mark(wd->calendar, i, "clear"); + snprintf(part, sizeof(part), "cit_%i.text", i); + edje_object_part_text_set(wd->calendar, part, day_s); + /* Clear previous marks */ + _cit_mark(wd->calendar, i, "clear"); } /* Set marks */ EINA_LIST_FOREACH(wd->marks, l, mark) { - struct tm *mtime = &mark->mark_time; - int mon = wd->selected_time.tm_mon; - int year = wd->selected_time.tm_year; - int mday_it = mtime->tm_mday + wd->first_day_it - 1; - - switch (mark->repeat) - { - case ELM_CALENDAR_UNIQUE: - if ((mtime->tm_mon == mon) && (mtime->tm_year == year)) - _cit_mark(wd->calendar, mday_it, mark->mark_type); - break; - case ELM_CALENDAR_DAILY: - if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) || - (mtime->tm_year < year)) - day = 1; - else if ((mtime->tm_year == year) && (mtime->tm_mon == mon)) - day = mtime->tm_mday; - else - break; - for (; day <= maxdays; day++) - _cit_mark(wd->calendar, day + wd->first_day_it - 1, - mark->mark_type); - break; - case ELM_CALENDAR_WEEKLY: - if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) || - (mtime->tm_year < year)) - day = 1; - else if ((mtime->tm_year == year) && (mtime->tm_mon == mon)) - day = mtime->tm_mday; - else - break; - for (; day <= maxdays; day++) - if (mtime->tm_wday == _weekday_get(wd->first_day_it, day)) - _cit_mark(wd->calendar, day + wd->first_day_it - 1, - mark->mark_type); - break; - case ELM_CALENDAR_MONTHLY: - if (((mtime->tm_year < year) || - ((mtime->tm_year == year) && (mtime->tm_mon <= mon))) && - (mtime->tm_mday <= maxdays)) - _cit_mark(wd->calendar, mday_it, mark->mark_type); - break; - case ELM_CALENDAR_ANNUALLY: - if ((mtime->tm_year <= year) && (mtime->tm_mon == mon) && - (mtime->tm_mday <= maxdays)) - _cit_mark(wd->calendar, mday_it, mark->mark_type); - break; - } + struct tm *mtime = &mark->mark_time; + int mon = wd->selected_time.tm_mon; + int year = wd->selected_time.tm_year; + int mday_it = mtime->tm_mday + wd->first_day_it - 1; + + switch (mark->repeat) + { + case ELM_CALENDAR_UNIQUE: + { + if ((mtime->tm_mon == mon) && (mtime->tm_year == year)) + _cit_mark(wd->calendar, mday_it, mark->mark_type); + break; + } + case ELM_CALENDAR_DAILY: + { + if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||(mtime->tm_year < year)) day = 1; + else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))day = mtime->tm_mday; + else break; + for (; day <= maxdays; day++) + _cit_mark(wd->calendar, day + wd->first_day_it -1, mark->mark_type); + break; + } + case ELM_CALENDAR_WEEKLY: + { + if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) || (mtime->tm_year < year))day = 1; + else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))day = mtime->tm_mday; + else break; + for (; day <= maxdays; day++) + if (mtime->tm_wday == _weekday_get(wd->first_day_it, day)) + _cit_mark(wd->calendar, day + wd->first_day_it - 1,mark->mark_type); + break; + } + case ELM_CALENDAR_MONTHLY: + { + if (((mtime->tm_year < year) ||((mtime->tm_year == year) && (mtime->tm_mon <= mon))) &&(mtime->tm_mday <= maxdays)) + _cit_mark(wd->calendar, mday_it, mark->mark_type); + break; + } + case ELM_CALENDAR_ANNUALLY: + { + if ((mtime->tm_year <= year) && (mtime->tm_mon == mon) &&(mtime->tm_mday <= maxdays)) + _cit_mark(wd->calendar, mday_it, mark->mark_type); + break; + } + } } } @@ -387,8 +332,8 @@ _set_headers(Evas_Object *obj) for (i = 0; i < 7; i++) { - part[3] = i + '0'; - edje_object_part_text_set(wd->calendar, part, wd->weekdays[i]); + part[3] = i + '0'; + edje_object_part_text_set(wd->calendar, part, wd->weekdays[i]); } } @@ -405,12 +350,10 @@ _del_hook(Evas_Object *obj) if (wd->update_timer) ecore_timer_del(wd->update_timer); if (wd->marks) - { - EINA_LIST_FREE(wd->marks, mark) - { + EINA_LIST_FREE(wd->marks, mark) + { _mark_free(mark); - } - } + } for (i = 0; i < 7; i++) eina_stringshare_del(wd->weekdays[i]); @@ -419,34 +362,17 @@ _del_hook(Evas_Object *obj) } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->calendar, "elm,action,focus", "elm"); - evas_object_focus_set(wd->calendar, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->calendar, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->calendar, EINA_FALSE); - } -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_theme_object_set(obj, wd->calendar, "calendar", "base", - elm_widget_style_get(obj)); + elm_widget_style_get(obj)); _set_headers(obj); _populate(obj); edje_object_message_signal_process(wd->calendar); edje_object_scale_set(wd->calendar, - elm_widget_scale_get(obj) * _elm_config->scale); + elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); } @@ -464,16 +390,15 @@ _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *so Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; edje_object_signal_callback_add(wd->calendar, emission, - source, func_cb, data); + source, func_cb, data); } -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) +static void * +_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source)) { Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - edje_object_signal_callback_del_full(wd->calendar, emission, source, func_cb, - data); + if (!wd) return NULL; + return edje_object_signal_callback_del(wd->calendar, emission, source, func_cb); } /* Set correct tm_wday and tm_yday after other fields changes*/ @@ -500,23 +425,23 @@ _update_month(Evas_Object *obj, int delta) wd->selected_time.tm_mon += delta; if (wd->selected_time.tm_mon < 0) { - if (wd->selected_time.tm_year == wd->year_min) - { - wd->selected_time.tm_mon++; - return EINA_FALSE; - } - wd->selected_time.tm_mon = 11; - wd->selected_time.tm_year--; + if (wd->selected_time.tm_year == wd->year_min) + { + wd->selected_time.tm_mon++; + return EINA_FALSE; + } + wd->selected_time.tm_mon = 11; + wd->selected_time.tm_year--; } else if (wd->selected_time.tm_mon > 11) { - if (wd->selected_time.tm_year == wd->year_max) - { - wd->selected_time.tm_mon--; - return EINA_FALSE; - } - wd->selected_time.tm_mon = 0; - wd->selected_time.tm_year++; + if (wd->selected_time.tm_year == wd->year_max) + { + wd->selected_time.tm_mon--; + return EINA_FALSE; + } + wd->selected_time.tm_mon = 0; + wd->selected_time.tm_year++; } maxdays = _maxdays_get(&wd->selected_time); @@ -589,42 +514,28 @@ _get_item_day(Evas_Object *obj, int selected_it) } static void -_update_sel_it(Evas_Object *obj, int sel_it) +_day_selected(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source) { - int day; - Widget_Data *wd = elm_widget_data_get(obj); + int sel_it, day; + Widget_Data *wd = elm_widget_data_get(data); if ((!wd) || (!wd->selection_enabled)) - return; - - day = _get_item_day(obj, sel_it); + return; + sel_it = atoi(source); + day = _get_item_day(data, sel_it); if (!day) return; - _unselect(wd, wd->selected_it); - wd->selected_it = sel_it; wd->selected_time.tm_mday = day; _select(wd, wd->selected_it); _fix_selected_time(wd); - evas_object_smart_callback_call(obj, "changed", NULL); -} - -static void -_day_selected(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source) -{ - int sel_it; - Widget_Data *wd = elm_widget_data_get(data); - if ((!wd) || (!wd->selection_enabled)) - return; - sel_it = atoi(source); - - _update_sel_it(data, sel_it); + evas_object_smart_callback_call(data, "changed", NULL); } static inline int _time_to_next_day(struct tm *t) { - return ((((24 - t->tm_hour) * 60) - t->tm_min) * 60) - t->tm_sec; + return (((24 - t->tm_hour) * 60) - t->tm_min) * 60 - t->tm_sec; } static Eina_Bool @@ -642,8 +553,7 @@ _update_cur_date(void *data) t = _time_to_next_day(&wd->current_time); ecore_timer_interval_set(wd->update_timer, t); - if ((wd->current_time.tm_mon != wd->selected_time.tm_mon) || - (wd->current_time.tm_year!= wd->selected_time.tm_year)) + if ((wd->current_time.tm_mon != wd->selected_time.tm_mon) || (wd->current_time.tm_year!= wd->selected_time.tm_year)) return ECORE_CALLBACK_RENEW; day = wd->current_time.tm_mday + wd->first_day_it - 1; @@ -652,52 +562,6 @@ _update_cur_date(void *data) return ECORE_CALLBACK_RENEW; } -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (!wd->selection_enabled) return EINA_FALSE; - - if ((!strcmp(ev->keyname, "Left")) || - (!strcmp(ev->keyname, "KP_Left"))) - { - _update_sel_it(obj, wd->selected_it-1); - } - else if ((!strcmp(ev->keyname, "Right")) || - (!strcmp(ev->keyname, "KP_Right"))) - { - _update_sel_it(obj, wd->selected_it+1); - } - else if ((!strcmp(ev->keyname, "Up")) || - (!strcmp(ev->keyname, "KP_Up"))) - { - _update_sel_it(obj, wd->selected_it-7); - } - else if ((!strcmp(ev->keyname, "Down")) || - (!strcmp(ev->keyname, "KP_Down"))) - { - _update_sel_it(obj, wd->selected_it+7); - } - else if ((!strcmp(ev->keyname, "Prior")) || - (!strcmp(ev->keyname, "KP_Prior"))) - { - if (_update_month(obj, -1)) _populate(obj); - } - else if ((!strcmp(ev->keyname, "Next")) || - (!strcmp(ev->keyname, "KP_Next"))) - { - if (_update_month(obj, 1)) _populate(obj); - } - else return EINA_FALSE; - - return EINA_TRUE; -} - /** * Add a new calendar to the parent * @@ -715,24 +579,18 @@ elm_calendar_add(Evas_Object *parent) int i, t; Evas *e; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "calendar"); elm_widget_type_set(obj, "calendar"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); wd->first_interval = 0.85; wd->year_min = 2; @@ -804,8 +662,6 @@ elm_calendar_weekdays_names_set(Evas_Object *obj, const char *weekdays[]) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(weekdays); - for (i = 0; i < 7; i++) { eina_stringshare_replace(&wd->weekdays[i], weekdays[i]); @@ -927,6 +783,8 @@ elm_calendar_min_max_year_set(Evas_Object *obj, int min, int max) EAPI void elm_calendar_min_max_year_get(const Evas_Object *obj, int *min, int *max) { + if (min) *min = 0; + if (max) *max = 0; ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -996,8 +854,6 @@ elm_calendar_selected_time_set(Evas_Object *obj, struct tm *selected_time) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - - EINA_SAFETY_ON_NULL_RETURN(selected_time); wd->selected_time = *selected_time; _populate(obj); return; @@ -1021,8 +877,7 @@ elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time) ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(selected_time, EINA_FALSE); - *selected_time = wd->selected_time; + if (selected_time) *selected_time = wd->selected_time; return EINA_TRUE; } @@ -1090,7 +945,7 @@ elm_calendar_format_function_set(Evas_Object *obj, char * (*format_function) (st * * @param obj The calendar object * @param mark_type A string used to define the type of mark. It will be - * emitted to the theme, that should display a related modification on these + * emmitted to the theme, that should display a related modification on these * days representation. * @param mark_time A time struct to represent the date of inclusion of the * mark. For marks that repeats it will just be displayed after the inclusion @@ -1129,7 +984,7 @@ elm_calendar_mark_del(Elm_Calendar_Mark *mark) Evas_Object *obj; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN(mark); + if (!mark) return; obj = mark->obj; wd = elm_widget_data_get(obj); @@ -1155,7 +1010,7 @@ elm_calendar_marks_clear(Evas_Object *obj) if (!wd) return; EINA_LIST_FREE(wd->marks, mark) - _mark_free(mark); + _mark_free(mark); } /** @@ -1199,82 +1054,61 @@ elm_calendar_marks_draw(Evas_Object *obj) } /** - * Set a text color to the saturday color. - * - * Deprecated. use elm_calendar_mark_add() instead like: - * - * @code - * struct tm t = { 0, 0, 12, 6, 0, 0, 5, 5, -1 }; - * elm_calendar_mark_add(obj, "sat", &t, ELM_CALENDAR_WEEKLY); - * @endcode - * + * Set a text color - blue. + * * @param obj The calendar object - * @param pos The text position + * @param pos The text position * * @ingroup Calendar */ -EINA_DEPRECATED EAPI void -elm_calendar_text_saturday_color_set(Evas_Object *obj, int pos) +EAPI void +elm_calendar_text_saturday_color_set(const Evas_Object *obj, int pos) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - _text_day_color_set(wd, DAY_SATURDAY, pos); + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + char emission[16]; + snprintf(emission, sizeof(emission), "cit_%d,saturday", pos); + edje_object_signal_emit(wd->calendar, emission, "elm"); } /** - * Set a text color to the sunday color. + * Set a text color - red. * - * Deprecated. use elm_calendar_mark_add() instead like: - * - * @code - * struct tm t = { 0, 0, 12, 7, 0, 0, 6, 6, -1 }; - * elm_calendar_mark_add(obj, "sun", &t, ELM_CALENDAR_WEEKLY); - * @endcode - * * @param obj The calendar object - * @param pos The text position + * @param pos The text position * * @ingroup Calendar */ -EINA_DEPRECATED EAPI void -elm_calendar_text_sunday_color_set(Evas_Object *obj, int pos) +EAPI void +elm_calendar_text_sunday_color_set(const Evas_Object *obj, int pos) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - _text_day_color_set(wd, DAY_SUNDAY, pos); + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + char emission[16]; + snprintf(emission, sizeof(emission), "cit_%d,sunday", pos); + edje_object_signal_emit(wd->calendar, emission, "elm"); } /** - * Set a text color to the weekday color. + * Set a text color - black. * - * Deprecated. use elm_calendar_mark_add() instead like: - * - * @code - * struct tm t = { 0, 0, 12, 1, 0, 0, 0, 0, -1 }; - * - * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // monday - * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++; - * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // tuesday - * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++; - * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // wednesday - * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++; - * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // thursday - * t.tm_tm_mday++; t.tm_wday++; t.tm_yday++; - * elm_calendar_mark_add(obj, "week", &t, ELM_CALENDAR_WEEKLY); // friday - * @endcode - * * @param obj The calendar object - * @param pos The text position + * @param pos The text position * * @ingroup Calendar */ -EINA_DEPRECATED EAPI void -elm_calendar_text_weekday_color_set(Evas_Object *obj, int pos) +EAPI void +elm_calendar_text_weekday_color_set(const Evas_Object *obj, int pos) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - _text_day_color_set(wd, DAY_WEEKDAY, pos); + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + char emission[16]; + snprintf(emission, sizeof(emission), "cit_%d,weekday", pos); + edje_object_signal_emit(wd->calendar, emission, "elm"); } diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index 364fc0b..8c8c005 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -41,34 +41,12 @@ static void _signal_check_off(void *data, Evas_Object *obj, const char *emission static void _signal_check_on(void *data, Evas_Object *obj, const char *emission, const char *source); static void _signal_check_toggle(void *data, Evas_Object *obj, const char *emission, const char *source); static void _on_focus_hook(void *data, Evas_Object *obj); -static void _activate_hook(Evas_Object *obj); -static void _activate(Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); - static const char SIG_CHANGED[] = "changed"; static const Evas_Smart_Cb_Description _signals[] = { {SIG_CHANGED, ""}, {NULL, NULL} }; -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if ((strcmp(ev->keyname, "Return")) && - (strcmp(ev->keyname, "KP_Enter")) && - (strcmp(ev->keyname, "space"))) - return EINA_FALSE; - _activate(obj); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; -} - - static void _del_hook(Evas_Object *obj) { @@ -85,13 +63,13 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) if (!wd) return; if (elm_widget_focus_get(obj)) { - edje_object_signal_emit(wd->chk, "elm,action,focus", "elm"); - evas_object_focus_set(wd->chk, EINA_TRUE); + edje_object_signal_emit(wd->chk, "elm,action,focus", "elm"); + evas_object_focus_set(wd->chk, EINA_TRUE); } else { - edje_object_signal_emit(wd->chk, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->chk, EINA_FALSE); + edje_object_signal_emit(wd->chk, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->chk, EINA_FALSE); } } @@ -102,17 +80,17 @@ _theme_hook(Evas_Object *obj) if (!wd) return; _elm_theme_object_set(obj, wd->chk, "check", "base", elm_widget_style_get(obj)); if (wd->icon) - edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm"); else - edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm"); if (wd->state) - edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm"); else - edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm"); if (wd->label) - edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm"); else - edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm"); edje_object_part_text_set(wd->chk, "elm.text", wd->label); if (elm_widget_disabled_get(obj)) edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm"); @@ -127,9 +105,9 @@ _disable_hook(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (elm_widget_disabled_get(obj)) - edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,disabled", "elm"); else - edje_object_signal_emit(wd->chk, "elm,state,enabled", "elm"); + edje_object_signal_emit(wd->chk, "elm,state,enabled", "elm"); } static void @@ -164,12 +142,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) if (!wd) return; if (sub == wd->icon) { - edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm"); - evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm"); + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - wd->icon = NULL; - _sizing_eval(obj); - edje_object_message_signal_process(wd->chk); + wd->icon = NULL; + _sizing_eval(obj); + edje_object_message_signal_process(wd->chk); } } @@ -198,19 +176,7 @@ _signal_check_on(void *data, Evas_Object *obj __UNUSED__, const char *emission _ static void _signal_check_toggle(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - _activate(data); -} - -static void -_activate_hook(Evas_Object *obj) -{ - _activate(obj); -} - -static void -_activate(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; wd->state = !wd->state; if (wd->statep) *wd->statep = wd->state; @@ -218,13 +184,13 @@ _activate(Evas_Object *obj) edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm"); else edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm"); - evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); + evas_object_smart_callback_call(data, SIG_CHANGED, NULL); } /** * Add a new Check object * - * @param parent The parent object + * @param[in] parent The parent object * @return The new object or NULL if it cannot be created * * @ingroup Check @@ -240,19 +206,16 @@ elm_check_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "check"); elm_widget_type_set(obj, "check"); + elm_widget_can_focus_set(obj, EINA_TRUE); elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_activate_hook_set(obj, _activate_hook); - elm_widget_event_hook_set(obj, _event_hook); wd->chk = edje_object_add(e); _elm_theme_object_set(obj, wd->chk, "check", "base", "default"); @@ -277,8 +240,8 @@ elm_check_add(Evas_Object *parent) /** * Set the text label of the check object * - * @param obj The check object - * @param label The text label string in UTF-8 + * @param[in] obj The check object + * @param[in] label The text label string in UTF-8 * * @ingroup Check */ @@ -301,7 +264,7 @@ elm_check_label_set(Evas_Object *obj, const char *label) /** * Get the text label of the check object * - * @param obj The check object + * @param[in] obj The check object * @return The text label string in UTF-8 * * @ingroup Check @@ -322,8 +285,8 @@ elm_check_label_get(const Evas_Object *obj) * If you want to keep that old content object, use the * elm_check_icon_unset() function. * - * @param obj The check object - * @param icon The icon object + * @param[in] obj The check object + * @param[in] icon The icon object * * @ingroup Check */ @@ -338,12 +301,12 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) wd->icon = icon; if (icon) { - elm_widget_sub_object_add(obj, icon); - evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->chk, "elm.swallow.content", icon); - edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm"); - edje_object_message_signal_process(wd->chk); + elm_widget_sub_object_add(obj, icon); + evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->chk, "elm.swallow.content", icon); + edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm"); + edje_object_message_signal_process(wd->chk); } _sizing_eval(obj); } @@ -351,7 +314,7 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Get the icon object of the check object * - * @param obj The check object + * @param[in] obj The check object * @return The icon object * * @ingroup Check @@ -370,7 +333,7 @@ elm_check_icon_get(const Evas_Object *obj) * * Unparent and return the icon object which was set for this widget. * - * @param obj The check object + * @param[in] obj The check object * @return The icon object that was being used * * @ingroup Check @@ -395,8 +358,8 @@ elm_check_icon_unset(Evas_Object *obj) * This sets the state of the check and will also set the value if pointed to * to the state supplied, but will not call any callbacks. * - * @param obj The check object - * @param state The state to use (1 == on, 0 == off) + * @param[in] obj The check object + * @param[in] state The state to use (1 == on, 0 == off) * * @ingroup Check */ @@ -408,19 +371,19 @@ elm_check_state_set(Evas_Object *obj, Eina_Bool state) if (!wd) return; if (state != wd->state) { - wd->state = state; - if (wd->statep) *wd->statep = wd->state; - if (wd->state) - edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm"); - else - edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm"); + wd->state = state; + if (wd->statep) *wd->statep = wd->state; + if (wd->state) + edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm"); + else + edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm"); } } /** * Get the state of the check object * - * @param obj The check object + * @param[in] obj The check object * @return The boolean state * * @ingroup Check @@ -444,8 +407,8 @@ elm_check_state_get(const Evas_Object *obj) * reflect the value of the boolean statep points to, just like calling * elm_check_state_set(). * - * @param obj The check object - * @param statep Pointer to the boolean to modify + * @param[in] obj The check object + * @param[in] statep Pointer to the boolean to modify * * @ingroup Check */ @@ -457,15 +420,15 @@ elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) if (!wd) return; if (statep) { - wd->statep = statep; - if (*wd->statep != wd->state) - { - wd->state = *wd->statep; - if (wd->state) - edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm"); - else - edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm"); - } + wd->statep = statep; + if (*wd->statep != wd->state) + { + wd->state = *wd->statep; + if (wd->state) + edje_object_signal_emit(wd->chk, "elm,state,check,on", "elm"); + else + edje_object_signal_emit(wd->chk, "elm,state,check,off", "elm"); + } } else wd->statep = NULL; diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c index c589e53..9e121b9 100644 --- a/src/lib/elm_clock.c +++ b/src/lib/elm_clock.c @@ -20,7 +20,7 @@ struct _Widget_Data Eina_Bool am_pm : 1; Eina_Bool edit : 1; Elm_Clock_Digedit digedit; - int hrs, min, sec, timediff; + int hrs, min, sec; Evas_Object *digit[6]; Evas_Object *ampm; Evas_Object *sel_obj; @@ -39,7 +39,6 @@ struct _Widget_Data static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); -static void _on_focus_hook(void *data, Evas_Object *obj); static Eina_Bool _ticker(void *data); static Eina_Bool _signal_clock_val_up(void *data); static Eina_Bool _signal_clock_val_down(void *data); @@ -80,15 +79,9 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->clk, "elm,action,focus", "elm"); - evas_object_focus_set(wd->clk, EINA_TRUE); - } + edje_object_signal_emit(wd->clk, "elm,action,focus", "elm"); else - { - edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->clk, EINA_FALSE); - } + edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm"); } static void @@ -120,32 +113,18 @@ _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *so } } -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) +static void * +_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source)) { Widget_Data *wd = elm_widget_data_get(obj); int i; + if (!wd) return NULL; for (i = 0; i < 6; i++) { - edje_object_signal_callback_del_full(wd->digit[i], emission, source, - func_cb, data); + edje_object_signal_callback_del(wd->digit[i], emission, source, + func_cb); } - edje_object_signal_callback_del_full(wd->clk, emission, source, func_cb, - data); -} - -static void -_timediff_set(Widget_Data *wd) -{ - struct timeval timev; - struct tm *tm; - time_t tt; - gettimeofday(&timev, NULL); - tt = (time_t)(timev.tv_sec); - tzset(); - tm = localtime(&tt); - wd->timediff = (((wd->hrs - tm->tm_hour) * 60 + - wd->min - tm->tm_min) * 60) + wd->sec - tm->tm_sec; + return edje_object_signal_callback_del(wd->clk, emission, source, func_cb); } static Eina_Bool @@ -162,7 +141,7 @@ _ticker(void *data) wd->ticker = ecore_timer_add(t, _ticker, data); if (!wd->edit) { - tt = (time_t)(timev.tv_sec) + wd->timediff; + tt = (time_t)(timev.tv_sec); tzset(); tm = localtime(&tt); if (tm) @@ -364,7 +343,7 @@ _time_update(Evas_Object *obj) _elm_theme_object_set(obj, wd->digit[i], "clock", "flipdigit", style); edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) * _elm_config->scale); - if ((wd->edit) && (wd->digedit & (1 << i))) + if (wd->edit && (wd->digedit & (1 << i))) edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm"); edje_object_signal_callback_add(wd->digit[i], "elm,action,up,start", "", _signal_clock_val_up_start, obj); @@ -433,7 +412,7 @@ _time_update(Evas_Object *obj) if (hrs > 12) hrs -= 12; ampm = 1; } - else if (!hrs) hrs = 12; + else if (hrs == 0) hrs = 12; } d1 = hrs / 10; d2 = hrs % 10; @@ -531,11 +510,8 @@ elm_clock_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "clock"); elm_widget_type_set(obj, "clock"); @@ -547,7 +523,6 @@ elm_clock_add(Evas_Object *parent) elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); wd->clk = edje_object_add(e); elm_widget_resize_object_set(obj, wd->clk); @@ -558,7 +533,6 @@ elm_clock_add(Evas_Object *parent) wd->cur.edit = EINA_TRUE; wd->cur.digedit = ELM_CLOCK_NONE; wd->first_interval = 0.85; - wd->timediff = 0; _time_update(obj); _ticker(obj); @@ -587,7 +561,6 @@ elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec) wd->hrs = hrs; wd->min = min; wd->sec = sec; - _timediff_set(wd); _time_update(obj); } @@ -638,9 +611,7 @@ elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->edit = edit; - if (!edit) - _timediff_set(wd); - if ((edit) && (wd->digedit == ELM_CLOCK_NONE)) + if (edit && (wd->digedit == ELM_CLOCK_NONE)) elm_clock_digit_edit_set(obj, ELM_CLOCK_ALL); else _time_update(obj); diff --git a/src/lib/elm_cnp_helper.c b/src/lib/elm_cnp_helper.c index 14fdea5..1af9aa5 100644 --- a/src/lib/elm_cnp_helper.c +++ b/src/lib/elm_cnp_helper.c @@ -1,419 +1,349 @@ -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif -#include -#include "elm_priv.h" +/* + * todo + * - move to stringshare for stuff when I can + */ +#include #include +#include // debug + +#include + +#include "elm_priv.h" + #ifdef HAVE_ELEMENTARY_X -#define ARRAYINIT(foo) [foo] = +# include +# include + + +# define ARRAYINIT(foo) [foo]= -//#define DEBUGON 1 +#define DEBUGON 0 -#ifdef DEBUGON -# define cnp_debug(x...) fprintf(stderr, __FILE__": " x) +#if DEBUGON +#define cnp_debug(x...) printf(__FILE__": " x) #else -# define cnp_debug(x...) +#define cnp_debug(x...) #endif + #define PROVIDER_SET "__elm_cnp_provider_set" -typedef struct _Paste_Image Paste_Image; -typedef struct _Cnp_Selection Cnp_Selection; -typedef struct _Escape Escape; -typedef struct _Tmp_Info Tmp_Info; -typedef struct _Cnp_Atom Cnp_Atom; -typedef struct _Saved_Type Saved_Type; -typedef struct _Dropable Dropable; +enum { + CNP_ATOM_TARGETS = 0, + CNP_ATOM_text_uri, + CNP_ATOM_text_urilist, + CNP_ATOM_text_x_vcard, + CNP_ATOM_image_png, + CNP_ATOM_image_jpeg, + CNP_ATOM_XELM, + CNP_ATOM_text_html_utf8, + CNP_ATOM_text_html, + CNP_ATOM_UTF8STRING, + CNP_ATOM_STRING, + CNP_ATOM_TEXT, + CNP_ATOM_text_plain_utf8, + CNP_ATOM_text_plain, + + CNP_N_ATOMS, +}; +struct pasteimage { + Evas_Object *entry; + const char *tag; + const char *file; + Evas_Object *img; +}; + -typedef Eina_Bool (*Converter_Fn_Cb) (char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); -typedef int (*Response_Handler_Cb) (Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *); -typedef int (*Notify_Handler_Cb) (Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *); +struct _elm_cnp_selection { + const char *debug; + Evas_Object *widget; -enum -{ - CNP_ATOM_TARGETS = 0, - CNP_ATOM_text_uri, - CNP_ATOM_text_urilist, - CNP_ATOM_text_x_vcard, - CNP_ATOM_image_png, - CNP_ATOM_image_jpeg, - CNP_ATOM_image_bmp, - CNP_ATOM_image_gif, - CNP_ATOM_image_tiff, - CNP_ATOM_image_svg, - CNP_ATOM_image_xpm, - CNP_ATOM_image_tga, - CNP_ATOM_image_ppm, - CNP_ATOM_XELM, - CNP_ATOM_text_html_utf8, - CNP_ATOM_text_html, - CNP_ATOM_UTF8STRING, - CNP_ATOM_STRING, - CNP_ATOM_TEXT, - CNP_ATOM_text_plain_utf8, - CNP_ATOM_text_plain, - - CNP_N_ATOMS, -}; + Elm_Sel_Format format; + char *selbuf; -struct _Paste_Image -{ - Evas_Object *entry; - const char *tag; - const char *file; - Evas_Object *img; -}; + unsigned int active : 1; -struct _Cnp_Selection -{ - const char *debug; - Evas_Object *widget; - char *selbuf; - Evas_Object *requestwidget; - void *udata; - Elm_Sel_Format requestformat; - Elm_Drop_Cb datacb; - Eina_Bool (*set) (Ecore_X_Window, const void *data, int size); - Eina_Bool (*clear) (void); - void (*request) (Ecore_X_Window, const char *target); - - Elm_Sel_Format format; Ecore_X_Selection ecore_sel; - - Eina_Bool active : 1; + + Evas_Object *requestwidget; + Elm_Sel_Format requestformat; + + Elm_Drop_Cb datacb; + void *udata; + + Eina_Bool (*set)(Ecore_X_Window, const void *data, int size); + Eina_Bool (*clear)(void); + void (*request)(Ecore_X_Window, const char *target); }; -struct _Escape -{ +/* Optimisation: Turn this into a 256 byte table: + * then can lookup in one index, not N checks */ +static const struct escapes { const char *escape; - const char value; + const char value; +} escapes[] = { + { "
", '\n' }, + { "", '\n' }, + { "<\t>", '\t' }, + { "gt;", '>' }, + { "lt;", '<' }, + { "amp;",'&' }, + { "quot;",'\'' }, + { "dquot;", '"' }, }; +#define N_ESCAPES ((int)(sizeof(escapes)/sizeof(escapes[0]))) -struct _Tmp_Info -{ +struct tmpinfo { + int fd; char *filename; void *map; - int fd; - int len; -}; - -struct _Cnp_Atom -{ - const char *name; - Elm_Sel_Format formats; - /* Called by ecore to do conversion */ - Converter_Fn_Cb converter; - Response_Handler_Cb response; - Notify_Handler_Cb notify; - /* Atom */ - Ecore_X_Atom atom; + int len; }; -struct _Saved_Type -{ - const char **types; - Paste_Image *pi; - int ntypes; - int x, y; - Eina_Bool textreq: 1; -}; -struct _Dropable -{ - Evas_Object *obj; - /* FIXME: Cache window */ - Elm_Sel_Format types; - Elm_Drop_Cb dropcb; - void *cbdata; -}; - -static Tmp_Info *elm_cnp_tempfile_create(int size); -static int tmpinfo_free(Tmp_Info *tmp); +static struct tmpinfo *elm_cnp_tempfile_create(int size); +static int tmpinfo_free(struct tmpinfo *tmp); static Eina_Bool _elm_cnp_init(void); static Eina_Bool selection_clear(void *udata __UNUSED__, int type, void *event); +//static Eina_Bool selection_request(void *udata __UNUSED__, int type, void *event); static Eina_Bool selection_notify(void *udata __UNUSED__, int type, void *event); static char *remove_tags(const char *p, int *len); static char *mark_up(const char *start, int inlen, int *lenp); static Evas_Object *image_provider(void *images, Evas_Object *entry, const char *item); -static void entry_deleted(void *images, Evas *e, Evas_Object *entry, void *unused); +static void +entry_deleted(void *images, Evas *e, Evas_Object *entry, void *unused); +typedef Eina_Bool (*converter_fn)(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); + static Eina_Bool targets_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); static Eina_Bool text_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); static Eina_Bool html_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); static Eina_Bool edje_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); static Eina_Bool uri_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); -static Eina_Bool image_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); +static Eina_Bool png_converter(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); static Eina_Bool vcard_send(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize); -static int response_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *); - -static int notify_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify); -static int notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify); -static int notify_handler_image(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify); -static int notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify); -static int notify_handler_html(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify); -static int vcard_receive(Cnp_Selection *sed, Ecore_X_Event_Selection_Notify *notify); - -static Paste_Image *pasteimage_alloc(const char *file, int pathlen); -static Eina_Bool pasteimage_append(Paste_Image *pi, Evas_Object *entry); -static void pasteimage_free(Paste_Image *pi); - -/* Optimisation: Turn this into a 256 byte table: - * then can lookup in one index, not N checks */ -static const Escape escapes[] = { - { "
", '\n' }, - { "<\t>", '\t' }, - { "gt;", '>' }, - { "lt;", '<' }, - { "amp;", '&' }, - { "quot;", '\'' }, - { "dquot;", '"' } -}; -#define N_ESCAPES ((int)(sizeof(escapes) / sizeof(escapes[0]))) - -static const char *image_extensions[] = -{ - ".png", - ".jpg", ".jpeg", ".jpe", ".jfif", ".jfi", - ".bmp", - ".xpm", - ".ppm", "pgm", ".pbm", ".pnm", - ".gif", - ".tif", ".tiff", - ".svg", ".svg.gz", - ".tga", ".targa", - - NULL -}; - -static Cnp_Atom atoms[CNP_N_ATOMS] = { +/* FIXME: Which way should this be: Notify or response */ +typedef int (*response_handler)(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *); +static int response_handler_targets(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *); + +typedef int (*notify_handler)(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *); +static int notify_handler_targets(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify); +static int notify_handler_text(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify); +static int notify_handler_png(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify); +static int notify_handler_uri(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify); +static int notify_handler_html(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify); +static int vcard_receive(struct _elm_cnp_selection *sed, + Ecore_X_Event_Selection_Notify *notify); + +static struct pasteimage *pasteimage_alloc(const char *file, int pathlen); +static bool pasteimage_append(struct pasteimage *pi, Evas_Object *entry); +static void pasteimage_free(struct pasteimage *pi); + +static struct { + const char *name; + Elm_Sel_Format formats; + /* Called by ecore to do conversion */ + converter_fn converter; + response_handler response; + notify_handler notify; + /* Atom */ + Ecore_X_Atom atom; +} atoms[CNP_N_ATOMS] = { [CNP_ATOM_TARGETS] = { - "TARGETS", - (Elm_Sel_Format) -1, // everything - targets_converter, - response_handler_targets, - notify_handler_targets, - 0 + "TARGETS", + (Elm_Sel_Format)-1, // everything + targets_converter, + response_handler_targets, + notify_handler_targets, + 0 }, [CNP_ATOM_XELM] = { - "application/x-elementary-markup", - ELM_SEL_FORMAT_MARKUP, - edje_converter, - NULL, - NULL, - 0 + "application/x-elementary-markup", + ELM_SEL_FORMAT_MARKUP, + edje_converter, + NULL, + NULL, + 0 }, [CNP_ATOM_text_uri] = { - "text/uri", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, /* Either images or entries */ - uri_converter, - NULL, - notify_handler_uri, - 0 + "text/uri", + ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, /* Either images or entries */ + uri_converter, + NULL, + notify_handler_uri, + 0 }, [CNP_ATOM_text_urilist] = { - "text/uri-list", - ELM_SEL_FORMAT_IMAGE | ELM_SEL_FORMAT_MARKUP, - uri_converter, - NULL, - notify_handler_uri, - 0 + "text/uri-list", + ELM_SEL_FORMAT_IMAGE | ELM_SEL_FORMAT_MARKUP, + uri_converter, + NULL, + notify_handler_uri, + 0 }, [CNP_ATOM_text_x_vcard] = { - "text/x-vcard", - ELM_SEL_FORMAT_VCARD, - vcard_send, NULL, - vcard_receive, 0 + "text/x-vcard", + ELM_SEL_FORMAT_VCARD, + vcard_send, NULL, + vcard_receive, 0 }, [CNP_ATOM_image_png] = { - "image/png", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image, - 0 + "image/png", + ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, + png_converter, + NULL, + notify_handler_png, + 0 }, [CNP_ATOM_image_jpeg] = { - "image/jpeg", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 - }, - [CNP_ATOM_image_bmp] = { - "image/x-ms-bmp", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 - }, - [CNP_ATOM_image_gif] = { - "image/gif", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 - }, - [CNP_ATOM_image_tiff] = { - "image/tiff", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 - }, - [CNP_ATOM_image_svg] = { - "image/svg+xml", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 - }, - [CNP_ATOM_image_xpm] = { - "image/x-xpixmap", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 - }, - [CNP_ATOM_image_tga] = { - "image/x-tga", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 - }, - [CNP_ATOM_image_ppm] = { - "image/x-portable-pixmap", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, - image_converter, - NULL, - notify_handler_image,/* Raw image data is the same */ - 0 + "image/jpeg", + ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE, + png_converter, + NULL, + notify_handler_png,/* Raw image data is the same */ + 0 }, [CNP_ATOM_text_html_utf8] = { - "text/html;charset=utf-8", - ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, - html_converter, - NULL, - notify_handler_html, - 0 + "text/html;charset=utf-8", + ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, + html_converter, + NULL, + notify_handler_html, + 0 }, [CNP_ATOM_text_html] = { - "text/html", - ELM_SEL_FORMAT_HTML, - html_converter, - NULL, - notify_handler_html, /* No encoding: Webkit only */ - 0 + "text/html", + ELM_SEL_FORMAT_HTML, + html_converter, + NULL, + notify_handler_html, /* No encoding: Webkit only */ + 0 }, [CNP_ATOM_UTF8STRING] = { - "UTF8_STRING", - ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, - text_converter, - NULL, - notify_handler_text, - 0 + "UTF8_STRING", + ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, + text_converter, + NULL, + notify_handler_text, + 0 }, [CNP_ATOM_STRING] = { - "STRING", - ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, - text_converter, - NULL, - notify_handler_text, - 0 + "STRING", + ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, + text_converter, + NULL, + notify_handler_text, + 0 }, [CNP_ATOM_TEXT] = { - "TEXT", - ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, - text_converter, - NULL, - NULL, - 0 + "TEXT", + ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, + text_converter, + NULL, + NULL, + 0 }, [CNP_ATOM_text_plain_utf8] = { - "text/plain;charset=utf-8", - ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, - text_converter, - NULL, - NULL, - 0 + "text/plain;charset=ut-8", + ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, + text_converter, + NULL, + NULL, + 0 }, [CNP_ATOM_text_plain] = { - "text/plain", - ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, - text_converter, - NULL, - NULL, - 0 + "text/plain", + ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_HTML, + text_converter, + NULL, + NULL, + 0 }, }; -static Cnp_Selection selections[ELM_SEL_MAX] = { +static struct _elm_cnp_selection selections[ELM_SEL_MAX] = { ARRAYINIT(ELM_SEL_PRIMARY) { - .debug = "Primary", - .ecore_sel = ECORE_X_SELECTION_PRIMARY, - .set = ecore_x_selection_primary_set, - .clear = ecore_x_selection_primary_clear, - .request = ecore_x_selection_primary_request, + .debug = "Primary", + .ecore_sel = ECORE_X_SELECTION_PRIMARY, + .set = ecore_x_selection_primary_set, + .clear = ecore_x_selection_primary_clear, + .request = ecore_x_selection_primary_request, }, ARRAYINIT(ELM_SEL_SECONDARY) { - .debug = "Secondary", - .ecore_sel = ECORE_X_SELECTION_SECONDARY, - .set = ecore_x_selection_secondary_set, - .clear = ecore_x_selection_secondary_clear, - .request = ecore_x_selection_secondary_request, + .debug = "Secondary", + .ecore_sel = ECORE_X_SELECTION_SECONDARY, + .set = ecore_x_selection_secondary_set, + .clear = ecore_x_selection_secondary_clear, + .request = ecore_x_selection_secondary_request, }, ARRAYINIT(ELM_SEL_CLIPBOARD) { - .debug = "Clipboard", - .ecore_sel = ECORE_X_SELECTION_CLIPBOARD, - .set = ecore_x_selection_clipboard_set, - .clear = ecore_x_selection_clipboard_clear, - .request = ecore_x_selection_clipboard_request, + .debug = "Clipboard", + .ecore_sel = ECORE_X_SELECTION_CLIPBOARD, + .set = ecore_x_selection_clipboard_set, + .clear = ecore_x_selection_clipboard_clear, + .request = ecore_x_selection_clipboard_request, }, ARRAYINIT(ELM_SEL_XDND) { - .debug = "XDnD", - .ecore_sel = ECORE_X_SELECTION_XDND, - .request = ecore_x_selection_xdnd_request, + .debug = "XDnD", + .ecore_sel = ECORE_X_SELECTION_XDND, + .request = ecore_x_selection_xdnd_request, }, }; /* Data for DND in progress */ -static Saved_Type savedtypes = { NULL, NULL, 0, 0, 0, EINA_FALSE }; - -static void (*dragdonecb) (void *data, Evas_Object *obj) = NULL; -static void *dragdonedata = NULL; +/* FIXME: BEtter name */ +struct { + int ntypes; + const char **types; + unsigned int textreq: 1; + struct pasteimage *pi; + int x,y; +} savedtypes = { 0, NULL, 0, NULL, 0, 0 }; + +static void (*dragdonecb)(void *,Evas_Object*); +static void *dragdonedata; static int _elm_cnp_init_count = 0; -/* FIXME: who left this out of XAtoms.h */ + /* Gah... who left this out of XAtoms.h */ static Ecore_X_Atom clipboard_atom; -static Eina_List *pastedimages = NULL; +Eina_List *pastedimages; +Eina_List *providedobjs; /** * Drag & Drop functions */ - +struct dropable { + Evas_Object *obj; + /* FIXME: Cache window */ + Elm_Sel_Format types; + Elm_Drop_Cb dropcb; + void *cbdata; +}; /* FIXME: Way too many globals */ -static Eina_List *drops = NULL; -static Evas_Object *dragwin = NULL; -static int _dragx = 0, _dragy = 0; -static Ecore_Event_Handler *handler_pos = NULL; -static Ecore_Event_Handler *handler_drop = NULL; -static Ecore_Event_Handler *handler_enter = NULL; -static Ecore_Event_Handler *handler_status = NULL; +Eina_List *drops = NULL; +Evas_Object *dragwin; +int _dragx, _dragy; +Ecore_Event_Handler *handler_pos, *handler_drop, *handler_enter, + *handler_status; + +struct dropable *cur; + #endif @@ -421,15 +351,16 @@ static Ecore_Event_Handler *handler_status = NULL; static const char *text_uri; Eina_Bool -elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format format, const char *selbuf) +elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, + Elm_Sel_Format format, const char *selbuf) { #ifdef HAVE_ELEMENTARY_X - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; if ((unsigned int)selection >= (unsigned int)ELM_SEL_MAX) return EINA_FALSE; if (!_elm_cnp_init_count) _elm_cnp_init(); if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE)) - return elm_selection_clear(selection, widget); + return elm_selection_clear(selection, widget); sel = selections + selection; @@ -450,7 +381,7 @@ Eina_Bool elm_selection_clear(Elm_Sel_Type selection, Evas_Object *widget) { #ifdef HAVE_ELEMENTARY_X - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; if ((unsigned int)selection >= (unsigned int)ELM_SEL_MAX) return EINA_FALSE; if (!_elm_cnp_init_count) _elm_cnp_init(); @@ -476,7 +407,7 @@ elm_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format, { #ifdef HAVE_ELEMENTARY_X Evas_Object *top; - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; if ((unsigned int)selection >= (unsigned int)ELM_SEL_MAX) return EINA_FALSE; if (!_elm_cnp_init_count) _elm_cnp_init(); @@ -500,38 +431,36 @@ elm_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format, #ifdef HAVE_ELEMENTARY_X static Eina_Bool -_elm_cnp_init(void) -{ +_elm_cnp_init(void){ int i; - - if (_elm_cnp_init_count++) return EINA_TRUE; - for (i = 0; i < CNP_N_ATOMS; i++) + if (_elm_cnp_init_count ++) return EINA_TRUE; + + for (i = 0 ; i < CNP_N_ATOMS ; i ++) { atoms[i].atom = ecore_x_atom_get(atoms[i].name); ecore_x_selection_converter_atom_add(atoms[i].atom, - atoms[i].converter); + atoms[i].converter); } clipboard_atom = ecore_x_atom_get("CLIPBOARD"); - ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, selection_clear, NULL); - ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, selection_notify, NULL); - + ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, selection_clear,NULL); + ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,selection_notify,NULL); + text_uri = eina_stringshare_add("text/uri-list"); return EINA_TRUE; } static Eina_Bool -selection_clear(void *udata __UNUSED__, int type __UNUSED__, void *event) -{ +selection_clear(void *udata __UNUSED__, int type __UNUSED__, void *event){ Ecore_X_Event_Selection_Clear *ev = event; - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; int i; - - for (i = 0; i < ELM_SEL_MAX; i++) + + for (i = 0 ; i < ELM_SEL_MAX ; i ++) { if (selections[i].ecore_sel == ev->selection) break; } - cnp_debug("selection %d clear\n", i); + cnp_debug("selection %d clear\n",i); /* Not me... Don't care */ if (i == ELM_SEL_MAX) return ECORE_CALLBACK_PASS_ON; @@ -551,45 +480,40 @@ selection_clear(void *udata __UNUSED__, int type __UNUSED__, void *event) * else it's the data we want. */ static Eina_Bool -selection_notify(void *udata __UNUSED__, int type __UNUSED__, void *event) -{ +selection_notify(void *udata __UNUSED__, int type __UNUSED__, void *event){ Ecore_X_Event_Selection_Notify *ev = event; - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; int i; - + cnp_debug("selection notify callback: %d\n",ev->selection); - switch (ev->selection) - { + switch (ev->selection){ case ECORE_X_SELECTION_CLIPBOARD: - sel = selections + ELM_SEL_CLIPBOARD; - break; + sel = selections + ELM_SEL_CLIPBOARD; + break; case ECORE_X_SELECTION_PRIMARY: - sel = selections + ELM_SEL_PRIMARY; - break; + sel = selections + ELM_SEL_PRIMARY; + break; case ECORE_X_SELECTION_SECONDARY: - sel = selections + ELM_SEL_SECONDARY; - break; + sel = selections + ELM_SEL_SECONDARY; + break; case ECORE_X_SELECTION_XDND: - sel = selections + ELM_SEL_XDND; - break; + sel = selections + ELM_SEL_XDND; + break; default: - return ECORE_CALLBACK_PASS_ON; - } - cnp_debug("Target is %s\n", ev->target); - - for (i = 0; i < CNP_N_ATOMS; i++) + return ECORE_CALLBACK_PASS_ON; + } + cnp_debug("Target is %s\n",ev->target); + + for (i = 0 ; i < CNP_N_ATOMS ; i ++) { if (!strcmp(ev->target, atoms[i].name)) { - if (atoms[i].notify) - { - cnp_debug("Found something: %s\n", atoms[i].name); + if (atoms[i].notify){ + cnp_debug("Found something: %s\n", atoms[i].name); atoms[i].notify(sel, ev); - } - else - { - cnp_debug("Ignored: No handler!\n"); - } + } else { + printf("Ignored: No handler!\n"); + } } } @@ -599,50 +523,54 @@ selection_notify(void *udata __UNUSED__, int type __UNUSED__, void *event) static Eina_Bool -targets_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **data_ret, int *size_ret, Ecore_X_Atom *ttype, int *typesize) -{ +targets_converter(char *target __UNUSED__, void *data, int size __UNUSED__, + void **data_ret, int *size_ret, + Ecore_X_Atom *ttype, int *typesize){ int i,count; Ecore_X_Atom *aret; - Cnp_Selection *sel; - + struct _elm_cnp_selection *sel; + if (!data_ret) return EINA_FALSE; - sel = selections + *((int *)data); + sel = selections + *(int*)data; - for (i = 0, count = 0; i < CNP_N_ATOMS ; i++) - { - if (sel->format & atoms[i].formats) count++; - } + for (i = 0, count = 0 ; i < CNP_N_ATOMS ; i ++) + if (sel->format & atoms[i].formats) + count ++; aret = malloc(sizeof(Ecore_X_Atom) * count); - for (i = 0, count = 0; i < CNP_N_ATOMS; i++) - { - if (sel->format & atoms[i].formats) aret[count ++] = atoms[i].atom; - } + for (i = 0, count = 0 ; i < CNP_N_ATOMS ; i ++) + if (sel->format & atoms[i].formats) + aret[count ++] = atoms[i].atom; *data_ret = aret; if (typesize) *typesize = 32 /* urk */; - if (ttype) *ttype = ECORE_X_ATOM_ATOM; + if (ttype) *ttype = XA_ATOM; if (size_ret) *size_ret = count; return EINA_TRUE; } static Eina_Bool -image_converter(char *target __UNUSED__, void *data __UNUSED__, int size __UNUSED__, void **data_ret __UNUSED__, int *size_ret __UNUSED__, Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) +png_converter(char *target __UNUSED__, void *data __UNUSED__, + int size __UNUSED__, void **data_ret __UNUSED__, + int *size_ret __UNUSED__, Ecore_X_Atom *ttype __UNUSED__, + int *typesize __UNUSED__) { - cnp_debug("Image converter called\n"); + cnp_debug("Png converter called\n"); return EINA_TRUE; } static Eina_Bool -vcard_send(char *target __UNUSED__, void *data __UNUSED__, int size __UNUSED__, void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) +vcard_send(char *target __UNUSED__, void *data __UNUSED__, int size __UNUSED__, + void **data_ret, int *size_ret, + Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) { - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; + + cnp_debug("vcard send called\n"); - cnp_debug("Vcard send called\n"); - - sel = selections + *((int *)data); + sel = selections + *(int*)data; if (data_ret) *data_ret = strdup(sel->selbuf); if (size_ret) *size_ret = strlen(sel->selbuf); @@ -654,20 +582,21 @@ vcard_send(char *target __UNUSED__, void *data __UNUSED__, int size __UNUSED__, * So pick the format we'd like; and then request it. */ static int -notify_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) +notify_handler_targets(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify) { Ecore_X_Selection_Data_Targets *targets; Ecore_X_Atom *atomlist; - int i, j; - + int i,j; + targets = notify->data; atomlist = (Ecore_X_Atom *)(targets->data.data); - for (j = 1; j < CNP_N_ATOMS; j++) + for (j = 1; j < CNP_N_ATOMS ; j ++) { - cnp_debug("\t%s %d\n", atoms[j].name, atoms[j].atom); + cnp_debug("\t%s %d\n",atoms[j].name, atoms[j].atom); if (!(atoms[j].formats & sel->requestformat)) continue; - for (i = 0; i < targets->data.length; i++) + for (i = 0 ; i < targets->data.length ; i ++) { if ((atoms[j].atom == atomlist[i]) && (atoms[j].notify)) { @@ -688,7 +617,8 @@ notify_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notif } static int -response_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) +response_handler_targets(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify) { Ecore_X_Selection_Data_Targets *targets; Ecore_X_Atom *atomlist; @@ -704,40 +634,41 @@ response_handler_targets(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *not if (!(atoms[j].formats & sel->requestformat)) continue; for (i = 0 ; i < targets->data.length ; i ++) { - if ((atoms[j].atom == atomlist[i]) && (atoms[j].response)) - { + if ((atoms[j].atom == atomlist[i]) && (atoms[j].response)){ /* Found a match: Use it */ goto found; - } - } + } + } } -found: + found: if (j == CNP_N_ATOMS) { cnp_debug("No matching type found\n"); return 0; } - + top = elm_widget_top_get(sel->requestwidget); if (!top) return 0; - + sel->request(elm_win_xwindow_get(top), atoms[j].name); return 0; } static int -notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) +notify_handler_text(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify) { Ecore_X_Selection_Data *data; char *str; - + data = notify->data; - cnp_debug("Notify handler text %d %d %p\n", data->format,data->length, data->data); - str = mark_up((char *)data->data, data->length, NULL); - cnp_debug("String is %s (from %s)\n", str, data->data); + cnp_debug("Notify handler text %d %d %p\n",data->format,data->length,data->data); + str = mark_up((char*)data->data, data->length, NULL); + cnp_debug("String is %s (from %s)\n",str,data->data); elm_entry_entry_insert(sel->requestwidget, str); free(str); + return 0; } @@ -746,15 +677,16 @@ notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) * So someone is pasting an image into my entry or widget... */ static int -notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) +notify_handler_uri(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify) { Ecore_X_Selection_Data *data; Ecore_X_Selection_Data_Files *files; - Paste_Image *pi; - char *p, *pp, *ext; + struct pasteimage *pi; + char *p; data = notify->data; - cnp_debug("data->format is %d %p %p\n", data->format, notify, data); + printf("data->format is %d %p %p\n",data->format,notify,data); if (data->content == ECORE_X_SELECTION_CONTENT_FILES) { cnp_debug("got a files list\n"); @@ -767,45 +699,33 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) } p = files->files[0]; } - else p = (char *)data->data; + else + p = (char *)data->data; if (!p) { cnp_debug("Couldn't find a file\n"); return 0; - } + } cnp_debug("Got %s\n",p); if (strncmp(p, "file://", 7)) { /* Try and continue if it looks sane */ if (*p != '/') return 0; } - else p += strlen("file://"); - - ext = p + strlen(p); - if (ext) + else + p += strlen("file://"); + + if ((!strcasestr(p,".png")) && (!strcasestr(p,".jpg")) && (!strcasestr(p,".bmp"))) { - Eina_Bool extok = EINA_FALSE; - int i; - - for (i = 0; image_extensions[i]; i++) - { - pp = ext - strlen(image_extensions[i]); - if ((pp >= p) && (!strcasecmp(pp, image_extensions[i]))) - { - extok = EINA_TRUE; - break; - } - } - if (!extok) - { - cnp_debug("No known image format extension, ignoring\n"); - if (savedtypes.textreq) savedtypes.textreq = 0; - return 0; - } + cnp_debug("No image(png, jpg and bmp), ignoring\n"); + if (savedtypes.textreq) savedtypes.textreq = 0; + return 0; } if (savedtypes.pi) pasteimage_free(savedtypes.pi); + pi = pasteimage_alloc(p, data->length); + if (savedtypes.textreq) { savedtypes.textreq = 0; @@ -816,6 +736,7 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) pasteimage_append(pi, sel->requestwidget); savedtypes.pi = NULL; } + return 0; } @@ -823,31 +744,30 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) * Just receieved an vcard, either through cut and paste, or dnd. */ static int -vcard_receive(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) +vcard_receive(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify) { - Dropable *dropable; + struct dropable *dropable; Eina_List *l; Ecore_X_Selection_Data *data; data = notify->data; cnp_debug("vcard receive\n"); - if (sel == (selections + ELM_SEL_XDND)) + if (sel == selections + ELM_SEL_XDND) { Elm_Selection_Data ddata; - cnp_debug("drag & drop\n"); /* FIXME: this needs to be generic: Used for all receives */ EINA_LIST_FOREACH(drops, l, dropable) - { - if (dropable->obj == sel->requestwidget) break; - } + if (dropable->obj == sel->requestwidget) + break; if (!dropable) { cnp_debug("Unable to find drop object"); ecore_x_dnd_send_finished(); return 0; - } + } dropable = eina_list_data_get(l); ddata.x = savedtypes.x; ddata.y = savedtypes.y; @@ -869,29 +789,29 @@ vcard_receive(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) else { cnp_debug("Paste request\n"); - } - + } + return 0; } static int -notify_handler_image(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) +notify_handler_png(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify) { Ecore_X_Selection_Data *data; - Tmp_Info *tmp; - Paste_Image *pi; - + struct tmpinfo *tmp; + struct pasteimage *pi; + cnp_debug("got a png (or a jpeg)!\n"); data = notify->data; - - cnp_debug("Size if %d\n", data->length); + + cnp_debug("Size if %d\n",data->length); if (sel->datacb) { - Elm_Selection_Data ddata; - + Elm_Selection_Data ddata; ddata.x = ddata.y = 0; ddata.format = ELM_SEL_FORMAT_IMAGE; ddata.data = data->data; @@ -899,17 +819,22 @@ notify_handler_image(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) sel->datacb(sel->udata, sel->widget, &ddata); return 0; } - + + /* generate tmp name */ tmp = elm_cnp_tempfile_create(data->length); + memcpy(tmp->map, data->data, data->length); + munmap(tmp->map,data->length); - + /* FIXME: Add to paste image data to clean up */ + pi = pasteimage_alloc(tmp->filename, data->length); pasteimage_append(pi, sel->requestwidget); tmpinfo_free(tmp); + return 0; } @@ -920,13 +845,13 @@ notify_handler_image(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) * chrome sends utf8... blerg */ static int -notify_handler_html(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) -{ +notify_handler_html(struct _elm_cnp_selection *sel, + Ecore_X_Event_Selection_Notify *notify){ Ecore_X_Selection_Data *data; - + cnp_debug("Got some HTML: Checking encoding is useful\n"); data = notify->data; - + if (sel->datacb) { Elm_Selection_Data ddata; @@ -939,27 +864,30 @@ notify_handler_html(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify) } char *stripstr = NULL; - stripstr = malloc(sizeof(char) * (data->length + 1)); - strncpy(stripstr, (char *)data->data, data->length); + stripstr = malloc(sizeof(char)*(data->length+1)); + strncpy(stripstr, data->data, data->length); stripstr[data->length] = '\0'; - cnp_debug("String is %s (%d bytes)\n", stripstr, data->length); + cnp_debug("String is %s (%d bytes)\n",stripstr,data->length); elm_entry_entry_insert(sel->requestwidget, stripstr); free(stripstr); + return 0; } static Eina_Bool -text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) +text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, + void **data_ret, int *size_ret, + Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) { - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; cnp_debug("text converter\n"); - sel = selections + *((int *)data); + sel = selections + *(int *)data; if (!sel->active) return EINA_TRUE; - - if ((sel->format == ELM_SEL_FORMAT_MARKUP) || - (sel->format == ELM_SEL_FORMAT_HTML)) + + if (sel->format == ELM_SEL_FORMAT_MARKUP || + sel->format == ELM_SEL_FORMAT_HTML) { *data_ret = remove_tags(sel->selbuf, size_ret); } @@ -970,8 +898,8 @@ text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void ** } else if (sel->format == ELM_SEL_FORMAT_IMAGE) { - cnp_debug("Image %s\n", evas_object_type_get(sel->widget)); - cnp_debug("Elm type: %s\n", elm_object_widget_type_get(sel->widget)); + cnp_debug("Image %s\n",evas_object_type_get(sel->widget)); + cnp_debug("Elm type: %s\n",elm_object_widget_type_get(sel->widget)); evas_object_image_file_get(elm_photocam_internal_image_get(sel->widget), (const char **)data_ret, NULL); if (!*data_ret) *data_ret = strdup("No file"); else *data_ret = strdup(*data_ret); @@ -981,11 +909,13 @@ text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void ** } static Eina_Bool -edje_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) +edje_converter(char *target __UNUSED__, void *data, int size __UNUSED__, + void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, + int *typesize __UNUSED__) { - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; - sel = selections + *((int *)data); + sel = selections + *(int *)data; if (data_ret) *data_ret = strdup(sel->selbuf); if (size_ret) *size_ret = strlen(sel->selbuf); @@ -994,9 +924,11 @@ edje_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void ** static Eina_Bool -html_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) +html_converter(char *target __UNUSED__, void *data, int size __UNUSED__, + void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, + int *typesize __UNUSED__) { - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; sel = selections + *(int *)data; if (data_ret) *data_ret = strdup(sel->selbuf); @@ -1006,16 +938,19 @@ html_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void ** } static Eina_Bool -uri_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, int *typesize __UNUSED__) +uri_converter(char *target __UNUSED__, void *data, int size __UNUSED__, + void **data_ret, int *size_ret, Ecore_X_Atom *ttype __UNUSED__, + int *typesize __UNUSED__) { - Cnp_Selection *sel; - sel = selections + *((int *)data); + struct _elm_cnp_selection *sel; + sel = selections + *(int *)data; cnp_debug("Uri converter\n"); if (data_ret) *data_ret = strdup(sel->selbuf); if (size_ret) *size_ret = strlen(sel->selbuf); return EINA_TRUE; } + /* * Image paste provide */ @@ -1025,65 +960,65 @@ uri_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **d static Evas_Object * image_provider(void *images __UNUSED__, Evas_Object *entry, const char *item) { - Paste_Image *pi; + struct pasteimage *pi; Eina_List *l; - cnp_debug("image provider for %s called\n", item); + cnp_debug("image provider for %s called\n",item); EINA_LIST_FOREACH(pastedimages, l, pi) { cnp_debug("is it %s?\n",pi->tag); - if (!strcmp(pi->tag, item)) - { + if (!strcmp(pi->tag, item)){ /* Found it */ Evas_Object *o; o = evas_object_image_filled_add(evas_object_evas_get(entry)); /* FIXME: Handle eets */ - cnp_debug("file is %s (object is %p)\n", pi->file, o); + cnp_debug("file is %s (object is %p)\n",pi->file,o); evas_object_image_file_set(o, pi->file, NULL); evas_object_show(o); return o; - } + } } return NULL; } -static Paste_Image * +static struct pasteimage * pasteimage_alloc(const char *file, int pathlen) { - Paste_Image *pi; + struct pasteimage *pi; int len; char *buf, *filebuf; int prefixlen = strlen("file://"); - pi = calloc(1, sizeof(Paste_Image)); + pi = calloc(1,sizeof(struct pasteimage)); if (!pi) return NULL; - - len = snprintf(NULL, 0, "pasteimage-%p", pi); - len++; + + len = snprintf(NULL, 0, "pasteimage-%p",pi); + len ++; buf = malloc(len); if (!buf) { free(pi); return NULL; } - snprintf(buf, len, "pasteimage-%p", pi); + snprintf(buf, len, "pasteimage-%p",pi); pi->tag = buf; - + if (file) { if (strstr(file,"file://")) file += prefixlen; - filebuf = alloca(sizeof(char) * (pathlen - prefixlen + 1)); - strncpy(filebuf, file, pathlen - prefixlen); - filebuf[pathlen-prefixlen] = '\0'; + filebuf = malloc(sizeof(char)*(pathlen-prefixlen+1)); + strncpy(filebuf, file, pathlen-prefixlen); + filebuf[pathlen-prefixlen] = '\0'; pi->file = strdup(filebuf); + free(filebuf); } return pi; } static void -pasteimage_free(Paste_Image *pi) +pasteimage_free(struct pasteimage *pi) { if (!pi) return; if (pi->file) free((void*)pi->file); @@ -1091,17 +1026,16 @@ pasteimage_free(Paste_Image *pi) free(pi); } -static Eina_Bool +static bool pasteimage_provider_set(Evas_Object *entry) { void *v; const char *type; - - if (!entry) return EINA_FALSE; + if (!entry) return false; type = elm_widget_type_get(entry); - cnp_debug("type is %s\n", type); - if ((!type) || (strcmp(type, "entry"))) return EINA_FALSE; - + printf("type is %s\n",type); + if ((!type) || (strcmp(type, "entry"))) return false; + v = evas_object_data_get(entry, PROVIDER_SET); if (!v) { @@ -1110,80 +1044,75 @@ pasteimage_provider_set(Evas_Object *entry) evas_object_event_callback_add(entry, EVAS_CALLBACK_FREE, entry_deleted, NULL); } - return EINA_TRUE; + return true; } -static Eina_Bool -pasteimage_append(Paste_Image *pi, Evas_Object *entry) +static bool +pasteimage_append(struct pasteimage *pi, Evas_Object *entry) { - char *entrytag; - char *tagstring = ""; - - if (!pi) return EINA_FALSE; - if (!entry) return EINA_FALSE; + char entrytag[100]; + + if (!pi) return false; + if (!entry) return false; pasteimage_provider_set(entry); pastedimages = eina_list_append(pastedimages, pi); - entrytag = alloca(sizeof(char)*(strlen(tagstring)+strlen(pi->file)+1)); - snprintf(entrytag, (strlen(tagstring)+strlen(pi->file)), tagstring, pi->file); + snprintf(entrytag, sizeof(entrytag),"",pi->tag); elm_entry_entry_insert(entry, entrytag); - return EINA_TRUE; + return true; } static void entry_deleted(void *images __UNUSED__, Evas *e __UNUSED__, Evas_Object *entry, void *unused __UNUSED__) { - Paste_Image *pi; + struct pasteimage *pi; Eina_List *l,*next; EINA_LIST_FOREACH_SAFE(pastedimages, l, next, pi) { - if (pi->entry == entry) - pastedimages = eina_list_remove_list(pastedimages, l); + if (pi->entry == entry){ + pastedimages = eina_list_remove_list(pastedimages, l); + } } } static char * -remove_tags(const char *p, int *len) -{ +remove_tags(const char *p, int *len){ char *q,*ret; int i; if (!p) return NULL; - + q = malloc(strlen(p) + 1); if (!q) return NULL; ret = q; while (*p) { - if ((*p != '<') && (*p != '&')) *q++ = *p++; - else if (*p == '<') - { + if ((*p != '<') && (*p != '&')){ + *q ++ = *p ++; + } else if (*p == '<') { if ((p[1] == 'b') && (p[2] == 'r') && - ((p[3] == ' ') || (p[3] == '/') || (p[3] == '>'))) + ((p[3] == ' ') || (p[3] == '/') || (p[3] == '>'))) *q++ = '\n'; - while ((*p) && (*p != '>')) p++; - p++; - } - else if (*p == '&') - { - p++; - for (i = 0 ; i < N_ESCAPES ; i++) - { - if (!strncmp(p,escapes[i].escape, strlen(escapes[i].escape))) - { - p += strlen(escapes[i].escape); + while ((*p) && (*p != '>')) p ++; + p ++; + } else if (*p == '&') { + p ++; + for (i = 0 ; i < N_ESCAPES ; i ++){ + if (!strncmp(p,escapes[i].escape, strlen(escapes[i].escape))){ + p += strlen(escapes[i].escape); *q = escapes[i].value; - q++; + q ++; break; - } - } - if (i == N_ESCAPES) *q ++= '&'; - } + } + } + if (i == N_ESCAPES) + *q ++ = '&'; + } } *q = 0; if (len) *len = q - ret; @@ -1192,50 +1121,52 @@ remove_tags(const char *p, int *len) /* Mark up */ static char * -mark_up(const char *start, int inlen, int *lenp) -{ - int l, i; - const char *p; - char *q, *ret; - const char *endp = NULL; - - if (!start) return NULL; - if (inlen >= 0) endp = start + inlen; - /* First pass: Count characters */ - for (l = 0, p = start; ((!endp) || (p < endp)) && (*p); p++) - { - for (i = 0 ; i < N_ESCAPES ; i ++) - { - if (*p == escapes[i].value) - { - l += strlen(escapes[i].escape); - break; - } - } - if (i == N_ESCAPES) l++; - } - - q = ret = malloc(l + 1); - - /* Second pass: Change characters */ - for (p = start; *p; ) +mark_up(const char *start, int inlen, int *lenp){ + int l,i; + const char *p; + char *q,*ret; + const char *endp = NULL; + + if (!start) return NULL; + if (inlen >= 0) + endp = start + inlen; + /* First pass: Count characters */ + for (l = 0, p = start ; ((!endp) || (p < endp)) && (*p) ; p ++) { - for (i = 0; i < N_ESCAPES; i++) - { - if (*p == escapes[i].value) - { - strcpy(q, escapes[i].escape); - q += strlen(escapes[i].escape); - p ++; - break; - } - } - if (i == N_ESCAPES) *q++ = *p++; - } - *q = 0; - - if (lenp) *lenp = l; - return ret; + for (i = 0 ; i < N_ESCAPES ; i ++) + { + if (*p == escapes[i].value) + { + l += strlen(escapes[i].escape); + break; + } + } + if (i == N_ESCAPES) + l ++; + } + + q = ret = malloc(l + 1); + + /* Second pass: Change characters */ + for (p = start ; *p ; ) + { + for (i = 0 ; i < N_ESCAPES ; i ++) + { + if (*p == escapes[i].value) + { + strcpy(q, escapes[i].escape); + q += strlen(escapes[i].escape); + p ++; + break; + } + } + if (i == N_ESCAPES) + *q ++ = *p ++; + } + *q = 0; + + if (lenp) *lenp = l; + return ret; } @@ -1252,12 +1183,13 @@ _dnd_enter(void *data __UNUSED__, int etype __UNUSED__, void *ev) savedtypes.ntypes = enter->num_types; if (savedtypes.types) free(savedtypes.types); savedtypes.types = malloc(sizeof(char *) * enter->num_types); - if (!savedtypes.types) return EINA_FALSE; - - for (i = 0; i < enter->num_types; i++) + if (!savedtypes.types) + return EINA_FALSE; + + for (i = 0 ; i < enter->num_types ; i ++) { savedtypes.types[i] = eina_stringshare_add(enter->types[i]); - cnp_debug("Type is %s %p %p\n", enter->types[i], + cnp_debug("Type is %s %p %p\n",enter->types[i], savedtypes.types[i],text_uri); if (savedtypes.types[i] == text_uri) { @@ -1270,6 +1202,7 @@ _dnd_enter(void *data __UNUSED__, int etype __UNUSED__, void *ev) } /* FIXME: Find an object and make it current */ + return EINA_TRUE; } @@ -1277,42 +1210,46 @@ static Eina_Bool _dnd_drop(void *data __UNUSED__, int etype __UNUSED__, void *ev) { struct _Ecore_X_Event_Xdnd_Drop *drop; - Dropable *dropable; + struct dropable *dropable; Eina_List *l; Ecore_Evas *ee; Ecore_X_Window xwin; Elm_Selection_Data ddata; - int x, y, w, h; - int i, j; + int x,y,w,h; + + int i,j; drop = ev; // check we still have something to drop - if (!drops) return EINA_TRUE; + if (!drops) return true; /* Find any widget in our window; then work out geometry rel to our window */ - for (l = drops; l; l = l->next) + for (l = drops ; l ; l = l->next) { dropable = l->data; - xwin = (Ecore_X_Window)ecore_evas_window_get - (ecore_evas_ecore_evas_get(evas_object_evas_get - (dropable->obj))); - if (xwin == drop->win) break; + xwin = (Ecore_X_Window)ecore_evas_window_get(ecore_evas_ecore_evas_get( + evas_object_evas_get( + dropable->obj))); + if (xwin == drop->win) + break; } /* didn't find a window */ - if (!l) return EINA_TRUE; + if (!l) + return true; + /* Calculate real (widget relative) position */ - // - window position - // - widget position + // - window position + // - widget position ee = ecore_evas_ecore_evas_get(evas_object_evas_get(dropable->obj)); ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); savedtypes.x = drop->position.x - x; savedtypes.y = drop->position.y - y; - - cnp_debug("Drop position is %d,%d\n", savedtypes.x, savedtypes.y); - for (; l; l = l->next) + cnp_debug("Drop position is %d,%d\n",savedtypes.x,savedtypes.y); + + for ( ; l ; l = l->next) { dropable = l->data; evas_object_geometry_get(dropable->obj, &x, &y, &w, &h); @@ -1320,67 +1257,69 @@ _dnd_drop(void *data __UNUSED__, int etype __UNUSED__, void *ev) (savedtypes.x < x + w) && (savedtypes.y < y + h)) break; /* found! */ } - - if (!l) return EINA_TRUE; /* didn't find one */ - + + if (!l) /* didn't find one */ + return true; + evas_object_geometry_get(dropable->obj, &x, &y, NULL, NULL); savedtypes.x -= x; savedtypes.y -= y; - + /* Find our type from the previous list */ - for (i = 0; i < CNP_N_ATOMS; i++) + for (i = 0 ; i < CNP_N_ATOMS ; i ++) { - for (j = 0; j < savedtypes.ntypes; j++) + for (j = 0 ; j < savedtypes.ntypes ; j ++) { - if (!strcmp(savedtypes.types[j], atoms[i].name)) goto found; + if (!strcmp(savedtypes.types[j], atoms[i].name)) + { + goto found; + } } } - + cnp_debug("Didn't find a target\n"); - return EINA_TRUE; - + return true; + found: - cnp_debug("Found a target we'd like: %s\n", atoms[i].name); - cnp_debug("0x%x\n",xwin); - + printf("Found a target we'd like: %s\n",atoms[i].name); + cnp_debug("0x%x\n",xwin); + if (i == CNP_ATOM_text_urilist) { - cnp_debug("We found a URI... (%scached)\n", savedtypes.pi ? "" : "not "); + cnp_debug("We found a URI... (%scached)\n",savedtypes.pi?"":"not "); if (savedtypes.pi) { - char *entrytag; - char *tagstring = ""; - + char entrytag[100]; + ddata.x = savedtypes.x; ddata.y = savedtypes.y; if (dropable->types & ELM_SEL_FORMAT_IMAGE) { - cnp_debug("Doing image insert (%s)\n", savedtypes.pi->file); + cnp_debug("Doing image insert (%s)\n",savedtypes.pi->file); ddata.format = ELM_SEL_FORMAT_IMAGE; ddata.data = (char *)savedtypes.pi->file; dropable->dropcb(dropable->cbdata, dropable->obj, &ddata); ecore_x_dnd_send_finished(); - + pasteimage_free(savedtypes.pi); savedtypes.pi = NULL; - - return EINA_TRUE; + + return true; } else if (dropable->types & ELM_SEL_FORMAT_MARKUP) { ddata.format = ELM_SEL_FORMAT_MARKUP; pasteimage_provider_set(dropable->obj); - + pastedimages = eina_list_append(pastedimages, savedtypes.pi); - entrytag = alloca(sizeof(char)*(strlen(tagstring)+strlen(savedtypes.pi->file)+1)); - snprintf(entrytag, (strlen(tagstring)+strlen(savedtypes.pi->file)), - tagstring, savedtypes.pi->file); + snprintf(entrytag, sizeof(entrytag), + "",savedtypes.pi->tag); ddata.data = entrytag; - cnp_debug("Insert %s\n", (char *)ddata.data); + cnp_debug("Insert %s\n",(char *)ddata.data); dropable->dropcb(dropable->cbdata, dropable->obj, &ddata); ecore_x_dnd_send_finished(); - return EINA_TRUE; + return true; } } else if (savedtypes.textreq) @@ -1389,27 +1328,27 @@ found: * it comes in */ savedtypes.textreq = 0; ecore_x_dnd_send_finished(); - return EINA_TRUE; + return true; } } cnp_debug("doing a request then\n"); selections[ELM_SEL_XDND].requestwidget = dropable->obj; selections[ELM_SEL_XDND].requestformat = ELM_SEL_FORMAT_MARKUP; - selections[ELM_SEL_XDND].active = EINA_TRUE; + selections[ELM_SEL_XDND].active = true; ecore_x_selection_xdnd_request(xwin, atoms[i].name); - return EINA_TRUE; + return true; } static Eina_Bool _dnd_position(void *data __UNUSED__, int etype __UNUSED__, void *ev) { struct _Ecore_X_Event_Xdnd_Position *pos; Ecore_X_Rectangle rect; - + pos = ev; - + /* Need to send a status back */ /* FIXME: Should check I can drop here */ /* FIXME: Should highlight widget */ @@ -1417,9 +1356,9 @@ _dnd_position(void *data __UNUSED__, int etype __UNUSED__, void *ev) rect.y = pos->position.y - 5; rect.width = 10; rect.height = 10; - ecore_x_dnd_send_status(EINA_TRUE, EINA_FALSE, rect, pos->action); + ecore_x_dnd_send_status(true, false, rect, pos->action); - return EINA_TRUE; + return true; } /** @@ -1432,88 +1371,88 @@ _dnd_status(void *data __UNUSED__, int etype __UNUSED__, void *ev) { struct _Ecore_X_Event_Xdnd_Status *status = ev; - if (!status) return EINA_TRUE; - + if (!status) return true; + /* Only thing we care about: will accept */ if (status->will_accept) { - cnp_debug("Will accept\n"); + printf("Will accept\n"); } else { /* Won't accept */ - cnp_debug("Won't accept accept\n"); + printf("Won't accept accept\n"); } - return EINA_TRUE; + return true; } /** * Add a widget as drop target. */ Eina_Bool -elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, Elm_Drop_Cb dropcb, void *cbdata) +elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, + Elm_Drop_Cb dropcb, void *cbdata) { - Dropable *drop; + struct dropable *drop; Ecore_X_Window xwin; int first; - - if (!obj) return EINA_FALSE; + + if (!obj) return false; if (!_elm_cnp_init_count) _elm_cnp_init(); - + /* Is this the first? */ first = (!drops) ? 1 : 0; - - drop = calloc(1, sizeof(Dropable)); - if (!drop) return EINA_FALSE; + + drop = calloc(1,sizeof(struct dropable)); + if (!drop) return false; drop->dropcb = dropcb; drop->cbdata = cbdata; - + /* FIXME: Check it's not already there */ - + /* FIXME: Check for eina's deranged error method */ drops = eina_list_append(drops, drop); - + if (!drops/* || or other error */) { free(drop); - return EINA_FALSE; + return false; } - + drop->obj = obj; /* Something for now */ drop->types = format; - + evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, /* I love C and varargs */ (Evas_Object_Event_Cb)elm_drop_target_del, obj); /* FIXME: Handle resizes */ - + /* If not the first: We're done */ - if (!first) return EINA_TRUE; - - xwin = (Ecore_X_Window)ecore_evas_window_get - (ecore_evas_ecore_evas_get(evas_object_evas_get(obj))); - - ecore_x_dnd_aware_set(xwin, EINA_TRUE); - - cnp_debug("Adding drop target calls\n"); + if (!first) return true; + + xwin = (Ecore_X_Window)ecore_evas_window_get(ecore_evas_ecore_evas_get( + evas_object_evas_get(obj))); + ecore_x_dnd_aware_set(xwin, true); + + printf("Adding drop target calls\n"); handler_enter = ecore_event_handler_add(ECORE_X_EVENT_XDND_ENTER, _dnd_enter, NULL); handler_pos = ecore_event_handler_add(ECORE_X_EVENT_XDND_POSITION, _dnd_position, NULL); handler_drop = ecore_event_handler_add(ECORE_X_EVENT_XDND_DROP, _dnd_drop, NULL); - - return EINA_TRUE; + + return true; } Eina_Bool elm_drop_target_del(Evas_Object *obj) { - Dropable *drop,*del; + struct dropable *drop,*del; Eina_List *item; Ecore_X_Window xwin; - + del = NULL; EINA_LIST_FOREACH(drops, item, drop) { @@ -1524,30 +1463,30 @@ elm_drop_target_del(Evas_Object *obj) break; } } - if (!del) return EINA_FALSE; - + if (!del) return false; + evas_object_event_callback_del(obj, EVAS_CALLBACK_FREE, (Evas_Object_Event_Cb)elm_drop_target_del); free(drop); /* If still drops there: All fine.. continue */ - if (drops) return EINA_TRUE; - + if (drops) return true; + cnp_debug("Disabling DND\n"); - xwin = (Ecore_X_Window)ecore_evas_window_get - (ecore_evas_ecore_evas_get(evas_object_evas_get(obj))); - ecore_x_dnd_aware_set(xwin, EINA_FALSE); - + xwin = (Ecore_X_Window)ecore_evas_window_get(ecore_evas_ecore_evas_get( + evas_object_evas_get(obj))); + ecore_x_dnd_aware_set(xwin, false); + ecore_event_handler_del(handler_pos); ecore_event_handler_del(handler_drop); ecore_event_handler_del(handler_enter); - + if (savedtypes.pi) { pasteimage_free(savedtypes.pi); savedtypes.pi = NULL; } - - return EINA_TRUE; + + return true; } @@ -1566,30 +1505,30 @@ _drag_mouse_up(void *un __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void * evas_object_del(dragwin); dragwin = NULL; } + } static void -_drag_move(void *data __UNUSED__, Ecore_X_Xdnd_Position *pos) -{ - evas_object_move(dragwin, - pos->position.x - _dragx, +_drag_move(void *data __UNUSED__, Ecore_X_Xdnd_Position *pos){ + evas_object_move(dragwin, pos->position.x - _dragx, pos->position.y - _dragy); } Eina_Bool -elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (*dragdone) (void *data, Evas_Object *), void *donecbdata) +elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, + void (*dragdone)(void *data, Evas_Object *),void *donecbdata) { Ecore_X_Window xwin; - Cnp_Selection *sel; + struct _elm_cnp_selection *sel; Elm_Sel_Type xdnd = ELM_SEL_XDND; Ecore_Evas *ee; - int x, y, x2, y2, x3, y3; + int x,y,x2,y2,x3,y3; Evas_Object *icon; - int w, h; - + int w,h; + if (!_elm_cnp_init_count) _elm_cnp_init(); - + xwin = elm_win_xwindow_get(obj); cnp_debug("starting drag...\n"); @@ -1602,23 +1541,23 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void ( sel->selbuf = data ? strdup(data) : NULL; dragdonecb = dragdone; dragdonedata = donecbdata; - + ecore_x_dnd_callback_pos_update_set(_drag_move, NULL); ecore_x_dnd_begin(xwin, (unsigned char *)&xdnd, sizeof(Elm_Sel_Type)); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP, _drag_mouse_up, NULL); - + handler_status = ecore_event_handler_add(ECORE_X_EVENT_XDND_STATUS, _dnd_status, NULL); - - dragwin = elm_win_add(NULL, "Elm Drag Object", ELM_WIN_UTILITY); - elm_win_override_set(dragwin, 1); - + + dragwin = elm_win_add(NULL, "Elm Drag Object",ELM_WIN_UTILITY); + elm_win_override_set(dragwin,1); + /* FIXME: Images only */ icon = elm_icon_add(dragwin); - elm_icon_file_set(icon, data + 7, NULL); /* 7!? "file://" */ + elm_icon_file_set(icon, data + 7, NULL); /* 7!? */ elm_win_resize_object_add(dragwin,icon); - evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND); evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); /* Position subwindow appropriately */ @@ -1628,9 +1567,9 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void ( x += x2; y += y2; evas_object_move(dragwin, x, y); - evas_object_resize(icon, w, h); - evas_object_resize(dragwin, w, h); - + evas_object_resize(icon,w,h); + evas_object_resize(dragwin,w,h); + evas_object_show(icon); evas_object_show(dragwin); @@ -1638,69 +1577,67 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void ( _dragx = x3 - x2; _dragy = y3 - y2; - return EINA_TRUE; + return true; } -static Tmp_Info * -elm_cnp_tempfile_create(int size) -{ - Tmp_Info *info; +static struct tmpinfo * +elm_cnp_tempfile_create(int size){ + struct tmpinfo *info; const char *tmppath; int len; - - info = malloc(sizeof(Tmp_Info)); + + info = malloc(sizeof(struct tmpinfo)); if (!info) return NULL; - + tmppath = getenv("TMP"); if (!tmppath) tmppath = P_tmpdir; if (!tmppath) tmppath = "/tmp"; - len = snprintf(NULL, 0, "%s/%sXXXXXX", tmppath, "elmcnpitem-"); + len = snprintf(NULL,0,"%s/%sXXXXXX",tmppath, "elmcnpitem-"); if (len < 0) { free(info); return NULL; } - len++; + len ++; info->filename = malloc(len); if (!info->filename) { free(info); return NULL; } - snprintf(info->filename,len,"%s/%sXXXXXX", tmppath, "elmcnpitem-"); - + snprintf(info->filename,len,"%s/%sXXXXXX",tmppath, "elmcnpitem-"); + info->fd = mkstemp(info->filename); - -# ifdef __linux__ - { - char *tmp; - /* And before someone says anything see POSIX 1003.1-2008 page 400 */ - long pid; - - pid = (long)getpid(); - /* Use pid instead of /proc/self: That way if can be passed around */ - len = snprintf(NULL,0,"/proc/%li/fd/%i", pid, info->fd); - len++; - tmp = malloc(len); - if (tmp) - { - snprintf(tmp,len, "/proc/%li/fd/%i", pid, info->fd); - unlink(info->filename); - free(info->filename); - info->filename = tmp; - } - } -# endif - - cnp_debug("filename is %s\n", info->filename); + +#ifdef __linux__ + { + char *tmp; + /* And before someone says anything see POSIX 1003.1-2008 page 400 */ + long pid; + pid = (long)getpid(); + /* Use pid instead of /proc/self: That way if can be passed around */ + len = snprintf(NULL,0,"/proc/%ld/fd/%d",pid, info->fd); + len ++; + tmp = malloc(len); + if (tmp) + { + snprintf(tmp,len, "/proc/%ld/fd/%d",pid, info->fd); + unlink(info->filename); + free(info->filename); + info->filename = tmp; + } + } +#endif + + printf("filename is %s\n",info->filename); if (size < 1) { /* Set map to NULL and return */ info->map = NULL; info->len = 0; return info; - } - + } + /* Map it in */ if (ftruncate(info->fd, size)) { @@ -1709,21 +1646,21 @@ elm_cnp_tempfile_create(int size) info->len = 0; return info; } - - info->map = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, info->fd, 0); + + info->map = mmap(NULL,size, PROT_READ|PROT_WRITE, MAP_SHARED, info->fd, 0); if (info->map == MAP_FAILED) { perror("mmap"); info->map = NULL; info->len = 0; } - + return info; } static int -tmpinfo_free(Tmp_Info *info) +tmpinfo_free(struct tmpinfo *info) { if (!info) return 0; free(info->filename); @@ -1734,21 +1671,21 @@ tmpinfo_free(Tmp_Info *info) #else /* Stubs for windows */ Eina_Bool -elm_drag_start(Evas_Object *o, Elm_Sel_Format f, const char *d, void (*donecb)(void *, Evas_Object *),void *cbdata) +elm_drag_start(Evas_Object *o, Elm_Sel_Format f, const char *d, + void (*donecb)(void *, Evas_Object *),void *cbdata) { - return EINA_FALSE; + return false; } - Eina_Bool -elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, Elm_Drop_Cb dropcb, void *cbdata) -{ - return EINA_FALSE; +elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, + Elm_Drop_Cb dropcb, void *cbdata){ + return false; } Eina_Bool elm_drop_target_del(Evas_Object *o) { - return EINA_TRUE; + return true; } #endif diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index e84ddc1..58ee2f3 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -657,7 +657,7 @@ _desc_init(void) ELM_CONFIG_VAL(D, T, inwin_dialogs_enable, T_UCHAR); ELM_CONFIG_VAL(D, T, icon_size, T_INT); ELM_CONFIG_VAL(D, T, longpress_timeout, T_DOUBLE); - ELM_CONFIG_VAL(D, T, password_show_last_character, T_UCHAR); + ELM_CONFIG_VAL(D, T, password_show_last_character, T_INT); #undef T #undef D #undef T_INT @@ -1200,7 +1200,7 @@ _config_load(void) _elm_config->inwin_dialogs_enable = EINA_FALSE; _elm_config->icon_size = 32; _elm_config->longpress_timeout = 1.0; - _elm_config->password_show_last_character = EINA_FALSE; + _elm_config->password_show_last_character = 0; } static const char * @@ -1583,7 +1583,7 @@ _env_get(void) if (s) _elm_config->finger_size = atoi(s); s = getenv("ELM_PASSWORD_SHOW_LAST_CHARACTER"); - if (s) _elm_config->password_show_last_character = !!atoi(s); + if (s) _elm_config->password_show_last_character = atoi(s); s = getenv("ELM_FPS"); if (s) _elm_config->fps = atof(s); @@ -1636,15 +1636,20 @@ _elm_config_init(void) _desc_init(); _profile_fetch_from_conf(); _config_load(); - _env_get(); - _config_apply(); - _elm_config_font_overlay_apply(); - _elm_recache(); +// _env_get(); +// _config_apply(); +// _elm_config_font_overlay_apply(); +// _elm_recache(); } void _elm_config_sub_init(void) { + _env_get(); + _config_apply(); + _elm_config_font_overlay_apply(); + _elm_recache(); + #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name)) if (ENGINE_COMPARE(ELM_SOFTWARE_X11) || ENGINE_COMPARE(ELM_SOFTWARE_16_X11) || diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 2994fff..641fdb8 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -3,14 +3,15 @@ /** * @defgroup Conformant Conformant + * @ingroup Elementary * * The aim is to provide a widget that can be used in elementary apps to - * account for space taken up by the indicator, virtual keypad & softkey windows when running + * account for space taken up by the indicator & softkey windows when running * the illume2 module of E17. */ typedef struct _Widget_Data Widget_Data; -struct _Widget_Data +struct _Widget_Data { Evas_Object *base; Evas_Object *shelf, *panel, *virtualkeypad; @@ -20,61 +21,52 @@ struct _Widget_Data #ifdef HAVE_ELEMENTARY_X Ecore_X_Virtual_Keyboard_State vkb_state; #endif - struct { - Ecore_Animator *animator; // animaton timer - double start; // time started - Evas_Coord auto_x, auto_y; // desired delta - Evas_Coord x, y; // current delta - } delta; -}; - -/* Enum to identify conformant swallow parts */ -typedef enum _Conformant_Part_Type Conformant_Part_Type; -enum _Conformant_Part_Type -{ - ELM_CONFORM_INDICATOR_PART = 1, - ELM_CONFORM_VIRTUAL_KEYPAD_PART = 2, - ELM_CONFORM_SOFTKEY_PART = 4 }; /* local function prototypes */ static const char *widtype = NULL; -static void _del_hook(Evas_Object *obj); -static void _theme_hook(Evas_Object *obj); static void -_swallow_conformant_parts(Evas_Object *obj); +_del_hook(Evas_Object *obj); static void -_conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, int sy, int sh); +_theme_hook(Evas_Object *obj); static void -_conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type); -static void _sizing_eval(Evas_Object *obj); -static Eina_Bool _prop_change(void *data, int type, void *event); +_swallow_conformant_parts(Evas_Object *obj); +static void +_sizing_eval(Evas_Object *obj); +static Eina_Bool +_prop_change(void *data, int type, void *event); /* local functions */ -static void -_del_hook(Evas_Object *obj) +static void +_del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->prop_hdl) ecore_event_handler_del(wd->prop_hdl); + if (wd->shelf) evas_object_del(wd->shelf); + if (wd->virtualkeypad) evas_object_del(wd->virtualkeypad); + if (wd->panel) evas_object_del(wd->panel); free(wd); } -static void -_theme_hook(Evas_Object *obj) +static void +_theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - _elm_theme_object_set(obj, wd->base, "conformant", "base", elm_widget_style_get(obj)); + _elm_theme_object_set(obj, wd->base, "conformant", "base", + elm_widget_style_get(obj)); _swallow_conformant_parts(obj); - if (wd->content) - edje_object_part_swallow(wd->base, "elm.swallow.content", wd->content); - edje_object_scale_set(wd->base, elm_widget_scale_get(obj) * _elm_config->scale); + + if (wd->content) edje_object_part_swallow(wd->base, "elm.swallow.content", + wd->content); + edje_object_scale_set(wd->base, elm_widget_scale_get(obj) + * _elm_config->scale); _sizing_eval(obj); } -static void -_sizing_eval(Evas_Object *obj) +static void +_sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord mw = -1, mh = -1; @@ -85,110 +77,51 @@ _sizing_eval(Evas_Object *obj) } static void -_conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, int sy, int sh) +_swallow_conformant_parts(Evas_Object *obj) { - Evas_Coord cx, cy, cw, ch; - int part_height = 0; - - evas_object_geometry_get(obj, &cx, &cy, &cw, &ch); - if (sy < 0) sy = 0; - if (sh < 0) sh = 0; - if ((ch > 0)&&(sh > 0)) - { - /* Part overlapping with conformant */ - if ((sy > 0) && ((cy + ch) > sy)) - part_height = cy + ch - sy; - else - part_height = sh; - } - else - part_height = 0; - evas_object_size_hint_min_set(sobj, -1, part_height); - evas_object_size_hint_max_set(sobj, -1, part_height); -} + Widget_Data *wd = elm_widget_data_get(obj); -static void -_conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type) -{ + int sh = -1; #ifdef HAVE_ELEMENTARY_X Ecore_X_Window zone, xwin; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; xwin = elm_win_xwindow_get(obj); zone = ecore_x_e_illume_zone_get(xwin); - if (part_type & ELM_CONFORM_INDICATOR_PART) - { - int sy = -1, sh = -1; - - ecore_x_e_illume_indicator_geometry_get(zone, NULL, &sy, NULL, &sh); - _conformant_part_size_set(obj, wd->shelf, sy, sh); - } - if (part_type & ELM_CONFORM_VIRTUAL_KEYPAD_PART) - { - int sy = -1, sh = -1; - - ecore_x_e_illume_keyboard_geometry_get(zone, NULL, &sy, NULL, &sh); - _conformant_part_size_set(obj,wd->virtualkeypad, sy, sh); - } - if (part_type & ELM_CONFORM_SOFTKEY_PART) - { - int sy = -1, sh = -1; - - ecore_x_e_illume_softkey_geometry_get(zone, NULL, &sy, NULL, &sh); - _conformant_part_size_set(obj, wd->panel, sy, sh); - } + ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); #endif -} - -static void -_swallow_conformant_parts(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - - wd->scroller = NULL; + if (sh < 0) sh = 0; if (!wd->shelf) - { - wd->shelf = evas_object_rectangle_add(evas_object_evas_get(obj)); - elm_widget_sub_object_add(obj, wd->shelf); - evas_object_size_hint_min_set(wd->shelf, -1, 0); - evas_object_size_hint_max_set(wd->shelf, -1, 0); - } - else - { - _conformant_part_sizing_eval(obj, ELM_CONFORM_INDICATOR_PART); - } + wd->shelf = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_color_set(wd->shelf, 0, 0, 0, 0); + evas_object_size_hint_min_set(wd->shelf, -1, sh); + evas_object_size_hint_max_set(wd->shelf, -1, sh); edje_object_part_swallow(wd->base, "elm.swallow.shelf", wd->shelf); + wd->scroller = NULL; + sh = -1; +#ifdef HAVE_ELEMENTARY_X + ecore_x_e_illume_keyboard_geometry_get(zone, NULL, NULL, NULL, &sh); +#endif + if (sh < 0) sh = 0; if (!wd->virtualkeypad) - { - wd->virtualkeypad = evas_object_rectangle_add(evas_object_evas_get(obj)); - elm_widget_sub_object_add(obj, wd->virtualkeypad); - evas_object_size_hint_min_set(wd->virtualkeypad, -1, 0); - evas_object_size_hint_max_set(wd->virtualkeypad, -1, 0); - } - else - { - _conformant_part_sizing_eval(obj, ELM_CONFORM_VIRTUAL_KEYPAD_PART); - } + wd->virtualkeypad = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_color_set(wd->virtualkeypad, 0, 0, 0, 0); + evas_object_size_hint_min_set(wd->virtualkeypad, -1, sh); + evas_object_size_hint_max_set(wd->virtualkeypad, -1, sh); edje_object_part_swallow(wd->base, "elm.swallow.virtualkeypad", wd->virtualkeypad); + sh = -1; +#ifdef HAVE_ELEMENTARY_X + ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); +#endif + if (sh < 0) sh = 0; if (!wd->panel) - { - wd->panel = evas_object_rectangle_add(evas_object_evas_get(obj)); - elm_widget_sub_object_add(obj, wd->panel); - evas_object_size_hint_min_set(wd->panel, -1, 0); - evas_object_size_hint_max_set(wd->panel, -1, 0); - } - else - { - _conformant_part_sizing_eval(obj, ELM_CONFORM_SOFTKEY_PART); - } + wd->panel = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_color_set(wd->panel, 0, 0, 0, 0); + evas_object_size_hint_min_set(wd->panel, -1, sh); + evas_object_size_hint_max_set(wd->panel, -1, sh); edje_object_part_swallow(wd->base, "elm.swallow.panel", wd->panel); } @@ -207,77 +140,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) Evas_Object *sub = event_info; if (!wd) return; if (sub == wd->content) - { - evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - wd->content = NULL; - _sizing_eval(obj); - } -} - -/* unused now - but meant to be for making sure the focused widget is always - * visible when the vkbd comes and goes by moving the conformant obj (and thus - * its children) to show the focused widget (and if focus changes follow) - -static Evas_Object * -_focus_object_get(const Evas_Object *obj) -{ - Evas_Object *win, *foc; - - win = elm_widget_top_get(obj); - if (!win) return NULL; - foc = elm_widget_top_get(win); -} - -static void -_focus_object_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) -{ - evas_object_geometry_get(obj, x, y, w, h); -} - -static void -_focus_change_del(void *data, Evas_Object *obj, void *event_info) -{ - // called from toplevel when the focused window shanges -} - -static void -_autoscroll_move(Evas_Object *obj) -{ - // move conformant edje by delta to show focused widget -} - -static void -_autoscroll_mode_enable(Evas_Object *obj) -{ - // called when autoscroll mode should be on - content area smaller than - // its min size - // 1. get focused object - // 2. if not in visible conformant area calculate delta needed to - // get it in - // 3. store delta and call _autoscroll_move() which either asanimates - // or jumps right there -} - -static void -_autoscroll_mode_disable(Evas_Object *obj) -{ - // called when autoscroll mode should be off - set delta to 0 and - // call _autoscroll_move() -} -*/ - -static void -_conformant_move_resize_event_cb(void *data, Evas *e, Evas_Object *obj, - void *event_info) -{ - Conformant_Part_Type part_type; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - part_type = (ELM_CONFORM_INDICATOR_PART | - ELM_CONFORM_VIRTUAL_KEYPAD_PART | - ELM_CONFORM_SOFTKEY_PART); - _conformant_part_sizing_eval(obj, part_type); + { + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + wd->content = NULL; + _sizing_eval(obj); + } } static void @@ -285,12 +153,9 @@ _content_resize_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Object *focus_obj; - Evas_Object *conformant = (Evas_Object *) data; - Widget_Data *wd = elm_widget_data_get(conformant); - if (!wd) return; + Widget_Data *wd = elm_widget_data_get(obj); if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return; - - focus_obj = elm_widget_focused_object_get(conformant); + focus_obj = elm_widget_focused_object_get(obj); if (focus_obj) { Evas_Coord x, y, w, h; @@ -313,8 +178,8 @@ _update_autoscroll_objs(void *data) Evas_Object *conformant = (Evas_Object *) data; Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - sub = elm_widget_focused_object_get(conformant); + //Look up for Top most scroller in the Focus Object hierarchy inside Conformant. while (sub) { @@ -328,63 +193,98 @@ _update_autoscroll_objs(void *data) //If the scroller got changed by app, replace it. if (top_scroller != wd->scroller) - { - if (wd->scroller) evas_object_event_callback_del(wd->scroller, - EVAS_CALLBACK_RESIZE, - _content_resize_event_cb); - wd->scroller = top_scroller; - if (wd->scroller) evas_object_event_callback_add(wd->scroller, - EVAS_CALLBACK_RESIZE, - _content_resize_event_cb, - data); - } + { + if (wd->scroller) evas_object_event_callback_del(wd->scroller, + EVAS_CALLBACK_RESIZE, + _content_resize_event_cb); + wd->scroller = top_scroller; + if (wd->scroller) evas_object_event_callback_add(wd->scroller, + EVAS_CALLBACK_RESIZE, + _content_resize_event_cb, + data); + } } static Eina_Bool -_prop_change(void *data, int type __UNUSED__, void *event) +_prop_change(void *data, int type __UNUSED__, void *event) { #ifdef HAVE_ELEMENTARY_X + int indicator_height=0; + Ecore_X_Virtual_Keyboard_State virt_keypad_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN; Ecore_X_Event_Window_Property *ev; Widget_Data *wd = elm_widget_data_get(data); if (!wd) return ECORE_CALLBACK_PASS_ON; ev = event; - if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE) - { - Conformant_Part_Type part_type; - part_type = (ELM_CONFORM_INDICATOR_PART | - ELM_CONFORM_VIRTUAL_KEYPAD_PART | - ELM_CONFORM_SOFTKEY_PART); - _conformant_part_sizing_eval(data, part_type); - evas_object_event_callback_add(data, EVAS_CALLBACK_RESIZE, - _conformant_move_resize_event_cb, data); - evas_object_event_callback_add(data, EVAS_CALLBACK_MOVE, - _conformant_move_resize_event_cb, data); - } - else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY) - { - _conformant_part_sizing_eval(data, ELM_CONFORM_INDICATOR_PART); - } - else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY) - { - _conformant_part_sizing_eval(data, ELM_CONFORM_SOFTKEY_PART); - } - else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY) - { - _conformant_part_sizing_eval(data, ELM_CONFORM_VIRTUAL_KEYPAD_PART); - } + if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE) + { + Ecore_X_Window zone; + int sh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = indicator_height; + + evas_object_size_hint_min_set(wd->shelf, -1, sh); + evas_object_size_hint_max_set(wd->shelf, -1, sh); + sh = -1; + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_keyboard_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->virtualkeypad, -1, sh); + evas_object_size_hint_max_set(wd->virtualkeypad, -1, sh); + sh = -1; + ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->panel, -1, sh); + evas_object_size_hint_max_set(wd->panel, -1, sh); + } + else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY) + { + Ecore_X_Window zone; + int sh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->shelf, -1, sh); + evas_object_size_hint_max_set(wd->shelf, -1, sh); + } + else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY) + { + Ecore_X_Window zone; + int sh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh); + if (sh < 0) sh = 0; + evas_object_size_hint_min_set(wd->panel, -1, sh); + evas_object_size_hint_max_set(wd->panel, -1, sh); + } + else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY) + { + Ecore_X_Window zone; + int ky = -1, kh = -1; + + zone = ecore_x_e_illume_zone_get(ev->win); + ecore_x_e_illume_keyboard_geometry_get(zone, NULL, &ky, NULL, &kh); + if (kh < 0) kh = 0; + evas_object_size_hint_min_set(wd->virtualkeypad, -1, kh); + evas_object_size_hint_max_set(wd->virtualkeypad, -1, kh); + } else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) - { - Ecore_X_Window zone; - zone = ecore_x_e_illume_zone_get(ev->win); - wd->vkb_state = ecore_x_e_virtual_keyboard_state_get(zone); - if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) - { - evas_object_size_hint_min_set(wd->virtualkeypad, -1, 0); - evas_object_size_hint_max_set(wd->virtualkeypad, -1, 0); - } - else - _update_autoscroll_objs(data); - } + { + Ecore_X_Window zone; + zone = ecore_x_e_illume_zone_get(ev->win); + wd->vkb_state = ecore_x_e_virtual_keyboard_state_get(zone); + + if(wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) + { + evas_object_size_hint_min_set(wd->virtualkeypad, -1, 0); + evas_object_size_hint_max_set(wd->virtualkeypad, -1, 0); + } + else + _update_autoscroll_objs(data); + } #endif return ECORE_CALLBACK_PASS_ON; @@ -399,18 +299,15 @@ _prop_change(void *data, int type __UNUSED__, void *event) * @ingroup Conformant */ EAPI Evas_Object * -elm_conformant_add(Evas_Object *parent) +elm_conformant_add(Evas_Object *parent) { Evas_Object *obj; Evas *evas; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); evas = evas_object_evas_get(parent); - if (!evas) return NULL; obj = elm_widget_add(evas); ELM_SET_WIDTYPE(widtype, "conformant"); @@ -419,7 +316,6 @@ elm_conformant_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); wd->base = edje_object_add(evas); _elm_theme_object_set(obj, wd->base, "conformant", "base", "default"); @@ -427,8 +323,8 @@ elm_conformant_add(Evas_Object *parent) _swallow_conformant_parts(obj); #ifdef HAVE_ELEMENTARY_X - wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, - _prop_change, obj); + wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, + _prop_change, obj); wd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF; #endif @@ -460,35 +356,16 @@ elm_conformant_content_set(Evas_Object *obj, Evas_Object *content) if (wd->content) evas_object_del(wd->content); wd->content = content; if (content) - { - elm_widget_sub_object_add(obj, content); - evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->base, "elm.swallow.content", content); - } + { + elm_widget_sub_object_add(obj, content); + evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->base, "elm.swallow.content", content); + } _sizing_eval(obj); } /** - * Get the content of the conformant widget - * - * Return the content object which is set for this widget; - * - * @param obj The conformant object - * @return The content that is being used - * - * @ingroup Conformant - */ -EAPI Evas_Object * -elm_conformant_content_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->content; -} - -/** * Unset the content of the conformant widget * * Unparent and return the content object which was set for this widget; diff --git a/src/lib/elm_controlbar.c b/src/lib/elm_controlbar.c index dd68b9e..4e5e7db 100644 --- a/src/lib/elm_controlbar.c +++ b/src/lib/elm_controlbar.c @@ -1767,7 +1767,7 @@ create_tab_item(Evas_Object * obj, const char *icon_path, const char *label, return NULL; } it = ELM_NEW(Elm_Controlbar_Item); - if (!it) return NULL; + if (it == NULL) return NULL; it->obj = obj; it->text = eina_stringshare_add(label); it->icon_path = eina_stringshare_add(icon_path); @@ -1810,7 +1810,7 @@ create_tool_item(Evas_Object * obj, const char *icon_path, const char *label, return NULL; } it = ELM_NEW(Elm_Controlbar_Item); - if (!it) + if (it == NULL) return NULL; it->obj = obj; it->text = eina_stringshare_add(label); @@ -1851,7 +1851,7 @@ create_object_item(Evas_Object * obj, Evas_Object * obj_item, const int sel) return NULL; } it = ELM_NEW(Elm_Controlbar_Item); - if (!it) + if (it == NULL) return NULL; it->obj = obj; it->badge = 0; @@ -1981,7 +1981,7 @@ list_clicked(void *data, Evas_Object *obj, void *event_info) Widget_Data *wd; Evas_Object *content; Elm_List_Item *lit = (Elm_List_Item *) elm_list_selected_item_get(obj); - if(!lit) return; + if(lit == NULL) return; elm_list_item_selected_set(lit, 0); @@ -2016,7 +2016,7 @@ create_more_view(Widget_Data *wd) Evas_Object *icon; list = elm_list_add( wd->object ); - elm_list_mode_set( list, ELM_LIST_COMPRESS ); + elm_list_horizontal_mode_set( list, ELM_LIST_COMPRESS ); EINA_LIST_FOREACH(wd->items, l, item) { @@ -2108,7 +2108,7 @@ create_more_item(Widget_Data *wd, int style) Elm_Controlbar_Item * it; it = ELM_NEW(Elm_Controlbar_Item); - if (!it) return NULL; + if (it == NULL) return NULL; it->obj = wd->object; it->text = eina_stringshare_add("more"); it->icon_path = eina_stringshare_add(CONTROLBAR_SYSTEM_ICON_MORE); @@ -2156,7 +2156,6 @@ create_more_item(Widget_Data *wd, int style) */ EAPI Evas_Object * elm_controlbar_add(Evas_Object * parent) { - if (parent == NULL) return NULL; Evas_Object * obj = NULL; Evas_Object * bg = NULL; Widget_Data * wd = NULL; @@ -2324,7 +2323,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_append(Evas_Object * obj, Elm_Controlbar_Item * lit; Widget_Data * wd; it = create_tab_item(obj, icon_path, label, view); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ if(!wd->more_item) { @@ -2376,7 +2375,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tab_item_prepend(Evas_Object * Elm_Controlbar_Item * lit; Elm_Controlbar_Item * item; it = create_tab_item(obj, icon_path, label, view); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); item = eina_list_data_get(wd->items); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ @@ -2428,7 +2427,7 @@ elm_controlbar_tab_item_insert_before(Evas_Object * obj, Elm_Controlbar_Item * lit; if (!before) return NULL; it = create_tab_item(obj, icon_path, label, view); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ if(!wd->more_item) @@ -2489,7 +2488,7 @@ elm_controlbar_tab_item_insert_after(Evas_Object * obj, Elm_Controlbar_Item * item; if (!after) return NULL; it = create_tab_item(obj, icon_path, label, view); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); item = elm_controlbar_item_next(after); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ @@ -2557,7 +2556,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_append(Evas_Object * Elm_Controlbar_Item * lit; Widget_Data * wd; it = create_tool_item(obj, icon_path, label, func, data); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ if(!wd->more_item) { @@ -2609,7 +2608,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_tool_item_prepend(Evas_Object * Elm_Controlbar_Item * lit; Elm_Controlbar_Item * item; it = create_tool_item(obj, icon_path, label, func, data); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); item = eina_list_data_get(wd->items); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ @@ -2659,7 +2658,7 @@ elm_controlbar_tool_item_insert_before(Evas_Object * obj, Elm_Controlbar_Item * lit; if (!before) return NULL; it = create_tool_item(obj, icon_path, label, func, data); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ if(!wd->more_item) @@ -2718,7 +2717,7 @@ elm_controlbar_tool_item_insert_after(Evas_Object * obj, Elm_Controlbar_Item * item; if (!after) return NULL; it = create_tool_item(obj, icon_path, label, func, data); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); item = elm_controlbar_item_next(after); if(check_bar_item_number(wd) >= 5 && wd->auto_align){ @@ -2767,7 +2766,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_object_item_append(Evas_Object * Widget_Data * wd; Elm_Controlbar_Item * it; it = create_object_item(obj, obj_item, sel); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); set_items_position(obj, it, NULL, EINA_TRUE); wd->items = eina_list_append(wd->items, it); @@ -2796,7 +2795,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_object_item_prepend(Evas_Object * Elm_Controlbar_Item * it; Elm_Controlbar_Item * item; it = create_object_item(obj, obj_item, sel); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); item = eina_list_data_get(wd->items); set_items_position(obj, it, item, EINA_TRUE); @@ -2826,7 +2825,7 @@ elm_controlbar_object_item_insert_before(Evas_Object * obj, Elm_Controlbar_Item * it; if (!before) return NULL; it = create_object_item(obj, obj_item, sel); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); set_items_position(obj, it, before, EINA_TRUE); wd->items = eina_list_prepend_relative(wd->items, it, before); @@ -2856,7 +2855,7 @@ elm_controlbar_object_item_insert_after(Evas_Object * obj, Elm_Controlbar_Item * item; if (!after) return NULL; it = create_object_item(obj, obj_item, sel); - if (!it) return NULL; + if (it == NULL) return NULL; wd = elm_widget_data_get(obj); item = elm_controlbar_item_next(after); set_items_position(obj, it, item, EINA_TRUE); @@ -2875,7 +2874,6 @@ elm_controlbar_object_item_insert_after(Evas_Object * obj, EAPI void elm_controlbar_item_del(Elm_Controlbar_Item * it) { - if (!it) return; Evas_Object * obj; Widget_Data * wd; const Eina_List *l; @@ -2975,7 +2973,7 @@ elm_controlbar_item_del(Elm_Controlbar_Item * it) EAPI void elm_controlbar_item_select(Elm_Controlbar_Item * it) { - if (!it) return; + if (it == NULL) return; if (it->obj == NULL) return; Widget_Data * wd = elm_widget_data_get(it->obj); if (wd == NULL) return; @@ -2997,7 +2995,7 @@ elm_controlbar_item_select(Elm_Controlbar_Item * it) EAPI void elm_controlbar_item_icon_set(Elm_Controlbar_Item * it, const char *icon_path) { - if (!it) return; + if (it == NULL) return; if(it->icon_path) eina_stringshare_del(it->icon_path); it->icon_path = eina_stringshare_add(icon_path); @@ -3066,7 +3064,6 @@ elm_controlbar_item_icon_set(Elm_Controlbar_Item * it, const char *icon_path) EAPI Evas_Object * elm_controlbar_item_icon_get(Elm_Controlbar_Item * it) { - if (!it) return NULL; return it->icon; } @@ -3081,11 +3078,14 @@ elm_controlbar_item_icon_get(Elm_Controlbar_Item * it) EAPI void elm_controlbar_item_label_set(Elm_Controlbar_Item * it, const char *label) { - if (!it) return; + if (it == NULL) return; + if(it->text) eina_stringshare_del(it->text); + if(it->label) evas_object_del(it->label); it->text = eina_stringshare_add(label); it->label = create_item_label(it->base_item, it, "elm.swallow.text"); + if(it->disable) item_color_set(it, "elm.item.disable.color"); // it->edit_label = create_item_label(it->edit_item, it, "elm.swallow.text"); - + if(it->label && it->icon){ edje_object_signal_emit(_EDJ(it->base_item), "elm,state,icon_text", "elm"); elm_label_line_wrap_set(it->label, EINA_FALSE); @@ -3114,7 +3114,6 @@ elm_controlbar_item_label_set(Elm_Controlbar_Item * it, const char *label) EAPI const char * elm_controlbar_item_label_get(Elm_Controlbar_Item * it) { - if (!it) return NULL; return it->text; } @@ -3202,7 +3201,6 @@ EAPI Eina_List * elm_controlbar_items_get(Evas_Object * obj) EAPI Elm_Controlbar_Item * elm_controlbar_item_prev(Elm_Controlbar_Item * it) { - if (!it) return NULL; const Eina_List *l; Elm_Controlbar_Item * item; @@ -3232,7 +3230,6 @@ EAPI Elm_Controlbar_Item * elm_controlbar_item_prev(Elm_Controlbar_Item * EAPI Elm_Controlbar_Item * elm_controlbar_item_next(Elm_Controlbar_Item * it) { - if (!it) return NULL; const Eina_List *l; Elm_Controlbar_Item * item; @@ -3284,7 +3281,7 @@ EAPI Elm_Controlbar_Item * elm_controlbar_item_next(Elm_Controlbar_Item * EAPI void elm_controlbar_item_visible_set(Elm_Controlbar_Item * it, Eina_Bool visible) { - if (!it) return; + if(!it) return; if (it->obj == NULL) return; Widget_Data * wd = elm_widget_data_get(it->obj); if (!wd) return; @@ -3304,7 +3301,7 @@ elm_controlbar_item_visible_set(Elm_Controlbar_Item * it, Eina_Bool visible) EAPI Eina_Bool elm_controlbar_item_visible_get(Elm_Controlbar_Item * it) { - if (!it) return EINA_FALSE; + if(!it) return EINA_FALSE; if (it->obj == NULL) return EINA_FALSE; Widget_Data * wd = elm_widget_data_get(it->obj); @@ -3348,7 +3345,7 @@ elm_controlbar_item_visible_get(Elm_Controlbar_Item * it) EAPI void elm_controlbar_item_disable_set(Elm_Controlbar_Item * it, Eina_Bool disable) { - if( !it) return; + if(!it) return; if(it->disable == disable) return; @@ -3372,10 +3369,10 @@ elm_controlbar_item_disable_set(Elm_Controlbar_Item * it, Eina_Bool disable) * * @ingroup Controlbar */ -EAPI Eina_Bool +EAPI void elm_controlbar_item_disable_get(Elm_Controlbar_Item * it) { - if(!it) return NULL; + if(!it) return; return it->disable; } diff --git a/src/lib/elm_ctxpopup.c b/src/lib/elm_ctxpopup.c index df0ae08..a35f6dd 100644 --- a/src/lib/elm_ctxpopup.c +++ b/src/lib/elm_ctxpopup.c @@ -690,7 +690,7 @@ static void _sizing_eval(Evas_Object *obj) evas_object_move(wd->base, rect.x, rect.y); evas_object_resize(wd->base, rect.w, rect.h); - if(wd->visible) + if(wd->visible) edje_object_signal_emit(wd->base, "elm,state,show", "elm"); } diff --git a/src/lib/elm_diskcontroller.c b/src/lib/elm_diskcontroller.c new file mode 100644 index 0000000..672a6ca --- /dev/null +++ b/src/lib/elm_diskcontroller.c @@ -0,0 +1,902 @@ +/* + * SLP + * Copyright (c) 2009 Samsung Electronics, Inc. + * All rights reserved. + * + * This software is a confidential and proprietary information + * of Samsung Electronics, Inc. ("Confidential Information"). You + * shall not disclose such Confidential Information and shall use + * it only in accordance with the terms of the license agreement + * you entered into with Samsung Electronics. + */ + + +/** + * @defgroup Diskcontroller Diskcontroller + * @ingroup Elementary + * + * This is a Diskcontroller. It can contain label and icon objects. + */ + +#include +#include + +#include +#include "elm_priv.h" + +#ifndef EAPI +#define EAPI __attribute__ ((visibility("default"))) +#endif + +#define MAX_ARGS 512 +#define SCROLLED_DISTANCE 215 +#define STANDARD_W 480 +#define SIDE_STRING_LENGTH 3 +#define SIDE_POINT 50 + +#define _EDJ(x) (Evas_Object *)elm_layout_edje_get(x) + +// internal data structure of diskcontroller object +typedef struct _Widget_Data Widget_Data; + +struct _Widget_Data +{ + Evas_Object *object; + Evas_Object *parent; + Evas_Object *edje; + Evas_Object *scroller; + Evas_Object *main_box; + Evas_Object *left_blank; + Evas_Object *right_blank; + + Elm_Diskcontroller_Item *selected_item; + Elm_Diskcontroller_Item *first; + Elm_Diskcontroller_Item *second; + Elm_Diskcontroller_Item *s_last; + Elm_Diskcontroller_Item *last; + + Eina_List *items; + Eina_List *r_items; + + Evas_Coord x, y, w, h; + + Ecore_Idler *i; + int item_num; + int round; + int stop; + double time; + + + Ecore_Idler *idler; + Ecore_Idler *check_idler; + Eina_Bool flag; + Eina_Bool init; + + Ecore_Event_Handler *move_event; + Ecore_Event_Handler *up_event; +}; + +struct _Elm_Diskcontroller_Item +{ + Evas_Object *obj; + Evas_Object *base; + Evas_Object *icon; + const char *label; + void (*func)(void *data, Evas_Object *obj, void *event_info); + const void *data; +}; + +static void _del_hook(Evas_Object *obj); +static void _theme_hook(Evas_Object *obj); +static void _sizing_eval(Evas_Object *obj); +static void _sub_del(void *data, Evas_Object *obj, void *event_info); + +static void _diskcontroller_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _diskcontroller_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _diskcontroller_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _diskcontroller_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info); + +static void +_del_hook(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + Elm_Diskcontroller_Item *item; + + if (!wd) return; + + if (wd->main_box) { + evas_object_del(wd->main_box); + wd->main_box = NULL; + } + + if (wd->scroller) { + evas_object_del(wd->scroller); + wd->scroller = NULL; + } + + if (wd->edje) { + evas_object_del(wd->edje); + wd->edje = NULL; + } + + EINA_LIST_FREE(wd->items, item){ + eina_stringshare_del(item->label); + if(item->icon) evas_object_del(item->icon); + if(item->base) evas_object_del(item->base); + free(item); + item = NULL; + } + + free(wd); + wd = NULL; +} + +static void +_theme_hook(Evas_Object *obj) +{ + Eina_List *l; + Elm_Diskcontroller_Item *it; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + _elm_theme_object_set(obj, wd->edje, "diskcontroller", "bg", elm_widget_style_get(obj)); + + if(wd->round){ + EINA_LIST_FOREACH(wd->r_items, l, it) { + elm_layout_theme_set(it->base, "diskcontroller", "item", "default"); + } + }else{ + EINA_LIST_FOREACH(wd->items, l, it) { + elm_layout_theme_set(it->base, "diskcontroller", "item", "default"); + } + } + +} + +static void +_sub_del(void *data, Evas_Object *obj, void *event_info) +{ + Widget_Data *wd = elm_widget_data_get(obj); + //Evas_Object *sub = event_info; + if (!wd) return; + /* + if (sub == wd->icon) + { + edje_object_signal_emit(wd->btn, "elm,state,icon,hidden", "elm"); + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + wd->icon = NULL; + edje_object_message_signal_process(wd->btn); + _sizing_eval(obj); + } + */ +} + +static void +_sizing_eval(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + + if (!wd) return; + + DBG("[%s]\n", __func__); + + _diskcontroller_object_move(obj, NULL, obj, NULL); + _diskcontroller_object_resize(obj, NULL, obj, NULL); +} + +static void select_item(Elm_Diskcontroller_Item *it) +{ + if(it == NULL) return; + + Widget_Data *wd = elm_widget_data_get(it->obj); + wd->selected_item = it; + + if(it->func) it->func((void *)(it->data), it->obj, it); + evas_object_smart_callback_call(it->obj, "stop", it); +} + +static void string_signal_emit(Elm_Diskcontroller_Item *it) +{ + char buf[MAX_ARGS]; + + if(strlen(it->label) > 14){ + if(strlen(it->label) < 18){ + edje_object_signal_emit(_EDJ(it->base), "elm,state,center_small", "elm"); + }else{ + strncpy(buf, it->label, 40); + buf[40] = '\0'; + edje_object_part_text_set(_EDJ(it->base), "elm.text", buf); + edje_object_signal_emit(_EDJ(it->base), "elm,state,center_small", "elm"); + } + }else{ + edje_object_signal_emit(_EDJ(it->base), "elm,state,center", "elm"); + } +} + +static int check_letter(const char *str, int length) +{ + int code = str[length]; + + if(code == '\0') return length; // null string + else if(isalnum(code)) return length; // alphabet or number + else if ((33<=code && code<47) || (58<=code && code<64) || (91<=code && code<96) || (123<=code && code<126)) return length; // special letter + + return length-1; +} + +static Eina_Bool check_string(void *data) +{ + Eina_List *l; + Elm_Diskcontroller_Item *it; + Evas_Coord x, y, w, h; + int mid, step, length, diff, side; + char buf[MAX_ARGS]; + Widget_Data *wd = (Widget_Data *)data; + Eina_List *list; + + if(wd->w <= 0) return EXIT_FAILURE; + if(!wd->init) return EXIT_FAILURE; + + if(!wd->round) list = wd->items; + else list = wd->r_items; + + EINA_LIST_FOREACH(list, l, it) { + evas_object_geometry_get(it->base, &x, &y, &w, &h); + mid = (int)(x + w/2); + if(mid <= -SCROLLED_DISTANCE || mid >= wd->w+SCROLLED_DISTANCE) continue; + + side = MIN(SIDE_STRING_LENGTH, strlen(it->label)); + + step = strlen(it->label)-side+1; + if(mid <= wd->x + wd->w/2){ + diff = (wd->x + wd->w/2) - mid; + }else{ + diff = mid - (wd->x + wd->w/2); + } + + length = strlen(it->label) - (int)(diff/(int)(wd->w*SCROLLED_DISTANCE/STANDARD_W/step)); + if(mid - wd->x <= wd->w*SIDE_POINT/STANDARD_W || mid - wd->x >= wd->w-wd->w*SIDE_POINT/STANDARD_W){ + edje_object_signal_emit(_EDJ(it->base), "elm,state,side", "elm"); + }else{ + string_signal_emit(it); + } + length = MAX(length, side); + length = check_letter(it->label, length); + strncpy(buf, it->label, length); + buf[length] = '\0'; + edje_object_part_text_set(_EDJ(it->base), "elm.text", buf); + } + + if(wd->check_idler) ecore_idler_del(wd->check_idler); + wd->check_idler = NULL; + + return EXIT_SUCCESS; +} + +static void scroller_move_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Coord x, y, w, h; + Widget_Data *wd = (Widget_Data *)data; + + check_string(wd); + + if(wd->round) { + elm_scroller_region_get(wd->scroller, &x, &y, &w, &h); + + if(x > 100000 || x < -100000){ + elm_scroller_region_show(wd->scroller, 0, y, w, h); + return; + } + if(x > wd->w*SCROLLED_DISTANCE/STANDARD_W*(wd->item_num+1)){ + elm_scroller_region_show(wd->scroller, x-wd->w*SCROLLED_DISTANCE/STANDARD_W*wd->item_num, y, w, h); + }else if(x < wd->w*SCROLLED_DISTANCE/STANDARD_W*(1)){ + elm_scroller_region_show(wd->scroller, x+wd->w*SCROLLED_DISTANCE/STANDARD_W*wd->item_num, y, w, h); + } + } + + wd->stop = 0; +} + +static void scroller_stop_cb(void *data, Evas_Object *obj, void *event_info) +{ + Widget_Data *wd = (Widget_Data *)data; + Eina_List *l; + Elm_Diskcontroller_Item *it; + Evas_Coord x,y,w,h; + Eina_List *list; + + if(!wd->round) list = wd->items; + else list = wd->r_items; + + if(wd->idler != NULL) return; + + EINA_LIST_FOREACH(list, l, it) { + evas_object_geometry_get(it->base, &x, &y, &w, &h); + if(abs((int)(wd->w/2 - (int)(x + w/2))) < 10) break; + } + + if(it == NULL) return; + + select_item(it); + + wd->stop = 1; +} + +static Eina_Bool move_scroller(void *data) +{ + Widget_Data *wd = (Widget_Data *)data; + Eina_List *l; + Elm_Diskcontroller_Item *dit; + Evas_Coord x, y, w, h; + int i; + + if(wd->round) i = 1; + else i = 0; + + EINA_LIST_FOREACH(wd->items, l, dit){ + if(wd->selected_item == dit) break; + i++; + } + + if(dit == NULL) { + wd->selected_item = (Elm_Diskcontroller_Item *)eina_list_nth(wd->items, 0); + return EXIT_FAILURE; + } + + elm_scroller_region_get(wd->scroller, &x, &y, &w, &h); + elm_scroller_region_show(wd->scroller, wd->w*SCROLLED_DISTANCE/STANDARD_W*i+1, y, w, h); + elm_scroller_region_get(wd->scroller, &x, &y, &w, &h); + + select_item(dit); + + if(wd->idler){ + ecore_idler_del(wd->idler); + wd->idler = NULL; + } + + wd->init = EINA_TRUE; + + check_string(wd); + + return EXIT_SUCCESS; +} + +static Elm_Diskcontroller_Item *item_new(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) +{ + Elm_Diskcontroller_Item *it; + Widget_Data *wd; + + if(obj == NULL) return NULL; + wd = elm_widget_data_get(obj); + if(wd == NULL) return NULL; + + it = ELM_NEW(Elm_Diskcontroller_Item); + if(it == NULL) return NULL; + + it->obj = obj; + it->label = eina_stringshare_add(label); + it->icon = icon; + it->func = func; + it->data = data; + it->base = elm_layout_add(wd->edje); + if(it->base == NULL) return NULL; + elm_layout_theme_set(it->base, "diskcontroller", "item", "default"); + evas_object_size_hint_weight_set(it->base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(it->base, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(it->base); + elm_widget_sub_object_add(obj, it->base); + + if (it->label){ + //string_signal_emit(it); + edje_object_part_text_set(_EDJ(it->base), "elm.text", it->label); + } + + if (it->icon){ +// int ms = 0; + +// ms = ((double)wd->icon_size * _elm_config->scale); + evas_object_size_hint_min_set(it->icon, 24, 24); + evas_object_size_hint_max_set(it->icon, 40, 40); + edje_object_part_swallow(_EDJ(it->base), "elm.swallow.icon", it->icon); + evas_object_show(it->icon); + elm_widget_sub_object_add(obj, it->icon); + } + + if (it->label && it->icon){ + edje_object_signal_emit(_EDJ(it->base), "elm,state,icon_text", "elm"); + } + + return it; +} + +static void dummy_item_del(void *data) +{ + Widget_Data *wd = (Widget_Data *)data; + + if(wd->last){ + elm_box_unpack(wd->main_box, wd->last->base); + wd->r_items = eina_list_remove(wd->r_items, wd->last); + evas_object_del(wd->last->base); + free(wd->last); + wd->last = NULL; + } + if(wd->s_last){ + elm_box_unpack(wd->main_box, wd->s_last->base); + wd->r_items = eina_list_remove(wd->r_items, wd->s_last); + evas_object_del(wd->s_last->base); + free(wd->s_last); + wd->s_last = NULL; + } + if(wd->second){ + elm_box_unpack(wd->main_box, wd->second->base); + wd->r_items = eina_list_remove(wd->r_items, wd->second); + evas_object_del(wd->second->base); + free(wd->second); + wd->second = NULL; + } + if(wd->first){ + elm_box_unpack(wd->main_box, wd->first->base); + wd->r_items = eina_list_remove(wd->r_items, wd->first); + evas_object_del(wd->first->base); + free(wd->first); + wd->first = NULL; + } +} + +static void dummy_item_add(void *data) +{ + Widget_Data *wd = (Widget_Data *)data; + Elm_Diskcontroller_Item *dit; + Elm_Diskcontroller_Item *it; + + dit = it = eina_list_nth(wd->items, 0); + if(it != NULL){ + wd->first = item_new(it->obj, it->icon, it->label, it->func, it->data); + wd->r_items = eina_list_append(wd->r_items, wd->first); + } + it = eina_list_nth(wd->items, 1); + if(it != NULL){ + wd->second = item_new(it->obj, it->icon, it->label, it->func, it->data); + wd->r_items = eina_list_append(wd->r_items, wd->second); + }else{ + wd->second = item_new(dit->obj, dit->icon, dit->label, dit->func, dit->data); + wd->r_items = eina_list_append(wd->r_items, wd->second); + } + it = eina_list_nth(wd->items, wd->item_num-1); + if(it != NULL && wd->last == NULL){ + wd->last = item_new(it->obj, it->icon, it->label, it->func, it->data); + wd->r_items = eina_list_prepend(wd->r_items, wd->last); + }else{ + wd->last = item_new(dit->obj, dit->icon, dit->label, dit->func, dit->data); + wd->r_items = eina_list_prepend(wd->r_items, wd->last); + } + it = eina_list_nth(wd->items, wd->item_num-2); + if(it != NULL && wd->s_last == NULL){ + wd->s_last = item_new(it->obj, it->icon, it->label, it->func, it->data); + wd->r_items = eina_list_prepend(wd->r_items, wd->s_last); + }else{ + wd->s_last = item_new(dit->obj, dit->icon, dit->label, dit->func, dit->data); + wd->r_items = eina_list_prepend(wd->r_items, wd->s_last); + } +} + +/** + * Add a new diskcontroller object + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Diskcontroller + */ +EAPI Evas_Object *elm_diskcontroller_add(Evas_Object *parent) +{ + Evas_Object *obj = NULL; + Widget_Data *wd = NULL; + Evas_Coord x, y, w, h; + Evas *e; + + wd = ELM_NEW(Widget_Data); + e = evas_object_evas_get(parent); + if (e == NULL) return NULL; + obj = elm_widget_add(e); + if(obj == NULL) return NULL; + elm_widget_type_set(obj, "diskcontroller"); + elm_widget_sub_object_add(parent, obj); + elm_widget_data_set(obj, wd); + elm_widget_del_hook_set(obj, _del_hook); + elm_widget_theme_hook_set(obj, _theme_hook); + + // initialization + wd->parent = parent; + evas_object_geometry_get(parent, &x, &y, &w, &h); + wd->object = obj; + wd->x = x; + wd->y = y; + wd->w = w; + wd->h = h; + wd->item_num = 0; + wd->round = 0; + wd->stop = 0; + wd->init = EINA_FALSE; + + /* load background edj */ + wd->edje = edje_object_add(e); + _elm_theme_object_set(obj, wd->edje, "diskcontroller", "bg", "default"); + if(wd->edje == NULL) { + printf("Cannot load bg edj\n"); + return NULL; + } + + evas_object_show(wd->edje); + + evas_object_event_callback_add(wd->edje, EVAS_CALLBACK_RESIZE, _diskcontroller_object_resize, obj); + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _diskcontroller_object_move, obj); + evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _diskcontroller_object_show, obj); + evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _diskcontroller_object_hide, obj); + + wd->scroller = elm_scroller_add(wd->edje); + elm_scroller_policy_set(wd->scroller, ELM_SMART_SCROLLER_POLICY_OFF, ELM_SMART_SCROLLER_POLICY_OFF); + elm_scroller_bounce_set(wd->scroller, 1, 0); + elm_scroller_page_size_set(wd->scroller, (int)(wd->w*SCROLLED_DISTANCE/STANDARD_W), 0); + edje_object_part_swallow(wd->edje, "elm.scroller", wd->scroller); + + evas_object_smart_callback_add(wd->scroller, "scroll", scroller_move_cb, wd); + evas_object_smart_callback_add(wd->scroller, "scroll,anim,stop", scroller_stop_cb, wd); + + wd->main_box = elm_box_add(wd->edje); + elm_box_horizontal_set(wd->main_box, 1); + elm_box_homogenous_set(wd->main_box, 2); + evas_object_show(wd->main_box); + evas_object_size_hint_weight_set(wd->main_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(wd->main_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + + wd->left_blank = elm_layout_add(wd->edje); + if(wd->left_blank == NULL) return NULL; + elm_layout_theme_set(wd->left_blank, "diskcontroller", "item", "default"); + evas_object_size_hint_weight_set(wd->left_blank, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(wd->left_blank, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(wd->left_blank); + elm_box_pack_end(wd->main_box, wd->left_blank); + elm_widget_sub_object_add(obj, wd->left_blank); + + wd->right_blank = elm_layout_add(wd->edje); + if(wd->right_blank == NULL) return NULL; + elm_layout_theme_set(wd->right_blank, "diskcontroller", "item", "default"); + evas_object_size_hint_weight_set(wd->right_blank, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(wd->right_blank, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(wd->right_blank); + elm_box_pack_end(wd->main_box, wd->right_blank); + elm_widget_sub_object_add(obj, wd->right_blank); + + elm_scroller_content_set(wd->scroller, wd->main_box); + + //FIXME + // evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); + + + elm_widget_resize_object_set(obj, wd->edje); + evas_object_smart_member_add(wd->scroller, obj); + evas_object_smart_member_add(wd->main_box, obj); + + _sizing_eval(obj); + return obj; +} + +/** + * Set round mode + * + * @param it The item of diskcontroller + * @param if or not set round mode + * + * @ingroup Diskcontroller + */ +EAPI void elm_diskcontroller_round_set(Evas_Object *obj, Eina_Bool round) +{ + Widget_Data *wd; + + if(obj == NULL) return; + wd = elm_widget_data_get(obj); + if(wd == NULL) return; + + if(wd->round == round) return; + wd->round = round; + + + if(wd->r_items) eina_list_free(wd->r_items); + wd->r_items = eina_list_clone(wd->items); + + if(wd->round) { + elm_box_unpack(wd->main_box, wd->left_blank); + evas_object_hide(wd->left_blank); + elm_box_unpack(wd->main_box, wd->right_blank); + evas_object_hide(wd->right_blank); + + if(wd->items == NULL) return; + + dummy_item_add(wd); + dummy_item_del(wd); + + //composite another list + if(wd->first->base) elm_box_pack_end(wd->main_box, wd->first->base); + if(wd->second->base) elm_box_pack_end(wd->main_box, wd->second->base); + if(wd->last->base) elm_box_pack_start(wd->main_box, wd->last->base); + if(wd->s_last->base) elm_box_pack_start(wd->main_box, wd->s_last->base); + + } else { + elm_box_unpack(wd->main_box, wd->first->base); + evas_object_hide(wd->first->base); + elm_box_unpack(wd->main_box, wd->second->base); + evas_object_hide(wd->second->base); + elm_box_unpack(wd->main_box, wd->last->base); + evas_object_hide(wd->last->base); + elm_box_unpack(wd->main_box, wd->s_last->base); + evas_object_hide(wd->s_last->base); + + + elm_box_pack_start(wd->main_box, wd->left_blank); + elm_box_pack_end(wd->main_box, wd->right_blank); + } + + _sizing_eval(obj); +} + + +/** + * @fn int elm_diskcontroller_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void event_info), const void *data) + * @ingroup TW3_diskcontroller_group + * @brief Add text item + * @param[in] obj The diskcontroller object + * @param[in] icon The icon of item + * @param[in] label The label of item + * @param[in] func Callback function of item + * @param[in] data The data of callback function + * @return 0 (SUCCESS) or -1 (FAIL) + */ +EAPI Elm_Diskcontroller_Item *elm_diskcontroller_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data) +{ + Elm_Diskcontroller_Item *it; + Widget_Data *wd; + + if(obj == NULL) return NULL; + wd = elm_widget_data_get(obj); + if(wd == NULL) return NULL; + + it = item_new(obj, icon, label, func, data); + + wd->items = eina_list_append(wd->items, it); + + wd->item_num++; + + if(wd->round){ + dummy_item_del(wd); + wd->r_items = eina_list_append(wd->r_items, it); + dummy_item_add(wd); + + if(wd->last) elm_box_pack_start(wd->main_box, wd->last->base); + if(wd->s_last) elm_box_pack_start(wd->main_box, wd->s_last->base); + elm_box_pack_end(wd->main_box, it->base); + if(wd->first) elm_box_pack_end(wd->main_box, wd->first->base); + if(wd->second) elm_box_pack_end(wd->main_box, wd->second->base); + }else{ + elm_box_unpack(wd->main_box, wd->right_blank); + elm_box_pack_end(wd->main_box, it->base); + elm_box_pack_end(wd->main_box, wd->right_blank); + } + + wd->selected_item = it; + if(wd->idler == NULL) wd->idler = ecore_idler_add(move_scroller, wd); + + _sizing_eval(obj); + + return it; +} + +/** + * Delete the item + * + * @param it The item of diskcontroller + * + * @ingroup Diskcontroller + */ +EAPI void elm_diskcontroller_item_del(Elm_Diskcontroller_Item *it) +{ + Widget_Data *wd; + Elm_Diskcontroller_Item *dit; + Evas_Object *obj; + + if(it == NULL) return; + if(it->obj == NULL) return; + obj = it->obj; + wd = elm_widget_data_get(it->obj); + if(wd == NULL) return; + + elm_box_unpack(wd->main_box, it->base); + + if(wd->round){ + wd->r_items = eina_list_remove(wd->r_items, it); + } + wd->items = eina_list_remove(wd->items, it); + + if(wd->selected_item == it){ + dit = (Elm_Diskcontroller_Item *)eina_list_nth(wd->items, 0); + if(dit != it){ + wd->selected_item = dit; + }else{ + wd->selected_item = (Elm_Diskcontroller_Item *)eina_list_nth(wd->items, 1); + } + } + + if(it->base) evas_object_del(it->base); + if(it->icon) evas_object_del(it->icon); + if(it) free(it); + it = NULL; + + wd->item_num -= 1; + + if(wd->round){ + if(wd->item_num == 0){ + evas_object_hide(wd->first->base); + evas_object_hide(wd->second->base); + evas_object_hide(wd->last->base); + evas_object_hide(wd->s_last->base); + }else{ + dit = eina_list_nth(wd->items, 0); + if(dit){ + wd->first->label = eina_stringshare_add(dit->label); + edje_object_part_text_set(_EDJ(wd->first->base), "elm.text", wd->first->label); + } + dit = eina_list_nth(wd->items, 1); + if(dit){ + wd->second->label = eina_stringshare_add(dit->label); + edje_object_part_text_set(_EDJ(wd->second->base), "elm.text", wd->second->label); + } + dit = eina_list_nth(wd->items, eina_list_count(wd->items)-1); + if(dit){ + wd->last->label = eina_stringshare_add(dit->label); + edje_object_part_text_set(_EDJ(wd->last->base), "elm.text", wd->last->label); + } + dit = eina_list_nth(wd->items, eina_list_count(wd->items)-2); + if(dit){ + wd->s_last->label = eina_stringshare_add(dit->label); + edje_object_part_text_set(_EDJ(wd->s_last->base), "elm.text", wd->s_last->label); + } + } + } + + wd->check_idler = ecore_idler_add(check_string, wd); + + _sizing_eval(obj); +} + +/** + * Get the label of item + * + * @param it The item of diskcontroller + * @return The label of item + * + * @ingroup Diskcontroller + */ +EAPI const char *elm_diskcontroller_item_label_get(Elm_Diskcontroller_Item *it) +{ + return it->label; +} + + +/** + * Set the label of item + * + * @param it The item of diskcontroller + * @return The label of item + * + * @ingroup Diskcontroller + */ +EAPI void elm_diskcontroller_item_label_set(Elm_Diskcontroller_Item *it, const char *label) +{ + it->label = eina_stringshare_add(label); + edje_object_part_text_set(_EDJ(it->base), "elm.text", it->label); +} + +/** + * Set the item visible + * + * @param it The item of diskcontroller + * + * @ingroup Diskcontroller + */ +EAPI void elm_diskcontroller_item_focus_set(Elm_Diskcontroller_Item *it) +{ + Widget_Data *wd; + + if(it->obj == NULL) return; + wd = elm_widget_data_get(it->obj); + if(wd == NULL) return; + + wd->selected_item = it; + + if(wd->idler == NULL) ecore_idler_add(move_scroller, wd); +} + + +/////////////////////////////////////////////////////////////////// +// +// Smart Object basic function +// +//////////////////////////////////////////////////////////////////// + +static void _diskcontroller_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + DBG("%s", __func__); + + Widget_Data *wd; + Evas_Coord x, y; + + if(!data) return; + wd = elm_widget_data_get((Evas_Object *)data); + if(!wd) return; + + evas_object_geometry_get(wd->edje, &x, &y, NULL, NULL); + + wd->x = x; + wd->y = y; + + evas_object_move(wd->edje, x, y); +} + + +static void _diskcontroller_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Widget_Data *wd; + Evas_Coord w, h; + + if(!data) return; + wd = elm_widget_data_get((Evas_Object *)data); + if(!wd) return; + + evas_object_geometry_get(wd->edje, NULL, NULL, &w, &h); + + wd->w = w; + wd->h = h; + + evas_object_resize(wd->edje, w, h); + if(wd->round){ + evas_object_size_hint_min_set(wd->main_box, w*SCROLLED_DISTANCE*(wd->item_num+4)/STANDARD_W, h-1); + }else{ + evas_object_size_hint_min_set(wd->main_box, w*SCROLLED_DISTANCE*(wd->item_num+2)/STANDARD_W, h-1); + } + elm_scroller_page_size_set(wd->scroller, (int)(wd->w*SCROLLED_DISTANCE/STANDARD_W), 0); + + if(wd->idler == NULL) { + wd->idler = ecore_idler_add(move_scroller, wd); + } +} + + +static void _diskcontroller_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + DBG("%s", __func__); + + Widget_Data *wd; + + if(!data) return; + wd = elm_widget_data_get((Evas_Object *)data); + if(!wd) return; + + evas_object_show(wd->edje); +} + + + +static void _diskcontroller_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + DBG("%s", __func__); + + Widget_Data *wd; + + if(!data) return; + wd = elm_widget_data_get((Evas_Object *)data); + if(!wd) return; + + evas_object_hide(wd->edje); +} + diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c deleted file mode 100644 index fe34ef9..0000000 --- a/src/lib/elm_diskselector.c +++ /dev/null @@ -1,1543 +0,0 @@ -/** - * @defgroup Diskselector - * - * A diskselector is a kind of list widget. It scrolls horizontally, - * and can contain label and icon objects. Three items are displayed - * with the selected on the middle. - * - * It can act like a circular list with round mode and labels can be - * reduced for a defined lenght for side items. - * - * Signal emitted by this widget: - * "selected" - when item is selected (scroller stops) - */ - -#include -#include "elm_priv.h" - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -typedef struct _Widget_Data Widget_Data; - -struct _Widget_Data -{ - Evas_Object *self; - Evas_Object *scroller; - Evas_Object *main_box; - Evas_Object *left_blank; - Evas_Object *right_blank; - Elm_Diskselector_Item *selected_item; - Elm_Diskselector_Item *first; - Elm_Diskselector_Item *second; - Elm_Diskselector_Item *s_last; - Elm_Diskselector_Item *last; - Eina_List *items; - Eina_List *r_items; - int item_count, len_threshold, len_side; - Ecore_Idler *idler; - Ecore_Idler *check_idler; - Eina_Bool init:1; - Eina_Bool round:1; -}; - -struct _Elm_Diskselector_Item -{ - Elm_Widget_Item base; - Eina_List *node; - Evas_Object *icon; - const char *label; - Evas_Smart_Cb func; -}; - -static const char *widtype = NULL; - -#define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \ - ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \ - ELM_CHECK_WIDTYPE(it->base.widget, widtype) __VA_ARGS__; - -static Eina_Bool _move_scroller(void *data); -static void _del_hook(Evas_Object * obj); -static void _del_pre_hook(Evas_Object * obj); -static void _sizing_eval(Evas_Object * obj); -static void _theme_hook(Evas_Object * obj); -static void _on_focus_hook(void *data, Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info); -static void _sub_del(void *data, Evas_Object * obj, void *event_info); -static void _round_items_del(Widget_Data *wd); -static void _scroller_move_cb(void *data, Evas_Object *obj, void *event_info); - -static const char SIG_SELECTED[] = "selected"; -static const Evas_Smart_Cb_Description _signals[] = { - {SIG_SELECTED, ""}, - {NULL, NULL} -}; - -static void -_diskselector_object_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) -{ - Widget_Data *wd; - Evas_Coord w, h, minw = -1, minh = -1; - - wd = elm_widget_data_get(data); - if (!wd) return; - - elm_coords_finger_size_adjust(6, &minw, 1, &minh); - edje_object_size_min_restricted_calc(elm_smart_scroller_edje_object_get( - wd->scroller), &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); - - evas_object_geometry_get(wd->scroller, NULL, NULL, &w, &h); - if (wd->round) - evas_object_resize(wd->main_box, w / 3 * (wd->item_count + 4), h); - else - evas_object_resize(wd->main_box, w / 3 * (wd->item_count + 2), h); - - elm_smart_scroller_paging_set(wd->scroller, 0, 0, - (int)(w / 3), 0); - - if (!wd->idler) - wd->idler = ecore_idler_add(_move_scroller, data); -} - -static Elm_Diskselector_Item * -_item_new(Evas_Object *obj, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data) -{ - Elm_Diskselector_Item *it; - const char *style = elm_widget_style_get(obj); - - it = elm_widget_item_new(obj, Elm_Diskselector_Item); - if (!it) return NULL; - - it->label = eina_stringshare_add(label); - it->icon = icon; - it->func = func; - it->base.data = data; - it->base.view = edje_object_add(evas_object_evas_get(obj)); - _elm_theme_object_set(obj, it->base.view, "diskselector", "item", style); - evas_object_size_hint_weight_set(it->base.view, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(it->base.view, EVAS_HINT_FILL, - EVAS_HINT_FILL); - evas_object_show(it->base.view); - - if (it->label) - edje_object_part_text_set(it->base.view, "elm.text", it->label); - if (it->icon) - { - evas_object_size_hint_min_set(it->icon, 24, 24); - evas_object_size_hint_max_set(it->icon, 40, 40); - edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon); - evas_object_show(it->icon); - elm_widget_sub_object_add(obj, it->icon); - } - return it; -} - -static void -_item_del(Elm_Diskselector_Item *item) -{ - if (!item) return; - eina_stringshare_del(item->label); - if (item->icon) - evas_object_del(item->icon); - elm_widget_item_del(item); -} - -static void -_theme_data_get(Widget_Data *wd) -{ - const char* str; - str = edje_object_data_get(wd->right_blank, "len_threshold"); - if (str) wd->len_threshold = atoi(str); - else wd->len_threshold = 0; -} - -static void -_del_hook(Evas_Object * obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - free(wd); -} - -static void -_del_pre_hook(Evas_Object * obj) -{ - Elm_Diskselector_Item *it; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - if (wd->left_blank) - evas_object_del(wd->left_blank); - if (wd->right_blank) - evas_object_del(wd->right_blank); - if (wd->last) - { - eina_stringshare_del(wd->last->label); - evas_object_del(wd->last->base.view); - free(wd->last); - } - if (wd->s_last) - { - eina_stringshare_del(wd->s_last->label); - evas_object_del(wd->s_last->base.view); - free(wd->s_last); - } - if (wd->second) - { - eina_stringshare_del(wd->second->label); - evas_object_del(wd->second->base.view); - free(wd->second); - } - if (wd->first) - { - eina_stringshare_del(wd->first->label); - evas_object_del(wd->first->base.view); - free(wd->first); - } - - EINA_LIST_FREE(wd->items, it) _item_del(it); - eina_list_free(wd->r_items); -} - -static void -_sizing_eval(Evas_Object * obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - _diskselector_object_resize(obj, NULL, obj, NULL); -} - -static void -_theme_hook(Evas_Object * obj) -{ - Eina_List *l; - Elm_Diskselector_Item *it; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - if (wd->scroller) - elm_smart_scroller_object_theme_set(obj, wd->scroller, "diskselector", - "base", elm_widget_style_get(obj)); - if (wd->round) - { - EINA_LIST_FOREACH(wd->r_items, l, it) - { - _elm_theme_object_set(obj, it->base.view, "diskselector", "item", - elm_widget_style_get(obj)); - } - } - else - { - EINA_LIST_FOREACH(wd->items, l, it) - { - _elm_theme_object_set(obj, it->base.view, "diskselector", "item", - elm_widget_style_get(obj)); - } - } - _theme_data_get(wd); - _sizing_eval(obj); -} - -static void -_sub_del(void *data __UNUSED__, Evas_Object * obj, void *event_info) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *sub = event_info; - Elm_Diskselector_Item *it; - const Eina_List *l; - - if (!wd) return; - if (!sub) abort(); - if (sub == wd->scroller) - wd->scroller = NULL; - else - { - EINA_LIST_FOREACH(wd->items, l, it) - { - if (sub == it->icon) - { - it->icon = NULL; - _sizing_eval(obj); - break; - } - } - } -} - -static void -_select_item(Elm_Diskselector_Item *it) -{ - if (!it) return; - Widget_Data *wd = elm_widget_data_get(it->base.widget); - wd->selected_item = it; - if (it->func) it->func((void *)it->base.data, it->base.widget, it); - evas_object_smart_callback_call(it->base.widget, SIG_SELECTED, it); -} - -static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->self, "elm,action,focus", "elm"); - evas_object_focus_set(wd->self, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->self, EINA_FALSE); - } -} - -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - - Elm_Diskselector_Item *it = NULL; - Eina_List *l; - - if (!wd->selected_item) { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - - if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")) || - (!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) - { - l = wd->selected_item->node->prev; - if ((!l) && (wd->round)) - l = eina_list_last(wd->items); - } - else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")) || - (!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) - { - l = wd->selected_item->node->next; - if ((!l) && (wd->round)) - l = wd->items; - } - else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home"))) - l = wd->items; - else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End"))) - l = eina_list_last(wd->items); - else return EINA_FALSE; - - if (l) - it = eina_list_data_get(l); - - if (it) - { - wd->selected_item = it; - if (!wd->idler) - wd->idler = ecore_idler_add(_move_scroller, obj); - } - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; -} - -static int -_check_letter(const char *str, int length) -{ - int code = str[length]; - - if (code == '\0') - return length; // null string - else if (((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122))) - return length; // alphabet - else if ((48 <= code) && (code < 58)) - return length; // number - else if (((33 <= code) && (code < 47)) || ((58 <= code) && (code < 64)) - || ((91 <= code) && (code < 96)) || ((123 <= code) && (code < 126))) - return length; // special letter - return length - 1; -} - -static Eina_Bool -_check_string(void *data) -{ - int mid, steps, length, diff; - Elm_Diskselector_Item *it; - Eina_List *list, *l; - Evas_Coord ox, ow; - char buf[1024]; - Widget_Data *wd = data; - - evas_object_geometry_get(wd->scroller, &ox, NULL, &ow, NULL); - if (ow <= 0) - return EINA_FALSE; - if (!wd->init) - return EINA_FALSE; - if (!wd->round) - list = wd->items; - else - list = wd->r_items; - - EINA_LIST_FOREACH(list, l, it) - { - Evas_Coord x, w; - int len; - evas_object_geometry_get(it->base.view, &x, NULL, &w, NULL); - /* item not visible */ - if ((x + w <= ox) || (x >= ox + ow)) - continue; - - len = eina_stringshare_strlen(it->label); - - if (x <= ox + 5) - edje_object_signal_emit(it->base.view, "elm,state,left_side", - "elm"); - else if (x + w >= ox + ow - 5) - edje_object_signal_emit(it->base.view, "elm,state,right_side", - "elm"); - else - { - if ((wd->len_threshold) && (len > wd->len_threshold)) - edje_object_signal_emit(it->base.view, "elm,state,center_small", - "elm"); - else - edje_object_signal_emit(it->base.view, "elm,state,center", - "elm"); - } - - if (len <= wd->len_side) - continue; - - steps = len - wd->len_side + 1; - mid = x + w / 2; - if (mid <= ox + ow / 2) - diff = (ox + ow / 2) - mid; - else - diff = mid - (ox + ow / 2); - - length = len - (int)(diff * steps / (ow / 3)); - length = MAX(length, wd->len_side); - length = _check_letter(it->label, length); - strncpy(buf, it->label, length); - buf[length] = '\0'; - edje_object_part_text_set(it->base.view, "elm.text", buf); - } - - if (wd->check_idler) - ecore_idler_del(wd->check_idler); - wd->check_idler = NULL; - return EINA_FALSE; -} - -static void -_scroller_move_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Coord x, y, w, h, bw; - Widget_Data *wd = data; - - _check_string(wd); - elm_smart_scroller_child_pos_get(obj, &x, &y); - elm_smart_scroller_child_viewport_size_get(obj, &w, &h); - if (wd->round) - { - evas_object_geometry_get(wd->main_box, NULL, NULL, &bw, NULL); - if (x > w / 3 * (wd->item_count + 1)) - elm_smart_scroller_child_region_show(wd->scroller, - x - w / 3 * wd->item_count, - y, w, h); - else if (x < 0) - elm_smart_scroller_child_region_show(wd->scroller, - x + w / 3 * wd->item_count, - y, w, h); - } -} - -static void -_scroller_stop_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Elm_Diskselector_Item *it; - Widget_Data *wd = data; - Evas_Coord x, w, ow; - Eina_List *l, *list; - - if (wd->idler) - return; - - if (!wd->round) - list = wd->items; - else - list = wd->r_items; - - evas_object_geometry_get(wd->scroller, NULL, NULL, &ow, NULL); - EINA_LIST_FOREACH(list, l, it) - { - evas_object_geometry_get(it->base.view, &x, NULL, &w, NULL); - if (abs((int)(ow / 2 - (int)(x + w / 2))) < 10) - break; - } - - if (!it) - return; - - _select_item(it); -} - -static Eina_Bool -_move_scroller(void *data) -{ - Evas_Object *obj = data; - Widget_Data *wd; - Eina_List *l; - Elm_Diskselector_Item *dit; - Evas_Coord y, w, h; - int i; - - wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - - if (wd->round) - i = 1; - else - i = 0; - - EINA_LIST_FOREACH(wd->items, l, dit) - { - if (wd->selected_item == dit) - break; - i++; - } - if (!dit) - { - wd->selected_item = - (Elm_Diskselector_Item *) eina_list_nth(wd->items, 0); - return EINA_FALSE; - } - - evas_object_geometry_get(wd->scroller, NULL, &y, &w, &h); - elm_smart_scroller_child_region_show(wd->scroller, w / 3 * i, y, w, h); - _select_item(dit); - if (wd->idler) - { - ecore_idler_del(wd->idler); - wd->idler = NULL; - } - wd->init = EINA_TRUE; - _check_string(wd); - - return EINA_TRUE; -} - -static void -_round_item_del(Widget_Data *wd, Elm_Diskselector_Item *it) -{ - if (!it) return; - elm_box_unpack(wd->main_box, it->base.view); - wd->r_items = eina_list_remove(wd->r_items, it); - eina_stringshare_del(it->label); - evas_object_del(it->base.view); - free(it); -} - -static void -_round_items_del(Widget_Data *wd) -{ - _round_item_del(wd, wd->last); - wd->last = NULL; - _round_item_del(wd, wd->s_last); - wd->s_last = NULL; - _round_item_del(wd, wd->second); - wd->second = NULL; - _round_item_del(wd, wd->first); - wd->first = NULL; -} - -static void -_round_items_add(Widget_Data *wd) -{ - Elm_Diskselector_Item *dit; - Elm_Diskselector_Item *it; - - dit = it = eina_list_nth(wd->items, 0); - if (!dit) return; - - if (!wd->first) - { - wd->first = _item_new(it->base.widget, it->icon, it->label, it->func, - it->base.data); - wd->first->node = it->node; - wd->r_items = eina_list_append(wd->r_items, wd->first); - } - - it = eina_list_nth(wd->items, 1); - if (!it) - it = dit; - if (!wd->second) - { - wd->second = _item_new(it->base.widget, it->icon, it->label, it->func, - it->base.data); - wd->second->node = it->node; - wd->r_items = eina_list_append(wd->r_items, wd->second); - } - - it = eina_list_nth(wd->items, wd->item_count - 1); - if (!it) - it = dit; - if (!wd->last) - { - wd->last = _item_new(it->base.widget, it->icon, it->label, it->func, - it->base.data); - wd->last->node = it->node; - wd->r_items = eina_list_prepend(wd->r_items, wd->last); - } - - it = eina_list_nth(wd->items, wd->item_count - 2); - if (!it) - it = dit; - if (!wd->s_last) - { - wd->s_last = _item_new(it->base.widget, it->icon, it->label, it->func, - it->base.data); - wd->s_last->node = it->node; - wd->r_items = eina_list_prepend(wd->r_items, wd->s_last); - } -} - -/** - * Add a new diskselector object - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup Diskselector - */ -EAPI Evas_Object * -elm_diskselector_add(Evas_Object *parent) -{ - Evas_Object *obj; - Widget_Data *wd; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - - wd = ELM_NEW(Widget_Data); - wd->self = obj = elm_widget_add(evas_object_evas_get(parent)); - ELM_SET_WIDTYPE(widtype, "diskselector"); - elm_widget_type_set(obj, "diskselector"); - elm_widget_sub_object_add(parent, obj); - elm_widget_data_set(obj, wd); - elm_widget_del_hook_set(obj, _del_hook); - elm_widget_del_pre_hook_set(obj, _del_pre_hook); - elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); - elm_widget_event_hook_set(obj, _event_hook); - - wd->item_count = 0; - wd->round = EINA_FALSE; - wd->init = EINA_FALSE; - wd->len_side = 3; - - wd->scroller = elm_smart_scroller_add(evas_object_evas_get(parent)); - elm_smart_scroller_widget_set(wd->scroller, obj); - _theme_hook(obj); - elm_widget_resize_object_set(obj, wd->scroller); - elm_smart_scroller_policy_set(wd->scroller, ELM_SMART_SCROLLER_POLICY_OFF, - ELM_SMART_SCROLLER_POLICY_OFF); - elm_smart_scroller_bounce_allow_set(wd->scroller, EINA_TRUE, EINA_FALSE); - evas_object_smart_callback_add(wd->scroller, "scroll", _scroller_move_cb, - wd); - evas_object_smart_callback_add(wd->scroller, "animate,stop", - _scroller_stop_cb, wd); - _elm_theme_object_set(obj, wd->scroller, "diskselector", "base", - "default"); - evas_object_event_callback_add(wd->scroller, EVAS_CALLBACK_RESIZE, - _diskselector_object_resize, obj); - - wd->main_box = elm_box_add(parent); - elm_box_horizontal_set(wd->main_box, EINA_TRUE); - elm_box_homogenous_set(wd->main_box, EINA_TRUE); - evas_object_size_hint_weight_set(wd->main_box, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(wd->main_box, EVAS_HINT_FILL, - EVAS_HINT_FILL); - _elm_theme_object_set(obj, wd->main_box, "diskselector", "base", - "default"); - elm_widget_sub_object_add(obj, wd->main_box); - - elm_smart_scroller_child_set(wd->scroller, wd->main_box); - - wd->left_blank = edje_object_add(evas_object_evas_get(obj)); - _elm_theme_object_set(obj, wd->left_blank, "diskselector", "item", - "default"); - evas_object_size_hint_weight_set(wd->left_blank, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(wd->left_blank, EVAS_HINT_FILL, - EVAS_HINT_FILL); - elm_box_pack_end(wd->main_box, wd->left_blank); - evas_object_show(wd->left_blank); - - wd->right_blank = edje_object_add(evas_object_evas_get(obj)); - _elm_theme_object_set(obj, wd->right_blank, "diskselector", "item", - "default"); - evas_object_size_hint_weight_set(wd->right_blank, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(wd->right_blank, EVAS_HINT_FILL, - EVAS_HINT_FILL); - elm_box_pack_end(wd->main_box, wd->right_blank); - evas_object_show(wd->right_blank); - - _theme_data_get(wd); - - evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - evas_object_smart_callbacks_descriptions_set(obj, _signals); - _sizing_eval(obj); - return obj; -} - -/** - * Get round mode - * - * If round mode is activated the items list will work like a circle list, - * so when the user reaches the last item, the first one will popup. - * - * @param obj The diskselector object - * @return if or not set round mode or false if not a valid diskselector - * - * @ingroup Diskselector - */ -EAPI Eina_Bool -elm_diskselector_round_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->round; -} - -/** - * Set round mode - * - * If round mode is activated the items list will work like a circle list, - * so when the user reaches the last item, the first one will popup. - * - * @param it The item of diskselector - * @param if or not set round mode - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_round_set(Evas_Object * obj, Eina_Bool round) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - if (wd->round == round) - return; - - wd->round = round; - if (round) - { - wd->r_items = eina_list_clone(wd->items); - elm_box_unpack(wd->main_box, wd->left_blank); - evas_object_hide(wd->left_blank); - elm_box_unpack(wd->main_box, wd->right_blank); - evas_object_hide(wd->right_blank); - if (!wd->items) - return; - - _round_items_add(wd); - - if (wd->last) - elm_box_pack_start(wd->main_box, wd->last->base.view); - if (wd->s_last) - elm_box_pack_start(wd->main_box, wd->s_last->base.view); - if (wd->first) - elm_box_pack_end(wd->main_box, wd->first->base.view); - if (wd->second) - elm_box_pack_end(wd->main_box, wd->second->base.view); - } - else - { - _round_items_del(wd); - elm_box_pack_start(wd->main_box, wd->left_blank); - elm_box_pack_end(wd->main_box, wd->right_blank); - eina_list_free(wd->r_items); - wd->r_items = NULL; - } - _sizing_eval(obj); -} - -/** - * Get the side labels max lenght - * - * @param obj The diskselector object - * @return The max lenght defined for side labels, or 0 if not a valid - * diskselector - * - * @ingroup Diskselector - */ -EAPI int -elm_diskselector_side_label_lenght_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return 0; - return wd->len_side; -} - -/** - * Set the side labels max lenght - * - * @param obj The diskselector object - * @param len The max lenght defined for side labels - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_side_label_lenght_set(Evas_Object *obj, int len) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - wd->len_side = len; -} - -/** - * Set bounce mode - * - * This will enable or disable the scroller bounce mode for the diskselector. - * See elm_scroller_bounce_set() for details. Horizontal bounce is enabled by - * default. - * - * @param obj The diskselector object - * @param h_bounce Allow bounce horizontally - * @param v_bounce Allow bounce vertically - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->scroller) - elm_smart_scroller_bounce_allow_set(wd->scroller, h_bounce, v_bounce); -} - -/** - * Get the bounce mode - * - * @param obj The Diskselector object - * @param h_bounce Allow bounce horizontally - * @param v_bounce Allow bounce vertically - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_smart_scroller_bounce_allow_get(wd->scroller, h_bounce, v_bounce); -} - -/** - * Get the scrollbar policy - * - * This sets the scrollbar visibility policy for the given scroller. - * ELM_SMART_SCROLLER_POLICY_AUTO means the scrollber is made visible if it - * is needed, and otherwise kept hidden. ELM_SMART_SCROLLER_POLICY_ON turns - * it on all the time, and ELM_SMART_SCROLLER_POLICY_OFF always keeps it off. - * This applies respectively for the horizontal and vertical scrollbars. - * The both are disabled by default. - * - * @param obj The diskselector object - * @param policy_h Horizontal scrollbar policy - * @param policy_v Vertical scrollbar policy - * - * @ingroup Diskselector - */ - -EAPI void -elm_diskselector_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Elm_Smart_Scroller_Policy s_policy_h, s_policy_v; - Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->scroller)) return; - elm_smart_scroller_policy_get(wd->scroller, &s_policy_h, &s_policy_v); - *policy_h = (Elm_Scroller_Policy) s_policy_h; - *policy_v = (Elm_Scroller_Policy) s_policy_v; -} - - -/** - * Set the scrollbar policy - * - * This sets the scrollbar visibility policy for the given scroller. - * ELM_SMART_SCROLLER_POLICY_AUTO means the scrollber is made visible if it - * is needed, and otherwise kept hidden. ELM_SMART_SCROLLER_POLICY_ON turns - * it on all the time, and ELM_SMART_SCROLLER_POLICY_OFF always keeps it off. - * This applies respectively for the horizontal and vertical scrollbars. - * The both are disabled by default. - * - * @param obj The diskselector object - * @param policy_h Horizontal scrollbar policy - * @param policy_v Vertical scrollbar policy - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if ((policy_h >= 3) || (policy_v >= 3)) return; - if (wd->scroller) - elm_smart_scroller_policy_set(wd->scroller, policy_h, policy_v); -} - -/** - * Clears a diskselector of all items. - * - * @param obj The diskselector object - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_clear(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Elm_Diskselector_Item *it; - - if (!wd) return; - if (!wd->items) return; - - wd->selected_item = NULL; - EINA_LIST_FREE(wd->items, it) _item_del(it); - _round_items_del(wd); - _sizing_eval(obj); -} - -/** - * Returns a list of all the diskselector items. - * - * @param obj The diskselector object - * @return An Eina_List* of the diskselector items, or NULL on failure - * - * @ingroup Diskselector - */ -EAPI const Eina_List * -elm_diskselector_items_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->items; -} - -/** - * Appends an item to the diskselector object. - * - * @param obj The diskselector object - * @param label The label of the diskselector item - * @param icon The icon object to use for the left side of the item - * @param func The function to call when the item is selected - * @param data The data to associate with the item for related callbacks - * - * @return The created item or NULL upon failure - * - * @ingroup Diskselector - */ -EAPI Elm_Diskselector_Item * -elm_diskselector_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) -{ - Elm_Diskselector_Item *it; - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - - it = _item_new(obj, icon, label, func, data); - wd->items = eina_list_append(wd->items, it); - it->node = eina_list_last(wd->items); - wd->item_count++; - if (wd->round) - { - _round_items_del(wd); - wd->r_items = eina_list_append(wd->r_items, it); - _round_items_add(wd); - if (wd->last) - elm_box_pack_start(wd->main_box, wd->last->base.view); - if (wd->s_last) - elm_box_pack_start(wd->main_box, wd->s_last->base.view); - elm_box_pack_end(wd->main_box, it->base.view); - if (wd->first) - elm_box_pack_end(wd->main_box, wd->first->base.view); - if (wd->second) - elm_box_pack_end(wd->main_box, wd->second->base.view); - } - else - { - elm_box_unpack(wd->main_box, wd->right_blank); - elm_box_pack_end(wd->main_box, it->base.view); - elm_box_pack_end(wd->main_box, wd->right_blank); - } - if (!wd->selected_item) - wd->selected_item = it; - if (!wd->idler) - wd->idler = ecore_idler_add(_move_scroller, obj); - _sizing_eval(obj); - return it; -} - -/** - * Delete the item - * - * @param it The item of diskselector - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_del(Elm_Diskselector_Item * it) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it); - Elm_Diskselector_Item *dit; - Widget_Data *wd = elm_widget_data_get(it->base.widget); - if (!wd) return; - - elm_box_unpack(wd->main_box, it->base.view); - - if (wd->round) - wd->r_items = eina_list_remove(wd->r_items, it); - - wd->items = eina_list_remove(wd->items, it); - - if (wd->selected_item == it) - { - dit = (Elm_Diskselector_Item *) eina_list_nth(wd->items, 0); - if (dit != it) - wd->selected_item = dit; - else - wd->selected_item = eina_list_nth(wd->items, 1); - } - - _item_del(it); - wd->item_count -= 1; - - if (wd->round) - { - if (!wd->item_count) - { - evas_object_hide(wd->first->base.view); - evas_object_hide(wd->second->base.view); - evas_object_hide(wd->last->base.view); - evas_object_hide(wd->s_last->base.view); - } - else - { - dit = eina_list_nth(wd->items, 0); - if (dit) - { - eina_stringshare_replace(&wd->first->label, dit->label); - edje_object_part_text_set(wd->first->base.view, "elm.text", - wd->first->label); - } - dit = eina_list_nth(wd->items, 1); - if (dit) - { - eina_stringshare_replace(&wd->second->label, dit->label); - edje_object_part_text_set(wd->second->base.view, "elm.text", - wd->second->label); - } - dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 1); - if (dit) - { - eina_stringshare_replace(&wd->last->label, dit->label); - edje_object_part_text_set(wd->last->base.view, "elm.text", - wd->last->label); - } - dit = eina_list_nth(wd->items, eina_list_count(wd->items) - 2); - if (dit) - { - eina_stringshare_replace(&wd->s_last->label, dit->label); - edje_object_part_text_set(wd->s_last->base.view, "elm.text", - wd->s_last->label); - } - } - } - wd->check_idler = ecore_idler_add(_check_string, wd); - _sizing_eval(it->base.widget); -} - -/** - * Get the label of item - * - * @param it The item of diskselector - * @return The label of item - * - * @ingroup Diskselector - */ -EAPI const char * -elm_diskselector_item_label_get(const Elm_Diskselector_Item * it) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL); - return it->label; -} - -/** - * Set the label of item - * - * @param it The item of diskselector - * @param label The label of item - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_label_set(Elm_Diskselector_Item * it, const char *label) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it); - eina_stringshare_replace(&it->label, label); - edje_object_part_text_set(it->base.view, "elm.text", it->label); -} - -/** - * Get the selected item - * - * @param obj The diskselector object - * @return The selected diskselector item - * - * @ingroup Diskselector - */ -EAPI Elm_Diskselector_Item * -elm_diskselector_selected_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->selected_item; -} - -/** - * Set the selected state of an item - * - * This sets the selected state (EINA_TRUE selected, EINA_FALSE not selected) - * of the given item @p it. - * If a new item is selected the previosly selected will be unselected. - * If the item @p it is unselected, the first item will be selected. - * - * @param it The diskselector item - * @param selected The selected state - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_selected_set(Elm_Diskselector_Item *it, Eina_Bool selected) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it); - Widget_Data *wd; - wd = elm_widget_data_get(it->base.widget); - if (!wd) return; - - if ((wd->selected_item == it) && (selected)) - return; - - if ((wd->selected_item == it) && (!selected)) - wd->selected_item = eina_list_data_get(wd->items); - else - wd->selected_item = it; - - if (!wd->idler) - ecore_idler_add(_move_scroller, it->base.widget); -} - -/* - * Get the selected state of @p item. - * - * @param it The diskselector item - * @return If true, the item is selected - * - * @ingroup Diskselector - */ -EAPI Eina_Bool -elm_diskselector_item_selected_get(const Elm_Diskselector_Item *it) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); - Widget_Data *wd; - - wd = elm_widget_data_get(it->base.widget); - if (!wd) return EINA_FALSE; - return (wd->selected_item == it); -} - -/** - * Set the function called when a diskselector item is freed. - * - * @param it The item to set the callback on - * @param func The function called - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_del_cb_set(Elm_Diskselector_Item *it, Evas_Smart_Cb func) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it); - elm_widget_item_del_cb_set(it, func); -} - -/** - * Returns the data associated with the item. - * - * @param it The diskselector item - * @return The data associated with @p it - * - * @ingroup Diskselector - */ -EAPI void * -elm_diskselector_item_data_get(const Elm_Diskselector_Item *it) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL); - return elm_widget_item_data_get(it); -} - -/** - * Returns the icon associated with the item. - * - * @param it The diskselector item - * @return The icon associated with @p it - * - * @ingroup Diskselector - */ -EAPI Evas_Object * -elm_diskselector_item_icon_get(const Elm_Diskselector_Item *it) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL); - return it->icon; -} - -/** - * Sets the icon associated with the item. - * - * Once the icon object is set, a previously set one will be deleted. - * You probably don't want, then, to have the same icon object set - * for more than one item of the diskselector. - * - * @param it The diskselector item - * @param icon The icon object to associate with @p it - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_icon_set(Elm_Diskselector_Item *it, Evas_Object *icon) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it); - if (it->icon == icon) return; - if (it->icon) - evas_object_del(it->icon); - it->icon = icon; - if (it->base.view) - edje_object_part_swallow(it->base.view, "elm.swallow.icon", icon); -} - -/** - * Gets the item before @p it in the list. - * - * @param it The diskselector item - * @return The item before @p it, or NULL on failure - * - * @ingroup Diskselector - */ -EAPI Elm_Diskselector_Item * -elm_diskselector_item_prev_get(const Elm_Diskselector_Item *it) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL); - if (it->node->prev) return it->node->prev->data; - else return NULL; -} - -/** - * Gets the item after @p it in the list. - * - * @param it The diskselector item - * @return The item after @p it, or NULL on failure - * - * @ingroup Diskselector - */ -EAPI Elm_Diskselector_Item * -elm_diskselector_item_next_get(const Elm_Diskselector_Item *it) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, NULL); - if (it->node->next) return it->node->next->data; - else return NULL; -} - -/** - * Get the first item in the diskselector - * - * @param obj The diskselector object - * @return The first item, or NULL if none - * - * @ingroup Diskselector - */ -EAPI Elm_Diskselector_Item * -elm_diskselector_first_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd || !wd->items) - return NULL; - - return eina_list_data_get(wd->items); -} - -/** - * Get the last item in the diskselector - * - * @param obj The diskselector object - * @return The last item, or NULL if none - * - * @ingroup Diskselector - */ -EAPI Elm_Diskselector_Item * -elm_diskselector_last_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Widget_Data *wd; - wd = elm_widget_data_get(obj); - if (!wd || !wd->items) - return NULL; - - return eina_list_data_get(eina_list_last(wd->items)); -} - -/** - * Set the text to be shown in the diskselector item. - * - * @param item Target item - * @param text The text to set in the content - * - * Setup the text as tooltip to object. The item can have only one tooltip, - * so any previous tooltip data is removed. - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_tooltip_text_set(Elm_Diskselector_Item *item, const char *text) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_text_set(item, text); -} - -/** - * Set the content to be shown in the tooltip item - * - * Setup the tooltip to item. The item can have only one tooltip, - * so any previous tooltip data is removed. @p func(with @p data) will - * be called every time that need show the tooltip and it should - * return a valid Evas_Object. This object is then managed fully by - * tooltip system and is deleted when the tooltip is gone. - * - * @param item the diskselector item being attached a tooltip. - * @param func the function used to create the tooltip contents. - * @param data what to provide to @a func as callback data/context. - * @param del_cb called when data is not needed anymore, either when - * another callback replaces @func, the tooltip is unset with - * elm_diskselector_item_tooltip_unset() or the owner @a item - * dies. This callback receives as the first parameter the - * given @a data, and @c event_info is the item. - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_tooltip_content_cb_set(Elm_Diskselector_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb); -} - -/** - * Unset tooltip from item - * - * @param item diskselector item to remove previously set tooltip. - * - * Remove tooltip from item. The callback provided as del_cb to - * elm_diskselector_item_tooltip_content_cb_set() will be called to notify - * it is not used anymore. - * - * @see elm_diskselector_item_tooltip_content_cb_set() - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_tooltip_unset(Elm_Diskselector_Item *item) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_unset(item); -} - -/** - * Sets a different style for this item tooltip. - * - * @note before you set a style you should define a tooltip with - * elm_diskselector_item_tooltip_content_cb_set() or - * elm_diskselector_item_tooltip_text_set() - * - * @param item diskselector item with tooltip already set. - * @param style the theme style to use (default, transparent, ...) - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_tooltip_style_set(Elm_Diskselector_Item *item, const char *style) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_style_set(item, style); -} - -/** - * Get the style for this item tooltip. - * - * @param item diskselector item with tooltip already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a tooltip set, then NULL is returned. - * - * @ingroup Diskselector - */ -EAPI const char * -elm_diskselector_item_tooltip_style_get(const Elm_Diskselector_Item *item) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_tooltip_style_get(item); -} - -/** - * Set the cursor to be shown when mouse is over the diskselector item - * - * @param item Target item - * @param cursor the cursor name to be used. - * - * @see elm_object_cursor_set() - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_cursor_set(Elm_Diskselector_Item *item, const char *cursor) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_cursor_set(item, cursor); -} - -/** - * Get the cursor to be shown when mouse is over the diskselector item - * - * @param item diskselector item with cursor already set. - * @return the cursor name. - * - * @ingroup Diskselector - */ -EAPI const char * -elm_diskselector_item_cursor_get(const Elm_Diskselector_Item *item) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_cursor_get(item); -} - -/** - * Unset the cursor to be shown when mouse is over the diskselector item - * - * @param item Target item - * - * @see elm_object_cursor_unset() - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_cursor_unset(Elm_Diskselector_Item *item) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_cursor_unset(item); -} - -/** - * Sets a different style for this item cursor. - * - * @note before you set a style you should define a cursor with - * elm_diskselector_item_cursor_set() - * - * @param item diskselector item with cursor already set. - * @param style the theme style to use (default, transparent, ...) - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_cursor_style_set(Elm_Diskselector_Item *item, const char *style) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_cursor_style_set(item, style); -} - -/** - * Get the style for this item cursor. - * - * @param item diskselector item with cursor already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a cursor set, then NULL is returned. - * - * @ingroup Diskselector - */ -EAPI const char * -elm_diskselector_item_cursor_style_get(const Elm_Diskselector_Item *item) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_cursor_style_get(item); -} - -/** - * Set if the cursor set should be searched on the theme or should use - * the provided by the engine, only. - * - * @note before you set if should look on theme you should define a cursor - * with elm_object_cursor_set(). By default it will only look for cursors - * provided by the engine. - * - * @param item widget item with cursor already set. - * @param engine_only boolean to define it cursors should be looked only - * between the provided by the engine or searched on widget's theme as well. - * - * @ingroup Diskselector - */ -EAPI void -elm_diskselector_item_cursor_engine_only_set(Elm_Diskselector_Item *item, Eina_Bool engine_only) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item); - elm_widget_item_cursor_engine_only_set(item, engine_only); -} - -/** - * Get the cursor engine only usage for this item cursor. - * - * @param item widget item with cursor already set. - * @return engine_only boolean to define it cursors should be looked only - * between the provided by the engine or searched on widget's theme as well. If - * the object does not have a cursor set, then EINA_FALSE is returned. - * - * @ingroup Diskselector - */ -EAPI Eina_Bool -elm_diskselector_item_cursor_engine_only_get(const Elm_Diskselector_Item *item) -{ - ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(item, EINA_FALSE); - return elm_widget_item_cursor_engine_only_get(item); -} diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 4d049e9..b3e5170 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1,10 +1,12 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include -#include #include "elm_priv.h" #include "elm_module_priv.h" - /** * @defgroup Entry Entry + * @ingroup Elementary * * An entry is a convenience widget which shows * a box that the user can enter text into. Unlike a @@ -12,15 +14,15 @@ * input. Entry widgets are capable of expanding past the * boundaries of the window, thus resizing the window to its * own length. - * + * * You can also insert "items" in the entry with: - * + * * \\ - * + * * for example. sizing can be set bu size=WxH, relsize=WxH or absize=WxH with * vsize=ascent or vsize=full. the href=NAME sets the item name. Entry * supports a list of emoticon names by default. These are: - * + * * - emoticon/angry * - emoticon/angry-shout * - emoticon/crazy-laugh @@ -65,14 +67,9 @@ * These are built-in currently, but you can add your own item provieer that * can create inlined objects in the text and fill the space allocated to the * item with a custom object of your own. - * + * * See the entry test for some more examples of use of this. - * - * Entries have functions to load a text file, display it, - * allowing editing of it and saving of changes back to the file loaded. - * Changes are written back to the original file after a short delay. - * The file to load and save to is specified by elm_entry_file_set(). - * + * * Signals that you can add callbacks for are: * - "changed" - The text within the entry was changed * - "activated" - The entry has had editing finished and changes are to be committed (generally when enter key is pressed) @@ -95,33 +92,29 @@ typedef struct _Mod_Api Mod_Api; typedef struct _Widget_Data Widget_Data; -typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item; typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider; -typedef struct _Elm_Entry_Text_Filter Elm_Entry_Text_Filter; struct _Widget_Data { Evas_Object *ent; + Evas_Object *popup;/*copy paste UI - elm_popup*/ + Evas_Object *ctxpopup;/*copy paste UI - elm_ctxpopup*/ Evas_Object *bg; Evas_Object *hoversel; Ecore_Job *deferred_recalc_job; Ecore_Event_Handler *sel_notify_handler; Ecore_Event_Handler *sel_clear_handler; Ecore_Timer *longpress_timer; - Ecore_Timer *delay_write; /* Only for clipboard */ const char *cut_sel; const char *text; Evas_Coord wrap_w; int ellipsis_threshold; - const char *file; - Elm_Text_Format format; Evas_Coord lastw; Evas_Coord downx, downy; Evas_Coord cx, cy, cw, ch; Eina_List *items; Eina_List *item_providers; - Eina_List *text_filters; Ecore_Job *hovdeljob; Mod_Api *api; // module api if supplied int max_no_of_bytes; @@ -134,18 +127,14 @@ struct _Widget_Data Eina_Bool editable : 1; Eina_Bool selection_asked : 1; Eina_Bool have_selection : 1; - Eina_Bool handler_moving : 1; Eina_Bool selmode : 1; Eina_Bool deferred_cur : 1; Eina_Bool disabled : 1; Eina_Bool double_clicked : 1; - Eina_Bool long_pressed : 1; Eina_Bool context_menu : 1; Eina_Bool drag_selection_asked : 1; Eina_Bool bgcolor : 1; Eina_Bool ellipsis : 1; - Eina_Bool can_write : 1; - Eina_Bool autosave : 1; Eina_Bool autoreturnkey : 1; Eina_Bool input_panel_enable : 1; Eina_Bool autocapital : 1; @@ -153,29 +142,12 @@ struct _Widget_Data Eina_Bool autoperiod : 1; }; -struct _Elm_Entry_Context_Menu_Item -{ - Evas_Object *obj; - const char *label; - const char *icon_file; - const char *icon_group; - Elm_Icon_Type icon_type; - Evas_Smart_Cb func; - void *data; -}; - struct _Elm_Entry_Item_Provider { Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item); void *data; }; -struct _Elm_Entry_Text_Filter -{ - void (*func) (void *data, Evas_Object *entry, char **text); - void *data; -}; - static const char *widtype = NULL; // start for cbhm static Evas_Object *cnpwidgetdata = NULL; @@ -206,6 +178,7 @@ static int _stringshare_key_value_replace(const char **srcstring, char *key, con static int _is_width_over(Evas_Object *obj); static void _ellipsis_entry_to_width(Evas_Object *obj); static void _reverse_ellipsis_entry(Evas_Object *obj); +static Eina_Bool *_textinput_control_function(void *data,void *input_data); static int _entry_length_get(Evas_Object *obj); static const char SIG_CHANGED[] = "changed"; @@ -224,6 +197,7 @@ static const char SIG_SELECTION_CHANGED[] = "selection,changed"; static const char SIG_SELECTION_CLEARED[] = "selection,cleared"; static const char SIG_CURSOR_CHANGED[] = "cursor,changed"; static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked"; + static const Evas_Smart_Cb_Description _signals[] = { {SIG_CHANGED, ""}, {SIG_ACTIVATED, ""}, @@ -271,187 +245,34 @@ _module(Evas_Object *obj __UNUSED__) ((Mod_Api *)(m->api) )->obj_longpress = // called on long press menu _elm_module_symbol_get(m, "obj_longpress"); ((Mod_Api *)(m->api) )->obj_hidemenu = // called on hide menu - _elm_module_symbol_get(m, "obj_hidemenu"); - ((Mod_Api *)(m->api) )->obj_mouseup = // called on mouseup - _elm_module_symbol_get(m, "obj_mouseup"); + _elm_module_symbol_get(m, "obj_hidemenu"); + ((Mod_Api *)(m->api) )->obj_mouseup = // called on mouseup + _elm_module_symbol_get(m, "obj_mouseup"); ok: // ok - return api return m->api; } -static char * -_buf_append(char *buf, const char *str, int *len, int *alloc) -{ - int len2 = strlen(str); - if ((*len + len2) >= *alloc) - { - char *buf2 = realloc(buf, *alloc + len2 + 512); - if (!buf2) return NULL; - buf = buf2; - *alloc += (512 + len2); - } - strcpy(buf + *len, str); - *len += len2; - return buf; -} - -static char * -_load_file(const char *file) -{ - FILE *f; - size_t size; - int alloc = 0, len = 0; - char *text = NULL, buf[PATH_MAX]; - - f = fopen(file, "rb"); - if (!f) return NULL; - while ((size = fread(buf, 1, sizeof(buf), f))) - { - char *tmp_text; - buf[size] = 0; - tmp_text = _buf_append(text, buf, &len, &alloc); - if (!tmp_text) break; - text = tmp_text; - } - fclose(f); - return text; -} - -static char * -_load_plain(const char *file) -{ - char *text; - - text = _load_file(file); - if (text) - { - char *text2; - - text2 = elm_entry_utf8_to_markup(text); - free(text); - return text2; - } - return NULL; -} - -static void -_load(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - char *text; - if (!wd) return; - if (!wd->file) - { - elm_entry_entry_set(obj, ""); - return; - } - switch (wd->format) - { - case ELM_TEXT_FORMAT_PLAIN_UTF8: - text = _load_plain(wd->file); - break; - case ELM_TEXT_FORMAT_MARKUP_UTF8: - text = _load_file(wd->file); - break; - default: - text = NULL; - break; - } - if (text) - { - elm_entry_entry_set(obj, text); - free(text); - } - else - elm_entry_entry_set(obj, ""); -} - -static void -_save_markup_utf8(const char *file, const char *text) -{ - FILE *f; - - if ((!text) || (!text[0])) - { - ecore_file_unlink(file); - return; - } - f = fopen(file, "wb"); - if (!f) - { - // FIXME: report a write error - return; - } - fputs(text, f); // FIXME: catch error - fclose(f); -} - -static void -_save_plain_utf8(const char *file, const char *text) -{ - char *text2; - - text2 = elm_entry_markup_to_utf8(text); - if (!text2) - return; - _save_markup_utf8(file, text2); - free(text2); -} - -static void -_save(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (!wd->file) return; - switch (wd->format) - { - case ELM_TEXT_FORMAT_PLAIN_UTF8: - _save_plain_utf8(wd->file, elm_entry_entry_get(obj)); - break; - case ELM_TEXT_FORMAT_MARKUP_UTF8: - _save_markup_utf8(wd->file, elm_entry_entry_get(obj)); - break; - default: - break; - } -} - -static Eina_Bool -_delay_write(void *data) -{ - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) return ECORE_CALLBACK_CANCEL; - _save(data); - wd->delay_write = NULL; - return ECORE_CALLBACK_CANCEL; -} - -static void -_del_pre_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->delay_write) - { - ecore_timer_del(wd->delay_write); - wd->delay_write = NULL; - if (wd->autosave) _save(obj); - } -} - static void _del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Elm_Entry_Context_Menu_Item *it; Elm_Entry_Item_Provider *ip; - Elm_Entry_Text_Filter *tf; - - if (wd->file) eina_stringshare_del(wd->file); + Evas_Object *parent_obj = obj; + Evas_Object *above = NULL; if (wd->hovdeljob) ecore_job_del(wd->hovdeljob); if ((wd->api) && (wd->api->obj_unhook)) wd->api->obj_unhook(obj); // module - unhook + /* added for locating parents as they were */ + while (parent_obj) + { + above = evas_object_data_get(parent_obj, "raise"); + if (above) + evas_object_stack_below(parent_obj, above); + parent_obj = elm_widget_parent_get(parent_obj); + } + entries = eina_list_remove(entries, obj); #ifdef HAVE_ELEMENTARY_X ecore_event_handler_del(wd->sel_notify_handler); @@ -473,10 +294,6 @@ _del_hook(Evas_Object *obj) { free(ip); } - EINA_LIST_FREE(wd->text_filters, tf) - { - free(tf); - } free(wd); } @@ -491,9 +308,6 @@ _theme_hook(Evas_Object *obj) _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj)); elm_entry_entry_set(obj, t); eina_stringshare_del(t); - if (elm_widget_disabled_get(obj)) - edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm"); - edje_object_message_signal_process(wd->ent); edje_object_scale_set(wd->ent, elm_widget_scale_get(obj) * _elm_config->scale); edje_object_part_text_autocapitalization_set(wd->ent, "elm.text", wd->autocapital); edje_object_part_text_autoperiod_set(wd->ent, "elm.text", wd->autoperiod); @@ -535,6 +349,7 @@ _elm_win_recalc_job(void *data) wd->deferred_recalc_job = NULL; evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh); resh = 0; + minminw = 0; edje_object_size_min_restricted_calc(wd->ent, &minw, &minh, 0, 0); elm_coords_finger_size_adjust(1, &minw, 1, &minh); minminw = minw; @@ -554,7 +369,7 @@ _sizing_eval(Evas_Object *obj) Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Evas_Coord resw, resh; if (!wd) return; - if ((wd->linewrap) || (wd->char_linewrap)) + if (wd->linewrap || wd->char_linewrap) { evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh); if ((resw == wd->lastw) && (!wd->changed)) return; @@ -617,37 +432,35 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) { evas_object_focus_set(wd->ent, EINA_TRUE); edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); + if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL); _check_enable_returnkey(obj); - while (parent_obj) - { - above = evas_object_above_get(parent_obj); - if (above) - evas_object_data_set(parent_obj, "raise", above); - evas_object_raise(parent_obj); - parent_obj = elm_widget_parent_get(parent_obj); - } + while (parent_obj) + { + above = evas_object_above_get(parent_obj); + if (above) + evas_object_data_set(parent_obj, "raise", above); + evas_object_raise(parent_obj); + parent_obj = elm_widget_parent_get(parent_obj); + } } else { edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm"); + //edje_object_part_text_set(wd->ent, "elm_entry_remain_byte_count", ""); evas_object_focus_set(wd->ent, EINA_FALSE); if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF); evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL); - while (parent_obj) - { - above = evas_object_data_get(parent_obj, "raise"); - if (above) - evas_object_stack_below(parent_obj, above); - parent_obj = elm_widget_parent_get(parent_obj); - } - if ((wd->api) && (wd->api->obj_hidemenu)) - { - wd->api->obj_hidemenu(data); - } + while (parent_obj) + { + above = evas_object_data_get(parent_obj, "raise"); + if (above) + evas_object_stack_below(parent_obj, above); + parent_obj = elm_widget_parent_get(parent_obj); + } } } @@ -667,19 +480,12 @@ _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *so edje_object_signal_callback_add(wd->ent, emission, source, func_cb, data); } -static void +static void * _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) { Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_del_full(wd->ent, emission, source, func_cb, - data); -} - -static void -_on_focus_region_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text", x, y, w, h); + if (!wd) return NULL; + return edje_object_signal_callback_del(wd->ent, emission, source, func_cb); } static void @@ -719,7 +525,7 @@ _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - if ((wd->linewrap) || (wd->char_linewrap)) + if (wd->linewrap || wd->char_linewrap) { _sizing_eval(data); } @@ -733,7 +539,7 @@ _hover_del(void *data) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - + if (wd->hoversel) { evas_object_del(wd->hoversel); @@ -765,7 +571,7 @@ _selectall(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) if (!wd) return; wd->selmode = EINA_TRUE; if (!wd->password) - edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE); + edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE); edje_object_signal_emit(wd->ent, "elm,state,select,on", "elm"); edje_object_part_text_select_all(wd->ent, "elm.text"); //elm_widget_scroll_hold_push(data); @@ -811,7 +617,7 @@ _store_selection(Elm_Sel_Type seltype, Evas_Object *obj) sel = edje_object_part_text_selection_get(wd->ent, "elm.text"); elm_selection_set(seltype, obj, ELM_SEL_FORMAT_MARKUP, sel); if (seltype == ELM_SEL_CLIPBOARD) - eina_stringshare_replace(&wd->cut_sel, sel); + eina_stringshare_replace(&wd->cut_sel, sel); } static void @@ -884,6 +690,7 @@ _item_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__) { Elm_Entry_Context_Menu_Item *it = data; Evas_Object *obj2 = it->obj; + if (it->func) it->func(it->data, obj2, NULL); } @@ -895,6 +702,13 @@ _long_press(void *data) const Eina_List *l; const Elm_Entry_Context_Menu_Item *it; if (!wd) return ECORE_CALLBACK_CANCEL; + + if (wd->longpress_timer) + { + ecore_timer_del(wd->longpress_timer); + wd->longpress_timer = NULL; + } + if ((wd->api) && (wd->api->obj_longpress)) { wd->api->obj_longpress(data); @@ -986,8 +800,6 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void wd->longpress_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data); wd->downx = ev->canvas.x; wd->downy = ev->canvas.y; - - wd->long_pressed = EINA_FALSE; } static void @@ -1007,11 +819,9 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * } if (wd->longpress_timer) { - ecore_timer_del(wd->longpress_timer); - wd->longpress_timer = NULL; + ecore_timer_del(wd->longpress_timer); + wd->longpress_timer = NULL; } - - elm_object_scroll_freeze_pop(data); } static void @@ -1109,6 +919,181 @@ _getbase(Evas_Object *obj) return "base"; } +static char * +_str_append(char *str, const char *txt, int *len, int *alloc) +{ + int txt_len = strlen(txt); + + if (txt_len <= 0) return str; + if ((*len + txt_len) >= *alloc) + { + char *str2; + int alloc2; + + alloc2 = *alloc + txt_len + 128; + str2 = realloc(str, alloc2); + if (!str2) return str; + *alloc = alloc2; + str = str2; + } + strcpy(str + *len, txt); + *len += txt_len; + return str; +} + +/*FIXME: Sholud be implemented somewhere else, it really depends on the context + * because some markups can be implemented otherwise according to style. + * probably doing it in textblock and making it translate according to it's + * style is correct. */ +static char * +_strncpy(char* dest, const char* src, size_t count) +{ + if (!dest) + { + ERR( "dest is NULL" ); + return NULL; + } + if (!src) + { + ERR( "src is NULL" ); + return NULL; + } + if (count < 0) + { + ERR( "count is smaller than 0" ); + return NULL; + } + + return strncpy( dest, src, count ); +} + +static char * +_mkup_to_text(const char *mkup) +{ + char *str = NULL; + int str_len = 0, str_alloc = 0; + char *s, *p; + char *tag_start, *tag_end, *esc_start, *esc_end, *ts; + + if (!mkup) return NULL; + s=p=NULL; + tag_start = tag_end = esc_start = esc_end = NULL; + p = (char *)mkup; + s = p; + for (;;) + { + if (((p!=NULL)&&(*p == 0)) || + (tag_end) || (esc_end) || + (tag_start) || (esc_start)) + { + if (tag_end) + { + char *ttag; + + ttag = malloc(tag_end - tag_start); + if (ttag) + { + _strncpy(ttag, tag_start + 1, tag_end - tag_start - 1); + ttag[tag_end - tag_start - 1] = 0; + if (!strcmp(ttag, "br")) + str = _str_append(str, "\n", &str_len, &str_alloc); + else if (!strcmp(ttag, "\n")) + str = _str_append(str, "\n", &str_len, &str_alloc); + else if (!strcmp(ttag, "\\n")) + str = _str_append(str, "\n", &str_len, &str_alloc); + else if (!strcmp(ttag, "\t")) + str = _str_append(str, "\t", &str_len, &str_alloc); + else if (!strcmp(ttag, "\\t")) + str = _str_append(str, "\t", &str_len, &str_alloc); + else if (!strcmp(ttag, "ps")) /* Unicode paragraph separator */ + str = _str_append(str, "\xE2\x80\xA9", &str_len, &str_alloc); + free(ttag); + } + tag_start = tag_end = NULL; + } + else if (esc_end) + { + ts = malloc(esc_end - esc_start + 1); + if (ts) + { + const char *esc; + _strncpy(ts, esc_start, esc_end - esc_start); + ts[esc_end - esc_start] = 0; + esc = evas_textblock_escape_string_get(ts); + if (esc) + str = _str_append(str, esc, &str_len, &str_alloc); + free(ts); + } + esc_start = esc_end = NULL; + } + else if ((p!=NULL)&&(*p == 0)) + { + ts = malloc(p - s + 1); + if (ts) + { + _strncpy(ts, s, p - s); + ts[p - s] = 0; + str = _str_append(str, ts, &str_len, &str_alloc); + free(ts); + } + break; + } + } + if ((p!=NULL)&&(*p == '<')) + { + if (!esc_start) + { + tag_start = p; + tag_end = NULL; + ts = malloc(p - s + 1); + if (ts) + { + _strncpy(ts, s, p - s); + ts[p - s] = 0; + str = _str_append(str, ts, &str_len, &str_alloc); + free(ts); + } + s = NULL; + } + } + else if ((p!=NULL)&&(*p == '>')) + { + if (tag_start) + { + tag_end = p; + s = p + 1; + } + } + else if ((p!=NULL)&&(*p == '&')) + { + if (!tag_start) + { + esc_start = p; + esc_end = NULL; + ts = malloc(p - s + 1); + if (ts) + { + _strncpy(ts, s, p - s); + ts[p - s] = 0; + str = _str_append(str, ts, &str_len, &str_alloc); + free(ts); + } + s = NULL; + } + } + else if ((p!=NULL)&&(*p == ';')) + { + if (esc_start) + { + esc_end = p; + s = p + 1; + } + } + p++; + } + return str; +} + static int _entry_length_get(Evas_Object *obj) { @@ -1116,7 +1101,7 @@ _entry_length_get(Evas_Object *obj) const char *str = elm_entry_entry_get(obj); if (!str) return 0; - char *plain_str = _elm_util_mkup_to_text(str); + char *plain_str = _mkup_to_text(str); if (!plain_str) return 0; len = strlen(plain_str); @@ -1125,6 +1110,43 @@ _entry_length_get(Evas_Object *obj) return len; } +static char * +_text_to_mkup(const char *text) +{ + char *str = NULL; + int str_len = 0, str_alloc = 0; + int ch, pos = 0, pos2 = 0; + + if (!text) return NULL; + for (;;) + { + pos = pos2; + pos2 = evas_string_char_next_get((char *)(text), pos2, &ch); + if ((ch <= 0) || (pos2 <= 0)) break; + if (ch == '\n') + str = _str_append(str, "
", &str_len, &str_alloc); + else if (ch == '\t') + str = _str_append(str, "<\t>", &str_len, &str_alloc); + else if (ch == '<') + str = _str_append(str, "<", &str_len, &str_alloc); + else if (ch == '>') + str = _str_append(str, ">", &str_len, &str_alloc); + else if (ch == '&') + str = _str_append(str, "&", &str_len, &str_alloc); + else if (ch == 0x2029) + str = _str_append(str, "", &str_len, &str_alloc); + else + { + char tstr[16]; + + _strncpy(tstr, text + pos, pos2 - pos); + tstr[pos2 - pos] = 0; + str = _str_append(str, tstr, &str_len, &str_alloc); + } + } + return str; +} + static void _signal_entry_changed(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { @@ -1136,13 +1158,6 @@ _signal_entry_changed(void *data, Evas_Object *obj __UNUSED__, const char *emiss wd->text = NULL; _check_enable_returnkey(data); evas_object_smart_callback_call(data, SIG_CHANGED, NULL); - if (wd->delay_write) - { - ecore_timer_del(wd->delay_write); - wd->delay_write = NULL; - } - if ((!wd->autosave) || (!wd->file)) return; - wd->delay_write = ecore_timer_add(2.0, _delay_write, data); } static void @@ -1215,18 +1230,18 @@ _signal_selection_changed(void *data, Evas_Object *obj __UNUSED__, const char *e wd->selmode = EINA_TRUE; evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL); elm_selection_set(ELM_SEL_PRIMARY, obj, ELM_SEL_FORMAT_MARKUP, - elm_entry_selection_get(data)); + elm_entry_selection_get(data)); edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text", &cx, &cy, &cw, &ch); if (!wd->deferred_recalc_job) - elm_widget_show_region_set(data, cx, cy, cw, ch + elm_finger_size_get()); + elm_widget_show_region_set(data, cx, cy, cw, ch + elm_finger_size_get()); else { - wd->deferred_cur = EINA_TRUE; - wd->cx = cx; - wd->cy = cy; - wd->cw = cw; - wd->ch = ch + elm_finger_size_get(); + wd->deferred_cur = EINA_TRUE; + wd->cx = cx; + wd->cy = cy; + wd->cw = cw; + wd->ch = ch + elm_finger_size_get(); } } @@ -1282,8 +1297,7 @@ _signal_entry_paste_request(void *data, Evas_Object *obj __UNUSED__, const char if ((top) && (elm_win_xwindow_get(top))) { wd->selection_asked = EINA_TRUE; - elm_selection_get(ELM_SEL_CLIPBOARD, ELM_SEL_FORMAT_MARKUP, data, - NULL, NULL); + elm_selection_get(ELM_SEL_CLIPBOARD, ELM_SEL_FORMAT_MARKUP, data, NULL, NULL); } #endif } @@ -1443,6 +1457,9 @@ _signal_mouse_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emiss Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; evas_object_smart_callback_call(data, SIG_CLICKED, NULL); + +// if (wd->have_selection) +// _long_press(data); } static void @@ -1461,7 +1478,7 @@ _event_selection_notify(void *data, int type __UNUSED__, void *event) Widget_Data *wd = elm_widget_data_get(data); Ecore_X_Event_Selection_Notify *ev = event; if (!wd) return ECORE_CALLBACK_PASS_ON; - if ((!wd->selection_asked) && (!wd->drag_selection_asked)) + if (!wd->selection_asked && !wd->drag_selection_asked) return ECORE_CALLBACK_PASS_ON; if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) || @@ -1474,7 +1491,7 @@ _event_selection_notify(void *data, int type __UNUSED__, void *event) { if (text_data->text) { - char *txt = _elm_util_text_to_mkup(text_data->text); + char *txt = _text_to_mkup(text_data->text); if (txt) { @@ -1494,7 +1511,7 @@ _event_selection_notify(void *data, int type __UNUSED__, void *event) { if (text_data->text) { - char *txt = _elm_util_text_to_mkup(text_data->text); + char *txt = _text_to_mkup(text_data->text); if (txt) { @@ -1548,7 +1565,6 @@ _event_selection_clear(void *data, int type __UNUSED__, void *event) return ECORE_CALLBACK_PASS_ON; } - static Eina_Bool _drag_drop_cb(void *data __UNUSED__, Evas_Object *obj, Elm_Selection_Data *drop) { @@ -1558,13 +1574,13 @@ _drag_drop_cb(void *data __UNUSED__, Evas_Object *obj, Elm_Selection_Data *drop) wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; - printf("Inserting at (%d,%d) %s\n",drop->x,drop->y,(char*)drop->data); +//printf("Inserting at (%d,%d) %s\n",drop->x,drop->y,(char*)drop->data); edje_object_part_text_cursor_copy(wd->ent, "elm.text", EDJE_CURSOR_MAIN,/*->*/EDJE_CURSOR_USER); rv = edje_object_part_text_cursor_coord_set(wd->ent,"elm.text", EDJE_CURSOR_MAIN,drop->x,drop->y); - if (!rv) printf("Warning: Failed to position cursor: paste anyway\n"); +// if (!rv) printf("Warning: Failed to position cursor: paste anyway\n"); elm_entry_entry_insert(obj, drop->data); edje_object_part_text_cursor_copy(wd->ent, "elm.text", EDJE_CURSOR_USER,/*->*/EDJE_CURSOR_MAIN); @@ -1580,6 +1596,7 @@ _get_item(void *data, Evas_Object *edje __UNUSED__, const char *part __UNUSED__, Evas_Object *o; Eina_List *l; Elm_Entry_Item_Provider *ip; + int ok = 0; EINA_LIST_FOREACH(wd->item_providers, l, ip) { @@ -1589,7 +1606,7 @@ _get_item(void *data, Evas_Object *edje __UNUSED__, const char *part __UNUSED__, if (!strncmp(item, "file://", 7)) { const char *fname = item + 7; - + o = evas_object_image_filled_add(evas_object_evas_get(data)); evas_object_image_file_set(o, fname, NULL); if (evas_object_image_load_error_get(o) == EVAS_LOAD_ERROR_NONE) @@ -1605,7 +1622,9 @@ _get_item(void *data, Evas_Object *edje __UNUSED__, const char *part __UNUSED__, return o; } o = edje_object_add(evas_object_evas_get(data)); - if (!_elm_theme_object_set(data, o, "entry", item, elm_widget_style_get(data))) + if (!strncmp(item, "emoticon/", 9)) + ok = _elm_theme_object_set(data, o, "entry", item, elm_widget_style_get(data)); + if (!ok) _elm_theme_object_set(data, o, "entry/emoticon", "wtf", elm_widget_style_get(data)); return o; } @@ -1717,11 +1736,15 @@ _strbuf_key_value_replace(Eina_Strbuf *srcbuf, char *key, const char *value, int { replocater = curlocater + strlen(key) + 1; - while ((*replocater) && (*replocater != ' ') && (*replocater != '>')) + while (*replocater && *replocater == ' ' || *replocater == '=') replocater++; + while (*replocater && *replocater != ' ' && *replocater != '>') + replocater++; + if (replocater-curlocater > strlen(key)+1) { + replocater--; eina_strbuf_append_n(diffbuf, curlocater, replocater-curlocater+1); } else @@ -2026,25 +2049,6 @@ static Eina_Bool *_textinput_control_function(void *data,void *input_data) return EINA_FALSE; } - -static void -_text_filter(void *data, Evas_Object *edje __UNUSED__, const char *part __UNUSED__, Edje_Text_Filter_Type type, char **text) -{ - Widget_Data *wd = elm_widget_data_get(data); - Eina_List *l; - Elm_Entry_Text_Filter *tf; - - if (type == EDJE_TEXT_FILTER_FORMAT) - return; - - EINA_LIST_FOREACH(wd->text_filters, l, tf) - { - tf->func(tf->data, data, text); - if (!*text) - break; - } -} - /** * This adds an entry to @p parent object. * @@ -2060,11 +2064,8 @@ elm_entry_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; wd->bgcolor = EINA_FALSE; wd->bg = evas_object_rectangle_add(e); evas_object_color_set(wd->bg, 0, 0, 0, 0); @@ -2075,16 +2076,12 @@ elm_entry_add(Evas_Object *parent) elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); - elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_on_focus_region_hook_set(obj, _on_focus_region_hook); elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - elm_object_cursor_set(obj, ELM_CURSOR_XTERM); elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_highlight_ignore_set(obj, EINA_TRUE); wd->linewrap = EINA_TRUE; wd->ellipsis = EINA_FALSE; @@ -2092,14 +2089,12 @@ elm_entry_add(Evas_Object *parent) wd->editable = EINA_TRUE; wd->disabled = EINA_FALSE; wd->context_menu = EINA_TRUE; - wd->autosave = EINA_TRUE; wd->autoperiod = EINA_TRUE; wd->ellipsis_threshold = 0; wd->ent = edje_object_add(e); edje_object_item_provider_set(wd->ent, _get_item, obj); - edje_object_text_insert_filter_callback_add(wd->ent,"elm.text", _text_filter, obj); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOVE, _move, obj); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_RESIZE, _resize, obj); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_DOWN, @@ -2276,6 +2271,7 @@ elm_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes) Widget_Data *wd = elm_widget_data_get(obj); wd->max_no_of_bytes = max_no_of_bytes; + edje_object_signal_emit(wd->ent, "elm,state,remain,bytes,show", "elm"); edje_object_part_textinput_callback_set(wd->ent, "elm.text", _textinput_control_function,obj); } @@ -2325,6 +2321,34 @@ elm_entry_password_set(Evas_Object *obj, Eina_Bool password) _sizing_eval(obj); } +/** + * This set's the entry in password mode with out masking the last character entered by user, + * and later masking the character after 2 seconds. + + * @param obj The entry object + * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character" + * 0 for default). + * + * @ingroup Entry + */ +EAPI void +elm_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character) +{ + Widget_Data *wd = elm_widget_data_get(obj); + const char *t; + if (!wd) return; + if ((wd->password == show_last_character)&&(wd->show_last_character ==show_last_character)) return; + wd->show_last_character = show_last_character; + wd->password = show_last_character; + wd->single_line = EINA_TRUE; + wd->linewrap = EINA_FALSE; + wd->char_linewrap = EINA_FALSE; + t = eina_stringshare_add(elm_entry_entry_get(obj)); + _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj)); + elm_entry_entry_set(obj, t); + eina_stringshare_del(t); + _sizing_eval(obj); +} /** * This returns whether password mode is enabled. @@ -2400,8 +2424,8 @@ elm_entry_entry_get(const Evas_Object *obj) text = edje_object_part_text_get(wd->ent, "elm.text"); if (!text) { - ERR("text=NULL for edje %p, part 'elm.text'", wd->ent); - return NULL; + ERR("text=NULL for edje %p, part 'elm.text'", wd->ent); + return NULL; } eina_stringshare_replace(&wd->text, text); if(wd->password)return elm_entry_markup_to_utf8(wd->text); @@ -2426,13 +2450,8 @@ elm_entry_selection_get(const Evas_Object *obj) } /** - * This inserts text in @p entry where the current cursor position. - * - * This inserts text at the cursor position is as if it was typed - * by the user (note this also allows markup which a user - * can't just "type" as it would be converted to escaped text, so this - * call can be used to insert things like emoticon items or bold push/pop - * tags, other font and color change tags etc.) + * This inserts text in @p entry at the beginning of the entry + * object. * * @param obj The entry object * @param entry The text to insert @@ -3017,7 +3036,7 @@ elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *dat ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider)); if (!ip) return; ip->func = func; @@ -3043,7 +3062,7 @@ elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *da ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider)); if (!ip) return; ip->func = func; @@ -3071,7 +3090,7 @@ elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *dat Eina_List *l; Elm_Entry_Item_Provider *ip; if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(func); + if (!func) return; EINA_LIST_FOREACH(wd->item_providers, l, ip) { if ((ip->func == func) && (ip->data == data)) @@ -3084,106 +3103,6 @@ elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *dat } /** - * Append a filter function for text inserted in the entry - * - * Append the given callback to the list. This functions will be called - * whenever any text is inserted into the entry, with the text to be inserted - * as a parameter. The callback function is free to alter the text in any way - * it wants, but it must remember to free the given pointer and update it. - * If the new text is to be discarded, the function can free it and set it text - * parameter to NULL. This will also prevent any following filters from being - * called. - * - * @param obj The entry object - * @param func The function to use as text filter - * @param data User data to pass to @p func - * - * @ingroup Entry - */ -EAPI void -elm_entry_text_filter_append(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) -{ - Widget_Data *wd; - Elm_Entry_Text_Filter *tf; - ELM_CHECK_WIDTYPE(obj, widtype); - - wd = elm_widget_data_get(obj); - - EINA_SAFETY_ON_NULL_RETURN(func); - - tf = ELM_NEW(Elm_Entry_Text_Filter); - if (!tf) return; - tf->func = func; - tf->data = data; - wd->text_filters = eina_list_append(wd->text_filters, tf); -} - -/** - * Prepend a filter function for text insdrted in the entry - * - * Prepend the given callback to the list. See elm_entry_text_filter_append() - * for more information - * - * @param obj The entry object - * @param func The function to use as text filter - * @param data User data to pass to @p func - * - * @ingroup Entry - */ -EAPI void -elm_entry_text_filter_prepend(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) -{ - Widget_Data *wd; - Elm_Entry_Text_Filter *tf; - ELM_CHECK_WIDTYPE(obj, widtype); - - wd = elm_widget_data_get(obj); - - EINA_SAFETY_ON_NULL_RETURN(func); - - tf = ELM_NEW(Elm_Entry_Text_Filter); - if (!tf) return; - tf->func = func; - tf->data = data; - wd->text_filters = eina_list_prepend(wd->text_filters, tf); -} - -/** - * Remove a filter from the list - * - * Removes the given callback from the filter list. See elm_entry_text_filter_append() - * for more information. - * - * @param obj The entry object - * @param func The filter function to remove - * @param data The user data passed when adding the function - * - * @ingroup Entry - */ -EAPI void -elm_entry_text_filter_remove(Evas_Object *obj, void (*func) (void *data, Evas_Object *entry, char **text), void *data) -{ - Widget_Data *wd; - Eina_List *l; - Elm_Entry_Text_Filter *tf; - ELM_CHECK_WIDTYPE(obj, widtype); - - wd = elm_widget_data_get(obj); - - EINA_SAFETY_ON_NULL_RETURN(func); - - EINA_LIST_FOREACH(wd->text_filters, l, tf) - { - if ((tf->func == func) && (tf->data == data)) - { - wd->text_filters = eina_list_remove_list(wd->text_filters, l); - free(tf); - return; - } - } -} - -/** * This converts a markup (HTML-like) string into UTF-8. * * @param s The string (in markup) to be converted @@ -3194,7 +3113,7 @@ elm_entry_text_filter_remove(Evas_Object *obj, void (*func) (void *data, Evas_Ob EAPI char * elm_entry_markup_to_utf8(const char *s) { - char *ss = _elm_util_mkup_to_text(s); + char *ss = _mkup_to_text(s); if (!ss) ss = strdup(""); return ss; } @@ -3210,7 +3129,7 @@ elm_entry_markup_to_utf8(const char *s) EAPI char * elm_entry_utf8_to_markup(const char *s) { - char *ss = _elm_util_text_to_mkup(s); + char *ss = _text_to_mkup(s); if (!ss) ss = strdup(""); return ss; } @@ -3448,270 +3367,6 @@ elm_entry_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis) } /** - * Filter inserted text based on user defined character and byte limits - * - * Add this filter to an entry to limit the characters that it will accept - * based the the contents of the provided Elm_Entry_Filter_Limit_Size. - * The funtion works on the UTF-8 representation of the string, converting - * it from the set markup, thus not accounting for any format in it. - * - * The user must create an Elm_Entry_Filter_Limit_Size structure and pass - * it as data when setting the filter. In it it's possible to set limits - * by character count or bytes (any of them is disabled if 0), and both can - * be set at the same time. In that case, it first checks for characters, - * then bytes. - * - * The function will cut the inserted text in order to allow only the first - * number of characters that are still allowed. The cut is made in - * characters, even when limiting by bytes, in order to always contain - * valid ones and avoid half unicode characters making it in. - * - * @ingroup Entry - */ -EAPI void -elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text) -{ - Elm_Entry_Filter_Limit_Size *lim = data; - char *current; - int len, newlen; - const char *(*text_get)(const Evas_Object *); - const char *widget_type; - - EINA_SAFETY_ON_NULL_RETURN(data); - EINA_SAFETY_ON_NULL_RETURN(entry); - EINA_SAFETY_ON_NULL_RETURN(text); - - /* hack. I don't want to copy the entire function to work with - * scrolled_entry */ - widget_type = elm_widget_type_get(entry); - if (!strcmp(widget_type, "entry")) - text_get = elm_entry_entry_get; - else if (!strcmp(widget_type, "scrolled_entry")) - text_get = elm_scrolled_entry_entry_get; - else /* huh? */ - return; - - current = elm_entry_markup_to_utf8(text_get(entry)); - - if (lim->max_char_count > 0) - { - int cut; - len = evas_string_char_len_get(current); - if (len >= lim->max_char_count) - { - free(*text); - free(current); - *text = NULL; - return; - } - newlen = evas_string_char_len_get(*text); - cut = strlen(*text); - while ((len + newlen) > lim->max_char_count) - { - cut = evas_string_char_prev_get(*text, cut, NULL); - newlen--; - } - (*text)[cut] = 0; - } - - if (lim->max_byte_count > 0) - { - len = strlen(current); - if (len >= lim->max_byte_count) - { - free(*text); - free(current); - *text = NULL; - return; - } - newlen = strlen(*text); - while ((len + newlen) > lim->max_byte_count) - { - int p = evas_string_char_prev_get(*text, newlen, NULL); - newlen -= (newlen - p); - } - if (newlen) - (*text)[newlen] = 0; - else - { - free(*text); - *text = NULL; - } - } - free(current); -} - -/** - * Filter inserted text based on accepted or rejected sets of characters - * - * Add this filter to an entry to restrict the set of accepted characters - * based on the sets in the provided Elm_Entry_Filter_Accept_Set. - * This structure contains both accepted and rejected sets, but they are - * mutually exclusive. If accepted is set, it will be used, otherwise it - * goes on to the rejected set. - */ -EAPI void -elm_entry_filter_accept_set(void *data, Evas_Object *entry __UNUSED__, char **text) -{ - Elm_Entry_Filter_Accept_Set *as = data; - const char *set; - char *insert; - Eina_Bool goes_in; - int read_idx, last_read_idx = 0, read_char; - - EINA_SAFETY_ON_NULL_RETURN(data); - EINA_SAFETY_ON_NULL_RETURN(text); - - if ((!as->accepted) && (!as->rejected)) - return; - - if (as->accepted) - { - set = as->accepted; - goes_in = EINA_TRUE; - } - else - { - set = as->rejected; - goes_in = EINA_FALSE; - } - - insert = *text; - read_idx = evas_string_char_next_get(*text, 0, &read_char); - while (read_char) - { - int cmp_idx, cmp_char; - Eina_Bool in_set = EINA_FALSE; - - cmp_idx = evas_string_char_next_get(set, 0, &cmp_char); - while (cmp_char) - { - if (read_char == cmp_char) - { - in_set = EINA_TRUE; - break; - } - cmp_idx = evas_string_char_next_get(set, cmp_idx, &cmp_char); - } - if (in_set == goes_in) - { - int size = read_idx - last_read_idx; - const char *src = (*text) + last_read_idx; - if (src != insert) - memcpy(insert, *text + last_read_idx, size); - insert += size; - } - last_read_idx = read_idx; - read_idx = evas_string_char_next_get(*text, read_idx, &read_char); - } - *insert = 0; -} - -/** - * This sets the file (and implicitly loads it) for the text to display and - * then edit. All changes are written back to the file after a short delay if - * the entry object is set to autosave. - * - * @param obj The entry object - * @param file The path to the file to load and save - * @param format The file format - * - * @ingroup Entry - */ -EAPI void -elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->delay_write) - { - ecore_timer_del(wd->delay_write); - wd->delay_write = NULL; - } - if (wd->autosave) _save(obj); - eina_stringshare_replace(&wd->file, file); - wd->format = format; - _load(obj); -} - -/** - * Gets the file to load and save and the file format - * - * @param obj The entry object - * @param file The path to the file to load and save - * @param format The file format - * - * @ingroup Entry - */ -EAPI void -elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (file) *file = wd->file; - if (format) *format = wd->format; -} - -/** - * This function writes any changes made to the file set with - * elm_entry_file_set() - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void -elm_entry_file_save(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->delay_write) - { - ecore_timer_del(wd->delay_write); - wd->delay_write = NULL; - } - _save(obj); - wd->delay_write = ecore_timer_add(2.0, _delay_write, obj); -} - -/** - * This sets the entry object to 'autosave' the loaded text file or not. - * - * @param obj The entry object - * @param autosave Autosave the loaded file or not - * - * @ingroup Entry - */ -EAPI void -elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - wd->autosave = !!autosave; -} - -/** - * This gets the entry object's 'autosave' status. - * - * @param obj The entry object - * @return Autosave the loaded file or not - * - * @ingroup Entry - */ -EAPI Eina_Bool -elm_entry_autosave_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->autosave; -} - -/** * This sets the attribute to show the input panel automatically. * * @param obj The entry object @@ -3752,3 +3407,5 @@ elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout ecore_imf_context_input_panel_layout_set(ic, (Ecore_IMF_Input_Panel_Layout)layout); } + +/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c index b224161..9b7c206 100644 --- a/src/lib/elm_flip.c +++ b/src/lib/elm_flip.c @@ -59,22 +59,6 @@ _theme_hook(Evas_Object *obj) _sizing_eval(obj); } -static Eina_Bool -_elm_flip_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) - return EINA_FALSE; - - /* Try Focus cycle in subitem */ - if (wd->state) - return elm_widget_focus_next_get(wd->front.content, dir, next); - else - return elm_widget_focus_next_get(wd->back.content, dir, next); - -} - static void _sizing_eval(Evas_Object *obj) { @@ -159,7 +143,6 @@ flip_show_hide(Evas_Object *obj) evas_object_hide(wd->back.clip); } } - static Eina_Bool _flip(Evas_Object *obj) { @@ -175,6 +158,7 @@ _flip(Evas_Object *obj) if (t > 1.0) t = 1.0; if (!wd) return ECORE_CALLBACK_CANCEL; + evas_object_geometry_get(obj, &x, &y, &w, &h); mf = evas_map_new(4); evas_map_smooth_set(mf, 0); @@ -182,17 +166,9 @@ _flip(Evas_Object *obj) evas_map_smooth_set(mb, 0); if (wd->front.content) - { - evas_object_geometry_get(wd->front.content, &x, &y, &w, &h); - evas_map_util_points_populate_from_geometry(mf, x, y, w, h, 0); - } + evas_map_util_points_populate_from_object_full(mf, wd->front.content, 0); if (wd->back.content) - { - evas_object_geometry_get(wd->back.content, &x, &y, &w, &h); - evas_map_util_points_populate_from_geometry(mb, x, y, w, h, 0); - } - - evas_object_geometry_get(obj, &x, &y, &w, &h); + evas_map_util_points_populate_from_object_full(mb, wd->back.content, 0); cx = x + (w / 2); cy = y + (h / 2); @@ -337,11 +313,11 @@ _flip(Evas_Object *obj) { evas_object_map_enable_set(wd->front.content, 0); evas_object_map_enable_set(wd->back.content, 0); - // FIXME: hack around evas rendering bug (only fix makes evas bitch-slow +// FIXME: hack around evas rendering bug (only fix makes evas bitch-slow evas_object_resize(wd->front.content, 0, 0); evas_object_resize(wd->back.content, 0, 0); evas_smart_objects_calculate(evas_object_evas_get(obj)); - // FIXME: end hack +// FIXME: end hack wd->animator = NULL; wd->state = !wd->state; _configure(obj); @@ -406,11 +382,8 @@ elm_flip_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "flip"); elm_widget_type_set(obj, "flip"); @@ -418,18 +391,14 @@ elm_flip_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_focus_next_hook_set(obj, _elm_flip_focus_next_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); wd->clip = evas_object_rectangle_add(e); - evas_object_static_clip_set(wd->clip, 1); evas_object_color_set(wd->clip, 255, 255, 255, 255); evas_object_move(wd->clip, -49999, -49999); evas_object_resize(wd->clip, 99999, 99999); elm_widget_sub_object_add(obj, wd->clip); evas_object_clip_set(wd->clip, evas_object_clip_get(obj)); evas_object_smart_member_add(wd->clip, obj); - wd->front.clip = evas_object_rectangle_add(e); evas_object_static_clip_set(wd->front.clip, 1); evas_object_data_set(wd->front.clip, "_elm_leaveme", obj); @@ -461,14 +430,10 @@ elm_flip_add(Evas_Object *parent) } /** - * Set the front content of the flip widget. - * - * Once the content object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_flip_content_front_unset() function. + * Set the flip front content * * @param obj The flip object - * @param content The new front content object + * @param content The content to be used in this flip object * * @ingroup Flip */ @@ -479,7 +444,12 @@ elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->front.content == content) return; - if (wd->front.content) evas_object_del(wd->back.content); + if ((wd->front.content != content) && (wd->front.content)) + { + evas_object_clip_set(wd->front.content, NULL); + elm_widget_sub_object_del(obj, wd->front.content); + evas_object_smart_member_del(wd->front.content); + } wd->front.content = content; if (content) { @@ -491,21 +461,15 @@ elm_flip_content_front_set(Evas_Object *obj, Evas_Object *content) _changed_size_hints, obj); _sizing_eval(obj); } - // force calc to contents are the right size before transition - evas_smart_objects_calculate(evas_object_evas_get(obj)); flip_show_hide(obj); _configure(obj); } /** - * Set the back content of the flip widget. - * - * Once the content object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_flip_content_back_unset() function. + * Set the flip back content * * @param obj The flip object - * @param content The new back content object + * @param content The content to be used in this flip object * * @ingroup Flip */ @@ -516,7 +480,12 @@ elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->back.content == content) return; - if (wd->back.content) evas_object_del(wd->back.content); + if ((wd->back.content != content) && (wd->back.content)) + { + evas_object_clip_set(wd->back.content, NULL); + elm_widget_sub_object_del(obj, wd->back.content); + evas_object_smart_member_del(wd->back.content); + } wd->back.content = content; if (content) { @@ -528,19 +497,15 @@ elm_flip_content_back_set(Evas_Object *obj, Evas_Object *content) _changed_size_hints, obj); _sizing_eval(obj); } - // force calc to contents are the right size before transition - evas_smart_objects_calculate(evas_object_evas_get(obj)); flip_show_hide(obj); _configure(obj); } /** - * Get the front content used for the flip - * - * Return the front content object which is set for this widget. + * Get the flip front content * * @param obj The flip object - * @return The front content object that is being used + * @return The content to be used in this flip object front * * @ingroup Flip */ @@ -552,14 +517,11 @@ elm_flip_content_front_get(const Evas_Object *obj) return wd->front.content; } - /** - * Get the back content used for the flip - * - * Return the back content object which is set for this widget. + * Get the flip back content * * @param obj The flip object - * @return The back content object that is being used + * @return The content to be used in this flip object back * * @ingroup Flip */ @@ -572,56 +534,6 @@ elm_flip_content_back_get(const Evas_Object *obj) } /** - * Unset the front content used for the flip - * - * Unparent and return the front content object which was set for this widget. - * - * @param obj The flip object - * @return The front content object that was being used - * - * @ingroup Flip - */ -EAPI Evas_Object * -elm_flip_content_front_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->front.content) return NULL; - Evas_Object *content = wd->front.content; - evas_object_clip_unset(content); - elm_widget_sub_object_del(obj, content); - evas_object_smart_member_del(content); - wd->front.content = NULL; - return content; -} - -/** - * Unset the back content used for the flip - * - * Unparent and return the back content object which was set for this widget. - * - * @param obj The flip object - * @return The back content object that was being used - * - * @ingroup Flip - */ -EAPI Evas_Object * -elm_flip_content_back_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->back.content) return NULL; - Evas_Object *content = wd->back.content; - evas_object_clip_unset(content); - elm_widget_sub_object_del(obj, content); - evas_object_smart_member_del(content); - wd->back.content = NULL; - return content; -} - -/** * Get flip front visibility state * * @param obj The flip object @@ -670,9 +582,6 @@ elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc __UNUSED__, Evas_Coord * ELM_FLIP_ROTATE_YZ_CENTER_AXIS * ELM_FLIP_CUBE_LEFT * ELM_FLIP_CUBE_RIGHT - * - * FIXME: add - ELM_FLIP_CUBE_UP - * FIXMEL add - ELM_FLIP_CUBE_DOWN * * @ingroup Flip */ @@ -687,15 +596,5 @@ elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode) wd->mode = mode; wd->start = ecore_loop_time_get(); wd->len = 0.5; - // force calc to contents are the right size before transition - evas_smart_objects_calculate(evas_object_evas_get(obj)); _flip(obj); - // FIXME: hack around evas rendering bug (only fix makes evas bitch-slow - evas_object_map_enable_set(wd->front.content, 0); - evas_object_map_enable_set(wd->back.content, 0); - evas_object_resize(wd->front.content, 0, 0); - evas_object_resize(wd->back.content, 0, 0); - evas_smart_objects_calculate(evas_object_evas_get(obj)); - _configure(obj); - // FIXME: end hack } diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c deleted file mode 100644 index 3b783e8..0000000 --- a/src/lib/elm_flipselector.c +++ /dev/null @@ -1,1158 +0,0 @@ -#include -#include "elm_priv.h" - -/** - * @addtogroup Flipselector Flipselector - * - * A flip selector is a widget to show a set of label items, one at a - * time, with an animation when one changes the current selection - * (like the flip of calendar sheets, in the default theme). - */ - -/* TODO: ideally, the default theme would use map{} blocks on the TEXT - parts to implement their fading in/out propertly (as in the clock - widget) */ -/* TODO: if one ever wants to extend it to receiving generic widgets - as items, be my guest. in this case, remember to implement the - items tooltip infra. */ -/* TODO: implement disabled mode -- disable_hook() and stuff. */ -/* TODO: fix default theme image borders for looong strings as item - labels. */ -/* TODO: set text elipsis on labels if one enforces mininum size on - * the overall widget less the required for displaying it. */ -/* TODO: find a way to, in the default theme, to detect we are - * bootstrapping (receiving the 1st message) and populate the downmost - * TEXT parts with the same text as the upmost, where appropriate. */ - -#define FLIP_FIRST_INTERVAL (0.85) -#define FLIP_MIN_INTERVAL (0.1) -#define MSG_FLIP_DOWN (1) -#define MSG_FLIP_UP (2) -#define MAX_LEN_DEFAULT (50) - -#define DATA_GET eina_list_data_get - -struct _Elm_Flipselector_Item { - Elm_Widget_Item base; - const char *label; - Evas_Smart_Cb func; - void *data; - int deleted : 1; -}; - -typedef struct _Widget_Data Widget_Data; - -struct _Widget_Data { - Evas_Object *self; - Evas_Object *base; - Eina_List *items; - Eina_List *current; - Eina_List *sentinel; /* item containing the largest label string */ - int walking; - unsigned int max_len; - Ecore_Timer *spin; - double interval, first_interval; -}; - -static const char *widtype = NULL; -static void _del_hook(Evas_Object *obj); -static void _theme_hook(Evas_Object *obj); -static void _sizing_eval(Evas_Object *obj); -static void _update_view(Evas_Object *obj); -static void _callbacks_set(Evas_Object *obj); -static void _flip_up(Widget_Data *wd); -static void _flip_down(Widget_Data *wd); - -static const char SIG_SELECTED[] = "selected"; -static const char SIG_UNDERFLOWED[] = "underflowed"; -static const char SIG_OVERFLOWED[] = "overflowed"; -static const Evas_Smart_Cb_Description _signals[] = { - {SIG_SELECTED, ""}, - {SIG_UNDERFLOWED, ""}, - {SIG_OVERFLOWED, ""}, - {NULL, NULL} -}; - -#define ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(it, ...) \ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \ - if (it->deleted) \ - { \ - ERR(""#it" has been DELETED.\n"); \ - return __VA_ARGS__; \ - } \ - -static Elm_Flipselector_Item * -_item_new(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data) -{ - unsigned int len; - Elm_Flipselector_Item *it; - Widget_Data *wd = elm_widget_data_get(obj); - - it = elm_widget_item_new(obj, Elm_Flipselector_Item); - if (!it) - return NULL; - - len = strlen(label); - if (len > wd->max_len) - len = wd->max_len; - - it->label = eina_stringshare_add_length(label, len); - it->func = func; - it->base.data = data; - - /* TODO: no view here, but if one desires general contents in the - * future... */ - return it; -} - -static inline void -_item_free(Elm_Flipselector_Item *it) -{ - eina_stringshare_del(it->label); - elm_widget_item_del(it); -} - -static void -_del_hook(Evas_Object *obj) -{ - Elm_Flipselector_Item *item; - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - - if (wd->walking) - ERR("flipselector deleted while walking.\n"); - - EINA_LIST_FREE(wd->items, item) - _item_free(item); - - if (wd->spin) ecore_timer_del(wd->spin); - free(wd); -} - -static void -_theme_hook(Evas_Object *obj) -{ - Widget_Data *wd; - const char *max_len; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - - _elm_theme_object_set(obj, wd->base, "flipselector", "base", - elm_widget_style_get(obj)); - edje_object_scale_set(wd->base, - elm_widget_scale_get(obj) * _elm_config->scale); - - max_len = edje_object_data_get(wd->base, "max_len"); - if (!max_len) - wd->max_len = MAX_LEN_DEFAULT; - else - { - wd->max_len = atoi(max_len); - if (!wd->max_len) - wd->max_len = MAX_LEN_DEFAULT; - } - - _update_view(obj); - _sizing_eval(obj); -} - -static void -_sentinel_eval(Widget_Data *wd) -{ - Elm_Flipselector_Item *it; - Eina_List *l; - - if (!wd->items) - { - wd->sentinel = NULL; - return; - } - - wd->sentinel = wd->items; - - EINA_LIST_FOREACH(wd->items, l, it) - { - if (strlen(elm_flipselector_item_label_get(it)) > - strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel)))) - wd->sentinel = l; - } -} - -/* TODO: create a flag to avoid looping here all times */ -static void -_flipselector_process_deletions(Widget_Data *wd) -{ - Elm_Flipselector_Item *it; - Eina_List *l; - Eina_Bool skip = EINA_TRUE; - Eina_Bool sentinel_eval = EINA_FALSE; - - wd->walking++; /* avoid nested deletions */ - - EINA_LIST_FOREACH(wd->items, l, it) - { - if (!it->deleted) - continue; - - if (wd->current == l) - { - if (wd->current == wd->sentinel) - sentinel_eval = EINA_TRUE; - - wd->current = eina_list_prev(wd->current); - } - wd->items = eina_list_remove(wd->items, it); - - if (!wd->current) - wd->current = wd->items; - - _item_free(it); - skip = EINA_FALSE; - - if (eina_list_count(wd->items) <= 1) - edje_object_signal_emit(wd->base, "elm,state,button,hidden", "elm"); - else - edje_object_signal_emit(wd->base, "elm,state,button,visible", "elm"); - } - - if (!skip) - _update_view(wd->self); - - if (sentinel_eval) - _sentinel_eval(wd); - - wd->walking--; -} - -static inline void -_flipselector_walk(Widget_Data *wd) -{ - if (wd->walking < 0) - { - ERR("walking was negative. fixed!\n"); - wd->walking = 0; - } - wd->walking++; -} - -static inline void -_flipselector_unwalk(Widget_Data *wd) -{ - wd->walking--; - if (wd->walking < 0) - { - ERR("walking became negative. fixed!\n"); - wd->walking = 0; - } - - if (wd->walking) - return; - - _flipselector_process_deletions(wd); -} - -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - Evas_Event_Key_Down *ev; - Widget_Data *wd; - Eina_Bool is_up = EINA_TRUE; - - if (type != EVAS_CALLBACK_KEY_DOWN) - return EINA_FALSE; - - wd = elm_widget_data_get(obj); - if (!wd) - return EINA_FALSE; - - ev = event_info; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) - return EINA_FALSE; - - if (elm_widget_disabled_get(obj)) - return EINA_FALSE; - - if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) - is_up = EINA_FALSE; - else if ((strcmp(ev->keyname, "Up")) && (strcmp(ev->keyname, "KP_Up"))) - return EINA_FALSE; - - if (wd->spin) ecore_timer_del(wd->spin); - - /* TODO: if direction setting via API is not coming in, replace - these calls by flip_{next,prev} */ - _flipselector_walk(wd); - if (is_up) - _flip_up(wd); - else - _flip_down(wd); - _flipselector_unwalk(wd); - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; -} - -static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - - /* FIXME: no treatment of this signal so far */ - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->base, "elm,action,focus", "elm"); - evas_object_focus_set(wd->base, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->base, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->base, EINA_FALSE); - } -} - -static void -_sizing_eval(Evas_Object *obj) -{ - Widget_Data *wd; - const char *tmp = NULL; - Evas_Coord minw = -1, minh = -1, w, h; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - - elm_coords_finger_size_adjust(1, &minw, 2, &minh); - - if (wd->sentinel) - { - const char *label = \ - elm_flipselector_item_label_get(DATA_GET(wd->sentinel)); - - tmp = edje_object_part_text_get(wd->base, "top"); - edje_object_part_text_set(wd->base, "top", label); - } - - edje_object_size_min_restricted_calc(wd->base, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 2, &minh); - evas_object_size_hint_min_get(obj, &w, &h); - - if (wd->sentinel) - edje_object_part_text_set(wd->base, "top", tmp); - - if (w > minw) minw = w; - if (h > minh) minh = h; - - evas_object_size_hint_min_set(obj, minw, minh); -} - -static void -_update_view(Evas_Object *obj) -{ - Widget_Data *wd; - const char *label; - Elm_Flipselector_Item *item; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - - label = NULL; - item = DATA_GET(wd->current); - if (item) - label = item->label; - - edje_object_part_text_set(wd->base, "top", label ? label : ""); - edje_object_part_text_set(wd->base, "bottom", label ? label : ""); - - edje_object_message_signal_process(wd->base); -} - -static void -_changed(Widget_Data *wd) -{ - Elm_Flipselector_Item *item; - - item = DATA_GET(wd->current); - if (!item) - return; - - if (item->func) - item->func((void *)item->base.data, item->base.widget, item); - if (!item->deleted) - evas_object_smart_callback_call(wd->self, SIG_SELECTED, item); -} - -static void -_send_msg(Widget_Data *wd, int flipside, char *label) -{ - Edje_Message_String msg; - - msg.str = label; - edje_object_message_send(wd->base, EDJE_MESSAGE_STRING, flipside, &msg); - edje_object_message_signal_process(wd->base); - - _changed(wd); -} - -static void -_flip_up(Widget_Data *wd) -{ - Elm_Flipselector_Item *item; - - if (!wd->current) - return; - - if (wd->current == wd->items) - { - wd->current = eina_list_last(wd->items); - evas_object_smart_callback_call(wd->self, SIG_UNDERFLOWED, NULL); - } - else - wd->current = eina_list_prev(wd->current); - - item = DATA_GET(wd->current); - if (!item) - return; - - _send_msg(wd, MSG_FLIP_UP, (char *)item->label); -} - -static Eina_Bool -_signal_val_up(void *data) -{ - Widget_Data *wd = elm_widget_data_get(data); - - if (!wd) - goto val_up_exit_on_error; - - _flipselector_walk(wd); - - if (wd->interval > FLIP_MIN_INTERVAL) - wd->interval = wd->interval / 1.05; - - ecore_timer_interval_set(wd->spin, wd->interval); - - _flip_up(wd); - - _flipselector_unwalk(wd); - - return ECORE_CALLBACK_RENEW; - - val_up_exit_on_error: - return ECORE_CALLBACK_CANCEL; -} - -static void -_signal_val_up_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) - return; - - wd->interval = wd->first_interval; - - if (wd->spin) - ecore_timer_del(wd->spin); - wd->spin = ecore_timer_add(wd->interval, _signal_val_up, data); - - _signal_val_up(data); -} - -static void -_flip_down(Widget_Data *wd) -{ - Elm_Flipselector_Item *item; - - if (!wd->current) - return; - - wd->current = eina_list_next(wd->current); - if (!wd->current) - { - wd->current = wd->items; - evas_object_smart_callback_call(wd->self, SIG_OVERFLOWED, NULL); - } - - item = DATA_GET(wd->current); - if (!item) - return; - - _send_msg(wd, MSG_FLIP_DOWN, (char *)item->label); -} - -static Eina_Bool -_signal_val_down(void *data) -{ - Widget_Data *wd = elm_widget_data_get(data); - - if (!wd) - goto val_down_exit_on_error; - - _flipselector_walk(wd); - - if (wd->interval > FLIP_MIN_INTERVAL) - wd->interval = wd->interval / 1.05; - ecore_timer_interval_set(wd->spin, wd->interval); - - _flip_down(wd); - - _flipselector_unwalk(wd); - - return ECORE_CALLBACK_RENEW; - - val_down_exit_on_error: - return ECORE_CALLBACK_CANCEL; -} - -static void -_signal_val_down_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) - return; - - wd->interval = wd->first_interval; - - if (wd->spin) - ecore_timer_del(wd->spin); - wd->spin = ecore_timer_add(wd->interval, _signal_val_down, data); - - _signal_val_down(data); -} - -static void -_signal_val_change_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) - return; - - if (wd->spin) - ecore_timer_del(wd->spin); - wd->spin = NULL; -} - -static void -_callbacks_set(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - - edje_object_signal_callback_add(wd->base, "elm,action,up,start", - "", _signal_val_up_start, obj); - edje_object_signal_callback_add(wd->base, "elm,action,up,stop", - "", _signal_val_change_stop, obj); - edje_object_signal_callback_add(wd->base, "elm,action,down,start", - "", _signal_val_down_start, obj); - edje_object_signal_callback_add(wd->base, "elm,action,down,stop", - "", _signal_val_change_stop, obj); -} - -/** - * Add a new flipselector to the parent. - * - * @param parent The parent object - * @return The new object or NULL, if it cannot be created - * - * @ingroup Flipselector - */ -EAPI Evas_Object * -elm_flipselector_add(Evas_Object *parent) -{ - Evas_Object *obj; - Evas *e; - Widget_Data *wd; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - - wd = ELM_NEW(Widget_Data); - e = evas_object_evas_get(parent); - if (!e) return NULL; - obj = elm_widget_add(e); - wd->self = obj; - ELM_SET_WIDTYPE(widtype, "flipselector"); - elm_widget_type_set(obj, "flipselector"); - elm_widget_sub_object_add(parent, obj); - elm_widget_data_set(obj, wd); - - elm_widget_del_hook_set(obj, _del_hook); - elm_widget_theme_hook_set(obj, _theme_hook); - /* TODO: elm_widget_disable_hook_set(obj, _disable_hook); */ - - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); - elm_widget_event_hook_set(obj, _event_hook); - - wd->base = edje_object_add(e); - elm_widget_resize_object_set(obj, wd->base); - - _callbacks_set(obj); - - wd->first_interval = FLIP_FIRST_INTERVAL; - - _theme_hook(obj); - - evas_object_smart_callbacks_descriptions_set(obj, _signals); - return obj; -} - -/** - * Select next item of a flipselector. - * - * @param obj The flipselector object - * - * @ingroup Flipselector - */ -EAPI void -elm_flipselector_flip_next(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - - if (wd->spin) ecore_timer_del(wd->spin); - - _flipselector_walk(wd); - _flip_down(wd); - _flipselector_unwalk(wd); -} - -/** - * Select previous item of a flipselector. - * - * @param obj The flipselector object - * - * @ingroup Flipselector - */ -EAPI void -elm_flipselector_flip_prev(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - - if (wd->spin) ecore_timer_del(wd->spin); - - _flipselector_walk(wd); - _flip_up(wd); - _flipselector_unwalk(wd); -} - -/** - * Append item to a flipselector. - * - * @param obj The flipselector object - * @param label The label of new item - * @param func Convenience function called when item selected - * @param data Data passed to @p func above - * @return A handle to the item added or NULL, on errors - * - * @note The maximum length of the label is going to be determined by - * the widget's theme. Strings larger than that value are going to be - * truncated. - * - * @ingroup Flipselector - */ -EAPI Elm_Flipselector_Item * -elm_flipselector_item_append(Evas_Object *obj, const char *label, void (*func)(void *data, Evas_Object *obj, void *event_info), void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Elm_Flipselector_Item *item; - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return NULL; - - item = _item_new(obj, label, func, data); - if (!item) - return NULL; - - wd->items = eina_list_append(wd->items, item); - if (!wd->current) { - wd->current = wd->items; - _update_view(obj); - } - - if (!wd->sentinel || - (strlen(elm_flipselector_item_label_get(item)) > - strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel))))) - { - wd->sentinel = eina_list_last(wd->items); - _sizing_eval(obj); - } - - if (eina_list_count(wd->items) >= 2) - edje_object_signal_emit(wd->base, "elm,state,button,visible", "elm"); - - return item; -} - -/** - * Prepend item to a flipselector. - * - * @param obj The flipselector object - * @param label The label of new item - * @param func Convenience function called when item selected - * @param data Data passed to @p func above - * @return A handle to the item added or NULL, on errors - * - * @note The maximum length of the label is going to be determined by - * the widget's theme. Strings larger than that value are going to be - * truncated. - * - * @ingroup Flipselector - */ -EAPI Elm_Flipselector_Item * -elm_flipselector_item_prepend(Evas_Object *obj, const char *label, void (*func)(void *data, Evas_Object *obj, void *event_info), void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Elm_Flipselector_Item *item; - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return NULL; - - item = _item_new(obj, label, func, data); - if (!item) - return NULL; - - wd->items = eina_list_prepend(wd->items, item); - if (!wd->current) { - wd->current = wd->items; - _update_view(obj); - } - - if (!wd->sentinel || - (strlen(elm_flipselector_item_label_get(item)) > - strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel))))) - { - wd->sentinel = wd->items; - _sizing_eval(obj); - } - - if (eina_list_count(wd->items) >= 2) - edje_object_signal_emit(wd->base, "elm,state,button,visible", "elm"); - - return item; -} - -/* TODO: account for deleted items? */ -/** - * Get a list of items in the flipselector. - * - * @param obj The flipselector object - * @return The list of items, or NULL on errors. - * - * @ingroup Flipselector - */ -EAPI const Eina_List * -elm_flipselector_items_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return NULL; - - return wd->items; -} - -/** - * Get the first item in the flipselector - * - * @param obj The flipselector object - * @return The first item, or NULL if none - * - * @ingroup Flipselector - */ -EAPI Elm_Flipselector_Item * -elm_flipselector_first_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Elm_Flipselector_Item *it; - Widget_Data *wd; - Eina_List *l; - - wd = elm_widget_data_get(obj); - if (!wd || !wd->items) - return NULL; - - EINA_LIST_FOREACH(wd->items, l, it) - { - if (it->deleted) - continue; - - return it; - } - - return NULL; -} - -/** - * Get the last item in the flipselector - * - * @param obj The flipselector object - * @return The last item, or NULL if none - * - * @ingroup Flipselector - */ -EAPI Elm_Flipselector_Item * -elm_flipselector_last_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Elm_Flipselector_Item *it; - Widget_Data *wd; - Eina_List *l; - - wd = elm_widget_data_get(obj); - if (!wd || !wd->items) - return NULL; - - EINA_LIST_REVERSE_FOREACH(wd->items, l, it) - { - if (it->deleted) - continue; - - return it; - } - - return NULL; -} - -/** - * Get the selected item in a flipselector. - * - * @param obj The flipselector object - * @return The selected item, or NULL if none - * - * @ingroup Flipselector - */ -EAPI Elm_Flipselector_Item * -elm_flipselector_selected_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->current) - return NULL; - - return DATA_GET(wd->current); -} - -/** - * Set the selected state of an item - * - * This sets the selected state (EINA_TRUE selected, EINA_FALSE not selected) - * of the given item @p item. - * If a new item is selected the previosly selected will be unselected. - * If the item @p item is unselected, the first item will be selected. - * - * @param item The item - * @param selected The selected state - * - * @ingroup Flipselector - */ -EAPI void -elm_flipselector_item_selected_set(Elm_Flipselector_Item *item, Eina_Bool selected) -{ - ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item); - - Elm_Flipselector_Item *_item, *cur; - int flipside = MSG_FLIP_UP; - Widget_Data *wd; - Eina_List *l; - - wd = elm_widget_data_get(item->base.widget); - if (!wd) - return; - - cur = DATA_GET(wd->current); - if ((selected) && (cur == item)) - return; - - _flipselector_walk(wd); - - if ((!selected) && (cur == item)) - { - EINA_LIST_FOREACH(wd->items, l, _item) - { - if (!_item->deleted) - { - wd->current = l; - _send_msg(wd, MSG_FLIP_UP, (char *)_item->label); - break; - } - } - _flipselector_unwalk(wd); - return; - } - - EINA_LIST_FOREACH(wd->items, l, _item) - { - if (_item == cur) - flipside = MSG_FLIP_DOWN; - - if (_item == item) - { - wd->current = l; - _send_msg(wd, flipside, (char *)item->label); - break; - } - } - - _flipselector_unwalk(wd); -} - -/* - * Get the selected state of @p item. - * - * @param item The flipselector item - * @return If true, the item is selected - * - * @ingroup Flipselector - */ -EAPI Eina_Bool -elm_flipselector_item_selected_get(const Elm_Flipselector_Item *item) -{ - ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item, EINA_FALSE); - Widget_Data *wd; - - wd = elm_widget_data_get(item->base.widget); - if (!wd) return EINA_FALSE; - return (eina_list_data_get(wd->current) == item); -} - -/** - * Delete a given item from a flipselector. - * - * @param item The item - * - * @ingroup Flipselector - */ -EAPI void -elm_flipselector_item_del(Elm_Flipselector_Item *item) -{ - ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item); - - Widget_Data *wd; - - wd = elm_widget_data_get(item->base.widget); - if (!wd) - return; - - if (wd->walking > 0) - { - item->deleted = EINA_TRUE; - return; - } - - _flipselector_walk(wd); - - wd->items = eina_list_remove(wd->items, item); - _item_free(item); - _sentinel_eval(wd); - - _flipselector_unwalk(wd); -} - -/** - * Get the label of a given flipselector item. - * - * @param item The item - * @return The label of a given item, or NULL if none - * - * @ingroup Flipselector - */ -EAPI const char * -elm_flipselector_item_label_get(const Elm_Flipselector_Item *item) -{ - ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item, NULL); - - Elm_Flipselector_Item *_item; - Widget_Data *wd; - Eina_List *l; - - wd = elm_widget_data_get(item->base.widget); - if ((!wd) || (!wd->items)) - return NULL; - - EINA_LIST_FOREACH(wd->items, l, _item) - if (_item == item) - return item->label; - - return NULL; -} - -/** - * Set the label of a given flipselector item. - * - * @param item The item - * @param label The text label string in UTF-8 - * - * @ingroup Flipselector - */ -EAPI void -elm_flipselector_item_label_set(Elm_Flipselector_Item *item, const char *label) -{ - ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item); - - Widget_Data *wd; - Eina_List *l; - - if ((!item) || (!label)) - return; - - wd = elm_widget_data_get(item->base.widget); - if ((!wd) || (!wd->items)) - return; - - l = eina_list_data_find_list(wd->items, item); - if (!l) - return; - - eina_stringshare_del(item->label); - item->label = eina_stringshare_add_length(label, wd->max_len); - - if (strlen(label) > - strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel)))) - wd->sentinel = l; - - if (wd->current == l) - { - _update_view(item->base.widget); - _sizing_eval(wd->self); - } - - return; -} - -/** - * Gets the item before @p item in a flipselector. - * - * @param item The item - * @return The item before the item @p item - * - * @ingroup Flipselector - */ -EAPI Elm_Flipselector_Item * -elm_flipselector_item_prev_get(Elm_Flipselector_Item *item) -{ - ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item, NULL); - - Elm_Flipselector_Item *_item; - Widget_Data *wd; - Eina_List *l; - - wd = elm_widget_data_get(item->base.widget); - if ((!wd) || (!wd->items)) - return NULL; - - EINA_LIST_FOREACH(wd->items, l, _item) - if (_item == item) - { - l = eina_list_prev(l); - if (!l) - return NULL; - return DATA_GET(l); - } - - return NULL; -} - -/** - * Gets the item after @p item in a flipselector. - * - * @param item The item - * @return The item after the item @p item - * - * @ingroup Flipselector - */ -EAPI Elm_Flipselector_Item * -elm_flipselector_item_next_get(Elm_Flipselector_Item *item) -{ - ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(item, NULL); - - Elm_Flipselector_Item *_item; - Widget_Data *wd; - Eina_List *l; - - wd = elm_widget_data_get(item->base.widget); - if ((!wd) || (!wd->items)) - return NULL; - - EINA_LIST_FOREACH(wd->items, l, _item) - if (_item == item) - { - l = eina_list_next(l); - if (!l) - return NULL; - return DATA_GET(l); - } - - return NULL; -} - -/** - * Set the flipping interval for the flipselector. - * - * @param obj The flipselector object - * @param interval The interval value in seconds - * - * The interval value is decreased while the user flips the widget up - * or down repeatedly. The next interval value is the previous - * interval / 1.05, so it speeds up a bit. Default value is 0.85 - * seconds. - * - * @ingroup Flipselector - */ -EAPI void -elm_flipselector_interval_set(Evas_Object *obj, double interval) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - - wd->first_interval = interval; -} - -/** - * Get the flipping interval of the flipselector. - * - * @param obj The flipselector object - * @return The value of the first interval in seconds - * - * The interval value is decreased while the user flips the widget up - * or down repeatedly. The next interval value is the previous - * interval / 1.05, so it speeds up a bit. Default value is 0.85 - * seconds. - * - * @ingroup Flipselector - */ -EAPI double -elm_flipselector_interval_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0.0; - - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) - return 0.0; - return wd->first_interval; -} diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c index 5d4e601..1e5cc17 100644 --- a/src/lib/elm_frame.c +++ b/src/lib/elm_frame.c @@ -15,7 +15,6 @@ struct _Widget_Data { Evas_Object *frm; Evas_Object *content; - const char *label; }; static const char *widtype = NULL; @@ -30,7 +29,6 @@ _del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (wd->label) eina_stringshare_del(wd->label); free(wd); } @@ -40,28 +38,12 @@ _theme_hook(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_theme_object_set(obj, wd->frm, "frame", "base", elm_widget_style_get(obj)); - edje_object_part_text_set(wd->frm, "elm.text", wd->label); if (wd->content) edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content); edje_object_scale_set(wd->frm, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); } -static Eina_Bool -_elm_frame_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *cur; - - if ((!wd) || (!wd->content)) - return EINA_FALSE; - - cur = wd->content; - - /* Try Focus cycle in subitem */ - return elm_widget_focus_next_get(cur, dir, next); -} - static void _sizing_eval(Evas_Object *obj) { @@ -114,11 +96,8 @@ elm_frame_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "frame"); elm_widget_type_set(obj, "frame"); @@ -126,8 +105,6 @@ elm_frame_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_focus_next_hook_set(obj, _elm_frame_focus_next_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); wd->frm = edje_object_add(e); _elm_theme_object_set(obj, wd->frm, "frame", "base", "default"); @@ -153,8 +130,7 @@ elm_frame_label_set(Evas_Object *obj, const char *label) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - eina_stringshare_replace(&(wd->label), label); - edje_object_part_text_set(wd->frm, "elm.text", wd->label); + edje_object_part_text_set(wd->frm, "elm.text", label); _sizing_eval(obj); } @@ -172,8 +148,8 @@ elm_frame_label_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->label; + if ((!wd) || (!wd->frm)) return NULL; + return edje_object_part_text_get(wd->frm, "elm.text"); } /** @@ -208,25 +184,6 @@ elm_frame_content_set(Evas_Object *obj, Evas_Object *content) } /** - * Get the content of the frame widget - * - * Return the content object which is set for this widget - * - * @param obj The frame object - * @return The content that is being used - * - * @ingroup Frame - */ -EAPI Evas_Object * -elm_frame_content_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->content; -} - -/** * Unset the content of the frame widget * * Unparent and return the content object which was set for this widget diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 0060898..1cfbe32 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -1,53 +1,45 @@ #include -#include #include "elm_priv.h" /** * @defgroup Gengrid Gengrid + * @ingroup Elementary * - * This widget aims to position objects in a grid layout while - * actually building only the visible ones, using the same idea as - * genlist: the user define a class for each item, specifying - * functions that will be called at object creation and deletion. + * This widget aims to position objects in a grid layout while actually + * building only the visible ones, using the same idea as genlist: the user + * define a class for each item, specifying functions that will be called at + * object creation and deletion. * * Signals that you can add callbacks for are: * - * clicked - The user has double-clicked a item. The event_info - * parameter is the Gengrid item that was double-clicked. + * clicked - The user has double-clicked a item. The event_info parameter is + * the Gengrid item that was double-clicked. * - * selected - The user has made an item selected. The event_info - * parameter is the Gengrid item that was selected. + * selected - The user has made an item selected. The event_info parameter is + * the Gengrid item that was selected. * - * unselected - The user has made an item unselected. The event_info - * parameter is the Gengrid item that was unselected. + * unselected - The user has made an item unselected. The event_info parameter + * is the Gengrid item that was unselected. * - * realized - This is called when the item in the Gengrid is created - * as a real evas object. event_info is the Gengrid item that was - * created. The object may be deleted at any time, so it is up to the - * caller to not use the object pointer from - * elm_gengrid_item_object_get() in a way where it may point to freed - * objects. + * realized - This is called when the item in the Gengrid is created as a real + * evas object. event_info is the Gengrid item that was created. The object may be + * deleted at any time, so it is up to the caller to not use the object pointer + * from elm_gengrid_item_object_get() in a way where it may point to + * freed objects. * - * unrealized - This is called when the real evas object for this item - * is deleted. event_info is the Gengrid item that was created. + * drag,start,up - Called when the item in the Gengrid has been dragged (not + * scrolled) up. * - * changed - Called when an item is added, removed, resized or moved - * and when gengrid is resized or horizontal property changes. + * drag,start,down - Called when the item in the Gengrid has been dragged (not + * scrolled) down. * - * drag,start,up - Called when the item in the Gengrid has been - * dragged (not scrolled) up. + * drag,start,left - Called when the item in the Gengrid has been dragged (not + * scrolled) left. * - * drag,start,down - Called when the item in the Gengrid has been - * dragged (not scrolled) down. + * drag,start,right - Called when the item in the Gengrid has been dragged (not + * scrolled) right. * - * drag,start,left - Called when the item in the Gengrid has been - * dragged (not scrolled) left. - * - * drag,start,right - Called when the item in the Gengrid has been - * dragged (not scrolled) right. - * - * drag,stop - Called when the item in the Gengrid has stopped being - * dragged. + * drag,stop - Called when the item in the Gengrid has stopped being dragged. * * drag - Called when the item in the Gengrid is being dragged. * @@ -58,97 +50,86 @@ * scroll,drag,stop - called when dragging the content has stopped. * * - * A item in the Gengrid can have 0 or more text labels (they can be - * regular text or textblock - that's up to the style to determine), 0 - * or more icons (which are simply objects swallowed into the Gengrid - * item) and 0 or more boolean states that can be used for check, - * radio or other indicators by the edje theme style. A item may be - * one of several styles (Elementary provides 1 by default - + * A item in the Gengrid can have 0 or more text labels (they can be regular text + * or textblock - that's up to the style to determine), 0 or more icons (which + * are simply objects swallowed into the Gengrid item) and 0 or more boolean states + * that can be used for check, radio or other indicators by the edje theme style. + * A item may be one of several styles (Elementary provides 1 by default - * "default", but this can be extended by system or application custom * themes/overlays/extensions). * - * In order to implement the ability to add and delete items on the - * fly, Gengrid implements a class/callback system where the - * application provides a structure with information about that type - * of item (Gengrid may contain multiple different items with - * different classes, states and styles). Gengrid will call the - * functions in this struct (methods) when a item is "realized" (that - * is created dynamically while scrolling). All objects will simply be - * deleted when no longer needed with evas_object_del(). The - * Elm_GenGrid_Item_Class structure contains the following members: - * - * item_style - This is a constant string and simply defines the name - * of the item style. It must be specified and the default should be - * "default". - * - * func.label_get - This function is called when an actual item object - * is created. The data parameter is the one passed to - * elm_gengrid_item_append() and related item creation functions. The - * obj parameter is the Gengrid object and the part parameter is the - * string name of the text part in the edje design that is listed as - * one of the possible labels that can be set. This function must + * In order to implement the ability to add and delete items on the fly, Gengrid + * implements a class/callback system where the application provides a structure + * with information about that type of item (Gengrid may contain multiple different + * items with different classes, states and styles). Gengrid will call the functions + * in this struct (methods) when an item is "realized" (that is created + * dynamically while scrolling). All objects will simply be deleted when no + * longer needed with evas_object_del(). The Elm_GenGrid_Item_Class structure + * contains the following members: + * + * item_style - This is a constant string and simply defines the name of the + * item style. It must be specified and the default should be "default". + * + * func.label_get - This function is called when an actual item object is + * created. The data parameter is the one passed to elm_gengrid_item_append() + * and related item creation functions. The obj parameter is the Gengrid object and + * the part parameter is the string name of the text part in the edje design that + * is listed as one of the possible labels that can be set. This function must * return a strdup'()ed string as the caller will free() it when done. * - * func.icon_get - This function is called when an actual item object - * is created. The data parameter is the one passed to - * elm_gengrid_item_append() and related item creation functions. The - * obj parameter is the Gengrid object and the part parameter is the - * string name of the icon part in the edje design that is listed as - * one of the possible icons that can be set. This must return NULL - * for no object or a valid object. The object will be deleted by - * Gengrid on shutdown or when the item is unrealized. - * - * func.state_get - This function is called when an actual item object - * is created. The data parameter is the one passed to - * elm_gengrid_item_append() and related item creation functions. The - * obj parameter is the Gengrid object and the part parameter is the - * string name of th state part in the edje design that is listed as - * one of the possible states that can be set. Return 0 for false and - * 1 for true. Gengrid will emit a signal to the edje object with - * "elm,state,XXX,active" "elm" when true (the default is false), - * where XXX is the name of the part. - * - * func.del - This is called when elm_gengrid_item_del() is called on - * a item or elm_gengrid_clear() is called on the Gengrid. This is - * intended for use when actual Gengrid items are deleted, so any - * backing data attached to the item (e.g. its data parameter on - * creation) can be deleted. + * func.icon_get - This function is called when an actual item object is + * created. The data parameter is the one passed to elm_gengrid_item_append() + * and related item creation functions. The obj parameter is the Gengrid object and + * the part parameter is the string name of the icon part in the edje design that + * is listed as one of the possible icons that can be set. This must return NULL + * for no object or a valid object. The object will be deleted by Gengrid on + * shutdown or when the item is unrealized. + * + * func.state_get - This function is called when an actual item object is + * created. The data parameter is the one passed to elm_gengrid_item_append() + * and related item creation functions. The obj parameter is the Gengrid object and + * the part parameter is the string name of th state part in the edje design that + * is listed as one of the possible states that can be set. Return 0 for false + * and 1 for true. Gengrid will emit a signal to the edje object with + * "elm,state,XXX,active" "elm" when true (the default is false), where XXX is + * the name of the part. + * + * func.del - This is called when elm_gengrid_item_del() is called on a + * item or elm_gengrid_clear() is called on the Gengrid. This is intended for + * use when actual Gengrid items are deleted, so any backing data attached to the + * item (e.g. its data parameter on creation) can be deleted. * * If the application wants multiple items to be able to be selected, * elm_gengrid_multi_select_set() can enable this. If the Gengrid is - * single-selection only (the default), then - * elm_gengrid_select_item_get() will return the selected item, if - * any, or NULL if none is selected. If the Gengrid is multi-select - * then elm_gengrid_selected_items_get() will return a list (that is - * only valid as long as no items are modified (added, deleted, + * single-selection only (the default), then elm_gengrid_select_item_get() + * will return the selected item, if any, or NULL if none is selected. If the + * Gengrid is multi-select then elm_gengrid_selected_items_get() will return a + * list (that is only valid as long as no items are modified (added, deleted, * selected or unselected). * - * If a item changes (state of boolean changes, label or icons - * change), then use elm_gengrid_item_update() to have Gengrid update - * the item with the new state. Gengrid will re-realize the item thus - * call the functions in the _Elm_Gengrid_Item_Class for that item. - * - * To programmatically (un)select a item use - * elm_gengrid_item_selected_set(). To get its selected state use - * elm_gengrid_item_selected_get(). To make a item disabled (unable to - * be selected and appear differently) use - * elm_gengrid_item_disabled_set() to set this and - * elm_gengrid_item_disabled_get() to get the disabled state. - * - * Cells will only call their selection func and callback when first - * becoming selected. Any further clicks will do nothing, unless you - * enable always select with - * elm_gengrid_always_select_mode_set(). This means event if selected, - * every click will make the selected callbacks be called. - * elm_gengrid_no_select_mode_set() will turn off the ability to - * select items entirely and they will neither appear selected nor - * call selected callback function. - * - * Remember that you can create new styles and add your own theme - * augmentation per application with elm_theme_extension_add(). If you - * absolutely must have a specific style that overrides any theme the - * user or system sets up you can use elm_theme_overlay_add() to add - * such a file. + * If a item changes (state of boolean changes, label or icons change), then use + * elm_gengrid_item_update() to have Gengrid update the item with the new + * state. Gengrid will re-realize the item thus call the functions in the + * _Elm_Gengrid_Item_Class for that item. + * + * To programmatically (un)select a item use elm_gengrid_item_selected_set(). + * To get its selected state use elm_gengrid_item_selected_get(). To make a + * item disabled (unable to be selected and appear differently) use + * elm_gengrid_item_disable_set() to set this and + * elm_gengrid_item_disable_get() to get the disabled state. + * + * Cells will only call their selection func and callback when first becoming + * selected. Any further clicks will do nothing, unless you enable always + * select with elm_gengrid_always_select_mode_set(). This means event if + * selected, every click will make the selected callbacks be called. + * elm_gengrid_no_select_mode_set() will turn off the ability to select + * items entirely and they will neither appear selected nor call selected + * callback function. + * + * Remember that you can create new styles and add your own theme augmentation + * per application with elm_theme_extension_add(). If you absolutely must have a + * specific style that overrides any theme the user or system sets up you can use + * elm_theme_overlay_add() to add such a file. * * -- * TODO: @@ -156,498 +137,78 @@ */ typedef struct _Widget_Data Widget_Data; -typedef struct _Pan Pan; +typedef struct _Pan Pan; #define PRELOAD 1 struct _Elm_Gengrid_Item { - Elm_Widget_Item base; - EINA_INLIST; - Evas_Object *spacer; + Evas_Object *base, *spacer; const Elm_Gengrid_Item_Class *gic; - Ecore_Timer *long_timer; - Widget_Data *wd; - Eina_List *labels, *icons, *states, *icon_objs; + Ecore_Timer *long_timer; + Widget_Data *wd; + Eina_List *labels, *icons, *states, *icon_objs; + const void *data; struct - { - Evas_Smart_Cb func; - const void *data; - } func; + { + Evas_Smart_Cb func; + const void *data; + } func; Evas_Coord x, y, dx, dy; - int relcount; - int walking; - - struct - { - const void *data; - Elm_Tooltip_Item_Content_Cb content_cb; - Evas_Smart_Cb del_cb; - const char *style; - } tooltip; - - const char *mouse_cursor; - - Eina_Bool want_unrealize : 1; - Eina_Bool realized : 1; - Eina_Bool dragging : 1; - Eina_Bool down : 1; - Eina_Bool delete_me : 1; - Eina_Bool display_only : 1; - Eina_Bool disabled : 1; - Eina_Bool selected : 1; - Eina_Bool hilighted : 1; + int relcount; + + Eina_Bool want_unrealize : 1; + Eina_Bool realized : 1; + Eina_Bool dragging : 1; + Eina_Bool down : 1; + Eina_Bool delete_me : 1; + Eina_Bool display_only : 1; + Eina_Bool disabled : 1; + Eina_Bool selected : 1; + Eina_Bool hilighted : 1; + Eina_Bool walking : 1; }; struct _Widget_Data { - Evas_Object *self, *scr; - Evas_Object *pan_smart; - Pan *pan; - Eina_Inlist *items; - Ecore_Job *calc_job; - Eina_List *selected; - Elm_Gengrid_Item *last_selected_item; - double align_x, align_y; - - Evas_Coord pan_x, pan_y; - Evas_Coord item_width, item_height; /* Each item size */ - Evas_Coord minw, minh; /* Total obj size */ - unsigned int nmax; - long count; - int walking; - - Eina_Bool horizontal : 1; - Eina_Bool on_hold : 1; - Eina_Bool longpressed : 1; - Eina_Bool multi : 1; - Eina_Bool no_select : 1; - Eina_Bool wasselected : 1; - Eina_Bool always_select : 1; - Eina_Bool clear_me : 1; + Evas_Object *self, *scr; + Evas_Object *pan_smart; + Pan *pan; + Eina_List *items; + Ecore_Job *calc_job; + Eina_List *selected; + double align_x, align_y; + + Evas_Coord pan_x, pan_y; + Evas_Coord item_width, item_height; /* Each item size */ + Evas_Coord minw, minh; /* Total obj size */ + unsigned int nmax; + + Eina_Bool horizontal : 1; + Eina_Bool on_hold : 1; + Eina_Bool longpressed : 1; + Eina_Bool multi : 1; + Eina_Bool no_select : 1; + Eina_Bool wasselected : 1; + Eina_Bool always_select : 1; }; -#define ELM_GENGRID_ITEM_FROM_INLIST(item) \ - ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Gengrid_Item) : NULL) - struct _Pan { Evas_Object_Smart_Clipped_Data __clipped_data; - Widget_Data *wd; + Widget_Data *wd; }; static const char *widtype = NULL; -static void _item_hilight(Elm_Gengrid_Item *item); -static void _item_unrealize(Elm_Gengrid_Item *item); -static void _item_select(Elm_Gengrid_Item *item); -static void _item_unselect(Elm_Gengrid_Item *item); -static void _calc_job(void *data); -static void _on_focus_hook(void *data, - Evas_Object *obj); -static Eina_Bool _item_multi_select_up(Widget_Data *wd); -static Eina_Bool _item_multi_select_down(Widget_Data *wd); -static Eina_Bool _item_multi_select_left(Widget_Data *wd); -static Eina_Bool _item_multi_select_right(Widget_Data *wd); -static Eina_Bool _item_single_select_up(Widget_Data *wd); -static Eina_Bool _item_single_select_down(Widget_Data *wd); -static Eina_Bool _item_single_select_left(Widget_Data *wd); -static Eina_Bool _item_single_select_right(Widget_Data *wd); -static Eina_Bool _event_hook(Evas_Object *obj, - Evas_Object *src, - Evas_Callback_Type type, - void *event_info); -static Eina_Bool _deselect_all_items(Widget_Data *wd); +static void _item_hilight(Elm_Gengrid_Item *item); +static void _item_unrealize(Elm_Gengrid_Item *item); +static void _item_select(Elm_Gengrid_Item *item); +static void _item_unselect(Elm_Gengrid_Item *item); +static void _calc_job(void *data); static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION; -static Eina_Bool -_event_hook(Evas_Object *obj, - Evas_Object *src __UNUSED__, - Evas_Callback_Type type, - void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (!wd->items) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - - Elm_Gengrid_Item *item = NULL; - Evas_Coord x = 0; - Evas_Coord y = 0; - Evas_Coord step_x = 0; - Evas_Coord step_y = 0; - Evas_Coord v_w = 0; - Evas_Coord v_h = 0; - Evas_Coord page_x = 0; - Evas_Coord page_y = 0; - - elm_smart_scroller_child_pos_get(wd->scr, &x, &y); - elm_smart_scroller_step_size_get(wd->scr, &step_x, &step_y); - elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y); - elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); - - if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) - { - if ((wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_up(wd))) - || (_item_single_select_up(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_left(wd))) - || (_item_single_select_left(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - x -= step_x; - } - else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) - { - if ((wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_down(wd))) - || (_item_single_select_down(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_right(wd))) - || (_item_single_select_right(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - x += step_x; - } - else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) - { - if ((wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_left(wd))) - || (_item_single_select_left(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_up(wd))) - || (_item_single_select_up(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - y -= step_y; - } - else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) - { - if ((wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_right(wd))) - || (_item_single_select_right(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!wd->horizontal) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_down(wd))) - || (_item_single_select_down(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - y += step_y; - } - else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home"))) - { - item = elm_gengrid_first_item_get(obj); - elm_gengrid_item_bring_in(item); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End"))) - { - item = elm_gengrid_last_item_get(obj); - elm_gengrid_item_bring_in(item); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!strcmp(ev->keyname, "Prior")) || - (!strcmp(ev->keyname, "KP_Prior"))) - { - if (wd->horizontal) - { - if (page_x < 0) - x -= -(page_x * v_w) / 100; - else - x -= page_x; - } - else - { - if (page_y < 0) - y -= -(page_y * v_h) / 100; - else - y -= page_y; - } - } - else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next"))) - { - if (wd->horizontal) - { - if (page_x < 0) - x += -(page_x * v_w) / 100; - else - x += page_x; - } - else - { - if (page_y < 0) - y += -(page_y * v_h) / 100; - else - y += page_y; - } - } - else if (!strcmp(ev->keyname, "Escape")) - { - if (!_deselect_all_items(wd)) return EINA_FALSE; - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else return EINA_FALSE; - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - elm_smart_scroller_child_pos_set(wd->scr, x, y); - return EINA_TRUE; -} - -static Eina_Bool -_deselect_all_items(Widget_Data *wd) -{ - if (!wd->selected) return EINA_FALSE; - while(wd->selected) - elm_gengrid_item_selected_set(wd->selected->data, EINA_FALSE); - - return EINA_TRUE; -} - -static Eina_Bool -_item_multi_select_left(Widget_Data *wd) -{ - if (!wd->selected) return EINA_FALSE; - - Elm_Gengrid_Item *prev = elm_gengrid_item_prev_get(wd->last_selected_item); - if (!prev) return EINA_TRUE; - if (elm_gengrid_item_selected_get(prev)) - { - elm_gengrid_item_selected_set(wd->last_selected_item, EINA_FALSE); - wd->last_selected_item = prev; - elm_gengrid_item_show(wd->last_selected_item); - } - else - { - elm_gengrid_item_selected_set(prev, EINA_TRUE); - elm_gengrid_item_show(prev); - } - - return EINA_TRUE; -} - -static Eina_Bool -_item_multi_select_right(Widget_Data *wd) -{ - if (!wd->selected) return EINA_FALSE; - - Elm_Gengrid_Item *next = elm_gengrid_item_next_get(wd->last_selected_item); - if (!next) return EINA_TRUE; - if (elm_gengrid_item_selected_get(next)) - { - elm_gengrid_item_selected_set(wd->last_selected_item, EINA_FALSE); - wd->last_selected_item = next; - elm_gengrid_item_show(wd->last_selected_item); - } - else - { - elm_gengrid_item_selected_set(next, EINA_TRUE); - elm_gengrid_item_show(next); - } - - return EINA_TRUE; -} - -static Eina_Bool -_item_multi_select_up(Widget_Data *wd) -{ - unsigned int i; - Eina_Bool r = EINA_TRUE; - - if (!wd->selected) return EINA_FALSE; - - for (i = 0; (r) && (i < wd->nmax); i++) - r &= _item_multi_select_left(wd); - - return r; -} - -static Eina_Bool -_item_multi_select_down(Widget_Data *wd) -{ - unsigned int i; - Eina_Bool r = EINA_TRUE; - - if (!wd->selected) return EINA_FALSE; - - for (i = 0; (r) && (i < wd->nmax); i++) - r &= _item_multi_select_right(wd); - - return r; -} - -static Eina_Bool -_item_single_select_up(Widget_Data *wd) -{ - unsigned int i; - - Elm_Gengrid_Item *prev; - - if (!wd->selected) - { - prev = ELM_GENGRID_ITEM_FROM_INLIST(wd->items->last); - while ((prev) && (prev->delete_me)) - prev = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev); - elm_gengrid_item_selected_set(prev, EINA_TRUE); - elm_gengrid_item_show(prev); - return EINA_TRUE; - } - else prev = elm_gengrid_item_prev_get(wd->last_selected_item); - - if (!prev) return EINA_FALSE; - - for (i = 1; i < wd->nmax; i++) - { - Elm_Gengrid_Item *tmp = elm_gengrid_item_prev_get(prev); - if (!tmp) return EINA_FALSE; - prev = tmp; - } - - _deselect_all_items(wd); - - elm_gengrid_item_selected_set(prev, EINA_TRUE); - elm_gengrid_item_show(prev); - return EINA_TRUE; -} - -static Eina_Bool -_item_single_select_down(Widget_Data *wd) -{ - unsigned int i; - - Elm_Gengrid_Item *next; - - if (!wd->selected) - { - next = ELM_GENGRID_ITEM_FROM_INLIST(wd->items); - while ((next) && (next->delete_me)) - next = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); - elm_gengrid_item_selected_set(next, EINA_TRUE); - elm_gengrid_item_show(next); - return EINA_TRUE; - } - else next = elm_gengrid_item_next_get(wd->last_selected_item); - - if (!next) return EINA_FALSE; - - for (i = 1; i < wd->nmax; i++) - { - Elm_Gengrid_Item *tmp = elm_gengrid_item_next_get(next); - if (!tmp) return EINA_FALSE; - next = tmp; - } - - _deselect_all_items(wd); - - elm_gengrid_item_selected_set(next, EINA_TRUE); - elm_gengrid_item_show(next); - return EINA_TRUE; -} - -static Eina_Bool -_item_single_select_left(Widget_Data *wd) -{ - Elm_Gengrid_Item *prev; - if (!wd->selected) - { - prev = ELM_GENGRID_ITEM_FROM_INLIST(wd->items->last); - while ((prev) && (prev->delete_me)) - prev = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev); - } - else prev = elm_gengrid_item_prev_get(wd->last_selected_item); - - if (!prev) return EINA_FALSE; - - _deselect_all_items(wd); - - elm_gengrid_item_selected_set(prev, EINA_TRUE); - elm_gengrid_item_show(prev); - return EINA_TRUE; -} - -static Eina_Bool -_item_single_select_right(Widget_Data *wd) -{ - Elm_Gengrid_Item *next; - if (!wd->selected) - { - next = ELM_GENGRID_ITEM_FROM_INLIST(wd->items); - while ((next) && (next->delete_me)) - next = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); - } - else next = elm_gengrid_item_next_get(wd->last_selected_item); - - if (!next) return EINA_FALSE; - - _deselect_all_items(wd); - - elm_gengrid_item_selected_set(next, EINA_TRUE); - elm_gengrid_item_show(next); - return EINA_TRUE; -} - -static void -_on_focus_hook(void *data __UNUSED__, - Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->self, "elm,action,focus", "elm"); - evas_object_focus_set(wd->self, EINA_TRUE); - if ((wd->selected) && (!wd->last_selected_item)) - wd->last_selected_item = eina_list_data_get(wd->selected); - } - else - { - edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->self, EINA_FALSE); - } -} - static void _theme_hook(Evas_Object *obj) { @@ -658,38 +219,18 @@ _theme_hook(Evas_Object *obj) } static void -_del_pre_hook(Evas_Object *obj) +_del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; elm_gengrid_clear(obj); evas_object_del(wd->pan_smart); wd->pan_smart = NULL; -} - -static void -_del_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); free(wd); } static void -_signal_emit_hook(Evas_Object *obj, - const char *emission, - const char *source) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), - emission, source); -} - -static void -_mouse_move(void *data, - Evas *evas __UNUSED__, - Evas_Object *obj, - void *event_info) +_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) { Elm_Gengrid_Item *item = data; Evas_Event_Mouse_Move *ev = event_info; @@ -697,31 +238,31 @@ _mouse_move(void *data, if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) { - if (!item->wd->on_hold) - { - item->wd->on_hold = EINA_TRUE; + if (!item->wd->on_hold) + { + item->wd->on_hold = EINA_TRUE; if (!item->wd->wasselected) _item_unselect(item); - } + } } if ((item->dragging) && (item->down)) { - if (item->long_timer) - { - ecore_timer_del(item->long_timer); - item->long_timer = NULL; - } - evas_object_smart_callback_call(item->wd->self, "drag", item); - return; + if (item->long_timer) + { + ecore_timer_del(item->long_timer); + item->long_timer = NULL; + } + evas_object_smart_callback_call(item->wd->self, "drag", item); + return; } if ((!item->down) || (item->wd->longpressed)) { - if (item->long_timer) - { - ecore_timer_del(item->long_timer); - item->long_timer = NULL; - } - return; + if (item->long_timer) + { + ecore_timer_del(item->long_timer); + item->long_timer = NULL; + } + return; } if (!item->display_only) elm_coords_finger_size_adjust(1, &minw, 1, &minh); @@ -738,41 +279,41 @@ _mouse_move(void *data, minh /= 2; if ((adx > minw) || (ady > minh)) { - item->dragging = 1; - if (item->long_timer) - { - ecore_timer_del(item->long_timer); - item->long_timer = NULL; - } - if (!item->wd->wasselected) - _item_unselect(item); - if (dy < 0) - { - if (ady > adx) - evas_object_smart_callback_call(item->wd->self, "drag,start,up", - item); - else - { - if (dx < 0) - evas_object_smart_callback_call(item->wd->self, - "drag,start,left", item); - } - } - else - { - if (ady > adx) - evas_object_smart_callback_call(item->wd->self, - "drag,start,down", item); - else - { - if (dx < 0) - evas_object_smart_callback_call(item->wd->self, - "drag,start,left", item); - else - evas_object_smart_callback_call(item->wd->self, - "drag,start,right", item); - } - } + item->dragging = 1; + if (item->long_timer) + { + ecore_timer_del(item->long_timer); + item->long_timer = NULL; + } + if (!item->wd->wasselected) + _item_unselect(item); + if (dy < 0) + { + if (ady > adx) + evas_object_smart_callback_call(item->wd->self, "drag,start,up", + item); + else + { + if (dx < 0) + evas_object_smart_callback_call(item->wd->self, + "drag,start,left", item); + } + } + else + { + if (ady > adx) + evas_object_smart_callback_call(item->wd->self, + "drag,start,down", item); + else + { + if (dx < 0) + evas_object_smart_callback_call(item->wd->self, + "drag,start,left", item); + else + evas_object_smart_callback_call(item->wd->self, + "drag,start,right", item); + } + } } } @@ -789,10 +330,7 @@ _long_press(void *data) } static void -_mouse_down(void *data, - Evas *evas __UNUSED__, - Evas_Object *obj, - void *event_info) +_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) { Elm_Gengrid_Item *item = data; Evas_Event_Mouse_Down *ev = event_info; @@ -813,17 +351,13 @@ _mouse_down(void *data, evas_object_smart_callback_call(item->wd->self, "clicked", item); if (item->long_timer) ecore_timer_del(item->long_timer); if (item->realized) - item->long_timer = ecore_timer_add(_elm_config->longpress_timeout, - _long_press, item); + item->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, item); else item->long_timer = NULL; } static void -_mouse_up(void *data, - Evas *evas __UNUSED__, - Evas_Object *obj __UNUSED__, - void *event_info) +_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_Gengrid_Item *item = data; Evas_Event_Mouse_Up *ev = event_info; @@ -835,59 +369,59 @@ _mouse_up(void *data, else item->wd->on_hold = EINA_FALSE; if (item->long_timer) { - ecore_timer_del(item->long_timer); - item->long_timer = NULL; + ecore_timer_del(item->long_timer); + item->long_timer = NULL; } if (item->dragging) { - item->dragging = EINA_FALSE; - evas_object_smart_callback_call(item->wd->self, "drag,stop", item); - dragged = EINA_TRUE; + item->dragging = EINA_FALSE; + evas_object_smart_callback_call(item->wd->self, "drag,stop", item); + dragged = EINA_TRUE; } if (item->wd->on_hold) { - item->wd->longpressed = EINA_FALSE; - item->wd->on_hold = EINA_FALSE; - return; + item->wd->longpressed = EINA_FALSE; + item->wd->on_hold = EINA_FALSE; + return; } if (item->wd->longpressed) { - item->wd->longpressed = EINA_FALSE; - if (!item->wd->wasselected) _item_unselect(item); - item->wd->wasselected = EINA_FALSE; - return; + item->wd->longpressed = EINA_FALSE; + if (!item->wd->wasselected) _item_unselect(item); + item->wd->wasselected = EINA_FALSE; + return; } if (dragged) { - if (item->want_unrealize) _item_unrealize(item); + if (item->want_unrealize) _item_unrealize(item); } - if ((item->disabled) || (dragged)) return; + if ((item->disabled) || dragged) return; if (item->wd->multi) { - if (!item->selected) - { - _item_hilight(item); - _item_select(item); - } - else _item_unselect(item); + if (!item->selected) + { + _item_hilight(item); + _item_select(item); + } + else _item_unselect(item); } else { - if (!item->selected) - { - while (item->wd->selected) - _item_unselect(item->wd->selected->data); - } - else - { - const Eina_List *l, *l_next; - Elm_Gengrid_Item *item2; - - EINA_LIST_FOREACH_SAFE(item->wd->selected, l, l_next, item2) - if (item2 != item) _item_unselect(item2); - } - _item_hilight(item); - _item_select(item); + if (!item->selected) + { + while (item->wd->selected) + _item_unselect(item->wd->selected->data); + } + else + { + const Eina_List *l, *l_next; + Elm_Gengrid_Item *item2; + + EINA_LIST_FOREACH_SAFE(item->wd->selected, l, l_next, item2) + if (item2 != item) _item_unselect(item2); + } + _item_hilight(item); + _item_select(item); } } @@ -895,7 +429,7 @@ static void _item_hilight(Elm_Gengrid_Item *item) { if ((item->wd->no_select) || (item->delete_me) || (item->hilighted)) return; - edje_object_signal_emit(item->base.view, "elm,state,selected", "elm"); + edje_object_signal_emit(item->base, "elm,state,selected", "elm"); item->hilighted = EINA_TRUE; } @@ -906,120 +440,103 @@ _item_realize(Elm_Gengrid_Item *item) char style[1024]; if ((item->realized) || (item->delete_me)) return; - item->base.view = edje_object_add(evas_object_evas_get(item->wd->self)); - edje_object_scale_set(item->base.view, elm_widget_scale_get(item->wd->self) * - _elm_config->scale); - evas_object_smart_member_add(item->base.view, item->wd->pan_smart); - elm_widget_sub_object_add(item->wd->self, item->base.view); + item->base = edje_object_add(evas_object_evas_get(item->wd->self)); + edje_object_scale_set(item->base, elm_widget_scale_get(item->wd->self) * + _elm_config->scale); + evas_object_smart_member_add(item->base, item->wd->pan_smart); + elm_widget_sub_object_add(item->wd->self, item->base); snprintf(style, sizeof(style), "item/%s", - item->gic->item_style ? item->gic->item_style : "default"); - _elm_theme_object_set(item->wd->self, item->base.view, "gengrid", style, + item->gic->item_style ? item->gic->item_style : "default"); + _elm_theme_object_set(item->wd->self, item->base, "gengrid", style, elm_widget_style_get(item->wd->self)); - item->spacer = - evas_object_rectangle_add(evas_object_evas_get(item->wd->self)); + item->spacer = evas_object_rectangle_add(evas_object_evas_get(item->wd->self)); evas_object_color_set(item->spacer, 0, 0, 0, 0); elm_widget_sub_object_add(item->wd->self, item->spacer); evas_object_size_hint_min_set(item->spacer, 2 * _elm_config->scale, 1); - edje_object_part_swallow(item->base.view, "elm.swallow.pad", item->spacer); + edje_object_part_swallow(item->base, "elm.swallow.pad", item->spacer); if (item->gic->func.label_get) { - const Eina_List *l; - const char *key; - - item->labels = - elm_widget_stringlist_get(edje_object_data_get(item->base.view, - "labels")); - EINA_LIST_FOREACH(item->labels, l, key) - { - char *s = item->gic->func.label_get - ((void *)item->base.data, item->wd->self, l->data); - if (s) - { - edje_object_part_text_set(item->base.view, l->data, s); - free(s); - } - } + const Eina_List *l; + const char *key; + + item->labels = elm_widget_stringlist_get(edje_object_data_get(item->base, + "labels")); + EINA_LIST_FOREACH(item->labels, l, key) + { + char *s = item->gic->func.label_get(item->data, item->wd->self, + l->data); + if (s) + { + edje_object_part_text_set(item->base, l->data, s); + free(s); + } + } } if (item->gic->func.icon_get) { - const Eina_List *l; - const char *key; - - item->icons = - elm_widget_stringlist_get(edje_object_data_get(item->base.view, - "icons")); - EINA_LIST_FOREACH(item->icons, l, key) - { - Evas_Object *ic = item->gic->func.icon_get - ((void *)item->base.data, item->wd->self, l->data); - if (ic) - { - item->icon_objs = eina_list_append(item->icon_objs, ic); - edje_object_part_swallow(item->base.view, key, ic); - evas_object_show(ic); - elm_widget_sub_object_add(item->wd->self, ic); - } - } + const Eina_List *l; + const char *key; + + item->icons = elm_widget_stringlist_get(edje_object_data_get(item->base, + "icons")); + EINA_LIST_FOREACH(item->icons, l, key) + { + Evas_Object *ic = item->gic->func.icon_get(item->data, + item->wd->self, + l->data); + if (ic) + { + item->icon_objs = eina_list_append(item->icon_objs, ic); + edje_object_part_swallow(item->base, key, ic); + evas_object_show(ic); + elm_widget_sub_object_add(item->wd->self, ic); + } + } } if (item->gic->func.state_get) { - const Eina_List *l; - const char *key; - - item->states = - elm_widget_stringlist_get(edje_object_data_get(item->base.view, - "states")); - EINA_LIST_FOREACH(item->states, l, key) - { - Eina_Bool on = item->gic->func.state_get - ((void *)item->base.data, item->wd->self, l->data); - if (on) - { - snprintf(buf, sizeof(buf), "elm,state,%s,active", key); - edje_object_signal_emit(item->base.view, buf, "elm"); - } - } + const Eina_List *l; + const char *key; + + item->states = elm_widget_stringlist_get(edje_object_data_get(item->base, + "states")); + EINA_LIST_FOREACH(item->states, l, key) + { + Eina_Bool on = item->gic->func.state_get(item->data, + item->wd->self, l->data); + if (on) + { + snprintf(buf, sizeof(buf), "elm,state,%s,active", key); + edje_object_signal_emit(item->base, buf, "elm"); + } + } } if ((!item->wd->item_width) && (!item->wd->item_height)) { - edje_object_size_min_restricted_calc(item->base.view, - &item->wd->item_width, - &item->wd->item_height, - item->wd->item_width, - item->wd->item_height); - elm_coords_finger_size_adjust(1, &item->wd->item_width, - 1, &item->wd->item_height); + edje_object_size_min_restricted_calc(item->base, + &item->wd->item_width, &item->wd->item_height, + item->wd->item_width, item->wd->item_height); + elm_coords_finger_size_adjust(1, &item->wd->item_width, + 1, &item->wd->item_height); } - evas_object_event_callback_add(item->base.view, EVAS_CALLBACK_MOUSE_DOWN, - _mouse_down, item); - evas_object_event_callback_add(item->base.view, EVAS_CALLBACK_MOUSE_UP, - _mouse_up, item); - evas_object_event_callback_add(item->base.view, EVAS_CALLBACK_MOUSE_MOVE, - _mouse_move, item); + evas_object_event_callback_add(item->base, EVAS_CALLBACK_MOUSE_DOWN, + _mouse_down, item); + evas_object_event_callback_add(item->base, EVAS_CALLBACK_MOUSE_UP, + _mouse_up, item); + evas_object_event_callback_add(item->base, EVAS_CALLBACK_MOUSE_MOVE, + _mouse_move, item); if (item->selected) - edje_object_signal_emit(item->base.view, "elm,state,selected", "elm"); + edje_object_signal_emit(item->base, "elm,state,selected", "elm"); if (item->disabled) - edje_object_signal_emit(item->base.view, "elm,state,disabled", "elm"); - - evas_object_show(item->base.view); - - if (item->tooltip.content_cb) - { - elm_widget_item_tooltip_content_cb_set(item, - item->tooltip.content_cb, - item->tooltip.data, NULL); - elm_widget_item_tooltip_style_set(item, item->tooltip.style); - } - - if (item->mouse_cursor) - elm_widget_item_cursor_set(item, item->mouse_cursor); + edje_object_signal_emit(item->base, "elm,state,disabled", "elm"); + evas_object_show(item->base); item->realized = EINA_TRUE; item->want_unrealize = EINA_FALSE; } @@ -1032,11 +549,11 @@ _item_unrealize(Elm_Gengrid_Item *item) if (!item->realized) return; if (item->long_timer) { - ecore_timer_del(item->long_timer); - item->long_timer = NULL; + ecore_timer_del(item->long_timer); + item->long_timer = NULL; } - evas_object_del(item->base.view); - item->base.view = NULL; + evas_object_del(item->base); + item->base = NULL; evas_object_del(item->spacer); item->spacer = NULL; elm_widget_stringlist_free(item->labels); @@ -1044,19 +561,17 @@ _item_unrealize(Elm_Gengrid_Item *item) elm_widget_stringlist_free(item->icons); item->icons = NULL; elm_widget_stringlist_free(item->states); - item->states = NULL; EINA_LIST_FREE(item->icon_objs, icon) evas_object_del(icon); + item->states = NULL; item->realized = EINA_FALSE; item->want_unrealize = EINA_FALSE; } static void -_item_place(Elm_Gengrid_Item *item, - Evas_Coord cx, - Evas_Coord cy) +_item_place(Elm_Gengrid_Item *item, Evas_Coord cx, Evas_Coord cy) { Evas_Coord x, y, ox, oy, cvx, cvy, cvw, cvh; Evas_Coord tch, tcw, alignw = 0, alignh = 0, vw, vh; @@ -1064,6 +579,8 @@ _item_place(Elm_Gengrid_Item *item, item->x = cx; item->y = cy; evas_object_geometry_get(item->wd->pan_smart, &ox, &oy, &vw, &vh); + evas_output_viewport_get(evas_object_evas_get(item->wd->self), + &cvx, &cvy, &cvw, &cvh); /* Preload rows/columns at each side of the Gengrid */ cvx = ox - PRELOAD * item->wd->item_width; @@ -1071,116 +588,86 @@ _item_place(Elm_Gengrid_Item *item, cvw = vw + 2 * PRELOAD * item->wd->item_width; cvh = vh + 2 * PRELOAD * item->wd->item_height; - alignh = 0; - alignw = 0; + tch = ((vh/item->wd->item_height)*item->wd->item_height); + alignh = (vh - tch)*item->wd->align_y; - if (item->wd->horizontal) - { - int columns, items_visible = 0, items_row; + tcw = ((vw/item->wd->item_width)*item->wd->item_width); + alignw = (vw - tcw)*item->wd->align_x; - if (item->wd->item_height > 0) - items_visible = vh / item->wd->item_height; - if (items_visible < 1) - items_visible = 1; + if ((item->wd->horizontal) && (item->wd->minw < vw)) + { + int columns; - columns = item->wd->count / items_visible; - if (item->wd->count % items_visible) - columns++; + columns = eina_list_count(item->wd->items)/(vh/item->wd->item_height); + if (eina_list_count(item->wd->items) % (vh/item->wd->item_height)) + columns++; tcw = item->wd->item_width * columns; - alignw = (vw - tcw) * item->wd->align_x; - - items_row = items_visible; - if (items_row > item->wd->count) - items_row = item->wd->count; - tch = items_row * item->wd->item_height; - alignh = (vh - tch) * item->wd->align_y; + alignw = (vw - tcw)*item->wd->align_x; } - else + else if ((item->wd->horizontal) && (item->wd->minw > vw)) + alignw = 0; + if ((!item->wd->horizontal) && (item->wd->minh < vh)) { - int rows, items_visible = 0, items_col; - - if (item->wd->item_width > 0) - items_visible = vw / item->wd->item_width; - if (items_visible < 1) - items_visible = 1; + int rows; - rows = item->wd->count / items_visible; - if (item->wd->count % items_visible) - rows++; + rows = eina_list_count(item->wd->items)/(vw/item->wd->item_width); + if (eina_list_count(item->wd->items) % (vw/item->wd->item_width)) + rows++; tch = item->wd->item_height * rows; - alignh = (vh - tch) * item->wd->align_y; - - items_col = items_visible; - if (items_col > item->wd->count) - items_col = item->wd->count; - tcw = items_col * item->wd->item_width; - alignw = (vw - tcw) * item->wd->align_x; + alignh = (vh - tch)*item->wd->align_y; } - + else if ((!item->wd->horizontal) && (item->wd->minh > vh)) + alignh = 0; x = cx * item->wd->item_width - item->wd->pan_x + ox + alignw; y = cy * item->wd->item_height - item->wd->pan_y + oy + alignh; - Eina_Bool was_realized = item->realized; if (ELM_RECTS_INTERSECT(x, y, item->wd->item_width, item->wd->item_height, - cvx, cvy, cvw, cvh)) + cvx, cvy, cvw, cvh)) { - _item_realize(item); - if (!was_realized) - evas_object_smart_callback_call(item->wd->self, "realized", item); - evas_object_move(item->base.view, x, y); - evas_object_resize(item->base.view, item->wd->item_width, - item->wd->item_height); + Eina_Bool was_realized = item->realized; + + _item_realize(item); + if (!was_realized) + evas_object_smart_callback_call(item->wd->self, "realized", item); + evas_object_move(item->base, x, y); + evas_object_resize(item->base, item->wd->item_width, + item->wd->item_height); } else - { - _item_unrealize(item); - if (was_realized) - evas_object_smart_callback_call(item->wd->self, "unrealized", item); - } + _item_unrealize(item); } static Elm_Gengrid_Item * -_item_create(Widget_Data *wd, - const Elm_Gengrid_Item_Class *gic, - const void *data, - Evas_Smart_Cb func, - const void *func_data) +_item_create(Widget_Data *wd, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data) { Elm_Gengrid_Item *item; - item = elm_widget_item_new(wd->self, Elm_Gengrid_Item); + item = calloc(1, sizeof(*item)); if (!item) return NULL; - wd->count++; item->wd = wd; item->gic = gic; - item->base.data = data; + item->data = data; item->func.func = func; item->func.data = func_data; - item->mouse_cursor = NULL; return item; } static void _item_del(Elm_Gengrid_Item *item) { - elm_widget_item_pre_notify_del(item); if (item->selected) item->wd->selected = eina_list_remove(item->wd->selected, item); if (item->realized) _item_unrealize(item); if ((!item->delete_me) && (item->gic->func.del)) - item->gic->func.del((void *)item->base.data, item->wd->self); + item->gic->func.del(item->data, item->wd->self); item->delete_me = EINA_TRUE; - item->wd->items = eina_inlist_remove(item->wd->items, EINA_INLIST_GET(item)); + item->wd->items = eina_list_remove(item->wd->items, item); if (item->long_timer) ecore_timer_del(item->long_timer); - if (item->tooltip.del_cb) - item->tooltip.del_cb((void *)item->tooltip.data, item->base.widget, item); - item->wd->walking -= item->walking; - item->wd->count--; if (item->wd->calc_job) ecore_job_del(item->wd->calc_job); item->wd->calc_job = ecore_job_add(_calc_job, item->wd); - elm_widget_item_del(item); + free(item); } static void @@ -1189,41 +676,33 @@ _item_select(Elm_Gengrid_Item *item) if ((item->wd->no_select) || (item->delete_me)) return; if (item->selected) { - if (item->wd->always_select) goto call; - return; + if (item->wd->always_select) goto call; + return; } item->selected = EINA_TRUE; item->wd->selected = eina_list_append(item->wd->selected, item); call: item->walking++; - item->wd->walking++; - if (item->func.func) + if (item->func.func) item->func.func((void *)item->func.data, item->wd->self, item); if (!item->delete_me) evas_object_smart_callback_call(item->wd->self, "selected", item); item->walking--; - item->wd->walking--; - if ((item->wd->clear_me) && (!item->wd->walking)) - elm_gengrid_clear(item->base.widget); - else - { - if ((!item->walking) && (item->delete_me)) - if (!item->relcount) _item_del(item); - } - item->wd->last_selected_item = item; + if ((item->walking == 0) && (item->delete_me)) + if (item->relcount == 0) _item_del(item); } static void _item_unselect(Elm_Gengrid_Item *item) { if ((item->delete_me) || (!item->hilighted)) return; - edje_object_signal_emit(item->base.view, "elm,state,unselected", "elm"); + edje_object_signal_emit(item->base, "elm,state,unselected", "elm"); item->hilighted = EINA_FALSE; if (item->selected) { - item->selected = EINA_FALSE; - item->wd->selected = eina_list_remove(item->wd->selected, item); - evas_object_smart_callback_call(item->wd->self, "unselected", item); + item->selected = EINA_FALSE; + item->wd->selected = eina_list_remove(item->wd->selected, item); + evas_object_smart_callback_call(item->wd->self, "unselected", item); } } @@ -1235,31 +714,31 @@ _calc_job(void *data) int count; evas_object_geometry_get(wd->pan_smart, NULL, NULL, &cvw, &cvh); - if ((wd->horizontal) && (wd->item_height > 0)) + if ((wd->horizontal) && (wd->item_height)) nmax = cvh / wd->item_height; - else if (wd->item_width > 0) + else if (wd->item_width) nmax = cvw / wd->item_width; - if (nmax < 1) - nmax = 1; - - count = wd->count; - if (wd->horizontal) + if (nmax) { - minw = ceil(count / (float)nmax) * wd->item_width; - minh = nmax * wd->item_height; - } - else - { - minw = nmax * wd->item_width; - minh = ceil(count / (float)nmax) * wd->item_height; + count = eina_list_count(wd->items); + if (wd->horizontal) + { + minw = ceil(count / (float)nmax) * wd->item_width; + minh = nmax * wd->item_height; + } + else + { + minw = nmax * wd->item_width; + minh = ceil(count / (float)nmax) * wd->item_height; + } } if ((minw != wd->minw) || (minh != wd->minh)) { - wd->minh = minh; - wd->minw = minw; - evas_object_smart_callback_call(wd->pan_smart, "changed", NULL); + wd->minh = minh; + wd->minw = minw; + evas_object_smart_callback_call(wd->pan_smart, "changed", NULL); } wd->nmax = nmax; @@ -1292,9 +771,7 @@ _pan_del(Evas_Object *obj) } static void -_pan_set(Evas_Object *obj, - Evas_Coord x, - Evas_Coord y) +_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { Pan *sd = evas_object_smart_data_get(obj); if ((x == sd->wd->pan_x) && (y == sd->wd->pan_y)) return; @@ -1304,9 +781,7 @@ _pan_set(Evas_Object *obj, } static void -_pan_get(Evas_Object *obj, - Evas_Coord *x, - Evas_Coord *y) +_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) { Pan *sd = evas_object_smart_data_get(obj); if (x) *x = sd->wd->pan_x; @@ -1314,9 +789,7 @@ _pan_get(Evas_Object *obj, } static void -_pan_child_size_get(Evas_Object *obj, - Evas_Coord *w, - Evas_Coord *h) +_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { Pan *sd = evas_object_smart_data_get(obj); if (w) *w = sd->wd->minw; @@ -1324,9 +797,7 @@ _pan_child_size_get(Evas_Object *obj, } static void -_pan_max_get(Evas_Object *obj, - Evas_Coord *x, - Evas_Coord *y) +_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) { Pan *sd = evas_object_smart_data_get(obj); Evas_Coord ow, oh; @@ -1340,25 +811,7 @@ _pan_max_get(Evas_Object *obj, } static void -_pan_min_get(Evas_Object *obj, - Evas_Coord *x, - Evas_Coord *y) -{ - Pan *sd = evas_object_smart_data_get(obj); - Evas_Coord mx, my; - - if (!sd) return; - _pan_max_get(obj, &mx, &my); - if (x) - *x = -mx * sd->wd->align_x; - if (y) - *y = -my * sd->wd->align_y; -} - -static void -_pan_resize(Evas_Object *obj, - Evas_Coord w, - Evas_Coord h) +_pan_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { Pan *sd = evas_object_smart_data_get(obj); Evas_Coord ow, oh; @@ -1374,32 +827,30 @@ _pan_calculate(Evas_Object *obj) { Pan *sd = evas_object_smart_data_get(obj); Evas_Coord cx = 0, cy = 0; + Eina_List *l; Elm_Gengrid_Item *item; if (!sd) return; if (!sd->wd->nmax) return; - EINA_INLIST_FOREACH(sd->wd->items, item) - { - _item_place(item, cx, cy); - if (sd->wd->horizontal) - { - cy = (cy + 1) % sd->wd->nmax; - if (!cy) cx++; - } - else - { - cx = (cx + 1) % sd->wd->nmax; - if (!cx) cy++; - } - } - evas_object_smart_callback_call(sd->wd->self, "changed", NULL); + EINA_LIST_FOREACH(sd->wd->items, l, item) + { + _item_place(item, cx, cy); + if (sd->wd->horizontal) + { + cy = (cy + 1) % sd->wd->nmax; + if (!cy) cx++; + } + else + { + cx = (cx + 1) % sd->wd->nmax; + if (!cx) cy++; + } + } } static void -_pan_move(Evas_Object *obj, - Evas_Coord x __UNUSED__, - Evas_Coord y __UNUSED__) +_pan_move(Evas_Object *obj, Evas_Coord x __UNUSED__, Evas_Coord y __UNUSED__) { Pan *sd = evas_object_smart_data_get(obj); if (!sd) return; @@ -1408,9 +859,7 @@ _pan_move(Evas_Object *obj, } static void -_hold_on(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -1418,9 +867,7 @@ _hold_on(void *data __UNUSED__, } static void -_hold_off(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -1428,9 +875,7 @@ _hold_off(void *data __UNUSED__, } static void -_freeze_on(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -1438,9 +883,7 @@ _freeze_on(void *data __UNUSED__, } static void -_freeze_off(void *data __UNUSED__, - Evas_Object *obj, - void *event_info __UNUSED__) +_freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -1448,25 +891,19 @@ _freeze_off(void *data __UNUSED__, } static void -_scr_drag_start(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_scr_drag_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { evas_object_smart_callback_call(data, "scroll,drag,start", NULL); } static void -_scr_drag_stop(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_scr_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { evas_object_smart_callback_call(data, "scroll,drag,stop", NULL); } static void -_scr_scroll(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) +_scr_scroll(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { evas_object_smart_callback_call(data, "scroll", NULL); } @@ -1488,46 +925,37 @@ _scr_scroll(void *data, EAPI Evas_Object * elm_gengrid_add(Evas_Object *parent) { + if (!parent) return NULL; + Evas_Object *obj; Evas *e; Widget_Data *wd; static Evas_Smart *smart = NULL; - Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "gengrid"); elm_widget_type_set(obj, "gengrid"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); - elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); wd->scr = elm_smart_scroller_add(e); elm_smart_scroller_widget_set(wd->scr, obj); - elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base", - "default"); + elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base", "default"); elm_widget_resize_object_set(obj, wd->scr); evas_object_smart_callback_add(wd->scr, "drag,start", _scr_drag_start, obj); evas_object_smart_callback_add(wd->scr, "drag,stop", _scr_drag_stop, obj); evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj); - elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce); + elm_smart_scroller_bounce_allow_set(wd->scr, 1, 1); wd->self = obj; wd->align_x = 0.5; wd->align_y = 0.5; - wd->no_select = EINA_FALSE; evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj); evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj); @@ -1536,29 +964,29 @@ elm_gengrid_add(Evas_Object *parent) if (!smart) { - static Evas_Smart_Class sc; - - evas_object_smart_clipped_smart_set(&_pan_sc); - sc = _pan_sc; - sc.name = "elm_gengrid_pan"; - sc.version = EVAS_SMART_CLASS_VERSION; - sc.add = _pan_add; - sc.del = _pan_del; - sc.resize = _pan_resize; - sc.move = _pan_move; - sc.calculate = _pan_calculate; - smart = evas_smart_class_new(&sc); + static Evas_Smart_Class sc; + + evas_object_smart_clipped_smart_set(&_pan_sc); + sc = _pan_sc; + sc.name = "elm_gengrid_pan"; + sc.version = EVAS_SMART_CLASS_VERSION; + sc.add = _pan_add; + sc.del = _pan_del; + sc.resize = _pan_resize; + sc.move = _pan_move; + sc.calculate = _pan_calculate; + smart = evas_smart_class_new(&sc); } if (smart) { - wd->pan_smart = evas_object_smart_add(e, smart); - wd->pan = evas_object_smart_data_get(wd->pan_smart); - wd->pan->wd = wd; + wd->pan_smart = evas_object_smart_add(e, smart); + wd->pan = evas_object_smart_data_get(wd->pan_smart); + wd->pan->wd = wd; } elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart, - _pan_set, _pan_get, _pan_max_get, - _pan_min_get, _pan_child_size_get); + _pan_set, _pan_get, + _pan_max_get, _pan_child_size_get); return obj; } @@ -1575,9 +1003,7 @@ elm_gengrid_add(Evas_Object *parent) * @ingroup Gengrid */ EAPI void -elm_gengrid_item_size_set(Evas_Object *obj, - Evas_Coord w, - Evas_Coord h) +elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -1601,9 +1027,7 @@ elm_gengrid_item_size_set(Evas_Object *obj, * @ingroup Gengrid */ EAPI void -elm_gengrid_item_size_get(const Evas_Object *obj, - Evas_Coord *w, - Evas_Coord *h) +elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -1624,9 +1048,7 @@ elm_gengrid_item_size_get(const Evas_Object *obj, * @ingroup Gengrid */ EAPI void -elm_gengrid_align_set(Evas_Object *obj, - double align_x, - double align_y) +elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -1656,14 +1078,13 @@ elm_gengrid_align_set(Evas_Object *obj, * @ingroup Gengrid */ EAPI void -elm_gengrid_align_get(const Evas_Object *obj, - double *align_x, - double *align_y) +elm_gengrid_align_get(const Evas_Object *obj, double *align_x, double *align_y) { - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (align_x) *align_x = wd->align_x; - if (align_y) *align_y = wd->align_y; + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (align_x) *align_x = wd->align_x; + if (align_y) *align_y = wd->align_y; } /** @@ -1676,19 +1097,14 @@ elm_gengrid_align_get(const Evas_Object *obj, * @param func_data Data passed to @p func above. * @return A handle to the item added or NULL if not possible. * - * @see elm_gengrid_item_prepend() - * @see elm_gengrid_item_insert_before() - * @see elm_gengrid_item_insert_after() * @see elm_gengrid_item_del() * * @ingroup Gengrid */ EAPI Elm_Gengrid_Item * -elm_gengrid_item_append(Evas_Object *obj, - const Elm_Gengrid_Item_Class *gic, - const void *data, - Evas_Smart_Cb func, - const void *func_data) +elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, + const void *data, Evas_Smart_Cb func, + const void *func_data) { Elm_Gengrid_Item *item; ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -1697,48 +1113,9 @@ elm_gengrid_item_append(Evas_Object *obj, item = _item_create(wd, gic, data, func, func_data); if (!item) return NULL; - wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(item)); - - if (wd->calc_job) ecore_job_del(wd->calc_job); - wd->calc_job = ecore_job_add(_calc_job, wd); - return item; -} - -/** - * Add item at start of the Gengrid. - * - * This adds an item to the beginning of the grid. - * - * @param obj The Gengrid object. - * @param gic The item class for the item. - * @param data The item data. - * @param func Convenience function called when item is selected. - * @param func_data Data passed to @p func above. - * @return A handle to the item added or NULL if not possible. - * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_insert_before() - * @see elm_gengrid_item_insert_after() - * @see elm_gengrid_item_del() - * - * @ingroup Gengrid - */ -EAPI Elm_Gengrid_Item * -elm_gengrid_item_prepend(Evas_Object *obj, - const Elm_Gengrid_Item_Class *gic, - const void *data, - Evas_Smart_Cb func, - const void *func_data) -{ - Elm_Gengrid_Item *item; - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - - item = _item_create(wd, gic, data, func, func_data); - if (!item) return NULL; - wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(item)); + wd->items = eina_list_append(wd->items, item); + wd->no_select = EINA_FALSE; if (wd->calc_job) ecore_job_del(wd->calc_job); wd->calc_job = ecore_job_add(_calc_job, wd); @@ -1747,92 +1124,43 @@ elm_gengrid_item_prepend(Evas_Object *obj, } /** - * Insert and item before another in the Gengrid. + * Prepend item at start of the Gengrid * - * This inserts an item before another in the grid. + * This adds an item to the beginning of the list or beginning of the children + * of the parent if given. * * @param obj The Gengrid object. * @param gic The item class for the item. * @param data The item data. - * @param relative The item to which insert before. * @param func Convenience function called when item is selected. * @param func_data Data passed to @p func above. * @return A handle to the item added or NULL if not possible. * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_prepend() - * @see elm_gengrid_item_insert_after() * @see elm_gengrid_item_del() * * @ingroup Gengrid */ -EAPI Elm_Gengrid_Item * -elm_gengrid_item_insert_before(Evas_Object *obj, - const Elm_Gengrid_Item_Class *gic, - const void *data, - Elm_Gengrid_Item *relative, - Evas_Smart_Cb func, - const void *func_data) -{ - Elm_Gengrid_Item *item; - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(relative, NULL); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - - item = _item_create(wd, gic, data, func, func_data); - if (!item) return NULL; - wd->items = eina_inlist_prepend_relative - (wd->items, EINA_INLIST_GET(item), EINA_INLIST_GET(relative)); - - if (wd->calc_job) ecore_job_del(wd->calc_job); - wd->calc_job = ecore_job_add(_calc_job, wd); - return item; -} -/** - * Insert and item after another in the Gengrid. - * - * This inserts an item after another in the grid. - * - * @param obj The Gengrid object. - * @param gic The item class for the item. - * @param data The item data. - * @param relative The item to which insert after. - * @param func Convenience function called when item is selected. - * @param func_data Data passed to @p func above. - * @return A handle to the item added or NULL if not possible. - * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_prepend() - * @see elm_gengrid_item_insert_before() - * @see elm_gengrid_item_del() - * - * @ingroup Gengrid - */ EAPI Elm_Gengrid_Item * -elm_gengrid_item_insert_after(Evas_Object *obj, - const Elm_Gengrid_Item_Class *gic, - const void *data, - Elm_Gengrid_Item *relative, - Evas_Smart_Cb func, - const void *func_data) +elm_gengrid_item_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, + const void *data, Evas_Smart_Cb func, + const void *func_data) { Elm_Gengrid_Item *item; ELM_CHECK_WIDTYPE(obj, widtype) NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(relative, NULL); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - + item = _item_create(wd, gic, data, func, func_data); if (!item) return NULL; - wd->items = eina_inlist_append_relative - (wd->items, EINA_INLIST_GET(item), EINA_INLIST_GET(relative)); - + + wd->items = eina_list_prepend(wd->items, item); + wd->no_select = EINA_FALSE; + if (wd->calc_job) ecore_job_del(wd->calc_job); wd->calc_job = ecore_job_add(_calc_job, wd); - + return item; } @@ -1849,16 +1177,15 @@ elm_gengrid_item_insert_after(Evas_Object *obj, EAPI void elm_gengrid_item_del(Elm_Gengrid_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + if (!item) return; if ((item->relcount > 0) || (item->walking > 0)) { - item->delete_me = EINA_TRUE; - elm_widget_item_pre_notify_del(item); - if (item->selected) - item->wd->selected = eina_list_remove(item->wd->selected, item); - if (item->gic->func.del) - item->gic->func.del((void *)item->base.data, item->wd->self); - return; + item->delete_me = EINA_TRUE; + if (item->selected) + item->wd->selected = eina_list_remove(item->wd->selected, item); + if (item->gic->func.del) + item->gic->func.del(item->data, item->wd->self); + return; } _item_del(item); @@ -1868,14 +1195,13 @@ elm_gengrid_item_del(Elm_Gengrid_Item *item) * Set for what direction the Gengrid will expand. * * @param obj The Gengrid object. - * @param setting If @c EINA_TRUE the Gengrid will expand horizontally - * or vertically if @c EINA_FALSE. + * @param setting If @c EINA_TRUE the Gengrid will expand horizontally or + * vertically if @c EINA_FALSE. * * @ingroup Gengrid */ EAPI void -elm_gengrid_horizontal_set(Evas_Object *obj, - Eina_Bool setting) +elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -1902,49 +1228,37 @@ elm_gengrid_horizontal_set(Evas_Object *obj, EAPI void elm_gengrid_clear(Evas_Object *obj) { + Eina_List *l, *l_next; + Elm_Gengrid_Item *item; ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->calc_job) { - ecore_job_del(wd->calc_job); - wd->calc_job = NULL; + ecore_job_del(wd->calc_job); + wd->calc_job = NULL; } - if (wd->walking > 0) + EINA_LIST_FOREACH_SAFE(wd->items, l, l_next, item) { - Elm_Gengrid_Item *item; - wd->clear_me = 1; - EINA_INLIST_FOREACH(wd->items, item) - item->delete_me = 1; - return; - } - wd->clear_me = 0; - while (wd->items) - { - Elm_Gengrid_Item *item = ELM_GENGRID_ITEM_FROM_INLIST(wd->items); - - wd->items = eina_inlist_remove(wd->items, wd->items); - elm_widget_item_pre_notify_del(item); - if (item->realized) _item_unrealize(item); - if (item->gic->func.del) - item->gic->func.del((void *)item->base.data, wd->self); - if (item->long_timer) ecore_timer_del(item->long_timer); - elm_widget_item_del(item); + if (item->realized) _item_unrealize(item); + if (item->gic->func.del) item->gic->func.del(item->data, wd->self); + if (item->long_timer) ecore_timer_del(item->long_timer); + free(item); + wd->items = eina_list_remove_list(wd->items, l); } if (wd->selected) { - eina_list_free(wd->selected); - wd->selected = NULL; + eina_list_free(wd->selected); + wd->selected = NULL; } wd->pan_x = 0; wd->pan_y = 0; wd->minw = 0; wd->minh = 0; - wd->count = 0; evas_object_size_hint_min_set(wd->pan_smart, wd->minw, wd->minh); evas_object_smart_callback_call(wd->pan_smart, "changed", NULL); } @@ -1952,13 +1266,12 @@ elm_gengrid_clear(Evas_Object *obj) /** * Get the real evas object of the Gengrid item * - * This returns the actual evas object used for the specified Gengrid - * item. This may be NULL as it may not be created, and may be - * deleted at any time by Gengrid. Do not modify this object (move, - * resize, show, hide etc.) as Gengrid is controlling it. This - * function is for querying, emitting custom signals or hooking lower - * level callbacks for events. Do not delete this object under any - * circumstances. + * This returns the actual evas object used for the specified Gengrid item. + * This may be NULL as it may not be created, and may be deleted at any time + * by Gengrid. Do not modify this object (move, resize, show, hide etc.) as + * Gengrid is controlling it. This function is for querying, emitting custom + * signals or hooking lower level callbacks for events. Do not delete this + * object under any circumstances. * * @param item The Gengrid item. * @return the evas object associated to this item. @@ -1968,39 +1281,17 @@ elm_gengrid_clear(Evas_Object *obj) * @ingroup Gengrid */ EAPI const Evas_Object * -elm_gengrid_item_object_get(const Elm_Gengrid_Item *item) +elm_gengrid_item_object_get(Elm_Gengrid_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->base.view; -} - -/** - * Update the contents of an item - * - * This updates an item by calling all the item class functions again - * to get the icons, labels and states. Use this when the original - * item data has changed and the changes are desired to be reflected. - * - * @param item The item - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_update(Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - if (!item->realized) return; - if (item->want_unrealize) return; - _item_unrealize(item); - _item_realize(item); - _item_place(item, item->x, item->y); + if (!item) return NULL; + return item->base; } /** * Returns the data associated to a item * - * This returns the data value passed on the elm_gengrid_item_append() - * and related item addition calls. + * This returns the data value passed on the elm_gengrid_item_append() and + * related item addition calls. * * @param item The Gengrid item. * @return the data associated to this item. @@ -2011,32 +1302,10 @@ elm_gengrid_item_update(Elm_Gengrid_Item *item) * @ingroup Gengrid */ EAPI void * -elm_gengrid_item_data_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_data_get(item); -} - -/** - * Set the data item from the gengrid item - * - * This set the data value passed on the elm_gengrid_item_append() and - * related item addition calls. This function will also call - * elm_gengrid_item_update() so the item will be updated to reflect - * the new data. - * - * @param item The item - * @param data The new data pointer to set - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_data_set(Elm_Gengrid_Item *item, - const void *data) +elm_gengrid_item_data_get(Elm_Gengrid_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_data_set(item, data); - elm_gengrid_item_update(item); + if (!item) return NULL; + return (void *)item->data; } /** @@ -2051,11 +1320,9 @@ elm_gengrid_item_data_set(Elm_Gengrid_Item *item, * @ingroup Gengrid */ EAPI void -elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, - unsigned int *x, - unsigned int *y) +elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, unsigned int *x, unsigned int *y) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + if (!item) return; if (x) *x = item->x; if (y) *y = item->y; } @@ -2063,8 +1330,8 @@ elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, /** * Enable or disable multi-select in the Gengrid. * - * This enables (EINA_TRUE) or disables (EINA_FALSE) multi-select in - * the Gengrid. This allows more than 1 item to be selected. + * This enables (EINA_TRUE) or disables (EINA_FALSE) multi-select in the Gengrid. + * This allows more than 1 item to be selected. * * @param obj The Gengrid object. * @param multi Multi-select enabled/disabled @@ -2072,8 +1339,7 @@ elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, * @ingroup Gengrid */ EAPI void -elm_gengrid_multi_select_set(Evas_Object *obj, - Eina_Bool multi) +elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -2102,10 +1368,9 @@ elm_gengrid_multi_select_get(const Evas_Object *obj) /** * Get the selected item in the Gengrid * - * This gets the selected item in the Gengrid (if multi-select is - * enabled only the first item in the list is selected - which is not - * very useful, so see elm_gengrid_selected_items_get() for when - * multi-select is used). + * This gets the selected item in the Gengrid (if multi-select is enabled only + * the first item in the list is selected - which is not very useful, so see + * elm_gengrid_selected_items_get() for when multi-select is used). * * If no item is selected, NULL is returned. * @@ -2127,10 +1392,9 @@ elm_gengrid_selected_item_get(const Evas_Object *obj) /** * Get a list of selected items in the Gengrid. * - * This returns a list of the selected items. This list pointer is - * only valid so long as no items are selected or unselected (or - * unselected implictly by deletion). The list contains - * Elm_Gengrid_Item pointers. + * This returns a list of the selected items. This list pointer is only valid + * so long as no items are selected or unselected (or unselected implictly by + * deletion). The list contains Elm_Gengrid_Item pointers. * * @param obj The Gengrid object. * @return The list of selected items, or NULL if none are selected. @@ -2149,9 +1413,8 @@ elm_gengrid_selected_items_get(const Evas_Object *obj) /** * Set the selected state of a item. * - * This sets the selected state of a item. If multi-select is not - * enabled and selected is EINA_TRUE, previously selected items are - * unselected. + * This sets the selected state of a item. If multi-select is not enabled and + * selected is EINA_TRUE, previously selected items are unselected. * * @param item The item * @param selected The selected state. @@ -2159,11 +1422,9 @@ elm_gengrid_selected_items_get(const Evas_Object *obj) * @ingroup Gengrid */ EAPI void -elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, - Eina_Bool selected) +elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, Eina_Bool selected) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - Widget_Data *wd = item->wd; + Widget_Data *wd = elm_widget_data_get(item->wd->self); if (!wd) return; if ((!item) || (item->delete_me)) return; selected = !!selected; @@ -2171,13 +1432,13 @@ elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, if (selected) { - if (!wd->multi) - { - while (wd->selected) - _item_unselect(wd->selected->data); - } - _item_hilight(item); - _item_select(item); + if (!wd->multi) + { + while (wd->selected) + _item_unselect(wd->selected->data); + } + _item_hilight(item); + _item_select(item); } else _item_unselect(item); @@ -2196,16 +1457,16 @@ elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Gengrid_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); + if (!item) return EINA_FALSE; return item->selected; } /** * Sets the disabled state of a item. * - * A disabled item cannot be selected or unselected. It will also - * change appearance to disabled. This sets the disabled state (1 - * disabled, 0 not disabled). + * A disabled item cannot be selected or unselected. It will also change + * appearance to disabled. This sets the disabled state (1 disabled, 0 not + * disabled). * * @param item The item * @param disabled The disabled state @@ -2213,19 +1474,18 @@ elm_gengrid_item_selected_get(const Elm_Gengrid_Item *item) * @ingroup Gengrid */ EAPI void -elm_gengrid_item_disabled_set(Elm_Gengrid_Item *item, - Eina_Bool disabled) +elm_gengrid_item_disabled_set(Elm_Gengrid_Item *item, Eina_Bool disabled) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + if (!item) return; if (item->disabled == disabled) return; if (item->delete_me) return; item->disabled = disabled; if (item->realized) { - if (item->disabled) - edje_object_signal_emit(item->base.view, "elm,state,disabled", "elm"); - else - edje_object_signal_emit(item->base.view, "elm,state,enabled", "elm"); + if (item->disabled) + edje_object_signal_emit(item->base, "elm,state,disabled", "elm"); + else + edje_object_signal_emit(item->base, "elm,state,enabled", "elm"); } } @@ -2242,320 +1502,26 @@ elm_gengrid_item_disabled_set(Elm_Gengrid_Item *item, EAPI Eina_Bool elm_gengrid_item_disabled_get(const Elm_Gengrid_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); + if (!item) return EINA_FALSE; if (item->delete_me) return EINA_FALSE; return item->disabled; } -static Evas_Object * -_elm_gengrid_item_label_create(void *data, - Evas_Object *obj, - void *item __UNUSED__) -{ - Evas_Object *label = elm_label_add(obj); - if (!label) - return NULL; - elm_object_style_set(label, "tooltip"); - elm_label_label_set(label, data); - return label; -} - -static void -_elm_gengrid_item_label_del_cb(void *data, - Evas_Object *obj __UNUSED__, - void *event_info __UNUSED__) -{ - eina_stringshare_del(data); -} - -/** - * Set the text to be shown in the gengrid item. - * - * @param item Target item - * @param text The text to set in the content - * - * Setup the text as tooltip to object. The item can have only one - * tooltip, so any previous tooltip data is removed. - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_tooltip_text_set(Elm_Gengrid_Item *item, - const char *text) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - text = eina_stringshare_add(text); - elm_gengrid_item_tooltip_content_cb_set(item, _elm_gengrid_item_label_create, - text, - _elm_gengrid_item_label_del_cb); -} - -/** - * Set the content to be shown in the tooltip item - * - * Setup the tooltip to item. The item can have only one tooltip, so - * any previous tooltip data is removed. @p func(with @p data) will be - * called every time that need show the tooltip and it should return a - * valid Evas_Object. This object is then managed fully by tooltip - * system and is deleted when the tooltip is gone. - * - * @param item the gengrid item being attached a tooltip. - * @param func the function used to create the tooltip contents. - * @param data what to provide to @a func as callback data/context. - * @param del_cb called when data is not needed anymore, either when - * another callback replaces @func, the tooltip is unset with - * elm_gengrid_item_tooltip_unset() or the owner @a item - * dies. This callback receives as the first parameter the - * given @a data, and @c event_info is the item. - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_tooltip_content_cb_set(Elm_Gengrid_Item *item, - Elm_Tooltip_Item_Content_Cb func, - const void *data, - Evas_Smart_Cb del_cb) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_GOTO(item, error); - - if ((item->tooltip.content_cb == func) && (item->tooltip.data == data)) - return; - - if (item->tooltip.del_cb) - item->tooltip.del_cb((void *)item->tooltip.data, - item->base.widget, item); - item->tooltip.content_cb = func; - item->tooltip.data = data; - item->tooltip.del_cb = del_cb; - if (item->base.view) - { - elm_widget_item_tooltip_content_cb_set(item, - item->tooltip.content_cb, - item->tooltip.data, NULL); - elm_widget_item_tooltip_style_set(item, item->tooltip.style); - } - - return; - -error: - if (del_cb) del_cb((void *)data, NULL, NULL); -} - -/** - * Unset tooltip from item - * - * @param item gengrid item to remove previously set tooltip. - * - * Remove tooltip from item. The callback provided as del_cb to - * elm_gengrid_item_tooltip_content_cb_set() will be called to notify - * it is not used anymore. - * - * @see elm_gengrid_item_tooltip_content_cb_set() - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - if ((item->base.view) && (item->tooltip.content_cb)) - elm_widget_item_tooltip_unset(item); - - if (item->tooltip.del_cb) - item->tooltip.del_cb((void *)item->tooltip.data, item->base.widget, item); - item->tooltip.del_cb = NULL; - item->tooltip.content_cb = NULL; - item->tooltip.data = NULL; - if (item->tooltip.style) - elm_gengrid_item_tooltip_style_set(item, NULL); -} - -/** - * Sets a different style for this item tooltip. - * - * @note before you set a style you should define a tooltip with - * elm_gengrid_item_tooltip_content_cb_set() or - * elm_gengrid_item_tooltip_text_set() - * - * @param item gengrid item with tooltip already set. - * @param style the theme style to use (default, transparent, ...) - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_tooltip_style_set(Elm_Gengrid_Item *item, - const char *style) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - eina_stringshare_replace(&item->tooltip.style, style); - if (item->base.view) elm_widget_item_tooltip_style_set(item, style); -} - -/** - * Get the style for this item tooltip. - * - * @param item gengrid item with tooltip already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a tooltip set, then NULL is returned. - * - * @ingroup Gengrid - */ -EAPI const char * -elm_gengrid_item_tooltip_style_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->tooltip.style; -} - -/** - * Set the cursor to be shown when mouse is over the gengrid item - * - * @param item Target item - * @param cursor the cursor name to be used. - * - * @see elm_object_cursor_set() - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_cursor_set(Elm_Gengrid_Item *item, - const char *cursor) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - eina_stringshare_replace(&item->mouse_cursor, cursor); - if (item->base.view) elm_widget_item_cursor_set(item, cursor); -} - -/** - * Get the cursor to be shown when mouse is over the gengrid item - * - * @param item gengrid item with cursor already set. - * @return the cursor name. - * - * @ingroup Gengrid - */ -EAPI const char * -elm_gengrid_item_cursor_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_cursor_get(item); -} - -/** - * Unset the cursor to be shown when mouse is over the gengrid item - * - * @param item Target item - * - * @see elm_object_cursor_unset() - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_cursor_unset(Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - if (!item->mouse_cursor) - return; - - if (item->base.view) - elm_widget_item_cursor_unset(item); - - eina_stringshare_del(item->mouse_cursor); - item->mouse_cursor = NULL; -} - -/** - * Sets a different style for this item cursor. - * - * @note before you set a style you should define a cursor with - * elm_gengrid_item_cursor_set() - * - * @param item gengrid item with cursor already set. - * @param style the theme style to use (default, transparent, ...) - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_cursor_style_set(Elm_Gengrid_Item *item, - const char *style) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_cursor_style_set(item, style); -} - -/** - * Get the style for this item cursor. - * - * @param item gengrid item with cursor already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a cursor set, then NULL is returned. - * - * @ingroup Gengrid - */ -EAPI const char * -elm_gengrid_item_cursor_style_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_cursor_style_get(item); -} - -/** - * Set if the cursor set should be searched on the theme or should use - * the provided by the engine, only. - * - * @note before you set if should look on theme you should define a - * cursor with elm_object_cursor_set(). By default it will only look - * for cursors provided by the engine. - * - * @param item widget item with cursor already set. - * @param engine_only boolean to define it cursors should be looked - * only between the provided by the engine or searched on widget's - * theme as well. - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_cursor_engine_only_set(Elm_Gengrid_Item *item, - Eina_Bool engine_only) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_cursor_engine_only_set(item, engine_only); -} - -/** - * Get the cursor engine only usage for this item cursor. - * - * @param item widget item with cursor already set. - * @return engine_only boolean to define it cursors should be looked - * only between the provided by the engine or searched on widget's - * theme as well. If the object does not have a cursor set, then - * EINA_FALSE is returned. - * - * @ingroup Gengrid - */ -EAPI Eina_Bool -elm_gengrid_item_cursor_engine_only_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); - return elm_widget_item_cursor_engine_only_get(item); -} - /** * Set the always select mode. * - * Cells will only call their selection func and callback when first - * becoming selected. Any further clicks will do nothing, unless you - * enable always select with - * elm_gengrid_always_select_mode_set(). This means even if selected, + * Cells will only call their selection func and callback when first becoming + * selected. Any further clicks will do nothing, unless you enable always select + * with elm_gengrid_always_select_mode_set(). This means even if selected, * every click will make the selected callbacks be called. * * @param obj The Gengrid object - * @param always_select The always select mode (EINA_TRUE = on, - * EINA_FALSE = off) + * @param always_select The always select mode (EINA_TRUE = on, EINA_FALSE = off) * * @ingroup Gengrid */ EAPI void -elm_gengrid_always_select_mode_set(Evas_Object *obj, - Eina_Bool always_select) +elm_gengrid_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -2583,8 +1549,8 @@ elm_gengrid_always_select_mode_get(const Evas_Object *obj) /** * Set no select mode. * - * This will turn off the ability to select items entirely and they - * will neither appear selected nor call selected callback functions. + * This will turn off the ability to select items entirely and they will + * neither appear selected nor call selected callback functions. * * @param obj The Gengrid object * @param no_select The no select mode (EINA_TRUE = on, EINA_FALSE = off) @@ -2592,8 +1558,7 @@ elm_gengrid_always_select_mode_get(const Evas_Object *obj) * @ingroup Gengrid */ EAPI void -elm_gengrid_no_select_mode_set(Evas_Object *obj, - Eina_Bool no_select) +elm_gengrid_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -2621,8 +1586,8 @@ elm_gengrid_no_select_mode_get(const Evas_Object *obj) /** * Set bounce mode. * - * This will enable or disable the scroller bounce mode for the - * Gengrid. See elm_scroller_bounce_set() for details. + * This will enable or disable the scroller bounce mode for the Gengrid. See + * elm_scroller_bounce_set() for details. * * @param obj The Gengrid object * @param h_bounce Allow bounce horizontally @@ -2631,9 +1596,7 @@ elm_gengrid_no_select_mode_get(const Evas_Object *obj) * @ingroup Gengrid */ EAPI void -elm_gengrid_bounce_set(Evas_Object *obj, - Eina_Bool h_bounce, - Eina_Bool v_bounce) +elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -2651,9 +1614,7 @@ elm_gengrid_bounce_set(Evas_Object *obj, * @ingroup Gengrid */ EAPI void -elm_gengrid_bounce_get(const Evas_Object *obj, - Eina_Bool *h_bounce, - Eina_Bool *v_bounce) +elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -2672,233 +1633,37 @@ elm_gengrid_bounce_get(const Evas_Object *obj, * * @ingroup Gengrid */ - -/** - * Set gengrid scroll page size relative to viewport size. - * - * The gengrid scroller is capable of limiting scrolling by the user - * to "pages" That is to jump by and only show a "whole page" at a - * time as if the continuous area of the scroller content is split - * into page sized pieces. This sets the size of a page relative to - * the viewport of the scroller. 1.0 is "1 viewport" is size - * (horizontally or vertically). 0.0 turns it off in that axis. This - * is mutually exclusive with page size (see - * elm_gengrid_page_size_set() for more information). Likewise 0.5 is - * "half a viewport". Sane usable valus are normally between 0.0 and - * 1.0 including 1.0. If you only want 1 axis to be page "limited", - * use 0.0 for the other axis. - * - * @param obj The gengrid object - * @param h_pagerel The horizontal page relative size - * @param v_pagerel The vertical page relative size - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_page_relative_set(Evas_Object *obj, - double h_pagerel, - double v_pagerel) -{ - Evas_Coord pagesize_h; - Evas_Coord pagesize_v; - - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - elm_smart_scroller_paging_get(wd->scr, NULL, NULL, &pagesize_h, &pagesize_v); - elm_smart_scroller_paging_set(wd->scr, h_pagerel, v_pagerel, pagesize_h, - pagesize_v); -} - -/** - * Set gengrid scroll page size. - * - * See also elm_gengrid_page_relative_set(). This, instead of a page - * size being relative to the viewport, sets it to an absolute fixed - * value, with 0 turning it off for that axis. - * - * @param obj The gengrid object - * @param h_pagesize The horizontal page size - * @param v_pagesize The vertical page size - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_page_size_set(Evas_Object *obj, - Evas_Coord h_pagesize, - Evas_Coord v_pagesize) -{ - double pagerel_h; - double pagerel_v; - - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_smart_scroller_paging_get(wd->scr, &pagerel_h, &pagerel_v, NULL, NULL); - elm_smart_scroller_paging_set(wd->scr, pagerel_h, pagerel_v, h_pagesize, - v_pagesize); -} - -/** - * Get the first item in the gengrid - * - * This returns the first item in the list. - * - * @param obj The gengrid object - * @return The first item, or NULL if none - * - * @ingroup Gengrid - */ -EAPI Elm_Gengrid_Item * -elm_gengrid_first_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->items) return NULL; - Elm_Gengrid_Item *item = ELM_GENGRID_ITEM_FROM_INLIST(wd->items); - while ((item) && (item->delete_me)) - item = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next); - return item; -} - -/** - * Get the last item in the gengrid - * - * This returns the last item in the list. - * - * @return The last item, or NULL if none - * - * @ingroup Gengrid - */ -EAPI Elm_Gengrid_Item * -elm_gengrid_last_item_get(const Evas_Object *obj) +EAPI const Eina_List * +elm_gengrid_items_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd->items) return NULL; - Elm_Gengrid_Item *item = ELM_GENGRID_ITEM_FROM_INLIST(wd->items->last); if (!wd) return NULL; - while ((item) && (item->delete_me)) - item = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->prev); - return item; -} - -/** - * Get the next item in the gengrid - * - * This returns the item after the item @p item. - * - * @param item The item - * @return The item after @p item, or NULL if none - * - * @ingroup Gengrid - */ -EAPI Elm_Gengrid_Item * -elm_gengrid_item_next_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - while (item) - { - item = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next); - if ((item) && (!item->delete_me)) break; - } - return (Elm_Gengrid_Item *)item; -} - -/** - * Get the previous item in the gengrid - * - * This returns the item before the item @p item. - * - * @param item The item - * @return The item before @p item, or NULL if none - * - * @ingroup Gengrid - */ -EAPI Elm_Gengrid_Item * -elm_gengrid_item_prev_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - while (item) - { - item = ELM_GENGRID_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->prev); - if ((item) && (!item->delete_me)) break; - } - return (Elm_Gengrid_Item *)item; + return wd->items; } /** - * Get the gengrid object from an item - * - * This returns the gengrid object itself that an item belongs to. - * - * @param item The item - * @return The gengrid object - * - * @ingroup Gengrid - */ -EAPI Evas_Object * -elm_gengrid_item_gengrid_get(const Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->base.widget; -} - -/** - * Show the given item - * - * This causes gengrid to jump to the given item @p item and show it - * (by scrolling), if it is not fully visible. - * - * @param item The item - * + * Update the contents of an item + * + * This updates an item by calling all the item class functions again to get + * the icons, labels and states. Use this when he original item data has + * changed and the changes are desired to be reflected. + * + * @param it The item + * * @ingroup Gengrid */ EAPI void -elm_gengrid_item_show(Elm_Gengrid_Item *item) +elm_gengrid_item_update(Elm_Gengrid_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - Widget_Data *wd = elm_widget_data_get(item->wd->self); - Evas_Coord minx = 0, miny = 0; - - if (!wd) return; - if ((!item) || (item->delete_me)) return; - _pan_min_get(wd->pan_smart, &minx, &miny); + if (item->realized) + { + _item_unrealize(item); + _item_realize(item); + evas_object_smart_callback_call(item->wd->self, "realized", item); - elm_smart_scroller_child_region_show(item->wd->scr, - item->x * wd->item_width + minx, - item->y * wd->item_height + miny, - item->wd->item_width, - item->wd->item_height); + if (item->wd->calc_job) ecore_job_del(item->wd->calc_job); + item->wd->calc_job = ecore_job_add(_calc_job, item->wd); + } } -/** - * Bring in the given item - * - * This causes gengrig to jump to the given item @p item and show it - * (by scrolling), if it is not fully visible. This may use animation - * to do so and take a period of time - * - * @param item The item - * - * @ingroup Gengrid - */ -EAPI void -elm_gengrid_item_bring_in(Elm_Gengrid_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - if (item->delete_me) return; - - Evas_Coord minx = 0, miny = 0; - Widget_Data *wd = elm_widget_data_get(item->wd->self); - if (!wd) return; - _pan_min_get(wd->pan_smart, &minx, &miny); - - elm_smart_scroller_region_bring_in(item->wd->scr, - item->x * wd->item_width + minx, - item->y * wd->item_height + miny, - item->wd->item_width, - item->wd->item_height); -} diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index f4893ca..a5b10aa 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -313,7 +313,7 @@ struct _Widget_Data int item_height; int max_items_per_block; double longpress_timeout; - Eina_List *group_items; + Eina_Inlist *group_items; Eina_List *menuopened; int edit_mode; int select_all_minh; @@ -389,7 +389,6 @@ struct _Elm_Genlist_Item const Elm_Genlist_Item_Class *itc; const void *data; Elm_Genlist_Item *parent; - Elm_Genlist_Item *group_item; Elm_Genlist_Item_Flags flags; struct { Evas_Smart_Cb func; @@ -400,19 +399,16 @@ struct _Elm_Genlist_Item Eina_List *labels, *icons, *states, *icon_objs; Ecore_Timer *long_timer; Evas_Coord dx, dy, scrl_x, scrl_y; - Evas_Coord old_y, finish_y; Evas_Coord reoder_cavas_x, reoder_cavas_y; Elm_Genlist_Item *rel; int relcount; int walking; int expanded_depth; - int num; Eina_Bool before : 1; Eina_Bool want_unrealize : 1; - Eina_Bool want_realize : 1; Eina_Bool realized : 1; Eina_Bool selected : 1; Eina_Bool hilighted : 1; @@ -440,6 +436,7 @@ struct _Elm_Genlist_Item Evas_Coord old_pad_left; int list_expanded; Eina_Bool effect_done : 1; + Elm_Genlist_GroupItem *group_item; Evas_Object *edit_obj; Eina_List *edit_icon_objs; Ecore_Timer *edit_long_timer; @@ -454,6 +451,33 @@ struct _Pan Widget_Data *wd; }; +struct _Elm_Genlist_GroupItem +{ + EINA_INLIST; + Widget_Data *wd; + Eina_List *items; + Evas_Coord x, y, w, h, minw, minh; + const Elm_Genlist_Item_Class *itc; + const void *data; + struct { + Evas_Smart_Cb func; + const void *data; + } func; + + Evas_Object *base; + Eina_List *labels, *icons, *states, *icon_objs; + int align; + Eina_Bool realized : 1; + Eina_Bool delete_me : 1; + Eina_Bool visible : 1; + Eina_Bool mincalcd : 1; + + Evas_Coord old_y, finish_y; + int num; + Eina_Bool down : 1; + Eina_Bool update_finish_y : 1; +}; + static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); @@ -462,6 +486,8 @@ static void _sizing_eval(Evas_Object *obj); static void _item_unrealize(Elm_Genlist_Item *it); static void _item_block_unrealize(Item_Block *itb); static void _calc_job(void *data); +static void _groupitem_remove(Elm_Genlist_GroupItem *git, Eina_Bool update_items); +static void _groupitem_unrealize(Elm_Genlist_GroupItem *git); static Eina_Bool _edit_mode_reset(Widget_Data *wd); static void _edit_controls_eval(Elm_Genlist_Item *it); static void _move_edit_controls(Elm_Genlist_Item *it, int itx, int ity); @@ -474,7 +500,6 @@ static void _select_all_down(void *data, Evas_Object *obj __UNUSED__, const char static void _notify_item_position(Elm_Genlist_Item *it); static void _notify_item_position(Elm_Genlist_Item *it); static int _get_space_for_reorder_item(Elm_Genlist_Item *it); -static void _print_deprecated(const char *deprecated, const char *new); static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION; @@ -503,9 +528,14 @@ _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Item_Block *itb; + Elm_Genlist_GroupItem *git; if (!wd) return; elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base", elm_widget_style_get(obj)); // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); + EINA_INLIST_FOREACH(wd->group_items, git) + { + _groupitem_unrealize(git); + } EINA_INLIST_FOREACH(wd->blocks, itb) { Eina_List *l; @@ -662,8 +692,6 @@ _item_del(Elm_Genlist_Item *it) it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it)); if (it->parent) it->parent->items = eina_list_remove(it->parent->items, it); - if (it->flags & ELM_GENLIST_ITEM_GROUP) - it->wd->group_items = eina_list_remove(it->wd->group_items, it); if (it->long_timer) ecore_timer_del(it->long_timer); if (it->group_item) { @@ -1354,6 +1382,189 @@ _signal_contract(void *data, Evas_Object *obj __UNUSED__, const char *emission _ } static void +_group_item_click_cb(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +{ + Elm_Genlist_GroupItem *git = data; + elm_smart_scroller_bounce_allow_set(git->wd->scr, EINA_FALSE, EINA_TRUE); + if (git->wd->pinchzoom_effect_mode == ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_CONTRACT_FINISH) + { + if(!git->wd->group_items_moved) + { + git->wd->pinch_it = git->num; + _elm_genlist_pinch_zoom_execute(git->wd->obj, 0); + } + git->wd->group_items_moved = EINA_FALSE; + } + return; +} + +static void +_groupitem_realize(Elm_Genlist_Item *it, int calc) +{ + char buf[1024]; + const char *align; + Elm_Genlist_GroupItem *git = it->group_item; + Evas_Coord ox, oy, ow, oh; + + if (calc && git->realized) + { + git->wd->start_y_pos += it->h; + } + + if ((git->realized) || (git->delete_me)) return; + git->base = edje_object_add(evas_object_evas_get(git->wd->obj)); + edje_object_scale_set(git->base, elm_widget_scale_get(git->wd->obj) * + _elm_config->scale); + evas_object_smart_member_add(git->base, git->wd->pan_smart); + elm_widget_sub_object_add(git->wd->obj, git->base); + + strncpy(buf, "item/", sizeof(buf)); + strncat(buf, git->itc->item_style, sizeof(buf) - strlen(buf)); + _elm_theme_object_set(git->wd->obj, git->base, "genlist", buf, elm_widget_style_get(git->wd->obj)); + + align = edje_object_data_get(git->base, "orientation"); + git->align = GROUP_ALIGN_NORTH; + if (align) + { + if (!strcmp(align, "top")) + git->align = GROUP_ALIGN_NORTH; + else if (!strcmp(align, "left")) + git->align = GROUP_ALIGN_WEST; + else git->align = GROUP_ALIGN_NORTH; + } + + if (git->itc->func.label_get) + { + const Eina_List *l; + const char *key; + + git->labels = elm_widget_stringlist_get(edje_object_data_get(git->base, "labels")); + EINA_LIST_FOREACH(git->labels, l, key) + { + char *s = git->itc->func.label_get(git->data, git->wd->obj, l->data); + + if (s) + { + edje_object_part_text_set(git->base, l->data, s); + free(s); + } + } + } + + if (git->itc->func.icon_get) + { + const Eina_List *l; + const char *key; + + git->icons = elm_widget_stringlist_get(edje_object_data_get(git->base, "icons")); + EINA_LIST_FOREACH(git->icons, l, key) + { + Evas_Object *ic = git->itc->func.icon_get(git->data, git->wd->obj, l->data); + + if (ic) + { + git->icon_objs = eina_list_append(git->icon_objs, ic); + edje_object_part_swallow(git->base, key, ic); + evas_object_show(ic); + elm_widget_sub_object_add(git->wd->obj, ic); + } + } + + } + if (git->itc->func.state_get) + { + const Eina_List *l; + const char *key; + + git->states = elm_widget_stringlist_get(edje_object_data_get(git->base, "states")); + EINA_LIST_FOREACH(git->states, l, key) + { + Eina_Bool on = git->itc->func.state_get(git->data, git->wd->obj, l->data); + + if (on) + { + snprintf(buf, sizeof(buf), "elm,state,%s,active", key); + edje_object_signal_emit(git->base, buf, "elm"); + } + } + } + if (!git->mincalcd) + { + Evas_Coord mw = -1, mh = -1; + + edje_object_size_min_restricted_calc(git->base, &mw, &mh, mw, mh); + + git->w = git->minw = mw; + git->h = git->minh = mh; + git->mincalcd = EINA_TRUE; + } + evas_object_geometry_get(git->wd->pan_smart, &ox, &oy, &ow, &oh); + + if (!oy) + git->update_finish_y = EINA_TRUE; + + git->y = git->finish_y = oy + git->wd->start_y_pos; + git->wd->start_y_pos += it->h + git->h; + + git->num = ++git->wd->max_git_num; + + edje_object_signal_callback_add(git->base, "elm,title_action,item,click", + "elm", _group_item_click_cb, git); + evas_object_show(git->base); + + git->realized = EINA_TRUE; +} + +static void +_groupitem_unrealize(Elm_Genlist_GroupItem *git) +{ + Evas_Object *icon; + + if (!git->realized) return; + evas_object_del(git->base); + git->base = NULL; + elm_widget_stringlist_free(git->labels); + git->labels = NULL; + elm_widget_stringlist_free(git->icons); + git->icons = NULL; + elm_widget_stringlist_free(git->states); + + EINA_LIST_FREE(git->icon_objs, icon) + evas_object_del(icon); + + if (git->wd->max_git_num) + git->wd->max_git_num--; + git->states = NULL; + git->realized = EINA_FALSE; +} + +static void +_groupitem_remove(Elm_Genlist_GroupItem *git, Eina_Bool update_items) +{ + Elm_Genlist_Item *it; + const Eina_List *l; + + if (!git) return; + + if (git->realized) + _groupitem_unrealize(git); + + git->wd->group_items = eina_inlist_remove(git->wd->group_items,EINA_INLIST_GET(git)); + + if (update_items) + { + EINA_LIST_FOREACH(git->items,l, it) + { + it->group_item = NULL; + elm_genlist_item_update(it); + } + } + + if (git->itc->func.del) git->itc->func.del(git->data, git->wd->obj); + free(git); +} + +static void _item_realize(Elm_Genlist_Item *it, int in, int calc) { Elm_Genlist_Item *it2; @@ -1381,10 +1592,7 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) it->spacer = evas_object_rectangle_add(evas_object_evas_get(it->wd->obj)); evas_object_color_set(it->spacer, 0, 0, 0, 0); elm_widget_sub_object_add(it->wd->obj, it->spacer); - for (it2 = it, depth = 0; it2->parent; it2 = it2->parent) - { - if (it2->parent->flags != ELM_GENLIST_ITEM_GROUP) depth += 1; - } + for (it2 = it, depth = 0; it2->parent; it2 = it2->parent) depth += 1; it->expanded_depth = depth; treesize = edje_object_data_get(it->base, "treesize"); if (treesize) tsize = atoi(treesize); @@ -1535,8 +1743,9 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) it->realized = EINA_TRUE; it->want_unrealize = EINA_FALSE; - if ((ELM_GENLIST_EDIT_MODE_NONE != it->wd->edit_mode) && - (it->flags != ELM_GENLIST_ITEM_GROUP)) + if (it->group_item) + _groupitem_realize(it, calc); + if (ELM_GENLIST_EDIT_MODE_NONE != it->wd->edit_mode) { Evas_Object *icon; EINA_LIST_FREE(it->edit_icon_objs, icon) @@ -1590,6 +1799,7 @@ _item_block_recalc(Item_Block *itb, int in, int qadd, int norender) Evas_Coord minw = 0, minh = 0; int showme = 0, changed = 0; Evas_Coord y = 0; + Elm_Genlist_GroupItem *git = NULL; itb->num = in; EINA_LIST_FOREACH(itb->items, l, it) @@ -1627,7 +1837,17 @@ _item_block_recalc(Item_Block *itb, int in, int qadd, int norender) it->x = 0; it->y = y; y += it->h; + if (git != it->group_item) + { + git = it->group_item; + if (git && git->align == GROUP_ALIGN_NORTH && git->items->data == it) //Add Place holder for Group title + { + minh += git->minh; + it->y += git->minh; + y += git->minh; + } + } } itb->minw = minw; itb->minh = minh; @@ -1671,17 +1891,14 @@ _item_block_unrealize(Item_Block *itb) if (!itb->realized) return; EINA_LIST_FOREACH(itb->items, l, it) { - if (it->flags != ELM_GENLIST_ITEM_GROUP) - { - if (it->dragging || it->reordering) - { - dragging = 1; - it->want_unrealize = EINA_TRUE; - } - else - _item_unrealize(it); - } - } + if (it->dragging || it->reordering) + { + dragging = 1; + it->want_unrealize = EINA_TRUE; + } + else + _item_unrealize(it); + } if (!dragging) { itb->realized = EINA_FALSE; @@ -1692,40 +1909,6 @@ _item_block_unrealize(Item_Block *itb) } static void -_group_items_recalc(void *data) -{ - Widget_Data *wd = data; - Eina_List *l; - Elm_Genlist_Item *git; - - EINA_LIST_FOREACH(wd->group_items, l, git) - { - if (git->want_realize) - { - if (!git->realized) - _item_realize(git, 0, 0); - evas_object_resize(git->base, wd->minw, git->h); - evas_object_move(git->base, git->scrl_x, git->scrl_y); - evas_object_show(git->base); - evas_object_raise(git->base); - - /* - evas_object_resize(git->base.view, wd->minw, git->h); - evas_object_move(git->base.view, git->scrl_x, git->scrl_y); - evas_object_show(git->base.view); - evas_object_raise(git->base.view); - - */ - } - else if (!git->want_realize && git->realized) - { - if (!git->dragging) - _item_unrealize(git); - } - } -} - -static void _item_block_position(Item_Block *itb, int in) { const Eina_List *l; @@ -1733,7 +1916,7 @@ _item_block_position(Item_Block *itb, int in) Evas_Coord y = 0, ox, oy, ow, oh, cvx, cvy, cvw, cvh; int vis=0; int is_reorder = 0; - Elm_Genlist_Item *git = NULL; + Elm_Genlist_GroupItem *git = NULL; Elm_Genlist_Item *select_all_item = NULL; evas_object_geometry_get(itb->wd->pan_smart, &ox, &oy, &ow, &oh); @@ -1762,37 +1945,79 @@ _item_block_position(Item_Block *itb, int in) it->x = 0; it->y = y; it->w = itb->w; - it->scrl_x = itb->x + it->x - it->wd->pan_x + ox; - it->scrl_y = itb->y + it->y - it->wd->pan_y + oy; - - vis = (ELM_RECTS_INTERSECT(it->scrl_x, it->scrl_y, it->w, it->h, - cvx, cvy, cvw, cvh)); - if (it->flags != ELM_GENLIST_ITEM_GROUP) + vis = (ELM_RECTS_INTERSECT(itb->x - it->wd->pan_x + ox, + itb->y - it->wd->pan_y + oy, + itb->w, itb->h, + cvx, cvy, cvw, cvh)); + if ((itb->realized) && (!it->realized)) { - if ((itb->realized) && (!it->realized)) + if (vis) { - if (vis) _item_realize(it, in, 0); - } + Eina_Bool was_realized = it->realized; + _item_realize(it, in, 0); + if (!was_realized) + evas_object_smart_callback_call(it->wd->obj, + "realized", it); + } + } if (it->realized) { _notify_item_position(it); - if (vis) - { - git = it->group_item; - if (git) - { - if (git->scrl_y < oy) - git->scrl_y = oy; - if ((git->scrl_y + git->h) > (it->scrl_y + it->h)) - git->scrl_y = (it->scrl_y + it->h) - git->h; - git->want_realize = EINA_TRUE; - } - evas_object_resize(it->base, it->w, it->h); - evas_object_move(it->base, - it->scrl_x, it->scrl_y); - evas_object_show(it->base); + if (vis) + { + it->scrl_x = ox + itb->x + it->x - itb->wd->pan_x; + it->scrl_y = oy + itb->y + it->y - itb->wd->pan_y + itb->reoder_y;; + if (git != it->group_item) + { + git = it->group_item; + if (git) + { + git->visible = EINA_TRUE; //Mark Group Item to make it visible + if (git->items->data == it) + git->y = it->scrl_y; + if (GROUP_ALIGN_NORTH == git->align) + { + git->w = itb->w; + if (git->items->data == it) + { + it->scrl_y += git->minh; + y += git->minh; + } + } + } + } + if (git) + { + git->x = ox + itb->x - itb->wd->pan_x; + if (git->y < oy) + git->y = oy; + + if (git->align == GROUP_ALIGN_WEST) + { + it->w -= git->w; + it->scrl_x += git->x + git->w; + git->h = (it->scrl_y + it->h) - git->y ; + if (git->h < it->h) + { + git->y = it->scrl_y; + git->h = it->h; + } + } + if (git->align == GROUP_ALIGN_NORTH) + { + git->h = git->minh; + if ((git->y + git->h) > (it->scrl_y + it->h)) + git->y = (it->scrl_y + it->h) - git->minh; + } + if (git->update_finish_y) + { + git->finish_y += oy; + git->update_finish_y = EINA_FALSE; + } + + } is_reorder = _get_space_for_reorder_item(it); @@ -1838,15 +2063,10 @@ _item_block_position(Item_Block *itb, int in) _item_unrealize(it); } } - - in++; - } - else - { - if (vis) it->want_realize = EINA_TRUE; - } if (!it->reordering) y += it->h; + + in++; } if (itb->wd->select_all_item && @@ -1854,7 +2074,11 @@ _item_block_position(Item_Block *itb, int in) evas_object_raise(select_all_item->base); if (vis) - itb->wd->animate_edit_controls = 0; + { + itb->wd->animate_edit_controls = 0; + if (git) + git->visible = EINA_TRUE; + } } static void @@ -2059,7 +2283,7 @@ _pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) if (sd->wd->pinchzoom_effect_mode == ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_CONTRACT_FINISH) { int git_cnt = 0, git_h = 0; - Elm_Genlist_Item *git; + Elm_Genlist_GroupItem *git; EINA_INLIST_FOREACH(sd->wd->group_items, git) { @@ -2091,15 +2315,6 @@ _pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) } static void -_pan_min_get(Evas_Object *obj __UNUSED__, - Evas_Coord *x, - Evas_Coord *y) -{ - if (x) *x = 0; - if (y) *y = 0; -} - -static void _pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { Pan *sd = evas_object_smart_data_get(obj); @@ -2168,8 +2383,7 @@ _pan_calculate(Evas_Object *obj) Item_Block *itb; Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh; int in = 0; - Elm_Genlist_Item *git; - Eina_List *l; + Elm_Genlist_GroupItem *git; evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); if (sd->wd->pinchzoom_effect_mode == ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_EXPAND) return; @@ -2179,8 +2393,9 @@ _pan_calculate(Evas_Object *obj) { sd->wd->group_items_moved = EINA_TRUE; sd->wd->contract_pan_y = sd->wd->pan_y; - EINA_LIST_FOREACH(sd->wd->group_items, l, git) + EINA_INLIST_FOREACH(sd->wd->group_items, git) { + git->visible = EINA_TRUE; evas_object_raise(git->base); evas_object_resize(git->base, sd->wd->minw, git->h); evas_object_move(git->base, git->x, git->y + sd->wd->pan_y * -1); @@ -2192,10 +2407,9 @@ _pan_calculate(Evas_Object *obj) if (sd->wd->edit_mode != ELM_GENLIST_EDIT_MODE_NONE) (void)_edit_mode_reset(sd->wd); - - EINA_LIST_FOREACH(sd->wd->group_items, l, git) + EINA_INLIST_FOREACH(sd->wd->group_items, git) { - git->want_realize = EINA_FALSE; + git->visible = EINA_FALSE; } evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh); @@ -2227,15 +2441,29 @@ _pan_calculate(Evas_Object *obj) if (sd->wd->effect_mode && sd->wd->edit_mode_effect_mode) sd->wd->item_moving_effect_timer = ecore_animator_add(_edit_mode_item_moving_effect_cb, sd->wd); + + EINA_INLIST_FOREACH(sd->wd->group_items, git) + { + if (git->visible) + { + evas_object_raise(git->base); + evas_object_resize(git->base, git->w, git->h - 1); + evas_object_move(git->base, git->x, git->y); + if (!sd->wd->pinch_zoom_reserve) + evas_object_show(git->base); + else + evas_object_hide(git->base); + } + else + evas_object_hide(git->base); + } if ((sd->wd->edit_mode & ELM_GENLIST_EDIT_MODE_REORDER) && (sd->wd->ed->reorder_item)) { evas_object_raise(sd->wd->ed->reorder_item->base); evas_object_raise(sd->wd->ed->reorder_item->edit_obj); } - - _group_items_recalc(sd->wd); if (sd->wd->select_all_item) - evas_object_raise(sd->wd->select_all_item->base); + evas_object_raise(sd->wd->select_all_item->base); } static void @@ -2384,8 +2612,8 @@ elm_genlist_add(Evas_Object *parent) wd->pan->wd = wd; elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart, - _pan_set, _pan_get, _pan_max_get, - _pan_min_get, _pan_child_size_get); + _pan_set, _pan_get, + _pan_max_get, _pan_child_size_get); edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh); @@ -2678,16 +2906,14 @@ elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, - func_data); + Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); if (!wd) return NULL; if (!it) return NULL; if (!it->parent) { - if (flags & ELM_GENLIST_ITEM_GROUP) - wd->group_items = eina_list_append(wd->group_items, it); wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it)); it->rel = NULL; + } else { @@ -2696,18 +2922,13 @@ elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, if (ll) it2 = ll->data; it->parent->items = eina_list_append(it->parent->items, it); if (!it2) it2 = it->parent; - wd->items = - eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(it2)); + wd->items = + eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(it2)); it->rel = it2; it->rel->relcount++; - - if (it->parent->flags & ELM_GENLIST_ITEM_GROUP) - it->group_item = parent; - else if (it->parent->group_item) - it->group_item = it->parent->group_item; } - it->before = EINA_FALSE; + it->before = 0; _item_queue(wd, it); return it; } @@ -2730,46 +2951,24 @@ elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, * @ingroup Genlist */ EAPI Elm_Genlist_Item * -elm_genlist_item_prepend(Evas_Object *obj, - const Elm_Genlist_Item_Class *itc, - const void *data, - Elm_Genlist_Item *parent, +elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, - Evas_Smart_Cb func, - const void *func_data) + Evas_Smart_Cb func, const void *func_data) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, - func_data); + Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); if (!wd) return NULL; if (!it) return NULL; if (!it->parent) - { - if (flags & ELM_GENLIST_ITEM_GROUP) - wd->group_items = eina_list_prepend(wd->group_items, it); wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it)); - it->rel = NULL; - } else { - Elm_Genlist_Item *it2 = NULL; - Eina_List *ll = it->parent->items; - if (ll) it2 = ll->data; - it->parent->items = eina_list_prepend(it->parent->items, it); - if (!it2) it2 = it->parent; - wd->items = - eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(it2)); - it->rel = it2; - it->rel->relcount++; - - if (it->parent->flags & ELM_GENLIST_ITEM_GROUP) - it->group_item = parent; - else if (it->parent->group_item) - it->group_item = it->parent->group_item; + printf("FIXME: 12 tree not handled yet\n"); } - it->before = EINA_TRUE; + it->rel = NULL; + it->before = 1; _item_queue(wd, it); return it; } @@ -2783,7 +2982,6 @@ elm_genlist_item_prepend(Evas_Object *obj, * @param obj The genlist object * @param itc The item class for the item * @param data The item data - * @param parent The parent item * @param before The item to insert before * @param flags Item flags * @param func Convenience function called when item selected @@ -2793,43 +2991,27 @@ elm_genlist_item_prepend(Evas_Object *obj, * @ingroup Genlist */ EAPI Elm_Genlist_Item * -elm_genlist_item_insert_before(Evas_Object *obj, - const Elm_Genlist_Item_Class *itc, - const void *data, - Elm_Genlist_Item *parent, - Elm_Genlist_Item *before, - Elm_Genlist_Item_Flags flags, - Evas_Smart_Cb func, - const void *func_data) +elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *before, + Elm_Genlist_Item_Flags flags, + Evas_Smart_Cb func, const void *func_data) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(before, NULL); Widget_Data *wd = elm_widget_data_get(obj); - Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, - func_data); + Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func, func_data); if (!wd) return NULL; if (!it) return NULL; if (!it->parent) - { - if ((flags & ELM_GENLIST_ITEM_GROUP) && - (before->flags & ELM_GENLIST_ITEM_GROUP)) - wd->group_items = eina_list_prepend_relative(wd->group_items, it, - before); - } + wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(before)); else { - it->parent->items = eina_list_prepend_relative(it->parent->items, it, - before); - if (it->parent->flags & ELM_GENLIST_ITEM_GROUP) - it->group_item = parent; - else if (it->parent->group_item) - it->group_item = it->parent->group_item; + printf("FIXME: 13 tree not handled yet\n"); } - wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(before)); it->rel = before; it->rel->relcount++; - it->before = EINA_TRUE; + it->before = 1; _item_queue(wd, it); return it; } @@ -2843,7 +3025,6 @@ elm_genlist_item_insert_before(Evas_Object *obj, * @param obj The genlist object * @param itc The item class for the item * @param data The item data - * @param parent The parent item * @param after The item to insert after * @param flags Item flags * @param func Convenience function called when item selected @@ -2853,43 +3034,27 @@ elm_genlist_item_insert_before(Evas_Object *obj, * @ingroup Genlist */ EAPI Elm_Genlist_Item * -elm_genlist_item_insert_after(Evas_Object *obj, - const Elm_Genlist_Item_Class *itc, - const void *data, - Elm_Genlist_Item *parent, - Elm_Genlist_Item *after, - Elm_Genlist_Item_Flags flags, - Evas_Smart_Cb func, - const void *func_data) +elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *after, + Elm_Genlist_Item_Flags flags, + Evas_Smart_Cb func, const void *func_data) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL); Widget_Data *wd = elm_widget_data_get(obj); - Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, - func_data); + Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func, func_data); if (!wd) return NULL; if (!it) return NULL; if (!it->parent) + wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(after)); + else { - if ((flags & ELM_GENLIST_ITEM_GROUP) && - (after->flags & ELM_GENLIST_ITEM_GROUP)) - wd->group_items = eina_list_append_relative(wd->group_items, it, - after); - } - else - { - it->parent->items = eina_list_append_relative(it->parent->items, it, - after); - if (it->parent->flags & ELM_GENLIST_ITEM_GROUP) - it->group_item = parent; - else if (it->parent->group_item) - it->group_item = it->parent->group_item; + printf("FIXME: 14 tree not handled yet\n"); } - wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(after)); it->rel = after; it->rel->relcount++; - it->before = EINA_FALSE; + it->before = 0; _item_queue(wd, it); return it; } @@ -2910,19 +3075,11 @@ elm_genlist_clear(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - /** this is temporary code **/ - Elm_Genlist_Item *it; - while ((it = elm_genlist_first_item_get(obj))) { - elm_genlist_item_del(it); - } - return; - /** this should be fixed **/ - wd->move_effect_mode = ELM_GENLIST_ITEM_MOVE_EFFECT_NONE; wd->pinchzoom_effect_mode = ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_NONE; elm_smart_scroller_hold_set(wd->scr, 0); elm_smart_scroller_freeze_set(wd->scr, 0); - elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_FALSE); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 0); elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_TRUE); wd->max_git_num = 0; wd->pinch_zoom_reserve = EINA_FALSE; @@ -2932,6 +3089,12 @@ elm_genlist_clear(Evas_Object *obj) // ecore_timer_del(wd->item_moving_effect_timer); wd->item_moving_effect_timer = NULL; } + + while (wd->group_items) + { + _groupitem_remove((Elm_Genlist_GroupItem *)wd->group_items, EINA_FALSE); + } + if (wd->walking > 0) { Elm_Genlist_Item *it; @@ -2952,8 +3115,6 @@ elm_genlist_clear(Evas_Object *obj) if (it->realized) _item_unrealize(it); if (it->itc->func.del) it->itc->func.del(it->data, it->wd->obj); if (it->long_timer) ecore_timer_del(it->long_timer); - if (it->flags & ELM_GENLIST_ITEM_GROUP) - it->wd->group_items = eina_list_remove(it->wd->group_items, it); free(it); } while (wd->blocks) @@ -3567,7 +3728,6 @@ elm_genlist_item_show(Elm_Genlist_Item *it) { if (!it) return; if (it->delete_me) return; - Evas_Coord gith = 0; if ((it->queued) || (!it->mincalcd)) { it->wd->show_item = it; @@ -3580,11 +3740,9 @@ elm_genlist_item_show(Elm_Genlist_Item *it) it->wd->show_item->showme = EINA_FALSE; it->wd->show_item = NULL; } - if ((it->group_item) && (it->wd->pan_y > (it->y + it->block->y))) - gith = it->group_item->h; elm_smart_scroller_child_region_show(it->wd->scr, it->x + it->block->x, - it->y + it->block->y - gith, + it->y + it->block->y, it->block->w, it->h); } @@ -3604,7 +3762,6 @@ elm_genlist_item_bring_in(Elm_Genlist_Item *it) { if (!it) return; if (it->delete_me) return; - Evas_Coord gith = 0; if ((it->queued) || (!it->mincalcd)) { it->wd->show_item = it; @@ -3617,11 +3774,9 @@ elm_genlist_item_bring_in(Elm_Genlist_Item *it) it->wd->show_item->showme = EINA_FALSE; it->wd->show_item = NULL; } - if ((it->group_item) && (it->wd->pan_y > (it->y + it->block->y))) - gith = it->group_item->h; elm_smart_scroller_region_bring_in(it->wd->scr, it->x + it->block->x, - it->y + it->block->y - gith, + it->y + it->block->y, it->block->w, it->h); } @@ -3640,7 +3795,6 @@ elm_genlist_item_top_show(Elm_Genlist_Item *it) { if (!it) return; Evas_Coord ow, oh; - Evas_Coord gith = 0; if (it->delete_me) return; if ((it->queued) || (!it->mincalcd)) @@ -3656,12 +3810,10 @@ elm_genlist_item_top_show(Elm_Genlist_Item *it) it->wd->show_item = NULL; } evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &ow, &oh); - if (it->group_item) gith = it->group_item->h; elm_smart_scroller_child_region_show(it->wd->scr, it->x + it->block->x, - it->y + it->block->y - gith, + it->y + it->block->y, it->block->w, oh); - } /** @@ -3680,7 +3832,6 @@ elm_genlist_item_top_bring_in(Elm_Genlist_Item *it) { if (!it) return; Evas_Coord ow, oh; - Evas_Coord gith = 0; if (it->delete_me) return; if ((it->queued) || (!it->mincalcd)) @@ -3696,12 +3847,10 @@ elm_genlist_item_top_bring_in(Elm_Genlist_Item *it) it->wd->show_item = NULL; } evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &ow, &oh); - if (it->group_item) gith = it->group_item->h; elm_smart_scroller_region_bring_in(it->wd->scr, it->x + it->block->x, - it->y + it->block->y - gith, + it->y + it->block->y, it->block->w, oh); - } /** @@ -4278,7 +4427,7 @@ _group_item_contract_moving_effect_timer_cb(void *data) Widget_Data *wd = elm_widget_data_get(obj); Item_Block *itb = NULL; - Elm_Genlist_Item *git; + Elm_Genlist_GroupItem *git; Elm_Genlist_Item *it; const Eina_List *l; int cnt = 0, git_count = 0; @@ -4330,7 +4479,7 @@ _group_item_contract_moving_effect_timer_cb(void *data) EINA_INLIST_FOREACH(wd->group_items, git) { - base_git = list_start_y + git->h * (git->num - 1) + git->num; + base_git = list_start_y + git->h * (git->num-1) + git->num; git->old_y = git->y; added_gy = abs(base_git - git->y) / devide_size; if (added_gy < 1.0) @@ -4424,7 +4573,7 @@ _group_item_contract_moving_effect_timer_cb(void *data) wd->contract_pan_y = 0; wd->pinch_zoom_reserve = EINA_FALSE; wd->pinchzoom_effect_mode = ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_CONTRACT_FINISH; - elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_FALSE); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 0); elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_TRUE); // fprintf(stderr,"ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT FINISH \n"); @@ -4464,7 +4613,7 @@ _group_item_expand_moving_effect_timer_cb(void *data) { Evas_Object *obj = (Evas_Object *)data; Widget_Data *wd = elm_widget_data_get(obj); - Elm_Genlist_Item *git, *tmp_git; + Elm_Genlist_GroupItem *git, *tmp_git; Item_Block *itb = NULL; Elm_Genlist_Item *it; const Eina_List *l; @@ -4701,7 +4850,7 @@ _group_item_expand_moving_effect_timer_cb(void *data) fprintf(stderr,"ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND FINISH \n"); elm_smart_scroller_hold_set(wd->scr, 0); elm_smart_scroller_freeze_set(wd->scr, 0); - elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_FALSE); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 0); elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_TRUE); // printf("_group_item_expand_moving_effect_timer_cb FINISH \n"); evas_object_lower(wd->alpha_bg); @@ -4736,7 +4885,7 @@ _item_pinch_recalc(Evas_Object *obj, int emode) { wd->pinchzoom_effect_mode = ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_CONTRACT; - elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_TRUE); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 1); elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_FALSE); evas_object_raise(wd->alpha_bg); evas_object_show(wd->alpha_bg); @@ -4747,7 +4896,7 @@ _item_pinch_recalc(Evas_Object *obj, int emode) } else if (wd->pinchzoom_effect_mode == ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_CONTRACT_FINISH) { - elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_TRUE); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 1); evas_object_raise(wd->alpha_bg); evas_object_show(wd->alpha_bg); @@ -5152,6 +5301,31 @@ elm_genlist_effect_set(const Evas_Object *obj, Eina_Bool emode) evas_object_hide(wd->point_rect); } +/* + EAPI void + elm_genlist_edit_mode_effect_set(const Evas_Object *obj, Eina_Bool emode) + { + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + wd->edit_mode_effect_mode = emode; + } + */ + +EAPI void +elm_genlist_queue_exception_set(const Evas_Object *obj, Eina_Bool emode) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + wd->queue_exception = emode; + + fprintf(stderr, "=================> Caution!!! <========================\n"); + fprintf(stderr, "==> elm_genlist_queue_exception_set() is for demo. <===\n"); + fprintf(stderr, "==> Do not use this API <==\n"); + fprintf(stderr, "=======================================================\n"); +} + static void _delete_confirm_cb(void *data, Evas_Object *obj, void *event_info) { @@ -5700,6 +5874,196 @@ _get_space_for_reorder_item(Elm_Genlist_Item *it) } /** + * Add Group Item to the genlist + * + * @param obj The genlist object + * @param itc The item class for the item + * @param data The group item data + */ +EAPI Elm_Genlist_GroupItem * +elm_genlist_groupitem_add(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Elm_Genlist_GroupItem *git; + Widget_Data *wd = elm_widget_data_get(obj); + + git = calloc(1, sizeof(Elm_Genlist_GroupItem)); + if (!git) return NULL; + git->wd = wd; + git->itc = itc; + git->data = data; + + wd->group_items = eina_inlist_append(wd->group_items, EINA_INLIST_GET(git)); + return git; +} + +/** + * Delete a given groupitem + * + * This deletes the group item from genlist and calls the genlist group item del class + * callback defined in the item class, if it is set. + * + * @param git The group item + * + * @ingroup Genlist + */ +EAPI void +elm_genlist_groupitem_del(Elm_Genlist_GroupItem *git) +{ + _groupitem_remove(git, EINA_TRUE); +} + +/** + * Append item to the end of the genlist with Group Item + * + * This appends the given item to the end of the list or the end of the + * children if the parent is given. + * + * @param obj The genlist object + * @param itc The item class for the item + * @param data The item data + * @param parent The parent item, or NULL if none + * @param flags Item flags + * @param git Group Item + * @param func Convenience function called when item selected + * @param func_data Data passed to @p func above. + * @return A handle to the item added or NULL if not possible + * + * @ingroup Genlist + */ +EAPI Elm_Genlist_Item * +elm_genlist_item_append_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *parent, + Elm_Genlist_Item_Flags flags, Elm_Genlist_GroupItem *git, + Evas_Smart_Cb func, const void *func_data) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + parent = NULL; + Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); + Elm_Genlist_GroupItem *pgit = NULL; + Elm_Genlist_Item *it2 = NULL; + Eina_List *ll = NULL; + if (!wd) return NULL; + if (!it) return NULL; + if (!git) return NULL; + + pgit = git; + while (pgit) + { + ll = eina_list_last(pgit->items); + if (ll) + { + it2 = ll->data; + break; + } + if (!(EINA_INLIST_GET(pgit)->prev)) break; + pgit = (Elm_Genlist_GroupItem *)(EINA_INLIST_GET(pgit)->prev); + } + if (it2) + { + wd->items = + eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(it2)); + it->rel = it2; + it->rel->relcount++; + } + else + { + wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it)); + it->rel = NULL; + } + git->items = eina_list_append(git->items, it); + it->before = 0; + it->group_item = git; + _item_queue(wd, it); + return it; +} + +/** + * Prepend item at start of the genlist with Group Item + * + * This adds the given item to the beginning of the list or beginning of the + * children if the parent is given. + * + * @param obj The genlist object + * @param itc The item class for the item + * @param data The item data + * @param parent The parent item, or NULL if none + * @param flags Item flags + * @param git Group Item + * @param func Convenience function called when item selected + * @param func_data Data passed to @p func above. + * @return A handle to the item added or NULL if not possible + * + * @ingroup Genlist + */ +EAPI Elm_Genlist_Item * +elm_genlist_item_prepend_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *parent, + Elm_Genlist_Item_Flags flags, Elm_Genlist_GroupItem *git, + Evas_Smart_Cb func, const void *func_data) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + parent = NULL; + Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); + Elm_Genlist_GroupItem *pgit = NULL; + Elm_Genlist_Item *it2 = NULL; + Eina_List *ll = NULL; + Eina_Bool new_group = EINA_FALSE; + if (!wd) return NULL; + if (!it) return NULL; + if (!git) return NULL; + + pgit = git; + while (pgit) + { + if(new_group) + ll = eina_list_last(pgit->items); + else + ll = pgit->items; + + if (ll) + { + it2 = ll->data; + break; + } + if (!(EINA_INLIST_GET(pgit)->prev)) break; + pgit = (Elm_Genlist_GroupItem *)(EINA_INLIST_GET(pgit)->prev); + new_group = EINA_TRUE; + } + if (it2) + { + if(new_group) + wd->items = + eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(it2)); + else + wd->items = + eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(it2)); + it->rel = it2; + it->rel->relcount++; + } + else + { + wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it)); + it->rel = NULL; + } + git->items = eina_list_prepend(git->items, it); + if(!new_group) + it->before = 1; + else + it->before = 0; + + it->group_item = git; + _item_queue(wd, it); + return it; +} + +/** * Moves the Genlist Item */ EAPI void @@ -5832,13 +6196,10 @@ elm_genlist_edit_mode_set(Evas_Object *obj, int emode, Elm_Genlist_Edit_Class *e { EINA_LIST_FOREACH(itb->items, l, it) { - if (it->flags != ELM_GENLIST_ITEM_GROUP) - { it->delete_check = 0; it->del_confirm_state = 0; _item_unselect(it); _edit_controls_eval(it); - } } } if (wd->edit_mode & ELM_GENLIST_EDIT_MODE_SELECTALL) @@ -6168,61 +6529,3 @@ elm_genlist_item_rename_mode_set(Elm_Genlist_Item *it, int emode) it->wd->edit_mode = 0; } } - -EAPI Elm_Genlist_Item * -elm_genlist_groupitem_add(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, - const void *data) -{ - _print_deprecated("elm_genlist_groupitem_add", "elm_genlist_item_append"); - return elm_genlist_item_append(obj, itc, data, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL); -} - -EAPI Elm_Genlist_Item * -elm_genlist_item_append_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, - const void *data, Elm_Genlist_Item *parent, - Elm_Genlist_Item_Flags flags, Elm_Genlist_Item *git, - Evas_Smart_Cb func, const void *func_data) -{ - _print_deprecated("elm_genlist_item_append_with_group", "elm_genlist_item_append"); - return elm_genlist_item_append(obj, itc, data, git, flags, func, func_data); -} - -EAPI Elm_Genlist_Item * -elm_genlist_item_prepend_with_group(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, - const void *data, Elm_Genlist_Item *parent, - Elm_Genlist_Item_Flags flags, Elm_Genlist_Item *git, - Evas_Smart_Cb func, const void *func_data) -{ - _print_deprecated("elm_genlist_item_prepend_with_group", "elm_genlist_item_prepend"); - return elm_genlist_item_prepend(obj, itc, data, git, flags, func, func_data); -} - -EAPI void -elm_genlist_groupitem_del(Elm_Genlist_Item *git) -{ - _print_deprecated("elm_genlist_groupitem_del", "elm_genlist_item_del"); - return elm_genlist_item_del(git); -} - -static void -_print_deprecated(const char *deprecated, const char *new) -{ - fprintf(stderr, "=================> Caution!!! <========================\n"); - fprintf(stderr, "==> %s () is deprecated.\n", deprecated); - fprintf(stderr, "==> Use %s() instead.\n", new); - fprintf(stderr, "=======================================================\n"); -} - -EAPI void -elm_genlist_queue_exception_set(const Evas_Object *obj, Eina_Bool emode) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - wd->queue_exception = emode; - - fprintf(stderr, "=================> Caution!!! <========================\n"); - fprintf(stderr, "==> elm_genlist_queue_exception_set() is for demo. <===\n"); - fprintf(stderr, "==> Do not use this API <==\n"); - fprintf(stderr, "=======================================================\n"); -} diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c index d6efcca..22cc80e 100644 --- a/src/lib/elm_hover.c +++ b/src/lib/elm_hover.c @@ -5,60 +5,28 @@ * @defgroup Hover Hover * @ingroup Elementary * - * A Hover object will over its @p parent object at the @p target - * location. Anything in the background will be given a darker - * coloring to indicate that the hover object is on top (at the - * default theme). + * A Hover object will over over the @p Parent object at the @p Target + * location. Anything in the background will be given a darker coloring + * to indicate that the hover object is on top. * - * @note The hover object will take up the entire space of @p target - * object. + * NOTE: The hover object will take up the entire space of @p Target object. */ typedef struct _Widget_Data Widget_Data; -typedef struct _Content_Info Content_Info; - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#define ELM_HOVER_PARTS_FOREACH unsigned int i = 0; \ - for (i = 0; i < sizeof(wd->subs) / sizeof(wd->subs[0]); i++) - -static const char *_directions[] = { - "left", - "top-left", - "top", - "top-right", - "right", - "bottom-right", - "bottom", - "bottom-left", - "middle" -}; - -#define _HOV_LEFT (_directions[0]) -#define _HOV_TOP_LEFT (_directions[1]) -#define _HOV_TOP (_directions[2]) -#define _HOV_TOP_RIGHT (_directions[2]) -#define _HOV_RIGHT (_directions[4]) -#define _HOV_BOTTOM_RIGHT (_directions[5]) -#define _HOV_BOTTOM (_directions[6]) -#define _HOV_BOTTOM_LEFT (_directions[7]) -#define _HOV_MIDDLE (_directions[8]) - -struct _Content_Info -{ - const char *swallow; - Evas_Object *obj; -}; +typedef struct _Subinfo Subinfo; struct _Widget_Data { Evas_Object *hov, *cov; Evas_Object *offset, *size; Evas_Object *parent, *target; - Evas_Object *smt_sub; - Content_Info subs[sizeof(_directions)/sizeof(_directions[0])]; + Eina_List *subs; +}; + +struct _Subinfo +{ + const char *swallow; + Evas_Object *obj; }; static const char *widtype = NULL; @@ -73,33 +41,27 @@ static void _hov_move(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _hov_resize(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _hov_show(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _hov_hide(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _on_focus_hook(void *data, Evas_Object *obj); -static void _elm_hover_sub_obj_placement_eval_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _elm_hover_sub_obj_placement_eval(Evas_Object *obj); - -static const char SIG_CLICKED[] = "clicked"; -static const char SIG_SMART_LOCATION_CHANGED[] = "smart,changed"; -static const Evas_Smart_Cb_Description _signals[] = { - {SIG_CLICKED, ""}, - {SIG_SMART_LOCATION_CHANGED, ""}, - {NULL, NULL} -}; static void _del_pre_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - + Subinfo *si; + if (!wd) return; if (evas_object_visible_get(obj)) - evas_object_smart_callback_call(obj, SIG_CLICKED, NULL); + evas_object_smart_callback_call(obj, "clicked", NULL); elm_hover_target_set(obj, NULL); elm_hover_parent_set(obj, NULL); evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_MOVE, _hov_move, obj); evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_RESIZE, _hov_resize, obj); evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_SHOW, _hov_show, obj); evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_HIDE, _hov_hide, obj); + + EINA_LIST_FREE(wd->subs, si) + { + eina_stringshare_del(si->swallow); + free(si); + } } static void @@ -111,99 +73,19 @@ _del_hook(Evas_Object *obj) } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->cov, "elm,action,focus", "elm"); - evas_object_focus_set(wd->cov, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->cov, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->cov, EINA_FALSE); - } -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - // FIXME: hover contents doesn't seem to propagate resizes properly + // FIXME: hover contents doesnt seem to propagate resizes properly _elm_theme_object_set(obj, wd->cov, "hover", "base", elm_widget_style_get(obj)); edje_object_scale_set(wd->cov, elm_widget_scale_get(obj) * _elm_config->scale); - - if (wd->smt_sub) - _elm_hover_sub_obj_placement_eval(obj); - else - _reval_content(obj); + _reval_content(obj); _sizing_eval(obj); if (evas_object_visible_get(wd->cov)) _hov_show_do(obj); } -static void -_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) -{ - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - - edje_object_signal_emit(wd->cov, emission, source); -} - -static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - - edje_object_signal_callback_add(wd->hov, emission, source, func_cb, data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - - edje_object_signal_callback_del_full(wd->hov, emission, source, func_cb, - data); -} - -static void -_elm_hover_left_space_calc(Widget_Data *wd, Evas_Coord *spc_l, Evas_Coord *spc_t, Evas_Coord *spc_r, Evas_Coord *spc_b) -{ - Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0; - - if (wd->parent) - evas_object_geometry_get(wd->parent, &x, &y, &w, &h); - if (wd->target) - evas_object_geometry_get(wd->target, &x2, &y2, &w2, &h2); - - *spc_l = x2 - x; - *spc_r = (x + w) - (x2 + w2); - if (*spc_l < 0) - *spc_l = 0; - if (*spc_r < 0) - *spc_r = 0; - - *spc_t = y2 - y; - *spc_b = (y + h) - (y2 + h2); - if (*spc_t < 0) - *spc_t = 0; - if (*spc_b < 0) - *spc_b = 0; -} static void _sizing_eval(Evas_Object *obj) @@ -225,110 +107,30 @@ static void _reval_content(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - - ELM_HOVER_PARTS_FOREACH - { - char buf[1024]; - snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", wd->subs[i].swallow); - edje_object_part_swallow(wd->cov, buf, wd->subs[i].obj); - } -} - -static const char * -_elm_hover_smart_content_location_get(Widget_Data *wd, Evas_Coord spc_l, Evas_Coord spc_t, Evas_Coord spc_r, Evas_Coord spc_b) -{ - Evas_Coord c_w = 0, c_h = 0, mid_w, mid_h; - int max; - - evas_object_size_hint_min_get(wd->smt_sub, &c_w, &c_h); - mid_w = c_w / 2; - mid_h = c_h / 2; - - if (spc_l > spc_r) - goto left; - - max = MAX(spc_t, spc_r); - max = MAX(max, spc_b); - - if (max == spc_t) - { - if (mid_w > spc_l) - return _HOV_TOP_RIGHT; - - return _HOV_TOP; - } - - if (max == spc_r) - { - if (mid_h > spc_t) - return _HOV_BOTTOM_RIGHT; - else if (mid_h > spc_b) - return _HOV_TOP_RIGHT; - - return _HOV_RIGHT; - } - - if (mid_h > spc_l) - return _HOV_BOTTOM_RIGHT; - - return _HOV_BOTTOM; - -left: - max = MAX(spc_t, spc_l); - max = MAX(max, spc_b); - - if (max == spc_t) - { - if (mid_w > spc_r) - return _HOV_TOP_LEFT; - - return _HOV_TOP; - } - - if (max == spc_l) - { - if (mid_h > spc_t) - return _HOV_BOTTOM_LEFT; - else if (mid_h > spc_b) - return _HOV_TOP_LEFT; - - return _HOV_LEFT; - } - - if (mid_h > spc_r) - return _HOV_BOTTOM_LEFT; - - return _HOV_BOTTOM; + const Eina_List *l; + const Subinfo *si; + if (!wd) return; + EINA_LIST_FOREACH(wd->subs, l, si) + edje_object_part_swallow(wd->cov, si->swallow, si->obj); } static void _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) { - Widget_Data *wd; - Evas_Object *sub; - - sub = event_info; - wd = elm_widget_data_get(obj); - if (!wd) - return; - - if (wd->smt_sub) - { - if (wd->smt_sub == sub) - wd->smt_sub = NULL; - } - else + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *sub = event_info; + Eina_List *l; + Subinfo *si; + if (!wd) return; + EINA_LIST_FOREACH(wd->subs, l, si) { - ELM_HOVER_PARTS_FOREACH - { - if (wd->subs[i].obj == sub) - { - wd->subs[i].obj = NULL; - break; - } - } + if (si->obj == sub) + { + wd->subs = eina_list_remove_list(wd->subs, l); + eina_stringshare_del(si->swallow); + free(si); + break; + } } } @@ -336,23 +138,22 @@ static void _hov_show_do(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) - return; - + const Eina_List *l; + const Subinfo *si; + if (!wd) return; if (wd->cov) { evas_object_show(wd->cov); edje_object_signal_emit(wd->cov, "elm,action,show", "elm"); } - - ELM_HOVER_PARTS_FOREACH + EINA_LIST_FOREACH(wd->subs, l, si) { char buf[1024]; - if (wd->subs[i].obj) + if (!strncmp(si->swallow, "elm.swallow.slot.", 17)) { snprintf(buf, sizeof(buf), "elm,action,slot,%s,show", - wd->subs[i].swallow); + si->swallow + 17); edje_object_signal_emit(wd->cov, buf, "elm"); } } @@ -380,21 +181,22 @@ static void _hov_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); + const Eina_List *l; + const Subinfo *si; if (!wd) return; if (wd->cov) { edje_object_signal_emit(wd->cov, "elm,action,hide", "elm"); evas_object_hide(wd->cov); } - - ELM_HOVER_PARTS_FOREACH + EINA_LIST_FOREACH(wd->subs, l, si) { char buf[1024]; - if (wd->subs[i].obj) + if (!strncmp(si->swallow, "elm.swallow.slot.", 17)) { snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide", - wd->subs[i].swallow); + si->swallow + 17); edje_object_signal_emit(wd->cov, buf, "elm"); } } @@ -409,23 +211,12 @@ _target_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *e } static void -_target_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Widget_Data *wd = elm_widget_data_get(data); - if (!wd) - return; - - _sizing_eval(data); - _elm_hover_sub_obj_placement_eval(data); -} - -static void _signal_dismiss(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; evas_object_hide(data); - evas_object_smart_callback_call(data, SIG_CLICKED, NULL); + evas_object_smart_callback_call(data, "clicked", NULL); } static void @@ -477,31 +268,19 @@ elm_hover_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); - - ELM_HOVER_PARTS_FOREACH - wd->subs[i].swallow = _directions[i]; - e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "hover"); elm_widget_type_set(obj, "hover"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_del_hook_set(obj, _del_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); wd->hov = evas_object_rectangle_add(e); - evas_object_pass_events_set(wd->hov, EINA_TRUE); + evas_object_pass_events_set(wd->hov, 1); evas_object_color_set(wd->hov, 0, 0, 0, 0); elm_widget_resize_object_set(obj, wd->hov); evas_object_event_callback_add(wd->hov, EVAS_CALLBACK_MOVE, _hov_move, obj); @@ -516,12 +295,12 @@ elm_hover_add(Evas_Object *parent) _signal_dismiss, obj); wd->offset = evas_object_rectangle_add(e); - evas_object_pass_events_set(wd->offset, EINA_TRUE); + evas_object_pass_events_set(wd->offset, 1); evas_object_color_set(wd->offset, 0, 0, 0, 0); elm_widget_sub_object_add(obj, wd->offset); wd->size = evas_object_rectangle_add(e); - evas_object_pass_events_set(wd->size, EINA_TRUE); + evas_object_pass_events_set(wd->size, 1); evas_object_color_set(wd->size, 0, 0, 0, 0); elm_widget_sub_object_add(obj, wd->size); @@ -531,7 +310,6 @@ elm_hover_add(Evas_Object *parent) evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); elm_hover_parent_set(obj, parent); - evas_object_smart_callbacks_descriptions_set(obj, _signals); _sizing_eval(obj); return obj; @@ -553,19 +331,13 @@ elm_hover_target_set(Evas_Object *obj, Evas_Object *target) Widget_Data *wd = elm_widget_data_get(obj); if (wd->target) - { - evas_object_event_callback_del_full(wd->target, EVAS_CALLBACK_DEL, - _target_del, obj); - evas_object_event_callback_del_full(wd->target, EVAS_CALLBACK_MOVE, - _target_move, obj); - } + evas_object_event_callback_del_full(wd->target, EVAS_CALLBACK_DEL, + _target_del, obj); wd->target = target; if (wd->target) { evas_object_event_callback_add(wd->target, EVAS_CALLBACK_DEL, _target_del, obj); - evas_object_event_callback_add(wd->target, EVAS_CALLBACK_MOVE, - _target_move, obj); elm_widget_hover_object_set(target, obj); _sizing_eval(obj); } @@ -622,11 +394,11 @@ elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent) * * @param obj The hover object * @return The target object of the hover. - * + * * @ingroup Hover */ EAPI Evas_Object * -elm_hover_target_get(const Evas_Object *obj) +elm_hover_target_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); @@ -644,7 +416,7 @@ elm_hover_target_get(const Evas_Object *obj) * @ingroup Hover */ EAPI Evas_Object * -elm_hover_parent_get(const Evas_Object *obj) +elm_hover_parent_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); @@ -653,251 +425,94 @@ elm_hover_parent_get(const Evas_Object *obj) return wd->parent; } -static void -_elm_hover_subs_del(Widget_Data *wd) -{ - ELM_HOVER_PARTS_FOREACH - { - if (wd->subs[i].obj) - { - evas_object_del(wd->subs[i].obj); - wd->subs[i].obj = NULL; - } - } -} - -static void -_elm_hover_sub_obj_placement_eval(Evas_Object *obj) -{ - Evas_Coord spc_l, spc_r, spc_t, spc_b; - const char *smart_dir; - Widget_Data *wd; - char buf[1024]; - - wd = elm_widget_data_get(obj); - if (!wd->smt_sub) - return; - - _elm_hover_left_space_calc(wd, &spc_l, &spc_t, &spc_r, &spc_b); - - edje_object_part_unswallow(wd->cov, wd->smt_sub); - - smart_dir = _elm_hover_smart_content_location_get(wd, spc_l, spc_t, spc_r, - spc_b); - evas_object_smart_callback_call(obj, SIG_SMART_LOCATION_CHANGED, - (void *)smart_dir); - - snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", smart_dir); - edje_object_part_swallow(wd->cov, buf, wd->smt_sub); -} - -static void -_elm_hover_sub_obj_placement_eval_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - _elm_hover_sub_obj_placement_eval(data); -} - /** * Sets the content of the hover object and the direction in which * it will pop out. * - * Once the content object is set for a given direction, a previously - * set one (on the same direction) will be deleted. If you want to - * keep that old content object, use the elm_hover_content_unset() - * function. + * Once the content object is set, a previously set one will be deleted. + * If you want to keep that old content object, use the + * elm_hover_content_unset() function. * * @param obj The hover object - * @param swallow The direction that the object will be displayed - * at. Accepted values are "left", "top-left", "top", "top-right", - * "right", "bottom-right", "bottom", "bottom-left", "middle" and - * "smart". + * @param swallow The direction that the object will display in. Multiple + * objects can have the same swallow location. Objects placed in the same + * swallow will be placed starting at the middle of the hover and ending + * farther from the middle. + * Accepted values are "left" "right" "top" "bottom" "middle" * @param content The content to place at @p swallow * - * All directions may have contents at the same time, except for - * "smart". This is a special placement hint and its use case - * independs of the calculations coming from - * elm_hover_best_content_location_get(). Its use is for cases when - * one desires only one hover content, but with a dinamic special - * placement within the hover area. The content's geometry, whenever - * it changes, will be used to decide on a best location not - * extrapolating the hover's parent object view to show it in (still - * being the hover's target determinant of its medium part -- move and - * resize it to simulate finger sizes, for example). If one of the - * directions other than "smart" are used, a previously content set - * using it will be deleted, and vice-versa. - * * @ingroup Hover */ EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - - if (!strcmp(swallow, "smart")) - { - if (wd->smt_sub != content) - { - _elm_hover_subs_del(wd); - wd->smt_sub = content; - } - - if (content) - { - elm_widget_sub_object_add(obj, content); - evas_object_event_callback_add(wd->smt_sub, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _elm_hover_sub_obj_placement_eval_cb, - obj); - - _elm_hover_sub_obj_placement_eval(obj); - } - - goto end; - } - - if (wd->smt_sub) - { - evas_object_del(wd->smt_sub); - wd->smt_sub = NULL; - } - - ELM_HOVER_PARTS_FOREACH + Widget_Data *wd = elm_widget_data_get(obj); + Subinfo *si; + const Eina_List *l; + char buf[1024]; + if (!wd) return; + snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", swallow); + EINA_LIST_FOREACH(wd->subs, l, si) { - if (!strcmp(swallow, wd->subs[i].swallow)) + if (!strcmp(buf, si->swallow)) { - if (content == wd->subs[i].obj) - return; - evas_object_del(wd->subs[i].obj); - wd->subs[i].obj = NULL; - - if (content) - { - char buf[1024]; - - snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", swallow); - elm_widget_sub_object_add(obj, content); - edje_object_part_swallow(wd->cov, buf, content); - wd->subs[i].obj = content; - } + if (content == si->obj) return; + evas_object_del(si->obj); + si->obj = NULL; break; } } - - end: + if (content) + { + elm_widget_sub_object_add(obj, content); + edje_object_part_swallow(wd->cov, buf, content); + si = ELM_NEW(Subinfo); + si->swallow = eina_stringshare_add(buf); + si->obj = content; + wd->subs = eina_list_append(wd->subs, si); + } _sizing_eval(obj); } /** - * Get the content of the hover object, in a given direction. + * Unset the content of the hover object * - * Return the content object which was set for this widget in the - * given direction. + * Unparent and return the content object which was set for this widget * * @param obj The hover object - * @param swallow The direction that the object was display at. + * @param swallow The direction that the object will display in. Multiple + * objects can have the same swallow location. Objects placed in the same + * swallow will be placed starting at the middle of the hover and ending + * farther from the middle. + * Accepted values are "left" "right" "top" "bottom" "middle" * @return The content that was being used * - * @note See elm_hover_content_set() for more information. - * - * @ingroup Hover - */ -EAPI Evas_Object * -elm_hover_content_get(const Evas_Object *obj, const char *swallow) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return NULL; - - if (!strcmp(swallow, "smart")) - return wd->smt_sub; - - ELM_HOVER_PARTS_FOREACH - if (!strcmp(swallow, wd->subs[i].swallow)) - return wd->subs[i].obj; - - return NULL; -} - -static void -_elm_hover_sub_obj_unparent(Evas_Object *obj) -{ - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - - elm_widget_sub_object_del(obj, wd->smt_sub); - evas_object_event_callback_del_full(wd->smt_sub, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _elm_hover_sub_obj_placement_eval_cb, - obj); - edje_object_part_unswallow(wd->cov, wd->smt_sub); - wd->smt_sub = NULL; -} - -/** - * Unset the content of the hover object, in a given direction. - * - * Unparent and return the content object set at that direction. - * - * @param obj The hover object - * @param swallow The direction that the object was display at. - * @return The content that was being used. - * - * @note See elm_hover_content_set() for more information. - * * @ingroup Hover */ EAPI Evas_Object * elm_hover_content_unset(Evas_Object *obj, const char *swallow) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return NULL; - - if (!strcmp(swallow, "smart")) - { - Evas_Object *content; - - if (!wd->smt_sub) - return NULL; - - content = wd->smt_sub; - _elm_hover_sub_obj_unparent(obj); - return content; - } - - ELM_HOVER_PARTS_FOREACH + Widget_Data *wd = elm_widget_data_get(obj); + Subinfo *si; + const Eina_List *l; + char buf[1024]; + if (!wd) return NULL; + snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", swallow); + EINA_LIST_FOREACH(wd->subs, l, si) { - if (!strcmp(swallow, wd->subs[i].swallow)) + if (!strcmp(buf, si->swallow)) { Evas_Object *content; - - if (!wd->subs[i].obj) - return NULL; - - content = wd->subs[i].obj; - elm_widget_sub_object_del(obj, wd->subs[i].obj); - edje_object_part_unswallow(wd->cov, wd->subs[i].obj); - wd->subs[i].obj = NULL; - + if (!si->obj) return NULL; + content = si->obj; + elm_widget_sub_object_del(obj, si->obj); + edje_object_part_unswallow(wd->cov, si->obj); + si->obj = NULL; return content; } } - return NULL; } @@ -905,54 +520,46 @@ elm_hover_content_unset(Evas_Object *obj, const char *swallow) * Returns the best swallow location for content in the hover. * * @param obj The hover object - * @param pref_axis The preferred orientation axis for the hover object to use - * @return The edje location to place content into the hover or @c - * NULL, on errors. - * - * @p pref_axis may be one of - *
    - * - @c ELM_HOVER_AXIS_NONE -- no prefered orientation - * - @c ELM_HOVER_AXIS_HORIZONTAL -- horizontal - * - @c ELM_HOVER_AXIS_VERTICAL -- vertical - * - @c ELM_HOVER_AXIS_BOTH -- both - *
- * - * See also elm_hover_content_set(). + * @return The edje location to place content into the hover. + * See also elm_hover_content_set() * * @ingroup Hover */ EAPI const char * elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - + ELM_CHECK_WIDTYPE(obj, widtype) "left"; + Widget_Data *wd = elm_widget_data_get(obj); + Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0; Evas_Coord spc_l, spc_r, spc_t, spc_b; - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return NULL; - - _elm_hover_left_space_calc(wd, &spc_l, &spc_t, &spc_r, &spc_b); - + if (!wd) return "left"; + if (wd->parent) evas_object_geometry_get(wd->parent, &x, &y, &w, &h); + if (wd->target) evas_object_geometry_get(wd->target, &x2, &y2, &w2, &h2); + spc_l = x2 - x; + spc_r = (x + w) - (x2 + w2); + if (spc_l < 0) spc_l = 0; + if (spc_r < 0) spc_r = 0; + spc_t = y2 - y; + spc_b = (y + h) - (y2 + h2); + if (spc_t < 0) spc_t = 0; + if (spc_b < 0) spc_b = 0; if (pref_axis == ELM_HOVER_AXIS_HORIZONTAL) { - if (spc_l < spc_r) return _HOV_RIGHT; - else return _HOV_LEFT; + if (spc_l < spc_r) return "right"; + else return "left"; } else if (pref_axis == ELM_HOVER_AXIS_VERTICAL) { - if (spc_t < spc_b) return _HOV_BOTTOM; - else return _HOV_TOP; + if (spc_t < spc_b) return "bottom"; + else return "top"; } - if (spc_l < spc_r) { - if (spc_t > spc_r) return _HOV_TOP; - else if (spc_b > spc_r) return _HOV_BOTTOM; - return _HOV_RIGHT; + if (spc_t > spc_r) return "top"; + else if (spc_b > spc_r) return "bottom"; + return "right"; } - if (spc_t > spc_r) return _HOV_TOP; - else if (spc_b > spc_r) return _HOV_BOTTOM; - return _HOV_LEFT; + if (spc_t > spc_r) return "top"; + else if (spc_b > spc_r) return "bottom"; + return "left"; } diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c index 44f891d..d88b30a 100644 --- a/src/lib/elm_icon.c +++ b/src/lib/elm_icon.c @@ -1,11 +1,6 @@ #include #include "elm_priv.h" -#ifdef ELM_EFREET -#define NON_EXISTING (void *)-1 -static const char *icon_theme = NULL; -#endif - /** * @defgroup Icon Icon * @ingroup Elementary @@ -14,9 +9,9 @@ static const char *icon_theme = NULL; * arrows etc.) or a custom file (PNG, JPG, EDJE etc.) used for an * icon. The Icon may scale or not and of course... support alpha * channels. - * + * * Signals that you can add callbacks for are: - * + * * clicked - This is called when a user has clicked the icon */ @@ -26,13 +21,6 @@ struct _Widget_Data { Evas_Object *img; const char *stdicon; - Elm_Icon_Lookup_Order lookup_order; -#ifdef ELM_EFREET - struct { - int requested_size; - Eina_Bool use : 1; - } freedesktop; -#endif Eina_Bool scale_up : 1; Eina_Bool scale_down : 1; Eina_Bool smooth : 1; @@ -46,25 +34,6 @@ static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static Eina_Bool _icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name); -static Eina_Bool _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size); - -//FIXME: move this code to ecore -#ifdef _WIN32 -static Eina_Bool -_path_is_absolute(const char *path) -{ - //TODO: Check if this works with all absolute paths in windows - return ((isalpha (*path)) && (*(path + 1) == ':') && ((*(path + 2) == '\\') || (*(path + 2) == '/'))); -} -#else -static Eina_Bool -_path_is_absolute(const char *path) -{ - return (*path == '/'); -} -#endif - static void _del_hook(Evas_Object *obj) { @@ -86,40 +55,6 @@ _theme_hook(Evas_Object *obj) } static void -_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - Evas_Object *icon_edje; - icon_edje = _els_smart_icon_edje_get(wd->img); - if (!icon_edje) return; - edje_object_signal_emit(icon_edje, emission, source); -} - -static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - Evas_Object *icon_edje; - icon_edje = _els_smart_icon_edje_get(wd->img); - if (!icon_edje) return; - edje_object_signal_callback_add(icon_edje, emission, source, func_cb, data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - Evas_Object *icon_edje; - icon_edje = _els_smart_icon_edje_get(wd->img); - if (!icon_edje) return; - edje_object_signal_callback_del_full(icon_edje, emission, source, func_cb, - data); -} - -static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -128,17 +63,6 @@ _sizing_eval(Evas_Object *obj) int w, h; _els_smart_icon_size_get(wd->img, &w, &h); -#ifdef ELM_EFREET - if ((wd->freedesktop.use) && (!((w - wd->freedesktop.requested_size) % 16))) - { - /* This icon has been set to a freedesktop icon, and the requested - appears to have a different size than the requested size, so try to - request another, higher resolution, icon. - FIXME: Find a better heuristic to determine if there should be - an icon with a different resolution. */ - _icon_freedesktop_set(wd, obj, wd->stdicon, w); - } -#endif _els_smart_icon_scale_up_set(wd->img, wd->scale_up); _els_smart_icon_scale_down_set(wd->img, wd->scale_down); _els_smart_icon_smooth_scale_set(wd->img, wd->smooth); @@ -187,11 +111,8 @@ elm_icon_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "icon"); elm_widget_type_set(obj, "icon"); @@ -200,15 +121,11 @@ elm_icon_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - wd->lookup_order = ELM_ICON_LOOKUP_THEME_FDO; wd->img = _els_smart_icon_add(e); evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); - evas_object_repeat_events_set(wd->img, EINA_TRUE); + evas_object_repeat_events_set(wd->img, 1); elm_widget_resize_object_set(obj, wd->img); wd->smooth = EINA_TRUE; @@ -226,7 +143,7 @@ elm_icon_add(Evas_Object *parent) * @param file The path to file that will be used as icon * @param group The group that the icon belongs in edje file * - * @return (1 = success, 0 = error) + * @return (1 = sucess, 0 = error) * * @ingroup Icon */ @@ -238,8 +155,7 @@ elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) Eina_Bool ret; const char *p; - if (!wd) return EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); + if ((!wd) || (!file)) return EINA_FALSE; if (wd->stdicon) eina_stringshare_del(wd->stdicon); wd->stdicon = NULL; if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj"))) @@ -251,114 +167,12 @@ elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) } /** - * Get the file that will be used as icon - * - * @param obj The icon object - * @param file The path to file that will be used as icon - * @param group The group that the icon belongs in edje file - * - * @ingroup Icon - */ -EAPI void -elm_icon_file_get(const Evas_Object *obj, const char **file, const char **group) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - _els_smart_icon_file_get(wd->img, file, group); -} - -static Eina_Bool -_icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name) -{ - if (_elm_theme_object_icon_set(obj, wd->img, name, "default")) - { -#ifdef ELM_EFREET - /* TODO: elm_unneed_efreet() */ - wd->freedesktop.use = EINA_FALSE; -#endif - return EINA_TRUE; - } - return EINA_FALSE; -} - -static Eina_Bool -_icon_file_set(Widget_Data *wd, Evas_Object *obj, const char *path) -{ - if (elm_icon_file_set(obj, path, NULL)) - { -#ifdef ELM_EFREET - /* TODO: elm_unneed_efreet() */ - wd->freedesktop.use = EINA_FALSE; -#endif - return EINA_TRUE; - } - return EINA_FALSE; -} - -static Eina_Bool -_icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size) -{ -#ifdef ELM_EFREET - const char *path; - - elm_need_efreet(); - if (icon_theme == NON_EXISTING) return EINA_FALSE; - if (!icon_theme) - { - Efreet_Icon_Theme *theme; - /* TODO: Listen for EFREET_EVENT_ICON_CACHE_UPDATE */ - theme = efreet_icon_theme_find(getenv("E_ICON_THEME")); - if (!theme) - { - const char **itr; - static const char *themes[] = { - "gnome", "Human", "oxygen", "hicolor", NULL - }; - for (itr = themes; *itr; itr++) - { - theme = efreet_icon_theme_find(*itr); - if (theme) break; - } - } - - if (!theme) - { - icon_theme = NON_EXISTING; - return EINA_FALSE; - } - else - icon_theme = eina_stringshare_add(theme->name.internal); - } - path = efreet_icon_path_find(icon_theme, name, size); - wd->freedesktop.use = !!path; - if (wd->freedesktop.use) - { - wd->freedesktop.requested_size = size; - elm_icon_file_set(obj, path, NULL); - return EINA_TRUE; - } -#endif - return EINA_FALSE; -} - -static inline int -_icon_size_min_get(Evas_Object *icon) -{ - int size; - _els_smart_icon_size_get(icon, &size, NULL); - return (size < 32) ? 32 : size; -} - -/** - * Set the theme, as standard, for a icon. - * If theme was not found and it is the absolute path of an image file, this - * image will be used. + * Set the theme, as standard, for a icon * * @param obj The icon object * @param name The theme name * - * @return (1 = success, 0 = error) + * @return (1 = sucess, 0 = error) * * @ingroup Icon */ @@ -367,99 +181,13 @@ elm_icon_standard_set(Evas_Object *obj, const char *name) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - char *tmp; Eina_Bool ret; if ((!wd) || (!name)) return EINA_FALSE; - - /* try locating the icon using the specified lookup order */ - switch (wd->lookup_order) - { - case ELM_ICON_LOOKUP_FDO: - ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img)); - break; - case ELM_ICON_LOOKUP_THEME: - ret = _icon_standard_set(wd, obj, name); - break; - case ELM_ICON_LOOKUP_THEME_FDO: - ret = _icon_standard_set(wd, obj, name) || - _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img)); - break; - case ELM_ICON_LOOKUP_FDO_THEME: - default: - ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img)) || - _icon_standard_set(wd, obj, name); - break; - } - - if (ret) - { - eina_stringshare_replace(&wd->stdicon, name); - _sizing_eval(obj); - return EINA_TRUE; - } - - if (_path_is_absolute(name)) - return _icon_file_set(wd, obj, name); - - /* if that fails, see if icon name is in the format size/name. if so, - try locating a fallback without the size specification */ - if (!(tmp = strchr(name, '/'))) return EINA_FALSE; - ++tmp; - if (*tmp) return elm_icon_standard_set(obj, tmp); - - /* give up */ - return EINA_FALSE; -} - -/** - * Get the theme, as standard, for a icon - * - * @param obj The icon object - * @return The theme name - * - * @ingroup Icon - */ -EAPI const char * -elm_icon_standard_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->stdicon; -} - -/** - * Sets icon lookup order, used by elm_icon_standard_set(). - * - * @param obj The icon object - * @param order The icon lookup order - * - * @ingroup Icon - */ -EAPI void -elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (wd) wd->lookup_order = order; -} - -/** - * Gets the icon lookup order. - * - * @param obj The icon object - * @return The icon lookup order - * - * @ingroup Icon - */ -EAPI Elm_Icon_Lookup_Order -elm_icon_order_lookup_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) ELM_ICON_LOOKUP_THEME_FDO; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_ICON_LOOKUP_THEME_FDO; - return wd->lookup_order; + eina_stringshare_replace(&wd->stdicon, name); + ret = _elm_theme_object_icon_set(obj, wd->img, name, "default"); + _sizing_eval(obj); + return ret; } /** @@ -483,25 +211,7 @@ elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth) } /** - * Get the smooth effect for a icon - * - * @param obj The icon object - * @return If setted smooth effect - * - * @ingroup Icon - */ -EAPI Eina_Bool -elm_icon_smooth_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) return EINA_FALSE; - return wd->smooth; -} - -/** - * Set if the object is scalable + * Set if the object are scalable * * @param obj The icon object * @param no_scale A bool to set scale (or no) @@ -521,23 +231,6 @@ elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) } /** - * Get if the object isn't scalable - * - * @param obj The icon object - * @return If isn't scalable - * - * @ingroup Icon - */ -EAPI Eina_Bool -elm_icon_no_scale_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->no_scale; -} - -/** * Set if the object is (up/down) scalable * * @param obj The icon object @@ -559,25 +252,6 @@ elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) } /** - * Get if the object is (up/down) scalable - * - * @param obj The icon object - * @param scale_up A bool to set if the object is scalable up - * @param scale_down A bool to set if the object is scalable down - * - * @ingroup Icon - */ -EAPI void -elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (scale_up) *scale_up = wd->scale_up; - if (scale_down) *scale_down = wd->scale_down; -} - -/** * Set if the object is filled outside * * @param obj The icon object @@ -597,23 +271,6 @@ elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) _sizing_eval(obj); } -/** - * Get if the object is filled outside - * - * @param obj The icon object - * @return If the object is filled outside - * - * @ingroup Icon - */ -EAPI Eina_Bool -elm_icon_fill_outside_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) return EINA_FALSE; - return wd->fill_outside; -} /** * Set the prescale size for the icon @@ -633,20 +290,4 @@ elm_icon_prescale_set(Evas_Object *obj, int size) _els_smart_icon_scale_size_set(wd->img, size); } -/** - * Get the prescale size for the icon - * - * @param obj The icon object - * @return The prescale size - * - * @ingroup Icon - */ -EAPI int -elm_icon_prescale_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return 0; - return _els_smart_icon_scale_size_get(wd->img); -} diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c index 5100e64..a32e8e5 100644 --- a/src/lib/elm_image.c +++ b/src/lib/elm_image.c @@ -115,11 +115,8 @@ elm_image_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "image"); elm_widget_type_set(obj, "image"); @@ -128,12 +125,12 @@ elm_image_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); + elm_widget_can_focus_set(obj, 0); wd->img = _els_smart_icon_add(e); evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); - evas_object_repeat_events_set(wd->img, EINA_TRUE); + evas_object_repeat_events_set(wd->img, 1); elm_widget_resize_object_set(obj, wd->img); wd->smooth = EINA_TRUE; @@ -165,8 +162,7 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group) Eina_Bool ret; const char *p; - if (!wd) return EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); + if ((!wd) || (!file)) return EINA_FALSE; if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj"))) ret = _els_smart_icon_file_edje_set(wd->img, file, group); else @@ -176,24 +172,6 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group) } /** - * Get the file that will be used as image - * - * @param obj The image object - * @param file The path to file - * @param group The group that the image belongs in edje file - * - * @ingroup Image - */ -EAPI void -elm_image_file_get(const Evas_Object *obj, const char **file, const char **group) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - _els_smart_icon_file_get(wd->img, file, group); -} - -/** * Set the smooth effect for a image * * @param obj The image object @@ -214,24 +192,6 @@ elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth) } /** - * Get the smooth effect for a image - * - * @param obj The image object - * @return If setted smooth effect - * - * @ingroup Image - */ -EAPI Eina_Bool -elm_image_smooth_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) return EINA_FALSE; - return wd->smooth; -} - -/** * Gets the current size of the image. * * Either width or height (or both) may be NULL. @@ -274,23 +234,6 @@ elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) } /** - * Get if the object isn't scalable - * - * @param obj The image object - * @return If isn't scalable - * - * @ingroup Image - */ -EAPI Eina_Bool -elm_image_no_scale_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->no_scale; -} - -/** * Set if the object is (up/down) scalable * * @param obj The image object @@ -312,25 +255,6 @@ elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) } /** - * Get if the object is (up/down) scalable - * - * @param obj The image object - * @param scale_up A bool to set if the object is scalable up - * @param scale_down A bool to set if the object is scalable down - * - * @ingroup Image - */ -EAPI void -elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (scale_up) *scale_up = wd->scale_up; - if (scale_down) *scale_down = wd->scale_down; -} - -/** * Set if the object is filled outside * * @param obj The image object @@ -351,24 +275,6 @@ elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) } /** - * Get if the object is filled outside - * - * @param obj The image object - * @return If the object is filled outside - * - * @ingroup Image - */ -EAPI Eina_Bool -elm_image_fill_outside_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) return EINA_FALSE; - return wd->fill_outside; -} - -/** * Set the prescale size for the image * * @param obj The image object @@ -387,24 +293,6 @@ elm_image_prescale_set(Evas_Object *obj, int size) } /** - * Get the prescale size for the image - * - * @param obj The image object - * @return The prescale size - * - * @ingroup Image - */ -EAPI int -elm_image_prescale_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0; - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) return 0; - return _els_smart_icon_scale_size_get(wd->img); -} - -/** * Set the image orient * * @param obj The image object @@ -427,27 +315,6 @@ elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient) } /** - * Get the image orient - * - * @param obj The image object - * @return The image orient - * (ELM_IMAGE_ORIENT_NONE, ELM_IMAGE_ROTATE_90_CW, - * ELM_IMAGE_ROTATE_180_CW, ELM_IMAGE_ROTATE_90_CCW, - * ELM_IMAGE_FLIP_HORIZONTAL,ELM_IMAGE_FLIP_VERTICAL, - * ELM_IMAGE_FLIP_TRANSPOSE, ELM_IMAGE_FLIP_TRANSVERSE) - * - * @ingroup Image - */ -EAPI Elm_Image_Orient -elm_image_orient_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) ELM_IMAGE_ORIENT_NONE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_IMAGE_ORIENT_NONE; - return _els_smart_icon_orient_get(wd->img); -} - -/** * Make the image 'editable'. * * This means the image is a valid drag target for drag and drop, and can be @@ -462,27 +329,9 @@ elm_image_editable_set(Evas_Object *obj, Eina_Bool set) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (!wd) return;; _els_smart_icon_edit_set(wd->img, set, obj); } -/** - * Make the image 'editable'. - * - * This means the image is a valid drag target for drag and drop, and can be - * cut or pasted too. - * - * @param obj Image object. - * @return Editability. - */ -EAPI Eina_Bool -elm_image_editable_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return _els_smart_icon_edit_get(wd->img); -} - /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ diff --git a/src/lib/elm_imageslider.c b/src/lib/elm_imageslider.c index 924b9e8..ef97ddb 100644 --- a/src/lib/elm_imageslider.c +++ b/src/lib/elm_imageslider.c @@ -878,8 +878,7 @@ _imageslider_update(Widget_Data * wd) if (!eo) { eo = elm_image_add(wd->obj); - elm_layout_content_set(wd->ly[i], "swl.photo", eo); - //elm_image_prescale_set(eo, wd->w); + elm_layout_content_set(wd->ly[i], "swl.photo", eo); elm_image_prescale_set(eo, wd->w); elm_image_file_set(eo, it->photo_file, NULL); elm_image_object_size_get(eo, &it->w, &it->h); evas_object_geometry_get(eo, &it->ox, &it->oy, &it->ow, &it->oh); @@ -892,11 +891,11 @@ _imageslider_update(Widget_Data * wd) it->moving = wd->moving; if (wd->moving) { - //elm_image_prescale_set(eo, MOVING_IMAGE_SIZE); + elm_image_prescale_set(eo, MOVING_IMAGE_SIZE); } else { - //elm_image_prescale_set(eo, it->w > it->h ? it->w : it->h); + elm_image_prescale_set(eo, it->w > it->h ? it->w : it->h); } } } diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c index 406866a..f91e9e7 100644 --- a/src/lib/elm_label.c +++ b/src/lib/elm_label.c @@ -262,12 +262,15 @@ _strbuf_key_value_replace(Eina_Strbuf *srcbuf, const char *key, const char *valu if (curlocater) { replocater = curlocater + key_len + 1; + while ((*replocater) && (*replocater != '=')) + replocater++; - while ((*replocater) && (*replocater != ' ') && (*replocater != '>')) + while (*replocater && *replocater != ' ' && *replocater != '>') replocater++; - if (replocater - curlocater > key_len) + if (replocater - curlocater > key_len + 1) { + replocater--; eina_strbuf_append_n(diffbuf, curlocater, replocater-curlocater); } @@ -586,9 +589,9 @@ _label_state_change(Evas_Object *obj) if (wd->linewrap) { if (wd->wrapmode) - edje_object_signal_emit(wd->lbl, "elm,state,default", "elm"); + edje_object_signal_emit(wd->lbl, "elm,state,wordwrap", "elm"); else - edje_object_signal_emit(wd->lbl, "elm,state,charwrap", "elm"); + edje_object_signal_emit(wd->lbl, "elm,state,default", "elm"); } } @@ -681,7 +684,7 @@ elm_label_add(Evas_Object *parent) wd->linewrap = EINA_FALSE; wd->ellipsis = EINA_FALSE; - wd->wrapmode = EINA_TRUE; + wd->wrapmode = EINA_FALSE; wd->slidingmode = EINA_FALSE; wd->slidingellipsis = EINA_FALSE; wd->wrap_w = 0; diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c index d3f483a..c32437d 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -1,3 +1,7 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + #include #include "elm_priv.h" @@ -13,78 +17,39 @@ typedef struct _Widget_Data Widget_Data; typedef struct _Subinfo Subinfo; -typedef struct _Part_Cursor Part_Cursor; struct _Widget_Data { - Evas_Object *obj; Evas_Object *lay; Eina_List *subs; - Eina_List *parts_cursors; Eina_Bool needs_size_calc:1; const char *clas, *group, *style; }; struct _Subinfo { - const char *part; - Evas_Object *obj; - enum { - SWALLOW, - BOX_APPEND, - BOX_PREPEND, - BOX_INSERT_BEFORE, - BOX_INSERT_AT, - TABLE_PACK, - TEXT - } type; - union { - union { - const Evas_Object *reference; - unsigned int pos; - } box; - struct { - unsigned short col, row, colspan, rowspan; - } table; - struct { - const char *text; - } text; - } p; -}; - -struct _Part_Cursor -{ + const char *swallow; Evas_Object *obj; - const char *part; - const char *cursor; - const char *style; - Eina_Bool engine_only:1; }; static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); -static void _sizing_eval(Widget_Data *wd); +static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _sub_del(void *data, Evas_Object *obj, void *event_info); -static void _part_cursor_free(Part_Cursor *pc); static void _del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Subinfo *si; - Part_Cursor *pc; - if (!wd) return; EINA_LIST_FREE(wd->subs, si) { - eina_stringshare_del(si->part); - if (si->type == TEXT) - eina_stringshare_del(si->p.text.text); + eina_stringshare_del(si->swallow); free(si); } - EINA_LIST_FREE(wd->parts_cursors, pc) _part_cursor_free(pc); free(wd); } @@ -96,8 +61,8 @@ _theme_hook(Evas_Object *obj) _elm_theme_object_set(obj, wd->lay, wd->clas, wd->group, wd->style); edje_object_scale_set(wd->lay, elm_widget_scale_get(obj) * - _elm_config->scale); - _sizing_eval(wd); + _elm_config->scale); + _sizing_eval(obj); } static void @@ -107,147 +72,30 @@ _changed_hook(Evas_Object *obj) if (!wd) return; if (wd->needs_size_calc) { - _sizing_eval(wd); + _sizing_eval(obj); wd->needs_size_calc = 0; } } static void -_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_emit(wd->lay, emission, source); -} - -static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_add(wd->lay, emission, source, func_cb, data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_del_full(wd->lay, emission, source, func_cb, - data); -} - - -static void * -_elm_layout_list_data_get(const Eina_List *list) -{ - Subinfo *si = eina_list_data_get(list); - return si->obj; -} - -static Eina_Bool -_elm_layout_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) +_sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - const Eina_List *items; - void *(*list_data_get) (const Eina_List *list); - - if ((!wd) || (!wd->subs)) - return EINA_FALSE; - - /* Focus chain (This block is diferent of elm_win cycle)*/ - if ((items = elm_widget_focus_custom_chain_get(obj))) - list_data_get = eina_list_data_get; - else - { - items = wd->subs; - list_data_get = _elm_layout_list_data_get; - - if (!items) return EINA_FALSE; - } - - return elm_widget_focus_list_next_get(obj, items, list_data_get, dir, - next); -} - -static void -_sizing_eval(Widget_Data *wd) -{ Evas_Coord minw = -1, minh = -1; + if (!wd) return; edje_object_size_min_calc(wd->lay, &minw, &minh); - evas_object_size_hint_min_set(wd->obj, minw, minh); - evas_object_size_hint_max_set(wd->obj, -1, -1); + evas_object_size_hint_min_set(obj, minw, minh); + evas_object_size_hint_max_set(obj, -1, -1); } static void -_request_sizing_eval(Widget_Data *wd) +_request_sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; if (wd->needs_size_calc) return; wd->needs_size_calc = 1; - evas_object_smart_changed(wd->obj); -} - -static void -_part_cursor_free(Part_Cursor *pc) -{ - eina_stringshare_del(pc->part); - eina_stringshare_del(pc->style); - eina_stringshare_del(pc->cursor); - free(pc); -} - -static void -_part_cursor_part_apply(const Part_Cursor *pc) -{ - elm_object_cursor_set(pc->obj, pc->cursor); - elm_object_cursor_style_set(pc->obj, pc->style); - elm_object_cursor_engine_only_set(pc->obj, pc->engine_only); -} - -static Part_Cursor * -_parts_cursors_find(Widget_Data *wd, const char *part) -{ - const Eina_List *l; - Part_Cursor *pc; - EINA_LIST_FOREACH(wd->parts_cursors, l, pc) - { - if (!strcmp(pc->part, part)) - return pc; - } - return NULL; -} - -static void -_parts_cursors_apply(Widget_Data *wd) -{ - const char *file, *group; - const Eina_List *l; - Part_Cursor *pc; - - edje_object_file_get(wd->lay, &file, &group); - - EINA_LIST_FOREACH(wd->parts_cursors, l, pc) - { - Evas_Object *obj = (Evas_Object *)edje_object_part_object_get - (wd->lay, pc->part); - - if (!obj) - { - pc->obj = NULL; - WRN("no part '%s' in group '%s' of file '%s'. " - "Cannot set cursor '%s'", - pc->part, group, file, pc->cursor); - continue; - } - else if (evas_object_pass_events_get(obj)) - { - pc->obj = NULL; - WRN("part '%s' in group '%s' of file '%s' has mouse_events: 0. " - "Cannot set cursor '%s'", - pc->part, group, file, pc->cursor); - continue; - } - - pc->obj = obj; - _part_cursor_part_apply(pc); - } + evas_object_smart_changed(obj); } static void @@ -269,11 +117,11 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) if (si->obj == sub) { evas_object_event_callback_del_full(sub, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, - wd); + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, + obj); wd->subs = eina_list_remove_list(wd->subs, l); - eina_stringshare_del(si->part); + eina_stringshare_del(si->swallow); free(si); break; } @@ -286,19 +134,6 @@ _signal_size_eval(void *data, Evas_Object *obj __UNUSED__, const char *emission _request_sizing_eval(data); } -static void -_parts_text_fix(Widget_Data *wd) -{ - const Eina_List *l; - Subinfo *si; - - EINA_LIST_FOREACH(wd->subs, l, si) - { - if (si->type == TEXT) - edje_object_part_text_set(wd->lay, si->part, si->p.text.text); - } -} - /** * Add a new layout to the parent * @@ -314,12 +149,9 @@ elm_layout_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; - wd->obj = obj = elm_widget_add(e); + obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "layout"); elm_widget_type_set(obj, "layout"); elm_widget_sub_object_add(parent, obj); @@ -327,20 +159,15 @@ elm_layout_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_changed_hook_set(obj, _changed_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); - elm_widget_focus_next_hook_set(obj, _elm_layout_focus_next_hook); - elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); wd->lay = edje_object_add(e); elm_widget_resize_object_set(obj, wd->lay); edje_object_signal_callback_add(wd->lay, "size,eval", "elm", - _signal_size_eval, wd); - + _signal_size_eval, obj); + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - _request_sizing_eval(wd); + _request_sizing_eval(obj); return obj; } @@ -351,7 +178,7 @@ elm_layout_add(Evas_Object *parent) * @param file The path to file (edj) that will be used as layout * @param group The group that the layout belongs in edje file * - * @return (1 = success, 0 = error) + * @return (1 = sucess, 0 = error) * * @ingroup Layout */ @@ -362,15 +189,7 @@ elm_layout_file_set(Evas_Object *obj, const char *file, const char *group) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return EINA_FALSE; Eina_Bool ret = edje_object_file_set(wd->lay, file, group); - if (ret) - { - _parts_text_fix(wd); - _request_sizing_eval(wd); - _parts_cursors_apply(wd); - } - else DBG("failed to set edje file '%s', group '%s': %s", - file, group, - edje_load_error_str(edje_object_load_error_get(wd->lay))); + if (ret) _request_sizing_eval(obj); return ret; } @@ -382,7 +201,7 @@ elm_layout_file_set(Evas_Object *obj, const char *file, const char *group) * @param group the group * @param style the style to used * - * @return (1 = success, 0 = error) + * @return (1 = sucess, 0 = error) * * @ingroup Layout */ @@ -396,12 +215,7 @@ elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, cons wd->clas = clas; wd->group = group; wd->style = style; - if (ret) - { - _parts_text_fix(wd); - _request_sizing_eval(wd); - _parts_cursors_apply(wd); - } + if (ret) _request_sizing_eval(obj); return ret; } @@ -428,7 +242,7 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte if (!wd) return; EINA_LIST_FOREACH(wd->subs, l, si) { - if ((si->type == SWALLOW) && (!strcmp(swallow, si->part))) + if (!strcmp(swallow, si->swallow)) { if (content == si->obj) return; evas_object_del(si->obj); @@ -439,43 +253,15 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte { elm_widget_sub_object_add(obj, content); evas_object_event_callback_add(content, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, wd); - if (!edje_object_part_swallow(wd->lay, swallow, content)) - WRN("could not swallow %p into part '%s'", content, swallow); + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->lay, swallow, content); si = ELM_NEW(Subinfo); - si->type = SWALLOW; - si->part = eina_stringshare_add(swallow); + si->swallow = eina_stringshare_add(swallow); si->obj = content; wd->subs = eina_list_append(wd->subs, si); } - _request_sizing_eval(wd); -} - -/** - * Get the swallowed object in the given part - * - * @param obj The layout object - * @param swallow The SWALLOW part to get its content - * - * @return The swallowed object or NULL if none or an error occurred - * - * @ingroup Layout - */ -EAPI const Evas_Object * -elm_layout_content_get(const Evas_Object *obj, const char *swallow) -{ - Widget_Data *wd = elm_widget_data_get(obj); - const Eina_List *l; - Subinfo *si; - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - - EINA_LIST_FOREACH(wd->subs, l, si) - { - if ((si->type == SWALLOW) && !strcmp(swallow, si->part)) - return si->obj; - } - return NULL; + _request_sizing_eval(obj); } /** @@ -499,7 +285,7 @@ elm_layout_content_unset(Evas_Object *obj, const char *swallow) if (!wd) return NULL; EINA_LIST_FOREACH(wd->subs, l, si) { - if ((si->type == SWALLOW) && (!strcmp(swallow, si->part))) + if (!strcmp(swallow, si->swallow)) { Evas_Object *content; if (!si->obj) return NULL; @@ -513,472 +299,6 @@ elm_layout_content_unset(Evas_Object *obj, const char *swallow) } /** - * Set the text of the given part - * - * @param obj The layout object - * @param part The TEXT part where to set the text - * @param text The text to set - * - * @ingroup Layout - */ -EAPI void -elm_layout_text_set(Evas_Object *obj, const char *part, const char *text) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si = NULL; - Eina_List *l; - ELM_CHECK_WIDTYPE(obj, widtype); - - EINA_LIST_FOREACH(wd->subs, l, si) - { - if ((si->type == TEXT) && (!strcmp(part, si->part))) - { - if (!text) - { - eina_stringshare_del(si->part); - eina_stringshare_del(si->p.text.text); - free(si); - edje_object_part_text_set(wd->lay, part, NULL); - wd->subs = eina_list_remove_list(wd->subs, l); - return; - } - else - break; - } - si = NULL; - } - - if (!si) - { - si = ELM_NEW(Subinfo); - if (!si) return; - si->type = TEXT; - si->part = eina_stringshare_add(part); - wd->subs = eina_list_append(wd->subs, si); - } - - eina_stringshare_replace(&si->p.text.text, text); - edje_object_part_text_set(wd->lay, part, text); - _request_sizing_eval(wd); -} - -/** - * Get the text set in the given part - * - * @param obj The layout object - * @param part The TEXT part to retrieve the text off - * - * @return The text set in @p part - * - * @ingroup Layout - */ -EAPI const char * -elm_layout_text_get(const Evas_Object *obj, const char *part) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - return edje_object_part_text_get(wd->lay, part); -} - -/** - * Append child to layout box part. - * - * Once the object is appended, its lifetime will be bound to the - * layout, whenever the layout dies the child will be deleted - * automatically. One should use elm_layout_box_remove() to make this - * layout forget about the object. - * - * @param obj the layout object - * @param part the box part to append. - * @param child the child object to append to box. - * - * @ingroup Layout - */ -EAPI void -elm_layout_box_append(Evas_Object *obj, const char *part, Evas_Object *child) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si; - if (!wd) return; - - if (!edje_object_part_box_append(wd->lay, part, child)) - WRN("child %p could not be appended to box part '%s'", child, part); - elm_widget_sub_object_add(obj, child); - evas_object_event_callback_add - (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd); - - si = ELM_NEW(Subinfo); - si->type = BOX_APPEND; - si->part = eina_stringshare_add(part); - si->obj = child; - wd->subs = eina_list_append(wd->subs, si); - _request_sizing_eval(wd); -} - -/** - * Prepend child to layout box part. - * - * Once the object is prepended, its lifetime will be bound to the - * layout, whenever the layout dies the child will be deleted - * automatically. One should use elm_layout_box_remove() to make this - * layout forget about the object. - * - * @param obj the layout object - * @param part the box part to prepend. - * @param child the child object to prepend to box. - * - * @ingroup Layout - */ -EAPI void -elm_layout_box_prepend(Evas_Object *obj, const char *part, Evas_Object *child) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si; - if (!wd) return; - - if (!edje_object_part_box_prepend(wd->lay, part, child)) - WRN("child %p could not be prepended to box part '%s'", child, part); - elm_widget_sub_object_add(obj, child); - evas_object_event_callback_add - (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd); - - si = ELM_NEW(Subinfo); - si->type = BOX_PREPEND; - si->part = eina_stringshare_add(part); - si->obj = child; - wd->subs = eina_list_prepend(wd->subs, si); - _request_sizing_eval(wd); -} - -static void -_box_reference_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Subinfo *si = data; - si->p.box.reference = NULL; -} - -/** - * Insert child to layout box part before a reference object. - * - * Once the object is inserted, its lifetime will be bound to the - * layout, whenever the layout dies the child will be deleted - * automatically. One should use elm_layout_box_remove() to make this - * layout forget about the object. - * - * @param obj the layout object - * @param part the box part to insert. - * @param child the child object to insert into box. - * @param reference another reference object to insert before in box. - * - * @ingroup Layout - */ -EAPI void -elm_layout_box_insert_before(Evas_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si; - if (!wd) return; - - if (!edje_object_part_box_insert_before(wd->lay, part, child, reference)) - WRN("child %p could not be inserted before %p inf box part '%s'", - child, reference, part); - - si = ELM_NEW(Subinfo); - si->type = BOX_INSERT_BEFORE; - si->part = eina_stringshare_add(part); - si->obj = child; - si->p.box.reference = reference; - - elm_widget_sub_object_add(obj, child); - evas_object_event_callback_add - (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd); - evas_object_event_callback_add - ((Evas_Object *)reference, EVAS_CALLBACK_DEL, _box_reference_del, si); - - wd->subs = eina_list_append(wd->subs, si); - _request_sizing_eval(wd); -} - -/** - * Insert child to layout box part at a given position. - * - * Once the object is inserted, its lifetime will be bound to the - * layout, whenever the layout dies the child will be deleted - * automatically. One should use elm_layout_box_remove() to make this - * layout forget about the object. - * - * @param obj the layout object - * @param part the box part to insert. - * @param child the child object to insert into box. - * @param pos the numeric position >=0 to insert the child. - * - * @ingroup Layout - */ -EAPI void -elm_layout_box_insert_at(Evas_Object *obj, const char *part, Evas_Object *child, unsigned int pos) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si; - if (!wd) return; - - if (!edje_object_part_box_insert_at(wd->lay, part, child, pos)) - WRN("child %p could not be inserted at %u to box part '%s'", - child, pos, part); - - elm_widget_sub_object_add(obj, child); - evas_object_event_callback_add - (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd); - - si = ELM_NEW(Subinfo); - si->type = BOX_INSERT_AT; - si->part = eina_stringshare_add(part); - si->obj = child; - si->p.box.pos = pos; - wd->subs = eina_list_append(wd->subs, si); - _request_sizing_eval(wd); -} - -static Evas_Object * -_sub_box_remove(Widget_Data *wd, Subinfo *si) -{ - Evas_Object *child; - - if (si->type == BOX_INSERT_BEFORE) - evas_object_event_callback_del_full - ((Evas_Object *)si->p.box.reference, - EVAS_CALLBACK_DEL, _box_reference_del, si); - - child = si->obj; /* si will die in _sub_del due elm_widget_sub_object_del() */ - edje_object_part_box_remove(wd->lay, si->part, child); - elm_widget_sub_object_del(wd->obj, child); - return child; -} - -static Evas_Object * -_sub_table_remove(Widget_Data *wd, Subinfo *si) -{ - Evas_Object *child; - - child = si->obj; /* si will die in _sub_del due elm_widget_sub_object_del() */ - edje_object_part_table_unpack(wd->lay, si->part, child); - elm_widget_sub_object_del(wd->obj, child); - return child; -} - -static Eina_Bool -_sub_box_is(const Subinfo *si) -{ - switch (si->type) - { - case BOX_APPEND: - case BOX_PREPEND: - case BOX_INSERT_BEFORE: - case BOX_INSERT_AT: - return EINA_TRUE; - default: - return EINA_FALSE; - } -} - -/** - * Remove a child of the given part box. - * - * The object will be removed from the box part and its lifetime will - * not be handled by the layout anymore. This is equivalent to - * elm_layout_content_unset() for box. - * - * @param obj The layout object - * @param part The box part name to remove child. - * @param child The object to remove from box. - * @return The object that was being used, or NULL if not found. - * - * @ingroup Layout - */ -EAPI Evas_Object * -elm_layout_box_remove(Evas_Object *obj, const char *part, Evas_Object *child) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - const Eina_List *l; - Subinfo *si; - - if (!wd) return NULL; - - EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(child, NULL); - EINA_LIST_FOREACH(wd->subs, l, si) - { - if (!_sub_box_is(si)) continue; - if ((si->obj == child) && (!strcmp(si->part, part))) - return _sub_box_remove(wd, si); - } - return NULL; -} - -/** - * Remove all child of the given part box. - * - * The objects will be removed from the box part and their lifetime will - * not be handled by the layout anymore. This is equivalent to - * elm_layout_content_unset() for all box children. - * - * @param obj The layout object - * @param part The box part name to remove child. - * @param clear If EINA_TRUE, then all objects will be deleted as - * well, otherwise they will just be removed and will be - * dangling on the canvas. - * - * @ingroup Layout - */ -EAPI void -elm_layout_box_remove_all(Evas_Object *obj, const char *part, Eina_Bool clear) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si; - Eina_List *lst; - - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(part); - - lst = eina_list_clone(wd->subs); - EINA_LIST_FREE(lst, si) - { - if (!_sub_box_is(si)) continue; - if (!strcmp(si->part, part)) - { - Evas_Object *child = _sub_box_remove(wd, si); - if ((clear) && (child)) evas_object_del(child); - } - } - /* eventually something may not be added with layout, del them as well */ - edje_object_part_box_remove_all(wd->lay, part, clear); -} - -/** - * Insert child to layout table part. - * - * Once the object is inserted, its lifetime will be bound to the - * layout, whenever the layout dies the child will be deleted - * automatically. One should use elm_layout_box_remove() to make this - * layout forget about the object. - * - * @param obj the layout object - * @param part the box part to pack child. - * @param child the child object to pack into table. - * @param reference another reference object to insert before in box. - * - * @ingroup Layout - */ -EAPI void -elm_layout_table_pack(Evas_Object *obj, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si; - if (!wd) return; - - if (!edje_object_part_table_pack - (wd->lay, part, child, col, row, colspan, rowspan)) - WRN("child %p could not be packed into box part '%s' col=%uh, row=%hu, " - "colspan=%hu, rowspan=%hu", child, part, col, row, colspan, rowspan); - - elm_widget_sub_object_add(obj, child); - evas_object_event_callback_add - (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd); - - si = ELM_NEW(Subinfo); - si->type = TABLE_PACK; - si->part = eina_stringshare_add(part); - si->obj = child; - si->p.table.col = col; - si->p.table.row = row; - si->p.table.colspan = colspan; - si->p.table.rowspan = rowspan; - wd->subs = eina_list_append(wd->subs, si); - _request_sizing_eval(wd); -} - -/** - * Unpack (remove) a child of the given part table. - * - * The object will be unpacked from the table part and its lifetime - * will not be handled by the layout anymore. This is equivalent to - * elm_layout_content_unset() for table. - * - * @param obj The layout object - * @param part The table part name to remove child. - * @param child The object to remove from table. - * @return The object that was being used, or NULL if not found. - * - * @ingroup Layout - */ -EAPI Evas_Object * -elm_layout_table_unpack(Evas_Object *obj, const char *part, Evas_Object *child) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - const Eina_List *l; - Subinfo *si; - - if (!wd) return NULL; - - EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(child, NULL); - EINA_LIST_FOREACH(wd->subs, l, si) - { - if (si->type != TABLE_PACK) continue; - if ((si->obj == child) && (!strcmp(si->part, part))) - return _sub_table_remove(wd, si); - } - return NULL; -} - -/** - * Remove all child of the given part table. - * - * The objects will be removed from the table part and their lifetime will - * not be handled by the layout anymore. This is equivalent to - * elm_layout_content_unset() for all table children. - * - * @param obj The layout object - * @param part The table part name to remove child. - * @param clear If EINA_TRUE, then all objects will be deleted as - * well, otherwise they will just be removed and will be - * dangling on the canvas. - * - * @ingroup Layout - */ -EAPI void -elm_layout_table_clear(Evas_Object *obj, const char *part, Eina_Bool clear) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - Subinfo *si; - Eina_List *lst; - - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(part); - - lst = eina_list_clone(wd->subs); - EINA_LIST_FREE(lst, si) - { - if (si->type != TABLE_PACK) continue; - if (!strcmp(si->part, part)) - { - Evas_Object *child = _sub_table_remove(wd, si); - if ((clear) && (child)) evas_object_del(child); - } - } - /* eventually something may not be added with layout, del them as well */ - edje_object_part_table_clear(wd->lay, part, clear); -} - -/** * Get the edje layout * * @param obj The layout object @@ -987,7 +307,7 @@ elm_layout_table_clear(Evas_Object *obj, const char *part, Eina_Bool clear) * objects via edje_object_part_swallow() for example. Use * elm_layout_content_set() instead so child object handling and sizing is * done properly. This is more intended for setting text, emitting signals, - * hooking to signal callbacks etc. + * hooking to singal callbacks etc. * * @return A Evas_Object with the edje layout settings loaded * with function elm_layout_file_set @@ -1004,7 +324,7 @@ elm_layout_edje_get(const Evas_Object *obj) } /** - * Eval sizing + * Get the edje layout * * Manually forms a sizing re-evaluation when contents changed state so that * minimum size might have changed and needs re-evaluation. Also note that @@ -1019,224 +339,5 @@ EAPI void elm_layout_sizing_eval(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN(wd); - _request_sizing_eval(wd); -} - -/** - * Sets a specific cursor for an edje part. - * - * @param obj The layout object. - * @param part_name a part from loaded edje group. - * @param cursor cursor name to use, see Elementary_Cursor.h - * - * @return EINA_TRUE on success or EINA_FALSE on failure, that may be - * part not exists or it has "mouse_events: 0". - * - * @ingroup Layout - */ -EAPI Eina_Bool -elm_layout_part_cursor_set(Evas_Object *obj, const char *part_name, const char *cursor) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN_VAL(wd, EINA_FALSE); - Evas_Object *part_obj; - Part_Cursor *pc; - - part_obj = (Evas_Object *)edje_object_part_object_get(wd->lay, part_name); - if (!part_obj) - { - const char *group, *file; - edje_object_file_get(wd->lay, &file, &group); - WRN("no part '%s' in group '%s' of file '%s'. Cannot set cursor '%s'", - part_name, group, file, cursor); - return EINA_FALSE; - } - if (evas_object_pass_events_get(part_obj)) - { - const char *group, *file; - edje_object_file_get(wd->lay, &file, &group); - WRN("part '%s' in group '%s' of file '%s' has mouse_events: 0. " - "Cannot set cursor '%s'", - part_name, group, file, cursor); - return EINA_FALSE; - } - - pc = _parts_cursors_find(wd, part_name); - if (pc) eina_stringshare_replace(&pc->cursor, cursor); - else - { - pc = calloc(1, sizeof(*pc)); - pc->part = eina_stringshare_add(part_name); - pc->cursor = eina_stringshare_add(cursor); - } - - pc->obj = part_obj; - elm_object_sub_cursor_set(part_obj, obj, pc->cursor); - return EINA_TRUE; -} - -/** - * Get the cursor to be shown when mouse is over an edje part - * - * @param obj The layout object. - * @param part_name a part from loaded edje group. - * @return the cursor name. - * - * @ingroup Layout - */ -EAPI const char * -elm_layout_part_cursor_get(const Evas_Object *obj, const char *part_name) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, NULL); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN_VAL(wd, NULL); - Part_Cursor *pc = _parts_cursors_find(wd, part_name); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc, NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, NULL); - return elm_object_cursor_get(pc->obj); -} - -/** - * Unsets a cursor previously set with elm_layout_part_cursor_set(). - * - * @param obj The layout object. - * @param part_name a part from loaded edje group, that had a cursor set - * with elm_layout_part_cursor_set(). - * - * @ingroup Layout - */ -EAPI void -elm_layout_part_cursor_unset(Evas_Object *obj, const char *part_name) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - EINA_SAFETY_ON_NULL_RETURN(part_name); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN(wd); - Eina_List *l; - Part_Cursor *pc; - - EINA_LIST_FOREACH(wd->parts_cursors, l, pc) - { - if (!strcmp(part_name, pc->part)) - { - if (pc->obj) elm_object_cursor_unset(pc->obj); - _part_cursor_free(pc); - wd->parts_cursors = eina_list_remove_list(wd->parts_cursors, l); - return; - } - } -} - -/** - * Sets a specific cursor style for an edje part. - * - * @param obj The layout object. - * @param part_name a part from loaded edje group. - * @param style the theme style to use (default, transparent, ...) - * - * @return EINA_TRUE on success or EINA_FALSE on failure, that may be - * part not exists or it did not had a cursor set. - * - * @ingroup Layout - */ -EAPI Eina_Bool -elm_layout_part_cursor_style_set(Evas_Object *obj, const char *part_name, const char *style) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN_VAL(wd, EINA_FALSE); - Part_Cursor *pc = _parts_cursors_find(wd, part_name); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, EINA_FALSE); - - eina_stringshare_replace(&pc->style, style); - elm_object_cursor_style_set(pc->obj, pc->style); - return EINA_TRUE; -} - -/** - * Gets a specific cursor style for an edje part. - * - * @param obj The layout object. - * @param part_name a part from loaded edje group. - * - * @return the theme style in use, defaults to "default". If the - * object does not have a cursor set, then NULL is returned. - * - * @ingroup Layout - */ -EAPI const char * -elm_layout_part_cursor_style_get(const Evas_Object *obj, const char *part_name) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, NULL); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN_VAL(wd, NULL); - Part_Cursor *pc = _parts_cursors_find(wd, part_name); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc, NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, NULL); - return elm_object_cursor_style_get(pc->obj); -} - -/** - * Sets if the cursor set should be searched on the theme or should use - * the provided by the engine, only. - * - * @note before you set if should look on theme you should define a - * cursor with elm_layout_part_cursor_set(). By default it will only - * look for cursors provided by the engine. - * - * @param obj The layout object. - * @param part_name a part from loaded edje group. - * @param engine_only if cursors should be just provided by the engine - * or should also search on widget's theme as well - * - * @return EINA_TRUE on success or EINA_FALSE on failure, that may be - * part not exists or it did not had a cursor set. - * - * @ingroup Layout - */ -EAPI Eina_Bool -elm_layout_part_cursor_engine_only_set(Evas_Object *obj, const char *part_name, Eina_Bool engine_only) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN_VAL(wd, EINA_FALSE); - Part_Cursor *pc = _parts_cursors_find(wd, part_name); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, EINA_FALSE); - - pc->engine_only = !!engine_only; - elm_object_cursor_engine_only_set(pc->obj, pc->engine_only); - return EINA_TRUE; -} - -/** - * Gets a specific cursor engine_only for an edje part. - * - * @param obj The layout object. - * @param part_name a part from loaded edje group. - * - * @return whenever the cursor is just provided by engine or also from theme. - * - * @ingroup Layout - */ -EAPI Eina_Bool -elm_layout_part_cursor_engine_only_get(const Evas_Object *obj, const char *part_name) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE); - Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_NULL_RETURN_VAL(wd, EINA_FALSE); - Part_Cursor *pc = _parts_cursors_find(wd, part_name); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, EINA_FALSE); - return elm_object_cursor_engine_only_get(pc->obj); + _request_sizing_eval(obj); } diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index fa5d289..39af398 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -1,8 +1,6 @@ #include #include "elm_priv.h" -#define SWIPE_MOVES 12 - /** * @defgroup List List * @ingroup Elementary @@ -17,19 +15,9 @@ struct _Widget_Data { Evas_Object *scr, *box, *self; Eina_List *items, *selected, *to_delete; - Elm_List_Item *last_selected_item; Elm_List_Mode mode; - Elm_List_Mode h_mode; Evas_Coord minw[2], minh[2]; - Eina_Bool scr_minw : 1; - Eina_Bool scr_minh : 1; int walking; - int movements; - struct - { - Evas_Coord x, y; - } history[SWIPE_MOVES]; - Eina_Bool swipe : 1; Eina_Bool fix_pending : 1; Eina_Bool on_hold : 1; Eina_Bool multi : 1; @@ -40,16 +28,15 @@ struct _Widget_Data struct _Elm_List_Item { - Elm_Widget_Item base; - Widget_Data *wd; Eina_List *node; + Evas_Object *obj, *base; const char *label; Evas_Object *icon, *end; Evas_Smart_Cb func; + Evas_Smart_Cb del_cb; + const void *data; Ecore_Timer *long_timer; - Ecore_Timer *swipe_timer; Eina_Bool deleted : 1; - Eina_Bool disabled : 1; Eina_Bool even : 1; Eina_Bool is_even : 1; Eina_Bool is_separator : 1; @@ -64,301 +51,63 @@ static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); -static void _disable_hook(Evas_Object *obj); static void _on_focus_hook(void *data, Evas_Object *obj); -static void _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _fix_items(Evas_Object *obj); static void _mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info); -static void _scroll_edge_left(void *data, Evas_Object *scr, void *event_info); -static void _scroll_edge_right(void *data, Evas_Object *scr, void *event_info); -static void _scroll_edge_top(void *data, Evas_Object *scr, void *event_info); -static void _scroll_edge_bottom(void *data, Evas_Object *scr, void *event_info); -static Eina_Bool _item_multi_select_up(Widget_Data *wd); -static Eina_Bool _item_multi_select_down(Widget_Data *wd); -static Eina_Bool _item_single_select_up(Widget_Data *wd); -static Eina_Bool _item_single_select_down(Widget_Data *wd); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); -static Eina_Bool _deselect_all_items(Widget_Data *wd); #define ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ...) \ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \ - if (it->deleted) \ + if (!it) \ + { \ + fprintf(stderr, "ERROR: %s:%d:%s() "#it" is NULL.\n", \ + __FILE__, __LINE__, __FUNCTION__); \ + return __VA_ARGS__; \ + } \ + else if (it->deleted) \ { \ - ERR("ERROR: "#it" has been DELETED.\n"); \ + fprintf(stderr, "ERROR: %s:%d:%s() "#it" has been DELETED.\n", \ + __FILE__, __LINE__, __FUNCTION__); \ return __VA_ARGS__; \ } + + +static inline void +_elm_list_item_call_del_cb(Elm_List_Item *it) +{ + if (it->del_cb) it->del_cb((void *)it->data, it->obj, it); +} + static inline void _elm_list_item_free(Elm_List_Item *it) { evas_object_event_callback_del_full - (it->base.view, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it); + (it->base, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it); evas_object_event_callback_del_full - (it->base.view, EVAS_CALLBACK_MOUSE_UP, _mouse_up, it); + (it->base, EVAS_CALLBACK_MOUSE_UP, _mouse_up, it); evas_object_event_callback_del_full - (it->base.view, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it); + (it->base, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it); if (it->icon) evas_object_event_callback_del_full (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, it->base.widget); + _changed_size_hints, it->obj); if (it->end) evas_object_event_callback_del_full (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, it->base.widget); + _changed_size_hints, it->obj); eina_stringshare_del(it->label); - if (it->swipe_timer) ecore_timer_del(it->swipe_timer); if (it->long_timer) ecore_timer_del(it->long_timer); if (it->icon) evas_object_del(it->icon); if (it->end) evas_object_del(it->end); - - elm_widget_item_del(it); -} - -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (!wd->items) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - - Elm_List_Item *it = NULL; - Evas_Coord x = 0; - Evas_Coord y = 0; - Evas_Coord step_x = 0; - Evas_Coord step_y = 0; - Evas_Coord v_w = 0; - Evas_Coord v_h = 0; - Evas_Coord page_x = 0; - Evas_Coord page_y = 0; - - elm_smart_scroller_child_pos_get(wd->scr, &x, &y); - elm_smart_scroller_step_size_get(wd->scr, &step_x, &step_y); - elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y); - elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); - - /* TODO: fix logic for horizontal mode */ - if ((!strcmp(ev->keyname, "Left")) || - (!strcmp(ev->keyname, "KP_Left"))) - { - if ((wd->h_mode) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_up(wd))) - || (_item_single_select_up(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - x -= step_x; - } - else if ((!strcmp(ev->keyname, "Right")) || - (!strcmp(ev->keyname, "KP_Right"))) - { - if ((wd->h_mode) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_down(wd))) - || (_item_single_select_down(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - x += step_x; - } - else if ((!strcmp(ev->keyname, "Up")) || - (!strcmp(ev->keyname, "KP_Up"))) - { - if ((!wd->h_mode) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_up(wd))) - || (_item_single_select_up(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - y -= step_y; - } - else if ((!strcmp(ev->keyname, "Down")) || - (!strcmp(ev->keyname, "KP_Down"))) - { - if ((!wd->h_mode) && - (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && - (_item_multi_select_down(wd))) - || (_item_single_select_down(wd)))) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else - y += step_y; - } - else if ((!strcmp(ev->keyname, "Home")) || - (!strcmp(ev->keyname, "KP_Home"))) - { - it = eina_list_data_get(wd->items); - elm_list_item_bring_in(it); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!strcmp(ev->keyname, "End")) || - (!strcmp(ev->keyname, "KP_End"))) - { - it = eina_list_data_get(eina_list_last(wd->items)); - elm_list_item_bring_in(it); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!strcmp(ev->keyname, "Prior")) || - (!strcmp(ev->keyname, "KP_Prior"))) - { - if (wd->h_mode) - { - if (page_x < 0) - x -= -(page_x * v_w) / 100; - else - x -= page_x; - } - else - { - if (page_y < 0) - y -= -(page_y * v_h) / 100; - else - y -= page_y; - } - } - else if ((!strcmp(ev->keyname, "Next")) || - (!strcmp(ev->keyname, "KP_Next"))) - { - if (wd->h_mode) - { - if (page_x < 0) - x += -(page_x * v_w) / 100; - else - x += page_x; - } - else - { - if (page_y < 0) - y += -(page_y * v_h) / 100; - else - y += page_y; - } - } - else if (!strcmp(ev->keyname, "Escape")) - { - if (!_deselect_all_items(wd)) return EINA_FALSE; - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else return EINA_FALSE; - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - elm_smart_scroller_child_pos_set(wd->scr, x, y); - return EINA_TRUE; -} - -static Eina_Bool -_deselect_all_items(Widget_Data *wd) -{ - if (!wd->selected) return EINA_FALSE; - while(wd->selected) - elm_list_item_selected_set(wd->selected->data, EINA_FALSE); - - return EINA_TRUE; -} - -static Eina_Bool -_item_multi_select_up(Widget_Data *wd) -{ - if (!wd->selected) return EINA_FALSE; - if (!wd->multi) return EINA_FALSE; - - Elm_List_Item *prev = elm_list_item_prev(wd->last_selected_item); - if (!prev) return EINA_TRUE; - - if (elm_list_item_selected_get(prev)) - { - elm_list_item_selected_set(wd->last_selected_item, EINA_FALSE); - wd->last_selected_item = prev; - elm_list_item_show(wd->last_selected_item); - } - else - { - elm_list_item_selected_set(prev, EINA_TRUE); - elm_list_item_show(prev); - } - return EINA_TRUE; -} - -static Eina_Bool -_item_multi_select_down(Widget_Data *wd) -{ - if (!wd->selected) return EINA_FALSE; - if (!wd->multi) return EINA_FALSE; - - Elm_List_Item *next = elm_list_item_next(wd->last_selected_item); - if (!next) return EINA_TRUE; - - if (elm_list_item_selected_get(next)) - { - elm_list_item_selected_set(wd->last_selected_item, EINA_FALSE); - wd->last_selected_item = next; - elm_list_item_show(wd->last_selected_item); - } - else - { - elm_list_item_selected_set(next, EINA_TRUE); - elm_list_item_show(next); - } - return EINA_TRUE; -} - -static Eina_Bool -_item_single_select_up(Widget_Data *wd) -{ - Elm_List_Item *prev; - - if (!wd->selected) prev = eina_list_data_get(eina_list_last(wd->items)); - else prev = elm_list_item_prev(wd->last_selected_item); - - if (!prev) return EINA_FALSE; - - _deselect_all_items(wd); - - elm_list_item_selected_set(prev, EINA_TRUE); - elm_list_item_show(prev); - return EINA_TRUE; -} - -static Eina_Bool -_item_single_select_down(Widget_Data *wd) -{ - Elm_List_Item *next; - - if (!wd->selected) next = eina_list_data_get(wd->items); - else next = elm_list_item_next(wd->last_selected_item); - - if (!next) return EINA_FALSE; - - _deselect_all_items(wd); - - elm_list_item_selected_set(next, EINA_TRUE); - elm_list_item_show(next); - return EINA_TRUE; + if (it->base) evas_object_del(it->base); + free(it); } static void @@ -370,10 +119,10 @@ _elm_list_process_deletions(Widget_Data *wd) EINA_LIST_FREE(wd->to_delete, it) { - elm_widget_item_pre_notify_del(it); + _elm_list_item_call_del_cb(it); - wd->items = eina_list_remove_list(wd->items, it->node); - _elm_list_item_free(it); + wd->items = eina_list_remove_list(wd->items, it->node); + _elm_list_item_free(it); } wd->walking--; @@ -384,7 +133,7 @@ _elm_list_walk(Widget_Data *wd) { if (wd->walking < 0) { - ERR("ERROR: walking was negative. fixed!\n"); + fprintf(stderr, "ERROR: walking was negative. fixed!\n"); wd->walking = 0; } wd->walking++; @@ -396,7 +145,7 @@ _elm_list_unwalk(Widget_Data *wd) wd->walking--; if (wd->walking < 0) { - ERR("ERROR: walking became negative. fixed!\n"); + fprintf(stderr, "ERROR: walking became negative. fixed!\n"); wd->walking = 0; } @@ -408,9 +157,9 @@ _elm_list_unwalk(Widget_Data *wd) if (wd->fix_pending) { - wd->fix_pending = EINA_FALSE; - _fix_items(wd->self); - _sizing_eval(wd->self); + wd->fix_pending = EINA_FALSE; + _fix_items(wd->self); + _sizing_eval(wd->self); } } @@ -422,14 +171,13 @@ _del_hook(Evas_Object *obj) Eina_List *n; if (!wd) return; - if (wd->walking) - ERR("ERROR: list deleted while walking.\n"); + if (wd->walking != 0) + fprintf(stderr, "ERROR: list deleted while walking.\n"); _elm_list_walk(wd); - EINA_LIST_FOREACH(wd->items, n, it) elm_widget_item_pre_notify_del(it); + EINA_LIST_FOREACH(wd->items, n, it) _elm_list_item_call_del_cb(it); _elm_list_unwalk(wd); - if (wd->to_delete) - ERR("ERROR: leaking nodes!\n"); + if (wd->to_delete) fprintf(stderr, "ERROR: leaking nodes!\n"); EINA_LIST_FREE(wd->items, it) _elm_list_item_free(it); eina_list_free(wd->selected); @@ -437,102 +185,18 @@ _del_hook(Evas_Object *obj) } static void -_show_region_hook(void *data, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(data); - Evas_Coord x, y, w, h; - elm_widget_show_region_get(obj, &x, &y, &w, &h); - elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); -} - -static void -_disable_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_disabled_get(obj)) - { - _signal_emit_hook(obj, "elm,state,disabled", "elm"); - elm_widget_scroll_freeze_push(obj); - elm_widget_scroll_hold_push(obj); - /* FIXME: if we get to have a way to only un-hilight items - * in the future, keeping them selected... */ - _deselect_all_items(wd); - } - else - { - _signal_emit_hook(obj, "elm,state,enabled", "elm"); - elm_widget_scroll_freeze_pop(obj); - elm_widget_scroll_hold_pop(obj); - } -} - -static void _sizing_eval(Evas_Object *obj) { - Widget_Data *wd = elm_widget_data_get(obj); + Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; if (!wd) return; - Evas_Coord vw, vh, minw, minh, maxw, maxh, w, h, vmw, vmh; - double xw, yw; - - evas_object_size_hint_min_get(wd->box, &minw, &minh); - evas_object_size_hint_max_get(wd->box, &maxw, &maxh); - evas_object_size_hint_weight_get(wd->box, &xw, &yw); - if (!wd->scr) return; - elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); - if (xw > 0.0) - { - if ((minw > 0) && (vw < minw)) vw = minw; - else if ((maxw > 0) && (vw > maxw)) vw = maxw; - } - else if (minw > 0) vw = minw; - if (yw > 0.0) + if (wd->scr) { - if ((minh > 0) && (vh < minh)) vh = minh; - else if ((maxh > 0) && (vh > maxh)) vh = maxh; + evas_object_size_hint_min_get(wd->scr, &minw, &minh); + evas_object_size_hint_max_get(wd->scr, &maxw, &maxh); + evas_object_size_hint_min_set(obj, minw, minh); + evas_object_size_hint_max_set(obj, maxw, maxh); } - else if (minh > 0) vh = minh; - evas_object_resize(wd->box, vw, vh); - w = -1; - h = -1; - edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), - &vmw, &vmh); - if (wd->scr_minw) w = vmw + minw; - if (wd->scr_minh) h = vmh + minh; - - evas_object_size_hint_max_get(obj, &maxw, &maxh); - if ((maxw > 0) && (w > maxw)) - w = maxw; - if ((maxh > 0) && (h > maxh)) - h = maxh; - - evas_object_size_hint_min_set(obj, w, h); -} - -static void -_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), - emission, source); -} - -static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr), - emission, source, func_cb, data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_del_full( - elm_smart_scroller_edje_object_get(wd->scr), - emission, source, func_cb, data); } static void @@ -545,23 +209,12 @@ _theme_hook(Evas_Object *obj) if (!wd) return; if (wd->scr) { - Evas_Object *edj; - const char *str; - - elm_smart_scroller_object_theme_set(obj, wd->scr, "list", "base", - elm_widget_style_get(obj)); -// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); - edj = elm_smart_scroller_edje_object_get(wd->scr); - str = edje_object_data_get(edj, "focus_highlight"); - if ((str) && (!strcmp(str, "on"))) - elm_widget_highlight_in_theme_set(obj, EINA_TRUE); - else - elm_widget_highlight_in_theme_set(obj, EINA_FALSE); + elm_scroller_custom_widget_base_theme_set(wd->scr, "list", "base"); elm_object_style_set(wd->scr, elm_widget_style_get(obj)); +// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); } EINA_LIST_FOREACH(wd->items, n, it) { - edje_object_scale_set(it->base.view, elm_widget_scale_get(obj) * _elm_config->scale); it->fixed = 0; } _fix_items(obj); @@ -574,18 +227,9 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->self, "elm,action,focus", "elm"); - evas_object_focus_set(wd->self, EINA_TRUE); - - if ((wd->selected) && (!wd->last_selected_item)) - wd->last_selected_item = eina_list_data_get(wd->selected); - } + evas_object_focus_set(wd->scr, 1); else - { - edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->self, EINA_FALSE); - } + evas_object_focus_set(wd->scr, 0); } static void @@ -593,8 +237,8 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - _fix_items(data); - _sizing_eval(data); +// _fix_items(data); +// _sizing_eval(data); } static void @@ -636,7 +280,7 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) static void _item_hilight(Elm_List_Item *it) { - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); const char *selectraise; if (!wd) return; @@ -644,10 +288,10 @@ _item_hilight(Elm_List_Item *it) if (it->hilighted) return; _elm_list_walk(wd); - edje_object_signal_emit(it->base.view, "elm,state,selected", "elm"); - selectraise = edje_object_data_get(it->base.view, "selectraise"); + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); + selectraise = edje_object_data_get(it->base, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) - evas_object_raise(it->base.view); + evas_object_raise(it->base); it->hilighted = EINA_TRUE; _elm_list_unwalk(wd); @@ -656,31 +300,30 @@ _item_hilight(Elm_List_Item *it) static void _item_select(Elm_List_Item *it) { - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); if (!wd) return; ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (it->selected) { - if (wd->always_select) goto call; - return; + if (wd->always_select) goto call; + return; } it->selected = EINA_TRUE; wd->selected = eina_list_append(wd->selected, it); call: _elm_list_walk(wd); - if (it->func) it->func((void *)it->base.data, it->base.widget, it); - evas_object_smart_callback_call(it->base.widget, "selected", it); + if (it->func) it->func((void *)it->data, it->obj, it); + evas_object_smart_callback_call(it->obj, "selected", it); _elm_list_unwalk(wd); - it->wd->last_selected_item = it; } static void _item_unselect(Elm_List_Item *it) { - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); const char *stacking, *selectraise; if (!wd) return; @@ -688,52 +331,39 @@ _item_unselect(Elm_List_Item *it) if (!it->hilighted) return; _elm_list_walk(wd); - edje_object_signal_emit(it->base.view, "elm,state,unselected", "elm"); - stacking = edje_object_data_get(it->base.view, "stacking"); - selectraise = edje_object_data_get(it->base.view, "selectraise"); + edje_object_signal_emit(it->base, "elm,state,unselected", "elm"); + stacking = edje_object_data_get(it->base, "stacking"); + selectraise = edje_object_data_get(it->base, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) { - if ((stacking) && (!strcmp(stacking, "below"))) - evas_object_lower(it->base.view); + if ((stacking) && (!strcmp(stacking, "below"))) + evas_object_lower(it->base); } it->hilighted = EINA_FALSE; if (it->selected) { - it->selected = EINA_FALSE; - wd->selected = eina_list_remove(wd->selected, it); - evas_object_smart_callback_call(it->base.widget, "unselected", it); + it->selected = EINA_FALSE; + wd->selected = eina_list_remove(wd->selected, it); + evas_object_smart_callback_call(it->obj, "unselected", it); } _elm_list_unwalk(wd); } -static Eina_Bool -_swipe_cancel(void *data) -{ - Elm_List_Item *it = data; - Widget_Data *wd = elm_widget_data_get(it->base.widget); - - if (!wd) return ECORE_CALLBACK_CANCEL; - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL); - wd->swipe = EINA_FALSE; - wd->movements = 0; - return ECORE_CALLBACK_RENEW; -} - static void _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_List_Item *it = data; - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Event_Mouse_Move *ev = event_info; if (!wd) return; ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) { - if (!wd->on_hold) - { - wd->on_hold = EINA_TRUE; + if (!wd->on_hold) + { + wd->on_hold = EINA_TRUE; if (it->long_timer) { ecore_timer_del(it->long_timer); @@ -741,96 +371,29 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void } if (!wd->wasselected) _item_unselect(it); - } - if (wd->movements == SWIPE_MOVES) wd->swipe = EINA_TRUE; - else - { - wd->history[wd->movements].x = ev->cur.canvas.x; - wd->history[wd->movements].y = ev->cur.canvas.y; - if (abs((wd->history[wd->movements].x - wd->history[0].x)) > 40) - wd->swipe = EINA_TRUE; - else - wd->movements++; - } + } } } -static void -_scroll_edge_left(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *obj = data; - evas_object_smart_callback_call(obj, "scroll,edge,left", NULL); -} - -static void -_scroll_edge_right(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *obj = data; - evas_object_smart_callback_call(obj, "scroll,edge,right", NULL); -} - -static void -_scroll_edge_top(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *obj = data; - evas_object_smart_callback_call(obj, "scroll,edge,top", NULL); -} - -static void -_scroll_edge_bottom(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *obj = data; - evas_object_smart_callback_call(obj, "scroll,edge,bottom", NULL); -} - static Eina_Bool _long_press(void *data) { Elm_List_Item *it = data; - Widget_Data *wd = elm_widget_data_get(it->base.widget); - - if (!wd) - goto end; - - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL); + Widget_Data *wd = elm_widget_data_get(it->obj); + if (!wd) return ECORE_CALLBACK_CANCEL; it->long_timer = NULL; - - if (it->disabled) - goto end; - + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, 0); wd->longpressed = EINA_TRUE; - evas_object_smart_callback_call(it->base.widget, "longpressed", it); - - end: + evas_object_smart_callback_call(it->obj, "longpressed", it); return ECORE_CALLBACK_CANCEL; } static void -_swipe(Elm_List_Item *it) -{ - int i, sum = 0; - Widget_Data *wd = elm_widget_data_get(it->base.widget); - - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - if (!wd) return; - wd->swipe = EINA_FALSE; - for (i = 0; i < wd->movements; i++) - { - sum += wd->history[i].x; - if (abs(wd->history[0].y - wd->history[i].y) > 10) return; - } - - sum /= wd->movements; - if (abs(sum - wd->history[0].x) <= 10) return; - evas_object_smart_callback_call(it->base.widget, "swipe", it); -} - -static void _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_List_Item *it = data; - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Event_Mouse_Down *ev = event_info; if (!wd) return; @@ -844,20 +407,16 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void wd->longpressed = EINA_FALSE; if (it->long_timer) ecore_timer_del(it->long_timer); it->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, it); - if (it->swipe_timer) ecore_timer_del(it->swipe_timer); - it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it); /* Always call the callbacks last - the user may delete our context! */ if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) - evas_object_smart_callback_call(it->base.widget, "clicked", it); - wd->swipe = EINA_FALSE; - wd->movements = 0; + evas_object_smart_callback_call(it->obj, "clicked", it); } static void _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Elm_List_Item *it = data; - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Event_Mouse_Up *ev = event_info; if (!wd) return; @@ -871,16 +430,10 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * ecore_timer_del(it->long_timer); it->long_timer = NULL; } - if (it->swipe_timer) - { - ecore_timer_del(it->swipe_timer); - it->swipe_timer = NULL; - } if (wd->on_hold) { - if (wd->swipe) _swipe(data); - wd->on_hold = EINA_FALSE; - return; + wd->on_hold = EINA_FALSE; + return; } if (wd->longpressed) { @@ -889,40 +442,38 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * return; } - if (it->disabled) - return; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; - + if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; + _elm_list_walk(wd); // watch out "return" before unwalk! if (wd->multi) { - if (!it->selected) - { - _item_hilight(it); - _item_select(it); - } - else _item_unselect(it); + if (!it->selected) + { + _item_hilight(it); + _item_select(it); + } + else _item_unselect(it); } else { - if (!it->selected) - { - while (wd->selected) - _item_unselect(wd->selected->data); - _item_hilight(it); - _item_select(it); - } - else - { - const Eina_List *l, *l_next; - Elm_List_Item *it2; + if (!it->selected) + { + while (wd->selected) + _item_unselect(wd->selected->data); + _item_hilight(it); + _item_select(it); + } + else + { + const Eina_List *l, *l_next; + Elm_List_Item *it2; - EINA_LIST_FOREACH_SAFE(wd->selected, l, l_next, it2) - if (it2 != it) _item_unselect(it2); - _item_hilight(it); - _item_select(it); - } + EINA_LIST_FOREACH_SAFE(wd->selected, l, l_next, it2) + if (it2 != it) _item_unselect(it2); + _item_hilight(it); + _item_select(it); + } } _elm_list_unwalk(wd); @@ -935,71 +486,38 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e Elm_List_Item *it; if (!wd) return NULL; - it = elm_widget_item_new(obj, Elm_List_Item); - it->wd = wd; + it = calloc(1, sizeof(Elm_List_Item)); + it->obj = obj; it->label = eina_stringshare_add(label); it->icon = icon; it->end = end; it->func = func; - it->base.data = data; - it->base.view = edje_object_add(evas_object_evas_get(obj)); - evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_DOWN, - _mouse_down, it); - evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_UP, - _mouse_up, it); - evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_MOVE, - _mouse_move, it); - evas_object_size_hint_weight_set(it->base.view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(it->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL); + it->data = data; + it->base = edje_object_add(evas_object_evas_get(obj)); + evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_DOWN, + _mouse_down, it); + evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_UP, + _mouse_up, it); + evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_MOVE, + _mouse_move, it); + evas_object_size_hint_weight_set(it->base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(it->base, EVAS_HINT_FILL, EVAS_HINT_FILL); if (it->icon) { - elm_widget_sub_object_add(obj, it->icon); - evas_object_event_callback_add(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); + elm_widget_sub_object_add(obj, it->icon); + evas_object_event_callback_add(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); } if (it->end) { - elm_widget_sub_object_add(obj, it->end); - evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); + elm_widget_sub_object_add(obj, it->end); + evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); } return it; } static void -_elm_list_mode_set_internal(Widget_Data *wd) -{ - if (!wd->scr) - return; - - if (wd->mode == ELM_LIST_LIMIT) - { - if (!wd->h_mode) - { - wd->scr_minw = EINA_TRUE; - wd->scr_minh = EINA_FALSE; - } - else - { - wd->scr_minw = EINA_FALSE; - wd->scr_minh = EINA_TRUE; - } - } - else if (wd->mode == ELM_LIST_EXPAND) - { - wd->scr_minw = EINA_TRUE; - wd->scr_minh = EINA_TRUE; - } - else - { - wd->scr_minw = EINA_FALSE; - wd->scr_minh = EINA_FALSE; - } - - _sizing_eval(wd->self); -} - -static void _fix_items(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -1009,99 +527,84 @@ _fix_items(Evas_Object *obj) Evas_Coord mw, mh; int i, redo = 0; const char *style = elm_widget_style_get(obj); - const char *it_plain = wd->h_mode ? "h_item" : "item"; - const char *it_odd = wd->h_mode ? "h_item_odd" : "item_odd"; - const char *it_compress = wd->h_mode ? "h_item_compress" : "item_compress"; - const char *it_compress_odd = wd->h_mode ? "h_item_compress_odd" : "item_compress_odd"; if (!wd) return; if (wd->walking) { - wd->fix_pending = EINA_TRUE; - return; + wd->fix_pending = EINA_TRUE; + return; } _elm_list_walk(wd); // watch out "return" before unwalk! EINA_LIST_FOREACH(wd->items, l, it) { - if (it->deleted) continue; - if (it->icon) - { - evas_object_size_hint_min_get(it->icon, &mw, &mh); - if (mw > minw[0]) minw[0] = mw; - if (mh > minh[0]) minh[0] = mh; - } - if (it->end) - { - evas_object_size_hint_min_get(it->end, &mw, &mh); - if (mw > minw[1]) minw[1] = mw; - if (mh > minh[1]) minh[1] = mh; - } + if (it->deleted) continue; + if (it->icon) + { + evas_object_size_hint_min_get(it->icon, &mw, &mh); + if (mw > minw[0]) minw[0] = mw; + if (mh > minh[0]) minh[0] = mh; + } + if (it->end) + { + evas_object_size_hint_min_get(it->end, &mw, &mh); + if (mw > minw[1]) minw[1] = mw; + if (mh > minh[1]) minh[1] = mh; + } } - if ((minw[0] != wd->minw[0]) || (minw[1] != wd->minw[1]) || (minw[0] != wd->minh[0]) || (minh[1] != wd->minh[1])) { - wd->minw[0] = minw[0]; - wd->minw[1] = minw[1]; - wd->minh[0] = minh[0]; - wd->minh[1] = minh[1]; - redo = 1; + wd->minw[0] = minw[0]; + wd->minw[1] = minw[1]; + wd->minh[0] = minh[0]; + wd->minh[1] = minh[1]; + redo = 1; } i = 0; EINA_LIST_FOREACH(wd->items, l, it) { - if (it->deleted) - continue; - + if (it->deleted) continue; it->even = i & 0x1; if ((it->even != it->is_even) || (!it->fixed) || (redo)) { const char *stacking; - /* FIXME: separators' themes seem to be b0rked */ if (it->is_separator) - _elm_theme_object_set(obj, it->base.view, "separator", - wd->h_mode ? "horizontal" : "vertical", - style); + _elm_theme_object_set(obj, it->base, "list", "separator", style); else if (wd->mode == ELM_LIST_COMPRESS) { if (it->even) - _elm_theme_object_set(obj, it->base.view, "list", - it_compress, style); + _elm_theme_object_set(obj, it->base, "list", "item_compress", style); else - _elm_theme_object_set(obj, it->base.view, "list", - it_compress_odd, style); + _elm_theme_object_set(obj, it->base, "list", "item_compress_odd", style); } else { if (it->even) - _elm_theme_object_set(obj, it->base.view, "list", it_plain, - style); + _elm_theme_object_set(obj, it->base, "list", "item", style); else - _elm_theme_object_set(obj, it->base.view, "list", it_odd, - style); + _elm_theme_object_set(obj, it->base, "list", "item_odd", style); } - stacking = edje_object_data_get(it->base.view, "stacking"); + stacking = edje_object_data_get(it->base, "stacking"); if (stacking) { if (!strcmp(stacking, "below")) - evas_object_lower(it->base.view); + evas_object_lower(it->base); else if (!strcmp(stacking, "above")) - evas_object_raise(it->base.view); + evas_object_raise(it->base); } - edje_object_part_text_set(it->base.view, "elm.text", it->label); - + edje_object_part_text_set(it->base, "elm.text", it->label); if ((!it->icon) && (minh[0] > 0)) { - it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base.view)); + it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base)); evas_object_color_set(it->icon, 0, 0, 0, 0); it->dummy_icon = EINA_TRUE; } if ((!it->end) && (minh[1] > 0)) { - it->end = evas_object_rectangle_add(evas_object_evas_get(it->base.view)); + it->end = evas_object_rectangle_add(evas_object_evas_get(it->base)); evas_object_color_set(it->end, 0, 0, 0, 0); it->dummy_end = EINA_TRUE; } @@ -1109,28 +612,28 @@ _fix_items(Evas_Object *obj) { evas_object_size_hint_min_set(it->icon, minw[0], minh[0]); evas_object_size_hint_max_set(it->icon, 99999, 99999); - edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon); + edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); } if (it->end) { evas_object_size_hint_min_set(it->end, minw[1], minh[1]); evas_object_size_hint_max_set(it->end, 99999, 99999); - edje_object_part_swallow(it->base.view, "elm.swallow.end", it->end); + edje_object_part_swallow(it->base, "elm.swallow.end", it->end); } if (!it->fixed) { // this may call up user and it may modify the list item // but we're safe as we're flagged as walking. // just don't process further - edje_object_message_signal_process(it->base.view); + edje_object_message_signal_process(it->base); if (it->deleted) continue; mw = mh = -1; elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(it->base.view, &mw, &mh, mw, mh); + edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); elm_coords_finger_size_adjust(1, &mw, 1, &mh); - evas_object_size_hint_min_set(it->base.view, mw, mh); - evas_object_show(it->base.view); + evas_object_size_hint_min_set(it->base, mw, mh); + evas_object_show(it->base); } if ((it->selected) || (it->hilighted)) { @@ -1139,18 +642,15 @@ _fix_items(Evas_Object *obj) // this may call up user and it may modify the list item // but we're safe as we're flagged as walking. // just don't process further - edje_object_signal_emit(it->base.view, "elm,state,selected", "elm"); + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); if (it->deleted) continue; - selectraise = edje_object_data_get(it->base.view, "selectraise"); + selectraise = edje_object_data_get(it->base, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) - evas_object_raise(it->base.view); + evas_object_raise(it->base); + stacking = edje_object_data_get(it->base, "stacking"); } - if (it->disabled) - edje_object_signal_emit(it->base.view, "elm,state,disabled", - "elm"); - it->fixed = EINA_TRUE; it->is_even = it->even; } @@ -1161,8 +661,14 @@ _fix_items(Evas_Object *obj) mw = 0; mh = 0; evas_object_size_hint_min_get(wd->box, &mw, &mh); - - _elm_list_mode_set_internal(wd); + if (wd->scr) + { + if (wd->mode == ELM_LIST_LIMIT) + elm_scroller_content_min_limit(wd->scr, 1, 0); + else + elm_scroller_content_min_limit(wd->scr, 0, 0); + } + _sizing_eval(obj); } static void @@ -1171,7 +677,7 @@ _hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->scr) - elm_smart_scroller_hold_set(wd->scr, EINA_TRUE); + elm_widget_scroll_hold_push(wd->scr); } static void @@ -1180,7 +686,7 @@ _hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->scr) - elm_smart_scroller_hold_set(wd->scr, EINA_FALSE); + elm_widget_scroll_hold_pop(wd->scr); } static void @@ -1189,7 +695,7 @@ _freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->scr) - elm_smart_scroller_freeze_set(wd->scr, EINA_TRUE); + elm_widget_scroll_hold_push(wd->scr); } static void @@ -1198,13 +704,7 @@ _freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__ Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->scr) - elm_smart_scroller_freeze_set(wd->scr, EINA_FALSE); -} - -static void -_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - _sizing_eval(data); + elm_widget_scroll_hold_pop(wd->scr); } /** @@ -1221,13 +721,9 @@ elm_list_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - Evas_Coord minw, minh; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; wd->self = obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "list"); elm_widget_type_set(obj, "list"); @@ -1236,45 +732,23 @@ elm_list_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - elm_widget_event_hook_set(obj, _event_hook); - - wd->scr = elm_smart_scroller_add(e); - elm_smart_scroller_widget_set(wd->scr, obj); - _theme_hook(obj); + elm_widget_can_focus_set(obj, 1); + + wd->scr = elm_scroller_add(parent); + elm_scroller_custom_widget_base_theme_set(wd->scr, "list", "base"); elm_widget_resize_object_set(obj, wd->scr); - evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj); - elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, - _elm_config->thumbscroll_bounce_enable); + elm_scroller_bounce_set(wd->scr, 0, 1); wd->box = elm_box_add(parent); elm_box_homogenous_set(wd->box, 1); evas_object_size_hint_weight_set(wd->box, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(wd->box, EVAS_HINT_FILL, 0.0); - elm_widget_on_show_region_hook_set(wd->box, _show_region_hook, obj); - elm_widget_sub_object_add(obj, wd->box); - elm_smart_scroller_child_set(wd->scr, wd->box); - evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - + elm_scroller_content_set(wd->scr, wd->box); evas_object_show(wd->box); wd->mode = ELM_LIST_SCROLL; - evas_object_smart_callback_add(wd->scr, "edge,left", _scroll_edge_left, obj); - evas_object_smart_callback_add(wd->scr, "edge,right", _scroll_edge_right, obj); - evas_object_smart_callback_add(wd->scr, "edge,top", _scroll_edge_top, obj); - evas_object_smart_callback_add(wd->scr, "edge,bottom", _scroll_edge_bottom, obj); - evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj); evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj); @@ -1308,7 +782,7 @@ elm_list_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Eva wd->items = eina_list_append(wd->items, it); it->node = eina_list_last(wd->items); - elm_box_pack_end(wd->box, it->base.view); + elm_box_pack_end(wd->box, it->base); return it; } @@ -1335,7 +809,7 @@ elm_list_item_prepend(Evas_Object *obj, const char *label, Evas_Object *icon, Ev wd->items = eina_list_prepend(wd->items, it); it->node = wd->items; - elm_box_pack_start(wd->box, it->base.view); + elm_box_pack_start(wd->box, it->base); return it; } @@ -1360,8 +834,7 @@ elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char Widget_Data *wd; Elm_List_Item *it; - EINA_SAFETY_ON_NULL_RETURN_VAL(before, NULL); - if (!before->node) return NULL; + if ((!before) || (!before->node)) return NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(before, NULL); ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -1370,7 +843,7 @@ elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char it = _item_new(obj, label, icon, end, func, data); wd->items = eina_list_prepend_relative_list(wd->items, it, before->node); it->node = before->node->prev; - elm_box_pack_before(wd->box, it->base.view, before->base.view); + elm_box_pack_before(wd->box, it->base, before->base); return it; } @@ -1395,8 +868,7 @@ elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *l Widget_Data *wd; Elm_List_Item *it; - EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL); - if (!after->node) return NULL; + if ((!after) || (!after->node)) return NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(after, NULL); ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -1405,7 +877,7 @@ elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *l it = _item_new(obj, label, icon, end, func, data); wd->items = eina_list_append_relative_list(wd->items, it, after->node); it->node = after->node->next; - elm_box_pack_after(wd->box, it->base.view, after->base.view); + elm_box_pack_after(wd->box, it->base, after->base); return it; } @@ -1437,14 +909,14 @@ elm_list_item_sorted_insert(Evas_Object *obj, const char *label, Evas_Object *ic l = eina_list_next(l); if (!l) { - it->node = eina_list_last(wd->items); - elm_box_pack_end(wd->box, it->base.view); + it->node = eina_list_last(wd->items); + elm_box_pack_end(wd->box, it->base); } else { - Elm_List_Item *before = eina_list_data_get(l); - it->node = before->node->prev; - elm_box_pack_before(wd->box, it->base.view, before->base.view); + Elm_List_Item *before = eina_list_data_get(l); + it->node = before->node->prev; + elm_box_pack_before(wd->box, it->base, before->base); } return it; } @@ -1471,23 +943,23 @@ elm_list_clear(Evas_Object *obj) if (wd->walking > 0) { - Eina_List *n; + Eina_List *n; - EINA_LIST_FOREACH(wd->items, n, it) - { - if (it->deleted) continue; - it->deleted = EINA_TRUE; - wd->to_delete = eina_list_append(wd->to_delete, it); - } - return; + EINA_LIST_FOREACH(wd->items, n, it) + { + if (it->deleted) continue; + it->deleted = EINA_TRUE; + wd->to_delete = eina_list_append(wd->to_delete, it); + } + return; } _elm_list_walk(wd); EINA_LIST_FREE(wd->items, it) { - elm_widget_item_pre_notify_del(it); - _elm_list_item_free(it); + _elm_list_item_call_del_cb(it); + _elm_list_item_free(it); } _elm_list_unwalk(wd); @@ -1547,143 +1019,48 @@ elm_list_multi_select_get(const Evas_Object *obj) } /** - * Set which mode to use for the list with. + * Enables/disables horizontal mode of the list * * @param obj The list object - * @param mode One of @c ELM_LIST_COMPRESS, @c ELM_LIST_SCROLL, @c - * ELM_LIST_LIMIT or @c ELM_LIST_EXPAND. - * - * @note Default value is @c ELM_LIST_SCROLL. At this mode, the list - * object won't set any of its size hints to inform how a possible - * container should resize it. Then, if it's not created as a "resize - * object", it might end with zero dimensions. The list will respect - * the container's geometry and, if any of its items won't fit into - * its transverse axis, one will be able to scroll it in that - * direction. @c ELM_LIST_COMPRESS is the same as the previous, except - * that it won't let one scroll in the transverse axis, on - * those cases (large items will get cropped). @c ELM_LIST_LIMIT will - * actually set a minimun size hint on the list object, so that - * containers may respect it (and resize itself to fit the child - * properly). More specifically, a minimum size hint will be set for - * its transverse axis, so that the largest item in that - * direction fits well. @c ELM_LIST_EXPAND, besides setting a minimum - * size on the transverse axis, just like the previous mode, will set - * a minimum size on the longitudinal axis too, trying to reserve - * space to all its children to be visible at a time. The last two - * modes can always have effects bounded by setting the list object's - * maximum size hints, though. + * @param mode If true, horizontale mode is enabled * * @ingroup List */ EAPI void -elm_list_mode_set(Evas_Object *obj, Elm_List_Mode mode) +elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) { ELM_CHECK_WIDTYPE(obj, widtype); - - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - if (wd->mode == mode) - return; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (wd->mode == mode) return; wd->mode = mode; - - _elm_list_mode_set_internal(wd); + if (wd->scr) + { + if (wd->mode == ELM_LIST_LIMIT) + elm_scroller_content_min_limit(wd->scr, 1, 0); + else + elm_scroller_content_min_limit(wd->scr, 0, 0); + } } /** - * Get the mode the list is at. + * Gets the state of horizontal mode of the list * * @param obj The list object - * @return mode One of @c ELM_LIST_COMPRESS, @c ELM_LIST_SCROLL or @c - * ELM_LIST_LIMIT (@c ELM_LIST_LAST on errors). - * - * @note see elm_list_mode_set() for more information. + * @return If true, horizontale mode is enabled * * @ingroup List */ EAPI Elm_List_Mode -elm_list_mode_get(const Evas_Object *obj) +elm_list_horizontal_mode_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) ELM_LIST_LAST; + ELM_CHECK_WIDTYPE(obj, widtype) ELM_LIST_SCROLL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_LIST_LAST; + if (!wd) return ELM_LIST_SCROLL; return wd->mode; } /** - * Enables/disables horizontal mode of the list. - * - * @param obj The list object - * @param mode If true, horizontale mode is enabled - * - * @note Bounce options for the list will be reset to default values - * with this funcion. Re-call elm_list_bounce_set() once more after - * this one, if you had custom values. - * - * @ingroup List - */ -EAPI void -elm_list_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - - Widget_Data *wd; - Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable; - - wd = elm_widget_data_get(obj); - if (!wd) - return; - - if (wd->h_mode == horizontal) - return; - - wd->h_mode = horizontal; - elm_box_horizontal_set(wd->box, horizontal); - - if (horizontal) - { - evas_object_size_hint_weight_set(wd->box, 0.0, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(wd->box, 0.0, EVAS_HINT_FILL); - elm_smart_scroller_bounce_allow_set(wd->scr, bounce, EINA_FALSE); - } - else - { - evas_object_size_hint_weight_set(wd->box, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(wd->box, EVAS_HINT_FILL, 0.0); - elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, bounce); - } - - _elm_list_mode_set_internal(wd); -} - -/** - * Retrieve whether horizontal mode is enabled for a list. - * - * @param obj The list object - * @return @c EINA_TRUE, if horizontal mode is enabled and @c - * EINA_FALSE, otherwise. - * - * @note see elm_list_horizontal_set() for more information. - * - * @ingroup List - */ -EAPI Eina_Bool -elm_list_horizontal_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) - return EINA_FALSE; - - return wd->h_mode; -} - -/** * Enables/disables the state of always_select, meaning that * an item will always be selected. * @@ -1808,11 +1185,9 @@ elm_list_item_separator_get(const Elm_List_Item *it) EAPI void elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); if (!wd) return; - + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); selected = !!selected; if (it->selected == selected) return; @@ -1820,16 +1195,16 @@ elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) if (selected) { - if (!wd->multi) - { - while (wd->selected) - _item_unselect(wd->selected->data); - } - _item_hilight(it); - _item_select(it); + if (!wd->multi) + { + while (wd->selected) + _item_unselect(wd->selected->data); + } + _item_hilight(it); + _item_select(it); } else - _item_unselect(it); + _item_unselect(it); _elm_list_unwalk(wd); } @@ -1843,7 +1218,7 @@ elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) * @ingroup List */ EAPI Eina_Bool -elm_list_item_selected_get(const Elm_List_Item *it) +elm_list_item_selected_get(Elm_List_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); return it->selected; @@ -1859,44 +1234,17 @@ elm_list_item_selected_get(const Elm_List_Item *it) EAPI void elm_list_item_show(Elm_List_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Coord bx, by, bw, bh; Evas_Coord x, y, w, h; - evas_object_geometry_get(wd->box, &bx, &by, &bw, &bh); - evas_object_geometry_get(it->base.view, &x, &y, &w, &h); - x -= bx; - y -= by; - if (wd->scr) - elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); -} - -/** - * Bring in the given item - * - * This causes list to jump to the given item @p it and show it (by scrolling), - * if it is not fully visible. This may use animation to do so and take a - * period of time - * - * @param it The item - * - * @ingroup List - */ -EAPI void -elm_list_item_bring_in(Elm_List_Item *it) -{ ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - Widget_Data *wd = elm_widget_data_get(it->base.widget); - Evas_Coord bx, by, bw, bh; - Evas_Coord x, y, w, h; - evas_object_geometry_get(wd->box, &bx, &by, &bw, &bh); - evas_object_geometry_get(it->base.view, &x, &y, &w, &h); + evas_object_geometry_get(it->base, &x, &y, &w, &h); x -= bx; y -= by; if (wd->scr) - elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); + elm_scroller_region_show(wd->scr, x, y, w, h); } /** @@ -1909,25 +1257,25 @@ elm_list_item_bring_in(Elm_List_Item *it) EAPI void elm_list_item_del(Elm_List_Item *it) { - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); if (!wd) return; + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (it->selected) _item_unselect(it); if (wd->walking > 0) { - if (it->deleted) return; - it->deleted = EINA_TRUE; - wd->to_delete = eina_list_append(wd->to_delete, it); - return; + if (it->deleted) return; + it->deleted = EINA_TRUE; + wd->to_delete = eina_list_append(wd->to_delete, it); + return; } wd->items = eina_list_remove_list(wd->items, it->node); _elm_list_walk(wd); - elm_widget_item_pre_notify_del(it); + _elm_list_item_call_del_cb(it); _elm_list_item_free(it); _elm_list_unwalk(wd); @@ -1945,7 +1293,7 @@ EAPI void elm_list_item_del_cb_set(Elm_List_Item *it, Evas_Smart_Cb func) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - elm_widget_item_del_cb_set(it, func); + it->del_cb = func; } /** @@ -1960,7 +1308,7 @@ EAPI void * elm_list_item_data_get(const Elm_List_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); - return elm_widget_item_data_get(it); + return (void *)it->data; } /** @@ -1996,26 +1344,26 @@ elm_list_item_icon_set(Elm_List_Item *it, Evas_Object *icon) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (it->icon == icon) return; - if ((it->dummy_icon) && (!icon)) return; + if (it->dummy_icon && !icon) return; if (it->dummy_icon) { - evas_object_del(it->icon); - it->dummy_icon = EINA_FALSE; + evas_object_del(it->icon); + it->dummy_icon = EINA_FALSE; } if (!icon) { - icon = evas_object_rectangle_add(evas_object_evas_get(it->base.widget)); - evas_object_color_set(icon, 0, 0, 0, 0); - it->dummy_icon = EINA_TRUE; + icon = evas_object_rectangle_add(evas_object_evas_get(it->obj)); + evas_object_color_set(icon, 0, 0, 0, 0); + it->dummy_icon = EINA_TRUE; } if (it->icon) { - evas_object_del(it->icon); - it->icon = NULL; + evas_object_del(it->icon); + it->icon = NULL; } it->icon = icon; - if (it->base.view) - edje_object_part_swallow(it->base.view, "elm.swallow.icon", icon); + if (it->base) + edje_object_part_swallow(it->base, "elm.swallow.icon", icon); } /** @@ -2051,26 +1399,26 @@ elm_list_item_end_set(Elm_List_Item *it, Evas_Object *end) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (it->end == end) return; - if ((it->dummy_end) && (!end)) return; + if (it->dummy_end && !end) return; if (it->dummy_end) { - evas_object_del(it->end); - it->dummy_icon = EINA_FALSE; + evas_object_del(it->end); + it->dummy_icon = EINA_FALSE; } if (!end) { - end = evas_object_rectangle_add(evas_object_evas_get(it->base.widget)); - evas_object_color_set(end, 0, 0, 0, 0); - it->dummy_end = EINA_TRUE; + end = evas_object_rectangle_add(evas_object_evas_get(it->obj)); + evas_object_color_set(end, 0, 0, 0, 0); + it->dummy_end = EINA_TRUE; } if (it->end) { - evas_object_del(it->end); - it->end = NULL; + evas_object_del(it->end); + it->end = NULL; } it->end = end; - if (it->base.view) - edje_object_part_swallow(it->base.view, "elm.swallow.end", end); + if (it->base) + edje_object_part_swallow(it->base, "elm.swallow.end", end); } /** @@ -2085,7 +1433,7 @@ EAPI Evas_Object * elm_list_item_base_get(const Elm_List_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); - return it->base.view; + return it->base; } /** @@ -2116,8 +1464,8 @@ elm_list_item_label_set(Elm_List_Item *it, const char *text) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (!eina_stringshare_replace(&it->label, text)) return; - if (it->base.view) - edje_object_part_text_set(it->base.view, "elm.text", it->label); + if (it->base) + edje_object_part_text_set(it->base, "elm.text", it->label); } /** @@ -2153,224 +1501,6 @@ elm_list_item_next(const Elm_List_Item *it) } /** - * Set the text to be shown in the list item. - * - * @param item Target item - * @param text The text to set in the content - * - * Setup the text as tooltip to object. The item can have only one tooltip, - * so any previous tooltip data is removed. - * - * @ingroup List - */ -EAPI void -elm_list_item_tooltip_text_set(Elm_List_Item *item, const char *text) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_text_set(item, text); -} - -/** - * Set the content to be shown in the tooltip item - * - * Setup the tooltip to item. The item can have only one tooltip, - * so any previous tooltip data is removed. @p func(with @p data) will - * be called every time that need show the tooltip and it should - * return a valid Evas_Object. This object is then managed fully by - * tooltip system and is deleted when the tooltip is gone. - * - * @param item the list item being attached a tooltip. - * @param func the function used to create the tooltip contents. - * @param data what to provide to @a func as callback data/context. - * @param del_cb called when data is not needed anymore, either when - * another callback replaces @func, the tooltip is unset with - * elm_list_item_tooltip_unset() or the owner @a item - * dies. This callback receives as the first parameter the - * given @a data, and @c event_info is the item. - * - * @ingroup List - */ -EAPI void -elm_list_item_tooltip_content_cb_set(Elm_List_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb); -} - -/** - * Unset tooltip from item - * - * @param item list item to remove previously set tooltip. - * - * Remove tooltip from item. The callback provided as del_cb to - * elm_list_item_tooltip_content_cb_set() will be called to notify - * it is not used anymore. - * - * @see elm_list_item_tooltip_content_cb_set() - * - * @ingroup List - */ -EAPI void -elm_list_item_tooltip_unset(Elm_List_Item *item) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_unset(item); -} - -/** - * Sets a different style for this item tooltip. - * - * @note before you set a style you should define a tooltip with - * elm_list_item_tooltip_content_cb_set() or - * elm_list_item_tooltip_text_set() - * - * @param item list item with tooltip already set. - * @param style the theme style to use (default, transparent, ...) - * - * @ingroup List - */ -EAPI void -elm_list_item_tooltip_style_set(Elm_List_Item *item, const char *style) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_tooltip_style_set(item, style); -} - -/** - * Get the style for this item tooltip. - * - * @param item list item with tooltip already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a tooltip set, then NULL is returned. - * - * @ingroup List - */ -EAPI const char * -elm_list_item_tooltip_style_get(const Elm_List_Item *item) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, NULL); - return elm_widget_item_tooltip_style_get(item); -} - -/** - * Set the cursor to be shown when mouse is over the list item - * - * @param item Target item - * @param cursor the cursor name to be used. - * - * @see elm_object_cursor_set() - * @ingroup List - */ -EAPI void -elm_list_item_cursor_set(Elm_List_Item *item, const char *cursor) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_set(item, cursor); -} - -/** - * Get the cursor to be shown when mouse is over the list item - * - * @param item list item with cursor already set. - * @return the cursor name. - * - * @ingroup List - */ -EAPI const char * -elm_list_item_cursor_get(const Elm_List_Item *item) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, NULL); - return elm_widget_item_cursor_get(item); -} - -/** - * Unset the cursor to be shown when mouse is over the list item - * - * @param item Target item - * - * @see elm_object_cursor_unset() - * @ingroup List - */ -EAPI void -elm_list_item_cursor_unset(Elm_List_Item *item) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_unset(item); -} - -/** - * Sets a different style for this item cursor. - * - * @note before you set a style you should define a cursor with - * elm_list_item_cursor_set() - * - * @param item list item with cursor already set. - * @param style the theme style to use (default, transparent, ...) - * - * @ingroup List - */ -EAPI void -elm_list_item_cursor_style_set(Elm_List_Item *item, const char *style) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_style_set(item, style); -} - -/** - * Get the style for this item cursor. - * - * @param item list item with cursor already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a cursor set, then NULL is returned. - * - * @ingroup List - */ -EAPI const char * -elm_list_item_cursor_style_get(const Elm_List_Item *item) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, NULL); - return elm_widget_item_cursor_style_get(item); -} - -/** - * Set if the cursor set should be searched on the theme or should use - * the provided by the engine, only. - * - * @note before you set if should look on theme you should define a cursor - * with elm_object_cursor_set(). By default it will only look for cursors - * provided by the engine. - * - * @param item widget item with cursor already set. - * @param engine_only boolean to define it cursors should be looked only - * between the provided by the engine or searched on widget's theme as well. - * - * @ingroup List - */ -EAPI void -elm_list_item_cursor_engine_only_set(Elm_List_Item *item, Eina_Bool engine_only) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item); - elm_widget_item_cursor_engine_only_set(item, engine_only); -} - -/** - * Get the cursor engine only usage for this item cursor. - * - * @param item widget item with cursor already set. - * @return engine_only boolean to define it cursors should be looked only - * between the provided by the engine or searched on widget's theme as well. If - * the object does not have a cursor set, then EINA_FALSE is returned. - * - * @ingroup List - */ -EAPI Eina_Bool -elm_list_item_cursor_engine_only_get(const Elm_List_Item *item) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(item, EINA_FALSE); - return elm_widget_item_cursor_engine_only_get(item); -} - -/** * Set bounce mode * * This will enable or disable the scroller bounce mode for the list. See @@ -2389,31 +1519,13 @@ elm_list_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->scr) - elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); -} - -/** - * Get the bounce mode - * - * @param obj The List object - * @param h_bounce Allow bounce horizontally - * @param v_bounce Allow bounce vertically - * - * @ingroup List - */ -EAPI void -elm_list_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - elm_smart_scroller_bounce_allow_get(wd->scr, h_bounce, v_bounce); + elm_scroller_bounce_set(wd->scr, h_bounce, v_bounce); } /** * Set the scrollbar policy * - * This sets the scrollbar visibility policy for the given list scroller. + * This sets the scrollbar visibility policy for the given scroller. * ELM_SMART_SCROLLER_POLICY_AUTO means the scrollber is made visible if it * is needed, and otherwise kept hidden. ELM_SMART_SCROLLER_POLICY_ON turns * it on all the time, and ELM_SMART_SCROLLER_POLICY_OFF always keeps it off. @@ -2431,10 +1543,8 @@ elm_list_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if ((policy_h >= ELM_SCROLLER_POLICY_LAST) || - (policy_v >= ELM_SCROLLER_POLICY_LAST)) if (wd->scr) - elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v); + elm_scroller_policy_set(wd->scr, policy_h, policy_v); } EAPI void @@ -2442,68 +1552,7 @@ elm_list_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - Elm_Smart_Scroller_Policy s_policy_h, s_policy_v; - if ((!wd) || (!wd->scr)) return; - elm_smart_scroller_policy_get(wd->scr, &s_policy_h, &s_policy_v); - if (policy_h) *policy_h = (Elm_Scroller_Policy) s_policy_h; - if (policy_v) *policy_v = (Elm_Scroller_Policy) s_policy_v; -} - -/** - * Sets the disabled/enabled state of a list item. - * - * A disabled item cannot be selected or unselected. It will also - * change its appearance (generally greyed out). This sets the - * disabled state (@c EINA_TRUE for disabled, @c EINA_FALSE for - * enabled). - * - * @param it The item - * @param disabled The disabled state - * - * @ingroup List - */ -EAPI void -elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - - if (it->disabled == disabled) - return; - - it->disabled = !!disabled; - - if (it->disabled) - edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm"); - else - edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm"); -} - -/** - * Get the disabled/enabled state of a list item - * - * @param it The item - * @return The disabled state - * - * See elm_list_item_disabled_set(). - * - * @ingroup List - */ -EAPI Eina_Bool -elm_list_item_disabled_get(const Elm_List_Item *it) -{ - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); - - return it->disabled; -} - -EAPI void -elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) -{ - elm_list_mode_set(obj, mode); -} - -EAPI Elm_List_Mode -elm_list_horizontal_mode_get(const Evas_Object *obj) -{ - return elm_list_mode_get(obj); + if (!wd) return; + if (wd->scr) + elm_scroller_policy_get(wd->scr, policy_h, policy_v); } diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index 33e38af..ef020a1 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -1,5 +1,6 @@ #include #include "elm_priv.h" +#include "elm_module_priv.h" /** * @defgroup Map Map @@ -19,9 +20,9 @@ * * clicked,double - This is called when a user has double-clicked the photo. * - * load,detail - Map detailed data load begins. + * load,details - Map detailed data load begins. * - * loaded,detail - This is called when all parts of the map are loaded. + * loaded,details - This is called when all parts of the map are loaded. * * zoom,start - Zoom animation started. * @@ -39,8 +40,6 @@ * * scroll,drag,stop - dragging the contents around has stopped * - * downloaded - This is called when map images are downloaded - * * TODO : doxygen */ @@ -51,7 +50,6 @@ typedef struct _Grid Grid; typedef struct _Grid_Item Grid_Item; typedef struct _Marker_Group Marker_Group; typedef struct _Mod_Api Mod_Api; -typedef struct _Event Event; #define DEST_DIR_ZOOM_PATH "/tmp/elm_map/%d/%d/" #define DEST_DIR_PATH DEST_DIR_ZOOM_PATH"%d/" @@ -67,36 +65,30 @@ typedef struct _Map_Sources_Tab int zoom_min; int zoom_max; ElmMapSourceURLFunc url_cb; + Eina_Bool use_module : 1; } Map_Sources_Tab; -#define ZOOM_MAX 18 - +#define ZOOM_MAX 20 +#define TOUCH_HOLD_RANGE 40 //Zemm min is supposed to be 0 -static char *_mapnik_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char *_osmarender_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char *_cyclemap_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char *_maplint_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char *_module_url_cb(Evas_Object *obj, int x, int y, int zoom); -static char * _custom1_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char * _custom2_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char * _custom3_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char * _custom4_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char * _custom5_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); -static char * _custom6_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom); - +static char * _mapnik_url_cb(void *data ,int x, int y, int zoom); +static char * _osmarender_url_cb(void *data ,int x, int y, int zoom); +static char * _cyclemap_url_cb(void *data ,int x, int y, int zoom); +static char * _maplint_url_cb(void *data ,int x, int y, int zoom); +static char * _decarta_url_cb(void *data ,int x, int y, int zoom); static Map_Sources_Tab map_sources_tab[] = { - {ELM_MAP_SOURCE_MAPNIK, "Mapnik", 0, 18, _mapnik_url_cb}, - {ELM_MAP_SOURCE_OSMARENDER, "Osmarender", 0, 17, _osmarender_url_cb}, - {ELM_MAP_SOURCE_CYCLEMAP, "Cycle Map", 0, 17, _cyclemap_url_cb}, - {ELM_MAP_SOURCE_MAPLINT, "Maplint", 12, 16, _maplint_url_cb}, - {ELM_MAP_SOURCE_CUSTOM_1, "Custom 1", 0, 18, _custom1_url_cb}, - {ELM_MAP_SOURCE_CUSTOM_2, "Custom 2", 0, 18, _custom2_url_cb}, - {ELM_MAP_SOURCE_CUSTOM_3, "Custom 3", 0, 18, _custom3_url_cb}, - {ELM_MAP_SOURCE_CUSTOM_4, "Custom 4", 0, 18, _custom4_url_cb}, - {ELM_MAP_SOURCE_CUSTOM_5, "Custom 5", 0, 18, _custom5_url_cb}, - {ELM_MAP_SOURCE_CUSTOM_6, "Custom 6", 0, 18, _custom6_url_cb}, - {ELM_MAP_SOURCE_MODULE, "Module", 0, 18, _module_url_cb} + {ELM_MAP_SOURCE_MAPNIK, "Mapnik", 0, 18, _mapnik_url_cb, EINA_FALSE}, + {ELM_MAP_SOURCE_OSMARENDER, "Osmarender", 0, 17, _osmarender_url_cb, EINA_FALSE}, + {ELM_MAP_SOURCE_CYCLEMAP, "Cycle Map", 0, 17, _cyclemap_url_cb, EINA_FALSE}, + {ELM_MAP_SOURCE_MAPLINT, "Maplint", 12, 16, _maplint_url_cb, EINA_FALSE}, + {ELM_MAP_SOURCE_DECARTA, "Decarta", 1, 20, _decarta_url_cb, EINA_TRUE}, + {ELM_MAP_SOURCE_CUSTOM_1, "Custom 1", 0, 18, NULL, EINA_FALSE}, + {ELM_MAP_SOURCE_CUSTOM_2, "Custom 2", 0, 18, NULL, EINA_FALSE}, + {ELM_MAP_SOURCE_CUSTOM_3, "Custom 3", 0, 18, NULL, EINA_FALSE}, + {ELM_MAP_SOURCE_CUSTOM_4, "Custom 4", 0, 18, NULL, EINA_FALSE}, + {ELM_MAP_SOURCE_CUSTOM_5, "Custom 5", 0, 18, NULL, EINA_FALSE}, + {ELM_MAP_SOURCE_CUSTOM_6, "Custom 6", 0, 18, NULL, EINA_FALSE} }; struct _Elm_Map_Marker_Class @@ -260,9 +252,12 @@ struct _Widget_Data Elm_Map_Sources source; Mod_Api *api; - Eina_List *s_event_list; - int try_num; - int finish_num; +}; + +struct _Pan +{ + Evas_Object_Smart_Clipped_Data __clipped_data; + Widget_Data *wd; }; struct _Mod_Api @@ -273,18 +268,13 @@ struct _Mod_Api Eina_Bool (*obj_convert_coord_into_geo) (const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat); Eina_Bool (*obj_convert_geo_into_coord) (const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y); }; -struct _Pan -{ - Evas_Object_Smart_Clipped_Data __clipped_data; - Widget_Data *wd; -}; -struct _Event +struct event_t { int device; - struct { - Evas_Coord x, y; + struct prev { + Evas_Coord x, y; } prev; Evas_Coord x, y, w, h; @@ -292,10 +282,16 @@ struct _Event Evas_Object *object; Ecore_Timer *hold_timer; + int ts; + int v; + int pinch_dis; + Evas_Object *pinch_obj; + Evas_Object *test; }; - static int dis_old = 0; +static Eina_List *s_event_list; + static const char *widtype = NULL; static const char SIG_CHANGED[] = "changed"; @@ -311,7 +307,6 @@ static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop"; static const char SIG_ZOOM_CHANGE[] = "zoom,change"; static const char SIG_ZOOM_START[] = "zoom,start"; static const char SIG_ZOOM_STOP[] = "zoom,stop"; -static const char SIG_DOWNLOADED[] = "downloaded"; static const Evas_Smart_Cb_Description _signals[] = { {SIG_CHANGED, ""}, {SIG_CLICKED, ""}, @@ -326,21 +321,15 @@ static const Evas_Smart_Cb_Description _signals[] = { {SIG_ZOOM_CHANGE, ""}, {SIG_ZOOM_START, ""}, {SIG_ZOOM_STOP, ""}, - {SIG_DOWNLOADED, ""}, {NULL, NULL} }; static void _pan_calculate(Evas_Object *obj); -static Eina_Bool _hold_timer_cb(void *data); -static void _rect_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); -static void _on_focus_hook(void *data, Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _calc_job(void *data); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); static void grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh); static void grid_clear(Evas_Object *obj, Grid *g); static Grid *grid_create(Evas_Object *obj); @@ -368,70 +357,95 @@ static void _mouse_multi_down(void *data, Evas *evas, Evas_Object *obj, void *ev static void _mouse_multi_up(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _mouse_multi_move(void *data, Evas *evas, Evas_Object *obj, void *event_info); +static Eina_Bool +hold_timer_cb(void *data) +{ + struct event_t *ev0 = (struct event_t *)data; + ev0->hold_timer = NULL; + + return ECORE_CALLBACK_CANCEL; +} + +static void +_rect_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Widget_Data *wd = elm_widget_data_get(data); + int x,y,w,h; + + evas_object_geometry_get(wd->rect,&x,&y,&w,&h); + evas_object_geometry_get(wd->pan_smart,&x,&y,&w,&h); + evas_object_resize(wd->rect,w,h); + evas_object_move(wd->rect,x,y); +} + static int -get_multi_device(Evas_Object *obj) +get_multi_device(void) { - Widget_Data *wd = elm_widget_data_get(obj); Eina_List *l; - Event *ev; + struct event_t *ev = NULL; - EINA_LIST_FOREACH(wd->s_event_list, l, ev) - { - if (ev->device) return ev->device; - } + EINA_LIST_FOREACH(s_event_list, l, ev) { + if(ev->device != 0) return ev->device; + } return 0; } static int get_distance(Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2) { - int dx = x1 - x2; - int dy = y1 - y2; - return sqrt((dx * dx) + (dy * dy)); + int dis, dx, dy; + + dx = x1 - x2; + dy = y1 - y2; + + dis = (int)sqrt(dx * dx + dy * dy); + return dis; } -static Event * -create_event_object(void *data, Evas_Object *obj, int device) +static struct event_t* +get_event_object(int device) { - Widget_Data *wd = elm_widget_data_get(data); - Event *ev = calloc(1, sizeof(Event)); - - EINA_SAFETY_ON_NULL_RETURN_VAL(ev, NULL); + Eina_List *l; + struct event_t *ev = NULL; - ev->object = obj; - ev->device = device; - evas_object_geometry_get(obj, &ev->x, &ev->y, &ev->w, &ev->h); - wd->s_event_list = eina_list_append(wd->s_event_list, ev); + EINA_LIST_FOREACH(s_event_list, l, ev) { + if(ev->device == device) break; + ev = NULL; + } return ev; } -static Event* -get_event_object(void *data, int device) +static struct event_t * +create_event_object(Evas_Object *object, int device) { - Widget_Data *wd = elm_widget_data_get(data); - Eina_List *l; - Event *ev; + struct event_t *ev; + + ev = calloc(1, sizeof(struct event_t)); + if(ev == NULL) DBG("Cannot allocate event_t"); + + ev->object = object; + ev->device = device; + + evas_object_geometry_get(object, &ev->x, &ev->y, &ev->w, &ev->h); + + s_event_list = eina_list_append(s_event_list, ev); - EINA_LIST_FOREACH(wd->s_event_list, l, ev) - { - if (ev->device == device) break; - ev = NULL; - } return ev; } static void -destroy_event_object(void *data, Event *ev) +destroy_event_object(struct event_t *ev) { - Widget_Data *wd = elm_widget_data_get(data); - EINA_SAFETY_ON_NULL_RETURN(ev); + if(ev == NULL) return; + ev->pinch_obj = NULL; ev->pinch_dis = 0; - wd->s_event_list = eina_list_remove(wd->s_event_list, ev); - if (ev->hold_timer) - { - ecore_timer_del(ev->hold_timer); - ev->hold_timer = NULL; - } + + s_event_list = eina_list_remove(s_event_list, ev); + + if (ev->hold_timer) { + ecore_timer_del(ev->hold_timer); + ev->hold_timer = NULL; + } free(ev); } @@ -439,14 +453,15 @@ static Mod_Api * module(Evas_Object *obj __UNUSED__) { static Elm_Module *m = NULL; - if (m) goto ok; + if (m) goto ok; // already found - just use if (!(m = _elm_module_find_as("map/api"))) return NULL; + // get module api m->api = malloc(sizeof(Mod_Api)); if (!m->api) return NULL; - ((Mod_Api *)(m->api) )->obj_hook = + ((Mod_Api *)(m->api) )->obj_hook = // called on creation _elm_module_symbol_get(m, "obj_hook"); - ((Mod_Api *)(m->api) )->obj_unhook = + ((Mod_Api *)(m->api) )->obj_unhook = // called on deletion _elm_module_symbol_get(m, "obj_unhook"); ((Mod_Api *)(m->api) )->obj_url_request = _elm_module_symbol_get(m, "obj_url_request"); @@ -454,7 +469,7 @@ module(Evas_Object *obj __UNUSED__) _elm_module_symbol_get(m, "obj_convert_coord_into_geo"); ((Mod_Api *)(m->api) )->obj_convert_geo_into_coord = _elm_module_symbol_get(m, "obj_convert_geo_into_coord"); - ok: + ok: // ok - return api return m->api; } @@ -471,7 +486,7 @@ rect_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_C gw = wd->size.w; gh = wd->size.h; - if ((ww == gw) && (hh == gh)) return; + if (ww == gw && hh == gh) return; if (ow > gw) ax = (ow - gw) / 2; if (oh > gh) ay = (oh - gh) / 2; @@ -522,8 +537,8 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord } wd->marker_zoom = wd->zoom; - if ((wd->paused_markers) - && ((wd->size.nw != wd->size.w) || (wd->size.nh != wd->size.h)) ) + if (wd->paused_markers + && (wd->size.nw != wd->size.w || wd->size.nh != wd->size.h) ) return; g_xx = wd->pan_x / wd->tsize; @@ -539,7 +554,7 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord EINA_LIST_FREE(wd->cells_displayed, cell) { eina_matrixsparse_cell_position_get(cell, (unsigned long *)&y, (unsigned long *)&x); - if ((y < g_yy) || (y > g_yy + g_hh) || (x < g_xx) || (x > g_xx + g_ww)) + if (y < g_yy || y > g_yy + g_hh || x < g_xx || x > g_xx + g_ww) { EINA_LIST_FOREACH(eina_matrixsparse_cell_data_get(cell), l, group) { @@ -590,9 +605,9 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord hh = (((long long)gh * (ty + hh)) / g->h) - yy; } - if ((!group->clas->hide) - && (xx-px+ax+ox >= ox) && (xx-px+ax+ox<= ox+ow) - && (yy-py+ay+oy >= oy) && (yy-py+ay+oy<= oy+oh)) + if (!group->clas->hide + && xx-px+ax+ox >= ox && xx-px+ax+ox<= ox+ow + && yy-py+ay+oy >= oy && yy-py+ay+oy<= oy+oh) { if (!group->obj) _group_object_create(group); @@ -610,7 +625,7 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord evas_object_move(group->obj, xx - px + ax + ox - ww/2, yy - py + ay + oy - hh/2); - if ((!wd->paused_markers) || (group->update_resize)) + if (!wd->paused_markers || group->update_resize) { group->update_resize = EINA_FALSE; evas_object_resize(group->obj, ww, hh); @@ -712,7 +727,7 @@ grid_clear(Evas_Object *obj, Grid *g) { gi->want = EINA_FALSE; wd->preload_num--; - if (!wd->preload_num) + if (wd->preload_num == 0) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,stop", "elm"); @@ -726,7 +741,6 @@ grid_clear(Evas_Object *obj, Grid *g) ecore_file_download_abort(gi->job); ecore_file_remove(gi->file); gi->job = NULL; - wd->try_num--; } if (gi->file) eina_stringshare_del(gi->file); @@ -756,7 +770,7 @@ _tile_update(Grid_Item *gi) gi->have = EINA_TRUE; gi->wd->preload_num--; - if (!gi->wd->preload_num) + if (gi->wd->preload_num == 0) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(gi->wd->scr), "elm,state,busy,stop", "elm"); @@ -774,17 +788,13 @@ _tile_downloaded(void *data, const char *file __UNUSED__, int status) gi->job = NULL; DBG("DOWNLOAD done %s", gi->file); - if ((gi->want) && (!status)) _tile_update(gi); + if (gi->want && !status) _tile_update(gi); if (status) { DBG("Download failed %s (%d) ", gi->file, status); ecore_file_remove(gi->file); } - else - gi->wd->finish_num++; - - evas_object_smart_callback_call(gi->wd->obj, SIG_DOWNLOADED, NULL); } static Grid * @@ -870,6 +880,14 @@ grid_load(Evas_Object *obj, Grid *g) { if (gi->want) { + wd->preload_num--; + if (wd->preload_num == 0) + { + edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), + "elm,state,busy,stop", "elm"); + evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, + NULL); + } evas_object_hide(gi->img); //evas_object_hide(gi->txt); evas_object_image_file_set(gi->img, NULL, NULL); @@ -882,18 +900,8 @@ grid_load(Evas_Object *obj, Grid *g) ecore_file_download_abort(gi->job); ecore_file_remove(gi->file); gi->job = NULL; - wd->try_num--; } gi->download = EINA_FALSE; - wd->preload_num--; - if (!wd->preload_num) - { - edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), - "elm,state,busy,stop", "elm"); - evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, - NULL); - } - } else if (gi->have) { @@ -965,7 +973,7 @@ grid_load(Evas_Object *obj, Grid *g) eina_matrixsparse_data_idx_set(g->grid, y, x, gi); } - if ((!gi->have) && (!gi->download)) + if (!gi->have && !gi->download) { char buf[PATH_MAX], buf2[PATH_MAX]; char *source; @@ -979,11 +987,11 @@ grid_load(Evas_Object *obj, Grid *g) snprintf(buf2, sizeof(buf2), DEST_FILE_PATH, buf, y); source = map_sources_tab[wd->source].url_cb(obj, x, y, g->zoom); - if ((!source) || (strlen(source)==0)) continue; + if(strlen(source)==0) continue; eina_stringshare_replace(&gi->file, buf2); - if ((ecore_file_exists(buf2)) || (g == eina_list_data_get(wd->grids))) + if (ecore_file_exists(buf2) || g == eina_list_data_get(wd->grids)) { gi->download = EINA_TRUE; wd->preload_num++; @@ -1002,10 +1010,8 @@ grid_load(Evas_Object *obj, Grid *g) { DBG("DOWNLOAD %s \t in %s", source, buf2); ecore_file_download(source, buf2, _tile_downloaded, NULL, gi, &(gi->job)); - if (!gi->job) - DBG("Can't start to download %s", buf); - else - wd->try_num++; + if (!gi->job) + DBG("Can't start to download %s", buf); } } if (source) free(source); @@ -1046,7 +1052,7 @@ _smooth_update(Evas_Object *obj) EINA_ITERATOR_FOREACH(it, cell) { Grid_Item *gi = eina_matrixsparse_cell_data_get(cell); - evas_object_image_smooth_scale_set(gi->img, (!wd->nosmooth)); + evas_object_image_smooth_scale_set(gi->img, (wd->nosmooth == 0)); } eina_iterator_free(it); } @@ -1076,7 +1082,7 @@ _scr_timeout(void *data) Widget_Data *wd = elm_widget_data_get(data); if (!wd) return ECORE_CALLBACK_CANCEL; wd->nosmooth--; - if (!wd->nosmooth) _smooth_update(data); + if (wd->nosmooth == 0) _smooth_update(data); wd->scr_timer = NULL; return ECORE_CALLBACK_CANCEL; } @@ -1163,7 +1169,7 @@ _zoom_anim(void *data) if (!go) { wd->nosmooth--; - if (!wd->nosmooth) _smooth_update(data); + if (wd->nosmooth == 0) _smooth_update(data); wd->zoom_animator = NULL; evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); } @@ -1182,113 +1188,116 @@ _long_press(void *data) } static void -_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); - Evas_Event_Mouse_Down *ev = event_info; - Event *ev0; + Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down*)event_info; + struct event_t *ev0; - ev0 = get_event_object(data, 0); - if (ev0) return; - ev0 = create_event_object(data, obj, 0); - if (!ev0) return; - - ev0->hold_timer = NULL; - ev0->prev.x = ev->output.x; - ev0->prev.y = ev->output.y; + ev0 = get_event_object(0); + if(!ev0){ + ev0 = create_event_object(obj, 0); + if(ev0){ + ev0->hold_timer = NULL; + ev0->prev.x = ev->output.x; + ev0->prev.y = ev->output.y; + }else return; + }else return; if (!wd) return; if (ev->button != 1) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE; else wd->on_hold = EINA_FALSE; if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) - evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, ev); + evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, ev); else - evas_object_smart_callback_call(data, SIG_PRESS, ev); + evas_object_smart_callback_call(data, SIG_PRESS, ev); wd->longpressed = EINA_FALSE; if (wd->long_timer) ecore_timer_del(wd->long_timer); wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data); } static void -_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); - Evas_Event_Mouse_Move *move = event_info; - Event *ev0; - - if (wd->pinch_zoom) return; - ev0 = get_event_object(data, 0); - if (!ev0) return; + Evas_Event_Mouse_Move *move = (Evas_Event_Mouse_Move *)event_info; + struct event_t *ev0; + if(wd->pinch_zoom) return; + ev0 = get_event_object(0); + if(ev0 == NULL) return; + ev0->prev.x = move->cur.output.x; ev0->prev.y = move->cur.output.y; } static void -_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Up *ev = event_info; + int mdevice; - Event *ev0; - Event *ev1; + struct event_t *ev0; + struct event_t *ev1 = NULL; - ev0 = get_event_object(data, 0); - if (ev0) - { - mdevice = get_multi_device(data); - if (mdevice == 0) - { - if (ev0->hold_timer) - { - ecore_timer_del(ev0->hold_timer); - ev0->hold_timer = NULL; - } - elm_smart_scroller_hold_set(wd->scr, 0); - elm_smart_scroller_freeze_set(wd->scr, 0); - wd->pinch_zoom = EINA_FALSE; - } - else - { - ev1 = get_event_object(data, mdevice); - if (ev1) - ev1->hold_timer = ecore_timer_add(0.35, _hold_timer_cb, ev1); - } - destroy_event_object(data, ev0); - } - + ev0 = get_event_object(0); + if(ev0 != NULL) { + mdevice = get_multi_device(); + if(mdevice == 0) { + if(ev0->hold_timer == NULL){ + }else{ + ecore_timer_del(ev0->hold_timer); + ev0->hold_timer = NULL; + } + elm_smart_scroller_hold_set(wd->scr, 0); + elm_smart_scroller_freeze_set(wd->scr, 0); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 0); + elm_smart_scroller_freeze_bounce_animator_set(wd->scr, 0); + wd->pinch_zoom = EINA_FALSE; + }else{ + ev1 = get_event_object(mdevice); + if(ev1 != NULL){ + ev1->hold_timer = ecore_timer_add(0.35f, hold_timer_cb, ev1); + } + } + destroy_event_object(ev0); + }else{ + DBG("Cannot get event0"); + } if (!wd) return; if (ev->button != 1) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE; else wd->on_hold = EINA_FALSE; - if (wd->long_timer) - { - ecore_timer_del(wd->long_timer); - wd->long_timer = NULL; - } - if (!wd->on_hold) evas_object_smart_callback_call(data, SIG_CLICKED, ev); + if (wd->long_timer){ + ecore_timer_del(wd->long_timer); + wd->long_timer = NULL; + } + if (!wd->on_hold) + evas_object_smart_callback_call(data, SIG_CLICKED, ev); wd->on_hold = EINA_FALSE; } static void -_mouse_multi_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_multi_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); - Event *ev; + struct event_t *ev; Evas_Event_Multi_Down *down = event_info; elm_smart_scroller_hold_set(wd->scr, 1); elm_smart_scroller_freeze_set(wd->scr, 1); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 1); + elm_smart_scroller_freeze_bounce_animator_set(wd->scr, 1); - ev = get_event_object(data, down->device); - if (ev) goto done; + ev = get_event_object(down->device); + if(ev) goto done; - ev = create_event_object(data, obj, down->device); - if (!ev) - { - DBG("Failed : create_event_object"); - goto done; - } + ev = create_event_object(obj, down->device); + if(!ev){ + DBG("Failed : create_event_object"); + goto done; + } wd->pinch_zoom = EINA_FALSE; @@ -1298,113 +1307,95 @@ _mouse_multi_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *eve done: return; +error: + elm_smart_scroller_hold_set(wd->scr, 0); + elm_smart_scroller_freeze_set(wd->scr, 0); + elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 0); + elm_smart_scroller_freeze_bounce_animator_set(wd->scr, 0); + } static void -_mouse_multi_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_multi_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); - Evas_Event_Multi_Move *move = event_info; - int dis_new, zoom; - Event *ev0; - Event *ev; - - if (wd->pinch_zoom) return; - ev = get_event_object(data, move->device); - if (!ev) return; + Evas_Event_Multi_Move *move = (Evas_Event_Multi_Move *)event_info; + int dis_new; + struct event_t *ev0; + struct event_t *ev; + + if(wd->pinch_zoom) return; + ev = get_event_object(move->device); + if(ev == NULL) { + DBG("Cannot get multi device"); + return; + } ev->prev.x = move->cur.output.x; ev->prev.y = move->cur.output.y; - ev0 = get_event_object(data, 0); - if (!ev0) return; + ev0 = get_event_object(0); + if(ev0 == NULL) { + DBG("Cannot get device0"); + return; + } dis_new = get_distance(ev0->prev.x, ev0->prev.y, ev->prev.x, ev->prev.y); - zoom = wd->zoom; + int zoom = wd->zoom; - if (dis_old) - { - if (((dis_old - dis_new) > 0) && - (ev->pinch_dis > elm_finger_size_get())) - { - wd->pinch_zoom = EINA_TRUE; - zoom--; - elm_map_zoom_set(data, zoom); - ev->pinch_dis = 0; - } - else if (((dis_old - dis_new) < 0) && - (ev->pinch_dis < -elm_finger_size_get())) - { - wd->pinch_zoom = EINA_TRUE; - zoom++; - elm_map_zoom_set(data, zoom); - ev->pinch_dis = 0; - } - ev->pinch_dis += (dis_old - dis_new); - } + if(dis_old != 0) { + if(dis_old - dis_new > 0 && ev->pinch_dis > TOUCH_HOLD_RANGE){ + wd->pinch_zoom = EINA_TRUE; + --zoom; + elm_map_zoom_set(data, zoom); + ev->pinch_dis = 0; + }else if(dis_old - dis_new < 0 && ev->pinch_dis < -TOUCH_HOLD_RANGE){ + wd->pinch_zoom = EINA_TRUE; + ++zoom; + elm_map_zoom_set(data, zoom); + ev->pinch_dis = 0; + } + + ev->pinch_dis += (dis_old - dis_new); + } dis_old = dis_new; } static void -_mouse_multi_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_mouse_multi_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) { - Evas_Event_Multi_Up *up = event_info; - Event *ev0; - Event *ev; + Evas_Event_Multi_Up *up = (Evas_Event_Multi_Up *)event_info; + struct event_t *ev0; + struct event_t *ev; - ev = get_event_object(data, up->device); - if (!ev) - { - DBG("Cannot get multi device"); - return; - } + ev = get_event_object(up->device); + if(ev == NULL){ + DBG("Cannot get multi device"); + return; + } dis_old = 0; - ev0 = get_event_object(data, 0); - if (ev0) - ev0->hold_timer = ecore_timer_add(0.35, _hold_timer_cb, ev0); - else - { - if (ev->hold_timer) - { - ecore_timer_del(ev->hold_timer); - ev->hold_timer = NULL; - } - } - destroy_event_object(data, ev); + ev0 = get_event_object(0); + if(ev0){ + ev0->hold_timer = ecore_timer_add(0.35f, hold_timer_cb, ev0); + }else{ + if(ev->hold_timer == NULL) { + } else { + ecore_timer_del(ev->hold_timer); + ev->hold_timer = NULL; + } + } + destroy_event_object(ev); } static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL; -static Eina_Bool -_hold_timer_cb(void *data) -{ - Event *ev0 = data; - - ev0->hold_timer = NULL; - return ECORE_CALLBACK_CANCEL; -} - -static void -_rect_resize_cb(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Widget_Data *wd = elm_widget_data_get(data); - int x, y, w, h; - - evas_object_geometry_get(wd->rect, &x, &y, &w, &h); - evas_object_geometry_get(wd->pan_smart, &x, &y, &w, &h); - evas_object_resize(wd->rect, w, h); - evas_object_move(wd->rect, x, y); -} - static void _del_hook(Evas_Object *obj) { Elm_Map_Group_Class *group_clas; Elm_Map_Marker_Class *marker_clas; Widget_Data *wd = elm_widget_data_get(obj); - Eina_List *l; - Event *ev; if (!wd) return; @@ -1422,17 +1413,12 @@ _del_hook(Evas_Object *obj) free(marker_clas); } - EINA_LIST_FOREACH(wd->s_event_list, l, ev) - { - destroy_event_object(obj, ev); - } - if (wd->calc_job) ecore_job_del(wd->calc_job); if (wd->scr_timer) ecore_timer_del(wd->scr_timer); if (wd->zoom_animator) ecore_animator_del(wd->zoom_animator); if (wd->long_timer) ecore_timer_del(wd->long_timer); - if ((wd->api) && (wd->api->obj_unhook)) wd->api->obj_unhook(obj); + if ((wd->api) && (wd->api->obj_unhook)) wd->api->obj_unhook(obj); free(wd); } @@ -1479,23 +1465,6 @@ _del_pre_hook(Evas_Object *obj) } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->obj, "elm,action,focus", "elm"); - evas_object_focus_set(wd->obj, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->obj, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->obj, EINA_FALSE); - } -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -1581,13 +1550,6 @@ _pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) } static void -_pan_min_get(Evas_Object *obj __UNUSED__, Evas_Coord *x, Evas_Coord *y) -{ - if (x) *x = 0; - if (y) *y = 0; -} - -static void _pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { Pan *sd = evas_object_smart_data_get(obj); @@ -1731,7 +1693,7 @@ _group_object_create(Marker_Group *group) Evas_Object *icon = NULL; if (group->obj) return; - if ((!group->clas->priv.objs_notused) || (eina_list_count(group->markers) == 1)) + if (!group->clas->priv.objs_notused || eina_list_count(group->markers) == 1) { //set icon and style if (eina_list_count(group->markers) == 1) @@ -1870,7 +1832,7 @@ _group_bubble_content_update(Marker_Group *group) group->sc = elm_scroller_add(group->bubble); elm_scroller_content_min_limit(group->sc, EINA_FALSE, EINA_TRUE); elm_scroller_policy_set(group->sc, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF); - elm_scroller_bounce_set(group->sc, _elm_config->thumbscroll_bounce_enable, EINA_FALSE); + elm_scroller_bounce_set(group->sc, EINA_TRUE, EINA_FALSE); edje_object_part_swallow(group->bubble, "elm.swallow.content", group->sc); evas_object_show(group->sc); evas_object_smart_member_add(group->sc, @@ -1892,7 +1854,7 @@ _group_bubble_content_update(Marker_Group *group) EINA_LIST_FOREACH(group->markers, l, marker) { if (i >= group->wd->markers_max_num) break; - if ((!marker->content) && (marker->clas->func.get)) + if (!marker->content && marker->clas->func.get) marker->content = marker->clas->func.get(group->wd->obj, marker, marker->data); else if (marker->content) elm_box_unpack(group->bx, marker->content); @@ -1914,7 +1876,7 @@ _group_bubble_content_free(Marker_Group *group) if (!group->sc) return; EINA_LIST_FOREACH(group->markers, l, marker) { - if ((marker->content) && (marker->clas->func.del)) + if (marker->content && marker->clas->func.del) marker->clas->func.del(group->wd->obj, marker, marker->data, marker->content); else if (marker->content) evas_object_del(marker->content); @@ -1944,7 +1906,7 @@ _group_bubble_place(Marker_Group *group) Evas_Coord xx, yy, ww, hh; const char *s; - if ((!group->bubble) || (!group->obj)) return; + if (!group->bubble || !group->obj) return; evas_object_geometry_get(group->obj, &x, &y, &w, NULL); edje_object_size_min_calc(group->bubble, NULL, &hh); @@ -1994,84 +1956,6 @@ _group_open_cb(void *data, Evas_Object *obj __UNUSED__, const char *emission __U _group_bubble_create(group); } -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - double zoom; - Evas_Coord x = 0; - Evas_Coord y = 0; - Evas_Coord step_x = 0; - Evas_Coord step_y = 0; - Evas_Coord v_w = 0; - Evas_Coord v_h = 0; - Evas_Coord page_x = 0; - Evas_Coord page_y = 0; - - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - - elm_smart_scroller_child_pos_get(wd->scr, &x, &y); - elm_smart_scroller_step_size_get(wd->scr, &step_x, &step_y); - elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y); - elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); - - if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) - { - x -= step_x; - } - else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) - { - x += step_x; - } - else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) - { - y -= step_y; - } - else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) - { - y += step_y; - } - else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior"))) - { - if (page_y < 0) - y -= -(page_y * v_h) / 100; - else - y -= page_y; - } - else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next"))) - { - if (page_y < 0) - y += -(page_y * v_h) / 100; - else - y += page_y; - } - else if (!strcmp(ev->keyname, "KP_Add")) - { - zoom = elm_map_zoom_get(obj); - zoom += 1; - elm_map_zoom_mode_set(obj, ELM_MAP_ZOOM_MODE_MANUAL); - elm_map_zoom_set(obj, zoom); - return EINA_TRUE; - } - else if (!strcmp(ev->keyname, "KP_Subtract")) - { - zoom = elm_map_zoom_get(obj); - zoom -= 1; - elm_map_zoom_mode_set(obj, ELM_MAP_ZOOM_MODE_MANUAL); - elm_map_zoom_set(obj, zoom); - return EINA_TRUE; - } - else return EINA_FALSE; - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - elm_smart_scroller_child_pos_set(wd->scr, x, y); - - return EINA_TRUE; -} - static int idnum = 1; /** @@ -2089,10 +1973,9 @@ elm_map_add(Evas_Object *parent) Widget_Data *wd; Evas_Coord minw, minh; Evas_Object *obj; + Eina_Bool ret = EINA_FALSE; + int idx; static Evas_Smart *smart = NULL; - Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); if (!ecore_file_download_protocol_available("http://")) { @@ -2101,19 +1984,16 @@ elm_map_add(Evas_Object *parent) } wd = ELM_NEW(Widget_Data); + wd->api = NULL; e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "map"); elm_widget_type_set(obj, "map"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); wd->scr = elm_smart_scroller_add(e); elm_smart_scroller_widget_set(wd->scr, obj); @@ -2128,16 +2008,22 @@ elm_map_add(Evas_Object *parent) evas_object_smart_callback_add(wd->scr, "drag,stop", _scr_drag_stop, obj); evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj); - elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce); - - wd->api = module(obj); - if ((wd->api) && (wd->api->obj_hook)) wd->api->obj_hook(obj); + elm_smart_scroller_bounce_allow_set(wd->scr, EINA_TRUE, EINA_TRUE); wd->obj = obj; wd->markers_max_num = 30; wd->source = ELM_MAP_SOURCE_MAPNIK; + for(idx=ELM_MAP_SOURCE_MAPNIK; idx<=ELM_MAP_SOURCE_CUSTOM_6; idx++) + if(map_sources_tab[idx].use_module == EINA_TRUE){ + if(!wd->api){ + wd->api = module(obj); + if ((wd->api) && (wd->api->obj_hook)) ret = wd->api->obj_hook(obj); + if (!ret) DBG("Failed : loading module [%s]", elm_map_source_name_get(idx)); + } + } + evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj); evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj); evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj); @@ -2166,24 +2052,23 @@ elm_map_add(Evas_Object *parent) } elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart, - _pan_set, _pan_get, _pan_max_get, - _pan_min_get, _pan_child_size_get); + _pan_set, _pan_get, + _pan_max_get, _pan_child_size_get); wd->rect = evas_object_rectangle_add(e); - evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_RESIZE, - _rect_resize_cb, obj); + evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_RESIZE, _rect_resize_cb, obj); evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, obj); - evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_MOVE, - _mouse_move, obj); evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); + evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_MOVE, + _mouse_move, obj); evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_DOWN, - _mouse_multi_down, obj); + _mouse_multi_down, obj); evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_MOVE, - _mouse_multi_move, obj); + _mouse_multi_move, obj); evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_UP, - _mouse_multi_up, obj); + _mouse_multi_up, obj); evas_object_smart_member_add(wd->rect, wd->pan_smart); elm_widget_sub_object_add(obj, wd->rect); @@ -2198,7 +2083,7 @@ elm_map_add(Evas_Object *parent) wd->tsize = 256; edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), - &minw, &minh); + &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); wd->paused = EINA_TRUE; @@ -2246,6 +2131,7 @@ elm_map_zoom_set(Evas_Object *obj, int zoom) if (zoom < map_sources_tab[wd->source].zoom_min) zoom = map_sources_tab[wd->source].zoom_min; if (zoom == wd->zoom) return; + if (wd->zoom_animator) return; wd->zoom = zoom; wd->size.ow = wd->size.w; @@ -2507,7 +2393,7 @@ elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat) if (wd->zoom_animator) { wd->nosmooth--; - if (!wd->nosmooth) _smooth_update(obj); + if (wd->nosmooth == 0) _smooth_update(obj); ecore_animator_del(wd->zoom_animator); wd->zoom_animator = NULL; zoom_do(obj, 1.0); @@ -2680,35 +2566,6 @@ elm_map_paused_markers_get(const Evas_Object *obj) } /** - * Get the information of downloading status - * - * This gets the current downloading status for the map object. - * - * @param obj The map object - * @param try_num the number of download trying map - * @param finish_num the number of downloaded map - * - * @ingroup Map - */ - -EAPI void -elm_map_utils_downloading_status_get(const Evas_Object *obj, int *try_num, int *finish_num) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - - if (try_num) - { - *try_num = wd->try_num; - } - - if (finish_num) - { - *finish_num = wd->finish_num; - } -} -/** * Convert a pixel coordinate (x,y) into a geographic coordinate (longitude, latitude). * * @param obj The map object @@ -2726,9 +2583,11 @@ elm_map_utils_convert_coord_into_geo(const Evas_Object *obj, int x, int y, int s Widget_Data *wd = elm_widget_data_get(obj); int zoom = floor(log2(size/256)); - if (elm_map_source_get(obj) == ELM_MAP_SOURCE_MODULE) - if ((wd->api) && (wd->api->obj_convert_coord_into_geo)) - if (wd->api->obj_convert_coord_into_geo(obj, zoom, x, y, size, lon, lat)) return; + if(map_sources_tab[elm_map_source_get(obj)].use_module == EINA_TRUE) + if(wd->api) if ((wd->api) && (wd->api->obj_convert_coord_into_geo)){ + if(wd->api->obj_convert_coord_into_geo(obj, zoom, x, y, size, lon, lat)==EINA_TRUE) + return; + } if (lon) { @@ -2759,9 +2618,11 @@ elm_map_utils_convert_geo_into_coord(const Evas_Object *obj, double lon, double Widget_Data *wd = elm_widget_data_get(obj); int zoom = floor(log2(size/256)); - if (elm_map_source_get(obj) == ELM_MAP_SOURCE_MODULE) - if ((wd->api) && (wd->api->obj_convert_geo_into_coord)) - if (wd->api->obj_convert_geo_into_coord(obj, zoom, lon, lat, size, x, y)) return; + if(map_sources_tab[elm_map_source_get(obj)].use_module == EINA_TRUE) + if(wd->api) if ((wd->api) && (wd->api->obj_convert_geo_into_coord)){ + if(wd->api->obj_convert_geo_into_coord(obj, zoom, lon, lat, size, x, y)==EINA_TRUE) + return; + } if (x) *x = floor((lon + 180.0) / 360.0 * size); @@ -2800,8 +2661,7 @@ elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Clas Evas_Object *o; if (!wd) return NULL; - EINA_SAFETY_ON_NULL_RETURN_VAL(clas_group, NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(clas, NULL); + if (!clas_group || !clas) return NULL; Elm_Map_Marker *marker = ELM_NEW(Elm_Map_Marker); @@ -2973,13 +2833,13 @@ elm_map_marker_remove(Elm_Map_Marker *marker) Eina_List *groups; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN(marker); + if (!marker) return; wd = marker->wd; if (!wd) return; for (i = 0; i <= ZOOM_MAX; i++) { marker->groups[i]->markers = eina_list_remove(marker->groups[i]->markers, marker); - if (!eina_list_count(marker->groups[i]->markers)) + if (eina_list_count(marker->groups[i]->markers) == 0) { groups = eina_matrixsparse_cell_data_get(marker->groups[i]->cell); groups = eina_list_remove(groups, marker->groups[i]); @@ -3006,14 +2866,14 @@ elm_map_marker_remove(Elm_Map_Marker *marker) if (marker->groups[i]->h > marker->groups[i]->clas->priv.edje_max_h) marker->groups[i]->h = marker->groups[i]->clas->priv.edje_max_h; } - if ((marker->groups[i]->obj) && (eina_list_count(marker->groups[i]->markers) == 1)) + if (marker->groups[i]->obj && eina_list_count(marker->groups[i]->markers) == 1) { _group_object_free(marker->groups[i]); _group_object_create(marker->groups[i]); } } - if ((marker->content) && (marker->clas->func.del)) + if (marker->content && marker->clas->func.del) marker->clas->func.del(marker->wd->obj, marker, marker->data, marker->content); else if (marker->content) evas_object_del(marker->content); @@ -3038,7 +2898,7 @@ elm_map_marker_remove(Elm_Map_Marker *marker) EAPI void elm_map_marker_bring_in(Elm_Map_Marker *marker) { - EINA_SAFETY_ON_NULL_RETURN(marker); + if (!marker) return; elm_map_geo_region_bring_in(marker->wd->obj, marker->longitude, marker->latitude); } @@ -3053,7 +2913,7 @@ elm_map_marker_bring_in(Elm_Map_Marker *marker) EAPI void elm_map_marker_show(Elm_Map_Marker *marker) { - EINA_SAFETY_ON_NULL_RETURN(marker); + if (!marker) return; elm_map_geo_region_show(marker->wd->obj, marker->longitude, marker->latitude); } @@ -3078,22 +2938,22 @@ elm_map_markers_list_show(Eina_List *markers) Evas_Coord rw, rh, xc, yc; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN(markers); + if (!markers) return; EINA_LIST_FOREACH(markers, l, marker) { wd = marker->wd; - if ((!m_min_lon) || (marker->longitude < m_min_lon->longitude)) + if (!m_min_lon || marker->longitude < m_min_lon->longitude) m_min_lon = marker; - if ((!m_max_lon) || (marker->longitude > m_max_lon->longitude)) + if (!m_max_lon || marker->longitude > m_max_lon->longitude) m_max_lon = marker; - if ((!m_min_lat) || (marker->latitude > m_min_lat->latitude)) + if (!m_min_lat || marker->latitude > m_min_lat->latitude) m_min_lat = marker; - if ((!m_max_lat) || (marker->latitude < m_max_lat->latitude)) + if (!m_max_lat || marker->latitude < m_max_lat->latitude) m_max_lat = marker; } @@ -3106,10 +2966,10 @@ elm_map_markers_list_show(Eina_List *markers) Evas_Coord size = pow(2.0, zoom)*wd->tsize; elm_map_utils_convert_geo_into_coord(wd->obj, lon, lat, size, &xc, &yc); - if ((m_min_lon->x[zoom] - wd->marker_max_w >= xc-rw/2) - && (m_min_lat->y[zoom] - wd->marker_max_h >= yc-rh/2) - && (m_max_lon->x[zoom] + wd->marker_max_w <= xc+rw/2) - && (m_max_lat->y[zoom] + wd->marker_max_h <= yc+rh/2)) + if (m_min_lon->x[zoom] - wd->marker_max_w >= xc-rw/2 + && m_min_lat->y[zoom] - wd->marker_max_h >= yc-rh/2 + && m_max_lon->x[zoom] + wd->marker_max_w <= xc+rw/2 + && m_max_lat->y[zoom] + wd->marker_max_h <= yc+rh/2) break; } @@ -3147,9 +3007,9 @@ elm_map_max_marker_per_group_set(Evas_Object *obj, int max) * @ingroup Map */ EAPI Evas_Object * -elm_map_marker_object_get(const Elm_Map_Marker *marker) +elm_map_marker_object_get(Elm_Map_Marker *marker) { - EINA_SAFETY_ON_NULL_RETURN_VAL(marker, NULL); + if (!marker) return NULL; return marker->content; } @@ -3163,7 +3023,7 @@ elm_map_marker_object_get(const Elm_Map_Marker *marker) EAPI void elm_map_marker_update(Elm_Map_Marker *marker) { - EINA_SAFETY_ON_NULL_RETURN(marker); + if (!marker) return; if (marker->content) { if (marker->clas->func.del) @@ -3229,7 +3089,7 @@ elm_map_group_class_new(Evas_Object *obj) EAPI void elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; eina_stringshare_replace(&clas->style, style); } @@ -3246,7 +3106,7 @@ elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style) EAPI void elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFunc icon_get) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; clas->func.icon_get = icon_get; } @@ -3261,7 +3121,7 @@ elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFun EAPI void elm_map_group_class_data_set(Elm_Map_Group_Class *clas, void *data) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; clas->data = data; } @@ -3278,7 +3138,7 @@ elm_map_group_class_data_set(Elm_Map_Group_Class *clas, void *data) EAPI void elm_map_group_class_zoom_displayed_set(Elm_Map_Group_Class *clas, int zoom) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; clas->zoom_displayed = zoom; } @@ -3293,7 +3153,7 @@ elm_map_group_class_zoom_displayed_set(Elm_Map_Group_Class *clas, int zoom) EAPI void elm_map_group_class_zoom_grouped_set(Elm_Map_Group_Class *clas, int zoom) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; clas->zoom_grouped = zoom; } @@ -3312,7 +3172,7 @@ elm_map_group_class_hide_set(Evas_Object *obj, Elm_Map_Group_Class *clas, Eina_B ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; if (clas->hide == hide) return; clas->hide = hide; if (wd->grids) @@ -3357,7 +3217,7 @@ elm_map_marker_class_new(Evas_Object *obj) EAPI void elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; eina_stringshare_replace(&clas->style, style); } @@ -3374,7 +3234,7 @@ elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style) EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGetFunc icon_get) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; clas->func.icon_get = icon_get; } @@ -3393,7 +3253,7 @@ elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGet EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc get) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; clas->func.get = get; } @@ -3411,7 +3271,7 @@ elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc EAPI void elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc del) { - EINA_SAFETY_ON_NULL_RETURN(clas); + if (!clas) return; clas->func.del = del; } @@ -3443,7 +3303,7 @@ elm_map_source_set(Evas_Object *obj, Elm_Map_Sources source) wd->source = source; zoom = wd->zoom; wd->zoom = -1; - + if (map_sources_tab[wd->source].zoom_max < zoom) zoom = map_sources_tab[wd->source].zoom_max; if (map_sources_tab[wd->source].zoom_min > zoom) @@ -3485,8 +3345,7 @@ elm_map_source_get(const Evas_Object *obj) EAPI void elm_map_source_custom_api_set(Elm_Map_Sources source, const char *name, int zoom_min, int zoom_max, ElmMapSourceURLFunc url_cb) { - EINA_SAFETY_ON_NULL_RETURN(name); - EINA_SAFETY_ON_NULL_RETURN(url_cb); + if (!name || !url_cb) return; map_sources_tab[source].name = name; map_sources_tab[source].zoom_min = zoom_min; map_sources_tab[source].zoom_max = zoom_max; @@ -3537,7 +3396,7 @@ elm_map_source_name_get(Elm_Map_Sources source) static char * -_mapnik_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) +_mapnik_url_cb(void *data, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", @@ -3546,82 +3405,43 @@ _mapnik_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) } static char * -_osmarender_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) +_osmarender_url_cb(void * data, int x, int y, int zoom) { char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), - "http://tah.openstreetmap.org/Tiles/tile/%d/%d/%d.png", + snprintf(buf, sizeof(buf), "http://tah.openstreetmap.org/Tiles/tile/%d/%d/%d.png", zoom, x, y); return strdup(buf); } static char * -_cyclemap_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) +_cyclemap_url_cb(void *data, int x, int y, int zoom) { char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), - "http://andy.sandbox.cloudmade.com/tiles/cycle/%d/%d/%d.png", + snprintf(buf, sizeof(buf), "http://andy.sandbox.cloudmade.com/tiles/cycle/%d/%d/%d.png", zoom, x, y); return strdup(buf); } static char * -_maplint_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) +_maplint_url_cb(void *data, int x, int y, int zoom) { char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), - "http://tah.openstreetmap.org/Tiles/maplint/%d/%d/%d.png", + snprintf(buf, sizeof(buf), "http://tah.openstreetmap.org/Tiles/maplint/%d/%d/%d.png", zoom, x, y); return strdup(buf); } static char * -_custom1_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) +_decarta_url_cb(void *data, int x, int y, int zoom) { - return strdup(""); -} - -static char * -_custom2_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) -{ - return strdup(""); -} - -static char * -_custom3_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) -{ - return strdup(""); -} - -static char * -_custom4_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) -{ - return strdup(""); -} - -static char * -_custom5_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) -{ - return strdup(""); -} - -static char * -_custom6_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom) -{ - return strdup(""); -} - -static char * -_module_url_cb(Evas_Object *obj, int x, int y, int zoom) -{ - char *buf = NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (elm_map_source_get(obj) == ELM_MAP_SOURCE_MODULE) - if ((wd->api) && (wd->api->obj_url_request)) - buf = wd->api->obj_url_request(obj, x, y, zoom); + char *url = NULL; + Widget_Data *wd = elm_widget_data_get(data); + if(map_sources_tab[elm_map_source_get(data)].use_module == EINA_TRUE) + if(wd->api) if ((wd->api) && (wd->api->obj_url_request)) + url = wd->api->obj_url_request(data, x, y, zoom); - if (!buf) buf = strdup(""); + if(!url) url = strdup(""); - return buf; + return url; } diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index 38fea0e..7e2d017 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -168,11 +168,8 @@ elm_mapbuf_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "mapbuf"); elm_widget_type_set(obj, "mapbuf"); @@ -180,7 +177,6 @@ elm_mapbuf_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, NULL); @@ -217,7 +213,6 @@ elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) wd->content = content; if (content) { - evas_object_data_set(content, "_elm_leaveme", (void *)1); elm_widget_sub_object_add(content, obj); evas_object_smart_member_add(content, obj); evas_object_clip_set(content, evas_object_clip_get(obj)); @@ -230,25 +225,6 @@ elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content) } /** - * Get the mapbuf front content - * - * Return the content object which is set for this widget. - * - * @param obj The mapbuf object - * @return The content that is being used - * - * @ingroup Mapbuf - */ -EAPI Evas_Object * -elm_mapbuf_content_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->content; -} - -/** * Unset the mapbuf front content * * Unparent and return the content object which was set for this widget. @@ -267,10 +243,9 @@ elm_mapbuf_content_unset(Evas_Object *obj) if (!wd) return NULL; if (!wd->content) return NULL; content = wd->content; - elm_widget_sub_object_del(obj, content); - evas_object_smart_member_del(content); - evas_object_clip_unset(content); - evas_object_data_del(content, "_elm_leaveme"); + elm_widget_sub_object_del(obj, wd->content); + evas_object_smart_member_del(wd->content); + evas_object_clip_unset(wd->content); wd->content = NULL; return content; } diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c index e9aa59d..43d1224 100644 --- a/src/lib/elm_menu.c +++ b/src/lib/elm_menu.c @@ -13,28 +13,32 @@ typedef struct _Widget_Data Widget_Data; -struct _Elm_Menu_Item +struct _Menu_Item { - Elm_Widget_Item base; + Evas_Object *menu; + Evas_Object *o; Elm_Menu_Item *parent; + + Eina_Bool separator; + Eina_Bool disabled; + + //if classic item or submenu Evas_Object *icon; - const char *icon_str; const char *label; - Evas_Smart_Cb func; - struct { - Evas_Object *hv, *bx, *location; - Eina_List *items; - Eina_Bool open : 1; - } submenu; + Evas_Smart_Cb func; + Evas_Smart_Cb del_cb; + const void *data; - Eina_Bool separator : 1; - Eina_Bool disabled : 1; + //if submenu + Eina_Bool open; + Evas_Object *hv, *bx, *location; + Eina_List *items; }; struct _Widget_Data { - Evas_Object *hv, *bx, *location, *parent, *obj; + Evas_Object *hv, *bx, *location, *parent; Eina_List *items; Evas_Coord xloc, yloc; }; @@ -45,92 +49,81 @@ static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _submenu_sizing_eval(Elm_Menu_Item *parent); static void _item_sizing_eval(Elm_Menu_Item *item); +static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _submenu_hide(Elm_Menu_Item *item); static void _submenu_open(void *data, Evas_Object *obj, const char *emission, const char *source); static void _parent_resize(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _menu_hide(void *data, Evas_Object *obj, void *event_info); static void -_del_item(Elm_Menu_Item *item) -{ - Elm_Menu_Item *child; - - elm_widget_item_pre_notify_del(item); - - EINA_LIST_FREE(item->submenu.items, child) - _del_item(child); - - if (item->label) eina_stringshare_del(item->label); - if (item->submenu.hv) evas_object_del(item->submenu.hv); - if (item->submenu.location) evas_object_del(item->submenu.location); - if (item->icon_str) eina_stringshare_del(item->icon_str); - elm_widget_item_del(item); -} - -static void _del_pre_hook(Evas_Object *obj) { - Elm_Menu_Item *item; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, obj); - evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_DEL, _parent_del, wd); - - EINA_LIST_FREE(wd->items, item) - _del_item(item); - - if (wd->hv) evas_object_del(wd->hv); - if (wd->location) evas_object_del(wd->location); } static void _del_hook(Evas_Object *obj) { + Eina_List *l, *ll = NULL; + Elm_Menu_Item *item; Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + ll = eina_list_append(ll, wd->items); + EINA_LIST_FOREACH(ll, ll, l) + { + EINA_LIST_FREE(l, item) + { + ll = eina_list_append(ll, item->items); + if (item->del_cb) item->del_cb((void*)item->data, item->o, item); + if (item->label) eina_stringshare_del(item->label); + if (item->hv) evas_object_del(item->hv); + if (item->location) evas_object_del(item->location); + free(item); + } + } + if (wd->hv) evas_object_del(wd->hv); + if (wd->location) evas_object_del(wd->location); free(wd); } static void _theme_hook(Evas_Object *obj) { - Eina_List *l, *_l, *_ll, *ll = NULL; + Eina_List *l, *_l, *ll = NULL; Elm_Menu_Item *item; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; ll = eina_list_append(ll, wd->items); - EINA_LIST_FOREACH(ll, _ll, l) + EINA_LIST_FOREACH(ll, ll, l) { EINA_LIST_FOREACH(l, _l, item) { - ll = eina_list_append(ll, item->submenu.items); + ll = eina_list_append(ll, item->items); if (item->separator) - _elm_theme_object_set(obj, item->base.view, "menu", "separator", + _elm_theme_object_set(obj, item->o, "menu", "separator", elm_widget_style_get(obj)); - else if (item->submenu.bx) + else if (item->bx) { - _elm_theme_object_set - (obj, item->base.view, "menu", "item_with_submenu", - elm_widget_style_get(obj)); + _elm_theme_object_set(obj, item->o, "menu", "item_with_submenu", + elm_widget_style_get(obj)); elm_menu_item_label_set(item, item->label); - elm_menu_item_icon_set(item, item->icon_str); + elm_menu_item_icon_set(item, item->icon); } else { - _elm_theme_object_set(obj, item->base.view, "menu", "item", + _elm_theme_object_set(obj, item->o, "menu", "item", elm_widget_style_get(obj)); elm_menu_item_label_set(item, item->label); - elm_menu_item_icon_set(item, item->icon_str); + elm_menu_item_icon_set(item, item->icon); } if (item->disabled) - edje_object_signal_emit - (item->base.view, "elm,state,disabled", "elm"); + edje_object_signal_emit(item->o, "elm,state,disabled", "elm"); else - edje_object_signal_emit - (item->base.view, "elm,state,enabled", "elm"); - edje_object_message_signal_process(item->base.view); - edje_object_scale_set(item->base.view, elm_widget_scale_get(obj) * + edje_object_signal_emit(item->o, "elm,state,enabled", "elm"); + edje_object_message_signal_process(item->o); + edje_object_scale_set(item->o, elm_widget_scale_get(obj) * _elm_config->scale); } } @@ -167,7 +160,7 @@ _sizing_eval(Evas_Object *obj) EINA_LIST_FOREACH(wd->items,l,item) { - if (item->submenu.open) _submenu_sizing_eval(item); + if (item->open) _submenu_sizing_eval(item); } } @@ -177,12 +170,12 @@ _submenu_sizing_eval(Elm_Menu_Item *parent) Eina_List *l; Elm_Menu_Item *item; Evas_Coord x_p, y_p, w_p, h_p, x2, y2, w2, h2, bx, by, bw, bh, px, py, pw, ph; - Widget_Data *wd = elm_widget_data_get(parent->base.widget); + Widget_Data *wd = elm_widget_data_get(parent->menu); if (!wd) return; - EINA_LIST_FOREACH(parent->submenu.items, l, item) _item_sizing_eval(item); - evas_object_geometry_get(parent->submenu.location, &x_p, &y_p, &w_p, &h_p); - evas_object_geometry_get(parent->base.view, &x2, &y2, &w2, &h2); - evas_object_geometry_get(parent->submenu.bx, &bx, &by, &bw, &bh); + EINA_LIST_FOREACH(parent->items,l,item) _item_sizing_eval(item); + evas_object_geometry_get(parent->location, &x_p, &y_p, &w_p, &h_p); + evas_object_geometry_get(parent->o, &x2, &y2, &w2, &h2); + evas_object_geometry_get(parent->bx, &bx, &by, &bw, &bh); evas_object_geometry_get(wd->parent, &px, &py, &pw, &ph); x_p = x2+w2; @@ -196,15 +189,15 @@ _submenu_sizing_eval(Elm_Menu_Item *parent) if (y_p < py) y_p += y_p - y_p; - evas_object_move(parent->submenu.location, x_p, y_p); - evas_object_resize(parent->submenu.location, bw, h_p); - evas_object_size_hint_min_set(parent->submenu.location, bw, h_p); - evas_object_size_hint_max_set(parent->submenu.location, bw, h_p); - elm_hover_target_set(parent->submenu.hv, parent->submenu.location); + evas_object_move(parent->location, x_p, y_p); + evas_object_resize(parent->location, bw, h_p); + evas_object_size_hint_min_set(parent->location, bw, h_p); + evas_object_size_hint_max_set(parent->location, bw, h_p); + elm_hover_target_set(parent->hv, parent->location); - EINA_LIST_FOREACH(parent->submenu.items, l, item) + EINA_LIST_FOREACH(parent->items,l,item) { - if (item->submenu.open) + if (item->open) _submenu_sizing_eval(item); } } @@ -215,38 +208,36 @@ _item_sizing_eval(Elm_Menu_Item *item) Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; if (!item->separator) elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc(item->base.view, &minw, &minh, minw, minh); + edje_object_size_min_restricted_calc(item->o, &minw, &minh, minw, minh); if (!item->separator) elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(item->base.view, minw, minh); - evas_object_size_hint_max_set(item->base.view, maxw, maxh); + evas_object_size_hint_min_set(item->o, minw, minh); + evas_object_size_hint_max_set(item->o, maxw, maxh); } static void -_menu_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { _sizing_eval(data); } static void -_parent_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_menu_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { _sizing_eval(data); } static void -_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +_parent_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Widget_Data *wd = data; - evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, _parent_resize, wd->obj); - wd->parent = NULL; + _sizing_eval(data); } static void _item_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Elm_Menu_Item *item = data; - if (item->submenu.open) _submenu_sizing_eval(item); + if (item->open) _submenu_sizing_eval(item); } static void @@ -268,7 +259,7 @@ _menu_hide(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) EINA_LIST_FOREACH(wd->items, l, item2) { - if (item2->submenu.open) _submenu_hide(item2); + if (item2->open) _submenu_hide(item2); } } @@ -277,27 +268,27 @@ _submenu_hide(Elm_Menu_Item *item) { Eina_List *l; Elm_Menu_Item *item2; - evas_object_hide(item->submenu.hv); - item->submenu.open = EINA_FALSE; - EINA_LIST_FOREACH(item->submenu.items, l, item2) + evas_object_hide(item->hv); + item->open = EINA_FALSE; + EINA_LIST_FOREACH(item->items, l, item2) { - if (item2->submenu.open) _submenu_hide(item2); + if (item2->open) _submenu_hide(item2); } } static void _menu_item_select(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - Elm_Menu_Item *item = data; - if (item->submenu.items) + Elm_Menu_Item *it = data; + if (it->items) { - if (!item->submenu.open) _submenu_open(item, NULL, NULL, NULL); - else _submenu_hide(item); + if (!it->open) _submenu_open(it, NULL, NULL, NULL); + else _submenu_hide(it); } else - _menu_hide(item->base.widget, NULL, NULL); + _menu_hide(it->menu, NULL, NULL); - if (item->func) item->func((void *)(item->base.data), item->base.widget, item); + if (it->func) it->func((void *)(it->data), it->menu, it); } static void @@ -308,17 +299,17 @@ _menu_item_activate(void *data, Evas_Object *obj __UNUSED__, const char *emissio Elm_Menu_Item *item = data; if (item->parent) { - EINA_LIST_FOREACH(item->parent->submenu.items, l, item2) + EINA_LIST_FOREACH(item->parent->items, l, item2) { - if ((item2->submenu.open) && (item2 != item)) _submenu_hide(item2); + if ((item2->open) && (item2 != item)) _submenu_hide(item2); } } else { - Widget_Data *wd = elm_widget_data_get(item->base.widget); + Widget_Data *wd = elm_widget_data_get(item->menu); EINA_LIST_FOREACH(wd->items, l, item2) { - if ((item2->submenu.open) && (item2 != item)) _submenu_hide(item2); + if ((item2->open) && (item2 != item)) _submenu_hide(item2); } } } @@ -326,10 +317,10 @@ _menu_item_activate(void *data, Evas_Object *obj __UNUSED__, const char *emissio static void _submenu_open(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - Elm_Menu_Item *item = data; - item->submenu.open = EINA_TRUE; - evas_object_show(item->submenu.hv); - _sizing_eval(item->base.widget); + Elm_Menu_Item *it = data; + it->open = EINA_TRUE; + evas_object_show(it->hv); + _sizing_eval(it->menu); } static void @@ -343,59 +334,59 @@ _show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i static void _item_obj_create(Elm_Menu_Item *item) { - Widget_Data *wd = elm_widget_data_get(item->base.widget); + Widget_Data *wd = elm_widget_data_get(item->menu); if (!wd) return; - item->base.view = edje_object_add(evas_object_evas_get(wd->bx)); - evas_object_size_hint_weight_set(item->base.view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_fill_set(item->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL); - _elm_theme_object_set(item->base.widget, item->base.view, "menu", "item", elm_widget_style_get(item->base.widget)); - edje_object_signal_callback_add(item->base.view, "elm,action,click", "", + item->o = edje_object_add(evas_object_evas_get(wd->bx)); + evas_object_size_hint_weight_set(item->o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(item->o, EVAS_HINT_FILL, EVAS_HINT_FILL); + _elm_theme_object_set(item->menu, item->o, "menu", "item", elm_widget_style_get(item->menu)); + edje_object_signal_callback_add(item->o, "elm,action,click", "", _menu_item_select, item); - edje_object_signal_callback_add(item->base.view, "elm,action,activate", "", + edje_object_signal_callback_add(item->o, "elm,action,activate", "", _menu_item_activate, item); - evas_object_show(item->base.view); + evas_object_show(item->o); } static void _item_separator_obj_create(Elm_Menu_Item *item) { - Widget_Data *wd = elm_widget_data_get(item->base.widget); + Widget_Data *wd = elm_widget_data_get(item->menu); if (!wd) return; - item->base.view = edje_object_add(evas_object_evas_get(wd->bx)); - evas_object_size_hint_weight_set(item->base.view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_fill_set(item->base.view, EVAS_HINT_FILL, EVAS_HINT_FILL); - _elm_theme_object_set(item->base.widget, item->base.view, "menu", "separator", elm_widget_style_get(item->base.widget)); - edje_object_signal_callback_add(item->base.view, "elm,action,activate", "", + item->o = edje_object_add(evas_object_evas_get(wd->bx)); + evas_object_size_hint_weight_set(item->o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(item->o, EVAS_HINT_FILL, EVAS_HINT_FILL); + _elm_theme_object_set(item->menu, item->o, "menu", "separator", elm_widget_style_get(item->menu)); + edje_object_signal_callback_add(item->o, "elm,action,activate", "", _menu_item_activate, item); - evas_object_show(item->base.view); + evas_object_show(item->o); } static void _item_submenu_obj_create(Elm_Menu_Item *item) { - Widget_Data *wd = elm_widget_data_get(item->base.widget); + Widget_Data *wd = elm_widget_data_get(item->menu); if (!wd) return; - item->submenu.location = elm_icon_add(wd->bx); - item->submenu.hv = elm_hover_add(wd->bx); - elm_hover_target_set(item->submenu.hv, item->submenu.location); - elm_hover_parent_set(item->submenu.hv, wd->parent); - elm_object_style_set(item->submenu.hv, "submenu"); - - item->submenu.bx = elm_box_add(wd->bx); - evas_object_size_hint_weight_set(item->submenu.bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(item->submenu.bx); - elm_hover_content_set(item->submenu.hv, elm_hover_best_content_location_get(item->submenu.hv, ELM_HOVER_AXIS_VERTICAL), item->submenu.bx); - - _elm_theme_object_set(item->base.widget, item->base.view, "menu", "item_with_submenu", elm_widget_style_get(item->base.widget)); + item->location = elm_icon_add(wd->bx); + item->hv = elm_hover_add(wd->bx); + elm_hover_target_set(item->hv, item->location); + elm_hover_parent_set(item->hv, wd->parent); + elm_object_style_set(item->hv, "submenu"); + + item->bx = elm_box_add(wd->bx); + evas_object_size_hint_weight_set(item->bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(item->bx); + elm_hover_content_set(item->hv, elm_hover_best_content_location_get(item->hv, ELM_HOVER_AXIS_VERTICAL), item->bx); + + _elm_theme_object_set(item->menu, item->o, "menu", "item_with_submenu", elm_widget_style_get(item->menu)); elm_menu_item_label_set(item, item->label); - elm_menu_item_icon_set(item, item->icon_str); + elm_menu_item_icon_set(item, item->icon); - edje_object_signal_callback_add(item->base.view, "elm,action,open", "", + edje_object_signal_callback_add(item->o, "elm,action,open", "", _submenu_open, item); - evas_object_event_callback_add(item->base.view, EVAS_CALLBACK_MOVE, _item_move_resize, item); - evas_object_event_callback_add(item->base.view, EVAS_CALLBACK_RESIZE, _item_move_resize, item); + evas_object_event_callback_add(item->o, EVAS_CALLBACK_MOVE, _item_move_resize, item); + evas_object_event_callback_add(item->o, EVAS_CALLBACK_RESIZE, _item_move_resize, item); - evas_object_event_callback_add(item->submenu.bx, EVAS_CALLBACK_RESIZE, _menu_resize, item->base.widget); + evas_object_event_callback_add(item->bx, EVAS_CALLBACK_RESIZE, _menu_resize, item->menu); } /** @@ -413,11 +404,8 @@ elm_menu_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "menu"); elm_widget_type_set(obj, "menu"); @@ -426,11 +414,9 @@ elm_menu_add(Evas_Object *parent) elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); wd->location = elm_icon_add(obj); wd->parent = parent; - wd->obj = obj; wd->hv = elm_hover_add(obj); elm_hover_parent_set(wd->hv, parent); @@ -443,8 +429,7 @@ elm_menu_add(Evas_Object *parent) evas_object_show(wd->bx); elm_hover_content_set(wd->hv, elm_hover_best_content_location_get(wd->hv, ELM_HOVER_AXIS_VERTICAL), wd->bx); - evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, wd->obj); - evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_DEL, _parent_del, wd); + evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj); @@ -459,41 +444,29 @@ elm_menu_add(Evas_Object *parent) * * @param obj The menu object. * @param parent The new parent. - * + * * @ingroup Menu */ EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent) { - Eina_List *l, *_l, *_ll, *ll = NULL; + Eina_List *l, *_l, *ll = NULL; Elm_Menu_Item *item; ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - - if (wd->parent == parent) return; - if (wd->parent) - { - evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, wd->obj); - evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_DEL, _parent_del, wd); - } - wd->parent = parent; - if (wd->parent) - { - evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, wd->obj); - evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_DEL, _parent_del, wd); - } elm_hover_parent_set(wd->hv, parent); + wd->parent = parent; ll = eina_list_append(ll, wd->items); - EINA_LIST_FOREACH(ll, _ll, l) + EINA_LIST_FOREACH(ll, ll, l) { EINA_LIST_FOREACH(l, _l, item) { - if (item->submenu.hv) + if (item->hv) { - elm_hover_parent_set(item->submenu.hv, parent); - ll = eina_list_append(ll, item->submenu.items); + elm_hover_parent_set(item->hv, parent); + ll = eina_list_append(ll, item->items); } } } @@ -501,29 +474,12 @@ elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent) } /** - * Get the parent - * - * @param obj The menu object. - * @return The parent. - * - * @ingroup Menu - */ -EAPI Evas_Object * -elm_menu_parent_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->parent; -} - -/** * Move the menu to a new position * * @param obj The menu object. * @param x The new position. * @param y The new position. - * + * * @ingroup Menu */ EAPI void @@ -539,46 +495,15 @@ elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) /** * Get the Evas_Object of an Elm_Menu_Item - * - * @param item The menu item object. - * + * + * @param it The menu item object. + * * @ingroup Menu */ EAPI Evas_Object * -elm_menu_object_get(const Elm_Menu_Item *item) +elm_menu_object_get(const Elm_Menu_Item *it) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->base.view; -} - -static void -_item_clone(Evas_Object *obj, Elm_Menu_Item *parent, Elm_Menu_Item *item) -{ - Elm_Menu_Item *new_item, *subitem; - Eina_List *iter; - - if (item->separator) - new_item = elm_menu_item_separator_add(obj, parent); - else - new_item = elm_menu_item_add(obj, parent, item->icon_str, item->label, item->func, item->base.data); - elm_menu_item_disabled_set(new_item, item->disabled); - - EINA_LIST_FOREACH(item->submenu.items, iter, subitem) - _item_clone(obj, new_item, subitem); -} - -void -elm_menu_clone(Evas_Object *from_menu, Evas_Object *to_menu, Elm_Menu_Item *parent) -{ - ELM_CHECK_WIDTYPE(from_menu, widtype); - ELM_CHECK_WIDTYPE(to_menu, widtype); - Widget_Data *from_wd = elm_widget_data_get(from_menu); - Eina_List *iter; - Elm_Menu_Item *item; - - if (!from_wd) return; - EINA_LIST_FOREACH(from_wd->items, iter, item) - _item_clone(to_menu, parent, item); + return it->o; } /** @@ -590,47 +515,37 @@ elm_menu_clone(Evas_Object *from_menu, Evas_Object *to_menu, Elm_Menu_Item *pare * @param func Function called when the user select the item. * @param data Data sent by the callback. * @return Returns the new item. - * + * * @ingroup Menu */ EAPI Elm_Menu_Item * -elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data) { Elm_Menu_Item *subitem; ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *icon_obj; if (!wd) return NULL; - icon_obj = elm_icon_add(obj); - if (!icon_obj) return NULL; - subitem = elm_widget_item_new(obj, Elm_Menu_Item); - if (!subitem) - { - evas_object_del(icon_obj); - return NULL; - } - subitem->base.data = data; + subitem = ELM_NEW(Elm_Menu_Item); + if (!subitem) return NULL; subitem->func = func; + subitem->data = data; + subitem->menu = obj; subitem->parent = parent; - subitem->icon = icon_obj; _item_obj_create(subitem); elm_menu_item_label_set(subitem, label); - - elm_widget_sub_object_add(subitem->base.widget, subitem->icon); - edje_object_part_swallow(subitem->base.view, "elm.swallow.content", subitem->icon); - if (icon) elm_menu_item_icon_set(subitem, icon); + elm_menu_item_icon_set(subitem, icon); if (parent) { - if (!parent->submenu.bx) _item_submenu_obj_create(parent); - elm_box_pack_end(parent->submenu.bx, subitem->base.view); - parent->submenu.items = eina_list_append(parent->submenu.items, subitem); + if (!parent->bx) _item_submenu_obj_create(parent); + elm_box_pack_end(parent->bx, subitem->o); + parent->items = eina_list_append(parent->items, subitem); } else { - elm_box_pack_end(wd->bx, subitem->base.view); + elm_box_pack_end(wd->bx, subitem->o); wd->items = eina_list_append(wd->items, subitem); } @@ -641,7 +556,7 @@ elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, const char *icon, con /** * Set the label of a menu item * - * @param item The menu item object. + * @param it The menu item object. * @param label The label to set for @p item * * @ingroup Menu @@ -649,31 +564,30 @@ elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, const char *icon, con EAPI void elm_menu_item_label_set(Elm_Menu_Item *item, const char *label) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); eina_stringshare_replace(&item->label, label); if (label) - edje_object_signal_emit(item->base.view, "elm,state,text,visible", "elm"); + edje_object_signal_emit(item->o, "elm,state,text,visible", "elm"); else - edje_object_signal_emit(item->base.view, "elm,state,text,hidden", "elm"); + edje_object_signal_emit(item->o, "elm,state,text,hidden", "elm"); - edje_object_message_signal_process(item->base.view); - edje_object_part_text_set(item->base.view, "elm.text", label); - _sizing_eval(item->base.widget); + edje_object_message_signal_process(item->o); + edje_object_part_text_set(item->o, "elm.text", label); + _sizing_eval(item->menu); } /** * Get the label of a menu item * - * @param item The menu item object. + * @param it The menu item object. * @return The label of @p item * * @ingroup Menu */ EAPI const char * -elm_menu_item_label_get(const Elm_Menu_Item *item) +elm_menu_item_label_get(Elm_Menu_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + if (!item) return NULL; return item->label; } @@ -682,35 +596,33 @@ elm_menu_item_label_get(const Elm_Menu_Item *item) * * Once the icon object is set, a previously set one will be deleted. * - * @param item The menu item object. + * @param it The menu item object. * @param icon The icon object to set for @p item * * @ingroup Menu */ EAPI void -elm_menu_item_icon_set(Elm_Menu_Item *item, const char *icon) -{ - char icon_tmp[512]; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - EINA_SAFETY_ON_NULL_RETURN(icon); - if (!*icon) return; - if ((item->icon_str) && (!strcmp(item->icon_str, icon))) return; - if ((snprintf(icon_tmp, sizeof(icon_tmp), "menu/%s", icon) > 0) && - (elm_icon_standard_set(item->icon, icon_tmp))) +elm_menu_item_icon_set(Elm_Menu_Item *item, Evas_Object *icon) +{ + if(item->icon == icon) return; + if (item->icon) evas_object_del(item->icon); + item->icon = icon; + if (icon) { - eina_stringshare_replace(&item->icon_str, icon); - edje_object_signal_emit(item->base.view, "elm,state,icon,visible", "elm"); + elm_widget_sub_object_add(item->menu, icon); + evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, item->menu); + edje_object_part_swallow(item->o, "elm.swallow.content", icon); + edje_object_signal_emit(item->o, "elm,state,icon,visible", "elm"); + edje_object_message_signal_process(item->o); } - else - edje_object_signal_emit(item->base.view, "elm,state,icon,hidden", "elm"); - edje_object_message_signal_process(item->base.view); - _sizing_eval(item->base.widget); + _sizing_eval(item->menu); } /** * Set the disabled state of @p item. * - * @param item The menu item object. + * @param it The menu item object. * @param disabled The enabled/disabled state of the item * * @ingroup Menu @@ -718,31 +630,29 @@ elm_menu_item_icon_set(Elm_Menu_Item *item, const char *icon) EAPI void elm_menu_item_disabled_set(Elm_Menu_Item *item, Eina_Bool disabled) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); if (disabled == item->disabled) return; item->disabled = disabled; if (disabled) { - edje_object_signal_emit(item->base.view, "elm,state,disabled", "elm"); - if (item->submenu.open) _submenu_hide(item); + edje_object_signal_emit(item->o, "elm,state,disabled", "elm"); + if (item->open) _submenu_hide(item); } else - edje_object_signal_emit(item->base.view, "elm,state,enabled", "elm"); - edje_object_message_signal_process(item->base.view); + edje_object_signal_emit(item->o, "elm,state,enabled", "elm"); + edje_object_message_signal_process(item->o); } /** * Get the disabled state of @p item. - * - * @param item The menu item object. + * + * @param it The menu item object. * @return The enabled/disabled state of the item - * + * * @ingroup Menu */ EAPI Eina_Bool -elm_menu_item_disabled_get(const Elm_Menu_Item *item) +elm_menu_item_disabled_get(Elm_Menu_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); if (!item) return EINA_FALSE; return item->disabled; } @@ -764,61 +674,48 @@ elm_menu_item_separator_add(Evas_Object *obj, Elm_Menu_Item *parent) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - /* don't add a separator as the first item */ - if (!wd->items) return NULL; - /* don't allow adding more than one separator in a row */ - if (parent) subitem = eina_list_last(parent->submenu.items)->data; - else subitem = eina_list_last(wd->items)->data; - if (subitem->separator) return NULL; - - subitem = elm_widget_item_new(obj, Elm_Menu_Item); + subitem = ELM_NEW(Elm_Menu_Item); if (!subitem) return NULL; - subitem->base.widget = obj; + subitem->menu = obj; subitem->separator = 1; _item_separator_obj_create(subitem); if (!parent) { - elm_box_pack_end(wd->bx, subitem->base.view); + elm_box_pack_end(wd->bx, subitem->o); wd->items = eina_list_append(wd->items, subitem); } else { - if (!parent->submenu.bx) _item_submenu_obj_create(parent); - elm_box_pack_end(parent->submenu.bx, subitem->base.view); - parent->submenu.items = eina_list_append(parent->submenu.items, subitem); + if (!parent->bx) _item_submenu_obj_create(parent); + elm_box_pack_end(parent->bx, subitem->o); + parent->items = eina_list_append(parent->items, subitem); } _sizing_eval(obj); return subitem; } + /** - * Get the icon object from a menu item + * Deletes an item from the menu. * - * @param item The menu item object - * @return The icon object or NULL if there's no icon + * @param item The item to delete * * @ingroup Menu */ -EAPI const Evas_Object * -elm_menu_item_object_icon_get(const Elm_Menu_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return (const Evas_Object *)item->icon; -} /** - * Get the string representation from the icon of a menu item - * - * @param item The menu item object. - * @return The string representation of @p item's icon or NULL - * + * Get the icon of a menu item + * + * @param it The menu item object. + * @return The icon object of @p item or NULL + * * @ingroup Menu */ -EAPI const char * -elm_menu_item_icon_get(const Elm_Menu_Item *item) +EAPI Evas_Object * +elm_menu_item_icon_get(Elm_Menu_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->icon_str; + if (!item) return NULL; + return item->icon; } /** @@ -832,74 +729,68 @@ elm_menu_item_icon_get(const Elm_Menu_Item *item) EAPI Eina_Bool elm_menu_item_is_separator(Elm_Menu_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); + if (!item) return EINA_FALSE; return item->separator; } -/** - * Deletes an item from the menu. - * - * @param item The item to delete. - * - * @ingroup Menu - */ EAPI void elm_menu_item_del(Elm_Menu_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); Elm_Menu_Item *_item; - elm_widget_item_pre_notify_del(item); + if (!item) return; + if (item->del_cb) item->del_cb((void*)item->data, item->o, item); - EINA_LIST_FREE(item->submenu.items, _item) elm_menu_item_del(_item); + EINA_LIST_FREE(item->items, _item) elm_menu_item_del(_item); if (item->label) eina_stringshare_del(item->label); if (item->icon) evas_object_del(item->icon); - if (item->submenu.hv) evas_object_del(item->submenu.hv); - if (item->submenu.location) evas_object_del(item->submenu.location); + if (item->hv) evas_object_del(item->hv); + if (item->location) evas_object_del(item->location); + if (item->o) evas_object_del(item->o); if (item->parent) - item->parent->submenu.items = eina_list_remove(item->parent->submenu.items, item); + item->parent->items = eina_list_remove(item->parent->items, item); else { - Widget_Data *wd = elm_widget_data_get(item->base.widget); + Widget_Data *wd = elm_widget_data_get(item->menu); wd->items = eina_list_remove(wd->items, item); } - elm_widget_item_del(item); + free(item); } /** * Set the function called when a menu item is freed. * - * @param item The item to set the callback on + * @param it The item to set the callback on * @param func The function called * * @ingroup Menu */ EAPI void -elm_menu_item_del_cb_set(Elm_Menu_Item *item, Evas_Smart_Cb func) +elm_menu_item_del_cb_set(Elm_Menu_Item *it, Evas_Smart_Cb func) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_del_cb_set(item, func); + if (!it) return; + it->del_cb = func; } /** - * Returns the data associated with menu item @p item. + * Returns the data associated with menu item @p it. * - * @param item The item - * @return The data associated with @p item + * @param it The item + * @return The data associated with @p it * * @ingroup Menu */ EAPI void * -elm_menu_item_data_get(const Elm_Menu_Item *item) +elm_menu_item_data_get(const Elm_Menu_Item *it) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_data_get(item); + if (!it) return NULL; + return (void *)it->data; } /** - * Sets the data to be associated with menu item @p item. + * Sets the data to be associated with menu item @p it. * * @param item The item * @param data The data to be associated with @p item @@ -909,21 +800,21 @@ elm_menu_item_data_get(const Elm_Menu_Item *item) EAPI void elm_menu_item_data_set(Elm_Menu_Item *item, const void *data) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_data_set(item, data); + if (!item) return; + item->data = data; } /** * Returns a list of @p item's subitems. * - * @param item The item + * @param it The item * @return An Eina_List* of @p item's subitems * * @ingroup Menu */ EAPI const Eina_List * -elm_menu_item_subitems_get(const Elm_Menu_Item *item) +elm_menu_item_subitems_get(Elm_Menu_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->submenu.items; + if (!item) return NULL; + return item->items; } diff --git a/src/lib/elm_module_priv.h b/src/lib/elm_module_priv.h index 15acae3..8aa6ff3 100644 --- a/src/lib/elm_module_priv.h +++ b/src/lib/elm_module_priv.h @@ -2,6 +2,7 @@ #define ELM_MODULE_PRIV_H typedef struct _Elm_Entry_Extension_data Elm_Entry_Extension_data; +typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item; typedef void (*cpfunc)(void *data, Evas_Object *obj, void *event_info); struct _Elm_Entry_Extension_data @@ -24,6 +25,17 @@ struct _Elm_Entry_Extension_data Eina_Bool context_menu : 1; }; +struct _Elm_Entry_Context_Menu_Item +{ + Evas_Object *obj; + const char *label; + const char *icon_file; + const char *icon_group; + Elm_Icon_Type icon_type; + Evas_Smart_Cb func; + void *data; +}; + EAPI void elm_entry_extension_module_data_get(Evas_Object *obj,Elm_Entry_Extension_data *ext_mod); #endif diff --git a/src/lib/elm_multibuttonentry.c b/src/lib/elm_multibuttonentry.c index a60f0a0..b3b9ffb 100644 --- a/src/lib/elm_multibuttonentry.c +++ b/src/lib/elm_multibuttonentry.c @@ -727,7 +727,7 @@ _view_init(Evas_Object *obj) { if (! (wd->box = elm_box_add (obj))) return; elm_widget_sub_object_add(obj, wd->box); - elm_box_extended_mode_set(wd->box, EINA_TRUE); + elm_box_extended_set(wd->box, EINA_TRUE); elm_box_homogenous_set(wd->box, EINA_FALSE); edje_object_part_swallow(wd->base, "box.swallow", wd->box); } diff --git a/src/lib/elm_navigationbar.c b/src/lib/elm_navigationbar.c index e03c7a4..7a867b9 100644 --- a/src/lib/elm_navigationbar.c +++ b/src/lib/elm_navigationbar.c @@ -136,23 +136,13 @@ _delete_item(Item *it) if (!it) return; Evas_Object *list_obj; - if(it->back_btn) - evas_object_del(it->back_btn); - if(it->fn_btn1) - { - elm_object_unfocus(it->fn_btn1); - evas_object_del(it->fn_btn1); - } - if(it->fn_btn2) - { - elm_object_unfocus(it->fn_btn2); - evas_object_del(it->fn_btn2); - } - if(it->fn_btn3) - { - elm_object_unfocus(it->fn_btn3); - evas_object_del(it->fn_btn3); - } + evas_object_del(it->back_btn); + elm_object_unfocus(it->fn_btn1); + evas_object_del(it->fn_btn1); + elm_object_unfocus(it->fn_btn2); + evas_object_del(it->fn_btn2); + elm_object_unfocus(it->fn_btn3); + evas_object_del(it->fn_btn3); if (it->title) eina_stringshare_del(it->title); if (it->subtitle) @@ -496,8 +486,6 @@ elm_navigationbar_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -1362,23 +1350,6 @@ elm_navigationbar_subtitle_label_get(Evas_Object *obj, Evas_Object *content) } /** - * deprecate this This disables content area animation on push/pop. - * - * @param[in] obj The NavigationBar object - * @param[in] disable if EINA_TRUE animation is disabled. - * - * @ingroup NavigationBar - */ -EAPI void -elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - - elm_pager_animation_disabled_set(wd->pager, disable); -} - -/** * This disables content area animation on push/pop. * * @param[in] obj The NavigationBar object @@ -1387,11 +1358,11 @@ elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable) * @ingroup NavigationBar */ EAPI void -elm_navigationbar_animation_disabled_set(Evas_Object *obj, Eina_Bool disable) +elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - elm_pager_animation_disabled_set(wd->pager, disable); + elm_pager_animation_disable_set(wd->pager, disable); } diff --git a/src/lib/elm_navigationbar_ex.c b/src/lib/elm_navigationbar_ex.c index b6bfe60..a4fc7d4 100644 --- a/src/lib/elm_navigationbar_ex.c +++ b/src/lib/elm_navigationbar_ex.c @@ -412,8 +412,6 @@ elm_navigationbar_ex_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); @@ -689,7 +687,6 @@ elm_navigationbar_ex_item_title_button_set(Elm_Navigationbar_ex_Item* item, char EAPI Evas_Object * elm_navigationbar_ex_item_title_button_get(Elm_Navigationbar_ex_Item* item, int button_type) { - if (!item) return NULL; fn_button *btn_det; Eina_List *bl; EINA_LIST_FOREACH(item->fnbtn_list, bl, btn_det) @@ -712,7 +709,6 @@ elm_navigationbar_ex_item_title_button_get(Elm_Navigationbar_ex_Item* item, int EAPI Evas_Object * elm_navigationbar_ex_item_title_button_unset(Elm_Navigationbar_ex_Item* item, int button_type) { - if (!item) return NULL; fn_button *btn_det; Eina_List *bl; Evas_Object *btn_ret; @@ -825,7 +821,6 @@ elm_navigationbar_ex_item_title_object_get(Elm_Navigationbar_ex_Item* item) EAPI Evas_Object * elm_navigationbar_ex_item_content_unset(Elm_Navigationbar_ex_Item* item) { - if (!item) return NULL; Evas_Object *content = _content_unset(item); return content; } @@ -875,7 +870,6 @@ EAPI void elm_navigationbar_ex_item_style_set(Elm_Navigationbar_ex_Item* item, const char* item_style) { if (!item) return; - if(!item_style) return; char buf[1024]; char buf_fn[1024]; Eina_List *bl; @@ -935,7 +929,6 @@ elm_navigationbar_ex_item_style_get(Elm_Navigationbar_ex_Item* item) EAPI void elm_navigationbar_ex_item_promote(Elm_Navigationbar_ex_Item* item) { - if (!item) return NULL; _item_promote(item); } diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index 4dc4967..458ca5c 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -3,13 +3,11 @@ /** - * @defgroup Notify notify + * @defgroup Notify Notify + * @ingroup Elementary * - * Display a window in a particular region of the application (top, - * bottom, etc. A timeout can be set to automatically close the - * window. This is so that, after an evas_object_show() on a notify - * object, if a timeout was set on it, it will automatically - * get hidden after that time. + * Display a window in a particular region of the application (top, bottom ...). + * A timeout can be set to automatically close the window. * */ @@ -23,7 +21,7 @@ struct _Widget_Data Eina_Bool repeat_events; Evas_Object *block_events; - double timeout; + int timeout; Ecore_Timer *timer; }; @@ -40,14 +38,6 @@ static void _show(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _hide(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info); -static const char SIG_BLOCK_CLICKED[] = "block,clicked"; -static const char SIG_TIMEOUT[] = "timeout"; -static const Evas_Smart_Cb_Description _signals[] = { - {SIG_BLOCK_CLICKED, ""}, - {SIG_TIMEOUT, ""}, - {NULL, NULL} -}; - static void _del_pre_hook(Evas_Object *obj) { @@ -172,7 +162,7 @@ _signal_block_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emiss { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - evas_object_smart_callback_call(data, SIG_BLOCK_CLICKED, NULL); + evas_object_smart_callback_call(data, "block,clicked", NULL); } static void @@ -249,23 +239,11 @@ _timer_cb(void *data) if (!wd) return ECORE_CALLBACK_CANCEL; wd->timer = NULL; evas_object_hide(obj); - evas_object_smart_callback_call(obj, SIG_TIMEOUT, NULL); + evas_object_smart_callback_call(obj, "notify,timeout", NULL); return ECORE_CALLBACK_CANCEL; } static void -_timer_init(Evas_Object *obj, Widget_Data *wd) -{ - if (wd->timer) - { - ecore_timer_del(wd->timer); - wd->timer = NULL; - } - if ((evas_object_visible_get(obj)) && (wd->timeout > 0.0)) - wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj); -} - -static void _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); @@ -273,7 +251,13 @@ _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_i evas_object_show(wd->notify); if (!wd->repeat_events) evas_object_show(wd->block_events); - _timer_init(obj, wd); + if (wd->timer) + { + ecore_timer_del(wd->timer); + wd->timer = NULL; + } + if (wd->timeout > 0) + wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj); } static void @@ -324,11 +308,8 @@ elm_notify_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "notify"); elm_widget_type_set(obj, "notify"); @@ -354,8 +335,6 @@ elm_notify_add(Evas_Object *parent) evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj); _sizing_eval(obj); - - evas_object_smart_callbacks_descriptions_set(obj, _signals); return obj; } @@ -433,16 +412,13 @@ elm_notify_content_get(const Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; + if ((!wd) || (!wd->content)) return NULL; return wd->content; } /** * Set the notify parent * - * Once the parent object is set, a previously set one will be desconected - * and replaced. - * * @param obj The notify object * @param content The new parent * @@ -491,23 +467,6 @@ elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent) } /** - * Get the notify parent - * - * @param obj The notify object - * @return The parent - * - * @ingroup Notify - */ -EAPI Evas_Object * -elm_notify_parent_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->parent; -} - -/** * Set the orientation * * @param obj The notify object @@ -541,56 +500,66 @@ elm_notify_orient_get(const Evas_Object *obj) } /** - * Set the time interval after which the notify window is going to be - * hidden. + * Set the time before the notify window is hidden.
+ * Set a value < 0 to disable the timer * * @param obj The notify object - * @param time The new timeout - * - * As said previously, an evas_object_show() on a notify object which - * had a timeout set by this function will trigger a timer to - * automatically hide it again. So, any order one calls - * elm_notify_timeout_set() and evas_object_show() on the same object - * (at hidden state) will behave the same. - * - * @note Set a value <= 0.0 to disable a running timer. - * - * @note If the value > 0.0 and the notify is previously visible, the - * timer will be started with this value, canceling any running timer. + * @param time the new timeout * + * @ingroup Notify */ EAPI void -elm_notify_timeout_set(Evas_Object *obj, double timeout) +elm_notify_timeout_set(Evas_Object *obj, int timeout) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->timeout = timeout; - _timer_init(obj, wd); + elm_notify_timer_init(obj); } /** * Return the timeout value (in seconds) * @param obj the notify object */ -EAPI double +EAPI int elm_notify_timeout_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) 0.0; + ELM_CHECK_WIDTYPE(obj, widtype) -1; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return 0.0; + if (!wd) return -1; return wd->timeout; } /** + * Re-init the timer + * @param obj The notify object + * + * @ingroup Notify + */ +EAPI void +elm_notify_timer_init(Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (wd->timer) ecore_timer_del(wd->timer); + wd->timer = NULL; + if (wd->timeout > 0) + wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj); +} + +/** * When true if the user clicks outside the window the events will be - * catch by the others widgets, else the events are block and the signal - * dismiss will be sent when the user click outside the window. + * caught by other widgets, else the events are blocked and the signal + * block,clicked will be sent when the user click's outside the window. * * @note The default value is EINA_TRUE. * * @param obj The notify object - * @param repeats EINA_TRUE Events are repeats, else no + * @param repeats EINA_TRUE Events are repeated else The events are blocked. + * + * @ingroup Notify */ EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) @@ -605,8 +574,7 @@ elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) wd->block_events = edje_object_add(evas_object_evas_get(obj)); _block_events_theme_apply(obj); elm_widget_resize_object_set(obj, wd->block_events); - edje_object_signal_callback_add(wd->block_events, "elm,action,clicked", - "elm", _signal_block_clicked, obj); + edje_object_signal_callback_add(wd->block_events, "elm,action,clicked", "elm", _signal_block_clicked, obj); } else evas_object_del(wd->block_events); diff --git a/src/lib/elm_pager.c b/src/lib/elm_pager.c index 0eeb7dc..d0996b7 100644 --- a/src/lib/elm_pager.c +++ b/src/lib/elm_pager.c @@ -6,9 +6,9 @@ * @ingroup Elementary * * The pager is an object that allows flipping (with animation) between 1 or - * more “pages” of objects, much like a stack of windows within the window. + * more ?œpages??of objects, much like a stack of windows within the window. * - * Objects can be pushed or popped from the stack or deleted as normal. + * Objects can be pushed or popped from he stack or deleted as normal. * Pushes and pops will animate (and a pop will delete the object once the * animation is finished). Any object in the pager can be promoted to the top * (from its current stacking position) as well. Objects are pushed to the @@ -71,20 +71,6 @@ _theme_hook(Evas_Object *obj) _sizing_eval(obj); } -static Eina_Bool -_elm_pager_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *cur; - - if ((!wd) || (!wd->top)) - return EINA_FALSE; - - cur = wd->top->content; - - /* Try Focus cycle in subitem */ - return elm_widget_focus_next_get(cur, dir, next); -} static void _sizing_eval(Evas_Object *obj) @@ -96,8 +82,8 @@ _sizing_eval(Evas_Object *obj) if (!wd) return; EINA_LIST_FOREACH(wd->stack, l, it) { - if (it->minw > minw) minw = it->minw; - if (it->minh > minh) minh = it->minh; + if (it->minw > minw) minw = it->minw; + if (it->minh > minh) minh = it->minh; } evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); @@ -171,12 +157,12 @@ _eval_top(Evas_Object *obj) } else edje_object_signal_emit(o, "elm,action,push", "elm"); - onshow = edje_object_data_get(o, "onshow"); - if (onshow) - { - if (!strcmp(onshow, "raise")) evas_object_raise(o); - else if (!strcmp(onshow, "lower")) evas_object_lower(o); - } + onshow = edje_object_data_get(o, "onshow"); + if (onshow) + { + if (!strcmp(onshow, "raise")) evas_object_raise(o); + else if (!strcmp(onshow, "lower")) evas_object_lower(o); + } } } @@ -203,16 +189,16 @@ _sub_del(void *data, Evas_Object *obj __UNUSED__, void *event_info) if (!wd) return; EINA_LIST_FOREACH(wd->stack, l, it) { - if (it->content == sub) - { - wd->stack = eina_list_remove_list(wd->stack, l); - evas_object_event_callback_del_full + if (it->content == sub) + { + wd->stack = eina_list_remove_list(wd->stack, l); + evas_object_event_callback_del_full (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it); - evas_object_del(it->base); - _eval_top(it->obj); - free(it); - return; - } + evas_object_del(it->base); + _eval_top(it->obj); + free(it); + return; + } } } @@ -232,13 +218,14 @@ static void _signal_hide_finished(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { Item *it = data; + Evas_Object *content = it->content; Evas_Object *obj2 = it->obj; evas_object_hide(it->base); edje_object_signal_emit(it->base, "elm,action,reset", "elm"); - evas_object_smart_callback_call(obj2, "hide,finished", it->content); + evas_object_smart_callback_call(obj2, "hide,finished", content); edje_object_message_signal_process(it->base); - if (it->popme) evas_object_del(it->content); - evas_object_hide(it->content); + if (it->popme) evas_object_del(content); + evas_object_hide(content); _sizing_eval(obj2); } @@ -256,12 +243,9 @@ elm_pager_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "pager"); elm_widget_type_set(obj, "pager"); @@ -269,23 +253,22 @@ elm_pager_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_focus_next_hook_set(obj, _elm_pager_focus_next_hook); elm_widget_can_focus_set(obj, EINA_FALSE); - + wd->clip = evas_object_rectangle_add(e); elm_widget_resize_object_set(obj, wd->clip); elm_widget_sub_object_add(obj, wd->clip); - + wd->rect = evas_object_rectangle_add(e); elm_widget_sub_object_add(obj, wd->rect); evas_object_color_set(wd->rect, 255, 255, 255, 0); evas_object_clip_set(wd->rect, wd->clip); - + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj); - + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } @@ -360,28 +343,28 @@ elm_pager_content_pop(Evas_Object *obj) ll = eina_list_last(wd->stack); if (ll) { - ll = ll->prev; - if (!ll) - { - Evas_Object *o; - const char *onhide; - - wd->top = it; - o = wd->top->base; - edje_object_signal_emit(o, "elm,action,pop", "elm"); - onhide = edje_object_data_get(o, "onhide"); - if (onhide) - { - if (!strcmp(onhide, "raise")) evas_object_raise(o); - else if (!strcmp(onhide, "lower")) evas_object_lower(o); - } - wd->top = NULL; - } - else - { - it = ll->data; - elm_pager_content_promote(obj, it->content); - } + ll = ll->prev; + if (!ll) + { + Evas_Object *o; + const char *onhide; + + wd->top = it; + o = wd->top->base; + edje_object_signal_emit(o, "elm,action,pop", "elm"); + onhide = edje_object_data_get(o, "onhide"); + if (onhide) + { + if (!strcmp(onhide, "raise")) evas_object_raise(o); + else if (!strcmp(onhide, "lower")) evas_object_lower(o); + } + wd->top = NULL; + } + else + { + it = ll->data; + elm_pager_content_promote(obj, it->content); + } } } @@ -456,13 +439,13 @@ elm_pager_content_promote(Evas_Object *obj, Evas_Object *content) if (!wd) return; EINA_LIST_FOREACH(wd->stack, l, it) { - if (it->content == content) - { - wd->stack = eina_list_remove_list(wd->stack, l); - wd->stack = eina_list_append(wd->stack, it); - _eval_top(obj); - return; - } + if (it->content == content) + { + wd->stack = eina_list_remove_list(wd->stack, l); + wd->stack = eina_list_append(wd->stack, it); + _eval_top(obj); + return; + } } } @@ -513,9 +496,11 @@ elm_pager_content_top_get(const Evas_Object *obj) * @ingroup Pager */ EAPI void -elm_pager_animation_disabled_set(Evas_Object *obj, Eina_Bool disable) +elm_pager_animation_disable_set(Evas_Object *obj, Eina_Bool disable) { ELM_CHECK_WIDTYPE(obj, widtype)NULL; Widget_Data *wd = elm_widget_data_get(obj); wd->disable_animation = disable; } + + diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index 2e7d185..a435f64 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -29,7 +29,6 @@ struct _Widget_Data static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); -static void _on_focus_hook(void *data, Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _resize(void *data, Evas *evas, Evas_Object *obj, void *event); static void _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data); @@ -48,83 +47,12 @@ _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (wd->scr) - { - Evas_Object *edj; - const char *str; - - elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", - elm_widget_style_get(obj)); - // scale = (elm_widget_scale_get(obj) * _elm_config->scale); - // edje_object_scale_set(wd->scr, scale); - edj = elm_smart_scroller_edje_object_get(wd->scr); - str = edje_object_data_get(edj, "focus_highlight"); - if ((str) && (!strcmp(str, "on"))) - elm_widget_highlight_in_theme_set(obj, EINA_TRUE); - else - elm_widget_highlight_in_theme_set(obj, EINA_FALSE); - } + elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", elm_widget_style_get(obj)); +// scale = (elm_widget_scale_get(obj) * _elm_config->scale); +// edje_object_scale_set(wd->scr, scale); _sizing_eval(obj); } -static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - evas_object_focus_set(obj, EINA_TRUE); - else - evas_object_focus_set(obj, EINA_FALSE); -} - -static Eina_Bool -_elm_panel_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *cur; - - if ((!wd) || (!wd->content)) - return EINA_FALSE; - - cur = wd->content; - - /* Try Focus cycle in subitem */ - if (!wd->hidden) - return elm_widget_focus_next_get(cur, dir, next); - - /* Return */ - *next = (Evas_Object *)obj; - return !elm_widget_focus_get(obj); -} - -static void -_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), - emission, source); -} - -static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr), - emission, source, func_cb, data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_del_full( - elm_smart_scroller_edje_object_get(wd->scr), emission, source, - func_cb, data); -} - static void _sizing_eval(Evas_Object *obj) { @@ -177,7 +105,7 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) } static void -_toggle_panel(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__) +_toggle_panel(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -186,44 +114,15 @@ _toggle_panel(void *data, Evas_Object *obj, const char *emission __UNUSED__, con edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,action,show", "elm"); wd->hidden = EINA_FALSE; - evas_object_repeat_events_set(obj, EINA_FALSE); } else { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,action,hide", "elm"); wd->hidden = EINA_TRUE; - evas_object_repeat_events_set(obj, EINA_TRUE); - if (elm_widget_focus_get(wd->content)) - { - elm_widget_focused_object_clear(obj); - elm_widget_focus_steal(obj); - } } } -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if ((src != obj) || (type != EVAS_CALLBACK_KEY_DOWN)) return EINA_FALSE; - - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - - if ((strcmp(ev->keyname, "Return")) && - (strcmp(ev->keyname, "KP_Enter")) && - (strcmp(ev->keyname, "space"))) - return EINA_FALSE; - - _toggle_panel(obj, NULL, "elm,action,panel,toggle", "*"); - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; -} - /** * Adds a panel object * @@ -240,11 +139,8 @@ elm_panel_add(Evas_Object *parent) Evas *evas; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); evas = evas_object_evas_get(parent); - if (!evas) return NULL; obj = elm_widget_add(evas); ELM_SET_WIDTYPE(widtype, "panel"); elm_widget_type_set(obj, "panel"); @@ -252,18 +148,12 @@ elm_panel_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); - elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - elm_widget_focus_next_hook_set(obj, _elm_panel_focus_next_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); + elm_widget_can_focus_set(obj, 0); wd->scr = elm_smart_scroller_add(evas); elm_smart_scroller_widget_set(wd->scr, obj); - _theme_hook(obj); - elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_FALSE); + elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "left"); + elm_smart_scroller_bounce_allow_set(wd->scr, 0, 0); elm_widget_resize_object_set(obj, wd->scr); elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF, ELM_SMART_SCROLLER_POLICY_OFF); @@ -312,10 +202,7 @@ elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient) switch (orient) { case ELM_PANEL_ORIENT_TOP: - elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "top"); - break; case ELM_PANEL_ORIENT_BOTTOM: - elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "bottom"); break; case ELM_PANEL_ORIENT_LEFT: elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "left"); @@ -323,6 +210,8 @@ elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient) case ELM_PANEL_ORIENT_RIGHT: elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "right"); break; + default: + break; } _sizing_eval(obj); } @@ -336,7 +225,7 @@ elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient) * @ingroup Panel */ EAPI Elm_Panel_Orient -elm_panel_orient_get(const Evas_Object *obj) +elm_panel_orient_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) ELM_PANEL_ORIENT_LEFT; Widget_Data *wd = elm_widget_data_get(obj); @@ -375,25 +264,6 @@ elm_panel_content_set(Evas_Object *obj, Evas_Object *content) } /** - * Get the content of the panel. - * - * Return the content object which is set for this widget. - * - * @param obj The panel object - * @return The content that is being used - * - * @ingroup Panel - */ -EAPI Evas_Object * -elm_panel_content_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->content; -} - -/** * Unset the content of the panel. * * Unparent and return the content object which was set for this widget. @@ -432,6 +302,7 @@ elm_panel_hidden_set(Evas_Object *obj, Eina_Bool hidden) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->hidden == hidden) return; + wd->hidden = hidden; _toggle_panel(obj, NULL, "elm,action,panel,toggle", "*"); } @@ -444,7 +315,7 @@ elm_panel_hidden_set(Evas_Object *obj, Eina_Bool hidden) * @ingroup Panel */ EAPI Eina_Bool -elm_panel_hidden_get(const Evas_Object *obj) +elm_panel_hidden_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c index 1347d8a..5c770a2 100644 --- a/src/lib/elm_panes.c +++ b/src/lib/elm_panes.c @@ -15,15 +15,15 @@ struct _Widget_Data struct { - Evas_Object *left; - Evas_Object *right; + Evas_Object *left; + Evas_Object *right; } contents; struct { - int x_diff; - int y_diff; - Eina_Bool move; + int x_diff; + int y_diff; + Eina_Bool move; } move; Eina_Bool clicked_double; @@ -42,7 +42,6 @@ _del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (wd->panes) evas_object_del(wd->panes); free(wd); } @@ -72,52 +71,6 @@ _theme_hook(Evas_Object *obj) elm_panes_content_left_size_set(obj, size); } -static Eina_Bool -_elm_panes_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) - return EINA_FALSE; - - double w, h; - edje_object_part_drag_value_get(wd->panes, "elm.bar", &w, &h); - if (((wd->horizontal) && ( h == 0.0 )) || ((!wd->horizontal) && ( w == 0.0 ))) - return elm_widget_focus_next_get(wd->contents.right, dir, next); - - Evas_Object *chain[2]; - - /* Direction */ - if (dir == ELM_FOCUS_PREVIOUS) - { - chain[0] = wd->contents.right; - chain[1] = wd->contents.left; - } - else if (dir == ELM_FOCUS_NEXT) - { - chain[0] = wd->contents.left; - chain[1] = wd->contents.right; - } - else - return EINA_FALSE; - - unsigned char i = elm_widget_focus_get(chain[1]); - - if (elm_widget_focus_next_get(chain[i], dir, next)) - return EINA_TRUE; - - i = !i; - - Evas_Object *to_focus; - if (elm_widget_focus_next_get(chain[i], dir, &to_focus)) - { - *next = to_focus; - return !!i; - } - - return EINA_FALSE; -} - static void _sizing_eval(Evas_Object *obj) { @@ -140,17 +93,16 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ if (!wd) return; if (sub == wd->contents.left) { - evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - wd->contents.left = NULL; - _sizing_eval(obj); + wd->contents.left = NULL; + _sizing_eval(obj); } else if (sub == wd->contents.right) { - evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - wd->contents.right= NULL; - _sizing_eval(obj); + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + wd->contents.right= NULL; + _sizing_eval(obj); } } @@ -182,8 +134,8 @@ _unpress(void *data, Evas_Object *obj __UNUSED__ , const char *emission __UNUSED if (wd->clicked_double) { - evas_object_smart_callback_call(data, "clicked,double", NULL); - wd->clicked_double = EINA_FALSE; + evas_object_smart_callback_call(data, "clicked,double", NULL); + wd->clicked_double = EINA_FALSE; } } @@ -206,16 +158,14 @@ elm_panes_add(Evas_Object *parent) wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "panes"); - elm_widget_type_set(obj, "panes"); + elm_widget_type_set(obj, widtype); elm_widget_can_focus_set(obj, EINA_FALSE); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_focus_next_hook_set(obj, _elm_panes_focus_next_hook); wd->contents.left = NULL; wd->contents.right = NULL; @@ -262,19 +212,19 @@ elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content) Widget_Data *wd = elm_widget_data_get(obj); if (wd->contents.left) { - evas_object_del(wd->contents.left); - wd->contents.left = NULL; + evas_object_del(wd->contents.left); + wd->contents.left = NULL; } if (content) { - wd->contents.left = content; - elm_widget_sub_object_add(obj, content); - edje_object_part_swallow(wd->panes, "elm.swallow.left", content); + elm_widget_sub_object_add(obj, content); + wd->contents.left = content; + edje_object_part_swallow(wd->panes, "elm.swallow.left", content); if (wd->contents.right) - edje_object_signal_emit(wd->panes, "elm.panes.pair", "elm"); + edje_object_signal_emit(wd->panes, "panes_pair", "elm"); } else - edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); + edje_object_signal_emit(wd->panes, "panes_unpair", "elm"); } /** @@ -296,19 +246,19 @@ elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) Widget_Data *wd = elm_widget_data_get(obj); if (wd->contents.right) { - evas_object_del(wd->contents.right); - wd->contents.right = NULL; + evas_object_del(wd->contents.right); + wd->contents.right = NULL; } if (content) { - wd->contents.right = content; - elm_widget_sub_object_add(obj, content); - edje_object_part_swallow(wd->panes, "elm.swallow.right", content); + elm_widget_sub_object_add(obj, content); + wd->contents.right = content; + edje_object_part_swallow(wd->panes, "elm.swallow.right", content); if (wd->contents.left) - edje_object_signal_emit(wd->panes, "elm.panes.pair", "elm"); + edje_object_signal_emit(wd->panes, "panes_pair", "elm"); } else - edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); + edje_object_signal_emit(wd->panes, "panes_unpair", "elm"); } /** @@ -316,7 +266,7 @@ elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) * * Return the left/top content object which is set for this widget. * - * @param[in] obj The panes object + * @param[in] obj The pane object * @return The left/top content object that is being used * * @ingroup Panes @@ -334,8 +284,8 @@ elm_panes_content_left_get(const Evas_Object *obj) * * Return the right/bottom content object which is set for this widget. * - * @param[in] obj The panes object - * @return The right/bottom content object that is being used + * @param[in] obj The pane object + * @return The Evas Object set as a right/bottom content of the pane * * @ingroup Panes */ @@ -361,15 +311,18 @@ EAPI Evas_Object * elm_panes_content_left_unset(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd = NULL; + Evas_Object *content = NULL; + + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->contents.left) return NULL; - Evas_Object *content = wd->contents.left; + content = wd->contents.left; edje_object_part_unswallow(wd->panes, content); elm_widget_sub_object_del(obj, content); evas_object_hide(content); wd->contents.left = NULL; - edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); + edje_object_signal_emit(wd->panes, "panes_unpair", "elm"); return content; } @@ -387,15 +340,19 @@ EAPI Evas_Object * elm_panes_content_right_unset(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd = NULL; + Evas_Object *content = NULL; + + wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->contents.right) return NULL; - Evas_Object *content = wd->contents.right; + + content = wd->contents.right; edje_object_part_unswallow(wd->panes, content); elm_widget_sub_object_del(obj, content); evas_object_hide(content); wd->contents.right = NULL; - edje_object_signal_emit(wd->panes, "elm.panes.unpair", "elm"); + edje_object_signal_emit(wd->panes, "panes_unpair", "elm"); return content; } @@ -493,9 +450,9 @@ elm_panes_fixed_set(Evas_Object *obj, Eina_Bool fixed) Widget_Data *wd = elm_widget_data_get(obj); wd->fixed = fixed; if (wd->fixed == EINA_TRUE) - edje_object_signal_emit(wd->panes, "elm.panes.fixed", "elm"); + edje_object_signal_emit(wd->panes, "elm.fixed", "movement.decider"); else - edje_object_signal_emit(wd->panes, "elm.panes.unfixed", "elm"); + edje_object_signal_emit(wd->panes, "elm.unfixed", "movement.decider"); } /** diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c index ea71177..5b955af 100644 --- a/src/lib/elm_photo.c +++ b/src/lib/elm_photo.c @@ -47,11 +47,9 @@ _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - _elm_theme_object_set(obj, wd->frm, "photo", "base", - elm_widget_style_get(obj)); + _elm_theme_object_set(obj, wd->frm, "photo", "base", elm_widget_style_get(obj)); edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img); - edje_object_scale_set(wd->frm, elm_widget_scale_get(obj) * - _elm_config->scale); + edje_object_scale_set(wd->frm, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); } @@ -60,45 +58,40 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - if (!wd) return; - if (wd->size > 0) - { - double scale = 0.0; - - scale = (wd->size * elm_widget_scale_get(obj) * _elm_config->scale); - evas_object_size_hint_min_set(wd->img, scale, scale); - edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc(wd->frm, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - maxw = minw; - maxh = minh; - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, maxw, maxh); - } + + if(wd->size > 0) { + evas_object_size_hint_min_set(wd->img, + wd->size * elm_widget_scale_get(obj) * _elm_config->scale, + wd->size * elm_widget_scale_get(obj) * _elm_config->scale); + edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img); + elm_coords_finger_size_adjust(1, &minw, 1, &minh); + edje_object_size_min_restricted_calc(wd->frm, &minw, &minh, minw, minh); + elm_coords_finger_size_adjust(1, &minw, 1, &minh); + maxw = minw; + maxh = minh; + evas_object_size_hint_min_set(obj, minw, minh); + evas_object_size_hint_max_set(obj, maxw, maxh); + } } static void _icon_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Coord w, h; - Widget_Data *wd = elm_widget_data_get(data); - - if (!wd) return; - if (wd->fill) - { - Edje_Message_Int_Set *msg; - Evas_Object *icon = _els_smart_icon_object_get(wd->img); - - evas_object_geometry_get(icon, NULL, NULL, &w, &h); - msg = alloca(sizeof(Edje_Message_Int_Set) + (sizeof(int))); - msg->count=2; - msg->val[0] = (int)w; - msg->val[1] = (int)h; - - edje_object_message_send(wd->frm, EDJE_MESSAGE_INT_SET, 0, msg); - } + Evas_Coord w, h; + Widget_Data *wd = elm_widget_data_get(data); + if (!wd) return; + + if(wd->fill) { + Evas_Object *icon = _els_smart_icon_object_get(wd->img); + evas_object_geometry_get(icon, NULL, NULL, &w, &h); + Edje_Message_Int_Set *msg = alloca(sizeof(Edje_Message_Int_Set) + (sizeof(int))); + msg->count=2; + msg->val[0] = (int)w; + msg->val[1] = (int)h; + + edje_object_message_send(wd->frm, EDJE_MESSAGE_INT_SET, 0, msg); + } } @@ -117,7 +110,7 @@ _longpress(void *objv) const char *file; char *buf; - DBG("Long press: start drag!"); + printf("Long press: start drag!\n"); wd->longtimer = NULL; /* clear: must return NULL now */ evas_object_event_callback_del(objv, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move); @@ -164,16 +157,16 @@ _mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event) } static void -_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); if (wd->longtimer) ecore_timer_del(wd->longtimer); /* FIXME: Hard coded timeout */ - wd->longtimer = ecore_timer_add(0.7, _longpress, data); - evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, - _mouse_move, data); + wd->longtimer = ecore_timer_add(0.7,_longpress, data); + evas_object_event_callback_add(obj,EVAS_CALLBACK_MOUSE_MOVE, + _mouse_move,data); } static void @@ -181,7 +174,7 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *eve { Widget_Data *wd = elm_widget_data_get(data); - if ((wd) && (wd->longtimer)) + if (wd && wd->longtimer) { ecore_timer_del(wd->longtimer); wd->longtimer = NULL; @@ -207,11 +200,8 @@ elm_photo_add(Evas_Object *parent) Widget_Data *wd; Evas_Object *icon; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "photo"); elm_widget_type_set(obj, "photo"); @@ -219,7 +209,7 @@ elm_photo_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); + elm_widget_can_focus_set(obj, 0); wd->frm = edje_object_add(e); _elm_theme_object_set(obj, wd->frm, "photo", "base", "default"); @@ -232,8 +222,7 @@ elm_photo_add(Evas_Object *parent) _els_smart_icon_fill_inside_set(wd->img, 0); _els_smart_icon_scale_size_set(wd->img, 0); wd->fill = EINA_FALSE; - _els_smart_icon_scale_set(wd->img, - elm_widget_scale_get(obj) * _elm_config->scale); + _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) * _elm_config->scale); evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_DOWN, @@ -291,8 +280,8 @@ elm_photo_size_set(Evas_Object *obj, int size) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + wd->size = (size > 0) ? size : 0; _els_smart_icon_scale_size_set(wd->img, wd->size); @@ -313,7 +302,6 @@ elm_photo_fill_inside_set(Evas_Object *obj, Eina_Bool fill) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; _els_smart_icon_fill_inside_set(wd->img, fill); wd->fill = fill; diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c index 3398234..bde9b42 100644 --- a/src/lib/elm_photocam.c +++ b/src/lib/elm_photocam.c @@ -819,13 +819,6 @@ _pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) } static void -_pan_min_get(Evas_Object *obj __UNUSED__, Evas_Coord *x, Evas_Coord *y) -{ - if (x) *x = 0; - if (y) *y = 0; -} - -static void _pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { Pan *sd = evas_object_smart_data_get(obj); @@ -976,11 +969,8 @@ elm_photocam_add(Evas_Object *parent) static Evas_Smart *smart = NULL; Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "photocam"); elm_widget_type_set(obj, "photocam"); @@ -1036,8 +1026,8 @@ elm_photocam_add(Evas_Object *parent) } elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart, - _pan_set, _pan_get, _pan_max_get, - _pan_min_get, _pan_child_size_get); + _pan_set, _pan_get, + _pan_max_get, _pan_child_size_get); wd->zoom = 1; wd->mode = ELM_PHOTOCAM_ZOOM_MODE_MANUAL; @@ -1083,7 +1073,7 @@ elm_photocam_add(Evas_Object *parent) * * @ingroup Photocam */ -EAPI Evas_Load_Error +EAPI int elm_photocam_file_set(Evas_Object *obj, const char *file) { ELM_CHECK_WIDTYPE(obj, widtype) EVAS_LOAD_ERROR_NONE; diff --git a/src/lib/elm_popup.c b/src/lib/elm_popup.c index 668addb..e03cd91 100644 --- a/src/lib/elm_popup.c +++ b/src/lib/elm_popup.c @@ -24,8 +24,6 @@ struct _Widget_Data Evas_Object *action_area; Eina_List *button_list; int rot_angle; - int no_of_buttons; - Evas_Object *content; Elm_Notify_Orient notify_orient; Ecore_Job *del_job; Eina_Bool delete_me : 1; @@ -113,25 +111,19 @@ _theme_hook(Evas_Object *obj) char buf[4096]; Eina_List *list = NULL; Action_Area_Data *action_data = NULL; - int index =0; - + if (!wd) return; elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj)); elm_notify_orient_set(wd->notify, wd->notify_orient); edje_object_message_signal_process(elm_layout_edje_get(wd->layout)); + if (wd->action_area) { - snprintf(buf, sizeof(buf), "buttons%d", wd->no_of_buttons); - elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(obj)); EINA_LIST_FOREACH(wd->button_list, list, action_data) { snprintf(buf, sizeof(buf), "popup_button/%s", elm_widget_style_get(obj)); elm_object_style_set(action_data->btn, buf); - ++index; - snprintf(buf, sizeof(buf), "actionbtn%d", index); - elm_layout_content_set(wd->action_area, buf, action_data->btn); } - elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area); } if (wd->content_area) { @@ -140,18 +132,8 @@ _theme_hook(Evas_Object *obj) { snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj)); elm_object_style_set(wd->desc_label, buf); - elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->desc_label); - } - else if(wd->content) - { - elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->content); } - elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area); } - if(wd->title_area) - { - edje_object_part_text_set(elm_layout_edje_get(wd->layout), "elm.swallow.title", wd->title_area); - } _sizing_eval(obj); } @@ -236,6 +218,7 @@ static void _hide(void *data, Evas *e, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,hide", "elm"); edje_object_message_signal_process(wd->layout); @@ -365,7 +348,7 @@ elm_popup_add(Evas_Object *parent_app) evas_object_resize(parent, w, h); evas_object_move(parent, x, y); if (rotation != -1) - elm_win_rotation_with_resize_set(parent, rotation); + elm_win_rotation_with_resize_set(parent, rotation); } else @@ -409,7 +392,7 @@ elm_popup_add(Evas_Object *parent_app) evas_object_event_callback_add(parent, EVAS_CALLBACK_DEL, _del_parent, obj); } - ecore_x_netwm_window_type_get(elm_win_xwindow_get(parent), &type); + ecore_x_netwm_window_type_get(elm_win_xwindow_get(parent), &type); if (type == ECORE_X_WINDOW_TYPE_DIALOG) { elm_object_style_set(wd->notify, "popup"); @@ -455,7 +438,6 @@ elm_popup_with_buttons_add(Evas_Object *parent, char *title, char *desc_text,int wd->action_area = elm_layout_add(popup); elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area); snprintf(buf,sizeof(buf), "buttons%d", no_of_buttons); - wd->no_of_buttons = no_of_buttons; elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(popup)); edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm"); if (wd->title_area) @@ -630,24 +612,19 @@ elm_popup_content_set(Evas_Object *obj, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - + if (!wd) return; - if (wd->content == content) return; if (wd->content_area) { evas_object_del(wd->content_area); wd->content_area = NULL; } - wd->content = content; - if(content) - { - wd->content_area = elm_layout_add(obj); - elm_layout_theme_set(wd->content_area, "popup","content", elm_widget_style_get(obj)); - elm_layout_content_set(wd->content_area, "elm.swallow.content", content); - elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area); - evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - } + wd->content_area = elm_layout_add(obj); + elm_layout_theme_set(wd->content_area, "popup","content", elm_widget_style_get(obj)); + elm_layout_content_set(wd->content_area, "elm.swallow.content", content); + elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area); + evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); _sizing_eval(obj); } @@ -664,9 +641,12 @@ elm_popup_content_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - + Evas_Object *content; + if (!wd) return NULL; - return wd->content; + content = edje_object_part_swallow_get(elm_layout_edje_get(wd->content_area), + "elm.swallow.content"); + return content; } /** @@ -680,12 +660,13 @@ elm_popup_content_get(Evas_Object *obj) */ EAPI void elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_text, ...) + { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); char buf[4096]; va_list args; - + if (!wd) return; va_start(args, first_button_text); if (wd->action_area) @@ -699,10 +680,9 @@ elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_tex evas_object_size_hint_align_set(wd->action_area, EVAS_HINT_FILL, EVAS_HINT_FILL); snprintf(buf, sizeof(buf), "buttons%d", no_of_buttons); elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(obj)); - wd->no_of_buttons = no_of_buttons; edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm"); if (wd->title_area) - edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm"); + edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm"); _elm_popup_buttons_add_valist (obj, first_button_text, args); va_end(args); edje_object_message_signal_process(wd->layout); @@ -719,14 +699,14 @@ elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_tex * @ingroup Popup */ EAPI void -elm_popup_timeout_set(Evas_Object *obj, double timeout) +elm_popup_timeout_set(Evas_Object *obj, int timeout) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - + if (!wd) return; elm_notify_timeout_set(wd->notify, timeout); - evas_object_smart_callback_add(wd->notify, "timeout", _elm_popup_timeout, obj); + evas_object_smart_callback_add(wd->notify, "notify,timeout", _elm_popup_timeout, obj); } /** @@ -883,7 +863,7 @@ elm_popup_run(Evas_Object *obj) /*Finger waggle warning*/ _elm_dangerous_call_check(__FUNCTION__); evas_object_show(obj); - evas_object_smart_callback_add(obj, "response", response_cb, &response_id); + evas_object_smart_callback_add(obj, "response", response_cb, &response_id); _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, &response_id); ecore_main_loop_begin(); if (_elm_exit_handler) diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index d6f573c..67837e7 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -13,10 +13,10 @@ # include #endif -#include "els_pan.h" -#include "els_scroller.h" -#include "els_box.h" -#include "els_icon.h" +//#include "els_pan.h" +//#include "els_scroller.h" +//#include "els_box.h" +//#include "els_icon.h" #include "elm_widget.h" @@ -26,6 +26,71 @@ #define INF(...) EINA_LOG_DOM_INFO(_elm_log_dom, __VA_ARGS__) #define DBG(...) EINA_LOG_DOM_DBG (_elm_log_dom, __VA_ARGS__) + + +Evas_Object *_elm_smart_pan_add (Evas *evas); +void _elm_smart_pan_child_set (Evas_Object *obj, Evas_Object *child); +Evas_Object *_elm_smart_pan_child_get (Evas_Object *obj); +void _elm_smart_pan_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y); +void _elm_smart_pan_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); +void _elm_smart_pan_max_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); +void _elm_smart_pan_child_size_get (Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); + +typedef enum _Elm_Smart_Scroller_Policy +{ + ELM_SMART_SCROLLER_POLICY_AUTO, + ELM_SMART_SCROLLER_POLICY_ON, + ELM_SMART_SCROLLER_POLICY_OFF +} +Elm_Smart_Scroller_Policy; + +Evas_Object *elm_smart_scroller_add (Evas *evas); +void elm_smart_scroller_child_set (Evas_Object *obj, Evas_Object *child); +void elm_smart_scroller_extern_pan_set (Evas_Object *obj, Evas_Object *pan, void (*pan_set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*pan_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)); +void elm_smart_scroller_custom_edje_file_set (Evas_Object *obj, char *file, char *group); +void elm_smart_scroller_child_pos_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y); +void elm_smart_scroller_child_pos_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); +void elm_smart_scroller_child_region_show (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); +void elm_smart_scroller_child_viewport_size_get (Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); +void elm_smart_scroller_step_size_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y); +void elm_smart_scroller_step_size_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); +void elm_smart_scroller_page_size_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y); +void elm_smart_scroller_page_size_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); +void elm_smart_scroller_policy_set (Evas_Object *obj, Elm_Smart_Scroller_Policy hbar, Elm_Smart_Scroller_Policy vbar); +void elm_smart_scroller_policy_get (Evas_Object *obj, Elm_Smart_Scroller_Policy *hbar, Elm_Smart_Scroller_Policy *vbar); +Evas_Object *elm_smart_scroller_edje_object_get (Evas_Object *obj); +void elm_smart_scroller_single_dir_set (Evas_Object *obj, Eina_Bool single_dir); +Eina_Bool elm_smart_scroller_single_dir_get (Evas_Object *obj); +void elm_smart_scroller_object_theme_set (Evas_Object *parent, Evas_Object *obj, const char *clas, const char *group, const char *style); +void elm_smart_scroller_hold_set (Evas_Object *obj, Eina_Bool hold); +void elm_smart_scroller_freeze_set (Evas_Object *obj, Eina_Bool freeze); +void elm_smart_scroller_bounce_allow_set (Evas_Object *obj, Eina_Bool horiz, Eina_Bool vert); +void elm_smart_scroller_bounce_allow_get (const Evas_Object *obj, Eina_Bool *horiz, Eina_Bool *vert); +void elm_smart_scroller_paging_set (Evas_Object *obj, double pagerel_h, double pagerel_v, Evas_Coord pagesize_h, Evas_Coord pagesize_v); +void elm_smart_scroller_region_bring_in (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); +void elm_smart_scroller_widget_set (Evas_Object *obj, Evas_Object *wid); +void elm_smart_scroller_page_move_set (Evas_Object *obj, Eina_Bool set); +void elm_smart_scroller_freeze_momentum_animator_set(Evas_Object *obj, Eina_Bool freeze); +void elm_smart_scroller_freeze_bounce_animator_set(Evas_Object *obj, Eina_Bool freeze); + +void _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous); +void _els_box_layout_ex(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous, int extended); + +Evas_Object *_els_smart_icon_add (Evas *evas); +Eina_Bool _els_smart_icon_file_key_set (Evas_Object *obj, const char *file, const char *key); +Eina_Bool _els_smart_icon_file_edje_set (Evas_Object *obj, const char *file, const char *part); +void _els_smart_icon_smooth_scale_set (Evas_Object *obj, int smooth); +Evas_Object *_els_smart_icon_object_get(Evas_Object *obj); +void _els_smart_icon_size_get (Evas_Object *obj, int *w, int *h); +void _els_smart_icon_fill_inside_set (Evas_Object *obj, int fill_inside); +void _els_smart_icon_scale_up_set (Evas_Object *obj, int scale_up); +void _els_smart_icon_scale_down_set (Evas_Object *obj, int scale_down); +void _els_smart_icon_scale_size_set (Evas_Object *obj, int size); +void _els_smart_icon_scale_set (Evas_Object *obj, double scale); +void _els_smart_icon_orient_set (Evas_Object *obj, Elm_Image_Orient orient); + +void _els_smart_icon_edit_set (Evas_Object *obj, Eina_Bool, Evas_Object *parent); + typedef struct _Elm_Config Elm_Config; typedef struct _Elm_Module Elm_Module; @@ -114,7 +179,7 @@ struct _Elm_Config int input_panel_enable; int autocapital_allow; int autoperiod_allow; - Eina_Bool password_show_last_character; + int password_show_last_character; }; struct _Elm_Module @@ -203,11 +268,11 @@ char *_elm_util_text_to_mkup(const char *text); EAPI Eina_Bool elm_cbhm_helper_init(Evas_Object *self); EAPI void elm_cbhm_send_raw_data(char *cmd); -extern char *_elm_appname; -extern Elm_Config *_elm_config; -extern const char *_elm_data_dir; -extern const char *_elm_lib_dir; -extern int _elm_log_dom; -extern Eina_List *_elm_win_list; +extern char *_elm_appname; +extern Elm_Config *_elm_config; +extern const char *_elm_data_dir; +extern const char *_elm_lib_dir; +extern int _elm_log_dom; +extern Eina_List *_elm_win_list; #endif diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c index b6f16ff..c24f273 100644 --- a/src/lib/elm_progressbar.c +++ b/src/lib/elm_progressbar.c @@ -68,31 +68,32 @@ _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; + edje_object_part_unswallow(NULL, wd->spacer); if (wd->horizontal) _elm_theme_object_set(obj, wd->progressbar, "progressbar", "horizontal", elm_widget_style_get(obj)); else _elm_theme_object_set(obj, wd->progressbar, "progressbar", "vertical", elm_widget_style_get(obj)); - + if (wd->inverted) + edje_object_signal_emit(wd->progressbar, "elm,state,inverted,on", "elm"); + else + edje_object_signal_emit(wd->progressbar, "elm,state,inverted,off", "elm"); if (wd->icon) - { - edje_object_part_swallow(wd->progressbar, "elm.swallow.content", wd->icon); - edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm"); - } + edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm"); + else + edje_object_signal_emit(wd->progressbar, "elm,state,icon,hidden", "elm"); if (wd->label) - { - edje_object_part_text_set(wd->progressbar, "elm.text", wd->label); - edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm"); - } + edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm"); + else + edje_object_signal_emit(wd->progressbar, "elm,state,text,hidden", "elm"); + edje_object_part_text_set(wd->progressbar, "elm.text", wd->label); if (wd->pulse) - edje_object_signal_emit(wd->progressbar, "elm,state,pulse", "elm"); + edje_object_signal_emit(wd->progressbar, "elm,state,pulse", "elm"); else - edje_object_signal_emit(wd->progressbar, "elm,state,fraction", "elm"); - if (wd->pulse_state) - edje_object_signal_emit(wd->progressbar, "elm,state,pulse,start", "elm"); - - if ((wd->units) && (!wd->pulse)) - edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm"); - + edje_object_signal_emit(wd->progressbar, "elm,state,fraction", "elm"); + if (wd->units && !wd->pulse) + edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm"); + else + edje_object_signal_emit(wd->progressbar, "elm,state,units,hidden", "elm"); if (wd->horizontal) evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1); else @@ -100,9 +101,6 @@ _theme_hook(Evas_Object *obj) edje_object_part_swallow(wd->progressbar, "elm.swallow.bar", wd->spacer); - if (wd->inverted) - edje_object_signal_emit(wd->progressbar, "elm,state,inverted,on", "elm"); - _units_set(obj); edje_object_message_signal_process(wd->progressbar); edje_object_scale_set(wd->progressbar, elm_widget_scale_get(obj) * _elm_config->scale); @@ -138,12 +136,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) if (!wd) return; if (sub == wd->icon) { - edje_object_signal_emit(wd->progressbar, "elm,state,icon,hidden", "elm"); - evas_object_event_callback_del_full - (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - wd->icon = NULL; - edje_object_message_signal_process(wd->progressbar); - _sizing_eval(obj); + edje_object_signal_emit(wd->progressbar, "elm,state,icon,hidden", "elm"); + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + wd->icon = NULL; + edje_object_message_signal_process(wd->progressbar); + _sizing_eval(obj); } } @@ -188,11 +186,8 @@ elm_progressbar_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "progressbar"); elm_widget_type_set(obj, "progressbar"); @@ -200,7 +195,6 @@ elm_progressbar_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); wd->horizontal = EINA_TRUE; wd->inverted = EINA_FALSE; @@ -215,7 +209,7 @@ elm_progressbar_add(Evas_Object *parent) wd->spacer = evas_object_rectangle_add(e); evas_object_color_set(wd->spacer, 0, 0, 0, 0); - evas_object_pass_events_set(wd->spacer, EINA_TRUE); + evas_object_pass_events_set(wd->spacer, 1); elm_widget_sub_object_add(obj, wd->spacer); edje_object_part_swallow(wd->progressbar, "elm.swallow.bar", wd->spacer); @@ -283,7 +277,7 @@ elm_progressbar_pulse(Evas_Object *obj, Eina_Bool state) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; state = !!state; - if ((!wd->pulse) && (wd->pulse_state == state)) return; + if (!wd->pulse && wd->pulse_state == state) return; wd->pulse_state = state; if (wd->pulse_state) edje_object_signal_emit(wd->progressbar, "elm,state,pulse,start", "elm"); @@ -295,7 +289,7 @@ elm_progressbar_pulse(Evas_Object *obj, Eina_Bool state) * Set the value the progressbar indicates * * @param obj The progressbar object - * @param val The fraction value (must be between 0.0 and 1.0) + * @param val The fraction value (must be beween 0.0 and 1.0) * * @ingroup Progressbar */ @@ -348,13 +342,13 @@ elm_progressbar_label_set(Evas_Object *obj, const char *label) eina_stringshare_replace(&wd->label, label); if (label) { - edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm"); - edje_object_message_signal_process(wd->progressbar); + edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm"); + edje_object_message_signal_process(wd->progressbar); } else { - edje_object_signal_emit(wd->progressbar, "elm,state,text,hidden", "elm"); - edje_object_message_signal_process(wd->progressbar); + edje_object_signal_emit(wd->progressbar, "elm,state,text,hidden", "elm"); + edje_object_message_signal_process(wd->progressbar); } edje_object_part_text_set(wd->progressbar, "elm.text", label); _sizing_eval(obj); @@ -381,8 +375,6 @@ elm_progressbar_label_get(const Evas_Object *obj) * Set the icon object of the progressbar object * * Once the icon object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_progressbar_icon_unset() function. * * @param obj The progressbar object * @param icon The icon object @@ -400,12 +392,12 @@ elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon) wd->icon = icon; if (icon) { - elm_widget_sub_object_add(obj, icon); - evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->progressbar, "elm.swallow.content", icon); - edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm"); - edje_object_message_signal_process(wd->progressbar); + elm_widget_sub_object_add(obj, icon); + evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + edje_object_part_swallow(wd->progressbar, "elm.swallow.content", icon); + edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm"); + edje_object_message_signal_process(wd->progressbar); } _sizing_eval(obj); } @@ -428,30 +420,6 @@ elm_progressbar_icon_get(const Evas_Object *obj) } /** - * Unset the icon used for the progressbar object - * - * Unparent and return the icon object which was set for this widget. - * - * @param obj The progressbar object - * @return The icon object that was being used - * - * @ingroup Progressbar - */ -EAPI Evas_Object * -elm_progressbar_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->icon) return NULL; - Evas_Object *icon = wd->icon; - elm_widget_sub_object_del(obj, wd->icon); - edje_object_part_unswallow(wd->progressbar, wd->icon); - wd->icon = NULL; - return icon; -} - -/** * Set the length of the progression region of the progressbar * * This sets the minimum width or height (depending on orientation) of the @@ -519,13 +487,13 @@ elm_progressbar_unit_format_set(Evas_Object *obj, const char *units) eina_stringshare_replace(&wd->units, units); if (units) { - edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm"); - edje_object_message_signal_process(wd->progressbar); + edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm"); + edje_object_message_signal_process(wd->progressbar); } else { - edje_object_signal_emit(wd->progressbar, "elm,state,units,hidden", "elm"); - edje_object_message_signal_process(wd->progressbar); + edje_object_signal_emit(wd->progressbar, "elm,state,units,hidden", "elm"); + edje_object_message_signal_process(wd->progressbar); } _units_set(obj); _sizing_eval(obj); diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c index 9d3c4bd..e2a65e9 100644 --- a/src/lib/elm_radio.c +++ b/src/lib/elm_radio.c @@ -60,11 +60,6 @@ static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _signal_radio_on(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _on_focus_hook(void *data, Evas_Object *obj); -static void _activate(Evas_Object *obj); -static void _activate_hook(Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); static const char SIG_CHANGED[] = "changed"; static const Evas_Smart_Cb_Description _signals[] = { @@ -72,23 +67,6 @@ static const Evas_Smart_Cb_Description _signals[] = { {NULL, NULL} }; -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - - if ((strcmp(ev->keyname, "Return")) && - (strcmp(ev->keyname, "KP_Enter")) && - (strcmp(ev->keyname, "space"))) - return EINA_FALSE; - _activate(obj); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; -} - static void _del_hook(Evas_Object *obj) { @@ -102,23 +80,6 @@ _del_hook(Evas_Object *obj) } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->radio, "elm,action,focus", "elm"); - evas_object_focus_set(wd->radio, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->radio, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->radio, EINA_FALSE); - } -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -137,11 +98,6 @@ _theme_hook(Evas_Object *obj) else edje_object_signal_emit(wd->radio, "elm,state,text,hidden", "elm"); edje_object_part_text_set(wd->radio, "elm.text", wd->label); - if (elm_widget_disabled_get(obj)) - { - edje_object_signal_emit(wd->radio, "elm,state,disabled", "elm"); - if (wd->state) _state_set(obj, 0); - } edje_object_message_signal_process(wd->radio); edje_object_scale_set(wd->radio, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); @@ -231,37 +187,25 @@ _state_set_all(Widget_Data *wd) } else _state_set(child, 0); } - if ((disabled) && (selected)) _state_set(selected, 1); + if (disabled && selected) _state_set(selected, 1); } static void -_activate(Evas_Object *obj) +_signal_radio_on(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; if (wd->group->value == wd->value) return; wd->group->value = wd->value; if (wd->group->valuep) *(wd->group->valuep) = wd->group->value; _state_set_all(wd); - evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); -} - -static void -_activate_hook(Evas_Object *obj) -{ - _activate(obj); -} - -static void -_signal_radio_on(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ - _activate(data); + evas_object_smart_callback_call(data, SIG_CHANGED, NULL); } /** * Add a new radio to the parent * - * @param parent The parent object + * @param[in] parent The parent object * @return The new object or NULL if it cannot be created * * @ingroup Radio @@ -273,23 +217,16 @@ elm_radio_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "radio"); elm_widget_type_set(obj, "radio"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_activate_hook_set(obj, _activate_hook); - elm_widget_event_hook_set(obj, _event_hook); wd->radio = edje_object_add(e); _elm_theme_object_set(obj, wd->radio, "radio", "base", "default"); @@ -314,8 +251,8 @@ elm_radio_add(Evas_Object *parent) /** * Set the text label of the radio object * - * @param obj The radio object - * @param label The text label string in UTF-8 + * @param[in] obj The radio object + * @param[in] label The text label string in UTF-8 * * @ingroup Radio */ @@ -343,7 +280,7 @@ elm_radio_label_set(Evas_Object *obj, const char *label) /** * Get the text label of the radio object * - * @param obj The radio object + * @param[in] obj The radio object * @return The text label string in UTF-8 * * @ingroup Radio @@ -361,11 +298,9 @@ elm_radio_label_get(const Evas_Object *obj) * Set the icon object of the radio object * * Once the icon object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_radio_icon_unset() function. * - * @param obj The radio object - * @param icon The icon object + * @param[in] obj The radio object + * @param[in] icon The icon object * * @ingroup Radio */ @@ -393,7 +328,7 @@ elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Get the icon object of the radio object * - * @param obj The radio object + * @param[in] obj The radio object * @return The icon object * * @ingroup Radio @@ -408,30 +343,6 @@ elm_radio_icon_get(const Evas_Object *obj) } /** - * Unset the icon used for the radio object - * - * Unparent and return the icon object which was set for this widget. - * - * @param obj The radio object - * @return The icon object that was being used - * - * @ingroup Radio - */ -EAPI Evas_Object * -elm_radio_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->icon) return NULL; - Evas_Object *icon = wd->icon; - elm_widget_sub_object_del(obj, wd->icon); - edje_object_part_unswallow(wd->radio, wd->icon); - wd->icon = NULL; - return icon; -} - -/** * Add this radio to a group of other radio objects * * Radio objects work in groups. Each member should have a different integer @@ -439,8 +350,8 @@ elm_radio_icon_unset(Evas_Object *obj) * about eacthother. This adds the given radio object to the group of which * the group object indicated is a member. * - * @param obj The radio object - * @param group The object whose group the object is to join + * @param[in] obj The radio object + * @param[in] group The object whose group the object is to join * * @ingroup Radio */ @@ -476,8 +387,8 @@ elm_radio_group_add(Evas_Object *obj, Evas_Object *group) * * This sets the value of the radio. * - * @param obj The radio object - * @param value The value to use if this radio object is selected + * @param[in] obj The radio object + * @param[in] value The value to use if this radio object is selected * * @ingroup Radio */ @@ -493,32 +404,13 @@ elm_radio_state_value_set(Evas_Object *obj, int value) } /** - * Get the integer value that this radio object represents - * - * This gets the value of the radio. - * - * @param obj The radio object - * @return The value used if this radio object is selected - * - * @ingroup Radio - */ -EAPI int -elm_radio_state_value_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) 0; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return 0; - return wd->value; -} - -/** * Set the value of the radio. * * This sets the value of the radio group and will also set the value if * pointed to, to the value supplied, but will not call any callbacks. * - * @param obj The radio object - * @param value The value to use for the group + * @param[in] obj The radio object + * @param[in] value The value to use for the group * * @ingroup Radio */ @@ -537,7 +429,7 @@ elm_radio_value_set(Evas_Object *obj, int value) /** * Get the state of the radio object * - * @param obj The radio object + * @param[in] obj The radio object * @return The integer state * * @ingroup Radio @@ -561,8 +453,8 @@ elm_radio_value_get(const Evas_Object *obj) * reflect the value of the integer valuep points to, just like calling * elm_radio_value_set(). * - * @param obj The radio object - * @param valuep Pointer to the integer to modify + * @param[in] obj The radio object + * @param[in] valuep Pointer to the integer to modify * * @ingroup Radio */ diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index d3faf3e..51120fa 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -50,10 +50,6 @@ static void _theme_hook(Evas_Object *obj); static void _show_region_hook(void *data, Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _sub_del(void *data, Evas_Object *obj, void *event_info); -static void _on_focus_hook(void *data, Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); - static const char SIG_SCROLL[] = "scroll"; static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start"; @@ -77,95 +73,6 @@ static const Evas_Smart_Cb_Description _signals[] = { {NULL, NULL} }; -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - - Evas_Coord x = 0; - Evas_Coord y = 0; - Evas_Coord step_x = 0; - Evas_Coord step_y = 0; - Evas_Coord max_x = 0; - Evas_Coord max_y = 0; - Evas_Coord v_w = 0; - Evas_Coord v_h = 0; - Evas_Coord page_x = 0; - Evas_Coord page_y = 0; - - elm_smart_scroller_child_pos_get(wd->scr, &x, &y); - elm_smart_scroller_step_size_get(wd->scr, &step_x, &step_y); - elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y); - elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); - elm_scroller_child_size_get(obj, &max_x, &max_y); - - if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) - { - x -= step_x; - } - else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) - { - x += step_x; - } - else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) - { - y -= step_y; - } - else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) - { - y += step_y; - } - else if ((!strcmp(ev->keyname, "Home")) || (!strcmp(ev->keyname, "KP_Home"))) - { - y = 0; - } - else if ((!strcmp(ev->keyname, "End")) || (!strcmp(ev->keyname, "KP_End"))) - { - y = max_y - v_h; - } - else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior"))) - { - if (page_y < 0) - y -= -(page_y * v_h) / 100; - else - y -= page_y; - } - else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next"))) - { - if (page_y < 0) - y += -(page_y * v_h) / 100; - else - y += page_y; - } - else return EINA_FALSE; - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - elm_smart_scroller_child_pos_set(wd->scr, x, y); - return EINA_TRUE; -} - -static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->scr, "elm,action,focus", "elm"); - evas_object_focus_set(wd->scr, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->scr, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->scr, EINA_FALSE); - } -} - static void _del_hook(Evas_Object *obj) { @@ -181,43 +88,14 @@ _theme_hook(Evas_Object *obj) if (!wd) return; if (wd->scr) { - Evas_Object *edj; - const char *str; - - elm_smart_scroller_object_theme_set(obj, wd->scr, + elm_smart_scroller_object_theme_set(obj, wd->scr, wd->widget_name, wd->widget_base, elm_widget_style_get(obj)); // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); - edj = elm_smart_scroller_edje_object_get(wd->scr); - str = edje_object_data_get(edj, "focus_highlight"); - if ((str) && (!strcmp(str, "on"))) - elm_widget_highlight_in_theme_set(obj, EINA_TRUE); - else - elm_widget_highlight_in_theme_set(obj, EINA_FALSE); } _sizing_eval(obj); } -static Eina_Bool -_elm_scroller_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *cur; - - if ((!wd) || (!wd->content)) - return EINA_FALSE; - - cur = wd->content; - - /* Try Focus cycle in subitem */ - if ((elm_widget_can_focus_get(cur)) || (elm_widget_child_can_focus_get(cur))) - return elm_widget_focus_next_get(cur, dir, next); - - /* Return */ - *next = (Evas_Object *)obj; - return !elm_widget_focus_get(obj); -} - static void _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) { @@ -228,26 +106,9 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) } static void -_signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - edje_object_signal_callback_add(elm_smart_scroller_edje_object_get(wd->scr), - emission, source, func_cb, data); -} - -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_del_full( - elm_smart_scroller_edje_object_get(wd->scr), emission, source, - func_cb, data); -} - -static void _show_region_hook(void *data, Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(data); Evas_Coord x, y, w, h; if (!wd) return; @@ -257,16 +118,9 @@ _show_region_hook(void *data, Evas_Object *obj) } static void -_focus_region_hook(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (wd->scr) - elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); -} - -static void _sizing_eval(Evas_Object *obj) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord vw, vh, minw, minh, maxw, maxh, w, h, vmw, vmh; double xw, yw; @@ -275,30 +129,38 @@ _sizing_eval(Evas_Object *obj) evas_object_size_hint_min_get(wd->content, &minw, &minh); evas_object_size_hint_max_get(wd->content, &maxw, &maxh); evas_object_size_hint_weight_get(wd->content, &xw, &yw); + //evas_object_geometry_get(wd->content, NULL, NULL, &w, &h); + if (wd->scr) { elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); if (xw > 0.0) { - if ((minw > 0) && (vw < minw)) vw = minw; +// if(w > vw) vw = w; + if ((minw > 0) && (vw < minw)) vw = minw; else if ((maxw > 0) && (vw > maxw)) vw = maxw; } else if (minw > 0) vw = minw; + if (yw > 0.0) { - if ((minh > 0) && (vh < minh)) vh = minh; + // if(h > vh) vh = h; + if ((minh > 0) && (vh < minh)) vh = minh; else if ((maxh > 0) && (vh > maxh)) vh = maxh; } else if (minh > 0) vh = minh; + evas_object_resize(wd->content, vw, vh); w = -1; h = -1; edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh); if (wd->min_w) w = vmw + minw; if (wd->min_h) h = vmh + minh; + evas_object_size_hint_max_get(obj, &maxw, &maxh); if ((maxw > 0) && (w > maxw)) w = maxw; if ((maxh > 0) && (h > maxh)) h = maxh; + evas_object_size_hint_min_set(obj, w, h); } } @@ -312,6 +174,7 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, static void _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) { + Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *sub = event_info; @@ -331,6 +194,7 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) static void _hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -341,6 +205,7 @@ _hold_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) static void _hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -351,6 +216,7 @@ _hold_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) static void _freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -361,6 +227,7 @@ _freeze_on(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) static void _freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -444,33 +311,25 @@ elm_scroller_add(Evas_Object *parent) Widget_Data *wd; Evas_Coord minw, minh; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "scroller"); elm_widget_type_set(obj, "scroller"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); - elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); - elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - elm_widget_focus_next_hook_set(obj, _elm_scroller_focus_next_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); - elm_widget_focus_region_hook_set(obj, _focus_region_hook); wd->widget_name = eina_stringshare_add("scroller"); wd->widget_base = eina_stringshare_add("base"); - + wd->scr = elm_smart_scroller_add(e); elm_smart_scroller_widget_set(wd->scr, obj); - _theme_hook(obj); + elm_smart_scroller_object_theme_set(obj, wd->scr, + wd->widget_name, wd->widget_base, + elm_widget_style_get(obj)); elm_widget_resize_object_set(obj, wd->scr); evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); @@ -503,14 +362,6 @@ elm_scroller_add(Evas_Object *parent) return obj; } -Evas_Object * -_elm_scroller_edje_object_get(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return elm_smart_scroller_edje_object_get(wd->scr); -} /** * Set the content of the scroller widget (the object to be scrolled around). @@ -537,8 +388,8 @@ elm_scroller_content_set(Evas_Object *obj, Evas_Object *content) { elm_widget_on_show_region_hook_set(content, _show_region_hook, obj); elm_widget_sub_object_add(obj, content); - if (wd->scr) - elm_smart_scroller_child_set(wd->scr, content); + if (wd->scr) + elm_smart_scroller_child_set(wd->scr, content); evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); } @@ -569,7 +420,7 @@ elm_scroller_content_get(const Evas_Object *obj) * * Unparent and return the content object which was set for this widget * - * @param obj The slider object + * @param obj The slider objecet * @return The content that was being used * * @ingroup Scroller @@ -591,7 +442,7 @@ elm_scroller_content_unset(Evas_Object *obj) /** * Set custom theme elements for the scroller - * + * * @param obj The scroller object * @param widget The widget name to use (default is "scroller") * @param base The base name to use (default is "base") @@ -604,8 +455,7 @@ elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(widget); - EINA_SAFETY_ON_NULL_RETURN(base); + if ((!widget) || (!base)) return; if (eina_stringshare_replace(&wd->widget_name, widget) | eina_stringshare_replace(&wd->widget_base, base)) _theme_hook(obj); @@ -655,8 +505,9 @@ elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coor { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->scr)) return; - elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); + if (!wd) return; + if (wd->scr) + elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } /** @@ -685,9 +536,10 @@ elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scro ELM_SMART_SCROLLER_POLICY_ON, ELM_SMART_SCROLLER_POLICY_OFF }; - if ((!wd) || (!wd->scr)) return; + if (!wd) return; if ((policy_h >= 3) || (policy_v >= 3)) return; - elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]); + if (wd->scr) + elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]); } EAPI void @@ -695,10 +547,12 @@ elm_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, E { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->scr)) return; - elm_smart_scroller_policy_get(wd->scr, - (Elm_Smart_Scroller_Policy *) policy_h, - (Elm_Smart_Scroller_Policy *) policy_v); + Elm_Smart_Scroller_Policy s_policy_h, s_policy_v; + if (!wd) return; + if (wd->scr) + elm_smart_scroller_policy_get(wd->scr, &s_policy_h, &s_policy_v); + *policy_h = (Elm_Scroller_Policy) s_policy_h; + *policy_v = (Elm_Scroller_Policy) s_policy_v; } /** @@ -721,9 +575,12 @@ elm_scroller_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Ev { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->scr)) return; - if ((x) || (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y); - if ((w) || (h)) elm_smart_scroller_child_viewport_size_get(wd->scr, w, h); + if (!wd) return; + if (wd->scr) + { + if ((x) && (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y); + if ((w) && (h)) elm_smart_scroller_child_viewport_size_get(wd->scr, w, h); + } } /** @@ -754,7 +611,7 @@ elm_scroller_child_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h * When scrolling, the scroller may "bounce" when reaching an edge of the child * object. This is a visual way to indicate the end has been reached. This is * enabled by default for both axes. This will set if it is enabled for that - * axis with the boolean parameters for each axis. + * axis with the boolean parameers for each axis. * * @param obj The scroller object * @param h_bounce Will the scroller bounce horizontally or not @@ -767,8 +624,9 @@ elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->scr)) return; - elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); + if (!wd) return; + if (wd->scr) + elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); } /** @@ -790,15 +648,15 @@ elm_scroller_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool * } /** - * Set scroll page size relative to viewport size. + * Set scroll page size relative to viewport size * - * The scroller is capable of limiting scrolling by the user to "pages". That + * The scroller is sapale of limiting scrolling by the user to "pages". That * is to jump by and only show a "whole page" at a time as if the continuous - * area of the scroller content is split into page sized pieces. This sets + * area of the scroller conent is split into page sized pieces. This sets * the size of a page relative to the viewport of the scroller. 1.0 is "1 * viewport" is size (horizontally or vertically). 0.0 turns it off in that * axis. This is mutually exclusive with page size - * (see elm_scroller_page_size_set() for more information). Likewise 0.5 + * (see elm_scroller_page_size_set() for more information). likewise 0.5 * is "half a viewport". Sane usable valus are normally between 0.0 and 1.0 * including 1.0. If you only want 1 axis to be page "limited", use 0.0 for * the other axis. @@ -823,10 +681,10 @@ elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_page } /** - * Set scroll page size. + * Set scroll page size * * See also elm_scroller_page_relative_set(). This, instead of a page size - * being relative to the viewport, sets it to an absolute fixed value, with + * being relaive to the viewport, sets it to an absolute fixed value, with * 0 turning it off for that axis. * * @param obj The scroller object @@ -849,7 +707,7 @@ elm_scroller_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v } /** - * Show a specific virtual region within the scroller content object. + * Show a specific virtual region within the scroller content object * * This will ensure all (or part if it does not fit) of the designated * region in the virtual content object (0, 0 starting at the top-left of the @@ -872,57 +730,41 @@ elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_ { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->scr)) return; - elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); + if (!wd) return; + if (wd->scr) + elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); } - /** - * Set event propagation on a scroller + * Set scroll only one page * - * This enables or disabled event propagation from the scroller content to - * the scroller and its parent. By default event propagation is disabled. - * * @param obj The scroller object - * @param propagation If propagation is enabled or not + * @param set Flag * * @ingroup Scroller */ EAPI void -elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool propagation) +elm_scroller_page_move_set(Evas_Object *obj, Eina_Bool set) { - ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - evas_object_propagate_events_set(wd->scr, propagation); + elm_smart_scroller_page_move_set(wd->scr, set); } /** - * Get event propagation for a scroller + * Set events propagation * - * This gets the event propagation for a scroller. See - * elm_scroller_propagate_events_set() for more information - * * @param obj The scroller object - * @return The propagation state + * @param set Flag * * @ingroup Scroller */ -EAPI Eina_Bool -elm_scroller_propagate_events_get(const Evas_Object *obj) +EAPI void +elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool set) { - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; + if (!wd) return; - return evas_object_propagate_events_get(wd->scr); + evas_object_propagate_events_set(wd->scr, set); } - - - -EAPI void -elm_scroller_page_move_set(Evas_Object *obj, Eina_Bool set) -{ - return ; -} \ No newline at end of file diff --git a/src/lib/elm_separator.c b/src/lib/elm_separator.c index c3d0cdd..319ff35 100644 --- a/src/lib/elm_separator.c +++ b/src/lib/elm_separator.c @@ -71,11 +71,8 @@ elm_separator_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "separator"); wd->horizontal = EINA_FALSE; @@ -84,7 +81,7 @@ elm_separator_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); + elm_widget_can_focus_set(obj, 0); wd->sep = edje_object_add(e); _elm_theme_object_set(obj, wd->sep, "separator", "vertical", "default"); diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index c2d569d..e4e8f46 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include #include "elm_priv.h" @@ -45,43 +48,40 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { Evas_Object *slider; - Evas_Object *icon; - Evas_Object *end; + Evas_Object *icon; Evas_Object *spacer; const char *label; + const char *e_label; const char *units; const char *indicator; const char *(*indicator_format_func)(double val); Eina_Bool horizontal : 1; Eina_Bool inverted : 1; - Eina_Bool indicator_show : 1; int feed_cnt; double val, val_min, val_max; Ecore_Timer *delay; Evas_Coord size; + Ecore_Timer *mv_timer; + Evas_Object *e_icon; + double src_val; + double des_val; + double mv_step; }; -#define ELM_SLIDER_INVERTED_FACTOR (-1.0) +#define SLIDER_THUMB_MOVE_STEP 100 -static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); -static void _disable_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _units_set(Evas_Object *obj); -static void _val_set(Evas_Object *obj); static void _indicator_set(Evas_Object *obj); -static void _on_focus_hook(void *data, Evas_Object *obj); -static void _drag_up(void *data, Evas_Object *obj, - const char *emission, const char *source); -static void _drag_down(void *data, Evas_Object *obj, - const char *emission, const char *source); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); static void _spacer_cb(void *data, Evas * e, Evas_Object * obj, void *event_info); + +static Eina_Bool _mv_timer_cb(void *data); + static const char SIG_CHANGED[] = "changed"; static const char SIG_DELAY_CHANGED[] = "delay,changed"; static const char SIG_DRAG_START[] = "slider,drag,start"; @@ -94,98 +94,19 @@ static const Evas_Smart_Cb_Description _signals[] = { {NULL, NULL} }; -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - Evas_Event_Mouse_Wheel *mev; - Evas_Event_Key_Down *ev; - Widget_Data *wd; - - wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - - if (type == EVAS_CALLBACK_KEY_DOWN) goto key_down; - else if (type != EVAS_CALLBACK_MOUSE_WHEEL) return EINA_FALSE; - - mev = event_info; - if (mev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - - if (mev->z < 0) _drag_up(obj, NULL, NULL, NULL); - else _drag_down(obj, NULL, NULL, NULL); - mev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - - key_down: - ev = event_info; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if ((!strcmp(ev->keyname, "Left")) - || (!strcmp(ev->keyname, "KP_Left"))) - { - if (!wd->horizontal) return EINA_FALSE; - if (!wd->inverted) _drag_down(obj, NULL, NULL, NULL); - else _drag_up(obj, NULL, NULL, NULL); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!strcmp(ev->keyname, "Right")) - || (!strcmp(ev->keyname, "KP_Right"))) - { - if (!wd->horizontal) return EINA_FALSE; - if (!wd->inverted) _drag_up(obj, NULL, NULL, NULL); - else _drag_down(obj, NULL, NULL, NULL); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) - { - if (wd->horizontal) return EINA_FALSE; - if (wd->inverted) _drag_up(obj, NULL, NULL, NULL); - else _drag_down(obj, NULL, NULL, NULL); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) - { - if (wd->horizontal) return EINA_FALSE; - if (wd->inverted) _drag_down(obj, NULL, NULL, NULL); - else _drag_up(obj, NULL, NULL, NULL); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else return EINA_FALSE; -} - static void _del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (wd->label) eina_stringshare_del(wd->label); + if (wd->e_label) eina_stringshare_del(wd->label); if (wd->indicator) eina_stringshare_del(wd->units); if (wd->delay) ecore_timer_del(wd->delay); free(wd); } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->slider, "elm,action,focus", "elm"); - evas_object_focus_set(wd->slider, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->slider, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->slider, EINA_FALSE); - } -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -194,53 +115,44 @@ _theme_hook(Evas_Object *obj) _elm_theme_object_set(obj, wd->slider, "slider", "horizontal", elm_widget_style_get(obj)); else _elm_theme_object_set(obj, wd->slider, "slider", "vertical", elm_widget_style_get(obj)); + if (wd->inverted) + edje_object_signal_emit(wd->slider, "elm,state,inverted,on", "elm"); + else + edje_object_signal_emit(wd->slider, "elm,state,inverted,off", "elm"); if (wd->icon) - { - edje_object_part_swallow(wd->slider, "elm.swallow.content", wd->icon); - edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm"); - } - if (wd->end) - edje_object_signal_emit(wd->slider, "elm,state,end,visible", "elm"); + edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm"); + else + edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm"); + if (wd->e_icon) + edje_object_signal_emit(wd->slider, "elm,state,eicon,visible", "elm"); else - edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm"); + edje_object_signal_emit(wd->slider, "elm,state,eicon,hidden", "elm"); if (wd->label) - { - edje_object_part_text_set(wd->slider, "elm.text", wd->label); - edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm"); - } - + edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm"); + else + edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm"); + edje_object_part_text_set(wd->slider, "elm.text", wd->label); + if (wd->e_label) + edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm"); + else + edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm"); + edje_object_part_text_set(wd->slider, "elm.units", wd->e_label); if (wd->units) edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm"); - + else + edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm"); if (wd->horizontal) evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1); else evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale); - - if (wd->inverted) - edje_object_signal_emit(wd->slider, "elm,state,inverted,on", "elm"); - edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer); _units_set(obj); - _indicator_set(obj); edje_object_message_signal_process(wd->slider); edje_object_scale_set(wd->slider, elm_widget_scale_get(obj) * _elm_config->scale); - _val_set(obj); _sizing_eval(obj); } static void -_disable_hook(Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_disabled_get(obj)) - edje_object_signal_emit(wd->slider, "elm,state,disabled", "elm"); - else - edje_object_signal_emit(wd->slider, "elm,state,enabled", "elm"); -} - -static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -258,7 +170,9 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *even { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - if ((obj != wd->icon) && (obj != wd->end)) return; + + if (obj != wd->icon && obj != wd->e_icon) return; + _sizing_eval(data); } @@ -270,21 +184,17 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) if (!wd) return; if (sub == wd->icon) { - edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm"); - evas_object_event_callback_del_full - (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - wd->icon = NULL; - edje_object_message_signal_process(wd->slider); - _sizing_eval(obj); + edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm"); + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + wd->icon = NULL; + edje_object_message_signal_process(wd->slider); + _sizing_eval(obj); } - if (sub == wd->end) + if (sub == wd->e_icon) { - edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm"); - evas_object_event_callback_del_full(sub, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - wd->end = NULL; - edje_object_message_signal_process(wd->slider); + edje_object_signal_emit(wd->slider, "elm,state,eicon,hidden", "elm"); + evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + wd->e_icon = NULL; _sizing_eval(obj); } } @@ -305,18 +215,17 @@ _val_fetch(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); double posx = 0.0, posy = 0.0, pos = 0.0, val; if (!wd) return; - edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", - &posx, &posy); + edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", &posx, &posy); if (wd->horizontal) pos = posx; else pos = posy; if (wd->inverted) pos = 1.0 - pos; val = (pos * (wd->val_max - wd->val_min)) + wd->val_min; if (val != wd->val) { - wd->val = val; - evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); - if (wd->delay) ecore_timer_del(wd->delay); - wd->delay = ecore_timer_add(0.2, _delay_change, obj); + wd->val = val; + evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); + if (wd->delay) ecore_timer_del(wd->delay); + wd->delay = ecore_timer_add(0.2, _delay_change, obj); } } @@ -343,11 +252,12 @@ _units_set(Evas_Object *obj) if (!wd) return; if (wd->units) { - char buf[1024]; - - snprintf(buf, sizeof(buf), wd->units, wd->val); - edje_object_part_text_set(wd->slider, "elm.units", buf); + char buf[1024]; + snprintf(buf, sizeof(buf), wd->units, wd->val); + edje_object_part_text_set(wd->slider, "elm.units", buf); } + else if (wd->e_label) + edje_object_part_text_set(wd->slider, "elm.units", wd->e_label); else edje_object_part_text_set(wd->slider, "elm.units", NULL); } @@ -359,15 +269,15 @@ _indicator_set(Evas_Object *obj) if (!wd) return; if (wd->indicator_format_func) { - const char *buf; - buf = wd->indicator_format_func(wd->val); - edje_object_part_text_set(wd->slider, "elm.indicator", buf); + const char *buf; + buf = wd->indicator_format_func(wd->val); + edje_object_part_text_set(wd->slider, "elm.indicator", buf); } else if (wd->indicator) { - char buf[1024]; - snprintf(buf, sizeof(buf), wd->indicator, wd->val); - edje_object_part_text_set(wd->slider, "elm.indicator", buf); + char buf[1024]; + snprintf(buf, sizeof(buf), wd->indicator, wd->val); + edje_object_part_text_set(wd->slider, "elm.indicator", buf); } else edje_object_part_text_set(wd->slider, "elm.indicator", NULL); @@ -377,6 +287,12 @@ static void _drag(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { Widget_Data *wd = elm_widget_data_get((Evas_Object*)data); + /* delete thumb move timer when drag event occured to the moving thumb */ + if(wd->mv_timer) + { + ecore_timer_del(wd->mv_timer); + wd->mv_timer = NULL; + } edje_object_signal_emit(wd->slider, "elm,state,drag", "elm"); edje_object_message_signal_process(wd->slider); _val_fetch(data); @@ -388,29 +304,27 @@ static void _drag_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { Widget_Data *wd = elm_widget_data_get((Evas_Object*)data); + /* delete thumb move timer when drag event occured to the moving thumb */ + if(wd->mv_timer) + { + ecore_timer_del(wd->mv_timer); + wd->mv_timer = NULL; + } + elm_widget_scroll_hold_push(data); _val_fetch(data); evas_object_smart_callback_call(data, SIG_DRAG_START, NULL); edje_object_signal_emit(wd->slider, "elm,state,drag", "elm"); edje_object_message_signal_process(wd->slider); _units_set(data); _indicator_set(data); - elm_widget_scroll_hold_push(data); } static void _drag_stop(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - _val_fetch(data); - evas_object_smart_callback_call(data, SIG_DRAG_STOP, NULL); - _units_set(data); - _indicator_set(data); elm_widget_scroll_hold_pop(data); -} - -static void -_drag_step(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ _val_fetch(data); + evas_object_smart_callback_call(data, SIG_DRAG_STOP, NULL); _units_set(data); _indicator_set(data); } @@ -418,42 +332,28 @@ _drag_step(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSE static void _drag_up(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - double step; - Widget_Data *wd; - - wd = elm_widget_data_get(data); - step = 0.05; - - if (wd->inverted) step *= ELM_SLIDER_INVERTED_FACTOR; - - edje_object_part_drag_step(wd->slider, "elm.dragable.slider", step, step); + Widget_Data *wd = elm_widget_data_get(data); + edje_object_part_drag_step(wd->slider, "elm.dragable.slider", -0.05, -0.05); } static void _drag_down(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - double step; - Widget_Data *wd; - - wd = elm_widget_data_get(data); - step = -0.05; - - if (wd->inverted) step *= ELM_SLIDER_INVERTED_FACTOR; - - edje_object_part_drag_step(wd->slider, "elm.dragable.slider", step, step); + Widget_Data *wd = elm_widget_data_get(data); + edje_object_part_drag_step(wd->slider, "elm.dragable.slider", 0.05, 0.05); } static void -_spacer_cb(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info) +_spacer_cb(void *data, Evas * e, Evas_Object * obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Down *ev = event_info; Evas_Coord x, y, w, h; double button_x, button_y; - + evas_object_geometry_get(wd->spacer, &x, &y, &w, &h); edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", &button_x, &button_y); - if (wd->horizontal) + if(wd->horizontal) { button_x = ((double)ev->output.x - (double)x) / (double)w; if (button_x > 1) button_x = 1; @@ -473,6 +373,8 @@ _spacer_cb(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info) wd->feed_cnt = 0; } +static const char*widtype = NULL; + /** * Add a new slider to the parent * @@ -488,47 +390,45 @@ elm_slider_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; + if (e == NULL) return NULL; + wd = ELM_NEW(Widget_Data); obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "slider"); elm_widget_type_set(obj, "slider"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); wd->horizontal = EINA_TRUE; - wd->indicator_show = EINA_TRUE; wd->feed_cnt = 0; wd->val = 0.0; wd->val_min = 0.0; wd->val_max = 1.0; + wd->mv_step = (double)((wd->val_max - wd->val_min) / (double)SLIDER_THUMB_MOVE_STEP); + wd->slider = edje_object_add(e); _elm_theme_object_set(obj, wd->slider, "slider", "horizontal", "default"); elm_widget_resize_object_set(obj, wd->slider); edje_object_signal_callback_add(wd->slider, "drag", "*", _drag, obj); edje_object_signal_callback_add(wd->slider, "drag,start", "*", _drag_start, obj); edje_object_signal_callback_add(wd->slider, "drag,stop", "*", _drag_stop, obj); - edje_object_signal_callback_add(wd->slider, "drag,step", "*", _drag_step, obj); + edje_object_signal_callback_add(wd->slider, "drag,step", "*", _drag_stop, obj); edje_object_signal_callback_add(wd->slider, "drag,page", "*", _drag_stop, obj); -// edje_object_signal_callback_add(wd->slider, "drag,set", "*", _drag_stop, obj); + //edje_object_signal_callback_add(wd->slider, "drag,set", "*", _drag_stop, obj); + edje_object_signal_callback_add(wd->slider, "mouse,wheel,0,-1", "*", _drag_up, obj); + edje_object_signal_callback_add(wd->slider, "mouse,wheel,0,1", "*", _drag_down, obj); edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", 0.0, 0.0); wd->spacer = evas_object_rectangle_add(e); evas_object_color_set(wd->spacer, 0, 0, 0, 0); - evas_object_pass_events_set(wd->spacer, EINA_TRUE); + evas_object_pass_events_set(wd->spacer, 1); elm_widget_sub_object_add(obj, wd->spacer); edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer); evas_object_event_callback_add(wd->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_cb, obj); + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); _sizing_eval(obj); @@ -556,13 +456,13 @@ elm_slider_label_set(Evas_Object *obj, const char *label) eina_stringshare_replace(&wd->label, label); if (label) { - edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm"); - edje_object_message_signal_process(wd->slider); + edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm"); + edje_object_message_signal_process(wd->slider); } else { - edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm"); - edje_object_message_signal_process(wd->slider); + edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm"); + edje_object_message_signal_process(wd->slider); } edje_object_part_text_set(wd->slider, "elm.text", label); _sizing_eval(obj); @@ -586,18 +486,13 @@ elm_slider_label_get(const Evas_Object *obj) } /** - * Set the icon object (leftmost widget) of the slider object. + * Set the icon object of the slider object * * Once the icon object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_slider_icon_unset() function. * * @param obj The slider object * @param icon The icon object * - * @note If the object being set does not have minimum size hints set, - * it won't get properly displayed. - * * @ingroup Slider */ EAPI void @@ -611,50 +506,17 @@ elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) wd->icon = icon; if (icon) { - elm_widget_sub_object_add(obj, icon); - evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->slider, "elm.swallow.icon", icon); - edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm"); - edje_object_message_signal_process(wd->slider); + elm_widget_sub_object_add(obj, icon); + evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + edje_object_part_swallow(wd->slider, "elm.swallow.content", icon); + edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm"); + edje_object_message_signal_process(wd->slider); } _sizing_eval(obj); } /** - * Unset the leftmost widget of the slider, unparenting and - * returning it. - * - * @param obj The slider object - * @return the previously set icon sub-object of this slider, on - * success. - * - * @see elm_slider_icon_set() - * - * @ingroup Slider - */ -EAPI Evas_Object * -elm_slider_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *ret = NULL; - if (!wd) return NULL; - if (wd->icon) - { - elm_widget_sub_object_del(obj, wd->icon); - ret = wd->icon; - edje_object_part_unswallow(wd->slider, wd->icon); - edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm"); - wd->icon = NULL; - _sizing_eval(obj); - } - return ret; -} - -/** - * Get the icon object of the slider object. This object is owned by - * the scrolled entry and should not be modified. + * Get the icon object of the slider object * * @param obj The slider object * @return The icon object @@ -695,10 +557,6 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1); else evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale); - if (wd->indicator_show) - edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm"); - else - edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm"); edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer); _sizing_eval(obj); } @@ -747,13 +605,13 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units) eina_stringshare_replace(&wd->units, units); if (units) { - edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm"); - edje_object_message_signal_process(wd->slider); + edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm"); + edje_object_message_signal_process(wd->slider); } else { - edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm"); - edje_object_message_signal_process(wd->slider); + edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm"); + edje_object_message_signal_process(wd->slider); } _units_set(obj); _sizing_eval(obj); @@ -883,6 +741,9 @@ elm_slider_min_max_set(Evas_Object *obj, double min, double max) if ((wd->val_min == min) && (wd->val_max == max)) return; wd->val_min = min; wd->val_max = max; + + wd->mv_step = (double)((wd->val_max - wd->val_min) / (double)SLIDER_THUMB_MOVE_STEP); + if (wd->val < wd->val_min) wd->val = wd->val_min; if (wd->val > wd->val_max) wd->val = wd->val_max; _val_set(obj); @@ -915,7 +776,7 @@ elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max) * Set the value the slider indicates * * @param obj The slider object - * @param val The value (must be between min and max for the slider) + * @param val The value (must be beween min and max for the slider) * * @ingroup Slider */ @@ -1022,169 +883,200 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(d _indicator_set(obj); } + +////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////// supporting beat feature /////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////// + + + /** - * Set the end object (rightmost widget) of the slider object. + * Set the end side icon object of the slider object * - * Once the end object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_button_end_unset() function. + * Once the end side icon object is set, it will become a child of the slider object and + * be deleted when the slider object is deleted. If another icon object is set + * then the previous one becomes orophaned and will no longer be deleted along + * with the slider. * * @param obj The slider object - * @param end The end object - * - * @note If the object being set does not have minimum size hints set, - * it won't get properly displayed. - * + * @param icon The icon object + * + * @return 1 if icon set succeed, 0 if there is no part for the end side icon + * * @ingroup Slider */ -EAPI void -elm_slider_end_set(Evas_Object *obj, Evas_Object *end) +EAPI Eina_Bool +elm_slider_end_icon_set(Evas_Object *obj, Evas_Object *icon) { - ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->end == end) return; - if (wd->end) evas_object_del(wd->end); - wd->end = end; - if (end) + + if ((wd->e_icon != icon) && (wd->e_icon)) + elm_widget_sub_object_del(obj, wd->e_icon); + + if (icon) { - elm_widget_sub_object_add(obj, end); - evas_object_event_callback_add(end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - edje_object_part_swallow(wd->slider, "elm.swallow.end", end); - edje_object_signal_emit(wd->slider, "elm,state,end,visible", "elm"); - edje_object_message_signal_process(wd->slider); + if ( !(edje_object_part_swallow(wd->slider, "end_icon", icon)) ) + return EINA_FALSE; + wd->e_icon = icon; + elm_widget_sub_object_add(obj, icon); + evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,_changed_size_hints, obj); + edje_object_signal_emit(wd->slider, "elm,state,eicon,visible", "elm");_sizing_eval(obj); } - _sizing_eval(obj); + + return EINA_TRUE; } + /** - * Unset the rightmost widget of the slider, unparenting and - * returning it. + * Get the end side icon object of the slider object * * @param obj The slider object - * @return the previously set end sub-object of this slider, on - * success. - * - * @see elm_slider_end_set() + * @return The end side icon object * * @ingroup Slider */ EAPI Evas_Object * -elm_slider_end_unset(Evas_Object *obj) +elm_slider_end_icon_get(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *ret = NULL; if (!wd) return NULL; - if (wd->end) - { - elm_widget_sub_object_del(obj, wd->end); - ret = wd->end; - edje_object_part_unswallow(wd->slider, wd->end); - edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm"); - wd->end = NULL; - _sizing_eval(obj); - } - return ret; + return wd->e_icon; } + /** - * Get the end icon object of the slider object. This object is owned - * by the scrolled entry and should not be modified. + * Set whether showing the number(indicator) or not. * * @param obj The slider object - * @return The end icon object + * @param show 1 will show the number, 0 will not. * * @ingroup Slider */ -EAPI Evas_Object * -elm_slider_end_get(const Evas_Object *obj) +EAPI void +elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->end; + if(!wd) return; + if(show) + edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm"); + else + edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm"); } -/** - * Set whether to the slider indicator (augmented knob) at all. - * - * @param obj The slider object - * @param show @c EINA_TRUE will make it show it, @c EINA_FALSE will - * let the knob alwayes at default size. - * - * @note It will conflict with elm_slider_indicator_format_set(), if - * you wanted those effects. - * - * @ingroup Slider - */ -EAPI void -elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show) +static Eina_Bool +_mv_timer_cb(void *data) { - ELM_CHECK_WIDTYPE(obj, widtype); + Evas_Object* obj = (Evas_Object*)data; Widget_Data *wd = elm_widget_data_get(obj); - if (show) { - wd->indicator_show = EINA_TRUE; - edje_object_signal_emit(wd->slider, "elm,state,val,show", "elm"); - } - else { - wd->indicator_show = EINA_FALSE; - edje_object_signal_emit(wd->slider, "elm,state,val,hide", "elm"); - } + + if (!wd) return 1; + + if(wd->src_val < wd->des_val) + { + wd->src_val += wd->mv_step; + if(wd-> src_val > wd->des_val) + wd->src_val = wd->des_val; + } + else if (wd->src_val > wd->des_val) + { + wd->src_val -= wd->mv_step; + if(wd->src_val < wd->des_val) + wd->src_val = wd->des_val; + } + + elm_slider_value_set(obj, wd->src_val); + evas_object_smart_callback_call(obj, SIG_CHANGED , NULL); + + if (wd->val == wd->des_val) + { + if (wd->mv_timer) + { + ecore_timer_del(wd->mv_timer); + wd->mv_timer = NULL; + } + return 0; + } + else + return 1; } + /** - * Get the state of indicator in the slider (if it's being shown or - * not). + * Move the thumb to the specified value. * + * This is different with elm_slider_value_set() in animated moving. + * * @param obj The slider object - * @return @c EINA_TRUE if the indicator is being shown, @c EINA_FALSE - * otherwise. + * @param val thumb's destination value. * - * @ingroup Slider + * @ingroup Slider */ -EAPI Eina_Bool -elm_slider_indicator_show_get(const Evas_Object *obj) +EAPI void +elm_slider_value_animated_set(Evas_Object *obj, double val) { - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->indicator_show; -} + if (wd->val == val) return; -////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////// DEPRECTAED /////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////// + wd->src_val = wd->val; + wd->des_val = val; + if (wd->des_val < wd->val_min) wd->des_val = wd->val_min; + if (wd->des_val > wd->val_max) wd->des_val = wd->val_max; -EAPI Eina_Bool -elm_slider_end_icon_set(Evas_Object *obj, Evas_Object *icon) -{ - elm_slider_end_set(obj, icon); - return EINA_TRUE; -} + if(wd->mv_timer) + { + ecore_timer_del(wd->mv_timer); + wd->mv_timer = NULL; + } -EAPI Evas_Object * -elm_slider_end_icon_get(Evas_Object *obj) -{ - return elm_slider_end_get(obj); + wd->mv_timer = ecore_timer_add(0.005, _mv_timer_cb, obj); } -EAPI void -elm_slider_value_animated_set(Evas_Object *obj, double val) -{ - return ; -} +/** + * Set the end side label of the slider + * + * @param obj The slider object + * @param label The text label string in UTF-8 + * + * @ingroup Slider + */ EAPI void elm_slider_end_label_set(Evas_Object *obj, const char *label) { - return ; + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + eina_stringshare_replace(&wd->e_label, label); + if (label) + { + edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm"); + edje_object_message_signal_process(wd->slider); + } + else + { + edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm"); + edje_object_message_signal_process(wd->slider); + } + edje_object_part_text_set(wd->slider, "elm.units", label); + if(wd->units) + wd->units = NULL; + _sizing_eval(obj); } +/** + * Get the end side label of the slider + * + * @param obj The slider object + * @return The text label string in UTF-8 + * + * @ingroup Slider + */ EAPI const char * elm_slider_end_label_get(const Evas_Object *obj) { - return NULL; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + return wd->e_label; } diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c index 67b6af7..c74ff21 100644 --- a/src/lib/elm_slideshow.c +++ b/src/lib/elm_slideshow.c @@ -20,11 +20,14 @@ typedef struct _Widget_Data Widget_Data; struct _Elm_Slideshow_Item { - Elm_Widget_Item base; + Evas_Object *obj; Eina_List *l, *l_built; + const void *data; const Elm_Slideshow_Item_Class *itc; + + Evas_Object *o; }; struct _Widget_Data @@ -57,45 +60,6 @@ static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static Eina_Bool _timer_cb(void *data); -static void _on_focus_hook(void *data, Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); - -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) - { - elm_slideshow_previous(obj); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) - { - elm_slideshow_next(obj); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - if ((!strcmp(ev->keyname, "Return")) || - (!strcmp(ev->keyname, "KP_Enter")) || - (!strcmp(ev->keyname, "space"))) - { - if (wd->timeout) - elm_slideshow_timeout_set(obj, 0); - else - elm_slideshow_timeout_set(obj, 3); - - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - return EINA_FALSE; -} static void _del_hook(Evas_Object *obj) @@ -112,23 +76,6 @@ _del_hook(Evas_Object *obj) } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->slideshow, "elm,action,focus", "elm"); - evas_object_focus_set(wd->slideshow, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->slideshow, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->slideshow, EINA_FALSE); - } -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -153,17 +100,17 @@ _sizing_eval(Evas_Object *obj) static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item) { - Widget_Data *wd = elm_widget_data_get(item->base.widget); + Widget_Data *wd = elm_widget_data_get(item->obj); Elm_Slideshow_Item* prev = eina_list_data_get(eina_list_prev(item->l)); - if((!prev) && (wd->loop)) + if(!prev && wd->loop) prev = eina_list_data_get(eina_list_last(item->l)); return prev; } static Elm_Slideshow_Item* _item_next_get(Elm_Slideshow_Item* item) { - Widget_Data *wd = elm_widget_data_get(item->base.widget); + Widget_Data *wd = elm_widget_data_get(item->obj); Elm_Slideshow_Item* next = eina_list_data_get(eina_list_next(item->l)); - if((!next) && (wd->loop)) + if(!next && wd->loop) next = eina_list_data_get(wd->items); return next; } @@ -185,42 +132,42 @@ static void _item_realize(Elm_Slideshow_Item *item) { Elm_Slideshow_Item *_item; - Evas_Object *obj = item->base.widget; + Evas_Object *obj = item->obj; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if ((!item->base.view) && (item->itc->func.get)) + if ((!item->o) && (item->itc->func.get)) { - item->base.view = item->itc->func.get((void*)item->base.data, obj); - evas_object_smart_member_add(item->base.view, obj); + item->o = item->itc->func.get((void*)item->data, obj); + evas_object_smart_member_add(item->o, obj); item->l_built = eina_list_append(NULL, item); wd->items_built = eina_list_merge(wd->items_built, item->l_built); - evas_object_hide(item->base.view); + evas_object_hide(item->o); } else if (item->l_built) wd->items_built = eina_list_demote_list(wd->items_built, item->l_built); //pre-create previous and next item _item = _item_next_get(item); - if ((_item) && (!_item->base.view) && (_item->itc->func.get)) + if ((_item) && (!_item->o) && (_item->itc->func.get)) { - _item->base.view = _item->itc->func.get((void*)_item->base.data, obj); - evas_object_smart_member_add(_item->base.view, obj); + _item->o = _item->itc->func.get((void*)_item->data, obj); + evas_object_smart_member_add(_item->o, obj); _item->l_built = eina_list_append(NULL, _item); wd->items_built = eina_list_merge(wd->items_built, _item->l_built); - evas_object_hide(_item->base.view); + evas_object_hide(_item->o); } else if ((_item) && (_item->l_built)) wd->items_built = eina_list_demote_list(wd->items_built, _item->l_built); _item = _item_prev_get(item); - if ((_item) && (!_item->base.view) && (_item->itc->func.get)) + if ((_item) && (!_item->o) && (_item->itc->func.get)) { - _item->base.view = _item->itc->func.get((void*)_item->base.data, obj); - evas_object_smart_member_add(_item->base.view, obj); + _item->o = _item->itc->func.get((void*)_item->data, obj); + evas_object_smart_member_add(_item->o, obj); _item->l_built = eina_list_append(NULL, _item); wd->items_built = eina_list_merge(wd->items_built, _item->l_built); - evas_object_hide(_item->base.view); + evas_object_hide(_item->o); } else if ((_item) && (_item->l_built)) wd->items_built = eina_list_demote_list(wd->items_built, _item->l_built); @@ -231,9 +178,9 @@ _item_realize(Elm_Slideshow_Item *item) _item = eina_list_data_get(wd->items_built); wd->items_built = eina_list_remove_list(wd->items_built, wd->items_built); if(item->itc->func.del) - item->itc->func.del((void*)item->base.data, _item->base.view); - evas_object_del(_item->base.view); - _item->base.view = NULL; + item->itc->func.del((void*)item->data, _item->o); + evas_object_del(_item->o); + _item->o = NULL; } } @@ -247,21 +194,21 @@ _end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, c item = wd->previous; if(item) { - edje_object_part_unswallow(NULL, item->base.view); - evas_object_hide(item->base.view); + edje_object_part_unswallow(NULL, item->o); + evas_object_hide(item->o); wd->previous = NULL; } item = wd->current; - if ((!item) || (!item->base.view)) return; + if (!item || !item->o) return; _item_realize(item); - edje_object_part_unswallow(NULL, item->base.view); - evas_object_show(item->base.view); + edje_object_part_unswallow(NULL, item->o); + evas_object_show(item->o); edje_object_signal_emit(wd->slideshow, "anim,end", "slideshow"); - edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->base.view); + edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->o); } @@ -293,21 +240,15 @@ elm_slideshow_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "slideshow"); elm_widget_type_set(obj, "slideshow"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); wd->current = NULL; wd->previous = NULL; @@ -353,9 +294,10 @@ elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, co Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - item = elm_widget_item_new(obj, Elm_Slideshow_Item); - item->base.data = data; + item = calloc(1, sizeof(Elm_Slideshow_Item)); + item->data = data; item->itc = itc; + item->obj = obj; item->l = eina_list_append(item->l, item); wd->items = eina_list_merge(wd->items, item->l); @@ -379,22 +321,24 @@ elm_slideshow_show(Elm_Slideshow_Item *item) char buf[1024]; Elm_Slideshow_Item *next = NULL; Widget_Data *wd; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - wd = elm_widget_data_get(item->base.widget); + if (!item) + return; + ELM_CHECK_WIDTYPE(item->obj, widtype); + wd = elm_widget_data_get(item->obj); if (!wd) return; if (item == wd->current) return; next = item; - _end(item->base.widget, item->base.widget, NULL, NULL); + _end(item->obj, item->obj, NULL, NULL); if (wd->timer) ecore_timer_del(wd->timer); if (wd->timeout > 0) - wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->base.widget); + wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->obj); _item_realize(next); - edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view); - evas_object_show(next->base.view); + edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->o); + evas_object_show(next->o); snprintf(buf, sizeof(buf), "%s,next", wd->transition); edje_object_signal_emit(wd->slideshow, buf, "slideshow"); wd->previous = wd->current; @@ -422,7 +366,7 @@ elm_slideshow_next(Evas_Object *obj) if (wd->current) next = _item_next_get(wd->current); - if ((!next) || (next == wd->current)) return; + if (!next || next == wd->current) return; _end(obj, obj, NULL, NULL); @@ -433,8 +377,8 @@ elm_slideshow_next(Evas_Object *obj) _item_realize(next); - edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view); - evas_object_show(next->base.view); + edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->o); + evas_object_show(next->o); snprintf(buf, sizeof(buf), "%s,next", wd->transition); edje_object_signal_emit(wd->slideshow, buf, "slideshow"); @@ -463,7 +407,7 @@ elm_slideshow_previous(Evas_Object *obj) if (wd->current) prev = _item_prev_get(wd->current); - if ((!prev) || (prev == wd->current)) return; + if (!prev || prev == wd->current) return; _end(obj, obj, NULL, NULL); @@ -473,8 +417,8 @@ elm_slideshow_previous(Evas_Object *obj) _item_realize(prev); - edje_object_part_swallow(wd->slideshow, "elm.swallow.2", prev->base.view); - evas_object_show(prev->base.view); + edje_object_part_swallow(wd->slideshow, "elm.swallow.2", prev->o); + evas_object_show(prev->o); snprintf(buf, 1024, "%s,previous", wd->transition); edje_object_signal_emit(wd->slideshow, buf, "slideshow"); @@ -491,7 +435,7 @@ elm_slideshow_previous(Evas_Object *obj) * * @ingroup Slideshow */ -EAPI const Eina_List * +const Eina_List * elm_slideshow_transitions_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -508,7 +452,7 @@ elm_slideshow_transitions_get(const Evas_Object *obj) * * @ingroup Slideshow */ -EAPI const Eina_List * +const Eina_List * elm_slideshow_layouts_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -680,16 +624,15 @@ elm_slideshow_clear(Evas_Object *obj) wd->current = NULL; EINA_LIST_FREE(wd->items_built, item) { - if (item->itc->func.del) - item->itc->func.del((void*)item->base.data, item->base.view); - evas_object_del(item->base.view); - item->base.view = NULL; + if (item->itc->func.del) + item->itc->func.del((void*)item->data, item->o); + evas_object_del(item->o); } EINA_LIST_FREE(wd->items, item) - { - elm_widget_item_del(item); - } + { + free(item); + } } @@ -703,8 +646,8 @@ elm_slideshow_clear(Evas_Object *obj) EAPI void elm_slideshow_item_del(Elm_Slideshow_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - Widget_Data *wd = elm_widget_data_get(item->base.widget); + if (!item) return; + Widget_Data *wd = elm_widget_data_get(item->obj); if (!wd) return; if (wd->previous == item) wd->previous = NULL; if (wd->current == item) @@ -721,10 +664,10 @@ elm_slideshow_item_del(Elm_Slideshow_Item *item) wd->items = eina_list_remove_list(wd->items, item->l); wd->items_built = eina_list_remove_list(wd->items_built, item->l_built); - if ((item->base.view) && (item->itc->func.del)) - item->itc->func.del((void*)item->base.data, item->base.view); - if (item->base.view) - evas_object_del(item->base.view); + if (item->o && item->itc->func.del) + item->itc->func.del((void*)item->data, wd->previous->o); + if (item->o) + evas_object_del(item->o); free(item); } @@ -771,10 +714,10 @@ elm_slideshow_item_current_get(const Evas_Object *obj) * @ingroup Slideshow */ EAPI Evas_Object * -elm_slideshow_item_object_get(const Elm_Slideshow_Item * item) +elm_slideshow_item_object_get(Elm_Slideshow_Item * item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->base.view; + if (!item) return NULL; + return item->o; } /** @@ -786,8 +729,8 @@ elm_slideshow_item_object_get(const Elm_Slideshow_Item * item) * @ingroup Slideshow */ EAPI void * -elm_slideshow_item_data_get(const Elm_Slideshow_Item * item) +elm_slideshow_item_data_get(Elm_Slideshow_Item * item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_data_get(item); + if (!item) return NULL; + return (void *)item->data; } diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index e11cddf..f1a2c7a 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -40,10 +40,9 @@ struct _Widget_Data Eina_Bool editable : 1; }; -struct _Elm_Spinner_Special_Value -{ - double value; - const char *label; +struct _Elm_Spinner_Special_Value { + double value; + const char *label; }; static const char *widtype = NULL; @@ -53,9 +52,6 @@ static void _write_label(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); //static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static Eina_Bool _value_set(Evas_Object *obj, double delta); -static void _on_focus_hook(void *data, Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); static void _del_hook(Evas_Object *obj) @@ -67,13 +63,11 @@ _del_hook(Evas_Object *obj) if (wd->delay) ecore_timer_del(wd->delay); if (wd->spin) ecore_timer_del(wd->spin); if (wd->special_values) - { - EINA_LIST_FREE(wd->special_values, sv) - { - eina_stringshare_del(sv->label); - free(sv); - } - } + EINA_LIST_FREE(wd->special_values, sv) + { + eina_stringshare_del(sv->label); + free(sv); + } free(wd); } @@ -83,9 +77,9 @@ _disable_hook(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (elm_widget_disabled_get(obj)) - edje_object_signal_emit(wd->spinner, "elm,state,disabled", "elm"); + edje_object_signal_emit(wd->spinner, "elm,state,disabled", "elm"); else - edje_object_signal_emit(wd->spinner, "elm,state,enabled", "elm"); + edje_object_signal_emit(wd->spinner, "elm,state,enabled", "elm"); } static void @@ -102,15 +96,16 @@ _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *so Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; edje_object_signal_callback_add(wd->spinner, emission, - source, func_cb, data); + source, func_cb, data); } -static void -_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data) +static void * +_signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source)) { Widget_Data *wd = elm_widget_data_get(obj); - edje_object_signal_callback_del_full(wd->spinner, emission, source, - func_cb, data); + if (!wd) return NULL; + return edje_object_signal_callback_del(wd->spinner, emission, source, + func_cb); } static void @@ -121,14 +116,12 @@ _theme_hook(Evas_Object *obj) _elm_theme_object_set(obj, wd->spinner, "spinner", "base", elm_widget_style_get(obj)); edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent); _write_label(obj); - if (elm_widget_focus_get(obj)) - edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm"); - else - edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm"); - if (elm_widget_disabled_get(obj)) - edje_object_signal_emit(wd->spinner, "elm,state,disabled", "elm"); edje_object_message_signal_process(wd->spinner); edje_object_scale_set(wd->spinner, elm_widget_scale_get(obj) * _elm_config->scale); + if (elm_widget_focus_get(obj)) + edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm"); + else + edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm"); _sizing_eval(obj); } @@ -138,15 +131,9 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm"); - evas_object_focus_set(wd->spinner, EINA_TRUE); - } + edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm"); else - { - edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->spinner, EINA_FALSE); - } + edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm"); } static Eina_Bool @@ -212,13 +199,11 @@ _write_label(Evas_Object *obj) char buf[1024]; if (!wd) return; EINA_LIST_FOREACH(wd->special_values, l, sv) - { - if (sv->value == wd->val) - { - snprintf(buf, sizeof(buf), "%s", sv->label); - goto apply; - } - } + if (sv->value == wd->val) + { + snprintf(buf, sizeof(buf), "%s", sv->label); + goto apply; + } if (wd->label) snprintf(buf, sizeof(buf), wd->label, wd->val); else @@ -501,48 +486,27 @@ _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNU wd->delay = ecore_timer_add(0.2, _delay_change, data); } -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) +static void +_entry_event_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (type == EVAS_CALLBACK_KEY_DOWN) - { - Evas_Event_Key_Down *ev = event_info; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left") - || !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) - { - _val_dec_start(obj); - edje_object_signal_emit(wd->spinner, "elm,left,anim,activate", "elm"); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right") - || !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) - { - _val_inc_start(obj); - edje_object_signal_emit(wd->spinner, "elm,right,anim,activate", "elm"); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - } - else if (type == EVAS_CALLBACK_KEY_UP) - { - Evas_Event_Key_Down *ev = event_info; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right") - || !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) - _val_inc_stop(obj); - else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left") - || !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) - _val_dec_stop(obj); - else return EINA_FALSE; - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; - } - return EINA_FALSE; + Evas_Event_Key_Down *ev = event_info; + Widget_Data *wd = elm_widget_data_get(data); + if (!wd) return; + if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; + if (!strcmp(ev->keyname, "Up")) _val_inc_start(data); + else if (!strcmp(ev->keyname, "Down")) _val_dec_start(data); +} + +static void +_entry_event_key_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + Evas_Event_Key_Down *ev = event_info; + Widget_Data *wd = elm_widget_data_get(data); + if (!wd) return; + if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; + if (!strcmp(ev->keyname, "Up")) _val_inc_stop(data); + else if (!strcmp(ev->keyname, "Down")) _val_dec_stop(data); + else if (!strcmp(ev->keyname, "Escape")) _reset_value(data); } /** @@ -560,16 +524,12 @@ elm_spinner_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "spinner"); elm_widget_type_set(obj, "spinner"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); @@ -578,8 +538,6 @@ elm_spinner_add(Evas_Object *parent) elm_widget_signal_emit_hook_set(obj, _signal_emit_hook); elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook); elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); wd->val = 0.0; wd->val_min = 0.0; @@ -614,6 +572,11 @@ elm_spinner_add(Evas_Object *parent) edje_object_part_drag_value_set(wd->spinner, "elm.dragable.slider", 0.0, 0.0); + evas_object_event_callback_add(wd->spinner, EVAS_CALLBACK_KEY_DOWN, + _entry_event_key_down, obj); + evas_object_event_callback_add(wd->spinner, EVAS_CALLBACK_KEY_UP, + _entry_event_key_up, obj); + wd->ent = elm_entry_add(obj); elm_entry_single_line_set(wd->ent, 1); evas_object_smart_callback_add(wd->ent, "activated", _entry_activated, obj); @@ -751,7 +714,7 @@ elm_spinner_step_get(const Evas_Object *obj) * Set the value the spinner indicates * * @param obj The spinner object - * @param val The value (must be between min and max for the spinner) + * @param val The value (must be beween min and max for the spinner) * * @ingroup Spinner */ diff --git a/src/lib/elm_store.c b/src/lib/elm_store.c deleted file mode 100644 index dba552b..0000000 --- a/src/lib/elm_store.c +++ /dev/null @@ -1,754 +0,0 @@ -#include -#include -#include "elm_priv.h" - -#ifndef EFL_HAVE_THREADS -# error "No thread support. Required." -#endif - -#ifdef EFL_HAVE_POSIX_THREADS -# include -# define LK(x) pthread_mutex_t x -# define LKI(x) pthread_mutex_init(&(x), NULL); -# define LKD(x) pthread_mutex_destroy(&(x)); -# define LKL(x) pthread_mutex_lock(&(x)); -# define LKU(x) pthread_mutex_unlock(&(x)); -#else /* EFL_HAVE_WIN32_THREADS */ -# define WIN32_LEAN_AND_MEAN -# include -# undef WIN32_LEAN_AND_MEAN -# define LK(x) HANDLE x -# define LKI(x) x = CreateMutex(NULL, FALSE, NULL) -# define LKD(x) CloseHandle(x) -# define LKL(x) WaitForSingleObject(x, INFINITE) -# define LKU(x) ReleaseMutex(x) -#endif - -#define ELM_STORE_MAGIC 0x3f89ea56 -#define ELM_STORE_FILESYSTEM_MAGIC 0x3f89ea57 -#define ELM_STORE_ITEM_MAGIC 0x5afe8c1d - -struct _Elm_Store -{ - EINA_MAGIC; - void (*free)(Elm_Store *store); - struct { - void (*free)(Elm_Store_Item *item); - } item; - Evas_Object *genlist; - Ecore_Thread *list_th; - Eina_Inlist *items; - Eina_List *realized; - int realized_count; - int cache_max; - struct { - struct { - Elm_Store_Item_List_Cb func; - void *data; - } list; - struct { - Elm_Store_Item_Fetch_Cb func; - void *data; - } fetch; - struct { - Elm_Store_Item_Unfetch_Cb func; - void *data; - } unfetch; - } cb; - Eina_Bool sorted : 1; - Eina_Bool fetch_thread : 1; -}; - -struct _Elm_Store_Item -{ - EINA_INLIST; - EINA_MAGIC; - Elm_Store *store; - Elm_Genlist_Item *item; - Ecore_Thread *fetch_th; - Ecore_Job *eval_job; - const Elm_Store_Item_Mapping *mapping; - void *data; - LK(lock); - Eina_Bool live : 1; - Eina_Bool was_live : 1; - Eina_Bool realized : 1; - Eina_Bool fetched : 1; -}; - -struct _Elm_Store_Filesystem -{ - Elm_Store base; - EINA_MAGIC; - const char *dir; -}; - -struct _Elm_Store_Item_Filesystem -{ - Elm_Store_Item base; - const char *path; -}; - -static Elm_Genlist_Item_Class _store_item_class; - -static void -_store_cache_trim(Elm_Store *st) -{ - while ((st->realized ) && - (((int)eina_list_count(st->realized) - st->realized_count) - > st->cache_max)) - { - Elm_Store_Item *sti = st->realized->data; - if (sti->realized) - { - st->realized = eina_list_remove_list(st->realized, st->realized); - sti->realized = EINA_FALSE; - } - LKL(sti->lock); - if (!sti->fetched) - { - LKU(sti->lock); - if (sti->fetch_th) - { - ecore_thread_cancel(sti->fetch_th); - sti->fetch_th = NULL; - } - LKL(sti->lock); - } - sti->fetched = EINA_FALSE; - LKU(sti->lock); - if (st->cb.unfetch.func) - st->cb.unfetch.func(st->cb.unfetch.data, sti); - LKL(sti->lock); - sti->data = NULL; - LKU(sti->lock); - } -} - -static void -_store_genlist_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Elm_Store *st = data; - st->genlist = NULL; - if (st->list_th) - { - ecore_thread_cancel(st->list_th); - st->list_th = NULL; - } - eina_list_free(st->realized); - while (st->items) - { - Elm_Store_Item *sti = (Elm_Store_Item *)st->items; - if (sti->eval_job) ecore_job_del(sti->eval_job); - if (sti->fetch_th) - { - ecore_thread_cancel(sti->fetch_th); - sti->fetch_th = NULL; - } - if (sti->store->item.free) sti->store->item.free(sti); - if (sti->data) - { - if (st->cb.unfetch.func) - st->cb.unfetch.func(st->cb.unfetch.data, sti); - sti->data = NULL; - } - LKD(sti->lock); - free(sti); - } - // FIXME: kill threads and more -} - -////// **** WARNING *********************************************************** -//// * This function runs inside a thread outside efl mainloop. Be careful! * -// ************************************************************************ -/* TODO: refactor lock part into core? this does not depend on filesystm part */ -static void -_store_filesystem_fetch_do(void *data, Ecore_Thread *th __UNUSED__) -{ - Elm_Store_Item *sti = data; - LKL(sti->lock); - if (sti->data) - { - LKU(sti->lock); - return; - } - if (!sti->fetched) - { - LKU(sti->lock); - if (sti->store->cb.fetch.func) - sti->store->cb.fetch.func(sti->store->cb.fetch.data, sti); - LKL(sti->lock); - sti->fetched = EINA_TRUE; - } - LKU(sti->lock); -} -// ************************************************************************ -//// * End of separate thread function. * -////// ************************************************************************ -/* TODO: refactor lock part into core? this does not depend on filesystm part */ -static void -_store_filesystem_fetch_end(void *data, Ecore_Thread *th) -{ - Elm_Store_Item *sti = data; - LKL(sti->lock); - if (sti->data) elm_genlist_item_update(sti->item); - LKU(sti->lock); - if (th == sti->fetch_th) sti->fetch_th = NULL; -} - -/* TODO: refactor lock part into core? this does not depend on filesystm part */ -static void -_store_filesystem_fetch_cancel(void *data, Ecore_Thread *th) -{ - Elm_Store_Item *sti = data; - LKL(sti->lock); - if (th == sti->fetch_th) sti->fetch_th = NULL; - if (sti->data) elm_genlist_item_update(sti->item); - LKU(sti->lock); -} - -static void -_store_item_eval(void *data) -{ - Elm_Store_Item *sti = data; - sti->eval_job = NULL; - if (sti->live == sti->was_live) return; - sti->was_live = sti->live; - if (sti->live) - { - _store_cache_trim(sti->store); - if (sti->realized) - sti->store->realized = eina_list_remove(sti->store->realized, sti); - sti->store->realized = eina_list_append(sti->store->realized, sti); - sti->realized = EINA_TRUE; - if ((sti->store->fetch_thread) && (!sti->fetch_th)) - sti->fetch_th = ecore_thread_run(_store_filesystem_fetch_do, - _store_filesystem_fetch_end, - _store_filesystem_fetch_cancel, - sti); - else if ((!sti->store->fetch_thread)) - { - _store_filesystem_fetch_do(sti, NULL); - _store_filesystem_fetch_end(sti, NULL); - } - } - else - { - if (sti->fetch_th) - { - ecore_thread_cancel(sti->fetch_th); - sti->fetch_th = NULL; - } - _store_cache_trim(sti->store); - } -} - -static void -_store_genlist_item_realized(void *data, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Store *st = data; - Elm_Genlist_Item *gli = event_info; - Elm_Store_Item *sti = elm_genlist_item_data_get(gli); - if (!sti) return; - st->realized_count++; - sti->live = EINA_TRUE; - if (sti->eval_job) ecore_job_del(sti->eval_job); - sti->eval_job = ecore_job_add(_store_item_eval, sti); -} - -static void -_store_genlist_item_unrealized(void *data, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Store *st = data; - Elm_Genlist_Item *gli = event_info; - Elm_Store_Item *sti = elm_genlist_item_data_get(gli); - if (!sti) return; - st->realized_count--; - sti->live = EINA_FALSE; - if (sti->eval_job) ecore_job_del(sti->eval_job); - sti->eval_job = ecore_job_add(_store_item_eval, sti); -} - -static const Elm_Store_Item_Mapping * -_store_item_mapping_find(Elm_Store_Item *sti, const char *part) -{ - const Elm_Store_Item_Mapping *m; - - for (m = sti->mapping; m; m ++) - { - if (m->type == ELM_STORE_ITEM_MAPPING_NONE) break; - if (!strcmp(part, m->part)) return m; - } - return NULL; -} - -static char * -_store_item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part) -{ - Elm_Store_Item *sti = data; - const char *s = ""; - LKL(sti->lock); - if (sti->data) - { - const Elm_Store_Item_Mapping *m = _store_item_mapping_find(sti, part); - if (m) - { - switch (m->type) - { - case ELM_STORE_ITEM_MAPPING_LABEL: - s = *(char **)(((unsigned char *)sti->data) + m->offset); - break; - case ELM_STORE_ITEM_MAPPING_CUSTOM: - if (m->details.custom.func) - s = m->details.custom.func(sti->data, sti, part); - break; - default: - break; - } - } - } - LKU(sti->lock); - return strdup(s); -} - -static Evas_Object * -_store_item_icon_get(void *data, Evas_Object *obj, const char *part) -{ - Elm_Store_Item *sti = data; - LKL(sti->lock); - if (sti->data) - { - const Elm_Store_Item_Mapping *m = _store_item_mapping_find(sti, part); - if (m) - { - Evas_Object *ic = NULL; - const char *s = NULL; - - switch (m->type) - { - case ELM_STORE_ITEM_MAPPING_ICON: - ic = elm_icon_add(obj); - s = *(char **)(((unsigned char *)sti->data) + m->offset); - elm_icon_order_lookup_set(ic, m->details.icon.lookup_order); - evas_object_size_hint_aspect_set(ic, - EVAS_ASPECT_CONTROL_VERTICAL, - m->details.icon.w, - m->details.icon.h); - elm_icon_smooth_set(ic, m->details.icon.smooth); - elm_icon_no_scale_set(ic, m->details.icon.no_scale); - elm_icon_scale_set(ic, - m->details.icon.scale_up, - m->details.icon.scale_down); - if (s) - { - if (m->details.icon.standard_name) - elm_icon_standard_set(ic, s); - else - elm_icon_file_set(ic, s, NULL); - } - break; - case ELM_STORE_ITEM_MAPPING_PHOTO: - ic = elm_icon_add(obj); - s = *(char **)(((unsigned char *)sti->data) + m->offset); - elm_photo_size_set(ic, m->details.photo.size); - if (s) - elm_photo_file_set(ic, s); - break; - case ELM_STORE_ITEM_MAPPING_CUSTOM: - if (m->details.custom.func) - ic = m->details.custom.func(sti->data, sti, part); - break; - default: - break; - } - LKU(sti->lock); - return ic; - } - } - LKU(sti->lock); - return NULL; -} - -static void -_store_item_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__) -{ -} - -////// **** WARNING *********************************************************** -//// * This function runs inside a thread outside efl mainloop. Be careful! * -// ************************************************************************ -static int -_store_filesystem_sort_cb(void *d1, void *d2) -{ - Elm_Store_Item_Info *info1 = d1, *info2 = d2; - if ((!info1->sort_id) || (!info2->sort_id)) return 0; - return strcoll(info1->sort_id, info2->sort_id); -} - -static void -_store_filesystem_list_do(void *data, Ecore_Thread *th __UNUSED__) -{ - Elm_Store_Filesystem *st = data; - Eina_Iterator *it; - const Eina_File_Direct_Info *finf; - Eina_List *sorted = NULL; - Elm_Store_Item_Info_Filesystem *info; - - // FIXME: need a way to abstract the open, list, feed items from list - // and maybe get initial sortable key vals etc. - it = eina_file_stat_ls(st->dir); - if (!it) return; - EINA_ITERATOR_FOREACH(it, finf) - { - Eina_Bool ok; - size_t pathsz = finf->path_length + 1; - - info = calloc(1, sizeof(Elm_Store_Item_Info_Filesystem) + pathsz); - if (!info) continue; - info->path = ((char *)info) + sizeof(Elm_Store_Item_Info_Filesystem); - memcpy(info->path, finf->path, pathsz); - ok = EINA_TRUE; - if (st->base.cb.list.func) - ok = st->base.cb.list.func(st->base.cb.list.data, &info->base); - if (ok) - { - if (!st->base.sorted) ecore_thread_feedback(th, info); - else sorted = eina_list_append(sorted, info); - } - else - { - if (info->base.sort_id) free(info->base.sort_id); - free(info); - } - if (ecore_thread_check(th)) break; - } - eina_iterator_free(it); - if (sorted) - { - sorted = eina_list_sort(sorted, 0, - EINA_COMPARE_CB(_store_filesystem_sort_cb)); - EINA_LIST_FREE(sorted, info) - { - if (!ecore_thread_check(th)) ecore_thread_feedback(th, info); - } - } -} -// ************************************************************************ -//// * End of separate thread function. * -////// ************************************************************************ - -static void -_store_filesystem_list_end(void *data, Ecore_Thread *th) -{ - Elm_Store *st = data; - if (th == st->list_th) st->list_th = NULL; -} - -static void -_store_filesystem_list_cancel(void *data, Ecore_Thread *th) -{ - Elm_Store *st = data; - if (th == st->list_th) st->list_th = NULL; -} - -static void -_store_filesystem_list_update(void *data, Ecore_Thread *th __UNUSED__, void *msg) -{ - Elm_Store *st = data; - Elm_Store_Item_Filesystem *sti; - Elm_Genlist_Item_Class *itc; - Elm_Store_Item_Info_Filesystem *info = msg; - - sti = calloc(1, sizeof(Elm_Store_Item_Filesystem)); - if (!sti) goto done; - LKI(sti->base.lock); - EINA_MAGIC_SET(&(sti->base), ELM_STORE_ITEM_MAGIC); - sti->base.store = st; - sti->base.data = info->base.data; - sti->base.mapping = info->base.mapping; - sti->path = eina_stringshare_add(info->path); - - itc = info->base.item_class; - if (!itc) itc = &_store_item_class; - else - { - itc->func.label_get = _store_item_label_get; - itc->func.icon_get = _store_item_icon_get; - itc->func.state_get = NULL; // FIXME: support state gets later - itc->func.del = _store_item_del; - } - - // FIXME: handle being a parent (tree) - sti->base.item = elm_genlist_item_append(st->genlist, itc, - sti/* item data */, - NULL/* parent */, - ELM_GENLIST_ITEM_NONE, - NULL/* func */, - NULL/* func data */); - st->items = eina_inlist_append(st->items, (Eina_Inlist *)sti); -done: - if (info->base.sort_id) free(info->base.sort_id); - free(info); -} - -// public api calls -static Elm_Store * -_elm_store_new(size_t size) -{ - Elm_Store *st = calloc(1, size); - EINA_SAFETY_ON_NULL_RETURN_VAL(st, NULL); - - // TODO: BEGIN - move to elm_store_init() - eina_magic_string_set(ELM_STORE_MAGIC, "Elm_Store"); - eina_magic_string_set(ELM_STORE_FILESYSTEM_MAGIC, "Elm_Store_Filesystem"); - eina_magic_string_set(ELM_STORE_ITEM_MAGIC, "Elm_Store_Item"); - // setup default item class (always the same) if list cb doesnt provide one - _store_item_class.item_style = "default"; - _store_item_class.func.label_get = _store_item_label_get; - _store_item_class.func.icon_get = _store_item_icon_get; - _store_item_class.func.state_get = NULL; // FIXME: support state gets later - _store_item_class.func.del = _store_item_del; - // TODO: END - move to elm_store_init() - - EINA_MAGIC_SET(st, ELM_STORE_MAGIC); - st->cache_max = 128; - st->fetch_thread = EINA_TRUE; - return st; -} -#define elm_store_new(type) (type*)_elm_store_new(sizeof(type)) - -static void -_elm_store_filesystem_free(Elm_Store *store) -{ - Elm_Store_Filesystem *st = (Elm_Store_Filesystem *)store; - eina_stringshare_del(st->dir); -} - -static void -_elm_store_filesystem_item_free(Elm_Store_Item *item) -{ - Elm_Store_Item_Filesystem *sti = (Elm_Store_Item_Filesystem *)item; - eina_stringshare_del(sti->path); -} - -EAPI Elm_Store * -elm_store_filesystem_new(void) -{ - Elm_Store_Filesystem *st = elm_store_new(Elm_Store_Filesystem); - EINA_SAFETY_ON_NULL_RETURN_VAL(st, NULL); - - EINA_MAGIC_SET(st, ELM_STORE_FILESYSTEM_MAGIC); - st->base.free = _elm_store_filesystem_free; - st->base.item.free = _elm_store_filesystem_item_free; - - return &st->base; -} - -EAPI void -elm_store_free(Elm_Store *st) -{ - void (*item_free)(Elm_Store_Item *); - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - if (st->list_th) - { - ecore_thread_cancel(st->list_th); - st->list_th = NULL; - } - eina_list_free(st->realized); - item_free = st->item.free; - while (st->items) - { - Elm_Store_Item *sti = (Elm_Store_Item *)st->items; - if (sti->eval_job) ecore_job_del(sti->eval_job); - if (sti->fetch_th) - { - ecore_thread_cancel(sti->fetch_th); - sti->fetch_th = NULL; - } - if (item_free) item_free(sti); - if (sti->data) - { - if (st->cb.unfetch.func) - st->cb.unfetch.func(st->cb.unfetch.data, sti); - sti->data = NULL; - } - LKD(sti->lock); - free(sti); - } - if (st->genlist) - { - evas_object_event_callback_del_full(st->genlist, EVAS_CALLBACK_DEL, _store_genlist_del, st); - evas_object_smart_callback_del(st->genlist, "realized", _store_genlist_item_realized); - evas_object_smart_callback_del(st->genlist, "unrealized", _store_genlist_item_unrealized); - elm_genlist_clear(st->genlist); - st->genlist = NULL; - } - if (st->free) st->free(st); - free(st); -} - -EAPI void -elm_store_target_genlist_set(Elm_Store *st, Evas_Object *obj) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - if (st->genlist == obj) return; - if (st->genlist) - { - evas_object_event_callback_del_full(st->genlist, EVAS_CALLBACK_DEL, _store_genlist_del, st); - evas_object_smart_callback_del(st->genlist, "realized", _store_genlist_item_realized); - evas_object_smart_callback_del(st->genlist, "unrealized", _store_genlist_item_unrealized); - elm_genlist_clear(st->genlist); - } - st->genlist = obj; - if (!st->genlist) return; - evas_object_smart_callback_add(st->genlist, "realized", _store_genlist_item_realized, st); - evas_object_smart_callback_add(st->genlist, "unrealized", _store_genlist_item_unrealized, st); - evas_object_event_callback_add(st->genlist, EVAS_CALLBACK_DEL, _store_genlist_del, st); - elm_genlist_clear(st->genlist); -} - -EAPI void -elm_store_filesystem_directory_set(Elm_Store *store, const char *dir) -{ - Elm_Store_Filesystem *st = (Elm_Store_Filesystem *)store; - if (!EINA_MAGIC_CHECK(store, ELM_STORE_MAGIC)) return; - if (!EINA_MAGIC_CHECK(st, ELM_STORE_FILESYSTEM_MAGIC)) return; - if (store->list_th) - { - ecore_thread_cancel(store->list_th); - store->list_th = NULL; - } - if (!eina_stringshare_replace(&st->dir, dir)) return; - store->list_th = ecore_thread_feedback_run(_store_filesystem_list_do, - _store_filesystem_list_update, - _store_filesystem_list_end, - _store_filesystem_list_cancel, - st, EINA_TRUE); -} - -EAPI const char * -elm_store_filesystem_directory_get(const Elm_Store *store) -{ - const Elm_Store_Filesystem *st = (const Elm_Store_Filesystem *)store; - if (!EINA_MAGIC_CHECK(store, ELM_STORE_MAGIC)) return NULL; - if (!EINA_MAGIC_CHECK(st, ELM_STORE_FILESYSTEM_MAGIC)) return NULL; - return st->dir; -} - -EAPI void -elm_store_cache_set(Elm_Store *st, int max) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - if (max < 0) max = 0; - st->cache_max = max; - _store_cache_trim(st); -} - -EAPI int -elm_store_cache_get(const Elm_Store *st) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return 0; - return st->cache_max; -} - -EAPI void -elm_store_list_func_set(Elm_Store *st, Elm_Store_Item_List_Cb func, const void *data) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - st->cb.list.func = func; - st->cb.list.data = (void *)data; -} - -EAPI void -elm_store_fetch_func_set(Elm_Store *st, Elm_Store_Item_Fetch_Cb func, const void *data) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - st->cb.fetch.func = func; - st->cb.fetch.data = (void *)data; -} - -EAPI void -elm_store_fetch_thread_set(Elm_Store *st, Eina_Bool use_thread) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - st->fetch_thread = !!use_thread; -} - -EAPI Eina_Bool -elm_store_fetch_thread_get(const Elm_Store *st) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return EINA_FALSE; - return st->fetch_thread; -} - -EAPI void -elm_store_unfetch_func_set(Elm_Store *st, Elm_Store_Item_Unfetch_Cb func, const void *data) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - st->cb.unfetch.func = func; - st->cb.unfetch.data = (void *)data; -} - -EAPI void -elm_store_sorted_set(Elm_Store *st, Eina_Bool sorted) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return; - st->sorted = sorted; -} - -EAPI Eina_Bool -elm_store_sorted_get(const Elm_Store *st) -{ - if (!EINA_MAGIC_CHECK(st, ELM_STORE_MAGIC)) return EINA_FALSE; - return st->sorted; -} - -EAPI void -elm_store_item_data_set(Elm_Store_Item *sti, void *data) -{ - if (!EINA_MAGIC_CHECK(sti, ELM_STORE_ITEM_MAGIC)) return; - LKL(sti->lock); - sti->data = data; - LKU(sti->lock); -} - -EAPI void * -elm_store_item_data_get(Elm_Store_Item *sti) -{ - if (!EINA_MAGIC_CHECK(sti, ELM_STORE_ITEM_MAGIC)) return NULL; - void *d; - LKL(sti->lock); - d = sti->data; - LKU(sti->lock); - return d; -} - -EAPI const Elm_Store * -elm_store_item_store_get(const Elm_Store_Item *sti) -{ - if (!EINA_MAGIC_CHECK(sti, ELM_STORE_ITEM_MAGIC)) return NULL; - // dont need lock - return sti->store; -} - -EAPI const Elm_Genlist_Item * -elm_store_item_genlist_item_get(const Elm_Store_Item *sti) -{ - if (!EINA_MAGIC_CHECK(sti, ELM_STORE_ITEM_MAGIC)) return NULL; - // dont need lock - return sti->item; -} - -EAPI const char * -elm_store_item_filesystem_path_get(const Elm_Store_Item *item) -{ - Elm_Store_Item_Filesystem *sti = (Elm_Store_Item_Filesystem *)item; - Elm_Store_Filesystem *st; - if (!EINA_MAGIC_CHECK(item, ELM_STORE_ITEM_MAGIC)) return NULL; - if (!EINA_MAGIC_CHECK(item->store, ELM_STORE_MAGIC)) return NULL; - /* ensure we're dealing with filesystem item */ - st = (Elm_Store_Filesystem *)item->store; - if (!EINA_MAGIC_CHECK(st, ELM_STORE_FILESYSTEM_MAGIC)) return NULL; - // dont need lock - return sti->path; -} diff --git a/src/lib/elm_table.c b/src/lib/elm_table.c index 2582664..ac5e997 100644 --- a/src/lib/elm_table.c +++ b/src/lib/elm_table.c @@ -41,42 +41,6 @@ _del_hook(Evas_Object *obj) free(wd); } -static Eina_Bool -_elm_table_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) -{ - Widget_Data *wd = elm_widget_data_get(obj); - const Eina_List *items; - void *(*list_data_get) (const Eina_List *list); - Eina_List *(*list_free) (Eina_List *list); - - if ((!wd) || (!wd->tbl)) - return EINA_FALSE; - - /* Focus chain */ - /* TODO: Change this to use other chain */ - if ((items = elm_widget_focus_custom_chain_get(obj))) - { - list_data_get = eina_list_data_get; - list_free = NULL; - } - else - { - items = evas_object_table_children_get(wd->tbl); - list_data_get = eina_list_data_get; - list_free = eina_list_free; - - if (!items) return EINA_FALSE; - } - - Eina_Bool ret = elm_widget_focus_list_next_get(obj, items, list_data_get, - dir, next); - - if (list_free) - list_free((Eina_List *)items); - - return ret; -} - static void _sizing_eval(Evas_Object *obj) { @@ -105,6 +69,14 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, static void _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { + /* We do not add this callback, consequently we do not need to delete it + + Widget_Data *wd = elm_widget_data_get(obj); + evas_Object *sub = event_info; + + evas_object_event_callback_del_full + (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + */ _sizing_eval(obj); } @@ -123,11 +95,8 @@ elm_table_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "table"); elm_widget_type_set(obj, "table"); @@ -135,9 +104,6 @@ elm_table_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_del_pre_hook_set(obj, _del_pre_hook); - elm_widget_focus_next_hook_set(obj, _elm_table_focus_next_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); - elm_widget_highlight_ignore_set(obj, EINA_FALSE); wd->tbl = evas_object_table_add(e); evas_object_event_callback_add(wd->tbl, EVAS_CALLBACK_CHANGED_SIZE_HINTS, @@ -169,28 +135,10 @@ elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) } /** - * Get the current table homogenous mode. - * - * @param obj The table object - * @return a boolean to set (or no) layout homogenous in the table - * (1 = homogenous, 0 = no homogenous) - * - * @ingroup Table - */ -EAPI Eina_Bool -elm_table_homogenous_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return evas_object_table_homogeneous_get(wd->tbl); -} - -/** * Set padding between cells. * * @param obj The layout object. - * @param horizontal set the horizontal padding. + * @param horizontal set the horizontal padding. * @param vertical set the vertical padding. * * @ingroup Table @@ -205,24 +153,6 @@ elm_table_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertic } /** - * Get padding between cells. - * - * @param obj The layout object. - * @param horizontal set the horizontal padding. - * @param vertical set the vertical padding. - * - * @ingroup Table - */ -EAPI void -elm_table_padding_get(const Evas_Object *obj, Evas_Coord *horizontal, Evas_Coord *vertical) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - evas_object_table_padding_get(wd->tbl, horizontal, vertical); -} - -/** * Add a subobject on the table with the coordinates passed * * @param obj The table object diff --git a/src/lib/elm_thumb.c b/src/lib/elm_thumb.c index 5efd05e..cabef97 100644 --- a/src/lib/elm_thumb.c +++ b/src/lib/elm_thumb.c @@ -49,20 +49,19 @@ struct _Widget_Data Eina_Bool is_video : 1; Eina_Bool was_video : 1; Eina_Bool edit : 1; + }; static const char *widtype = NULL; -#define SIG_CLICKED "clicked" -#define SIG_CLICKED_DOUBLE "clicked,double" -#define SIG_GENERATE_ERROR "generate,error" -#define SIG_GENERATE_START "generate,start" -#define SIG_GENERATE_STOP "generate,stop" -#define SIG_LOAD_ERROR "load,error" -#define SIG_PRESS "press" - -static const Evas_Smart_Cb_Description _signals[] = -{ +static const char SIG_CLICKED[] = "clicked"; +static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; +static const char SIG_GENERATE_ERROR[] = "generate,error"; +static const char SIG_GENERATE_START[] = "generate,start"; +static const char SIG_GENERATE_STOP[] = "generate,stop"; +static const char SIG_LOAD_ERROR[] = "load,error"; +static const char SIG_PRESS[]= "press"; +static const Evas_Smart_Cb_Description _signals[] = { {SIG_CLICKED, ""}, {SIG_CLICKED_DOUBLE, ""}, {SIG_GENERATE_ERROR, ""}, @@ -73,12 +72,12 @@ static const Evas_Smart_Cb_Description _signals[] = {NULL, NULL} }; -#define EDJE_SIGNAL_GENERATE_START "elm,thumb,generate,start" -#define EDJE_SIGNAL_GENERATE_STOP "elm,thumb,generate,stop" -#define EDJE_SIGNAL_GENERATE_ERROR "elm,thumb,generate,error" -#define EDJE_SIGNAL_LOAD_ERROR "elm,thumb,load,error" -#define EDJE_SIGNAL_PULSE_START "elm,state,pulse,start" -#define EDJE_SIGNAL_PULSE_STOP "elm,state,pulse,stop" +static const char EDJE_SIGNAL_GENERATE_START[] = "elm,thumb,generate,start"; +static const char EDJE_SIGNAL_GENERATE_STOP[] = "elm,thumb,generate,stop"; +static const char EDJE_SIGNAL_GENERATE_ERROR[] = "elm,thumb,generate,error"; +static const char EDJE_SIGNAL_LOAD_ERROR[] = "elm,thumb,load,error"; +static const char EDJE_SIGNAL_PULSE_START[] = "elm,state,pulse,start"; +static const char EDJE_SIGNAL_PULSE_STOP[] = "elm,state,pulse,stop"; struct _Ethumb_Client *_elm_ethumb_client = NULL; Eina_Bool _elm_ethumb_connected = EINA_FALSE; @@ -106,8 +105,7 @@ static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - _elm_theme_object_set(obj, wd->frame, "thumb", "base", - elm_widget_style_get(obj)); + _elm_theme_object_set(obj, wd->frame, "thumb", "base", elm_widget_style_get(obj)); } #ifdef HAVE_ELEMENTARY_ETHUMB @@ -116,7 +114,6 @@ _mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void { Widget_Data *wd = data; Evas_Event_Mouse_Down *ev = event_info; - if (ev->button != 1) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) @@ -132,9 +129,9 @@ _mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void static void _mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { + Widget_Data *wd = data; Evas_Event_Mouse_Up *ev = event_info; - if (ev->button != 1) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) @@ -248,20 +245,10 @@ _finished_thumb_cb(void *data, Ethumb_Client *c __UNUSED__, int id, const char * static void _thumb_apply(Widget_Data *wd) { - if (wd->thumb.id > 0) - { - ethumb_client_generate_cancel - (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL); - wd->thumb.id = -1; - } - - if (!wd->file) return; - ethumb_client_file_set(_elm_ethumb_client, wd->file, wd->key); if (ethumb_client_thumb_exists(_elm_ethumb_client)) { const char *thumb_path, *thumb_key; - wd->thumb.id = -1; ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path, &thumb_key); @@ -271,14 +258,17 @@ _thumb_apply(Widget_Data *wd) else if ((wd->thumb.id = ethumb_client_generate (_elm_ethumb_client, _finished_thumb_cb, wd, NULL)) != -1) { - edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, "elm"); - edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, "elm"); + edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, + "elm"); + edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, + "elm"); evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL); } else { wd->thumb.id = -1; - edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm"); + edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, + "elm"); evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL); } } @@ -370,7 +360,7 @@ void _elm_unneed_ethumb(void) { #ifdef ELM_ETHUMB - if (--_elm_need_ethumb) return; + if (-- _elm_need_ethumb != 0) return; ethumb_client_disconnect(_elm_ethumb_client); _elm_ethumb_client = NULL; @@ -397,13 +387,10 @@ EAPI Eina_Bool elm_need_ethumb(void) { #ifdef ELM_ETHUMB - if (_elm_need_ethumb++) return EINA_TRUE; + if (_elm_need_ethumb ++ != 0) return; ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new(); ethumb_client_init(); _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL); - return EINA_TRUE; -#else - return EINA_FALSE; #endif } @@ -426,11 +413,8 @@ elm_thumb_add(Evas_Object *parent) Evas_Object *obj; Evas_Coord minw, minh; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); evas = evas_object_evas_get(parent); - if (!evas) return NULL; obj = elm_widget_add(evas); ELM_SET_WIDTYPE(widtype, "thumb"); elm_widget_type_set(obj, "thumb"); @@ -438,7 +422,6 @@ elm_thumb_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); wd->frame = edje_object_add(evas); _elm_theme_object_set(obj, wd->frame, "thumb", "base", "default"); @@ -475,34 +458,6 @@ elm_thumb_add(Evas_Object *parent) } /** - * Reload thumbnail if it was generated before. - * - * This is useful if the ethumb client configuration changed, like its - * size, aspect or any other property one set in the handle returned - * by elm_thumb_ethumb_client_get(). - * - * @param obj The thumb object to reload - * - * @see elm_thumb_file_set() - * - * @ingroup Thumb - */ -EAPI void -elm_thumb_reload(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - - eina_stringshare_replace(&(wd->thumb.file), NULL); - eina_stringshare_replace(&(wd->thumb.key), NULL); - -#ifdef HAVE_ELEMENTARY_ETHUMB - if (evas_object_visible_get(obj)) - _thumb_show(wd); -#endif -} - -/** * Set the file that will be used as thumbnail. * * The file can be an image or a video (in that case, acceptable extensions are: @@ -514,7 +469,6 @@ elm_thumb_reload(Evas_Object *obj) * @param key The key used in case of an EET file. * * @see elm_thumb_file_get() - * @see elm_thumb_reload() * @see elm_thumb_animate() * * @ingroup Thumb @@ -533,10 +487,8 @@ elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key) { int prefix_size; const char **ext, *ptr; - static const char *extensions[] = - { - ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL - }; + static const char *extensions[] = { ".avi", ".mp4", ".ogv", ".mov", + ".mpg", ".wmv", NULL }; prefix_size = eina_stringshare_strlen(wd->file) - 4; if (prefix_size >= 0) @@ -556,7 +508,7 @@ elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key) eina_stringshare_replace(&(wd->thumb.key), NULL); #ifdef HAVE_ELEMENTARY_ETHUMB - if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj))) + if ((file_replaced || key_replaced) && evas_object_visible_get(obj)) _thumb_show(wd); #endif } @@ -579,7 +531,6 @@ elm_thumb_file_get(const Evas_Object *obj, const char **file, const char **key) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (file) *file = wd->file; if (key) @@ -606,7 +557,6 @@ elm_thumb_path_get(const Evas_Object *obj, const char **file, const char **key) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (file) *file = wd->thumb.file; if (key) @@ -631,7 +581,11 @@ elm_thumb_animate_set(Evas_Object *obj, Elm_Thumb_Animation_Setting setting) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - EINA_SAFETY_ON_TRUE_RETURN(setting >= ELM_THUMB_ANIMATION_LAST); + if (setting < ELM_THUMB_ANIMATION_START || + setting >= ELM_THUMB_ANIMATION_LAST) + { + return; + } wd->anim_setting = setting; if (setting == ELM_THUMB_ANIMATION_LOOP) @@ -705,7 +659,7 @@ elm_thumb_animate_get(const Evas_Object *obj) * * @ingroup Thumb */ -EAPI void * +EAPI struct _Ethumb_Client * elm_thumb_ethumb_client_get(void) { return _elm_ethumb_client; @@ -723,6 +677,7 @@ elm_thumb_ethumb_client_connected(void) return _elm_ethumb_connected; } + EAPI Eina_Bool elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit) { @@ -744,11 +699,10 @@ elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit) } EAPI Eina_Bool -elm_thumb_editable_get(const Evas_Object *obj) +elm_thumb_editable_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; return wd->edit; } diff --git a/src/lib/elm_toggle.c b/src/lib/elm_toggle.c index 52137bf..3a7b479 100644 --- a/src/lib/elm_toggle.c +++ b/src/lib/elm_toggle.c @@ -36,9 +36,6 @@ static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *eve static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _signal_toggle_off(void *data, Evas_Object *obj, const char *emission, const char *source); static void _signal_toggle_on(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _on_focus_hook(void *data, Evas_Object *obj); -static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, - Evas_Callback_Type type, void *event_info); static const char SIG_CHANGED[] = "changed"; static const Evas_Smart_Cb_Description _signals[] = { @@ -46,25 +43,6 @@ static const Evas_Smart_Cb_Description _signals[] = { {NULL, NULL} }; -static Eina_Bool -_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) -{ - if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE; - Evas_Event_Key_Down *ev = event_info; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if ((strcmp(ev->keyname, "Return")) && - (strcmp(ev->keyname, "KP_Enter")) && - (strcmp(ev->keyname, "space"))) - return EINA_FALSE; - elm_toggle_state_set(obj, !wd->state); - evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); - ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - return EINA_TRUE; -} - static void _del_hook(Evas_Object *obj) { @@ -88,23 +66,6 @@ _disable_hook(Evas_Object *obj) } static void -_on_focus_hook(void *data __UNUSED__, Evas_Object *obj) -{ - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (elm_widget_focus_get(obj)) - { - edje_object_signal_emit(wd->tgl, "elm,action,focus", "elm"); - evas_object_focus_set(wd->tgl, EINA_TRUE); - } - else - { - edje_object_signal_emit(wd->tgl, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->tgl, EINA_FALSE); - } -} - -static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -125,8 +86,6 @@ _theme_hook(Evas_Object *obj) edje_object_part_text_set(wd->tgl, "elm.text", wd->label); edje_object_part_text_set(wd->tgl, "elm.ontext", wd->ontext); edje_object_part_text_set(wd->tgl, "elm.offtext", wd->offtext); - if (elm_widget_disabled_get(obj)) - edje_object_signal_emit(wd->tgl, "elm,state,disabled", "elm"); edje_object_message_signal_process(wd->tgl); edje_object_scale_set(wd->tgl, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); @@ -195,7 +154,7 @@ _signal_toggle_on(void *data, Evas_Object *obj __UNUSED__, const char *emission /** * Add a toggle to @p parent. * - * @param parent The parent object + * @param[in] parent The parent object * * @return The toggle object * @@ -208,22 +167,16 @@ elm_toggle_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "toggle"); elm_widget_type_set(obj, "toggle"); elm_widget_sub_object_add(parent, obj); - elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); - elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_event_hook_set(obj, _event_hook); wd->tgl = edje_object_add(e); _elm_theme_object_set(obj, wd->tgl, "toggle", "base", "default"); @@ -250,8 +203,8 @@ elm_toggle_add(Evas_Object *parent) /** * Sets the label to be displayed with the toggle. * - * @param obj The toggle object - * @param label The label to be displayed + * @param[in] obj The toggle object + * @param[in] label The label to be displayed * * @ingroup Toggle */ @@ -274,7 +227,7 @@ elm_toggle_label_set(Evas_Object *obj, const char *label) /** * Gets the label of the toggle * - * @param obj toggleeee object + * @param[in] obj The toggle object * @return The label of the toggle * * @ingroup Toggle @@ -289,14 +242,12 @@ elm_toggle_label_get(const Evas_Object *obj) } /** - * Set the icon used for the toggle + * Sets the icon to be displayed with the toggle. * - * Once the icon object is set, a previously set one will be deleted - * If you want to keep that old content object, use the - * elm_toggle_icon_unset() function. + * Once the icon object is set, a previously set one will be deleted. * - * @param obj The toggle object - * @param icon The icon object for the button + * @param[in] obj The toggle object + * @param[in] icon The icon object to be displayed * * @ingroup Toggle */ @@ -322,12 +273,10 @@ elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) } /** - * Get the icon used for the toggle + * Gets the icon of the toggle * - * Return the icon object which is set for this widget. - * - * @param obj The toggle object - * @return The icon object that is being used + * @param[in] obj The toggle object + * @return The icon object * * @ingroup Toggle */ @@ -341,35 +290,11 @@ elm_toggle_icon_get(const Evas_Object *obj) } /** - * Unset the icon used for the toggle - * - * Unparent and return the icon object which was set for this widget. - * - * @param obj The toggle object - * @return The icon object that was being used - * - * @ingroup Toggle - */ -EAPI Evas_Object * -elm_toggle_icon_unset(Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!wd->icon) return NULL; - Evas_Object *icon = wd->icon; - elm_widget_sub_object_del(obj, wd->icon); - edje_object_part_unswallow(wd->tgl, wd->icon); - wd->icon = NULL; - return icon; -} - -/** * Sets the labels to be associated with the on and off states of the toggle. * - * @param obj The toggle object - * @param onlabel The label displayed when the toggle is in the "on" state - * @param offlabel The label displayed when the toggle is in the "off" state + * @param[in] obj The toggle object + * @param[in] onlabel The label displayed when the toggle is in the "on" state + * @param[in] offlabel The label displayed when the toggle is in the "off" state * * @ingroup Toggle */ @@ -390,9 +315,9 @@ elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char * /** * Gets the labels associated with the on and off states of the toggle. * - * @param obj The toggle object - * @param onlabel A char** to place the onlabel of @p obj into - * @param offlabel A char** to place the offlabel of @p obj into + * @param[in] obj The toggle object + * @param[in] onlabel A char** to place the onlabel of @p obj into + * @param[in] offlabel A char** to place the offlabel of @p obj into * * @ingroup Toggle */ @@ -411,8 +336,8 @@ elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const /** * Sets the state of the toggle to @p state. * - * @param obj The toggle object - * @param state The state of @p obj + * @param[in] obj The toggle object + * @param[in] state The state of @p obj * * @ingroup Toggle */ @@ -436,7 +361,7 @@ elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) /** * Gets the state of the toggle to @p state. * - * @param obj The toggle object + * @param[in] obj The toggle object * @return The state of @p obj * * @ingroup Toggle @@ -453,8 +378,8 @@ elm_toggle_state_get(const Evas_Object *obj) /** * Sets the state pointer of the toggle to @p statep. * - * @param obj The toggle object - * @param statep The state pointer of @p obj + * @param[in] obj The toggle object + * @param[in] statep The state pointer of @p obj * * @ingroup Toggle */ diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index eedac21..842ac8e 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -14,55 +14,33 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { Evas_Object *scr, *bx; - Evas_Object *menu_parent; - Eina_Inlist *items; - Elm_Toolbar_Item *more_item, *selected_item; - Elm_Toolbar_Shrink_Mode shrink_mode; - Elm_Icon_Lookup_Order lookup_order; + Eina_List *items; int icon_size; - double align; + Eina_Bool scrollable : 1; + Evas_Object *menu_parent; Eina_Bool homogeneous : 1; - Eina_Bool no_select : 1; - Ecore_Job *resize_job; + double align; }; struct _Elm_Toolbar_Item { - Elm_Widget_Item base; - EINA_INLIST; + Evas_Object *obj; + Evas_Object *base; const char *label; - const char *icon_str; Evas_Object *icon; - Evas_Object *o_menu; Evas_Smart_Cb func; - struct { - int priority; - Eina_Bool visible : 1; - } prio; + Evas_Smart_Cb del_cb; + const void *data; Eina_Bool selected : 1; Eina_Bool disabled : 1; Eina_Bool separator : 1; Eina_Bool menu : 1; - Eina_List *states; - Eina_List *current_state; -}; - -#define ELM_TOOLBAR_ITEM_FROM_INLIST(item) \ - ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Toolbar_Item) : NULL) - -struct _Elm_Toolbar_Item_State -{ - const char *label; - const char *icon_str; - Evas_Object *icon; - Evas_Smart_Cb func; - const void *data; + Evas_Object *o_menu; }; static const char *widtype = NULL; static void _item_show(Elm_Toolbar_Item *it); static void _item_select(Elm_Toolbar_Item *it); -static void _item_unselect(Elm_Toolbar_Item *it); static void _item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled); static void _del_pre_hook(Evas_Object *obj); static void _del_hook(Evas_Object *obj); @@ -72,104 +50,61 @@ static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _menu_move_resize(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _menu_hide(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data); -static void _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *signal); -static void _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal); - -static Eina_Bool -_item_icon_set(Evas_Object *icon_obj, const char *type, const char *icon) -{ - char icon_str[512]; - - if ((!type) || (!*type)) goto end; - if ((!icon) || (!*icon)) return EINA_FALSE; - if ((snprintf(icon_str, sizeof(icon_str), "%s%s", type, icon) > 0) - && (elm_icon_standard_set(icon_obj, icon_str))) - return EINA_TRUE; -end: - if (elm_icon_standard_set(icon_obj, icon)) - return EINA_TRUE; - WRN("couldn't find icon definition for '%s'", icon); - return EINA_FALSE; -} - -static int -_elm_toolbar_icon_size_get(Widget_Data *wd) -{ - const char *icon_size = edje_object_data_get( - elm_smart_scroller_edje_object_get(wd->scr), "icon_size"); - if (icon_size) - return atoi(icon_size); - return _elm_config->icon_size; -} static void _item_show(Elm_Toolbar_Item *it) { - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Coord x, y, w, h, bx, by; if (!wd) return; evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL); - evas_object_geometry_get(it->base.view, &x, &y, &w, &h); + evas_object_geometry_get(it->base, &x, &y, &w, &h); elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h); } static void -_item_unselect(Elm_Toolbar_Item *item) -{ - Widget_Data *wd; - if ((!item) || (!item->selected)) return; - wd = elm_widget_data_get(item->base.widget); - if (!wd) return; - item->selected = EINA_FALSE; - wd->selected_item = NULL; - edje_object_signal_emit(item->base.view, "elm,state,unselected", "elm"); - elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm"); -} - -static void _item_select(Elm_Toolbar_Item *it) { Elm_Toolbar_Item *it2; - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Object *obj2; + const Eina_List *l; if (!wd) return; if ((it->selected) || (it->disabled) || (it->separator)) return; - - if (!wd->no_select) + EINA_LIST_FOREACH(wd->items, l, it2) { - it2 = elm_toolbar_selected_item_get(it->base.widget); - _item_unselect(it2); - - it->selected = EINA_TRUE; - wd->selected_item = it; - edje_object_signal_emit(it->base.view, "elm,state,selected", "elm"); - elm_widget_signal_emit(it->icon, "elm,state,selected", "elm"); - _item_show(it); + if (it2->selected) + { + it2->selected = EINA_FALSE; + edje_object_signal_emit(it2->base, "elm,state,unselected", "elm"); + break; + } } - obj2 = it->base.widget; - if (it->menu) + it->selected = EINA_TRUE; + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); + _item_show(it); + obj2 = it->obj; + if(it->menu) { evas_object_show(it->o_menu); - evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_RESIZE, + evas_object_event_callback_add(it->base, EVAS_CALLBACK_RESIZE, _menu_move_resize, it); - evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOVE, + evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOVE, _menu_move_resize, it); _menu_move_resize(it, NULL, NULL, NULL); } - if (it->func) it->func((void *)(it->base.data), it->base.widget, it); + if (it->func) it->func((void *)(it->data), it->obj, it); evas_object_smart_callback_call(obj2, "clicked", it); } static void _menu_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Elm_Toolbar_Item *selected; Elm_Toolbar_Item *it = data; - selected = elm_toolbar_selected_item_get(it->base.widget); - _item_unselect(selected); + elm_toolbar_item_unselect_all(it->obj); } static void @@ -185,71 +120,43 @@ _menu_move_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v { Elm_Toolbar_Item *it = data; Evas_Coord x,y,w,h; - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); if ((!wd) || (!wd->menu_parent)) return; - evas_object_geometry_get(it->base.view, &x, &y, &w, &h); + evas_object_geometry_get(it->base, &x, &y, &w, &h); elm_menu_move(it->o_menu, x, y+h); } static void _item_disable(Elm_Toolbar_Item *it, Eina_Bool disabled) { - Widget_Data *wd = elm_widget_data_get(it->base.widget); + Widget_Data *wd = elm_widget_data_get(it->obj); if (!wd) return; if (it->disabled == disabled) return; it->disabled = disabled; if (it->disabled) - { - edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm"); - elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); - } + edje_object_signal_emit(it->base, "elm,state,disabled", "elm"); else - { - edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm"); - elm_widget_signal_emit(it->icon, "elm,state,enabled", "elm"); - } -} - -static void -_item_del(Elm_Toolbar_Item *it) -{ - Elm_Toolbar_Item_State *it_state; - elm_widget_item_pre_notify_del(it); - EINA_LIST_FREE(it->states, it_state) - { - if (it->icon == it_state->icon) - it->icon = NULL; - eina_stringshare_del(it_state->label); - eina_stringshare_del(it_state->icon_str); - if (it_state->icon) evas_object_del(it_state->icon); - free(it_state); - } - eina_stringshare_del(it->label); - eina_stringshare_del(it->icon_str); - if (it->icon) evas_object_del(it->icon); - //TODO: See if checking for wd->menu_parent is necessary before deleting menu - if (it->o_menu) evas_object_del(it->o_menu); - elm_widget_item_del(it); + edje_object_signal_emit(it->base, "elm,state,enabled", "elm"); } static void _del_pre_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - Elm_Toolbar_Item *it, *next; + Elm_Toolbar_Item *it; if (!wd) return; - it = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items); - while(it) + EINA_LIST_FREE(wd->items, it) { - next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); - _item_del(it); - it = next; + if (it->del_cb) it->del_cb((void *)it->data, it->obj, it); + eina_stringshare_del(it->label); + if (it->icon) evas_object_del(it->icon); + if ((!wd->menu_parent) && (it->o_menu)) evas_object_del(it->o_menu); + evas_object_del(it->base); + free(it); } - if (wd->more_item) - _item_del(wd->more_item); } static void @@ -261,68 +168,54 @@ _del_hook(Evas_Object *obj) free(wd); } - -static void -_theme_hook_item(Evas_Object *obj, Elm_Toolbar_Item *it, double scale, int icon_size) -{ - Evas_Object *view = it->base.view; - Evas_Coord mw, mh; - const char *style = elm_widget_style_get(obj); - - edje_object_scale_set(view, scale); - if (!it->separator) - { - _elm_theme_object_set(obj, view, "toolbar", "item", style); - if (it->selected) - { - edje_object_signal_emit(view, "elm,state,selected", "elm"); - elm_widget_signal_emit(it->icon, "elm,state,selected", "elm"); - } - if (it->disabled) - { - edje_object_signal_emit(view, "elm,state,disabled", "elm"); - elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); - } - if (it->icon) - { - int ms = 0; - - ms = ((double)icon_size * scale); - evas_object_size_hint_min_set(it->icon, ms, ms); - evas_object_size_hint_max_set(it->icon, ms, ms); - edje_object_part_swallow(view, "elm.swallow.icon", - it->icon); - } - edje_object_part_text_set(view, "elm.text", it->label); - } - else - _elm_theme_object_set(obj, view, "toolbar", "separator", style); - - mw = mh = -1; - if (!it->separator) - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(view, &mw, &mh, mw, mh); - if (!it->separator) - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - evas_object_size_hint_min_set(view, mw, mh); -} - static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); + const Eina_List *l; Elm_Toolbar_Item *it; + const char *style = elm_widget_style_get(obj); double scale = 0; if (!wd) return; elm_smart_scroller_object_theme_set(obj, wd->scr, "toolbar", "base", elm_widget_style_get(obj)); scale = (elm_widget_scale_get(obj) * _elm_config->scale); - edje_object_scale_set(wd->scr, scale); - wd->icon_size = _elm_toolbar_icon_size_get(wd); - EINA_INLIST_FOREACH(wd->items, it) - _theme_hook_item(obj, it, scale, wd->icon_size); - if (wd->more_item) - _theme_hook_item(obj, wd->more_item, scale, wd->icon_size); +// edje_object_scale_set(wd->scr, scale); + EINA_LIST_FOREACH(wd->items, l, it) + { + Evas_Coord mw, mh; + + edje_object_scale_set(it->base, scale); + if (!it->separator) + { + if (it->selected) + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); + if (it->disabled) + edje_object_signal_emit(it->base, "elm,state,disabled", "elm"); + _elm_theme_object_set(obj, it->base, "toolbar", "item", style); + if (it->icon) + { + int ms = 0; + + ms = ((double)wd->icon_size * _elm_config->scale); + evas_object_size_hint_min_set(it->icon, ms, ms); + evas_object_size_hint_max_set(it->icon, ms, ms); + edje_object_part_swallow(it->base, "elm.swallow.icon", + it->icon); + } + edje_object_part_text_set(it->base, "elm.text", it->label); + } + else + _elm_theme_object_set(obj, it->base, "toolbar", "separator", style); + + mw = mh = -1; + if (!it->separator) + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); + if (!it->separator) + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + evas_object_size_hint_min_set(it->base, mw, mh); + } _sizing_eval(obj); } @@ -330,7 +223,7 @@ static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - Evas_Coord minw = -1, minh = -1, minw_bx; + Evas_Coord minw = -1, minh = -1; Evas_Coord vw = 0, vh = 0; Evas_Coord w, h; @@ -345,242 +238,51 @@ _sizing_eval(Evas_Object *obj) evas_object_resize(wd->scr, w, h); evas_object_size_hint_min_get(wd->bx, &minw, &minh); - minw_bx = minw; if (w > minw) minw = w; evas_object_resize(wd->bx, minw, minh); elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); - switch (wd->shrink_mode) - { - case ELM_TOOLBAR_SHRINK_MENU: /* fallthrough */ - case ELM_TOOLBAR_SHRINK_HIDE: /* fallthrough */ - case ELM_TOOLBAR_SHRINK_SCROLL: minw = w - vw; break; - case ELM_TOOLBAR_SHRINK_NONE: minw = minw_bx + (w - vw); break; - } + if (wd->scrollable) + minw = w - vw; + else + minw = minw + (w - vw); minh = minh + (h - vh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); } static void -_item_menu_create(Widget_Data *wd, Elm_Toolbar_Item *item) -{ - item->o_menu = elm_menu_add(item->base.view); - if (wd->menu_parent) - elm_menu_parent_set(item->o_menu, wd->menu_parent); - evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_HIDE, - _menu_hide, item); - evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_DEL, - _menu_del, item); -} - -static void -_item_menu_destroy(Elm_Toolbar_Item *item) -{ - if (item->o_menu) - { - evas_object_del(item->o_menu); - item->o_menu = NULL; - } -} - -static int -_toolbar_item_prio_compare_cb(const void *i1, const void *i2) -{ - const Elm_Toolbar_Item *eti1 = i1; - const Elm_Toolbar_Item *eti2 = i2; - - if (!eti2) return 1; - if (!eti1) return -1; - - return eti2->prio.priority - eti1->prio.priority; -} - -static void -_fix_items_visibility(Widget_Data *wd, Evas_Coord *iw, Evas_Coord vw) -{ - Elm_Toolbar_Item *it; - Eina_List *sorted = NULL; - Evas_Coord ciw; - - EINA_INLIST_FOREACH(wd->items, it) - { - sorted = eina_list_sorted_insert(sorted, - _toolbar_item_prio_compare_cb, it); - } - - if (wd->more_item) - { - evas_object_geometry_get(wd->more_item->base.view, NULL, NULL, &ciw, NULL); - *iw += ciw; - } - EINA_LIST_FREE(sorted, it) - { - evas_object_geometry_get(it->base.view, NULL, NULL, &ciw, NULL); - *iw += ciw; - it->prio.visible = (*iw <= vw); - } -} - -static void -_elm_toolbar_item_menu_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Elm_Toolbar_Item *it = data; - if (it->func) it->func((void *)(it->base.data), it->base.widget, it); -} - -static void -_resize_job(void *data) +_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); Evas_Coord mw, mh, vw, vh, w, h; + const Eina_List *l; Elm_Toolbar_Item *it; if (!wd) return; - wd->resize_job = NULL; elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); evas_object_size_hint_min_get(wd->bx, &mw, &mh); evas_object_geometry_get(wd->bx, NULL, NULL, &w, &h); - if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_MENU) - { - Evas_Coord iw = 0, more_w; - - evas_object_resize(wd->bx, vw, h); - _fix_items_visibility(wd, &iw, vw); - evas_object_geometry_get(wd->more_item->base.view, NULL, NULL, &more_w, NULL); - if (iw - more_w <= vw) - iw -= more_w; - - /* All items are removed from the box object, since removing individual - * items won't trigger a resize. Items are be readded below. */ - evas_object_box_remove_all(wd->bx, EINA_FALSE); - if (iw > vw) - { - Evas_Object *menu; - - _item_menu_destroy(wd->more_item); - _item_menu_create(wd, wd->more_item); - menu = elm_toolbar_item_menu_get(wd->more_item); - - EINA_INLIST_FOREACH(wd->items, it) - { - if (!it->prio.visible) - { - if (it->separator) - elm_menu_item_separator_add(menu, NULL); - else - { - Elm_Menu_Item *item; - item = elm_menu_item_add(menu, NULL, it->icon_str, it->label, - _elm_toolbar_item_menu_cb, it); - elm_menu_item_disabled_set(item, it->disabled); - if (it->o_menu) elm_menu_clone(it->o_menu, menu, item); - } - evas_object_hide(it->base.view); - } - else - { - evas_object_box_append(wd->bx, it->base.view); - evas_object_show(it->base.view); - } - } - - evas_object_box_append(wd->bx, wd->more_item->base.view); - evas_object_show(wd->more_item->base.view); - } - else - { - /* All items are visible, show them all (except for the "More" - * button, of course). */ - EINA_INLIST_FOREACH(wd->items, it) - { - evas_object_show(it->base.view); - evas_object_box_append(wd->bx, it->base.view); - } - evas_object_hide(wd->more_item->base.view); - } - } - else if (wd->shrink_mode == ELM_TOOLBAR_SHRINK_HIDE) + if (vw >= mw) { - Evas_Coord iw = 0; - - evas_object_resize(wd->bx, vw, h); - _fix_items_visibility(wd, &iw, vw); - evas_object_box_remove_all(wd->bx, EINA_FALSE); - if (iw > vw) - { - EINA_INLIST_FOREACH(wd->items, it) - { - if (!it->prio.visible) - evas_object_hide(it->base.view); - else - { - evas_object_box_append(wd->bx, it->base.view); - evas_object_show(it->base.view); - } - } - } - else - { - /* All items are visible, show them all */ - EINA_INLIST_FOREACH(wd->items, it) - { - evas_object_show(it->base.view); - evas_object_box_append(wd->bx, it->base.view); - } - } + if (w != vw) evas_object_resize(wd->bx, vw, h); } - else + EINA_LIST_FOREACH(wd->items, l, it) { - if ((vw >= mw) && (w != vw)) evas_object_resize(wd->bx, vw, h); - EINA_INLIST_FOREACH(wd->items, it) - { - if (it->selected) - { - _item_show(it); - break; - } - } + if (it->selected) + { + _item_show(it); + break; + } } } static void -_resize_item(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - _sizing_eval(data); - _resize(data, NULL, NULL, NULL); -} - -static void -_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Widget_Data *wd = elm_widget_data_get(data); - if (!wd->resize_job) - wd->resize_job = ecore_job_add(_resize_job, data); -} - -static void _select(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { _item_select(data); } static void -_mouse_in(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ - Elm_Toolbar_Item *it = data; - edje_object_signal_emit(it->base.view, "elm,state,highlighted", "elm"); - elm_widget_signal_emit(it->icon, "elm,state,highlighted", "elm"); -} - -static void -_mouse_out(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) -{ - Elm_Toolbar_Item *it = data; - edje_object_signal_emit(it->base.view, "elm,state,unhighlighted", "elm"); - elm_widget_signal_emit(it->icon, "elm,state,unhighlighted", "elm"); -} - -static void _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) { Widget_Data *wd = data; @@ -588,75 +290,6 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) _els_box_layout(o, priv, 1, wd->homogeneous); } -static Elm_Toolbar_Item * -_item_new(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) -{ - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *icon_obj; - Evas_Coord mw, mh; - Elm_Toolbar_Item *it; - - icon_obj = elm_icon_add(obj); - elm_icon_order_lookup_set(icon_obj, wd->lookup_order); - if (!icon_obj) return NULL; - it = elm_widget_item_new(obj, Elm_Toolbar_Item); - if (!it) - { - evas_object_del(icon_obj); - return NULL; - } - it->label = eina_stringshare_add(label); - it->prio.visible = 1; - it->prio.priority = 0; - it->func = func; - it->separator = EINA_FALSE; - it->base.data = data; - it->base.view = edje_object_add(evas_object_evas_get(obj)); - if (_item_icon_set(icon_obj, "toolbar/", icon)) - { - it->icon = icon_obj; - it->icon_str = eina_stringshare_add(icon); - } - else - { - it->icon = NULL; - it->icon_str = NULL; - evas_object_del(icon_obj); - } - - _elm_theme_object_set(obj, it->base.view, "toolbar", "item", - elm_widget_style_get(obj)); - edje_object_signal_callback_add(it->base.view, "elm,action,click", "elm", - _select, it); - edje_object_signal_callback_add(it->base.view, "elm,mouse,in", "elm", - _mouse_in, it); - edje_object_signal_callback_add(it->base.view, "elm,mouse,out", "elm", - _mouse_out, it); - elm_widget_sub_object_add(obj, it->base.view); - if (it->icon) - { - int ms = 0; - - ms = ((double)wd->icon_size * _elm_config->scale); - evas_object_size_hint_min_set(it->icon, ms, ms); - evas_object_size_hint_max_set(it->icon, ms, ms); - edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon); - evas_object_show(it->icon); - elm_widget_sub_object_add(obj, it->icon); - } - edje_object_part_text_set(it->base.view, "elm.text", it->label); - mw = mh = -1; - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(it->base.view, &mw, &mh, mw, mh); - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - evas_object_size_hint_weight_set(it->base.view, -1.0, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(it->base.view, 0.5, EVAS_HINT_FILL); - evas_object_size_hint_min_set(it->base.view, mw, mh); - evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_RESIZE, - _resize_item, obj); - return it; -} - /** * Add a toolbar object to @p parent. * @@ -673,11 +306,8 @@ elm_toolbar_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); - if (!e) return NULL; obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "toolbar"); elm_widget_type_set(obj, "toolbar"); @@ -686,25 +316,19 @@ elm_toolbar_add(Evas_Object *parent) elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - elm_widget_can_focus_set(obj, EINA_FALSE); + elm_widget_can_focus_set(obj, 0); - wd->more_item = NULL; - wd->selected_item = NULL; wd->scr = elm_smart_scroller_add(e); elm_smart_scroller_widget_set(wd->scr, obj); elm_smart_scroller_object_theme_set(obj, wd->scr, "toolbar", "base", "default"); - elm_smart_scroller_bounce_allow_set(wd->scr, - _elm_config->thumbscroll_bounce_enable, - EINA_FALSE); + elm_smart_scroller_bounce_allow_set(wd->scr, 1, 0); elm_widget_resize_object_set(obj, wd->scr); elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_AUTO, ELM_SMART_SCROLLER_POLICY_OFF); - - wd->icon_size = _elm_toolbar_icon_size_get(wd); - - + wd->icon_size = 32; + wd->scrollable = EINA_TRUE; wd->homogeneous = EINA_TRUE; wd->align = 0.5; @@ -715,10 +339,7 @@ elm_toolbar_add(Evas_Object *parent) elm_smart_scroller_child_set(wd->scr, wd->bx); evas_object_show(wd->bx); - elm_toolbar_mode_shrink_set(obj, _elm_config->toolbar_shrink_mode); evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE, _resize, obj); - evas_object_event_callback_add(wd->bx, EVAS_CALLBACK_RESIZE, _resize, obj); - elm_toolbar_icon_order_lookup_set(obj, ELM_ICON_LOOKUP_THEME_FDO); _sizing_eval(obj); return obj; @@ -738,6 +359,7 @@ elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; + if (icon_size > 48) return; if (wd->icon_size == icon_size) return; wd->icon_size = icon_size; _theme_hook(obj); @@ -761,842 +383,186 @@ elm_toolbar_icon_size_get(const Evas_Object *obj) } /** - * Append item to the toolbar + * Add an item to the toolbar. * * @param obj The toolbar object - * @param icon A string with icon name or the absolute path of an image file. + * @param icon The icon object of the item * @param label The label of the item * @param func The function to call when the item is clicked * @param data The data to associate with the item - * @return The toolbar item, or NULL upon failure * - * @see elm_toolbar_item_icon_set + * @return The toolbar item, or NULL upon failure * * @ingroup Toolbar */ EAPI Elm_Toolbar_Item * -elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) +elm_toolbar_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; + Evas_Coord mw, mh; + Elm_Toolbar_Item *it; - Elm_Toolbar_Item *it = _item_new(obj, icon, label, func, data); + if (!wd) return NULL; + it = ELM_NEW(Elm_Toolbar_Item); if (!it) return NULL; + wd->items = eina_list_append(wd->items, it); + it->obj = obj; + it->label = eina_stringshare_add(label); + it->icon = icon; + it->func = func; + it->data = data; + it->separator = EINA_FALSE; + it->base = edje_object_add(evas_object_evas_get(obj)); + _elm_theme_object_set(obj, it->base, "toolbar", "item", elm_widget_style_get(obj)); + edje_object_signal_callback_add(it->base, "elm,action,click", "elm", + _select, it); + elm_widget_sub_object_add(obj, it->base); + if (it->icon) + { + int ms = 0; - wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it)); - evas_object_box_append(wd->bx, it->base.view); - evas_object_show(it->base.view); + ms = ((double)wd->icon_size * _elm_config->scale); + evas_object_size_hint_min_set(it->icon, ms, ms); + evas_object_size_hint_max_set(it->icon, ms, ms); + edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); + evas_object_show(it->icon); + elm_widget_sub_object_add(obj, it->icon); + } + edje_object_part_text_set(it->base, "elm.text", it->label); + mw = mh = -1; + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + evas_object_size_hint_weight_set(it->base, -1.0, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(it->base, 0.5, EVAS_HINT_FILL); + evas_object_size_hint_min_set(it->base, mw, mh); + evas_object_box_append(wd->bx, it->base); + evas_object_show(it->base); _sizing_eval(obj); - return it; } -static void -_elm_toolbar_item_state_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) -{ - Elm_Toolbar_Item *it = event_info; - Elm_Toolbar_Item_State *it_state; - - it_state = eina_list_data_get(it->current_state); - if (it_state->func) - it_state->func((void *)it_state->data, obj, event_info); -} - /** - * Sets the next @p item state as the current state. + * Get the icon associated with @p item. * - * @param item The item. + * @param item The toolbar item + * @return The icon object * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Item_State * -elm_toolbar_item_state_next(Elm_Toolbar_Item *item) +EAPI Evas_Object * +elm_toolbar_item_icon_get(Elm_Toolbar_Item *item) { - Widget_Data *wd; - Evas_Object *obj; - Eina_List *next_state; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - - obj = item->base.widget; - wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!item->states) return NULL; - - next_state = eina_list_next(item->current_state); - if (!next_state) - next_state = eina_list_next(item->states); - return eina_list_data_get(next_state); + if (!item) return NULL; + return item->icon; } /** - * Sets the previous @p item state as the current state. + * Get the label associated with @p item. * - * @param item The item. + * @param item The toolbar item + * @return The label * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Item_State * -elm_toolbar_item_state_prev(Elm_Toolbar_Item *item) +EAPI const char * +elm_toolbar_item_label_get(const Elm_Toolbar_Item *item) { - Widget_Data *wd; - Evas_Object *obj; - Eina_List *prev_state; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - - obj = item->base.widget; - wd = elm_widget_data_get(obj); - if (!wd) return NULL; - if (!item->states) return NULL; - - prev_state = eina_list_prev(item->current_state); - if ((!prev_state) || (prev_state == item->states)) - prev_state = eina_list_last(item->states); - return eina_list_data_get(prev_state); + if (!item) return NULL; + return item->label; } /** - * Unset the state of @p it - * The default icon and label from this item will be displayed. + * Get the selected state of @p item. * - * @param it The item. + * @param item The toolbar item + * @return If true, the item is selected * * @ingroup Toolbar */ -EAPI void -elm_toolbar_item_state_unset(Elm_Toolbar_Item *it) +EAPI Eina_Bool +elm_toolbar_item_selected_get(const Elm_Toolbar_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it); - elm_toolbar_item_state_set(it, NULL); + if (!item) return EINA_FALSE; + return item->selected; } /** - * Sets @p state as the current state of @p it. - * If @p state is NULL, it won't select any state and the default icon and - * label will be used. - * - * @param it The item. - * @param state The state to use. + * Set the label associated with @p item. * - * @return True if the state was correctly set. + * @param item The toolbar item + * @param label The label of @p item * * @ingroup Toolbar */ -EAPI Eina_Bool -elm_toolbar_item_state_set(Elm_Toolbar_Item *it, Elm_Toolbar_Item_State *state) +EAPI void +elm_toolbar_item_label_set(Elm_Toolbar_Item *item, const char *label) { - Widget_Data *wd; - Eina_List *next_state; - Elm_Toolbar_Item_State *it_state; - Evas_Object *obj; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, EINA_FALSE); + Evas_Coord mw = -1, mh = -1; - obj = it->base.widget; - wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - if (!it->states) return EINA_FALSE; - - if (state) - { - next_state = eina_list_data_find_list(it->states, state); - if (!next_state) return EINA_FALSE; - } - else - next_state = it->states; - - if (next_state == it->current_state) return EINA_TRUE; - - it_state = eina_list_data_get(next_state); - if (eina_list_data_find(it->current_state, state)) - { - _item_label_set(it, it_state->label, "elm,state,label_set,forward"); - _elm_toolbar_item_icon_obj_set(obj, it, it_state->icon, it_state->icon_str, - wd->icon_size, "elm,state,icon_set,forward"); - } - else - { - _item_label_set(it, it_state->label, "elm,state,label_set,backward"); - _elm_toolbar_item_icon_obj_set(obj, it, it_state->icon, it_state->icon_str, - wd->icon_size, "elm,state,icon_set,backward"); - } - if (it->disabled) - elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); - else - elm_widget_signal_emit(it->icon, "elm,state,enabled", "elm"); - - it->current_state = next_state; - return EINA_TRUE; -} - -/** - * Get the current state of @p item. - * If no state is selected, returns NULL. - * - * @param item The item. - * - * @return The state. - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item_State * -elm_toolbar_item_state_get(const Elm_Toolbar_Item *it) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, NULL); - if ((!it->states) || (!it->current_state)) return NULL; - if (it->current_state == it->states) return NULL; - - return eina_list_data_get(it->current_state); -} - -static Elm_Toolbar_Item_State * -_item_state_new(const char *label, const char *icon_str, Evas_Object *icon, Evas_Smart_Cb func, const void *data) -{ - Elm_Toolbar_Item_State *it_state; - it_state = ELM_NEW(Elm_Toolbar_Item_State); - it_state->label = eina_stringshare_add(label); - it_state->icon_str = eina_stringshare_add(icon_str); - it_state->icon = icon; - it_state->func = func; - it_state->data = data; - return it_state; -} - -/** - * Add a new state to @p item - * - * @param item The item. - * @param icon The icon string - * @param label The label of the new state - * @param func The function to call when the item is clicked when this state is - * selected. - * @param data The data to associate with the state - * @return The toolbar item state, or NULL upon failure - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item_State * -elm_toolbar_item_state_add(Elm_Toolbar_Item *item, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) -{ - Elm_Toolbar_Item_State *it_state; - Evas_Object *icon_obj; - Evas_Object *obj; - Widget_Data *wd; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - obj = item->base.widget; - wd = elm_widget_data_get(item->base.widget); - if (!wd) return NULL; - - if (!item->states) - { - it_state = _item_state_new(item->label, item->icon_str, item->icon, - item->func, item->base.data); - item->states = eina_list_append(item->states, it_state); - item->current_state = item->states; - } - - icon_obj = elm_icon_add(obj); - elm_icon_order_lookup_set(icon_obj, wd->lookup_order); - if (!icon_obj) goto error_state_add; - - if (!_item_icon_set(icon_obj, "toolbar/", icon)) - { - evas_object_del(icon_obj); - icon_obj = NULL; - icon = NULL; - } - - it_state = _item_state_new(label, icon, icon_obj, func, data); - item->states = eina_list_append(item->states, it_state); - item->func = _elm_toolbar_item_state_cb; - item->base.data = NULL; - - return it_state; - -error_state_add: - if (item->states && !eina_list_next(item->states)) - { - eina_stringshare_del(item->label); - eina_stringshare_del(item->icon_str); - free(eina_list_data_get(item->states)); - eina_list_free(item->states); - item->states = NULL; - } - return NULL; -} - -EAPI Eina_Bool -elm_toolbar_item_state_del(Elm_Toolbar_Item *item, Elm_Toolbar_Item_State *state) -{ - Eina_List *del_state; - Elm_Toolbar_Item_State *it_state; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); - - if (!state) return EINA_FALSE; - if (!item->states) return EINA_FALSE; - - del_state = eina_list_data_find_list(item->states, state); - if (del_state == item->states) return EINA_FALSE; - if (del_state == item->current_state) - elm_toolbar_item_state_unset(item); - - eina_stringshare_del(state->label); - eina_stringshare_del(state->icon_str); - if (state->icon) evas_object_del(state->icon); - free(state); - item->states = eina_list_remove_list(item->states, del_state); - if (item->states && !eina_list_next(item->states)) - { - it_state = eina_list_data_get(item->states); - item->base.data = it_state->data; - item->func = it_state->func; - eina_stringshare_del(it_state->label); - eina_stringshare_del(it_state->icon_str); - free(eina_list_data_get(item->states)); - eina_list_free(item->states); - item->states = NULL; - } - return EINA_TRUE; -} - - -/** - * Prepend item to the toolbar - * - * @param obj The toolbar object - * @param icon A string with icon name or the absolute path of an image file. - * @param label The label of the item - * @param func The function to call when the item is clicked - * @param data The data to associate with the item - * @return The toolbar item, or NULL upon failure - * - * @see elm_toolbar_item_icon_set - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - - Elm_Toolbar_Item *it = _item_new(obj, icon, label, func, data); - if (!it) return NULL; - - wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it)); - evas_object_box_prepend(wd->bx, it->base.view); - evas_object_show(it->base.view); - _sizing_eval(obj); - - return it; -} - -/** - * Insert item before another in the toolbar - * - * @param obj The toolbar object - * @param before The item to insert before - * @param icon A string with icon name or the absolute path of an image file. - * @param label The label of the item - * @param func The function to call when the item is clicked - * @param data The data to associate with the item - * @return The toolbar item, or NULL upon failure - * - * @see elm_toolbar_item_icon_set - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_insert_before(Evas_Object *obj, Elm_Toolbar_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(before, NULL); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - - Elm_Toolbar_Item *it = _item_new(obj, icon, label, func, data); - if (!it) return NULL; - - wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(before)); - evas_object_box_insert_before(wd->bx, it->base.view, before->base.view); - evas_object_show(it->base.view); - _sizing_eval(obj); - - return it; -} - -/** - * Insert item after another in the toolbar - * - * @param obj The toolbar object - * @param after The item to insert after - * @param icon A string with icon name or the absolute path of an image file. - * @param label The label of the item - * @param func The function to call when the item is clicked - * @param data The data to associate with the item - * @return The toolbar item, or NULL upon failure - * - * @see elm_toolbar_item_icon_set - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_insert_after(Evas_Object *obj, Elm_Toolbar_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(after, NULL); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - - Elm_Toolbar_Item *it = _item_new(obj, icon, label, func, data); - if (!it) return NULL; - - wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(after)); - evas_object_box_insert_after(wd->bx, it->base.view, after->base.view); - evas_object_show(it->base.view); - _sizing_eval(obj); - - return it; -} - -/** - * Get the first item in the toolbar - * - * @param obj The toolbar object - * @return The first item, or NULL if none - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_first_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->items) return NULL; - Elm_Toolbar_Item *it = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items); - return it; -} - -/** - * Get the last item in the toolbar - * - * @return The last item, or NULL if none - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_last_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->items) return NULL; - Elm_Toolbar_Item *it = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items->last); - return it; -} - -/** - * Get the next item in the toolbar - * - * This returns the item after the item @p it. - * - * @param item The item - * @return The item after @p it, or NULL if none - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_next_get(const Elm_Toolbar_Item *item) -{ - Elm_Toolbar_Item *next; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->next); - return next; -} - -/** - * Get the previous item in the toolbar - * - * This returns the item before the item @p it. - * - * @param item The item - * @return The item before @p it, or NULL if none - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_prev_get(const Elm_Toolbar_Item *item) -{ - Elm_Toolbar_Item *prev; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - prev = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(item)->prev); - return prev; -} - -/** - * Get the toolbar object from an item - * - * This returns the toolbar object itself that an item belongs to. - * - * @param item The item - * @return The toolbar object - * - * @ingroup Toolbar - */ -EAPI Evas_Object * -elm_toolbar_item_toolbar_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->base.widget; -} - -/** - * Sets the priority of a toolbar item. This is used only when the toolbar - * shrink mode is set to ELM_TOOLBAR_SHRINK_MENU or ELM_TOOLBAR_SHRINK_HIDE: - * when space is at a premium, items with low priority will be removed from - * the toolbar and added to a dynamically-created menu, while items with - * higher priority will remain on the toolbar, with the same order they were - * added. - * - * @param item The toolbar item. - * @param priority The item priority. The default is zero. - * - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_priority_set(Elm_Toolbar_Item *item, int priority) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - if (item->prio.priority == priority) return; - item->prio.priority = priority; - _resize(item->base.widget, NULL, NULL, NULL); -} - -/** - * Gets the priority of a toolbar item. - * - * @param item The toolbar item. - * @return The item priority, or 0 if an error occurred. - * - * @ingroup Toolbar - */ -EAPI int -elm_toolbar_item_priority_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, 0); - return item->prio.priority; -} - -/** - * Get the string used to set the icon of @p item. - * - * @param item The toolbar item - * @return The string associated with the icon object. - * - * @see elm_toolbar_item_icon_set() - * - * @ingroup Toolbar - */ -EAPI const char * -elm_toolbar_item_icon_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->icon_str; -} - -/** - * Get the label associated with @p item. - * - * @param item The toolbar item - * @return The label - * - * @ingroup Toolbar - */ -EAPI const char * -elm_toolbar_item_label_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return item->label; -} - -static void -_elm_toolbar_item_label_update(Elm_Toolbar_Item *item) -{ - Evas_Coord mw = -1, mh = -1; - edje_object_part_text_set(item->base.view, "elm.text", item->label); + if (!item) return; + eina_stringshare_replace(&item->label, label); + edje_object_part_text_set(item->base, "elm.text", item->label); elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(item->base.view, &mw, &mh, mw, mh); + edje_object_size_min_restricted_calc(item->base, &mw, &mh, mw, mh); elm_coords_finger_size_adjust(1, &mw, 1, &mh); - evas_object_size_hint_weight_set(item->base.view, -1.0, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(item->base.view, 0.5, EVAS_HINT_FILL); - evas_object_size_hint_min_set(item->base.view, mw, mh); -} - -static void -_elm_toolbar_item_label_set_cb (void *data, Evas_Object *obj, const char *emission, const char *source) -{ - Elm_Toolbar_Item *item = data; - _elm_toolbar_item_label_update(item); - edje_object_signal_callback_del(obj, emission, source, - _elm_toolbar_item_label_set_cb); - edje_object_signal_emit (item->base.view, "elm,state,label,reset", "elm"); + evas_object_size_hint_weight_set(item->base, -1.0, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(item->base, 0.5, EVAS_HINT_FILL); + evas_object_size_hint_min_set(item->base, mw, mh); } -static void -_item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal) -{ - const char *s; - - if ((label) && (item->label) && (!strcmp(label, item->label))) return; - - eina_stringshare_replace(&item->label, label); - s = edje_object_data_get(item->base.view, "transition_animation_on"); - if ((s) && (atoi(s))) - { - edje_object_part_text_set(item->base.view, "elm.text_new", item->label); - edje_object_signal_emit (item->base.view, signal, "elm"); - edje_object_signal_callback_add(item->base.view, - "elm,state,label_set,done", "elm", - _elm_toolbar_item_label_set_cb, item); - } - else - _elm_toolbar_item_label_update(item); - _resize(item->base.widget, NULL, NULL, NULL); -} /** - * Set the label associated with @p item. - * - * @param item The toolbar item - * @param label The label of @p item - * - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_label_set(Elm_Toolbar_Item *item, const char *label) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - _item_label_set(item, label, "elm,state,label_set"); -} - -static void -_elm_toolbar_item_icon_update(Elm_Toolbar_Item *item) -{ - Elm_Toolbar_Item_State *it_state; - Eina_List *l; - Evas_Coord mw = -1, mh = -1; - Evas_Object *old_icon = edje_object_part_swallow_get(item->base.view, - "elm.swallow.icon"); - elm_widget_sub_object_del(item->base.view, old_icon); - evas_object_hide(old_icon); - edje_object_part_swallow(item->base.view, "elm.swallow.icon", item->icon); - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(item->base.view, &mw, &mh, mw, mh); - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - evas_object_size_hint_weight_set(item->base.view, -1.0, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(item->base.view, 0.5, EVAS_HINT_FILL); - evas_object_size_hint_min_set(item->base.view, mw, mh); - - EINA_LIST_FOREACH(item->states, l, it_state) - if (it_state->icon == old_icon) - return; - evas_object_del(old_icon); -} - -/** - * Get the selected state of @p item. - * - * @param item The toolbar item - * @return If true, the item is selected - * - * @ingroup Toolbar - */ -EAPI Eina_Bool -elm_toolbar_item_selected_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); - return item->selected; -} - -/** - * Set the selected state of an item - * - * This sets the selected state (1 selected, 0 not selected) of the given - * item @p it. If a new item is selected the previosly selected will be - * unselected. - * - * @param item The item - * @param selected The selected state - * - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - Widget_Data *wd = elm_widget_data_get(item->base.widget); - if (!wd) return; - - if (item->selected == selected) return; - - if (selected) - _item_select(item); - else - _item_unselect(item); -} - -/** - * Get the selectd item in the toolbar - * - * If no item is selected, NULL is returned. - * - * @param obj The toolbar object - * @return The selected item, or NULL if none. - * - * @ingroup Toolbar - */ -EAPI Elm_Toolbar_Item * -elm_toolbar_selected_item_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->selected_item; -} - -static void -_elm_toolbar_item_icon_set_cb (void *data, Evas_Object *obj, const char *emission, const char *source) -{ - Elm_Toolbar_Item *item = data; - edje_object_part_unswallow(item->base.view, item->icon); - _elm_toolbar_item_icon_update(item); - edje_object_signal_callback_del(obj, emission, source, - _elm_toolbar_item_icon_set_cb); - edje_object_signal_emit (item->base.view, "elm,state,icon,reset", "elm"); -} - -static void -_elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *signal) -{ - Evas_Object *old_icon; - int ms = 0; - const char *s; - - if (icon_str) - eina_stringshare_replace(&item->icon_str, icon_str); - else - { - eina_stringshare_del(item->icon_str); - item->icon_str = NULL; - } - item->icon = icon_obj; - if (icon_obj) - { - ms = (icon_size * _elm_config->scale); - evas_object_size_hint_min_set(item->icon, ms, ms); - evas_object_size_hint_max_set(item->icon, ms, ms); - evas_object_show(item->icon); - elm_widget_sub_object_add(obj, item->icon); - } - s = edje_object_data_get(item->base.view, "transition_animation_on"); - if ((s) && (atoi(s))) - { - old_icon = edje_object_part_swallow_get(item->base.view, - "elm.swallow.icon_new"); - if (old_icon) - { - elm_widget_sub_object_del(item->base.view, old_icon); - evas_object_hide(old_icon); - } - edje_object_part_swallow(item->base.view, "elm.swallow.icon_new", - item->icon); - edje_object_signal_emit (item->base.view, signal, "elm"); - edje_object_signal_callback_add(item->base.view, - "elm,state,icon_set,done", "elm", - _elm_toolbar_item_icon_set_cb, item); - } - else - _elm_toolbar_item_icon_update(item); - _resize(obj, NULL, NULL, NULL); -} - -/** - * Set the icon associated with @p item. - * - * Toolbar will load icon image from fdo or current theme. - * This behavior can be set by elm_toolbar_icon_order_lookup_set() function. - * If an absolute path is provided it will load it direct from a file. - * - * @param obj The parent of this item - * @param item The toolbar item - * @param icon A string with icon name or the absolute path of an image file. + * Delete a toolbar item. * - * @see elm_toolbar_icon_order_lookup_set(), elm_toolbar_icon_order_lookup_get() + * @param it The toolbar item * * @ingroup Toolbar */ EAPI void -elm_toolbar_item_icon_set(Elm_Toolbar_Item *item, const char *icon) +elm_toolbar_item_del(Elm_Toolbar_Item *it) { - Evas_Object *icon_obj; - Widget_Data *wd; - Evas_Object *obj = item->base.widget; + Widget_Data *wd = elm_widget_data_get(it->obj); + Evas_Object *obj2 = it->obj; - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - wd = elm_widget_data_get(obj); - if (!wd) return; - if ((icon) && (item->icon_str) && (!strcmp(icon, item->icon_str))) return; - - icon_obj = elm_icon_add(obj); - if (!icon_obj) return; - if (_item_icon_set(icon_obj, "toolbar/", icon)) - _elm_toolbar_item_icon_obj_set(obj, item, icon_obj, icon, wd->icon_size, - "elm,state,icon_set"); - else - { - _elm_toolbar_item_icon_obj_set(obj, item, NULL, NULL, 0, - "elm,state,icon_set"); - evas_object_del(icon_obj); - } + if ((!wd) || (!it)) return; + if (it->del_cb) it->del_cb((void *)it->data, it->obj, it); + wd->items = eina_list_remove(wd->items, it); + eina_stringshare_del(it->label); + if (it->icon) evas_object_del(it->icon); + evas_object_del(it->base); + free(it); + _theme_hook(obj2); } /** - * Delete a toolbar item. + * Set the function called when a toolbar item is freed. * - * @param item The toolbar item + * @param it The item to set the callback on + * @param func The function called * * @ingroup Toolbar */ EAPI void -elm_toolbar_item_del(Elm_Toolbar_Item *item) +elm_toolbar_item_del_cb_set(Elm_Toolbar_Item *it, Evas_Smart_Cb func) { - Widget_Data *wd; - Evas_Object *obj2; - - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - wd = elm_widget_data_get(item->base.widget); - if (!wd) return; - obj2 = item->base.widget; - wd->items = eina_inlist_remove(wd->items, EINA_INLIST_GET(item)); - _item_del(item); - _theme_hook(obj2); + it->del_cb = func; } /** - * Set the function called when a toolbar item is freed. + * Select the toolbar item @p item. * - * @param item The item to set the callback on - * @param func The function called + * @param item The toolbar item * * @ingroup Toolbar */ EAPI void -elm_toolbar_item_del_cb_set(Elm_Toolbar_Item *item, Evas_Smart_Cb func) +elm_toolbar_item_select(Elm_Toolbar_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_del_cb_set(item, func); + if (!item) return; + _item_select(item); } /** @@ -1608,9 +574,9 @@ elm_toolbar_item_del_cb_set(Elm_Toolbar_Item *item, Evas_Smart_Cb func) * @ingroup Toolbar */ EAPI Eina_Bool -elm_toolbar_item_disabled_get(const Elm_Toolbar_Item *item) +elm_toolbar_item_disabled_get(Elm_Toolbar_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); + if (!item) return EINA_FALSE; return item->disabled; } @@ -1625,9 +591,8 @@ elm_toolbar_item_disabled_get(const Elm_Toolbar_Item *item) EAPI void elm_toolbar_item_disabled_set(Elm_Toolbar_Item *item, Eina_Bool disabled) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + if (!item) return; _item_disable(item, disabled); - _resize(item->base.widget, NULL, NULL, NULL); } /** @@ -1641,10 +606,10 @@ elm_toolbar_item_disabled_set(Elm_Toolbar_Item *item, Eina_Bool disabled) EAPI void elm_toolbar_item_separator_set(Elm_Toolbar_Item *item, Eina_Bool separator) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + if (!item) return; if (item->separator == separator) return; item->separator = separator; - _theme_hook(item->base.view); + _theme_hook(item->obj); } /** @@ -1656,75 +621,48 @@ elm_toolbar_item_separator_set(Elm_Toolbar_Item *item, Eina_Bool separator) * @ingroup Toolbar */ EAPI Eina_Bool -elm_toolbar_item_separator_get(const Elm_Toolbar_Item *item) +elm_toolbar_item_separator_get(Elm_Toolbar_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); + if (!item) return EINA_FALSE; return item->separator; } /** - * Set the shrink state of toolbar @p obj. + * Set the scrollable state of toolbar @p obj. * * @param obj The toolbar object - * @param shrink_mode The toolbar won't scroll if ELM_TOOLBAR_SHRINK_NONE, - * but will enforce a minimun size so all the items will fit, won't scroll - * and won't show the items that don't fit if ELM_TOOLBAR_SHRINK_HIDE, - * will scroll if ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to - * pop up excess elements with ELM_TOOLBAR_SHRINK_MENU. + * @param scrollable If true, the toolbar will be scrollable * * @ingroup Toolbar */ EAPI void -elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode) +elm_toolbar_scrollable_set(Evas_Object *obj, Eina_Bool scrollable) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - Eina_Bool bounce; if (!wd) return; - wd->shrink_mode = shrink_mode; - bounce = (_elm_config->thumbscroll_bounce_enable) && - (shrink_mode == ELM_TOOLBAR_SHRINK_SCROLL); - elm_smart_scroller_bounce_allow_set(wd->scr, bounce, EINA_FALSE); - - if (wd->more_item) - { - _item_del(wd->more_item); - wd->more_item = NULL; - } - - if (shrink_mode == ELM_TOOLBAR_SHRINK_MENU) - { - elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF, ELM_SMART_SCROLLER_POLICY_OFF); - - wd->more_item = _item_new(obj, "more_menu", "More", - NULL, NULL); - } - else if (shrink_mode == ELM_TOOLBAR_SHRINK_HIDE) - elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_OFF, - ELM_SMART_SCROLLER_POLICY_OFF); - else - elm_smart_scroller_policy_set(wd->scr, ELM_SMART_SCROLLER_POLICY_AUTO, - ELM_SMART_SCROLLER_POLICY_OFF); + wd->scrollable = scrollable; + elm_smart_scroller_bounce_allow_set(wd->scr, wd->scrollable, 0); _sizing_eval(obj); } /** - * Get the shrink mode of toolbar @p obj. + * Get the scrollable state of toolbar @p obj. * * @param obj The toolbar object - * @return See elm_toolbar_mode_shrink_set. + * @return If true, the toolbar is scrollable * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Shrink_Mode -elm_toolbar_mode_shrink_get(const Evas_Object *obj) +EAPI Eina_Bool +elm_toolbar_scrollable_get(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) ELM_TOOLBAR_SHRINK_NONE; + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_TOOLBAR_SHRINK_NONE; - return wd->shrink_mode; + if (!wd) return EINA_FALSE; + return wd->scrollable; } /** @@ -1755,7 +693,7 @@ elm_toolbar_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) * @ingroup Toolbar */ EAPI Eina_Bool -elm_toolbar_homogenous_get(const Evas_Object *obj) +elm_toolbar_homogenous_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); @@ -1775,20 +713,18 @@ elm_toolbar_homogenous_get(const Evas_Object *obj) EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent) { + Eina_List *l; Elm_Toolbar_Item *it; ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - EINA_SAFETY_ON_NULL_RETURN(parent); + if ((!wd) || (!parent)) return; wd->menu_parent = parent; - EINA_INLIST_FOREACH(wd->items, it) + EINA_LIST_FOREACH(wd->items, l, it) { if (it->o_menu) elm_menu_parent_set(it->o_menu, wd->menu_parent); } - if ((wd->more_item) && (wd->more_item->o_menu)) - elm_menu_parent_set(wd->more_item->o_menu, wd->menu_parent); } /** @@ -1800,16 +736,58 @@ elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent) * @ingroup Toolbar */ EAPI Evas_Object * -elm_toolbar_menu_parent_get(const Evas_Object *obj) +elm_toolbar_menu_parent_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; + return wd->menu_parent; } /** + * Unselect all of the items in the toolbar. + * + * @param obj The toolbar object + * + * @ingroup Toolbar + */ +EAPI void +elm_toolbar_item_unselect_all(Evas_Object *obj) +{ + Eina_List *l; + Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + + if (!wd) return; + EINA_LIST_FOREACH(wd->items, l, it) + { + if (it->selected) + { + it->selected = EINA_FALSE; + edje_object_signal_emit(it->base, "elm,state,unselected", "elm"); + break; + } + } +} + +/** + * Unselect the specified toolbar item. + * + * @param item The toolbar item + * + * @ingroup Toolbar + */ +EAPI void +elm_toolbar_item_unselect(Elm_Toolbar_Item *item) +{ + if ((!item) || (!item->selected)) return; + item->selected = EINA_FALSE; + edje_object_signal_emit(item->base, "elm,state,unselected", "elm"); +} + +/** * Set the alignment of the items. * * @param obj The toolbar object @@ -1858,393 +836,258 @@ elm_toolbar_align_get(const Evas_Object *obj) EAPI void elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - Widget_Data *wd = elm_widget_data_get(item->base.widget); - if (!wd) return; + if(!item) return; + Widget_Data *wd = elm_widget_data_get(item->obj); + if (!wd) return; if (item->menu == menu) return; item->menu = menu; - if (menu) _item_menu_create(wd, item); - else _item_menu_destroy(item); -} - -/** - * Set the text to be shown in the toolbar item. - * - * @param item Target item - * @param text The text to set in the content - * - * Setup the text as tooltip to object. The item can have only one tooltip, - * so any previous tooltip data is removed. - * - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_tooltip_text_set(Elm_Toolbar_Item *item, const char *text) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_text_set(item, text); + if (menu) + { + item->o_menu = elm_menu_add(item->base); + if (wd->menu_parent) + elm_menu_parent_set(item->o_menu, wd->menu_parent); + evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_HIDE, + _menu_hide, item); + evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_DEL, + _menu_del, item); + } + else if (item->o_menu) + { + evas_object_del(item->o_menu); + } } -/** - * Set the content to be shown in the tooltip item - * - * Setup the tooltip to item. The item can have only one tooltip, - * so any previous tooltip data is removed. @p func(with @p data) will - * be called every time that need show the tooltip and it should - * return a valid Evas_Object. This object is then managed fully by - * tooltip system and is deleted when the tooltip is gone. - * - * @param item the toolbar item being attached a tooltip. - * @param func the function used to create the tooltip contents. - * @param data what to provide to @a func as callback data/context. - * @param del_cb called when data is not needed anymore, either when - * another callback replaces @func, the tooltip is unset with - * elm_toolbar_item_tooltip_unset() or the owner @a item - * dies. This callback receives as the first parameter the - * given @a data, and @c event_info is the item. - * - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_tooltip_content_cb_set(Elm_Toolbar_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb); -} /** - * Unset tooltip from item - * - * @param item toolbar item to remove previously set tooltip. - * - * Remove tooltip from item. The callback provided as del_cb to - * elm_toolbar_item_tooltip_content_cb_set() will be called to notify - * it is not used anymore. + * Get whether the toolbar item opens a menu. * - * @see elm_toolbar_item_tooltip_content_cb_set() + * @param item The toolbar item + * @return If true, @p item opens a menu when selected * * @ingroup Toolbar */ -EAPI void -elm_toolbar_item_tooltip_unset(Elm_Toolbar_Item *item) +EAPI Evas_Object * +elm_toolbar_item_menu_get(Elm_Toolbar_Item *item) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_unset(item); + if (!item) return NULL; + Widget_Data *wd = elm_widget_data_get(item->obj); + if (!wd) return NULL; + elm_toolbar_item_menu_set(item, 1); + return item->o_menu; } /** - * Sets a different style for this item tooltip. + * Return a list of all toolbar items. * - * @note before you set a style you should define a tooltip with - * elm_toolbar_item_tooltip_content_cb_set() or - * elm_toolbar_item_tooltip_text_set() + * @param obj The toolbar object * - * @param item toolbar item with tooltip already set. - * @param style the theme style to use (default, transparent, ...) + * @return An Eina_List* of the toolbar items in @p obj * * @ingroup Toolbar */ -EAPI void -elm_toolbar_item_tooltip_style_set(Elm_Toolbar_Item *item, const char *style) +EAPI Eina_List * +elm_toolbar_item_get_all(Evas_Object *obj) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_tooltip_style_set(item, style); -} + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; -/** - * Get the style for this item tooltip. - * - * @param item toolbar item with tooltip already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a tooltip set, then NULL is returned. - * - * @ingroup Toolbar - */ -EAPI const char * -elm_toolbar_item_tooltip_style_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_tooltip_style_get(item); + return wd->items; } /** - * Set the cursor to be shown when mouse is over the toolbar item - * - * @param item Target item - * @param cursor the cursor name to be used. + * Return the first toolbar item in the list of toolbar items. * - * @see elm_object_cursor_set() - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_cursor_set(Elm_Toolbar_Item *item, const char *cursor) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_cursor_set(item, cursor); -} - -/** - * Get the cursor to be shown when mouse is over the toolbar item + * @param obj The toolbar object * - * @param item toolbar item with cursor already set. - * @return the cursor name. + * @return The first toolbar item, or NULL on failure * * @ingroup Toolbar */ -EAPI const char * -elm_toolbar_item_cursor_get(const Elm_Toolbar_Item *item) +EAPI Elm_Toolbar_Item * +elm_toolbar_item_get_first(Evas_Object *obj) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_cursor_get(item); -} + Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + if (!(it = eina_list_data_get(wd->items))) return NULL; -/** - * Unset the cursor to be shown when mouse is over the toolbar item - * - * @param item Target item - * - * @see elm_object_cursor_unset() - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_cursor_unset(Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_cursor_unset(item); + return it; } /** - * Sets a different style for this item cursor. + * Return the last toolbar item in the list of toolbar items. * - * @note before you set a style you should define a cursor with - * elm_toolbar_item_cursor_set() + * @param obj The toolbar object * - * @param item toolbar item with cursor already set. - * @param style the theme style to use (default, transparent, ...) + * @return The last toolbar item, or NULL on failure * * @ingroup Toolbar */ -EAPI void -elm_toolbar_item_cursor_style_set(Elm_Toolbar_Item *item, const char *style) +EAPI Elm_Toolbar_Item * +elm_toolbar_item_get_last(Evas_Object *obj) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_cursor_style_set(item, style); -} + Eina_List *last; + Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + if (!(last = eina_list_last(wd->items))) return NULL; + it = eina_list_data_get(last); -/** - * Get the style for this item cursor. - * - * @param item toolbar item with cursor already set. - * @return style the theme style in use, defaults to "default". If the - * object does not have a cursor set, then NULL is returned. - * - * @ingroup Toolbar - */ -EAPI const char * -elm_toolbar_item_cursor_style_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_cursor_style_get(item); + return it; } /** - * Set if the cursor set should be searched on the theme or should use - * the provided by the engine, only. - * - * @note before you set if should look on theme you should define a cursor - * with elm_object_cursor_set(). By default it will only look for cursors - * provided by the engine. + * Return the next toolbar item (relative to the currently selected + * toolbar item) in the list of toolbar items. * - * @param item widget item with cursor already set. - * @param engine_only boolean to define it cursors should be looked only - * between the provided by the engine or searched on widget's theme as well. - * - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_item_cursor_engine_only_set(Elm_Toolbar_Item *item, Eina_Bool engine_only) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_cursor_engine_only_set(item, engine_only); -} - -/** - * Get the cursor engine only usage for this item cursor. + * @param obj The toolbar object * - * @param item widget item with cursor already set. - * @return engine_only boolean to define it cursors should be looked only - * between the provided by the engine or searched on widget's theme as well. If - * the object does not have a cursor set, then EINA_FALSE is returned. + * @return The next toolbar item, or NULL on failure * * @ingroup Toolbar */ -EAPI Eina_Bool -elm_toolbar_item_cursor_engine_only_get(const Elm_Toolbar_Item *item) +EAPI Elm_Toolbar_Item * +elm_toolbar_item_get_next(Evas_Object *obj) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); - return elm_widget_item_cursor_engine_only_get(item); -} + Eina_List *l, *l2; + Elm_Toolbar_Item *it, *next; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); -/** - * Get whether the toolbar item opens a menu. - * - * @param item The toolbar item - * @return If true, @p item opens a menu when selected - * - * @ingroup Toolbar - */ -EAPI Evas_Object * -elm_toolbar_item_menu_get(Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - Widget_Data *wd = elm_widget_data_get(item->base.widget); if (!wd) return NULL; - /* FIXME: It's not ok. This function needs to be reviewed. And should - * receive a const item */ - elm_toolbar_item_menu_set(item, 1); - return item->o_menu; + EINA_LIST_FOREACH_SAFE(wd->items, l, l2, it) + { + if (it->selected) + { + if (!(next = eina_list_data_get(l2))) return NULL; + return next; + } + } + return NULL; } /** - * Returns a pointer to a toolbar item by its label + * Selects the next non-disabled, non-separator toolbar item in the list + * of toolbar items. * * @param obj The toolbar object - * @param label The label of the item to find * - * @return The pointer to the toolbar item matching @p label - * Returns NULL on failure. + * @return The newly selected toolbar item, or NULL on failure * * @ingroup Toolbar */ EAPI Elm_Toolbar_Item * -elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label) +elm_toolbar_item_select_next(Evas_Object *obj) { - Elm_Toolbar_Item *it; + Eina_List *l, *l2; + Elm_Toolbar_Item *it, *next; ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - EINA_INLIST_FOREACH(wd->items, it) + EINA_LIST_FOREACH(wd->items, l, it) { - if (!strcmp(it->label, label)) return it; + if (it->selected) + { + EINA_LIST_FOREACH(l, l2, next) + if ((!next->disabled) && (next->separator)) + { + _item_select(next); + return next; + } + } } - - return NULL; + return NULL; } /** - * Set the data item from the toolbar item + * Selects the first non-disabled, non-separator toolbar item in the list + * of toolbar items. * - * This set the data value passed on the elm_toolbar_item_append() and - * related item addition calls. + * @param obj The toolbar object * - * @param item The item - * @param data The new data pointer to set + * @return The newly selected toolbar item, or NULL on failure * * @ingroup Toolbar */ -EAPI void -elm_toolbar_item_data_set(Elm_Toolbar_Item *item, const void *data) +EAPI Elm_Toolbar_Item * +elm_toolbar_item_select_first(Evas_Object *obj) { - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); - elm_widget_item_data_set(item, data); -} + Eina_List *l; + Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + EINA_LIST_FOREACH(wd->items, l, it) + { + if ((!it->disabled) && (!it->separator)) + { + _item_select(it); + return it; + } + } -/** - * Get the data item from the toolbar item - * - * This returns the data value passed on the elm_toolbar_item_append() and - * related item addition calls. - * - * @param item The item - * @return The data pointer provided when created - * - * @ingroup Toolbar - */ -EAPI void * -elm_toolbar_item_data_get(const Elm_Toolbar_Item *item) -{ - ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); - return elm_widget_item_data_get(item); + return NULL; } /** - * Set no select mode. - * - * This will turn off the ability to select items entirely and they will - * neither appear selected nor emit selected signals. The clicked - * callback function will still be called. + * Selects the last non-disabled, non-separator toolbar item in the list + * of toolbar items. * - * @param obj The Toolbar object - * @param no_select The no select mode (EINA_TRUE = on, EINA_FALSE = off) - * - * @ingroup Toolbar - */ -EAPI void -elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select) -{ - ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - wd->no_select = no_select; -} - -/** - * Gets no select mode. + * @param obj The toolbar object * - * @param obj The Toolbar object - * @return The no select mode (EINA_TRUE = on, EINA_FALSE = off) + * @return The newly selected toolbar item, or NULL on failure * * @ingroup Toolbar */ -EAPI Eina_Bool -elm_toolbar_no_select_mode_get(const Evas_Object *obj) +EAPI Elm_Toolbar_Item * +elm_toolbar_item_select_last(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Eina_List *l; + Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->no_select; + if (!wd) return NULL; + EINA_LIST_REVERSE_FOREACH(wd->items, l, it) + { + if ((!it->disabled) && (!it->separator)) + { + _item_select(it); + return it; + } + } + + return NULL; } /** - * Sets icon lookup order, for icons used in this toolbar. - * Icons added before calling this function will not be affected. - * The default lookup order is ELM_ICON_LOOKUP_THEME_FDO. + * Returns a pointer to a toolbar item by its label * * @param obj The toolbar object - * @param order The icon lookup order + * @param label The label of the item to find + * + * @return The pointer to the toolbar item matching @p label + * Returns NULL on failure. * * @ingroup Toolbar */ -EAPI void -elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order) +EAPI Elm_Toolbar_Item * +elm_toolbar_item_find_by_label(Evas_Object *obj, const char *label) { - ELM_CHECK_WIDTYPE(obj, widtype); + Eina_List *l; Elm_Toolbar_Item *it; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - - wd->lookup_order = order; - EINA_INLIST_FOREACH(wd->items, it) - elm_icon_order_lookup_set(it->icon, order); - if (wd->more_item) - elm_icon_order_lookup_set(wd->more_item->icon, order); -} + + if (!wd) return NULL; + EINA_LIST_FOREACH(wd->items, l, it) + { + if (!strcmp(it->label, label)) return it; + } -/** - * Gets the icon lookup order. - * - * @param obj The Toolbar object - * @return The icon lookup order - * - * @ingroup Toolbar - */ -EAPI Elm_Icon_Lookup_Order -elm_toolbar_icon_order_lookup_get(const Evas_Object *obj) -{ - ELM_CHECK_WIDTYPE(obj, widtype) ELM_ICON_LOOKUP_THEME_FDO; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_ICON_LOOKUP_THEME_FDO; - return wd->lookup_order; + return NULL; } diff --git a/src/lib/els_box.c b/src/lib/els_box.c index e0fed0e..6c824ad 100644 --- a/src/lib/els_box.c +++ b/src/lib/els_box.c @@ -4,140 +4,142 @@ static void _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horizontal, int homogeneous, int extended) { - Evas_Coord minw, minh, maxw, maxh, mnw, mnh, ww; - Evas_Coord w, cw = 0, cmaxh = 0; - const Eina_List *l; - Evas_Object_Box_Option *opt; - double wx; - - /* FIXME: need to calc max */ - minw = 0; - minh = 0; - maxw = -1; - maxh = -1; - - if (homogeneous) - { - EINA_LIST_FOREACH(priv->children, l, opt) - { - evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); - if (minh < mnh) minh = mnh; - if (minw < mnw) minw = mnw; - } - if (horizontal) - minw *= eina_list_count(priv->children); + Evas_Coord minw, minh, maxw, maxh, mnw, mnh, ww; + Evas_Coord w, cw = 0, cmaxh = 0; + const Eina_List *l; + Evas_Object_Box_Option *opt; + double wx; + + /* FIXME: need to calc max */ + minw = 0; + minh = 0; + maxw = -1; + maxh = -1; + + if (homogeneous) + { + EINA_LIST_FOREACH(priv->children, l, opt) + { + evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); + if (minh < mnh) minh = mnh; + if (minw < mnw) minw = mnw; + } + if (horizontal) + minw *= eina_list_count(priv->children); + else + minh *= eina_list_count(priv->children); + } else - minh *= eina_list_count(priv->children); - } - else - { - if (horizontal && extended) - { - evas_object_geometry_get(box, NULL, NULL, &w, NULL); - evas_object_size_hint_min_get(box, &minw, NULL); - } - - EINA_LIST_FOREACH(priv->children, l, opt) - { - evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); - - if (horizontal) - { - if (extended) - { - evas_object_size_hint_weight_get(opt->obj, &wx, NULL); - - if(wx) - { - if (mnw != -1 && (w - cw) >= mnw) - ww = w - cw; - else - ww = w; - } - else - ww = mnw; - - if ((cw + mnw) > w) - { - minh += cmaxh; - - cw = 0; - cmaxh = 0; - } - cw += ww; - if (cmaxh < mnh) cmaxh = mnh; - } - else - { - if (minh < mnh) minh = mnh; - minw += mnw; - } - } - else - { - if (minw < mnw) minw = mnw; - minh += mnh; - } - } - - if(horizontal && extended) - { - minh += cmaxh; - } - - } - evas_object_size_hint_min_set(box, minw, minh); + { + if (horizontal && extended) + { + evas_object_geometry_get(box, NULL, NULL, &w, NULL); + evas_object_size_hint_min_get(box, &minw, NULL); + } + + EINA_LIST_FOREACH(priv->children, l, opt) + { + evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); + + if (horizontal) + { + if (extended) + { + evas_object_size_hint_weight_get(opt->obj, &wx, NULL); + + if(wx) + { + if (mnw != -1 && (w - cw) >= mnw) + ww = w - cw; + else + ww = w; + } + else + ww = mnw; + + if ((cw + mnw) > w) + { + minh += cmaxh; + + cw = 0; + cmaxh = 0; + } + cw += ww; + if (cmaxh < mnh) cmaxh = mnh; + } + else + { + if (minh < mnh) minh = mnh; + minw += mnw; + } + } + else + { + if (minw < mnw) minw = mnw; + minh += mnh; + } + } + + if(horizontal && extended) + { + minh += cmaxh; + } + + } + evas_object_size_hint_min_set(box, minw, minh); } + static Evas_Coord _smart_extents_calculate_max_height(Evas_Object *box, Evas_Object_Box_Data *priv, int obj_index) { - Evas_Coord mnw, mnh, cw = 0, cmaxh = 0, w, ww; - const Eina_List *l; - Evas_Object_Box_Option *opt; - int index = 0; - double wx; - - evas_object_geometry_get(box, NULL, NULL, &w, NULL); + Evas_Coord mnw, mnh, cw = 0, cmaxh = 0, w, ww; + const Eina_List *l; + Evas_Object_Box_Option *opt; + int index = 0; + double wx; - EINA_LIST_FOREACH(priv->children, l, opt) - { - evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); - evas_object_size_hint_weight_get(opt->obj, &wx, NULL); - - if(wx) - { - if (mnw != -1 && (w - cw) >= mnw) - ww = w - cw; - else - ww = w; - } - else - ww = mnw; - - if ((cw + ww) > w) - { - if (index > obj_index ) - { - return cmaxh; - } - cw = 0; - cmaxh = 0; - } - - cw += ww; - if (cmaxh < mnh) cmaxh = mnh; - - index++; - } + evas_object_geometry_get(box, NULL, NULL, &w, NULL); - return cmaxh; + EINA_LIST_FOREACH(priv->children, l, opt) + { + evas_object_size_hint_min_get(opt->obj, &mnw, &mnh); + evas_object_size_hint_weight_get(opt->obj, &wx, NULL); + + if(wx) + { + if (mnw != -1 && (w - cw) >= mnw) + ww = w - cw; + else + ww = w; + } + else + ww = mnw; + + if ((cw + ww) > w) + { + if (index > obj_index ) + { + return cmaxh; + } + cw = 0; + cmaxh = 0; + } + + cw += ww; + if (cmaxh < mnh) cmaxh = mnh; + + index++; + } + + return cmaxh; } + void _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous) { - _els_box_layout_ex(o, priv, horizontal, homogeneous, 0); + _els_box_layout_ex(o, priv, horizontal, homogeneous, 0); } void @@ -182,7 +184,7 @@ _els_box_layout_ex(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, i if (wy > 0.0) expand++; } } - if ((!expand) && (!extended)) + if (expand == 0 && (!extended)) { evas_object_size_hint_align_get(o, &ax, &ay); if (horizontal) @@ -244,70 +246,70 @@ _els_box_layout_ex(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, i } else { - if (extended) - { - Evas_Coord ww, hh, ow, oh; - if(wx) - { - if (mnw != -1 && (w - cw) >= mnw) - ww = w - cw; - else - ww = w; - } - else - ww = mnw; - hh = _smart_extents_calculate_max_height(o, priv, obj_index); - - ow = mnw; - if (fw) ow = ww; - if ((mxw >= 0) && (mxw < ow)) ow = mxw; - oh = mnh; - if (fh) oh = hh; - if ((mxh >= 0) && (mxh < oh)) oh = mxh; - - if ((cw + ww) > w) - { - ch += cmaxh; - - cw = 0; - cmaxh = 0; - } - - evas_object_move(obj, - xx + cw + (Evas_Coord)(((double)(ww - ow)) * ax), - yy + ch + (Evas_Coord)(((double)(hh - oh)) * ay)); - evas_object_resize(obj, ow, oh); - - cw += ww; - if (cmaxh < hh) cmaxh = hh; - } - else - { - Evas_Coord ww, hh, ow, oh; - - ww = mnw; - if ((expand > 0) && (xw)) - { - if (expand == 1) ow = wdif; - else ow = (w - minw) / expand; - wdif -= ow; - ww += ow; - } - hh = h; - ow = mnw; - if (fw) ow = ww; - if ((mxw >= 0) && (mxw < ow)) ow = mxw; - oh = mnh; - if (fh) oh = hh; - if ((mxh >= 0) && (mxh < oh)) oh = mxh; - evas_object_move(obj, - xx + (Evas_Coord)(((double)(ww - ow)) * ax), - yy + (Evas_Coord)(((double)(hh - oh)) * ay)); - evas_object_resize(obj, ow, oh); - xx += ww; - } - } - } + if (extended) + { + Evas_Coord ww, hh, ow, oh; + if(wx) + { + if (mnw != -1 && (w - cw) >= mnw) + ww = w - cw; + else + ww = w; + } + else + ww = mnw; + hh = _smart_extents_calculate_max_height(o, priv, obj_index); + + ow = mnw; + if (fw) ow = ww; + if ((mxw >= 0) && (mxw < ow)) ow = mxw; + oh = mnh; + if (fh) oh = hh; + if ((mxh >= 0) && (mxh < oh)) oh = mxh; + + if ((cw + ww) > w) + { + ch += cmaxh; + + cw = 0; + cmaxh = 0; + } + + evas_object_move(obj, + xx + cw + (Evas_Coord)(((double)(ww - ow)) * ax), + yy + ch + (Evas_Coord)(((double)(hh - oh)) * ay)); + evas_object_resize(obj, ow, oh); + + cw += ww; + if (cmaxh < hh) cmaxh = hh; + } + else + { + Evas_Coord ww, hh, ow, oh; + + ww = mnw; + if ((expand > 0) && (xw)) + { + if (expand == 1) ow = wdif; + else ow = (w - minw) / expand; + wdif -= ow; + ww += ow; + } + hh = h; + ow = mnw; + if (fw) ow = ww; + if ((mxw >= 0) && (mxw < ow)) ow = mxw; + oh = mnh; + if (fh) oh = hh; + if ((mxh >= 0) && (mxh < oh)) oh = mxh; + evas_object_move(obj, + xx + (Evas_Coord)(((double)(ww - ow)) * ax), + yy + (Evas_Coord)(((double)(hh - oh)) * ay)); + evas_object_resize(obj, ow, oh); + xx += ww; + } + } + } else { if (homogeneous) @@ -355,7 +357,7 @@ _els_box_layout_ex(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, i } } - obj_index++; + obj_index++; } } diff --git a/src/lib/els_box.h b/src/lib/els_box.h index e394884..9cf025b 100644 --- a/src/lib/els_box.h +++ b/src/lib/els_box.h @@ -1 +1,2 @@ void _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous); +void _els_box_layout_ex(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous, int extended); diff --git a/src/lib/els_icon.c b/src/lib/els_icon.c index daa0373..43a22bd 100644 --- a/src/lib/els_icon.c +++ b/src/lib/els_icon.c @@ -9,14 +9,12 @@ struct _Smart_Data Evas_Object *obj; int size; double scale; - Eina_Bool fill_inside : 1; - Eina_Bool scale_up : 1; - Eina_Bool scale_down : 1; - Eina_Bool preloading : 1; - Eina_Bool show : 1; - Eina_Bool edit : 1; - Eina_Bool edje : 1; - Elm_Image_Orient orient; + unsigned char fill_inside : 1; + unsigned char scale_up : 1; + unsigned char scale_down : 1; + unsigned char preloading : 1; + unsigned char show : 1; + unsigned char edit : 1; }; /* local subsystem functions */ @@ -48,46 +46,23 @@ _els_smart_icon_add(Evas *evas) return evas_object_smart_add(evas, _e_smart); } -static void -_preloaded(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) -{ - Smart_Data *sd = data; - - sd->preloading = EINA_FALSE; - if (sd->show) - evas_object_show(sd->obj); -} - Eina_Bool _els_smart_icon_file_key_set(Evas_Object *obj, const char *file, const char *key) { Smart_Data *sd; - Evas_Object *pclip; sd = evas_object_smart_data_get(obj); if (!sd) return EINA_FALSE; /* smart code here */ - if (sd->edje) - { - pclip = evas_object_clip_get(sd->obj); - if (sd->obj) evas_object_del(sd->obj); - sd->obj = evas_object_image_add(evas_object_evas_get(obj)); - evas_object_image_scale_hint_set(sd->obj, EVAS_IMAGE_SCALE_HINT_STATIC); - evas_object_smart_member_add(sd->obj, obj); - evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_IMAGE_PRELOADED, - _preloaded, sd); - evas_object_clip_set(sd->obj, pclip); - sd->edje = EINA_FALSE; - } - if (!sd->size) + if (sd->size != 0) evas_object_image_load_size_set(sd->obj, sd->size, sd->size); evas_object_image_file_set(sd->obj, file, key); /* by default preload off by seok.j.jeong */ - sd->preloading = EINA_FALSE; - sd->show = EINA_TRUE; + sd->preloading = 0; + sd->show = 1; if (sd->preloading) evas_object_image_preload(sd->obj, EINA_FALSE); - if (sd->preloading) + if (sd->preloading) evas_object_hide(sd->obj); if (evas_object_image_load_error_get(sd->obj) != EVAS_LOAD_ERROR_NONE) return EINA_FALSE; @@ -99,21 +74,13 @@ Eina_Bool _els_smart_icon_file_edje_set(Evas_Object *obj, const char *file, const char *part) { Smart_Data *sd; - Evas_Object *pclip; sd = evas_object_smart_data_get(obj); if (!sd) return EINA_FALSE; /* smart code here */ - if (!sd->edje) - { - pclip = evas_object_clip_get(sd->obj); - if (sd->obj) evas_object_del(sd->obj); - sd->obj = edje_object_add(evas_object_evas_get(obj)); - evas_object_smart_member_add(sd->obj, obj); - if (sd->show) evas_object_show(sd->obj); - evas_object_clip_set(sd->obj, pclip); - } - sd->edje = EINA_TRUE; + if (sd->obj) evas_object_del(sd->obj); + sd->obj = edje_object_add(evas_object_evas_get(obj)); + evas_object_smart_member_add(sd->obj, obj); if (!edje_object_file_set(sd->obj, file, part)) return EINA_FALSE; _smart_reconfigure(sd); @@ -121,46 +88,29 @@ _els_smart_icon_file_edje_set(Evas_Object *obj, const char *file, const char *pa } void -_els_smart_icon_file_get(const Evas_Object *obj, const char **file, const char **key) +_els_smart_icon_smooth_scale_set(Evas_Object *obj, int smooth) { - Smart_Data *sd = evas_object_smart_data_get(obj); - if (!sd) return; - if (sd->edje) - edje_object_file_get(sd->obj, file, key); - else - evas_object_image_file_get(sd->obj, file, key); -} + Smart_Data *sd; -void -_els_smart_icon_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth) -{ - Smart_Data *sd = evas_object_smart_data_get(obj); + sd = evas_object_smart_data_get(obj); if (!sd) return; - if (sd->edje) + if (!strcmp(evas_object_type_get(sd->obj), "edje")) return; evas_object_image_smooth_scale_set(sd->obj, smooth); } -Eina_Bool -_els_smart_icon_smooth_scale_get(const Evas_Object *obj) -{ - Smart_Data *sd = evas_object_smart_data_get(obj); - if (!sd) return EINA_FALSE; - if (sd->edje) - return EINA_FALSE; - return evas_object_image_smooth_scale_get(sd->obj); -} - Evas_Object * -_els_smart_icon_object_get(const Evas_Object *obj) +_els_smart_icon_object_get(Evas_Object *obj) { - Smart_Data *sd = evas_object_smart_data_get(obj); + Smart_Data *sd; + + sd = evas_object_smart_data_get(obj); if (!sd) return NULL; return sd->obj; } void -_els_smart_icon_size_get(const Evas_Object *obj, int *w, int *h) +_els_smart_icon_size_get(Evas_Object *obj, int *w, int *h) { Smart_Data *sd; int tw, th; @@ -178,7 +128,7 @@ _els_smart_icon_size_get(const Evas_Object *obj, int *w, int *h) } void -_els_smart_icon_fill_inside_set(Evas_Object *obj, Eina_Bool fill_inside) +_els_smart_icon_fill_inside_set(Evas_Object *obj, int fill_inside) { Smart_Data *sd; @@ -190,16 +140,8 @@ _els_smart_icon_fill_inside_set(Evas_Object *obj, Eina_Bool fill_inside) _smart_reconfigure(sd); } -Eina_Bool -_els_smart_icon_fill_inside_get(const Evas_Object *obj) -{ - Smart_Data *sd = evas_object_smart_data_get(obj); - if (!sd) return EINA_FALSE; - return sd->fill_inside; -} - void -_els_smart_icon_scale_up_set(Evas_Object *obj, Eina_Bool scale_up) +_els_smart_icon_scale_up_set(Evas_Object *obj, int scale_up) { Smart_Data *sd; @@ -211,16 +153,8 @@ _els_smart_icon_scale_up_set(Evas_Object *obj, Eina_Bool scale_up) _smart_reconfigure(sd); } -Eina_Bool -_els_smart_icon_scale_up_get(const Evas_Object *obj) -{ - Smart_Data *sd; sd = evas_object_smart_data_get(obj); - if (!sd) return EINA_FALSE; - return sd->scale_up; -} - void -_els_smart_icon_scale_down_set(Evas_Object *obj, Eina_Bool scale_down) +_els_smart_icon_scale_down_set(Evas_Object *obj, int scale_down) { Smart_Data *sd; @@ -232,14 +166,6 @@ _els_smart_icon_scale_down_set(Evas_Object *obj, Eina_Bool scale_down) _smart_reconfigure(sd); } -Eina_Bool -_els_smart_icon_scale_down_get(const Evas_Object *obj) -{ - Smart_Data *sd; sd = evas_object_smart_data_get(obj); - if (!sd) return EINA_FALSE; - return sd->scale_up; -} - void _els_smart_icon_scale_size_set(Evas_Object *obj, int size) { @@ -249,36 +175,22 @@ _els_smart_icon_scale_size_set(Evas_Object *obj, int size) if (!sd) return; sd->size = size; if (!sd->obj) return; - if (sd->edje) + if (!strcmp(evas_object_type_get(sd->obj), "edje")) return; evas_object_image_load_size_set(sd->obj, sd->size, sd->size); } -int -_els_smart_icon_scale_size_get(const Evas_Object *obj) -{ - Smart_Data *sd; sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - return sd->size; -} - void _els_smart_icon_scale_set(Evas_Object *obj, double scale) { - Smart_Data *sd = evas_object_smart_data_get(obj); + Smart_Data *sd; + + sd = evas_object_smart_data_get(obj); if (!sd) return; sd->scale = scale; _smart_reconfigure(sd); } -double -_els_smart_icon_scale_get(const Evas_Object *obj) -{ - Smart_Data *sd; sd = evas_object_smart_data_get(obj); - if (!sd) return 0.0; - return sd->scale; -} - void _els_smart_icon_orient_set(Evas_Object *obj, Elm_Image_Orient orient) { @@ -290,7 +202,7 @@ _els_smart_icon_orient_set(Evas_Object *obj, Elm_Image_Orient orient) sd = evas_object_smart_data_get(obj); if (!sd) return; - if (sd->edje) + if (!strcmp(evas_object_type_get(sd->obj), "edje")) return; switch (orient) @@ -304,15 +216,15 @@ _els_smart_icon_orient_set(Evas_Object *obj, Elm_Image_Orient orient) case ELM_IMAGE_ROTATE_180_CW: _els_smart_icon_rotate_180(sd); return; - default: - break; + //default: + //return; } evas_object_image_size_get(sd->obj, &iw, &ih); evas_object_image_file_get(sd->obj, &file, &key); tmp = evas_object_image_add(evas_object_evas_get(sd->obj)); evas_object_image_file_set(tmp, file, key); - data2 = evas_object_image_data_get(tmp, EINA_FALSE); + data2 = evas_object_image_data_get(tmp, 0); w = ih; ih = iw; @@ -320,7 +232,7 @@ _els_smart_icon_orient_set(Evas_Object *obj, Elm_Image_Orient orient) hw = w * ih; evas_object_image_size_set(sd->obj, iw, ih); - data = evas_object_image_data_get(sd->obj, EINA_TRUE); + data = evas_object_image_data_get(sd->obj, 1); switch (orient) { case ELM_IMAGE_FLIP_TRANSPOSE: @@ -358,63 +270,45 @@ _els_smart_icon_orient_set(Evas_Object *obj, Elm_Image_Orient orient) } to += hw; } - sd->orient = orient; evas_object_del(tmp); evas_object_image_data_set(sd->obj, data); evas_object_image_data_update_add(sd->obj, 0, 0, iw, ih); _smart_reconfigure(sd); } -Elm_Image_Orient -_els_smart_icon_orient_get(const Evas_Object *obj) -{ - Smart_Data *sd; sd = evas_object_smart_data_get(obj); - if (!sd) return 0; - return sd->orient; -} - /** * Turns on editing through drag and drop and copy and paste. */ void _els_smart_icon_edit_set(Evas_Object *obj, Eina_Bool edit, Evas_Object *parent) { - Smart_Data *sd = evas_object_smart_data_get(obj); + Smart_Data *sd; + + sd = evas_object_smart_data_get(obj); if (!sd) return; - if (sd->edje) + if (strcmp(evas_object_type_get(sd->obj), "edje")== 0) { printf("No editing edje objects yet (ever)\n"); return; } /* Unfortunately eina bool is not a bool, but a char */ + edit = !!edit; if (edit == sd->edit) return; sd->edit = edit; if (sd->edit) - elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE, _els_smart_icon_dropcb, - parent); + { + elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE, _els_smart_icon_dropcb, + parent); + } else - elm_drop_target_del(obj); -} - -Eina_Bool -_els_smart_icon_edit_get(const Evas_Object *obj) -{ - Smart_Data *sd; sd = evas_object_smart_data_get(obj); - if (!sd) return EINA_FALSE; - return sd->edit; -} + { + elm_drop_target_del(obj); + } -Evas_Object * -_els_smart_icon_edje_get(Evas_Object *obj) -{ - Smart_Data *sd = evas_object_smart_data_get(obj); - if (!sd) return NULL; - if (!sd->edje) return NULL; - return sd->obj; } /* local subsystem globals */ @@ -490,6 +384,16 @@ _smart_reconfigure(Smart_Data *sd) } static void +_preloaded(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) +{ + Smart_Data *sd = data; + + sd->preloading = 0; + if (sd->show) + evas_object_show(sd->obj); +} + +static void _smart_init(void) { if (_e_smart) return; @@ -532,14 +436,14 @@ _smart_add(Evas_Object *obj) sd->y = 0; sd->w = 0; sd->h = 0; - sd->fill_inside = EINA_TRUE; - sd->scale_up = EINA_TRUE; - sd->scale_down = EINA_TRUE; + sd->fill_inside = 1; + sd->scale_up = 1; + sd->scale_down = 1; sd->size = 64; sd->scale = 1.0; evas_object_smart_member_add(sd->obj, obj); evas_object_smart_data_set(obj, sd); - evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_IMAGE_PRELOADED, + evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_IMAGE_PRELOADED, _preloaded, sd); } @@ -587,7 +491,7 @@ _smart_show(Evas_Object *obj) sd = evas_object_smart_data_get(obj); if (!sd) return; - sd->show = EINA_TRUE; + sd->show = 1; if (!sd->preloading) evas_object_show(sd->obj); } @@ -599,7 +503,7 @@ _smart_hide(Evas_Object *obj) sd = evas_object_smart_data_get(obj); if (!sd) return; - sd->show = EINA_FALSE; + sd->show = 0; evas_object_hide(sd->obj); } @@ -641,7 +545,7 @@ _els_smart_icon_flip_horizontal(Smart_Data *sd) int x, y, iw, ih; evas_object_image_size_get(sd->obj, &iw, &ih); - data = evas_object_image_data_get(sd->obj, EINA_TRUE); + data = evas_object_image_data_get(sd->obj, 1); for (y = 0; y < ih; y++) { @@ -670,7 +574,7 @@ _els_smart_icon_flip_vertical(Smart_Data *sd) int x, y, iw, ih; evas_object_image_size_get(sd->obj, &iw, &ih); - data = evas_object_image_data_get(sd->obj, EINA_TRUE); + data = evas_object_image_data_get(sd->obj, 1); for (y = 0; y < (ih >> 1); y++) { diff --git a/src/lib/els_icon.h b/src/lib/els_icon.h index f4325c8..567dcbc 100644 --- a/src/lib/els_icon.h +++ b/src/lib/els_icon.h @@ -1,23 +1,14 @@ Evas_Object *_els_smart_icon_add (Evas *evas); Eina_Bool _els_smart_icon_file_key_set (Evas_Object *obj, const char *file, const char *key); Eina_Bool _els_smart_icon_file_edje_set (Evas_Object *obj, const char *file, const char *part); -void _els_smart_icon_file_get (const Evas_Object *obj, const char **file, const char **key); -void _els_smart_icon_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth); -Eina_Bool _els_smart_icon_smooth_scale_get (const Evas_Object *obj); -Evas_Object *_els_smart_icon_object_get (const Evas_Object *obj); -void _els_smart_icon_size_get (const Evas_Object *obj, int *w, int *h); -void _els_smart_icon_fill_inside_set (Evas_Object *obj, Eina_Bool fill_inside); -Eina_Bool _els_smart_icon_fill_inside_get (const Evas_Object *obj); -void _els_smart_icon_scale_up_set (Evas_Object *obj, Eina_Bool scale_up); -Eina_Bool _els_smart_icon_scale_up_get (const Evas_Object *obj); -void _els_smart_icon_scale_down_set (Evas_Object *obj, Eina_Bool scale_down); -Eina_Bool _els_smart_icon_scale_down_get (const Evas_Object *obj); +void _els_smart_icon_smooth_scale_set (Evas_Object *obj, int smooth); +Evas_Object *_els_smart_icon_object_get(Evas_Object *obj); +void _els_smart_icon_size_get (Evas_Object *obj, int *w, int *h); +void _els_smart_icon_fill_inside_set (Evas_Object *obj, int fill_inside); +void _els_smart_icon_scale_up_set (Evas_Object *obj, int scale_up); +void _els_smart_icon_scale_down_set (Evas_Object *obj, int scale_down); void _els_smart_icon_scale_size_set (Evas_Object *obj, int size); -int _els_smart_icon_scale_size_get (const Evas_Object *obj); void _els_smart_icon_scale_set (Evas_Object *obj, double scale); -double _els_smart_icon_scale_get (const Evas_Object *obj); void _els_smart_icon_orient_set (Evas_Object *obj, Elm_Image_Orient orient); -Elm_Image_Orient _els_smart_icon_orient_get (const Evas_Object *obj); + void _els_smart_icon_edit_set (Evas_Object *obj, Eina_Bool, Evas_Object *parent); -Eina_Bool _els_smart_icon_edit_get (const Evas_Object *obj); -Evas_Object *_els_smart_icon_edje_get(Evas_Object *obj); diff --git a/src/lib/els_pan.c b/src/lib/els_pan.c index 436d287..f1982fc 100644 --- a/src/lib/els_pan.c +++ b/src/lib/els_pan.c @@ -123,16 +123,6 @@ _elm_smart_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) } void -_elm_smart_pan_min_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) -{ - API_ENTRY return; - if (x) - *x = 0; - if (y) - *y = 0; -} - -void _elm_smart_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) { API_ENTRY return; diff --git a/src/lib/els_pan.h b/src/lib/els_pan.h index cb64fa1..a2ce00c 100644 --- a/src/lib/els_pan.h +++ b/src/lib/els_pan.h @@ -4,5 +4,4 @@ Evas_Object *_elm_smart_pan_child_get (Evas_Object *obj); void _elm_smart_pan_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y); void _elm_smart_pan_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); void _elm_smart_pan_max_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); -void _elm_smart_pan_min_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); void _elm_smart_pan_child_size_get (Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); diff --git a/src/lib/els_scroller.c b/src/lib/els_scroller.c index c1bdf70..461cc9b 100644 --- a/src/lib/els_scroller.c +++ b/src/lib/els_scroller.c @@ -1,5 +1,6 @@ #include #include "elm_priv.h" +#include "els_pan.h" #define SMART_NAME "els_scroller" #define API_ENTRY Smart_Data *sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME))) @@ -20,7 +21,7 @@ struct _Smart_Data Evas_Object *event_obj; Evas_Object *widget; - + Elm_Smart_Scroller_Policy hbar_flags, vbar_flags; struct { @@ -41,7 +42,6 @@ struct _Smart_Data double anim_start2; double anim_start3; double onhold_vx, onhold_vy, onhold_tlast, onhold_vxe, onhold_vye; - double extra_time; Evas_Coord hold_x, hold_y; Ecore_Animator *hold_animator; Ecore_Animator *onhold_animator; @@ -62,7 +62,7 @@ struct _Smart_Data unsigned char locked : 1; unsigned char bounce_x_hold : 1; unsigned char bounce_y_hold : 1; - unsigned char scroll : 1; + unsigned char scroll : 1; } down; struct { @@ -76,7 +76,6 @@ struct _Smart_Data void (*set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y); void (*get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); void (*max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); - void (*min_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); void (*child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); } pan_func; @@ -90,7 +89,7 @@ struct _Smart_Data double pagerel_h, pagerel_v; Evas_Coord pagesize_h, pagesize_v; - + Eina_Bool one_page :1; unsigned char hbar_visible : 1; unsigned char vbar_visible : 1; unsigned char extern_pan : 1; @@ -101,8 +100,10 @@ struct _Smart_Data unsigned char bouncemey : 1; unsigned char bounce_horiz : 1; unsigned char bounce_vert : 1; - unsigned char momentum_animator_disabled :1; - unsigned char bounce_animator_disabled :1; + Eina_Bool freeze_bounce :1; + + Eina_Bool freeze_momentum_animator :1; + Eina_Bool freeze_bounce_animator :1; }; /* local subsystem functions */ @@ -116,6 +117,7 @@ static Eina_Bool _smart_momentum_animator(void *data); static void _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); static Eina_Bool _smart_onhold_animator(void *data); static void _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _smart_event_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _smart_edje_drag_v_start(void *data, Evas_Object *obj, const char *emission, const char *source); static void _smart_edje_drag_v_stop(void *data, Evas_Object *obj, const char *emission, const char *source); static void _smart_edje_drag_v(void *data, Evas_Object *obj, const char *emission, const char *source); @@ -180,7 +182,6 @@ elm_smart_scroller_child_set(Evas_Object *obj, Evas_Object *child) sd->pan_func.set = _elm_smart_pan_set; sd->pan_func.get = _elm_smart_pan_get; sd->pan_func.max_get = _elm_smart_pan_max_get; - sd->pan_func.min_get = _elm_smart_pan_min_get; sd->pan_func.child_size_get = _elm_smart_pan_child_size_get; evas_object_event_callback_add(child, EVAS_CALLBACK_DEL, _smart_child_del_hook, sd); @@ -194,22 +195,14 @@ elm_smart_scroller_child_set(Evas_Object *obj, Evas_Object *child) void elm_smart_scroller_extern_pan_set(Evas_Object *obj, Evas_Object *pan, - void (*pan_set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), - void (*pan_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), - void (*pan_max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), - void (*pan_min_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), - void (*pan_child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)) + void (*pan_set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), + void (*pan_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), + void (*pan_max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), + void (*pan_child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)) { API_ENTRY return; elm_smart_scroller_child_set(obj, NULL); - - if (sd->pan_obj) - { - evas_object_smart_callback_del(sd->pan_obj, "changed", _smart_pan_changed_hook); - evas_object_smart_callback_del(sd->pan_obj, "pan_changed", _smart_pan_pan_changed_hook); - } - if (sd->extern_pan) { if (sd->pan_obj) @@ -236,7 +229,6 @@ elm_smart_scroller_extern_pan_set(Evas_Object *obj, Evas_Object *pan, sd->pan_func.set = pan_set; sd->pan_func.get = pan_get; sd->pan_func.max_get = pan_max_get; - sd->pan_func.min_get = pan_min_get; sd->pan_func.child_size_get = pan_child_size_get; sd->extern_pan = 1; evas_object_smart_callback_add(sd->pan_obj, "changed", _smart_pan_changed_hook, sd); @@ -270,56 +262,6 @@ elm_smart_scroller_custom_edje_file_set(Evas_Object *obj, char *file, char *grou edje_object_signal_emit(sd->edje_obj, "elm,action,show_notalways,vbar", "elm"); } -Eina_Bool -elm_smart_scroller_momentum_animator_disabled_get(Evas_Object *obj) -{ - API_ENTRY return EINA_FALSE; - return sd->momentum_animator_disabled; -} - -void -elm_smart_scroller_momentum_animator_disabled_set(Evas_Object *obj, Eina_Bool disabled) -{ - API_ENTRY return; - sd->momentum_animator_disabled = disabled; - if (sd->momentum_animator_disabled) - { - if (sd->down.momentum_animator) - { - ecore_animator_del(sd->down.momentum_animator); - sd->down.momentum_animator = NULL; - } - } -} - -Eina_Bool -elm_smart_scroller_bounce_animator_disabled_get(Evas_Object *obj) -{ - API_ENTRY return EINA_FALSE; - return sd->bounce_animator_disabled; -} - -void -elm_smart_scroller_bounce_animator_disabled_set(Evas_Object *obj, Eina_Bool disabled) -{ - API_ENTRY return; - sd->bounce_animator_disabled = disabled; - if (sd->bounce_animator_disabled) - { - if (sd->scrollto.x.animator) - { - ecore_animator_del(sd->scrollto.x.animator); - sd->scrollto.x.animator = NULL; - } - - if (sd->scrollto.y.animator) - { - ecore_animator_del(sd->scrollto.y.animator); - sd->scrollto.y.animator = NULL; - } - } -} - static void _smart_anim_start(Evas_Object *obj) { @@ -372,23 +314,6 @@ _smart_scrollto_x_animator(void *data) } static void -_smart_momentum_end(Smart_Data *sd) -{ - if ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator)) return; - if (sd->down.momentum_animator) - { - ecore_animator_del(sd->down.momentum_animator); - sd->down.momentum_animator = NULL; - sd->down.bounce_x_hold = 0; - sd->down.bounce_y_hold = 0; - sd->down.ax = 0; - sd->down.ay = 0; - sd->down.pdx = 0; - sd->down.pdy = 0; - } -} - -static void _smart_scrollto_x(Smart_Data *sd, double t_in, Evas_Coord pos_x) { Evas_Coord px, py, x, y, w, h; @@ -422,7 +347,6 @@ _smart_scrollto_x(Smart_Data *sd, double t_in, Evas_Coord pos_x) { ecore_animator_del(sd->down.bounce_x_animator); sd->down.bounce_x_animator = NULL; - _smart_momentum_end(sd); } sd->bouncemex = 0; } @@ -489,7 +413,6 @@ _smart_scrollto_y(Smart_Data *sd, double t_in, Evas_Coord pos_y) { ecore_animator_del(sd->down.bounce_y_animator); sd->down.bounce_y_animator = NULL; - _smart_momentum_end(sd); } sd->bouncemey = 0; } @@ -497,8 +420,8 @@ _smart_scrollto_y(Smart_Data *sd, double t_in, Evas_Coord pos_y) static Eina_Bool _smart_do_page(Smart_Data *sd) { - if ((sd->pagerel_h == 0.0) && (!sd->pagesize_h) && - (sd->pagerel_v == 0.0) && (!sd->pagesize_v)) + if ((sd->pagerel_h == 0.0) && (sd->pagesize_h == 0) && + (sd->pagerel_v == 0.0) && (sd->pagesize_v == 0)) return EINA_FALSE; return EINA_TRUE; } @@ -506,13 +429,14 @@ _smart_do_page(Smart_Data *sd) static Evas_Coord _smart_page_x_get(Smart_Data *sd, int offset) { - Evas_Coord x, y, w, h, cw, ch, minx = 0; + Evas_Coord x, y, w, h, cw, ch; + Evas_Coord t; elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h); sd->pan_func.child_size_get(sd->pan_obj, &cw, &ch); - sd->pan_func.min_get(sd->pan_obj, &minx, NULL); + t = x; x += offset; if (sd->pagerel_h > 0.0) @@ -520,14 +444,48 @@ _smart_page_x_get(Smart_Data *sd, int offset) x = x + (w * sd->pagerel_h * 0.5); x = x / (w * sd->pagerel_h); x = x * (w * sd->pagerel_h); + + if (sd->one_page) + { + if (offset == 0) + { + if(t > x) x = x + (w * sd->pagerel_h); + if(t < x) x = x - (w * sd->pagerel_h); + } + else if (offset > 0) + { + if(t > x) x = x + (w * sd->pagerel_h); + } + else if (offset < 0) + { + if(t < x) x = x - (w * sd->pagerel_h); + } + } } else if (sd->pagesize_h > 0) { x = x + (sd->pagesize_h * 0.5); x = x / (sd->pagesize_h); x = x * (sd->pagesize_h); + + if(sd->one_page) + { + if (offset == 0) + { + if(t > x) x = x + (sd->pagesize_h); + if(t < x) x = x - (sd->pagesize_h); + } + else if (offset > 0) + { + if(t > x) x = x + (sd->pagesize_h); + } + else if (offset < 0) + { + if(t < x) x = x - (sd->pagesize_h); + } + } } - if (x < minx) x = minx; + if (x < 0) x = 0; else if ((x + w) > cw) x = cw - w; return x; } @@ -535,12 +493,11 @@ _smart_page_x_get(Smart_Data *sd, int offset) static Evas_Coord _smart_page_y_get(Smart_Data *sd, int offset) { - Evas_Coord x, y, w, h, cw, ch, miny = 0; + Evas_Coord x, y, w, h, cw, ch; elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h); sd->pan_func.child_size_get(sd->pan_obj, &cw, &ch); - sd->pan_func.min_get(sd->pan_obj, NULL, &miny); y += offset; @@ -556,7 +513,7 @@ _smart_page_y_get(Smart_Data *sd, int offset) y = y / (sd->pagesize_v); y = y * (sd->pagesize_v); } - if (y < miny) y = miny; + if (y < 0) y = 0; else if ((y + h) > ch) y = ch - h; return y; } @@ -607,7 +564,6 @@ _smart_bounce_x_animator(void *data) sd->down.bounce_x_animator = NULL; sd->down.pdx = 0; sd->bouncemex = 0; - _smart_momentum_end(sd); return ECORE_CALLBACK_CANCEL; } } @@ -645,7 +601,6 @@ _smart_bounce_y_animator(void *data) sd->down.bounce_y_animator = NULL; sd->down.pdy = 0; sd->bouncemey = 0; - _smart_momentum_end(sd); return ECORE_CALLBACK_CANCEL; } } @@ -659,24 +614,23 @@ _smart_bounce_y_animator(void *data) static Eina_Bool can_scroll(Smart_Data *sd, int dir) { - Evas_Coord mx = 0, my = 0, px = 0, py = 0, minx = 0, miny = 0; + Evas_Coord mx = 0, my = 0, px = 0, py = 0; sd->pan_func.max_get(sd->pan_obj, &mx, &my); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); sd->pan_func.get(sd->pan_obj, &px, &py); switch (dir) { case LEFT: - if (px > minx) return EINA_TRUE; + if (px > 0) return EINA_TRUE; break; case RIGHT: - if ((px - minx) < mx) return EINA_TRUE; + if (px < mx) return EINA_TRUE; break; case UP: - if (py > miny) return EINA_TRUE; + if (py > 0) return EINA_TRUE; break; case DOWN: - if ((py - miny) < my) return EINA_TRUE; + if (py < my) return EINA_TRUE; break; default: break; @@ -689,7 +643,7 @@ _smart_momentum_animator(void *data) { Smart_Data *sd; double t, dt, p; - Evas_Coord x, y, dx, dy, px, py, maxx, maxy, minx, miny; + Evas_Coord x, y, dx, dy, px, py; sd = data; t = ecore_loop_time_get(); @@ -713,11 +667,11 @@ _smart_momentum_animator(void *data) sd->down.cancelled = 1; } */ - dt = dt / (_elm_config->thumbscroll_friction + sd->down.extra_time); + dt = dt / _elm_config->thumbscroll_friction; if (dt > 1.0) dt = 1.0; p = 1.0 - ((1.0 - dt) * (1.0 - dt)); - dx = (sd->down.dx * (_elm_config->thumbscroll_friction + sd->down.extra_time) * p); - dy = (sd->down.dy * (_elm_config->thumbscroll_friction + sd->down.extra_time) * p); + dx = (sd->down.dx * _elm_config->thumbscroll_friction * p); + dy = (sd->down.dy * _elm_config->thumbscroll_friction * p); sd->down.ax = dx; sd->down.ay = dy; x = sd->down.sx - dx; @@ -736,10 +690,7 @@ _smart_momentum_animator(void *data) y = py; } elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); - sd->pan_func.max_get(sd->pan_obj, &maxx, &maxy); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); - if ((dt >= 1.0) || - ((sd->down.bounce_x_hold) && (sd->down.bounce_y_hold))) + if (dt >= 1.0 || ((sd->down.bounce_x_hold) && (sd->down.bounce_y_hold))) { _smart_anim_stop(sd->smart_obj); sd->down.momentum_animator = NULL; @@ -747,8 +698,8 @@ _smart_momentum_animator(void *data) sd->down.bounce_y_hold = 0; sd->down.ax = 0; sd->down.ay = 0; - sd->down.pdx = 0; - sd->down.pdy = 0; + sd->down.pdx = 0; + sd->down.pdy = 0; return ECORE_CALLBACK_CANCEL; } } @@ -758,7 +709,7 @@ _smart_momentum_animator(void *data) static void bounce_eval(Smart_Data *sd) { - Evas_Coord mx, my, px, py, bx, by, b2x, b2y, minx = 0, miny = 0; + Evas_Coord mx, my, px, py, bx, by, b2x, b2y; if (sd->freeze) return; if ((!sd->bouncemex) && (!sd->bouncemey)) return; @@ -774,20 +725,19 @@ bounce_eval(Smart_Data *sd) sd->down.hold_animator = NULL; } sd->pan_func.max_get(sd->pan_obj, &mx, &my); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); sd->pan_func.get(sd->pan_obj, &px, &py); bx = px; by = py; - if (px < minx) px = minx; - if ((px - minx) > mx) px = mx + minx; - if (py < miny) py = miny; - if ((py - miny) > my) py = my + miny; + if (px < 0) px = 0; + if (px > mx) px = mx; + if (py < 0) py = 0; + if (py > my) py = my; b2x = px; b2y = py; - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_x_get(sd->widget))) { - if (!sd->down.bounce_x_animator && !sd->bounce_animator_disabled) + if (!sd->down.bounce_x_animator) { if (sd->bouncemex) { @@ -806,10 +756,10 @@ bounce_eval(Smart_Data *sd) } } } - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_y_get(sd->widget))) { - if (!sd->down.bounce_y_animator && !sd->bounce_animator_disabled) + if (!sd->down.bounce_y_animator && !sd->freeze_bounce_animator) { if (sd->bouncemey) { @@ -833,18 +783,17 @@ bounce_eval(Smart_Data *sd) void elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { - Evas_Coord mx = 0, my = 0, px, py, minx = 0, miny = 0; + Evas_Coord mx = 0, my = 0, px, py; double vx, vy; API_ENTRY return; // FIXME: allow for bounce outside of range sd->pan_func.max_get(sd->pan_obj, &mx, &my); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); - if (mx > 0) vx = (double)(x - minx) / (double)mx; + if (mx > 0) vx = (double)x / (double)mx; else vx = 0.0; if (vx < 0.0) vx = 0.0; else if (vx > 1.0) vx = 1.0; - if (my > 0) vy = (double)(y - miny) / (double)my; + if (my > 0) vy = (double)y / (double)my; else vy = 0.0; if (vy < 0.0) vy = 0.0; else if (vy > 1.0) vy = 1.0; @@ -853,29 +802,32 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) sd->pan_func.get(sd->pan_obj, &px, &py); if (!_elm_config->thumbscroll_bounce_enable) { - if (x < minx) x = minx; - if ((x - minx) > mx) x = mx + minx; - if (y < miny) y = miny; - if ((y - miny) > my) y = my + miny; + if (x < 0) x = 0; + if (x > mx) x = mx; + if (y < 0) y = 0; + if (y > my) y = my; } if (!sd->bounce_horiz) { - if (x < minx) x = minx; - if ((x - minx) > mx) x = mx + minx; + if (x < 0) x = 0; + if (x > mx) x = mx; } if (!sd->bounce_vert) { - if (y < miny) y = miny; - if (y - miny > my) y = my + miny; + if (y < 0) y = 0; + if (y > my) y = my; } - sd->pan_func.set(sd->pan_obj, x, y); + if (sd->freeze_bounce == EINA_FALSE) + { + sd->pan_func.set(sd->pan_obj, x, y); + } if ((px != x) || (py != y)) edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); if (!sd->down.bounce_x_animator) { - if ((x < minx) || (x > (mx + minx))) + if ((x < 0) || (x > mx)) { sd->bouncemex = 1; bounce_eval(sd); @@ -883,7 +835,7 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) } if (!sd->down.bounce_y_animator) { - if ((y < miny) || (y > my + miny)) + if ((y < 0) || (y > my)) { sd->bouncemey = 1; bounce_eval(sd); @@ -895,16 +847,16 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) } if ((x != px)/* && (!sd->bouncemex)*/) { - if (x == minx) + if (x == 0) evas_object_smart_callback_call(obj, "edge,left", NULL); - if (x == (mx + minx)) + if (x == mx) evas_object_smart_callback_call(obj, "edge,right", NULL); } if ((y != py)/* && (!sd->bouncemey)*/) { - if (y == miny) + if (y == 0) evas_object_smart_callback_call(obj, "edge,top", NULL); - if (y == my + miny) + if (y == my) evas_object_smart_callback_call(obj, "edge,bottom", NULL); } } @@ -919,11 +871,10 @@ elm_smart_scroller_child_pos_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) void elm_smart_scroller_child_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { - Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny, minx = 0, miny = 0; + Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny; API_ENTRY return; sd->pan_func.max_get(sd->pan_obj, &mx, &my); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); sd->pan_func.child_size_get(sd->pan_obj, &cw, &ch); sd->pan_func.get(sd->pan_obj, &px, &py); @@ -1088,26 +1039,9 @@ void elm_smart_scroller_object_theme_set(Evas_Object *parent, Evas_Object *obj, const char *clas, const char *group, const char *style) { API_ENTRY return; - Evas_Coord mw, mh; _elm_theme_object_set(parent, sd->edje_obj, clas, group, style); - edje_object_scale_set(sd->edje_obj, elm_widget_scale_get(parent) * _elm_config->scale); if (sd->pan_obj) edje_object_part_swallow(sd->edje_obj, "elm.swallow.content", sd->pan_obj); - mw = mh = -1; - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - if (edje_object_part_exists(sd->edje_obj, "elm.scrollbar.base")) - { - Evas_Object *base; - base = edje_object_part_swallow_get(sd->edje_obj, "elm.scrollbar.base"); - if (!base) - { - base = evas_object_rectangle_add(evas_object_evas_get(sd->edje_obj)); - evas_object_color_set(base, 0, 0, 0, 0); - edje_object_part_swallow(sd->edje_obj, "elm.scrollbar.base", base); - } - if (!_elm_config->thumbscroll_enable) - evas_object_size_hint_min_set(base, mw, mh); - } sd->vbar_visible = !sd->vbar_visible; sd->hbar_visible = !sd->hbar_visible; _smart_scrollbar_bar_visibility_adjust(sd); @@ -1163,23 +1097,19 @@ elm_smart_scroller_paging_set(Evas_Object *obj, double pagerel_h, double pagerel } void -elm_smart_scroller_paging_get(Evas_Object *obj, double *pagerel_h, double *pagerel_v, Evas_Coord *pagesize_h, Evas_Coord *pagesize_v) +elm_smart_scroller_page_move_set(Evas_Object *obj, Eina_Bool set) { API_ENTRY return; - if(pagerel_h) *pagerel_h = sd->pagerel_h; - if(pagerel_v) *pagerel_v = sd->pagerel_v; - if(pagesize_h) *pagesize_h = sd->pagesize_h; - if(pagesize_v) *pagesize_v = sd->pagesize_v; + sd->one_page = set; } void elm_smart_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { - Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny, minx = 0, miny = 0; + Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny; API_ENTRY return; sd->pan_func.max_get(sd->pan_obj, &mx, &my); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); sd->pan_func.child_size_get(sd->pan_obj, &cw, &ch); sd->pan_func.get(sd->pan_obj, &px, &py); @@ -1239,15 +1169,15 @@ elm_smart_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, sd->down.bounce_y_hold = 0; sd->down.ax = 0; sd->down.ay = 0; - sd->down.pdx = 0; - sd->down.pdy = 0; + sd->down.pdx = 0; + sd->down.pdy = 0; } x = nx; - if (x < minx) x = minx; + if (x < 0) x = 0; else if ((x + w) > cw) x = cw - w; _smart_scrollto_x(sd, _elm_config->bring_in_scroll_friction, x); y = ny; - if (y < miny) y = miny; + if (y < 0) y = 0; else if ((y + h) > ch) y = ch - h; _smart_scrollto_y(sd, _elm_config->bring_in_scroll_friction, y); } @@ -1268,6 +1198,7 @@ _smart_edje_drag_v_start(void *data, Evas_Object *obj __UNUSED__, const char *em sd = data; _smart_scrollbar_read(sd); _smart_drag_start(sd->smart_obj); + sd->freeze_bounce = EINA_TRUE; } static void @@ -1278,6 +1209,8 @@ _smart_edje_drag_v_stop(void *data, Evas_Object *obj __UNUSED__, const char *emi sd = data; _smart_scrollbar_read(sd); _smart_drag_stop(sd->smart_obj); + sd->freeze_bounce = EINA_FALSE; + } static void @@ -1297,6 +1230,7 @@ _smart_edje_drag_h_start(void *data, Evas_Object *obj __UNUSED__, const char *em sd = data; _smart_scrollbar_read(sd); _smart_drag_start(sd->smart_obj); + sd->freeze_bounce = EINA_TRUE; } static void @@ -1307,6 +1241,7 @@ _smart_edje_drag_h_stop(void *data, Evas_Object *obj __UNUSED__, const char *emi sd = data; _smart_scrollbar_read(sd); _smart_drag_stop(sd->smart_obj); + sd->freeze_bounce = EINA_FALSE; } static void @@ -1397,12 +1332,12 @@ _smart_event_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, sd = data; ev = event_info; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ; - if ((evas_key_modifier_is_set(ev->modifiers, "Control")) || - (evas_key_modifier_is_set(ev->modifiers, "Alt")) || - (evas_key_modifier_is_set(ev->modifiers, "Shift")) || - (evas_key_modifier_is_set(ev->modifiers, "Meta")) || - (evas_key_modifier_is_set(ev->modifiers, "Hyper")) || - (evas_key_modifier_is_set(ev->modifiers, "Super"))) + if (evas_key_modifier_is_set(ev->modifiers, "Control") || + evas_key_modifier_is_set(ev->modifiers, "Alt") || + evas_key_modifier_is_set(ev->modifiers, "Shift") || + evas_key_modifier_is_set(ev->modifiers, "Meta") || + evas_key_modifier_is_set(ev->modifiers, "Hyper") || + evas_key_modifier_is_set(ev->modifiers, "Super")) return; elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); if ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator) || @@ -1432,13 +1367,11 @@ _smart_event_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, sd->down.bounce_y_animator = NULL; sd->bouncemey = 0; } - if (!ev->direction) + if (ev->direction == 0) y += ev->z * sd->step.y; else if (ev->direction == 1) x += ev->z * sd->step.x; - - if ((!sd->hold) && (!sd->freeze)) - elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); + elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); } static void @@ -1453,16 +1386,17 @@ _smart_event_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE // if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ; if (_elm_config->thumbscroll_enable) { - sd->down.hold = 0; + sd->down.hold = 0; if ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator) || (sd->down.momentum_animator) || (sd->scrollto.x.animator) || (sd->scrollto.y.animator)) { - ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL | EVAS_EVENT_FLAG_ON_HOLD; - sd->down.scroll = 1; - sd->down.hold = 1; + ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL | EVAS_EVENT_FLAG_ON_HOLD; + sd->down.scroll=1; + sd->down.hold = 1; _smart_anim_stop(sd->smart_obj); } + if (sd->scrollto.x.animator) { ecore_animator_del(sd->scrollto.x.animator); @@ -1532,11 +1466,11 @@ _smart_hold_animator(void *data) { Smart_Data *sd = data; Evas_Coord ox, oy; - + elm_smart_scroller_child_pos_get(sd->smart_obj, &ox, &oy); if (sd->down.dir_x) { - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_x_get(sd->widget))) { ox = sd->down.hold_x; @@ -1544,7 +1478,7 @@ _smart_hold_animator(void *data) } if (sd->down.dir_y) { - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_y_get(sd->widget))) { oy = sd->down.hold_y; @@ -1570,7 +1504,7 @@ _smart_event_post_up(void *data, Evas *e __UNUSED__) } static void -_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info) +_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj , void *event_info) { Evas_Event_Mouse_Down *ev; Smart_Data *sd; @@ -1579,6 +1513,7 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev sd = data; ev = event_info; sd->down.hold_parent = 0; + // if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ; evas_post_event_callback_push(e, _smart_event_post_up, sd); // FIXME: respect elm_widget_scroll_hold_get of parent container @@ -1633,116 +1568,111 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev at *= 4.0; dx = ev->canvas.x - ax; dy = ev->canvas.y - ay; + if(sd->one_page) at = 0.4; + if (at > 0) { vel = sqrt((dx * dx) + (dy * dy)) / at; + + if(sd->one_page) { + if(vel < _elm_config->thumbscroll_momentum_threshold) + vel = _elm_config->thumbscroll_momentum_threshold +1; + } + if ((_elm_config->thumbscroll_friction > 0.0) && (vel > _elm_config->thumbscroll_momentum_threshold) && (!sd->freeze)) { sd->down.dx = ((double)dx / at); sd->down.dy = ((double)dy / at); - if (((sd->down.dx > 0) && (sd->down.pdx > 0)) || - ((sd->down.dx < 0) && (sd->down.pdx < 0))) - sd->down.dx += (double)sd->down.pdx * 1.5; // FIXME: * 1.5 - probably should be config - if (((sd->down.dy > 0) && (sd->down.pdy > 0)) || - ((sd->down.dy < 0) && (sd->down.pdy < 0))) - sd->down.dy += (double)sd->down.pdy * 1.5; // FIXME: * 1.5 - probably should be config - if (((sd->down.dx > 0) && (sd->down.pdx > 0)) || - ((sd->down.dx < 0) && (sd->down.pdx < 0)) || - ((sd->down.dy > 0) && (sd->down.pdy > 0)) || - ((sd->down.dy < 0) && (sd->down.pdy < 0))) - { - double t = ecore_loop_time_get(); - double dt = t - sd->down.anim_start; - - if (dt < 0.0) dt = 0.0; - else if (dt > _elm_config->thumbscroll_friction) - dt = _elm_config->thumbscroll_friction; - sd->down.extra_time = _elm_config->thumbscroll_friction - dt; - } - else - sd->down.extra_time = 0.0; - sd->down.pdx = sd->down.dx; - sd->down.pdy = sd->down.dy; + if (((sd->down.dx > 0) && (sd->down.pdx > 0)) || + ((sd->down.dx < 0) && (sd->down.pdx < 0))) + sd->down.dx += sd->down.pdx * 2; // * 2 - probably should be config + if (((sd->down.dy > 0) && (sd->down.pdy > 0)) || + ((sd->down.dy < 0) && (sd->down.pdy < 0))) + sd->down.dy += sd->down.pdy * 2; // * 2 - probably should be config + sd->down.pdx = sd->down.dx; + sd->down.pdy = sd->down.dy; + ox = -sd->down.dx; oy = -sd->down.dy; - if (!_smart_do_page(sd)) - { - if (!sd->down.momentum_animator && !sd->momentum_animator_disabled) - { - sd->down.momentum_animator = ecore_animator_add(_smart_momentum_animator, sd); - ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; - _smart_anim_start(sd->smart_obj); - } - sd->down.anim_start = ecore_loop_time_get(); - elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); - sd->down.sx = x; - sd->down.sy = y; - sd->down.b0x = 0; - sd->down.b0y = 0; - } - } - } + if (!_smart_do_page(sd) && sd->freeze_bounce == EINA_FALSE) + { + if (!sd->down.momentum_animator && !sd->freeze_momentum_animator) + { + sd->down.momentum_animator = ecore_animator_add(_smart_momentum_animator, sd); + ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; + _smart_anim_start(sd->smart_obj); + } + sd->down.anim_start = ecore_loop_time_get(); + elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); + sd->down.sx = x; + sd->down.sy = y; + sd->down.b0x = 0; + sd->down.b0y = 0; + } + } + } if (sd->down.hold_animator) { ecore_animator_del(sd->down.hold_animator); sd->down.hold_animator = NULL; } } - else - { - sd->down.pdx = 0; - sd->down.pdy = 0; - } + else + { + sd->down.pdx = 0; + sd->down.pdy = 0; + } evas_event_feed_hold(e, 0, ev->timestamp, ev->data); if (_smart_do_page(sd)) { Evas_Coord pgx, pgy; elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_x_get(sd->widget))) { pgx = _smart_page_x_get(sd, ox); - if (pgx != x) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; - _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx); - } + if (pgx != x) _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx); } - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_y_get(sd->widget))) { pgy = _smart_page_y_get(sd, oy); - if (pgy != y) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; - _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy); - } + if (pgy != y) _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy); } } } else { - sd->down.pdx = 0; - sd->down.pdy = 0; + sd->down.pdx = 0; + sd->down.pdy = 0; if (_smart_do_page(sd)) { Evas_Coord pgx, pgy; elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_x_get(sd->widget))) { pgx = _smart_page_x_get(sd, ox); - if (pgx != x) _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx); + if (pgx != x) + { + ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; + _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx); + } } - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_y_get(sd->widget))) { pgy = _smart_page_y_get(sd, oy); - if (pgy != y) _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy); + if (pgy != y) + { + ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; + _smart_scrollto_y(sd, _elm_config->page_scroll_friction, pgy); + } + } } if (sd->down.hold_animator) @@ -1751,10 +1681,10 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev sd->down.hold_animator = NULL; } } - if (sd->down.scroll) - { - ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; - sd->down.scroll = 0; + if (sd->down.scroll) + { + ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; + sd->down.scroll = 0; } if (sd->down.hold) { @@ -1793,10 +1723,10 @@ _smart_onhold_animator(void *data) elm_smart_scroller_child_pos_get(sd->smart_obj, &ox, &oy); x = ox; y = oy; - + if (sd->down.dir_x) { - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_x_get(sd->widget))) { sd->down.onhold_vxe += vx; @@ -1804,10 +1734,10 @@ _smart_onhold_animator(void *data) sd->down.onhold_vxe -= (int)sd->down.onhold_vxe; } } - + if (sd->down.dir_y) { - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_y_get(sd->widget))) { sd->down.onhold_vye += vy; @@ -1815,9 +1745,8 @@ _smart_onhold_animator(void *data) sd->down.onhold_vye -= (int)sd->down.onhold_vye; } } - + elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); -// printf("scroll %i %i\n", sd->down.hold_x, sd->down.hold_y); } sd->down.onhold_tlast = t; return ECORE_CALLBACK_RENEW; @@ -1845,7 +1774,7 @@ _smart_event_post_move(void *data, Evas *e __UNUSED__) } if (sd->down.dir_x) { - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_x_get(sd->widget))) { sd->down.want_dragged = 0; @@ -1861,7 +1790,7 @@ _smart_event_post_move(void *data, Evas *e __UNUSED__) } if (sd->down.dir_y) { - if ((!sd->widget) || + if ((!sd->widget) || (!elm_widget_drag_child_locked_y_get(sd->widget))) { sd->down.want_dragged = 0; @@ -1893,6 +1822,7 @@ _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void * sd = data; ev = event_info; + // if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->down.hold_parent = 1; evas_post_event_callback_push(e, _smart_event_post_move, sd); @@ -1920,18 +1850,17 @@ _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void * { x = ev->cur.canvas.x - sd->down.x; y = ev->cur.canvas.y - sd->down.y; - sd->down.hdir = -1; sd->down.vdir = -1; - + if (x > 0) sd->down.hdir = LEFT; else if (x < 0) sd->down.hdir = RIGHT; if (y > 0) sd->down.vdir = UP; else if (y < 0) sd->down.vdir = DOWN; - + if (x < 0) x = -x; if (y < 0) y = -y; - + if ((sd->one_dir_at_a_time) && (!((sd->down.dir_x) || (sd->down.dir_y)))) { @@ -2012,34 +1941,10 @@ _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void * else x = sd->down.locked_x; } } - if (_elm_config->thumbscroll_border_friction > 0.0) - { - Evas_Coord minx, miny; - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); - if (y < miny) - y += (miny - y) * - _elm_config->thumbscroll_border_friction; - else if (sd->child.h <= sd->h) - y += (sd->down.sy - y) * - _elm_config->thumbscroll_border_friction; - else if ((sd->child.h - sd->h + miny) < y) - y += (sd->child.h - sd->h + miny - y) * - _elm_config->thumbscroll_border_friction; - if (x < minx) - x += (minx - x) * - _elm_config->thumbscroll_border_friction; - else if (sd->child.w <= sd->w) - x += (sd->down.sx - x) * - _elm_config->thumbscroll_border_friction; - else if ((sd->child.w - sd->w + minx) < x) - x += (sd->child.w - sd->w + minx - x) * - _elm_config->thumbscroll_border_friction; - } - sd->down.hold_x = x; sd->down.hold_y = y; if (!sd->down.hold_animator) - sd->down.hold_animator = + sd->down.hold_animator = ecore_animator_add(_smart_hold_animator, sd); // printf("a %i %i\n", sd->down.hold_x, sd->down.hold_y); // _smart_onhold_animator(sd); @@ -2125,19 +2030,112 @@ _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj __UNUSED__, void * } static void +_smart_event_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + Evas_Event_Key_Down *ev; + Smart_Data *sd; + Evas_Coord x = 0, y = 0, vw = 0, vh = 0, mx = 0, my = 0; + int xch = 0, ych = 0; + + sd = data; + ev = event_info; + if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; + elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); + sd->pan_func.max_get(sd->pan_obj, &mx, &my); + evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh); + if (!strcmp(ev->keyname, "Left")) + { + x -= sd->step.x; + xch = 1; + } + else if (!strcmp(ev->keyname, "Right")) + { + x += sd->step.x; + xch = 1; + } + else if (!strcmp(ev->keyname, "Up")) + { + y -= sd->step.y; + ych = 1; + } + else if (!strcmp(ev->keyname, "Home")) + { + y = 0; + ych = 1; + } + else if (!strcmp(ev->keyname, "End")) + { + y = my; + ych = 1; + } + else if (!strcmp(ev->keyname, "Down")) + { + y += sd->step.y; + ych = 1; + } + else if (!strcmp(ev->keyname, "Prior")) + { + if (sd->page.y < 0) + y -= -(sd->page.y * vh) / 100; + else + y -= sd->page.y; + ych = 1; + } + else if (!strcmp(ev->keyname, "Next")) + { + if (sd->page.y < 0) + y += -(sd->page.y * vh) / 100; + else + y += sd->page.y; + ych = 1; + } + if (xch) + { + if (sd->scrollto.x.animator) + { + ecore_animator_del(sd->scrollto.x.animator); + sd->scrollto.x.animator = NULL; + } + if (sd->down.bounce_x_animator) + { + ecore_animator_del(sd->down.bounce_x_animator); + sd->down.bounce_x_animator = NULL; + sd->bouncemex = 0; + } + } + if (ych) + { + if (sd->scrollto.y.animator) + { + ecore_animator_del(sd->scrollto.y.animator); + sd->scrollto.y.animator = NULL; + } + if (sd->down.bounce_y_animator) + { + ecore_animator_del(sd->down.bounce_y_animator); + sd->down.bounce_y_animator = NULL; + sd->bouncemey = 0; + } + } + + elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); +} + +static void _smart_scrollbar_read(Smart_Data *sd) { - Evas_Coord x, y, mx = 0, my = 0, px, py, minx = 0, miny = 0; - double vx, vy; + Evas_Coord x, y, mx = 0, my = 0, px, py; + double vx, vy = 0.0; edje_object_part_drag_value_get(sd->edje_obj, "elm.dragable.vbar", NULL, &vy); edje_object_part_drag_value_get(sd->edje_obj, "elm.dragable.hbar", &vx, NULL); sd->pan_func.max_get(sd->pan_obj, &mx, &my); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); - x = vx * (double)mx + minx; - y = vy * (double)my + miny; + x = vx * (double)mx; + y = vy * (double)my; sd->pan_func.get(sd->pan_obj, &px, &py); + sd->pan_func.set(sd->pan_obj, x, y); + if ((px != x) || (py != y)) edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); } @@ -2145,7 +2143,7 @@ _smart_scrollbar_read(Smart_Data *sd) static void _smart_scrollbar_reset(Smart_Data *sd) { - Evas_Coord px = 0, py = 0, minx = 0, miny = 0; + Evas_Coord px = 0, py = 0; edje_object_part_drag_value_set(sd->edje_obj, "elm.dragable.vbar", 0.0, 0.0); edje_object_part_drag_value_set(sd->edje_obj, "elm.dragable.hbar", 0.0, 0.0); @@ -2154,10 +2152,10 @@ _smart_scrollbar_reset(Smart_Data *sd) edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.vbar", 1.0, 1.0); edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.hbar", 1.0, 1.0); } - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); sd->pan_func.get(sd->pan_obj, &px, &py); - sd->pan_func.set(sd->pan_obj, minx, miny); - if ((px != minx) || (py != miny)) + sd->pan_func.set(sd->pan_obj, 0, 0); + + if ((px != 0) || (py != 0)) edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); } @@ -2165,8 +2163,9 @@ static int _smart_scrollbar_bar_v_visibility_adjust(Smart_Data *sd) { int scroll_v_vis_change = 0; - Evas_Coord h, vw, vh; + Evas_Coord w, h, vw, vh; + w = sd->child.w; h = sd->child.h; evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh); if (sd->vbar_visible) @@ -2233,9 +2232,10 @@ static int _smart_scrollbar_bar_h_visibility_adjust(Smart_Data *sd) { int scroll_h_vis_change = 0; - Evas_Coord w, vw, vh; + Evas_Coord w, h, vw, vh; w = sd->child.w; + h = sd->child.h; evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh); if (sd->hbar_visible) { @@ -2317,7 +2317,7 @@ _smart_scrollbar_size_adjust(Smart_Data *sd) { if ((sd->child_obj) || (sd->extern_pan)) { - Evas_Coord x, y, w, h, mx = 0, my = 0, vw = 0, vh = 0, px, py, minx = 0, miny = 0; + Evas_Coord x, y, w, h, mx = 0, my = 0, vw = 0, vh = 0, px, py; double vx, vy, size; edje_object_part_geometry_get(sd->edje_obj, "elm.swallow.content", @@ -2344,10 +2344,10 @@ _smart_scrollbar_size_adjust(Smart_Data *sd) edje_object_part_drag_value_get(sd->edje_obj, "elm.dragable.hbar", &vx, NULL); edje_object_part_drag_value_get(sd->edje_obj, "elm.dragable.vbar", NULL, &vy); + sd->pan_func.max_get(sd->pan_obj, &mx, &my); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); - x = vx * mx + minx; - y = vy * my + miny; + x = vx * mx; + y = vy * my; edje_object_part_drag_step_set(sd->edje_obj, "elm.dragable.hbar", (double)sd->step.x / (double)w, 0.0); edje_object_part_drag_step_set(sd->edje_obj, "elm.dragable.vbar", 0.0, (double)sd->step.y / (double)h); @@ -2364,19 +2364,18 @@ _smart_scrollbar_size_adjust(Smart_Data *sd) if (vx != mx) x = px; if (vy != my) y = py; sd->pan_func.set(sd->pan_obj, x, y); -// if ((px != 0) || (py != 0)) -// edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); + if ((px != 0) || (py != 0)) + edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); } else { - Evas_Coord px = 0, py = 0, minx = 0, miny = 0; + Evas_Coord px = 0, py = 0; edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.vbar", 1.0, 1.0); edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.hbar", 1.0, 1.0); - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); sd->pan_func.get(sd->pan_obj, &px, &py); - sd->pan_func.set(sd->pan_obj, minx, miny); - if ((px != minx) || (py != miny)) + sd->pan_func.set(sd->pan_obj, 0, 0); + if ((px != 0) || (py != 0)) edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); } _smart_scrollbar_bar_visibility_adjust(sd); @@ -2420,14 +2419,14 @@ _smart_add(Evas_Object *obj) sd->bounce_vert = 1; sd->one_dir_at_a_time = 1; - sd->momentum_animator_disabled = 0; - sd->bounce_animator_disabled = 0; - + + evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _smart_event_key_down, sd); + evas_object_propagate_events_set(obj, 0); + o = edje_object_add(evas_object_evas_get(obj)); - evas_object_propagate_events_set(o, 0); sd->edje_obj = o; // FIXME: null parent obj ... :( - elm_smart_scroller_object_theme_set(NULL, obj, "scroller", "base", "default"); + _elm_theme_object_set(NULL, o, "scroller", "base", "default"); edje_object_signal_callback_add(o, "drag", "elm.dragable.vbar", _smart_edje_drag_v, sd); edje_object_signal_callback_add(o, "drag,start", "elm.dragable.vbar", _smart_edje_drag_v_start, sd); edje_object_signal_callback_add(o, "drag,stop", "elm.dragable.vbar", _smart_edje_drag_v_stop, sd); @@ -2453,7 +2452,6 @@ _smart_add(Evas_Object *obj) sd->pan_func.set = _elm_smart_pan_set; sd->pan_func.get = _elm_smart_pan_get; sd->pan_func.max_get = _elm_smart_pan_max_get; - sd->pan_func.min_get = _elm_smart_pan_min_get; sd->pan_func.child_size_get = _elm_smart_pan_child_size_get; _smart_scrollbar_reset(sd); @@ -2484,6 +2482,7 @@ _smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) INTERNAL_ENTRY; sd->x = x; sd->y = y; + _smart_reconfigure(sd); } @@ -2567,3 +2566,32 @@ _smart_init(void) } } +void +elm_smart_scroller_freeze_momentum_animator_set(Evas_Object *obj, Eina_Bool freeze) +{ + API_ENTRY return; + sd->freeze_momentum_animator = freeze; + if (sd->freeze_momentum_animator) + { + if (sd->down.momentum_animator) + { + ecore_animator_del(sd->down.momentum_animator); + sd->down.momentum_animator = NULL; + } + } +} + +void +elm_smart_scroller_freeze_bounce_animator_set(Evas_Object *obj, Eina_Bool freeze) +{ + API_ENTRY return; + sd->freeze_bounce_animator = freeze; + if (sd->freeze_bounce_animator) + { + if (sd->scrollto.y.animator) + { + ecore_animator_del(sd->scrollto.y.animator); + sd->scrollto.y.animator = NULL; + } + } +} diff --git a/src/lib/els_scroller.h b/src/lib/els_scroller.h index a265cee..7dfb7da 100644 --- a/src/lib/els_scroller.h +++ b/src/lib/els_scroller.h @@ -8,7 +8,7 @@ Elm_Smart_Scroller_Policy; Evas_Object *elm_smart_scroller_add (Evas *evas); void elm_smart_scroller_child_set (Evas_Object *obj, Evas_Object *child); -void elm_smart_scroller_extern_pan_set (Evas_Object *obj, Evas_Object *pan, void (*pan_set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*pan_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_min_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)); +void elm_smart_scroller_extern_pan_set (Evas_Object *obj, Evas_Object *pan, void (*pan_set) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*pan_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y), void (*pan_child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)); void elm_smart_scroller_custom_edje_file_set (Evas_Object *obj, char *file, char *group); void elm_smart_scroller_child_pos_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y); void elm_smart_scroller_child_pos_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); @@ -29,10 +29,8 @@ void elm_smart_scroller_freeze_set (Evas_Object *obj, Eina_Bool fre void elm_smart_scroller_bounce_allow_set (Evas_Object *obj, Eina_Bool horiz, Eina_Bool vert); void elm_smart_scroller_bounce_allow_get (const Evas_Object *obj, Eina_Bool *horiz, Eina_Bool *vert); void elm_smart_scroller_paging_set (Evas_Object *obj, double pagerel_h, double pagerel_v, Evas_Coord pagesize_h, Evas_Coord pagesize_v); -void elm_smart_scroller_paging_get (Evas_Object *obj, double *pagerel_h, double *pagerel_v, Evas_Coord *pagesize_h, Evas_Coord *pagesize_v); void elm_smart_scroller_region_bring_in (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); void elm_smart_scroller_widget_set (Evas_Object *obj, Evas_Object *wid); -Eina_Bool elm_smart_scroller_momentum_animator_disabled_get (Evas_Object *obj); -void elm_smart_scroller_momentum_animator_disabled_set (Evas_Object *obj, Eina_Bool disabled); -void elm_smart_scroller_bounce_animator_disabled_set (Evas_Object *obj, Eina_Bool disabled); -Eina_Bool elm_smart_scroller_bounce_animator_disabled_get (Evas_Object *obj); +void elm_smart_scroller_page_move_set (Evas_Object *obj, Eina_Bool set); +void elm_smart_scroller_freeze_momentum_animator_set(Evas_Object *obj, Eina_Bool freeze); +void elm_smart_scroller_freeze_bounce_animator_set(Evas_Object *obj, Eina_Bool freeze); diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index 0cd2c67..e62d737 100755 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -2,4 +2,4 @@ AUTOMAKE_OPTIONS = 1.4 foreign MAINTAINERCLEANFILES = Makefile.in SUBDIRS = \ -test_entry ctxpopup_copypasteUI popup_copypasteUI test_map +test_entry ctxpopup_copypasteUI popup_copypasteUI diff --git a/src/modules/ctxpopup_copypasteUI/copypaste.c b/src/modules/ctxpopup_copypasteUI/copypaste.c index a306ca2..fa54b80 100644 --- a/src/modules/ctxpopup_copypasteUI/copypaste.c +++ b/src/modules/ctxpopup_copypasteUI/copypaste.c @@ -4,18 +4,6 @@ Elm_Entry_Extension_data *ext_mod; -typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item; -struct _Elm_Entry_Context_Menu_Item -{ - Evas_Object *obj; - const char *label; - const char *icon_file; - const char *icon_group; - Elm_Icon_Type icon_type; - Evas_Smart_Cb func; - void *data; -}; - static void _ctxpopup_position(Evas_Object *obj) { diff --git a/src/modules/popup_copypasteUI/copypaste.c b/src/modules/popup_copypasteUI/copypaste.c index b8f87bb..15c8dd2 100644 --- a/src/modules/popup_copypasteUI/copypaste.c +++ b/src/modules/popup_copypasteUI/copypaste.c @@ -3,18 +3,6 @@ #include "elm_priv.h" Elm_Entry_Extension_data *ext_mod; -typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item; -struct _Elm_Entry_Context_Menu_Item -{ - Evas_Object *obj; - const char *label; - const char *icon_file; - const char *icon_group; - Elm_Icon_Type icon_type; - Evas_Smart_Cb func; - void *data; -}; - static void _select(void *data, Evas_Object *obj, void *event_info) @@ -130,7 +118,7 @@ obj_longpress(Evas_Object *obj) elm_popup_title_label_set(ext_mod->popup,"CopyPaste"); list = elm_list_add(ext_mod->popup); elm_object_style_set(list,"popup"); - elm_list_mode_set(list, ELM_LIST_COMPRESS); + elm_list_horizontal_mode_set(list, ELM_LIST_COMPRESS); elm_widget_sub_object_add(obj, ext_mod->popup); if (!ext_mod->selmode) { diff --git a/src/modules/test_map/Makefile.am b/src/modules/test_map/Makefile.am deleted file mode 100644 index d789ce9..0000000 --- a/src/modules/test_map/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -AM_CPPFLAGS = \ --I. \ --I$(top_builddir) \ --I$(top_srcdir) \ --I$(top_srcdir)/src/lib \ --I$(top_builddir)/src/lib \ --DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ --DPACKAGE_LIB_DIR=\"$(libdir)\" \ -@ELEMENTARY_CFLAGS@ \ -@ELEMENTARY_X_CFLAGS@ \ -@ELEMENTARY_FB_CFLAGS@ \ -@ELEMENTARY_WIN32_CFLAGS@ \ -@ELEMENTARY_WINCE_CFLAGS@ \ -@ELEMENTARY_EDBUS_CFLAGS@ \ -@ELEMENTARY_EFREET_CFLAGS@ \ -@ELEMENTARY_ETHUMB_CFLAGS@ - -if ELEMENTARY_WINDOWS_BUILD -AM_CPPFLAGS += -DELEMENTARY_BUILD -endif - -pkgdir = $(libdir)/elementary/modules/test_map/$(MODULE_ARCH) -pkg_LTLIBRARIES = module.la - -module_la_SOURCES = mod.c - -module_la_LIBADD = $(top_builddir)/src/lib/libelementary.la -module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version -module_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/src/modules/test_map/mod.c b/src/modules/test_map/mod.c deleted file mode 100644 index 8b45ede..0000000 --- a/src/modules/test_map/mod.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif - -EAPI int -elm_modapi_init(void *m __UNUSED__) -{ - return 1; // succeed always -} - -EAPI int -elm_modapi_shutdown(void *m __UNUSED__) -{ - return 1; // succeed always -} - -EAPI Eina_Bool -obj_hook(Evas_Object *obj __UNUSED__) -{ - return EINA_TRUE; -} - -EAPI Eina_Bool -obj_unhook(Evas_Object *obj __UNUSED__) -{ - return EINA_TRUE; -} - -EAPI Eina_Bool -obj_convert_geo_into_coord(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, double lon __UNUSED__, double lat __UNUSED__, int size __UNUSED__, int *x __UNUSED__, int *y __UNUSED__) -{ - return EINA_FALSE; -} - -EAPI Eina_Bool -obj_convert_coord_into_geo(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, int x __UNUSED__, int y __UNUSED__, int size __UNUSED__, double *lon __UNUSED__, double *lat __UNUSED__) -{ - return EINA_FALSE; -} - -EAPI char* -obj_url_request(Evas_Object *obj __UNUSED__, int x, int y, int zoom) -{ - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", - zoom, x, y); - return strdup(buf); -} -