elementary/map - map supports language,changed
[framework/uifw/elementary.git] / src / lib / elm_container.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3 #include "elm_widget_container.h"
4
5 static const char CONTAINER_SMART_NAME[] = "elm_container";
6
7 /* Elementary smart class for all widgets containing others */
8 EVAS_SMART_SUBCLASS_NEW
9   (CONTAINER_SMART_NAME, _elm_container, Elm_Container_Smart_Class,
10   Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
11
12 /* no *direct* instantiation of this class, so far */
13 __UNUSED__ static Evas_Smart *_elm_container_smart_class_new(void);
14
15 static Eina_Bool
16 _unimplemented_smart_content_set(Evas_Object *obj,
17                                  const char *name __UNUSED__,
18                                  Evas_Object *content __UNUSED__)
19 {
20     WRN("The %s widget does not implement the \"content_set()\" function.",
21          elm_widget_type_get(obj));
22
23     return EINA_FALSE;
24 }
25
26 static Evas_Object *
27 _unimplemented_smart_content_get(const Evas_Object *obj,
28                                  const char *name __UNUSED__)
29 {
30     WRN("The %s widget does not implement the \"content_get()\" function.",
31          elm_widget_type_get(obj));
32
33     return NULL;
34 }
35
36 static Evas_Object *
37 _unimplemented_smart_content_unset(Evas_Object *obj,
38                                    const char *name __UNUSED__)
39 {
40     WRN("The %s widunset does not implement the \"content_unset()\" function.",
41          elm_widget_type_get(obj));
42
43     return NULL;
44 }
45
46 EAPI const Elm_Container_Smart_Class *
47 elm_container_smart_class_get(void)
48 {
49    static Elm_Container_Smart_Class _sc =
50      ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(CONTAINER_SMART_NAME);
51    static const Elm_Container_Smart_Class *class = NULL;
52
53    if (class)
54      return class;
55
56    _elm_container_smart_set(&_sc);
57    class = &_sc;
58
59    return class;
60 }
61
62 static void
63 _elm_container_smart_set_user(Elm_Container_Smart_Class *sc)
64 {
65    sc->content_set = _unimplemented_smart_content_set;
66    sc->content_get = _unimplemented_smart_content_get;
67    sc->content_unset = _unimplemented_smart_content_unset;
68 }