utc_UIFW_elm_box_pack_after_func \
utc_UIFW_elm_box_clear_func \
utc_UIFW_elm_box_unpack_func \
- utc_UIFW_elm_box_unpack_all_func
-
+ utc_UIFW_elm_box_unpack_all_func
-PKGS = elementary
+PKGS = elementary evas
LDFLAGS = `pkg-config --libs $(PKGS)`
LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
all: $(TARGETS)
-$(TARGET): %: %.c
- $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+$(TARGETS): %: %.c
+ $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
clean:
rm -f *~ *.o tet_captured tet_lock $(TARGETS)
ecore-file >= 1.0.0
ecore-imf >= 1.0.0
edje >= 1.0.999
+ icu-i18n >= 4.6.0
]
)
AM_CONDITIONAL([HAVE_EMOTION], [test "x${have_emotion}" = "xyes"])
-requirement_elm="edje >= 1.0.0 ecore-file >= 1.0.0 ecore-evas >= 1.0.0 ecore >= 1.0.0 evas >= 1.0.0 eet >= 1.4.0 eina >= 1.0.0 ${requirement_elm}"
+requirement_elm="edje >= 1.0.0 ecore-file >= 1.0.0 ecore-evas >= 1.0.0 ecore >= 1.0.0 evas >= 1.0.0 eet >= 1.4.0 eina >= 1.0.0 icu-i18n >= 4.6.0 ${requirement_elm}"
have_elementary_x="no"
want_elementary_x="auto"
}
}
+ group { name: "elm/conformant/layout/content";
+ parts {
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ }
+ }
+ }
+}
+
/////////////////////////////////////////////////////////////////////////////
// CALENDAR
/////////////////////////////////////////////////////////////////////////////
}
}
/////////////////////////////////////////////////////////////////////////
- group { name:"elm/naviframe/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";
- fill {
- smooth: 0;
- size {
- relative: 0.0 1.0;
- offset: 64 0;
- }
+group { name:"elm/naviframe/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";
+ fill {
+ smooth: 0;
+ size {
+ relative: 0.0 1.0;
+ offset: 64 0;
}
}
}
- part { name: "base1";
- type: IMAGE;
- description { state: "default" 0.0;
- image {
- normal: "frame_2.png";
- border: 5 5 32 26;
- middle: 0;
- }
- fill.smooth : 0;
+ }
+ part { name: "base1";
+ type: IMAGE;
+ 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;
- 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;
+ }
+ 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/naviframe/item/basic/default";
- parts {
- part { name: "title_clip";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- min: 1 50;
- align: 0.0 0.0;
- fixed: 0 1;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 0.0; }
- }
- description { state: "hide" 0.0;
- inherit: "default" 0.0;
- min: 0 0;
- max: 0 0;
- fixed: 1 1;
- }
- }
- part { name: "content_clip";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- rel1.to_y: "title_clip";
- }
- }
- part { name: "elm.swallow.content";
- type: SWALLOW;
- scale: 1;
- repeat_events: 0;
- clip_to: "content_clip";
- description { state: "default" 0.0;
- align: 0.0 0.0;
- rel1.relative: 1.0 1.0;
- rel1.to_y: "title_clip";
- rel2.relative: 2.0 1.0;
- }
- description { state: "show" 0.0;
- inherit: "default" 0.0;
- rel1.relative: 0.0 1.0;
- rel2.relative: 1.0 1.0;
- }
- description { state: "pushed" 0.0;
- inherit: "default" 0.0;
- rel1.relative: -1.0 1.0;
- rel2.relative: 0.0 1.0;
- }
- description { state: "popped" 0.0;
- inherit: "default" 0.0;
- rel1.relative: 1.0 1.0;
- rel2.relative: 2.0 1.0;
- }
+}
+group { name:"elm/naviframe/item/basic/default";
+ images {
+ image: "flip_base.png" COMP;
+ image: "flip_shad.png" COMP;
+ }
+ parts {
+ part { name: "title_clip";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ min: 1 50;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 0.0; }
}
- part { name: "elm.swallow.title";
- type: SWALLOW;
- scale: 1;
- repeat_events: 0;
- clip_to: "title_clip";
- description { state: "default" 0.0;
- min: 1 50;
- align: 0.0 0.0;
- fixed: 0 1;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 0.0; }
- }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ min: 0 0;
+ max: 0 0;
+ fixed: 1 1;
}
}
- programs {
- program { name: "show";
- signal: "elm,state,show";
- source: "elm";
- action: STATE_SET "show" 0.0;
- target: "elm.swallow.content";
- transition: DECELERATE 0.5;
- after: "show_finished";
- }
- program { name: "pushed";
- signal: "elm,state,pushed";
- source: "elm";
- action: STATE_SET "pushed" 0.0;
- target: "elm.swallow.content";
- transition: DECELERATE 0.5;
- after: "pushed_finished";
- }
- program { name: "popped";
- signal: "elm,state,popped";
- source: "elm";
- action: STATE_SET "popped" 0.0;
- target: "elm.swallow.content";
- transition: DECELERATE 0.5;
- after: "popped_finished";
- }
- program { name: "visible";
- signal: "elm,state,visible";
- source: "elm";
- action: STATE_SET "show" 0.0;
- target: "elm.swallow.content";
+ part { name: "content_clip";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ rel1.to_y: "title_clip";
+ rel1.relative: 0 1;
}
- program { name: "title_show";
- signal: "elm,state,title,show";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "title_clip";
+ }
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ scale: 1;
+ repeat_events: 0;
+ clip_to: "content_clip";
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1.relative: 1.0 1.0;
+ rel1.to_y: "title_clip";
+ rel2.relative: 2.0 1.0;
}
- program { name: "title_hide";
- signal: "elm,state,title,hide";
- source: "elm";
- action: STATE_SET "hide" 0.0;
- target: "title_clip";
+ description { state: "show" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 1.0 1.0;
}
- program { name: "show_finished";
- action: SIGNAL_EMIT "elm,action,show,finished" "";
+ description { state: "pushed" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: -1.0 1.0;
+ rel2.relative: 0.0 1.0;
}
- program { name: "pushed_finished";
- action: SIGNAL_EMIT "elm,action,pushed,finished" "";
+ description { state: "popped" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 1.0 1.0;
+ rel2.relative: 2.0 1.0;
}
- program { name: "popped_finished";
- action: SIGNAL_EMIT "elm,action,popped,finished" "";
+ }
+ part { name: "title_base";
+ type: IMAGE;
+ scale: 1;
+ repeat_events: 0;
+ clip_to: "title_clip";
+ description { state: "default" 0.0;
+ min: 1 50;
+ align: 0.0 0.0;
+ fixed: 0 1;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 0.0; }
+ image.normal: "flip_base.png";
+ }
+ }
+ part { name: "elm.swallow.prev_btn";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "title_clip";
+ description { state: "default" 0.0;
+ min: 80 40;
+ max: 80 40;
+ align: 0 0;
+ fixed: 1 1;
+ rel1.offset: 5 5;
+ rel1.to: "title_base";
+ rel2.offset: -1 -6;
+ rel2.to: "title_base";
+ }
+ }
+ part { name: "elm.swallow.next_btn";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "title_clip";
+ description { state: "default" 0.0;
+ min: 80 40;
+ max: 80 40;
+ align: 1 0;
+ fixed: 1 1;
+ rel1.offset: 0 5;
+ rel1.to: "title_base";
+ rel2.offset: -6 -6;
+ rel2.to: "title_base";
}
}
- }
- group { name:"elm/naviframe/item/instant/default";
- parts {
- part { name: "title_clip";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- min: 1 50;
- align: 0.0 0.0;
- fixed: 0 1;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 0.0; }
- }
- description { state: "hide" 0.0;
- inherit: "default" 0.0;
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "title_clip";
+ description { state: "default" 0.0;
+ min: 40 40;
+ max: 40 40;
+ align: 1 0.5;
+ rel1.to: "elm.text.title";
+ rel1.relative: 0 0;
+ rel1.to: "title_base";
+ rel2.to: "elm.text.title";
+ rel2.relative: 0 1;
+ rel2.to: "title_base";
+ }
+ }
+ part { name: "elm.text.title";
+ type: TEXT;
+ scale: 1;
+ repeat_events: 1;
+ clip_to: "title_clip";
+ description { state: "default" 0.0;
+ text { font: "Sans,Edje-Vera";
+ size: 10;
min: 0 0;
- max: 0 0;
- fixed: 1 1;
- }
- }
- part { name: "content_clip";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.0;
- rel1.to_y: "title_clip";
- }
- }
- part { name: "elm.swallow.content";
- type: SWALLOW;
- scale: 1;
- repeat_events: 0;
- clip_to: "content_clip";
- description { state: "default" 0.0;
- align: 0.0 0.0;
- rel1.relative: 0.0 1.0;
- rel1.to_y: "title_clip";
- rel2.relative: 1.0 1.0;
- visible: 0;
- }
- description { state: "show" 0.0;
- inherit: "default" 0.0;
- visible: 1;
+ max: 1 0;
+ align: 0.5 0.5;
}
- }
- part { name: "elm.swallow.title";
- type: SWALLOW;
- scale: 1;
- repeat_events: 0;
- clip_to: "title_clip";
- description { state: "default" 0.0;
- min: 1 50;
- align: 0.5 0.0;
- fixed: 0 1;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 0.0; }
+ color: 0 0 0 255;
+ align: 0.5 0.5;
+ rel1.to: "title_base";
+ rel2.to: "title_base";
+ }
+ }
+ part { name: "elm.text.subtitle";
+ type: TEXT;
+ scale: 1;
+ repeat_events: 1;
+ clip_to: "title_clip";
+ description { state: "default" 0.0;
+ text { font: "Sans,Edje-Vera";
+ size: 8;
+ min: 0 0;
+ max: 1 0;
+ align: 0.5 1;
}
+ rel1.to_y: "elm.text.title";
+ rel1.relative: 0 1;
+ rel1.to: "title_base";
+ rel2.to: "title_base";
+ color: 50 50 50 255;
+ align: 0.5 0;
}
}
- programs {
- program { name: "show";
- signal: "elm,state,show";
- source: "elm";
- action: STATE_SET "show" 0.0;
- target: "elm.swallow.content";
- after: "show_finished";
- }
- program { name: "pushed";
- signal: "elm,state,pushed";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.swallow.content";
- after: "pushed_finished";
- }
- program { name: "popped";
- signal: "elm,state,popped";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "elm.swallow.content";
- after: "popped_finished";
- }
- program { name: "visible";
- signal: "elm,state,visible";
- source: "elm";
- action: STATE_SET "show" 0.0;
- target: "elm.swallow.content";
- }
- program { name: "title_show";
- signal: "elm,state,title,show";
- source: "elm";
- action: STATE_SET "default" 0.0;
- target: "title_clip";
- }
- program { name: "title_hide";
- signal: "elm,state,title,hide";
- source: "elm";
- action: STATE_SET "hide" 0.0;
- target: "title_clip";
- }
- program { name: "show_finished";
- action: SIGNAL_EMIT "elm,action,show,finished" "";
- }
- program { name: "pushed_finished";
- action: SIGNAL_EMIT "elm,action,pushed,finished" "";
- }
- program { name: "popped_finished";
- action: SIGNAL_EMIT "elm,action,popped,finished" "";
+ part { name: "shade";
+ type: IMAGE;
+ mouse_events: 0;
+ clip_to: "title_clip";
+ description {
+ align: 0.5 1;
+ rel1.to_y: "elm.text.title";
+ rel1.relative: 0 1;
+ rel1.offset: 0 0;
+ rel1.to: "title_base";
+ rel2.offset: -1 5;
+ rel2.to: "title_base";
+ image.normal: "flip_shad.png";
}
}
}
- group { name:"elm/naviframe/title/default";
- images {
- image: "flip_base.png" COMP;
- image: "flip_shad.png" COMP;
+ programs {
+ program { name: "show";
+ signal: "elm,state,show";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.swallow.content";
+ transition: DECELERATE 0.5;
+ after: "show_finished";
+ }
+ program { name: "pushed";
+ signal: "elm,state,pushed";
+ source: "elm";
+ action: STATE_SET "pushed" 0.0;
+ target: "elm.swallow.content";
+ transition: DECELERATE 0.5;
+ after: "pushed_finished";
+ }
+ program { name: "popped";
+ signal: "elm,state,popped";
+ source: "elm";
+ action: STATE_SET "popped" 0.0;
+ target: "elm.swallow.content";
+ transition: DECELERATE 0.5;
+ after: "popped_finished";
+ }
+ program { name: "visible";
+ signal: "elm,state,visible";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.swallow.content";
+ }
+ program { name: "title_show";
+ signal: "elm,state,title,show";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "title_clip";
}
- parts {
- part { name: "base";
- type: IMAGE;
- description {
- image.normal: "flip_base.png";
- }
- }
- part { name: "elm.swallow.prev_btn";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
- min: 80 40;
- max: 80 40;
- align: 0 0;
- fixed: 1 1;
- rel1.offset: 5 5;
- rel2.offset: -1 -6;
- }
- }
- part { name: "elm.swallow.next_btn";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
- min: 80 40;
- max: 80 40;
- align: 1 0;
- fixed: 1 1;
- rel1.offset: 0 5;
- rel2.offset: -6 -6;
- }
- }
- part { name: "elm.swallow.icon";
- type: SWALLOW;
- scale: 1;
- description { state: "default" 0.0;
- min: 40 40;
- max: 40 40;
- align: 1 0.5;
- rel1.to: "elm.text.title";
- rel1.relative: 0 0;
- rel2.to: "elm.text.title";
- rel2.relative: 0 1;
- }
- }
- part { name: "elm.text.title";
- type: TEXT;
- scale: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- text { font: "Sans,Edje-Vera";
- size: 10;
- min: 0 0;
- max: 1 0;
- align: 0.5 0.5;
- }
- color: 0 0 0 255;
- align: 0.5 0.5;
- }
- }
- part { name: "elm.text.subtitle";
- type: TEXT;
- scale: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- text { font: "Sans,Edje-Vera";
- size: 8;
- min: 0 0;
- max: 1 0;
- align: 0.5 1;
- }
- rel1.to_y: "elm.text.title";
- rel1.relative: 0 1;
- color: 50 50 50 255;
- align: 0.5 0;
- }
- }
- part { name: "shade";
- type: IMAGE;
- mouse_events: 0;
- description {
- align: 0.5 1;
- rel1.to_y: "elm.text.title";
- rel1.relative: 0 1;
- rel1.offset: 0 0;
- rel2.offset: -1 5;
- image.normal: "flip_shad.png";
- }
- }
+ program { name: "title_hide";
+ signal: "elm,state,title,hide";
+ source: "elm";
+ action: STATE_SET "hide" 0.0;
+ target: "title_clip";
}
- programs {
- program {
- name: "title_clicked";
- signal: "mouse,clicked,1";
- source: "base";
- action: SIGNAL_EMIT "elm,action,clicked" "elm";
- }
+ program {
+ name: "title_clicked";
+ signal: "mouse,clicked,1";
+ source: "base";
+ action: SIGNAL_EMIT "elm,action,clicked" "elm";
+ }
+ program { name: "show_finished";
+ action: SIGNAL_EMIT "elm,action,show,finished" "";
+ }
+ program { name: "pushed_finished";
+ action: SIGNAL_EMIT "elm,action,pushed,finished" "";
+ }
+ program { name: "popped_finished";
+ action: SIGNAL_EMIT "elm,action,popped,finished" "";
}
}
}
+
+elementary (1.0.0+svn.61256slp2+build37) unstable; urgency=low
+
+ * Package Upload.
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build37
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com> Mon, 19 Sep 2011 19:15:52 +0900
+
+elementary (1.0.0+svn.61256slp2+build36) unstable; urgency=low
+
+ * Package Upload.
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build36
+
+ -- Ilkook Yun <ilkook.yun@samsung.com> Sat, 17 Sep 2011 19:45:56 +0900
+
+elementary (1.0.0+svn.61256slp2+build35) unstable; urgency=low
+
+ * Package Upload.
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build35
+
+ -- Ilkook Yun <ilkook.yun@samsung.com> Fri, 16 Sep 2011 18:10:34 +0900
+
+elementary (1.0.0+svn.61256slp2+build34) unstable; urgency=low
+
+ * temporal disable smart calc of elm_factory
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build34
+
+ -- Hyoyoung Chang <hyoyoung.chang@samsung.com> Fri, 16 Sep 2011 13:11:49 +0900
+
+elementary (1.0.0+svn.61256slp2+build33) unstable; urgency=low
+
+ * Package Upload.
+ * Important Changes
+ Rollback to elementary_1.0.0+svn.61256slp2+build29
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build33
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com> Fri, 16 Sep 2011 11:13:07 +0900
+
+elementary (1.0.0+svn.61256slp2+build32) unstable; urgency=low
+
+ * Package Upload.
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build32
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com> Thu, 15 Sep 2011 17:58:04 +0900
+
+elementary (1.0.0+svn.61256slp2+build31) unstable; urgency=low
+
+ * Package Upload.
+ * Important Changes
+ [Button] Applied upstream commit r63378. This fixes conference call issue.
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build31
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com> Thu, 15 Sep 2011 15:59:38 +0900
+
+elementary (1.0.0+svn.61256slp2+build30) unstable; urgency=low
+
+ * Package Upload.
+ * Important Changes
+ [Button] Applied upstream commit r63378. This fixes conference call
+ * Git: 165.213.180.234:slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build30
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com> Thu, 15 Sep 2011 10:33:43 +0900
+
+elementary (1.0.0+svn.61256slp2+build29) unstable; urgency=low
+
+ * Package Upload
+ * Important Changes
+ [elm_win] revert some modifications about focus control
+ * Git: 165.213.180.234:/slp/pkgs/e/elementary
+ * Tag: elementary_1.0.0+svn.61256slp2+build29
+
+ -- WooHyun Jung <wh0705.jung@samsung.com> Wed, 14 Sep 2011 11:05:23 +0900
+
elementary (1.0.0+svn.61256slp2+build28) unstable; urgency=low
* Package Upload.
Priority: optional
Maintainer: Jaehwan Kim <jae.hwan.kim@samsung.com>, Chuneon Park <chuneon.park@samsung.com>, Juyung Seo <juyung.seo@samsung.com>, Myungjae Lee <mjae.lee@samsung.com>, Woohyun Jung <wh0705.jung@samsung.com>, Jihoon Kim <jihoon48.kim@samsung.com>, Jeonghyun Yun <jh0506.yun@samsung.com>, Seunggyun Kim <sgyun.kim@samsung.com>, Shinwoo Kim <cinoo.kim@samsung.com>
Uploaders: Doyoun Kang <doyoun.kang@samsung.com>, Hyoyoung Chang <hyoyoung.chang@samsung.com>, Myoungwoon Kim <myoungwoon.kim@samsung.com>, Shinwoo Kim <cinoo.kim@samsung.com>
-Build-Depends: debhelper (>= 6), cdbs, libecore-dev, libevas-dev, libeet-dev, libeet-bin, libedje-dev, pkg-config, libtool, libeina-dev, libefreet-dev, libethumb-dev
+Build-Depends: debhelper (>= 6), cdbs, libecore-dev, libevas-dev, libeet-dev, libeet-bin, libedje-dev, pkg-config, libtool, libeina-dev, libefreet-dev, libethumb-dev, libicu-dev
Standards-Version: 3.8.1
Homepage: http://www.enlightenment.org
Package: libelm-dev
Section: libdevel
Architecture: any
-Depends: libelm (= ${binary:Version}), libecore-dev, libevas-dev, libeet-dev, libedje-dev, libedbus-dev, libefreet-dev, libethumb-dev
+Depends: libelm (= ${binary:Version}), libecore-dev, libevas-dev, libeet-dev, libedje-dev, libedbus-dev, libefreet-dev, libethumb-dev, libicu-dev
Description: Elementary - a basic widget set that is easy to use based on EFL for mobile
This package contains devel content.
+#sbs-git:slp/pkgs/e/elementary elementary_1.0.0+svn.61256slp2+build26 7a9d4e37a3eaef2856850022c0127a6e3738b0f2
Name: elementary
Summary: EFL toolkit for small touchscreens
Version: 0.7.0.svn61256
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(x11)
-BuildRequires: edje-bin
-BuildRequires: embryo-bin
-BuildRequires: eet-bin
+BuildRequires: edje-tools
+BuildRequires: embryo
+BuildRequires: eet-tools
BuildRequires: libjpeg-devel
BuildRequires: desktop-file-utils
%description devel
EFL toolkit for small touchscreens (devel)
-%package bin
-Summary: EFL toolkit (devel)
-Group: Development/Libraries
+%package tools
+Summary: EFL toolkit (tools)
+Group: Development/Tools
Requires: %{name} = %{version}-%{release}
+Provides: %{name}-bin
+Obsoletes: %{name}-bin
-%description bin
-EFL toolkit for small touchscreens (devel)
+%description tools
+EFL toolkit for small touchscreens (tools)
%prep
/usr/lib/libelementary.so
/usr/lib/pkgconfig/elementary.pc
-%files bin
+%files tools
%defattr(-,root,root,-)
/usr/bin/elementary_*
/usr/lib/elementary_testql.so
{
Evas_Object *bt, *bt2, *ic, *nf = data;
char buf[PATH_MAX];
- Elm_Naviframe_Item *it;
+ Elm_Object_Item *it;
bt = elm_button_add(nf);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
ic = elm_icon_add(nf);
- snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", PACKAGE_DATA_DIR);
+ snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get());
elm_icon_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_button_icon_set(bt, ic);
elm_object_text_set(bt2, "Naviframe Test");
ic = elm_icon_add(nf);
- snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
elm_icon_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
bt,
bt2,
NULL);
- elm_naviframe_item_subtitle_label_set(it, "Here is sub-title part!");
- elm_naviframe_item_icon_set(it, ic);
+ elm_object_item_text_part_set(it, "elm.text.subtitle", "Here is sub-title part!");
+ elm_object_item_content_part_set(it, "elm.swallow.icon", ic);
elm_naviframe_item_title_visible_set(it, EINA_FALSE);
evas_object_smart_callback_add(bt2, "clicked", _title_visible, it);
}
{
Evas_Object *bt, *bt2, *bt3, *ic, *nf = data;
char buf[PATH_MAX];
- Elm_Naviframe_Item *it;
+ Elm_Object_Item *it;
bt = elm_button_add(nf);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(bt3, "Naviframe Test");
ic = elm_icon_add(nf);
- snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
elm_icon_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
bt2,
bt3,
NULL);
- elm_naviframe_item_subtitle_label_set(it, "Here is sub-title part!");
- elm_naviframe_item_icon_set(it, ic);
+ elm_object_item_text_part_set(it, "elm.text.subtitle", "Here is sub-title part!");
+ elm_object_item_content_part_set(it, "elm.swallow.icon", ic);
}
void
{
Evas_Object *bt, *bt2, *ic, *nf = data;
char buf[PATH_MAX];
- Elm_Naviframe_Item *it;
+ Elm_Object_Item *it;
bt = elm_button_add(nf);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(bt2, "Naviframe Test");
ic = elm_icon_add(nf);
- snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", PACKAGE_DATA_DIR);
+ snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get());
elm_icon_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_button_icon_set(bt, ic);
bt,
bt2,
NULL);
- elm_naviframe_item_subtitle_label_set(it, "Here is sub-title part!");
+ elm_object_item_text_part_set(it, "elm.text.subtitle", "Here is sub-title part!");
}
void
/**
+ * @typedef Elm_Object_Item
+ * An Elementary Object item handle.
+ * @ingroup General
+ */
+ typedef struct _Elm_Object_Item Elm_Object_Item;
+
+
+ /**
* Called back when a widget's tooltip is activated and needs content.
* @param data user-data given to elm_object_tooltip_content_cb_set()
* @param obj owner widget.
* Set a label of an object
*
* @param obj The Elementary object
- * @param item The label id to set (NULL for the default label)
+ * @param part The text part name to set (NULL for the default label)
* @param label The new text of the label
*
* @note Elementary objects may have many labels (e.g. Action Slider)
*
* @ingroup General
*/
- EAPI void elm_object_text_part_set(Evas_Object *obj, const char *item, const char *label);
+ EAPI void elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label);
#define elm_object_text_set(obj, label) elm_object_text_part_set((obj), NULL, (label))
* Get a label of an object
*
* @param obj The Elementary object
- * @param item The label id to get (NULL for the default label)
- * @return text of the label or
- * NULL for any error
+ * @param part The text part name to get (NULL for the default label)
+ * @return text of the label or NULL for any error
*
* @note Elementary objects may have many labels (e.g. Action Slider)
*
* @ingroup General
*/
- EAPI const char *elm_object_text_part_get(const Evas_Object *obj, const char *item);
+ EAPI const char *elm_object_text_part_get(const Evas_Object *obj, const char *part);
#define elm_object_text_get(obj) elm_object_text_part_get((obj), NULL)
/**
+ * Set a content of an object
+ *
+ * @param obj The Elementary object
+ * @param part The content part name to set (NULL for the default content)
+ * @param content The new content of the object
+ *
+ * @note Elementary objects may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content);
+
+#define elm_object_content_set(obj, content) elm_object_content_part_set((obj), NULL, (content))
+
+ /**
+ * Get a content of an object
+ *
+ * @param obj The Elementary object
+ * @param item The content part name to get (NULL for the default content)
+ * @return content of the object or NULL for any error
+ *
+ * @note Elementary objects may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI Evas_Object *elm_object_content_part_get(const Evas_Object *obj, const char *part);
+
+#define elm_object_content_get(obj) elm_object_content_part_get((obj), NULL)
+
+ /**
+ * Unset a content of an object
+ *
+ * @param obj The Elementary object
+ * @param item The content part name to unset (NULL for the default content)
+ *
+ * @note Elementary objects may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI Evas_Object *elm_object_content_part_unset(Evas_Object *obj, const char *part);
+
+#define elm_object_content_unset(obj) elm_object_content_part_unset((obj), NULL)
+
+ /**
+ * Set a content of an object item
+ *
+ * @param it The Elementary object item
+ * @param part The content part name to set (NULL for the default content)
+ * @param content The new content of the object item
+ *
+ * @note Elementary object items may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_item_content_part_set(Elm_Object_Item *it, const char *part, Evas_Object *content);
+
+#define elm_object_item_content_set(it, content) elm_object_item_content_part_set((it), NULL, (content))
+
+ /**
+ * Get a content of an object item
+ *
+ * @param it The Elementary object item
+ * @param part The content part name to unset (NULL for the default content)
+ * @return content of the object item or NULL for any error
+ *
+ * @note Elementary object items may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI Evas_Object *elm_object_item_content_part_get(const Elm_Object_Item *it, const char *item);
+
+#define elm_object_item_content_get(it) elm_object_item_content_part_get((it), NULL)
+
+ /**
+ * Unset a content of an object item
+ *
+ * @param it The Elementary object item
+ * @param part The content part name to unset (NULL for the default content)
+ *
+ * @note Elementary object items may have many contents
+ *
+ * @ingroup General
+ */
+ EAPI Evas_Object *elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part);
+
+#define elm_object_item_content_unset(it, content) elm_object_item_content_part_unset((it), (content))
+
+ /**
+ * Set a label of an objec itemt
+ *
+ * @param it The Elementary object item
+ * @param part The text part name to set (NULL for the default label)
+ * @param label The new text of the label
+ *
+ * @note Elementary object items may have many labels
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_item_text_part_set(Elm_Object_Item *it, const char *part, const char *label);
+
+#define elm_object_item_text_set(it, label) elm_object_item_text_part_set((it), NULL, (label))
+
+ /**
+ * Get a label of an object
+ *
+ * @param it The Elementary object item
+ * @param part The text part name to get (NULL for the default label)
+ * @return text of the label or NULL for any error
+ *
+ * @note Elementary object items may have many labels
+ *
+ * @ingroup General
+ */
+ EAPI const char *elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part);
+
+ /**
+ * Set the text to read out when in accessibility mode
+ *
+ * @param obj The object which is to be described
+ * @param txt The text that describes the widget to people with poor or no vision
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
+
+ /**
+ * Set the text to read out when in accessibility mode
+ *
+ * @param it The object item which is to be described
+ * @param txt The text that describes the widget to people with poor or no vision
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt);
+
+
+#define elm_object_item_text_get(it) elm_object_item_text_part_get((it), NULL)
+
+ /**
+ * Get the data associated with an object item
+ * @param it The object item
+ * @return The data associated with @p it
+ *
+ * @ingroup General
+ */
+ EAPI void *elm_object_item_data_get(const Elm_Object_Item *it);
+
+ /**
+ * Set the data associated with an object item
+ * @param it The object item
+ * @param data The data to be associated with @p it
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_item_data_set(Elm_Object_Item *it, void *data);
+
+ /**
+ * Send a signal to the edje object of the widget item.
+ *
+ * This function sends a signal to the edje object of the obj item. An
+ * edje program can respond to a signal by specifying matching
+ * 'signal' and 'source' fields.
+ *
+ * @param it The Elementary object item
+ * @param emission The signal's name.
+ * @param source The signal's source.
+ * @ingroup General
+ */
+ EAPI void elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source) EINA_ARG_NONNULL(1);
+
+ /**
* @}
*/
ELM_CTXPOPUP_DIRECTION_RIGHT,
ELM_CTXPOPUP_DIRECTION_LEFT,
ELM_CTXPOPUP_DIRECTION_UP,
+ ELM_CTXPOPUP_DIRECTION_UNKNOWN, /**< ctxpopup does not determine it's direction yet*/
} Elm_Ctxpopup_Direction;
EAPI Evas_Object *elm_ctxpopup_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
EAPI Evas_Object *elm_ctxpopup_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
EAPI void elm_ctxpopup_direction_priority_set(Evas_Object *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) EINA_ARG_NONNULL(1);
EAPI void elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) EINA_ARG_NONNULL(1);
+ EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/* smart callbacks called:
* "dismissed" - the ctxpopup was dismissed
*/
ELM_DATEFIELD_LAYOUT_DATEANDTIME
} Elm_Datefield_Layout;
+ typedef enum _Elm_Datefield_ItemType
+ {
+ ELM_DATEFIELD_YEAR = 0,
+ ELM_DATEFIELD_MONTH,
+ ELM_DATEFIELD_DATE,
+ ELM_DATEFIELD_HOUR,
+ ELM_DATEFIELD_MINUTE,
+ ELM_DATEFIELD_AMPM
+ } Elm_Datefield_ItemType;
+
EAPI Evas_Object *elm_datefield_add(Evas_Object *parent);
EAPI void elm_datefield_layout_set(Evas_Object *obj, Elm_Datefield_Layout layout);
EAPI Elm_Datefield_Layout elm_datefield_layout_get(const Evas_Object *obj);
- EAPI void elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour, int min);
- EAPI void elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day, int *hour, int *min);
- EAPI Eina_Bool elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day);
- EAPI void elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month, int *day);
- EAPI Eina_Bool elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day);
- EAPI void elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month, int *day);
- EAPI void elm_datefield_time_mode_set(Evas_Object *obj, Eina_Bool mode);
- EAPI Eina_Bool elm_datefield_time_mode_get(const Evas_Object *obj);
EAPI void elm_datefield_date_format_set(Evas_Object *obj, const char *fmt);
EAPI const char *elm_datefield_date_format_get(const Evas_Object *obj);
- EAPI void elm_datefield_input_panel_state_callback_add(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value), void *data);
- EAPI void elm_datefield_input_panel_state_callback_del(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value));
+ EAPI void elm_datefield_item_enable_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, Eina_Bool enable);
+ EAPI Eina_Bool elm_datefield_item_enable_get(Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+ EAPI void elm_datefield_item_value_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, int value);
+ EAPI int elm_datefield_item_value_get(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+ EAPI void elm_datefield_item_min_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, int value, Eina_Bool abs_limit);
+ EAPI int elm_datefield_item_min_get(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+ EAPI Eina_Bool elm_datefield_item_min_is_absolute(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+ EAPI void elm_datefield_item_max_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, int value, Eina_Bool abs_limit);
+ EAPI int elm_datefield_item_max_get(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+ EAPI Eina_Bool elm_datefield_item_max_is_absolute(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+ EAPI void elm_datefield_time_mode_set(Evas_Object *obj, Eina_Bool mode);
+ EAPI Eina_Bool elm_datefield_time_mode_get(const Evas_Object *obj);
+
/* smart callbacks called:
- * "changed" - when datefield entry is changed, this signal is sent.
+ * "changed" - when datefield value is changed, this signal is sent.
*/
+////////////////////// DEPRECATED ///////////////////////////////////
+ EINA_DEPRECATED EAPI void elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour, int min);
+ EINA_DEPRECATED EAPI void elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day, int *hour, int *min);
+ EINA_DEPRECATED EAPI Eina_Bool elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day);
+ EINA_DEPRECATED EAPI void elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month, int *day);
+ EINA_DEPRECATED EAPI Eina_Bool elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day);
+ EINA_DEPRECATED EAPI void elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month, int *day);
+ EINA_DEPRECATED EAPI void elm_datefield_input_panel_state_callback_add(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value), void *data);
+ EINA_DEPRECATED EAPI void elm_datefield_input_panel_state_callback_del(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value));
+/////////////////////////////////////////////////////////////////////
+
/* popup */
typedef enum _Elm_Popup_Response
{
Eina_Bool elm_navigationbar_ex_title_object_visible_get(Elm_Navigationbar_ex_Item* item);
/* naviframe */
- #define NAVIFRAME_OPTIONHEADER "elm.swallow.optionheader"
-
- typedef struct _Elm_Naviframe_Item Elm_Naviframe_Item;
-
- typedef enum
- {
- ELM_NAVIFRAME_PREV_BUTTON,
- ELM_NAVIFRAME_NEXT_BUTTON
- } Elm_Naviframe_Button_Type;
+ #define ELM_NAVIFRAME_ITEM_ICON "elm.swallow.icon"
+ #define ELM_NAVIFRAME_ITEM_OPTIONHEADER "elm.swallow.optionheader"
+ #define ELM_NAVIFRAME_ITEM_TITLE_LABEL "elm.text.title"
+ #define ELM_NAVIFRAME_ITEM_PREV_BTN "elm.swallow.prev_btn"
+ #define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_CLOSE "elm,state,optionheader,instant_close", ""
+ #define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_OPEN "elm,state,optionheader,instant_open", ""
EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
- EAPI Elm_Naviframe_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style) EINA_ARG_NONNULL(1, 5);
+ EAPI Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style) EINA_ARG_NONNULL(1, 5);
EAPI Evas_Object *elm_naviframe_item_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
EAPI void elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve) EINA_ARG_NONNULL(1);
EAPI Eina_Bool elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_content_set(Elm_Naviframe_Item *item, Evas_Object *content) EINA_ARG_NONNULL(1, 2);
- EAPI Evas_Object *elm_naviframe_item_content_get(const Elm_Naviframe_Item *item) EINA_ARG_NONNULL(1);
- EAPI Evas_Object *elm_naviframe_item_content_unset(Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_title_label_set(Elm_Naviframe_Item *it, const char *label) EINA_ARG_NONNULL(1);
- EAPI const char *elm_naviframe_item_title_label_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_subtitle_label_set(Elm_Naviframe_Item *it, const char *label) EINA_ARG_NONNULL(1);
- EAPI const char *elm_naviframe_item_subtitle_label_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
- EAPI Elm_Naviframe_Item *elm_naviframe_top_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
- EAPI Elm_Naviframe_Item *elm_naviframe_bottom_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_button_set(Elm_Naviframe_Item *it, Evas_Object *btn, Elm_Naviframe_Button_Type btn_type) EINA_ARG_NONNULL(1);
- EAPI Evas_Object *elm_naviframe_item_button_get(const Elm_Naviframe_Item *it, Elm_Naviframe_Button_Type btn_type) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon) EINA_ARG_NONNULL(1);
- EAPI Evas_Object *elm_naviframe_item_icon_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_style_set(Elm_Naviframe_Item *it, const char *item_style) EINA_ARG_NONNULL(1);
- EAPI const char *elm_naviframe_item_style_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_title_visible_set(Elm_Naviframe_Item *it, Eina_Bool visible) EINA_ARG_NONNULL(1);
- EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Naviframe_Item *it) EINA_ARG_NONNULL(1);
- EAPI void elm_naviframe_item_extension_set(Elm_Naviframe_Item *it, const char *swallow, Evas_Object *extension) EINA_ARG_NONNULL(1, 2);
- EAPI Evas_Object *elm_naviframe_item_extension_unset(Elm_Naviframe_Item *it, const char *swallow) EINA_ARG_NONNULL(1);
- EAPI Evas_Object *elm_naviframe_item_extension_get(const Elm_Naviframe_Item *it, const char *swallow) EINA_ARG_NONNULL(1);
+ EAPI Elm_Object_Item *elm_naviframe_top_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EAPI Elm_Object_Item *elm_naviframe_bottom_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style) EINA_ARG_NONNULL(1);
+ EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
+ EAPI void elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible) EINA_ARG_NONNULL(1);
+ EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/* Control Bar */
#define CONTROLBAR_SYSTEM_ICON_ALBUMS "controlbar_albums"
EAPI void elm_tickernoti_mode_set (Evas_Object *obj, Elm_Tickernoti_Mode mode) EINA_ARG_NONNULL(1);
EAPI Elm_Tickernoti_Mode elm_tickernoti_mode_get (const Evas_Object *obj) EINA_ARG_NONNULL(1);
/* ############################################################################### */
+ /* smart callbacks called:
+ * @li "clicked" - emitted when tickernoti is clicked, except at the
+ * swallow/button region, if any.
+ * @li "hide" - emitted when the tickernoti is completelyhidden. In case of
+ * any hide animation, this signal is raised after the animation.
+ */
/* colorpalette */
typedef struct _Colorpalette_Color Elm_Colorpalette_Color;
elm_diskselector.c \
elm_editfield.c \
elm_entry.c \
+elm_factory.c \
elm_flip.c \
elm_flipselector.c \
elm_font.c \
if (third) *third = wd->dir_priority[2];
if (fourth) *fourth = wd->dir_priority[3];
}
+
+/**
+ * @brief Get the current direction of a ctxpopup.
+ *
+ * @param obj Ctxpopup object
+ * @return current direction of a ctxpopup
+ *
+ * @warning Once the ctxpopup showed up, the direction would be determined
+ */
+
+EAPI Elm_Ctxpopup_Direction
+elm_ctxpopup_direction_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) ELM_CTXPOPUP_DIRECTION_UNKNOWN;
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return ELM_CTXPOPUP_DIRECTION_UNKNOWN;
+ return wd->dir;
+}
+
#include "elm_priv.h"
typedef struct _Widget_Data Widget_Data;
+typedef struct _Elm_Naviframe_Item Elm_Naviframe_Item;
+typedef struct _Elm_Naviframe_Content_Item_Pair Elm_Naviframe_Content_Item_Pair;
+typedef struct _Elm_Naviframe_Text_Item_Pair Elm_Naviframe_Text_Item_Pair;
struct _Widget_Data
{
Eina_Bool pass_events: 1;
};
+struct _Elm_Naviframe_Content_Item_Pair
+{
+ const char *part;
+ Evas_Object *content;
+ Elm_Naviframe_Item *it;
+};
+
+struct _Elm_Naviframe_Text_Item_Pair
+{
+ const char *part;
+ const char *text;
+};
+
struct _Elm_Naviframe_Item
{
Elm_Widget_Item base;
- Evas_Object *title;
+ Eina_List *content_list;
+ Eina_List *text_list;
Evas_Object *content;
- const char *title_label;
- const char *title_sublabel;
Evas_Object *title_prev_btn;
Evas_Object *title_next_btn;
- Evas_Object *title_icon;
- Evas_Object *extension;
const char *style;
Eina_Bool back_btn: 1;
Eina_Bool title_visible: 1;
{NULL, NULL}
};
-#define ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, ...) \
- ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *) it, __VA_ARGS__); \
- ELM_CHECK_WIDTYPE(it->base.widget, widtype) __VA_ARGS__;
-
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
+static void _emit_hook(Evas_Object *obj,
+ const char *emission,
+ const char *source);
static void _disable_hook(Evas_Object *obj);
+static void _item_text_set_hook(Elm_Object_Item *it,
+ const char *part,
+ const char *label);
+static const char *_item_text_get_hook(const Elm_Object_Item *it,
+ const char *part);
+static void _item_content_set_hook(Elm_Object_Item *it,
+ const char *part,
+ Evas_Object *content);
+static Evas_Object *_item_content_get_hook(const Elm_Object_Item *it,
+ const char *part);
+static Evas_Object *_item_content_unset_hook(Elm_Object_Item *it,
+ const char *part);
+static void _item_signal_emit_hook(Elm_Object_Item *it,
+ const char *emission,
+ const char *source);
static void _sizing_eval(Evas_Object *obj);
static void _item_sizing_eval(Elm_Naviframe_Item *it);
static void _move(void *data, Evas *e, Evas_Object *obj, void *event_info);
Evas_Object *obj,
void *event_info);
static Evas_Object *_back_btn_new(Evas_Object *obj);
+static void _item_content_del(void *data,
+ Evas *e,
+ Evas_Object *obj,
+ void *event_info);
+static void _title_content_del(void *data,
+ Evas *e,
+ Evas_Object *obj,
+ void *event_info);
static void _title_prev_btn_del(void *data,
Evas *e,
Evas_Object *obj,
Evas *e,
Evas_Object *obj,
void *event_info);
-static void _title_icon_del(void *data,
- Evas *e,
- Evas_Object *obj,
- void *event_info);
-static void _content_del(void *data,
- Evas *e,
- Evas_Object *obj,
- void *event_info);
-static void _extension_del(void *data,
- Evas *e,
- Evas_Object *obj,
- void *event_info);
+static void _title_content_set(Elm_Naviframe_Item *it,
+ Elm_Naviframe_Content_Item_Pair *pair,
+ const char *part,
+ Evas_Object *content);
static void _title_prev_btn_set(Elm_Naviframe_Item *it,
Evas_Object *btn,
Eina_Bool back_btn);
Evas_Object *obj,
const char *emission,
const char *source);
+static void _item_content_set(Elm_Naviframe_Item *navi_it,
+ Evas_Object *content);
static void
_del_hook(Evas_Object *obj)
//FIXME:
}
+static void _emit_hook(Evas_Object *obj,
+ const char *emission,
+ const char *source)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ edje_object_signal_emit(wd->base, emission, source);
+}
+
static void
_disable_hook(Evas_Object *obj __UNUSED__)
{
}
static void
+_item_text_set_hook(Elm_Object_Item *it,
+ const char *part,
+ const char *label)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+
+ Eina_List *l = NULL;
+ Elm_Naviframe_Text_Item_Pair *pair = NULL;
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+ char buf[1024];
+
+ if (!part)
+ snprintf(buf, sizeof(buf), "elm.text.title");
+ else
+ snprintf(buf, sizeof(buf), "%s", part);
+
+ EINA_LIST_FOREACH(navi_it->text_list, l, pair)
+ {
+ if (!strcmp(buf, pair->part))
+ {
+ if (pair->text)
+ {
+ if (!strcmp(pair->text, label))
+ return;
+ }
+ break;
+ }
+ }
+
+ if (!pair)
+ {
+ pair = ELM_NEW(Elm_Naviframe_Text_Item_Pair);
+ if (!pair)
+ {
+ ERR("Failed to allocate new text part of the item! : naviframe=%p", navi_it->base.widget);
+ return;
+ }
+ eina_stringshare_replace(&pair->part, buf);
+ navi_it->text_list = eina_list_append(navi_it->text_list, pair);
+ }
+
+ eina_stringshare_replace(&pair->text, label);
+ edje_object_part_text_set(navi_it->base.view, buf, label);
+
+ snprintf(buf, sizeof(buf), "elm,state,%s,show", buf);
+
+ if (label)
+ edje_object_signal_emit(navi_it->base.view, buf, "elm");
+ else
+ edje_object_signal_emit(navi_it->base.view, buf, "elm");
+
+ _item_sizing_eval(navi_it);
+}
+
+static const char *
+_item_text_get_hook(const Elm_Object_Item *it, const char *part)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+ Eina_List *l = NULL;
+ Elm_Naviframe_Text_Item_Pair *pair = NULL;
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+ char buf[1024];
+
+ if (!part)
+ snprintf(buf, sizeof(buf), "elm.text.title");
+ else
+ snprintf(buf, sizeof(buf), "%s", part);
+
+ EINA_LIST_FOREACH(navi_it->text_list, l, pair)
+ {
+ if (!strcmp(buf, pair->part))
+ return pair->text;
+ }
+ return NULL;
+}
+
+static void
+_item_content_set_hook(Elm_Object_Item *it,
+ const char *part,
+ Evas_Object *content)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+
+ Elm_Naviframe_Content_Item_Pair *pair = NULL;
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+
+ //specified parts
+ if ((!part) || (!strcmp(part, "elm.swallow.content")))
+ {
+ _item_content_set(navi_it, content);
+ return;
+ }
+ else if (!strcmp(part, "elm.swallow.prev_btn"))
+ {
+ _title_prev_btn_set(navi_it, content, EINA_FALSE);
+ return;
+ }
+ else if(!strcmp(part, "elm.swallow.next_btn"))
+ {
+ _title_next_btn_set(navi_it, content);
+ return;
+ }
+
+ //common part
+ _title_content_set(navi_it, pair, part, content);
+}
+
+/*
+ */
+static Evas_Object *
+_item_content_get_hook(const Elm_Object_Item *it, const char *part)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+ Eina_List *l = NULL;
+ Elm_Naviframe_Content_Item_Pair *pair = NULL;
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+
+ //specified parts
+ if ((!part) || (!strcmp(part, "elm.swallow.content")))
+ return navi_it->content;
+ else if (!strcmp(part, "elm.swallow.prev_btn"))
+ return navi_it->title_prev_btn;
+ else if(!strcmp(part, "elm.swallow.next_btn"))
+ return navi_it->title_next_btn;
+
+ //common parts
+ EINA_LIST_FOREACH(navi_it->content_list, l, pair)
+ {
+ if (!strcmp(part, pair->part))
+ return pair->content;
+ }
+ return NULL;
+}
+
+static Evas_Object *
+_item_content_unset_hook(Elm_Object_Item *it, const char *part)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+ Eina_List *l = NULL;
+ Elm_Naviframe_Content_Item_Pair *pair = NULL;
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+ Evas_Object *content = NULL;
+ char buf[1028];
+
+ //specified parts
+ //FIXME: could be unset the below specified contents also.
+ if (!part ||
+ !strcmp(part, "elm.swallow.content") ||
+ !strcmp(part, "elm.swallow.prev_btn") ||
+ !strcmp(part, "elm.swallow.next_btn"))
+ {
+ WRN("You can not unset the content! : naviframe=%p",
+ navi_it->base.widget);
+ return NULL;
+ }
+
+ //common parts
+ EINA_LIST_FOREACH(navi_it->content_list, l, pair)
+ {
+ if (!strcmp(part, pair->part))
+ {
+ content = pair->content;
+ eina_stringshare_del(pair->part);
+ navi_it->content_list = eina_list_remove(navi_it->content_list,
+ pair);
+ free(pair);
+ break;
+ }
+ }
+
+ if (!content) return NULL;
+
+ elm_widget_sub_object_del(navi_it->base.widget, content);
+ edje_object_part_unswallow(navi_it->base.view, content);
+ snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
+ edje_object_signal_emit(navi_it->base.view, buf, "elm");
+ evas_object_event_callback_del(content,
+ EVAS_CALLBACK_DEL,
+ _title_content_del);
+ _item_sizing_eval(navi_it);
+
+ return content;
+}
+
+static void
+_item_signal_emit_hook(Elm_Object_Item *it,
+ const char *emission,
+ const char *source)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+ edje_object_signal_emit(navi_it->base.view, emission, source);
+}
+
+static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd;
_back_btn_new(Evas_Object *obj)
{
Evas_Object *btn;
- char buf[256]; //FIXME: How to guarantee the size of style name?
+ char buf[1024];
btn = elm_button_add(obj);
if (!btn) return NULL;
evas_object_smart_callback_add(btn, "clicked", _back_btn_clicked, obj);
}
static void
+_title_content_del(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ char buf[1024];
+ Elm_Naviframe_Content_Item_Pair *pair = data;
+ Elm_Naviframe_Item *it = pair->it;
+ snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
+ edje_object_signal_emit(it->base.view, buf, "elm");
+ it->content_list = eina_list_remove(it->content_list, pair);
+ eina_stringshare_del(pair->part);
+ free(pair);
+}
+
+static void
_title_prev_btn_del(void *data,
Evas *e __UNUSED__,
Evas_Object *obj __UNUSED__,
}
static void
-_title_icon_del(void *data,
- Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
-{
- Elm_Naviframe_Item *it = data;
- it->title_icon = NULL;
- edje_object_signal_emit(it->base.view, "elm,state,icon,hide", "elm");
-}
-
-static void
-_content_del(void *data,
- Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
+_item_content_del(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
Elm_Naviframe_Item *it = data;
it->content = NULL;
}
static void
-_extension_del(void *data,
- Evas *e,
- Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
+_title_content_set(Elm_Naviframe_Item *it,
+ Elm_Naviframe_Content_Item_Pair *pair,
+ const char *part,
+ Evas_Object *content)
{
- Elm_Naviframe_Item *it = data;
- it->extension = NULL;
+ Eina_List *l = NULL;
+ char buf[1024];
+
+ EINA_LIST_FOREACH(it->content_list, l, pair)
+ {
+ if (!strcmp(part, pair->part))
+ {
+ if (pair->content == content) return;
+ break;
+ }
+ }
+
+ if (!pair)
+ {
+ pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
+ if (!pair)
+ {
+ ERR("Failed to allocate new content part of the item! : naviframe=%p", it->base.widget);
+ return;
+ }
+ pair->it = it;
+ eina_stringshare_replace(&pair->part, part);
+ it->content_list = eina_list_append(it->content_list, pair);
+ }
+
+ if (pair->content) evas_object_del(pair->content);
+ pair->content = content;
+
+ if (!content)
+ {
+ snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
+ edje_object_signal_emit(it->base.view, buf, "elm");
+ return;
+ }
+
+ elm_widget_sub_object_add(it->base.widget, content);
+ edje_object_part_swallow(it->base.view, part, content);
+ snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
+ edje_object_signal_emit(it->base.view, buf, "elm");
+ evas_object_event_callback_add(content,
+ EVAS_CALLBACK_DEL,
+ _title_content_del,
+ pair);
+ _item_sizing_eval(it);
}
static void
_title_prev_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn, Eina_Bool back_btn)
{
- char buf[256]; //FIXME: How to guarantee the size of style name?
-
if (it->title_prev_btn == btn) return;
if (it->title_prev_btn)
if (!btn) return;
- if (!back_btn)
- {
- snprintf(buf,
- sizeof(buf),
- "naviframe/prev_btn/%s",
- elm_widget_style_get(it->base.widget));
- elm_object_style_set(btn, buf);
- }
elm_widget_sub_object_add(it->base.widget, btn);
evas_object_event_callback_add(btn,
EVAS_CALLBACK_DEL,
_title_prev_btn_del,
it);
- edje_object_part_swallow(it->title, "elm.swallow.prev_btn", btn);
+ edje_object_part_swallow(it->base.view, "elm.swallow.prev_btn", btn);
it->back_btn = back_btn;
+
+ _item_sizing_eval(it);
}
static void
_title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn)
{
- char buf[256]; //FIXME: How to guarantee the size of style name?
-
if (it->title_next_btn == btn) return;
if (it->title_next_btn)
if (!btn) return;
- snprintf(buf,
- sizeof(buf),
- "naviframe/next_btn/%s",
- elm_widget_style_get(it->base.widget));
- elm_object_style_set(btn, buf);
elm_widget_sub_object_add(it->base.widget, btn);
evas_object_event_callback_add(btn,
EVAS_CALLBACK_DEL,
_title_next_btn_del,
it);
- edje_object_part_swallow(it->title, "elm.swallow.next_btn", btn);
+ edje_object_part_swallow(it->base.view, "elm.swallow.next_btn", btn);
+
+ _item_sizing_eval(it);
}
static void
_item_del(Elm_Naviframe_Item *it)
{
Widget_Data *wd;
+ Eina_List *l;
+ Elm_Naviframe_Content_Item_Pair *content_pair;
+ Elm_Naviframe_Text_Item_Pair *text_pair;
if (!it) return;
evas_object_del(it->title_prev_btn);
if (it->title_next_btn)
evas_object_del(it->title_next_btn);
- if (it->title_icon)
- evas_object_del(it->title_icon);
- if ((it->content) && (!wd->preserve))
+ if ((it->content) && (!wd->preserve))
evas_object_del(it->content);
- if (it->extension)
- evas_object_del(it->extension);
- evas_object_del(it->title);
+ EINA_LIST_FOREACH(it->content_list, l, content_pair)
+ evas_object_del(content_pair->content);
+
+ EINA_LIST_FOREACH(it->text_list, l, text_pair)
+ {
+ eina_stringshare_del(text_pair->part);
+ eina_stringshare_del(text_pair->text);
+ }
+
+ eina_list_free(it->content_list);
+ eina_list_free(it->text_list);
+
evas_object_del(it->base.view);
wd->stack = eina_list_remove(wd->stack, it);
evas_object_pass_events_set(wd->base, EINA_FALSE);
}
+static void
+_item_content_set(Elm_Naviframe_Item *navi_it, Evas_Object *content)
+{
+ if (navi_it->content == content) return;
+ if (navi_it->content) evas_object_del(navi_it->content);
+ elm_widget_sub_object_add(navi_it->base.widget, content);
+ edje_object_part_swallow(navi_it->base.view, "elm.swallow.content", content);
+ if (content)
+ edje_object_signal_emit(navi_it->base.view,
+ "elm,state,content,show",
+ "elm");
+ else
+ edje_object_signal_emit(navi_it->base.view,
+ "elm,state,content,hide",
+ "elm");
+ evas_object_event_callback_add(content,
+ EVAS_CALLBACK_DEL,
+ _item_content_del,
+ navi_it);
+ navi_it->content = content;
+ _item_sizing_eval(navi_it);
+}
+
EAPI Evas_Object *
elm_naviframe_add(Evas_Object *parent)
{
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_disable_hook_set(obj, _disable_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
+ elm_widget_signal_emit_hook_set(obj, _emit_hook);
//base
wd->base = edje_object_add(e);
return obj;
}
-EAPI Elm_Naviframe_Item *
+EAPI Elm_Object_Item *
elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
ERR("Failed to allocate new item! : naviframe=%p", obj);
return NULL;
}
+
+ elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
+ elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
+ elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
+ elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
+ elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
+ elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
+
//item base layout
it->base.view = edje_object_add(evas_object_evas_get(obj));
evas_object_smart_member_add(it->base.view, wd->base);
"elm,action,popped,finished",
"",
_popped_finished, it);
- elm_naviframe_item_style_set(it, item_style);
+ elm_naviframe_item_style_set(ELM_CAST(it), item_style);
//title
- it->title = edje_object_add(evas_object_evas_get(obj));
- elm_widget_sub_object_add(obj, it->title);
- _elm_theme_object_set(obj,
- it->title, "naviframe",
- "title",
- elm_widget_style_get(obj));
- edje_object_signal_callback_add(it->title,
- "elm,action,clicked",
+ edje_object_signal_callback_add(it->base.view,
+ "elm,action,title,clicked",
"elm",
_title_clicked, it);
- elm_naviframe_item_title_label_set(it, title_label);
+ _item_text_set_hook(ELM_CAST(it), "elm.text.title", title_label);
//title buttons
if ((!prev_btn) && (eina_list_count(wd->stack)))
_title_prev_btn_set(it, prev_btn, EINA_FALSE);
_title_next_btn_set(it, next_btn);
- edje_object_part_swallow(it->base.view, "elm.swallow.title", it->title);
- elm_naviframe_item_content_set(it, content);
+ _item_content_set(it, content);
_item_sizing_eval(it);
evas_object_show(it->base.view);
- prev_it = elm_naviframe_top_item_get(obj);
+ prev_it = ELM_CAST(elm_naviframe_top_item_get(obj));
if (prev_it)
{
if (wd->pass_events)
edje_object_signal_emit(it->base.view, "elm,state,visible", "elm");
it->title_visible = EINA_TRUE;
wd->stack = eina_list_append(wd->stack, it);
- return it;
+ return ELM_CAST(it);
}
EAPI Evas_Object *
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
- it = elm_naviframe_top_item_get(obj);
+ it = ELM_CAST(elm_naviframe_top_item_get(obj));
if (!it) return NULL;
wd->stack = eina_list_remove(wd->stack, it);
if (wd->preserve)
content = it->content;
- prev_it = elm_naviframe_top_item_get(obj);
+ prev_it = ELM_CAST(elm_naviframe_top_item_get(obj));
if (prev_it)
{
if (wd->pass_events)
return wd->preserve;
}
-EAPI void
-elm_naviframe_item_content_set(Elm_Naviframe_Item *it, Evas_Object *content)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
-
- if (it->content == content) return;
- if (it->content) evas_object_del(it->content);
- elm_widget_sub_object_add(it->base.widget, content);
- edje_object_part_swallow(it->base.view, "elm.swallow.content", content);
- if (content)
- edje_object_signal_emit(it->base.view,
- "elm,state,content,show",
- "elm");
- else
- edje_object_signal_emit(it->base.view,
- "elm,state,content,hide",
- "elm");
- evas_object_event_callback_add(content,
- EVAS_CALLBACK_DEL,
- _content_del,
- it);
- it->content = content;
- _item_sizing_eval(it);
-}
-
-EAPI Evas_Object *
-elm_naviframe_item_content_get(const Elm_Naviframe_Item *it)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
- return it->content;
-}
-
-EAPI void
-elm_naviframe_item_title_label_set(Elm_Naviframe_Item *it, const char *label)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
-
- edje_object_part_text_set(it->title, "elm.text.title", label);
- if (label)
- edje_object_signal_emit(it->title, "elm,state,title,show", "elm");
- else
- edje_object_signal_emit(it->title, "elm,state,title,hidew", "elm");
-
- eina_stringshare_replace(&it->title_label, label);
- _item_sizing_eval(it);
-}
-
-EAPI const char *
-elm_naviframe_item_title_label_get(const Elm_Naviframe_Item *it)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
- return it->title_label;
-}
-
-EAPI void
-elm_naviframe_item_subtitle_label_set(Elm_Naviframe_Item *it, const char *label)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
-
- edje_object_part_text_set(it->title, "elm.text.subtitle", label);
- if (label)
- edje_object_signal_emit(it->title, "elm,state,subtitle,show", "elm");
- else
- edje_object_signal_emit(it->title, "elm,state,subtitle,hide", "elm");
-
- eina_stringshare_replace(&it->title_sublabel, label);
- _item_sizing_eval(it);
-}
-
-EAPI const char *
-elm_naviframe_item_subtitle_label_get(const Elm_Naviframe_Item *it)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
- return it->title_sublabel;
-}
-
-EAPI Elm_Naviframe_Item*
+EAPI Elm_Object_Item*
elm_naviframe_top_item_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
return eina_list_last(wd->stack)->data;
}
-EAPI Elm_Naviframe_Item*
+EAPI Elm_Object_Item*
elm_naviframe_bottom_item_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
}
EAPI void
-elm_naviframe_item_button_set(Elm_Naviframe_Item *it, Evas_Object *btn, Elm_Naviframe_Button_Type btn_type)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
-
- switch(btn_type)
- {
- case ELM_NAVIFRAME_PREV_BUTTON:
- _title_prev_btn_set(it, btn, EINA_FALSE);
- break;
- case ELM_NAVIFRAME_NEXT_BUTTON:
- _title_next_btn_set(it, btn);
- break;
- default:
- WRN("Button type is invalid! : naviframe=%p", it->base.widget);
- break;
- }
- _item_sizing_eval(it);
-}
-
-EAPI Evas_Object *
-elm_naviframe_item_button_get(const Elm_Naviframe_Item *it, Elm_Naviframe_Button_Type btn_type)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
-
- switch(btn_type)
- {
- case ELM_NAVIFRAME_PREV_BUTTON:
- return it->title_prev_btn;
- case ELM_NAVIFRAME_NEXT_BUTTON:
- return it->title_next_btn;
- default:
- WRN("Button type is invalid! : naviframe=%p", it->base.widget);
- break;
- }
- return NULL;
-}
-
-EAPI void
-elm_naviframe_item_icon_set(Elm_Naviframe_Item *it, Evas_Object *icon)
+elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style)
{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
-
- Widget_Data *wd = elm_widget_data_get(it->base.widget);
- if (!wd) return;
-
- if (it->title_icon == icon) return;
- if (it->title_icon) evas_object_del(it->title_icon);
- it->title_icon = icon;
- if (!icon)
- {
- edje_object_signal_emit(it->title,
- "elm,state,icon,hide",
- "elm");
- return;
- }
- elm_widget_sub_object_add(it->base.widget, icon);
- edje_object_part_swallow(it->title, "elm.swallow.icon", icon);
- edje_object_signal_emit(it->title, "elm,state,icon,show", "elm");
-
- evas_object_event_callback_add(icon, EVAS_CALLBACK_DEL, _title_icon_del, it);
- _item_sizing_eval(it);
-}
-
-EAPI Evas_Object *
-elm_naviframe_item_icon_get(const Elm_Naviframe_Item *it)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
- return it->title_icon;
-}
-
-EAPI void
-elm_naviframe_item_style_set(Elm_Naviframe_Item *it, const char *item_style)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
char buf[256];
else
{
if (strlen(item_style) > sizeof(buf))
- WRN("too much long style name! : naviframe=%p", it->base.widget);
+ WRN("too much long style name! : naviframe=%p", navi_it->base.widget);
else
sprintf(buf, "item/%s", item_style);
}
- _elm_theme_object_set(it->base.widget,
- it->base.view,
+ _elm_theme_object_set(navi_it->base.widget,
+ navi_it->base.view,
"naviframe",
buf,
- elm_widget_style_get(it->base.widget));
+ elm_widget_style_get(navi_it->base.widget));
}
EAPI const char *
-elm_naviframe_item_style_get(const Elm_Naviframe_Item *it)
+elm_naviframe_item_style_get(const Elm_Object_Item *it)
{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
- return it->style;
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+ return navi_it->style;
}
EAPI void
-elm_naviframe_item_title_visible_set(Elm_Naviframe_Item *it, Eina_Bool visible)
+elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible)
{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
visible = !!visible;
- if (it->title_visible == visible) return;
+ if (navi_it->title_visible == visible) return;
if (visible)
- edje_object_signal_emit(it->base.view, "elm,state,title,show", "elm");
+ edje_object_signal_emit(navi_it->base.view, "elm,state,title,show", "elm");
else
- edje_object_signal_emit(it->base.view, "elm,state,title,hide", "elm");
+ edje_object_signal_emit(navi_it->base.view, "elm,state,title,hide", "elm");
- it->title_visible = visible;
+ navi_it->title_visible = visible;
}
EAPI Eina_Bool
-elm_naviframe_item_title_visible_get(const Elm_Naviframe_Item *it)
+elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, EINA_FALSE);
- return it->title_visible;
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
+ Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+ return navi_it->title_visible;
}
-EAPI void
-elm_naviframe_item_extension_set(Elm_Naviframe_Item *it, const char *swallow, Evas_Object *extension)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it);
- Evas_Object *prev;
- if (!swallow)
- {
- WRN("swallow part should not be NULL! : naviframe=%p", it->base.widget);
- return;
- }
- if (it->extension) evas_object_del(it->extension);
- it->extension = extension;
- if (!extension) return;
- evas_object_event_callback_add(extension, EVAS_CALLBACK_DEL, _extension_del, it);
- if (!edje_object_part_swallow(it->base.view, swallow, extension))
- return;
- elm_widget_sub_object_add(it->base.widget, extension);
- edje_object_signal_emit(it->base.view,
- "elm,state,extension,show",
- "elm");
- _sizing_eval(it->base.view);
-}
-
-EAPI Evas_Object *
-elm_naviframe_item_extension_unset(Elm_Naviframe_Item *it, const char *swallow)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
-
- Evas_Object *extension = it->extension;
- if (!extension) return NULL;
- edje_object_part_unswallow(it->base.view, extension);
- elm_widget_sub_object_del(it->base.widget, extension);
- evas_object_event_callback_del(extension, EVAS_CALLBACK_DEL, _extension_del);
- edje_object_signal_emit(it->base.view,
- "elm,state,extension,hide",
- "elm");
- _sizing_eval(it->base.widget);
- it->extension = NULL;
- return extension;
-}
-
-EAPI Evas_Object *
-elm_naviframe_item_extension_get(const Elm_Naviframe_Item *it, const char *swallow)
-{
- ELM_NAVIFRAME_ITEM_CHECK_RETURN(it, NULL);
- return edje_object_part_swallow_get(it->base.view, swallow);
-}
\r
strncpy(buf, "item/", sizeof(buf));\r
strncat(buf, item_style, sizeof(buf) - strlen(buf));\r
- if (!eina_stringshare_replace(&it->item_style, item_style)) return NULL;\r
+ eina_stringshare_replace(&it->item_style, item_style);\r
_elm_theme_object_set(obj, it->base, "navigationbar_ex", buf, elm_widget_style_get(obj));\r
\r
\r
{
Evas_Object *btn, *icon;
const char *label;
- Eina_Bool autorepeat;
- Eina_Bool repeating;
double ar_threshold;
double ar_interval;
Ecore_Timer *timer;
const char *statelabel[4];
int statetype[4];
+ Eina_Bool autorepeat : 1;
+ Eina_Bool repeating : 1;
+ Eina_Bool delete_me : 1;
};
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
+static void _del_pre_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
+_del_pre_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->delete_me = EINA_TRUE;
+}
+
+static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord w, h;
if (!wd) return;
+ if (wd->delete_me) 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);
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_can_focus_set(obj, EINA_TRUE);
#ifdef HAVE_ELEMENTARY_X
static Ecore_Event_Handler *_prop_change_handler = NULL;
static Ecore_X_Window _root_1st = 0;
-#define ATOM_COUNT 22
+#define ATOM_COUNT 25
static Ecore_X_Atom _atom[ATOM_COUNT];
static Ecore_X_Atom _atom_config = 0;
static const char *_atom_names[ATOM_COUNT] =
Evas_Object *shelf, *panel, *virtualkeypad;
Evas_Object *content;
Evas_Object *scroller;
+ Evas_Object *layout;
#ifdef HAVE_ELEMENTARY_X
Ecore_Event_Handler *prop_hdl;
Ecore_X_Virtual_Keyboard_State vkb_state;
_mirrored_set(obj, elm_widget_mirrored_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);
_sizing_eval(obj);
}
static void
-_sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
+_sub_del(void *data, Evas_Object *obj __UNUSED__, void *event_info)
{
- Widget_Data *wd = elm_widget_data_get(obj);
+ Widget_Data *wd = elm_widget_data_get(data);
Evas_Object *sub = event_info;
if (!wd) return;
{
evas_object_event_callback_del_full(sub,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
+ _changed_size_hints, data);
wd->content = NULL;
- _sizing_eval(obj);
+ _sizing_eval(data);
}
}
+
/* 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)
_elm_theme_object_set(obj, wd->base, "conformant", "base", "default");
elm_widget_resize_object_set(obj, wd->base);
+ wd->layout = elm_layout_add(obj);
+ edje_object_part_swallow(wd->base, "elm.swallow.content", wd->layout);
+ elm_layout_theme_set(wd->layout, "conformant", "layout", "content");
+
+ _swallow_conformant_parts(obj);
+
#ifdef HAVE_ELEMENTARY_X
Evas_Object *top = elm_widget_top_get(obj);
Ecore_X_Window xwin = elm_win_xwindow_get(top);
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
_conformant_move_resize_event_cb, obj);
#endif
- evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ evas_object_smart_callback_add(wd->layout, "sub-object-del", _sub_del, obj);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
if (wd->content == content) return;
if (wd->content) evas_object_del(wd->content);
wd->content = content;
- if (content)
+ if (wd->content)
{
- elm_widget_sub_object_add(obj, content);
- evas_object_event_callback_add(content,
+ elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content);
+ evas_object_event_callback_add( wd->content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
- edje_object_part_swallow(wd->base, "elm.swallow.content", content);
}
_sizing_eval(obj);
}
if (!wd) return NULL;
if (!wd->content) return NULL;
content = wd->content;
- elm_widget_sub_object_del(obj, wd->content);
- edje_object_part_unswallow(wd->base, wd->content);
+ elm_layout_content_unset(wd->layout, "elm.swallow.content");
wd->content = NULL;
return content;
}
/*Finger waggle warning*/
_elm_dangerous_call_check(__FUNCTION__);
- return (Evas_Object *)edje_object_part_object_get(wd->base, "elm.swallow.content");
+ return wd->layout;
}
+#include <locale.h>
+#include <unicode/udat.h>
+#include <unicode/ucal.h>
+#include <unicode/putil.h>
+#include <unicode/ustring.h>
+#include <unicode/uchar.h>
#include <Elementary.h>
#include "elm_priv.h"
-
#ifdef HAVE_ELEMENTARY_X
# include <langinfo.h>
#else
* @defgroup Datefield Datefield
* @ingroup Elementary
*
- * This is a date editfield. it is used to input date and time using keypad
+ * This is a date edit field. it is used to input date and time using
+ * diskselector integrated ctxpopup.
*/
typedef struct _Widget_Data Widget_Data;
-enum
+#define DATEFIELD_TYPE_COUNT 6
+#define BUFFER_SIZE 64
+#define MAX_FORMAT_LEN 32
+#define MAX_SEPARATOR_LEN 3
+#define MAX_ITEM_FORMAT_LEN 6
+#define DISKSELECTOR_ITEMS_NUM_MIN 4
+
+// Interface between EDC & C code. Item names & signal names.
+// Values 0 to 6 are valid range, can be substituted for %d.
+#define EDC_DATEFIELD_ENABLE_SIG_STR "elm,state,enabled"
+#define EDC_DATEFIELD_DISABLE_SIG_STR "elm,state,disabled"
+#define EDC_DATEFIELD_FOCUSIN_SIG_STR "elm,action,focus"
+#define EDC_DATEFIELD_FOCUSOUT_SIG_STR "elm,action,unfocus"
+#define EDC_PART_ITEM_STR "item%d"
+#define EDC_PART_SEPARATOR_STR "separator%d"
+#define EDC_PART_ITEM_OVER_STR "item%d.over"
+#define EDC_PART_ITEM_ENABLE_SIG_STR "item%d,enable"
+#define EDC_PART_ITEM_DISABLE_SIG_STR "item%d,disable"
+#define EDC_PART_ITEM_FOCUSIN_SIG_STR "item%d,focus,in"
+#define EDC_PART_ITEM_FOCUSOUT_SIG_STR "item%d,focus,out"
+#define EDC_PART_ITEM_STYLE_DEFAULT_SIG_STR "item%d,style,default"
+#define EDC_PART_ITEM_STYLE_AMPM_SIG_STR "item%d,style,ampm"
+
+typedef struct _ICU_Format
{
- DATE_FORMAT_YYMMDD,
- DATE_FORMAT_YYDDMM,
- DATE_FORMAT_MMYYDD,
- DATE_FORMAT_MMDDYY,
- DATE_FORMAT_DDYYMM,
- DATE_FORMAT_DDMMYY,
- DATE_FORMAT_MAX
+ Elm_Datefield_ItemType type;
+ UChar fmt_char[2];
+ const char *def_sep;
+ UDateFormatField icu_type;
+ int def_min;
+ int def_max;
+}ICU_Format_Map;
+
+static const UChar icu_fmt_chars[] = {'y', 'M', 'd', 'h', 'H',
+ 'm', 's', 'a', 'z', 'E',
+ 'Q', 'L', 'v'};
+
+//-1 denotes, get the value from ICU dynamically.
+static const ICU_Format_Map mapping[DATEFIELD_TYPE_COUNT] = {
+ { ELM_DATEFIELD_YEAR, {'y',0}, "", UDAT_YEAR_FIELD, 1970, 2037},
+ { ELM_DATEFIELD_MONTH, {'M',0}, "", UDAT_MONTH_FIELD, 0, 11 },
+ { ELM_DATEFIELD_DATE, {'d',0}, "", UDAT_DATE_FIELD, 1, -1 },
+ { ELM_DATEFIELD_HOUR, {'H','h'}, ":", UDAT_HOUR_OF_DAY0_FIELD, -1, -1 },
+ { ELM_DATEFIELD_MINUTE, {'m',0}, " ", UDAT_MINUTE_FIELD, 0, 59 },
+ { ELM_DATEFIELD_AMPM, {'a',0}, " ", UDAT_AM_PM_FIELD, 0, 1 }
};
-enum
+typedef struct _Datefield_Item
{
- ENTRY_YEAR,
- ENTRY_MON,
- ENTRY_DAY,
- ENTRY_HOUR,
- ENTRY_MIN
-};
-
-#define MONTH_MAXIMUM 12
-#define HOUR_24H_MAXIMUM 23
-#define HOUR_12H_MAXIMUM 12
-#define MIN_MAXIMUM 59
-#define YEAR_MAX_LENGTH 4
+ UChar format[MAX_ITEM_FORMAT_LEN]; //format being set for the current item
+ const char *content; //string to be displayed
+ const char *separator;
+ int location; //location of the item as per the current format
+ int value;
+ int min, max;
+ int default_min, default_max;
+ UDateFormatField type; //type of the item
+ UDateFormatField sub_type; //mainly used for Time, whether 12hr/24Hr format
+ Eina_Bool fmt_exist:1; //if item format is present or not
+ Eina_Bool enabled:1; //if item is to be shown or not
+ Eina_Bool abs_min:1;
+ Eina_Bool abs_max:1;
+} Datefield_Item;
struct _Widget_Data
{
Evas_Object *base;
- Evas_Object *time_ampm;
+ Datefield_Item *item_list; //Fixed set of items, so no Eina list.
Evas_Object *ctxpopup;
- Evas_Object *diskselector;
- unsigned int layout;
- int year, month, day, hour, min;
- int y_max, m_max, d_max;
- int y_min, m_min, d_min;
- int date_format,date_focusedpart;
- Eina_Bool pm:1;
- Eina_Bool time_mode:1;
- Eina_Bool format_exists:1;
- Eina_Bool ctxpopup_show:1;
+ Datefield_Item *selected_it;
+ UChar format[MAX_FORMAT_LEN];
+ UCalendar *calendar;
+ UDateFormat* date_fmt; //ICU date format
+ UDateFormatStyle date_style;
+ UDateFormatStyle time_style;
+ Eina_Bool user_format:1; //whether user set format or the default format.
+
+ //////////////////////DEPRECATED//////////////////////
+ unsigned int datefield_layout; // user set layout
+ const char *old_style_format; // user set format
+ Eina_Bool time_mode; // current time mode 12hr/24hr
+ //////////////////////////////////////////////////////
};
+typedef struct _DiskItem_Data
+{
+ Evas_Object *datefield;
+ unsigned int sel_item_value;
+} DiskItem_Data;
+
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
static void _on_focus_hook(void *data __UNUSED__, Evas_Object *obj);
-static void _theme_hook(Evas_Object *obj);
+static void _disable_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _sizing_eval(Evas_Object *obj);
-static void _datefield_resize_cb(void *data, Evas *e __UNUSED__,
- Evas_Object *obj, void *event_info __UNUSED__);
-static void _ampm_clicked_cb(void *data, Evas_Object *obj, void *event_info);
-static void _signal_rect_mouse_down(void *data, Evas_Object *obj __UNUSED__,
- const char *emission __UNUSED__,
- const char *source);
+static void _theme_hook(Evas_Object *obj);
+static void _ctxpopup_dismissed_cb(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__);
+static void _datefield_resize_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj
+ __UNUSED__, void *event_info __UNUSED__);
+static void _datefield_move_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj
+ __UNUSED__, void *event_info __UNUSED__);
+static void _contextual_field_limit_get(Evas_Object * obj, Datefield_Item * it,
+ UDateFormatField udtype, int * range_min, int * range_max );
+static void _update_items(Evas_Object *obj);
+static void _field_value_set(Evas_Object * obj, UDateFormatField icu_type,
+ int value, Eina_Bool adjust_time);
static void _diskselector_cb(void *data, Evas_Object *obj __UNUSED__,
- void *event_info);
-static void _datefield_focus_set(Evas_Object *data);
-static int _maximum_day_get(int year, int month);
-static int _check_date_boundary(Evas_Object *obj, int num, int flag);
-static char* _get_i18n_string(Evas_Object *obj, nl_item item);
-static void _date_update(Evas_Object *obj);
+ void *event_info __UNUSED__);
+static void _ampm_clicked (void *data);
+static void _diskselector_item_free_cb(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__);
+static void _load_field_options(Evas_Object * data, Evas_Object *diskselector,
+ Datefield_Item *it);
+static void _datefield_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__, const char *source);
+static void _format_reload(Evas_Object *obj);
+static void _item_list_init(Evas_Object *obj);
+
+static const char SIG_CHANGED[] = "changed";
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_CHANGED, ""},
+ {NULL, NULL}
+};
static void
_del_hook(Evas_Object *obj)
{
- Widget_Data *wd = elm_widget_data_get(obj);
+ Widget_Data *wd;
+ Datefield_Item *tmp;
+ unsigned int idx;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+ {
+ tmp = wd->item_list + idx;
+ if (tmp->content) eina_stringshare_del(tmp->content);
+ if (tmp->separator) eina_stringshare_del(tmp->separator);
+ }
+ free( wd->item_list );
+ ucal_close(wd->calendar);
+ wd->calendar = NULL;
+ udat_close(wd->date_fmt);
+ wd->date_fmt = NULL;
+ evas_object_del(wd->ctxpopup);
- if (!wd) return ;
free(wd);
}
static void
+_disable_hook(Evas_Object *obj)
+{
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || !wd->base) return;
+ if (elm_widget_disabled_get(obj))
+ {
+ evas_object_hide(wd->ctxpopup);
+ edje_object_signal_emit(wd->base, EDC_DATEFIELD_DISABLE_SIG_STR,"elm");
+ }
+ else
+ edje_object_signal_emit(wd->base, EDC_DATEFIELD_ENABLE_SIG_STR, "elm");
+}
+
+static void
_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
{
- Widget_Data *wd = elm_widget_data_get(obj);
+ Widget_Data *wd;
- if (!wd || !wd->base) return ;
+ wd = elm_widget_data_get(obj);
+ if (!wd ) return;
+ if (elm_widget_focus_get(obj))
+ edje_object_signal_emit(wd->base, EDC_DATEFIELD_FOCUSIN_SIG_STR, "elm");
+ else
+ edje_object_signal_emit(wd->base, EDC_DATEFIELD_FOCUSOUT_SIG_STR, "elm");
}
static void
-_theme_hook(Evas_Object *obj)
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
{
- Widget_Data *wd = elm_widget_data_get(obj);
- char sig[32] = {0,};
- char buf[1024];
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ evas_object_hide(wd->ctxpopup);
+ edje_object_mirrored_set(wd->base, rtl);
+}
+
+static void
+_sizing_eval(Evas_Object *obj)
+{
+ Widget_Data *wd;
+ Evas_Coord minw = -1, minh = -1;
+ wd = elm_widget_data_get(obj);
if (!wd || !wd->base) return;
+ edje_object_size_min_calc(wd->base, &minw, &minh);
+ evas_object_size_hint_min_set(obj, minw, minh);
+ evas_object_size_hint_max_set(obj, -1, -1);
+}
- if (wd->layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME)
- _elm_theme_object_set(obj, wd->base, "datefield", "dateandtime",
- elm_widget_style_get(obj));
- else if (wd->layout == ELM_DATEFIELD_LAYOUT_DATE)
- _elm_theme_object_set(obj, wd->base, "datefield", "date",
- elm_widget_style_get(obj));
- else if (wd->layout == ELM_DATEFIELD_LAYOUT_TIME)
- _elm_theme_object_set(obj, wd->base, "datefield", "time",
- elm_widget_style_get(obj));
-
- if (wd->time_ampm)
- {
- edje_object_part_unswallow(wd->base,wd->time_ampm);
- evas_object_del(wd->time_ampm);
- wd->time_ampm = NULL;
- }
- if ((wd->layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME
- || wd->layout == ELM_DATEFIELD_LAYOUT_TIME) && wd->time_mode)
- {
- wd->time_ampm = elm_button_add(obj);
- elm_widget_sub_object_add(obj, wd->time_ampm);
- edje_object_part_swallow(wd->base, "elm.swallow.time.ampm",
- wd->time_ampm);
- snprintf(buf,sizeof(buf),"datefield.ampm/%s",elm_widget_style_get(obj));
- elm_object_style_set(wd->time_ampm, buf);
- evas_object_size_hint_weight_set(wd->time_ampm, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(wd->time_ampm, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_smart_callback_add(wd->time_ampm, "clicked",
- _ampm_clicked_cb, obj);
- }
+static void
+_theme_hook(Evas_Object *obj)
+{
+ Widget_Data *wd;
+ Datefield_Item *it;
+ char buf[BUFFER_SIZE];
+ int idx;
+ //Evas_Object *diskselector;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || !wd->base) return;
+ _elm_theme_object_set(obj, wd->base, "datefield", "base",
+ elm_widget_style_get(obj));
+ _elm_widget_mirrored_reload(obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
+ snprintf(buf, sizeof(buf), "datefield/%s", elm_object_style_get(obj));
+ elm_object_style_set(wd->ctxpopup, buf);
+ /*//Enabled once elm_object_content_get() API comes to git.
+ if (diskselector = elm_object_content_get(wd->ctxpopup))
+ elm_object_style_set(diskselector, buf);*/
edje_object_scale_set(wd->base,elm_widget_scale_get(obj)*_elm_config->scale);
- //set date format
- if (wd->format_exists)
- sprintf(sig, "elm,state,format,%s", elm_datefield_date_format_get(obj));
+ if (elm_widget_disabled_get(obj))
+ edje_object_signal_emit(wd->base, EDC_DATEFIELD_DISABLE_SIG_STR,"elm");
else
+ edje_object_signal_emit(wd->base, EDC_DATEFIELD_ENABLE_SIG_STR, "elm");
+
+ for (idx= 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
{
- char *str = _get_i18n_string(obj, D_FMT);
- if (str)
+ it = wd->item_list + idx;
+ if (it->fmt_exist && it->enabled )
+ {
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_STR, it->location);
+ edje_object_part_text_set(wd->base, buf, it->content);
+ snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, it->location);
+ edje_object_part_text_set(wd->base, buf, it->separator);
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_ENABLE_SIG_STR,
+ it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
+ if (it->type == UDAT_AM_PM_FIELD)
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_AMPM_SIG_STR,
+ it->location);
+ else
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_DEFAULT_SIG_STR,
+ it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
+ }
+ else
{
- 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);
+ snprintf(buf, sizeof(buf),EDC_PART_ITEM_DISABLE_SIG_STR,
+ it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
}
}
- edje_object_signal_emit(wd->base, sig, "elm");
edje_object_message_signal_process(wd->base);
-
- _date_update(obj);
_sizing_eval(obj);
}
static void
-_sizing_eval(Evas_Object *obj)
+_ctxpopup_dismissed_cb(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
- Widget_Data *wd = elm_widget_data_get(obj);
- Evas_Coord minw = -1, minh = -1;
+ Widget_Data *wd;
+ Evas_Object *diskselector;
+ char buf[BUFFER_SIZE];
- edje_object_size_min_calc(wd->base, &minw, &minh);
- evas_object_size_hint_min_set(obj, minw, minh);
- evas_object_size_hint_max_set(obj, -1, -1);
+ wd = elm_widget_data_get(data);
+ if (!wd || !wd->base) return;
+ diskselector = elm_ctxpopup_content_unset(wd->ctxpopup);
+ if (diskselector) evas_object_del(diskselector);
+
+ if (wd->selected_it)
+ {
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_FOCUSOUT_SIG_STR,
+ wd->selected_it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
+ wd->selected_it = NULL;
+ }
}
static void
-_datefield_resize_cb(void *data,Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
+_datefield_resize_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
- Widget_Data *wd = elm_widget_data_get(data);
-
- if (!wd || !wd->base) return ;
+ Widget_Data *wd;
- Evas_Object *disk = elm_ctxpopup_content_unset(wd->ctxpopup);
- if (disk) evas_object_del(disk);
- if (wd->ctxpopup_show)
- wd->ctxpopup_show = EINA_FALSE;
+ wd = elm_widget_data_get(data);
+ if (!wd) return;
evas_object_hide(wd->ctxpopup);
}
static void
-_ctxpopup_dismissed_cb(void *data, Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
+_datefield_move_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
- Widget_Data *wd = elm_widget_data_get(data);
-
- if (!wd || !wd->base) return ;
+ Widget_Data *wd;
- Evas_Object *disk = elm_ctxpopup_content_unset(wd->ctxpopup);
- if (disk) evas_object_del(disk);
- if (wd->ctxpopup_show)
- wd->ctxpopup_show = EINA_FALSE;
+ wd = elm_widget_data_get(data);
+ if (!wd) return;
+ evas_object_hide(wd->ctxpopup);
+}
- switch (wd->date_focusedpart)
+static void
+_contextual_field_limit_get(Evas_Object * obj, Datefield_Item * it,
+ UDateFormatField udtype, int *range_min, int *range_max)
+{
+ Widget_Data *wd;
+ Datefield_Item * tmp;
+ int idx,icu_min, icu_max;
+ UErrorCode status = U_ZERO_ERROR;
+ Eina_Bool min_limit = EINA_TRUE;
+ Eina_Bool max_limit = EINA_TRUE;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || !it) return;
+ //Top down check all the fields until current field for Min/Max limit
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
{
- case ENTRY_YEAR:
- edje_object_signal_emit(wd->base, "elm,state,year,focus,out", "elm");
- break;
- case ENTRY_MON:
- edje_object_signal_emit(wd->base, "elm,state,month,focus,out", "elm");
- break;
- case ENTRY_DAY:
- edje_object_signal_emit(wd->base, "elm,state,day,focus,out", "elm");
- break;
- case ENTRY_HOUR:
- edje_object_signal_emit(wd->base, "elm,state,hour,focus,out", "elm");
- break;
- case ENTRY_MIN:
- edje_object_signal_emit(wd->base, "elm,state,min,focus,out", "elm");
- break;
+ tmp = wd->item_list + idx;
+ if (tmp->type == it->type) break;
+
+ if (max_limit && ((int)tmp->value < tmp->max)) max_limit = EINA_FALSE;
+ if (min_limit && ((int)tmp->value > tmp->min)) min_limit = EINA_FALSE;
}
+
+ if (it->abs_min || min_limit) (*range_min) = it->min;
+ else (*range_min) = it->default_min;
+
+ if (it->abs_max || max_limit) (*range_max) = it->max;
+ else (*range_max) = it->default_max;
+
+ icu_min = ucal_getLimit( wd->calendar, udat_toCalendarDateField(udtype),
+ UCAL_ACTUAL_MINIMUM, &status );
+ icu_max = ucal_getLimit( wd->calendar, udat_toCalendarDateField(udtype),
+ UCAL_ACTUAL_MAXIMUM, &status );
+
+ if ((*range_min == -1) || (*range_min < icu_min))
+ *range_min = icu_min;
+ if ((*range_max == -1) || (*range_max > icu_max))
+ *range_max = icu_max;
}
static void
-_ampm_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
+_update_items(Evas_Object *obj)
{
- Widget_Data *wd = elm_widget_data_get(data);
- char *str;
-
- if (!wd || !wd->base) return ;
-
- wd->pm = !wd->pm;
- if (wd->pm)
- {
- str = _get_i18n_string(data, PM_STR);
- if (str)
+ Widget_Data *wd;
+ Datefield_Item *it;
+ char buf[BUFFER_SIZE];
+ int idx= 0;
+ UDate date;
+ UChar result[BUFFER_SIZE];
+ UErrorCode status = U_ZERO_ERROR;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || !wd->base) return;
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
{
- elm_object_text_set(wd->time_ampm, str);
- free(str);
+ it = wd->item_list + idx;
+ ucal_set (wd->calendar, udat_toCalendarDateField(it->type), it->value);
}
- wd->hour += HOUR_12H_MAXIMUM;
- }
- else
+ date = ucal_getMillis (wd->calendar, &status);
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
{
- str = _get_i18n_string(data, AM_STR);
- if (str)
- {
- elm_object_text_set(wd->time_ampm, str);
- free(str);
- }
- wd->hour -= HOUR_12H_MAXIMUM;
+ it = wd->item_list + idx;
+ if ( it->fmt_exist && it->enabled )
+ {
+ udat_applyPattern(wd->date_fmt, TRUE, it->format,
+ u_strlen(it->format));
+ udat_format(wd->date_fmt, date, result, BUFFER_SIZE, NULL, &status);
+ u_strToUTF8(buf, BUFFER_SIZE, 0, result, -1, &status);
+ if (it->content) eina_stringshare_del(it->content);
+ it->content = eina_stringshare_add(buf);
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_STR, it->location);
+ edje_object_part_text_set(wd->base, buf, it->content);
+ snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, it->location+1);
+ edje_object_part_text_set(wd->base, buf, it->separator);
+ }
}
- evas_object_smart_callback_call(data, "changed", NULL);
}
static void
-_signal_rect_mouse_down(void *data, Evas_Object *obj __UNUSED__,
- const char *emission __UNUSED__, const char *source)
+_field_value_set(Evas_Object * obj, UDateFormatField icu_type, int value, Eina_Bool adjust_time)
{
- Widget_Data *wd = elm_widget_data_get(data);
+ Widget_Data *wd;
+ Datefield_Item * it, *it2 = NULL;
+ int idx, min, max;
+ UErrorCode status = U_ZERO_ERROR;
+ Eina_Bool validate = EINA_FALSE;
+ Eina_Bool value_changed = EINA_FALSE;
+ wd = elm_widget_data_get(obj);
if (!wd) return;
+ //Validate & reset lower order fields
+ for ( idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+ {
+ if (mapping[idx].icu_type == icu_type) validate = EINA_TRUE;
+ if (!validate) continue;
- if (!strcmp(source, "elm.rect.date.year.over"))
- wd->date_focusedpart = ENTRY_YEAR;
- else if (!strcmp(source, "elm.rect.date.month.over"))
- wd->date_focusedpart = ENTRY_MON;
- else if (!strcmp(source, "elm.rect.date.day.over"))
- wd->date_focusedpart = ENTRY_DAY;
- else if (!strcmp(source, "elm.rect.time.hour.over"))
- wd->date_focusedpart = ENTRY_HOUR;
- else if (!strcmp(source, "elm.rect.time.min.over"))
- wd->date_focusedpart = ENTRY_MIN;
-
- _datefield_focus_set(data);
-}
-
-static void
-_diskselector_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info)
-{
- const char *label = elm_diskselector_item_label_get(
- (Elm_Diskselector_Item *) event_info);
- Widget_Data *wd = elm_widget_data_get(data);
- int i=0, mon = 0, hour =0;
-
- if (!wd || !wd->base) return;
+ it = wd->item_list + idx;
+ _contextual_field_limit_get(obj, it, it->type, &min, &max);
- if (label)
- {
- if ((wd->date_focusedpart == ENTRY_YEAR) && (wd->year!=atoi(label)))
+ if (it->type == icu_type ) //Set the value now
{
- wd->year = _check_date_boundary(data, atoi(label), ENTRY_YEAR);
- edje_object_signal_emit(wd->base,"elm,state,year,focus,out","elm");
- _date_update(data);
- }
- else if (wd->date_focusedpart == ENTRY_MON)
- {
- char *month_list[] = {
- E_("Jan"), E_("Feb"), E_("Mar"), E_("Apr"),
- E_("May"), E_("Jun"), E_("Jul"), E_("Aug"),
- E_("Sep"), E_("Oct"), E_("Nov"), E_("Dec"),
- };
- for (i=0; i <12; i++)
- {
- if (!(strcmp(month_list[i],label)))
- mon = _check_date_boundary(data, i+1, ENTRY_MON);
- }
- if (wd->month != mon)
+ // Updating time may alter AM/PM and viceversa. Read back from ICU.
+ if (it->type == UDAT_HOUR_OF_DAY0_FIELD )
{
- wd->month = mon;
- edje_object_signal_emit(wd->base, "elm,state,month,focus,out",
- "elm");
- _date_update(data);
+ it2 = wd->item_list + ELM_DATEFIELD_AMPM;
+ //12 hr format & PM then add 12 to value.
+ if (it->sub_type == UDAT_HOUR1_FIELD && adjust_time &&
+ it2->value && value < 12)
+ value += 12;
}
+ else if (it->type == UDAT_AM_PM_FIELD )
+ it2 = wd->item_list + ELM_DATEFIELD_HOUR;
+
+ if (value < min) value = min;
+ else if (value > max) value = max;
+ if (it->value == value) continue;
+ it->value = value;
+ value_changed = EINA_TRUE;
+ ucal_set(wd->calendar, udat_toCalendarDateField (it->type),
+ it->value);
+ //Read back AM/PM or hour value. update based new 24hr format time value.
+ if (it2)
+ it2->value = ucal_get(wd->calendar,
+ udat_toCalendarDateField(it2->type),&status);
}
- else if ((wd->date_focusedpart == ENTRY_DAY) && (wd->day!=atoi(label)))
- {
- wd->day = _check_date_boundary(data, atoi(label), ENTRY_DAY);
- edje_object_signal_emit(wd->base,"elm,state,day,focus,out", "elm");
- _date_update(data);
- }
- else if (wd->date_focusedpart == ENTRY_HOUR)
+ else
{
- if ((wd->hour > 12)&& (wd->time_mode)&& (wd->pm))
- hour = wd->hour - HOUR_12H_MAXIMUM;
- else
- hour = wd->hour;
- if (hour!=atoi(label))
+ //Validate current value against context based Min/Max restriction.
+ if (it->value < min)
{
- wd->hour = atoi(label);
- edje_object_signal_emit(wd->base, "elm,state,hour,focus,out",
- "elm");
- _date_update(data);
+ it->value = min;
+ value_changed = EINA_TRUE;
}
+ else if (it->value > max)
+ {
+ it->value = max;
+ value_changed = EINA_TRUE;
+ }
+ ucal_set(wd->calendar, udat_toCalendarDateField (it->type),
+ it->value);
}
- else if ((wd->date_focusedpart == ENTRY_MIN) && (wd->min!=atoi(label)))
- {
- wd->min = atoi(label);
- edje_object_signal_emit(wd->base,"elm,state,min,focus,out", "elm");
- _date_update(data);
- }
- evas_object_smart_callback_call(data, "changed", NULL);
}
+ _update_items(obj);
+
+ if (value_changed)
+ evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
}
static void
-_datefield_focus_set(Evas_Object *data)
+_diskselector_cb(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
{
- Elm_Diskselector_Item *item = NULL;
- Evas_Object *diskselector, *disk, *edj_part = NULL;
- const char *item_list[138], *value = NULL;
- int idx, count_start = 0, count_end = 0;
- Evas_Coord x, y, w, h;
+ DiskItem_Data *cb_data;
+ Widget_Data *wd;
- Widget_Data *wd = elm_widget_data_get(data);
- if (!wd || !wd->base) return;
+ cb_data = (DiskItem_Data *)data;
+ if (!cb_data) return;
+ wd = elm_widget_data_get(cb_data->datefield);
+ if (!wd ) return;
+ _field_value_set(cb_data->datefield, wd->selected_it->type,
+ cb_data->sel_item_value, EINA_TRUE);
+ evas_object_hide(wd->ctxpopup);
+}
- diskselector = elm_diskselector_add(elm_widget_top_get(data));
- elm_object_style_set(diskselector, "extended/timepicker");
- evas_object_size_hint_weight_set(diskselector, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(diskselector, EVAS_HINT_FILL,EVAS_HINT_FILL);
- elm_diskselector_display_item_num_set(diskselector, 8);
- elm_object_focus_allow_set(diskselector, EINA_FALSE);
- elm_diskselector_side_label_lenght_set(diskselector, 4);
+static void
+_ampm_clicked (void *data)
+{
+ Widget_Data *wd;
+ Datefield_Item * it;
+ char buf[BUFFER_SIZE];
+ UErrorCode status = U_ZERO_ERROR;
- char *month_list[] = {
- E_("Jan"), E_("Feb"), E_("Mar"), E_("Apr"), E_("May"), E_("Jun"),
- E_("Jul"), E_("Aug"), E_("Sep"), E_("Oct"), E_("Nov"), E_("Dec"),
- };
+ wd = elm_widget_data_get(data);
+ if (!wd || !wd->base) return;
+ wd->selected_it->value = !wd->selected_it->value;
+ ucal_set(wd->calendar, udat_toCalendarDateField(wd->selected_it->type),
+ wd->selected_it->value );
+
+ //Read back hour according to updated AM/PM
+ it = wd->item_list + ELM_DATEFIELD_HOUR;
+ it->value = ucal_get(wd->calendar, udat_toCalendarDateField(it->type),
+ &status );
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_FOCUSOUT_SIG_STR,
+ wd->selected_it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
+ wd->selected_it = NULL;
+ _update_items(data);
+ evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
+}
- if (wd->date_focusedpart == ENTRY_YEAR)
+static void
+_diskselector_item_free_cb(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ if (data) free(data);
+}
+\r
+static void
+_load_field_options(Evas_Object * data, Evas_Object *diskselector,
+ Datefield_Item *it)
+{
+ Widget_Data *wd;
+ Datefield_Item *it2, *it3;
+ DiskItem_Data *disk_data;
+ Elm_Diskselector_Item *item;
+ int idx, min, max, selected_val;
+ int text_len, max_len = 0;
+ char item_label[BUFFER_SIZE];
+ UCalendarDateFields cfield;
+ UChar result[BUFFER_SIZE];
+ UErrorCode status = U_ZERO_ERROR;
+
+ wd = elm_widget_data_get(data);
+ if (!wd) return;
+ //Apply field format to Date Format Object
+ udat_applyPattern(wd->date_fmt, TRUE, it->format,
+ u_strlen(it->format));
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
{
- edje_object_signal_emit(wd->base, "elm,state,year,focus,in", "elm");
- value = edje_object_part_text_get(wd->base,"elm.text.date.year");
- edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
- "elm.rect.date.year.over");
- count_start = wd->y_min;
- if (wd->y_max > wd->y_min)
- count_end = wd->y_max ;
+ it3 = wd->item_list + idx;
+ // To avoid month roll over based on date value, set to min value.
+ if (it3->type == UDAT_DATE_FIELD)
+ ucal_set (wd->calendar, udat_toCalendarDateField (it3->type), 1);
else
- count_end = 2037 ;
- //Maximum limit is set for making it compatible with Calendar widget.
- }
- else if (wd->date_focusedpart == ENTRY_MON)
- {
- edje_object_signal_emit(wd->base, "elm,state,month,focus,in", "elm");
- value= edje_object_part_text_get(wd->base,"elm.text.date.month");
- edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
- "elm.rect.date.month.over");
- count_start = 0;
- count_end = MONTH_MAXIMUM - 1;
+ ucal_set (wd->calendar, udat_toCalendarDateField (it3->type), it3->value);
}
- else if (wd->date_focusedpart == ENTRY_DAY)
+ _contextual_field_limit_get(data, it, it->sub_type, &min, &max );
+
+ cfield = udat_toCalendarDateField (it->type);
+ selected_val = it->value;
+ if (it->sub_type == UDAT_HOUR1_FIELD)
{
- edje_object_signal_emit(wd->base, "elm,state,day,focus,in", "elm");
- value = edje_object_part_text_get(wd->base,"elm.text.date.day");
- edj_part =(Evas_Object *) edje_object_part_object_get(wd->base,
- "elm.rect.date.day.over");
- count_start = 1;
- count_end = _maximum_day_get(wd->year, wd->month);
+ it2 = wd->item_list + ELM_DATEFIELD_AMPM;
+ if (it2->value) selected_val -= 12; // if 12hr format & PM, reduce 12
}
- else if (wd->date_focusedpart == ENTRY_HOUR)
+
+ for (idx = min; idx <= max; idx++)\r
{
- edje_object_signal_emit(wd->base, "elm,state,hour,focus,in", "elm");
- value = edje_object_part_text_get(wd->base,"elm.text.time.hour");
- edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
- "elm.rect.time.hour.over");
- if (wd->time_mode)
+ ucal_set (wd->calendar, cfield, idx);
+ udat_format(wd->date_fmt, ucal_getMillis (wd->calendar, &status),
+ result, BUFFER_SIZE, NULL, &status);
+ u_strToUTF8(item_label, BUFFER_SIZE, &text_len, result, -1, &status);
+ if (text_len > max_len ) max_len = text_len; //Store max. label length
+
+ if (idx == selected_val) //Selected Item, don't attach a callback to handle
{
- count_start = 1;
- count_end = HOUR_12H_MAXIMUM ;
+ item = elm_diskselector_item_append(diskselector, item_label,
+ NULL, NULL, NULL);
+ elm_diskselector_item_selected_set(item, EINA_TRUE);
}
else
{
- count_start = 0;
- count_end = HOUR_24H_MAXIMUM ;
+ disk_data = (DiskItem_Data *) malloc (sizeof(DiskItem_Data));
+ disk_data->datefield = data;
+ disk_data->sel_item_value = idx;
+ item = elm_diskselector_item_append(diskselector,
+ item_label, NULL, _diskselector_cb, disk_data);
+ elm_diskselector_item_del_cb_set(item, _diskselector_item_free_cb);
}
}
- else if (wd->date_focusedpart == ENTRY_MIN)
+ elm_diskselector_side_label_length_set(diskselector, max_len);
+}
+
+static void
+_datefield_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__, const char *source)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Object *diskselector;
+ const Evas_Object *edj_part;
+ char buf[BUFFER_SIZE];
+ int idx = 0, idx1 = 0, display_item_num;
+ Evas_Coord x = 0, y = 0, w = 0, h = 0;
+ Evas_Coord disksel_width;
+
+ if (!wd || !wd->base) return;
+ if (elm_widget_disabled_get(data)) return;
+
+ wd->selected_it = NULL;
+ //Locate the selected Index & Selected Datefield_Item
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
{
- edje_object_signal_emit(wd->base, "elm,state,min,focus,in", "elm");
- value = edje_object_part_text_get(wd->base,"elm.text.time.min");
- edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
- "elm.rect.time.min.over");
- count_start = 0;
- count_end = MIN_MAXIMUM;
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_OVER_STR, idx);
+ if (!strncmp(buf, source, sizeof(buf)))
+ {
+ for (idx1 = 0; idx1 < DATEFIELD_TYPE_COUNT; idx1++ )
+ {
+ if ((wd->item_list + idx1)->location == (int)idx)
+ {
+ wd->selected_it = wd->item_list + idx1;
+ break;
+ }
+ }
+ break;
+ }
}
- if (wd->ctxpopup_show) return;
- for (idx=count_start; idx<= count_end; idx++)
+
+ if ( !wd->selected_it || !wd->selected_it->fmt_exist
+ || !wd->selected_it->enabled ) return;
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_FOCUSIN_SIG_STR,
+ wd->selected_it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
+
+ if ( wd->selected_it->type == UDAT_AM_PM_FIELD )
{
- char str[5];
- if (wd->date_focusedpart == ENTRY_MON)
- snprintf(str, sizeof(str), month_list[idx]);
- else
- snprintf(str, sizeof(str), "%02d", idx);
- item_list[idx] = eina_stringshare_add(str);
- if ((value) && (strcmp(value, item_list[idx]) == 0))
- item = elm_diskselector_item_append(diskselector,item_list[idx],NULL,
- _diskselector_cb, data);
- else
- elm_diskselector_item_append(diskselector, item_list[idx], NULL,
- _diskselector_cb, data);
- eina_stringshare_del(item_list[idx]);
+ _ampm_clicked (data);
+ return;
}
- elm_diskselector_round_set(diskselector, EINA_TRUE);
- if(item != NULL) elm_diskselector_item_selected_set(item, EINA_TRUE);
- disk = elm_ctxpopup_content_unset(wd->ctxpopup);
- if (disk) evas_object_del(disk);
+ //Recreating diskselector everytime due to diskselector behavior
+ diskselector = elm_diskselector_add(elm_widget_top_get(data));
+ snprintf(buf, sizeof(buf), "datefield/%s", elm_object_style_get(data));
+ elm_object_style_set(diskselector, buf);
+
+ //Load the options list
+ _load_field_options(data, diskselector, wd->selected_it);
+
elm_ctxpopup_content_set(wd->ctxpopup, diskselector);
- evas_object_show(wd->ctxpopup);
- wd->ctxpopup_show = EINA_TRUE;
+ snprintf(buf,sizeof(buf), EDC_PART_ITEM_OVER_STR, wd->selected_it->location);
+ edj_part = edje_object_part_object_get(wd->base, buf);
evas_object_geometry_get(edj_part, &x, &y, &w, &h);
- evas_object_move(wd->ctxpopup, (x+w/2), (y+h) );
-}
-
-static int
-_maximum_day_get(int year, int month)
-{
- int day_of_month = 0;
- if (year == 0 || month == 0) return 0;
+ evas_object_move(wd->ctxpopup, (x+w/2), (y+h));
+ if (elm_ctxpopup_direction_get (wd->ctxpopup) == ELM_CTXPOPUP_DIRECTION_DOWN)
+ evas_object_move(wd->ctxpopup, (x+w/2), y);
+ evas_object_show(wd->ctxpopup);
- switch (month)
- {
- case 4:
- case 6:
- case 9:
- case 11:
- day_of_month = 30;
- break;
- case 2:
- {
- if ((!(year % 4) && (year % 100)) || !(year % 400))
- day_of_month = 29;
- else
- day_of_month = 28;
- }
- break;
- default:
- day_of_month = 31;
- break;
- }
+ evas_object_geometry_get(diskselector, NULL, NULL, &disksel_width, NULL);
+ display_item_num = disksel_width / (w + elm_finger_size_get()/2);
+ //odd number of items leads to auto selection.
+ //making as event number of item to prevent auto selection.
+ if (display_item_num%2) display_item_num-=1;
+ if (display_item_num < DISKSELECTOR_ITEMS_NUM_MIN)
+ display_item_num = DISKSELECTOR_ITEMS_NUM_MIN;
- return day_of_month;
+ elm_diskselector_display_item_num_set(diskselector, display_item_num);
+ elm_diskselector_round_set(diskselector, EINA_TRUE);
}
-static int
-_check_date_boundary(Evas_Object *obj, int num, int flag)
+static void
+_parse_separator( const UChar *fmt, UChar *separator, unsigned int len )
{
- Widget_Data *wd = elm_widget_data_get(obj);
- if (flag == ENTRY_YEAR)
- {
- if ((num > wd->y_max)&&(wd->y_max > wd->y_min)) num = wd->y_max;
- else if (num < wd->y_min) num = wd->y_min;
- return num;
- }
+ unsigned int i = 0;
+ while( (*fmt) && (i < len-2))
+ {
+ if ( !u_strchr(icu_fmt_chars, *fmt) && !u_isspace(*fmt))
+ separator[i++] = *fmt++;
+ else break;
+ }
+ separator[i] = 0;
+}
- else if (flag == ENTRY_MON)
+static unsigned int
+_parse_format( Evas_Object *obj )
+{
+ Widget_Data *wd;
+ unsigned int len, idx, location = 0;
+ Datefield_Item *it;
+ UChar *fmt_ptr;
+ UChar cur;
+ UChar usep[MAX_SEPARATOR_LEN];
+ char separator[2*MAX_SEPARATOR_LEN];
+ UErrorCode status = U_ZERO_ERROR;
+
+ wd = elm_widget_data_get(obj);
+ fmt_ptr = wd->format;
+ while( (cur = *fmt_ptr ) )
{
- if (wd->year == wd->y_max && num > wd->m_max) num = wd->m_max;
- else if (wd->year == wd->y_min && num < wd->m_min) num = wd->m_min;
- else if (num > MONTH_MAXIMUM) num = MONTH_MAXIMUM;
- else if (num <= 0) num = 1;
- return num;
- }
+ len = 0;
+ for ( idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+ {
+ if (mapping[idx].fmt_char[0] == cur ||
+ mapping[idx].fmt_char[1] == cur)
+ {
+ while( *(fmt_ptr+len) == cur ) len++;
+ fmt_ptr += len;
+ break;
+ }
+ }
+
+ if (!len)
+ {
+ fmt_ptr++;
+ continue;
+ }
- else if (flag == ENTRY_DAY)
- {
- int day_of_month = _maximum_day_get(wd->year, wd->month);
- if (wd->year == wd->y_max && wd->month == wd->m_max && num > wd->d_max)
- num = wd->d_max;
- else if (wd->year == wd->y_min && wd->month == wd->m_min
- && num < wd->d_min) num = wd->d_min;
- else if (num > day_of_month) num = day_of_month;
- else if (num <= 0) num = 1;
- return num;
- }
- return num;
-}
+ it = wd->item_list + idx;
+ // ignore the items already have or disabled
+ // valid formats, means already parsed, repeated format, ignore.
+ if (!it->enabled || it->location != -1) continue;
-static char*
-_get_i18n_string(Evas_Object *obj, nl_item item)
-{
- Widget_Data *wd = elm_widget_data_get(obj);
- const char *fmt;
- char *str = NULL;
- int i = 0, j = 0;
+ // In default format, Months larger than MMM are restricted.
+ if ((!wd->user_format) && (it->type == UDAT_MONTH_FIELD) && (len > 3))
+ len = 3;
- if (!wd) return NULL;
+ u_memset(it->format, cur, len);
+ it->format[len] = 0; //NULL terminating
- fmt = nl_langinfo(item);
- if (!fmt) return NULL;
+ //set the hour display format 12h/24h
+ if (it->type == UDAT_HOUR_OF_DAY0_FIELD)
+ {
+ if (cur == 'H') it->sub_type = UDAT_HOUR_OF_DAY0_FIELD;
+ else if (cur == 'h') it->sub_type = UDAT_HOUR1_FIELD;
+ }
- 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;
- 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;
- 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;
- }
- return NULL;
+ it->fmt_exist = EINA_TRUE;
+ it->location = location++;
+ if (!strncmp(mapping[idx].def_sep,"",MAX_SEPARATOR_LEN))
+ {
+ _parse_separator(fmt_ptr, usep, MAX_SEPARATOR_LEN );
+ u_strToUTF8(separator, BUFFER_SIZE, 0, usep, -1, &status);
+ if (it->separator) eina_stringshare_del(it->separator);
+ it->separator = eina_stringshare_add(separator);
+ }
+ }
+ //Return the number of valid items parsed.
+ return location;
}
static void
-_date_update(Evas_Object *obj)
+_format_reload(Evas_Object *obj)
{
- Widget_Data *wd = elm_widget_data_get(obj);
- Evas_Object *diskselector;
- char str[YEAR_MAX_LENGTH+1] = {0,};
- char *i18n_str;
-
- if (!wd || !wd->base) return;
-
- sprintf(str, "%d", wd->year);
- edje_object_part_text_set(wd->base, "elm.text.date.year", str);
-
- i18n_str = _get_i18n_string(obj, ABMON_1+wd->month-1);
- if (i18n_str)
+ Widget_Data *wd;
+ Datefield_Item *it;
+ char buf[BUFFER_SIZE];
+ UChar timezone[BUFFER_SIZE];
+ UErrorCode status = U_ZERO_ERROR;
+ const char *locale;
+ unsigned int idx, location;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ // fetch the format from ICU, if not user format
+ if (!wd->user_format )
{
- edje_object_part_text_set(wd->base, "elm.text.date.month", i18n_str);
- free(i18n_str);
+ if ( wd->date_fmt ) udat_close( wd->date_fmt );
+ locale = uloc_getDefault();
+ ucal_getDefaultTimeZone(timezone, BUFFER_SIZE, &status);
+ wd->date_fmt = udat_open(wd->time_style, wd->date_style, locale,
+ timezone, -1, NULL, -1, &status);
+ udat_toPattern(wd->date_fmt, 0, wd->format, BUFFER_SIZE, &status);
}
- sprintf(str, "%02d", wd->day);
- edje_object_part_text_set(wd->base, "elm.text.date.day", str);
+ //reset all the items to disable state
+ for ( idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+ {
+ it = wd->item_list + idx;
+ if (it->content) eina_stringshare_del(it->content);
+ it->content = NULL;
+ it->fmt_exist = EINA_FALSE;
+ it->location = -1;
+ }
+ location = _parse_format( obj );
- if (!wd->time_mode) //24 mode
- sprintf(str, "%02d", wd->hour);
- else
+ //assign locations to disabled fields for uniform usage
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
{
- if (wd->hour >= HOUR_12H_MAXIMUM)
+ it = wd->item_list + idx;
+ if (it->location == -1) it->location = location++;
+
+ if (it->fmt_exist && it->enabled)
{
- wd->pm = EINA_TRUE;
- i18n_str = _get_i18n_string(obj, PM_STR);
- if ((i18n_str)&&(wd->time_ampm))
- {
- elm_object_text_set(wd->time_ampm, i18n_str);
- free(i18n_str);
- }
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_ENABLE_SIG_STR,
+ it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
+ if (it->type == UDAT_AM_PM_FIELD)
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_AMPM_SIG_STR,
+ it->location);
+ else
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_DEFAULT_SIG_STR,
+ it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
}
else
{
- wd->pm = EINA_FALSE;
- i18n_str = _get_i18n_string(obj, AM_STR);
- if ((i18n_str)&&(wd->time_ampm))
- {
- elm_object_text_set(wd->time_ampm, i18n_str);
- free(i18n_str);
- }
+ snprintf(buf, sizeof(buf),EDC_PART_ITEM_DISABLE_SIG_STR,
+ it->location);
+ edje_object_signal_emit(wd->base, buf, "elm");
}
-
- if (wd->hour > HOUR_12H_MAXIMUM)
- sprintf(str, "%02d", wd->hour - HOUR_12H_MAXIMUM);
- else if (wd->hour == 0)
- sprintf(str, "%02d", HOUR_12H_MAXIMUM);
- else
- sprintf(str, "%02d", wd->hour);
}
- edje_object_part_text_set(wd->base, "elm.text.time.hour", str);
- sprintf(str, "%02d", wd->min);
- edje_object_part_text_set(wd->base, "elm.text.time.min", str);
+ edje_object_message_signal_process(wd->base);
- diskselector = elm_ctxpopup_content_unset(wd->ctxpopup);
- if (diskselector) evas_object_del(diskselector);
- evas_object_hide(wd->ctxpopup);
- if (wd->ctxpopup_show)
- wd->ctxpopup_show = EINA_FALSE;
+ wd->time_mode = ((wd->item_list + ELM_DATEFIELD_HOUR)->sub_type
+ == UDAT_HOUR1_FIELD);
+
+ _update_items(obj);
}
+static void
+_item_list_init(Evas_Object *obj)
+{
+ Widget_Data *wd;
+ Datefield_Item *it;
+ char buf[BUFFER_SIZE];
+ UChar timezone[BUFFER_SIZE];
+ UErrorCode status = U_ZERO_ERROR;
+ const char *locale=NULL;
+ unsigned int idx;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ ucal_getDefaultTimeZone(timezone, BUFFER_SIZE, &status);
+ locale = uloc_getDefault();
+ wd->calendar = ucal_open (timezone, -1, locale, UCAL_DEFAULT, &status);
+ wd->date_fmt = udat_open( wd->time_style, wd->date_style, locale, timezone,
+ -1, NULL, -1, &status);
+
+ wd->item_list = calloc(1, DATEFIELD_TYPE_COUNT * sizeof(Datefield_Item));
+ for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
+ {
+ it = wd->item_list + idx;
+ it->type = mapping[idx].icu_type;
+ it->sub_type = mapping[idx].icu_type;
+ it->fmt_exist = EINA_FALSE;
+ it->enabled = EINA_TRUE;
+ it->min = mapping[idx].def_min;
+ it->default_min = mapping[idx].def_min;
+ it->max = mapping[idx].def_max;
+ it->default_max = mapping[idx].def_max;
+ it->separator = strdup(mapping[idx].def_sep);
+
+ //get the default value from Calendar
+ it->value = ucal_get(wd->calendar, udat_toCalendarDateField(it->type),
+ &status );
+
+ snprintf(buf, sizeof(buf), EDC_PART_ITEM_OVER_STR, idx);
+ edje_object_signal_callback_add(wd->base, "mouse,clicked,1", buf,
+ _datefield_clicked_cb, obj);
+ }
+}
/**
- * Add a new datefield object
+ * @brief Add a new datefield Widget
* The date format and strings are based on current locale
*
- * @param parent The parent object
+ * @param[in] parent The parent object
* @return The new object or NULL if it cannot be created
*
* @ingroup Datefield
{
Evas_Object *obj;
Evas *e;
- char buf[4096];
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "datefield");
- elm_widget_type_set(obj, "datefield");
+ elm_widget_type_set(obj, widtype);
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_on_focus_hook_set( obj, _on_focus_hook, NULL );
+ elm_widget_disable_hook_set(obj, _disable_hook);
elm_widget_can_focus_set(obj, EINA_TRUE);
wd->base = edje_object_add(e);
elm_widget_resize_object_set(obj, wd->base);
- edje_object_signal_callback_add(wd->base, "mouse,down,1",
- "elm.rect.date.year.over", _signal_rect_mouse_down, obj);
- edje_object_signal_callback_add(wd->base, "mouse,down,1",
- "elm.rect.date.month.over", _signal_rect_mouse_down, obj);
- edje_object_signal_callback_add(wd->base, "mouse,down,1",
- "elm.rect.date.day.over", _signal_rect_mouse_down, obj);
-
- edje_object_signal_callback_add(wd->base, "mouse,down,1",
- "elm.rect.time.hour.over", _signal_rect_mouse_down, obj);
- edje_object_signal_callback_add(wd->base, "mouse,down,1",
- "elm.rect.time.min.over", _signal_rect_mouse_down, obj);
+ _elm_theme_object_set(obj, wd->base, "datefield", "base", "default");
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
+ wd->time_style = UDAT_LONG;
+ wd->date_style = UDAT_LONG;
+ _item_list_init(obj);
+ _format_reload(obj);
+
+ wd->datefield_layout = ELM_DATEFIELD_LAYOUT_DATEANDTIME;
+ wd->time_mode = EINA_TRUE;
+ wd->old_style_format = "mmddyy";
wd->ctxpopup = elm_ctxpopup_add(elm_widget_top_get(obj));
- snprintf(buf,sizeof(buf),"extended/timepicker/%s",elm_widget_style_get(obj));
- elm_object_style_set(wd->ctxpopup, buf);
+ elm_object_style_set(wd->ctxpopup, "datefield/default");
elm_ctxpopup_horizontal_set(wd->ctxpopup, EINA_TRUE);
elm_ctxpopup_direction_priority_set(wd->ctxpopup,ELM_CTXPOPUP_DIRECTION_DOWN,
ELM_CTXPOPUP_DIRECTION_UP,ELM_CTXPOPUP_DIRECTION_LEFT,
evas_object_size_hint_weight_set(wd->ctxpopup, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(wd->ctxpopup, EVAS_HINT_FILL,EVAS_HINT_FILL);
- elm_object_focus_allow_set(wd->ctxpopup, EINA_FALSE);
evas_object_smart_callback_add(wd->ctxpopup, "dismissed",
_ctxpopup_dismissed_cb, obj);
evas_object_event_callback_add(wd->base, EVAS_CALLBACK_RESIZE,
_datefield_resize_cb, obj);
-
- wd->y_min = 1900;
- wd->m_min = 1;
- wd->d_min = 1;
- wd->y_max = -1;
- wd->m_max = 12;
- wd->d_max = 31;
- wd->year = wd->y_min;
- wd->month = 1;
- wd->day = 1;
- wd->ctxpopup_show = EINA_FALSE;
-
- wd->layout = ELM_DATEFIELD_LAYOUT_DATEANDTIME;
- wd->time_mode = EINA_TRUE;
-
- _theme_hook(obj);
+ evas_object_event_callback_add(wd->base, EVAS_CALLBACK_MOVE,
+ _datefield_move_cb, obj);
+ _mirrored_set(obj, elm_widget_mirrored_get(obj));
return obj;
}
/**
- * set layout for the datefield
+ * Set the format of datefield
+ * Maximum allowed format length is 32 chars.
+ * Default value is taken according to the system locale format.
+ * The Caller has to free the memory of input format string.
*
- * @param obj The datefield object
- * @param layout set layout for date/time/dateandtime
- * (default: ELM_DATEFIELD_LAYOUT_DATEANDTIME)
+ * @param[in] obj The datefield object
+ * @param[in] fmt The date format, ex) MMMddy hh:mm.
*
- * @ingroup Datefield
*/
-EAPI void
-elm_datefield_layout_set(Evas_Object *obj, Elm_Datefield_Layout layout)
+void
+elm_datefield_format_set(Evas_Object *obj, const char *fmt)
{
ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
+ Widget_Data *wd;
+ UErrorCode status = U_ZERO_ERROR;
+ wd = elm_widget_data_get(obj);
if (!wd) return;
- if (layout > ELM_DATEFIELD_LAYOUT_DATEANDTIME) return;
- if (wd->layout != layout)
+ if (fmt)
{
- if (wd->time_ampm)
- {
- edje_object_part_unswallow(wd->base,wd->time_ampm);
- evas_object_del(wd->time_ampm);
- wd->time_ampm = NULL;
- }
- wd->layout = layout;
- _theme_hook(obj);
+ u_strFromUTF8(wd->format, MAX_FORMAT_LEN, 0, fmt, strlen(fmt), &status);
+ wd->user_format = EINA_TRUE;
}
- return;
+ else wd->user_format = EINA_FALSE;
+
+ _format_reload(obj);
}
/**
- * get layout of the datefield
+ * Get the format of datefield
*
- * @param obj The datefield object
- * @return layout of the datefield
+ * @param[in] obj The datefield object
+ * @return date format string. ex) MMMddyhhmm
+ * The Caller has to free the memory of return string.
*
- * @ingroup Datefield
*/
-EAPI Elm_Datefield_Layout
-elm_datefield_layout_get(const Evas_Object *obj)
+char *
+elm_datefield_format_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) 0;
- Widget_Data *wd = elm_widget_data_get(obj);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd;
+ int length;
+ char *format;
+ UErrorCode status = U_ZERO_ERROR;
- if (!wd) return 0;
+ wd = elm_widget_data_get(obj);
+ if (!wd ) return NULL;
- return wd->layout;
+ //get the length : pre flighting.
+ u_strToUTF8(NULL, 0, &length, wd->format, u_strlen(wd->format), &status);
+ format = malloc (length);
+ u_strToUTF8(format, length, 0, wd->format, u_strlen(wd->format), &status);
+
+ return format;
}
/**
- * Set selected date of the datefield
+ * @brief Set the selected value of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month value range is from 0 to 11
+ * Date value range is from 1 to 31 according to the month value.
+ * The hour value should be set according to 24hr format (0~23)
+ * Minute value range is from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
*
- * @param obj The datefield object
- * @param year The year to set
- * @param month The month to set
- * @param day The day to set
- * @param hour The hours to set (24hour mode - 0~23)
- * @param min The minutes to set (0~59)
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] value The data to be set. ex. year/month/date/hour/minute/ampm
*
* @ingroup Datefield
*/
EAPI void
-elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour,
- int min)
+elm_datefield_item_value_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+ int value)
{
ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
+ Widget_Data *wd;
+ Datefield_Item *it;
- if (!wd) return;
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
- wd->year = _check_date_boundary(obj, year, ENTRY_YEAR);
- wd->month = _check_date_boundary(obj, month, ENTRY_MON);
- wd->day = _check_date_boundary(obj, day, ENTRY_DAY);
+ it = wd->item_list + itemtype;
+ _field_value_set(obj, it->type, value, EINA_FALSE);
+}
- if (hour > HOUR_24H_MAXIMUM) wd->hour = HOUR_24H_MAXIMUM;
- else if (hour < 0) wd->hour = 0;
- else wd->hour = hour;
+/**
+ * @brief Get Current value date of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month value range is from 0 to 11
+ * Date value range is from 1 to 31 according to the month value.
+ * The hour value should be set according to 24hr format (0~23)
+ * Minute value range is from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return int The value of the field.
+ *
+ * @ingroup Datefield
+ */
+EAPI int
+elm_datefield_item_value_get(const Evas_Object *obj, Elm_Datefield_ItemType
+ itemtype)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) -1;
+ Widget_Data *wd;
- if (min > MIN_MAXIMUM) wd->min = MIN_MAXIMUM;
- else if (min < 0) wd->min = 0;
- else wd->min = min;
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return -1;
- _date_update(obj);
+ return ((wd->item_list + itemtype)->value);
}
+
/**
- * Get selected date of the datefield
+ * @brief Enable/Disable an item of the datefield
*
- * @param obj The datefield object
- * @param year The pointer to the variable get the selected year
- * @param month The pointer to the variable get the selected month
- * @param day The pointer to the variable get the selected day
- * @param hour The pointer to the variable get the selected hour (24hour mode)
- * @param hour The pointer to the variable get the selected min
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] enable Item is Enabled or disabled.
*
* @ingroup Datefield
*/
+
EAPI void
-elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day,
- int *hour, int *min)
+elm_datefield_item_enable_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+ Eina_Bool enable)
{
ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
+ Widget_Data *wd;
+ Datefield_Item *it;
- if (!wd) return;
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
- if (year)
- *year = wd->year;
- if (month)
- *month = wd->month;
- if (day)
- *day = wd->day;
- if (hour)
- *hour = wd->hour;
- if (min)
- *min = wd->min;
+ it = wd->item_list + itemtype;
+ if ( it->enabled == enable ) return;
+ it->enabled = enable;
+ _format_reload(obj);
}
/**
- * Set upper boundary of the datefield
+ * @brief Get whether the item is Enabled/Disabled
*
- * @param obj The datefield object
- * @param year The year to set
- * @param month The month to set
- * @param day The day to set
- * @return TRUE/FALSE
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return EINA_TRUE = Item is Enabled or EINA_FALSE = disabled.
*
* @ingroup Datefield
*/
+
EAPI Eina_Bool
-elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day)
+elm_datefield_item_enable_get(Evas_Object *obj, Elm_Datefield_ItemType itemtype)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
- Widget_Data *wd = elm_widget_data_get(obj);
- int day_of_month;
- Eina_Bool update = EINA_FALSE;
+ Widget_Data *wd;
+ Datefield_Item *it;
- if (!wd) return EINA_FALSE;
- if (month < 1 || month > MONTH_MAXIMUM) return EINA_FALSE;
- day_of_month = _maximum_day_get(year, month);
- if (day < 1 || day > day_of_month) return EINA_FALSE;
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return EINA_FALSE;
- wd->y_max = year;
- wd->m_max = month;
- wd->d_max = day;
+ it = wd->item_list + itemtype;
+ return it->enabled;
+}
- if (wd->year > wd->y_max)
- {
- wd->year = wd->y_max;
- update = EINA_TRUE;
- }
- if (wd->year == wd->y_max && wd->month > wd->m_max)
- {
- wd->month = wd->m_max;
- update = EINA_TRUE;
- }
- if (wd->year == wd->y_max && wd->month == wd->m_max && wd->day > wd->d_max)
- {
- wd->day = wd->d_max;
- update = EINA_TRUE;
- }
+/**
+ * @brief Get lower boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month default value range is from 0 to 11
+ * Date default value range is from 1 to 31 according to the month value.
+ * Hour default value will be in terms of 24 hr format (0~23)
+ * Minute default value range will be from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] value The minimum value of the field that is to be set.
+ * @ingroup Datefield
+ */
+EAPI void
+elm_datefield_item_min_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+ int value, Eina_Bool abs_limit)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd;
+ Datefield_Item *it;
+ UDateFormatField icu_dftype;
+ UErrorCode status = U_ZERO_ERROR;
+ int icu_min;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
+
+ it = wd->item_list + itemtype;
+ icu_dftype = it->type;
+ icu_min = ucal_getLimit(wd->calendar, udat_toCalendarDateField(icu_dftype),
+ UCAL_MINIMUM, &status);
+ if ( value < icu_min ) value = icu_min;
+ it->min = value;
+ it->abs_min = abs_limit;
+ _field_value_set(obj, icu_dftype, it->value, EINA_FALSE); // Trigger the validation
+}
- if (update) _date_update(obj);
- return EINA_TRUE;
+/**
+ * @brief Get lower boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month default value range is from 0 to 11
+ * Date default value range is from 1 to 31 according to the month value.
+ * Hour default value will be in terms of 24 hr format (0~23)
+ * Minute default value range will be from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return int The minimum value of the field.
+ *
+ * @ingroup Datepicker
+ */
+EAPI int
+elm_datefield_item_min_get(const Evas_Object *obj, Elm_Datefield_ItemType
+ itemtype)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) -1;
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return -1;
+
+ return ((wd->item_list + itemtype)->min);
+}
+
+/**
+ * @brief Get whether the minimum value of the item is absolute or not
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return EINA_TRUE = Minimim is absolute or EINA_FALSE = Minimum is relative.
+ *
+ * @ingroup Datefield
+ */
+
+EAPI Eina_Bool
+elm_datefield_item_min_is_absolute(const Evas_Object *obj,
+ Elm_Datefield_ItemType itemtype)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return EINA_FALSE;
+
+ return ((wd->item_list + itemtype)->abs_min);
}
/**
- * Get upper boundary of the datefield
+ * @brief Set upper boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month:default value range is from 0 to 11
+ * Date : default value range is from 1 to 31 according to the month value.
+ * Hour : default value will be in terms of 24 hr format (0~23)
+ * Minute : default value range will be from 0 to 59.
+ * AM/PM: Value 0 for AM and 1 for PM.
+ * If the value is beyond the contextual range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
*
- * @param obj The datefield object
- * @param year The pointer to the variable get the maximum year
- * @param month The pointer to the variable get the maximum month
- * @param day The pointer to the variable get the maximum day
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] value The maximum field value that is to be set.
*
* @ingroup Datefield
*/
EAPI void
-elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month,
- int *day)
+elm_datefield_item_max_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+ int value, Eina_Bool abs_limit )
{
ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
+ Widget_Data *wd;
+ Datefield_Item *it;
+ UDateFormatField icu_dftype;
+ UErrorCode status = U_ZERO_ERROR;
+ int icu_max;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
+
+ it = wd->item_list + itemtype;
+ icu_dftype = it->type;
+ icu_max = ucal_getLimit(wd->calendar, udat_toCalendarDateField(icu_dftype),
+ UCAL_MAXIMUM, &status);
+ if ( value > icu_max ) value = icu_max;
+ it->max = value;
+ it->abs_max = abs_limit;
+ _field_value_set(obj, icu_dftype, it->value, EINA_FALSE); // Trigger the validation
+}
- if (!wd) return;
- if (year)
- *year = wd->y_max;
- if (month)
- *month = wd->m_max;
- if (day)
- *day = wd->d_max;
+/**
+ * @brief Get upper boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month default value range is from 0 to 11
+ * Date default value range is from 1 to 31 according to the month value.
+ * Hour default value will be in terms of 24 hr format (0~23)
+ * Minute default value range will be from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return int The maximum value of the field.
+ *
+ * @ingroup Datefield
+ */
+EAPI int
+elm_datefield_item_max_get(const Evas_Object *obj, Elm_Datefield_ItemType
+ itemtype)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) -1;
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return -1;
+
+ return ((wd->item_list + itemtype)->max);
}
/**
- * Set lower boundary of the datefield
+ * @brief Get whether the max value of the item is absolute or not
*
- * @param obj The datefield object
- * @param year The year to set
- * @param month The month to set
- * @param day The day to set
- * @return TRUE/FALSE
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return EINA_TRUE = Max is absolute or EINA_FALSE = Max is relative.
*
- * @ingroup Datepicker
+ * @ingroup Datefield
*/
+
EAPI Eina_Bool
-elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day)
+elm_datefield_item_max_is_absolute(const Evas_Object *obj,
+ Elm_Datefield_ItemType itemtype)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+ Widget_Data *wd;
+
+ wd = elm_widget_data_get(obj);
+ if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return EINA_FALSE;
+
+ return ((wd->item_list + itemtype)->abs_max);
+}
+
+
+#define DATE_FORMAT_TYPE_COUNT 6
+
+typedef struct _format_mapper
+{
+ char old_fmt[BUFFER_SIZE];
+ char new_fmt[BUFFER_SIZE];
+}format_mapper;
+
+format_mapper map_format[DATE_FORMAT_TYPE_COUNT] = {
+ { "ddmmyy", "ddMMy"},
+ { "ddyymm", "ddyMM"},
+ { "mmddyy", "MMddy"},
+ { "mmyydd", "MMydd"},
+ { "yymmdd", "yMMdd"},
+ { "yyddmm", "yddMM"}
+};
+
+static char*
+_get_format(Evas_Object *obj, const char * format)
+{
Widget_Data *wd = elm_widget_data_get(obj);
- int day_of_month;
- Eina_Bool update = EINA_FALSE;
+ Eina_Strbuf *strbuf;
+ char * fmt;
+ int i= 0;
- if (!wd) return EINA_FALSE;
- if (month < 1 || month > MONTH_MAXIMUM) return EINA_FALSE;
- day_of_month = _maximum_day_get(year, month);
- if (day < 1 || day > day_of_month) return EINA_FALSE;
+ if (!wd) return NULL;
- wd->y_min = year;
- wd->m_min = month;
- wd->d_min = day;
+ strbuf = eina_strbuf_new();
- if (wd->year < wd->y_min)
- {
- wd->year = wd->y_min;
- update = EINA_TRUE;
- }
- if (wd->year == wd->y_min && wd->month < wd->m_min)
+ if (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATE ||
+ wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME)
{
- wd->month = wd->m_min;
- update = EINA_TRUE;
+ for (i =0; i< DATE_FORMAT_TYPE_COUNT; i++)
+ {
+ if (!strncmp(format, map_format[i].old_fmt, BUFFER_SIZE))
+ {
+ eina_strbuf_append(strbuf, map_format[i].new_fmt);
+ break;
+ }
+ }
}
- if (wd->year == wd->y_min && wd->month == wd->m_min && wd->day < wd->d_min)
+
+ if (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_TIME ||
+ wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME)
{
- wd->day = wd->d_min;
- update = EINA_TRUE;
+ if (wd->time_mode)
+ eina_strbuf_append(strbuf, "hh:mma");
+ else
+ eina_strbuf_append(strbuf, "HH:mm");
}
- if (update) _date_update(obj);
- return EINA_TRUE;
+ eina_strbuf_append_char(strbuf, 0); // NULL terminated string
+ fmt = eina_strbuf_string_steal(strbuf);
+ eina_strbuf_free( strbuf );
+
+ return fmt;
}
/**
- * Get lower boundary of the datefield
+ * @brief Set layout for the datefield
*
- * @param obj The datefield object
- * @param year The pointer to the variable get the maximum year
- * @param month The pointer to the variable get the maximum month
- * @param day The pointer to the variable get the maximum day
+ * @param[in] obj The datefield object
+ * @param[in] layout set layout for date/time/dateandtime
+ * (default: ELM_DATEFIELD_LAYOUT_DATEANDTIME)
*
* @ingroup Datefield
*/
EAPI void
-elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month,
- int *day)
+elm_datefield_layout_set(Evas_Object *obj, Elm_Datefield_Layout layout)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Eina_Bool date_enabled;
+ Eina_Bool time_enabled;
+
+ if (!wd || layout > ELM_DATEFIELD_LAYOUT_DATEANDTIME) return;
+ if (layout == wd->datefield_layout) return;
+ wd->datefield_layout = layout;
+ date_enabled = ((wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATE)
+ || (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME));
+
+ time_enabled = ((wd->datefield_layout == ELM_DATEFIELD_LAYOUT_TIME)
+ || (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME));
+
+ elm_datefield_item_enable_set(obj, ELM_DATEFIELD_YEAR, date_enabled);
+ elm_datefield_item_enable_set(obj, ELM_DATEFIELD_MONTH, date_enabled);
+ elm_datefield_item_enable_set(obj, ELM_DATEFIELD_DATE, date_enabled);
+ elm_datefield_item_enable_set(obj, ELM_DATEFIELD_HOUR, time_enabled);
+ elm_datefield_item_enable_set(obj, ELM_DATEFIELD_MINUTE, time_enabled);
+ elm_datefield_item_enable_set(obj, ELM_DATEFIELD_AMPM, (time_enabled && wd->time_mode));
+}
+
+/**
+ * @brief Get layout of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @return layout of the datefield
+ *
+ * @ingroup Datefield
+ */
+EAPI Elm_Datefield_Layout
+elm_datefield_layout_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype)-1;
+ Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (!wd) return -1;
+
+ return (wd->datefield_layout);
+}
+
+/**
+ * @brief Set date format of datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] fmt The date format, ex) mmddyy.
+ * Default value is taken according to the system locale settings.
+ *
+ * @ingroup Datefield
+ */
+EAPI void
+elm_datefield_date_format_set(Evas_Object *obj, const char *fmt)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (year)
- *year = wd->y_min;
- if (month)
- *month = wd->m_min;
- if (day)
- *day = wd->d_min;
+ wd->old_style_format = strdup(fmt);
+ elm_datefield_format_set(obj, _get_format(obj, fmt));
+}
+
+/**
+ * @brief Get the user set format of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @return date format string. ex) mmddyy
+ *
+ * @ingroup Datefield
+ */
+EAPI const char *
+elm_datefield_date_format_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->old_style_format);
}
/**
- * Set if the datefield show hours in military or am/pm mode
+ * @brief Set if the datefield show hours in military or am/pm mode
*
- * @param obj The datefield object
- * @param mode option for the hours mode. If true, it is shown as 12h mode,
+ * @param[in] obj The datefield object
+ * @param[in] mode option for the hours mode. If true, it is shown as 12h mode,
* if false, it is shown as 24h mode. Default value is true
*
* @ingroup Datefield
if (!wd) return;
- 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");
- edje_object_message_signal_process(wd->base);
- _date_update(obj);
- }
+ wd->time_mode = mode;
+ elm_datefield_format_set(obj, _get_format(obj, wd->old_style_format));
}
/**
- * get time mode of the datefield
+ * @brief get time mode of the datefield
*
- * @param obj The datefield object
+ * @param[in] obj The datefield object
* @return time mode (EINA_TRUE: 12hour mode / EINA_FALSE: 24hour mode)
*
* @ingroup Datefield
if (!wd) return EINA_FALSE;
- return wd->time_mode;
+ return (wd->time_mode);
}
+
+/////////////////////////////////////////////////////////////////////////////////
+////////////////////////// Date Field DEPRECATED APIs ///////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
/**
- * Set date format of datefield
+ * @brief Set selected date of the datefield
*
- * @param obj The datefield object
- * @param fmt The date format, ex) yymmdd. Default value is mmddyy.
+ * @param[in] obj The datefield object
+ * @param[in] year The year to set
+ * @param[in] month The month to set (1-12)
+ * @param[in] day The day to set
+ * @param[in] hour The hours to set (24hour mode - 0~23)
+ * @param[in] min The minutes to set (0~59)
*
* @ingroup Datefield
+ * @deprecated, use elm_datefield_item_value_set() instead.
*/
-EAPI void
-elm_datefield_date_format_set(Evas_Object *obj, const char *fmt)
+EINA_DEPRECATED EAPI void
+elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour,
+ int min)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- char sig[32] = "elm,state,format,";
- int i = 0, j;
-
- if (!wd || !fmt) return;
+ elm_datefield_item_value_set(obj, ELM_DATEFIELD_YEAR, year);
+ month -= 1; // backward compatibility
+ elm_datefield_item_value_set(obj, ELM_DATEFIELD_MONTH, month);
+ elm_datefield_item_value_set(obj, ELM_DATEFIELD_DATE, day);
+ elm_datefield_item_value_set(obj, ELM_DATEFIELD_HOUR, hour);
+ elm_datefield_item_value_set(obj, ELM_DATEFIELD_MINUTE, min);
+}
- j = strlen(sig);
- while (j < 31 )
+/**
+ * @brief Get selected date of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The pointer to the variable get the selected year
+ * @param[in] month The pointer to the variable get the selected month (1-12)
+ * @param[in] day The pointer to the variable get the selected day
+ * @param[in] hour The pointer to the variable get the selected hour(24hour mode)
+ * @param[in] hour The pointer to the variable get the selected min
+ *
+ * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_value_get() instead.
+ */
+EINA_DEPRECATED EAPI void
+elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day,
+ int *hour, int *min)
+{
+ if (year)
+ *year = elm_datefield_item_value_get(obj, ELM_DATEFIELD_YEAR);
+ if (month)
{
- sig[j++] = tolower(fmt[i++]);
+ *month = elm_datefield_item_value_get(obj, ELM_DATEFIELD_MONTH);
+ (*month)+=1; // backward compatibility
}
- if (j < 32) sig[j] = '\0';
- edje_object_signal_emit(wd->base, sig, "elm");
- edje_object_message_signal_process(wd->base);
+ if (day)
+ *day = elm_datefield_item_value_get(obj, ELM_DATEFIELD_DATE);
+ if (hour)
+ *hour = elm_datefield_item_value_get(obj, ELM_DATEFIELD_HOUR);
+ if (min)
+ *min = elm_datefield_item_value_get(obj, ELM_DATEFIELD_MINUTE);
+}
- if (strstr(sig, "yymmdd")) wd->date_format = DATE_FORMAT_YYMMDD;
- else if (strstr(sig, "yyddmm")) wd->date_format = DATE_FORMAT_YYDDMM;
- else if (strstr(sig, "mmyydd")) wd->date_format = DATE_FORMAT_MMYYDD;
- else if (strstr(sig, "mmddyy")) wd->date_format = DATE_FORMAT_MMDDYY;
- else if (strstr(sig, "ddyymm")) wd->date_format = DATE_FORMAT_DDYYMM;
- else if (strstr(sig, "ddmmyy")) wd->date_format = DATE_FORMAT_DDMMYY;
- wd->format_exists = EINA_TRUE;
+/**
+ * @brief Set lower boundary of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The year to set
+ * @param[in] month The month to set (1-12)
+ * @param[in] day The day to set
+ * @return TRUE/FALSE
+ *
+ * @ingroup Datepicker
+ * @deprecated, use elm_datefield_item_min_set() instead.
+ */
+EINA_DEPRECATED EAPI Eina_Bool
+elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day)
+{
+ elm_datefield_item_min_set(obj, ELM_DATEFIELD_YEAR, year, EINA_FALSE);
+ month -= 1; // backward compatibility
+ elm_datefield_item_min_set(obj, ELM_DATEFIELD_MONTH, month, EINA_FALSE);
+ elm_datefield_item_min_set(obj, ELM_DATEFIELD_DATE, day, EINA_FALSE);
+ return EINA_TRUE;
}
/**
- * get date format of the datefield
+ * @brief Get lower boundary of the datefield
*
- * @param obj The datefield object
- * @return date format string. ex) yymmdd
+ * @param[in] obj The datefield object
+ * @param[in] year The pointer to the variable get the maximum year
+ * @param[in] month The pointer to the variable get the maximum month (1-12)
+ * @param[in] day The pointer to the variable get the maximum day
*
* @ingroup Datefield
+ * @deprecated, use elm_datefield_item_min_get() instead.
*/
-EAPI const char *
-elm_datefield_date_format_get(const Evas_Object *obj)
+EINA_DEPRECATED EAPI void
+elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month,
+ int *day)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
+ if (year)
+ *year = elm_datefield_item_min_get(obj, ELM_DATEFIELD_YEAR);
+ if (month)
+ {
+ *month = elm_datefield_item_min_get(obj, ELM_DATEFIELD_MONTH);
+ (*month)+=1; // backward compatibility
+ }
+ if (day)
+ *day = elm_datefield_item_min_get(obj, ELM_DATEFIELD_DATE);
+}
- switch (wd->date_format)
+/**
+ * @brief Set upper boundary of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The year to set
+ * @param[in] month The month to set (1-12)
+ * @param[in] day The day to set
+ * @return TRUE/FALSE
+ *
+ * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_max_set() instead.
+ */
+EINA_DEPRECATED EAPI Eina_Bool
+elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day)
+{
+ elm_datefield_item_max_set(obj, ELM_DATEFIELD_YEAR, year, EINA_FALSE);
+ month -= 1; // backward compatibility
+ elm_datefield_item_max_set(obj, ELM_DATEFIELD_MONTH, month, EINA_FALSE);
+ elm_datefield_item_max_set(obj, ELM_DATEFIELD_DATE, day, EINA_FALSE);
+ return EINA_TRUE;
+}
+
+/**
+ * @brief Get upper boundary of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The pointer to the variable get the maximum year
+ * @param[in] month The pointer to the variable get the maximum month (1-12)
+ * @param[in] day The pointer to the variable get the maximum day
+ *
+ * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_max_get() instead.
+ */
+EINA_DEPRECATED EAPI void
+elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month,
+ int *day)
+{
+ if (year)
+ *year = elm_datefield_item_max_get(obj, ELM_DATEFIELD_YEAR);
+ if (month)
{
- case DATE_FORMAT_YYMMDD: return "yymmdd";
- case DATE_FORMAT_YYDDMM: return "yyddmm";
- case DATE_FORMAT_MMYYDD: return "mmyydd";
- case DATE_FORMAT_MMDDYY: return "mmddyy";
- case DATE_FORMAT_DDYYMM: return "ddyymm";
- case DATE_FORMAT_DDMMYY: return "ddmmyy";
- default: return NULL;
+ *month = elm_datefield_item_max_get(obj, ELM_DATEFIELD_MONTH);
+ (*month)+=1; // backward compatibility
}
+ if (day)
+ *day = elm_datefield_item_max_get(obj, ELM_DATEFIELD_DATE);
}
/**
- * Add a callback function for input panel state
+ * @brief Add a callback function for input panel state
*
- * @param obj The datefield object
- * @param func The function to be called when the event is triggered
+ * @param[in] obj The datefield object
+ * @param[in] func The function to be called when the event is triggered
* (value will be the Ecore_IMF_Input_Panel_State)
- * @param data The data pointer to be passed to @p func
+ * @param[in] data The data pointer to be passed to @p func
*
* @ingroup Datefield
+ * @deprecated and will no longer be in use.
*/
-EAPI void
+EINA_DEPRECATED EAPI void
elm_datefield_input_panel_state_callback_add(Evas_Object *obj,
void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value),
void *data)
{
- // This API will be no more in use after the redesigning of datefield widget
- //with ctxpopup & diskselector instead of using entry objects edited by Vkpd.
- // API will be deprecated soon.
- printf( "#####\nWARNING: API elm_datefield_input_panel_state_callback_add "
- "will be deprecated soon \n#####\n");
+ //Empty implementation
}
/**
- * Delete a callback function for input panel state
+ * @brief Delete a callback function for input panel state
*
- * @param obj The datefield object
- * @param func The function to be called when the event is triggered
+ * @param[in] obj The datefield object
+ * @param[in] func The function to be called when the event is triggered
*
* @ingroup Datefield
+ * @deprecated and will no longer be in use.
*/
-EAPI void
+EINA_DEPRECATED EAPI void
elm_datefield_input_panel_state_callback_del(Evas_Object *obj,
void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value))
{
- // This API will be no more in use after the redesigning of datefield widget
- //with ctxpopup & diskselector instead of using entry objects edited by Vkpd.
- // API will be deprecated soon.
- printf( "#####\nWARNING: API elm_datefield_input_panel_state_callback_del"
- "will be deprecated soon \n#####\n");
+ //Empty implementation
}
+/////////////////////////////////////////////////////////////////////////////////
+//////////////////////////Date Field DEPRECATED APIs END////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
--- /dev/null
+#include <Elementary.h>
+#include "elm_priv.h"
+
+// FIXME: handle if canvas resizes
+
+typedef struct _Widget_Data Widget_Data;
+
+struct _Widget_Data
+{
+ Evas_Object *obj;
+ Evas_Object *content;
+ int last_calc_count;
+ Evas_Coord maxminw, maxminh;
+ Eina_Bool eval : 1;
+ Eina_Bool szeval : 1;
+ Eina_Bool maxmin : 1;
+};
+
+static const char *widtype = NULL;
+static void _del_hook(Evas_Object *obj);
+static Eina_Bool _focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next);
+static void _sizing_eval(Evas_Object *obj);
+static void _eval(Evas_Object *obj);
+static void _changed(Evas_Object *obj);
+static void _move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
+static void _resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
+static void _child_change(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
+static void _child_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__);
+
+static const char SIG_REALIZE[] = "realize";
+static const char SIG_UNREALIZE[] = "unrealize";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_REALIZE, ""},
+ {SIG_UNREALIZE, ""},
+ {NULL, NULL}
+};
+
+static int fac = 0;
+
+static void
+_del_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (wd->content)
+ {
+ Evas_Object *o = wd->content;
+
+ evas_object_event_callback_del_full(o,
+ EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _child_change, obj);
+ evas_object_event_callback_del_full(o,
+ EVAS_CALLBACK_DEL,
+ _child_del, obj);
+ wd->content = NULL;
+ evas_object_del(o);
+ fac--;
+// printf("FAC-- = %i\n", fac);
+ }
+ free(wd);
+}
+
+static Eina_Bool
+_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;
+ return elm_widget_focus_next_get(cur, dir, next);
+}
+
+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->content) return;
+ evas_object_size_hint_min_get(wd->content, &minw, &minh);
+ evas_object_size_hint_max_get(wd->content, &maxw, &maxh);
+ if (wd->maxmin)
+ {
+ if (minw > wd->maxminw) wd->maxminw = minw;
+ if (minh > wd->maxminh) wd->maxminh = minh;
+ evas_object_size_hint_min_set(obj, wd->maxminw, wd->maxminh);
+ }
+ else
+ {
+ evas_object_size_hint_min_set(obj, minw, minh);
+ }
+ evas_object_size_hint_max_set(obj, maxw, maxh);
+// printf("FAC SZ: %i %i | %i %i\n", minw, minh, maxw, maxh);
+}
+
+static void
+_eval(Evas_Object *obj)
+{
+ Evas_Coord x, y, w, h, cvx, cvy, cvw, cvh;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ evas_event_freeze(evas_object_evas_get(obj));
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
+ if (w < 1) w = 1;
+ if (h < 1) h = 1;
+ evas_output_viewport_get(evas_object_evas_get(obj),
+ &cvx, &cvy, &cvw, &cvh);
+ if ((cvw < 1) || (cvh < 1)) return;
+ // need some fuzz value thats beyond the current viewport
+ // for now just make it the viewport * 3 in size (so 1 vp in each direction)
+ /*
+ cvx -= cvw;
+ cvy -= cvh;
+ cvw *= 3;
+ cvh *= 3;
+ */
+ if (ELM_RECTS_INTERSECT(x, y, w, h, cvx, cvy, cvw, cvh))
+ {
+ if (!wd->content)
+ {
+// printf(" + %i %i %ix%i <> %i %i %ix%i\n", x, y, w, h, cvx, cvy, cvw, cvh);
+ evas_object_smart_callback_call(obj, SIG_REALIZE, NULL);
+ if (wd->content)
+ {
+ if (evas_object_smart_data_get(wd->content))
+ evas_object_smart_calculate(wd->content);
+ }
+ //wd->last_calc_count =
+ //evas_smart_objects_calculate_count_get(evas_object_evas_get(obj));
+ }
+ }
+ else
+ {
+ if (wd->content)
+ {
+ //if (wd->last_calc_count !=
+ //evas_smart_objects_calculate_count_get(evas_object_evas_get(obj)))
+ evas_object_smart_callback_call(obj, SIG_UNREALIZE, NULL);
+ }
+ }
+ evas_event_thaw(evas_object_evas_get(obj));
+ evas_event_thaw_eval(evas_object_evas_get(obj));
+}
+
+static void
+_changed(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (wd->eval)
+ {
+ _eval(obj);
+ wd->eval = EINA_FALSE;
+ }
+ if (wd->szeval)
+ {
+ _sizing_eval(obj);
+ wd->szeval = EINA_FALSE;
+ }
+}
+
+static void
+_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->eval = EINA_TRUE;
+ evas_object_smart_changed(obj);
+}
+
+static void
+_resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->eval = EINA_TRUE;
+ evas_object_smart_changed(obj);
+}
+
+static void
+_child_change(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+ wd->eval = EINA_TRUE;
+ wd->szeval = EINA_TRUE;
+ evas_object_smart_changed(data);
+}
+
+static void
+_child_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+{
+ Evas_Object *fobj = data;
+ Widget_Data *wd = elm_widget_data_get(fobj);
+ if (!wd) return;
+ if (wd->content != obj) return;
+ evas_object_event_callback_del_full(wd->content,
+ EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _child_change, obj);
+ evas_object_event_callback_del_full(wd->content,
+ EVAS_CALLBACK_DEL,
+ _child_del, obj);
+ wd->content = NULL;
+ fac--;
+// printf("FAC-- = %i\n", fac);
+}
+
+EAPI Evas_Object *
+elm_factory_add(Evas_Object *parent)
+{
+ Evas_Object *obj;
+ Evas *e;
+ Widget_Data *wd;
+
+ ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
+
+ ELM_SET_WIDTYPE(widtype, "factory");
+ elm_widget_type_set(obj, "factory");
+ elm_widget_sub_object_add(parent, obj);
+ elm_widget_data_set(obj, wd);
+ elm_widget_del_hook_set(obj, _del_hook);
+ elm_widget_focus_next_hook_set(obj, _focus_next_hook);
+ elm_widget_can_focus_set(obj, EINA_FALSE);
+ elm_widget_changed_hook_set(obj, _changed);
+
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, NULL);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL);
+
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
+ wd->obj = obj;
+ wd->last_calc_count = -1;
+ return obj;
+}
+
+EAPI void
+elm_factory_content_set(Evas_Object *obj, Evas_Object *content)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (wd->content == content) return;
+ if (wd->content)
+ {
+ Evas_Object *o = wd->content;
+
+ evas_object_event_callback_del_full(wd->content,
+ EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _child_change, obj);
+ evas_object_event_callback_del_full(wd->content,
+ EVAS_CALLBACK_DEL,
+ _child_del, obj);
+ wd->content = NULL;
+ evas_object_del(o);
+ fac--;
+// printf("FAC-- = %i\n", fac);
+ }
+ wd->content = content;
+ if (wd->content)
+ {
+ fac++;
+// printf("FAC++ = %i\n", fac);
+ elm_widget_resize_object_set(obj, wd->content);
+ evas_object_event_callback_add(wd->content, EVAS_CALLBACK_DEL,
+ _child_del, obj);
+ evas_object_event_callback_add(wd->content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _child_change, obj);
+ wd->eval = EINA_TRUE;
+ wd->szeval = EINA_TRUE;
+ evas_object_smart_changed(obj);
+ }
+}
+
+EAPI Evas_Object *
+elm_factory_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;
+}
+
+EAPI void
+elm_factory_maxmin_mode_set(Evas_Object *obj, Eina_Bool enabled)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->maxmin = !!enabled;
+}
+
+EAPI Eina_Bool
+elm_factory_maxmin_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->maxmin;
+}
+
+EAPI void
+elm_factory_maxmin_reset_set(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ wd->maxminw = 0;
+ wd->maxminh = 0;
+ wd->eval = EINA_TRUE;
+ wd->szeval = EINA_TRUE;
+ evas_object_smart_changed(obj);
+}
const char *photo_file;
void (*func) (void *data, Evas_Object *obj, void *event_info);
void *data;
- Evas_Coord x, y, w, h;
- Evas_Coord ox, oy, ow, oh;
- int moving:1;
};
// Image Slider Widget Data.
int move_cnt;
int ani_lock:1;
int moving:1;
-
- Eina_Bool on_zoom:1;
- Eina_Bool on_hold:1;
- int dx, dy, mx, my;
- int mdx, mdy, mmx, mmy;
- int dratio;
- int ratio;
};
// Global value declaration.
static void _imageslider_update(Widget_Data * wd);
static void _imageslider_update_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord y, Evas_Coord w);
-static void _imageslider_update_center_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord my, Evas_Coord y, Evas_Coord w);
static void _imageslider_obj_shift(Widget_Data * wd, Eina_Bool left);
static int _check_drag(int state, void *data);
-static void _check_zoom(void *data);
-
static void _anim(Widget_Data * wd);
static Eina_Bool _timer_cb(void *data);
-//static void _signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _ev_imageslider_down_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
static void _ev_imageslider_up_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
static void _ev_imageslider_move_cb(void *data, Evas * e, Evas_Object *obj, void *event_info);
wd = elm_widget_data_get(obj);
- if (!wd)
- return;
-
- for (i = 0; i < BLOCK_MAX; i++)
- {
- elm_widget_sub_object_del(wd->obj, wd->ly[i]);
- evas_object_del(wd->ly[i]);
- }
+ if (!wd) return;
if (wd->its)
{
wd->anim_timer = NULL;
}
- if (wd)
- free(wd);
+ if (wd) free(wd);
}
for (i = 0; i < BLOCK_MAX; i++)
{
if (wd->ly[i])
- _elm_theme_object_set(obj, wd->ly[i], "imageslider", "base",
+ elm_layout_theme_set(wd->ly[i], "imageslider", "base",
elm_object_style_get(obj));
evas_object_show(wd->ly[i]);
}
return;
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
- fprintf(stderr, "%d %d -resize\n", w, h);
+ DBG("%d %d -resize\n", w, h);
wd->w = w;
wd->h = h;
static void
_imageslider_update_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord y, Evas_Coord w)
{
- int i = 0;
evas_object_move(wd->ly[BLOCK_LEFT], x - (w + INTERVAL_WIDTH), y);
evas_object_move(wd->ly[BLOCK_CENTER], x, y);
evas_object_move(wd->ly[BLOCK_RIGHT], x + (w + INTERVAL_WIDTH), y);
- //making sure that the clipping happens for all three layouts based on clipper's geometry
- for (i = 0; i < BLOCK_MAX; i++)
- evas_object_clip_set(wd->ly[i], wd->clip);
- evas_render_idle_flush(evas_object_evas_get(wd->obj));
-}
-
-// Update the center position of Image Slider item.
-static void
-_imageslider_update_center_pos(Widget_Data * wd, Evas_Coord x, Evas_Coord my __UNUSED__, Evas_Coord y, Evas_Coord w)
-{
- Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0;
- const Evas_Object *eo = elm_layout_content_get((const Evas_Object*)(wd->ly[BLOCK_CENTER]), "swl.photo");
- if (eo)
- evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
- if ((ix > 0) || (ix + iw < wd->w))
- {
- edje_object_signal_emit(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "block.on", "block");
- _imageslider_update_pos(wd, x, y, w);
- wd->on_zoom = EINA_FALSE;
- }
}
// Shift next/previous Image Slider item in layouts.
{
wd->step = -ANI_STEP;
wd->move_x += wd->w;
- _imageslider_obj_shift(wd, 0);
+ _imageslider_obj_shift(wd, EINA_FALSE);
}
- wd->moving = 1;
+ wd->moving = EINA_TRUE;
}
else if (step < 0)
{
{
wd->step = ANI_STEP;
wd->move_x -= wd->w;
- _imageslider_obj_shift(wd, 1);
+ _imageslider_obj_shift(wd, EINA_TRUE);
}
- wd->moving = 1;
+ wd->moving = EINA_TRUE;
}
else
{
wd->step = ANI_STEP;
else
wd->step = -ANI_STEP;
- wd->moving = 0;
+ wd->moving = EINA_FALSE;
}
_imageslider_update(wd);
wd->timestamp = ev->timestamp;
wd->move_cnt = MOVE_STEP;
- wd->dx = ev->canvas.x;
- wd->dy = ev->canvas.y;
- wd->mx = ev->canvas.x;
- wd->my = ev->canvas.y;
-
- wd->dratio = 1;
- wd->ratio = 1;
-
- eo = (Evas_Object*)elm_layout_content_get((const Evas_Object*)obj, "swl.photo");
- if (eo)
- evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
-
- if (iw != wd->w)
- {
- wd->on_zoom = EINA_TRUE;
- edje_object_signal_emit(elm_layout_edje_get(obj), "block.off", "block");
- }
-
}
// Whenever MOUSE UP event occurs, Call this function.
int interval;
- if (wd->ani_lock)
- return;
+ if (wd->ani_lock) return;
- if (wd->on_zoom)
+ step = wd->down_pos.x - ev->canvas.x;
+ interval = ev->timestamp - wd->timestamp;
+ if (step == 0 || interval == 0)
{
+ DBG("case1: emit CLICK event\n");
+ evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
+ return;
}
- else
+ if (interval < CLICK_TIME_MAX)
{
- step = wd->down_pos.x - ev->canvas.x;
- interval = ev->timestamp - wd->timestamp;
- if (step == 0 || interval == 0)
+ if (step < CLICK_WIDTH_MIN && step > CLICK_WIDTH_MIN)
{
- fprintf(stderr, "[[[ DEBUG ]]]: case1: emit CLICK event\n");
+ DBG("case2: emit CLICK event\n");
evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
return;
}
- if (interval < CLICK_TIME_MAX)
+ }
+
+ if (interval < FLICK_TIME_MAX)
+ {
+ if (step < FLICK_WIDTH_MIN && step > FLICK_WIDTH_MIN)
{
- if (step < CLICK_WIDTH_MIN && step > CLICK_WIDTH_MIN)
- {
- fprintf(stderr, "[[[ DEBUG ]]]: case2: emit CLICK event\n");
- evas_object_smart_callback_call(wd->obj, SIG_CLICKED, NULL);
- return;
- }
- }
+ DBG("ev_imageslider_up_cb-black zone (1)\n");
- if (interval < FLICK_TIME_MAX)
+ _imageslider_obj_move(wd, 0);
+ }
+ else
{
- if (step < FLICK_WIDTH_MIN && step > FLICK_WIDTH_MIN)
- {
- fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-black zone (1)\n");
+ DBG("ev_imageslider_up_cb-black zone (2)\n");
- _imageslider_obj_move(wd, 0);
- }
- else
- {
- fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-black zone (2)\n");
+ _imageslider_obj_move(wd, step);
+ }
- _imageslider_obj_move(wd, step);
- }
+ }
+ else
+ {
+ step = (wd->x - wd->move_x) << 1;
+ if (step <= wd->w && step >= -(wd->w))
+ {
+ DBG("ev_imageslider_up_cb-white zone (1)\n");
+ _imageslider_obj_move(wd, 0);
}
else
{
- step = (wd->x - wd->move_x) << 1;
- if (step <= wd->w && step >= -(wd->w))
- {
- fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-white zone (1)\n");
+ DBG("ev_imageslider_up_cb-white zone (2)\n");
- _imageslider_obj_move(wd, 0);
- }
- else
- {
- fprintf(stderr, "[[[ DEBUG ]]]:_ev_imageslider_up_cb-white zone (2)\n");
-
- _imageslider_obj_move(wd, step);
- }
+ _imageslider_obj_move(wd, step);
}
}
}
-// Whenever MOUSE MOVE event occurs, Call this API.
+// Whenever MOUSE MOVE event occurs, Call this
static void
_ev_imageslider_move_cb(void *data, Evas * e __UNUSED__, Evas_Object *obj, void *event_info)
{
if (wd->move_cnt == MOVE_STEP)
{
- if (wd->on_hold == EINA_FALSE)
- {
- wd->move_cnt = 0;
+ wd->move_cnt = 0;
- if (ev->buttons)
- {
- step = ev->cur.canvas.x - wd->down_pos.x;
- if (step > 0)
- idx = BLOCK_LEFT;
- else
- idx = BLOCK_RIGHT;
-
- wd->move_x = wd->x + ((ev->cur.canvas.x - wd->down_pos.x));
- wd->move_y = wd->y + ((ev->cur.canvas.y - wd->down_pos.y));
-
- if (wd->on_zoom)
- {
- _imageslider_update_center_pos(wd, wd->move_x, wd->move_y, wd->y, wd->w);
- }
- else
- {
- _imageslider_update_pos(wd, wd->move_x, wd->y, wd->w);
- }
- }
- }
- else
+ if (ev->buttons)
{
- wd->mx = ev->cur.canvas.x;
- wd->my = ev->cur.canvas.y;
-
- wd->ratio =
- sqrt((wd->mx - wd->mmx) * (wd->mx - wd->mmx) + (wd->my - wd->mmy) * (wd->my - wd->mmy));
+ step = ev->cur.canvas.x - wd->down_pos.x;
+ if (step > 0)
+ idx = BLOCK_LEFT;
+ else
+ idx = BLOCK_RIGHT;
- eo = (Evas_Object*)elm_layout_content_get((const Evas_Object*)obj, "swl.photo");
- if (eo)
- {
- it = eina_list_data_get(wd->cur);
- if (((it->w * wd->ratio / wd->dratio) / it->ow) < MAX_ZOOM_SIZE)
- {
- edje_object_part_unswallow(elm_layout_edje_get(obj), eo);
- evas_object_resize(eo, it->w * wd->ratio / wd->dratio, it->h * wd->ratio / wd->dratio);
- evas_object_size_hint_min_set(eo, it->w * wd->ratio / wd->dratio, it->h * wd->ratio / wd->dratio);
- elm_layout_content_set(obj, "swl.photo", eo);
- }
- }
+ wd->move_x = wd->x + ((ev->cur.canvas.x - wd->down_pos.x));
+ wd->move_y = wd->y + ((ev->cur.canvas.y - wd->down_pos.y));
+ _imageslider_update_pos(wd, wd->move_x, wd->y, wd->w);
}
}
wd->move_cnt++;
}
-#if 0
-// Whenever CLICK event occurs, Call this API
-// But, DONOT emit CLICK event.
-// DO NOT use this callback function. Remove later.
-static void
-_signal_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
- fprintf(stderr, "[[[ DEBUG ]]]: Call the callback function about Click event!, But DONOT emit CLICK event in the callback function!\n");
-}
-#endif
-
static inline double
time_get(Evas_Coord x, Evas_Coord w)
{
_imageslider_update(wd);
if (wd->queue_idler)
- {
- ecore_idler_del(wd->queue_idler);
- wd->queue_idler = NULL;
- }
+ wd->queue_idler = NULL;
return ECORE_CALLBACK_CANCEL;
}
return 0;
}
-static void
-_check_zoom(void *data)
-{
- Widget_Data *wd = data;
-
- Elm_Imageslider_Item *it;
-
- Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0;
-
- double dx = 0, dy = 0;
-
- Evas_Object *eo = NULL;
-
- it = eina_list_data_get(wd->cur);
-
- eo = (Evas_Object*)elm_layout_content_get(wd->ly[BLOCK_CENTER], "swl.photo");
- if (eo)
- evas_object_geometry_get(eo, &ix, &iy, &iw, &ih);
- edje_object_part_drag_value_get(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "swl.photo", &dx, &dy);
-
- if ((iw != wd->w) || ((dx != 0) || (dy != 0)))
- {
- wd->on_zoom = EINA_TRUE;
- edje_object_signal_emit(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "block.off", "block");
- }
- else
- {
- wd->on_zoom = EINA_FALSE;
- edje_object_signal_emit(elm_layout_edje_get(wd->ly[BLOCK_CENTER]), "block.on", "block");
- }
-}
-
static Eina_Bool
_timer_cb(void *data)
{
int ret;
wd = data;
- if (wd->ani_lock == 0)
- return 0;
+ if (wd->ani_lock == EINA_FALSE)
+ return EINA_FALSE;
gettimeofday(&tv, NULL);
if (wd->move_x == wd->x)
{
- wd->ani_lock = 0;
+ wd->ani_lock = EINA_FALSE;
if (wd->cur)
{
it = eina_list_data_get(wd->cur);
ret = _check_drag(BLOCK_LEFT, wd);
ret = _check_drag(BLOCK_RIGHT, wd);
- _check_zoom(wd);
if (!wd->queue_idler)
wd->queue_idler = ecore_idler_add(_icon_to_image, wd);
if (wd->anim_timer)
- {
- ecore_timer_del(wd->anim_timer);
- wd->anim_timer = NULL;
- }
+ wd->anim_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
return;
}
- wd->ani_lock = 1;
+ wd->ani_lock = EINA_TRUE;
w = wd->move_x;
gettimeofday(&wd->tv, NULL);
if (!eo)
{
eo = elm_image_add(wd->obj);
- elm_layout_content_set(wd->ly[i], "swl.photo", eo);
//elm_image_prescale_set(eo, wd->w);
elm_image_file_set(eo, it->photo_file, NULL);
- elm_image_object_size_get(eo, &it->w, &it->h);
- evas_object_geometry_get(eo, &it->ox, &it->oy, &it->ow, &it->oh);
- it->ow = it->w;
- it->oh = it->h;
elm_layout_content_set(wd->ly[i], "swl.photo", eo);
}
-
- if (wd->moving != it->moving)
- {
- it->moving = wd->moving;
- if (wd->moving)
- {
- //elm_image_prescale_set(eo, MOVING_IMAGE_SIZE);
- }
- else
- {
- //elm_image_prescale_set(eo, it->w > it->h ? it->w : it->h);
- }
- }
}
}
/**
* Add an Image Slider widget
*
-* @param parent The parent object
-* @return The new Image slider object or NULL if it cannot be created
+* @param parent The parent object
+* @return The new Image slider object or NULL if it cannot be created
*
* @ingroup Imageslider
*/
elm_widget_theme_hook_set(obj, _theme_hook);
wd->clip = evas_object_rectangle_add(e);
+ elm_widget_sub_object_add(obj, wd->clip);
elm_widget_resize_object_set(obj, wd->clip);
for (i = 0; i < BLOCK_MAX; i++)
elm_widget_sub_object_add(obj, wd->ly[i]);
evas_object_smart_member_add(wd->ly[i], obj);
- //edje_object_signal_callback_add(elm_layout_edje_get(wd->ly[i]), "elm,photo,clicked", "", _signal_clicked, obj);
evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_DOWN, _ev_imageslider_down_cb, wd);
evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_UP, _ev_imageslider_up_cb, wd);
evas_object_event_callback_add(wd->ly[i], EVAS_CALLBACK_MOUSE_MOVE, _ev_imageslider_move_cb, wd);
/**
* Append an Image Slider item
*
-* @param obj The Image Slider object
-* @param photo_file photo file path
-* @param func callback function
-* @param data callback data
-* @return The Image Slider item handle or NULL
+* @param obj The Image Slider object
+* @param photo_file photo file path
+* @param func callback function
+* @param data callback data
+* @return The Image Slider item handle or NULL
*
* @ingroup Imageslider
*/
/**
* Insert an Image Slider item into the Image Slider Widget by using the given index.
*
-* @param obj The Image Slider object
-* @param photo_file photo file path
-* @param func callback function
-* @param index required position
-* @param data callback data
-* @return The Image Slider item handle or NULL
+* @param obj The Image Slider object
+* @param photo_file photo file path
+* @param func callback function
+* @param index required position
+* @param data callback data
+* @return The Image Slider item handle or NULL
*
-* @ingroup Imageslider
+* @ingroup Imageslider
*/
EAPI Elm_Imageslider_Item *
elm_imageslider_item_append_relative(Evas_Object *obj, const char *photo_file, Elm_Imageslider_Cb func, unsigned int index, void *data)
Elm_Imageslider_Item *it;
- fprintf(stderr, "[[[ DEBUG ]]]:: New elm_imageslider_item_append_relative()\n");
+ DBG("New elm_imageslider_item_append_relative()\n");
if (!obj || !(wd = elm_widget_data_get(obj)))
return NULL;
/**
* Prepend Image Slider item
*
-* @param obj The Image Slider object
-* @param photo_file photo file path
-* @param func callback function
-* @param data callback data
-* @return The imageslider item handle or NULL
+* @param obj The Image Slider object
+* @param photo_file photo file path
+* @param func callback function
+* @param data callback data
+* @return The imageslider item handle or NULL
*
* @ingroup Imageslider
*/
/**
* Delete the selected Image Slider item
*
-* @param it The selected Image Slider item handle
+* @param it The selected Image Slider item handle
*
* @ingroup Imageslider
*/
/**
* Get the selected Image Slider item
*
-* @param obj The Image Slider object
+* @param obj The Image Slider object
* @return The selected Image Slider item or NULL
*
* @ingroup Imageslider
/**
* Get whether an Image Slider item is selected or not
*
-* @param it the selected Image Slider item
+* @param it the selected Image Slider item
* @return EINA_TRUE or EINA_FALSE
*
* @ingroup Imageslider
/**
* Set the selected Image Slider item
*
-* @param it The Imaga Slider item
+* @param it The Imaga Slider item
*
* @ingroup Imageslider
*/
/**
* Get the photo file path of given Image Slider item
*
-* @param it The Image Slider item
+* @param it The Image Slider item
* @return The photo file path or NULL;
*
* @ingroup Imageslider
/**
* Get the previous Image Slider item
*
-* @param it The Image Slider item
+* @param it The Image Slider item
* @return The previous Image Slider item or NULL
*
* @ingroup Imageslider
/**
* Get the next Image Slider item
*
-* @param it The Image Slider item
+* @param it The Image Slider item
* @return The next Image Slider item or NULL
*
* @ingroup Imageslider
/**
* Move to the previous Image Slider item
*
-* @param obj The Image Slider object
+* @param obj The Image Slider object
*
* @ingroup Imageslider
*/
if (!it || (!(wd = elm_widget_data_get(it->obj)))) return;
ELM_CHECK_WIDTYPE(it->obj, widtype);
+ if (wd->ani_lock == EINA_TRUE) return;
if (it == eina_list_data_get(eina_list_prev(wd->cur)))
elm_layout_content_set(wd->ly[BLOCK_LEFT], "swl.photo", NULL);
else if (it == eina_list_data_get(wd->cur))
elm_layout_content_set(wd->ly[BLOCK_CENTER], "swl.photo", NULL);
- else if (it == eina_list_data_get(eina_list_prev(wd->cur)))
+ else if (it == eina_list_data_get(eina_list_next(wd->cur)))
elm_layout_content_set(wd->ly[BLOCK_RIGHT], "swl.photo", NULL);
-
_imageslider_update(wd);
}
}
EAPI void
-elm_object_text_part_set(Evas_Object *obj, const char *item, const char *label)
+elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label)
{
EINA_SAFETY_ON_NULL_RETURN(obj);
- elm_widget_text_part_set(obj, item, label);
+ elm_widget_text_part_set(obj, part, label);
}
EAPI const char *
-elm_object_text_part_get(const Evas_Object *obj, const char *item)
+elm_object_text_part_get(const Evas_Object *obj, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
- return elm_widget_text_part_get(obj, item);
+ return elm_widget_text_part_get(obj, part);
+}
+
+EAPI void
+elm_object_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
+{
+ EINA_SAFETY_ON_NULL_RETURN(obj);
+ elm_widget_content_part_set(obj, part, content);
+}
+
+EAPI Evas_Object *
+elm_object_content_part_get(const Evas_Object *obj, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+ return elm_widget_content_part_get(obj, part);
+}
+
+EAPI Evas_Object *
+elm_object_content_part_unset(Evas_Object *obj, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+ return elm_widget_content_part_unset(obj, part);
}
/**
{
return _elm_config->longpress_timeout;
}
+
+EAPI void
+elm_object_item_content_part_set(Elm_Object_Item *it,
+ const char *part,
+ Evas_Object *content)
+{
+ elm_widget_item_content_part_set(it, part, content);
+}
+
+EAPI Evas_Object *
+elm_object_item_content_part_get(const Elm_Object_Item *it,
+ const char *part)
+{
+ return elm_widget_item_content_part_get(it, part);
+}
+
+EAPI Evas_Object *
+elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part)
+{
+ return elm_widget_item_content_part_unset(it, part);
+}
+
+EAPI void
+elm_object_item_text_part_set(Elm_Object_Item *it,
+ const char *part,
+ const char *label)
+{
+ elm_widget_item_text_part_set(it, part, label);
+}
+
+EAPI const char *
+elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part)
+{
+ return elm_widget_item_text_part_get(it, part);
+}
+
+EAPI void
+elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source)
+{
+ elm_widget_item_signal_emit(it, emission, source);
+}
\ No newline at end of file
ecore_imf_context_input_panel_show(imf_context);
evas_object_focus_set(obj, EINA_TRUE);
}
- else if ((imf_context) && (!wd->current))
+ else if ((imf_context) && ((!wd->current) || (!eina_list_count(wd->items))))
{
+ _view_update(obj);
ecore_imf_context_input_panel_show(imf_context);
- elm_object_focus(wd->entry);
}
}
else
Evas_Coord w_text, h_btn, padding_outer, padding_inner;
Evas_Coord w_btn = 0, button_max_width = 0;
const char *size_str;
+ const char *ellipsis = "<ellipsis=1.0>";
size_str = edje_object_data_get(btn, "button_max_size");
if (size_str) button_max_width = (Evas_Coord)atoi(size_str);
+ const char *button_text = edje_object_part_text_get(btn, "elm.btn.text");
+
// decide the size of button
edje_object_part_geometry_get(btn, "elm.base", NULL, NULL, NULL, &h_btn);
edje_object_part_geometry_get(btn, "elm.btn.text", NULL, NULL, &w_text, NULL);
w_btn = w_text + 2*padding_outer + 2*padding_inner;
rw = w_btn;
- vw = (button_max_width < w_btn) ? button_max_width : w_btn;
+
+ if (button_max_width < w_btn)
+ {
+ vw = button_max_width;
+ edje_object_part_text_set(btn, "elm.btn.text", ellipsis);
+ edje_object_part_text_append(btn, "elm.btn.text", button_text);
+ }
+ else
+ vw = w_btn;
//resize btn
evas_object_resize(btn, vw, h_btn);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
- if (!parent) return NULL;
- wd = ELM_NEW(Widget_Data);
- e = evas_object_evas_get(parent);
- if (!e) return NULL;
- obj = elm_widget_add(e);
+ ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
+
ELM_SET_WIDTYPE(widtype, "multibuttonentry");
elm_widget_type_set(obj, "multibuttonentry");
elm_widget_sub_object_add(parent, obj);
void _elm_widget_type_clear(void);
void _elm_widget_focus_region_show(const Evas_Object *obj);
-void _elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool top_win_focused);
-Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
void _elm_unneed_ethumb(void);
#define ELM_STORE_FILESYSTEM_MAGIC 0x3f89ea57
#define ELM_STORE_DBSYSTEM_MAGIC 0x3f89ea58
#define ELM_STORE_ITEM_MAGIC 0x5afe8c1d
-#define CACHE_COUNT 128
+#define CACHE_COUNT 1024
struct _Elm_Store
{
switch (m->type)
{
case ELM_STORE_ITEM_MAPPING_LABEL:
+ LKU(sti->lock);
s = *(char **)(((unsigned char *)sti->data) + m->offset);
+ LKL(sti->lock);
break;
case ELM_STORE_ITEM_MAPPING_CUSTOM:
if (m->details.custom.func)
- s = m->details.custom.func(sti->data, sti, part);
+ {
+ LKU(sti->lock);
+ s = m->details.custom.func(sti->data, sti, part);
+ LKL(sti->lock);
+ }
break;
default:
if (m->type == ELM_STORE_ITEM_MAPPING_CUSTOM)
{
if (m->details.custom.func)
- s = m->details.custom.func(NULL, sti, part);
+ {
+ LKU(sti->lock);
+ s = m->details.custom.func(sti->item_info, sti, part);
+ LKL(sti->lock);
+ }
if (s)
{
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
+static const char SIG_CLICKED[] = "clicked";
+static const char SIG_HIDDEN[] = "hide";
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_CLICKED, ""},
+ {SIG_HIDDEN, ""},
+ {NULL, NULL}
+};
static void
_del_job(void *data)
{
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
- Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
+ Evas_Coord minw = -1, minh = -1;
if (!wd) return;
- edje_object_size_min_calc(wd->win, &minw, &minh);
-//TODO:
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ edje_object_size_min_restricted_calc(wd->edje_obj, &minw, &minh, minw, minh);
+ evas_object_size_hint_min_set(obj, minw, minh);
}
#ifdef HAVE_ELEMENTARY_X
if (!wd) return;
evas_object_hide (wd->win);
- evas_object_smart_callback_call (data, "hide", NULL);
+ evas_object_smart_callback_call (data, SIG_HIDDEN, NULL);
+}
+
+static void _clicked_cb (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_CLICKED, NULL);
}
static Evas_Object
#endif
edje_object_signal_callback_add(wd->edje_obj, "request,hide", "", _hide_cb, obj);
+ edje_object_signal_callback_add(wd->edje_obj, "clicked", "", _clicked_cb, obj);
evas_object_show (wd->edje_obj);
}
evas_object_event_callback_add (obj, EVAS_CALLBACK_SHOW, _show, NULL);
evas_object_event_callback_add (obj, EVAS_CALLBACK_HIDE, _hide, NULL);
-
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
return obj;
}
/*
* manual calculate win_tickernoti_indi window position & size
- * - win_indi is not full size window (480 x 27)
+ * - win_indi is not full size window
*/
ecore_x_window_size_get (ecore_x_window_root_first_get(), &root_w, &root_h);
Smart_Data * sd = evas_object_smart_data_get(obj); \
if (!sd) return;
+#undef elm_widget_text_set_hook_set
+#undef elm_widget_text_get_hook_set
+#undef elm_widget_content_set_hook_set
+#undef elm_widget_content_get_hook_set
+#undef elm_widget_content_unset_hook_set
+
typedef struct _Smart_Data Smart_Data;
typedef struct _Edje_Signal_Data Edje_Signal_Data;
typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data;
Evas_Coord *y,
Evas_Coord *w,
Evas_Coord *h);
- void (*on_text_set_func)(Evas_Object *obj,
- const char *item,
- const char *text);
- const char *(*on_text_get_func)(const Evas_Object *obj,
- const char *item);
+ Elm_Widget_On_Text_Set_Cb on_text_set_func;
+ Elm_Widget_On_Text_Get_Cb on_text_get_func;
+ Elm_Widget_On_Content_Set_Cb on_content_set_func;
+ Elm_Widget_On_Content_Get_Cb on_content_get_func;
+ Elm_Widget_On_Content_Unset_Cb on_content_unset_func;
void *data;
Evas_Coord rx, ry, rw, rh;
int scroll_hold;
Eina_Bool can_focus : 1;
Eina_Bool child_can_focus : 1;
Eina_Bool focused : 1;
- Eina_Bool top_win_focused : 1;
Eina_Bool tree_unfocusable : 1;
Eina_Bool highlight_ignore : 1;
Eina_Bool highlight_in_theme : 1;
focus_order++;
sd->focus_order = focus_order;
- if (sd->top_win_focused)
- {
- sd->focused = EINA_TRUE;
- if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
- if (sd->focus_func) sd->focus_func(obj);
- _elm_widget_focus_region_show(obj);
- }
+ sd->focused = EINA_TRUE;
+ if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
+ if (sd->focus_func) sd->focus_func(obj);
+
+ _elm_widget_focus_region_show(obj);
+
sd->focus_order_on_calc = EINA_FALSE;
}
EAPI void
elm_widget_text_set_hook_set(Evas_Object *obj,
- void (*func)(Evas_Object *obj,
- const char *item,
- const char *text))
+ Elm_Widget_On_Text_Set_Cb func)
{
API_ENTRY return;
sd->on_text_set_func = func;
EAPI void
elm_widget_text_get_hook_set(Evas_Object *obj,
- const char *(*func)(const Evas_Object *obj,
- const char *item))
+ Elm_Widget_On_Text_Get_Cb func)
{
API_ENTRY return;
sd->on_text_get_func = func;
}
EAPI void
+elm_widget_content_set_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Content_Set_Cb func)
+{
+ API_ENTRY return;
+ sd->on_content_set_func = func;
+}
+
+EAPI void
+elm_widget_content_get_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Content_Get_Cb func)
+{
+ API_ENTRY return;
+ sd->on_content_get_func = func;
+}
+
+EAPI void
+elm_widget_content_unset_hook_set(Evas_Object *obj,
+ Elm_Widget_On_Content_Unset_Cb func)
+{
+ API_ENTRY return;
+ sd->on_content_unset_func = func;
+}
+
+EAPI void
elm_widget_changed_hook_set(Evas_Object *obj,
void (*func)(Evas_Object *obj))
{
if (sd2->parent_obj)
elm_widget_sub_object_del(sd2->parent_obj, sobj);
sd2->parent_obj = obj;
- sd2->top_win_focused = sd->top_win_focused;
if (!sd->child_can_focus && (_is_focusable(sobj)))
sd->child_can_focus = EINA_TRUE;
}
if (_elm_widget_is(sd->resize_obj))
{
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
- if (sd2)
- {
- sd2->parent_obj = obj;
- sd2->top_win_focused = sd->top_win_focused;
- }
+ if (sd2) sd2->parent_obj = obj;
evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE,
_sub_obj_hide, sd);
}
}
}
-void
-_elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool top_win_focused)
-{
- const Eina_List *l;
- Evas_Object *child;
- API_ENTRY return;
-
- if (sd->top_win_focused == top_win_focused) return;
- if (sd->resize_obj)
- _elm_widget_top_win_focused_set(sd->resize_obj, top_win_focused);
- EINA_LIST_FOREACH(sd->subobjs, l, child)
- {
- _elm_widget_top_win_focused_set(child, top_win_focused);
- }
- sd->top_win_focused = top_win_focused;
-}
-
-Eina_Bool
-_elm_widget_top_win_focused_get(const Evas_Object *obj)
-{
- API_ENTRY return EINA_FALSE;
- return sd->top_win_focused;
-}
-
EAPI void
elm_widget_activate(Evas_Object *obj)
{
return sd->on_text_get_func(obj, item);
}
+EAPI void
+elm_widget_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
+{
+ API_ENTRY return;
+
+ if (!sd->on_content_set_func) return;
+ sd->on_content_set_func(obj, part, content);
+}
+
+EAPI Evas_Object *
+elm_widget_content_part_get(const Evas_Object *obj, const char *part)
+{
+ API_ENTRY return NULL;
+
+ if (!sd->on_content_get_func) return NULL;
+ return sd->on_content_get_func(obj, part);
+}
+
+EAPI Evas_Object *
+elm_widget_content_part_unset(Evas_Object *obj, const char *part)
+{
+ API_ENTRY return NULL;
+
+ if (!sd->on_content_unset_func) return NULL;
+ return sd->on_content_unset_func(obj, part);
+}
+
EAPI Elm_Theme *
elm_widget_theme_get(const Evas_Object *obj)
{
}
}
+EAPI void
+_elm_widget_item_content_part_set(Elm_Widget_Item *item,
+ const char *part,
+ Evas_Object *content)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (!item->on_content_set_func) return;
+ item->on_content_set_func((Elm_Object_Item *) item, part, content);
+}
+
+EAPI Evas_Object *
+_elm_widget_item_content_part_get(const Elm_Widget_Item *item,
+ const char *part)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+ if (!item->on_content_get_func) return NULL;
+ return item->on_content_get_func((Elm_Object_Item *) item, part);
+}
+
+EAPI Evas_Object *
+_elm_widget_item_content_part_unset(Elm_Widget_Item *item,
+ const char *part)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+ if (!item->on_content_unset_func) return NULL;
+ return item->on_content_unset_func((Elm_Object_Item *) item, part);
+}
+
+EAPI void
+_elm_widget_item_text_part_set(Elm_Widget_Item *item,
+ const char *part,
+ const char *label)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (!item->on_text_set_func) return;
+ item->on_text_set_func((Elm_Object_Item *) item, part, label);
+}
+
+EAPI void
+_elm_widget_item_signal_emit(Elm_Widget_Item *item,
+ const char *emission,
+ const char *source)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (item->on_signal_emit_func)
+ item->on_signal_emit_func((Elm_Object_Item *) item, emission, source);
+}
+
+EAPI const char *
+_elm_widget_item_text_part_get(const Elm_Widget_Item *item,
+ const char *part)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+ if (!item->on_text_get_func) return NULL;
+ return item->on_text_get_func((Elm_Object_Item *) item, part);
+}
+
+EAPI void
+_elm_widget_item_content_set_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Content_Set_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_content_set_func = func;
+}
+
+EAPI void
+_elm_widget_item_content_get_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Content_Get_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_content_get_func = func;
+}
+
+EAPI void
+_elm_widget_item_content_unset_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Content_Unset_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_content_unset_func = func;
+}
+
+EAPI void
+_elm_widget_item_text_set_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Text_Set_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_text_set_func = func;
+}
+
+EAPI void
+_elm_widget_item_text_get_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Text_Get_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_text_get_func = func;
+}
+
+EAPI void
+_elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Signal_Emit_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->on_signal_emit_func = func;
+}
+
static void
_smart_add(Evas_Object *obj)
{
typedef struct _Elm_Cursor Elm_Cursor;
typedef struct _Elm_Widget_Item Elm_Widget_Item; /**< base structure for all widget items that are not Elm_Widget themselves */
+typedef void (*Elm_Widget_On_Text_Set_Cb)(void *data, const char *part, const char *text);
+typedef void (*Elm_Widget_On_Content_Set_Cb)(void *data, const char *part, Evas_Object *content);
+typedef const char *(*Elm_Widget_On_Text_Get_Cb)(const void *data, const char *part);
+typedef Evas_Object *(*Elm_Widget_On_Content_Get_Cb)(const void *data, const char *part);
+typedef Evas_Object *(*Elm_Widget_On_Content_Unset_Cb)(const void *data, const char *part);
+typedef void (*Elm_Widget_On_Signal_Emit_Cb)(void *data, const char *emission, const char *source);
+
struct _Elm_Widget_Item
{
/* ef1 ~~ efl, el3 ~~ elm */
Evas_Object *view; /**< the base view object */
const void *data; /**< item specific data */
Evas_Smart_Cb del_cb; /**< used to notify the item is being deleted */
+ Elm_Widget_On_Content_Set_Cb on_content_set_func;
+ Elm_Widget_On_Content_Get_Cb on_content_get_func;
+ Elm_Widget_On_Content_Unset_Cb on_content_unset_func;
+ Elm_Widget_On_Text_Set_Cb on_text_set_func;
+ Elm_Widget_On_Text_Get_Cb on_text_get_func;
+ Elm_Widget_On_Signal_Emit_Cb on_signal_emit_func;
/* widget variations should have data from here and on */
/* @todo: TODO check if this is enough for 1.0 release, maybe add padding! */
};
+struct _Elm_Object_Item
+{
+ Elm_Widget_Item it;
+};
+
#define ELM_NEW(t) calloc(1, sizeof(t))
+#define ELM_CAST(p) ((void *)(p))
+
+#define ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ...) \
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *) (it), __VA_ARGS__); \
+ ELM_CHECK_WIDTYPE(it->it.widget, widtype) __VA_ARGS__;
+
EAPI Eina_Bool elm_widget_api_check(int ver);
EAPI Evas_Object *elm_widget_add(Evas *evas);
EAPI void elm_widget_del_hook_set(Evas_Object *obj, void (*func) (Evas_Object *obj));
EAPI void elm_widget_on_change_hook_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), void *data);
EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), void *data);
EAPI void elm_widget_focus_region_hook_set(Evas_Object *obj, void (*func) (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h));
-EAPI void elm_widget_text_set_hook_set(Evas_Object *obj, void (*func)(Evas_Object *obj, const char *item, const char *text));
-EAPI void elm_widget_text_get_hook_set(Evas_Object *obj, const char *(*func)(const Evas_Object *obj, const char *item));
+EAPI void elm_widget_text_set_hook_set(Evas_Object *obj, Elm_Widget_On_Text_Set_Cb func);
+#define elm_widget_text_set_hook_set(obj, func) elm_widget_text_set_hook_set(obj, (Elm_Widget_On_Text_Set_Cb)(func))
+EAPI void elm_widget_text_get_hook_set(Evas_Object *obj, Elm_Widget_On_Text_Get_Cb func);
+#define elm_widget_text_get_hook_set(obj, func) elm_widget_text_get_hook_set(obj, (Elm_Widget_On_Text_Get_Cb)(func))
+EAPI void elm_widget_content_set_hook_set(Evas_Object *obj, Elm_Widget_On_Content_Set_Cb func);
+#define elm_widget_content_set_hook_set(obj, func) elm_widget_content_set_hook_set(obj, (Elm_Widget_On_Content_Set_Cb)(func))
+EAPI void elm_widget_content_get_hook_set(Evas_Object *obj, Elm_Widget_On_Content_Get_Cb func);
+#define elm_widget_content_get_hook_set(obj, func) elm_widget_content_get_hook_set(obj, (Elm_Widget_On_Content_Get_Cb)(func))
+EAPI void elm_widget_content_unset_hook_set(Evas_Object *obj, Elm_Widget_On_Content_Unset_Cb func);
+#define elm_widget_content_unset_hook_set(obj, func) elm_widget_content_unset_hook_set(obj, (Elm_Widget_On_Content_Unset_Cb)(func))
EAPI void elm_widget_on_focus_region_hook_set(Evas_Object *obj, void (*func) (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h));
EAPI void elm_widget_data_set(Evas_Object *obj, void *data);
EAPI void *elm_widget_data_get(const Evas_Object *obj);
EAPI void elm_widget_focus_mouse_down_handle(Evas_Object *obj);
EAPI void elm_widget_focus_tree_unfocusable_handle(Evas_Object *obj);
EAPI void elm_widget_focus_disabled_handle(Evas_Object *obj);
-EAPI void elm_widget_text_part_set(Evas_Object *obj, const char *item, const char *label);
-EAPI const char *elm_widget_text_part_get(const Evas_Object *obj, const char *item);
-
+EAPI void elm_widget_text_part_set(Evas_Object *obj, const char *part, const char *label);
+EAPI const char *elm_widget_text_part_get(const Evas_Object *obj, const char *part);
+EAPI void elm_widget_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content);
+EAPI Evas_Object *elm_widget_content_part_get(const Evas_Object *obj, const char *part);
+EAPI Evas_Object *elm_widget_content_part_unset(Evas_Object *obj, const char *part);
EAPI Elm_Widget_Item *_elm_widget_item_new(Evas_Object *parent, size_t alloc_size);
EAPI void _elm_widget_item_del(Elm_Widget_Item *item);
EAPI void _elm_widget_item_pre_notify_del(Elm_Widget_Item *item);
EAPI const char *_elm_widget_item_cursor_style_get(const Elm_Widget_Item *item);
EAPI void _elm_widget_item_cursor_engine_only_set(Elm_Widget_Item *item, Eina_Bool engine_only);
EAPI Eina_Bool _elm_widget_item_cursor_engine_only_get(const Elm_Widget_Item *item);
+EAPI void _elm_widget_item_content_part_set(Elm_Widget_Item *item, const char *part, Evas_Object *content);
+EAPI Evas_Object *_elm_widget_item_content_part_get(const Elm_Widget_Item *item, const char *part);
+EAPI Evas_Object *_elm_widget_item_content_part_unset(Elm_Widget_Item *item, const char *part);
+EAPI void _elm_widget_item_text_part_set(Elm_Widget_Item *item, const char *part, const char *label);
+EAPI const char *_elm_widget_item_text_part_get(const Elm_Widget_Item *item, const char *part);
+EAPI void _elm_widget_item_signal_emit(Elm_Widget_Item *item, const char *emission, const char *source);
+EAPI void _elm_widget_item_content_set_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Content_Set_Cb func);
+EAPI void _elm_widget_item_content_get_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Content_Get_Cb func);
+EAPI void _elm_widget_item_content_unset_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Content_Unset_Cb func);
+EAPI void _elm_widget_item_text_set_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Text_Set_Cb func);
+EAPI void _elm_widget_item_text_get_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Text_Get_Cb func);
+EAPI void _elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *it, Elm_Widget_On_Signal_Emit_Cb func);
/* debug function. don't use it unless you are tracking parenting issues */
EAPI void elm_widget_tree_dump(const Evas_Object *top);
*/
#define elm_widget_item_cursor_engine_only_get(item) \
_elm_widget_item_cursor_engine_only_get((const Elm_Widget_Item *)item)
+/**
+ * Convenience function to query item's content part set.
+ * @see _elm_widget_item_content_part_set()
+ */
+#define elm_widget_item_content_part_set(item, part, content) \
+ _elm_widget_item_content_part_set((Elm_Widget_Item *)item, part, content)
+/**
+ * Convenience function to query item's content part get.
+ * @see _elm_widget_item_content_part_get()
+ */
+#define elm_widget_item_content_part_get(item, part) \
+ _elm_widget_item_content_part_get((const Elm_Widget_Item *)item, part)
+/**
+ * Convenience function to query item's content part unset.
+ * @see _elm_widget_item_content_part_unset()
+ */
+#define elm_widget_item_content_part_unset(item, part) \
+ _elm_widget_item_content_part_unset((Elm_Widget_Item *)item, part)
+/**
+ * Convenience function to query item's text part set.
+ * @see _elm_widget_item_text_part_set()
+ */
+#define elm_widget_item_text_part_set(item, part, label) \
+ _elm_widget_item_text_part_set((Elm_Widget_Item *)item, part, label)
+/**
+ * Convenience function to query item's text part get.
+ * @see _elm_widget_item_text_part_get()
+ */
+#define elm_widget_item_text_part_get(item, part) \
+ _elm_widget_item_text_part_get((const Elm_Widget_Item *)item, part)
+/**
+ * Convenience function to query item's signal emit.
+ * @see _elm_widget_item_signal_emit()
+ */
+#define elm_widget_item_signal_emit(item, emission, source) \
+ _elm_widget_item_signal_emit((Elm_Widget_Item *)item, emission, source)
+/**
+ * Convenience function to query item's content set hook.
+ * @see _elm_widget_item_content_set_hook_set()
+ */
+#define elm_widget_item_content_set_hook_set(item, func) \
+ _elm_widget_item_content_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Content_Set_Cb)func)
+/**
+ * Convenience function to query item's content get hook.
+ * @see _elm_widget_item_content_get_hook_set()
+ */
+#define elm_widget_item_content_get_hook_set(item, func) \
+ _elm_widget_item_content_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Content_Get_Cb)func)
+/**
+ * Convenience function to query item's content unset hook.
+ * @see _elm_widget_item_content_unset_hook_set()
+ */
+#define elm_widget_item_content_unset_hook_set(item, func) \
+ _elm_widget_item_content_unset_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Content_Unset_Cb)func)
+/**
+ * Convenience function to query item's text set hook.
+ * @see _elm_widget_item_text_set_hook_set()
+ */
+#define elm_widget_item_text_set_hook_set(item, func) \
+ _elm_widget_item_text_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Text_Set_Cb)func)
+/**
+ * Convenience function to query item's text get hook.
+ * @see _elm_widget_item_text_get_hook_set()
+ */
+#define elm_widget_item_text_get_hook_set(item, func) \
+ _elm_widget_item_text_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Text_Get_Cb)func)
+/**
+ * Convenience function to query item's signal emit hook.
+ * @see _elm_widget_item_signal_emit_hook_set()
+ */
+#define elm_widget_item_signal_emit_hook_set(item, func) \
+ _elm_widget_item_signal_emit_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Signal_Emit_Cb)func)
/**
* Cast and ensure the given pointer is an Elm_Widget_Item or return NULL.
} shot;
Eina_Bool autodel : 1;
int *autodel_clear, rot;
- int show_count;
struct {
int x, y;
} screen;
if (!obj) return;
win = elm_widget_data_get(obj);
if (!win) return;
- _elm_widget_top_win_focused_set(win->win_obj, EINA_TRUE);
- if (win->show_count == 1)
- {
- elm_object_focus(win->win_obj);
- win->show_count++;
- }
- else
+ if (!elm_widget_focus_get(win->win_obj))
elm_widget_focus_restore(win->win_obj);
evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_IN, NULL);
win->focus_highlight.cur.visible = EINA_TRUE;
win = elm_widget_data_get(obj);
if (!win) return;
elm_object_unfocus(win->win_obj);
- _elm_widget_top_win_focused_set(win->win_obj, EINA_FALSE);
evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_OUT, NULL);
win->focus_highlight.cur.visible = EINA_FALSE;
_elm_win_focus_highlight_reconfigure_job_start(win);
}
static void
-_elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
Elm_Win *win = data;
- if (!win->show_count) win->show_count++;
+ elm_object_focus(obj);
if (win->shot.info) _shot_handle(win);
}
Evas_Event_Mouse_Down *ev;
Smart_Data *sd;
Evas_Coord x = 0, y = 0, ox = 0, oy = 0;
+ Evas_Coord vw, vh, aw, ah;
sd = data;
ev = event_info;
}
else
sd->down.extra_time = 0.0;
+ elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &vw, &vh);
+ aw = abs(sd->down.dx);
+ if (aw > vw*3)
+ {
+ if (sd->down.dx > 0) sd->down.dx = vw*3;
+ else sd->down.dx = -(vw*3);
+ }
+ ah = abs(sd->down.dy);
+ if (ah > vh*3)
+ {
+ if (sd->down.dy > 0) sd->down.dy = vh*3;
+ else sd->down.dy = -(vh*3);
+ }
sd->down.pdx = sd->down.dx;
sd->down.pdy = sd->down.dy;
ox = -sd->down.dx;