From: Daniel Juyung Seo Date: Mon, 10 Jan 2011 05:22:51 +0000 (+0900) Subject: ================================================================ X-Git-Tag: REL_I9200_20110603-1~515 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc584e65818a75d810551af13ca49ca341e73fb2;p=framework%2Fuifw%2Felementary.git ================================================================ [Overwrite from Working Git] ================================================================ --- diff --git a/data/objects/Makefile.am b/data/objects/Makefile.am index 8d936c8..0f80b6c 100644 --- a/data/objects/Makefile.am +++ b/data/objects/Makefile.am @@ -6,11 +6,15 @@ EDJE_FLAGS = -v -id $(top_srcdir)/data/objects -fd $(top_srcdir)/data/objects filesdir = $(datadir)/elementary/objects -files_DATA = test.edj multip.edj +files_DATA = test.edj multip.edj colorpreview.edj cursors.edj font_preview.edj EXTRA_DIST = \ test.edc \ multip.edc \ +colorpreview.edc \ +cursors.edc \ +font_preview.edc \ +grid_bg.png \ over.png \ under.png \ sky.jpg \ @@ -21,11 +25,26 @@ 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 new file mode 100644 index 0000000..77d1441 --- /dev/null +++ b/data/objects/colorpreview.edc @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..a943037 --- /dev/null +++ b/data/objects/cursors.edc @@ -0,0 +1,80 @@ +///////////////////////////////////////////////////////////////////////////// +// 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 new file mode 100644 index 0000000..302c2e8 --- /dev/null +++ b/data/objects/font_preview.edc @@ -0,0 +1,40 @@ +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 new file mode 100644 index 0000000..7141658 Binary files /dev/null and b/data/objects/grid_bg.png differ diff --git a/data/objects/test.edc b/data/objects/test.edc index e694f6e..44b532c 100644 --- a/data/objects/test.edc +++ b/data/objects/test.edc @@ -40,6 +40,26 @@ 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"; @@ -405,5 +425,108 @@ 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 4f8309a..20120f6 100644 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -5,12 +5,14 @@ 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 +files_DATA = default.edj default-desktop.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 \ @@ -57,6 +59,8 @@ 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 \ @@ -103,13 +107,17 @@ 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 \ @@ -189,12 +197,36 @@ emo-wtf.png \ map_item.png \ map_item_2.png \ shadow.png \ -black.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 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 new file mode 100644 index 0000000..95df605 Binary files /dev/null and b/data/themes/bar_shine.png differ diff --git a/data/themes/color_picker_alpha.png b/data/themes/color_picker_alpha.png new file mode 100644 index 0000000..09cbe77 Binary files /dev/null and b/data/themes/color_picker_alpha.png differ diff --git a/data/themes/color_picker_alpha_bg.png b/data/themes/color_picker_alpha_bg.png new file mode 100644 index 0000000..6d144d7 Binary files /dev/null and b/data/themes/color_picker_alpha_bg.png differ diff --git a/data/themes/color_picker_brightness.png b/data/themes/color_picker_brightness.png new file mode 100644 index 0000000..b2bbf5d Binary files /dev/null and b/data/themes/color_picker_brightness.png differ diff --git a/data/themes/color_picker_color.png b/data/themes/color_picker_color.png new file mode 100644 index 0000000..1c609f8 Binary files /dev/null and b/data/themes/color_picker_color.png differ diff --git a/data/themes/color_picker_opacity.png b/data/themes/color_picker_opacity.png new file mode 100644 index 0000000..370ea1c Binary files /dev/null and b/data/themes/color_picker_opacity.png differ diff --git a/data/themes/default-desktop.edc b/data/themes/default-desktop.edc new file mode 100644 index 0000000..c8d1feb --- /dev/null +++ b/data/themes/default-desktop.edc @@ -0,0 +1,1351 @@ +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 caf9b51..358863a 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -6,9 +6,243 @@ // 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; @@ -29,6 +263,11 @@ 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; @@ -53,7 +292,7 @@ collections { mouse_events: 0; description { state: "default" 0.0; rel1.relative: 0.0 1.0; - rel1.offset: 0 -4; + rel1.offset: 0 -9; image.normal: "dia_botshad.png"; fill { smooth: 0; @@ -67,8 +306,6 @@ collections { part { name: "elm.swallow.content"; type: SWALLOW; description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; } } } @@ -82,6 +319,10 @@ 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) { @@ -111,8 +352,7 @@ collections { 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: "sl_bt2_2.png" COMP; } parts { part { name: "bg"; @@ -155,7 +395,29 @@ 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; @@ -183,35 +445,22 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 17; + min: 10 17; align: 1.0 0.0; rel1 { relative: 1.0 0.0; - offset: -2 2; + offset: 0 2; to_y: "elm.swallow.content"; + to_x: "elm.swallow.content"; } rel2 { relative: 1.0 0.0; - offset: -2 -1; + offset: -1 -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; @@ -222,7 +471,8 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 17 17; + min: 10 17; + max: 10 99999; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -236,8 +486,8 @@ collections { image { normal: "bt_sm_base2.png"; border: 6 6 6 6; + middle: SOLID; } - image.middle: SOLID; } } part { name: "sb_vbar_over1"; @@ -293,35 +543,22 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 17; + min: 17 10; align: 0.0 1.0; rel1 { relative: 0.0 1.0; - offset: 2 -2; + offset: 2 0; to_x: "elm.swallow.content"; + to_y: "elm.swallow.content"; } rel2 { relative: 0.0 1.0; - offset: -1 -2; + offset: -1 -1; 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; @@ -332,7 +569,8 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 17 17; + min: 17 10; + max: 99999 10; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -345,9 +583,9 @@ collections { } image { normal: "bt_sm_base2.png"; - border: 6 6 6 6; + border: 4 4 4 4; + middle: SOLID; } - image.middle: SOLID; } } part { name: "sb_hbar_over1"; @@ -359,7 +597,7 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + border: 4 4 4 0; } } } @@ -371,10 +609,24 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_shine.png"; - border: 6 6 6 0; + border: 4 4 4 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"; @@ -437,14 +689,14 @@ collections { signal: "do-show-vbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 1.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 1.0; + transition: LINEAR 0.5; target: "sb_vbar_clip"; } @@ -494,14 +746,14 @@ collections { signal: "do-show-hbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 1.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 1.0; + transition: LINEAR 0.5; target: "sb_hbar_clip"; } @@ -524,1027 +776,1226 @@ collections { } v = get_int(sbvis_timer); if (v > 0) cancel_timer(v); - v = timer(2.0, "timer0", 0); + v = timer(1.0, "timer0", 0); set_int(sbvis_timer, v); } } - } - } -/////////////////////////////////////////////////////////////////////////////// - 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: "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"; } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - text { - style: "textblock_style"; - min: 1 1; - } - } + 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"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disabler"; } } } - 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; - } - } - } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/scroller/entry/default"; + + data { + item: "focus_highlight" "on"; } - } - 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"; } + 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); + } } - } - - 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; - } + 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; } } - } - - 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"; - } + 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; } 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: "bg"; + type: RECT; description { state: "default" 0.0; - text { - style: "textblock_style2"; - min: 1 1; - } + rel1.offset: 2 2; + rel2.offset: -3 -3; } } - } - } - - 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; + part { name: "clipper"; + type: RECT; mouse_events: 0; - scale: 1; description { state: "default" 0.0; - text { - style: "textblock_style2"; - min: 0 1; - } + rel1.to: "bg"; + rel2.to: "bg"; + rel1.offset: 2 2; + rel2.offset: -3 -3; } } - } - } - -/////////////////////////////////////////////////////////////////////////////// - - 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; + part { name: "contentclipper"; + type: RECT; + mouse_events: 0; + clip_to: "clipper"; 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; - } + rel1.to: "elm.swallow.icon"; + rel1.relative: 1.0 0.0; + rel2.to: "elm.swallow.end"; + rel2.relative: 0.0 1.0; } } - part { name: "elm.swallow.content"; + part { name: "elm.swallow.icon"; type: SWALLOW; + clip_to: "clipper"; description { state: "default" 0.0; - fixed: 1 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; + } 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; - rel2.offset: 4 -5; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - fixed: 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; + } 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.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; + part { name: "elm.swallow.end"; + type: SWALLOW; + 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; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 0; - align: 0.5 0.5; - text_class: "button"; + 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; } 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; + 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; + } visible: 1; - text.min: 1 1; } } - part { name: "over1"; - mouse_events: 0; + part { name: "elm.swallow.content"; + clip_to: "contentclipper"; + type: SWALLOW; description { state: "default" 0.0; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; + rel1 { + to: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 4 4; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; + rel2 { + to: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -5 -5; } } } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; + part { name: "conf_over"; + mouse_events: 0; description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; image { - normal: "bt_shine.png"; + normal: "shelf_inset.png"; border: 7 7 7 7; + middle: 0; } + fill.smooth : 0; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "over3"; - mouse_events: 1; - repeat_events: 1; + 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; - color: 255 255 255 0; + rel1.offset: -1 -1; + rel2.offset: 0 0; image { - normal: "bt_glow.png"; - border: 12 12 12 12; + normal: "sl_bt2_2.png"; + border: 7 7 7 7; + middle: 0; } - fill.smooth : 0; + fill.smooth : 0; + color: 200 155 0 0; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + description { state: "enabled" 0.0; + inherit: "default" 0.0; + color: 200 155 0 255; } - } - part { name: "disabler"; + } + part { name: "sb_vbar_clip_master"; type: RECT; + mouse_events: 0; 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: 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; - target: "button_image"; - target: "over3"; - after: "button_unpressed_anim"; - } - program { - name: "button_unpressed_anim"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "button_image"; - target: "over3"; - } - 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,clicked,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_clip"; + clip_to: "sb_vbar_clip_master"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; } - } - 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: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; } } - 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); + 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: "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); + 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"; } - } - } - } - - 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; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; + 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.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; + normal: "bt_sm_base2.png"; + border: 6 6 6 6; + middle: SOLID; } } } - part { name: "arrow"; + part { name: "sb_vbar_over1"; + clip_to: "sb_vbar_clip"; 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: "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: "elm.swallow.content"; - type: SWALLOW; + part { name: "sb_vbar_over2"; + clip_to: "sb_vbar_clip"; + mouse_events: 0; description { state: "default" 0.0; - fixed: 1 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; - 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; - } + color: 255 255 255 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; + } + part { name: "sb_hbar_clip"; + clip_to: "sb_hbar_clip_master"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.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; + description { state: "hidden" 0.0; + visible: 0; + color: 255 255 255 0; } } - part { - name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; + part { name: "sb_hbar"; + type: RECT; + mouse_events: 0; description { state: "default" 0.0; + fixed: 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; - text_class: "button"; + 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"; } - } - 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: "over1"; + 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; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 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"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; + normal: "bt_sm_base2.png"; + border: 4 4 4 4; + middle: SOLID; } } } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; + 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_shine.png"; - border: 7 7 7 7; + normal: "bt_sm_hilight.png"; + border: 4 4 4 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; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { name: "disabler"; - type: RECT; + part { name: "sb_hbar_over2"; + clip_to: "sb_hbar_clip"; + mouse_events: 0; description { state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; + rel1.to: "elm.dragable.hbar"; + rel2.to: "elm.dragable.hbar"; + image { + normal: "bt_sm_shine.png"; + border: 4 4 4 0; + } } } } programs { - program { - name: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; + 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: "button_unclick"; - signal: "mouse,up,1"; - source: "over2"; + 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: "button_image"; + target: "elm.swallow.icon"; } - program { - name: "button_click2"; - signal: "mouse,down,1"; - source: "over3"; - action: STATE_SET "clicked" 0.0; - target: "over3"; + program { name: "end_show"; + signal: "elm,action,show,end"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.end"; } - program { - name: "button_unclick2"; - signal: "mouse,up,1"; - source: "over3"; + program { name: "end_hide"; + signal: "elm,action,hide,end"; + source: "elm"; 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" ""; + target: "elm.swallow.end"; } - program { name: "text_show"; - signal: "elm,state,text,visible"; + program { name: "vbar_show"; + signal: "elm,action,show,vbar"; 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 "default" 0.0; + target: "sb_vbar_clip_master"; } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; + program { name: "vbar_hide"; + signal: "elm,action,hide,vbar"; 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 "hidden" 0.0; + target: "sb_vbar_clip_master"; } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; + program { name: "vbar_show_always"; + signal: "elm,action,show_always,vbar"; 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); - } + 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: "icon_hide"; - signal: "elm,state,icon,hidden"; + 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; - target: "elm.swallow.content"; + transition: LINEAR 0.5; + target: "sb_vbar_clip"; } - program { name: "disable"; - signal: "elm,state,disabled"; + 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 "disabled" 0.0; - target: "button_image"; - target: "over1"; - target: "over2"; - target: "disabler"; - after: "disable_text"; + action: STATE_SET "default" 0.0; + target: "sb_hbar_clip_master"; } - 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"; + program { name: "hbar_hide"; + signal: "elm,action,hide,hbar"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "over1"; - target: "over2"; - target: "disabler"; - after: "enable_text"; + action: STATE_SET "hidden" 0.0; + target: "sb_hbar_clip_master"; } - program { name: "enable_text"; + 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 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); + 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"; + 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/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; - } +/////////////////////////////////////////////////////////////////////////////// +#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"; + } + } 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"; + part { name: "label.swallow.background"; 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; + visible: 1; } - 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: "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"; } } } - part { name: "textvis"; - type: RECT; + part { name: "elm.text"; + type: TEXTBLOCK; mouse_events: 0; + scale: 1; + clip_to: "label.text.clip"; description { state: "default" 0.0; - visible: 0; - } - description { state: "visible" 0.0; - visible: 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + text { + style: "textblock_style"; + min: 1 0; + } } } - part { - name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; + } + } + + 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; + mouse_events: 0; 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; - 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"; + style: "textblock_style"; + min: 0 1; } - } - 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; - } + } } - part { name: "over2"; - type: RECT; - mouse_events: 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; - color: 0 0 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; + multiline: 1; + description { state: "default" 0.0; + fixed: 0 1; + text { + style: "textblock_style"; + 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); - } + } + + 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"; } - 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); + } + 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: 1 1; + } } } - 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); + } + } + + 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; + } } } - 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; + 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); + } } + parts { - part { name: "button_image"; - mouse_events: 1; + part { name: "label.swallow.background"; + type: SWALLOW; 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: "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; + visible: 1; } - 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: "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.swallow.content"; - type: SWALLOW; + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + clip_to: "label.text.clip"; 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; + 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; } 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; @@ -1552,10 +2003,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 { @@ -1601,20 +2052,14 @@ 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; @@ -1649,7 +2094,6 @@ collections { } description { state: "clicked" 0.0; inherit: "default" 0.0; - visible: 1; color: 255 255 255 255; } } @@ -1666,29 +2110,44 @@ collections { } } programs { - program { - name: "button_mouse_in"; - signal: "mouse,in"; + program { + name: "button_click"; + signal: "mouse,down,1"; source: "over2"; - action: STATE_SET "visible" 0.0; - target: "button_image"; - target: "over1"; - transition: DECELERATE 0.5; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; } program { - name: "button_mouse_out"; - signal: "mouse,out"; - source: "over2"; - action: STATE_SET "default" 0.0; + name: "button_click_anim"; + action: STATE_SET "clicked" 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; + 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; + target: "button_image"; + target: "over3"; + after: "button_unpressed_anim"; + } + program { + name: "button_unpressed_anim"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "button_image"; + target: "over3"; + } + program { + name: "button_unclick_anim"; + action: STATE_SET "default" 0.0; target: "button_image"; } program { @@ -1708,7 +2167,7 @@ collections { } program { name: "button_unclick3"; - signal: "mouse,up,1"; + signal: "mouse,clicked,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,click" ""; } @@ -1800,292 +2259,183 @@ collections { } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/toggle/base/default"; + 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: "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; + 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: "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; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - color: 255 255 255 255; - } - } - part { name: "button"; - type: RECT; - scale: 1; - clip_to: "clipper"; + part { name: "button_image"; mouse_events: 1; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "bg"; - } 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; - } - } - part { name: "button_events"; - type: RECT; - dragable { - events: "button"; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + image.middle: SOLID; } - 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: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - } - 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: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } } - part { name: "offrect"; - type: RECT; - scale: 1; - clip_to: "clipper"; + part { name: "arrow"; 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; + 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: "togbase"; - mouse_events: 0; - clip_to: "clipper"; + part { name: "elm.swallow.content"; + type: SWALLOW; description { state: "default" 0.0; - rel1.to: "onrect"; - rel2.to: "offrect"; - image.normal: "tog_base.png"; + 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; + } } - description { state: "disabled" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; - image.normal: "tog_dis_base.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"; - } + fixed: 0 0; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 2 -5; } - description { state: "disabled" 0.0; + description { state: "icononly" 0.0; inherit: "default" 0.0; - color: 128 128 128 128; + 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: "elm.ontext"; - type: TEXT; - effect: SOFT_SHADOW; + part { + name: "elm.text"; + 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; + 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 1; + min: 0 0; align: 0.5 0.5; - text: "ON"; + text_class: "button"; } } + 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; - color3: 0 0 0 24; + 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: "conf_over"; - mouse_events: 0; + part { name: "over1"; + mouse_events: 0; description { state: "default" 0.0; - rel1.offset: -1 -1; - rel1.to: "bg"; - rel2.offset: 0 0; - rel2.to: "bg"; + rel2.relative: 1.0 0.5; image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; + normal: "bt_hilight.png"; + border: 7 7 7 0; } - fill.smooth : 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; + description { state: "disabled" 0.0; + inherit: "default" 0.0; image { - normal: "bt_bases.png"; - border: 11 11 11 11; + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; } - image.middle: SOLID; - color: 255 255 255 128; } } - part { name: "button2"; - mouse_events: 0; - clip_to: "clipper"; + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; description { state: "default" 0.0; - rel1.to: "button"; - rel1.offset: -2 -2; - rel2.to: "button"; - rel2.offset: 1 1; image { - normal: "bt_basew.png"; + normal: "bt_shine.png"; border: 7 7 7 7; } - image.middle: SOLID; } - } - 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; - } - } - } - 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; + 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; @@ -2099,55 +2449,77 @@ collections { } } programs { - program { name: "drag_end"; + program { + name: "button_click"; + signal: "mouse,down,1"; + source: "over2"; + action: STATE_SET "clicked" 0.0; + target: "button_image"; + } + program { + name: "button_unclick"; 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", ""); - } - } + source: "over2"; + action: STATE_SET "default" 0.0; + target: "button_image"; } - program { name: "toggle_on"; - signal: "elm,state,toggle,on"; - source: "elm"; - script { - set_drag(PART:"button", 100.0, 0.0); - } + program { + name: "button_click2"; + signal: "mouse,down,1"; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; } - program { name: "toggle_off"; - signal: "elm,state,toggle,off"; - source: "elm"; - script { - set_drag(PART:"button", 0.0, 0.0); - } + 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"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; + 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"; - action: STATE_SET "default" 0.0; - target: "elm.text"; + 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: "icon_show"; signal: "elm,state,icon,visible"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.content"; + 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: "icon_hide"; signal: "elm,state,icon,hidden"; @@ -2159,9 +2531,9 @@ collections { signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; - target: "togbase"; - target: "elm.offtext"; - target: "elm.ontext"; + target: "button_image"; + target: "over1"; + target: "over2"; target: "disabler"; after: "disable_text"; } @@ -2174,18 +2546,15 @@ 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"; } @@ -2198,638 +2567,925 @@ 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/clock/flipdigit/default"; + 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: "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; - } - 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); - } - } + image: "hoversel_entry_bg.png" COMP; } parts { - part { name: "shad"; - mouse_events: 0; + part { name: "button_image"; + mouse_events: 1; 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; - } + color: 255 255 255 0; + image.normal: "hoversel_entry_bg.png"; + image.border: 0 0 2 2; + fill.smooth: 0; } - } - part { name: "base"; - 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; -// max: 24 48; - image.normal: "flip_base.png"; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; } } - part { name: "b"; - type: RECT; - mouse_events: 1; + part { name: "elm.swallow.content"; + type: SWALLOW; description { state: "default" 0.0; visible: 0; - rel1.to: "base"; - rel1.relative: 0.0 0.5; - rel2.to: "base"; - color: 0 0 0 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: "t"; - type: RECT; - mouse_events: 1; + part { name: "textvis"; + type: RECT; + mouse_events: 0; description { state: "default" 0.0; - visible: 0; - rel1.to: "base"; - rel2.to: "base"; - rel2.relative: 1.0 0.5; - color: 0 0 0 0; + visible: 0; } description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + visible: 1; } } - part { name: "bot0"; - mouse_events: 0; + part { + name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + clip_to: "textvis"; description { state: "default" 0.0; - rel1.to: "b"; - rel2.to: "b"; - image.normal: "flip_0b.png"; + 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"; + } } - description { state: "0" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; - image.normal: "flip_0b.png"; + text.min: 1 1; } - description { state: "1" 0.0; + description { state: "clicked" 0.0; inherit: "default" 0.0; - image.normal: "flip_1b.png"; + text.min: 1 1; + color: 0 0 0 255; + color3: 0 0 0 0; } - description { state: "2" 0.0; - inherit: "default" 0.0; - image.normal: "flip_2b.png"; + } + part { name: "over2"; + type: RECT; + mouse_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; } - description { state: "3" 0.0; - inherit: "default" 0.0; - image.normal: "flip_3b.png"; + } + } + 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: "4" 0.0; - inherit: "default" 0.0; - image.normal: "flip_4b.png"; + } + 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); } - description { state: "5" 0.0; - inherit: "default" 0.0; - image.normal: "flip_5b.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: "6" 0.0; - inherit: "default" 0.0; - image.normal: "flip_6b.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: "7" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; - image.normal: "flip_7b.png"; + color: 255 255 255 255; } - description { state: "8" 0.0; + description { state: "clicked" 0.0; inherit: "default" 0.0; - image.normal: "flip_8b.png"; + inherit: "visible" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - 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; + 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: "bot"; - mouse_events: 0; + part { name: "elm.swallow.content"; + type: SWALLOW; 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; - rel2.relative: 1.0 0.0; - image.normal: "flip_0b.png"; - } - description { state: "1" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_1b.png"; - } - description { state: "1h" 0.0; - inherit: "default" 0.0; + fixed: 1 0; visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_1b.png"; + align: 0.0 0.5; + rel1.offset: 4 4; + rel2.offset: 3 -5; + rel2.relative: 0.0 1.0; } - description { state: "2" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; + fixed: 1 0; visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_2b.png"; - } - description { state: "2h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_2b.png"; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel2.offset: 4 -5; } - description { state: "3" 0.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; + rel2.offset: -5 -5; rel2.relative: 1.0 1.0; - image.normal: "flip_3b.png"; + aspect_preference: VERTICAL; } - description { state: "3h" 0.0; - inherit: "default" 0.0; + } + part { + name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_3b.png"; + 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"; + } } - description { state: "4" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_4b.png"; + text.min: 1 1; } - description { state: "4h" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_4b.png"; + color: 0 0 0 128; + color3: 0 0 0 0; } - description { state: "5" 0.0; + description { state: "disabled_visible" 0.0; inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_5b.png"; + text.min: 1 1; } - description { state: "5h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_5b.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: "6" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_6b.png"; + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; } - description { state: "6h" 0.0; - inherit: "default" 0.0; - visible: 0; - rel2.relative: 1.0 0.0; - image.normal: "flip_6b.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: "7" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - image.normal: "flip_7b.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: "7h" 0.0; - inherit: "default" 0.0; + description { state: "disabled" 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; + } + 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; - rel2.relative: 1.0 0.0; - image.normal: "flip_8b.png"; } - description { state: "9" 0.0; + description { state: "disabled" 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"; + } + 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); } - description { state: "7" 0.0; - inherit: "default" 0.0; - image.normal: "flip_7t.png"; + } + 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); } - description { state: "8" 0.0; - inherit: "default" 0.0; - image.normal: "flip_8t.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: "9" 0.0; - inherit: "default" 0.0; - image.normal: "flip_9t.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); } + } + 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"; } - part { name: "top"; + 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/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; - visible: 1; - rel1.to: "t"; - rel2.to: "t"; - image.normal: "flip_0t.png"; + 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: "0" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_0t.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: "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"; + } + 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: "1" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_1t.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: "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"; + } + part { name: "button_events"; + type: RECT; + dragable { + events: "button"; } - description { state: "2" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "default" 0.0; + rel1.to_x: "bg"; + rel1.offset: 0 0; rel1.relative: 0.0 0.0; - image.normal: "flip_2t.png"; + rel2.to_x: "bg"; + rel2.offset: -1 -1; + rel2.relative: 1.0 1.0; + color: 0 0 0 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: "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: "3" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_3t.png"; + } + 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; } - 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: "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: "4" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_4t.png"; + image.normal: "tog_dis_base.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"; + } + 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: "5" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_5t.png"; + color: 128 128 128 128; } - 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"; + } + 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: "6" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_6t.png"; + color: 128 128 128 128; + color3: 0 0 0 24; } - 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"; + } + 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: "7" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_7t.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: "7h" 0.0; - inherit: "default" 0.0; - color: 128 128 128 255; + } + 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; + } + } + 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; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_7t.png"; + align: 0.0 0.5; + rel1.offset: 4 4; + rel2.relative: 0.0 1.0; + rel2.offset: 3 -5; } - description { state: "8" 0.0; + description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_8t.png"; + aspect: 1.0 1.0; + rel2.offset: 4 -5; } - description { state: "8h" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - color: 128 128 128 255; - visible: 0; - rel1.relative: 0.0 1.0; - image.normal: "flip_8t.png"; + color: 128 128 128 128; } - description { state: "9" 0.0; + description { state: "disabled_visible" 0.0; inherit: "default" 0.0; + color: 128 128 128 128; 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"; + aspect: 1.0 1.0; } } - part { name: "atop"; + part { name: "elm.text"; + type: TEXT; 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"; + 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; + text.min: 1 1; } } - part { name: "abot"; - mouse_events: 0; - scale: 1; + part { name: "disabler"; + type: RECT; description { state: "default" 0.0; + color: 0 0 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; + description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 1; } } } programs { - program { name: "load"; - signal: "load"; - source: ""; + program { name: "drag_end"; + signal: "mouse,up,1"; + source: "button"; script { - set_int(v0_cur, 0); - set_int(v0_pre, 0); - set_int(v0_lock, 0); - set_int(v0_next, -1); + 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: "edit_on"; - signal: "elm,state,edit,on"; + program { name: "toggle_on"; + signal: "elm,state,toggle,on"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "atop"; - target: "abot"; - target: "t"; - target: "b"; + script { + set_drag(PART:"button", 100.0, 0.0); + } } - program { name: "edit_off"; - signal: "elm,state,edit,off"; + program { name: "toggle_off"; + signal: "elm,state,toggle,off"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "atop"; - target: "abot"; - target: "t"; - target: "b"; + script { + set_drag(PART:"button", 0.0, 0.0); + } } - program { name: "up"; - signal: "mouse,down,1"; - source: "t"; - action: SIGNAL_EMIT "elm,action,up,start" ""; + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; } - program { name: "up,stop"; - signal: "mouse,up,1"; - source: "t"; - action: SIGNAL_EMIT "elm,action,up,stop" ""; + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; } - program { name: "down"; - signal: "mouse,down,1"; - source: "b"; - action: SIGNAL_EMIT "elm,action,down,start" ""; + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; } - program { name: "down,stop"; - signal: "mouse,up,1"; - source: "b"; - action: SIGNAL_EMIT "elm,action,down,stop" ""; + 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: "togbase"; + target: "elm.offtext"; + target: "elm.ontext"; + 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/clock/flipampm/default"; + group { name: "elm/clock/flipdigit/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: "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; } @@ -2905,15 +3561,14 @@ 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 - aspect: 0.5 0.5; min: 24 48; + aspect: 0.5 0.5; // max: 24 48; image.normal: "flip_base.png"; } @@ -2922,36 +3577,78 @@ 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_amb.png"; + image.normal: "flip_0b.png"; } description { state: "0" 0.0; inherit: "default" 0.0; - image.normal: "flip_amb.png"; + image.normal: "flip_0b.png"; } description { state: "1" 0.0; inherit: "default" 0.0; - image.normal: "flip_pmb.png"; + 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"; } } part { name: "sh"; @@ -2977,82 +3674,314 @@ collections { visible: 1; rel1.to: "b"; rel2.to: "b"; - image.normal: "flip_amb.png"; + 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_amb.png"; + image.normal: "flip_0b.png"; } description { state: "0h" 0.0; inherit: "default" 0.0; visible: 0; rel2.relative: 1.0 0.0; - image.normal: "flip_amb.png"; + image.normal: "flip_0b.png"; } description { state: "1" 0.0; inherit: "default" 0.0; visible: 1; rel2.relative: 1.0 1.0; - image.normal: "flip_pmb.png"; + image.normal: "flip_1b.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"; + image.normal: "flip_1b.png"; } - description { state: "0" 0.0; + description { state: "2" 0.0; inherit: "default" 0.0; - image.normal: "flip_amt.png"; + visible: 1; + rel2.relative: 1.0 1.0; + image.normal: "flip_2b.png"; } - description { state: "1" 0.0; + description { state: "2h" 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"; + visible: 0; + rel2.relative: 1.0 0.0; + image.normal: "flip_2b.png"; } - description { state: "0" 0.0; + description { state: "3" 0.0; inherit: "default" 0.0; visible: 1; - rel1.relative: 0.0 0.0; - image.normal: "flip_amt.png"; + rel2.relative: 1.0 1.0; + image.normal: "flip_3b.png"; } - description { state: "0h" 0.0; + 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"; + } + } + part { name: "top"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + rel1.to: "t"; + rel2.to: "t"; + image.normal: "flip_0t.png"; + } + description { state: "0" 0.0; + inherit: "default" 0.0; + visible: 1; + rel1.relative: 0.0 0.0; + image.normal: "flip_0t.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"; + image.normal: "flip_0t.png"; } description { state: "1" 0.0; inherit: "default" 0.0; visible: 1; rel1.relative: 0.0 0.0; - image.normal: "flip_pmt.png"; + image.normal: "flip_1t.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"; + 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"; } } part { name: "atop"; @@ -3107,16 +4036,18 @@ 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"; @@ -3140,1639 +4071,3134 @@ collections { } } - /////////////////////////////////////////////////////////////////////////////// - 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 +/////////////////////////////////////////////////////////////////////////////// + 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); + } + } } - 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; - } - } + 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); } - 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); + public message(Msg_Type:type, id, ...) { + if ((type == MSG_INT) && (id == 1)) { + new value, v, buf[11]; - if (v==1 && d==0) - run_program(PROGRAM:"selected_text"); - } - } - program { - name: "item_mouse_in_3"; - action : STATE_SET "visible" 0.0; - target: "item_image"; - target: "over1"; - transition: DECELERATE 0.5; - } - program { - name: "selected_text"; - action: STATE_SET "selected" 0.0; - target: "elm.text"; - transition: DECELERATE 0.5; - } - // - - // - program { - name: "item_mouse_out"; - signal: "mouse,out"; - source: "over2"; - after: "item_mouse_out_2"; - after: "item_mouse_out_3"; - } - program { - name: "item_mouse_out_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:"visible_text"); - } - } - program { - name: "item_mouse_out_3"; - action: STATE_SET "default" 0.0; - target: "item_image"; - target: "over1"; - transition: DECELERATE 0.5; - } - program { - name: "visible_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - transition: DECELERATE 0.5; - } - // - - program { - name: "item_unclick"; - signal: "mouse,up,1"; - source: "over2"; - action: STATE_SET "visible" 0.0; - target: "item_image"; - } - program { - name: "item_click2"; - signal: "mouse,down,1"; - source: "over3"; - action: STATE_SET "clicked" 0.0; - target: "over3"; - } - program { - name: "item_unclick2"; - signal: "mouse,up,1"; - source: "over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "over3"; - } - program { - name: "item_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 { - set_int(menu_text_visible, 1); - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - set_int(menu_text_visible, 0); - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "item_image"; - target: "item_image_disabled"; - target: "over1"; - target: "over2"; - target: "over_disabled"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new v; - v = get_int(menu_text_visible); - if (v==1) - set_state(PART:"elm.text", "disabled_visible", 0.0); - else if (v==0) - set_state(PART:"elm.text", "disabled", 0.0); - set_int(menu_disable, 1); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "item_image"; - target: "item_image_disabled"; - target: "over1"; - target: "over2"; - target: "over_disabled"; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new v; - v = get_int(menu_text_visible); - if (v==1) - set_state(PART:"elm.text", "visible", 0.0); - else if (v==0) - set_state(PART:"elm.text", "default", 0.0); - set_int(menu_disable, 0); - } - } - } - } - - group { name: "elm/menu/item_with_submenu/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; - } - script { - public menu_text_visible; //0:hide (default), 1:visible - public menu_disable; //0:enable, 1:disable + 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: "arrow"; - mouse_events: 1; - description { state: "default" 0.0; - color: 255 255 255 255; - align: 1.0 0.5; - aspect: 1 1; - aspect_preference: BOTH; - image { - normal: "arrow_right.png"; - } - } - } - 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; - } - } + } + 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); + + if (v==1 && d==0) + run_program(PROGRAM:"selected_text"); + } + } + program { + name: "item_mouse_in_3"; + action : STATE_SET "visible" 0.0; + target: "item_image"; + target: "over1"; + transition: DECELERATE 0.5; + } + program { + name: "selected_text"; + action: STATE_SET "selected" 0.0; + target: "elm.text"; + transition: DECELERATE 0.5; + } + // + + // + program { + name: "item_mouse_out"; + signal: "mouse,out"; + source: "over2"; + after: "item_mouse_out_2"; + after: "item_mouse_out_3"; + } + program { + name: "item_mouse_out_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:"visible_text"); + } + } + program { + name: "item_mouse_out_3"; + action: STATE_SET "default" 0.0; + target: "item_image"; + target: "over1"; + transition: DECELERATE 0.5; + } + program { + name: "visible_text"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + transition: DECELERATE 0.5; + } + // + + program { + name: "item_unclick"; + signal: "mouse,up,1"; + source: "over2"; + action: STATE_SET "visible" 0.0; + target: "item_image"; + } + program { + name: "item_click2"; + signal: "mouse,down,1"; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; + } + program { + name: "item_unclick2"; + signal: "mouse,up,1"; + source: "over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "over3"; + } + program { + name: "item_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 { + set_int(menu_text_visible, 1); + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + set_int(menu_text_visible, 0); + set_state(PART:"elm.text", "default", 0.0); + } + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "item_image"; + target: "item_image_disabled"; + target: "over1"; + target: "over2"; + target: "over_disabled"; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new v; + v = get_int(menu_text_visible); + if (v==1) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else if (v==0) + set_state(PART:"elm.text", "disabled", 0.0); + set_int(menu_disable, 1); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "item_image"; + target: "item_image_disabled"; + target: "over1"; + target: "over2"; + target: "over_disabled"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new v; + v = get_int(menu_text_visible); + if (v==1) + set_state(PART:"elm.text", "visible", 0.0); + else if (v==0) + set_state(PART:"elm.text", "default", 0.0); + set_int(menu_disable, 0); + } + } + } + } + + group { name: "elm/menu/item_with_submenu/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; + } + 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: "arrow"; + mouse_events: 1; + description { state: "default" 0.0; + color: 255 255 255 255; + align: 1.0 0.5; + aspect: 1 1; + aspect_preference: BOTH; + image { + normal: "arrow_right.png"; + } + } + } + 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: "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); + + if (v==1 && d==0) + run_program(PROGRAM:"selected_text"); + } + } + program { + name: "item_mouse_in_3"; + action : STATE_SET "visible" 0.0; + target: "item_image"; + target: "over1"; + transition: DECELERATE 0.5; + } + program { + name: "selected_text"; + action: STATE_SET "selected" 0.0; + target: "elm.text"; + transition: DECELERATE 0.5; + } + // + + // + program { + name: "item_mouse_out"; + signal: "mouse,out"; + source: "over2"; + after: "item_mouse_out_2"; + after: "item_mouse_out_3"; + } + program { + name: "item_mouse_out_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:"visible_text"); + } + } + program { + name: "item_mouse_out_3"; + action: STATE_SET "default" 0.0; + target: "item_image"; + target: "over1"; + transition: DECELERATE 0.5; + } + program { + name: "visible_text"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + transition: DECELERATE 0.5; + } + // + + program { + name: "item_unclick"; + signal: "mouse,up,1"; + source: "over2"; + action: STATE_SET "visible" 0.0; + target: "item_image"; + } + program { + name: "item_click2"; + signal: "mouse,down,1"; + source: "over3"; + action: STATE_SET "clicked" 0.0; + target: "over3"; + } + program { + name: "item_unclick2"; + signal: "mouse,up,1"; + source: "over3"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "over3"; + } + program { + name: "item_unclick3"; + signal: "mouse,up,1"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { + name: "menu_open"; + signal: "mouse,in"; + source: "over2"; + action: SIGNAL_EMIT "elm,action,open" ""; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + set_int(menu_text_visible, 1); + set_state(PART:"elm.text", "visible", 0.0); + } + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + set_int(menu_text_visible, 0); + set_state(PART:"elm.text", "default", 0.0); } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "item_image"; + target: "item_image_disabled"; + target: "over1"; + target: "over2"; + target: "over_disabled"; + 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 if (!strcmp(st, "default")) + set_state(PART:"elm.text", "disabled", 0.0); } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - inherit: "visible" 0.0; - color: 0 0 0 128; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "item_image"; + target: "item_image_disabled"; + target: "over1"; + target: "over2"; + target: "over_disabled"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new v; + v = get_int(menu_text_visible); + if (v==1) + set_state(PART:"elm.text", "visible", 0.0); + else if (v==0) + set_state(PART:"elm.text", "default", 0.0); + set_int(menu_disable, 0); + } + } + } + } + + group { name: "elm/menu/separator/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/clock/base-all/default"; + parts { + part { name: "d0"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.0000000 0.0; + rel2.relative: 0.1250000 1.0; + } + } + part { name: "d1"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.1250000 0.0; + rel2.relative: 0.2500000 1.0; + } + } + part { name: "c0"; + type: SWALLOW; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.relative: 0.2500000 0.0; + rel2.relative: 0.3125000 1.0; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + text: ":"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } + } + } + part { name: "d2"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.3125000 0.0; + rel2.relative: 0.4375000 1.0; + } + } + part { name: "d3"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.4375000 0.0; + rel2.relative: 0.5625000 1.0; + } + } + // (if seconds) + part { name: "c1"; + type: SWALLOW; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.relative: 0.5625000 0.0; + rel2.relative: 0.6250000 1.0; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + text: ":"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } + } + } + // (if seconds) + part { name: "d4"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.6250000 0.0; + rel2.relative: 0.7500000 1.0; + } + } + // (if seconds) + part { name: "d5"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.7500000 0.0; + rel2.relative: 0.8750000 1.0; + } + } + // (if am_pm) + part { name: "ampm"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.8750000 0.0; + rel2.relative: 1.0 1.0; + } + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/clock/base-seconds/default"; + parts { + part { name: "d0"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.000000000 0.0; + rel2.relative: 0.142857143 1.0; + } + } + part { name: "d1"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.142857143 0.0; + rel2.relative: 0.285714286 1.0; + } + } + part { name: "c0"; + type: SWALLOW; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.relative: 0.285714286 0.0; + rel2.relative: 0.357142857 1.0; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + text: ":"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } + } + } + part { name: "d2"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.357142857 0.0; + rel2.relative: 0.500000000 1.0; + } + } + part { name: "d3"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.500000000 0.0; + rel2.relative: 0.642857143 1.0; + } + } + // (if seconds) + part { name: "c1"; + type: SWALLOW; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.relative: 0.642857143 0.0; + rel2.relative: 0.714285714 1.0; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + text: ":"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } + } + } + // (if seconds) + part { name: "d4"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.714285714 0.0; + rel2.relative: 0.857142857 1.0; + } + } + // (if seconds) + part { name: "d5"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.857142857 0.0; + rel2.relative: 1.000000000 1.0; + } + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/clock/base-am_pm/default"; + parts { + part { name: "d0"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.000000000 0.0; + rel2.relative: 0.181818182 1.0; + } + } + part { name: "d1"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.181818182 0.0; + rel2.relative: 0.363636364 1.0; + } + } + part { name: "c0"; + type: SWALLOW; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.relative: 0.363636364 0.0; + rel2.relative: 0.454545455 1.0; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + text: ":"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } + } + } + part { name: "d2"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.454545455 0.0; + rel2.relative: 0.636363636 1.0; + } + } + part { name: "d3"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.636363636 0.0; + rel2.relative: 0.818181818 1.0; + } + } + // (if am_pm) + part { name: "ampm"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.818181818 0.0; + rel2.relative: 1.0 1.0; + } + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/clock/base/default"; + parts { + part { name: "d0"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.000000000 0.0; + rel2.relative: 0.222222222 1.0; + } + } + part { name: "d1"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.222222222 0.0; + rel2.relative: 0.444444444 1.0; + } + } + part { name: "c0"; + type: SWALLOW; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.relative: 0.444444444 0.0; + rel2.relative: 0.555555556 1.0; + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + text: ":"; + size: 10; + min: 1 1; + align: 0.5 0.5; + } + } + } + part { name: "d2"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.555555556 0.0; + rel2.relative: 0.777777778 1.0; + } + } + part { name: "d3"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.777777778 0.0; + rel2.relative: 1.000000000 1.0; + } + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/frame/base/default"; + images { + image: "frame_1.png" COMP; + image: "frame_2.png" COMP; + image: "dia_grad.png" COMP; + } + parts { + part { name: "base0"; + mouse_events: 0; + 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: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 0; - rel2.relative: 1.0 0.5; + part { name: "base"; + mouse_events: 0; + description { state: "default" 0.0; + rel2.to: "elm.swallow.content"; + rel2.offset: 9 9; image { - normal: "bt_hilight.png"; - border: 7 7 7 0; + normal: "frame_2.png"; + border: 5 5 32 26; + middle: 0; } + fill.smooth : 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + } + 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: 6 6; + } + rel2 { + relative: 1.0 0.0; + offset: -7 6; + } + color: 0 0 0 64; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + max: 1 1; + align: 0.0 0.0; + } } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + } + part { name: "over"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.to: "elm.swallow.content"; + rel2.offset: 5 5; + image { + normal: "frame_1.png"; + border: 2 2 28 22; + middle: 0; + } + fill.smooth : 0; } } - part { name: "over_disabled"; - mouse_events: 0; + part { name: "elm.swallow.content"; + type: SWALLOW; 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; + align: 0.0 0.0; + rel1 { + to_y: "elm.text"; + relative: 0.0 1.0; + offset: 8 2; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + rel2.offset: -9 -9; } } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; + } + } + + group { name: "elm/frame/base/pad_small"; + parts { + part { name: "b0"; + mouse_events: 0; + type: RECT; + scale: 1; description { state: "default" 0.0; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } + visible: 0; + min: 4 4; + max: 4 4; + align: 0.0 0.0; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; + } + part { name: "b1"; + mouse_events: 0; + type: RECT; + scale: 1; + description { state: "default" 0.0; visible: 0; + min: 4 4; + max: 4 4; + align: 1.0 1.0; } } - part { name: "over3"; - mouse_events: 1; - repeat_events: 1; + part { name: "elm.swallow.content"; + type: SWALLOW; description { state: "default" 0.0; - color: 255 255 255 0; - image { - normal: "bt_glow.png"; - border: 12 12 12 12; + rel1 { + to: "b0"; + relative: 1.0 1.0; + offset: 0 0; + } + rel2 { + to: "b1"; + relative: 0.0 0.0; + offset: -1 -1; } - fill.smooth : 0; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + } + } + } + + group { name: "elm/frame/base/pad_medium"; + parts { + part { name: "b0"; + mouse_events: 0; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 8 8; + max: 8 8; + align: 0.0 0.0; } } - part { name: "disabler"; + part { name: "b1"; + mouse_events: 0; type: RECT; + scale: 1; description { state: "default" 0.0; - color: 0 0 0 0; visible: 0; + min: 8 8; + max: 8 8; + align: 1.0 1.0; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "b0"; + relative: 1.0 1.0; + offset: 0 0; + } + rel2 { + to: "b1"; + relative: 0.0 0.0; + offset: -1 -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); + } - if (v==1 && d==0) - run_program(PROGRAM:"selected_text"); + group { name: "elm/frame/base/pad_large"; + parts { + part { name: "b0"; + mouse_events: 0; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 16; + max: 16 16; + align: 0.0 0.0; } } - program { - name: "item_mouse_in_3"; - action : STATE_SET "visible" 0.0; - target: "item_image"; - target: "over1"; - transition: DECELERATE 0.5; - } - program { - name: "selected_text"; - action: STATE_SET "selected" 0.0; - target: "elm.text"; - transition: DECELERATE 0.5; - } - // - - // - program { - name: "item_mouse_out"; - signal: "mouse,out"; - source: "over2"; - after: "item_mouse_out_2"; - after: "item_mouse_out_3"; - } - program { - name: "item_mouse_out_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:"visible_text"); + part { name: "b1"; + mouse_events: 0; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 16; + max: 16 16; + align: 1.0 1.0; } } - program { - name: "item_mouse_out_3"; - action: STATE_SET "default" 0.0; - target: "item_image"; - target: "over1"; - transition: DECELERATE 0.5; - } - program { - name: "visible_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - transition: DECELERATE 0.5; + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "b0"; + relative: 1.0 1.0; + offset: 0 0; + } + rel2 { + to: "b1"; + relative: 0.0 0.0; + offset: -1 -1; + } + } } - // + } + } - program { - name: "item_unclick"; - signal: "mouse,up,1"; - source: "over2"; - action: STATE_SET "visible" 0.0; - target: "item_image"; - } - program { - name: "item_click2"; - signal: "mouse,down,1"; - source: "over3"; - action: STATE_SET "clicked" 0.0; - target: "over3"; - } - program { - name: "item_unclick2"; - signal: "mouse,up,1"; - source: "over3"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "over3"; - } - program { - name: "item_unclick3"; - signal: "mouse,up,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { - name: "menu_open"; - signal: "mouse,in"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,open" ""; + group { name: "elm/frame/base/pad_huge"; + parts { + part { name: "b0"; + mouse_events: 0; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 32 32; + max: 32 32; + align: 0.0 0.0; + } } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - set_int(menu_text_visible, 1); - set_state(PART:"elm.text", "visible", 0.0); + part { name: "b1"; + mouse_events: 0; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 32 32; + max: 32 32; + align: 1.0 1.0; } } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - set_int(menu_text_visible, 0); - set_state(PART:"elm.text", "default", 0.0); + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + to: "b0"; + relative: 1.0 1.0; + offset: 0 0; + } + rel2 { + to: "b1"; + relative: 0.0 0.0; + offset: -1 -1; + } } } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "item_image"; - target: "item_image_disabled"; - target: "over1"; - target: "over2"; - target: "over_disabled"; - target: "disabler"; - after: "disable_text"; + } + } + + group { name: "elm/frame/base/outdent_top"; + images { + image: "outdent-top.png" COMP; + } + parts { + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "outdent-top.png"; + image.border: 0 0 0 13; + fill.smooth: 0; + } } - 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 if (!strcmp(st, "default")) - set_state(PART:"elm.text", "disabled", 0.0); + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.offset: 2 2; + rel2.offset: -3 -13; } } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "item_image"; - target: "item_image_disabled"; - target: "over1"; - target: "over2"; - target: "over_disabled"; - target: "disabler"; - after: "enable_text"; + } + } + + group { name: "elm/frame/base/outdent_bottom"; + images { + image: "outdent-bottom.png" COMP; + } + parts { + part { name: "base0"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "outdent-bottom.png"; + image.border: 0 0 13 0; + fill.smooth: 0; + } } - program { name: "enable_text"; - script { - new v; - v = get_int(menu_text_visible); - if (v==1) - set_state(PART:"elm.text", "visible", 0.0); - else if (v==0) - set_state(PART:"elm.text", "default", 0.0); - set_int(menu_disable, 0); + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.offset: 2 12; + rel2.offset: -3 -3; } } } } - group { name: "elm/menu/separator/default"; +/////////////////////////////////////////////////////////////////////////////// + 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: "separator_h.png" COMP; + 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: "separator"; // separator group + part { name: "clipper"; + type: RECT; description { state: "default" 0.0; - min: 2 2; - rel1.offset: 4 4; - rel2.offset: -5 -5; - image { - normal: "separator_h.png"; + 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; } - fill { - smooth: 0; + 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; } + } + } + } + /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/clock/base-all/default"; + + /* TODO: replicate diagonal swallow slots to the other hover styles */ + group { name: "elm/hover/base/default"; + images { + image: "shad_circ.png" COMP; + } parts { - part { name: "d0"; - type: SWALLOW; + 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: "elm.swallow.size"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.0000000 0.0; - rel2.relative: 0.1250000 1.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: "d1"; - type: SWALLOW; + part { name: "base"; + type: RECT; + mouse_events: 1; description { state: "default" 0.0; - rel1.relative: 0.1250000 0.0; - rel2.relative: 0.2500000 1.0; + color: 0 0 0 64; } } - part { name: "c0"; - type: SWALLOW; - type: TEXT; + part { name: "shad"; mouse_events: 0; - scale: 1; description { state: "default" 0.0; - rel1.relative: 0.2500000 0.0; - rel2.relative: 0.3125000 1.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - text: ":"; - size: 10; - min: 1 1; - align: 0.5 0.5; - } + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.size"; + rel1.offset: -32 -32; + rel2.to: "elm.swallow.size"; + rel2.offset: 31 31; + fill.smooth: 0; } } - part { name: "d2"; - type: SWALLOW; + part { name: "box"; + type: RECT; + mouse_events: 0; description { state: "default" 0.0; - rel1.relative: 0.3125000 0.0; - rel2.relative: 0.4375000 1.0; + color: 0 0 0 0; + rel1.to: "elm.swallow.size"; + rel1.offset: -2 -2; + rel2.to: "elm.swallow.size"; + rel2.offset: 1 1; } } - part { name: "d3"; - type: SWALLOW; + part { name: "elm.swallow.slot.left"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.4375000 0.0; - rel2.relative: 0.5625000 1.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; } } - // (if seconds) - part { name: "c1"; - type: SWALLOW; - type: TEXT; - mouse_events: 0; - scale: 1; + part { name: "elm.swallow.slot.top-left"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.5625000 0.0; - rel2.relative: 0.6250000 1.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - text: ":"; - size: 10; - min: 1 1; - align: 0.5 0.5; - } + 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; } } - // (if seconds) - part { name: "d4"; - type: SWALLOW; + part { name: "elm.swallow.slot.top"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.6250000 0.0; - rel2.relative: 0.7500000 1.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; } } - // (if seconds) - part { name: "d5"; - type: SWALLOW; + part { name: "elm.swallow.slot.top-right"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.7500000 0.0; - rel2.relative: 0.8750000 1.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; } } - // (if am_pm) - part { name: "ampm"; - type: SWALLOW; + part { name: "elm.swallow.slot.right"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.8750000 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: "elm.swallow.slot.middle"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "elm.swallow.size"; + rel2.to: "elm.swallow.size"; } } } + programs { + program { name: "end"; + signal: "mouse,up,1"; + source: "base"; + action: SIGNAL_EMIT "elm,action,dismiss" ""; + } + } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/clock/base-seconds/default"; + group { name: "elm/hover/base/popout"; + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } parts { - part { name: "d0"; - type: SWALLOW; + part { name: "elm.swallow.offset"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.000000000 0.0; - rel2.relative: 0.142857143 1.0; + align: 0.0 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 0.0; } } - part { name: "d1"; - type: SWALLOW; + part { name: "elm.swallow.size"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.142857143 0.0; - rel2.relative: 0.285714286 1.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: "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: "leftclip"; + type: RECT; + description { state: "default" 0.0; + rel2.to_x: "pop"; + rel2.relative: 0.0 1.0; + rel2.offset: 1 -1; + } + } + part { name: "left"; + clip_to: "leftclip"; + description { state: "default" 0.0; + visible: 0; + rel1.to: "elm.swallow.slot.left"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.left"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "elm.swallow.slot.left"; + type: SWALLOW; + clip_to: "leftclip"; + description { state: "default" 0.0; + align: 0.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; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.offset: -7 0; + rel2.offset: -7 -1; + align: 1.0 0.5; } } - part { name: "c0"; - type: SWALLOW; - type: TEXT; - mouse_events: 0; - scale: 1; + part { name: "leftover"; + clip_to: "leftclip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.relative: 0.285714286 0.0; - rel2.relative: 0.357142857 1.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - text: ":"; - size: 10; - min: 1 1; - align: 0.5 0.5; + rel1.to: "left"; + rel2.to: "left"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; } } } - part { name: "d2"; - type: SWALLOW; + part { name: "rightclip"; + type: RECT; description { state: "default" 0.0; - rel1.relative: 0.357142857 0.0; - rel2.relative: 0.500000000 1.0; + rel1.to_x: "pop"; + rel1.relative: 1.0 0.0; + rel1.offset: -2 0; } } - part { name: "d3"; - type: SWALLOW; + part { name: "right"; + clip_to: "rightclip"; description { state: "default" 0.0; - rel1.relative: 0.500000000 0.0; - rel2.relative: 0.642857143 1.0; + visible: 0; + rel1.to: "elm.swallow.slot.right"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.right"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - // (if seconds) - part { name: "c1"; - type: SWALLOW; - type: TEXT; - mouse_events: 0; - scale: 1; + part { name: "elm.swallow.slot.right"; + type: SWALLOW; + clip_to: "rightclip"; description { state: "default" 0.0; - rel1.relative: 0.642857143 0.0; - rel2.relative: 0.714285714 1.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - text: ":"; - size: 10; - min: 1 1; - align: 0.5 0.5; - } + align: 1.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; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.offset: 6 0; + rel2.offset: 6 -1; + align: 0.0 0.5; } } - // (if seconds) - part { name: "d4"; - type: SWALLOW; + part { name: "rightover"; + clip_to: "rightclip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.relative: 0.714285714 0.0; - rel2.relative: 0.857142857 1.0; + rel1.to: "right"; + rel2.to: "right"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } } - // (if seconds) - part { name: "d5"; - type: SWALLOW; + part { name: "topclip"; + type: RECT; description { state: "default" 0.0; - rel1.relative: 0.857142857 0.0; - rel2.relative: 1.000000000 1.0; + rel2.to_y: "pop"; + rel2.relative: 1.0 0.0; + rel2.offset: -1 1; } } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/clock/base-am_pm/default"; - parts { - part { name: "d0"; - type: SWALLOW; + part { name: "top"; + clip_to: "topclip"; description { state: "default" 0.0; - rel1.relative: 0.000000000 0.0; - rel2.relative: 0.181818182 1.0; + visible: 0; + rel1.to: "elm.swallow.slot.top"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.top"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "d1"; - type: SWALLOW; + part { name: "elm.swallow.slot.top"; + type: SWALLOW; + clip_to: "topclip"; description { state: "default" 0.0; - rel1.relative: 0.181818182 0.0; - rel2.relative: 0.363636364 1.0; + visible: 1; + align: 0.5 0.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; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.offset: 0 -7; + rel2.offset: -1 -7; + align: 0.5 1.0; } } - part { name: "c0"; - type: SWALLOW; - type: TEXT; - mouse_events: 0; - scale: 1; + part { name: "topover"; + clip_to: "topclip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.relative: 0.363636364 0.0; - rel2.relative: 0.454545455 1.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - text: ":"; - size: 10; - min: 1 1; - align: 0.5 0.5; + rel1.to: "top"; + rel2.to: "top"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; } } } - part { name: "d2"; - type: SWALLOW; + part { name: "bottomclip"; + type: RECT; description { state: "default" 0.0; - rel1.relative: 0.454545455 0.0; - rel2.relative: 0.636363636 1.0; + rel1.to_y: "pop"; + rel1.relative: 0.0 1.0; + rel1.offset: -1 -2; } } - part { name: "d3"; - type: SWALLOW; + part { name: "bottom"; + clip_to: "bottomclip"; description { state: "default" 0.0; - rel1.relative: 0.636363636 0.0; - rel2.relative: 0.818181818 1.0; + visible: 0; + rel1.to: "elm.swallow.slot.bottom"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.bottom"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - // (if am_pm) - part { name: "ampm"; - type: SWALLOW; + part { name: "elm.swallow.slot.bottom"; + type: SWALLOW; + clip_to: "bottomclip"; description { state: "default" 0.0; - rel1.relative: 0.818181818 0.0; + align: 0.5 1.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; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.offset: 0 6; + rel2.offset: -1 6; + align: 0.5 0.0; } } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/clock/base/default"; - parts { - part { name: "d0"; - type: SWALLOW; + part { name: "bottomover"; + clip_to: "bottomclip"; + mouse_events: 0; description { state: "default" 0.0; - rel1.relative: 0.000000000 0.0; - rel2.relative: 0.222222222 1.0; + rel1.to: "bottom"; + rel2.to: "bottom"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } } - part { name: "d1"; - type: SWALLOW; + part { name: "shad"; + mouse_events: 0; description { state: "default" 0.0; - rel1.relative: 0.222222222 0.0; - rel2.relative: 0.444444444 1.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.size"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.size"; + rel2.offset: 63 63; + fill.smooth: 0; } } - part { name: "c0"; - type: SWALLOW; - type: TEXT; - mouse_events: 0; - scale: 1; + part { name: "pop"; + mouse_events: 1; description { state: "default" 0.0; - rel1.relative: 0.444444444 0.0; - rel2.relative: 0.555555556 1.0; - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - text: ":"; - size: 10; - min: 1 1; - align: 0.5 0.5; + rel1.to: "elm.swallow.slot.middle"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.middle"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; } + image.middle: SOLID; } } - part { name: "d2"; - type: SWALLOW; + part { name: "elm.swallow.slot.middle"; + type: SWALLOW; description { state: "default" 0.0; - rel1.relative: 0.555555556 0.0; - rel2.relative: 0.777777778 1.0; + rel1.to: "elm.swallow.size"; + rel2.to: "elm.swallow.size"; } } - part { name: "d3"; - type: SWALLOW; + part { name: "popover"; + mouse_events: 0; description { state: "default" 0.0; - rel1.relative: 0.777777778 0.0; - rel2.relative: 1.000000000 1.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } } } + 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; +// transition: DECELERATE 0.5; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } + + program { name: "leftshow"; + signal: "elm,action,slot,left,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "left"; + target: "elm.swallow.slot.left"; + } + program { name: "lefthide"; + signal: "elm,action,slot,left,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "left"; + target: "elm.swallow.slot.left"; + } + program { name: "rightshow"; + signal: "elm,action,slot,right,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "right"; + target: "elm.swallow.slot.right"; + } + program { name: "righthide"; + signal: "elm,action,slot,right,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "right"; + target: "elm.swallow.slot.right"; + } + program { name: "topshow"; + signal: "elm,action,slot,top,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "top"; + target: "elm.swallow.slot.top"; + } + program { name: "tophide"; + signal: "elm,action,slot,top,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "top"; + target: "elm.swallow.slot.top"; + } + program { name: "bottomshow"; + signal: "elm,action,slot,bottom,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "bottom"; + target: "elm.swallow.slot.bottom"; + } + program { name: "bottomhide"; + signal: "elm,action,slot,bottom,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "bottom"; + target: "elm.swallow.slot.bottom"; + } + } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/frame/base/default"; + //In the hover used by the menu only the bottom part is used. + group { name: "elm/hover/base/menu"; images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; } parts { - part { name: "base0"; - mouse_events: 0; + part { name: "elm.swallow.offset"; + type: SWALLOW; 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; - } - } + align: 0.0 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 0.0; } } - part { name: "base"; - mouse_events: 0; - description { state: "default" 0.0; - rel2.to: "elm.swallow.content"; - rel2.offset: 9 9; - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - fill.smooth : 0; + 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: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; + part { name: "base"; + type: RECT; + mouse_events: 1; description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 0 1; - rel1 { - relative: 0.0 0.0; - offset: 6 6; - } - rel2 { - relative: 1.0 0.0; - offset: -7 6; - } + color: 0 0 0 0; + } + description { state: "visible" 0.0; + inherit: "default" 1.0; color: 0 0 0 64; - text { - font: "Sans:style=Bold,Edje-Vera-Bold"; - size: 10; - min: 1 1; - max: 1 1; - align: 0.0 0.0; - } } } - part { name: "over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.to: "elm.swallow.content"; - rel2.offset: 5 5; + part { name: "elm.swallow.slot.left"; + type: SWALLOW; + description { state: "default" 0.0; + } + } + part { name: "elm.swallow.slot.right"; + type: SWALLOW; + description { state: "default" 0.0; + } + } + part { name: "elm.swallow.slot.top"; + type: SWALLOW; + description { state: "default" 0.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + } + } + part { name: "bottomclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to_y: "pop"; + rel1.relative: 0.0 1.0; + rel1.offset: -1 -2; + } + } + part { name: "bottom"; + clip_to: "bottomclip"; + description { state: "default" 0.0; + visible: 0; + rel1.to: "elm.swallow.slot.bottom"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.bottom"; + rel2.offset: 4 4; image { - normal: "frame_1.png"; - border: 2 2 28 22; - middle: 0; + normal: "bt_dis_base.png"; + border: 4 4 4 4; } - fill.smooth : 0; + image.middle: SOLID; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "elm.swallow.content"; + part { name: "elm.swallow.slot.bottom"; type: SWALLOW; + clip_to: "bottomclip"; description { state: "default" 0.0; - align: 0.0 0.0; - rel1 { - to_y: "elm.text"; - relative: 0.0 1.0; - offset: 8 2; - } - rel2.offset: -9 -9; + align: 0.5 1.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; } - } - } - } - - group { name: "elm/frame/base/pad_small"; - parts { - part { name: "b0"; - mouse_events: 0; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 0; - min: 4 4; - max: 4 4; - align: 0.0 0.0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.offset: 0 6; + rel2.offset: -1 6; + align: 0.5 0.0; } } - part { name: "b1"; - mouse_events: 0; - type: RECT; - scale: 1; + part { name: "pop"; + mouse_events: 1; + repeat_events:1; description { state: "default" 0.0; - visible: 0; - min: 4 4; - max: 4 4; - align: 1.0 1.0; + rel1.to: "elm.swallow.slot.middle"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.middle"; + rel2.offset: 4 4; } } - part { name: "elm.swallow.content"; + part { name: "elm.swallow.slot.middle"; type: SWALLOW; + repeat_events:1; description { state: "default" 0.0; - rel1 { - to: "b0"; - relative: 1.0 1.0; - offset: 0 0; - } - rel2 { - to: "b1"; - relative: 0.0 0.0; - offset: -1 -1; - } + rel1.to: "elm.swallow.size"; + rel2.to: "elm.swallow.size"; } } } + 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; + // transition: DECELERATE 0.5; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + // transition: DECELERATE 0.5; + target: "base"; + } + program { name: "bottomshow"; + signal: "elm,action,slot,bottom,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.3; + target: "bottom"; + target: "elm.swallow.slot.bottom"; + } + program { name: "bottomhide"; + signal: "elm,action,slot,bottom,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "bottom"; + target: "elm.swallow.slot.bottom"; + } + } } - group { name: "elm/frame/base/pad_medium"; + //In the hover used by the submenu only the bottom part is used + //and no part should interact except the bottom area + group { name: "elm/hover/base/submenu"; + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + } parts { - part { name: "b0"; - mouse_events: 0; - type: RECT; - scale: 1; + part { name: "elm.swallow.offset"; + type: SWALLOW; + repeat_events:1; description { state: "default" 0.0; - visible: 0; - min: 8 8; - max: 8 8; align: 0.0 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.0 0.0; } } - part { name: "b1"; - mouse_events: 0; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 0; - min: 8 8; - max: 8 8; - align: 1.0 1.0; - } - } - part { name: "elm.swallow.content"; + part { name: "elm.swallow.size"; type: SWALLOW; description { state: "default" 0.0; - rel1 { - to: "b0"; - relative: 1.0 1.0; - offset: 0 0; - } - rel2 { - to: "b1"; - relative: 0.0 0.0; - offset: -1 -1; - } + 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; } } - } - } - - group { name: "elm/frame/base/pad_large"; - parts { - part { name: "b0"; - mouse_events: 0; + //here we do non catch events like the hover hover does + part { name: "base"; type: RECT; - scale: 1; + mouse_events: 1; description { state: "default" 0.0; + color: 0 0 0 0; visible: 0; - min: 16 16; - max: 16 16; - align: 0.0 0.0; } } - part { name: "b1"; - mouse_events: 0; - type: RECT; - scale: 1; + part { name: "elm.swallow.slot.left"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - min: 16 16; - max: 16 16; - align: 1.0 1.0; } } - part { name: "elm.swallow.content"; + part { name: "elm.swallow.slot.right"; type: SWALLOW; description { state: "default" 0.0; - rel1 { - to: "b0"; - relative: 1.0 1.0; - offset: 0 0; - } - rel2 { - to: "b1"; - relative: 0.0 0.0; - offset: -1 -1; - } } } - } - } - - group { name: "elm/frame/base/pad_huge"; - parts { - part { name: "b0"; - mouse_events: 0; - type: RECT; - scale: 1; + part { name: "elm.swallow.slot.top"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - min: 32 32; - max: 32 32; - align: 0.0 0.0; } } - part { name: "b1"; - mouse_events: 0; + part { name: "bottomclip"; type: RECT; - scale: 1; description { state: "default" 0.0; - visible: 0; - min: 32 32; - max: 32 32; - align: 1.0 1.0; + rel1.to_y: "pop"; + rel1.relative: 0.0 1.0; + rel1.offset: -1 -2; } } - part { name: "elm.swallow.content"; - type: SWALLOW; + part { name: "bottom"; + clip_to: "bottomclip"; description { state: "default" 0.0; - rel1 { - to: "b0"; - relative: 1.0 1.0; - offset: 0 0; - } - rel2 { - to: "b1"; - relative: 0.0 0.0; - offset: -1 -1; + visible: 0; + rel1.to: "elm.swallow.slot.bottom"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.bottom"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; } + image.middle: SOLID; } - } - } - } - - group { name: "elm/frame/base/outdent_top"; - images { - image: "outdent-top.png" COMP; - } - parts { - part { name: "base0"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "outdent-top.png"; - image.border: 0 0 0 13; - fill.smooth: 0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "elm.swallow.content"; + part { name: "elm.swallow.slot.bottom"; type: SWALLOW; + clip_to: "bottomclip"; description { state: "default" 0.0; - rel1.offset: 2 2; - rel2.offset: -3 -13; + align: 0.5 1.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; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.offset: 0 6; + rel2.offset: -1 6; + align: 0.5 0.0; } } - } - } - - group { name: "elm/frame/base/outdent_bottom"; - images { - image: "outdent-bottom.png" COMP; - } - parts { - part { name: "base0"; - mouse_events: 0; + part { name: "pop"; + mouse_events: 1; + repeat_events:1; description { state: "default" 0.0; - image.normal: "outdent-bottom.png"; - image.border: 0 0 13 0; - fill.smooth: 0; + rel1.to: "elm.swallow.slot.middle"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.slot.middle"; + rel2.offset: 4 4; } } - part { name: "elm.swallow.content"; + part { name: "elm.swallow.slot.middle"; type: SWALLOW; + repeat_events:1; description { state: "default" 0.0; - rel1.offset: 2 12; - rel2.offset: -3 -3; + rel1.to: "elm.swallow.size"; + rel2.to: "elm.swallow.size"; } } } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/hover/base/default"; - images { - image: "shad_circ.png" COMP; - } - 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: "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: "base"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - color: 0 0 0 64; - } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.size"; - rel1.offset: -32 -32; - rel2.to: "elm.swallow.size"; - rel2.offset: 31 31; - fill.smooth: 0; - } - } - part { name: "box"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "elm.swallow.size"; - rel1.offset: -2 -2; - rel2.to: "elm.swallow.size"; - rel2.offset: 1 1; - } - } - 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.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.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.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.middle"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "elm.swallow.size"; - rel2.to: "elm.swallow.size"; - } - } - } - programs { - program { name: "end"; - signal: "mouse,up,1"; - source: "base"; - action: SIGNAL_EMIT "elm,action,dismiss" ""; - } - } - } - - group { name: "elm/hover/base/popout"; - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - 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: "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: "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: "leftclip"; - type: RECT; - description { state: "default" 0.0; - rel2.to_x: "pop"; - rel2.relative: 0.0 1.0; - rel2.offset: 1 -1; - } - } - part { name: "left"; - clip_to: "leftclip"; - description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.slot.left"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.left"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.swallow.slot.left"; + 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; + // transition: DECELERATE 0.5; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + // transition: DECELERATE 0.5; + target: "base"; + } + program { name: "bottomshow"; + signal: "elm,action,slot,bottom,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.3; + target: "bottom"; + target: "elm.swallow.slot.bottom"; + } + program { name: "bottomhide"; + signal: "elm,action,slot,bottom,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "bottom"; + target: "elm.swallow.slot.bottom"; + } + } + } + + group { name: "elm/hover/base/hoversel_vertical/default"; + alias: "elm/hover/base/hoversel_vertical/entry"; + images { +// image: "shad_circ.png" COMP; + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + image: "outdent-top.png" COMP; + image: "outdent-bottom.png" COMP; + } + parts { + part { name: "elm.swallow.offset"; type: SWALLOW; - clip_to: "leftclip"; description { state: "default" 0.0; - align: 0.0 0.5; - rel1.to: "elm.swallow.slot.middle"; + align: 0.0 0.0; 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; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1.offset: -7 0; - rel2.offset: -7 -1; - align: 1.0 0.5; + rel2.relative: 0.0 0.0; } } - part { name: "leftover"; - clip_to: "leftclip"; - mouse_events: 0; + part { name: "elm.swallow.size"; + type: SWALLOW; description { state: "default" 0.0; - rel1.to: "left"; - rel2.to: "left"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 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: "rightclip"; - type: RECT; +/* + part { name: "shad"; + mouse_events: 0; description { state: "default" 0.0; - rel1.to_x: "pop"; - rel1.relative: 1.0 0.0; - rel1.offset: -2 0; + image.normal: "shad_circ.png"; + rel1.to: "button_image"; + rel1.offset: -64 -64; + rel2.to: "button_image"; + rel2.offset: 63 63; + fill.smooth: 0; } } - part { name: "right"; - clip_to: "rightclip"; + */ + part { name: "button_image"; + mouse_events: 1; description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.slot.right"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.right"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; + rel1.to_x: "elm.swallow.slot.top"; + rel1.to_y: "elm.swallow.slot.top"; + rel1.offset: -2 -6; + rel2.to_x: "elm.swallow.slot.top"; + rel2.to_y: "elm.swallow.slot.bottom"; + rel2.offset: 1 5; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; } image.middle: SOLID; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + description { state: "bottom" 0.0; + rel1.to_x: "elm.swallow.slot.bottom"; + rel1.to_y: "elm.swallow.slot.top"; + rel1.offset: -2 -6; + rel2.to_x: "elm.swallow.slot.bottom"; + rel2.to_y: "elm.swallow.slot.bottom"; + rel2.offset: 1 5; + image { + normal: "bt_base2.png"; + border: 7 7 7 7; + } + image.middle: SOLID; } } - part { name: "elm.swallow.slot.right"; - type: SWALLOW; - clip_to: "rightclip"; + + part { name: "base"; + type: RECT; + mouse_events: 1; description { state: "default" 0.0; - align: 1.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; + color: 0 0 0 0; } description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1.offset: 6 0; - rel2.offset: 6 -1; - align: 0.0 0.5; - } - } - part { name: "rightover"; - clip_to: "rightclip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "right"; - rel2.to: "right"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + inherit: "default" 1.0; + color: 0 0 0 64; } } + part { name: "topclip"; type: RECT; description { state: "default" 0.0; - rel2.to_y: "pop"; + rel2.to_y: "edge_top"; rel2.relative: 1.0 0.0; - rel2.offset: -1 1; - } - } - part { name: "top"; - clip_to: "topclip"; - description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.slot.top"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.top"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + rel2.offset: -1 7; } } part { name: "elm.swallow.slot.top"; @@ -4795,44 +7221,13 @@ collections { align: 0.5 1.0; } } - part { name: "topover"; - clip_to: "topclip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "top"; - rel2.to: "top"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } + part { name: "bottomclip"; type: RECT; description { state: "default" 0.0; - rel1.to_y: "pop"; + rel1.to_y: "edge_bottom"; rel1.relative: 0.0 1.0; - rel1.offset: -1 -2; - } - } - part { name: "bottom"; - clip_to: "bottomclip"; - description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.slot.bottom"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.bottom"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + rel1.offset: -1 -8; } } part { name: "elm.swallow.slot.bottom"; @@ -4854,4502 +7249,8784 @@ collections { align: 0.5 0.0; } } - part { name: "bottomover"; - clip_to: "bottomclip"; + + part { name: "over1"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "bottom"; - rel2.to: "bottom"; + rel1.to: "button_image"; + rel2.to: "button_image"; rel2.relative: 1.0 0.5; image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; + 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: "shad"; - mouse_events: 0; + part { name: "edge_top"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + to: "elm.swallow.size"; + offset: 0 -10; + } + rel2 { + to: "elm.swallow.size"; + } + image.normal: "outdent-bottom.png"; + image.border: 0 0 13 0; + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "edge_bottom"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + to: "elm.swallow.size"; + } + rel2 { + to: "elm.swallow.size"; + offset: -1 9; + } + image.normal: "outdent-top.png"; + image.border: 0 0 0 13; + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "elm.swallow.slot.middle"; + type: SWALLOW; description { state: "default" 0.0; - image.normal: "shad_circ.png"; rel1.to: "elm.swallow.size"; - rel1.offset: -64 -64; rel2.to: "elm.swallow.size"; - rel2.offset: 63 63; - fill.smooth: 0; } } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.middle"; - rel2.offset: 4 4; + } + 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; +// transition: DECELERATE 0.5; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } + program { name: "topshow"; + signal: "elm,action,slot,top,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "edge_top"; + after: "topshow2"; + } + program { name: "topshow2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.slot.top"; + } + program { name: "topshow3"; + signal: "elm,action,slot,top,show"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "button_image"; + } + program { name: "tophide"; + signal: "elm,action,slot,top,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.slot.top"; + after: "tophide2"; + } + program { name: "tophide2"; + action: STATE_SET "default" 0.0; + target: "edge_top"; + } + program { name: "bottomshow"; + signal: "elm,action,slot,bottom,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "edge_bottom"; + after: "bottomshow2"; + } + program { name: "bottomshow2"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.slot.bottom"; + } + program { name: "bottomshow3"; + signal: "elm,action,slot,bottom,show"; + source: "elm"; + action: STATE_SET "bottom" 0.0; + target: "button_image"; + } + program { name: "bottomhide"; + signal: "elm,action,slot,bottom,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.slot.bottom"; + after: "bottomhide2"; + } + program { name: "bottomhide2"; + action: STATE_SET "default" 0.0; + target: "edge_bottom"; + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + 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; + } + 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: "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_dis_base.png"; - border: 4 4 4 4; - } + normal: "bt_base2.png"; + border: 7 7 7 7; + } image.middle: SOLID; - } - } - part { name: "elm.swallow.slot.middle"; + } + 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; + 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; + } + description { state: "top-right" 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; + } + description { state: "right" 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; + 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; + } + 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; + } + description { state: "bottom-left" 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; + } + description { state: "left" 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: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } + 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"; + } + } } programs { - program { name: "end"; - signal: "mouse,up,1"; - source: "base"; - action: SIGNAL_EMIT "elm,action,dismiss" ""; - } - - program { name: "show"; + 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; -// transition: DECELERATE 0.5; - target: "base"; - } - program { name: "hide"; + 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; -// transition: DECELERATE 0.5; - target: "base"; - } - - program { name: "leftshow"; - signal: "elm,action,slot,left,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "left"; - target: "elm.swallow.slot.left"; - } - program { name: "lefthide"; - signal: "elm,action,slot,left,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "left"; - target: "elm.swallow.slot.left"; - } - program { name: "rightshow"; - signal: "elm,action,slot,right,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "right"; - target: "elm.swallow.slot.right"; - } - program { name: "righthide"; - signal: "elm,action,slot,right,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "right"; - target: "elm.swallow.slot.right"; - } - program { name: "topshow"; + 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 "visible" 0.0; - transition: DECELERATE 0.5; - target: "top"; - target: "elm.swallow.slot.top"; - } - program { name: "tophide"; - signal: "elm,action,slot,top,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "top"; - target: "elm.swallow.slot.top"; - } - program { name: "bottomshow"; + 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 "visible" 0.0; - transition: DECELERATE 0.5; - target: "bottom"; - target: "elm.swallow.slot.bottom"; - } - program { name: "bottomhide"; - signal: "elm,action,slot,bottom,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "bottom"; - target: "elm.swallow.slot.bottom"; - } + 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"; + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + 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"; + 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; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + clip_to: "disclip"; + 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; + 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"; + } + 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: "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"; + } } } - //In the hover used by the menu only the bottom part is used. - group { name: "elm/hover/base/menu"; - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - } - 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; +/////////////////////////////////////////////////////////////////////////////// + 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); } - } - 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; + } + 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: "base"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; + } + set_int(sbvis_timer, 0); + return 0; + } + } + 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; + } + 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"; + 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; } - description { state: "visible" 0.0; - inherit: "default" 1.0; - color: 0 0 0 64; + 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"; } - } - part { name: "elm.swallow.slot.left"; - type: SWALLOW; - description { state: "default" 0.0; + 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: "elm.swallow.slot.right"; - type: SWALLOW; - description { state: "default" 0.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; } - } - part { name: "elm.swallow.slot.top"; - type: SWALLOW; - description { state: "default" 0.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); } - description { state: "visible" 0.0; - inherit: "default" 0.0; + } + } + 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); + } } - } - part { name: "bottomclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to_y: "pop"; - rel1.relative: 0.0 1.0; - rel1.offset: -1 -2; + } + } + 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); } - } - part { name: "bottom"; - clip_to: "bottomclip"; - description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.slot.bottom"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.bottom"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + } + } + 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); + } } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + } + } + 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); } - } - part { name: "elm.swallow.slot.bottom"; - type: SWALLOW; - clip_to: "bottomclip"; - description { state: "default" 0.0; - align: 0.5 1.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; + 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"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.3; + target: "focus_highlight"; + } + } + } + +/////////////////////////////////////////////////////////////////////////////// +// 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"; + } + 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: "visible" 0.0; - inherit: "default" 0.0; - rel1.offset: 0 6; - rel2.offset: -1 6; - align: 0.5 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_textblock_disabled_style"; + min: 0 1; } - } - part { name: "pop"; - mouse_events: 1; - repeat_events:1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.middle"; - rel2.offset: 4 4; + } + } + } + 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"; + 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"; + } + } + 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; } - } - part { name: "elm.swallow.slot.middle"; - type: SWALLOW; - repeat_events:1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.size"; - rel2.to: "elm.swallow.size"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_textblock_disabled_style_charwrap"; + min: 0 1; } - } - } - 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; - // transition: DECELERATE 0.5; - target: "base"; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - // transition: DECELERATE 0.5; - target: "base"; - } - program { name: "bottomshow"; - signal: "elm,action,slot,bottom,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.3; - target: "bottom"; - target: "elm.swallow.slot.bottom"; - } - program { name: "bottomhide"; - signal: "elm,action,slot,bottom,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "bottom"; - target: "elm.swallow.slot.bottom"; - } - } + } + } + } + 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"; + } + } } - //In the hover used by the submenu only the bottom part is used - //and no part should interact except the bottom area - group { name: "elm/hover/base/submenu"; - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - } - parts { - part { name: "elm.swallow.offset"; - type: SWALLOW; - repeat_events:1; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 0.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; + } + } + */ + } + 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"; + 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"; + } + } + 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; } - } - 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; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_single_textblock_disabled_style"; } - } - //here we do non catch events like the hover hover does - part { name: "base"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 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"; + } + } + } + + 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; } - } - part { name: "elm.swallow.slot.left"; - type: SWALLOW; - description { state: "default" 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_single_textblock_disabled_style"; } - } - part { name: "elm.swallow.slot.right"; - type: SWALLOW; - description { state: "default" 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"; + } + } + } + + 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; } - } - part { name: "elm.swallow.slot.top"; - type: SWALLOW; - description { state: "default" 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_textblock_disabled_style"; } - } - part { name: "bottomclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to_y: "pop"; - rel1.relative: 0.0 1.0; - rel1.offset: -1 -2; + } + } + } + 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"; + 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; } - } - part { name: "bottom"; - clip_to: "bottomclip"; - description { state: "default" 0.0; - visible: 0; - rel1.to: "elm.swallow.slot.bottom"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.bottom"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_textblock_disabled_style_charwrap"; } - 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"; + } + } + } + + 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; } - } - part { name: "elm.swallow.slot.bottom"; - type: SWALLOW; - clip_to: "bottomclip"; - description { state: "default" 0.0; - align: 0.5 1.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; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_textblock_disabled_style"; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1.offset: 0 6; - rel2.offset: -1 6; - align: 0.5 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"; + } + } + } + + 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; } - } - part { name: "pop"; - mouse_events: 1; - repeat_events:1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.slot.middle"; - rel2.offset: 4 4; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_single_textblock_disabled_style"; } - } - part { name: "elm.swallow.slot.middle"; - type: SWALLOW; - repeat_events:1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.size"; - rel2.to: "elm.swallow.size"; + } + } + } + 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; } - } - } - 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; - // transition: DECELERATE 0.5; - target: "base"; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - // transition: DECELERATE 0.5; - target: "base"; - } - program { name: "bottomshow"; - signal: "elm,action,slot,bottom,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.3; - target: "bottom"; - target: "elm.swallow.slot.bottom"; - } - program { name: "bottomhide"; - signal: "elm,action,slot,bottom,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "bottom"; - target: "elm.swallow.slot.bottom"; - } - } + } + 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; + } + } + } } - group { name: "elm/hover/base/hoversel_vertical/default"; - alias: "elm/hover/base/hoversel_vertical/entry"; - images { -// image: "shad_circ.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "outdent-top.png" COMP; - image: "outdent-bottom.png" COMP; + 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; + } + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + 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: "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; + 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; + } + } + 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; + } + } + } + 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; + } + } + } + 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; + 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; + } + 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; + } + } + } + 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; + } + } + 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_shine4.png"; + border: 5 36 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"; } - 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: "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: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "button_image"; - rel1.offset: -64 -64; - rel2.to: "button_image"; - rel2.offset: 63 63; - fill.smooth: 0; - } - } - */ - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to_x: "elm.swallow.slot.top"; - rel1.to_y: "elm.swallow.slot.top"; - rel1.offset: -2 -6; - rel2.to_x: "elm.swallow.slot.top"; - rel2.to_y: "elm.swallow.slot.bottom"; - rel2.offset: 1 5; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "bottom" 0.0; - rel1.to_x: "elm.swallow.slot.bottom"; - rel1.to_y: "elm.swallow.slot.top"; - rel1.offset: -2 -6; - rel2.to_x: "elm.swallow.slot.bottom"; - rel2.to_y: "elm.swallow.slot.bottom"; - rel2.offset: 1 5; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - } - - 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; - } - } + program { + name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.icon"; + } + } + } - part { name: "topclip"; - type: RECT; - description { state: "default" 0.0; - rel2.to_y: "edge_top"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 7; - } - } - part { name: "elm.swallow.slot.top"; - type: SWALLOW; - clip_to: "topclip"; - description { state: "default" 0.0; - visible: 1; - align: 0.5 0.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; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1.offset: 0 -7; - rel2.offset: -1 -7; - align: 0.5 1.0; - } - } + group { name: "elm/bubble/bottom_left/default"; + images { + 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 1.0; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + to_y: "elm.text"; + relative: 0.0 0.0; + offset: 4 0; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -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 { + to_x: "elm.swallow.icon"; + relative: 1.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 { + relative: 1.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_1.png"; + border: 36 11 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"; + } + } + } - part { name: "bottomclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to_y: "edge_bottom"; - rel1.relative: 0.0 1.0; - rel1.offset: -1 -8; - } - } - part { name: "elm.swallow.slot.bottom"; - type: SWALLOW; - clip_to: "bottomclip"; - description { state: "default" 0.0; - align: 0.5 1.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; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1.offset: 0 6; - rel2.offset: -1 6; - align: 0.5 0.0; - } - } + 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"; + } + } + } - 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: "edge_top"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - rel1 { - to: "elm.swallow.size"; - offset: 0 -10; - } - rel2 { - to: "elm.swallow.size"; - } - image.normal: "outdent-bottom.png"; - image.border: 0 0 13 0; - fill.smooth: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "edge_bottom"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - rel1 { - to: "elm.swallow.size"; - } - rel2 { - to: "elm.swallow.size"; - offset: -1 9; - } - image.normal: "outdent-top.png"; - image.border: 0 0 0 13; - fill.smooth: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "elm.swallow.slot.middle"; - type: SWALLOW; +/////////////////////////////////////////////////////////////////////////////// + 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"; + mouse_events: 0; description { state: "default" 0.0; - rel1.to: "elm.swallow.size"; - rel2.to: "elm.swallow.size"; + image.normal: "dia_grad.png"; + rel1.to: "over"; + rel2.to: "over"; + fill { + smooth: 0; + size { + relative: 0.0 1.0; + offset: 64 0; + } + } } } - } - 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; -// transition: DECELERATE 0.5; - target: "base"; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; -// transition: DECELERATE 0.5; - target: "base"; - } - program { name: "topshow"; - signal: "elm,action,slot,top,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "edge_top"; - after: "topshow2"; - } - program { name: "topshow2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "elm.swallow.slot.top"; - } - program { name: "topshow3"; - signal: "elm,action,slot,top,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - } - program { name: "tophide"; - signal: "elm,action,slot,top,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "elm.swallow.slot.top"; - after: "tophide2"; - } - program { name: "tophide2"; - action: STATE_SET "default" 0.0; - target: "edge_top"; - } - program { name: "bottomshow"; - signal: "elm,action,slot,bottom,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "edge_bottom"; - after: "bottomshow2"; - } - program { name: "bottomshow2"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.5; - target: "elm.swallow.slot.bottom"; - } - program { name: "bottomshow3"; - signal: "elm,action,slot,bottom,show"; - source: "elm"; - action: STATE_SET "bottom" 0.0; - target: "button_image"; - } - program { name: "bottomhide"; - signal: "elm,action,slot,bottom,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "elm.swallow.slot.bottom"; - after: "bottomhide2"; + part { name: "base"; + mouse_events: 0; + description { state: "default" 0.0; + image { + normal: "frame_2.png"; + border: 5 5 32 26; + middle: 0; + } + fill.smooth : 0; + } } - program { name: "bottomhide2"; - action: STATE_SET "default" 0.0; - target: "edge_bottom"; + part { name: "head"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + aspect: 1.0 1.0; + aspect_preference: BOTH; + image.normal: "head.png"; + } } - } - } - -/////////////////////////////////////////////////////////////////////////////// -// 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"; + part { name: "clip"; + mouse_events: 0; + type: RECT; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + } + } + part { name: "over"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + image { + normal: "frame_1.png"; + border: 2 2 28 22; + middle: 0; + } + fill.smooth: 0; + } + } + } + } + + group { name: "elm/photo/base/shadow"; + images { + image: "shadow.png" COMP; + image: "black.png" COMP; + } + script { + public message(Msg_Type:type, id, ...) { + if( (type==MSG_INT_SET) && (id==0) ) + { + new w; + new h; + + custom_state(PART:"size", "default", 0.0); + + w = getarg(2); + h = getarg(3); + set_state_val(PART:"size", STATE_REL1_OFFSET, - w/2, - h/2); + set_state_val(PART:"size", STATE_REL2_OFFSET, w/2 + 1, h/2 + 1); + set_state(PART:"size", "custom", 0.0); + } + } + } + parts { + part { name: "size"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.5 0.5; + rel2.relative: 0.5 0.5; + } + } + part { + name: "shadow"; + type: IMAGE; + repeat_events: 1; + description { + state: "default" 0.0; + rel1.to: "size"; + rel2.to: "size"; + rel1.relative: -0.06 -0.06; + rel2.relative: 1.07 1.07; + image.normal: "shadow.png"; + } + } + + + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.offset: 3 3; + rel2.offset: -3 -3; + fixed: 1 1; + } + } + + part { + name: "border"; + type: IMAGE; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 255; + rel1.to: "size"; + rel2.to: "size"; + image.normal: "black.png"; + image.border: 1 1 1 1; + image.middle: 0; + } + } + } + } + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/thumb/base/default"; + images { + image: "frame_1.png" COMP; + image: "frame_2.png" COMP; + image: "dia_grad.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: "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.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; + part { name: "base0"; + mouse_events: 0; + 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: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - min: 0 1; + } + part { name: "base"; + mouse_events: 0; + description { state: "default" 0.0; + image { + normal: "frame_2.png"; + border: 5 5 32 26; + middle: 0; } + fill.smooth : 0; } } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; + part { name: "clip"; + mouse_events: 0; + type: RECT; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + color: 255 255 255 255; + } } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; + part { name: "elm.swallow.content"; + type: SWALLOW; + clip_to: "clip"; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + } } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; + part { name: "progress"; + mouse_events: 0; + + clip_to: "clip"; + 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; + } + } + } + part { name: "over"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + image { + normal: "frame_1.png"; + border: 2 2 28 22; + middle: 0; + } + fill.smooth: 0; + } + } + 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/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"; - } - } + 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: "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.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 + part { name: "elm.swallow.content"; + type: SWALLOW; description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_style_charwrap"; - min: 0 1; - } + rel1.offset: 4 4; + rel2.offset: -5 -5; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style_charwrap"; - min: 0 1; + } + 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: "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"; + 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/entry/base-nowrap/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; +/////////////////////////////////////////////////////////////////////////////// + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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; + 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/toolbar/base/default"; + images { + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + image: "bt_dis_shine.png" COMP; + image: "icon_left_arrow.png" COMP; + image: "icon_right_arrow.png" COMP; + } 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: "base"; + mouse_events: 1; + description { state: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: 2 2; + } + rel2.offset: -3 -3; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; } - } - 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; + } + part { name: "clipper"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "base"; + offset: 2 2; + } + rel2 { + to: "base"; + offset: -3 -3; + } + } + } + part { name: "elm.swallow.content"; + clip_to: "clipper"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1.to: "clipper"; + rel2.to: "clipper"; + } + } + part { name: "over2"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + image { + normal: "bt_dis_shine.png"; + border: 4 4 4 4; + } + } + } + part { name: "over1"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + color: 255 255 255 128; + } + } + part { name: "left_arrow"; mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - max: 16 16; + description { state: "default" 0.0; + image.normal: "icon_left_arrow.png"; aspect: 1.0 1.0; - color: 255 0 0 0; - } - description { state: "visible" 0.0; + aspect_preference: VERTICAL; + align: 0.0 0.5; + min: 32 32; + max: 32 32; + } + description { state: "hidden" 0.0; inherit: "default" 0.0; - color: 255 0 0 50; + visible: 0; + color: 255 255 255 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"; - } - */ - } - } - - 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"; } + } + part { name: "right_arrow"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "icon_right_arrow.png"; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + align: 1.0 0.5; + min: 32 32; + max: 32 32; } - } - 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; + description { state: "hidden" 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/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"; } + visible: 0; + color: 255 255 255 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; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } + } + part { name: "event"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 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"; - } + program { name: "sb_hbar_show"; + signal: "elm,action,show,hbar"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.5; + target: "left_arrow"; + target: "right_arrow"; + } + program { name: "sb_hbar_hide"; + signal: "elm,action,hide,hbar"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "left_arrow"; + target: "right_arrow"; + transition: LINEAR 0.5; + } } } - 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: "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.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"; - } - } - } - } - 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/toolbar/item/default"; + 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; + rel1.to: "elm.text"; + rel2.to: "elm.text"; + color: 0 0 0 255; + text { + font: "Sans"; + text_source: "elm.text"; + 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; + 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: "bg"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + image { + normal: "toolbar_sel.png"; + border: 3 3 0 0; + } + image.middle: SOLID; + fill.smooth: 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + } + 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; + rel1 { + relative: 0.0 0.0; + offset: 2 2; + } + rel2 { + to_y: "elm.text"; + relative: 1.0 0.0; + offset: -3 -1; + } + 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; + 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.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; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + } + programs { + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "elm.text"; + target: "label2"; + target: "elm.text_new"; + target: "label2_new"; + transition: LINEAR 0.2; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "elm.text"; + target: "label2"; + target: "elm.text_new"; + target: "label2_new"; + transition: LINEAR 0.1; + } + program { name: "go"; + signal: "mouse,up,1"; + 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"; + } + 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); + set_state(PART:"elm.text_new", "disabled_visible", 0.0); + } + else + { + set_state(PART:"elm.text", "disabled", 0.0); + set_state(PART:"elm.text_new", "disabled", 0.0); + } + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "label2"; + target: "label2_new"; + target: "bg"; + 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); + set_state(PART:"elm.text_new", "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"; + } + } } - 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"; + group { name: "elm/toolbar/separator/default"; + images { + image: "toolbar_separator_v.png" COMP; + } 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.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; + part { name: "separator"; // separator group + description { state: "default" 0.0; + min: 2 2; + max: 2 9999; + rel1.offset: 4 4; + rel2.offset: -5 -5; + image { + normal: "toolbar_separator_v.png"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style_charwrap"; + 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"; - } - } } - - 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"; } - } - } - 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/notify/block_events/default"; + parts { + part { name: "block_events"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 64; + visible: 1; + } + } + } + programs { + program { + name: "block_clicked"; + signal: "mouse,clicked,1"; + source: "block_events"; + action: SIGNAL_EMIT "elm,action,clicked" "elm"; + } + } + } + group { name: "elm/notify/top/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: 0.0 -1.0; + rel2.relative: 1.0 0.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } + } + group { name: "elm/notify/center/default"; + //this group is a design similar to the inwin group + images { + image: "bt_dis_base.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } + } + group { name: "elm/notify/bottom/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: 0.0 1.0; + rel2.relative: 1.0 2.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } } - - 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"; } - } - } - 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/notify/left/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } } - - 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: "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/notify/right/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } + } + group { name: "elm/notify/top_left/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: 0.0 -1.0; + rel2.relative: 1.0 0.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } } - - 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/notify/top_right/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: 0.0 -1.0; + rel2.relative: 1.0 0.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } } - - 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; - } - } - } + group { name: "elm/notify/bottom_left/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: 0.0 1.0; + rel2.relative: 1.0 2.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } + } + group { name: "elm/notify/bottom_right/default"; + //this group is a design similar to the inwin group + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.offset: 10 10; + rel2.offset: -10 -10; + rel1.relative: 0.0 1.0; + rel2.relative: 1.0 2.0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { name: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "base"; + } + program { name: "show_2"; + signal: "show"; + action: STATE_SET "default" 0.0; + target: "base"; + after: "show_3"; + } + program { name: "show_3"; + signal: "show"; + action: STATE_SET "visible" 0.0; + target: "base"; + transition: LINEAR 0.5; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + } } -/////////////////////////////////////////////////////////////////////////////// - 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; - } - } - 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; - } - } - } - 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; - } - } - } - 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: "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; - } - } - 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; - } - 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; - } - } - } - 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/slideshow/base/default"; + data { + item: transitions "fade black_fade horizontal vertical square"; + item: layouts "fullscreen not_fullscreen"; } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 9 16; - } - rel2 { - to: "base0"; - offset: -10 -9; - } - } + parts { + part { name: "whole"; + type: RECT; + description { + state: "default" 0.0; + visible: 1; + color: 20 20 20 255; + } + } + part { name: "image_1_whole"; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "fade_prev_next" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + } + description { + state: "black_fade_prev_next_init" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "black_fade_prev_next" 0.0; + inherit: "default" 0.0; + color: 0 0 0 255; + } + description { + state: "horizontal_next_init" 0.0; + inherit: "default" 0.0; + } + description { + state: "horizontal_next" 0.0; + inherit: "default" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { + state: "horizontal_prev_init" 0.0; + inherit: "default" 0.0; + } + description { + state: "horizontal_prev" 0.0; + inherit: "default" 0.0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + description { + state: "vertical_next_init" 0.0; + inherit: "default" 0.0; + } + description { + state: "vertical_next" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 -1.0; + rel2.relative: 1.0 0.0; + } + description { + state: "vertical_prev_init" 0.0; + inherit: "default" 0.0; + } + description { + state: "vertical_prev" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 1.0; + rel2.relative: 1.0 2.0; + } + description { + state: "square_prev_next" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + } + } + part { name: "image_2_whole"; + description { + state: "default" 0.0; + visible: 1; + color: 255 255 255 0; + } + description { + state: "fade_prev_next" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "black_fade_prev_next_init" 0.0; + inherit: "default" 0.0; + color: 0 0 0 0; + } + description { + state: "black_fade_prev_next" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "horizontal_next_init" 0.0; + inherit: "default" 0.0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + color: 255 255 255 255; + } + description { + state: "horizontal_next" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "horizontal_prev_init" 0.0; + inherit: "default" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + color: 255 255 255 255; + } + description { + state: "horizontal_prev" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "vertical_next_init" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 1.0; + rel2.relative: 1.0 2.0; + color: 255 255 255 255; + } + description { + state: "vertical_next" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "vertical_prev_init" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 -1.0; + rel2.relative: 1.0 0.0; + color: 255 255 255 255; + } + description { + state: "vertical_prev" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "square_prev_next_init" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.5 0.5; + rel2.relative: 0.5 0.5; + color: 255 255 255 255; + } + description { + state: "square_prev_next" 0.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.1"; + type: SWALLOW; + clip_to: "image_1_whole"; + description { + state: "default" 0.0; + rel1.to: "image_1_whole"; + rel2.to: "image_1_whole"; + color: 255 255 255 255; + } + description { + state: "not_fullscreen" 0.0; + rel1.relative: 0.1 0.1; + rel1.to: "image_1_whole"; + rel2.relative: 0.9 0.9; + rel2.to: "image_1_whole"; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.2"; + type: SWALLOW; + clip_to: "image_2_whole"; + description { + state: "default" 0.0; + color: 255 255 255 255; + rel1.to: "image_2_whole"; + rel2.to: "image_2_whole"; + } + description { + state: "not_fullscreen" 0.0; + color: 255 255 255 255; + rel1.relative: 0.1 0.1; + rel1.to: "image_2_whole"; + rel2.relative: 0.9 0.9; + rel2.to: "image_2_whole"; + } + } + part { name: "events_catcher"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 0; + } + } } - 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; + programs { + //Substyle + program { name: "layout_fullscreen"; + signal: "layout,fullscreen"; + source: "slideshow"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.1"; + target: "elm.swallow.2"; + transition: SINUSOIDAL 1.0; } + program { name: "layout_not_fullscreen"; + signal: "layout,not_fullscreen"; + source: "slideshow"; + action: STATE_SET "not_fullscreen" 0.0; + target: "elm.swallow.1"; + target: "elm.swallow.2"; + transition: SINUSOIDAL 1.0; + } + // + program { name: "fade_next"; + signal: "fade,next"; + source: "slideshow"; + action: STATE_SET "default" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "fade_next_2"; + } + program { name: "fade_next_2"; + action: STATE_SET "fade_prev_next" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + transition: SINUSOIDAL 1.5; + after: "end"; + } + program { name: "fade_previous"; + signal: "fade,previous"; + source: "slideshow"; + action: STATE_SET "default" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "fade_previous_2"; + } + program { name: "fade_previous_2"; + action: STATE_SET "fade_prev_next" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + transition: SINUSOIDAL 1.5; + after: "end"; + } + program { name: "black_fade_next"; + signal: "black_fade,next"; + source: "slideshow"; + action: STATE_SET "black_fade_prev_next_init" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "black_fade_next_2"; + } + program { name: "black_fade_next_2"; + action: STATE_SET "black_fade_prev_next" 0.0; + target: "image_1_whole"; + transition: SINUSOIDAL 0.75; + after: "black_fade_next_3"; + } + program { name: "black_fade_next_3"; + action: STATE_SET "black_fade_prev_next" 0.0; + target: "image_2_whole"; + transition: SINUSOIDAL 0.75; + after: "end"; + } + program { name: "black_fade_previous"; + signal: "black_fade,previous"; + source: "slideshow"; + action: STATE_SET "black_fade_prev_next_init" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "black_fade_previous_2"; + } + program { name: "black_fade_previous_2"; + action: STATE_SET "black_fade_prev_next" 0.0; + target: "image_1_whole"; + transition: SINUSOIDAL 0.75; + after: "black_fade_previous_3"; + } + program { name: "black_fade_previous_3"; + action: STATE_SET "black_fade_prev_next" 0.0; + target: "image_2_whole"; + transition: SINUSOIDAL 0.75; + after: "end"; + } + program { name: "horizontal_next"; + signal: "horizontal,next"; + source: "slideshow"; + action: STATE_SET "horizontal_next_init" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "horizontal_next_2"; + } + program { name: "horizontal_next_2"; + action: STATE_SET "horizontal_next" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + transition: SINUSOIDAL 1.5; + after: "end"; + } + program { name: "horizontal_previous"; + signal: "horizontal,previous"; + source: "slideshow"; + action: STATE_SET "horizontal_prev_init" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "horizontal_previous_2"; + } + program { name: "horizontal_previous_2"; + action: STATE_SET "horizontal_prev" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + transition: SINUSOIDAL 1.5; + after: "end"; + } + program { name: "vertical_next"; + signal: "vertical,next"; + source: "slideshow"; + action: STATE_SET "vertical_next_init" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "vertical_next_2"; + } + program { name: "vertical_next_2"; + action: STATE_SET "vertical_next" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + transition: SINUSOIDAL 1.5; + after: "end"; + } + program { name: "vertical_previous"; + signal: "vertical,previous"; + source: "slideshow"; + action: STATE_SET "vertical_prev_init" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + after: "vertical_previous_2"; + } + program { name: "vertical_previous_2"; + action: STATE_SET "vertical_prev" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + transition: SINUSOIDAL 1.5; + after: "end"; + } + program { name: "square_next"; + signal: "square,next"; + source: "slideshow"; + action: STATE_SET "square_prev_next_init" 0.0; + target: "image_2_whole"; + after: "square_next_2"; + } + program { name: "square_next_2"; + action: STATE_SET "square_prev_next" 0.0; + target: "image_2_whole"; + target: "image_1_whole"; + transition: SINUSOIDAL 1.5; + after: "end"; + } + program { name: "square_previous"; + signal: "square,previous"; + source: "slideshow"; + action: STATE_SET "square_prev_next_init" 0.0; + target: "image_2_whole"; + after: "square_next_2"; + } + program { name: "end"; + action: SIGNAL_EMIT "end" "slideshow"; + } + program { name: "end_signal"; + signal: "anim,end"; + source: "slideshow"; + action: STATE_SET "default" 0.0; + target: "image_1_whole"; + target: "image_2_whole"; + } } - } - 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/bottom_left/default"; - images { - image: "bubble_1.png" COMP; - image: "bubble_shine.png" COMP; - } - parts { - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 1; - visible: 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 0; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -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 { - to_x: "elm.swallow.icon"; - relative: 1.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 { - relative: 1.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_1.png"; - border: 36 11 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; - } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/win/inwin/default"; + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; } - } - programs { - program { - name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; + parts { + 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: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.1 0.1; + rel2.relative: 0.9 0.9; + } + } } - program { - name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } } - } - } + } - group { name: "elm/bubble/bottom_right/default"; - images { - image: "bubble_2.png" COMP; - image: "bubble_shine.png" COMP; - } - parts { - 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; - } + group { name: "elm/win/inwin/minimal"; + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; } - 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; - } - } + parts { + 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: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + rel1.relative: 0.5 0.5; + rel2.relative: 0.5 0.5; + } + } } - 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; - } - } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } } - 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; - } + } + + group { name: "elm/win/inwin/minimal_vertical"; + images { + image: "shad_circ.png" COMP; + image: "bt_dis_base.png" COMP; + image: "bt_dis_hilight.png" COMP; } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { - to: "base0"; - offset: 9 8; - } - rel2 { - to: "base0"; - offset: -10 -17; - } - } + parts { + 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: "shad"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "shad_circ.png"; + rel1.to: "elm.swallow.content"; + rel1.offset: -64 -64; + rel2.to: "elm.swallow.content"; + rel2.offset: 63 63; + fill.smooth: 0; + } + } + part { name: "pop"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel1.offset: -5 -5; + rel2.to: "elm.swallow.content"; + rel2.offset: 4 4; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } + image.middle: SOLID; + } + } + part { name: "popover"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "pop"; + rel2.to: "pop"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 1; + rel1.relative: 0.1 0.5; + rel2.relative: 0.9 0.5; + } + } + } + programs { + program { name: "show"; + signal: "elm,action,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } + program { name: "hide"; + signal: "elm,action,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; +// transition: DECELERATE 0.5; + target: "base"; + } } - 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; - } + } + +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/list/item/default"; + data.item: "stacking" "above"; + 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; } - } - programs { - program { - name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; + 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"; + 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: 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.end"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { name: "elm.text"; + 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: 4 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"; + 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: "fg1"; + 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"; + 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.icon"; + 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/photo/base/default"; + } + group { name: "elm/list/item_odd/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.png" COMP; - image: "head.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: "base0"; - mouse_events: 0; - 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; - description { state: "default" 0.0; - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "head"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - aspect: 1.0 1.0; - aspect_preference: BOTH; - image.normal: "head.png"; - } - } - part { name: "clip"; - mouse_events: 0; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; + 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"; + 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: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - } - } - part { name: "over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - image { - normal: "frame_1.png"; - border: 2 2 28 22; - middle: 0; - } - fill.smooth: 0; - } - } - } - } - - group { name: "elm/photo/base/shadow"; - images { - image: "shadow.png" COMP; - image: "black.png" COMP; - } - script { - public message(Msg_Type:type, id, ...) { - if( (type==MSG_INT_SET) && (id==0) ) - { - new w; - new h; - - custom_state(PART:"size", "default", 0.0); - - w = getarg(2); - h = getarg(3); - set_state_val(PART:"size", STATE_REL1_OFFSET, - w/2, - h/2); - set_state_val(PART:"size", STATE_REL2_OFFSET, w/2 + 1, h/2 + 1); - set_state(PART:"size", "custom", 0.0); - } - } - } - parts { - part { name: "size"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.relative: 0.5 0.5; - rel2.relative: 0.5 0.5; - } - } - part { - name: "shadow"; - type: IMAGE; - repeat_events: 1; - description { - state: "default" 0.0; - rel1.to: "size"; - rel2.to: "size"; - rel1.relative: -0.06 -0.06; - rel2.relative: 1.07 1.07; - image.normal: "shadow.png"; - } - } - - - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.offset: 3 3; - rel2.offset: -3 -3; - fixed: 1 1; - } - } - - part { - name: "border"; - type: IMAGE; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - color: 0 0 0 255; - rel1.to: "size"; - rel2.to: "size"; - image.normal: "black.png"; - image.border: 1 1 1 1; - image.middle: 0; - } - } - } + 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: 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.end"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { + name: "elm.text"; + 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: 4 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"; + 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: "fg1"; + 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"; + 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; + } + } + } + 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/thumb/base/default"; + group { name: "elm/list/item_compress/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; images { - image: "frame_1.png" COMP; - image: "frame_2.png" COMP; - image: "dia_grad.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; + 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; + fixed: 1 1; + align: 0.0 0.0; + min: 0 10; + 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"; + 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: 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.end"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { + name: "elm.text"; + 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: 4 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"; + 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: "fg1"; + 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"; + 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; + } + } } - parts { - part { name: "base0"; - mouse_events: 0; - 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; - description { state: "default" 0.0; - image { - normal: "frame_2.png"; - border: 5 5 32 26; - middle: 0; - } - fill.smooth : 0; - } - } - part { name: "clip"; - mouse_events: 0; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - color: 255 255 255 255; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - } - } - part { name: "progress"; - mouse_events: 0; - - clip_to: "clip"; - 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; - } - } - } - part { name: "over"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.offset: 4 4; - rel2.offset: -5 -5; - image { - normal: "frame_1.png"; - border: 2 2 28 22; - middle: 0; - } - fill.smooth: 0; - } - } - 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"; - } - } + 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/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/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"; 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"; 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"; 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"; 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"; 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"; 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"; 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"; 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"; 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"; 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"; 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"; 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/toolbar/base/default"; + group { name: "elm/list/item_compress_odd/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; images { - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - image: "bt_dis_shine.png" COMP; - image: "icon_left_arrow.png" COMP; - image: "icon_right_arrow.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: "base"; - mouse_events: 1; + 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"; + 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; + offset: -2 -2; } - rel2.offset: -3 -3; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - image.middle: SOLID; } } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; rel1 { - to: "base"; - offset: 2 2; + relative: 0.0 0.0; + offset: 4 4; } rel2 { - to: "base"; - offset: -3 -3; + relative: 0.0 1.0; + offset: 4 -5; } } } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; + part { name: "elm.swallow.end"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } } } - part { name: "over2"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; - image { - normal: "bt_dis_shine.png"; - border: 4 4 4 4; + part { + name: "elm.text"; + 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: 4 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"; + 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: "over1"; + part { name: "fg1"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; rel2.relative: 1.0 0.5; + rel2.to: "bg"; image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - color: 255 255 255 128; - } - } - part { name: "left_arrow"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "icon_left_arrow.png"; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - align: 0.0 0.5; - min: 32 32; - max: 32 32; } - description { state: "hidden" 0.0; + description { state: "selected" 0.0; inherit: "default" 0.0; - visible: 0; - color: 255 255 255 0; + visible: 1; + color: 255 255 255 255; } } - part { name: "right_arrow"; + part { name: "fg2"; mouse_events: 0; description { state: "default" 0.0; - image.normal: "icon_right_arrow.png"; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - align: 1.0 0.5; - min: 32 32; - max: 32 32; - } - description { state: "hidden" 0.0; - inherit: "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: "event"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } } programs { - program { name: "sb_hbar_show"; - signal: "elm,action,show,hbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "left_arrow"; - target: "right_arrow"; + 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: "sb_hbar_hide"; - signal: "elm,action,hide,hbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "left_arrow"; - target: "right_arrow"; - transition: LINEAR 0.5; + 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/toolbar/item/default"; - images { - image: "toolbar_sel.png" COMP; - } - parts { - part { name: "label2"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.5 1.0; - fixed: 0 1; - rel1.to: "elm.text"; - rel2.to: "elm.text"; - color: 0 0 0 255; - text { - font: "Sans"; - text_source: "elm.text"; - size: 10; - min: 1 1; - align: 0.5 0.5; - } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/list/h_item/default"; + data.item: "stacking" "above"; + 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; + align: 0.0 0.0; + min: 10 0; + fixed: 1 1; + rel1 { + to: "base"; + relative: 1.0 0.0; + offset: 0 0; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 0; + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: 0 -1; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; + 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"; + 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: "disabled_visible" 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; + offset: 4 4; } - } - part { name: "bg"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - image { - normal: "toolbar_sel.png"; - border: 3 3 0 0; - } - image.middle: SOLID; - fill.smooth: 0; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - 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: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - color: 255 255 255 0; + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - 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; - } - rel2 { - to_y: "elm.text"; - relative: 1.0 0.0; - offset: -3 -1; - } - color: 0 0 0 0; + } + } + 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; } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - 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; - } + rel2 { + relative: 1.0 0.0; + offset: -5 4; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; + } + } + 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; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - text.min: 1 1; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - color3: 0 0 0 0; + } + } + part { name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + fixed: 0 1; + rel1 { + to_x: "elm.swallow.icon"; + relative: 0.0 1.0; + offset: 4 4; } - 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; + rel2 { + to_x: "elm.swallow.end"; + relative: 1.0 0.0; + offset: -5 -1; } - } - part { name: "event"; - type: RECT; - mouse_events: 1; - ignore_flags: ON_HOLD; - 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: 1 1; + align: 0.5 0.5; + text_class: "list_item"; } - } - } - programs { - program { name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "elm.text"; - target: "label2"; - transition: LINEAR 0.2; - } - program { name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "elm.text"; - target: "label2"; - transition: LINEAR 0.1; - } - program { name: "go"; - signal: "mouse,up,1"; - source: "event"; - action: SIGNAL_EMIT "elm,action,click" "elm"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "label2"; - target: "bg"; - 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: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "fg1"; + 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; } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "label2"; - target: "bg"; - 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: "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.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; + } + } + } + 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/toolbar/separator/default"; + group { name: "elm/list/h_item_odd/default"; + data.item: "stacking" "below"; + data.item: "selectraise" "on"; images { - image: "toolbar_separator_v.png" COMP; + 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: "separator"; // separator group + 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"; + mouse_events: 0; description { state: "default" 0.0; - min: 2 2; - max: 2 9999; - rel1.offset: 4 4; - rel2.offset: -5 -5; - image { - normal: "toolbar_separator_v.png"; - } - fill { - smooth: 0; - } - } - } - } - } - - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/notify/block_events/default"; - parts { - part { name: "block_events"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 64; - visible: 1; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; } - } - } - programs { - program { - name: "block_clicked"; - signal: "mouse,clicked,1"; - source: "block_events"; - action: SIGNAL_EMIT "elm,action,clicked" "elm"; - } - } - } - group { name: "elm/notify/top/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: 0.0 -1.0; - rel2.relative: 1.0 0.0; + rel2 { + relative: 1.0 1.0; + offset: 4 4; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 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: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + 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; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + 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"; + relative: 0.0 1.0; + offset: 4 4; + } + 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"; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "fg1"; + 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"; + 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; + } + } + } + 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; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: 0 -1; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + image { + normal: "ilist_item_shadow_h.png"; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - group { name: "elm/notify/center/default"; - //this group is a design similar to the inwin group - images { - image: "bt_dis_base.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; + 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; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } + fill.smooth: 0; + } + } + part { name: "bg"; + 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.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + rel2 { + relative: 1.0 1.0; + offset: 4 4; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - group { name: "elm/notify/bottom/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: 0.0 1.0; - rel2.relative: 1.0 2.0; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.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: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 0; + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + } + } + 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; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + rel2 { + relative: 1.0 0.0; + offset: -5 4; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + } + } + 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; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - group { name: "elm/notify/left/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; + } + } + 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"; + relative: 0.0 1.0; + offset: 4 4; } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 0; + rel2 { + to_x: "elm.swallow.end"; + relative: 1.0 0.0; + offset: -5 -1; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + 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"; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "fg1"; + 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.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + } + 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.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } + } + 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/notify/right/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; + 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; + } + } + part { name: "bg"; + 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; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; + rel2 { + relative: 1.0 1.0; + offset: 4 4; } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 0; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - 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; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + } + } + 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; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - group { name: "elm/notify/top_left/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: 0.0 -1.0; - rel2.relative: 1.0 0.0; + rel2 { + relative: 1.0 0.0; + offset: -5 4; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; + } + } + 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; } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 0; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + } + } + 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"; + relative: 0.0 1.0; + offset: 4 4; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + rel2 { + to_x: "elm.swallow.end"; + relative: 1.0 0.0; + offset: -5 -1; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + 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"; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - group { name: "elm/notify/top_right/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: 0.0 -1.0; - rel2.relative: 1.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"; + 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: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.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.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 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; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + rel2 { to: "bg"; + offset: -2 -1; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + 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; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + 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; + } + } + part { name: "level2"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + visible: 0; + rel1 { + to_y: "base"; + to_x: "elm.dragable.slider"; + relative: 0.5 0.0; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - group { name: "elm/notify/bottom_left/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: 0.0 1.0; - rel2.relative: 1.0 2.0; + 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; + } + description { state: "disabled_inverted" 0.0; + inherit: "default" 0.0; + color: 255 0 0 100; + visible: 1; + } + } + part { + name: "base_over"; + mouse_events: 0; + description { state: "default" 0.0; + 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; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.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: 48 24; + max: 99999 24; + align: 1.0 0.5; + rel1 { + to_x: "elm.text"; + relative: 1.0 0.0; + offset: 8 0; } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 0; + rel2 { + to_x: "elm.units"; + relative: 0.0 1.0; + offset: -10 -1; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 0; + align: 0.0 0.5; + rel1 { + offset: 4 0; + to_y: "elm.swallow.bar"; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + rel2 { + offset: 3 -1; + relative: 0.0 1.0; + to_y: "elm.swallow.bar"; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + } + 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.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"; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - group { name: "elm/notify/bottom_right/default"; - //this group is a design similar to the inwin group - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.offset: 10 10; - rel2.offset: -10 -10; - rel1.relative: 0.0 1.0; - rel2.relative: 1.0 2.0; + rel2 { + offset: -3 -1; + to_y: "elm.swallow.bar"; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - color: 0 0 0 64; - rel1.relative: 0.0 0.0; - rel2.relative: 1.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 -1; + } + } + part { name: "units"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1 { + to_x: "elm.units"; + offset: 0 5; } - } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 0; + rel2 { + to_x: "elm.units"; + offset: 5 -3; } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + image { + normal: "sl_units.png"; + border: 0 5 3 8; } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + 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; + } + } + part { name: "elm.dragable.slider"; + type: RECT; + mouse_events: 0; + scale: 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 { + relative: 0.5 0.0; + to_x: "bg"; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "base"; - rel2.to: "base"; + rel2 { + relative: 0.5 1.0; + to_x: "bg"; } - } - } - programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "show_2"; - signal: "show"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "show_3"; - } - program { name: "show_3"; - signal: "show"; - action: STATE_SET "visible" 0.0; - target: "base"; - transition: LINEAR 0.5; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/slideshow/base/default"; - data { - item: transitions "fade black_fade horizontal vertical square"; - item: layouts "fullscreen not_fullscreen"; - } - parts { - part { name: "whole"; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - color: 20 20 20 255; + color: 255 0 0 100; } } - part { name: "image_1_whole"; - description { - state: "default" 0.0; - color: 255 255 255 255; - } - description { - state: "fade_prev_next" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; + 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; + } + fill.smooth: 0; } - description { - state: "black_fade_prev_next_init" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + image { + normal: "sl_bt_3.png"; + border: 5 5 5 10; + } } - description { - state: "black_fade_prev_next" 0.0; - inherit: "default" 0.0; - color: 0 0 0 255; + } + 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; + } } - description { - state: "horizontal_next_init" 0.0; - inherit: "default" 0.0; + } + 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; } - description { - state: "horizontal_next" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; + } + part { name: "button3"; + mouse_events: 0; + description { state: "default" 0.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: -7 0; + } + rel2 { + to: "button4"; + relative: 0.0 1.0; + offset: -1 -1; + } + image { + normal: "sl_bt2_0_0.png"; + border: 6 0 6 12; + } + fill.smooth: 0; } - description { - state: "horizontal_prev_init" 0.0; - inherit: "default" 0.0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } - description { - state: "horizontal_prev" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; + } + part { name: "button4"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + max: 15 999; + min: 15 32; + rel1 { + to_x: "button0"; + to_y: "elm.indicator"; + offset: 0 0; + } + rel2.to: "button0"; + image { + normal: "sl_bt2_0_1.png"; + border: 0 0 6 12; + } + fill.smooth: 0; } - description { - state: "vertical_next_init" 0.0; - inherit: "default" 0.0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } - description { - state: "vertical_next" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 -1.0; - rel2.relative: 1.0 0.0; + } + part { name: "button5"; + mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + 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_bt2_0_2.png"; + border: 0 6 6 12; + } + fill.smooth: 0; } - description { - state: "vertical_prev_init" 0.0; - inherit: "default" 0.0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } - description { - state: "vertical_prev" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 1.0; - rel2.relative: 1.0 2.0; + } + 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"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.to: "button3"; + rel2 { + to: "button5"; + relative: 1.0 0.3; + offset: -1 -1; + } + image { + normal: "sl_bt2_1.png"; + border: 5 5 5 0; + } + fill.smooth: 0; } - description { - state: "square_prev_next" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "image_2_whole"; - description { - state: "default" 0.0; - visible: 1; - color: 255 255 255 0; - } - description { - state: "fade_prev_next" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + part { name: "button7"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.to: "button3"; + rel2.to: "button5"; + image { + normal: "sl_bt2_2.png"; + border: 5 5 5 0; + middle: 0; + } + fill.smooth: 0; } - description { - state: "black_fade_prev_next_init" 0.0; - inherit: "default" 0.0; - color: 0 0 0 0; + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } - description { - state: "black_fade_prev_next" 0.0; - inherit: "default" 0.0; - 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: "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); + } } - description { - state: "horizontal_next_init" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; - color: 255 255 255 255; + } + 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); + } } - description { - state: "horizontal_next" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + } + } + } + + 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_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); + } + } + parts { + part { name: "base"; + mouse_events: 0; + description { state: "default" 0.0; + max: 6 99999; + min: 6 0; + rel1 { to: "bg"; + offset: 1 0; + } + rel2 { to: "bg"; + offset: -2 -1; + } + image.normal: "slv_bg.png"; + fill.smooth: 0; } - description { - state: "horizontal_prev_init" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - color: 255 255 255 255; + } + part { name: "level"; + type: RECT; + 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; + } + color: 255 0 0 200; } - description { - state: "horizontal_prev" 0.0; + description { state: "inverted" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + visible: 0; } - description { - state: "vertical_next_init" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - rel1.relative: 0.0 1.0; - rel2.relative: 1.0 2.0; - color: 255 255 255 255; + color: 255 0 0 100; } - description { - state: "vertical_next" 0.0; + description { state: "disabled_inverted" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + visible: 0; } - description { - state: "vertical_prev_init" 0.0; - inherit: "default" 0.0; - rel1.relative: 0.0 -1.0; - rel2.relative: 1.0 0.0; - color: 255 255 255 255; + } + part { name: "level2"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + fixed: 1 1; + visible: 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: "vertical_prev" 0.0; + description { state: "inverted" 0.0; inherit: "default" 0.0; - color: 255 255 255 255; + visible: 1; } - description { - state: "square_prev_next_init" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - rel1.relative: 0.5 0.5; - rel2.relative: 0.5 0.5; - color: 255 255 255 255; + color: 255 0 0 100; } - description { - state: "square_prev_next" 0.0; + description { state: "disabled_inverted" 0.0; inherit: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - color: 255 255 255 255; + color: 255 0 0 100; + visible: 1; } } - part { name: "elm.swallow.1"; - type: SWALLOW; - clip_to: "image_1_whole"; - description { - state: "default" 0.0; - rel1.to: "image_1_whole"; - rel2.to: "image_1_whole"; - color: 255 255 255 255; - } - description { - state: "not_fullscreen" 0.0; - rel1.relative: 0.1 0.1; - rel1.to: "image_1_whole"; - rel2.relative: 0.9 0.9; - rel2.to: "image_1_whole"; - color: 255 255 255 255; + part { + name: "base_over"; + mouse_events: 0; + 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; + } + fill.smooth: 0; } } - part { name: "elm.swallow.2"; + 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.icon"; + 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: 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; - clip_to: "image_2_whole"; - description { + description { state: "default" 0.0; - color: 255 255 255 255; - rel1.to: "image_2_whole"; - rel2.to: "image_2_whole"; - } - description { - state: "not_fullscreen" 0.0; - color: 255 255 255 255; - rel1.relative: 0.1 0.1; - rel1.to: "image_2_whole"; - rel2.relative: 0.9 0.9; - rel2.to: "image_2_whole"; + 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; + rel1 { + to: "elm.units"; + offset: -8 0; + } + rel2 { + to: "elm.units"; + offset: 7 8; + } + image { + normal: "slv_units.png"; + border: 8 8 0 9; + } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; } } - part { name: "events_catcher"; + 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; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; + 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"; + } color: 0 0 0 0; } } - } - programs { - //Substyle - program { name: "layout_fullscreen"; - signal: "layout,fullscreen"; - source: "slideshow"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.1"; - target: "elm.swallow.2"; - transition: SINUSOIDAL 1.0; - } - program { name: "layout_not_fullscreen"; - signal: "layout,not_fullscreen"; - source: "slideshow"; - action: STATE_SET "not_fullscreen" 0.0; - target: "elm.swallow.1"; - target: "elm.swallow.2"; - transition: SINUSOIDAL 1.0; - } - // - program { name: "fade_next"; - signal: "fade,next"; - source: "slideshow"; - action: STATE_SET "default" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "fade_next_2"; - } - program { name: "fade_next_2"; - action: STATE_SET "fade_prev_next" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - transition: SINUSOIDAL 1.5; - after: "end"; - } - program { name: "fade_previous"; - signal: "fade,previous"; - source: "slideshow"; - action: STATE_SET "default" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "fade_previous_2"; - } - program { name: "fade_previous_2"; - action: STATE_SET "fade_prev_next" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - transition: SINUSOIDAL 1.5; - after: "end"; - } - program { name: "black_fade_next"; - signal: "black_fade,next"; - source: "slideshow"; - action: STATE_SET "black_fade_prev_next_init" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "black_fade_next_2"; - } - program { name: "black_fade_next_2"; - action: STATE_SET "black_fade_prev_next" 0.0; - target: "image_1_whole"; - transition: SINUSOIDAL 0.75; - after: "black_fade_next_3"; - } - program { name: "black_fade_next_3"; - action: STATE_SET "black_fade_prev_next" 0.0; - target: "image_2_whole"; - transition: SINUSOIDAL 0.75; - after: "end"; - } - program { name: "black_fade_previous"; - signal: "black_fade,previous"; - source: "slideshow"; - action: STATE_SET "black_fade_prev_next_init" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "black_fade_previous_2"; - } - program { name: "black_fade_previous_2"; - action: STATE_SET "black_fade_prev_next" 0.0; - target: "image_1_whole"; - transition: SINUSOIDAL 0.75; - after: "black_fade_previous_3"; - } - program { name: "black_fade_previous_3"; - action: STATE_SET "black_fade_prev_next" 0.0; - target: "image_2_whole"; - transition: SINUSOIDAL 0.75; - after: "end"; - } - program { name: "horizontal_next"; - signal: "horizontal,next"; - source: "slideshow"; - action: STATE_SET "horizontal_next_init" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "horizontal_next_2"; - } - program { name: "horizontal_next_2"; - action: STATE_SET "horizontal_next" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - transition: SINUSOIDAL 1.5; - after: "end"; - } - program { name: "horizontal_previous"; - signal: "horizontal,previous"; - source: "slideshow"; - action: STATE_SET "horizontal_prev_init" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "horizontal_previous_2"; - } - program { name: "horizontal_previous_2"; - action: STATE_SET "horizontal_prev" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - transition: SINUSOIDAL 1.5; - after: "end"; - } - program { name: "vertical_next"; - signal: "vertical,next"; - source: "slideshow"; - action: STATE_SET "vertical_next_init" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "vertical_next_2"; - } - program { name: "vertical_next_2"; - action: STATE_SET "vertical_next" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - transition: SINUSOIDAL 1.5; - after: "end"; - } - program { name: "vertical_previous"; - signal: "vertical,previous"; - source: "slideshow"; - action: STATE_SET "vertical_prev_init" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - after: "vertical_previous_2"; - } - program { name: "vertical_previous_2"; - action: STATE_SET "vertical_prev" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; - transition: SINUSOIDAL 1.5; - after: "end"; + 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: 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; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "sl_bt_3.png"; + border: 5 5 5 10; + } + } } - program { name: "square_next"; - signal: "square,next"; - source: "slideshow"; - action: STATE_SET "square_prev_next_init" 0.0; - target: "image_2_whole"; - after: "square_next_2"; + 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; + } + } } - program { name: "square_next_2"; - action: STATE_SET "square_prev_next" 0.0; - target: "image_2_whole"; - target: "image_1_whole"; - transition: SINUSOIDAL 1.5; - after: "end"; + 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; + } } - program { name: "square_previous"; - signal: "square,previous"; - source: "slideshow"; - action: STATE_SET "square_prev_next_init" 0.0; - target: "image_2_whole"; - after: "square_next_2"; + part { name: "button3"; + mouse_events: 0; + description { state: "default" 0.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; + } + rel2 { + to: "button4"; + relative: 0.0 1.0; + offset: -1 -1; + } + image { + normal: "sl_bt2_0_0.png"; + border: 6 0 6 12; + } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } } - program { name: "end"; - action: SIGNAL_EMIT "end" "slideshow"; + part { name: "button4"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + max: 15 999; + min: 15 32; + fixed: 1 1; + rel1 { + to_x: "button0"; + to_y: "elm.indicator"; + offset: 0 -7; + } + 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; + } } - program { name: "end_signal"; - signal: "anim,end"; - source: "slideshow"; - action: STATE_SET "default" 0.0; - target: "image_1_whole"; - target: "image_2_whole"; + part { name: "button5"; + mouse_events: 0; + description { state: "default" 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_bt2_0_2.png"; + border: 0 6 6 12; + } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/win/inwin/default"; - images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 1; + part { name: "elm.indicator"; + type: TEXT; + mouse_events: 0; + effect: SOFT_SHADOW; + scale: 1; description { state: "default" 0.0; - color: 0 0 0 0; + visible: 0; + fixed: 1 1; + align: 0.5 1.0; + rel1 { + to: "button0"; + relative: 0.0 -1.0; + offset: 0 0; + } + rel2 { + 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" 1.0; - color: 0 0 0 64; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + rel1.offset: 0 -1; + rel2.offset: -1 -1; } } - part { name: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; - fill.smooth: 0; + part { name: "button6"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.to: "button3"; + rel2 { + to: "button5"; + relative: 1.0 0.3; + offset: -1 -1; + } + 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; + } + } + part { name: "button7"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + rel1.to: "button3"; + rel2.to: "button5"; + image { + normal: "sl_bt2_2.png"; + border: 5 5 5 0; + middle: 0; + } + fill.smooth: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + 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: "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(); } } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; - image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; + program { name: "set_val_hide"; + signal: "elm,state,val,hide"; + source: "elm"; + script { + set_value_hide(); } } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } + program { name: "val_show"; + signal: "mouse,down,*"; + source: "elm.dragable.slider"; + script { + thumb_down(); } } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.relative: 0.1 0.1; - rel2.relative: 0.9 0.9; + program { name: "val_hide"; + signal: "mouse,up,*"; + source: "elm.dragable.slider"; + script { + thumb_up(); } } - } - programs { - program { name: "show"; - signal: "elm,action,show"; + program { + name: "go_disabled"; + signal: "elm,state,disabled"; source: "elm"; - action: STATE_SET "visible" 0.0; -// transition: DECELERATE 0.5; - target: "base"; + action: STATE_SET "disabled" 0.0; + target: "button0"; + target: "disabler"; + after: "disable_text"; } - program { name: "hide"; - signal: "elm,action,hide"; + 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; -// transition: DECELERATE 0.5; - target: "base"; + 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); + } + } } } } - group { name: "elm/win/inwin/minimal"; +//////////////////////////////////////////////////////////////////////////////// +// actionslider +//////////////////////////////////////////////////////////////////////////////// + group { name: "elm/actionslider/base/default"; + images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; + 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"; - 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: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; + 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"; + border: 2 2 2 2; + } fill.smooth: 0; - } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; + } + } + 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; + } + } + part { name: "icon.dragable.area"; + type: RECT; + 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; + } + } + } + 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; + } + } + } + part { name: "elm.drag_button_base"; + type: SWALLOW; + 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; + 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"; + rel2.relative: 1.0 0.5; image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; - } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 1; - rel1.relative: 0.5 0.5; - rel2.relative: 0.5 0.5; - } - } + normal: "bt_hilightw.png"; + border: 4 4 4 0; + } + color: 255 255 255 190; + } + } } programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; -// transition: DECELERATE 0.5; - target: "base"; + 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: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; -// transition: DECELERATE 0.5; - target: "base"; + 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/win/inwin/minimal_vertical"; + group { name: "elm/actionslider/base/bar"; + images { - image: "shad_circ.png" COMP; - image: "bt_dis_base.png" COMP; - image: "bt_dis_hilight.png" COMP; + 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"; - 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: "shad"; - mouse_events: 0; - description { state: "default" 0.0; - image.normal: "shad_circ.png"; - rel1.to: "elm.swallow.content"; - rel1.offset: -64 -64; - rel2.to: "elm.swallow.content"; - rel2.offset: 63 63; + 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; + } fill.smooth: 0; - } - } - part { name: "pop"; - mouse_events: 1; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel1.offset: -5 -5; - rel2.to: "elm.swallow.content"; - rel2.offset: 4 4; + } + } + part { name: "conf_over"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; image { - normal: "bt_dis_base.png"; - border: 4 4 4 4; - } - image.middle: SOLID; - } - } - part { name: "popover"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "pop"; - rel2.to: "pop"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "elm.swallow.content"; + normal: "shelf_inset.png"; + border: 7 7 7 7; + middle: 0; + } + fill.smooth : 0; + } + } + part { name: "icon.dragable.area"; + type: RECT; + 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; + } + } + } + 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; + } + } + } + part { name: "bar"; + 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; - description { state: "default" 0.0; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; fixed: 1 1; - rel1.relative: 0.1 0.5; - rel2.relative: 0.9 0.5; - } - } + 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; + 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"; + rel2.relative: 1.0 0.5; + image { + normal: "bt_hilightw.png"; + border: 4 4 4 0; + } + color: 255 255 255 190; + } + } } programs { - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; -// transition: DECELERATE 0.5; - target: "base"; + 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: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; -// transition: DECELERATE 0.5; - target: "base"; + 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/list/item/default"; + 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; @@ -9404,6 +16081,7 @@ collections { } } part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9436,7 +16114,7 @@ collections { } } } - part { name: "elm.swallow.icon"; + part { name: "elm.swallow.pad"; type: SWALLOW; description { state: "default" 0.0; fixed: 1 0; @@ -9451,11 +16129,32 @@ collections { } } } + 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; @@ -9467,6 +16166,7 @@ collections { } } part { name: "elm.text"; + clip_to: "disclip"; type: TEXT; effect: SOFT_SHADOW; mouse_events: 0; @@ -9477,7 +16177,7 @@ collections { rel1 { to_x: "elm.swallow.icon"; relative: 1.0 0.0; - offset: 4 4; + offset: 0 4; } rel2 { to_x: "elm.swallow.end"; @@ -9492,6 +16192,7 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -9501,6 +16202,7 @@ collections { } } part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9520,6 +16222,7 @@ collections { } } part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9537,8 +16240,24 @@ collections { 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"; @@ -9560,40 +16279,85 @@ collections { 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/list/item_odd/default"; - data.item: "stacking" "below"; + group { name: "elm/genlist/item/group_index/default"; + alias: "elm/genlist/item_odd/group_index/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_2.png" COMP; + image: "ilist_item_shadow.png" COMP; + image: "group_index.png" COMP; } parts { part { - name: "event"; - type: RECT; - repeat_events: 1; + name: "event"; + type: RECT; + repeat_events: 0; 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_2.png"; + normal: "group_index.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; @@ -9626,56 +16390,75 @@ collections { } } } - part { - name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; fixed: 1 0; - align: 0.0 0.5; + 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.end"; - type: SWALLOW; - description { state: "default" 0.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; + } + 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; + 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"; - type: TEXT; - effect: SOFT_SHADOW; - 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; -// min: 16 16; +// min: 16 16; rel1 { - to_x: "elm.swallow.icon"; + to_x: "elm.swallow.icon"; relative: 1.0 0.0; - offset: 4 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; @@ -9685,6 +16468,7 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -9694,6 +16478,7 @@ collections { } } part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9713,6 +16498,7 @@ collections { } } part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9730,8 +16516,24 @@ collections { 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"; @@ -9753,11 +16555,29 @@ collections { 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/list/item_compress/default"; + group { name: "elm/genlist/item_compress/message/default"; data.item: "stacking" "above"; 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: "treesize" "20"; +// data.item: "states" ""; images { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; @@ -9765,14 +16585,38 @@ collections { image: "ilist_1.png" COMP; image: "ilist_item_shadow.png" COMP; } - parts { + 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"; + } + } + 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; + description { + state: "default" 0.0; align: 0.0 0.0; min: 0 10; + fixed: 1 1; rel1 { to: "base"; relative: 0.0 1.0; @@ -9802,6 +16646,7 @@ collections { } } part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9834,62 +16679,72 @@ collections { } } } - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; + 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; rel1 { relative: 0.0 0.0; - offset: 4 4; + offset: 4 4; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.swallow.end"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; - offset: -5 4; + offset: -5 4; } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + 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"; } } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } } - part { - name: "elm.text"; + part { name: "elm.title.2"; + clip_to: "disclip"; type: TEXT; effect: SOFT_SHADOW; mouse_events: 0; scale: 1; - description { state: "default" 0.0; -// min: 16 16; + description { + state: "default" 0.0; + fixed: 0 1; +// min: 16 16; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 4 4; + to_y: "elm.title.1"; + relative: 0.0 1.0; + offset: 4 0; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; + to_y: "elm.title.1"; + 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: 1 1; min: 0 1; - align: 0.0 0.5; +// min: 1 1; + align: 0.0 0.0; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -9898,7 +16753,41 @@ collections { color3: 0 0 0 64; } } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + 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; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + align: 0.0 0.0; + text { + style: "genlist_textblock_style"; + min: 0 1; +// min: 1 1; + align: 0.0 0.0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "genlist_textblock_style2"; + } + } + } part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9918,6 +16807,7 @@ collections { } } part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -9935,17 +16825,24 @@ collections { color: 255 255 255 255; } } - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; + 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"; @@ -9954,6 +16851,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; + target: "elm.title.1"; + target: "elm.title.2"; target: "elm.text"; } program { @@ -9964,14 +16863,34 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; + target: "elm.title.1"; + target: "elm.title.2"; 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/list/item_compress_odd/default"; + group { name: "elm/genlist/item_compress_odd/message/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: "treesize" "20"; +// data.item: "states" ""; images { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; @@ -9979,6 +16898,14 @@ collections { 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; @@ -9992,6 +16919,7 @@ collections { } } part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -10024,63 +16952,72 @@ collections { } } } - part { name: "elm.swallow.icon"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; + 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; rel1 { relative: 0.0 0.0; - offset: 4 4; + offset: 4 4; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.swallow.end"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; - offset: -5 4; + offset: -5 4; } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + 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"; } } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } } - part { - name: "elm.text"; + part { name: "elm.title.2"; + clip_to: "disclip"; type: TEXT; effect: SOFT_SHADOW; mouse_events: 0; scale: 1; description { state: "default" 0.0; -// min: 16 16; + fixed: 0 1; +// min: 16 16; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 4 4; + to_y: "elm.title.1"; + relative: 0.0 1.0; + offset: 4 0; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -5; + to_y: "elm.title.1"; + 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: 1 1; min: 0 1; - align: 0.0 0.5; +// min: 1 1; + align: 0.0 0.0; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -10089,7 +17026,41 @@ collections { color3: 0 0 0 64; } } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; + 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; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + align: 0.0 0.0; + text { + style: "genlist_textblock_style"; + min: 0 1; +// min: 1 1; + align: 0.0 0.0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "genlist_textblock_style2"; + } + } + } part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -10109,6 +17080,7 @@ collections { } } part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -10126,17 +17098,24 @@ collections { color: 255 255 255 255; } } - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; + 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"; @@ -10145,6 +17124,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; + target: "elm.title.1"; + target: "elm.title.2"; target: "elm.text"; } program { @@ -10155,1080 +17136,802 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; + target: "elm.title.1"; + target: "elm.title.2"; 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/slider/horizontal/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: "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; + 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"; - mouse_events: 0; - description { state: "default" 0.0; - max: 99999 6; - min: 0 6; - rel1 { to: "bg"; - offset: 1 0; - } - rel2 { to: "bg"; - offset: -2 -1; - } - image.normal: "sl_bg.png"; - fill.smooth: 0; + part { + name: "event"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; } } - part { name: "level"; - type: RECT; + part { + name: "base_sh"; mouse_events: 0; - description { state: "default" 0.0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; fixed: 1 1; - rel1.to: "base"; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } rel2 { - to_y: "base"; - to_x: "elm.dragable.slider"; - relative: 0.5 1.0; + to: "base"; + relative: 1.0 1.0; + offset: -1 0; } - color: 255 0 0 200; - } - description { state: "inverted" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "level2"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - rel1 { - to_y: "base"; - to_x: "elm.dragable.slider"; - relative: 0.5 0.0; + image { + normal: "ilist_item_shadow.png"; } - rel2.to: "base"; - color: 255 0 0 200; - } - description { state: "inverted" 0.0; - inherit: "default" 0.0; - visible: 1; + fill.smooth: 0; } } part { - name: "base_over"; + name: "base"; mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "base"; - rel1.offset: -1 -1; - rel2.to: "base"; - rel2.offset: 0 0; + description { + state: "default" 0.0; image { - normal: "sl_bg_over.png"; - border: 3 3 3 3; + normal: "ilist_1.png"; + border: 2 2 2 2; } fill.smooth: 0; } } part { name: "bg"; - type: RECT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; + clip_to: "disclip"; + mouse_events: 0; + 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; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; } - rel2 { - to_x: "elm.units"; - relative: 0.0 1.0; - offset: -10 -1; + rel2 { + relative: 1.0 1.0; + offset: 4 4; } - } - } - 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"; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - rel2 { - offset: 3 -1; - relative: 0.0 1.0; - to_y: "elm.swallow.bar"; + 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; - 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; + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } + } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; + fixed: 1 0; + align: 0.0 0.5; rel1 { - to_x: "elm.units"; - offset: 0 5; + relative: 0.0 0.0; + offset: 4 4; } - image { - normal: "sl_units.png"; - border: 0 5 3 8; + 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: "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; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "bg"; - } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; description { state: "default" 0.0; - min: 0 24; - max: 0 24; - fixed: 1 1; - rel1 { - relative: 0.5 0.0; - to_x: "bg"; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } rel2 { - relative: 0.5 1.0; - to_x: "bg"; + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } - 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; + 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.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; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - fill.smooth: 0; } } - part { name: "button1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button0"; + 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 0.5; - offset: -1 -5; + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; } - image { - normal: "sl_bt_1.png"; - border: 5 5 5 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"; } } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } } - part { name: "button2"; + part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "button0"; - rel2.to: "button0"; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; image { - normal: "sl_bt_2.png"; - border: 5 5 5 10; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - fill.smooth: 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { name: "button3"; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.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: -7 0; - } - rel2 { - to: "button4"; - relative: 0.0 1.0; - offset: -1 -1; - } + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; image { - normal: "sl_bt2_0_0.png"; - border: 6 0 6 12; + 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: "button4"; - mouse_events: 0; + part { name: "disclip"; + type: RECT; description { state: "default" 0.0; - visible: 0; - max: 15 999; - min: 15 32; - rel1 { - to_x: "button0"; - to_y: "elm.indicator"; - offset: 0 0; - } - rel2.to: "button0"; + 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: "sl_bt2_0_1.png"; - border: 0 0 6 12; + normal: "ilist_2.png"; + border: 2 2 2 2; } fill.smooth: 0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } } - part { name: "button5"; + part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 8 32; - align: 0.0 0.5; + visible: 0; + color: 255 255 255 0; rel1 { - to: "button4"; - relative: 1.0 0.0; - offset: 0 0; + relative: 0.0 0.0; + offset: -5 -5; } rel2 { - to_x: "elm.indicator"; - to_y: "button4"; relative: 1.0 1.0; - offset: 6 -1; + offset: 4 4; } image { - normal: "sl_bt2_0_2.png"; - border: 0 6 6 12; + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - fill.smooth: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; + image.middle: SOLID; } - } - 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; + 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 { - to_x: "button0"; - relative: 1.0 -0.25; - offset: -1 0; + rel2 { + relative: 1.0 1.0; + offset: 1 1; } - 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; + } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - rel1.to: "button3"; - rel2 { - to: "button5"; - relative: 1.0 0.3; - offset: -1 -1; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; } - image { - normal: "sl_bt2_1.png"; - border: 5 5 5 0; + 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: "button7"; - mouse_events: 0; + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; description { state: "default" 0.0; - visible: 0; - rel1.to: "button3"; - rel2.to: "button5"; - image { - normal: "sl_bt2_2.png"; - border: 5 5 5 0; - middle: 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; - } - description { state: "visible" 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.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; - max: 6 99999; - min: 6 0; - rel1 { to: "bg"; - offset: 1 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 { to: "bg"; - offset: -2 -1; + rel2 { + relative: 1.0 1.0; + offset: -5 -5; } - image.normal: "slv_bg.png"; - fill.smooth: 0; } } - part { name: "level"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - rel1.to: "base"; + 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: "base"; - to_y: "elm.dragable.slider"; - relative: 1.0 0.5; + 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: 1 1; +// min: 0 1; + align: 0.0 0.5; + text_class: "list_item"; } - color: 255 0 0 200; } - description { state: "inverted" 0.0; + description { state: "selected" 0.0; inherit: "default" 0.0; - visible: 0; + color: 224 224 224 255; + color3: 0 0 0 64; } } - part { name: "level2"; - type: RECT; + part { name: "fg1"; + clip_to: "disclip"; mouse_events: 0; description { state: "default" 0.0; - fixed: 1 1; visible: 0; - rel1 { - to_x: "base"; - to_y: "elm.dragable.slider"; - relative: 0.0 0.5; + 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: "base"; - color: 255 0 0 200; } - description { state: "inverted" 0.0; + description { state: "selected" 0.0; inherit: "default" 0.0; visible: 1; + color: 255 255 255 255; } } - part { - name: "base_over"; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; 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; - } - 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; - rel1 { - to: "elm.units"; - offset: -8 0; - } - rel2 { - to: "elm.units"; - offset: 7 8; - } + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; image { - normal: "slv_units.png"; - border: 8 8 0 9; + 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: "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"; + part { name: "disclip"; type: RECT; - 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"; - } + 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: "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"; + part { + name: "base"; 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"; + description { + state: "default" 0.0; image { - normal: "sl_bt_0.png"; - border: 5 5 5 10; + normal: "ilist_2.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; } - } - 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; + 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: "button3"; - mouse_events: 0; + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; - 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; + relative: 0.0 0.0; + offset: 4 4; } rel2 { - to: "button4"; - relative: 0.0 1.0; - offset: -1 -1; - } - image { - normal: "sl_bt2_0_0.png"; - border: 6 0 6 12; + relative: 0.0 1.0; + offset: 4 -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.icon"; + clip_to: "disclip"; + 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; + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } - rel2.to: "button0"; - image { - normal: "sl_bt2_0_1.png"; - border: 0 0 6 12; + rel2 { + 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: "button5"; - mouse_events: 0; - description { state: "default" 0.0; - 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: 0 1; +// min: 1 1; + align: 0.0 0.5; + text_class: "list_item"; } - 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 -1.0; - offset: 0 0; - } - rel2 { - 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; - 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; } } } 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.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"; - } + // 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/default/default"; + group { name: "elm/genlist/tree/default/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; data.item: "labels" "elm.text"; @@ -11241,6 +17944,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 { @@ -11337,12 +18042,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; @@ -11353,6 +18059,29 @@ 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"; @@ -11400,6 +18129,7 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -11500,9 +18230,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_compress/default/default"; + group { name: "elm/genlist/tree_compress/default/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; data.item: "labels" "elm.text"; @@ -11515,6 +18265,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 { @@ -11611,12 +18363,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; @@ -11627,6 +18380,29 @@ 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"; @@ -11671,9 +18447,10 @@ collections { text { font: "Sans"; size: 10; - min: 0 1; // min: 1 1; + min: 0 1; align: 0.0 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -11764,19 +18541,39 @@ collections { name: "go_disabled"; signal: "elm,state,disabled"; source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; + 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_enabled"; - signal: "elm,state,enabled"; + name: "go_contracted"; + signal: "elm,state,contracted"; source: "elm"; action: STATE_SET "default" 0.0; - target: "disclip"; + target: "arrow"; } } } - group { name: "elm/genlist/item_odd/default/default"; + group { name: "elm/genlist/tree_odd/default/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; data.item: "labels" "elm.text"; @@ -11788,10 +18585,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; @@ -11859,12 +18659,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; @@ -11875,14 +18676,37 @@ 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 { @@ -11903,7 +18727,7 @@ 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; @@ -11922,6 +18746,7 @@ collections { min: 1 1; // min: 0 1; align: 0.0 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -12022,9 +18847,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_compress_odd/default/default"; + group { name: "elm/genlist/tree_compress_odd/default/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; data.item: "labels" "elm.text"; @@ -12036,10 +18881,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; @@ -12107,12 +18955,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; @@ -12123,14 +18972,37 @@ 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 { @@ -12151,7 +19023,7 @@ 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; @@ -12167,9 +19039,10 @@ collections { text { font: "Sans"; size: 10; - min: 0 1; // min: 1 1; + min: 0 1; align: 0.0 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -12270,948 +19143,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/tree/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; - 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; + 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; + } + } + 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; } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 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; } - image { - normal: "ilist_item_shadow.png"; + 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: "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"; - 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.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: 4 4; + } + 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 { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + 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.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; + text { + style: "genlist_selected_style"; + } } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + } + 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.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; + visible: 1; + color: 255 255 255 255; } - rel2 { - relative: 0.0 1.0; - offset: 4 -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: "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; + 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: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; } - 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: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; } - rel2 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -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"; + } + } + } + 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; } - } - } - 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: "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; } - rel2 { - relative: 1.0 1.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; } - } - } - 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; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } } - rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; - offset: -1 -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; + } } - 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.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; + } } - } - 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: "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; - 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.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; + } } - } - 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_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; - 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; + text { + style: "genlist_selected_style"; + } } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 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; + } } - image { - normal: "ilist_item_shadow.png"; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - 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: "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; + } } - 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: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - rel2 { - relative: 1.0 1.0; - offset: 4 4; + } + 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/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; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + 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; } - 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: "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; } - rel2 { - relative: 1.0 1.0; - offset: 1 1; + } + 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; } - } - } - 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; + 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: 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; + } + 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; + } + 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 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; } - 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; + } + 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: "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.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: "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; + } } - rel2 { - relative: 1.0 1.0; - offset: -5 -5; + description { state: "selected" 0.0; + inherit: "default" 0.0; + text { + style: "genlist_selected_style"; + } } - } - } - 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: "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.end"; - relative: 0.0 1.0; - offset: -1 -5; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + 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.0 0.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; + } } - } - 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; } - } - 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: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; } - } - 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"; - } - } + 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_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; - 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; - } - 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; + 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; } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + } + 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; } - 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: "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: 1 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: "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.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: 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"; } - } - } - 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; + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "icon_arrow_down.png"; } - rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - 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: "arrow"; + relative: 1.0 0.0; + offset: 4 4; + } + rel2 { + to_x: "arrow"; + relative: 1.0 1.0; + offset: 4 -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; + } + 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 { - to_x: "arrow"; - relative: 1.0 1.0; - offset: 4 -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; + } } - } - } - 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; + text { + style: "genlist_selected_style"; + } } - rel2 { - relative: 1.0 1.0; - offset: -5 -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.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 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; + } } - 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; + 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: "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: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; } - } - 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; + color: 255 255 255 64; } - } - 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"; - } - } + } + } + 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_compress_odd/default/default"; - data.item: "stacking" "below"; + + + 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" ""; @@ -13219,9 +20330,8 @@ collections { 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; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; } parts { part { @@ -13234,12 +20344,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; @@ -13294,13 +20428,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; @@ -13311,29 +20444,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"; @@ -13370,7 +20480,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; @@ -13378,9 +20488,10 @@ 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; @@ -13389,6 +20500,41 @@ 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; @@ -13455,6 +20601,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; } program { name: "go_passive"; @@ -13465,6 +20612,7 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; + target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -13481,1183 +20629,1252 @@ 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"; - 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; + group { name: "elm/genlist/item_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; + } + 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; + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 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; + image { + normal: "ilist_item_shadow.png"; } - } - 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; + 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: "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; + } + } + } + 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: 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; - text { - style: "genlist_selected_style"; - } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 0.5; + offset: -1 -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; - } + 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; - 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.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: "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.end"; + relative: 0.0 1.0; + offset: -1 -5; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + 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"; } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + } + 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; - color: 255 255 255 64; + } + 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 { - // 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; + 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"; + } + } + } + group { name: "elm/genlist/item_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; + } + 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: "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; + 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; + } + } + } + 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; } - 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: "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; - } + 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; - 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.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: "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 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"; } - } - } - 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"; - } - } + } + 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; + 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"; + } + } } - - 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; + group { name: "elm/genlist/item_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; + } + 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: "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: "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"; - mouse_events: 0; - description { - state: "default" 0.0; - min: 16 28; - image { - normal: "ilist_1.png"; - border: 2 2 2 2; - } - fill.smooth: 0; + rel2 { + relative: 1.0 1.0; + offset: 4 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; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } - 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.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.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: 1 1; } - } - 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"; + } + } + 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: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.png"; + 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: "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.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: "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 { + 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: 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; } - } - 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; - } + 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; - text { - style: "genlist_selected_style"; - } + } + 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: "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.end"; + relative: 0.0 1.0; + offset: -1 -5; } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + 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"; } - } - 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; + 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: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + } + 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"; + } + } + } + + 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; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; + image { + normal: "ilist_item_shadow.png"; } - } - } - 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; + 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_2.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: "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: 1 1; } - description { state: "active" 0.0; - inherit: "default" 0.0; - image.normal: "icon_arrow_down.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; } - } - 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 { + 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; } - } - 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 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -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; + text_class: "list_item"; } - 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"; - } - } + 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; + 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"; + 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/item/double_label/default"; + 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"; @@ -14670,6 +21887,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 { @@ -14766,12 +21985,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; @@ -14782,6 +22002,29 @@ 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"; @@ -14826,9 +22069,10 @@ 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; @@ -14860,9 +22104,10 @@ 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; @@ -14965,10 +22210,30 @@ 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"; - data.item: "stacking" "above"; + 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"; @@ -14978,8 +22243,9 @@ 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: "ilist_2.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_down.png" COMP; } parts { part { @@ -14992,36 +22258,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; @@ -15076,12 +22318,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; @@ -15092,6 +22335,29 @@ 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"; @@ -15136,9 +22402,10 @@ 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; @@ -15170,9 +22437,10 @@ 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; @@ -15275,24 +22543,47 @@ 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_odd/double_label/default"; - data.item: "stacking" "below"; + + 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 { 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; } parts { - part { name: "event"; - type: RECT; + part { + name: "event"; + type: RECT; repeat_events: 1; description { state: "default" 0.0; @@ -15300,12 +22591,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; @@ -15355,8 +22670,8 @@ collections { offset: 4 4; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + relative: 1.0 1.0; + offset: -4 -5; } } } @@ -15365,10 +22680,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 { @@ -15378,24 +22693,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; @@ -15406,14 +22703,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; @@ -15422,7 +22718,8 @@ collections { size: 10; min: 1 1; // min: 0 1; - align: 0.0 0.5; + align: 0.5 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -15431,40 +22728,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; - } - } - 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; @@ -15531,7 +22794,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; } program { name: "go_passive"; @@ -15542,7 +22804,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -15561,11 +22822,11 @@ collections { } } } - group { name: "elm/genlist/item_compress_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 { @@ -15639,8 +22900,8 @@ collections { offset: 4 4; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + relative: 1.0 1.0; + offset: -4 -5; } } } @@ -15649,10 +22910,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 { @@ -15662,24 +22923,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; @@ -15688,25 +22931,25 @@ 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; text { font: "Sans"; size: 10; -// min: 1 1; - min: 0 1; - align: 0.0 0.5; + min: 1 1; +// min: 0 1; + align: 0.5 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -15715,40 +22958,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; - } - } - 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; @@ -15815,7 +23024,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; } program { name: "go_passive"; @@ -15826,7 +23034,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -15846,11 +23053,11 @@ collections { } } - group { name: "elm/genlist/tree/double_label/default"; + 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 { @@ -15972,48 +23179,29 @@ collections { 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; + 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.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; } } } @@ -16027,14 +23215,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; @@ -16043,7 +23230,8 @@ collections { size: 10; min: 1 1; // min: 0 1; - align: 0.0 0.5; + align: 0.5 0.5; + text_class: "list_item"; } } description { state: "selected" 0.0; @@ -16052,40 +23240,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; - } - } - 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; @@ -16152,7 +23306,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; } program { name: "go_passive"; @@ -16163,7 +23316,6 @@ collections { target: "fg1"; target: "fg2"; target: "elm.text"; - target: "elm.text.sub"; transition: LINEAR 0.1; } program { @@ -16202,19 +23354,18 @@ collections { } } } - group { name: "elm/genlist/tree_compress/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; } @@ -16229,36 +23380,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; @@ -16337,228 +23464,641 @@ collections { 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.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; + } + } + } + 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"; } - 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; + } + } + + +/////////////////////////////////////////////////////////////////////////////// + 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: "elm.text"; - clip_to: "disclip"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; -// min: 16 16; + fill.smooth : 0; + } + } + part { name: "check"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 0 4; + to: "bg"; + offset: 1 1; } 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; + to: "bg"; + offset: -2 -2; } - } - description { state: "selected" 0.0; + visible: 0; + color: 255 255 255 255; + image.normal: "check.png"; + } + description { state: "visible" 0.0; inherit: "default" 0.0; - color: 224 224 224 255; - color3: 0 0 0 64; + 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); + } } - 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; - } + 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: "fg1"; - 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.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; + 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; + 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); + } } - } - 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"; + 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"; @@ -16728,9 +24268,10 @@ 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; @@ -16762,9 +24303,10 @@ 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; @@ -16890,13 +24432,11 @@ collections { } } - group { name: "elm/genlist/item/icon_top_text_bottom/default"; + group { name: "elm/genlist/item_compress/media/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon"; + data.item: "labels" "elm.text.title elm.text.album-artist"; data.item: "treesize" "20"; -// data.item: "states" ""; images { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; @@ -16994,61 +24534,70 @@ collections { offset: 4 4; } rel2 { - relative: 1.0 1.0; - offset: -4 -5; + relative: 0.0 1.0; + offset: 4 -5; } } } - part { name: "elm.swallow.icon"; + part { name: "elm.text.title"; clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; rel1 { - to_x: "elm.swallow.pad"; relative: 0.0 0.0; - offset: -1 4; + offset: 4 4; } rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + 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; + } } - part { name: "elm.text"; + part { name: "elm.text.album-artist"; 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; + relative: 0.0 0.5; + offset: 4 4; } rel2 { relative: 1.0 1.0; - offset: -5 -5; + offset: -1 -5; } - color: 0 0 0 255; + color: 0 0 0 128; color3: 0 0 0 0; text { font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.5 0.5; + size: 8; + 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; + color: 128 128 128 255; + color3: 0 0 0 32; } } part { name: "fg1"; @@ -17116,7 +24665,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.text"; + target: "elm.text.title"; + target: "elm.text.album-artist"; } program { name: "go_passive"; @@ -17126,7 +24676,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.text"; + target: "elm.text.title"; + target: "elm.text.album-artist"; transition: LINEAR 0.1; } program { @@ -17145,13 +24696,11 @@ collections { } } } - group { name: "elm/genlist/item_odd/icon_top_text_bottom/default"; + group { name: "elm/genlist/item_compress_odd/media/default"; data.item: "stacking" "below"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon"; + data.item: "labels" "elm.text.title elm.text.album-artist"; data.item: "treesize" "20"; -// data.item: "states" ""; images { image: "bt_sm_base1.png" COMP; image: "bt_sm_shine.png" COMP; @@ -17223,61 +24772,70 @@ collections { offset: 4 4; } rel2 { - relative: 1.0 1.0; - offset: -4 -5; + relative: 0.0 1.0; + offset: 4 -5; } } } - part { name: "elm.swallow.icon"; + part { name: "elm.text.title"; clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; rel1 { - to_x: "elm.swallow.pad"; relative: 0.0 0.0; - offset: -1 4; + offset: 4 4; } rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + 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; + } } - part { name: "elm.text"; + part { name: "elm.text.album-artist"; 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; + relative: 0.0 0.5; + offset: 4 4; } rel2 { relative: 1.0 1.0; - offset: -5 -5; + offset: -1 -5; } - color: 0 0 0 255; + color: 0 0 0 128; color3: 0 0 0 0; text { font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.5 0.5; + size: 8; + 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; + color: 128 128 128 255; + color3: 0 0 0 32; } } part { name: "fg1"; @@ -17345,7 +24903,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.text"; + target: "elm.text.title"; + target: "elm.text.album-artist"; } program { name: "go_passive"; @@ -17355,7 +24914,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.text"; + target: "elm.text.title"; + target: "elm.text.album-artist"; transition: LINEAR 0.1; } program { @@ -17375,26 +24935,26 @@ collections { } } - group { name: "elm/genlist/tree/icon_top_text_bottom/default"; + group { name: "elm/genlist/item_compress/media-album/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; - data.item: "labels" "elm.text"; - data.item: "icons" "elm.swallow.icon"; + data.item: "labels" "elm.text.title elm.text.trackno elm.text.length"; + data.item: "states" "elm.state.trackno"; 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; + } + script { + public dot_visible; } parts { part { - name: "event"; - type: RECT; + name: "event"; + type: RECT; repeat_events: 1; description { state: "default" 0.0; @@ -17486,64 +25046,25 @@ collections { } } } - 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; + part { + name: "elm.text.trackno"; + type: TEXT; scale: 1; + mouse_events: 0; description { state: "default" 0.0; -// min: 16 16; + color: 255 255 255 255; + align: 0.0 0.0; + fixed: 1 0; rel1 { - to_y: "elm.swallow.icon"; - relative: 0.0 1.0; - offset: 0 4; + to_y: "elm.text.title"; + relative: 0.0 0.0; + offset: 5 0; } rel2 { - relative: 1.0 1.0; - offset: -5 -5; + to_y: "elm.text.title"; + relative: 0.0 1.0; + offset: 20 0; } color: 0 0 0 255; color3: 0 0 0 0; @@ -17551,8 +25072,7 @@ collections { font: "Sans"; size: 10; min: 1 1; -// min: 0 1; - align: 0.5 0.5; + align: 1.0 0.5; } } description { state: "selected" 0.0; @@ -17561,279 +25081,122 @@ collections { 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"; - } - 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; - } - parts { - part { - name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } part { - name: "base"; + name: "dot"; + type: TEXT; + scale: 1; 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; + state: "default" 0.0; + color: 255 255 255 255; visible: 0; - color: 255 255 255 0; + fixed: 1 1; + align: 0.0 0.0; rel1 { - relative: 0.0 0.0; - offset: -5 -5; + 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: 4 4; + offset: 1 0; + } - image { - normal: "bt_sm_base1.png"; - border: 6 6 6 6; + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; + min: 1 1; + align: 0.0 0.5; + text: "."; } - image.middle: SOLID; + } + 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; - 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; + 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: "arrow"; + part { name: "elm.text.title"; 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; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; rel1 { - to_x: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 4; + to_x: "dot"; + relative: 0.0 0.0; + offset: 4 4; } rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + 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; } - image.normal: "icon_arrow_right.png"; } - description { state: "active" 0.0; + description { state: "selected" 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; - } + color: 224 224 224 255; + color3: 0 0 0 64; } } - part { name: "elm.text"; + part { name: "elm.text.length"; 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; + relative: 0.0 0.5; + offset: 4 4; } rel2 { relative: 1.0 1.0; - offset: -5 -5; + offset: -1 -5; } - color: 0 0 0 255; + color: 0 0 0 128; color3: 0 0 0 0; text { font: "Sans"; - size: 10; - min: 1 1; -// min: 0 1; - align: 0.5 0.5; + size: 8; + 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; + color: 128 128 128 255; + color3: 0 0 0 32; } } part { name: "fg1"; @@ -17869,577 +25232,457 @@ collections { 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/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; - } - fill.smooth : 0; - } - } - part { name: "check"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1 { - to: "bg"; - offset: 1 1; - } - rel2 { - to: "bg"; - offset: -2 -2; - } - visible: 0; - color: 255 255 255 255; - image.normal: "check.png"; - } - description { state: "visible" 0.0; + description { state: "selected" 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; 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"; - 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; - } - } + } + } + 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: "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); - } + // 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: "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); - } + 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/radio/base/default"; + 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: "radio_base.png" COMP; - image: "radio.png" COMP; - image: "radio2.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; + } + 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; + } + fill.smooth: 0; + } + } 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; + 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.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; + } + 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; + 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; + + } + 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: "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: "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; + } + 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; + } + } + 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; + } + } + 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"; - visible: 0; - image.normal: "radio.png"; - } - description { state: "visible" 0.0; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; inherit: "default" 0.0; visible: 1; - } - } - 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; - } - } + } + } + 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: "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); - } + // 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: "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); - } + 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/tree_compress_odd/double_label/default"; - data.item: "stacking" "below"; + + group { name: "elm/genlist/item_compress/media-preview/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.title elm.text.artist"; + data.item: "icons" "elm.swallow.preview"; 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; + image: "ilist_1.png" COMP; + image: "ilist_item_shadow.png" COMP; } parts { part { - name: "event"; - type: RECT; + name: "event"; + type: RECT; repeat_events: 1; description { state: "default" 0.0; @@ -18447,12 +25690,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; @@ -18507,13 +25774,14 @@ collections { } } } - part { name: "arrow"; + part { name: "elm.swallow.preview"; 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; + min: 68 68; + max: 68 68; rel1 { to_x: "elm.swallow.pad"; relative: 1.0 0.0; @@ -18524,50 +25792,270 @@ collections { relative: 1.0 1.0; offset: -1 -5; } - image.normal: "icon_arrow_right.png"; } - description { state: "active" 0.0; + } + 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; + } + 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; - image.normal: "icon_arrow_down.png"; + color: 224 224 224 255; + color3: 0 0 0 64; } } - part { name: "elm.swallow.icon"; + 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; + } + 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; + } + } + 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.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/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; + } + 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 { - to_x: "arrow"; - relative: 1.0 0.0; + relative: 0.0 0.0; offset: 4 4; } rel2 { - to_x: "arrow"; - relative: 1.0 1.0; + relative: 0.0 1.0; offset: 4 -5; } } } - part { name: "elm.swallow.end"; + part { name: "elm.swallow.preview"; 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; + min: 68 68; + max: 68 68; rel1 { + to_x: "elm.swallow.pad"; relative: 1.0 0.0; - offset: -5 4; + offset: -1 4; } rel2 { + to_x: "elm.swallow.pad"; relative: 1.0 1.0; - offset: -5 -5; + offset: -1 -5; } } } - part { name: "elm.text"; + part { name: "elm.text.title"; clip_to: "disclip"; type: TEXT; effect: SOFT_SHADOW; @@ -18575,15 +26063,13 @@ collections { scale: 1; description { state: "default" 0.0; -// min: 16 16; rel1 { - to_x: "elm.swallow.icon"; + to_x: "elm.swallow.preview"; relative: 1.0 0.0; - offset: 0 4; + offset: 4 4; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 0.5; + relative: 1.0 0.5; offset: -1 -5; } color: 0 0 0 255; @@ -18591,7 +26077,6 @@ collections { text { font: "Sans"; size: 10; -// min: 1 1; min: 0 1; align: 0.0 0.5; } @@ -18602,22 +26087,20 @@ collections { color3: 0 0 0 64; } } - part { name: "elm.text.sub"; + part { name: "elm.text.artist"; clip_to: "disclip"; type: TEXT; mouse_events: 0; scale: 1; description { state: "default" 0.0; -// min: 16 16; rel1 { - to_x: "elm.swallow.icon"; + to_x: "elm.swallow.preview"; relative: 1.0 0.5; - offset: 0 4; + offset: 4 4; } rel2 { - to_x: "elm.swallow.end"; - relative: 0.0 1.0; + relative: 1.0 1.0; offset: -1 -5; } color: 0 0 0 128; @@ -18625,7 +26108,6 @@ collections { text { font: "Sans"; size: 8; -// min: 1 1; min: 0 1; align: 0.0 0.5; } @@ -18701,8 +26183,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.text"; - target: "elm.text.sub"; + target: "elm.text.title"; + target: "elm.text.artist"; } program { name: "go_passive"; @@ -18712,8 +26194,8 @@ collections { target: "bg"; target: "fg1"; target: "fg2"; - target: "elm.text"; - target: "elm.text.sub"; + target: "elm.text.title"; + target: "elm.text.artist"; transition: LINEAR 0.1; } program { @@ -18730,26 +26212,6 @@ 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"; - } } } @@ -19106,603 +26568,1112 @@ collections { } } } - 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/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/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; + 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; } - description { state: "visible" 0.0; - inherit: "default" 0.0; + perspective { + zplane: 0; + focal: 1000; } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; + } + 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; } - } - 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; + rel2 { + relative: 1.0 1.0; } - description { state: "visible" 0.0; - inherit: "default" 0.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; } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; + rel2 { + to: "elm.background.progressbar"; + relative: 1.0 1.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: "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"; } - } - 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; + rel2 { + offset: 3 -1; + relative: 0.0 1.0; + to_y: "elm.background.progressbar"; } - } - 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; + } + 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; } - } - 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; - } + } + 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; } - } - } - 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 { + to: "elm.swallow.bar"; + relative: 1.0 1.0; + offset: -1 -1; } - description { state: "visible" 0.0; - inherit: "default" 0.0; + image { + normal: "shelf_inset.png"; + border: 7 7 7 7; } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; + } + } + + 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; } - } - 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; + rel2 { + to: "background"; + relative: 0.5 0.5; } - description { state: "visible" 0.0; - inherit: "default" 0.0; + text { + font: "Sans:style=Bold,Edje-Vera-Bold"; + size: 10; + min: 1 1; + align: 0.5 0.0; } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 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; } - } - 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 { + to_y: "elm.swallow.bar"; + to_x: "elm.cur.progressbar"; + offset: -1 -1; } - } - 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; + image { + normal: "bt_sm_base2.png"; + border: 6 6 6 6; } - } - 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; + } + 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; } - } - 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; - } + } + description { + state: "state_begin" 0.0; + inherit: "default" 0.0; + rel1 { + to: "elm.swallow.bar"; + relative: 0.0 0.0; } - } - } - 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; + rel2 { + to: "elm.swallow.bar"; + relative: 0.1 1.0; } - description { state: "visible" 0.0; - inherit: "default" 0.0; + } + description { + state: "state_end" 0.0; + inherit: "default" 0.0; + rel1 { + to: "elm.swallow.bar"; + relative: 0.9 0.0; } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 255 255 255 0; - visible: 0; + rel2 { + to: "elm.swallow.bar"; + relative: 1.0 1.0; } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clip"; - description { state: "default" 0.0; - rel1 { - offset: 8 8; - } - rel2 { - offset: -9 -9; - } + } + } + 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"; } - } - 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"; - } - } + } + 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"; + } + } } - - /////////////////////////////////////////////////////////////////////////////// -// FIXME: this doesn't look too hot. need to fix it up - group { name: "elm/progressbar/horizontal/default"; + group { name: "elm/progressbar/vertical/default"; images { image: "shelf_inset.png" COMP; image: "bt_sm_base2.png" COMP; @@ -19711,6 +27682,7 @@ collections { } parts { part { name: "elm.background.progressbar"; + type: RECT; mouse_events: 0; description { state: "default" 0.0; @@ -19720,24 +27692,26 @@ collections { } rel2 { relative: 1.0 1.0; + offset: -1 -1; } } } part { name: "elm.swallow.bar"; - mouse_events: 0; type: SWALLOW; - description { - min: 48 28; - max: 99999 28; - state: "default" 0.0; + scale: 1; + description { state: "default" 0.0; + min: 28 48; + max: 28 9999; + align: 0.5 1.0; rel1 { - to_x: "elm.text"; - to_y: "elm.background.progressbar"; - relative: 1.0 0.0; + to_y: "elm.text"; + relative: 0.0 1.0; + offset: 0 2; } rel2 { - to: "elm.background.progressbar"; - relative: 1.0 1.0; + to_y: "elm.text.box"; + relative: 1.0 0.0; + offset: -1 -3; } } } @@ -19745,23 +27719,23 @@ collections { type: SWALLOW; description { state: "default" 0.0; visible: 0; - align: 0.0 0.5; + align: 0.5 0.0; rel1 { - offset: 4 0; - to_y: "elm.background.progressbar"; + offset: 0 4; + to_x: "elm.swallow.bar"; } rel2 { - offset: 3 -1; - relative: 0.0 1.0; - to_y: "elm.background.progressbar"; + 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: VERTICAL; - rel2.offset: 4 -1; + aspect_preference: HORIZONTAL; + rel2.offset: -1 4; } } part { name: "elm.text"; @@ -19771,27 +27745,27 @@ collections { 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; + 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.0 0.5; + align: 0.5 0.0; } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; text.min: 1 1; - rel1.offset: 0 4; - rel2.offset: 0 -5; + rel1.offset: 4 0; + rel2.offset: -5 0; } } @@ -19816,49 +27790,20 @@ collections { } } - 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; + min: 28 14; fixed: 1 1; rel1 { to: "elm.swallow.bar"; relative: 0.0 0.0; } rel2 { - to_y: "elm.swallow.bar"; - to_x: "elm.cur.progressbar"; + to_x: "elm.swallow.bar"; + to_y: "elm.cur.progressbar"; offset: -1 -1; } image { @@ -19870,8 +27815,8 @@ collections { state: "invert" 0.0; inherit: "default" 0.0; rel1 { - to_y: "elm.swallow.bar"; - to_x: "elm.cur.progressbar"; + to_x: "elm.swallow.bar"; + to_y: "elm.cur.progressbar"; } rel2 { to: "elm.swallow.bar"; @@ -19879,57 +27824,28 @@ collections { } } 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; + 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; } - color: 224 224 224 255; - color3: 0 0 0 64; } - description { state: "hidden" 0.0; + description { + state: "state_end" 0.0; inherit: "default" 0.0; - visible: 0; - text.min: 0 0; + rel1 { + to: "elm.swallow.bar"; + relative: 0.0 0.9; + } + rel2 { + to: "elm.swallow.bar"; + relative: 1.0 1.0; + } } } @@ -19963,11 +27879,11 @@ collections { mouse_events: 0; dragable { confine: "background"; - x: 1 1 1; - y: 0 0 0; + x: 0 0 0; + y: 1 1 1; } description { state: "default" 0.0; - min: 14 28; + min: 28 14; fixed: 1 1; visible: 0; rel1 { @@ -19977,12 +27893,54 @@ collections { rel2.to: "background"; } } - part { name: "progress-rect"; + + part { name: "elm.text.box"; mouse_events: 0; - description { - state: "default" 0.0; - rel1.to: "elm.progress.progressbar"; - rel2.to: "elm.progress.progressbar"; + 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; } } } @@ -20014,16 +27972,16 @@ collections { program { name: "units_show"; signal: "elm,state,units,visible"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "text-bar"; + 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 "hidden" 0.0; - target: "text-bar"; + 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; @@ -20032,8 +27990,7 @@ collections { after: "slide_to_begin"; } program { name: "slide_to_begin"; - signal: "elm,state,slide,begin"; - action: STATE_SET "state_begin" 0.0; + action: STATE_SET "state_begin" 0.0; target: "elm.progress.progressbar"; transition: LINEAR 0.5; after: "slide_to_end"; @@ -20041,6 +27998,8 @@ collections { 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"; @@ -20074,540 +28033,740 @@ collections { 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/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; + 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; + } } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; + } + } + } + + /////////////////////////////////////////////////////////////////////////////// + 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; + } } - } - } - 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; + } + } + } + + 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; } - rel2 { - to_y: "elm.text.box"; - relative: 1.0 0.0; - offset: -1 -3; + } + 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; - visible: 0; - align: 0.5 0.0; - rel1 { - offset: 0 4; - to_x: "elm.swallow.bar"; + } + 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; } - rel2 { - offset: -1 3; - relative: 1.0 0.0; - to_x: "elm.swallow.bar"; + } + 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; } - } - 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; + } + 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: "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; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; - offset: -1 -1; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; + } + 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; + } } - } - } - - 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; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_hilight.png"; + border: 4 4 4 0; + } } - rel2 { - to_x: "elm.swallow.bar"; - to_y: "elm.cur.progressbar"; - offset: -1 -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; + } } - image { - normal: "bt_sm_base2.png"; - border: 6 6 6 6; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; } - } - description { - state: "invert" 0.0; - inherit: "default" 0.0; - rel1 { - to_x: "elm.swallow.bar"; - to_y: "elm.cur.progressbar"; + } + 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; } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.0; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - description { - state: "state_begin" 0.0; - inherit: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.0; + } + 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; } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 0.1; + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; } - } - description { - state: "state_end" 0.0; - inherit: "default" 0.0; - rel1 { - to: "elm.swallow.bar"; - relative: 0.0 0.9; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } - rel2 { - to: "elm.swallow.bar"; - relative: 1.0 1.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; + } } - } - } - - 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; + 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; - 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: "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; + } } - } - } - - 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; + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 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; + 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; } - 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: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } - } - 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 + } + part { name: "left_bt_icon"; + repeat_events: 1; description { state: "default" 0.0; - min: 2 2; + rel1.to: "left_bt"; rel1.offset: 4 4; + rel2.to: "left_bt"; rel2.offset: -5 -5; - image { - normal: "separator_h.png"; + 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"; } - fill { - smooth: 0; + 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; } } - } - } - - /////////////////////////////////////////////////////////////////////////////// - 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; - } - } + } + 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"; } - } - } - 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; - } + 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"; } - part { name: "elm.swallow.bar"; - mouse_events: 0; - type: SWALLOW; - description { state: "default" 0.0; - min: 0 0; - max: 0 0; - visible: 0; + 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); } } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - min: 0 0; - max: 0 0; - visible: 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"; } - 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; - } + 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); } } - } - programs { - program { name: "start_pulse"; - signal: "elm,state,pulse,start"; + program { name: "active"; + signal: "elm,state,active"; source: "elm"; - action: STATE_SET "pulse" 0.0; - target: "background"; - transition: LINEAR 0.5; - after: "start_pulse"; + action: STATE_SET "active" 0.0; + target: "elm.text"; + target: "elm.swallow.entry"; } - program { name: "stop_pulse"; - signal: "elm,state,pulse,stop"; + program { name: "inactive"; + signal: "elm,state,inactive"; source: "elm"; action: STATE_SET "default" 0.0; - target: "background"; + 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/default"; + group { name: "elm/spinner/base/vertical"; 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: "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; @@ -20617,8 +28776,13 @@ collections { part { name: "conf_over"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; + rel1 { + to: "bg"; + relative: 0.0 0.0; + } + rel2 { + to: "bg"; + } image { normal: "shelf_inset.png"; border: 7 7 7 7; @@ -20627,81 +28791,49 @@ collections { fill.smooth : 0; } } - part { name: "left_bt"; + part { name: "down_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; - } - 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; + fixed: 1 1; + rel1 { + to: "up_bt"; + relative: 0 1; + offset: 0 1; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image { - normal: "bt_dis_hilight.png"; - border: 4 4 4 0; + rel2 { + to_y: "bg"; + to_x: "up_bt"; + relative: 1 1; + offset: -1 -4; } - } - } - 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; + 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; - visible: 0; + image { + normal: "bt_dis_base.png"; + border: 4 4 4 4; + } } } - part { name: "left_over3"; + part { name: "down_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"; + rel1.to: "down_bt"; + rel2.to: "down_bt"; image { normal: "bt_glow.png"; border: 12 12 12 12; @@ -20714,27 +28846,31 @@ collections { color: 255 255 255 255; } } - part { name: "right_bt"; + part { name: "up_bt"; mouse_events: 1; description { state: "default" 0.0; + fixed: 1 0; rel1 { to: "bg"; - offset: -27 3; + relative: 0 0; + offset: 0 2; } rel2 { to: "bg"; - offset: -3 -3; + relative: 1 0.5; + offset: -3 0; } align: 1.0 0.5; - min: 24 24; - max: 24 24; + min: 24 16; + aspect: 1.5 1.0; + aspect_preference: BOTH; image { - normal: "bt_base1.png"; - border: 5 5 4 12; + 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_base1.png"; + image.normal: "bt_spinner_up.png"; image.middle: SOLID; } description { state: "disabled" 0.0; @@ -20745,15 +28881,15 @@ collections { } } } - part { name: "right_over1"; + part { name: "up_over1"; mouse_events: 0; description { state: "default" 0.0; - rel1.to: "right_bt"; - rel2 { to: "right_bt"; + rel1.to: "up_bt"; + rel2 { to: "up_bt"; relative: 1.0 0.5; } image { - normal: "bt_hilight.png"; + normal: "bt_spinner_hilight.png"; border: 7 7 7 0; } } @@ -20765,30 +28901,13 @@ collections { } } } - 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"; + part { name: "up_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"; + rel1.to: "up_bt"; + rel2.to: "up_bt"; image { normal: "bt_glow.png"; border: 12 12 12 12; @@ -20801,26 +28920,26 @@ collections { color: 255 255 255 255; } } - part { name: "left_bt_icon"; + part { name: "down_bt_icon"; repeat_events: 1; description { state: "default" 0.0; - rel1.to: "left_bt"; - rel2.to: "left_bt"; + rel1.to: "down_bt"; + rel1.offset: 5 3; + rel2.to: "down_bt"; + rel2.offset: -6 -3; align: 0.5 0.5; - min: 16 16; - max: 16 16; - image.normal: "sp_bt_l.png"; + image.normal: "down.png"; } } - part { name: "right_bt_icon"; + part { name: "up_bt_icon"; repeat_events: 1; description { state: "default" 0.0; - rel1.to: "right_bt"; - rel2.to: "right_bt"; + rel1.to: "up_bt"; + rel1.offset: 5 3; + rel2.to: "up_bt"; + rel2.offset: -6 -3; align: 0.5 0.5; - min: 16 16; - max: 16 16; - image.normal: "sp_bt_r.png"; + image.normal: "up.png"; } } part { name: "elm.text"; @@ -20830,14 +28949,14 @@ collections { description { state: "default" 0.0; visible: 1; align: 0.0 0.5; - rel1 { relative: 1.0 0.0; + rel1 { relative: 0.0 0.0; offset: 3 2; - to_x: "left_bt"; + to_x: "bg"; to_y: "bg"; } rel2 { relative: 0.0 1.0; offset: -3 -2; - to_x: "right_bt"; + to_x: "down_bt"; to_y: "bg"; } color: 0 0 0 255; @@ -20895,15 +29014,13 @@ collections { description { state: "default" 0.0; visible: 0; align: 0.5 0.5; - rel1 { relative: 1.0 0.5; + rel1 { relative: 0.0 0.5; offset: 3 2; - to_x: "left_bt"; - to_y: "bg"; + to: "bg"; } - rel2 { relative: 0.0 0.5; + rel2 { relative: 1.0 0.5; offset: -3 -2; - to_x: "right_bt"; - to_y: "bg"; + to: "bg"; } fixed: 1 1; color: 0 0 0 0; @@ -20949,105 +29066,60 @@ collections { } program { name: "dec"; signal: "mouse,down,1"; - source: "left_bt"; + source: "down_bt"; action: SIGNAL_EMIT "elm,action,decrement,start" ""; } program { name: "dec2"; signal: "mouse,up,1"; - source: "left_bt"; + source: "down_bt"; action: SIGNAL_EMIT "elm,action,decrement,stop" ""; } program { name: "inc"; signal: "mouse,down,1"; - source: "right_bt"; + source: "up_bt"; action: SIGNAL_EMIT "elm,action,increment,start" ""; } program { name: "inc2"; signal: "mouse,up,1"; - source: "right_bt"; + source: "up_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"; + name: "down_bt_click2"; signal: "mouse,down,1"; - source: "left_over3"; + source: "down_over3"; action: STATE_SET "clicked" 0.0; - target: "left_over3"; + target: "down_over3"; } program { - name: "left_bt_unclick2"; + name: "down_bt_unclick2"; signal: "mouse,up,1"; - source: "left_over3"; + source: "down_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"; + target: "down_over3"; } program { - name: "right_bt_click2"; + name: "up_bt_click2"; signal: "mouse,down,1"; - source: "right_over3"; + source: "up_over3"; action: STATE_SET "clicked" 0.0; - target: "right_over3"; + target: "up_over3"; } program { - name: "right_bt_unclick2"; + name: "up_bt_unclick2"; signal: "mouse,up,1"; - source: "right_over3"; + source: "up_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" ""; + target: "up_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: "down_bt"; + target: "up_bt"; target: "disabler"; after: "disable_text"; } @@ -21072,12 +29144,8 @@ collections { 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: "down_bt"; + target: "up_bt"; target: "disabler"; after: "enable_text"; } @@ -21120,899 +29188,1127 @@ collections { } } -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/spinner/base/vertical"; + + /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/index/base/vertical/default"; images { - image: "shelf_inset.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: "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"; + part { name: "clip"; type: RECT; + mouse_events: 0; description { state: "default" 0.0; - max: 99999 30; - min: 0 30; - rel1.offset: 1 1; - rel2.offset: -2 -2; + visible: 0; color: 255 255 255 0; } + description { state: "active" 0.0; + visible: 1; + color: 255 255 255 255; + } } - part { name: "conf_over"; + 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 { - to: "bg"; - relative: 0.0 0.0; - } - rel2 { - to_x: "down_bt"; - offset: -22 -1; + relative: 1.0 0.5; + offset: -1 5; } rel2 { - to_y: "bg"; - } - image { - normal: "shelf_inset.png"; - border: 7 7 7 7; - middle: 0; + relative: 1.0 0.5; + offset: -1 -6; } - fill.smooth : 0; } } - part { name: "down_bt"; - mouse_events: 1; + part { name: "button_image"; + mouse_events: 1; + clip_to: "clip"; description { state: "default" 0.0; rel1 { - to_x: "bg"; - to_y: "up_bt"; - relative: 1 1; - offset: 0 1; + to: "elm.text.body"; + offset: -5 -5; } - rel2 { to: "bg"; - relative: 1 1; - offset: -1 -1; + rel2 { + to: "elm.text"; + offset: 4 4; } - align: 1.0 0.5; - min: 24 16; - max: 24 16; image { - normal: "bt_spinner_down.png"; - border: 6 6 6 6; + normal: "bt_base2.png"; + border: 7 7 7 7; } - 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; + part { name: "elm.text.body"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + clip_to: "clip"; 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; + 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; } - 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; + part { name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + clip_to: "clip"; 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; + fixed: 1 1; + rel1 { + to_x: "elm.swallow.event.0"; + to_y: "elm.dragable.pointer"; + relative: 0.0 0.5; + offset: -16 0; } - 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; + 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: "up_over1"; + part { name: "over1"; mouse_events: 0; + clip_to: "clip"; description { state: "default" 0.0; - rel1.to: "up_bt"; - rel2 { to: "up_bt"; + rel1 { + to: "button_image"; + } + rel2 { + to: "button_image"; relative: 1.0 0.5; } image { - normal: "bt_spinner_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: "up_over3"; + part { name: "over2"; mouse_events: 1; repeat_events: 1; + ignore_flags: ON_HOLD; + clip_to: "clip"; description { state: "default" 0.0; - color: 255 255 255 0; - rel1.to: "up_bt"; - rel2.to: "up_bt"; + rel1 { + to: "button_image"; + } + rel2 { + to: "button_image"; + } image { - normal: "bt_glow.png"; - border: 12 12 12 12; + normal: "bt_shine.png"; + border: 7 7 7 7; } - 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; + 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; - rel1.to: "down_bt"; - rel2.to: "down_bt"; - align: 0.5 0.5; - min: 14 12; - max: 14 12; - image.normal: "down.png"; + 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: "up_bt_icon"; - repeat_events: 1; + part { name: "elm.swallow.event.0"; + type: SWALLOW; 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"; + 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; + } } } - part { name: "elm.text"; - type: TEXT; + } + 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; - 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"; + 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; } - rel2 { relative: 0.0 1.0; - offset: -3 -2; - to_x: "bg"; - to_y: "bg"; + image { + normal: "ilist_item_shadow.png"; } - color: 0 0 0 255; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 1 1; - align: 0.5 0.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; } + fill.smooth: 0; } 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; + rel1 { + offset: -16 0; + } } } - part { name: "elm.dragable.slider"; - type: RECT; - mouse_events: 0; + part { name: "elm.text"; + type: TEXT; + 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"; + description { + state: "default" 0.0; + // min: 16 16; + rel1 { + to: "base"; + relative: 0.0 0.0; + offset: 4 4; } - rel2 { relative: 1.0 0.5; - offset: -3 -2; - to: "bg"; + 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; } - 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; + color: 0 0 0 255; } } } programs { - program { name: "text_show"; - signal: "elm,state,text,visible"; + program { name: "active"; + signal: "elm,state,active"; source: "elm"; - action: STATE_SET "visible" 0.0; + action: STATE_SET "active" 0.0; + transition: DECELERATE 0.5; target: "elm.text"; + target: "base"; } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; + program { name: "inactive"; + signal: "elm,state,inactive"; 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"; + target: "elm.text"; + target: "base"; } - 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); + 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; + } } - } - 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); + 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: "elm.swallow.entry"; + 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: "elm.swallow.entry"; + 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"; } - program { name: "toggle_text"; - signal: "mouse,up,1"; - source: "button_events"; - action: SIGNAL_EMIT "elm,action,entry,toggle" ""; + 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"; } } - } - - - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/index/base/vertical/default"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; images { - image: "bt_base1.png" COMP; - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.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_item_shadow.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"; + part { name: "event"; 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"; + repeat_events: 1; 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; - } + color: 0 0 0 0; } } - part { name: "button_image"; - mouse_events: 1; - clip_to: "clip"; + 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: "elm.text.body"; - offset: -5 -5; + to: "base"; + relative: 0.0 1.0; + offset: 0 0; } rel2 { - to: "elm.text"; - offset: 4 4; + to: "base"; + relative: 1.0 1.0; + offset: -1 0; } image { - normal: "bt_base2.png"; - border: 7 7 7 7; + normal: "ilist_item_shadow.png"; } - image.middle: SOLID; + fill.smooth: 0; } } - part { name: "elm.text.body"; - type: TEXT; - effect: SOFT_SHADOW; + part { name: "base"; 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; + min: 16 28; + image { + normal: "ilist_1.png"; + border: 2 2 2 2; } + fill.smooth: 0; } } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; + part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; - scale: 1; - clip_to: "clip"; description { state: "default" 0.0; - align: 1.0 0.5; + visible: 0; + color: 255 255 255 0; rel1 { - to_x: "elm.swallow.event.0"; - to_y: "elm.dragable.pointer"; - relative: 0.0 0.5; - offset: -16 0; + relative: 0.0 0.0; + offset: -5 -5; } rel2 { - to_x: "elm.swallow.event.0"; - to_y: "elm.dragable.pointer"; - relative: 0.0 0.5; - offset: -16 -1; + relative: 1.0 1.0; + offset: 4 4; } - 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; + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; } + image.middle: SOLID; } - } - part { name: "over1"; - mouse_events: 0; - clip_to: "clip"; - description { state: "default" 0.0; + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; rel1 { - to: "button_image"; + relative: 0.0 0.0; + offset: -2 -2; } rel2 { - to: "button_image"; - relative: 1.0 0.5; - } - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; + relative: 1.0 1.0; + offset: 1 1; } } } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - clip_to: "clip"; + part { name: "elm.swallow.pad"; + type: SWALLOW; description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; rel1 { - to: "button_image"; + relative: 0.0 0.0; + offset: 4 4; } rel2 { - to: "button_image"; - } - image { - normal: "bt_shine.png"; - border: 7 7 7 7; + relative: 0.0 1.0; + offset: 4 -5; } } } - part { name: "elm.dragable.pointer"; - type: RECT; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 1 1 0; - } - clip_to: "clip"; + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; description { state: "default" 0.0; - fixed: 1 1; - min: 8 8; - max: 8 8; + fixed: 1 0; + align: 0.0 0.5; rel1 { - relative: 0.0 0.0; - offset: 0 0; + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; } rel2 { - relative: 0.0 0.0; - offset: 0 0; + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; } - color: 0 0 255 128; } } - part { name: "elm.swallow.event.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: -1 0; + relative: 1.0 0.0; + offset: -5 4; } rel2 { - relative: 1.0 1.0; - offset: -1 -1; + relative: 1.0 1.0; + offset: -5 -5; } } } - } - 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"; + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXTBLOCK; mouse_events: 0; + scale: 1; description { state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; + align: 0.0 0.5; + fixed: 0 1; rel1 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; + to_x: "elm.swallow.icon"; + to_y: "base"; + relative: 1.0 0.5; + offset: 0 4; } rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - image { - normal: "ilist_item_shadow.png"; + to_x: "elm.swallow.end"; + to_y: "base"; + relative: 0.0 0.5; + offset: -1 -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; + text { + style: "gengrid_style"; + min: 1 1; } - fill.smooth: 0; } - description { state: "active" 0.0; + description { state: "selected" 0.0; inherit: "default" 0.0; - rel1 { - offset: -16 0; + text { + style: "gengrid_selected_style"; } } } - 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; + 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: "active" 0.0; + description { state: "selected" 0.0; inherit: "default" 0.0; - color: 0 0 0 255; + visible: 1; + color: 255 255 255 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"; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; - description { - state: "default" 0.0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; image { - normal: "ilist_2.png"; - border: 2 2 2 2; + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - fill.smooth: 0; } - description { state: "active" 0.0; + description { state: "selected" 0.0; inherit: "default" 0.0; - rel1 { - offset: -16 0; - } + visible: 1; + color: 255 255 255 255; } } - 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; - } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; } - description { state: "active" 0.0; + description { state: "disabled" 0.0; inherit: "default" 0.0; - color: 0 0 0 255; + color: 255 255 255 64; } } } 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"; + // 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: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "elm.text"; - target: "base"; + program { name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; } } } - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/gengrid/item/default/default"; + group { name: "elm/gengrid/item/up/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; + 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"; + part { name: "event"; type: RECT; repeat_events: 1; - description { - state: "default" 0.0; + description { state: "default" 0.0; color: 0 0 0 0; } } - part { - name: "base_sh"; + part { name: "bg"; + clip_to: "disclip"; mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.0; - min: 0 10; - fixed: 1 1; + 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 { - to: "base"; - relative: 0.0 1.0; - offset: 0 0; + relative: 0.0 1.0; + offset: 20 -25; } rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; + 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: "ilist_item_shadow.png"; + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; } - fill.smooth: 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; } } - part { - name: "base"; + part { name: "fg2"; + clip_to: "disclip"; mouse_events: 0; - description { - state: "default" 0.0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.offset: -3 -3; + rel2.offset: 2 2; image { - normal: "ilist_1.png"; - border: 2 2 2 2; + normal: "bt_sm_shine.png"; + border: 6 6 6 0; } - fill.smooth: 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"; @@ -22021,100 +30317,159 @@ collections { 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; - } + rel1.offset: -3 -3; + rel2.offset: 2 2; image { normal: "bt_sm_base1.png"; border: 6 6 6 6; + middle: SOLID; } - image.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; - offset: -2 -2; + relative: 0.0 0.0; + to: "icon_box"; } rel2 { - relative: 1.0 1.0; - offset: 1 1; + relative: 0.5 0.5; + offset: -1 -1; + to: "icon_box"; } } } - part { name: "elm.swallow.pad"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; + part { name: "elm.swallow.icon.2"; + type: SWALLOW; + mouse_events: 0; + clip_to: "have-files-clipper"; + description { state: "default" 0.0; rel1 { - relative: 0.0 1.0; - offset: 0 -10; + relative: 0.5 0.0; + to: "icon_box"; } rel2 { - to_y: "elm.text"; - relative: 0.0 0.0; - offset: -1 -1; + relative: 1.0 0.5; + offset: -1 -1; + to: "icon_box"; } } } - part { name: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.5 0.5; + 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.0; - offset: -1 4; + relative: 0.0 0.5; + to: "icon_box"; } rel2 { - to_y: "elm.swallow.pad"; - relative: 1.0 0.0; - offset: -1 -5; + 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.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; + description { state: "default" 0.0; rel1 { relative: 0.0 1.0; - offset: 0 0; + offset: 20 -30; } rel2 { relative: 1.0 1.0; - offset: -5 -5; + offset: -21 -15; } color: 0 0 0 255; color3: 0 0 0 0; @@ -22123,12 +30478,12 @@ collections { 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; + inherit: "default" 0.0; + color: 255 255 255 255; } } part { name: "fg1"; @@ -22137,9 +30492,11 @@ collections { 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.offset: -3 -3; + rel2 { + relative: 1.0 0.5; + offset: 2 -1; + } image { normal: "bt_sm_hilight.png"; border: 6 6 6 0; @@ -22157,8 +30514,8 @@ collections { description { state: "default" 0.0; visible: 0; color: 255 255 255 0; - rel1.to: "bg"; - rel2.to: "bg"; + rel1.offset: -3 -3; + rel2.offset: 2 2; image { normal: "bt_sm_shine.png"; border: 6 6 6 0; @@ -22183,13 +30540,7 @@ collections { } } 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"; + program { name: "go_active"; signal: "elm,state,selected"; source: "elm"; action: STATE_SET "selected" 0.0; @@ -22198,8 +30549,7 @@ collections { target: "fg2"; target: "elm.text"; } - program { - name: "go_passive"; + program { name: "go_passive"; signal: "elm,state,unselected"; source: "elm"; action: STATE_SET "default" 0.0; @@ -22209,225 +30559,149 @@ collections { target: "elm.text"; transition: LINEAR 0.1; } - program { - name: "go_disabled"; + program { name: "go_disabled"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "disclip"; } - program { - name: "go_enabled"; + 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/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"; - } + + group { name: "elm/gengrid/item/thumb/default"; + data { + item: "icons" "elm.swallow.icon"; + item: "labels" "elm.text"; } - 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; + image: "thumb_shadow.png" COMP; } parts { - part { - name: "event"; + part { name: "event"; type: RECT; repeat_events: 1; - description { - state: "default" 0.0; + 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; - } + rel1.offset: -3 -3; + rel2.offset: 2 2; image { normal: "bt_sm_base1.png"; border: 6 6 6 6; + 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; - } - rel2 { - relative: 1.0 1.0; - offset: 1 1; - } } } - part { name: "elm.swallow.pad"; - type: SWALLOW; + part { name: "border-shadow"; + type: IMAGE; + mouse_events: 0; description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; rel1 { - relative: 0.0 0.0; - offset: 4 4; + to: "elm.swallow.icon"; + offset: -18 -18; } rel2 { - relative: 0.0 1.0; - offset: 4 -5; + 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: "elm.swallow.icon"; - clip_to: "disclip"; - type: SWALLOW; + part { name: "border"; + type: RECT; + mouse_events: 0; 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; + to: "border-shadow"; + offset: 16 16; } rel2 { - to_x: "elm.swallow.pad"; - relative: 1.0 1.0; - offset: -1 -5; + to: "border-shadow"; + offset: -15 -15; } } } - part { name: "elm.swallow.end"; - clip_to: "disclip"; + part { name: "elm.swallow.icon"; type: SWALLOW; + mouse_events: 0; description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.5; + aspect_preference: BOTH; aspect: 1.0 1.0; - aspect_preference: VERTICAL; - rel1 { - relative: 1.0 0.0; - offset: -5 4; - } + rel1.offset: 0 8; rel2 { - relative: 1.0 1.0; - offset: -5 -5; + to_y: "elm.text"; + relative: 1.0 0.0; + offset: -1 -2; } } } part { name: "elm.text"; - clip_to: "disclip"; - type: TEXTBLOCK; + type: TEXT; + effect: SOFT_SHADOW; mouse_events: 0; scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.5; - fixed: 0 1; + description { state: "default" 0.0; + color: 0 0 0 255; + color3: 0 0 0 0; + align: 0.5 1.0; rel1 { - to_x: "elm.swallow.icon"; - to_y: "base"; - relative: 1.0 0.5; - offset: 0 4; + relative: 0.0 1.0; + offset: 20 -30; } rel2 { - to_x: "elm.swallow.end"; - to_y: "base"; - relative: 0.0 0.5; - offset: -1 -5; - } - text { - style: "gengrid_style"; - min: 1 1; + relative: 1.0 1.0; + offset: -21 -15; } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; text { - style: "gengrid_selected_style"; + font: "Sans"; + size: 10; + min: 0 1; + align: 0.5 0.0; + text_class: "grid_item"; } } } 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"; + rel1.offset: -3 -3; + rel2 { + relative: 1.0 0.5; + offset: 2 -1; + } image { normal: "bt_sm_hilight.png"; border: 6 6 6 0; @@ -22440,15 +30714,14 @@ collections { } } 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"; + rel1.offset: -3 -3; + rel2.offset: 2 2; image { - normal: "bt_sm_shine.png"; + image: "bt_sm_shine.png"; border: 6 6 6 0; } } @@ -22458,63 +30731,29 @@ collections { 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"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; } program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; + signal: "elm,state,unselected"; + source: "elm"; action: STATE_SET "default" 0.0; - target: "bg"; - target: "fg1"; - target: "fg2"; - target: "elm.text"; + target: "bg"; + target: "fg1"; + target: "fg2"; 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; @@ -22545,8 +30784,6 @@ collections { 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; @@ -22664,7 +30901,7 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 17; + min: 10 17; align: 1.0 0.0; rel1 { relative: 1.0 0.0; @@ -22677,21 +30914,6 @@ collections { } } } - 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; @@ -22702,7 +30924,8 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 17 17; + min: 10 17; + max: 10 99999; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -22716,8 +30939,8 @@ collections { image { normal: "bt_sm_base2.png"; border: 6 6 6 6; + middle: SOLID; } - image.middle: SOLID; } } part { name: "sb_vbar_over1"; @@ -22773,7 +30996,7 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 17; + min: 17 10; align: 0.0 1.0; rel1 { relative: 0.0 1.0; @@ -22786,21 +31009,6 @@ collections { } } } - 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; @@ -22811,7 +31019,8 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 17 17; + min: 17 10; + max: 99999 10; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -22824,9 +31033,9 @@ collections { } image { normal: "bt_sm_base2.png"; - border: 6 6 6 6; + border: 4 4 4 4; + middle: SOLID; } - image.middle: SOLID; } } part { name: "sb_hbar_over1"; @@ -22838,7 +31047,7 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + border: 4 4 4 0; } } } @@ -22850,7 +31059,7 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_shine.png"; - border: 6 6 6 0; + border: 4 4 4 0; } } } @@ -22916,14 +31125,14 @@ collections { signal: "do-show-vbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 1.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 1.0; + transition: LINEAR 0.5; target: "sb_vbar_clip"; } @@ -22973,14 +31182,14 @@ collections { signal: "do-show-hbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 1.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 1.0; + transition: LINEAR 0.5; target: "sb_hbar_clip"; } @@ -23003,7 +31212,7 @@ collections { } v = get_int(sbvis_timer); if (v > 0) cancel_timer(v); - v = timer(2.0, "timer0", 0); + v = timer(1.0, "timer0", 0); set_int(sbvis_timer, v); } } @@ -23068,8 +31277,6 @@ collections { 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; @@ -23187,7 +31394,7 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 17; + min: 10 17; align: 1.0 0.0; rel1 { relative: 1.0 0.0; @@ -23200,21 +31407,6 @@ collections { } } } - 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; @@ -23225,7 +31417,8 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 17 17; + min: 10 17; + max: 10 99999; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -23239,8 +31432,8 @@ collections { image { normal: "bt_sm_base2.png"; border: 6 6 6 6; + middle: SOLID; } - image.middle: SOLID; } } part { name: "sb_vbar_over1"; @@ -23296,7 +31489,7 @@ collections { description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 17; + min: 17 10; align: 0.0 1.0; rel1 { relative: 0.0 1.0; @@ -23309,21 +31502,6 @@ collections { } } } - 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; @@ -23334,7 +31512,8 @@ collections { } description { state: "default" 0.0; fixed: 1 1; - min: 17 17; + min: 17 10; + max: 99999 10; rel1 { relative: 0.5 0.5; offset: 0 0; @@ -23347,9 +31526,9 @@ collections { } image { normal: "bt_sm_base2.png"; - border: 6 6 6 6; + border: 4 4 4 4; + middle: SOLID; } - image.middle: SOLID; } } part { name: "sb_hbar_over1"; @@ -23361,7 +31540,7 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_hilight.png"; - border: 6 6 6 0; + border: 4 4 4 0; } } } @@ -23373,7 +31552,7 @@ collections { rel2.to: "elm.dragable.hbar"; image { normal: "bt_sm_shine.png"; - border: 6 6 6 0; + border: 4 4 4 0; } } } @@ -23439,14 +31618,14 @@ collections { signal: "do-show-vbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 1.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 1.0; + transition: LINEAR 0.5; target: "sb_vbar_clip"; } @@ -23496,14 +31675,14 @@ collections { signal: "do-show-hbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 1.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 1.0; + transition: LINEAR 0.5; target: "sb_hbar_clip"; } @@ -23526,7 +31705,7 @@ collections { } v = get_int(sbvis_timer); if (v > 0) cancel_timer(v); - v = timer(2.0, "timer0", 0); + v = timer(1.0, "timer0", 0); set_int(sbvis_timer, v); } } @@ -24411,6 +32590,7 @@ collections { //Arrow part { name: "arrow_right"; + mouse_events: 0; description { state: "default" 0.0; min: 45 45; max: 45 45; @@ -24443,6 +32623,7 @@ collections { } part { name: "arrow_left"; + mouse_events: 0; description { state: "default" 0.0; min: 45 45; max: 45 45; @@ -24642,6 +32823,7 @@ collections { ///////////////////////////////////////////////////////////////////////////// group { name: "elm/panel/base/left"; + alias: "elm/panel/base/top"; images { image: "bt_base1.png" COMP; @@ -24652,8 +32834,35 @@ collections { 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"; @@ -24663,14 +32872,19 @@ collections { { state: "default" 0.0; color: 255 255 255 0; - rel1.offset: 30 0; - rel2.relative: 0.0 1.0; + rel1.relative: 0.0 0.0; + rel1.offset: 0 0; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -1; } description { - state: "visible" 0.0; + state: "hidden" 0.0; inherit: "default" 0.0; - rel2.relative: 1.0 1.0; + rel1.relative: -1.0 0.0; + rel1.offset: 21 0; + rel2.relative: 0.0 1.0; + rel2.offset: 20 -1; } } part @@ -24681,11 +32895,9 @@ collections { description { state: "default" 0.0; - rel2 - { - offset: -20 -1; - to_x: "bg"; - } + rel1.to: "bg"; + rel2.to: "bg"; + rel2.offset: -20 -1; image { normal: "bt_dis_base.png"; @@ -24836,13 +33048,13 @@ collections { align: 0.5 0.5; min: 16 16; max: 16 16; - image.normal: "icon_arrow_right.png"; + image.normal: "icon_arrow_left.png"; } description { - state: "visible" 0.0; + state: "hidden" 0.0; inherit: "default" 0.0; - image.normal: "icon_arrow_left.png"; + image.normal: "icon_arrow_right.png"; } } } @@ -24853,26 +33065,9 @@ collections { name: "show"; signal: "elm,action,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "bg"; - target: "btn_icon"; - transition: LINEAR 0.5; - } - program - { - name: "show2"; - signal: "show"; action: STATE_SET "default" 0.0; target: "bg"; target: "btn_icon"; - after: "show3"; - } - program - { - name: "show3"; - action: STATE_SET "visible" 0.0; - target: "bg"; - target: "btn_icon"; transition: LINEAR 0.5; } program @@ -24880,7 +33075,7 @@ collections { name: "hide"; signal: "elm,action,hide"; source: "elm"; - action: STATE_SET "default" 0.0; + action: STATE_SET "hidden" 0.0; target: "bg"; target: "btn_icon"; transition: LINEAR 0.5; @@ -24921,15 +33116,30 @@ collections { program { name: "btn_unclick3"; - signal: "mouse,up,1"; + 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; @@ -24942,6 +33152,30 @@ collections { } 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"; @@ -24951,14 +33185,19 @@ collections { { state: "default" 0.0; color: 255 255 255 0; - rel1.relative: 1 0; - rel2.offset: -31 0; + rel1.relative: 0.0 0.0; + rel1.offset: 0 0; + rel2.relative: 1.0 1.0; + rel2.offset: -1 -1; } description { - state: "visible" 0.0; + state: "hidden" 0.0; inherit: "default" 0.0; - rel1.relative: 0 0; + rel1.relative: 1.0 0.0; + rel1.offset: -22 0; + rel2.relative: 2.0 1.0; + rel2.offset: -23 -1; } } part @@ -24969,12 +33208,9 @@ collections { description { state: "default" 0.0; - rel1 - { - offset: 20 0; - to_x: "bg"; - } - rel2.offset: -1 -1; + rel1.to: "bg"; + rel1.offset: 20 0; + rel2.to: "bg"; image { normal: "bt_dis_base.png"; @@ -25128,13 +33364,13 @@ collections { align: 0.5 0.5; min: 16 16; max: 16 16; - image.normal: "icon_arrow_left.png"; + image.normal: "icon_arrow_right.png"; } description { - state: "visible" 0.0; + state: "hidden" 0.0; inherit: "default" 0.0; - image.normal: "icon_arrow_right.png"; + image.normal: "icon_arrow_left.png"; } } } @@ -25145,26 +33381,9 @@ collections { name: "show"; signal: "elm,action,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "bg"; - target: "btn_icon"; - transition: LINEAR 0.5; - } - program - { - name: "show2"; - signal: "show"; action: STATE_SET "default" 0.0; target: "bg"; target: "btn_icon"; - after: "show3"; - } - program - { - name: "show3"; - action: STATE_SET "visible" 0.0; - target: "bg"; - target: "btn_icon"; transition: LINEAR 0.5; } program @@ -25172,7 +33391,7 @@ collections { name: "hide"; signal: "elm,action,hide"; source: "elm"; - action: STATE_SET "default" 0.0; + action: STATE_SET "hidden" 0.0; target: "bg"; target: "btn_icon"; transition: LINEAR 0.5; @@ -25217,6 +33436,20 @@ collections { 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"; + } } } @@ -25238,6 +33471,17 @@ collections { 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"; } } @@ -25252,7 +33496,6 @@ collections { } } - ///////////////////////////////////////////////////////////////////////////// // CALENDAR ///////////////////////////////////////////////////////////////////////////// @@ -25581,393 +33824,2555 @@ collections { } \ } - 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; + 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; + } + } + 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; + } + } + 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; + } + } + 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; + } + } + 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; + } + } + 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; + } + } + 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; + } + } + 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; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "bt_base1.png"; + image.middle: SOLID; + } + } + 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; + } + } + } + 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: "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: "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: "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; + } + } + } + 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; + } + } + } + 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"; + rel2.to: "left_bt"; + align: 0.5 0.5; + min: 16 16; + max: 16 16; + image.normal: "sp_bt_l.png"; + } + } + 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"; + } + } + 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; + } + } + } + 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 + +//////////////////////////////////////////////////////////////////////////////// +// 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; + } + } + } + } + + 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"; + } + } + 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: "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; + } + dragable { + confine: "elm.arrow_bg"; + x: 1 1 0; + y: 0 0 0; + } + } + 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"; + } + } + } + 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; + } + dragable { + events: "elm.arrow"; + } + } + 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.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; + } + } + } + } + + 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"; + } + } + } + } + + 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/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"; + } + } + } + } + + 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"; + } + } + } + } + + 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"; + } + } + } + } + + 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; + } + } + part { name: "arrow_image"; + type: IMAGE; + mouse_events: 1; + description { state: "default" 0.0; + image.normal: "icon_arrow_down.png"; + } + } + } + } + + group { name: "elm/colorselector/button/left"; + images { + image: "bt_base1.png" COMP; + image: "bt_shine.png" COMP; + image: "sp_bt_l.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; + } + + 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; + } + } + } + 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: "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; + + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "left_arrow"; + mouse_events: 1; + description { state: "default" 0.0; + min: 16 16; + max: 16 16; + image.normal: "sp_bt_l.png"; + } + } + } + + 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; + image.middle: SOLID; + } + + 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; + } + } + } + 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: "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; + + } + description { state: "clicked" 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; + + public animator_bottom_down(val, Float:pos) { + new tmp[FLIP_PICKER_MAX_LEN]; + + 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); + + 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, 1, tmp); + } + } + } + + 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); + } + } + } + + 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); + } + + /* 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); + + replace_str(cur, 0, value); + + set_state(PART:"bottom_sheet", "default", 0.0); + set_state(PART:"top_sheet", "shrink", 0.0); + + set_int(lock, 1); + set_state(PART:"shadow", "full", 0.0); + anim(0.2, "animator_bottom_up", 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"; + scale: 1; + description { state: "default" 0.0; + rel1.offset: 4 4; + rel2.offset: -5 -5; + min: 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; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 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; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + 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"; + } + } + + 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; + } + } + } + + 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; + } + } + + 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! */ + } + } + + 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"; + } + } + + 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"; + } + } + } + + part { name: "top_sheet"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 1; + rel1.to: "t"; + rel2.to: "t"; + image.normal: "flip_t.png"; + } + description { state: "shrink" 0.0; + inherit: "default" 0.0; + color: 128 128 128 255; + visible: 0; + rel1.relative: 0.0 1.0; + } + } + + 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; + } + } + + part { name: "arrow_top"; + 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"; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "arrow_bottom"; + mouse_events: 0; + scale: 1; + 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"; + } + description { state: "hidden" 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"; + visible: 1; + } + } + + part { + type: RECT; + mouse_events: 0; + name: "bottom_clipper"; + description { + state: "default" 0.0; + rel1.to: "b"; + rel2.to: "b"; + visible: 1; + } + } + } + + programs { + program { name: "load"; + signal: "load"; + source: ""; + script { + append_str(cur, ""); + append_str(prev, ""); + append_str(next, ""); + set_int(lock, 0); + } + } + + 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"; + } + + 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"; + } + + 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" ""; + } + } + } + +//////////////////////////////////////////////////////////////////////////////// +// 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; + } + } + 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; + } + } + 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"; + } + } + } + } + + 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; + } + } + description { state: "show" 0.0; + inherit: "default" 0.0; + } + description { state: "default_small" 0.0; + inherit: "default" 0.0; + rel1.relative: 0 0.2; + rel2.relative: 0 0.8; + } + 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; + } + 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: "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; + } + } + 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; + } + } + } + + 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; + } + } + } + } + + 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; + } + } + } + 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; + } + } + } + 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; + } + } + } + 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; + } + } + } + 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; + } + } + } + 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; + } + } + } + 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; + } + } + } + } + } + + 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; + } + } + } + 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; + } + } + } + } + } + +//////////////////////////////////////////////////////////////////////// +// 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: "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; + } + } + } + } + } + + /* 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: "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_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 { 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"; + } + } + 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 { 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; + } + } + } + + 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; + } + } + } + } + } + + /* 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: "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; + } + } + + 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; + } + params.string: "label" "Next"; } - 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; + } + 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"; } - } - 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 { + to_y: "back"; } - } - 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; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + rel2 { + relative: 1.0 0.0; } - } - 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; + } + } + 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: "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; + rel2 { + relative: 0.0 0.0; + offset: 50 32; } - } - 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; + 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; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; + rel2 { + relative: 1.0 0.0; + offset: -1 32; } + params.string: "label" "Next"; } - 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; - } + } + 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: "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; - } + rel2 { to_y: "back"; + to_x: "next"; + relative: 0.0 1.0; + offset: -3 -1; } - } - 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; + text { + font: "Sans:style=Bold"; + size: 12; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + } + } + } + } + + /* 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; } - } - 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; + 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; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: "bt_base1.png"; - image.middle: SOLID; + } + } + } + } + + /* 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: "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; + } + } + } + } + } + + /* 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; + } + } + } + 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_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; - } + } + } + 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_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; - } + rel2 { + to: "base"; + relative: 0.0 1.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: "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; } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -5 -1; } - } - 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"; + } + 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: "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"; + rel2 { + to_x: "elm.swallow.end"; + to_y: "base"; + relative: 0.0 1.0; } - } - 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; - } + text { + font: "Sans"; + size: 12; + min: 0 0; + align: 0.5 0.5; + text_class: "title_bar"; } - } - 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"; - } - } + } + } + } + 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"; + } + } } - -#undef CIT -#undef CH +} diff --git a/data/themes/flip_b.png b/data/themes/flip_b.png new file mode 100644 index 0000000..bb7c7e7 Binary files /dev/null and b/data/themes/flip_b.png differ diff --git a/data/themes/flip_t.png b/data/themes/flip_t.png new file mode 100644 index 0000000..74ed50d Binary files /dev/null and b/data/themes/flip_t.png differ diff --git a/data/themes/group_index.png b/data/themes/group_index.png new file mode 100644 index 0000000..7df0680 Binary files /dev/null and b/data/themes/group_index.png differ diff --git a/data/themes/icon_arrow_down_left.png b/data/themes/icon_arrow_down_left.png new file mode 100644 index 0000000..2f1d2ed Binary files /dev/null and b/data/themes/icon_arrow_down_left.png differ diff --git a/data/themes/icon_arrow_down_right.png b/data/themes/icon_arrow_down_right.png new file mode 100644 index 0000000..0439e88 Binary files /dev/null and b/data/themes/icon_arrow_down_right.png differ diff --git a/data/themes/icon_arrow_up_left.png b/data/themes/icon_arrow_up_left.png new file mode 100644 index 0000000..711bef8 Binary files /dev/null and b/data/themes/icon_arrow_up_left.png differ diff --git a/data/themes/icon_arrow_up_right.png b/data/themes/icon_arrow_up_right.png new file mode 100644 index 0000000..7a9f495 Binary files /dev/null and b/data/themes/icon_arrow_up_right.png differ diff --git a/data/themes/ilist_1_h.png b/data/themes/ilist_1_h.png new file mode 100644 index 0000000..bd2fd15 Binary files /dev/null and b/data/themes/ilist_1_h.png differ diff --git a/data/themes/ilist_2_h.png b/data/themes/ilist_2_h.png new file mode 100644 index 0000000..6ab252e Binary files /dev/null and b/data/themes/ilist_2_h.png differ diff --git a/data/themes/ilist_item_shadow_h.png b/data/themes/ilist_item_shadow_h.png new file mode 100644 index 0000000..fb21bc5 Binary files /dev/null and b/data/themes/ilist_item_shadow_h.png differ diff --git a/data/themes/sl_bt_3.png b/data/themes/sl_bt_3.png new file mode 100644 index 0000000..8be95f5 Binary files /dev/null and b/data/themes/sl_bt_3.png differ diff --git a/data/themes/thumb_shadow.png b/data/themes/thumb_shadow.png new file mode 100644 index 0000000..8e66670 Binary files /dev/null and b/data/themes/thumb_shadow.png differ diff --git a/data/themes/tooltip-base.png b/data/themes/tooltip-base.png new file mode 100644 index 0000000..3ab8e0f Binary files /dev/null and b/data/themes/tooltip-base.png differ diff --git a/data/themes/tooltip-corner-bottom-left-tip.png b/data/themes/tooltip-corner-bottom-left-tip.png new file mode 100644 index 0000000..f60787b Binary files /dev/null and b/data/themes/tooltip-corner-bottom-left-tip.png differ diff --git a/data/themes/tooltip-corner-bottom-right-tip.png b/data/themes/tooltip-corner-bottom-right-tip.png new file mode 100644 index 0000000..4d715f3 Binary files /dev/null and b/data/themes/tooltip-corner-bottom-right-tip.png differ diff --git a/data/themes/tooltip-corner-top-left-tip.png b/data/themes/tooltip-corner-top-left-tip.png new file mode 100644 index 0000000..3f74c58 Binary files /dev/null and b/data/themes/tooltip-corner-top-left-tip.png differ diff --git a/data/themes/tooltip-corner-top-right-tip.png b/data/themes/tooltip-corner-top-right-tip.png new file mode 100644 index 0000000..c9dbaa2 Binary files /dev/null and b/data/themes/tooltip-corner-top-right-tip.png differ diff --git a/data/themes/tooltip-edge-bottom-tip.png b/data/themes/tooltip-edge-bottom-tip.png new file mode 100644 index 0000000..49fd2b0 Binary files /dev/null and b/data/themes/tooltip-edge-bottom-tip.png differ diff --git a/data/themes/tooltip-edge-left-tip.png b/data/themes/tooltip-edge-left-tip.png new file mode 100644 index 0000000..6cf071e Binary files /dev/null and b/data/themes/tooltip-edge-left-tip.png differ diff --git a/data/themes/tooltip-edge-right-tip.png b/data/themes/tooltip-edge-right-tip.png new file mode 100644 index 0000000..cd541a6 Binary files /dev/null and b/data/themes/tooltip-edge-right-tip.png differ diff --git a/data/themes/tooltip-edge-top-tip.png b/data/themes/tooltip-edge-top-tip.png new file mode 100644 index 0000000..a341a21 Binary files /dev/null and b/data/themes/tooltip-edge-top-tip.png differ diff --git a/debian/changelog b/debian/changelog index d907a5b..a210e2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,43 +1,3 @@ -elementary (1.0.0+svn.51480slp2+build87) unstable; urgency=low - - * Packaging for fixing elm_priv.h bug - * Git: 165.213.180.234:slp/pkgs/e/elementary - * Tag: elementary_1.0.0+svn.51480slp2+build87 - - -- WooHyun Jung Wed, 05 Jan 2011 13:05:03 +0900 - -elementary (1.0.0+svn.51480slp2+build86) unstable; urgency=low - - * Packaging for fixing elm_priv.h bug - * Git: 165.213.180.234:slp/pkgs/e/elementary - * Tag: elementary_1.0.0+svn.51480slp2+build86 - - -- Hyoyoung Chang Wed, 05 Jan 2011 12:16:11 +0900 - -elementary (1.0.0+svn.51480slp2+build85) unstable; urgency=low - - * version up - * Git: 165.213.180.234:slp/pkgs/e/elementary - * Tag: elementary_1.0.0+svn.51480slp2+build85 - - -- Hyoyoung Chang Wed, 05 Jan 2011 11:46:34 +0900 - -elementary (1.0.0+svn.51480slp2+build84) unstable; urgency=low - - * bugfix at elm_{label, entry} - * Git: 165.213.180.234:slp/pkgs/e/elementary - * Tag: elementary_1.0.0+svn.51480slp2+build84 - - -- Hyoyoung Chang Wed, 05 Jan 2011 11:36:51 +0900 - -elementary (1.0.0+svn.51480slp2+build83) unstable; urgency=low - - * Package uplaod for revert - * Git: 165.213.180.234:slp/pkgs/e/elementary - * Tag: elementary_1.0.0+svn.51480slp2+build83 - - -- WooHyun Jung Wed, 05 Jan 2011 01:06:07 +0900 - elementary (1.0.0+svn.51480slp2+build82) unstable; urgency=low * Package uplaod for revert diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index cfae1c5..2672432 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -78,7 +78,8 @@ test_multi.c \ test_floating.c \ test_launcher.c \ test_anim.c \ -test_calendar.c +test_calendar.c \ +test_diskselector.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 a01afb2..8bc8ed4 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -1,628 +1,2901 @@ #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 -my_win_del(void *data, Evas_Object *obj, void *event_info) +_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__) { - /* called when my_win_main is requested to be deleted */ + 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(); elm_exit(); /* exit the program's main loop that runs in elm_run() */ } static void -sc_round(void *data, Evas_Object *obj, void *event_info) +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 -sc_change(void *data, Evas_Object *obj, void *event_info) +bf_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - double scale = elm_scale_get(); + double bf = elm_scroll_bounce_friction_get(); double val = elm_slider_value_get(obj); - - if (scale == val) return; - elm_scale_all_set(val); + + if (bf == val) return; + elm_scroll_bounce_friction_all_set(val); } static void -fs_round(void *data, Evas_Object *obj, void *event_info) +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 * 5.0))) / 5.0; + + v = ((double)((int)(val * 10.0))) / 10.0; if (v != val) elm_slider_value_set(obj, v); } static void -fs_change(void *data, Evas_Object *obj, void *event_info) +ps_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - double scale = elm_scale_get(); + double ps = elm_scroll_page_scroll_friction_get(); double val = elm_slider_value_get(obj); - - if (scale == val) return; - elm_finger_size_all_set(val); + + if (ps == val) return; + elm_scroll_page_scroll_friction_all_set(val); } static void -_status_basic(Evas_Object *win, Evas_Object *bx0) +bis_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - 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); + 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 -_status_config(Evas_Object *win, Evas_Object *bx0) +bis_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - 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); + 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 -_flip_to(Evas_Object *win, const char *name) +zf_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - 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); + 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 -_cf_sizing(void *data, Evas_Object *obj, void *event_info) +zf_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - _flip_to(data, "sizing"); + 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 -_cf_themes(void *data, Evas_Object *obj, void *event_info) +ts_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - _flip_to(data, "themes"); + 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 -_cf_fonts(void *data, Evas_Object *obj, void *event_info) +tst_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - _flip_to(data, "fonts"); + 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 -_cf_profiles(void *data, Evas_Object *obj, void *event_info) +tst_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - _flip_to(data, "profiles"); + double tst = elm_scroll_thumbscroll_threshold_get(); + double val = elm_slider_value_get(obj); + + if (tst == val) return; + elm_scroll_thumbscroll_threshold_all_set(val); } static void -_cf_scrolling(void *data, Evas_Object *obj, void *event_info) +tsmt_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - _flip_to(data, "scrolling"); + 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 -_cf_rendering(void *data, Evas_Object *obj, void *event_info) +tsmt_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - _flip_to(data, "rendering"); + double tsmt = elm_scroll_thumbscroll_momentum_threshold_get(); + double val = elm_slider_value_get(obj); + + if (tsmt == val) return; + elm_scroll_thumbscroll_momentum_threshold_all_set(val); } static void -_cf_caches(void *data, Evas_Object *obj, void *event_info) +tsf_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - _flip_to(data, "caches"); + 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 -_theme_use(void *data, Evas_Object *obj, void *event_info) +tsf_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - printf("not implemented\n"); + 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); } static void -_theme_browse(void *data, Evas_Object *obj, void *event_info) +tsbf_round(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - printf("not implemented\n"); + 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 -_status_config_sizing(Evas_Object *win, Evas_Object *holder) +tsbf_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { - 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); - 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); + double tsbf = elm_scroll_thumbscroll_border_friction_get(); + double val = elm_slider_value_get(obj); - evas_object_data_set(win, "sizing", bx2); - - elm_table_pack(holder, bx2, 0, 0, 1, 1); + if (tsbf == val) return; + elm_scroll_thumbscroll_border_friction_all_set(val); } -static Evas_Object * -_sample_theme_new(Evas_Object *win) +static void +cf_enable(void *data, + Evas_Object *obj, + void *event_info __UNUSED__) { - 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); + 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); +} + +static void +cf_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 +cf_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + 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); +} + +static void +fc_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 +fc_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + 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); +} + +static void +ic_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 +ic_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + 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); +} + +static void +sc_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 +sc_change(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) +{ + 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); + + 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 +_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_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_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); + + // 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_check_label_set(ck, "Check"); - elm_table_pack(base, ck, 0, 1, 1, 1); + 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); - - 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); - + + 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, 1); - evas_object_size_hint_weight_set(sp, 1.0, 0.0); + 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, 2, 2, 1); + 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_slider_label_set(sl, "Slider"); + 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_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); + 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); - 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); + evas_object_smart_callback_add(sl, "changed", bis_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", bis_change, NULL); - 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; + 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 -_status_config_themes(Evas_Object *win, Evas_Object *holder) +_engines_list_fill(Evas_Object *l_widget, + Eina_List *e_names) { - 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); + const char *engine, *cur_engine; + void *sel_it = NULL; + Eina_List *l; - 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); - - // 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); + if (!e_names) + return; - 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); + 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); +} + +static void +_status_config_rendering(Evas_Object *win, + Evas_Object *pager) +{ + Evas_Object *li, *bx, *fr, *sp, *pd, *bt; + Eina_List *engines; + + 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 = elm_frame_add(win); - elm_frame_label_set(fr, "Preview"); - evas_object_size_hint_weight_set(fr, 1.0, 1.0); + elm_frame_label_set(fr, "Available Engines"); + 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(pd, fr); + elm_box_pack_end(bx, 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); - + + 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_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL); + + engines = ecore_evas_engines_get(); + _engines_list_fill(li, engines); + ecore_evas_engines_free(engines); + + evas_object_show(li); + evas_object_data_set(win, "engines_list", li); + ///////////////////////////////////////////// sp = elm_separator_add(win); - elm_separator_horizontal_set(sp, 1); - evas_object_size_hint_weight_set(sp, 1.0, 0.0); + 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(tb, sp, 0, 2, 1, 1); + 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_table_pack(tb, pd, 0, 3, 1, 1); + elm_box_pack_end(bx, pd); 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_smart_callback_add(bt, "clicked", _engine_use, li); + elm_button_label_set(bt, "Use Engine"); 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_table_pack(holder, tb, 0, 0, 1, 1); + + evas_object_data_set(win, "rendering", bx); + elm_pager_content_push(pager, bx); } static void -_unimplemented(Evas_Object *win, Evas_Object *holder, const char *name) +_status_config_caches(Evas_Object *win, + Evas_Object *pager) { - Evas_Object *lb, *pd, *bx2; - - 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, 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 *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_data_set(win, name, bx2); + elm_box_pack_end(bx, sl); + evas_object_show(sl); - elm_table_pack(holder, bx2, 0, 0, 1, 1); -} + evas_object_smart_callback_add(sl, "changed", cf_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", cf_change, NULL); -static void -_status_config_fonts(Evas_Object *win, Evas_Object *holder) -{ - _unimplemented(win, holder, "fonts"); -} + 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); -static void -_status_config_profiles(Evas_Object *win, Evas_Object *holder) -{ - _unimplemented(win, holder, "profiles"); -} + LABEL_FRAME_ADD("Font Cache Size"); -static void -_status_config_scrolling(Evas_Object *win, Evas_Object *holder) -{ - _unimplemented(win, holder, "scrolling"); -} + 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); -static void -_status_config_rendering(Evas_Object *win, Evas_Object *holder) -{ - _unimplemented(win, holder, "rendering"); -} + evas_object_smart_callback_add(sl, "changed", fc_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", fc_change, NULL); -static void -_status_config_caches(Evas_Object *win, Evas_Object *holder) -{ - _unimplemented(win, holder, "caches"); + 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"); + + 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); + + evas_object_smart_callback_add(sl, "changed", ecc_round, NULL); + evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL); + + evas_object_data_set(win, "caches", bx); + + elm_pager_content_push(pager, bx); } static void -_status_config_full(Evas_Object *win, Evas_Object *bx0) +_status_config_full(Evas_Object *win, + Evas_Object *bx0) { - Evas_Object *tb, *holder, *fl; - Elm_Toolbar_Item *it; - + Evas_Object *tb, *pager; + Elm_Toolbar_Item *sizing, *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); - 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); + 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); + elm_box_pack_end(bx0, tb); evas_object_show(tb); - - 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); + + 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); } static void @@ -633,7 +2906,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", my_win_del, NULL); + evas_object_smart_callback_add(win, "delete,request", config_exit, NULL); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, 1.0, 1.0); elm_win_resize_object_add(win, bg); @@ -645,27 +2918,30 @@ status_win(void) evas_object_show(bx0); if (!interactive) _status_basic(win, bx0); -// else _status_config(win, bx0); + else if (0) + _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) +_exit_timer(void *data __UNUSED__) { 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")) @@ -702,9 +2978,12 @@ elm_main(int argc, char **argv) interactive = 0; } } - /* put here any init specific to this app like parsing args etc. */ + /* put here any init code 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); @@ -728,12 +3007,13 @@ elm_main(int argc, char **argv) elm_exit(); } } - 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_run(); /* and run the program now and handle all events, etc. */ + /* if the mainloop that elm_run() runs exists, we exit the app */ elm_shutdown(); /* clean up and shut down */ /* exit code */ return 0; } + #endif -/* all emeentary apps should use this. but it right after elm_main() */ +/* All emelentary apps should use this. Put it right after elm_main() */ ELM_MAIN() diff --git a/src/bin/test.c b/src/bin/test.c index 44c5c8f..dcc6f32 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -41,6 +41,8 @@ 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); @@ -79,6 +81,7 @@ 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 { @@ -238,6 +241,8 @@ 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); @@ -277,6 +282,7 @@ 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_diskselector.c b/src/bin/test_diskselector.c new file mode 100644 index 0000000..9312c2b --- /dev/null +++ b/src/bin/test_diskselector.c @@ -0,0 +1,131 @@ +#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 6ce92a3..74f850f 100644 --- a/src/bin/test_flip.c +++ b/src/bin/test_flip.c @@ -1,68 +1,74 @@ #include +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif #ifndef ELM_LIB_QUICKLAUNCH void -my_fl_1(void *data, Evas_Object *obj, void *event_info) +my_fl_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_Y_CENTER_AXIS); } void -my_fl_2(void *data, Evas_Object *obj, void *event_info) +my_fl_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_X_CENTER_AXIS); } void -my_fl_3(void *data, Evas_Object *obj, void *event_info) +my_fl_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_XZ_CENTER_AXIS); } void -my_fl_4(void *data, Evas_Object *obj, void *event_info) +my_fl_4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_ROTATE_YZ_CENTER_AXIS); } void -my_fl_5(void *data, Evas_Object *obj, void *event_info) +my_fl_5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_LEFT); } void -my_fl_6(void *data, Evas_Object *obj, void *event_info) +my_fl_6(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_RIGHT); } void -my_fl_7(void *data, Evas_Object *obj, void *event_info) +my_fl_7(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_UP); } + void -my_fl_8(void *data, Evas_Object *obj, void *event_info) +my_fl_8(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *fl = data; elm_flip_go(fl, ELM_FLIP_CUBE_DOWN); } + void -test_flip(void *data, Evas_Object *obj, void *event_info) +test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { 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); @@ -152,10 +158,12 @@ test_flip(void *data, Evas_Object *obj, 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); @@ -171,6 +179,7 @@ test_flip(void *data, Evas_Object *obj, 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); @@ -178,6 +187,7 @@ test_flip(void *data, Evas_Object *obj, 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); @@ -194,9 +204,9 @@ test_flip(void *data, Evas_Object *obj, void *event_info) } void -test_flip2(void *data, Evas_Object *obj, void *event_info) +test_flip2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *tb, *ic, *li; + Evas_Object *win, *bg, *bx, *bx2, *fl, *o, *bt, *tb, *li, *en; char buf[PATH_MAX]; win = elm_win_add(NULL, "flip2", ELM_WIN_BASIC); @@ -229,25 +239,10 @@ test_flip2(void *data, Evas_Object *obj, 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); - 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_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); elm_box_pack_end(o, tb); evas_object_show(tb); @@ -274,19 +269,46 @@ test_flip2(void *data, Evas_Object *obj, void *event_info) elm_flip_content_front_set(fl, o); evas_object_show(o); - - 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); + + 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); evas_object_show(fl); @@ -351,7 +373,7 @@ test_flip2(void *data, Evas_Object *obj, void *event_info) } void -test_flip3(void *data, Evas_Object *obj, void *event_info) +test_flip3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg, *bx, *bx2, *fl, *fl_f, *fl_b, *o, *bt, *fr; char buf[PATH_MAX]; @@ -382,13 +404,13 @@ test_flip3(void *data, Evas_Object *obj, 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); @@ -397,9 +419,6 @@ test_flip3(void *data, Evas_Object *obj, 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); @@ -410,21 +429,17 @@ test_flip3(void *data, Evas_Object *obj, 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); @@ -433,9 +448,6 @@ test_flip3(void *data, Evas_Object *obj, 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); @@ -444,12 +456,6 @@ test_flip3(void *data, Evas_Object *obj, 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 30d7063..95b9f14 100644 --- a/src/bin/test_genlist.c +++ b/src/bin/test_genlist.c @@ -222,12 +222,14 @@ my_gl_insert_before(void *data, Evas_Object *obj, void *event_info) return ; } - gli = elm_genlist_item_insert_before(gl, &itc1, - (void *)i/* item data */, + elm_genlist_item_insert_before(gl, &itc1, + (void *)(long)i/* item data */, + NULL/* parent */, gli_selected /* item before */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)(i * 10)/* func data */); + (void *)(long)(i * 10)/* func data */); + i++; } @@ -252,12 +254,14 @@ my_gl_insert_after(void *data, Evas_Object *obj, void *event_info) return ; } - gli = elm_genlist_item_insert_after(gl, &itc1, - (void *)i/* item data */, + elm_genlist_item_insert_after(gl, &itc1, + (void *)(long)i/* item data */, + NULL/* parent */, gli_selected /* item after */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)(i * 10)/* func data */); + (void *)(long)(i * 10)/* func data */); + i++; } @@ -387,11 +391,12 @@ 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 */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1006/* func data */); + (void *)1006/* item data */, NULL/* parent */, 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 */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1007/* func data */); + (void *)1007/* item data */, NULL/* parent */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, + gl_sel/* func */, (void *)1007/* func data */); + elm_box_pack_end(bx, gl); @@ -1331,4 +1336,318 @@ 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 4adbb1f..1d3e006 100644 --- a/src/bin/test_map.c +++ b/src/bin/test_map.c @@ -1,4 +1,7 @@ #include +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif #ifndef ELM_LIB_QUICKLAUNCH typedef struct Marker_Data @@ -28,121 +31,105 @@ 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, Evas_Object *obj, void *event_info) +my_map_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("clicked\n"); } static void -my_map_press(void *data, Evas_Object *obj, void *event_info) +my_map_press(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("press\n"); } static void -my_map_longpressed(void *data, Evas_Object *obj, void *event_info) +my_map_longpressed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("longpressed\n"); } static void -my_map_clicked_double(void *data, Evas_Object *obj, void *event_info) +my_map_clicked_double(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("clicked,double\n"); } static void -my_map_load(void *data, Evas_Object *obj, void *event_info) +my_map_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("load\n"); } static void -my_map_loaded(void *data, Evas_Object *obj, void *event_info) +my_map_loaded(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("loaded\n"); } static void -my_map_load_details(void *data, Evas_Object *obj, void *event_info) +my_map_load_details(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("load,details\n"); } static void -my_map_loaded_details(void *data, Evas_Object *obj, void *event_info) +my_map_loaded_details(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("loaded,details\n"); } static void -my_map_zoom_start(void *data, Evas_Object *obj, void *event_info) +my_map_zoom_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("zoom,start\n"); } static void -my_map_zoom_stop(void *data, Evas_Object *obj, void *event_info) +my_map_zoom_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("zoom,stop\n"); } static void -my_map_zoom_change(void *data, Evas_Object *obj, void *event_info) +my_map_zoom_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("zoom,change\n"); } static void -my_map_anim_start(void *data, Evas_Object *obj, void *event_info) +my_map_anim_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("anim,start\n"); } static void -my_map_anim_stop(void *data, Evas_Object *obj, void *event_info) +my_map_anim_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("anim,stop\n"); } static void -my_map_drag_start(void *data, Evas_Object *obj, void *event_info) +my_map_drag_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("drag,start\n"); } static void -my_map_drag_stop(void *data, Evas_Object *obj, void *event_info) +my_map_drag_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - //Evas_Object *win = data; printf("drag_stop\n"); } static void -my_map_scroll(void *data, Evas_Object *obj, void *event_info) +my_map_scroll(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { - //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_bt_show_reg(void *data, Evas_Object *obj, void *event_info) +my_bt_show_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Eina_Bool b = elm_map_paused_get(data); elm_map_paused_set(data, EINA_TRUE); @@ -153,13 +140,13 @@ my_bt_show_reg(void *data, Evas_Object *obj, void *event_info) } static void -my_bt_bring_reg(void *data, Evas_Object *obj, void *event_info) +my_bt_bring_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_geo_region_bring_in(data, 2.352, 48.857); } static void -my_bt_zoom_in(void *data, Evas_Object *obj, void *event_info) +my_bt_zoom_in(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { double zoom; @@ -170,7 +157,7 @@ my_bt_zoom_in(void *data, Evas_Object *obj, void *event_info) } static void -my_bt_zoom_out(void *data, Evas_Object *obj, void *event_info) +my_bt_zoom_out(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { double zoom; @@ -181,55 +168,61 @@ my_bt_zoom_out(void *data, Evas_Object *obj, void *event_info) } static void -my_bt_pause(void *data, Evas_Object *obj, void *event_info) +my_bt_pause(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_paused_set(data, !elm_map_paused_get(data)); } static void -my_bt_markers_pause(void *data, Evas_Object *obj, void *event_info) +my_bt_markers_pause(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_paused_markers_set(data, !elm_map_paused_markers_get(data)); } static void -my_bt_zoom_fit(void *data, Evas_Object *obj, void *event_info) +my_bt_zoom_fit(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FIT); } static void -my_bt_zoom_fill(void *data, Evas_Object *obj, void *event_info) +my_bt_zoom_fill(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FILL); } static void -my_bt_source_mapnik(void *data, Evas_Object *obj, void *event_info) +my_bt_source_mapnik(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_source_set(data, ELM_MAP_SOURCE_MAPNIK); } static void -my_bt_source_osmarender(void *data, Evas_Object *obj, void *event_info) +my_bt_source_osmarender(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_source_set(data, ELM_MAP_SOURCE_OSMARENDER); } static void -my_bt_source_cyclemap(void *data, Evas_Object *obj, void *event_info) +my_bt_source_cyclemap(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_source_set(data, ELM_MAP_SOURCE_CYCLEMAP); } static void -my_bt_source_maplint(void *data, Evas_Object *obj, void *event_info) +my_bt_source_maplint(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_map_source_set(data, ELM_MAP_SOURCE_MAPLINT); } static void -my_bt_add(void *data, Evas_Object *obj, void *event_info) +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__) { int i; Elm_Map_Group_Class *g_clas; @@ -256,7 +249,6 @@ my_bt_add(void *data, Evas_Object *obj, void *event_info) else { m_clas = itc_parking; - g_clas = itc_group_parking; d = &data_parking; } @@ -273,7 +265,7 @@ my_bt_add(void *data, Evas_Object *obj, void *event_info) } static Evas_Object * -_marker_get(Evas_Object *obj, Elm_Map_Marker *marker, void *data) +_marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data) { Marker_Data *d = data; @@ -310,7 +302,7 @@ _marker_get(Evas_Object *obj, Elm_Map_Marker *marker, void *data) } static Evas_Object * -_icon_get(Evas_Object *obj, Elm_Map_Marker *marker, void *data) +_icon_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data) { Marker_Data *d = data; @@ -334,7 +326,7 @@ _group_icon_get(Evas_Object *obj, void *data) } static void -_map_mouse_wheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +_map_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Object *map = data; Evas_Event_Mouse_Wheel *ev = (Evas_Event_Mouse_Wheel*) event_info; @@ -350,11 +342,11 @@ _map_mouse_wheel_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) 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, Evas_Object *obj, void *event_info) +_map_move_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { int x,y,w,h; @@ -364,7 +356,7 @@ _map_move_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) } void -test_map(void *data, Evas_Object *obj, void *event_info) +test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg, *map, *tb2, *bt, *bx; @@ -405,7 +397,7 @@ test_map(void *data, Evas_Object *obj, void *event_info) // itc_group1 = elm_map_group_class_new(map); - elm_map_group_class_data_set(itc_group1, PACKAGE_DATA_DIR"/images/plant_01.jpg"); + elm_map_group_class_data_set(itc_group1, (void *)PACKAGE_DATA_DIR"/images/plant_01.jpg"); itc_group2 = elm_map_group_class_new(map); elm_map_group_class_style_set(itc_group2, "radio2"); @@ -413,7 +405,7 @@ test_map(void *data, Evas_Object *obj, 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, PACKAGE_DATA_DIR"/images/parking.png"); + elm_map_group_class_data_set(itc_group_parking, (void *)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); // @@ -432,21 +424,20 @@ test_map(void *data, Evas_Object *obj, void *event_info) evas_object_event_callback_add(map, EVAS_CALLBACK_MOVE, _map_move_resize_cb, map); - 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); + 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); nb_elts = 13; @@ -599,6 +590,14 @@ test_map(void *data, Evas_Object *obj, 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 7320bb6..aa0493a 100644 --- a/src/bin/test_panel.c +++ b/src/bin/test_panel.c @@ -1,49 +1,58 @@ #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(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 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 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) +_tstatus(void *data, Evas_Object *obj, void *event_info __UNUSED__) { - char *status; + Elm_Toolbar_Item *sel; + const 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); - elm_toolbar_item_unselect_all(obj); + sel = elm_toolbar_selected_item_get(obj); + elm_toolbar_item_selected_set(sel, EINA_FALSE); } static void -_bstatus(void *data, Evas_Object *obj, void *event_info) +_bstatus(void *data, Evas_Object *obj, void *event_info __UNUSED__) { - char *status; + Elm_Toolbar_Item *sel; + const 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); - elm_toolbar_item_unselect_all(obj); + sel = elm_toolbar_selected_item_get(obj); + elm_toolbar_item_selected_set(sel, EINA_FALSE); } static char * -_label_get(const void *data, Evas_Object *obj, const char *source) +_label_get(void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) { return strdup(ecore_file_file_get(data)); } static Evas_Object * -_icon_get(const void *data, Evas_Object *obj, const char *source) +_icon_get(void *data, Evas_Object *obj, const char *source) { if (!strcmp(source, "elm.swallow.icon")) { @@ -62,13 +71,13 @@ _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) +_state_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) { return EINA_FALSE; } static void -_item_del(const void *data, Evas_Object *obj) +_item_del(void *data, Evas_Object *obj __UNUSED__) { eina_stringshare_del(data); } @@ -139,10 +148,9 @@ _dir_has_subs(const char *path) } void -test_panel(void *data, Evas_Object *obj, void *event_info) +test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *win, *bg, *panel, *bx, *vbx, *toolbar, *ic; - char buf[PATH_MAX]; + Evas_Object *win, *bg, *panel, *bx, *vbx, *toolbar; Evas_Object *list; win = elm_win_add(NULL, "panel", ELM_WIN_BASIC); @@ -173,15 +181,12 @@ test_panel(void *data, Evas_Object *obj, void *event_info) toolbar = elm_toolbar_add(win); elm_toolbar_homogenous_set(toolbar, 0); - elm_toolbar_scrollable_set(toolbar, 0); + elm_toolbar_mode_shrink_set(toolbar, ELM_TOOLBAR_SHRINK_NONE); 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); - 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_toolbar_item_append(toolbar, "home", "Hello", _tstatus, panel); elm_panel_content_set(panel, toolbar); elm_box_pack_end(vbx, panel); @@ -215,6 +220,7 @@ test_panel(void *data, Evas_Object *obj, 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); @@ -235,18 +241,16 @@ test_panel(void *data, Evas_Object *obj, 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_scrollable_set(toolbar, 0); + elm_toolbar_mode_shrink_set(toolbar, ELM_TOOLBAR_SHRINK_NONE); 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); - 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_toolbar_item_append(toolbar, "home", "Hello", _bstatus, panel); elm_panel_content_set(panel, toolbar); elm_box_pack_end(vbx, panel); diff --git a/src/bin/test_slideshow.c b/src/bin/test_slideshow.c index 51ab2da..733119b 100644 --- a/src/bin/test_slideshow.c +++ b/src/bin/test_slideshow.c @@ -1,66 +1,67 @@ #include +#include #ifndef ELM_LIB_QUICKLAUNCH static Evas_Object *slideshow, *bt_start, *bt_stop; static Elm_Slideshow_Item_Class itc; -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 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 void -_notify_show(void *data, Evas *e, Evas_Object *obj, void *event_info) +_notify_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { evas_object_show(data); - elm_notify_timer_init(data); } static void -_next(void *data, Evas_Object *obj, void *event_info) +_next(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_slideshow_next(data); } static void -_previous(void *data, Evas_Object *obj, void *event_info) +_previous(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_slideshow_previous(data); } static void -_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) +_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_notify_timeout_set(data, 0); + evas_object_show(data); } static void -_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) +_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_notify_timeout_set(data, 3); } static void -_hv_select(void *data, Evas_Object *obj, void *event_info) +_hv_select(void *data, Evas_Object *obj, void *event_info __UNUSED__) { elm_slideshow_transition_set(slideshow, data); elm_hoversel_label_set(obj, data); } static void -_layout_select(void *data, Evas_Object *obj, void *event_info) +_layout_select(void *data, Evas_Object *obj, void *event_info __UNUSED__) { elm_slideshow_layout_set(slideshow, data); elm_hoversel_label_set(obj, data); } static void -_start(void *data, Evas_Object *obj, void *event_info) +_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_slideshow_timeout_set(slideshow, (int)elm_spinner_value_get(data)); @@ -69,7 +70,7 @@ _start(void *data, Evas_Object *obj, void *event_info) } static void -_stop(void *data, Evas_Object *obj, void *event_info) +_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_slideshow_timeout_set(slideshow, 0); elm_object_disabled_set(bt_start, 0); @@ -77,7 +78,7 @@ _stop(void *data, Evas_Object *obj, void *event_info) } static void -_spin(void *data, Evas_Object *obj, void *event_info) +_spin(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { if (elm_slideshow_timeout_get(slideshow) > 0) elm_slideshow_timeout_set(slideshow, (int)elm_spinner_value_get(data)); @@ -101,7 +102,7 @@ _get(void *data, Evas_Object *obj) void -test_slideshow(void *data, Evas_Object *obj, void *event_info) +test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin; const Eina_List *l; @@ -145,8 +146,10 @@ test_slideshow(void *data, Evas_Object *obj, void *event_info) 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"); @@ -200,9 +203,10 @@ test_slideshow(void *data, Evas_Object *obj, void *event_info) 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 29bc2a4..ca46fa4 100644 --- a/src/bin/test_toolbar.c +++ b/src/bin/test_toolbar.c @@ -1,7 +1,10 @@ #include +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif #ifndef ELM_LIB_QUICKLAUNCH static void -tb_1(void *data, Evas_Object *obj, void *event_info) +tb_1(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/panel_01.jpg", PACKAGE_DATA_DIR); @@ -9,7 +12,7 @@ tb_1(void *data, Evas_Object *obj, void *event_info) } static void -tb_2(void *data, Evas_Object *obj, void *event_info) +tb_2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", PACKAGE_DATA_DIR); @@ -17,7 +20,7 @@ tb_2(void *data, Evas_Object *obj, void *event_info) } static void -tb_3(void *data, Evas_Object *obj, void *event_info) +tb_3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/wood_01.jpg", PACKAGE_DATA_DIR); @@ -25,7 +28,21 @@ tb_3(void *data, Evas_Object *obj, void *event_info) } static void -tb_4(void *data, Evas_Object *obj, void *event_info) +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__) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR); @@ -33,15 +50,21 @@ tb_4(void *data, Evas_Object *obj, void *event_info) } static void -tb_5(void *data, Evas_Object *obj, void *event_info) +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__) { elm_photo_file_set(data, NULL); } void -test_toolbar(void *data, Evas_Object *obj, void *event_info) +test_toolbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *win, *bg, *bx, *tb, *ic, *ph, *menu; + Evas_Object *win, *bg, *bx, *tb, *ph, *menu; Evas_Object *ph1, *ph2, *ph3, *ph4; Elm_Toolbar_Item *item; Elm_Menu_Item *menu_item; @@ -63,6 +86,7 @@ test_toolbar(void *data, Evas_Object *obj, void *event_info) 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); @@ -71,59 +95,32 @@ test_toolbar(void *data, Evas_Object *obj, void *event_info) ph3 = elm_photo_add(win); ph4 = elm_photo_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); - item = elm_toolbar_item_add(tb, ic, "Hello", tb_1, ph1); + 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); - 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); + 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); - 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_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); @@ -171,7 +168,451 @@ test_toolbar(void *data, Evas_Object *obj, void *event_info) 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 f17e6bd..6782b54 100644 --- a/src/edje_externals/elm_fileselector_button.c +++ b/src/edje_externals/elm_fileselector_button.c @@ -3,6 +3,7 @@ typedef struct _Elm_Params_fileselector_button { Elm_Params base; + const char *label; Evas_Object *icon; struct { @@ -27,10 +28,10 @@ external_fileselector_button_state_set(void *data __UNUSED__, Evas_Object *obj, else if (from_params) p = from_params; else return; - if (p->base.label) - elm_fileselector_button_label_set(obj, p->base.label); + if (p->label) + elm_fileselector_button_label_set(obj, p->label); if (p->icon) elm_fileselector_button_icon_set(obj, p->icon); - if (p->fs.path) elm_fileselector_button_selected_set(obj, p->fs.path); + if (p->fs.path) elm_fileselector_button_path_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) @@ -66,7 +67,7 @@ external_fileselector_button_param_set(void *data __UNUSED__, Evas_Object *obj, { if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) { - elm_fileselector_button_selected_set(obj, param->s); + elm_fileselector_button_path_set(obj, param->s); return EINA_TRUE; } } @@ -129,7 +130,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_selected_get(obj); + param->s = elm_fileselector_button_path_get(obj); return EINA_TRUE; } } @@ -173,14 +174,13 @@ external_fileselector_button_param_get(void *data __UNUSED__, const Evas_Object } static void * -external_fileselector_button_params_parse(void *data, Evas_Object *obj, const Eina_List *params) +external_fileselector_button_params_parse(void *data __UNUSED__, Evas_Object *obj, const Eina_List *params) { Elm_Params_fileselector_button *mem; Edje_External_Param *param; const Eina_List *l; - mem = external_common_params_parse(Elm_Params_fileselector_button, - data, obj, params); + mem = calloc(1, sizeof(Elm_Params_fileselector_button)); if (!mem) return NULL; @@ -210,15 +210,17 @@ external_fileselector_button_params_parse(void *data, Evas_Object *obj, const Ei 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, const char *content) + const Evas_Object *obj __UNUSED__, const char *content __UNUSED__) { - ERR("so content"); + ERR("No content."); return NULL; } @@ -229,11 +231,14 @@ external_fileselector_button_params_free(void *params) if (mem->fs.path) eina_stringshare_del(mem->fs.path); - external_common_params_free(params); + if (mem->label) + eina_stringshare_del(mem->label); + 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 8f782af..a100db7 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_horizontal_mode_set(obj, set); + elm_list_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_horizontal_mode_set(obj, set); + elm_list_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_horizontal_mode_get(obj); + Elm_List_Mode m = elm_list_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 7a37a65..3eab33a 100644 --- a/src/edje_externals/elm_notify.c +++ b/src/edje_externals/elm_notify.c @@ -9,9 +9,8 @@ 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; - int timeout; + double timeout; const char *orient; }; @@ -38,7 +37,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]) == 0) return i; + if (!strcmp(orient, orients[i])) return i; return ELM_NOTIFY_ORIENT_LAST; } @@ -56,13 +55,10 @@ 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); @@ -74,8 +70,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)) @@ -83,26 +79,20 @@ 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, "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) + else if ((!strcmp(param->name, "timeout")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) { - elm_notify_timeout_set(obj, param->i); + elm_notify_timeout_set(obj, param->d); 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; @@ -124,20 +114,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_INT) + else if ((!strcmp(param->name, "timeout")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) { - param->i = elm_notify_timeout_get(obj); + param->d = 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; @@ -151,13 +141,13 @@ static Eina_Bool external_notify_param_get(void *data __UNUSED__, return EINA_FALSE; } -static void * external_notify_params_parse(void *data, Evas_Object *obj, +static void * external_notify_params_parse(void *data __UNUSED__, Evas_Object *obj, const Eina_List *params) { Elm_Params_Notify *mem; Edje_External_Param *param; const Eina_List *l; - mem = external_common_params_parse(Elm_Params_Notify, data, obj, params); + mem = calloc(1, sizeof(Elm_Params_Notify)); if (!mem) return NULL; @@ -167,13 +157,9 @@ static void * external_notify_params_parse(void *data, Evas_Object *obj, mem->content = external_common_param_edje_object_get(obj, param); else if (!strcmp(param->name, "timeout")) { - mem->timeout = param->i; + mem->timeout = param->d; 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; @@ -197,15 +183,14 @@ static Evas_Object *external_notify_content_get(void *data __UNUSED__, } static void external_notify_params_free(void *params) { - external_common_params_free(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_INT("timeout"), - EDJE_EXTERNAL_PARAM_INFO_BOOL("timer_init"), + EDJE_EXTERNAL_PARAM_INFO_DOUBLE("timeout"), EDJE_EXTERNAL_PARAM_INFO_SENTINEL }; diff --git a/src/edje_externals/elm_pager.c b/src/edje_externals/elm_pager.c index 4dfcbfe..96bed66 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_disable_set(obj, p->disable_animation); + if(p->disable_animation_exists) elm_pager_animation_disabled_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_disable_set(obj, param->i); + elm_pager_animation_disabled_set(obj, param->i); return EINA_TRUE; } } diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index e31e7e9..4810875 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -4,6 +4,7 @@ */ #ifndef ELEMENTARY_H #define ELEMENTARY_H + /** * @file Elementary.h * @brief Elementary's API @@ -157,7 +158,7 @@ extern "C" { EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT; /* Objects */ - /** + /** * Emitted when policy value changed. */ EAPI extern int ELM_EVENT_POLICY_CHANGED; @@ -462,7 +463,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, @@ -542,23 +543,25 @@ extern "C" { * (blank mouse, private mouse obj, defaultmouse) * */ - 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_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_screen_position_get(const Evas_Object *obj, int *x, int *y); + EAPI void elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y) 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); + 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); /* 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); + EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /* smart callbacks called: * "delete,request" - the user requested to delete the window * "focus,in" - window got focus @@ -566,19 +569,54 @@ extern "C" { * "moved" - window that holds the canvas was moved */ - EAPI Evas_Object *elm_bg_add(Evas_Object *parent); - EAPI void elm_bg_file_set(Evas_Object *obj, const char *file, const char *group); + /* 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); /* smart callbacks called: */ - 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); + /* 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); /* smart callbacks called: * "clicked" - the user clicked the icon */ @@ -586,42 +624,66 @@ 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); - 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); + 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); /* smart callbacks called: * "clicked" - the user clicked the image */ - 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); + /* 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); /* smart callbacks called: */ - typedef enum { UIControlStateDefault, @@ -659,55 +721,88 @@ extern "C" { */ /* fileselector */ - 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); - - + 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); - 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); + 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); /* smart callbacks called: * "edge,left" @@ -721,25 +816,26 @@ extern "C" { * "scroll,drag,stop" */ - 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); + /* 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); /* available styles: * default * marker @@ -747,25 +843,29 @@ extern "C" { /* smart callbacks called: */ - 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); + /* 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); /* smart callbacks called: * "changed" - the user toggled the state */ - 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); + /* 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) /* available styles: * default * pad_small @@ -778,68 +878,103 @@ extern "C" { /* smart callbacks called: */ - 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); + /* 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); + /* 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; - 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); + 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); 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); - 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); + 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); /* 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. @@ -864,61 +999,157 @@ extern "C" { ELM_CLOCK_ALL = (1 << 6) - 1 } Elm_Clock_Digedit; - 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); + 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); /* smart callbacks called: * "changed" - the user changed the time */ - 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); + /* 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") + /* 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); - 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); + 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); /* 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, @@ -926,14 +1157,15 @@ extern "C" { ELM_HOVER_AXIS_VERTICAL, ELM_HOVER_AXIS_BOTH } Elm_Hover_Axis; - 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); + 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); /* available styles: * default * popout @@ -942,14 +1174,17 @@ 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 { @@ -957,7 +1192,6 @@ 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 { @@ -981,64 +1215,85 @@ extern "C" { ELM_INPUT_PANEL_LAYOUT_CUSTOM_10 } Elm_Input_Panel_Layout; - 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); + 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 char *elm_entry_markup_to_utf8(const char *s); EAPI char *elm_entry_utf8_to_markup(const char *s); - 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); + 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_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); - EAPI void elm_entry_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis); - + 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_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); - EAPI void elm_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes); + EINA_DEPRECATED 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 @@ -1069,32 +1324,35 @@ 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); - 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); + 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); /* smart callbacks called: * "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorview_Info */ @@ -1103,57 +1361,61 @@ 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); - 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); + 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); /* smart callbacks called: * "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorblock_Info */ - 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); + /* 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); /* smart callbacks called: - * "clicked" - This is called when a user has clicked the bubble + * "clicked" - the user 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. */ - - 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); + + /* 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); /* smart callbacks called: * "clicked" - the user clicked the icon */ @@ -1167,19 +1429,22 @@ extern "C" { ELM_THUMB_ANIMATION_LAST } Elm_Thumb_Animation_Setting; - 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: + 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: * "clicked" - the user clicked the thumb * "clicked,double" - the user double clicked the thumb * "press" - the user pressed the thumb @@ -1189,70 +1454,117 @@ extern "C" { * "load,error" - the thumbnail image loading failed */ - 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); + /* 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); /* 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 */ - 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); + /* 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); /* 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); @@ -1277,25 +1589,27 @@ extern "C" { EAPI Eina_Bool elm_cursor_engine_only_set(int engine_only); /* menu */ - 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); + 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); /* smart callbacks called: * "clicked" - the user clicked the empty space in the menu to dismiss. event_info is NULL. */ @@ -1303,57 +1617,79 @@ extern "C" { /* list */ typedef enum _Elm_List_Mode { - ELM_LIST_COMPRESS = 0, - ELM_LIST_SCROLL, - ELM_LIST_LIMIT, - ELM_LIST_LAST + ELM_LIST_COMPRESS = 0, + ELM_LIST_SCROLL, + ELM_LIST_LIMIT, + ELM_LIST_EXPAND, + ELM_LIST_LAST } Elm_List_Mode; - 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); - + 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); /* 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 @@ -1366,32 +1702,38 @@ extern "C" { * "clicked" - when the user clicks on a carousel item and becomes selected */ - 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); + /* 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); /* smart callbacks called: * "changed" - Whenever the slider value is changed by the user. * @@ -1409,7 +1751,8 @@ extern "C" { typedef enum _Elm_Genlist_Item_Flags { ELM_GENLIST_ITEM_NONE = 0, - ELM_GENLIST_ITEM_SUBITEMS = (1 << 0) + ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), + ELM_GENLIST_ITEM_GROUP = (1 << 1) } Elm_Genlist_Item_Flags; typedef enum _Elm_Genlist_Edit_Mode { @@ -1485,8 +1828,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 *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); + 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); /* 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); @@ -1535,40 +1878,47 @@ 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); - 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); + 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); 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); @@ -1585,14 +1935,15 @@ 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); - 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); + /* 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); /* available item styles: * default @@ -1603,80 +1954,89 @@ 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; + typedef struct _Elm_Slideshow_Item Elm_Slideshow_Item; /**< Item of Elm_Slideshow. Sub-type of Elm_Widget_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); - 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); - + 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); /* 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 */ - 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); + /* 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); /* smart callbacks called: */ /* available item styles: @@ -1684,28 +2044,30 @@ extern "C" { * wheel (simple style, no text, no progression, only pulse is available) */ - 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); + /* 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); /* smart callbacks called: */ - 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); + /* 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); /* 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). @@ -1740,30 +2102,31 @@ 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 @@ -1809,60 +2172,57 @@ 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) (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); + 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) 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_utils_downloading_status_get(const Evas_Object *obj, int *try_num, int *finish_num) 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_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); /* smart callbacks called: * "clicked" - when image clicked * "press" - when mouse/finger held down initially on image @@ -1888,15 +2248,16 @@ 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 */ /** @@ -1931,81 +2292,137 @@ extern "C" { ELM_FLIP_CUBE_DOWN } Elm_Flip_Mode; - 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); + 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); /* smart callbacks called: * "animate,done" - when a flip animation is finished */ - 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); - + /* 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 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); - - 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); + 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 + */ /* animator */ - typedef enum + typedef enum { ELM_ANIMATOR_CURVE_LINEAR, ELM_ANIMATOR_CURVE_IN_OUT, @@ -2027,53 +2444,103 @@ 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); - 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 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 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); - EAPI void elm_animator_pause(Elm_Animator *animator); - EAPI void elm_animator_resume(Elm_Animator *animator); + 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); /* 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); - 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); + 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) + */ typedef struct _Picker_Item Elm_Picker_Item; EINA_DEPRECATED EAPI Evas_Object *elm_picker_add(Evas_Object *parent); @@ -2132,11 +2599,11 @@ extern "C" { * default */ - 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); + 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); /* smart callback called: * "changed" - when timepicker selected item is changed */ @@ -2144,15 +2611,15 @@ extern "C" { * default */ - 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); + 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); /* smart callback called: * "changed" - when datepicker selected item is changed */ @@ -2240,12 +2707,13 @@ 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, int timeout); + EAPI void elm_popup_timeout_set(Evas_Object *obj, double 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; @@ -2262,8 +2730,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); - 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_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); 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); @@ -2427,7 +2895,8 @@ 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); - EAPI void elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable); + 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); /* NavigationBar */ typedef enum @@ -2557,21 +3026,6 @@ 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); @@ -2971,6 +3425,117 @@ 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 127e6fa..16e7477 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -29,8 +29,7 @@ lib_LTLIBRARIES = libelementary.la includes_HEADERS = \ Elementary.h \ Elementary_Cursor.h \ -elm_widget.h \ -elm_priv.h +elm_widget.h includesdir = $(includedir)/elementary-@VMAJ@ libelementary_la_SOURCES = \ @@ -94,7 +93,6 @@ 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\ @@ -102,6 +100,7 @@ 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 1f233cc..7c75062 100644 --- a/src/lib/elc_anchorblock.c +++ b/src/lib/elc_anchorblock.c @@ -3,7 +3,6 @@ /** * @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 @@ -184,8 +183,11 @@ 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"); @@ -193,6 +195,7 @@ 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); @@ -289,6 +292,26 @@ 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 @@ -309,6 +332,26 @@ 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. @@ -351,7 +394,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; - if (!func) return; + EINA_SAFETY_ON_NULL_RETURN(func); Elm_Anchorblock_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorblock_Item_Provider)); if (!ip) return; ip->func = func; @@ -377,7 +420,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; - if (!func) return; + EINA_SAFETY_ON_NULL_RETURN(func); Elm_Anchorblock_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorblock_Item_Provider)); if (!ip) return; ip->func = func; @@ -405,7 +448,7 @@ elm_anchorblock_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (voi Eina_List *l; Elm_Anchorblock_Item_Provider *ip; if (!wd) return; - if (!func) return; + EINA_SAFETY_ON_NULL_RETURN(func); 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 f5495f8..df61e53 100644 --- a/src/lib/elc_anchorview.c +++ b/src/lib/elc_anchorview.c @@ -3,7 +3,6 @@ /** * @defgroup Anchorview Anchorview - * @ingroup Elementary * * This is just like the Anchorblock object, but provides a scroller to hold * the text automatically. @@ -175,8 +174,11 @@ 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"); @@ -184,6 +186,7 @@ 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); @@ -283,6 +286,26 @@ 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 @@ -303,6 +326,26 @@ 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. @@ -345,6 +388,24 @@ 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 @@ -366,7 +427,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; - if (!func) return; + EINA_SAFETY_ON_NULL_RETURN(func); Elm_Anchorview_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorview_Item_Provider)); if (!ip) return; ip->func = func; @@ -392,7 +453,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; - if (!func) return; + EINA_SAFETY_ON_NULL_RETURN(func); Elm_Anchorview_Item_Provider *ip = calloc(1, sizeof(Elm_Anchorview_Item_Provider)); if (!ip) return; ip->func = func; @@ -420,7 +481,7 @@ elm_anchorview_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void Eina_List *l; Elm_Anchorview_Item_Provider *ip; if (!wd) return; - if (!func) return; + EINA_SAFETY_ON_NULL_RETURN(func); 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 105287d..2cf3010 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -1,16 +1,26 @@ /** * @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. - + * 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 + * * Signals that you can add callbacks for are: * * "selected" - the user clicks on a file - * "directory,open" - the list is populated with a new content. event_info is a directory. + * "directory,open" - the list is populated with new content. + * event_info is a directory. * "done" - the user clicks on the ok or cancel button */ @@ -21,43 +31,55 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { - Evas_Object *vbox, *entry, *entry2, *list, *scr2; - const char *path; - const char *selection; - Eina_Bool only_folder; - Eina_Bool expand; + 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; Ecore_Idler *sel_idler; - struct - { - Evas_Object *bx; - Evas_Object *ok; - Evas_Object *cancel; - } buttons; + const char *path_separator; + + Elm_Fileselector_Mode mode; + + Eina_Bool only_folder : 1; + Eina_Bool expand : 1; }; struct sel_data { Evas_Object *fs; - const char *path; + const char *path; }; -Elm_Genlist_Item_Class itc; +Elm_Genlist_Item_Class list_itc; +Elm_Gengrid_Item_Class grid_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 @@ -73,8 +95,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); } @@ -85,79 +107,163 @@ _sizing_eval(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; if (!wd) return; - evas_object_size_hint_min_get(wd->vbox, &minw, &minh); + 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_set(obj, minw, minh); -// printf("***** SIZING EVAL [min %d %d] *************\n", 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); } /*** GENLIST "MODEL" ***/ -static char* -_itc_label_get(const void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) +static char * +_itc_label_get(void *data, + Evas_Object *obj __UNUSED__, + const char *source __UNUSED__) { - //~ printf("LABEL_GET: %s\n", (char*) data); - return strdup(ecore_file_file_get(data)); // NOTE this will be free() by the caller + return strdup(ecore_file_file_get(data)); /* NOTE this will be + * free() by the + * caller */ } -static Evas_Object* -_itc_icon_get(const void *data, Evas_Object *obj, const char *source) +static Evas_Object * +_itc_icon_get(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(const void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) +_itc_state_get(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + const char *source __UNUSED__) { return EINA_FALSE; } static void -_itc_del(const void *data, Evas_Object *obj __UNUSED__) +_itc_del(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); @@ -176,144 +282,186 @@ _sel_do(void *data) wd = elm_widget_data_get(sd->fs); path = sd->path; - if (ecore_file_is_dir(path)) + if ((!wd->only_folder) && ecore_file_is_dir(path)) { - // printf("SELECTED DIR: %s\n", path); - if (wd->expand) + if (wd->expand && wd->mode == ELM_FILESELECTOR_LIST) { _do_anchors(sd->fs, path); - if (wd->entry2) elm_entry_entry_set(wd->entry2, ""); + elm_scrolled_entry_entry_set(wd->filename_entry, ""); } 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 + else /* navigating through folders only or file is not a dir. */ { - // printf("SELECTED FILE: %s\n", path); - if (wd->entry2) - elm_entry_entry_set(wd->entry2, ecore_file_file_get(path)); + 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)); } - 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 = elm_genlist_item_data_get(event_info); + sd->path = wd->mode == ELM_FILESELECTOR_LIST ? + elm_genlist_item_data_get(event_info) : + elm_gengrid_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; - char *parent = ecore_file_dir_get(wd->path); + 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 (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)); + 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)); } free(tok[0]); free(tok); - //~ printf("ANCHOR: %s\n", buf); - elm_entry_entry_set(wd->entry, buf); + elm_scrolled_entry_entry_set(wd->path_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; @@ -325,56 +473,70 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent) 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->list); - eina_stringshare_replace(&wd->path, path); - _do_anchors(obj, path); + elm_genlist_clear(wd->files_list); + elm_gengrid_clear(wd->files_grid); + eina_stringshare_replace(&wd->path, path); + _do_anchors(obj, path); } - if (wd->entry2) elm_entry_entry_set(wd->entry2, ""); + if (wd->filename_entry) elm_scrolled_entry_entry_set(wd->filename_entry, ""); 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) { - //~ 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); + 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); } eina_list_free(dirs); EINA_LIST_FOREACH(files, l, 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); + 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); } eina_list_free(files); } /*** API ***/ + /** * Add a new Fileselector object * @@ -386,33 +548,29 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent) EAPI Evas_Object * elm_fileselector_add(Evas_Object *parent) { - Evas_Object *obj, *ic, *bt, *box; + 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; Widget_Data *wd; + int s; // Elementary Widget wd = ELM_NEW(Widget_Data); - wd->expand = EINA_FALSE; + wd->expand = !!_elm_config->fileselector_expand_enable; 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); - // 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); + wd->edje = edje_object_add(e); + _elm_theme_object_set(obj, wd->edje, "fileselector", "base", "default"); + elm_widget_resize_object_set(obj, wd->edje); // up btn ic = elm_icon_add(parent); @@ -422,10 +580,11 @@ 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); - elm_widget_sub_object_add(obj, bt); - elm_box_pack_end(box, bt); + evas_object_smart_callback_add(bt, "clicked", _up, obj); - evas_object_show(bt); + + elm_widget_sub_object_add(obj, bt); + wd->up_button = bt; // home btn ic = elm_icon_add(parent); @@ -435,63 +594,73 @@ 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); - elm_widget_sub_object_add(obj, bt); - 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); + + 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; // path entry - 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); + 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); - // 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; } @@ -506,28 +675,19 @@ 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) - { - 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); - } + edje_object_signal_emit(wd->edje, "elm,state,save,on", "elm"); else - { - evas_object_del(wd->entry2); - wd->entry2 = NULL; - } + edje_object_signal_emit(wd->edje, "elm,state,save,off", "elm"); } /** @@ -544,10 +704,9 @@ 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 wd->entry2 ? EINA_TRUE : EINA_FALSE; + return elm_object_disabled_get(wd->filename_entry); } - /** * This enables/disables folder-only view in the fileselector. * @@ -558,16 +717,17 @@ 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; + wd->only_folder = !!only; + if (wd->path) _populate(obj, wd->path, NULL); } - /** * This gets the state of file display in the fileselector. * @@ -586,10 +746,8 @@ elm_fileselector_folder_only_get(const Evas_Object *obj) return wd->only_folder; } - /** - * This enables/disables the file name entry box where the user can - * type in the name of a file to be selected. + * This enables/disables the ok,cancel buttons. * * @param obj The fileselector object * @param only If true, a box containing ok and cancel buttons is created. @@ -598,51 +756,45 @@ elm_fileselector_folder_only_get(const Evas_Object *obj) * @ingroup Fileselector */ EAPI void -elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool only) +elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, + Eina_Bool visible) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *box, *bt; + Evas_Object *bt; if (!wd) return; - 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); + if (visible) + { // cancel btn bt = elm_button_add(obj); - wd->buttons.cancel = bt; elm_button_label_set(bt, "Cancel"); - elm_widget_sub_object_add(obj, bt); - elm_box_pack_end(box, bt); + evas_object_smart_callback_add(bt, "clicked", _canc, obj); - evas_object_show(bt); + + elm_widget_sub_object_add(obj, bt); + wd->cancel_button = bt; // ok btn bt = elm_button_add(obj); - wd->buttons.ok = bt; elm_button_label_set(bt, "OK"); - elm_widget_sub_object_add(obj, bt); - elm_box_pack_end(box, bt); + evas_object_smart_callback_add(bt, "clicked", _ok, obj); - evas_object_show(bt); + + elm_widget_sub_object_add(obj, bt); + wd->ok_button = bt; + + _theme_hook(obj); } else { - evas_object_del(wd->buttons.bx); - evas_object_del(wd->buttons.ok); - evas_object_del(wd->buttons.cancel); - wd->buttons.bx = NULL; + evas_object_del(wd->cancel_button); + wd->cancel_button = NULL; + evas_object_del(wd->ok_button); + wd->ok_button = NULL; } } - /** * This gets the state of the box containing ok and cancel buttons. * @@ -658,22 +810,27 @@ 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->buttons.bx ? EINA_TRUE : EINA_FALSE; + return wd->ok_button ? EINA_TRUE : EINA_FALSE; } - /** - * This enables tree view in the fileselector. Arrows are created on the - * sides of directories, allowing them to expand in place. + * 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. * * @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; @@ -681,7 +838,9 @@ elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand) wd = elm_widget_data_get(obj); if (!wd) return; - wd->expand = expand; + wd->expand = !!expand; + + if (wd->path) _populate(obj, wd->path, NULL); } /** @@ -711,8 +870,10 @@ 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); } @@ -734,6 +895,80 @@ 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 @@ -746,22 +981,33 @@ 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->entry2) + + if (wd->filename_entry) { - 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; + 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; } - it = elm_genlist_selected_item_get(wd->list); - if (it) return elm_genlist_item_data_get(it); + 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); + } return wd->path; } @@ -778,24 +1024,29 @@ 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->entry2) - { - elm_entry_entry_set(wd->entry2, 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->filename_entry) + { + elm_scrolled_entry_entry_set(wd->filename_entry, + 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 02cc279..ea48d83 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,41 +15,40 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { - Evas_Object *btn, *icon, *fs; - const char *window_title; - const char *btn_label; - Evas_Coord w, h; - struct { + Evas_Object *self, *btn, *fs, *fsw; + const char *window_title; + 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; }; -static const char DEFAULT_WINDOW_TITLE[] = "Select a file"; +#define 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 _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 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 const char SIG_FILE_CHOSEN[] = "file,chosen"; -static const Evas_Smart_Cb_Description _signals[] = -{ - {SIG_CLICKED, ""}, - {SIG_UNPRESSED, ""}, +static const Evas_Smart_Cb_Description _signals[] = { {SIG_FILE_CHOSEN, "s"}, {NULL, NULL} }; @@ -63,54 +62,35 @@ _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)) - { - 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); - } + elm_widget_focus_steal(wd->btn); } static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); + char buf[4096]; 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->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); + snprintf(buf, sizeof(buf), "fileselector_button/%s", + elm_widget_style_get(obj)); + elm_object_style_set(wd->btn, buf); _sizing_eval(obj); } @@ -119,10 +99,7 @@ _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->btn, "elm,state,disabled", "elm"); - else - edje_object_signal_emit(wd->btn, "elm,state,enabled", "elm"); + elm_widget_disabled_set(wd->btn, elm_widget_disabled_get(obj)); } static void @@ -130,70 +107,48 @@ _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; - 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_get(wd->btn, &minw, &minh); + evas_object_size_hint_max_get(wd->btn, &maxw, &maxh); 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, void *event_info __UNUSED__) +_changed_size_hints(void *data, + Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, + 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 -_sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info) +_activate_hook(Evas_Object *obj) { - Widget_Data *wd = elm_widget_data_get(obj); - Evas_Object *sub = event_info; + Widget_Data *wd; + wd = elm_widget_data_get(obj); 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); - } + _activate(wd); } static void -_signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) +_button_clicked(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) { - 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); + _activate(data); } static Evas_Object * _parent_win_get(Evas_Object *obj) { - Evas_Object *ret; - - 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); - } + while ((obj) && (strcmp(elm_widget_type_get(obj), "win"))) + obj = elm_object_parent_widget_get(obj); - return ret; + return obj; } static Evas_Object * @@ -215,101 +170,69 @@ _new_window_add(Widget_Data *wd) } static void -_fs_launch(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +_activate(Widget_Data *wd) { - Evas_Object *fs_btn, *win = NULL, *iw = NULL; - Eina_Bool win_fallback; - Widget_Data *wd; + Eina_Bool is_inwin = EINA_FALSE; - 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) { - 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); - } - } - - if ((!wd->inwin_mode) || (win_fallback)) - { - win = _new_window_add(wd); - evas_object_data_set(fs_btn, "win", win); + 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; + } } + else + wd->fsw = _new_window_add(wd); - wd->fs = elm_fileselector_add(win); + wd->fs = elm_fileselector_add(wd->fsw); 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, fs_btn); + evas_object_smart_callback_add(wd->fs, "done", _selection_done, wd); evas_object_show(wd->fs); - if ((wd->inwin_mode) && (!win_fallback)) + if (is_inwin) { - elm_win_inwin_content_set(iw, wd->fs); - elm_win_inwin_activate(iw); + elm_win_inwin_content_set(wd->fsw, wd->fs); + elm_win_inwin_activate(wd->fsw); } else { - elm_win_resize_object_add(win, wd->fs); - evas_object_show(win); + elm_win_resize_object_add(wd->fsw, wd->fs); + evas_object_show(wd->fsw); } } static void -_selection_done(void *data, Evas_Object *obj __UNUSED__, void *event_info) +_selection_done(void *data, + Evas_Object *obj __UNUSED__, + void *event_info) { - Evas_Object *fs_btn, *win; - const char *file; - Widget_Data *wd; - - file = event_info; - fs_btn = data; - - wd = elm_widget_data_get(fs_btn); + const char *file = event_info; + Widget_Data *wd = data; + Evas_Object *del; 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; - evas_object_del(win); -} + wd->fsw = NULL; + evas_object_del(del); -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); + evas_object_smart_callback_call(wd->self, SIG_FILE_CHOSEN, + (void *)wd->fsd.path); } /** @@ -327,42 +250,39 @@ 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, 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_smart_callback_add(obj, "sub-object-del", _sub_del, obj); + elm_widget_can_focus_set(obj, EINA_TRUE); + elm_widget_activate_hook_set(obj, _activate_hook); - _sizing_eval(obj); + wd->btn = elm_button_add(parent); + 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); - // TODO: convert Elementary to subclassing of Evas_Smart_Class - // TODO: and save some bytes, making descriptions per-class and not instance! + _theme_hook(obj); evas_object_smart_callbacks_descriptions_set(obj, _signals); return obj; } @@ -376,66 +296,30 @@ 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; - 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; + elm_button_label_set(wd->btn, label); } /** - * Set the path to start the button's file selector with, when clicked. + * Get the label used in the file selector button. * * @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 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. + * @return The button label * * @ingroup File_Selector_Button */ EAPI const char * -elm_fileselector_button_selected_get(const Evas_Object *obj) +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->fsd.path; + return elm_button_label_get(wd->btn); } /** @@ -450,18 +334,24 @@ elm_fileselector_button_selected_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 */ @@ -470,6 +360,7 @@ 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; } @@ -487,13 +378,19 @@ 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); } /** @@ -506,10 +403,13 @@ elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas * @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; @@ -522,16 +422,22 @@ elm_fileselector_button_window_size_get(const Evas_Object *obj, Evas_Coord *widt * @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); } /** @@ -562,12 +468,17 @@ 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); } /** @@ -583,6 +494,7 @@ 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; } @@ -597,12 +509,17 @@ 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); } /** @@ -618,6 +535,7 @@ 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; } @@ -632,12 +550,17 @@ 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); } /** @@ -653,6 +576,7 @@ 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; } @@ -668,10 +592,12 @@ 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; } @@ -689,6 +615,7 @@ 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; } @@ -697,38 +624,33 @@ 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 image for the button + * @param icon The icon object 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) return; - if (wd->icon == icon) return; - if (wd->icon) evas_object_del(wd->icon); - wd->icon = icon; - if (icon) + if (!wd) { - 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); + evas_object_del(icon); + return; } - _sizing_eval(obj); + elm_button_icon_set(wd->btn, icon); } /** * Get the icon used for the button * * @param obj The button object - * @return The image for the button + * @return The icon object that is being used * * @ingroup File_Selector_Button */ @@ -738,5 +660,25 @@ 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 wd->icon; + return elm_button_icon_get(wd->btn); } + +/** + * 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 new file mode 100644 index 0000000..7b0ad6d --- /dev/null +++ b/src/lib/elc_fileselector_entry.c @@ -0,0 +1,655 @@ +#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 c54ca57..2e355b5 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -28,23 +28,24 @@ struct _Widget_Data Evas_Object *hover_parent; Eina_List *items; Eina_Bool horizontal : 1; + Eina_Bool expanded : 1; }; struct _Elm_Hoversel_Item { - Evas_Object *obj; + Elm_Widget_Item base; 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); @@ -53,18 +54,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 *it; + Elm_Hoversel_Item *item; 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, it) + EINA_LIST_FREE(wd->items, 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); + 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); } } @@ -84,10 +85,11 @@ _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 @@ -95,10 +97,7 @@ _disable_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (elm_widget_disabled_get(obj)) - elm_widget_disabled_set(wd->btn, 1); - else - elm_widget_disabled_set(wd->btn, 0); + elm_object_disabled_set(wd->btn, elm_widget_disabled_get(obj)); } static void @@ -114,6 +113,15 @@ _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); @@ -128,12 +136,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 *it = data; - Evas_Object *obj2 = it->obj; + Elm_Hoversel_Item *item = data; + Evas_Object *obj2 = item->base.widget; elm_hoversel_hover_end(obj2); - if (it->func) it->func(it->data, obj2, it); - evas_object_smart_callback_call(obj2, "selected", it); + if (item->func) item->func((void *)item->base.data, obj2, item); + evas_object_smart_callback_call(obj2, "selected", item); } static void @@ -142,10 +150,17 @@ _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 *it; + const Elm_Hoversel_Item *item; 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) @@ -168,26 +183,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, it) + EINA_LIST_FOREACH(wd->items, l, item) { bt = elm_button_add(wd->hover); elm_object_style_set(bt, buf); - elm_button_label_set(bt, it->label); - if (it->icon_file) + elm_button_label_set(bt, item->label); + if (item->icon_file) { ic = elm_icon_add(obj); elm_icon_scale_set(ic, 0, 1); - 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); + 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); 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, it); + evas_object_smart_callback_add(bt, "clicked", _item_clicked, item); evas_object_show(bt); } @@ -210,6 +225,12 @@ _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); @@ -237,10 +258,12 @@ elm_hoversel_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - char buf[4096]; + + 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, "hoversel"); elm_widget_type_set(obj, "hoversel"); @@ -250,19 +273,20 @@ 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); - 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); + wd->expanded = EINA_FALSE; 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); - _sizing_eval(obj); + _theme_hook(obj); return obj; } @@ -293,6 +317,26 @@ 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 @@ -370,6 +414,9 @@ 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 @@ -406,6 +453,26 @@ 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. * @@ -437,6 +504,7 @@ 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); @@ -452,7 +520,7 @@ elm_hoversel_hover_end(Evas_Object *obj) * @ingroup Hoversel */ EAPI Eina_Bool -elm_hoversel_expanded_get(Evas_Object *obj) +elm_hoversel_expanded_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); @@ -472,12 +540,12 @@ elm_hoversel_expanded_get(Evas_Object *obj) EAPI void elm_hoversel_clear(Evas_Object *obj) { - Elm_Hoversel_Item *it; + Elm_Hoversel_Item *item; 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, it) elm_hoversel_item_del(it); + EINA_LIST_FOREACH_SAFE(wd->items, l, ll, item) elm_hoversel_item_del(item); } /** @@ -521,16 +589,15 @@ 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 *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; + 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; } /** @@ -540,23 +607,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 it The item to delete + * @param item The item to delete * * @ingroup Hoversel */ EAPI void -elm_hoversel_item_del(Elm_Hoversel_Item *it) +elm_hoversel_item_del(Elm_Hoversel_Item *item) { - 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); + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + Widget_Data *wd = elm_widget_data_get(item->base.widget); if (!wd) return; - 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); + 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); } /** @@ -567,54 +634,54 @@ elm_hoversel_item_del(Elm_Hoversel_Item *it) * Evas_Object *the_item_object * Elm_Hoversel_Item *the_object_struct * - * @param it The item to set the callback on + * @param item 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 *it, Evas_Smart_Cb func) +elm_hoversel_item_del_cb_set(Elm_Hoversel_Item *item, Evas_Smart_Cb func) { - if (!it) return; - it->del_cb = func; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_del_cb_set(item, func); } /** * This returns the data pointer supplied with elm_hoversel_item_add() that * will be passed to associated function callbacks. * - * @param it The item to get the data from + * @param item 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(Elm_Hoversel_Item *it) +elm_hoversel_item_data_get(const Elm_Hoversel_Item *item) { - if (!it) return NULL; - return it->data; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return elm_widget_item_data_get(item); } /** * This returns the label text of the given hoversel item. * - * @param it The item to get the label + * @param item The item to get the label * @return The label text of the hoversel item * * @ingroup Hoversel */ EAPI const char * -elm_hoversel_item_label_get(Elm_Hoversel_Item *it) +elm_hoversel_item_label_get(const Elm_Hoversel_Item *item) { - if (!it) return NULL; - return it->label; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return item->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 it The item to set the icon + * @param item 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 @@ -624,18 +691,18 @@ elm_hoversel_item_label_get(Elm_Hoversel_Item *it) * @ingroup Hoversel */ EAPI void -elm_hoversel_item_icon_set(Elm_Hoversel_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type) +elm_hoversel_item_icon_set(Elm_Hoversel_Item *item, const char *icon_file, const char *icon_group, Elm_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; + 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; } /** * Get the icon object of the hoversel item * - * @param it The item to get the icon from + * @param item 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 @@ -645,11 +712,11 @@ elm_hoversel_item_icon_set(Elm_Hoversel_Item *it, const char *icon_file, const c * @ingroup Hoversel */ EAPI void -elm_hoversel_item_icon_get(Elm_Hoversel_Item *it, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type) +elm_hoversel_item_icon_get(const Elm_Hoversel_Item *item, const char **icon_file, const char **icon_group, Elm_Icon_Type *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; + 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; } diff --git a/src/lib/elc_scrolled_entry.c b/src/lib/elc_scrolled_entry.c index de2a4f5..8826e13 100644 --- a/src/lib/elc_scrolled_entry.c +++ b/src/lib/elc_scrolled_entry.c @@ -1,12 +1,8 @@ -/* - * 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 @@ -35,15 +31,42 @@ */ 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"; @@ -85,34 +108,37 @@ static const Evas_Smart_Cb_Description _signals[] = { static void _del_hook(Evas_Object *obj) { - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - free(wd); -} + Elm_Entry_Context_Menu_Item *ci; + Elm_Entry_Item_Provider *ip; + Elm_Entry_Text_Filter *tf; -static void -_theme_hook(Evas_Object *obj) -{ 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; - elm_object_style_set(wd->entry, elm_widget_style_get(obj)); - elm_object_style_set(wd->scroller, elm_widget_style_get(obj)); + free(wd); } static void _sizing_eval(Evas_Object *obj) { - Widget_Data *wd = elm_widget_data_get(obj); + Widget_Data *wd; 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 @@ -120,6 +146,18 @@ _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); @@ -146,108 +184,169 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) } static void -_entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_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) { _sizing_eval(data); - evas_object_smart_callback_call(data, SIG_CHANGED, NULL); + evas_object_smart_callback_call(data, SIG_CHANGED, event_info); } static void -_entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_ACTIVATED, NULL); + evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info); } static void -_entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_press(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_PRESS, NULL); + evas_object_smart_callback_call(data, SIG_PRESS, event_info); } static void -_entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_CLICKED, NULL); + evas_object_smart_callback_call(data, SIG_CLICKED, event_info); } static void -_entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_clicked_double(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL); + evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, event_info); } static void -_entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_cursor_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, NULL); + evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, event_info); } static void -_entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, NULL); + evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, event_info); } static void -_entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_selection_start(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL); + evas_object_smart_callback_call(data, SIG_SELECTION_START, event_info); } static void -_entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_selection_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL); + evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, event_info); } static void -_entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_selection_cleared(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, NULL); + evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, event_info); } static void -_entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_selection_paste(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL); + evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, event_info); } static void -_entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_selection_copy(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_SELECTION_COPY, NULL); + evas_object_smart_callback_call(data, SIG_SELECTION_COPY, event_info); } static void -_entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_selection_cut(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_SELECTION_CUT, NULL); + evas_object_smart_callback_call(data, SIG_SELECTION_CUT, event_info); } static void -_entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL); + evas_object_smart_callback_call(data, SIG_LONGPRESSED, event_info); } static void -_entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_FOCUSED, NULL); + evas_object_smart_callback_call(data, SIG_FOCUSED, event_info); } static void -_entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, SIG_UNFOCUSED, NULL); + evas_object_smart_callback_call(data, SIG_UNFOCUSED, event_info); } static void -_entry_maxlength_reached(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_context_item_wrap_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info) { - evas_object_smart_callback_call(data, "maxlength,reached", NULL); + Elm_Entry_Context_Menu_Item *ci = data; + ci->func(ci->data, ci->obj, event_info); } +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. @@ -264,8 +363,11 @@ 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"); @@ -274,22 +376,31 @@ 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, 1); + elm_widget_can_focus_set(obj, EINA_TRUE); 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(parent); - elm_widget_sub_object_add(obj, wd->scroller); + wd->scroller = elm_scroller_add(obj); + //elm_scroller_custom_widget_base_theme_set(wd->scroller, "scroller", "entry"); elm_widget_resize_object_set(obj, wd->scroller); - 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->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); 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); @@ -306,7 +417,9 @@ 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_smart_callback_add(wd->entry, "maxlength,reached", _entry_maxlength_reached, obj); + + evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, NULL); _sizing_eval(obj); @@ -317,6 +430,216 @@ 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. * @@ -367,6 +690,7 @@ 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 (*). @@ -404,6 +728,7 @@ 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. * @@ -554,6 +879,7 @@ 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. * @@ -885,10 +1211,18 @@ 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; - elm_entry_context_menu_item_add(wd->entry, label, icon_file, icon_type, func, data); + + 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); } /** @@ -962,6 +1296,7 @@ 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. * @@ -980,22 +1315,298 @@ elm_scrolled_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes) } /** - * 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. + * 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. * * @param obj The scrolled entry object - * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character" - * 0 for default) + * @param autosave Autosave the loaded file or not * * @ingroup Scrolled_Entry */ EAPI void -elm_scrolled_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character) +elm_scrolled_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; - elm_entry_password_show_last_character_set(wd->entry, show_last_character); + 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); } /** @@ -1086,4 +1697,3 @@ elm_scrolled_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod) elm_entry_autoperiod_set(wd->entry, autoperiod); } - diff --git a/src/lib/elm_autocompleteview.c b/src/lib/elm_autocompleteview.c index 01c3ccb..fd6673b 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_horizontal_mode_set(wd->list, ELM_LIST_COMPRESS); + elm_list_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 a08a0f4..5312615 100644 --- a/src/lib/elm_bg.c +++ b/src/lib/elm_bg.c @@ -1,5 +1,3 @@ -#include - #include #include "elm_priv.h" @@ -15,11 +13,13 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { - Evas_Object *img, *custom_img; + Evas_Object *base, *rect, *img, *overlay; 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,29 +35,87 @@ static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - _elm_theme_object_set(obj, wd->img, "bg", "base", elm_widget_style_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); } static void -_custom_resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +_custom_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - int iw = 0, ih = 0; - Evas_Coord x, y, w, h, ow = 0, oh = 0; + 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; - evas_object_geometry_get(obj, NULL, NULL, &ow, &oh); - evas_object_image_size_get(obj, &iw, &ih); + if ((!wd->img) || (!wd->file)) return; + if (((p = strrchr(wd->file, '.'))) && (!strcasecmp(p, ".edj"))) return; + /* grab image size */ + evas_object_image_size_get(wd->img, &iw, &ih); if ((iw < 1) || (ih < 1)) return; - w = ow; - h = (ih * w) / iw; - if (h < oh) + + /* 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) { - h = oh; - w = (iw * h) / ih; + 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; } - x = (ow - w) / 2; - y = (oh - h) / 2; - evas_object_image_fill_set(obj, x, y, w, h); + + 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); } /** @@ -75,8 +133,11 @@ 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"); @@ -84,11 +145,16 @@ 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, 0); + elm_widget_can_focus_set(obj, EINA_FALSE); - wd->img = edje_object_add(e); - _elm_theme_object_set(obj, wd->img, "bg", "base", "default"); - elm_widget_resize_object_set(obj, wd->img); + 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; return obj; } @@ -101,7 +167,10 @@ 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 arte not visible. + * 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. * * @ingroup Bg */ @@ -112,28 +181,219 @@ 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->custom_img) + if (wd->img) + { + evas_object_del(wd->img); + wd->img = NULL; + } + if (!file) { - evas_object_del(wd->custom_img); - wd->custom_img = NULL; + eina_stringshare_del(wd->file); + wd->file = NULL; + eina_stringshare_del(wd->group); + wd->group = NULL; + return; } - if (!file) return; eina_stringshare_replace(&wd->file, file); eina_stringshare_replace(&wd->group, group); if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj"))) { - wd->custom_img = edje_object_add(evas_object_evas_get(wd->img)); - edje_object_file_set(wd->custom_img, file, group); + wd->img = edje_object_add(evas_object_evas_get(wd->base)); + edje_object_file_set(wd->img, file, group); } else { - 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); + wd->img = evas_object_image_add(evas_object_evas_get(wd->base)); + evas_object_image_file_set(wd->img, file, group); } - 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); + 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; } diff --git a/src/lib/elm_box.c b/src/lib/elm_box.c index 2529774..8dc59f8 100644 --- a/src/lib/elm_box.c +++ b/src/lib/elm_box.c @@ -1,6 +1,9 @@ #include #include "elm_priv.h" +#define SIG_CHILD_ADDED "child,added" +#define SIG_CHILD_REMOVED "child,removed" + /** * @defgroup Box Box * @ingroup Elementary @@ -20,6 +23,7 @@ * 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 { @@ -29,6 +33,37 @@ 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); @@ -53,6 +88,39 @@ _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) { @@ -92,6 +160,172 @@ _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 @@ -108,8 +342,11 @@ 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"); @@ -117,6 +354,9 @@ 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, @@ -136,7 +376,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 orizontal as true, the box will become + * By calling this and providing @p horizontal as true, the box will become * horizontal arranging contents left to right. * * @param obj The box object @@ -173,6 +413,23 @@ 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 @@ -212,6 +469,23 @@ 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 @@ -316,7 +590,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, 1); + evas_object_box_remove_all(wd->box, EINA_TRUE); } /** @@ -354,21 +628,310 @@ 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, 0); + 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); } +/** + * 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_extended_set(Evas_Object *obj, Eina_Bool extended) +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_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_calendar.c b/src/lib/elm_calendar.c index ff9c79b..8656945 100644 --- a/src/lib/elm_calendar.c +++ b/src/lib/elm_calendar.c @@ -1,3 +1,11 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#ifdef HAVE_EVIL +# include +#endif + #include #include "elm_priv.h" @@ -17,6 +25,14 @@ * 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 @@ -30,6 +46,7 @@ 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; }; @@ -43,6 +60,7 @@ struct _Elm_Calendar_Mark }; static const char *widtype = NULL; +static void _on_focus_hook(void *data, Evas_Object *obj); static const char *_days_abbrev[] = { @@ -99,14 +117,16 @@ _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[18]; + char emission[32]; snprintf(emission, sizeof(emission), "cit_%i,unselected", selected); edje_object_signal_emit(wd->calendar, emission, "elm"); } @@ -114,7 +134,7 @@ _unselect(Widget_Data *wd, int selected) static inline void _select(Widget_Data *wd, int selected) { - char emission[16]; + char emission[32]; snprintf(emission, sizeof(emission), "cit_%i,selected", selected); edje_object_signal_emit(wd->calendar, emission, "elm"); } @@ -122,7 +142,7 @@ _select(Widget_Data *wd, int selected) static inline void _not_today(Widget_Data *wd) { - char emission[17]; + char emission[32]; snprintf(emission, sizeof(emission), "cit_%i,not_today", wd->today_it); edje_object_signal_emit(wd->calendar, emission, "elm"); wd->today_it = -1; @@ -131,7 +151,7 @@ _not_today(Widget_Data *wd) static inline void _today(Widget_Data *wd, int it) { - char emission[13]; + char emission[32]; snprintf(emission, sizeof(emission), "cit_%i,today", it); edje_object_signal_emit(wd->calendar, emission, "elm"); wd->today_it = it; @@ -159,6 +179,40 @@ _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) { @@ -168,7 +222,7 @@ _populate(Evas_Object *obj) struct tm first_day; Eina_List *l; char *buf; - Eina_Bool last_row=1; + Eina_Bool last_row = EINA_TRUE; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -183,8 +237,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", ""); @@ -195,130 +249,131 @@ _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=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"); - } - } - + + 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"); + } + } + for (i = 0; i < 42; i++) { - if ((!day) && (i == first_day.tm_wday)) - day = 1; + _text_day_color_update(wd, i); // EINA_DEPRECATED + 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), "%d", day++); - else + if ((day) && (day <= maxdays)) + snprintf(day_s, sizeof(day_s), "%i", 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; + } } } @@ -332,8 +387,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]); } } @@ -350,10 +405,12 @@ _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]); @@ -362,17 +419,34 @@ _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); } @@ -390,15 +464,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->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)) +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 NULL; - return edje_object_signal_callback_del(wd->calendar, emission, source, func_cb); + if (!wd) return; + edje_object_signal_callback_del_full(wd->calendar, emission, source, func_cb, + data); } /* Set correct tm_wday and tm_yday after other fields changes*/ @@ -425,23 +500,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); @@ -514,28 +589,42 @@ _get_item_day(Evas_Object *obj, int selected_it) } static void -_day_selected(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source) +_update_sel_it(Evas_Object *obj, int sel_it) { - int sel_it, day; - Widget_Data *wd = elm_widget_data_get(data); + int day; + Widget_Data *wd = elm_widget_data_get(obj); if ((!wd) || (!wd->selection_enabled)) - return; - sel_it = atoi(source); - day = _get_item_day(data, sel_it); + return; + + day = _get_item_day(obj, 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(data, "changed", NULL); + 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); } 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 @@ -553,7 +642,8 @@ _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; @@ -562,6 +652,52 @@ _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 * @@ -579,18 +715,24 @@ 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; @@ -662,6 +804,8 @@ 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]); @@ -783,8 +927,6 @@ 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; @@ -854,6 +996,8 @@ 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; @@ -877,7 +1021,8 @@ 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; - if (selected_time) *selected_time = wd->selected_time; + EINA_SAFETY_ON_NULL_RETURN_VAL(selected_time, EINA_FALSE); + *selected_time = wd->selected_time; return EINA_TRUE; } @@ -945,7 +1090,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 - * emmitted to the theme, that should display a related modification on these + * emitted 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 @@ -984,7 +1129,7 @@ elm_calendar_mark_del(Elm_Calendar_Mark *mark) Evas_Object *obj; Widget_Data *wd; - if (!mark) return; + EINA_SAFETY_ON_NULL_RETURN(mark); obj = mark->obj; wd = elm_widget_data_get(obj); @@ -1010,7 +1155,7 @@ elm_calendar_marks_clear(Evas_Object *obj) if (!wd) return; EINA_LIST_FREE(wd->marks, mark) - _mark_free(mark); + _mark_free(mark); } /** @@ -1054,61 +1199,82 @@ elm_calendar_marks_draw(Evas_Object *obj) } /** - * Set a text color - blue. - * + * 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 + * * @param obj The calendar object - * @param pos The text position + * @param pos The text position * * @ingroup Calendar */ -EAPI void -elm_calendar_text_saturday_color_set(const Evas_Object *obj, int pos) +EINA_DEPRECATED EAPI void +elm_calendar_text_saturday_color_set(Evas_Object *obj, int 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"); + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + _text_day_color_set(wd, DAY_SATURDAY, pos); } /** - * Set a text color - red. + * Set a text color to the sunday color. * + * 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 */ -EAPI void -elm_calendar_text_sunday_color_set(const Evas_Object *obj, int pos) +EINA_DEPRECATED EAPI void +elm_calendar_text_sunday_color_set(Evas_Object *obj, int 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"); + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + _text_day_color_set(wd, DAY_SUNDAY, pos); } /** - * Set a text color - black. + * Set a text color to the weekday color. * + * 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 */ -EAPI void -elm_calendar_text_weekday_color_set(const Evas_Object *obj, int pos) +EINA_DEPRECATED EAPI void +elm_calendar_text_weekday_color_set(Evas_Object *obj, int 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"); + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + _text_day_color_set(wd, DAY_WEEKDAY, pos); } diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index 8c8c005..364fc0b 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -41,12 +41,34 @@ 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) { @@ -63,13 +85,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); } } @@ -80,17 +102,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"); @@ -105,9 +127,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 @@ -142,12 +164,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); } } @@ -176,7 +198,19 @@ _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__) { - Widget_Data *wd = elm_widget_data_get(data); + _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); if (!wd) return; wd->state = !wd->state; if (wd->statep) *wd->statep = wd->state; @@ -184,13 +218,13 @@ _signal_check_toggle(void *data, Evas_Object *obj __UNUSED__, const char *emissi 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(data, SIG_CHANGED, NULL); + evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); } /** * Add a new Check object * - * @param[in] parent The parent object + * @param parent The parent object * @return The new object or NULL if it cannot be created * * @ingroup Check @@ -206,16 +240,19 @@ 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"); @@ -240,8 +277,8 @@ elm_check_add(Evas_Object *parent) /** * Set the text label of the check object * - * @param[in] obj The check object - * @param[in] label The text label string in UTF-8 + * @param obj The check object + * @param label The text label string in UTF-8 * * @ingroup Check */ @@ -264,7 +301,7 @@ elm_check_label_set(Evas_Object *obj, const char *label) /** * Get the text label of the check object * - * @param[in] obj The check object + * @param obj The check object * @return The text label string in UTF-8 * * @ingroup Check @@ -285,8 +322,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[in] obj The check object - * @param[in] icon The icon object + * @param obj The check object + * @param icon The icon object * * @ingroup Check */ @@ -301,12 +338,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); } @@ -314,7 +351,7 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Get the icon object of the check object * - * @param[in] obj The check object + * @param obj The check object * @return The icon object * * @ingroup Check @@ -333,7 +370,7 @@ elm_check_icon_get(const Evas_Object *obj) * * Unparent and return the icon object which was set for this widget. * - * @param[in] obj The check object + * @param obj The check object * @return The icon object that was being used * * @ingroup Check @@ -358,8 +395,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[in] obj The check object - * @param[in] state The state to use (1 == on, 0 == off) + * @param obj The check object + * @param state The state to use (1 == on, 0 == off) * * @ingroup Check */ @@ -371,19 +408,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[in] obj The check object + * @param obj The check object * @return The boolean state * * @ingroup Check @@ -407,8 +444,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[in] obj The check object - * @param[in] statep Pointer to the boolean to modify + * @param obj The check object + * @param statep Pointer to the boolean to modify * * @ingroup Check */ @@ -420,15 +457,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 9e121b9..c589e53 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; + int hrs, min, sec, timediff; Evas_Object *digit[6]; Evas_Object *ampm; Evas_Object *sel_obj; @@ -39,6 +39,7 @@ 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); @@ -79,9 +80,15 @@ _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"); + { + edje_object_signal_emit(wd->clk, "elm,action,focus", "elm"); + evas_object_focus_set(wd->clk, EINA_TRUE); + } else - edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm"); + { + edje_object_signal_emit(wd->clk, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->clk, EINA_FALSE); + } } static void @@ -113,18 +120,32 @@ _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)) +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); int i; - if (!wd) return NULL; for (i = 0; i < 6; i++) { - edje_object_signal_callback_del(wd->digit[i], emission, source, - func_cb); + edje_object_signal_callback_del_full(wd->digit[i], emission, source, + func_cb, data); } - return edje_object_signal_callback_del(wd->clk, 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; } static Eina_Bool @@ -141,7 +162,7 @@ _ticker(void *data) wd->ticker = ecore_timer_add(t, _ticker, data); if (!wd->edit) { - tt = (time_t)(timev.tv_sec); + tt = (time_t)(timev.tv_sec) + wd->timediff; tzset(); tm = localtime(&tt); if (tm) @@ -343,7 +364,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); @@ -412,7 +433,7 @@ _time_update(Evas_Object *obj) if (hrs > 12) hrs -= 12; ampm = 1; } - else if (hrs == 0) hrs = 12; + else if (!hrs) hrs = 12; } d1 = hrs / 10; d2 = hrs % 10; @@ -510,8 +531,11 @@ 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"); @@ -523,6 +547,7 @@ 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); @@ -533,6 +558,7 @@ 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); @@ -561,6 +587,7 @@ 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); } @@ -611,7 +638,9 @@ 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 && (wd->digedit == ELM_CLOCK_NONE)) + if (!edit) + _timediff_set(wd); + 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_config.c b/src/lib/elm_config.c index 42c09a5..e84ddc1 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_INT); + ELM_CONFIG_VAL(D, T, password_show_last_character, T_UCHAR); #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 = 0; + _elm_config->password_show_last_character = EINA_FALSE; } 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); diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 641fdb8..2994fff 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -3,15 +3,14 @@ /** * @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 & softkey windows when running + * account for space taken up by the indicator, virtual keypad & 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; @@ -21,52 +20,61 @@ 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 _del_hook(Evas_Object *obj); +static void _theme_hook(Evas_Object *obj); static void _swallow_conformant_parts(Evas_Object *obj); static void -_sizing_eval(Evas_Object *obj); -static Eina_Bool -_prop_change(void *data, int type, void *event); +_conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, int sy, int sh); +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); /* 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; @@ -77,51 +85,110 @@ _sizing_eval(Evas_Object *obj) } static void -_swallow_conformant_parts(Evas_Object *obj) +_conformant_part_size_set(Evas_Object *obj, Evas_Object *sobj, int sy, int sh) { - Widget_Data *wd = elm_widget_data_get(obj); + Evas_Coord cx, cy, cw, ch; + int part_height = 0; - int sh = -1; + 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); +} + +static void +_conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type) +{ #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); - ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh); + 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); + } #endif - if (sh < 0) sh = 0; +} + +static void +_swallow_conformant_parts(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + + wd->scroller = NULL; if (!wd->shelf) - wd->shelf = evas_object_rectangle_add(evas_object_evas_get(obj)); + { + 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); + } 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)); + { + 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); + } 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)); + { + 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); + } 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); } @@ -140,12 +207,77 @@ _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); - } + { + 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); } static void @@ -153,9 +285,12 @@ _content_resize_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Object *focus_obj; - Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *conformant = (Evas_Object *) data; + Widget_Data *wd = elm_widget_data_get(conformant); + if (!wd) return; if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return; - focus_obj = elm_widget_focused_object_get(obj); + + focus_obj = elm_widget_focused_object_get(conformant); if (focus_obj) { Evas_Coord x, y, w, h; @@ -178,8 +313,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); + sub = elm_widget_focused_object_get(conformant); //Look up for Top most scroller in the Focus Object hierarchy inside Conformant. while (sub) { @@ -193,98 +328,63 @@ _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) - { - 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); - } + 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); + } 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; @@ -299,15 +399,18 @@ _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"); @@ -316,6 +419,7 @@ 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"); @@ -323,8 +427,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 @@ -356,16 +460,35 @@ 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 4e5e7db..c1b909b 100644 --- a/src/lib/elm_controlbar.c +++ b/src/lib/elm_controlbar.c @@ -2016,7 +2016,7 @@ create_more_view(Widget_Data *wd) Evas_Object *icon; list = elm_list_add( wd->object ); - elm_list_horizontal_mode_set( list, ELM_LIST_COMPRESS ); + elm_list_mode_set( list, ELM_LIST_COMPRESS ); EINA_LIST_FOREACH(wd->items, l, item) { @@ -3079,13 +3079,10 @@ EAPI void elm_controlbar_item_label_set(Elm_Controlbar_Item * it, const char *label) { 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); diff --git a/src/lib/elm_datefield.c b/src/lib/elm_datefield.c index 524e5d3..34aa775 100644 --- a/src/lib/elm_datefield.c +++ b/src/lib/elm_datefield.c @@ -172,21 +172,21 @@ _theme_hook(Evas_Object *obj) //set date format if (wd->format_exists) - sprintf(sig, "elm,state,format,%s", elm_datefield_date_format_get(obj)); + sprintf(sig, "elm,state,format,%s", elm_datefield_date_format_get(obj)); else { - char *str = _get_i18n_string(obj, D_FMT); - if (str) - { - if (!strcmp(str, "yymmdd")) wd->date_format = DATE_FORMAT_YYMMDD; - else if (!strcmp(str, "yyddmm")) wd->date_format = DATE_FORMAT_YYDDMM; - else if (!strcmp(str, "mmyydd")) wd->date_format = DATE_FORMAT_MMYYDD; - else if (!strcmp(str, "mmddyy")) wd->date_format = DATE_FORMAT_MMDDYY; - else if (!strcmp(str, "ddyymm")) wd->date_format = DATE_FORMAT_DDYYMM; - else if (!strcmp(str, "ddmmyy")) wd->date_format = DATE_FORMAT_DDMMYY; - sprintf(sig, "elm,state,format,%s",str); - free(str); - } + char *str = _get_i18n_string(obj, D_FMT); + if (str) + { + if (!strcmp(str, "yymmdd")) wd->date_format = DATE_FORMAT_YYMMDD; + else if (!strcmp(str, "yyddmm")) wd->date_format = DATE_FORMAT_YYDDMM; + else if (!strcmp(str, "mmyydd")) wd->date_format = DATE_FORMAT_MMYYDD; + else if (!strcmp(str, "mmddyy")) wd->date_format = DATE_FORMAT_MMDDYY; + else if (!strcmp(str, "ddyymm")) wd->date_format = DATE_FORMAT_DDYYMM; + else if (!strcmp(str, "ddmmyy")) wd->date_format = DATE_FORMAT_DDMMYY; + sprintf(sig, "elm,state,format,%s",str); + free(str); + } } edje_object_signal_emit(wd->base, sig, "elm"); @@ -228,22 +228,22 @@ _signal_ampm_clicked(void *data, Evas_Object *obj, const char *emission, const c wd->pm = !wd->pm; if (wd->pm) { - str = _get_i18n_string(data, PM_STR); - if (str) - { - edje_object_part_text_set(wd->base, "elm.text.ampm", str); - free(str); - } + str = _get_i18n_string(data, PM_STR); + if (str) + { + edje_object_part_text_set(wd->base, "elm.text.ampm", str); + free(str); + } wd->hour += HOUR_12H_MAXIMUM; } else { - str = _get_i18n_string(data, AM_STR); - if (str) - { - edje_object_part_text_set(wd->base, "elm.text.ampm", str); - free(str); - } + str = _get_i18n_string(data, AM_STR); + if (str) + { + edje_object_part_text_set(wd->base, "elm.text.ampm", str); + free(str); + } wd->hour -= HOUR_12H_MAXIMUM; } evas_object_smart_callback_call(data, "changed", NULL); @@ -381,12 +381,12 @@ _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info) if (wd->month != (num = _check_date_boundary(data, wd->month, DATE_MON))) { wd->month = num; - i18n_str = _get_i18n_string(obj, ABMON_1+wd->month-1); - if (i18n_str) - { - elm_entry_entry_set(wd->date[DATE_MON], i18n_str); - free(i18n_str); - } + i18n_str = _get_i18n_string(obj, ABMON_1+wd->month-1); + if (i18n_str) + { + elm_entry_entry_set(wd->date[DATE_MON], i18n_str); + free(i18n_str); + } } //check day boundary if (wd->day != (num = _check_date_boundary(data, wd->day, DATE_DAY))) @@ -402,12 +402,12 @@ _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info) if (wd->month != (num = _check_date_boundary(data, wd->month, DATE_MON))) { wd->month = num; - i18n_str = _get_i18n_string(obj, ABMON_1+wd->month-1); - if (i18n_str) - { - elm_entry_entry_set(wd->date[DATE_MON], i18n_str); - free(i18n_str); - } + i18n_str = _get_i18n_string(obj, ABMON_1+wd->month-1); + if (i18n_str) + { + elm_entry_entry_set(wd->date[DATE_MON], i18n_str); + free(i18n_str); + } } //check day boundary if (wd->day != (num = _check_date_boundary(data, wd->day, DATE_DAY))) @@ -453,23 +453,23 @@ _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info) wd->hour = (wd->pm == EINA_TRUE)? num + HOUR_12H_MAXIMUM : num; if ((wd->hour % 12) == 0) wd->hour -= HOUR_12H_MAXIMUM; if (wd->pm) - { - i18n_str = _get_i18n_string(data, PM_STR); - if (i18n_str) - { - edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); - free(i18n_str); - } - } + { + i18n_str = _get_i18n_string(data, PM_STR); + if (i18n_str) + { + edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); + free(i18n_str); + } + } else - { - i18n_str = _get_i18n_string(data, AM_STR); - if (i18n_str) - { - edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); - free(i18n_str); - } - } + { + i18n_str = _get_i18n_string(data, AM_STR); + if (i18n_str) + { + edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); + free(i18n_str); + } + } } sprintf(str, "%02d", num); elm_entry_entry_set(wd->time[TIME_HOUR], str); @@ -614,52 +614,52 @@ _get_i18n_string(Evas_Object *obj, nl_item item) switch (item) { case D_FMT: - str = calloc(7, sizeof(char)); - while (fmt[i]) - { - if (fmt[i] == '%' && fmt[i+1]) - { - i++; - switch (fmt[i]) - { - case 'Y': case 'M': case 'D': case 'y': case 'm': case 'd': - str[j++] = tolower(fmt[i]); - str[j++] = tolower(fmt[i]); - break; - } - } - i++; - } - return str; + str = calloc(7, sizeof(char)); + while (fmt[i]) + { + if (fmt[i] == '%' && fmt[i+1]) + { + i++; + switch (fmt[i]) + { + case 'Y': case 'M': case 'D': case 'y': case 'm': case 'd': + str[j++] = tolower(fmt[i]); + str[j++] = tolower(fmt[i]); + break; + } + } + i++; + } + return str; case AM_STR: case PM_STR: - if (strlen(fmt) > 0) - { - str = calloc(strlen(fmt)+1, sizeof(char)); - strcpy(str, fmt); - } - else - { - str = calloc(3, sizeof(char)); - if (item == AM_STR) strcpy(str, "AM"); - else if (item == PM_STR) strcpy(str, "PM"); - } - return str; + if (strlen(fmt) > 0) + { + str = calloc(strlen(fmt)+1, sizeof(char)); + strcpy(str, fmt); + } + else + { + str = calloc(3, sizeof(char)); + if (item == AM_STR) strcpy(str, "AM"); + else if (item == PM_STR) strcpy(str, "PM"); + } + return str; case ABMON_1: case ABMON_2: case ABMON_3: case ABMON_4: case ABMON_5: case ABMON_6: case ABMON_7: case ABMON_8: case ABMON_9: case ABMON_10: case ABMON_11: case ABMON_12: - str = calloc(strlen(fmt)+1, sizeof(char)); - while (fmt[i]) - { - str[j++] = fmt[i]; - if (fmt[i] >= '1' && fmt[i] <= '9') - { - if (fmt[i+1] >= '1' && fmt[i+1] <= '9') - str[j] = fmt[i+1]; - break; - } - i++; - } - return str; + str = calloc(strlen(fmt)+1, sizeof(char)); + while (fmt[i]) + { + str[j++] = fmt[i]; + if (fmt[i] >= '1' && fmt[i] <= '9') + { + if (fmt[i+1] >= '1' && fmt[i+1] <= '9') + str[j] = fmt[i+1]; + break; + } + i++; + } + return str; } return NULL; } @@ -751,20 +751,20 @@ _imf_event_commit_cb(void *data, int type, void *event) } if (focus_obj == wd->date[DATE_MON]) { - char *i18n_str; + char *i18n_str; wd->month = atoi(ev->str); - i18n_str = _get_i18n_string(data, ABMON_1+wd->month-1); - if (i18n_str) - { - elm_entry_entry_set(focus_obj, i18n_str); - free(i18n_str); - } + i18n_str = _get_i18n_string(data, ABMON_1+wd->month-1); + if (i18n_str) + { + elm_entry_entry_set(focus_obj, i18n_str); + free(i18n_str); + } } else { strcpy(str, elm_entry_entry_get(focus_obj)); str[strlen(str)] = ev->str[0]; - elm_entry_entry_set(focus_obj, str); + elm_entry_entry_set(focus_obj, str); } if (_check_input_done(data, focus_obj, strlen(str))) @@ -799,8 +799,8 @@ _date_update(Evas_Object *obj) i18n_str = _get_i18n_string(obj, ABMON_1+wd->month-1); if (i18n_str) { - elm_entry_entry_set(wd->date[DATE_MON], i18n_str); - free(i18n_str); + elm_entry_entry_set(wd->date[DATE_MON], i18n_str); + free(i18n_str); } sprintf(str, "%d", wd->day); @@ -813,30 +813,30 @@ _date_update(Evas_Object *obj) if (wd->hour >= HOUR_12H_MAXIMUM) { wd->pm = EINA_TRUE; - i18n_str = _get_i18n_string(obj, PM_STR); - if (i18n_str) - { - edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); - free(i18n_str); - } + i18n_str = _get_i18n_string(obj, PM_STR); + if (i18n_str) + { + edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); + free(i18n_str); + } } else { wd->pm = EINA_FALSE; - i18n_str = _get_i18n_string(obj, AM_STR); - if (i18n_str) - { - edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); - free(i18n_str); - } + i18n_str = _get_i18n_string(obj, AM_STR); + if (i18n_str) + { + edje_object_part_text_set(wd->base, "elm.text.ampm", i18n_str); + free(i18n_str); + } } if (wd->hour > HOUR_12H_MAXIMUM) - sprintf(str, "%02d", wd->hour - HOUR_12H_MAXIMUM); + sprintf(str, "%02d", wd->hour - HOUR_12H_MAXIMUM); else if (wd->hour == 0) - sprintf(str, "%02d", HOUR_12H_MAXIMUM); + sprintf(str, "%02d", HOUR_12H_MAXIMUM); else - sprintf(str, "%02d", wd->hour); + sprintf(str, "%02d", wd->hour); } elm_entry_entry_set(wd->time[TIME_HOUR], str); sprintf(str, "%02d", wd->min); @@ -1234,10 +1234,10 @@ elm_datefield_time_mode_set(Evas_Object *obj, Eina_Bool mode) if (wd->time_mode != mode) { - wd->time_mode = mode; - if (!wd->time_mode) edje_object_signal_emit(wd->base, "elm,state,mode,24h", "elm"); - else edje_object_signal_emit(wd->base, "elm,state,mode,12h", "elm"); - _date_update(obj); + wd->time_mode = mode; + if (!wd->time_mode) edje_object_signal_emit(wd->base, "elm,state,mode,24h", "elm"); + else edje_object_signal_emit(wd->base, "elm,state,mode,12h", "elm"); + _date_update(obj); } } diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c new file mode 100644 index 0000000..fe34ef9 --- /dev/null +++ b/src/lib/elm_diskselector.c @@ -0,0 +1,1543 @@ +/** + * @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 98b558f..4d049e9 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1,12 +1,10 @@ -/* - * 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 @@ -14,15 +12,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 @@ -67,9 +65,14 @@ * 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) @@ -92,29 +95,33 @@ 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; @@ -127,14 +134,18 @@ 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; @@ -142,12 +153,29 @@ 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; @@ -178,7 +206,6 @@ 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"; @@ -197,7 +224,6 @@ 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, ""}, @@ -245,34 +271,187 @@ _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; - Evas_Object *parent_obj = obj; - Evas_Object *above = NULL; + Elm_Entry_Text_Filter *tf; + + if (wd->file) eina_stringshare_del(wd->file); 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); @@ -294,6 +473,10 @@ _del_hook(Evas_Object *obj) { free(ip); } + EINA_LIST_FREE(wd->text_filters, tf) + { + free(tf); + } free(wd); } @@ -308,6 +491,9 @@ _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); @@ -349,7 +535,6 @@ _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; @@ -369,7 +554,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; @@ -432,35 +617,37 @@ _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); - } + 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); + } } } @@ -480,12 +667,19 @@ _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); - if (!wd) return NULL; - return edje_object_signal_callback_del(wd->ent, emission, source, func_cb); + 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); } static void @@ -525,7 +719,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); } @@ -539,7 +733,7 @@ _hover_del(void *data) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - + if (wd->hoversel) { evas_object_del(wd->hoversel); @@ -571,7 +765,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); @@ -617,7 +811,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 @@ -690,7 +884,6 @@ _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); } @@ -702,13 +895,6 @@ _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); @@ -800,6 +986,8 @@ _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 @@ -819,9 +1007,11 @@ _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 @@ -919,181 +1109,6 @@ _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) { @@ -1101,7 +1116,7 @@ _entry_length_get(Evas_Object *obj) const char *str = elm_entry_entry_get(obj); if (!str) return 0; - char *plain_str = _mkup_to_text(str); + char *plain_str = _elm_util_mkup_to_text(str); if (!plain_str) return 0; len = strlen(plain_str); @@ -1110,43 +1125,6 @@ _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__) { @@ -1158,6 +1136,13 @@ _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 @@ -1230,18 +1215,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(); } } @@ -1297,7 +1282,8 @@ _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 } @@ -1457,9 +1443,6 @@ _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 @@ -1478,7 +1461,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) || @@ -1491,7 +1474,7 @@ _event_selection_notify(void *data, int type __UNUSED__, void *event) { if (text_data->text) { - char *txt = _text_to_mkup(text_data->text); + char *txt = _elm_util_text_to_mkup(text_data->text); if (txt) { @@ -1511,7 +1494,7 @@ _event_selection_notify(void *data, int type __UNUSED__, void *event) { if (text_data->text) { - char *txt = _text_to_mkup(text_data->text); + char *txt = _elm_util_text_to_mkup(text_data->text); if (txt) { @@ -1565,6 +1548,7 @@ _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) { @@ -1574,13 +1558,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); @@ -1596,7 +1580,6 @@ _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) { @@ -1606,7 +1589,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) @@ -1622,9 +1605,7 @@ _get_item(void *data, Evas_Object *edje __UNUSED__, const char *part __UNUSED__, return o; } o = edje_object_add(evas_object_evas_get(data)); - if (!strncmp(item, "emoticon/", 9)) - ok = _elm_theme_object_set(data, o, "entry", item, elm_widget_style_get(data)); - if (!ok) + if (!_elm_theme_object_set(data, o, "entry", item, elm_widget_style_get(data))) _elm_theme_object_set(data, o, "entry/emoticon", "wtf", elm_widget_style_get(data)); return o; } @@ -2045,6 +2026,25 @@ 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,8 +2060,11 @@ 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); @@ -2072,12 +2075,16 @@ 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; @@ -2085,12 +2092,14 @@ 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, @@ -2267,7 +2276,6 @@ 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); } @@ -2317,34 +2325,6 @@ 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. @@ -2420,8 +2400,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); @@ -2446,8 +2426,13 @@ elm_entry_selection_get(const Evas_Object *obj) } /** - * This inserts text in @p entry at the beginning of the entry - * object. + * 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.) * * @param obj The entry object * @param entry The text to insert @@ -3032,7 +3017,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; - if (!func) 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; @@ -3058,7 +3043,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; - if (!func) 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; @@ -3086,7 +3071,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; - if (!func) return; + EINA_SAFETY_ON_NULL_RETURN(func); EINA_LIST_FOREACH(wd->item_providers, l, ip) { if ((ip->func == func) && (ip->data == data)) @@ -3099,6 +3084,106 @@ 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 @@ -3109,7 +3194,7 @@ elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *dat EAPI char * elm_entry_markup_to_utf8(const char *s) { - char *ss = _mkup_to_text(s); + char *ss = _elm_util_mkup_to_text(s); if (!ss) ss = strdup(""); return ss; } @@ -3125,7 +3210,7 @@ elm_entry_markup_to_utf8(const char *s) EAPI char * elm_entry_utf8_to_markup(const char *s) { - char *ss = _text_to_mkup(s); + char *ss = _elm_util_text_to_mkup(s); if (!ss) ss = strdup(""); return ss; } @@ -3363,6 +3448,270 @@ 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 @@ -3403,5 +3752,3 @@ 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 9b7c206..b224161 100644 --- a/src/lib/elm_flip.c +++ b/src/lib/elm_flip.c @@ -59,6 +59,22 @@ _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) { @@ -143,6 +159,7 @@ flip_show_hide(Evas_Object *obj) evas_object_hide(wd->back.clip); } } + static Eina_Bool _flip(Evas_Object *obj) { @@ -158,7 +175,6 @@ _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); @@ -166,9 +182,17 @@ _flip(Evas_Object *obj) evas_map_smooth_set(mb, 0); if (wd->front.content) - evas_map_util_points_populate_from_object_full(mf, wd->front.content, 0); + { + evas_object_geometry_get(wd->front.content, &x, &y, &w, &h); + evas_map_util_points_populate_from_geometry(mf, x, y, w, h, 0); + } if (wd->back.content) - evas_map_util_points_populate_from_object_full(mb, wd->back.content, 0); + { + 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); cx = x + (w / 2); cy = y + (h / 2); @@ -313,11 +337,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); @@ -382,8 +406,11 @@ 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"); @@ -391,14 +418,18 @@ 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); @@ -430,10 +461,14 @@ elm_flip_add(Evas_Object *parent) } /** - * Set the flip front content + * 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. * * @param obj The flip object - * @param content The content to be used in this flip object + * @param content The new front content object * * @ingroup Flip */ @@ -444,12 +479,7 @@ 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 != 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); - } + if (wd->front.content) evas_object_del(wd->back.content); wd->front.content = content; if (content) { @@ -461,15 +491,21 @@ 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 flip back content + * 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. * * @param obj The flip object - * @param content The content to be used in this flip object + * @param content The new back content object * * @ingroup Flip */ @@ -480,12 +516,7 @@ 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 != 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); - } + if (wd->back.content) evas_object_del(wd->back.content); wd->back.content = content; if (content) { @@ -497,15 +528,19 @@ 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 flip front content + * Get the front content used for the flip + * + * Return the front content object which is set for this widget. * * @param obj The flip object - * @return The content to be used in this flip object front + * @return The front content object that is being used * * @ingroup Flip */ @@ -517,11 +552,14 @@ elm_flip_content_front_get(const Evas_Object *obj) return wd->front.content; } + /** - * Get the flip back content + * Get the back content used for the flip + * + * Return the back content object which is set for this widget. * * @param obj The flip object - * @return The content to be used in this flip object back + * @return The back content object that is being used * * @ingroup Flip */ @@ -534,6 +572,56 @@ 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 @@ -582,6 +670,9 @@ 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 */ @@ -596,5 +687,15 @@ 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 new file mode 100644 index 0000000..3b783e8 --- /dev/null +++ b/src/lib/elm_flipselector.c @@ -0,0 +1,1158 @@ +#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 1e5cc17..5d4e601 100644 --- a/src/lib/elm_frame.c +++ b/src/lib/elm_frame.c @@ -15,6 +15,7 @@ struct _Widget_Data { Evas_Object *frm; Evas_Object *content; + const char *label; }; static const char *widtype = NULL; @@ -29,6 +30,7 @@ _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); } @@ -38,12 +40,28 @@ _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) { @@ -96,8 +114,11 @@ 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"); @@ -105,6 +126,8 @@ 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"); @@ -130,7 +153,8 @@ 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; - edje_object_part_text_set(wd->frm, "elm.text", label); + eina_stringshare_replace(&(wd->label), label); + edje_object_part_text_set(wd->frm, "elm.text", wd->label); _sizing_eval(obj); } @@ -148,8 +172,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) || (!wd->frm)) return NULL; - return edje_object_part_text_get(wd->frm, "elm.text"); + if (!wd) return NULL; + return wd->label; } /** @@ -184,6 +208,25 @@ 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 1cfbe32..0060898 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -1,45 +1,53 @@ #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. * - * drag,start,up - Called when the item in the Gengrid has been dragged (not - * scrolled) up. + * 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,down - Called when the item in the Gengrid has been dragged (not - * scrolled) down. + * changed - Called when an item is added, removed, resized or moved + * and when gengrid is resized or horizontal property changes. * - * drag,start,left - Called when the item in the Gengrid has been dragged (not - * scrolled) left. + * drag,start,up - Called when the item in the Gengrid has been + * dragged (not scrolled) up. * - * drag,start,right - Called when the item in the Gengrid has been dragged (not - * scrolled) right. + * drag,start,down - Called when the item in the Gengrid has been + * dragged (not scrolled) down. * - * drag,stop - Called when the item in the Gengrid has stopped being dragged. + * 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 - Called when the item in the Gengrid is being dragged. * @@ -50,86 +58,97 @@ * 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 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 + * 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 * 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_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. + * 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. * * -- * TODO: @@ -137,78 +156,498 @@ */ typedef struct _Widget_Data Widget_Data; -typedef struct _Pan Pan; +typedef struct _Pan Pan; #define PRELOAD 1 struct _Elm_Gengrid_Item { - Evas_Object *base, *spacer; + Elm_Widget_Item base; + EINA_INLIST; + Evas_Object *spacer; const Elm_Gengrid_Item_Class *gic; - Ecore_Timer *long_timer; - Widget_Data *wd; - Eina_List *labels, *icons, *states, *icon_objs; - const void *data; + Ecore_Timer *long_timer; + Widget_Data *wd; + Eina_List *labels, *icons, *states, *icon_objs; 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; - - 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; + 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; }; struct _Widget_Data { - 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; + 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; }; +#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 _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 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) { @@ -219,18 +658,38 @@ _theme_hook(Evas_Object *obj) } static void -_del_hook(Evas_Object *obj) +_del_pre_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 -_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +_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) { Elm_Gengrid_Item *item = data; Evas_Event_Mouse_Move *ev = event_info; @@ -238,31 +697,31 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf 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); @@ -279,41 +738,41 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf 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); + } + } } } @@ -330,7 +789,10 @@ _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; @@ -351,13 +813,17 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf 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; @@ -369,59 +835,59 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * 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); } } @@ -429,7 +895,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, "elm,state,selected", "elm"); + edje_object_signal_emit(item->base.view, "elm,state,selected", "elm"); item->hilighted = EINA_TRUE; } @@ -440,103 +906,120 @@ _item_realize(Elm_Gengrid_Item *item) char style[1024]; if ((item->realized) || (item->delete_me)) return; - 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); + 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); snprintf(style, sizeof(style), "item/%s", - item->gic->item_style ? item->gic->item_style : "default"); - _elm_theme_object_set(item->wd->self, item->base, "gengrid", style, + item->gic->item_style ? item->gic->item_style : "default"); + _elm_theme_object_set(item->wd->self, item->base.view, "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, "elm.swallow.pad", item->spacer); + edje_object_part_swallow(item->base.view, "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, - "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); - } - } + 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); + } + } } 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, - "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); - } - } + 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); + } + } } 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, - "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"); - } - } + 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"); + } + } } if ((!item->wd->item_width) && (!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); + 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); } - 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); + 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); if (item->selected) - edje_object_signal_emit(item->base, "elm,state,selected", "elm"); + edje_object_signal_emit(item->base.view, "elm,state,selected", "elm"); if (item->disabled) - edje_object_signal_emit(item->base, "elm,state,disabled", "elm"); + 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); - evas_object_show(item->base); item->realized = EINA_TRUE; item->want_unrealize = EINA_FALSE; } @@ -549,11 +1032,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); - item->base = NULL; + evas_object_del(item->base.view); + item->base.view = NULL; evas_object_del(item->spacer); item->spacer = NULL; elm_widget_stringlist_free(item->labels); @@ -561,17 +1044,19 @@ _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; @@ -579,8 +1064,6 @@ _item_place(Elm_Gengrid_Item *item, Evas_Coord cx, Evas_Coord cy) 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; @@ -588,86 +1071,116 @@ _item_place(Elm_Gengrid_Item *item, Evas_Coord cx, Evas_Coord cy) cvw = vw + 2 * PRELOAD * item->wd->item_width; cvh = vh + 2 * PRELOAD * item->wd->item_height; - tch = ((vh/item->wd->item_height)*item->wd->item_height); - alignh = (vh - tch)*item->wd->align_y; - - tcw = ((vw/item->wd->item_width)*item->wd->item_width); - alignw = (vw - tcw)*item->wd->align_x; + alignh = 0; + alignw = 0; - if ((item->wd->horizontal) && (item->wd->minw < vw)) + if (item->wd->horizontal) { - int columns; + int columns, items_visible = 0, items_row; - 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++; + if (item->wd->item_height > 0) + items_visible = vh / item->wd->item_height; + if (items_visible < 1) + items_visible = 1; + + columns = item->wd->count / items_visible; + if (item->wd->count % items_visible) + columns++; tcw = item->wd->item_width * columns; - alignw = (vw - tcw)*item->wd->align_x; + 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; } - else if ((item->wd->horizontal) && (item->wd->minw > vw)) - alignw = 0; - if ((!item->wd->horizontal) && (item->wd->minh < vh)) + else { - int rows; + 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; - 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++; + rows = item->wd->count / items_visible; + if (item->wd->count % items_visible) + rows++; tch = item->wd->item_height * rows; - alignh = (vh - tch)*item->wd->align_y; + 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; } - 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)) { - 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); + _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); } else - _item_unrealize(item); + { + _item_unrealize(item); + if (was_realized) + evas_object_smart_callback_call(item->wd->self, "unrealized", 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 = calloc(1, sizeof(*item)); + item = elm_widget_item_new(wd->self, Elm_Gengrid_Item); if (!item) return NULL; + wd->count++; item->wd = wd; item->gic = gic; - item->data = data; + item->base.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(item->data, item->wd->self); + item->gic->func.del((void *)item->base.data, item->wd->self); item->delete_me = EINA_TRUE; - item->wd->items = eina_list_remove(item->wd->items, item); + item->wd->items = eina_inlist_remove(item->wd->items, EINA_INLIST_GET(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); - free(item); + elm_widget_item_del(item); } static void @@ -676,33 +1189,41 @@ _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++; - if (item->func.func) + item->wd->walking++; + 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--; - if ((item->walking == 0) && (item->delete_me)) - if (item->relcount == 0) _item_del(item); + 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; } static void _item_unselect(Elm_Gengrid_Item *item) { if ((item->delete_me) || (!item->hilighted)) return; - edje_object_signal_emit(item->base, "elm,state,unselected", "elm"); + edje_object_signal_emit(item->base.view, "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); } } @@ -714,31 +1235,31 @@ _calc_job(void *data) int count; evas_object_geometry_get(wd->pan_smart, NULL, NULL, &cvw, &cvh); - if ((wd->horizontal) && (wd->item_height)) + if ((wd->horizontal) && (wd->item_height > 0)) nmax = cvh / wd->item_height; - else if (wd->item_width) + else if (wd->item_width > 0) nmax = cvw / wd->item_width; - if (nmax) + if (nmax < 1) + nmax = 1; + + count = wd->count; + if (wd->horizontal) { - 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; - } + 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; @@ -771,7 +1292,9 @@ _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; @@ -781,7 +1304,9 @@ _pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) } 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; @@ -789,7 +1314,9 @@ _pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) } 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; @@ -797,7 +1324,9 @@ _pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) } 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; @@ -811,7 +1340,25 @@ _pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) } static void -_pan_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) +_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 *sd = evas_object_smart_data_get(obj); Evas_Coord ow, oh; @@ -827,30 +1374,32 @@ _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_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++; - } - } + 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); } 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; @@ -859,7 +1408,9 @@ _pan_move(Evas_Object *obj, Evas_Coord x __UNUSED__, Evas_Coord y __UNUSED__) } 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; @@ -867,7 +1418,9 @@ _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__) +_hold_off(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -875,7 +1428,9 @@ _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__) +_freeze_on(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -883,7 +1438,9 @@ _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__) +_freeze_off(void *data __UNUSED__, + Evas_Object *obj, + void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -891,19 +1448,25 @@ _freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __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); } @@ -925,37 +1488,46 @@ _scr_scroll(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__ 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, 1, 1); + elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce); 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); @@ -964,29 +1536,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_child_size_get); + _pan_set, _pan_get, _pan_max_get, + _pan_min_get, _pan_child_size_get); return obj; } @@ -1003,7 +1575,9 @@ 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); @@ -1027,7 +1601,9 @@ elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) * @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); @@ -1048,7 +1624,9 @@ elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) * @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); @@ -1078,13 +1656,14 @@ elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y) * @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 (!wd) return; - 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 (align_x) *align_x = wd->align_x; + if (align_y) *align_y = wd->align_y; } /** @@ -1097,14 +1676,19 @@ elm_gengrid_align_get(const Evas_Object *obj, double *align_x, double *align_y) * @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; @@ -1113,9 +1697,48 @@ elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, item = _item_create(wd, gic, data, func, func_data); if (!item) return NULL; + wd->items = eina_inlist_append(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); + + 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)); if (wd->calc_job) ecore_job_del(wd->calc_job); wd->calc_job = ecore_job_add(_calc_job, wd); @@ -1124,43 +1747,92 @@ elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, } /** - * Prepend item at start of the Gengrid + * Insert and item before another in the Gengrid. * - * This adds an item to the beginning of the list or beginning of the children - * of the parent if given. + * This inserts an item before 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 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_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, - const void *data, Evas_Smart_Cb func, - const void *func_data) +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 *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_list_prepend(wd->items, item); - wd->no_select = EINA_FALSE; - + wd->items = eina_inlist_append_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; } @@ -1177,15 +1849,16 @@ elm_gengrid_item_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, EAPI void elm_gengrid_item_del(Elm_Gengrid_Item *item) { - if (!item) return; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); if ((item->relcount > 0) || (item->walking > 0)) { - 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->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_del(item); @@ -1195,13 +1868,14 @@ 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); @@ -1228,37 +1902,49 @@ elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting) 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; } - EINA_LIST_FOREACH_SAFE(wd->items, l, l_next, item) + if (wd->walking > 0) { - 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); + 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 (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); } @@ -1266,12 +1952,13 @@ 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. @@ -1281,17 +1968,39 @@ elm_gengrid_clear(Evas_Object *obj) * @ingroup Gengrid */ EAPI const Evas_Object * -elm_gengrid_item_object_get(Elm_Gengrid_Item *item) +elm_gengrid_item_object_get(const Elm_Gengrid_Item *item) { - if (!item) return NULL; - return item->base; + 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); } /** * 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. @@ -1302,10 +2011,32 @@ elm_gengrid_item_object_get(Elm_Gengrid_Item *item) * @ingroup Gengrid */ EAPI void * -elm_gengrid_item_data_get(Elm_Gengrid_Item *item) +elm_gengrid_item_data_get(const Elm_Gengrid_Item *item) { - if (!item) return NULL; - return (void *)item->data; + 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_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_data_set(item, data); + elm_gengrid_item_update(item); } /** @@ -1320,9 +2051,11 @@ elm_gengrid_item_data_get(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) { - if (!item) return; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); if (x) *x = item->x; if (y) *y = item->y; } @@ -1330,8 +2063,8 @@ elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, unsigned int *x, unsigned /** * 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 @@ -1339,7 +2072,8 @@ elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, unsigned int *x, unsigned * @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); @@ -1368,9 +2102,10 @@ 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. * @@ -1392,9 +2127,10 @@ 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. @@ -1413,8 +2149,9 @@ 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. @@ -1422,9 +2159,11 @@ 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) { - Widget_Data *wd = elm_widget_data_get(item->wd->self); + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + Widget_Data *wd = item->wd; if (!wd) return; if ((!item) || (item->delete_me)) return; selected = !!selected; @@ -1432,13 +2171,13 @@ elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, Eina_Bool selected) 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); @@ -1457,16 +2196,16 @@ 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) { - if (!item) return EINA_FALSE; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, 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 @@ -1474,18 +2213,19 @@ 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) { - if (!item) return; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); 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, "elm,state,disabled", "elm"); - else - edje_object_signal_emit(item->base, "elm,state,enabled", "elm"); + 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"); } } @@ -1502,26 +2242,320 @@ 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) { - if (!item) return EINA_FALSE; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, 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); @@ -1549,8 +2583,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) @@ -1558,7 +2592,8 @@ 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); @@ -1586,8 +2621,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 @@ -1596,7 +2631,9 @@ 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); @@ -1614,7 +2651,9 @@ elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) * @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); @@ -1633,37 +2672,233 @@ elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v * * @ingroup Gengrid */ -EAPI const Eina_List * -elm_gengrid_items_get(const Evas_Object *obj) + +/** + * 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; - return wd->items; + 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; } /** - * 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 - * + * 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) +{ + 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; +} + +/** + * 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 + * * @ingroup Gengrid */ EAPI void -elm_gengrid_item_update(Elm_Gengrid_Item *item) +elm_gengrid_item_show(Elm_Gengrid_Item *item) { - if (item->realized) - { - _item_unrealize(item); - _item_realize(item); - evas_object_smart_callback_call(item->wd->self, "realized", 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 (item->wd->calc_job) ecore_job_del(item->wd->calc_job); - item->wd->calc_job = ecore_job_add(_calc_job, item->wd); - } + if (!wd) return; + if ((!item) || (item->delete_me)) return; + _pan_min_get(wd->pan_smart, &minx, &miny); + + 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); } +/** + * 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 a5b10aa..5032977 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_Inlist *group_items; + Eina_List *group_items; Eina_List *menuopened; int edit_mode; int select_all_minh; @@ -389,6 +389,7 @@ 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; @@ -399,16 +400,19 @@ 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; @@ -436,7 +440,6 @@ 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; @@ -451,33 +454,6 @@ 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); @@ -486,8 +462,6 @@ 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); @@ -500,6 +474,7 @@ 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; @@ -528,14 +503,9 @@ _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; @@ -692,6 +662,8 @@ _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) { @@ -1382,189 +1354,6 @@ _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; @@ -1592,7 +1381,10 @@ _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) depth += 1; + for (it2 = it, depth = 0; it2->parent; it2 = it2->parent) + { + if (it2->parent->flags != ELM_GENLIST_ITEM_GROUP) depth += 1; + } it->expanded_depth = depth; treesize = edje_object_data_get(it->base, "treesize"); if (treesize) tsize = atoi(treesize); @@ -1743,8 +1535,6 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) it->realized = EINA_TRUE; it->want_unrealize = EINA_FALSE; - if (it->group_item) - _groupitem_realize(it, calc); if (ELM_GENLIST_EDIT_MODE_NONE != it->wd->edit_mode) { Evas_Object *icon; @@ -1799,7 +1589,6 @@ _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) @@ -1837,17 +1626,7 @@ _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; @@ -1891,14 +1670,17 @@ _item_block_unrealize(Item_Block *itb) if (!itb->realized) return; EINA_LIST_FOREACH(itb->items, l, it) { - if (it->dragging || it->reordering) - { - dragging = 1; - it->want_unrealize = EINA_TRUE; - } - else - _item_unrealize(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 (!dragging) { itb->realized = EINA_FALSE; @@ -1909,6 +1691,40 @@ _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; @@ -1916,7 +1732,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_GroupItem *git = NULL; + Elm_Genlist_Item *git = NULL; Elm_Genlist_Item *select_all_item = NULL; evas_object_geometry_get(itb->wd->pan_smart, &ox, &oy, &ow, &oh); @@ -1945,79 +1761,37 @@ _item_block_position(Item_Block *itb, int in) it->x = 0; it->y = y; it->w = itb->w; - 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)) + 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) { - if (vis) + if ((itb->realized) && (!it->realized)) { - 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 (vis) _item_realize(it, in, 0); } - } + if (it->realized) { _notify_item_position(it); - 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; - } + 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); - } is_reorder = _get_space_for_reorder_item(it); @@ -2063,10 +1837,15 @@ _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 && @@ -2074,11 +1853,7 @@ _item_block_position(Item_Block *itb, int in) evas_object_raise(select_all_item->base); if (vis) - { - itb->wd->animate_edit_controls = 0; - if (git) - git->visible = EINA_TRUE; - } + itb->wd->animate_edit_controls = 0; } static void @@ -2283,7 +2058,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_GroupItem *git; + Elm_Genlist_Item *git; EINA_INLIST_FOREACH(sd->wd->group_items, git) { @@ -2315,6 +2090,15 @@ _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); @@ -2383,7 +2167,8 @@ _pan_calculate(Evas_Object *obj) Item_Block *itb; Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh; int in = 0; - Elm_Genlist_GroupItem *git; + Elm_Genlist_Item *git; + Eina_List *l; evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); if (sd->wd->pinchzoom_effect_mode == ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_EXPAND) return; @@ -2393,9 +2178,8 @@ _pan_calculate(Evas_Object *obj) { sd->wd->group_items_moved = EINA_TRUE; sd->wd->contract_pan_y = sd->wd->pan_y; - EINA_INLIST_FOREACH(sd->wd->group_items, git) + EINA_LIST_FOREACH(sd->wd->group_items, l, 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); @@ -2407,9 +2191,10 @@ _pan_calculate(Evas_Object *obj) if (sd->wd->edit_mode != ELM_GENLIST_EDIT_MODE_NONE) (void)_edit_mode_reset(sd->wd); - EINA_INLIST_FOREACH(sd->wd->group_items, git) + + EINA_LIST_FOREACH(sd->wd->group_items, l, git) { - git->visible = EINA_FALSE; + git->want_realize = EINA_FALSE; } evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh); @@ -2441,29 +2226,15 @@ _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 @@ -2612,8 +2383,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_child_size_get); + _pan_set, _pan_get, _pan_max_get, + _pan_min_get, _pan_child_size_get); edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh); @@ -2906,14 +2677,16 @@ 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 { @@ -2922,13 +2695,18 @@ 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 = 0; + it->before = EINA_FALSE; _item_queue(wd, it); return it; } @@ -2951,24 +2729,46 @@ 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 { - printf("FIXME: 12 tree not handled yet\n"); + 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; } - it->rel = NULL; - it->before = 1; + it->before = EINA_TRUE; _item_queue(wd, it); return it; } @@ -2982,6 +2782,7 @@ elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, * @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 @@ -2991,27 +2792,43 @@ elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, * @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 *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 *parent, + 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, NULL, 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) - wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(before)); + { + if ((flags & ELM_GENLIST_ITEM_GROUP) && + (before->flags & ELM_GENLIST_ITEM_GROUP)) + wd->group_items = eina_list_prepend_relative(wd->group_items, it, + before); + } else { - printf("FIXME: 13 tree not handled yet\n"); + 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; } + wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(before)); it->rel = before; it->rel->relcount++; - it->before = 1; + it->before = EINA_TRUE; _item_queue(wd, it); return it; } @@ -3025,6 +2842,7 @@ elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *i * @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 @@ -3034,27 +2852,43 @@ elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *i * @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 *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 *parent, + 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, NULL, 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) - wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), - EINA_INLIST_GET(after)); - else { - printf("FIXME: 14 tree not handled yet\n"); + 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; + } + wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), + EINA_INLIST_GET(after)); it->rel = after; it->rel->relcount++; - it->before = 0; + it->before = EINA_FALSE; _item_queue(wd, it); return it; } @@ -3079,7 +2913,7 @@ elm_genlist_clear(Evas_Object *obj) 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_freeze_momentum_animator_set(wd->scr, 0); + elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_FALSE); elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_TRUE); wd->max_git_num = 0; wd->pinch_zoom_reserve = EINA_FALSE; @@ -3090,10 +2924,6 @@ elm_genlist_clear(Evas_Object *obj) wd->item_moving_effect_timer = NULL; } - while (wd->group_items) - { - _groupitem_remove((Elm_Genlist_GroupItem *)wd->group_items, EINA_FALSE); - } if (wd->walking > 0) { @@ -3115,6 +2945,8 @@ 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) @@ -3728,6 +3560,7 @@ 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; @@ -3740,9 +3573,11 @@ 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, + it->y + it->block->y - gith, it->block->w, it->h); } @@ -3762,6 +3597,7 @@ 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; @@ -3774,9 +3610,11 @@ 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, + it->y + it->block->y - gith, it->block->w, it->h); } @@ -3795,6 +3633,7 @@ 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)) @@ -3810,10 +3649,12 @@ 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, + it->y + it->block->y - gith, it->block->w, oh); + } /** @@ -3832,6 +3673,7 @@ 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)) @@ -3847,10 +3689,12 @@ 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, + it->y + it->block->y - gith, it->block->w, oh); + } /** @@ -4427,7 +4271,7 @@ _group_item_contract_moving_effect_timer_cb(void *data) Widget_Data *wd = elm_widget_data_get(obj); Item_Block *itb = NULL; - Elm_Genlist_GroupItem *git; + Elm_Genlist_Item *git; Elm_Genlist_Item *it; const Eina_List *l; int cnt = 0, git_count = 0; @@ -4479,7 +4323,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) @@ -4573,7 +4417,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_freeze_momentum_animator_set(wd->scr, 0); + elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_FALSE); elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_TRUE); // fprintf(stderr,"ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT FINISH \n"); @@ -4613,7 +4457,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_GroupItem *git, *tmp_git; + Elm_Genlist_Item *git, *tmp_git; Item_Block *itb = NULL; Elm_Genlist_Item *it; const Eina_List *l; @@ -4850,7 +4694,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_freeze_momentum_animator_set(wd->scr, 0); + elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_FALSE); 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); @@ -4885,7 +4729,7 @@ _item_pinch_recalc(Evas_Object *obj, int emode) { wd->pinchzoom_effect_mode = ELM_GENLIST_ITEM_PINCHZOOM_EFFECT_CONTRACT; - elm_smart_scroller_freeze_momentum_animator_set(wd->scr, 1); + elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_TRUE); elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_FALSE); evas_object_raise(wd->alpha_bg); evas_object_show(wd->alpha_bg); @@ -4896,7 +4740,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_freeze_momentum_animator_set(wd->scr, 1); + elm_smart_scroller_momentum_animator_disabled_set(wd->scr, EINA_TRUE); evas_object_raise(wd->alpha_bg); evas_object_show(wd->alpha_bg); @@ -5301,31 +5145,6 @@ 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) { @@ -5874,196 +5693,6 @@ _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 @@ -6196,10 +5825,13 @@ 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) @@ -6529,3 +6161,61 @@ 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 22cc80e..d6efcca 100644 --- a/src/lib/elm_hover.c +++ b/src/lib/elm_hover.c @@ -5,28 +5,60 @@ * @defgroup Hover Hover * @ingroup Elementary * - * 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. + * 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). * - * 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 _Subinfo Subinfo; +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; +}; struct _Widget_Data { Evas_Object *hov, *cov; Evas_Object *offset, *size; Evas_Object *parent, *target; - Eina_List *subs; -}; - -struct _Subinfo -{ - const char *swallow; - Evas_Object *obj; + Evas_Object *smt_sub; + Content_Info subs[sizeof(_directions)/sizeof(_directions[0])]; }; static const char *widtype = NULL; @@ -41,27 +73,33 @@ 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); - Subinfo *si; - if (!wd) return; + if (!wd) + return; + if (evas_object_visible_get(obj)) - evas_object_smart_callback_call(obj, "clicked", NULL); + evas_object_smart_callback_call(obj, SIG_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 @@ -73,19 +111,99 @@ _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 doesnt seem to propagate resizes properly + // FIXME: hover contents doesn't 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); - _reval_content(obj); + + if (wd->smt_sub) + _elm_hover_sub_obj_placement_eval(obj); + else + _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) @@ -107,30 +225,110 @@ static void _reval_content(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - 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); + 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; } 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; - Eina_List *l; - Subinfo *si; - if (!wd) return; - EINA_LIST_FOREACH(wd->subs, l, si) + Widget_Data *wd; + Evas_Object *sub; + + sub = event_info; + wd = elm_widget_data_get(obj); + if (!wd) + return; + + if (wd->smt_sub) { - if (si->obj == sub) - { - wd->subs = eina_list_remove_list(wd->subs, l); - eina_stringshare_del(si->swallow); - free(si); - break; - } + if (wd->smt_sub == sub) + wd->smt_sub = NULL; + } + else + { + ELM_HOVER_PARTS_FOREACH + { + if (wd->subs[i].obj == sub) + { + wd->subs[i].obj = NULL; + break; + } + } } } @@ -138,22 +336,23 @@ static void _hov_show_do(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - const Eina_List *l; - const Subinfo *si; - if (!wd) return; + if (!wd) + return; + if (wd->cov) { evas_object_show(wd->cov); edje_object_signal_emit(wd->cov, "elm,action,show", "elm"); } - EINA_LIST_FOREACH(wd->subs, l, si) + + ELM_HOVER_PARTS_FOREACH { char buf[1024]; - if (!strncmp(si->swallow, "elm.swallow.slot.", 17)) + if (wd->subs[i].obj) { snprintf(buf, sizeof(buf), "elm,action,slot,%s,show", - si->swallow + 17); + wd->subs[i].swallow); edje_object_signal_emit(wd->cov, buf, "elm"); } } @@ -181,22 +380,21 @@ 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); } - EINA_LIST_FOREACH(wd->subs, l, si) + + ELM_HOVER_PARTS_FOREACH { char buf[1024]; - if (!strncmp(si->swallow, "elm.swallow.slot.", 17)) + if (wd->subs[i].obj) { snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide", - si->swallow + 17); + wd->subs[i].swallow); edje_object_signal_emit(wd->cov, buf, "elm"); } } @@ -211,12 +409,23 @@ _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, "clicked", NULL); + evas_object_smart_callback_call(data, SIG_CLICKED, NULL); } static void @@ -268,19 +477,31 @@ 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, 1); + evas_object_pass_events_set(wd->hov, EINA_TRUE); 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); @@ -295,12 +516,12 @@ elm_hover_add(Evas_Object *parent) _signal_dismiss, obj); wd->offset = evas_object_rectangle_add(e); - evas_object_pass_events_set(wd->offset, 1); + evas_object_pass_events_set(wd->offset, EINA_TRUE); 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, 1); + evas_object_pass_events_set(wd->size, EINA_TRUE); evas_object_color_set(wd->size, 0, 0, 0, 0); elm_widget_sub_object_add(obj, wd->size); @@ -310,6 +531,7 @@ 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; @@ -331,13 +553,19 @@ 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_DEL, + _target_del, obj); + evas_object_event_callback_del_full(wd->target, EVAS_CALLBACK_MOVE, + _target_move, 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); } @@ -394,11 +622,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(Evas_Object *obj) +elm_hover_target_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); @@ -416,7 +644,7 @@ elm_hover_target_get(Evas_Object *obj) * @ingroup Hover */ EAPI Evas_Object * -elm_hover_parent_get(Evas_Object *obj) +elm_hover_parent_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); @@ -425,94 +653,251 @@ elm_hover_parent_get(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, a previously set one 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 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. * * @param obj The hover object - * @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 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 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 = 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) + + Widget_Data *wd; + + wd = elm_widget_data_get(obj); + if (!wd) + return; + + if (!strcmp(swallow, "smart")) { - if (!strcmp(buf, si->swallow)) + 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 + { + if (!strcmp(swallow, wd->subs[i].swallow)) { - if (content == si->obj) return; - evas_object_del(si->obj); - si->obj = NULL; + 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; + } break; } } - 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); - } + + end: _sizing_eval(obj); } /** - * Unset the content of the hover object + * Get the content of the hover object, in a given direction. * - * Unparent and return the content object which was set for this widget + * Return the content object which was set for this widget in the + * given direction. * * @param obj The hover object - * @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 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_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 = 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) + + Widget_Data *wd; + + wd = elm_widget_data_get(obj); + if (!wd) + return NULL; + + if (!strcmp(swallow, "smart")) { - if (!strcmp(buf, si->swallow)) + 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 + { + if (!strcmp(swallow, wd->subs[i].swallow)) { Evas_Object *content; - 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; + + 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; + return content; } } + return NULL; } @@ -520,46 +905,54 @@ 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 - * @return The edje location to place content into the hover. - * See also elm_hover_content_set() + * @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(). * * @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) "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; + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Evas_Coord spc_l, spc_r, spc_t, 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; + 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 (pref_axis == ELM_HOVER_AXIS_HORIZONTAL) { - if (spc_l < spc_r) return "right"; - else return "left"; + if (spc_l < spc_r) return _HOV_RIGHT; + else return _HOV_LEFT; } else if (pref_axis == ELM_HOVER_AXIS_VERTICAL) { - if (spc_t < spc_b) return "bottom"; - else return "top"; + if (spc_t < spc_b) return _HOV_BOTTOM; + else return _HOV_TOP; } + if (spc_l < spc_r) { - 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_RIGHT; } - if (spc_t > spc_r) return "top"; - else if (spc_b > spc_r) return "bottom"; - return "left"; + if (spc_t > spc_r) return _HOV_TOP; + else if (spc_b > spc_r) return _HOV_BOTTOM; + return _HOV_LEFT; } diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c index d88b30a..44f891d 100644 --- a/src/lib/elm_icon.c +++ b/src/lib/elm_icon.c @@ -1,6 +1,11 @@ #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 @@ -9,9 +14,9 @@ * 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 */ @@ -21,6 +26,13 @@ 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; @@ -34,6 +46,25 @@ 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) { @@ -55,6 +86,40 @@ _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); @@ -63,6 +128,17 @@ _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); @@ -111,8 +187,11 @@ 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"); @@ -121,11 +200,15 @@ 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, 1); + evas_object_repeat_events_set(wd->img, EINA_TRUE); elm_widget_resize_object_set(obj, wd->img); wd->smooth = EINA_TRUE; @@ -143,7 +226,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 = sucess, 0 = error) + * @return (1 = success, 0 = error) * * @ingroup Icon */ @@ -155,7 +238,8 @@ elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) Eina_Bool ret; const char *p; - if ((!wd) || (!file)) return EINA_FALSE; + if (!wd) return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); if (wd->stdicon) eina_stringshare_del(wd->stdicon); wd->stdicon = NULL; if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj"))) @@ -167,12 +251,114 @@ elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) } /** - * Set the theme, as standard, for a icon + * 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. * * @param obj The icon object * @param name The theme name * - * @return (1 = sucess, 0 = error) + * @return (1 = success, 0 = error) * * @ingroup Icon */ @@ -181,13 +367,99 @@ 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; - eina_stringshare_replace(&wd->stdicon, name); - ret = _elm_theme_object_icon_set(obj, wd->img, name, "default"); - _sizing_eval(obj); - return ret; + + /* 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; } /** @@ -211,7 +483,25 @@ elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth) } /** - * Set if the object are scalable + * 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 * * @param obj The icon object * @param no_scale A bool to set scale (or no) @@ -231,6 +521,23 @@ 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 @@ -252,6 +559,25 @@ 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 @@ -271,6 +597,23 @@ 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 @@ -290,4 +633,20 @@ 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 a32e8e5..5100e64 100644 --- a/src/lib/elm_image.c +++ b/src/lib/elm_image.c @@ -115,8 +115,11 @@ 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"); @@ -125,12 +128,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, 0); + elm_widget_can_focus_set(obj, EINA_FALSE); 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, 1); + evas_object_repeat_events_set(wd->img, EINA_TRUE); elm_widget_resize_object_set(obj, wd->img); wd->smooth = EINA_TRUE; @@ -162,7 +165,8 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group) Eina_Bool ret; const char *p; - if ((!wd) || (!file)) return EINA_FALSE; + if (!wd) return EINA_FALSE; + EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj"))) ret = _els_smart_icon_file_edje_set(wd->img, file, group); else @@ -172,6 +176,24 @@ 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 @@ -192,6 +214,24 @@ 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. @@ -234,6 +274,23 @@ 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 @@ -255,6 +312,25 @@ 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 @@ -275,6 +351,24 @@ 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 @@ -293,6 +387,24 @@ 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 @@ -315,6 +427,27 @@ 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 @@ -329,9 +462,27 @@ 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_layout.c b/src/lib/elm_layout.c index c32437d..d3f483a 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -1,7 +1,3 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ - #include #include "elm_priv.h" @@ -17,39 +13,78 @@ 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 *swallow; + 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 +{ 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(Evas_Object *obj); +static void _sizing_eval(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 _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->swallow); + eina_stringshare_del(si->part); + if (si->type == TEXT) + eina_stringshare_del(si->p.text.text); free(si); } + EINA_LIST_FREE(wd->parts_cursors, pc) _part_cursor_free(pc); free(wd); } @@ -61,8 +96,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(obj); + _elm_config->scale); + _sizing_eval(wd); } static void @@ -72,30 +107,147 @@ _changed_hook(Evas_Object *obj) if (!wd) return; if (wd->needs_size_calc) { - _sizing_eval(obj); + _sizing_eval(wd); wd->needs_size_calc = 0; } } static void -_sizing_eval(Evas_Object *obj) +_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) { 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(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); + evas_object_size_hint_min_set(wd->obj, minw, minh); + evas_object_size_hint_max_set(wd->obj, -1, -1); } static void -_request_sizing_eval(Evas_Object *obj) +_request_sizing_eval(Widget_Data *wd) { - 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(obj); + 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); + } } static void @@ -117,11 +269,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, - obj); + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, + wd); wd->subs = eina_list_remove_list(wd->subs, l); - eina_stringshare_del(si->swallow); + eina_stringshare_del(si->part); free(si); break; } @@ -134,6 +286,19 @@ _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 * @@ -149,9 +314,12 @@ 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); - obj = elm_widget_add(e); + if (!e) return NULL; + wd->obj = obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "layout"); elm_widget_type_set(obj, "layout"); elm_widget_sub_object_add(parent, obj); @@ -159,15 +327,20 @@ 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, obj); - + _signal_size_eval, wd); + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - _request_sizing_eval(obj); + _request_sizing_eval(wd); return obj; } @@ -178,7 +351,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 = sucess, 0 = error) + * @return (1 = success, 0 = error) * * @ingroup Layout */ @@ -189,7 +362,15 @@ 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) _request_sizing_eval(obj); + 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))); return ret; } @@ -201,7 +382,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 = sucess, 0 = error) + * @return (1 = success, 0 = error) * * @ingroup Layout */ @@ -215,7 +396,12 @@ 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) _request_sizing_eval(obj); + if (ret) + { + _parts_text_fix(wd); + _request_sizing_eval(wd); + _parts_cursors_apply(wd); + } return ret; } @@ -242,7 +428,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 (!strcmp(swallow, si->swallow)) + if ((si->type == SWALLOW) && (!strcmp(swallow, si->part))) { if (content == si->obj) return; evas_object_del(si->obj); @@ -253,15 +439,43 @@ 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, obj); - edje_object_part_swallow(wd->lay, swallow, 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); si = ELM_NEW(Subinfo); - si->swallow = eina_stringshare_add(swallow); + si->type = SWALLOW; + si->part = eina_stringshare_add(swallow); si->obj = content; wd->subs = eina_list_append(wd->subs, si); } - _request_sizing_eval(obj); + _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; } /** @@ -285,7 +499,7 @@ elm_layout_content_unset(Evas_Object *obj, const char *swallow) if (!wd) return NULL; EINA_LIST_FOREACH(wd->subs, l, si) { - if (!strcmp(swallow, si->swallow)) + if ((si->type == SWALLOW) && (!strcmp(swallow, si->part))) { Evas_Object *content; if (!si->obj) return NULL; @@ -299,6 +513,472 @@ 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 @@ -307,7 +987,7 @@ elm_layout_content_unset(Evas_Object *obj, const char *swallow) * 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 singal callbacks etc. + * hooking to signal callbacks etc. * * @return A Evas_Object with the edje layout settings loaded * with function elm_layout_file_set @@ -324,7 +1004,7 @@ elm_layout_edje_get(const Evas_Object *obj) } /** - * Get the edje layout + * Eval sizing * * Manually forms a sizing re-evaluation when contents changed state so that * minimum size might have changed and needs re-evaluation. Also note that @@ -339,5 +1019,224 @@ EAPI void elm_layout_sizing_eval(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype); - _request_sizing_eval(obj); + 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); } diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index 39af398..fa5d289 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -1,6 +1,8 @@ #include #include "elm_priv.h" +#define SWIPE_MOVES 12 + /** * @defgroup List List * @ingroup Elementary @@ -15,9 +17,19 @@ 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; @@ -28,15 +40,16 @@ 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; @@ -51,63 +64,301 @@ 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, ...) \ - if (!it) \ - { \ - fprintf(stderr, "ERROR: %s:%d:%s() "#it" is NULL.\n", \ - __FILE__, __LINE__, __FUNCTION__); \ - return __VA_ARGS__; \ - } \ - else if (it->deleted) \ + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \ + if (it->deleted) \ { \ - fprintf(stderr, "ERROR: %s:%d:%s() "#it" has been DELETED.\n", \ - __FILE__, __LINE__, __FUNCTION__); \ + ERR("ERROR: "#it" has been DELETED.\n"); \ 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, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it); + (it->base.view, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it); evas_object_event_callback_del_full - (it->base, EVAS_CALLBACK_MOUSE_UP, _mouse_up, it); + (it->base.view, EVAS_CALLBACK_MOUSE_UP, _mouse_up, it); evas_object_event_callback_del_full - (it->base, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it); + (it->base.view, 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->obj); + _changed_size_hints, it->base.widget); if (it->end) evas_object_event_callback_del_full (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, it->obj); + _changed_size_hints, it->base.widget); 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); - if (it->base) evas_object_del(it->base); - free(it); + + 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; } static void @@ -119,10 +370,10 @@ _elm_list_process_deletions(Widget_Data *wd) EINA_LIST_FREE(wd->to_delete, it) { - _elm_list_item_call_del_cb(it); + elm_widget_item_pre_notify_del(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--; @@ -133,7 +384,7 @@ _elm_list_walk(Widget_Data *wd) { if (wd->walking < 0) { - fprintf(stderr, "ERROR: walking was negative. fixed!\n"); + ERR("ERROR: walking was negative. fixed!\n"); wd->walking = 0; } wd->walking++; @@ -145,7 +396,7 @@ _elm_list_unwalk(Widget_Data *wd) wd->walking--; if (wd->walking < 0) { - fprintf(stderr, "ERROR: walking became negative. fixed!\n"); + ERR("ERROR: walking became negative. fixed!\n"); wd->walking = 0; } @@ -157,9 +408,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); } } @@ -171,13 +422,14 @@ _del_hook(Evas_Object *obj) Eina_List *n; if (!wd) return; - if (wd->walking != 0) - fprintf(stderr, "ERROR: list deleted while walking.\n"); + if (wd->walking) + ERR("ERROR: list deleted while walking.\n"); _elm_list_walk(wd); - EINA_LIST_FOREACH(wd->items, n, it) _elm_list_item_call_del_cb(it); + EINA_LIST_FOREACH(wd->items, n, it) elm_widget_item_pre_notify_del(it); _elm_list_unwalk(wd); - if (wd->to_delete) fprintf(stderr, "ERROR: leaking nodes!\n"); + if (wd->to_delete) + ERR("ERROR: leaking nodes!\n"); EINA_LIST_FREE(wd->items, it) _elm_list_item_free(it); eina_list_free(wd->selected); @@ -185,18 +437,102 @@ _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; - if (wd->scr) + 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) { - 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); + 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->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 @@ -209,12 +545,23 @@ _theme_hook(Evas_Object *obj) if (!wd) return; if (wd->scr) { - elm_scroller_custom_widget_base_theme_set(wd->scr, "list", "base"); - elm_object_style_set(wd->scr, elm_widget_style_get(obj)); + 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_object_style_set(wd->scr, elm_widget_style_get(obj)); } 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); @@ -227,9 +574,18 @@ _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(wd->scr, 1); + { + 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 - evas_object_focus_set(wd->scr, 0); + { + edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->self, EINA_FALSE); + } } static void @@ -237,8 +593,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 @@ -280,7 +636,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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); const char *selectraise; if (!wd) return; @@ -288,10 +644,10 @@ _item_hilight(Elm_List_Item *it) if (it->hilighted) return; _elm_list_walk(wd); - edje_object_signal_emit(it->base, "elm,state,selected", "elm"); - selectraise = edje_object_data_get(it->base, "selectraise"); + edje_object_signal_emit(it->base.view, "elm,state,selected", "elm"); + selectraise = edje_object_data_get(it->base.view, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) - evas_object_raise(it->base); + evas_object_raise(it->base.view); it->hilighted = EINA_TRUE; _elm_list_unwalk(wd); @@ -300,30 +656,31 @@ _item_hilight(Elm_List_Item *it) static void _item_select(Elm_List_Item *it) { - Widget_Data *wd = elm_widget_data_get(it->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); 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->data, it->obj, it); - evas_object_smart_callback_call(it->obj, "selected", it); + if (it->func) it->func((void *)it->base.data, it->base.widget, it); + evas_object_smart_callback_call(it->base.widget, "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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); const char *stacking, *selectraise; if (!wd) return; @@ -331,39 +688,52 @@ _item_unselect(Elm_List_Item *it) if (!it->hilighted) return; _elm_list_walk(wd); - 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"); + 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"); if ((selectraise) && (!strcmp(selectraise, "on"))) { - if ((stacking) && (!strcmp(stacking, "below"))) - evas_object_lower(it->base); + if ((stacking) && (!strcmp(stacking, "below"))) + evas_object_lower(it->base.view); } 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->obj, "unselected", it); + it->selected = EINA_FALSE; + wd->selected = eina_list_remove(wd->selected, it); + evas_object_smart_callback_call(it->base.widget, "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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); 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); @@ -371,29 +741,96 @@ _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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); + + if (!wd) + goto end; + + ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL); - if (!wd) return ECORE_CALLBACK_CANCEL; it->long_timer = NULL; - ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, 0); + + if (it->disabled) + goto end; + wd->longpressed = EINA_TRUE; - evas_object_smart_callback_call(it->obj, "longpressed", it); + evas_object_smart_callback_call(it->base.widget, "longpressed", it); + + end: 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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); Evas_Event_Mouse_Down *ev = event_info; if (!wd) return; @@ -407,16 +844,20 @@ _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->obj, "clicked", it); + evas_object_smart_callback_call(it->base.widget, "clicked", it); + wd->swipe = EINA_FALSE; + wd->movements = 0; } 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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); Evas_Event_Mouse_Up *ev = event_info; if (!wd) return; @@ -430,10 +871,16 @@ _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) { - wd->on_hold = EINA_FALSE; - return; + if (wd->swipe) _swipe(data); + wd->on_hold = EINA_FALSE; + return; } if (wd->longpressed) { @@ -442,38 +889,40 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * return; } - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; - + if (it->disabled) + 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); @@ -486,38 +935,71 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e Elm_List_Item *it; if (!wd) return NULL; - it = calloc(1, sizeof(Elm_List_Item)); - it->obj = obj; + it = elm_widget_item_new(obj, Elm_List_Item); + it->wd = wd; it->label = eina_stringshare_add(label); it->icon = icon; it->end = end; it->func = func; - 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); + 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); 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); @@ -527,84 +1009,99 @@ _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, "list", "separator", style); + _elm_theme_object_set(obj, it->base.view, "separator", + wd->h_mode ? "horizontal" : "vertical", + style); else if (wd->mode == ELM_LIST_COMPRESS) { if (it->even) - _elm_theme_object_set(obj, it->base, "list", "item_compress", style); + _elm_theme_object_set(obj, it->base.view, "list", + it_compress, style); else - _elm_theme_object_set(obj, it->base, "list", "item_compress_odd", style); + _elm_theme_object_set(obj, it->base.view, "list", + it_compress_odd, style); } else { if (it->even) - _elm_theme_object_set(obj, it->base, "list", "item", style); + _elm_theme_object_set(obj, it->base.view, "list", it_plain, + style); else - _elm_theme_object_set(obj, it->base, "list", "item_odd", style); + _elm_theme_object_set(obj, it->base.view, "list", it_odd, + style); } - stacking = edje_object_data_get(it->base, "stacking"); + stacking = edje_object_data_get(it->base.view, "stacking"); if (stacking) { if (!strcmp(stacking, "below")) - evas_object_lower(it->base); + evas_object_lower(it->base.view); else if (!strcmp(stacking, "above")) - evas_object_raise(it->base); + evas_object_raise(it->base.view); } - edje_object_part_text_set(it->base, "elm.text", it->label); + edje_object_part_text_set(it->base.view, "elm.text", it->label); + if ((!it->icon) && (minh[0] > 0)) { - it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base)); + it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base.view)); 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)); + it->end = evas_object_rectangle_add(evas_object_evas_get(it->base.view)); evas_object_color_set(it->end, 0, 0, 0, 0); it->dummy_end = EINA_TRUE; } @@ -612,28 +1109,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, "elm.swallow.icon", it->icon); + edje_object_part_swallow(it->base.view, "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, "elm.swallow.end", it->end); + edje_object_part_swallow(it->base.view, "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); + edje_object_message_signal_process(it->base.view); if (it->deleted) continue; mw = mh = -1; elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, 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_min_set(it->base, mw, mh); - evas_object_show(it->base); + evas_object_size_hint_min_set(it->base.view, mw, mh); + evas_object_show(it->base.view); } if ((it->selected) || (it->hilighted)) { @@ -642,15 +1139,18 @@ _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, "elm,state,selected", "elm"); + edje_object_signal_emit(it->base.view, "elm,state,selected", "elm"); if (it->deleted) continue; - selectraise = edje_object_data_get(it->base, "selectraise"); + selectraise = edje_object_data_get(it->base.view, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) - evas_object_raise(it->base); - stacking = edje_object_data_get(it->base, "stacking"); + evas_object_raise(it->base.view); } + if (it->disabled) + edje_object_signal_emit(it->base.view, "elm,state,disabled", + "elm"); + it->fixed = EINA_TRUE; it->is_even = it->even; } @@ -661,14 +1161,8 @@ _fix_items(Evas_Object *obj) mw = 0; mh = 0; evas_object_size_hint_min_get(wd->box, &mw, &mh); - 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); + + _elm_list_mode_set_internal(wd); } static void @@ -677,7 +1171,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_widget_scroll_hold_push(wd->scr); + elm_smart_scroller_hold_set(wd->scr, EINA_TRUE); } static void @@ -686,7 +1180,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_widget_scroll_hold_pop(wd->scr); + elm_smart_scroller_hold_set(wd->scr, EINA_FALSE); } static void @@ -695,7 +1189,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_widget_scroll_hold_push(wd->scr); + elm_smart_scroller_freeze_set(wd->scr, EINA_TRUE); } static void @@ -704,7 +1198,13 @@ _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_widget_scroll_hold_pop(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); } /** @@ -721,9 +1221,13 @@ 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"); @@ -732,23 +1236,45 @@ 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_can_focus_set(obj, 1); - - wd->scr = elm_scroller_add(parent); - elm_scroller_custom_widget_base_theme_set(wd->scr, "list", "base"); + 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_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_scroller_bounce_set(wd->scr, 0, 1); + elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, + _elm_config->thumbscroll_bounce_enable); 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_scroller_content_set(wd->scr, wd->box); + 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); + 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); @@ -782,7 +1308,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); + elm_box_pack_end(wd->box, it->base.view); return it; } @@ -809,7 +1335,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); + elm_box_pack_start(wd->box, it->base.view); return it; } @@ -834,7 +1360,8 @@ elm_list_item_insert_before(Evas_Object *obj, Elm_List_Item *before, const char Widget_Data *wd; Elm_List_Item *it; - if ((!before) || (!before->node)) return NULL; + EINA_SAFETY_ON_NULL_RETURN_VAL(before, NULL); + if (!before->node) return NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(before, NULL); ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -843,7 +1370,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, before->base); + elm_box_pack_before(wd->box, it->base.view, before->base.view); return it; } @@ -868,7 +1395,8 @@ elm_list_item_insert_after(Evas_Object *obj, Elm_List_Item *after, const char *l Widget_Data *wd; Elm_List_Item *it; - if ((!after) || (!after->node)) return NULL; + EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL); + if (!after->node) return NULL; ELM_LIST_ITEM_CHECK_DELETED_RETURN(after, NULL); ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -877,7 +1405,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, after->base); + elm_box_pack_after(wd->box, it->base.view, after->base.view); return it; } @@ -909,14 +1437,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); + it->node = eina_list_last(wd->items); + elm_box_pack_end(wd->box, it->base.view); } else { - Elm_List_Item *before = eina_list_data_get(l); - it->node = before->node->prev; - elm_box_pack_before(wd->box, it->base, before->base); + 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); } return it; } @@ -943,23 +1471,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_list_item_call_del_cb(it); - _elm_list_item_free(it); + elm_widget_item_pre_notify_del(it); + _elm_list_item_free(it); } _elm_list_unwalk(wd); @@ -1019,48 +1547,143 @@ elm_list_multi_select_get(const Evas_Object *obj) } /** - * Enables/disables horizontal mode of the list + * Set which mode to use for the list with. * * @param obj The list object - * @param mode If true, horizontale mode is enabled + * @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. * * @ingroup List */ EAPI void -elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) +elm_list_mode_set(Evas_Object *obj, Elm_List_Mode mode) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - if (wd->mode == mode) return; + + Widget_Data *wd; + + wd = elm_widget_data_get(obj); + if (!wd) + return; + if (wd->mode == mode) + return; wd->mode = mode; - 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); - } + + _elm_list_mode_set_internal(wd); } /** - * Gets the state of horizontal mode of the list + * Get the mode the list is at. * * @param obj The list object - * @return If true, horizontale mode is enabled + * @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. * * @ingroup List */ EAPI Elm_List_Mode -elm_list_horizontal_mode_get(const Evas_Object *obj) +elm_list_mode_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) ELM_LIST_SCROLL; + ELM_CHECK_WIDTYPE(obj, widtype) ELM_LIST_LAST; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return ELM_LIST_SCROLL; + if (!wd) return ELM_LIST_LAST; 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. * @@ -1185,9 +1808,11 @@ elm_list_item_separator_get(const Elm_List_Item *it) EAPI void elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) { - Widget_Data *wd = elm_widget_data_get(it->obj); - if (!wd) return; ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + + Widget_Data *wd = elm_widget_data_get(it->base.widget); + if (!wd) return; + selected = !!selected; if (it->selected == selected) return; @@ -1195,16 +1820,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); } @@ -1218,7 +1843,7 @@ elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) * @ingroup List */ EAPI Eina_Bool -elm_list_item_selected_get(Elm_List_Item *it) +elm_list_item_selected_get(const Elm_List_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); return it->selected; @@ -1234,17 +1859,44 @@ elm_list_item_selected_get(Elm_List_Item *it) EAPI void elm_list_item_show(Elm_List_Item *it) { - Widget_Data *wd = elm_widget_data_get(it->obj); + 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); + 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, &x, &y, &w, &h); + evas_object_geometry_get(it->base.view, &x, &y, &w, &h); x -= bx; y -= by; if (wd->scr) - elm_scroller_region_show(wd->scr, x, y, w, h); + elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); } /** @@ -1257,25 +1909,25 @@ elm_list_item_show(Elm_List_Item *it) EAPI void elm_list_item_del(Elm_List_Item *it) { - Widget_Data *wd = elm_widget_data_get(it->obj); - if (!wd) return; ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); + Widget_Data *wd = elm_widget_data_get(it->base.widget); + if (!wd) return; 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_list_item_call_del_cb(it); + elm_widget_item_pre_notify_del(it); _elm_list_item_free(it); _elm_list_unwalk(wd); @@ -1293,7 +1945,7 @@ EAPI void elm_list_item_del_cb_set(Elm_List_Item *it, Evas_Smart_Cb func) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); - it->del_cb = func; + elm_widget_item_del_cb_set(it, func); } /** @@ -1308,7 +1960,7 @@ EAPI void * elm_list_item_data_get(const Elm_List_Item *it) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, NULL); - return (void *)it->data; + return elm_widget_item_data_get(it); } /** @@ -1344,26 +1996,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->obj)); - evas_object_color_set(icon, 0, 0, 0, 0); - it->dummy_icon = EINA_TRUE; + 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; } 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) - edje_object_part_swallow(it->base, "elm.swallow.icon", icon); + if (it->base.view) + edje_object_part_swallow(it->base.view, "elm.swallow.icon", icon); } /** @@ -1399,26 +2051,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->obj)); - evas_object_color_set(end, 0, 0, 0, 0); - it->dummy_end = EINA_TRUE; + 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; } 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) - edje_object_part_swallow(it->base, "elm.swallow.end", end); + if (it->base.view) + edje_object_part_swallow(it->base.view, "elm.swallow.end", end); } /** @@ -1433,7 +2085,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; + return it->base.view; } /** @@ -1464,8 +2116,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) - edje_object_part_text_set(it->base, "elm.text", it->label); + if (it->base.view) + edje_object_part_text_set(it->base.view, "elm.text", it->label); } /** @@ -1501,6 +2153,224 @@ 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 @@ -1519,13 +2389,31 @@ 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_scroller_bounce_set(wd->scr, h_bounce, v_bounce); + 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); } /** * Set the scrollbar policy * - * This sets the scrollbar visibility policy for the given scroller. + * This sets the scrollbar visibility policy for the given list 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. @@ -1543,8 +2431,10 @@ 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_scroller_policy_set(wd->scr, policy_h, policy_v); + elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v); } EAPI void @@ -1552,7 +2442,68 @@ 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); - if (!wd) return; - if (wd->scr) - elm_scroller_policy_get(wd->scr, policy_h, policy_v); + 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); } diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index ef020a1..a78d4af 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -1,6 +1,5 @@ #include #include "elm_priv.h" -#include "elm_module_priv.h" /** * @defgroup Map Map @@ -20,9 +19,11 @@ * * clicked,double - This is called when a user has double-clicked the photo. * - * load,details - Map detailed data load begins. + * load,detail - Map detailed data load begins. * - * loaded,details - This is called when all parts of the map are loaded. + * loading,detail - Map detailed data loading. + * + * loaded,detail - This is called when all parts of the map are loaded. * * zoom,start - Zoom animation started. * @@ -65,30 +66,36 @@ 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 20 +#define ZOOM_MAX 18 #define TOUCH_HOLD_RANGE 40 //Zemm min is supposed to be 0 -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 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 Map_Sources_Tab map_sources_tab[] = { - {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} + {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} }; struct _Elm_Map_Marker_Class @@ -179,7 +186,6 @@ struct _Grid_Item Eina_Bool download : 1; Eina_Bool have : 1; Ecore_File_Download_Job *job; - int try_num; }; struct _Grid @@ -252,12 +258,8 @@ struct _Widget_Data Elm_Map_Sources source; Mod_Api *api; -}; - -struct _Pan -{ - Evas_Object_Smart_Clipped_Data __clipped_data; - Widget_Data *wd; + int try_num; + int finish_num; }; struct _Mod_Api @@ -268,13 +270,18 @@ 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_t { int device; struct prev { - Evas_Coord x, y; + Evas_Coord x, y; } prev; Evas_Coord x, y, w, h; @@ -282,12 +289,7 @@ struct event_t 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; @@ -298,6 +300,7 @@ static const char SIG_CHANGED[] = "changed"; static const char SIG_CLICKED[] = "clicked"; static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; static const char SIG_LOADED_DETAIL[] = "loaded,detail"; +static const char SIG_LOADING_DETAIL[] = "loading,detail"; static const char SIG_LOAD_DETAIL[] = "load,detail"; static const char SIG_LONGPRESSED[] = "longpressed"; static const char SIG_PRESS[] = "press"; @@ -312,6 +315,7 @@ static const Evas_Smart_Cb_Description _signals[] = { {SIG_CLICKED, ""}, {SIG_CLICKED_DOUBLE, ""}, {SIG_LOADED_DETAIL, ""}, + {SIG_LOADING_DETAIL, ""}, {SIG_LOAD_DETAIL, ""}, {SIG_LONGPRESSED, ""}, {SIG_PRESS, ""}, @@ -326,10 +330,15 @@ static const Evas_Smart_Cb_Description _signals[] = { 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); @@ -357,36 +366,17 @@ 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(void) { Eina_List *l; struct event_t *ev = NULL; - EINA_LIST_FOREACH(s_event_list, l, ev) { - if(ev->device != 0) return ev->device; - } + EINA_LIST_FOREACH(s_event_list, l, ev) + { + if (ev->device) return ev->device; + } + return 0; } @@ -408,10 +398,11 @@ get_event_object(int device) Eina_List *l; struct event_t *ev = NULL; - EINA_LIST_FOREACH(s_event_list, l, ev) { - if(ev->device == device) break; - ev = NULL; - } + EINA_LIST_FOREACH(s_event_list, l, ev) + { + if (ev->device == device) break; + ev = NULL; + } return ev; } @@ -421,7 +412,7 @@ create_event_object(Evas_Object *object, int device) struct event_t *ev; ev = calloc(1, sizeof(struct event_t)); - if(ev == NULL) DBG("Cannot allocate event_t"); + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, NULL); ev->object = object; ev->device = device; @@ -436,16 +427,17 @@ create_event_object(Evas_Object *object, int device) static void destroy_event_object(struct event_t *ev) { - if(ev == NULL) return; - ev->pinch_obj = NULL; + EINA_SAFETY_ON_NULL_RETURN(ev); + ev->pinch_dis = 0; s_event_list = eina_list_remove(s_event_list, ev); - if (ev->hold_timer) { - ecore_timer_del(ev->hold_timer); - ev->hold_timer = NULL; - } + if (ev->hold_timer) + { + ecore_timer_del(ev->hold_timer); + ev->hold_timer = NULL; + } free(ev); } @@ -453,15 +445,14 @@ static Mod_Api * module(Evas_Object *obj __UNUSED__) { static Elm_Module *m = NULL; - if (m) goto ok; // already found - just use + if (m) goto ok; 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 = // called on creation + ((Mod_Api *)(m->api) )->obj_hook = _elm_module_symbol_get(m, "obj_hook"); - ((Mod_Api *)(m->api) )->obj_unhook = // called on deletion + ((Mod_Api *)(m->api) )->obj_unhook = _elm_module_symbol_get(m, "obj_unhook"); ((Mod_Api *)(m->api) )->obj_url_request = _elm_module_symbol_get(m, "obj_url_request"); @@ -469,7 +460,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 - return api + ok: return m->api; } @@ -486,7 +477,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; @@ -537,8 +528,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; @@ -554,7 +545,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) { @@ -605,9 +596,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); @@ -625,7 +616,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); @@ -727,7 +718,7 @@ grid_clear(Evas_Object *obj, Grid *g) { gi->want = EINA_FALSE; wd->preload_num--; - if (wd->preload_num == 0) + if (!wd->preload_num) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,stop", "elm"); @@ -741,6 +732,7 @@ 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); @@ -770,7 +762,7 @@ _tile_update(Grid_Item *gi) gi->have = EINA_TRUE; gi->wd->preload_num--; - if (gi->wd->preload_num == 0) + if (!gi->wd->preload_num) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(gi->wd->scr), "elm,state,busy,stop", "elm"); @@ -788,13 +780,23 @@ _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++; +} + +static int +_tile_downloading(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow) +{ + Grid_Item *gi = data; + evas_object_smart_callback_call(gi->wd->obj, SIG_LOADING_DETAIL, NULL); + return 0; } static Grid * @@ -881,7 +883,7 @@ grid_load(Evas_Object *obj, Grid *g) if (gi->want) { wd->preload_num--; - if (wd->preload_num == 0) + if (!wd->preload_num) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,stop", "elm"); @@ -900,6 +902,7 @@ 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; } @@ -973,7 +976,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; @@ -985,13 +988,13 @@ grid_load(Evas_Object *obj, Grid *g) ecore_file_mkpath(buf); snprintf(buf2, sizeof(buf2), DEST_FILE_PATH, buf, y); + if((!source) || (strlen(source)==0)) continue; source = map_sources_tab[wd->source].url_cb(obj, x, y, g->zoom); - 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++; @@ -1009,9 +1012,10 @@ grid_load(Evas_Object *obj, Grid *g) else { 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); + ecore_file_download(source, buf2, _tile_downloaded, _tile_downloading, gi, &(gi->job)); + if (!gi->job) DBG("Can't start to download %s", buf); + else + wd->try_num++; } } if (source) free(source); @@ -1052,7 +1056,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 == 0)); + evas_object_image_smooth_scale_set(gi->img, (!wd->nosmooth)); } eina_iterator_free(it); } @@ -1082,7 +1086,7 @@ _scr_timeout(void *data) Widget_Data *wd = elm_widget_data_get(data); if (!wd) return ECORE_CALLBACK_CANCEL; wd->nosmooth--; - if (wd->nosmooth == 0) _smooth_update(data); + if (!wd->nosmooth) _smooth_update(data); wd->scr_timer = NULL; return ECORE_CALLBACK_CANCEL; } @@ -1169,7 +1173,7 @@ _zoom_anim(void *data) if (!go) { wd->nosmooth--; - if (wd->nosmooth == 0) _smooth_update(data); + if (!wd->nosmooth) _smooth_update(data); wd->zoom_animator = NULL; evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); } @@ -1188,21 +1192,20 @@ _long_press(void *data) } static void -_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) +_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); - Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down*)event_info; + Evas_Event_Mouse_Down *ev = event_info; struct event_t *ev0; 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 (ev0) return; + ev0 = create_event_object(obj, 0); + if (!ev0) return; + + ev0->hold_timer = NULL; + ev0->prev.x = ev->output.x; + ev0->prev.y = ev->output.y; if (!wd) return; if (ev->button != 1) return; @@ -1218,63 +1221,62 @@ _mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) } static void -_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) +_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Move *move = (Evas_Event_Mouse_Move *)event_info; struct event_t *ev0; - if(wd->pinch_zoom) return; + if (wd->pinch_zoom) return; ev0 = get_event_object(0); - if(ev0 == NULL) return; + if (!ev0) return; ev0->prev.x = move->cur.output.x; ev0->prev.y = move->cur.output.y; } static void -_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) +_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Widget_Data *wd = elm_widget_data_get(data); Evas_Event_Mouse_Up *ev = event_info; int mdevice; struct event_t *ev0; - struct event_t *ev1 = NULL; + struct event_t *ev1; 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 (ev0) + { + mdevice = get_multi_device(); + 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(mdevice); + if (ev1) ev1->hold_timer = ecore_timer_add(0.35f, _hold_timer_cb, ev1); + } + destroy_event_object(ev0); + } + 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; } @@ -1287,17 +1289,16 @@ _mouse_multi_down(void *data, Evas *evas, Evas_Object *obj, void *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(down->device); - if(ev) goto done; + if (ev) goto done; ev = create_event_object(obj, down->device); - if(!ev){ - DBG("Failed : create_event_object"); - goto done; - } + if (!ev) + { + DBG("Failed : create_event_object"); + goto done; + } wd->pinch_zoom = EINA_FALSE; @@ -1307,12 +1308,6 @@ _mouse_multi_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) 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 @@ -1324,40 +1319,37 @@ _mouse_multi_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) struct event_t *ev0; struct event_t *ev; - if(wd->pinch_zoom) return; + if (wd->pinch_zoom) return; ev = get_event_object(move->device); - if(ev == NULL) { - DBG("Cannot get multi device"); - return; - } + if (!ev) return; ev->prev.x = move->cur.output.x; ev->prev.y = move->cur.output.y; ev0 = get_event_object(0); - if(ev0 == NULL) { - DBG("Cannot get device0"); - return; - } + if (!ev0) return; dis_new = get_distance(ev0->prev.x, ev0->prev.y, ev->prev.x, ev->prev.y); int zoom = wd->zoom; - 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); - } + if (dis_old) + { + 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; } @@ -1369,27 +1361,52 @@ _mouse_multi_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) struct event_t *ev; ev = get_event_object(up->device); - if(ev == NULL){ - DBG("Cannot get multi device"); - return; - } + if (!ev) + { + DBG("Cannot get multi device"); + return; + } dis_old = 0; 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; - } - } + if (ev0) + { + ev0->hold_timer = ecore_timer_add(0.35f, _hold_timer_cb, ev0); + } + else + { + if (ev->hold_timer) + { + 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) +{ + 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 void _del_hook(Evas_Object *obj) { @@ -1417,8 +1434,8 @@ _del_hook(Evas_Object *obj) 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); + free(wd); } @@ -1465,6 +1482,23 @@ _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); @@ -1550,6 +1584,13 @@ _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); @@ -1693,7 +1734,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) @@ -1832,7 +1873,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, EINA_TRUE, EINA_FALSE); + elm_scroller_bounce_set(group->sc, _elm_config->thumbscroll_bounce_enable, 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, @@ -1854,7 +1895,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); @@ -1876,7 +1917,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); @@ -1906,7 +1947,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); @@ -1956,6 +1997,84 @@ _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; /** @@ -1973,9 +2092,10 @@ 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://")) { @@ -1984,16 +2104,21 @@ elm_map_add(Evas_Object *parent) } wd = ELM_NEW(Widget_Data); - wd->api = NULL; + wd->try_num = 0; + wd->finish_num = 1; 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); @@ -2008,22 +2133,16 @@ 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, EINA_TRUE, EINA_TRUE); + 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); 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); @@ -2052,17 +2171,17 @@ 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_child_size_get); + _pan_set, _pan_get, _pan_max_get, + _pan_min_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_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_MOUSE_UP, + _mouse_up, obj); evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_DOWN, _mouse_multi_down, obj); evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_MOVE, @@ -2131,7 +2250,6 @@ 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; @@ -2393,7 +2511,7 @@ elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat) if (wd->zoom_animator) { wd->nosmooth--; - if (wd->nosmooth == 0) _smooth_update(obj); + if (!wd->nosmooth) _smooth_update(obj); ecore_animator_del(wd->zoom_animator); wd->zoom_animator = NULL; zoom_do(obj, 1.0); @@ -2566,6 +2684,33 @@ 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) +{ + Widget_Data *wd = elm_widget_data_get(obj); + + 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 @@ -2583,11 +2728,9 @@ 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(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 (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 (lon) { @@ -2618,11 +2761,9 @@ 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(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 (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 (x) *x = floor((lon + 180.0) / 360.0 * size); @@ -2661,7 +2802,8 @@ elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Clas Evas_Object *o; if (!wd) return NULL; - if (!clas_group || !clas) return NULL; + EINA_SAFETY_ON_NULL_RETURN_VAL(clas_group, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(clas, NULL); Elm_Map_Marker *marker = ELM_NEW(Elm_Map_Marker); @@ -2833,13 +2975,13 @@ elm_map_marker_remove(Elm_Map_Marker *marker) Eina_List *groups; Widget_Data *wd; - if (!marker) return; + EINA_SAFETY_ON_NULL_RETURN(marker); 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) == 0) + if (!eina_list_count(marker->groups[i]->markers)) { groups = eina_matrixsparse_cell_data_get(marker->groups[i]->cell); groups = eina_list_remove(groups, marker->groups[i]); @@ -2866,14 +3008,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); @@ -2898,7 +3040,7 @@ elm_map_marker_remove(Elm_Map_Marker *marker) EAPI void elm_map_marker_bring_in(Elm_Map_Marker *marker) { - if (!marker) return; + EINA_SAFETY_ON_NULL_RETURN(marker); elm_map_geo_region_bring_in(marker->wd->obj, marker->longitude, marker->latitude); } @@ -2913,7 +3055,7 @@ elm_map_marker_bring_in(Elm_Map_Marker *marker) EAPI void elm_map_marker_show(Elm_Map_Marker *marker) { - if (!marker) return; + EINA_SAFETY_ON_NULL_RETURN(marker); elm_map_geo_region_show(marker->wd->obj, marker->longitude, marker->latitude); } @@ -2938,22 +3080,22 @@ elm_map_markers_list_show(Eina_List *markers) Evas_Coord rw, rh, xc, yc; Widget_Data *wd; - if (!markers) return; + EINA_SAFETY_ON_NULL_RETURN(markers); 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; } @@ -2966,10 +3108,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; } @@ -3007,9 +3149,9 @@ elm_map_max_marker_per_group_set(Evas_Object *obj, int max) * @ingroup Map */ EAPI Evas_Object * -elm_map_marker_object_get(Elm_Map_Marker *marker) +elm_map_marker_object_get(const Elm_Map_Marker *marker) { - if (!marker) return NULL; + EINA_SAFETY_ON_NULL_RETURN_VAL(marker, NULL); return marker->content; } @@ -3023,7 +3165,7 @@ elm_map_marker_object_get(Elm_Map_Marker *marker) EAPI void elm_map_marker_update(Elm_Map_Marker *marker) { - if (!marker) return; + EINA_SAFETY_ON_NULL_RETURN(marker); if (marker->content) { if (marker->clas->func.del) @@ -3089,7 +3231,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); eina_stringshare_replace(&clas->style, style); } @@ -3106,7 +3248,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); clas->func.icon_get = icon_get; } @@ -3121,7 +3263,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); clas->data = data; } @@ -3138,7 +3280,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); clas->zoom_displayed = zoom; } @@ -3153,7 +3295,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); clas->zoom_grouped = zoom; } @@ -3172,7 +3314,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; - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); if (clas->hide == hide) return; clas->hide = hide; if (wd->grids) @@ -3217,7 +3359,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); eina_stringshare_replace(&clas->style, style); } @@ -3234,7 +3376,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); clas->func.icon_get = icon_get; } @@ -3253,7 +3395,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); clas->func.get = get; } @@ -3271,7 +3413,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) { - if (!clas) return; + EINA_SAFETY_ON_NULL_RETURN(clas); clas->func.del = del; } @@ -3303,7 +3445,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) @@ -3345,7 +3487,8 @@ 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) { - if (!name || !url_cb) return; + EINA_SAFETY_ON_NULL_RETURN(name); + EINA_SAFETY_ON_NULL_RETURN(url_cb); map_sources_tab[source].name = name; map_sources_tab[source].zoom_min = zoom_min; map_sources_tab[source].zoom_max = zoom_max; @@ -3396,7 +3539,7 @@ elm_map_source_name_get(Elm_Map_Sources source) static char * -_mapnik_url_cb(void *data, int x, int y, int zoom) +_mapnik_url_cb(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", @@ -3405,43 +3548,81 @@ _mapnik_url_cb(void *data, int x, int y, int zoom) } static char * -_osmarender_url_cb(void * data, int x, int y, int zoom) +_osmarender_url_cb(Evas_Object *obj __UNUSED__, 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(void *data, int x, int y, int zoom) +_cyclemap_url_cb(Evas_Object *obj __UNUSED__, 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(void *data, int x, int y, int zoom) +_maplint_url_cb(Evas_Object *obj __UNUSED__, 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 * -_decarta_url_cb(void *data, int x, int y, int zoom) +_custom1_url_cb(Evas_Object *obj, int x, int y, int 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); + return strdup(""); +} - if(!url) url = strdup(""); +static char * +_custom2_url_cb(Evas_Object *obj, int x, int y, int zoom) +{ + return strdup(""); +} + +static char * +_custom3_url_cb(Evas_Object *obj, int x, int y, int zoom) +{ + return strdup(""); +} - return url; +static char * +_custom4_url_cb(Evas_Object *obj, int x, int y, int zoom) +{ + return strdup(""); } +static char * +_custom5_url_cb(Evas_Object *obj, int x, int y, int zoom) +{ + return strdup(""); +} + +static char * +_custom6_url_cb(Evas_Object *obj, 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); + + if (!buf) buf = strdup(""); + + return buf; +} diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c index 7e2d017..38fea0e 100644 --- a/src/lib/elm_mapbuf.c +++ b/src/lib/elm_mapbuf.c @@ -168,8 +168,11 @@ 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"); @@ -177,6 +180,7 @@ 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); @@ -213,6 +217,7 @@ 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)); @@ -225,6 +230,25 @@ 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. @@ -243,9 +267,10 @@ 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, wd->content); - evas_object_smart_member_del(wd->content); - evas_object_clip_unset(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"); wd->content = NULL; return content; } diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c index 43d1224..e9aa59d 100644 --- a/src/lib/elm_menu.c +++ b/src/lib/elm_menu.c @@ -13,32 +13,28 @@ typedef struct _Widget_Data Widget_Data; -struct _Menu_Item +struct _Elm_Menu_Item { - Evas_Object *menu; - Evas_Object *o; + Elm_Widget_Item base; 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; - Evas_Smart_Cb del_cb; - const void *data; - //if submenu - Eina_Bool open; - Evas_Object *hv, *bx, *location; - Eina_List *items; + struct { + Evas_Object *hv, *bx, *location; + Eina_List *items; + Eina_Bool open : 1; + } submenu; + + Eina_Bool separator : 1; + Eina_Bool disabled : 1; }; struct _Widget_Data { - Evas_Object *hv, *bx, *location, *parent; + Evas_Object *hv, *bx, *location, *parent, *obj; Eina_List *items; Evas_Coord xloc, yloc; }; @@ -49,81 +45,92 @@ 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 = NULL; + Eina_List *l, *_l, *_ll, *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->items); + ll = eina_list_append(ll, item->submenu.items); if (item->separator) - _elm_theme_object_set(obj, item->o, "menu", "separator", + _elm_theme_object_set(obj, item->base.view, "menu", "separator", elm_widget_style_get(obj)); - else if (item->bx) + else if (item->submenu.bx) { - _elm_theme_object_set(obj, item->o, "menu", "item_with_submenu", - elm_widget_style_get(obj)); + _elm_theme_object_set + (obj, item->base.view, "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); + elm_menu_item_icon_set(item, item->icon_str); } else { - _elm_theme_object_set(obj, item->o, "menu", "item", + _elm_theme_object_set(obj, item->base.view, "menu", "item", elm_widget_style_get(obj)); elm_menu_item_label_set(item, item->label); - elm_menu_item_icon_set(item, item->icon); + elm_menu_item_icon_set(item, item->icon_str); } if (item->disabled) - edje_object_signal_emit(item->o, "elm,state,disabled", "elm"); + edje_object_signal_emit + (item->base.view, "elm,state,disabled", "elm"); else - 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) * + 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) * _elm_config->scale); } } @@ -160,7 +167,7 @@ _sizing_eval(Evas_Object *obj) EINA_LIST_FOREACH(wd->items,l,item) { - if (item->open) _submenu_sizing_eval(item); + if (item->submenu.open) _submenu_sizing_eval(item); } } @@ -170,12 +177,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->menu); + Widget_Data *wd = elm_widget_data_get(parent->base.widget); if (!wd) return; - 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); + 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); evas_object_geometry_get(wd->parent, &px, &py, &pw, &ph); x_p = x2+w2; @@ -189,15 +196,15 @@ _submenu_sizing_eval(Elm_Menu_Item *parent) if (y_p < py) y_p += y_p - y_p; - 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); + 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); - EINA_LIST_FOREACH(parent->items,l,item) + EINA_LIST_FOREACH(parent->submenu.items, l, item) { - if (item->open) + if (item->submenu.open) _submenu_sizing_eval(item); } } @@ -208,36 +215,38 @@ _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->o, &minw, &minh, minw, minh); + edje_object_size_min_restricted_calc(item->base.view, &minw, &minh, minw, minh); if (!item->separator) elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(item->o, minw, minh); - evas_object_size_hint_max_set(item->o, maxw, maxh); + evas_object_size_hint_min_set(item->base.view, minw, minh); + evas_object_size_hint_max_set(item->base.view, maxw, maxh); } static void -_changed_size_hints(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 -_menu_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_parent_resize(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__) +_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { - _sizing_eval(data); + Widget_Data *wd = data; + evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, _parent_resize, wd->obj); + wd->parent = NULL; } 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->open) _submenu_sizing_eval(item); + if (item->submenu.open) _submenu_sizing_eval(item); } static void @@ -259,7 +268,7 @@ _menu_hide(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) EINA_LIST_FOREACH(wd->items, l, item2) { - if (item2->open) _submenu_hide(item2); + if (item2->submenu.open) _submenu_hide(item2); } } @@ -268,27 +277,27 @@ _submenu_hide(Elm_Menu_Item *item) { Eina_List *l; Elm_Menu_Item *item2; - evas_object_hide(item->hv); - item->open = EINA_FALSE; - EINA_LIST_FOREACH(item->items, l, item2) + evas_object_hide(item->submenu.hv); + item->submenu.open = EINA_FALSE; + EINA_LIST_FOREACH(item->submenu.items, l, item2) { - if (item2->open) _submenu_hide(item2); + if (item2->submenu.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 *it = data; - if (it->items) + Elm_Menu_Item *item = data; + if (item->submenu.items) { - if (!it->open) _submenu_open(it, NULL, NULL, NULL); - else _submenu_hide(it); + if (!item->submenu.open) _submenu_open(item, NULL, NULL, NULL); + else _submenu_hide(item); } else - _menu_hide(it->menu, NULL, NULL); + _menu_hide(item->base.widget, NULL, NULL); - if (it->func) it->func((void *)(it->data), it->menu, it); + if (item->func) item->func((void *)(item->base.data), item->base.widget, item); } static void @@ -299,17 +308,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->items, l, item2) + EINA_LIST_FOREACH(item->parent->submenu.items, l, item2) { - if ((item2->open) && (item2 != item)) _submenu_hide(item2); + if ((item2->submenu.open) && (item2 != item)) _submenu_hide(item2); } } else { - Widget_Data *wd = elm_widget_data_get(item->menu); + Widget_Data *wd = elm_widget_data_get(item->base.widget); EINA_LIST_FOREACH(wd->items, l, item2) { - if ((item2->open) && (item2 != item)) _submenu_hide(item2); + if ((item2->submenu.open) && (item2 != item)) _submenu_hide(item2); } } } @@ -317,10 +326,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 *it = data; - it->open = EINA_TRUE; - evas_object_show(it->hv); - _sizing_eval(it->menu); + Elm_Menu_Item *item = data; + item->submenu.open = EINA_TRUE; + evas_object_show(item->submenu.hv); + _sizing_eval(item->base.widget); } static void @@ -334,59 +343,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->menu); + Widget_Data *wd = elm_widget_data_get(item->base.widget); if (!wd) return; - 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", "", + 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", "", _menu_item_select, item); - edje_object_signal_callback_add(item->o, "elm,action,activate", "", + edje_object_signal_callback_add(item->base.view, "elm,action,activate", "", _menu_item_activate, item); - evas_object_show(item->o); + evas_object_show(item->base.view); } static void _item_separator_obj_create(Elm_Menu_Item *item) { - Widget_Data *wd = elm_widget_data_get(item->menu); + Widget_Data *wd = elm_widget_data_get(item->base.widget); if (!wd) return; - 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", "", + 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", "", _menu_item_activate, item); - evas_object_show(item->o); + evas_object_show(item->base.view); } static void _item_submenu_obj_create(Elm_Menu_Item *item) { - Widget_Data *wd = elm_widget_data_get(item->menu); + Widget_Data *wd = elm_widget_data_get(item->base.widget); if (!wd) return; - 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)); + 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)); elm_menu_item_label_set(item, item->label); - elm_menu_item_icon_set(item, item->icon); + elm_menu_item_icon_set(item, item->icon_str); - edje_object_signal_callback_add(item->o, "elm,action,open", "", + edje_object_signal_callback_add(item->base.view, "elm,action,open", "", _submenu_open, 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->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->bx, EVAS_CALLBACK_RESIZE, _menu_resize, item->menu); + evas_object_event_callback_add(item->submenu.bx, EVAS_CALLBACK_RESIZE, _menu_resize, item->base.widget); } /** @@ -404,8 +413,11 @@ 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"); @@ -414,9 +426,11 @@ 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); @@ -429,7 +443,8 @@ 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, obj); + 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(obj, EVAS_CALLBACK_SHOW, _show, obj); @@ -444,29 +459,41 @@ 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 = NULL; + Eina_List *l, *_l, *_ll, *ll = NULL; Elm_Menu_Item *item; ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - elm_hover_parent_set(wd->hv, parent); + + 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); 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->hv) + if (item->submenu.hv) { - elm_hover_parent_set(item->hv, parent); - ll = eina_list_append(ll, item->items); + elm_hover_parent_set(item->submenu.hv, parent); + ll = eina_list_append(ll, item->submenu.items); } } } @@ -474,12 +501,29 @@ 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 @@ -495,15 +539,46 @@ elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) /** * Get the Evas_Object of an Elm_Menu_Item - * - * @param it The menu item object. - * + * + * @param item The menu item object. + * * @ingroup Menu */ EAPI Evas_Object * -elm_menu_object_get(const Elm_Menu_Item *it) +elm_menu_object_get(const Elm_Menu_Item *item) { - return it->o; + 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); } /** @@ -515,37 +590,47 @@ elm_menu_object_get(const Elm_Menu_Item *it) * @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, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data) +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 *subitem; ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); + Evas_Object *icon_obj; if (!wd) return NULL; - subitem = ELM_NEW(Elm_Menu_Item); - if (!subitem) 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->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_menu_item_icon_set(subitem, icon); + + 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); if (parent) { - if (!parent->bx) _item_submenu_obj_create(parent); - elm_box_pack_end(parent->bx, subitem->o); - parent->items = eina_list_append(parent->items, subitem); + 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); } else { - elm_box_pack_end(wd->bx, subitem->o); + elm_box_pack_end(wd->bx, subitem->base.view); wd->items = eina_list_append(wd->items, subitem); } @@ -556,7 +641,7 @@ elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *icon, co /** * Set the label of a menu item * - * @param it The menu item object. + * @param item The menu item object. * @param label The label to set for @p item * * @ingroup Menu @@ -564,30 +649,31 @@ elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *icon, co 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->o, "elm,state,text,visible", "elm"); + edje_object_signal_emit(item->base.view, "elm,state,text,visible", "elm"); else - edje_object_signal_emit(item->o, "elm,state,text,hidden", "elm"); + edje_object_signal_emit(item->base.view, "elm,state,text,hidden", "elm"); - edje_object_message_signal_process(item->o); - edje_object_part_text_set(item->o, "elm.text", label); - _sizing_eval(item->menu); + edje_object_message_signal_process(item->base.view); + edje_object_part_text_set(item->base.view, "elm.text", label); + _sizing_eval(item->base.widget); } /** * Get the label of a menu item * - * @param it The menu item object. + * @param item The menu item object. * @return The label of @p item * * @ingroup Menu */ EAPI const char * -elm_menu_item_label_get(Elm_Menu_Item *item) +elm_menu_item_label_get(const Elm_Menu_Item *item) { - if (!item) return NULL; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); return item->label; } @@ -596,33 +682,35 @@ elm_menu_item_label_get(Elm_Menu_Item *item) * * Once the icon object is set, a previously set one will be deleted. * - * @param it The menu item object. + * @param item 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, Evas_Object *icon) -{ - if(item->icon == icon) return; - if (item->icon) evas_object_del(item->icon); - item->icon = icon; - if (icon) +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_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); + eina_stringshare_replace(&item->icon_str, icon); + edje_object_signal_emit(item->base.view, "elm,state,icon,visible", "elm"); } - _sizing_eval(item->menu); + 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); } /** * Set the disabled state of @p item. * - * @param it The menu item object. + * @param item The menu item object. * @param disabled The enabled/disabled state of the item * * @ingroup Menu @@ -630,29 +718,31 @@ elm_menu_item_icon_set(Elm_Menu_Item *item, Evas_Object *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->o, "elm,state,disabled", "elm"); - if (item->open) _submenu_hide(item); + edje_object_signal_emit(item->base.view, "elm,state,disabled", "elm"); + if (item->submenu.open) _submenu_hide(item); } else - edje_object_signal_emit(item->o, "elm,state,enabled", "elm"); - edje_object_message_signal_process(item->o); + edje_object_signal_emit(item->base.view, "elm,state,enabled", "elm"); + edje_object_message_signal_process(item->base.view); } /** * Get the disabled state of @p item. - * - * @param it The menu item object. + * + * @param item The menu item object. * @return The enabled/disabled state of the item - * + * * @ingroup Menu */ EAPI Eina_Bool -elm_menu_item_disabled_get(Elm_Menu_Item *item) +elm_menu_item_disabled_get(const Elm_Menu_Item *item) { + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); if (!item) return EINA_FALSE; return item->disabled; } @@ -674,48 +764,61 @@ 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; - subitem = ELM_NEW(Elm_Menu_Item); + /* 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); if (!subitem) return NULL; - subitem->menu = obj; + subitem->base.widget = obj; subitem->separator = 1; _item_separator_obj_create(subitem); if (!parent) { - elm_box_pack_end(wd->bx, subitem->o); + elm_box_pack_end(wd->bx, subitem->base.view); wd->items = eina_list_append(wd->items, subitem); } else { - if (!parent->bx) _item_submenu_obj_create(parent); - elm_box_pack_end(parent->bx, subitem->o); - parent->items = eina_list_append(parent->items, subitem); + 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); } _sizing_eval(obj); return subitem; } - /** - * Deletes an item from the menu. + * Get the icon object from a menu item * - * @param item The item to delete + * @param item The menu item object + * @return The icon object or NULL if there's no icon * * @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 icon of a menu item - * - * @param it The menu item object. - * @return The icon object of @p item or NULL - * + * 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 + * * @ingroup Menu */ -EAPI Evas_Object * -elm_menu_item_icon_get(Elm_Menu_Item *item) +EAPI const char * +elm_menu_item_icon_get(const Elm_Menu_Item *item) { - if (!item) return NULL; - return item->icon; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return item->icon_str; } /** @@ -729,68 +832,74 @@ elm_menu_item_icon_get(Elm_Menu_Item *item) EAPI Eina_Bool elm_menu_item_is_separator(Elm_Menu_Item *item) { - if (!item) return EINA_FALSE; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, 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; - if (!item) return; - if (item->del_cb) item->del_cb((void*)item->data, item->o, item); + elm_widget_item_pre_notify_del(item); - EINA_LIST_FREE(item->items, _item) elm_menu_item_del(_item); + EINA_LIST_FREE(item->submenu.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->hv) evas_object_del(item->hv); - if (item->location) evas_object_del(item->location); - if (item->o) evas_object_del(item->o); + if (item->submenu.hv) evas_object_del(item->submenu.hv); + if (item->submenu.location) evas_object_del(item->submenu.location); if (item->parent) - item->parent->items = eina_list_remove(item->parent->items, item); + item->parent->submenu.items = eina_list_remove(item->parent->submenu.items, item); else { - Widget_Data *wd = elm_widget_data_get(item->menu); + Widget_Data *wd = elm_widget_data_get(item->base.widget); wd->items = eina_list_remove(wd->items, item); } - free(item); + elm_widget_item_del(item); } /** * Set the function called when a menu item is freed. * - * @param it The item to set the callback on + * @param item 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 *it, Evas_Smart_Cb func) +elm_menu_item_del_cb_set(Elm_Menu_Item *item, Evas_Smart_Cb func) { - if (!it) return; - it->del_cb = func; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_del_cb_set(item, func); } /** - * Returns the data associated with menu item @p it. + * Returns the data associated with menu item @p item. * - * @param it The item - * @return The data associated with @p it + * @param item The item + * @return The data associated with @p item * * @ingroup Menu */ EAPI void * -elm_menu_item_data_get(const Elm_Menu_Item *it) +elm_menu_item_data_get(const Elm_Menu_Item *item) { - if (!it) return NULL; - return (void *)it->data; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return elm_widget_item_data_get(item); } /** - * Sets the data to be associated with menu item @p it. + * Sets the data to be associated with menu item @p item. * * @param item The item * @param data The data to be associated with @p item @@ -800,21 +909,21 @@ elm_menu_item_data_get(const Elm_Menu_Item *it) EAPI void elm_menu_item_data_set(Elm_Menu_Item *item, const void *data) { - if (!item) return; - item->data = data; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_data_set(item, data); } /** * Returns a list of @p item's subitems. * - * @param it The item + * @param item The item * @return An Eina_List* of @p item's subitems * * @ingroup Menu */ EAPI const Eina_List * -elm_menu_item_subitems_get(Elm_Menu_Item *item) +elm_menu_item_subitems_get(const Elm_Menu_Item *item) { - if (!item) return NULL; - return item->items; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return item->submenu.items; } diff --git a/src/lib/elm_module_priv.h b/src/lib/elm_module_priv.h index 8aa6ff3..15acae3 100644 --- a/src/lib/elm_module_priv.h +++ b/src/lib/elm_module_priv.h @@ -2,7 +2,6 @@ #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 @@ -25,17 +24,6 @@ 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 5c7e9b7..a60f0a0 100644 --- a/src/lib/elm_multibuttonentry.c +++ b/src/lib/elm_multibuttonentry.c @@ -159,15 +159,6 @@ _sizing_eval(Evas_Object *obj) } static void -_signal_mouse_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) -{ - Widget_Data *wd = elm_widget_data_get(data); - if(!wd || !wd->base) return; - - evas_object_smart_callback_call(data, "clicked", NULL); -} - -static void _changed_size_hint_cb(void *data, Evas *evas, Evas_Object *obj, void *event) { Evas_Object *eo = (Evas_Object *)data; @@ -201,11 +192,6 @@ _event_init(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd || !wd->base) return; - if(wd->base) - { - edje_object_signal_callback_add(wd->base, "mouse,clicked,1", "*", _signal_mouse_clicked, obj); - } - if (wd->box) { evas_object_event_callback_add(wd->box, EVAS_CALLBACK_RESIZE, _resize_cb, obj); @@ -463,8 +449,7 @@ _change_current_button_state(Evas_Object *obj, Multibuttonentry_Button_State sta break; case MULTIBUTONENTRY_BUTTON_STATE_SELECTED: edje_object_signal_emit(item->button, "focused", ""); - evas_object_smart_callback_call(obj, "selected", item); // will be removed! - evas_object_smart_callback_call(obj, "item,selected", item); + evas_object_smart_callback_call(obj, "selected", item); break; default: edje_object_signal_emit(item->button, "default", ""); @@ -505,7 +490,6 @@ _button_clicked(void *data, Evas_Object *obj, const char *emission, const char * { Widget_Data *wd = elm_widget_data_get(data); static char str[MAX_STR]; - Elm_Multibuttonentry_Item *item = NULL; if (!wd) return; strncpy(str, elm_scrolled_entry_entry_get(wd->entry), MAX_STR); @@ -515,10 +499,6 @@ _button_clicked(void *data, Evas_Object *obj, const char *emission, const char * _add_button(data, str); _change_current_button(data, obj); - - if (wd->current) - if(item = eina_list_data_get(wd->current)) - evas_object_smart_callback_call(data, "item,clicked", item); } static void @@ -558,8 +538,7 @@ _del_button_item(Elm_Multibuttonentry_Item *item) { wd->items = eina_list_remove(wd->items, _item); elm_box_unpack(wd->box, _item->button); - evas_object_smart_callback_call(obj, "deleted", _item); // will be removed! - evas_object_smart_callback_call(obj, "item,deleted", _item); + evas_object_smart_callback_call(obj, "deleted", _item); _del_button_obj(obj, _item->button); free(_item); if (wd->current == l) @@ -691,8 +670,7 @@ _add_button_item(Evas_Object *obj, const char *str, Multibuttonentry_Pos pos, co elm_label_wrap_width_set(label, item->vw - 2*padding_outer - 2*padding_inner ); } - evas_object_smart_callback_call(obj, "added", item); // will be removed! - evas_object_smart_callback_call(obj, "item,added", item); + evas_object_smart_callback_call(obj, "added", item); return item; } @@ -749,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_set(wd->box, EINA_TRUE); + elm_box_extended_mode_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 9be75fd..5a9c483 100644 --- a/src/lib/elm_navigationbar.c +++ b/src/lib/elm_navigationbar.c @@ -1360,7 +1360,7 @@ elm_navigationbar_subtitle_label_get(Evas_Object *obj, Evas_Object *content) } /** - * This disables content area animation on push/pop. + * 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. @@ -1373,6 +1373,23 @@ 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_disable_set(wd->pager, disable); + elm_pager_animation_disabled_set(wd->pager, disable); +} + +/** + * 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_disabled_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); } diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index 458ca5c..4dc4967 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -3,11 +3,13 @@ /** - * @defgroup Notify Notify - * @ingroup Elementary + * @defgroup Notify notify * - * Display a window in a particular region of the application (top, bottom ...). - * A timeout can be set to automatically close the window. + * 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. * */ @@ -21,7 +23,7 @@ struct _Widget_Data Eina_Bool repeat_events; Evas_Object *block_events; - int timeout; + double timeout; Ecore_Timer *timer; }; @@ -38,6 +40,14 @@ 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) { @@ -162,7 +172,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, "block,clicked", NULL); + evas_object_smart_callback_call(data, SIG_BLOCK_CLICKED, NULL); } static void @@ -239,28 +249,34 @@ _timer_cb(void *data) if (!wd) return ECORE_CALLBACK_CANCEL; wd->timer = NULL; evas_object_hide(obj); - evas_object_smart_callback_call(obj, "notify,timeout", NULL); + evas_object_smart_callback_call(obj, SIG_TIMEOUT, NULL); return ECORE_CALLBACK_CANCEL; } static void -_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +_timer_init(Evas_Object *obj, Widget_Data *wd) { - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; - evas_object_show(wd->notify); - if (!wd->repeat_events) - evas_object_show(wd->block_events); if (wd->timer) { ecore_timer_del(wd->timer); wd->timer = NULL; } - if (wd->timeout > 0) + 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); + if (!wd) return; + evas_object_show(wd->notify); + if (!wd->repeat_events) + evas_object_show(wd->block_events); + _timer_init(obj, wd); +} + +static void _hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) { Widget_Data *wd = elm_widget_data_get(obj); @@ -308,8 +324,11 @@ 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"); @@ -335,6 +354,8 @@ 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; } @@ -412,13 +433,16 @@ elm_notify_content_get(const Evas_Object *obj) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if ((!wd) || (!wd->content)) return NULL; + if (!wd) 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 * @@ -467,6 +491,23 @@ 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 @@ -500,66 +541,56 @@ elm_notify_orient_get(const Evas_Object *obj) } /** - * Set the time before the notify window is hidden.
- * Set a value < 0 to disable the timer + * Set the time interval after which the notify window is going to be + * hidden. * * @param obj The notify object - * @param time the new timeout + * @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. * - * @ingroup Notify */ EAPI void -elm_notify_timeout_set(Evas_Object *obj, int timeout) +elm_notify_timeout_set(Evas_Object *obj, double timeout) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; wd->timeout = timeout; - elm_notify_timer_init(obj); + _timer_init(obj, wd); } /** * Return the timeout value (in seconds) * @param obj the notify object */ -EAPI int +EAPI double elm_notify_timeout_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) -1; + ELM_CHECK_WIDTYPE(obj, widtype) 0.0; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return -1; + if (!wd) return 0.0; 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 - * 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. + * catch by the others widgets, else the events are block and the signal + * dismiss will be sent when the user click outside the window. * * @note The default value is EINA_TRUE. * * @param obj The notify object - * @param repeats EINA_TRUE Events are repeated else The events are blocked. - * - * @ingroup Notify + * @param repeats EINA_TRUE Events are repeats, else no */ EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat) @@ -574,7 +605,8 @@ 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 503ab2f..0eeb7dc 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 he stack or deleted as normal. + * Objects can be pushed or popped from the 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,6 +71,20 @@ _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) @@ -82,8 +96,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); @@ -157,12 +171,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); + } } } @@ -189,16 +203,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; + } } } @@ -242,9 +256,12 @@ 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"); @@ -252,22 +269,23 @@ 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; } @@ -342,28 +360,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); + } } } @@ -438,13 +456,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; + } } } @@ -495,11 +513,9 @@ elm_pager_content_top_get(const Evas_Object *obj) * @ingroup Pager */ EAPI void -elm_pager_animation_disable_set(Evas_Object *obj, Eina_Bool disable) +elm_pager_animation_disabled_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 a435f64..2e7d185 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -29,6 +29,7 @@ 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); @@ -47,12 +48,83 @@ _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - 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); + 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); + } _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) { @@ -105,7 +177,7 @@ _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) } static void -_toggle_panel(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +_toggle_panel(void *data, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; @@ -114,15 +186,44 @@ _toggle_panel(void *data, Evas_Object *obj __UNUSED__, const char *emission __UN 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 * @@ -139,8 +240,11 @@ 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"); @@ -148,12 +252,18 @@ 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_can_focus_set(obj, 0); + 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); wd->scr = elm_smart_scroller_add(evas); elm_smart_scroller_widget_set(wd->scr, obj); - elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", "left"); - elm_smart_scroller_bounce_allow_set(wd->scr, 0, 0); + _theme_hook(obj); + elm_smart_scroller_bounce_allow_set(wd->scr, EINA_FALSE, EINA_FALSE); 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); @@ -202,7 +312,10 @@ 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"); @@ -210,8 +323,6 @@ 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); } @@ -225,7 +336,7 @@ elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient) * @ingroup Panel */ EAPI Elm_Panel_Orient -elm_panel_orient_get(Evas_Object *obj) +elm_panel_orient_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) ELM_PANEL_ORIENT_LEFT; Widget_Data *wd = elm_widget_data_get(obj); @@ -264,6 +375,25 @@ 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. @@ -302,7 +432,6 @@ 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", "*"); } @@ -315,7 +444,7 @@ elm_panel_hidden_set(Evas_Object *obj, Eina_Bool hidden) * @ingroup Panel */ EAPI Eina_Bool -elm_panel_hidden_get(Evas_Object *obj) +elm_panel_hidden_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c index 5b955af..ea71177 100644 --- a/src/lib/elm_photo.c +++ b/src/lib/elm_photo.c @@ -47,9 +47,11 @@ _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); } @@ -58,40 +60,45 @@ _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) { - 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); - } + 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); + } } 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) { - 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); - } + 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); + } } @@ -110,7 +117,7 @@ _longpress(void *objv) const char *file; char *buf; - printf("Long press: start drag!\n"); + DBG("Long press: start drag!"); wd->longtimer = NULL; /* clear: must return NULL now */ evas_object_event_callback_del(objv, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move); @@ -157,16 +164,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) +_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { 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 @@ -174,7 +181,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; @@ -200,8 +207,11 @@ 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"); @@ -209,7 +219,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, 0); + elm_widget_can_focus_set(obj, EINA_FALSE); wd->frm = edje_object_add(e); _elm_theme_object_set(obj, wd->frm, "photo", "base", "default"); @@ -222,7 +232,8 @@ 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, @@ -280,8 +291,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; + if (!wd) return; wd->size = (size > 0) ? size : 0; _els_smart_icon_scale_size_set(wd->img, wd->size); @@ -302,6 +313,7 @@ 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 bde9b42..3398234 100644 --- a/src/lib/elm_photocam.c +++ b/src/lib/elm_photocam.c @@ -819,6 +819,13 @@ _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); @@ -969,8 +976,11 @@ 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"); @@ -1026,8 +1036,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_child_size_get); + _pan_set, _pan_get, _pan_max_get, + _pan_min_get, _pan_child_size_get); wd->zoom = 1; wd->mode = ELM_PHOTOCAM_ZOOM_MODE_MANUAL; @@ -1073,7 +1083,7 @@ elm_photocam_add(Evas_Object *parent) * * @ingroup Photocam */ -EAPI int +EAPI Evas_Load_Error 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 ae3c269..668addb 100644 --- a/src/lib/elm_popup.c +++ b/src/lib/elm_popup.c @@ -719,14 +719,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, int timeout) +elm_popup_timeout_set(Evas_Object *obj, double 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, "notify,timeout", _elm_popup_timeout, obj); + evas_object_smart_callback_add(wd->notify, "timeout", _elm_popup_timeout, obj); } /** diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index 67837e7..d6f573c 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,71 +26,6 @@ #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; @@ -179,7 +114,7 @@ struct _Elm_Config int input_panel_enable; int autocapital_allow; int autoperiod_allow; - int password_show_last_character; + Eina_Bool password_show_last_character; }; struct _Elm_Module @@ -268,11 +203,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 c24f273..b6f16ff 100644 --- a/src/lib/elm_progressbar.c +++ b/src/lib/elm_progressbar.c @@ -68,32 +68,31 @@ _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_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm"); - else - edje_object_signal_emit(wd->progressbar, "elm,state,icon,hidden", "elm"); + { + edje_object_part_swallow(wd->progressbar, "elm.swallow.content", wd->icon); + edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm"); + } if (wd->label) - 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); + { + edje_object_part_text_set(wd->progressbar, "elm.text", wd->label); + edje_object_signal_emit(wd->progressbar, "elm,state,text,visible", "elm"); + } if (wd->pulse) - edje_object_signal_emit(wd->progressbar, "elm,state,pulse", "elm"); - else - 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"); + edje_object_signal_emit(wd->progressbar, "elm,state,pulse", "elm"); else - edje_object_signal_emit(wd->progressbar, "elm,state,units,hidden", "elm"); + 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"); + if (wd->horizontal) evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1); else @@ -101,6 +100,9 @@ _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); @@ -136,12 +138,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); } } @@ -186,8 +188,11 @@ 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"); @@ -195,6 +200,7 @@ 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; @@ -209,7 +215,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, 1); + evas_object_pass_events_set(wd->spacer, EINA_TRUE); elm_widget_sub_object_add(obj, wd->spacer); edje_object_part_swallow(wd->progressbar, "elm.swallow.bar", wd->spacer); @@ -277,7 +283,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"); @@ -289,7 +295,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 beween 0.0 and 1.0) + * @param val The fraction value (must be between 0.0 and 1.0) * * @ingroup Progressbar */ @@ -342,13 +348,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); @@ -375,6 +381,8 @@ 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 @@ -392,12 +400,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); } @@ -420,6 +428,30 @@ 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 @@ -487,13 +519,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 e2a65e9..9d3c4bd 100644 --- a/src/lib/elm_radio.c +++ b/src/lib/elm_radio.c @@ -60,6 +60,11 @@ 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[] = { @@ -67,6 +72,23 @@ 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) { @@ -80,6 +102,23 @@ _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); @@ -98,6 +137,11 @@ _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); @@ -187,25 +231,37 @@ _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 -_signal_radio_on(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +_activate(Evas_Object *obj) { - Widget_Data *wd = elm_widget_data_get(data); + Widget_Data *wd = elm_widget_data_get(obj); 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(data, SIG_CHANGED, NULL); + 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); } /** * Add a new radio to the parent * - * @param[in] parent The parent object + * @param parent The parent object * @return The new object or NULL if it cannot be created * * @ingroup Radio @@ -217,16 +273,23 @@ 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"); @@ -251,8 +314,8 @@ elm_radio_add(Evas_Object *parent) /** * Set the text label of the radio object * - * @param[in] obj The radio object - * @param[in] label The text label string in UTF-8 + * @param obj The radio object + * @param label The text label string in UTF-8 * * @ingroup Radio */ @@ -280,7 +343,7 @@ elm_radio_label_set(Evas_Object *obj, const char *label) /** * Get the text label of the radio object * - * @param[in] obj The radio object + * @param obj The radio object * @return The text label string in UTF-8 * * @ingroup Radio @@ -298,9 +361,11 @@ 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[in] obj The radio object - * @param[in] icon The icon object + * @param obj The radio object + * @param icon The icon object * * @ingroup Radio */ @@ -328,7 +393,7 @@ elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Get the icon object of the radio object * - * @param[in] obj The radio object + * @param obj The radio object * @return The icon object * * @ingroup Radio @@ -343,6 +408,30 @@ 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 @@ -350,8 +439,8 @@ elm_radio_icon_get(const Evas_Object *obj) * about eacthother. This adds the given radio object to the group of which * the group object indicated is a member. * - * @param[in] obj The radio object - * @param[in] group The object whose group the object is to join + * @param obj The radio object + * @param group The object whose group the object is to join * * @ingroup Radio */ @@ -387,8 +476,8 @@ elm_radio_group_add(Evas_Object *obj, Evas_Object *group) * * This sets the value of the radio. * - * @param[in] obj The radio object - * @param[in] value The value to use if this radio object is selected + * @param obj The radio object + * @param value The value to use if this radio object is selected * * @ingroup Radio */ @@ -404,13 +493,32 @@ 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[in] obj The radio object - * @param[in] value The value to use for the group + * @param obj The radio object + * @param value The value to use for the group * * @ingroup Radio */ @@ -429,7 +537,7 @@ elm_radio_value_set(Evas_Object *obj, int value) /** * Get the state of the radio object * - * @param[in] obj The radio object + * @param obj The radio object * @return The integer state * * @ingroup Radio @@ -453,8 +561,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[in] obj The radio object - * @param[in] valuep Pointer to the integer to modify + * @param obj The radio object + * @param valuep Pointer to the integer to modify * * @ingroup Radio */ diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 51120fa..d3faf3e 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -50,6 +50,10 @@ 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"; @@ -73,6 +77,95 @@ 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) { @@ -88,14 +181,43 @@ _theme_hook(Evas_Object *obj) if (!wd) return; if (wd->scr) { - elm_smart_scroller_object_theme_set(obj, wd->scr, + Evas_Object *edj; + const char *str; + + 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) { @@ -106,9 +228,26 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source) } static void -_show_region_hook(void *data, Evas_Object *obj) +_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; @@ -118,9 +257,16 @@ _show_region_hook(void *data, Evas_Object *obj) } static void -_sizing_eval(Evas_Object *obj) +_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; @@ -129,38 +275,30 @@ _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(w > vw) vw = w; - if ((minw > 0) && (vw < minw)) vw = minw; + 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(h > vh) vh = h; - if ((minh > 0) && (vh < minh)) vh = minh; + 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); } } @@ -174,7 +312,6 @@ _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; @@ -194,7 +331,6 @@ _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; @@ -205,7 +341,6 @@ _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; @@ -216,7 +351,6 @@ _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; @@ -227,7 +361,6 @@ _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; @@ -311,25 +444,33 @@ 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); - elm_smart_scroller_object_theme_set(obj, wd->scr, - wd->widget_name, wd->widget_base, - elm_widget_style_get(obj)); + _theme_hook(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); @@ -362,6 +503,14 @@ 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). @@ -388,8 +537,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); } @@ -420,7 +569,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 objecet + * @param obj The slider object * @return The content that was being used * * @ingroup Scroller @@ -442,7 +591,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") @@ -455,7 +604,8 @@ 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; - if ((!widget) || (!base)) return; + EINA_SAFETY_ON_NULL_RETURN(widget); + EINA_SAFETY_ON_NULL_RETURN(base); if (eina_stringshare_replace(&wd->widget_name, widget) | eina_stringshare_replace(&wd->widget_base, base)) _theme_hook(obj); @@ -505,9 +655,8 @@ 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) return; - if (wd->scr) - elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); + if ((!wd) || (!wd->scr)) return; + elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } /** @@ -536,10 +685,9 @@ 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) return; + if ((!wd) || (!wd->scr)) return; if ((policy_h >= 3) || (policy_v >= 3)) return; - if (wd->scr) - elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]); + elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]); } EAPI void @@ -547,12 +695,10 @@ 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); - 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; + if ((!wd) || (!wd->scr)) return; + elm_smart_scroller_policy_get(wd->scr, + (Elm_Smart_Scroller_Policy *) policy_h, + (Elm_Smart_Scroller_Policy *) policy_v); } /** @@ -575,12 +721,9 @@ 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) 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); - } + 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); } /** @@ -611,7 +754,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 parameers for each axis. + * axis with the boolean parameters for each axis. * * @param obj The scroller object * @param h_bounce Will the scroller bounce horizontally or not @@ -624,9 +767,8 @@ 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) return; - if (wd->scr) - elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); + if ((!wd) || (!wd->scr)) return; + elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); } /** @@ -648,15 +790,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 sapale of limiting scrolling by the user to "pages". That + * The 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 conent is split into page sized pieces. This sets + * 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_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. @@ -681,10 +823,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 relaive to the viewport, sets it to an absolute fixed value, with + * being relative to the viewport, sets it to an absolute fixed value, with * 0 turning it off for that axis. * * @param obj The scroller object @@ -707,7 +849,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 @@ -730,41 +872,57 @@ 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) return; - if (wd->scr) - elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); + if ((!wd) || (!wd->scr)) return; + elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); } + /** - * Set scroll only one page + * Set event propagation on a scroller * + * 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 set Flag + * @param propagation If propagation is enabled or not * * @ingroup Scroller */ EAPI void -elm_scroller_page_move_set(Evas_Object *obj, Eina_Bool set) +elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool propagation) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - elm_smart_scroller_page_move_set(wd->scr, set); + evas_object_propagate_events_set(wd->scr, propagation); } /** - * Set events propagation + * Get event propagation for a scroller * + * This gets the event propagation for a scroller. See + * elm_scroller_propagate_events_set() for more information + * * @param obj The scroller object - * @param set Flag + * @return The propagation state * * @ingroup Scroller */ -EAPI void -elm_scroller_propagate_events_set(Evas_Object *obj, Eina_Bool set) +EAPI Eina_Bool +elm_scroller_propagate_events_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (!wd) return EINA_FALSE; - evas_object_propagate_events_set(wd->scr, set); + return evas_object_propagate_events_get(wd->scr); } + + + +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 319ff35..c3d0cdd 100644 --- a/src/lib/elm_separator.c +++ b/src/lib/elm_separator.c @@ -71,8 +71,11 @@ 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; @@ -81,7 +84,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, 0); + elm_widget_can_focus_set(obj, EINA_FALSE); 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 e4e8f46..c2d569d 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -1,6 +1,3 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #include #include "elm_priv.h" @@ -48,40 +45,43 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { Evas_Object *slider; - Evas_Object *icon; + Evas_Object *icon; + Evas_Object *end; 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 SLIDER_THUMB_MOVE_STEP 100 +#define ELM_SLIDER_INVERTED_FACTOR (-1.0) +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,19 +94,98 @@ 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); @@ -115,44 +194,53 @@ _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_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"); + { + 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"); else - edje_object_signal_emit(wd->slider, "elm,state,eicon,hidden", "elm"); + edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm"); if (wd->label) - 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); + { + edje_object_part_text_set(wd->slider, "elm.text", wd->label); + edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm"); + } + 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); @@ -170,9 +258,7 @@ _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->e_icon) return; - + if ((obj != wd->icon) && (obj != wd->end)) return; _sizing_eval(data); } @@ -184,17 +270,21 @@ _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->e_icon) + if (sub == wd->end) { - 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; + 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); _sizing_eval(obj); } } @@ -215,17 +305,18 @@ _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); } } @@ -252,12 +343,11 @@ _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); } @@ -269,15 +359,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); @@ -287,12 +377,6 @@ 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); @@ -304,56 +388,72 @@ 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__) { - elm_widget_scroll_hold_pop(data); _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); + _units_set(data); + _indicator_set(data); } static void _drag_up(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - Widget_Data *wd = elm_widget_data_get(data); - edje_object_part_drag_step(wd->slider, "elm.dragable.slider", -0.05, -0.05); + 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); } static void _drag_down(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { - Widget_Data *wd = elm_widget_data_get(data); - edje_object_part_drag_step(wd->slider, "elm.dragable.slider", 0.05, 0.05); + 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); } static void -_spacer_cb(void *data, Evas * e, Evas_Object * obj, void *event_info) +_spacer_cb(void *data, Evas *e, Evas_Object *obj __UNUSED__, 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; @@ -373,8 +473,6 @@ _spacer_cb(void *data, Evas * e, Evas_Object * obj, void *event_info) wd->feed_cnt = 0; } -static const char*widtype = NULL; - /** * Add a new slider to the parent * @@ -390,45 +488,47 @@ elm_slider_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - e = evas_object_evas_get(parent); - if (e == NULL) return NULL; + 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, "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_stop, obj); + edje_object_signal_callback_add(wd->slider, "drag,step", "*", _drag_step, 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, "mouse,wheel,0,-1", "*", _drag_up, obj); - edje_object_signal_callback_add(wd->slider, "mouse,wheel,0,1", "*", _drag_down, obj); +// edje_object_signal_callback_add(wd->slider, "drag,set", "*", _drag_stop, 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, 1); + evas_object_pass_events_set(wd->spacer, EINA_TRUE); 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); @@ -456,13 +556,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); @@ -486,13 +586,18 @@ elm_slider_label_get(const Evas_Object *obj) } /** - * Set the icon object of the slider object + * Set the icon object (leftmost widget) 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 @@ -506,17 +611,50 @@ 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.content", 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.icon", icon); + edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm"); + edje_object_message_signal_process(wd->slider); } _sizing_eval(obj); } /** - * Get the icon object of the slider object + * 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. * * @param obj The slider object * @return The icon object @@ -557,6 +695,10 @@ 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); } @@ -605,13 +747,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); @@ -741,9 +883,6 @@ 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); @@ -776,7 +915,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 beween min and max for the slider) + * @param val The value (must be between min and max for the slider) * * @ingroup Slider */ @@ -883,200 +1022,169 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(d _indicator_set(obj); } - -////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////// supporting beat feature /////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////// - - - /** - * Set the end side icon object of the slider object + * Set the end object (rightmost widget) of the slider object. * - * 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. + * 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. * * @param obj The slider object - * @param icon The icon object - * - * @return 1 if icon set succeed, 0 if there is no part for the end side icon - * + * @param end The end object + * + * @note If the object being set does not have minimum size hints set, + * it won't get properly displayed. + * * @ingroup Slider */ -EAPI Eina_Bool -elm_slider_end_icon_set(Evas_Object *obj, Evas_Object *icon) +EAPI void +elm_slider_end_set(Evas_Object *obj, Evas_Object *end) { + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - - if ((wd->e_icon != icon) && (wd->e_icon)) - elm_widget_sub_object_del(obj, wd->e_icon); - - if (icon) + if (!wd) return; + if (wd->end == end) return; + if (wd->end) evas_object_del(wd->end); + wd->end = end; + if (end) { - 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); + 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); } - - return EINA_TRUE; + _sizing_eval(obj); } - /** - * Get the end side icon object of the slider object + * Unset the rightmost widget of the slider, unparenting and + * returning it. * * @param obj The slider object - * @return The end side icon object + * @return the previously set end sub-object of this slider, on + * success. + * + * @see elm_slider_end_set() * * @ingroup Slider */ EAPI Evas_Object * -elm_slider_end_icon_get(Evas_Object *obj) +elm_slider_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; - return wd->e_icon; + 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; } - /** - * Set whether showing the number(indicator) or not. + * Get the end icon object of the slider object. This object is owned + * by the scrolled entry and should not be modified. * * @param obj The slider object - * @param show 1 will show the number, 0 will not. + * @return The end icon object * * @ingroup Slider */ -EAPI void -elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show) +EAPI Evas_Object * +elm_slider_end_get(const Evas_Object *obj) { + ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - 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"); + if (!wd) return NULL; + return wd->end; } -static Eina_Bool -_mv_timer_cb(void *data) +/** + * 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) { - Evas_Object* obj = (Evas_Object*)data; + ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - - 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; + 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"); + } } - /** - * Move the thumb to the specified value. + * Get the state of indicator in the slider (if it's being shown or + * not). * - * This is different with elm_slider_value_set() in animated moving. - * * @param obj The slider object - * @param val thumb's destination value. + * @return @c EINA_TRUE if the indicator is being shown, @c EINA_FALSE + * otherwise. * - * @ingroup Slider + * @ingroup Slider */ -EAPI void -elm_slider_value_animated_set(Evas_Object *obj, double val) +EAPI Eina_Bool +elm_slider_indicator_show_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->indicator_show; +} - if (wd->val == val) return; - 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; +////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////// DEPRECTAED /////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////// - if(wd->mv_timer) - { - ecore_timer_del(wd->mv_timer); - wd->mv_timer = NULL; - } +EAPI Eina_Bool +elm_slider_end_icon_set(Evas_Object *obj, Evas_Object *icon) +{ + elm_slider_end_set(obj, icon); + return EINA_TRUE; +} - wd->mv_timer = ecore_timer_add(0.005, _mv_timer_cb, obj); +EAPI Evas_Object * +elm_slider_end_icon_get(Evas_Object *obj) +{ + return elm_slider_end_get(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) { - 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); + return ; } -/** - * 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) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - return wd->e_label; + return NULL; } diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c index c74ff21..67b6af7 100644 --- a/src/lib/elm_slideshow.c +++ b/src/lib/elm_slideshow.c @@ -20,14 +20,11 @@ typedef struct _Widget_Data Widget_Data; struct _Elm_Slideshow_Item { - Evas_Object *obj; + Elm_Widget_Item base; Eina_List *l, *l_built; - const void *data; const Elm_Slideshow_Item_Class *itc; - - Evas_Object *o; }; struct _Widget_Data @@ -60,6 +57,45 @@ 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) @@ -76,6 +112,23 @@ _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); @@ -100,17 +153,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->obj); + Widget_Data *wd = elm_widget_data_get(item->base.widget); 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->obj); + Widget_Data *wd = elm_widget_data_get(item->base.widget); 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; } @@ -132,42 +185,42 @@ static void _item_realize(Elm_Slideshow_Item *item) { Elm_Slideshow_Item *_item; - Evas_Object *obj = item->obj; + Evas_Object *obj = item->base.widget; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if ((!item->o) && (item->itc->func.get)) + if ((!item->base.view) && (item->itc->func.get)) { - item->o = item->itc->func.get((void*)item->data, obj); - evas_object_smart_member_add(item->o, obj); + item->base.view = item->itc->func.get((void*)item->base.data, obj); + evas_object_smart_member_add(item->base.view, 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->o); + evas_object_hide(item->base.view); } 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->o) && (_item->itc->func.get)) + if ((_item) && (!_item->base.view) && (_item->itc->func.get)) { - _item->o = _item->itc->func.get((void*)_item->data, obj); - evas_object_smart_member_add(_item->o, obj); + _item->base.view = _item->itc->func.get((void*)_item->base.data, obj); + evas_object_smart_member_add(_item->base.view, 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->o); + evas_object_hide(_item->base.view); } 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->o) && (_item->itc->func.get)) + if ((_item) && (!_item->base.view) && (_item->itc->func.get)) { - _item->o = _item->itc->func.get((void*)_item->data, obj); - evas_object_smart_member_add(_item->o, obj); + _item->base.view = _item->itc->func.get((void*)_item->base.data, obj); + evas_object_smart_member_add(_item->base.view, 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->o); + evas_object_hide(_item->base.view); } else if ((_item) && (_item->l_built)) wd->items_built = eina_list_demote_list(wd->items_built, _item->l_built); @@ -178,9 +231,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->data, _item->o); - evas_object_del(_item->o); - _item->o = NULL; + item->itc->func.del((void*)item->base.data, _item->base.view); + evas_object_del(_item->base.view); + _item->base.view = NULL; } } @@ -194,21 +247,21 @@ _end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, c item = wd->previous; if(item) { - edje_object_part_unswallow(NULL, item->o); - evas_object_hide(item->o); + edje_object_part_unswallow(NULL, item->base.view); + evas_object_hide(item->base.view); wd->previous = NULL; } item = wd->current; - if (!item || !item->o) return; + if ((!item) || (!item->base.view)) return; _item_realize(item); - edje_object_part_unswallow(NULL, item->o); - evas_object_show(item->o); + edje_object_part_unswallow(NULL, item->base.view); + evas_object_show(item->base.view); edje_object_signal_emit(wd->slideshow, "anim,end", "slideshow"); - edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->o); + edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->base.view); } @@ -240,15 +293,21 @@ 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; @@ -294,10 +353,9 @@ 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 = calloc(1, sizeof(Elm_Slideshow_Item)); - item->data = data; + item = elm_widget_item_new(obj, Elm_Slideshow_Item); + item->base.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); @@ -321,24 +379,22 @@ elm_slideshow_show(Elm_Slideshow_Item *item) char buf[1024]; Elm_Slideshow_Item *next = NULL; Widget_Data *wd; - if (!item) - return; - ELM_CHECK_WIDTYPE(item->obj, widtype); - wd = elm_widget_data_get(item->obj); + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + wd = elm_widget_data_get(item->base.widget); if (!wd) return; if (item == wd->current) return; next = item; - _end(item->obj, item->obj, NULL, NULL); + _end(item->base.widget, item->base.widget, NULL, NULL); if (wd->timer) ecore_timer_del(wd->timer); if (wd->timeout > 0) - wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->obj); + wd->timer = ecore_timer_add(wd->timeout, _timer_cb, item->base.widget); _item_realize(next); - edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->o); - evas_object_show(next->o); + edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view); + evas_object_show(next->base.view); snprintf(buf, sizeof(buf), "%s,next", wd->transition); edje_object_signal_emit(wd->slideshow, buf, "slideshow"); wd->previous = wd->current; @@ -366,7 +422,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); @@ -377,8 +433,8 @@ elm_slideshow_next(Evas_Object *obj) _item_realize(next); - edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->o); - evas_object_show(next->o); + edje_object_part_swallow(wd->slideshow, "elm.swallow.2", next->base.view); + evas_object_show(next->base.view); snprintf(buf, sizeof(buf), "%s,next", wd->transition); edje_object_signal_emit(wd->slideshow, buf, "slideshow"); @@ -407,7 +463,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); @@ -417,8 +473,8 @@ elm_slideshow_previous(Evas_Object *obj) _item_realize(prev); - edje_object_part_swallow(wd->slideshow, "elm.swallow.2", prev->o); - evas_object_show(prev->o); + edje_object_part_swallow(wd->slideshow, "elm.swallow.2", prev->base.view); + evas_object_show(prev->base.view); snprintf(buf, 1024, "%s,previous", wd->transition); edje_object_signal_emit(wd->slideshow, buf, "slideshow"); @@ -435,7 +491,7 @@ elm_slideshow_previous(Evas_Object *obj) * * @ingroup Slideshow */ -const Eina_List * +EAPI const Eina_List * elm_slideshow_transitions_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -452,7 +508,7 @@ elm_slideshow_transitions_get(const Evas_Object *obj) * * @ingroup Slideshow */ -const Eina_List * +EAPI const Eina_List * elm_slideshow_layouts_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; @@ -624,15 +680,16 @@ 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->data, item->o); - evas_object_del(item->o); + 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; } EINA_LIST_FREE(wd->items, item) - { - free(item); - } + { + elm_widget_item_del(item); + } } @@ -646,8 +703,8 @@ elm_slideshow_clear(Evas_Object *obj) EAPI void elm_slideshow_item_del(Elm_Slideshow_Item *item) { - if (!item) return; - Widget_Data *wd = elm_widget_data_get(item->obj); + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + Widget_Data *wd = elm_widget_data_get(item->base.widget); if (!wd) return; if (wd->previous == item) wd->previous = NULL; if (wd->current == item) @@ -664,10 +721,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->o && item->itc->func.del) - item->itc->func.del((void*)item->data, wd->previous->o); - if (item->o) - evas_object_del(item->o); + 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); free(item); } @@ -714,10 +771,10 @@ elm_slideshow_item_current_get(const Evas_Object *obj) * @ingroup Slideshow */ EAPI Evas_Object * -elm_slideshow_item_object_get(Elm_Slideshow_Item * item) +elm_slideshow_item_object_get(const Elm_Slideshow_Item * item) { - if (!item) return NULL; - return item->o; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return item->base.view; } /** @@ -729,8 +786,8 @@ elm_slideshow_item_object_get(Elm_Slideshow_Item * item) * @ingroup Slideshow */ EAPI void * -elm_slideshow_item_data_get(Elm_Slideshow_Item * item) +elm_slideshow_item_data_get(const Elm_Slideshow_Item * item) { - if (!item) return NULL; - return (void *)item->data; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return elm_widget_item_data_get(item); } diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index f1a2c7a..e11cddf 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -40,9 +40,10 @@ 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; @@ -52,6 +53,9 @@ 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) @@ -63,11 +67,13 @@ _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); } @@ -77,9 +83,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 @@ -96,16 +102,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->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)) +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 NULL; - return edje_object_signal_callback_del(wd->spinner, emission, source, - func_cb); + edje_object_signal_callback_del_full(wd->spinner, emission, source, + func_cb, data); } static void @@ -116,12 +121,14 @@ _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); - 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"); + edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm"); else - edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm"); + 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); _sizing_eval(obj); } @@ -131,9 +138,15 @@ _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"); + { + edje_object_signal_emit(wd->spinner, "elm,action,focus", "elm"); + evas_object_focus_set(wd->spinner, EINA_TRUE); + } else - edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm"); + { + edje_object_signal_emit(wd->spinner, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->spinner, EINA_FALSE); + } } static Eina_Bool @@ -199,11 +212,13 @@ _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 @@ -486,27 +501,48 @@ _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNU wd->delay = ecore_timer_add(0.2, _delay_change, data); } -static void -_entry_event_key_down(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_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) +static Eina_Bool +_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, 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); + 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; } /** @@ -524,12 +560,16 @@ 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); @@ -538,6 +578,8 @@ 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; @@ -572,11 +614,6 @@ 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); @@ -714,7 +751,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 beween min and max for the spinner) + * @param val The value (must be between min and max for the spinner) * * @ingroup Spinner */ diff --git a/src/lib/elm_store.c b/src/lib/elm_store.c new file mode 100644 index 0000000..dba552b --- /dev/null +++ b/src/lib/elm_store.c @@ -0,0 +1,754 @@ +#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 ac5e997..2582664 100644 --- a/src/lib/elm_table.c +++ b/src/lib/elm_table.c @@ -41,6 +41,42 @@ _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) { @@ -69,14 +105,6 @@ _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); } @@ -95,8 +123,11 @@ 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"); @@ -104,6 +135,9 @@ 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, @@ -135,10 +169,28 @@ 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 @@ -153,6 +205,24 @@ 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 cabef97..5efd05e 100644 --- a/src/lib/elm_thumb.c +++ b/src/lib/elm_thumb.c @@ -49,19 +49,20 @@ struct _Widget_Data Eina_Bool is_video : 1; Eina_Bool was_video : 1; Eina_Bool edit : 1; - }; static const char *widtype = NULL; -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[] = { +#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[] = +{ {SIG_CLICKED, ""}, {SIG_CLICKED_DOUBLE, ""}, {SIG_GENERATE_ERROR, ""}, @@ -72,12 +73,12 @@ static const Evas_Smart_Cb_Description _signals[] = { {NULL, NULL} }; -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"; +#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" struct _Ethumb_Client *_elm_ethumb_client = NULL; Eina_Bool _elm_ethumb_connected = EINA_FALSE; @@ -105,7 +106,8 @@ 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 @@ -114,6 +116,7 @@ _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) @@ -129,9 +132,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) @@ -245,10 +248,20 @@ _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); @@ -258,17 +271,14 @@ _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); } } @@ -360,7 +370,7 @@ void _elm_unneed_ethumb(void) { #ifdef ELM_ETHUMB - if (-- _elm_need_ethumb != 0) return; + if (--_elm_need_ethumb) return; ethumb_client_disconnect(_elm_ethumb_client); _elm_ethumb_client = NULL; @@ -387,10 +397,13 @@ EAPI Eina_Bool elm_need_ethumb(void) { #ifdef ELM_ETHUMB - if (_elm_need_ethumb ++ != 0) return; + if (_elm_need_ethumb++) return EINA_TRUE; 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 } @@ -413,8 +426,11 @@ 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"); @@ -422,6 +438,7 @@ 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"); @@ -458,6 +475,34 @@ 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: @@ -469,6 +514,7 @@ elm_thumb_add(Evas_Object *parent) * @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 @@ -487,8 +533,10 @@ 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) @@ -508,7 +556,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 } @@ -531,6 +579,7 @@ 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) @@ -557,6 +606,7 @@ 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) @@ -581,11 +631,7 @@ 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); - if (setting < ELM_THUMB_ANIMATION_START || - setting >= ELM_THUMB_ANIMATION_LAST) - { - return; - } + EINA_SAFETY_ON_TRUE_RETURN(setting >= ELM_THUMB_ANIMATION_LAST); wd->anim_setting = setting; if (setting == ELM_THUMB_ANIMATION_LOOP) @@ -659,7 +705,7 @@ elm_thumb_animate_get(const Evas_Object *obj) * * @ingroup Thumb */ -EAPI struct _Ethumb_Client * +EAPI void * elm_thumb_ethumb_client_get(void) { return _elm_ethumb_client; @@ -677,7 +723,6 @@ elm_thumb_ethumb_client_connected(void) return _elm_ethumb_connected; } - EAPI Eina_Bool elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit) { @@ -699,10 +744,11 @@ elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit) } EAPI Eina_Bool -elm_thumb_editable_get(Evas_Object *obj) +elm_thumb_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 wd->edit; } diff --git a/src/lib/elm_toggle.c b/src/lib/elm_toggle.c index 3a7b479..52137bf 100644 --- a/src/lib/elm_toggle.c +++ b/src/lib/elm_toggle.c @@ -36,6 +36,9 @@ 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[] = { @@ -43,6 +46,25 @@ 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) { @@ -66,6 +88,23 @@ _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); @@ -86,6 +125,8 @@ _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); @@ -154,7 +195,7 @@ _signal_toggle_on(void *data, Evas_Object *obj __UNUSED__, const char *emission /** * Add a toggle to @p parent. * - * @param[in] parent The parent object + * @param parent The parent object * * @return The toggle object * @@ -167,16 +208,22 @@ 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"); @@ -203,8 +250,8 @@ elm_toggle_add(Evas_Object *parent) /** * Sets the label to be displayed with the toggle. * - * @param[in] obj The toggle object - * @param[in] label The label to be displayed + * @param obj The toggle object + * @param label The label to be displayed * * @ingroup Toggle */ @@ -227,7 +274,7 @@ elm_toggle_label_set(Evas_Object *obj, const char *label) /** * Gets the label of the toggle * - * @param[in] obj The toggle object + * @param obj toggleeee object * @return The label of the toggle * * @ingroup Toggle @@ -242,12 +289,14 @@ elm_toggle_label_get(const Evas_Object *obj) } /** - * Sets the icon to be displayed with the toggle. + * Set the icon used for the toggle * - * Once the icon object is set, a previously set one will be deleted. + * 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. * - * @param[in] obj The toggle object - * @param[in] icon The icon object to be displayed + * @param obj The toggle object + * @param icon The icon object for the button * * @ingroup Toggle */ @@ -273,10 +322,12 @@ elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) } /** - * Gets the icon of the toggle + * Get the icon used for the toggle * - * @param[in] obj The toggle object - * @return The icon object + * Return the icon object which is set for this widget. + * + * @param obj The toggle object + * @return The icon object that is being used * * @ingroup Toggle */ @@ -290,11 +341,35 @@ 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[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 + * @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 * * @ingroup Toggle */ @@ -315,9 +390,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[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 + * @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 * * @ingroup Toggle */ @@ -336,8 +411,8 @@ elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const /** * Sets the state of the toggle to @p state. * - * @param[in] obj The toggle object - * @param[in] state The state of @p obj + * @param obj The toggle object + * @param state The state of @p obj * * @ingroup Toggle */ @@ -361,7 +436,7 @@ elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) /** * Gets the state of the toggle to @p state. * - * @param[in] obj The toggle object + * @param obj The toggle object * @return The state of @p obj * * @ingroup Toggle @@ -378,8 +453,8 @@ elm_toggle_state_get(const Evas_Object *obj) /** * Sets the state pointer of the toggle to @p statep. * - * @param[in] obj The toggle object - * @param[in] statep The state pointer of @p obj + * @param obj The toggle object + * @param statep The state pointer of @p obj * * @ingroup Toggle */ diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 842ac8e..eedac21 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -14,33 +14,55 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { Evas_Object *scr, *bx; - Eina_List *items; - int icon_size; - Eina_Bool scrollable : 1; Evas_Object *menu_parent; - Eina_Bool homogeneous : 1; + Eina_Inlist *items; + Elm_Toolbar_Item *more_item, *selected_item; + Elm_Toolbar_Shrink_Mode shrink_mode; + Elm_Icon_Lookup_Order lookup_order; + int icon_size; double align; + Eina_Bool homogeneous : 1; + Eina_Bool no_select : 1; + Ecore_Job *resize_job; }; struct _Elm_Toolbar_Item { - Evas_Object *obj; - Evas_Object *base; + Elm_Widget_Item base; + EINA_INLIST; const char *label; + const char *icon_str; Evas_Object *icon; + Evas_Object *o_menu; Evas_Smart_Cb func; - Evas_Smart_Cb del_cb; - const void *data; + struct { + int priority; + Eina_Bool visible : 1; + } prio; Eina_Bool selected : 1; Eina_Bool disabled : 1; Eina_Bool separator : 1; Eina_Bool menu : 1; - Evas_Object *o_menu; + 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; }; 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); @@ -50,61 +72,104 @@ 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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); 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, &x, &y, &w, &h); + evas_object_geometry_get(it->base.view, &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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); Evas_Object *obj2; - const Eina_List *l; if (!wd) return; if ((it->selected) || (it->disabled) || (it->separator)) return; - EINA_LIST_FOREACH(wd->items, l, it2) + + if (!wd->no_select) { - if (it2->selected) - { - it2->selected = EINA_FALSE; - edje_object_signal_emit(it2->base, "elm,state,unselected", "elm"); - break; - } + 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); } - it->selected = EINA_TRUE; - edje_object_signal_emit(it->base, "elm,state,selected", "elm"); - _item_show(it); - obj2 = it->obj; - if(it->menu) + obj2 = it->base.widget; + if (it->menu) { evas_object_show(it->o_menu); - evas_object_event_callback_add(it->base, EVAS_CALLBACK_RESIZE, + evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_RESIZE, _menu_move_resize, it); - evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOVE, + evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOVE, _menu_move_resize, it); _menu_move_resize(it, NULL, NULL, NULL); } - if (it->func) it->func((void *)(it->data), it->obj, it); + if (it->func) it->func((void *)(it->base.data), it->base.widget, 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; - elm_toolbar_item_unselect_all(it->obj); + selected = elm_toolbar_selected_item_get(it->base.widget); + _item_unselect(selected); } static void @@ -120,43 +185,71 @@ _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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); if ((!wd) || (!wd->menu_parent)) return; - evas_object_geometry_get(it->base, &x, &y, &w, &h); + evas_object_geometry_get(it->base.view, &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->obj); + Widget_Data *wd = elm_widget_data_get(it->base.widget); if (!wd) return; if (it->disabled == disabled) return; it->disabled = disabled; if (it->disabled) - edje_object_signal_emit(it->base, "elm,state,disabled", "elm"); + { + edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm"); + elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); + } else - edje_object_signal_emit(it->base, "elm,state,enabled", "elm"); + { + 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); } static void _del_pre_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - Elm_Toolbar_Item *it; + Elm_Toolbar_Item *it, *next; if (!wd) return; - EINA_LIST_FREE(wd->items, it) + it = ELM_TOOLBAR_ITEM_FROM_INLIST(wd->items); + while(it) { - 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); + next = ELM_TOOLBAR_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); + _item_del(it); + it = next; } + if (wd->more_item) + _item_del(wd->more_item); } static void @@ -168,54 +261,68 @@ _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); - 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); - } + 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); _sizing_eval(obj); } @@ -223,7 +330,7 @@ static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - Evas_Coord minw = -1, minh = -1; + Evas_Coord minw = -1, minh = -1, minw_bx; Evas_Coord vw = 0, vh = 0; Evas_Coord w, h; @@ -238,51 +345,242 @@ _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); - if (wd->scrollable) - minw = w - vw; - else - minw = minw + (w - vw); + 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; + } minh = minh + (h - vh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); } static void -_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +_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) { 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 (vw >= mw) + 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 (w != vw) evas_object_resize(wd->bx, vw, h); + 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); + } + } } - EINA_LIST_FOREACH(wd->items, l, it) + else { - if (it->selected) - { - _item_show(it); - break; - } + 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; + } + } } } 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; @@ -290,6 +588,75 @@ _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. * @@ -306,8 +673,11 @@ 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"); @@ -316,19 +686,25 @@ 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, 0); + elm_widget_can_focus_set(obj, EINA_FALSE); + 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, 1, 0); + elm_smart_scroller_bounce_allow_set(wd->scr, + _elm_config->thumbscroll_bounce_enable, + EINA_FALSE); 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 = 32; - wd->scrollable = EINA_TRUE; + + wd->icon_size = _elm_toolbar_icon_size_get(wd); + + wd->homogeneous = EINA_TRUE; wd->align = 0.5; @@ -339,7 +715,10 @@ 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; @@ -359,7 +738,6 @@ 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); @@ -383,186 +761,842 @@ elm_toolbar_icon_size_get(const Evas_Object *obj) } /** - * Add an item to the toolbar. + * Append item to the toolbar * * @param obj The toolbar object - * @param icon The icon object of the item + * @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_add(Evas_Object *obj, Evas_Object *icon, const char *label, Evas_Smart_Cb func, const void *data) +elm_toolbar_item_append(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); - Evas_Coord mw, mh; - Elm_Toolbar_Item *it; - if (!wd) return NULL; - it = ELM_NEW(Elm_Toolbar_Item); + + Elm_Toolbar_Item *it = _item_new(obj, icon, label, func, data); 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; - 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); + 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); _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); +} + /** - * Get the icon associated with @p item. + * Sets the next @p item state as the current state. * - * @param item The toolbar item - * @return The icon object + * @param item The item. * * @ingroup Toolbar */ -EAPI Evas_Object * -elm_toolbar_item_icon_get(Elm_Toolbar_Item *item) +EAPI Elm_Toolbar_Item_State * +elm_toolbar_item_state_next(Elm_Toolbar_Item *item) { - if (!item) return NULL; - return item->icon; + 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); } /** - * Get the label associated with @p item. + * Sets the previous @p item state as the current state. * - * @param item The toolbar item - * @return The label + * @param item The item. * * @ingroup Toolbar */ -EAPI const char * -elm_toolbar_item_label_get(const Elm_Toolbar_Item *item) +EAPI Elm_Toolbar_Item_State * +elm_toolbar_item_state_prev(Elm_Toolbar_Item *item) { - if (!item) return NULL; - return item->label; + 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); } /** - * Get the selected state of @p item. + * Unset the state of @p it + * The default icon and label from this item will be displayed. * - * @param item The toolbar item - * @return If true, the item is selected + * @param it The item. * * @ingroup Toolbar */ -EAPI Eina_Bool -elm_toolbar_item_selected_get(const Elm_Toolbar_Item *item) +EAPI void +elm_toolbar_item_state_unset(Elm_Toolbar_Item *it) { - if (!item) return EINA_FALSE; - return item->selected; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it); + elm_toolbar_item_state_set(it, NULL); } /** - * Set the label associated with @p item. + * 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 item The toolbar item - * @param label The label of @p item + * @param it The item. + * @param state The state to use. + * + * @return True if the state was correctly set. * * @ingroup Toolbar */ -EAPI void -elm_toolbar_item_label_set(Elm_Toolbar_Item *item, const char *label) +EAPI Eina_Bool +elm_toolbar_item_state_set(Elm_Toolbar_Item *it, Elm_Toolbar_Item_State *state) { - Evas_Coord mw = -1, mh = -1; + 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); - if (!item) return; - eina_stringshare_replace(&item->label, label); - edje_object_part_text_set(item->base, "elm.text", item->label); + 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); elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(item->base, &mw, &mh, mw, 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, -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); + 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"); } +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); +} /** - * Delete a toolbar item. + * Set the label associated with @p item. * - * @param it The toolbar item + * @param item The toolbar item + * @param label The label of @p item * * @ingroup Toolbar */ EAPI void -elm_toolbar_item_del(Elm_Toolbar_Item *it) +elm_toolbar_item_label_set(Elm_Toolbar_Item *item, const char *label) { - Widget_Data *wd = elm_widget_data_get(it->obj); - Evas_Object *obj2 = it->obj; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + _item_label_set(item, label, "elm,state,label_set"); +} - 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); +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); } /** - * Set the function called when a toolbar item is freed. + * Get the selected state of @p item. * - * @param it The item to set the callback on - * @param func The function called + * @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_del_cb_set(Elm_Toolbar_Item *it, Evas_Smart_Cb func) +elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected) { - it->del_cb = func; + 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); } /** - * Select the toolbar item @p 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. + * + * @see elm_toolbar_icon_order_lookup_set(), elm_toolbar_icon_order_lookup_get() + * + * @ingroup Toolbar + */ +EAPI void +elm_toolbar_item_icon_set(Elm_Toolbar_Item *item, const char *icon) +{ + Evas_Object *icon_obj; + Widget_Data *wd; + Evas_Object *obj = item->base.widget; + + 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); + } +} + +/** + * Delete a toolbar item. + * + * @param item The toolbar item + * + * @ingroup Toolbar + */ +EAPI void +elm_toolbar_item_del(Elm_Toolbar_Item *item) +{ + 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); +} + +/** + * Set the function called when a toolbar item is freed. * - * @param item The toolbar item + * @param item The item to set the callback on + * @param func The function called * * @ingroup Toolbar */ EAPI void -elm_toolbar_item_select(Elm_Toolbar_Item *item) +elm_toolbar_item_del_cb_set(Elm_Toolbar_Item *item, Evas_Smart_Cb func) { - if (!item) return; - _item_select(item); + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_del_cb_set(item, func); } /** @@ -574,9 +1608,9 @@ elm_toolbar_item_select(Elm_Toolbar_Item *item) * @ingroup Toolbar */ EAPI Eina_Bool -elm_toolbar_item_disabled_get(Elm_Toolbar_Item *item) +elm_toolbar_item_disabled_get(const Elm_Toolbar_Item *item) { - if (!item) return EINA_FALSE; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); return item->disabled; } @@ -591,8 +1625,9 @@ elm_toolbar_item_disabled_get(Elm_Toolbar_Item *item) EAPI void elm_toolbar_item_disabled_set(Elm_Toolbar_Item *item, Eina_Bool disabled) { - if (!item) return; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); _item_disable(item, disabled); + _resize(item->base.widget, NULL, NULL, NULL); } /** @@ -606,10 +1641,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) { - if (!item) return; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); if (item->separator == separator) return; item->separator = separator; - _theme_hook(item->obj); + _theme_hook(item->base.view); } /** @@ -621,48 +1656,75 @@ elm_toolbar_item_separator_set(Elm_Toolbar_Item *item, Eina_Bool separator) * @ingroup Toolbar */ EAPI Eina_Bool -elm_toolbar_item_separator_get(Elm_Toolbar_Item *item) +elm_toolbar_item_separator_get(const Elm_Toolbar_Item *item) { - if (!item) return EINA_FALSE; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); return item->separator; } /** - * Set the scrollable state of toolbar @p obj. + * Set the shrink state of toolbar @p obj. * * @param obj The toolbar object - * @param scrollable If true, the toolbar will be scrollable + * @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. * * @ingroup Toolbar */ EAPI void -elm_toolbar_scrollable_set(Evas_Object *obj, Eina_Bool scrollable) +elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); + Eina_Bool bounce; if (!wd) return; - wd->scrollable = scrollable; - elm_smart_scroller_bounce_allow_set(wd->scr, wd->scrollable, 0); + 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); _sizing_eval(obj); } /** - * Get the scrollable state of toolbar @p obj. + * Get the shrink mode of toolbar @p obj. * * @param obj The toolbar object - * @return If true, the toolbar is scrollable + * @return See elm_toolbar_mode_shrink_set. * * @ingroup Toolbar */ -EAPI Eina_Bool -elm_toolbar_scrollable_get(Evas_Object *obj) +EAPI Elm_Toolbar_Shrink_Mode +elm_toolbar_mode_shrink_get(const Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + ELM_CHECK_WIDTYPE(obj, widtype) ELM_TOOLBAR_SHRINK_NONE; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return EINA_FALSE; - return wd->scrollable; + if (!wd) return ELM_TOOLBAR_SHRINK_NONE; + return wd->shrink_mode; } /** @@ -693,7 +1755,7 @@ elm_toolbar_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) * @ingroup Toolbar */ EAPI Eina_Bool -elm_toolbar_homogenous_get(Evas_Object *obj) +elm_toolbar_homogenous_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); @@ -713,18 +1775,20 @@ elm_toolbar_homogenous_get(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) || (!parent)) return; + if (!wd) return; + EINA_SAFETY_ON_NULL_RETURN(parent); wd->menu_parent = parent; - EINA_LIST_FOREACH(wd->items, l, it) + EINA_INLIST_FOREACH(wd->items, 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); } /** @@ -736,58 +1800,16 @@ elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent) * @ingroup Toolbar */ EAPI Evas_Object * -elm_toolbar_menu_parent_get(Evas_Object *obj) +elm_toolbar_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; + 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 @@ -836,258 +1858,393 @@ elm_toolbar_align_get(const Evas_Object *obj) EAPI void elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu) { - if(!item) return; - Widget_Data *wd = elm_widget_data_get(item->obj); - + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + Widget_Data *wd = elm_widget_data_get(item->base.widget); if (!wd) return; + if (item->menu == menu) return; item->menu = menu; - 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); - } + if (menu) _item_menu_create(wd, item); + else _item_menu_destroy(item); } - /** - * Get whether the toolbar item opens a menu. + * Set the text to be shown in the toolbar item. * - * @param item The toolbar item - * @return If true, @p item opens a menu when selected + * @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 Evas_Object * -elm_toolbar_item_menu_get(Elm_Toolbar_Item *item) +EAPI void +elm_toolbar_item_tooltip_text_set(Elm_Toolbar_Item *item, const char *text) { - 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; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_tooltip_text_set(item, text); } /** - * Return a list of all toolbar items. + * 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. * - * @param obj The toolbar object + * @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. * - * @return An Eina_List* of the toolbar items in @p obj + * 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. + * + * @see elm_toolbar_item_tooltip_content_cb_set() * * @ingroup Toolbar */ -EAPI Eina_List * -elm_toolbar_item_get_all(Evas_Object *obj) +EAPI void +elm_toolbar_item_tooltip_unset(Elm_Toolbar_Item *item) { - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return NULL; - - return wd->items; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_tooltip_unset(item); } /** - * Return the first toolbar item in the list of toolbar items. + * Sets a different style for this item tooltip. * - * @param obj The toolbar object + * @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() * - * @return The first toolbar item, or NULL on failure + * @param item toolbar item with tooltip already set. + * @param style the theme style to use (default, transparent, ...) * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_get_first(Evas_Object *obj) +EAPI void +elm_toolbar_item_tooltip_style_set(Elm_Toolbar_Item *item, const char *style) { - 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; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_tooltip_style_set(item, style); +} - return it; +/** + * 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 the last toolbar item in the list of toolbar items. + * Set the cursor to be shown when mouse is over the toolbar item * - * @param obj The toolbar object + * @param item Target item + * @param cursor the cursor name to be used. + * + * @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 * - * @return The last toolbar item, or NULL on failure + * @param item toolbar item with cursor already set. + * @return the cursor name. * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_get_last(Evas_Object *obj) +EAPI const char * +elm_toolbar_item_cursor_get(const Elm_Toolbar_Item *item) { - 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); + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); + return elm_widget_item_cursor_get(item); +} - return it; +/** + * 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 the next toolbar item (relative to the currently selected - * toolbar item) in the list of toolbar items. + * Sets a different style for this item cursor. * - * @param obj The toolbar object + * @note before you set a style you should define a cursor with + * elm_toolbar_item_cursor_set() * - * @return The next toolbar item, or NULL on failure + * @param item toolbar item with cursor already set. + * @param style the theme style to use (default, transparent, ...) * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_get_next(Evas_Object *obj) +EAPI void +elm_toolbar_item_cursor_style_set(Elm_Toolbar_Item *item, const char *style) { - Eina_List *l, *l2; - Elm_Toolbar_Item *it, *next; - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_cursor_style_set(item, style); +} - if (!wd) return NULL; - 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; +/** + * 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); } /** - * Selects the next non-disabled, non-separator toolbar item in the list - * of toolbar items. + * Set if the cursor set should be searched on the theme or should use + * the provided by the engine, only. * - * @param obj The toolbar object + * @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 newly selected toolbar item, or NULL on failure + * @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 Elm_Toolbar_Item * -elm_toolbar_item_select_next(Evas_Object *obj) +EAPI void +elm_toolbar_item_cursor_engine_only_set(Elm_Toolbar_Item *item, Eina_Bool engine_only) { - Eina_List *l, *l2; - Elm_Toolbar_Item *it, *next; - ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd = elm_widget_data_get(obj); + 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 Toolbar + */ +EAPI Eina_Bool +elm_toolbar_item_cursor_engine_only_get(const Elm_Toolbar_Item *item) +{ + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE); + return elm_widget_item_cursor_engine_only_get(item); +} +/** + * 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; - EINA_LIST_FOREACH(wd->items, l, it) - { - if (it->selected) - { - EINA_LIST_FOREACH(l, l2, next) - if ((!next->disabled) && (next->separator)) - { - _item_select(next); - return next; - } - } - } - 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; } /** - * Selects the first non-disabled, non-separator toolbar item in the list - * of toolbar items. + * Returns a pointer to a toolbar item by its label * * @param obj The toolbar object + * @param label The label of the item to find * - * @return The newly selected toolbar item, or NULL on failure + * @return The pointer to the toolbar item matching @p label + * Returns NULL on failure. * * @ingroup Toolbar */ EAPI Elm_Toolbar_Item * -elm_toolbar_item_select_first(Evas_Object *obj) +elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label) { - 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) + EINA_INLIST_FOREACH(wd->items, it) { - if ((!it->disabled) && (!it->separator)) - { - _item_select(it); - return it; - } + if (!strcmp(it->label, label)) return it; } return NULL; } /** - * Selects the last non-disabled, non-separator toolbar item in the list - * of toolbar items. + * Set the data item from the toolbar item * - * @param obj The toolbar object + * This set the data value passed on the elm_toolbar_item_append() and + * related item addition calls. * - * @return The newly selected toolbar item, or NULL on failure + * @param item The item + * @param data The new data pointer to set * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_select_last(Evas_Object *obj) +EAPI void +elm_toolbar_item_data_set(Elm_Toolbar_Item *item, const void *data) { - Eina_List *l; - Elm_Toolbar_Item *it; - ELM_CHECK_WIDTYPE(obj, widtype) NULL; + ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); + elm_widget_item_data_set(item, data); +} + +/** + * 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); +} + +/** + * 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. + * + * @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 NULL; - EINA_LIST_REVERSE_FOREACH(wd->items, l, it) - { - if ((!it->disabled) && (!it->separator)) - { - _item_select(it); - return it; - } - } - - return NULL; + if (!wd) return; + wd->no_select = no_select; } /** - * Returns a pointer to a toolbar item by its label + * Gets no select mode. * - * @param obj The toolbar object - * @param label The label of the item to find + * @param obj The Toolbar object + * @return The no select mode (EINA_TRUE = on, EINA_FALSE = off) * - * @return The pointer to the toolbar item matching @p label - * Returns NULL on failure. + * @ingroup Toolbar + */ +EAPI Eina_Bool +elm_toolbar_no_select_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->no_select; +} + +/** + * 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. + * + * @param obj The toolbar object + * @param order The icon lookup order * * @ingroup Toolbar */ -EAPI Elm_Toolbar_Item * -elm_toolbar_item_find_by_label(Evas_Object *obj, const char *label) +EAPI void +elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order) { - Eina_List *l; + ELM_CHECK_WIDTYPE(obj, widtype); 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 (!strcmp(it->label, label)) return it; - } + if (!wd) return; - return NULL; + 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); +} + +/** + * 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; } diff --git a/src/lib/els_box.c b/src/lib/els_box.c index 6c824ad..e0fed0e 100644 --- a/src/lib/els_box.c +++ b/src/lib/els_box.c @@ -4,142 +4,140 @@ 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); - else - minh *= 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 - { - 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); -} + 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); +} 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_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_object_geometry_get(box, NULL, NULL, &w, NULL); - 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; -} + 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 @@ -184,7 +182,7 @@ _els_box_layout_ex(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, i if (wy > 0.0) expand++; } } - if (expand == 0 && (!extended)) + if ((!expand) && (!extended)) { evas_object_size_hint_align_get(o, &ax, &ay); if (horizontal) @@ -246,70 +244,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) @@ -357,7 +355,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 9cf025b..e394884 100644 --- a/src/lib/els_box.h +++ b/src/lib/els_box.h @@ -1,2 +1 @@ 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 43a22bd..ac0b092 100644 --- a/src/lib/els_icon.c +++ b/src/lib/els_icon.c @@ -9,12 +9,14 @@ struct _Smart_Data Evas_Object *obj; int size; double scale; - 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; + 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; }; /* local subsystem functions */ @@ -46,24 +48,44 @@ _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->size != 0) + 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) 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 = 0; - sd->show = 1; - if (sd->preloading) - evas_object_image_preload(sd->obj, EINA_FALSE); - if (sd->preloading) - evas_object_hide(sd->obj); + sd->preloading = EINA_TRUE; + sd->show = EINA_TRUE; + evas_object_hide(sd->obj); + evas_object_image_preload(sd->obj, EINA_FALSE); if (evas_object_image_load_error_get(sd->obj) != EVAS_LOAD_ERROR_NONE) return EINA_FALSE; _smart_reconfigure(sd); @@ -74,13 +96,21 @@ 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->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->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 (!edje_object_file_set(sd->obj, file, part)) return EINA_FALSE; _smart_reconfigure(sd); @@ -88,29 +118,46 @@ _els_smart_icon_file_edje_set(Evas_Object *obj, const char *file, const char *pa } void -_els_smart_icon_smooth_scale_set(Evas_Object *obj, int smooth) +_els_smart_icon_file_get(const Evas_Object *obj, const char **file, const char **key) { - Smart_Data *sd; + 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); +} - sd = evas_object_smart_data_get(obj); +void +_els_smart_icon_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth) +{ + Smart_Data *sd = evas_object_smart_data_get(obj); if (!sd) return; - if (!strcmp(evas_object_type_get(sd->obj), "edje")) + if (sd->edje) return; evas_object_image_smooth_scale_set(sd->obj, smooth); } -Evas_Object * -_els_smart_icon_object_get(Evas_Object *obj) +Eina_Bool +_els_smart_icon_smooth_scale_get(const Evas_Object *obj) { - Smart_Data *sd; + 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); +} - sd = evas_object_smart_data_get(obj); +Evas_Object * +_els_smart_icon_object_get(const Evas_Object *obj) +{ + Smart_Data *sd = evas_object_smart_data_get(obj); if (!sd) return NULL; return sd->obj; } void -_els_smart_icon_size_get(Evas_Object *obj, int *w, int *h) +_els_smart_icon_size_get(const Evas_Object *obj, int *w, int *h) { Smart_Data *sd; int tw, th; @@ -128,7 +175,7 @@ _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) +_els_smart_icon_fill_inside_set(Evas_Object *obj, Eina_Bool fill_inside) { Smart_Data *sd; @@ -140,8 +187,16 @@ _els_smart_icon_fill_inside_set(Evas_Object *obj, int 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, int scale_up) +_els_smart_icon_scale_up_set(Evas_Object *obj, Eina_Bool scale_up) { Smart_Data *sd; @@ -153,8 +208,16 @@ _els_smart_icon_scale_up_set(Evas_Object *obj, int 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, int scale_down) +_els_smart_icon_scale_down_set(Evas_Object *obj, Eina_Bool scale_down) { Smart_Data *sd; @@ -166,6 +229,14 @@ _els_smart_icon_scale_down_set(Evas_Object *obj, int 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) { @@ -175,22 +246,36 @@ _els_smart_icon_scale_size_set(Evas_Object *obj, int size) if (!sd) return; sd->size = size; if (!sd->obj) return; - if (!strcmp(evas_object_type_get(sd->obj), "edje")) + if (sd->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; - - sd = evas_object_smart_data_get(obj); + Smart_Data *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) { @@ -202,7 +287,7 @@ _els_smart_icon_orient_set(Evas_Object *obj, Elm_Image_Orient orient) sd = evas_object_smart_data_get(obj); if (!sd) return; - if (!strcmp(evas_object_type_get(sd->obj), "edje")) + if (sd->edje) return; switch (orient) @@ -216,15 +301,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: - //return; + default: + break; } 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, 0); + data2 = evas_object_image_data_get(tmp, EINA_FALSE); w = ih; ih = iw; @@ -232,7 +317,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, 1); + data = evas_object_image_data_get(sd->obj, EINA_TRUE); switch (orient) { case ELM_IMAGE_FLIP_TRANSPOSE: @@ -270,45 +355,63 @@ _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; - - sd = evas_object_smart_data_get(obj); + Smart_Data *sd = evas_object_smart_data_get(obj); if (!sd) return; - if (strcmp(evas_object_type_get(sd->obj), "edje")== 0) + if (sd->edje) { 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); - } + 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; +} + +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 */ @@ -384,16 +487,6 @@ _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; @@ -436,14 +529,14 @@ _smart_add(Evas_Object *obj) sd->y = 0; sd->w = 0; sd->h = 0; - sd->fill_inside = 1; - sd->scale_up = 1; - sd->scale_down = 1; + sd->fill_inside = EINA_TRUE; + sd->scale_up = EINA_TRUE; + sd->scale_down = EINA_TRUE; 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); } @@ -491,7 +584,7 @@ _smart_show(Evas_Object *obj) sd = evas_object_smart_data_get(obj); if (!sd) return; - sd->show = 1; + sd->show = EINA_TRUE; if (!sd->preloading) evas_object_show(sd->obj); } @@ -503,7 +596,7 @@ _smart_hide(Evas_Object *obj) sd = evas_object_smart_data_get(obj); if (!sd) return; - sd->show = 0; + sd->show = EINA_FALSE; evas_object_hide(sd->obj); } @@ -545,7 +638,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, 1); + data = evas_object_image_data_get(sd->obj, EINA_TRUE); for (y = 0; y < ih; y++) { @@ -574,7 +667,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, 1); + data = evas_object_image_data_get(sd->obj, EINA_TRUE); for (y = 0; y < (ih >> 1); y++) { diff --git a/src/lib/els_icon.h b/src/lib/els_icon.h index 567dcbc..f4325c8 100644 --- a/src/lib/els_icon.h +++ b/src/lib/els_icon.h @@ -1,14 +1,23 @@ 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_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_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 f1982fc..436d287 100644 --- a/src/lib/els_pan.c +++ b/src/lib/els_pan.c @@ -123,6 +123,16 @@ _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 a2ce00c..cb64fa1 100644 --- a/src/lib/els_pan.h +++ b/src/lib/els_pan.h @@ -4,4 +4,5 @@ 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 461cc9b..c1bdf70 100644 --- a/src/lib/els_scroller.c +++ b/src/lib/els_scroller.c @@ -1,6 +1,5 @@ #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))) @@ -21,7 +20,7 @@ struct _Smart_Data Evas_Object *event_obj; Evas_Object *widget; - + Elm_Smart_Scroller_Policy hbar_flags, vbar_flags; struct { @@ -42,6 +41,7 @@ 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,6 +76,7 @@ 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; @@ -89,7 +90,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; @@ -100,10 +101,8 @@ struct _Smart_Data unsigned char bouncemey : 1; unsigned char bounce_horiz : 1; unsigned char bounce_vert : 1; - Eina_Bool freeze_bounce :1; - - Eina_Bool freeze_momentum_animator :1; - Eina_Bool freeze_bounce_animator :1; + unsigned char momentum_animator_disabled :1; + unsigned char bounce_animator_disabled :1; }; /* local subsystem functions */ @@ -117,7 +116,6 @@ 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); @@ -182,6 +180,7 @@ 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); @@ -195,14 +194,22 @@ 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 (*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)) { 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) @@ -229,6 +236,7 @@ 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); @@ -262,6 +270,56 @@ 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) { @@ -314,6 +372,23 @@ _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; @@ -347,6 +422,7 @@ _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; } @@ -413,6 +489,7 @@ _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; } @@ -420,8 +497,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 == 0) && - (sd->pagerel_v == 0.0) && (sd->pagesize_v == 0)) + if ((sd->pagerel_h == 0.0) && (!sd->pagesize_h) && + (sd->pagerel_v == 0.0) && (!sd->pagesize_v)) return EINA_FALSE; return EINA_TRUE; } @@ -429,14 +506,13 @@ _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; - Evas_Coord t; + Evas_Coord x, y, w, h, cw, ch, minx = 0; 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) @@ -444,48 +520,14 @@ _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 < 0) x = 0; + if (x < minx) x = minx; else if ((x + w) > cw) x = cw - w; return x; } @@ -493,11 +535,12 @@ _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; + Evas_Coord x, y, w, h, cw, ch, miny = 0; 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; @@ -513,7 +556,7 @@ _smart_page_y_get(Smart_Data *sd, int offset) y = y / (sd->pagesize_v); y = y * (sd->pagesize_v); } - if (y < 0) y = 0; + if (y < miny) y = miny; else if ((y + h) > ch) y = ch - h; return y; } @@ -564,6 +607,7 @@ _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; } } @@ -601,6 +645,7 @@ _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; } } @@ -614,23 +659,24 @@ _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; + Evas_Coord mx = 0, my = 0, px = 0, py = 0, minx = 0, miny = 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 > 0) return EINA_TRUE; + if (px > minx) return EINA_TRUE; break; case RIGHT: - if (px < mx) return EINA_TRUE; + if ((px - minx) < mx) return EINA_TRUE; break; case UP: - if (py > 0) return EINA_TRUE; + if (py > miny) return EINA_TRUE; break; case DOWN: - if (py < my) return EINA_TRUE; + if ((py - miny) < my) return EINA_TRUE; break; default: break; @@ -643,7 +689,7 @@ _smart_momentum_animator(void *data) { Smart_Data *sd; double t, dt, p; - Evas_Coord x, y, dx, dy, px, py; + Evas_Coord x, y, dx, dy, px, py, maxx, maxy, minx, miny; sd = data; t = ecore_loop_time_get(); @@ -667,11 +713,11 @@ _smart_momentum_animator(void *data) sd->down.cancelled = 1; } */ - dt = dt / _elm_config->thumbscroll_friction; + dt = dt / (_elm_config->thumbscroll_friction + sd->down.extra_time); if (dt > 1.0) dt = 1.0; p = 1.0 - ((1.0 - dt) * (1.0 - dt)); - dx = (sd->down.dx * _elm_config->thumbscroll_friction * p); - dy = (sd->down.dy * _elm_config->thumbscroll_friction * p); + 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); sd->down.ax = dx; sd->down.ay = dy; x = sd->down.sx - dx; @@ -690,7 +736,10 @@ _smart_momentum_animator(void *data) y = py; } elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); - if (dt >= 1.0 || ((sd->down.bounce_x_hold) && (sd->down.bounce_y_hold))) + 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))) { _smart_anim_stop(sd->smart_obj); sd->down.momentum_animator = NULL; @@ -698,8 +747,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; } } @@ -709,7 +758,7 @@ _smart_momentum_animator(void *data) static void bounce_eval(Smart_Data *sd) { - Evas_Coord mx, my, px, py, bx, by, b2x, b2y; + Evas_Coord mx, my, px, py, bx, by, b2x, b2y, minx = 0, miny = 0; if (sd->freeze) return; if ((!sd->bouncemex) && (!sd->bouncemey)) return; @@ -725,19 +774,20 @@ 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 < 0) px = 0; - if (px > mx) px = mx; - if (py < 0) py = 0; - if (py > my) py = my; + if (px < minx) px = minx; + if ((px - minx) > mx) px = mx + minx; + if (py < miny) py = miny; + if ((py - miny) > my) py = my + miny; 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) + if (!sd->down.bounce_x_animator && !sd->bounce_animator_disabled) { if (sd->bouncemex) { @@ -756,10 +806,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->freeze_bounce_animator) + if (!sd->down.bounce_y_animator && !sd->bounce_animator_disabled) { if (sd->bouncemey) { @@ -783,17 +833,18 @@ 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; + Evas_Coord mx = 0, my = 0, px, py, minx = 0, miny = 0; double vx, vy; API_ENTRY return; // FIXME: allow for bounce outside of range sd->pan_func.max_get(sd->pan_obj, &mx, &my); - if (mx > 0) vx = (double)x / (double)mx; + sd->pan_func.min_get(sd->pan_obj, &minx, &miny); + if (mx > 0) vx = (double)(x - minx) / (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 / (double)my; + if (my > 0) vy = (double)(y - miny) / (double)my; else vy = 0.0; if (vy < 0.0) vy = 0.0; else if (vy > 1.0) vy = 1.0; @@ -802,32 +853,29 @@ 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 < 0) x = 0; - if (x > mx) x = mx; - if (y < 0) y = 0; - if (y > my) y = my; + 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 (!sd->bounce_horiz) { - if (x < 0) x = 0; - if (x > mx) x = mx; + if (x < minx) x = minx; + if ((x - minx) > mx) x = mx + minx; } if (!sd->bounce_vert) { - if (y < 0) y = 0; - if (y > my) y = my; + if (y < miny) y = miny; + if (y - miny > my) y = my + miny; } - if (sd->freeze_bounce == EINA_FALSE) - { - sd->pan_func.set(sd->pan_obj, x, y); - } + 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 < 0) || (x > mx)) + if ((x < minx) || (x > (mx + minx))) { sd->bouncemex = 1; bounce_eval(sd); @@ -835,7 +883,7 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) } if (!sd->down.bounce_y_animator) { - if ((y < 0) || (y > my)) + if ((y < miny) || (y > my + miny)) { sd->bouncemey = 1; bounce_eval(sd); @@ -847,16 +895,16 @@ elm_smart_scroller_child_pos_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) } if ((x != px)/* && (!sd->bouncemex)*/) { - if (x == 0) + if (x == minx) evas_object_smart_callback_call(obj, "edge,left", NULL); - if (x == mx) + if (x == (mx + minx)) evas_object_smart_callback_call(obj, "edge,right", NULL); } if ((y != py)/* && (!sd->bouncemey)*/) { - if (y == 0) + if (y == miny) evas_object_smart_callback_call(obj, "edge,top", NULL); - if (y == my) + if (y == my + miny) evas_object_smart_callback_call(obj, "edge,bottom", NULL); } } @@ -871,10 +919,11 @@ 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; + Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny, minx = 0, miny = 0; 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); @@ -1039,9 +1088,26 @@ 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); @@ -1097,19 +1163,23 @@ elm_smart_scroller_paging_set(Evas_Object *obj, double pagerel_h, double pagerel } void -elm_smart_scroller_page_move_set(Evas_Object *obj, Eina_Bool set) +elm_smart_scroller_paging_get(Evas_Object *obj, double *pagerel_h, double *pagerel_v, Evas_Coord *pagesize_h, Evas_Coord *pagesize_v) { API_ENTRY return; - sd->one_page = set; + 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; } 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; + Evas_Coord mx = 0, my = 0, cw = 0, ch = 0, px = 0, py = 0, nx, ny, minx = 0, miny = 0; 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); @@ -1169,15 +1239,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 < 0) x = 0; + if (x < minx) x = minx; else if ((x + w) > cw) x = cw - w; _smart_scrollto_x(sd, _elm_config->bring_in_scroll_friction, x); y = ny; - if (y < 0) y = 0; + if (y < miny) y = miny; else if ((y + h) > ch) y = ch - h; _smart_scrollto_y(sd, _elm_config->bring_in_scroll_friction, y); } @@ -1198,7 +1268,6 @@ _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 @@ -1209,8 +1278,6 @@ _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 @@ -1230,7 +1297,6 @@ _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 @@ -1241,7 +1307,6 @@ _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 @@ -1332,12 +1397,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) || @@ -1367,11 +1432,13 @@ _smart_event_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, sd->down.bounce_y_animator = NULL; sd->bouncemey = 0; } - if (ev->direction == 0) + if (!ev->direction) y += ev->z * sd->step.y; else if (ev->direction == 1) x += ev->z * sd->step.x; - elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); + + if ((!sd->hold) && (!sd->freeze)) + elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); } static void @@ -1386,17 +1453,16 @@ _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); @@ -1466,11 +1532,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; @@ -1478,7 +1544,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; @@ -1504,7 +1570,7 @@ _smart_event_post_up(void *data, Evas *e __UNUSED__) } static void -_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj , void *event_info) +_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Down *ev; Smart_Data *sd; @@ -1513,7 +1579,6 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj , void *event_info) 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 @@ -1568,111 +1633,116 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj , void *event_info) 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 += 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; - + 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; ox = -sd->down.dx; oy = -sd->down.dy; - 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 (!_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 (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) _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); + } } } } 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) - { - 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); } } if (sd->down.hold_animator) @@ -1681,10 +1751,10 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj , void *event_info) 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) { @@ -1723,10 +1793,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; @@ -1734,10 +1804,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; @@ -1745,8 +1815,9 @@ _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; @@ -1774,7 +1845,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; @@ -1790,7 +1861,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; @@ -1822,7 +1893,6 @@ _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); @@ -1850,17 +1920,18 @@ _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)))) { @@ -1941,10 +2012,34 @@ _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); @@ -2030,112 +2125,19 @@ _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; - double vx, vy = 0.0; + Evas_Coord x, y, mx = 0, my = 0, px, py, minx = 0, miny = 0; + double vx, vy; 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); - x = vx * (double)mx; - y = vy * (double)my; + sd->pan_func.min_get(sd->pan_obj, &minx, &miny); + x = vx * (double)mx + minx; + y = vy * (double)my + miny; 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"); } @@ -2143,7 +2145,7 @@ _smart_scrollbar_read(Smart_Data *sd) static void _smart_scrollbar_reset(Smart_Data *sd) { - Evas_Coord px = 0, py = 0; + Evas_Coord px = 0, py = 0, minx = 0, miny = 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); @@ -2152,10 +2154,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, 0, 0); - - if ((px != 0) || (py != 0)) + sd->pan_func.set(sd->pan_obj, minx, miny); + if ((px != minx) || (py != miny)) edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); } @@ -2163,9 +2165,8 @@ static int _smart_scrollbar_bar_v_visibility_adjust(Smart_Data *sd) { int scroll_v_vis_change = 0; - Evas_Coord w, h, vw, vh; + Evas_Coord 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) @@ -2232,10 +2233,9 @@ static int _smart_scrollbar_bar_h_visibility_adjust(Smart_Data *sd) { int scroll_h_vis_change = 0; - Evas_Coord w, h, vw, vh; + Evas_Coord w, 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; + Evas_Coord x, y, w, h, mx = 0, my = 0, vw = 0, vh = 0, px, py, minx = 0, miny = 0; 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); - x = vx * mx; - y = vy * my; + sd->pan_func.min_get(sd->pan_obj, &minx, &miny); + x = vx * mx + minx; + y = vy * my + miny; 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,18 +2364,19 @@ _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; + Evas_Coord px = 0, py = 0, minx = 0, miny = 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, 0, 0); - if ((px != 0) || (py != 0)) + sd->pan_func.set(sd->pan_obj, minx, miny); + if ((px != minx) || (py != miny)) edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); } _smart_scrollbar_bar_visibility_adjust(sd); @@ -2419,14 +2420,14 @@ _smart_add(Evas_Object *obj) sd->bounce_vert = 1; sd->one_dir_at_a_time = 1; - - evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _smart_event_key_down, sd); - evas_object_propagate_events_set(obj, 0); - + sd->momentum_animator_disabled = 0; + sd->bounce_animator_disabled = 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_theme_object_set(NULL, o, "scroller", "base", "default"); + elm_smart_scroller_object_theme_set(NULL, obj, "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); @@ -2452,6 +2453,7 @@ _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); @@ -2482,7 +2484,6 @@ _smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) INTERNAL_ENTRY; sd->x = x; sd->y = y; - _smart_reconfigure(sd); } @@ -2566,32 +2567,3 @@ _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 7dfb7da..a265cee 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_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_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_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,8 +29,10 @@ 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); -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); +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); diff --git a/src/modules/ctxpopup_copypasteUI/copypaste.c b/src/modules/ctxpopup_copypasteUI/copypaste.c index fa54b80..a306ca2 100644 --- a/src/modules/ctxpopup_copypasteUI/copypaste.c +++ b/src/modules/ctxpopup_copypasteUI/copypaste.c @@ -4,6 +4,18 @@ 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 15c8dd2..b8f87bb 100644 --- a/src/modules/popup_copypasteUI/copypaste.c +++ b/src/modules/popup_copypasteUI/copypaste.c @@ -3,6 +3,18 @@ #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) @@ -118,7 +130,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_horizontal_mode_set(list, ELM_LIST_COMPRESS); + elm_list_mode_set(list, ELM_LIST_COMPRESS); elm_widget_sub_object_add(obj, ext_mod->popup); if (!ext_mod->selmode) {