summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-24 10:38:01 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-24 10:41:14 +0200
commit54855a435e781f3f91c8c6dc3a76131e83cab52b (patch)
tree1c72d3e44ee2e6ee31f0143b3537dfea06d545de
parentdb00f2e93c12deb56f813087deadc14e1c89147a (diff)
Eolian: Integration of Panel
-rw-r--r--src/lib/Makefile.am10
-rw-r--r--src/lib/elm_panel.c273
-rw-r--r--src/lib/elm_panel.eo78
-rw-r--r--src/lib/elm_panel_eo.h4
-rw-r--r--src/lib/elm_widget_panel.h6
5 files changed, 157 insertions, 214 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 03486e9b0..cb66d4c6b 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -610,7 +610,9 @@ BUILT_SOURCES = \
610 elm_map.eo.c \ 610 elm_map.eo.c \
611 elm_map.eo.h \ 611 elm_map.eo.h \
612 elm_menu.eo.c \ 612 elm_menu.eo.c \
613 elm_menu.eo.h 613 elm_menu.eo.h \
614 elm_panel.eo.c \
615 elm_panel.eo.h
614 616
615EXTRA_DIST += \ 617EXTRA_DIST += \
616 elm_widget.eo \ 618 elm_widget.eo \
@@ -655,7 +657,8 @@ EXTRA_DIST += \
655 elm_label.eo \ 657 elm_label.eo \
656 elm_map_pan.eo \ 658 elm_map_pan.eo \
657 elm_map.eo \ 659 elm_map.eo \
658 elm_menu.eo 660 elm_menu.eo \
661 elm_panel.eo
659 662
660nodist_includesunstable_HEADERS = \ 663nodist_includesunstable_HEADERS = \
661 elm_widget.eo.h \ 664 elm_widget.eo.h \
@@ -700,5 +703,6 @@ nodist_includesunstable_HEADERS = \
700 elm_label.eo.h \ 703 elm_label.eo.h \
701 elm_map_pan.eo.h \ 704 elm_map_pan.eo.h \
702 elm_map.eo.h \ 705 elm_map.eo.h \
703 elm_menu.eo.h 706 elm_menu.eo.h \
707 elm_panel.eo.h
704 708
diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c
index 7d92e0576..8e9194fe5 100644
--- a/src/lib/elm_panel.c
+++ b/src/lib/elm_panel.c
@@ -9,8 +9,6 @@
9 9
10#include "els_box.h" 10#include "els_box.h"
11 11
12EAPI Eo_Op ELM_OBJ_PANEL_BASE_ID = EO_NOOP;
13
14#define MY_CLASS ELM_OBJ_PANEL_CLASS 12#define MY_CLASS ELM_OBJ_PANEL_CLASS
15 13
16#define MY_CLASS_NAME "Elm_Panel" 14#define MY_CLASS_NAME "Elm_Panel"
@@ -39,12 +37,11 @@ _mirrored_set(Evas_Object *obj,
39 elm_panel_orient_set(obj, elm_panel_orient_get(obj)); 37 elm_panel_orient_set(obj, elm_panel_orient_get(obj));
40} 38}
41 39
42static void 40EOLIAN static void
43_elm_panel_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 41_elm_panel_elm_layout_sizing_eval(Eo *obj, Elm_Panel_Data *sd)
44{ 42{
45 Evas_Coord mw = -1, mh = -1; 43 Evas_Coord mw = -1, mh = -1;
46 44
47 Elm_Panel_Smart_Data *sd = _pd;
48 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 45 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
49 46
50 if (sd->delete_me) return; 47 if (sd->delete_me) return;
@@ -130,21 +127,18 @@ _orient_set_do(Evas_Object *obj)
130 } 127 }
131} 128}
132 129
133static void 130EOLIAN static Eina_Bool
134_elm_panel_smart_theme(Eo *obj, void *_pd, va_list *list) 131_elm_panel_elm_widget_theme_apply(Eo *obj, Elm_Panel_Data *sd)
135{ 132{
136 const char *str; 133 const char *str;
137 Evas_Coord minw = 0, minh = 0; 134 Evas_Coord minw = 0, minh = 0;
138 Elm_Panel_Smart_Data *sd = _pd;
139 135
140 Eina_Bool int_ret = EINA_FALSE; 136 Eina_Bool int_ret = EINA_FALSE;
141 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
142 if (ret) *ret = EINA_FALSE;
143 137
144 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 138 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
145 139
146 eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret)); 140 eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret));
147 if (!int_ret) return; 141 if (!int_ret) return EINA_FALSE;
148 142
149 _mirrored_set(obj, elm_widget_mirrored_get(obj)); 143 _mirrored_set(obj, elm_widget_mirrored_get(obj));
150 144
@@ -167,38 +161,28 @@ _elm_panel_smart_theme(Eo *obj, void *_pd, va_list *list)
167 161
168 elm_layout_sizing_eval(obj); 162 elm_layout_sizing_eval(obj);
169 163
170 if (ret) *ret = EINA_TRUE; 164 return EINA_TRUE;
171} 165}
172 166
173static void 167EOLIAN static Eina_Bool
174_elm_panel_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) 168_elm_panel_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Panel_Data *_pd EINA_UNUSED)
175{ 169{
176 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 170 return EINA_TRUE;
177 *ret = EINA_TRUE;
178} 171}
179 172
180static void 173EOLIAN static Eina_Bool
181_elm_panel_smart_focus_next(Eo *obj, void *_pd, va_list *list) 174_elm_panel_elm_widget_focus_next(Eo *obj, Elm_Panel_Data *sd, Elm_Focus_Direction dir, Evas_Object **next)
182{ 175{
183 Evas_Object *cur; 176 Evas_Object *cur;
184 Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
185 Evas_Object **next = va_arg(*list, Evas_Object **);
186 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
187 Eina_Bool int_ret = EINA_FALSE;
188 177
189 Elm_Panel_Smart_Data *sd = _pd; 178 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
190 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
191 179
192 if (!sd->content) goto end; 180 if (!sd->content) return EINA_FALSE;
193 181
194 cur = sd->content; 182 cur = sd->content;
195 183
196 /* Try to Focus cycle in subitem */ 184 /* Try to Focus cycle in subitem */
197 if (!sd->hidden) 185 if (!sd->hidden) return elm_widget_focus_next_get(cur, dir, next);
198 {
199 int_ret = elm_widget_focus_next_get(cur, dir, next);
200 goto end;
201 }
202 186
203 /* access */ 187 /* access */
204 if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF) 188 if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
@@ -212,10 +196,7 @@ _elm_panel_smart_focus_next(Eo *obj, void *_pd, va_list *list)
212 196
213 /* Return */ 197 /* Return */
214 *next = (Evas_Object *)obj; 198 *next = (Evas_Object *)obj;
215 int_ret = !elm_widget_focus_get(obj); 199 return !elm_widget_focus_get(obj);
216
217end:
218 if (ret) *ret = int_ret;
219} 200}
220 201
221static void 202static void
@@ -261,44 +242,32 @@ void _key_action_toggle(Evas_Object *obj, const char *params EINA_UNUSED)
261 _panel_toggle(NULL, obj, NULL, NULL); 242 _panel_toggle(NULL, obj, NULL, NULL);
262} 243}
263 244
264static void 245EOLIAN static Eina_Bool
265_elm_panel_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list) 246_elm_panel_elm_widget_event(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
266{ 247{
267 Evas_Object *src = va_arg(*list, Evas_Object *); 248 Evas_Event_Key_Down *ev = event_info;
268 Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type); 249 if (elm_widget_disabled_get(obj)) return EINA_FALSE;
269 Evas_Event_Key_Down *ev = va_arg(*list, void *); 250 if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
270 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 251 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
271 252 if (src != obj) return EINA_FALSE;
272 if (ret) *ret = EINA_FALSE;
273
274 if (elm_widget_disabled_get(obj)) return;
275 if (type != EVAS_CALLBACK_KEY_DOWN) return;
276 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
277 if (src != obj) return;
278 253
279 if (!_elm_config_key_binding_call(obj, ev, key_actions)) return; 254 if (!_elm_config_key_binding_call(obj, ev, key_actions)) return EINA_FALSE;
280 255
281 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 256 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
282 if (ret) *ret = EINA_TRUE; 257 return EINA_TRUE;
283} 258}
284 259
285static void 260EOLIAN static Eina_Bool
286_elm_panel_smart_content_set(Eo *obj, void *_pd, va_list *list) 261_elm_panel_elm_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content)
287{ 262{
288 const char *part = va_arg(*list, const char *);
289 Evas_Object *content = va_arg(*list, Evas_Object *);
290 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
291 Eina_Bool int_ret = EINA_TRUE;
292
293 Elm_Panel_Smart_Data *sd = _pd;
294
295 if (part && strcmp(part, "default")) 263 if (part && strcmp(part, "default"))
296 { 264 {
265 Eina_Bool int_ret = EINA_TRUE;
297 eo_do_super(obj, MY_CLASS, elm_obj_container_content_set(part, content, &int_ret)); 266 eo_do_super(obj, MY_CLASS, elm_obj_container_content_set(part, content, &int_ret));
298 goto end; 267 return int_ret;
299 } 268 }
300 269
301 if (sd->content == content) goto end; 270 if (sd->content == content) return EINA_TRUE;
302 if (sd->content) 271 if (sd->content)
303 evas_object_box_remove_all(sd->bx, EINA_TRUE); 272 evas_object_box_remove_all(sd->bx, EINA_TRUE);
304 sd->content = content; 273 sd->content = content;
@@ -310,59 +279,45 @@ _elm_panel_smart_content_set(Eo *obj, void *_pd, va_list *list)
310 279
311 elm_layout_sizing_eval(obj); 280 elm_layout_sizing_eval(obj);
312 281
313end: 282 return EINA_TRUE;
314 if (ret) *ret = int_ret;
315
316} 283}
317 284
318static void 285EOLIAN static Evas_Object*
319_elm_panel_smart_content_get(Eo *obj, void *_pd, va_list *list) 286_elm_panel_elm_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part)
320{ 287{
321 Elm_Panel_Smart_Data *sd = _pd;
322 const char *part = va_arg(*list, const char *);
323 Evas_Object **ret = va_arg(*list, Evas_Object **);
324 if (!ret) return;
325
326 *ret = NULL;
327
328 if (part && strcmp(part, "default")) 288 if (part && strcmp(part, "default"))
329 { 289 {
330 eo_do_super(obj, MY_CLASS, elm_obj_container_content_get(part, ret)); 290 Evas_Object *ret = NULL;
331 return; 291 eo_do_super(obj, MY_CLASS, elm_obj_container_content_get(part, &ret));
292 return ret;
332 } 293 }
333 294
334 *ret = sd->content; 295 return sd->content;
335} 296}
336 297
337static void 298EOLIAN static Evas_Object*
338_elm_panel_smart_content_unset(Eo *obj, void *_pd, va_list *list) 299_elm_panel_elm_container_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *part)
339{ 300{
340 Evas_Object *content = NULL; 301 Evas_Object *content = NULL;
341 302
342 Elm_Panel_Smart_Data *sd = _pd;
343 const char *part = va_arg(*list, const char *);
344 Evas_Object **ret = va_arg(*list, Evas_Object **);
345
346 if (part && strcmp(part, "default")) 303 if (part && strcmp(part, "default"))
347 { 304 {
348 eo_do_super(obj, MY_CLASS, elm_obj_container_content_unset(part, &content)); 305 eo_do_super(obj, MY_CLASS, elm_obj_container_content_unset(part, &content));
349 goto end; 306 return content;
350 } 307 }
351 308
352 if (!sd->content) goto end; 309 if (!sd->content) return NULL;
353 content = sd->content; 310 content = sd->content;
354 311
355 evas_object_box_remove_all(sd->bx, EINA_FALSE); 312 evas_object_box_remove_all(sd->bx, EINA_FALSE);
356 sd->content = NULL; 313 sd->content = NULL;
357 314
358end: 315 return content;
359 if (ret) *ret = content;
360} 316}
361 317
362static void 318EOLIAN static void
363_elm_panel_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 319_elm_panel_evas_smart_add(Eo *obj, Elm_Panel_Data *priv)
364{ 320{
365 Elm_Panel_Smart_Data *priv = _pd;
366 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 321 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
367 322
368 eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); 323 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
@@ -407,13 +362,12 @@ _elm_panel_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
407 elm_layout_sizing_eval(obj); 362 elm_layout_sizing_eval(obj);
408} 363}
409 364
410static void 365EOLIAN static void
411_elm_panel_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 366_elm_panel_evas_smart_del(Eo *obj, Elm_Panel_Data *sd)
412{ 367{
413 Evas_Object *child; 368 Evas_Object *child;
414 Eina_List *l; 369 Eina_List *l;
415 370
416 Elm_Panel_Smart_Data *sd = _pd;
417 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 371 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
418 372
419 sd->delete_me = EINA_TRUE; 373 sd->delete_me = EINA_TRUE;
@@ -433,12 +387,11 @@ _elm_panel_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
433 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 387 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
434} 388}
435 389
436static void 390EOLIAN static void
437_elm_panel_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list) 391_elm_panel_elm_widget_access(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED, Eina_Bool is_access)
438{ 392{
439 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 393 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
440 394
441 Eina_Bool is_access = va_arg(*list, int);
442 if (is_access) 395 if (is_access)
443 _elm_access_edje_object_part_object_register 396 _elm_access_edje_object_part_object_register
444 (obj, wd->resize_obj, "btn_icon"); 397 (obj, wd->resize_obj, "btn_icon");
@@ -456,8 +409,8 @@ elm_panel_add(Evas_Object *parent)
456 return obj; 409 return obj;
457} 410}
458 411
459static void 412EOLIAN static void
460_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) 413_elm_panel_eo_base_constructor(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
461{ 414{
462 eo_do_super(obj, MY_CLASS, eo_constructor()); 415 eo_do_super(obj, MY_CLASS, eo_constructor());
463 eo_do(obj, 416 eo_do(obj,
@@ -465,20 +418,9 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
465 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL)); 418 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
466} 419}
467 420
468EAPI void 421EOLIAN static void
469elm_panel_orient_set(Evas_Object *obj, 422_elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
470 Elm_Panel_Orient orient)
471{ 423{
472 ELM_PANEL_CHECK(obj);
473 eo_do(obj, elm_obj_panel_orient_set(orient));
474}
475
476static void
477_orient_set(Eo *obj, void *_pd, va_list *list)
478{
479 Elm_Panel_Orient orient = va_arg(*list, Elm_Panel_Orient);
480 Elm_Panel_Smart_Data *sd = _pd;
481
482 if (sd->orient == orient) return; 424 if (sd->orient == orient) return;
483 sd->orient = orient; 425 sd->orient = orient;
484 426
@@ -487,121 +429,36 @@ _orient_set(Eo *obj, void *_pd, va_list *list)
487 elm_layout_sizing_eval(obj); 429 elm_layout_sizing_eval(obj);
488} 430}
489 431
490EAPI Elm_Panel_Orient 432EOLIAN static Elm_Panel_Orient
491elm_panel_orient_get(const Evas_Object *obj) 433_elm_panel_orient_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
492{
493 ELM_PANEL_CHECK(obj) ELM_PANEL_ORIENT_LEFT;
494 Elm_Panel_Orient ret = ELM_PANEL_ORIENT_LEFT;
495 eo_do((Eo *) obj, elm_obj_panel_orient_get(&ret));
496 return ret;
497}
498
499static void
500_orient_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
501{ 434{
502 Elm_Panel_Orient *ret = va_arg(*list, Elm_Panel_Orient *); 435 return sd->orient;
503 Elm_Panel_Smart_Data *sd = _pd;
504
505 if (ret) *ret = sd->orient;
506} 436}
507 437
508EAPI void 438EOLIAN static void
509elm_panel_hidden_set(Evas_Object *obj, 439_elm_panel_hidden_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool hidden)
510 Eina_Bool hidden)
511{ 440{
512 ELM_PANEL_CHECK(obj);
513 eo_do(obj, elm_obj_panel_hidden_set(hidden));
514}
515
516static void
517_hidden_set(Eo *obj, void *_pd, va_list *list)
518{
519 Eina_Bool hidden = va_arg(*list, int);
520 Elm_Panel_Smart_Data *sd = _pd;
521
522 if (sd->hidden == !!hidden) return; 441 if (sd->hidden == !!hidden) return;
523 442
524 _panel_toggle(NULL, obj, NULL, NULL); 443 _panel_toggle(NULL, obj, NULL, NULL);
525} 444}
526 445
527EAPI Eina_Bool 446EOLIAN static Eina_Bool
528elm_panel_hidden_get(const Evas_Object *obj) 447_elm_panel_hidden_get(Eo *obj EINA_UNUSED, Elm_Panel_Data *sd)
529{ 448{
530 ELM_PANEL_CHECK(obj) EINA_FALSE; 449 return sd->hidden;
531 Eina_Bool ret = EINA_FALSE;
532 eo_do((Eo *) obj, elm_obj_panel_hidden_get(&ret));
533 return ret;
534} 450}
535 451
536static void 452EOLIAN static void
537_hidden_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list) 453_elm_panel_toggle(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
538{
539 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
540 Elm_Panel_Smart_Data *sd = _pd;
541
542 if (ret) *ret = sd->hidden;
543}
544
545EAPI void
546elm_panel_toggle(Evas_Object *obj)
547{
548 ELM_PANEL_CHECK(obj);
549 eo_do(obj, elm_obj_panel_toggle());
550}
551
552static void
553_toggle(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
554{ 454{
555 _panel_toggle(NULL, obj, NULL, NULL); 455 _panel_toggle(NULL, obj, NULL, NULL);
556} 456}
557 457
558static void 458static void
559_class_constructor(Eo_Class *klass) 459_elm_panel_class_constructor(Eo_Class *klass)
560{ 460{
561 const Eo_Op_Func_Description func_desc[] = {
562 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
563 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_panel_smart_add),
564 EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_panel_smart_del),
565
566 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_panel_smart_focus_next_manager_is),
567 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT), _elm_panel_smart_focus_next),
568 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_THEME_APPLY), _elm_panel_smart_theme),
569 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_EVENT), _elm_panel_smart_event),
570 EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_ACCESS), _elm_panel_smart_access),
571
572 EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_panel_smart_content_set),
573 EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_panel_smart_content_get),
574 EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_panel_smart_content_unset),
575
576 EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_panel_smart_sizing_eval),
577
578 EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_ORIENT_SET), _orient_set),
579 EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_ORIENT_GET), _orient_get),
580 EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_HIDDEN_SET), _hidden_set),
581 EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_HIDDEN_GET), _hidden_get),
582 EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_TOGGLE), _toggle),
583 EO_OP_FUNC_SENTINEL
584 };
585 eo_class_funcs_set(klass, func_desc);
586
587 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); 461 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
588} 462}
589static const Eo_Op_Description op_desc[] = { 463
590 EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_ORIENT_SET, "Sets the orientation of the panel."), 464#include "elm_panel.eo.c"
591 EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_ORIENT_GET, "Get the orientation of the panel."),
592 EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_HIDDEN_SET, "Set the state of the panel."),
593 EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_HIDDEN_GET, "Get the state of the panel."),
594 EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_TOGGLE, "Toggle the hidden state of the panel from code."),
595 EO_OP_DESCRIPTION_SENTINEL
596};
597static const Eo_Class_Description class_desc = {
598 EO_VERSION,
599 MY_CLASS_NAME,
600 EO_CLASS_TYPE_REGULAR,
601 EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PANEL_BASE_ID, op_desc, ELM_OBJ_PANEL_SUB_ID_LAST),
602 NULL,
603 sizeof(Elm_Panel_Smart_Data),
604 _class_constructor,
605 NULL
606};
607EO_DEFINE_CLASS(elm_obj_panel_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_panel.eo b/src/lib/elm_panel.eo
new file mode 100644
index 000000000..a58872685
--- /dev/null
+++ b/src/lib/elm_panel.eo
@@ -0,0 +1,78 @@
1class Elm_Panel (Elm_Layout)
2{
3 eo_prefix: elm_obj_panel;
4 properties {
5 orient {
6 set {
7 /*@
8 @brief Sets the orientation of the panel
9
10 Sets from where the panel will (dis)appear.
11
12 @ingroup Panel */
13 }
14 get {
15 /*@
16 @brief Get the orientation of the panel.
17
18 @return The Elm_Panel_Orient, or ELM_PANEL_ORIENT_LEFT on failure.
19
20 @ingroup Panel */
21 }
22 values {
23 Elm_Panel_Orient orient; /*@ The panel orientation. Can be one of the following:
24 @li ELM_PANEL_ORIENT_TOP
25 @li ELM_PANEL_ORIENT_LEFT
26 @li ELM_PANEL_ORIENT_RIGHT */
27 }
28 }
29 hidden {
30 set {
31 /*@
32 @brief Set the state of the panel.
33
34 @ingroup Panel */
35 }
36 get {
37 /*@
38 @brief Get the state of the panel.
39
40 @return EINA_TRUE if it is hidden state
41
42 @ingroup Panel */
43 }
44 values {
45 Eina_Bool hidden; /*@ If true, the panel will run the animation to disappear. */
46 }
47 }
48 }
49 methods {
50 toggle {
51 /*@
52 @brief Toggle the hidden state of the panel from code
53
54 @ingroup Panel */
55
56 }
57 }
58 implements {
59 class::constructor;
60 Eo_Base::constructor;
61 Evas_Smart::add;
62 Evas_Smart::del;
63 Elm_Widget::theme_apply;
64 Elm_Widget::focus_next_manager_is;
65 Elm_Widget::focus_next;
66 Elm_Widget::access;
67 Elm_Widget::event;
68 Elm_Container::content_get;
69 Elm_Container::content_unset;
70 Elm_Container::content_set;
71 Elm_Layout::sizing_eval;
72 }
73 events {
74 focused;
75 unfocused;
76 }
77
78}
diff --git a/src/lib/elm_panel_eo.h b/src/lib/elm_panel_eo.h
index 6963d6042..d37ee1459 100644
--- a/src/lib/elm_panel_eo.h
+++ b/src/lib/elm_panel_eo.h
@@ -1,3 +1,6 @@
1#include "elm_panel.eo.h"
2
3#if 0
1#define ELM_OBJ_PANEL_CLASS elm_obj_panel_class_get() 4#define ELM_OBJ_PANEL_CLASS elm_obj_panel_class_get()
2 5
3const Eo_Class *elm_obj_panel_class_get(void) EINA_CONST; 6const Eo_Class *elm_obj_panel_class_get(void) EINA_CONST;
@@ -85,3 +88,4 @@ enum
85 * @ingroup Panel 88 * @ingroup Panel
86 */ 89 */
87#define elm_obj_panel_toggle() ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_TOGGLE) 90#define elm_obj_panel_toggle() ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_TOGGLE)
91#endif
diff --git a/src/lib/elm_widget_panel.h b/src/lib/elm_widget_panel.h
index c72f6066e..20b901b02 100644
--- a/src/lib/elm_widget_panel.h
+++ b/src/lib/elm_widget_panel.h
@@ -17,8 +17,8 @@
17/** 17/**
18 * Base layout smart data extended with panel instance data. 18 * Base layout smart data extended with panel instance data.
19 */ 19 */
20typedef struct _Elm_Panel_Smart_Data Elm_Panel_Smart_Data; 20typedef struct _Elm_Panel_Data Elm_Panel_Data;
21struct _Elm_Panel_Smart_Data 21struct _Elm_Panel_Data
22{ 22{
23 Evas_Object *bx, *content; 23 Evas_Object *bx, *content;
24 Evas_Object *event; 24 Evas_Object *event;
@@ -34,7 +34,7 @@ struct _Elm_Panel_Smart_Data
34 */ 34 */
35 35
36#define ELM_PANEL_DATA_GET(o, sd) \ 36#define ELM_PANEL_DATA_GET(o, sd) \
37 Elm_Panel_Smart_Data * sd = eo_data_scope_get(o, ELM_OBJ_PANEL_CLASS) 37 Elm_Panel_Data * sd = eo_data_scope_get(o, ELM_OBJ_PANEL_CLASS)
38 38
39#define ELM_PANEL_DATA_GET_OR_RETURN(o, ptr) \ 39#define ELM_PANEL_DATA_GET_OR_RETURN(o, ptr) \
40 ELM_PANEL_DATA_GET(o, ptr); \ 40 ELM_PANEL_DATA_GET(o, ptr); \