[Migration] Fixed build error.
[framework/uifw/elementary.git] / src / lib / elm_main.c
index 9986f68..522f263 100644 (file)
 
 static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
 EAPI Elm_Version *elm_version = &_version;
+/**
+ * @defgroup Main Main
+ * @ingroup Elementary
+ *
+ * This group includes functions of elm_main.c
+ */
+
 
 Eina_Bool
 _elm_dangerous_call_check(const char *call)
@@ -48,6 +55,7 @@ _elm_dangerous_call_check(const char *call)
 
 /**
  * @defgroup Start Getting Started
+ * @ingroup Main
  *
  * To write an Elementary app, you can get started with the following:
  *
@@ -402,19 +410,6 @@ _prefix_shutdown(void)
    app_pfx = NULL;
 }
 
-/**
- * @defgroup General General
- */
-
-/**
- * Inititalise Elementary
- *
- * @return The init counter value.
- *
- * This call is exported only for use by the ELM_MAIN() macro. There is no
- * need to use this if you use this macro (which is highly advisable).
- * @ingroup General
- */
 EAPI int
 elm_init(int    argc,
          char **argv)
@@ -427,17 +422,6 @@ elm_init(int    argc,
    return _elm_init_count;
 }
 
-/**
- * Shut down Elementary
- *
- * @return The init counter value.
- *
- * This should be called at the end of your application just before it ceases
- * to do any more processing. This will clean up any permanent resources your
- * application may have allocated via Elementary that would otherwise persist
- * on an exit without this call.
- * @ingroup General
- */
 EAPI int
 elm_shutdown(void)
 {
@@ -632,6 +616,10 @@ elm_quicklaunch_init(int    argc,
 
    eet_init();
    ecore_init();
+
+#ifdef HAVE_ELEMENTARY_EMAP
+   emap_init();
+#endif
    ecore_app_args_set(argc, (const char **)argv);
 
    memset(_elm_policies, 0, sizeof(_elm_policies));
@@ -644,7 +632,7 @@ elm_quicklaunch_init(int    argc,
 
    if (argv) _elm_appname = strdup(ecore_file_file_get(argv[0]));
 
-   pfx = eina_prefix_new(NULL, elm_init,
+   pfx = eina_prefix_new(NULL, elm_quicklaunch_init,
                          "ELM", "elementary", "config/profile.cfg",
                          PACKAGE_LIB_DIR, /* don't have a bin dir currently */
                          PACKAGE_LIB_DIR,
@@ -769,6 +757,11 @@ elm_quicklaunch_shutdown(void)
    _elm_unneed_e_dbus();
    _elm_unneed_ethumb();
    ecore_file_shutdown();
+
+#ifdef HAVE_ELEMENTARY_EMAP
+   emap_shutdown();
+#endif
+
    ecore_shutdown();
    eet_shutdown();
 
@@ -1084,51 +1077,18 @@ elm_quicklaunch_exe_path_get(const char *exe)
    return NULL;
 }
 
-/**
- * Run the main loop
- *
- * This call should be called just after all initialization is complete. This
- * function will not return until elm_exit() is called. It will keep looping
- * running the main event/processing loop for Elementary.
- * @ingroup General
- */
 EAPI void
 elm_run(void)
 {
    ecore_main_loop_begin();
 }
 
-/**
- * Exit the main loop
- *
- * If this call is called, it will flag the main loop to cease processing and
- * return back to its parent function.
- * @ingroup General
- */
 EAPI void
 elm_exit(void)
 {
    ecore_main_loop_quit();
 }
 
-/**
- * Set new policy value.
- *
- * This will emit the ecore event ELM_EVENT_POLICY_CHANGED in the main
- * loop giving the event information Elm_Event_Policy_Changed with
- * policy identifier, new and old values.
- *
- * @param policy policy identifier as in Elm_Policy.
- * @param value policy value, depends on identifiers, usually there is
- *        an enumeration with the same prefix as the policy name, for
- *        example: ELM_POLICY_QUIT and Elm_Policy_Quit
- *        (ELM_POLICY_QUIT_NONE, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED).
- * @ingroup General
- *
- * @return @c EINA_TRUE on success or @c EINA_FALSE on error (right
- *         now just invalid policy identifier, but in future policy
- *         value might be enforced).
- */
 EAPI Eina_Bool
 elm_policy_set(unsigned int policy,
                int          value)
@@ -1155,14 +1115,6 @@ elm_policy_set(unsigned int policy,
    return EINA_TRUE;
 }
 
-/**
- * Gets the policy value set for given identifier.
- *
- * @param policy policy identifier as in Elm_Policy.
- * @ingroup General
- *
- * @return policy value. Will be 0 if policy identifier is invalid.
- */
 EAPI int
 elm_policy_get(unsigned int policy)
 {
@@ -1237,24 +1189,6 @@ elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
    elm_widget_mirrored_automatic_set(obj, automatic);
 }
 
-/**
- * @defgroup Scaling Selective Widget Scaling
- *
- * Different widgets can be scaled independently. These functions allow you to
- * manipulate this scaling on a per-widget basis. The object and all its
- * children get their scaling factors multiplied by the scale factor set.
- * This is multiplicative, in that if a child also has a scale size set it is
- * in turn multiplied by its parent's scale size. 1.0 means “don't scale”,
- * 2.0 is double size, 0.5 is half etc.
- */
-
-/**
- * Set the scaling factor
- *
- * @param obj The object
- * @param scale Scale factor (from 0.0 up, with 1.0 == no scaling)
- * @ingroup Scaling
- */
 EAPI void
 elm_object_scale_set(Evas_Object *obj,
                      double       scale)
@@ -1263,13 +1197,6 @@ elm_object_scale_set(Evas_Object *obj,
    elm_widget_scale_set(obj, scale);
 }
 
-/**
- * Get the scaling factor
- *
- * @param obj The object
- * @return The scaling factor set by elm_object_scale_set()
- * @ingroup Scaling
- */
 EAPI double
 elm_object_scale_get(const Evas_Object *obj)
 {
@@ -1277,6 +1204,20 @@ elm_object_scale_get(const Evas_Object *obj)
    return elm_widget_scale_get(obj);
 }
 
+EAPI void
+elm_object_text_part_set(Evas_Object *obj, const char *item, const char *label)
+{
+   EINA_SAFETY_ON_NULL_RETURN(obj);
+   elm_widget_text_part_set(obj, item, label);
+}
+
+EAPI const char *
+elm_object_text_part_get(const Evas_Object *obj, const char *item)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+   return elm_widget_text_part_get(obj, item);
+}
+
 /**
  * Get the global scaling factor
  *
@@ -1330,21 +1271,6 @@ elm_scale_all_set(double scale)
 #endif
 }
 
-/**
- * @defgroup Styles Styles
- *
- * Widgets can have different styles of look. These generic API's set
- * styles of widgets, if they support them (and if the theme(s) do).
- */
-
-/**
- * Set the style
- *
- * This sets the name of the style
- * @param obj The object
- * @param style The style name to use
- * @ingroup Styles
- */
 EAPI void
 elm_object_style_set(Evas_Object *obj,
                      const char  *style)
@@ -1353,17 +1279,6 @@ elm_object_style_set(Evas_Object *obj,
    elm_widget_style_set(obj, style);
 }
 
-/**
- * Get the style
- *
- * This gets the style being used for that widget. Note that the string
- * pointer is only valid as longas the object is valid and the style doesn't
- * change.
- *
- * @param obj The object
- * @return The style name
- * @ingroup Styles
- */
 EAPI const char *
 elm_object_style_get(const Evas_Object *obj)
 {
@@ -1371,15 +1286,6 @@ elm_object_style_get(const Evas_Object *obj)
    return elm_widget_style_get(obj);
 }
 
-/**
- * Set the disable state
- *
- * This sets the disable state for the widget.
- *
- * @param obj The object
- * @param disabled The state
- * @ingroup Styles
- */
 EAPI void
 elm_object_disabled_set(Evas_Object *obj,
                         Eina_Bool    disabled)
@@ -1388,15 +1294,6 @@ elm_object_disabled_set(Evas_Object *obj,
    elm_widget_disabled_set(obj, disabled);
 }
 
-/**
- * Get the disable state
- *
- * This gets the disable state for the widget.
- *
- * @param obj The object
- * @return True, if the widget is disabled
- * @ingroup Styles
- */
 EAPI Eina_Bool
 elm_object_disabled_get(const Evas_Object *obj)
 {
@@ -1406,6 +1303,7 @@ elm_object_disabled_get(const Evas_Object *obj)
 
 /**
  * @defgroup Config Elementary Config
+ * @ingroup Main
  *
  * Elementary configuration is formed by a set options bounded to a
  * given @ref Profile profile, like @ref Theme theme, @ref Fingers
@@ -1454,6 +1352,7 @@ elm_config_reload(void)
 
 /**
  * @defgroup Profile Elementary Profile
+ * @ingroup Main
  *
  * Profiles are pre-set options that affect the whole look-and-feel of
  * Elementary-based applications. There are, for example, profiles
@@ -1586,6 +1485,7 @@ elm_profile_all_set(const char *profile)
 
 /**
  * @defgroup Engine Elementary Engine
+ * @ingroup Main
  *
  * These are functions setting and querying which rendering engine
  * Elementary will use for drawing its windows' pixels.
@@ -1630,6 +1530,7 @@ elm_engine_set(const char *engine)
 
 /**
  * @defgroup Fonts Elementary Fonts
+ * @ingroup Main
  *
  * These are functions dealing with font rendering, selection and the
  * like for Elementary applications. One might fetch which system
@@ -1903,22 +1804,6 @@ elm_font_available_hash_del(Eina_Hash *hash)
    _elm_font_available_hash_del(hash);
 }
 
-/**
- * @defgroup Fingers Fingers
- *
- * Elementary is designed to be finger-friendly for touchscreens, and so in
- * addition to scaling for display resolution, it can also scale based on
- * finger "resolution" (or size).
- */
-
-/**
- * Get the configured finger size
- *
- * This gets the globally configured finger size in pixels
- *
- * @return The finger size
- * @ingroup Fingers
- */
 EAPI Evas_Coord
 elm_finger_size_get(void)
 {
@@ -1963,6 +1848,31 @@ elm_finger_size_all_set(Evas_Coord size)
 #endif
 }
 
+EAPI void
+elm_autocapitalization_allow_all_set(Eina_Bool on)
+{
+#ifdef HAVE_ELEMENTARY_X
+   static Ecore_X_Atom atom = 0;
+   unsigned int on_i = (unsigned int)on;
+
+   if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_AUTOCAPITAL_ALLOW");
+   ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
+                                  atom, &on_i, 1);
+#endif
+}
+
+EAPI void
+elm_autoperiod_allow_all_set(Eina_Bool on)
+{
+#ifdef HAVE_ELEMENTARY_X
+   static Ecore_X_Atom atom = 0;
+   unsigned int on_i = (unsigned int)on;
+
+   if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_AUTOPERIOD_ALLOW");
+   ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
+                                  atom, &on_i, 1);
+#endif
+}
 /**
  * Adjust size of an element for finger usage
  *
@@ -1991,6 +1901,7 @@ elm_coords_finger_size_adjust(int         times_w,
 
 /**
  * @defgroup Caches Caches
+ * @ingroup Main
  *
  * These are functions which let one fine-tune some cache values for
  * Elementary applications, thus allowing for performance adjustments.
@@ -2364,22 +2275,6 @@ elm_edje_collection_cache_all_set(int size)
 #endif
 }
 
-/**
- * @defgroup Focus Focus
- *
- * Objects have focus. This is what determines where the keyboard input goes to
- * within the application window.
- */
-
-/**
- * Get the focus of the object
- *
- * This gets the focused property of the object.
- *
- * @param obj The object
- * @return 1 if the object is focused, 0 if not.
- * @ingroup Focus
- */
 EAPI Eina_Bool
 elm_object_focus_get(const Evas_Object *obj)
 {
@@ -2387,14 +2282,6 @@ elm_object_focus_get(const Evas_Object *obj)
    return elm_widget_focus_get(obj);
 }
 
-/**
- * Set the focus to the object
- *
- * This sets the focus target for keyboard input to be the object indicated.
- *
- * @param obj The object
- * @ingroup Focus
- */
 EAPI void
 elm_object_focus(Evas_Object *obj)
 {
@@ -2405,15 +2292,6 @@ elm_object_focus(Evas_Object *obj)
    elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
 }
 
-/**
- * Remove the focus from the object
- *
- * This removes the focus target for keyboard input from be the object
- * indicated.
- *
- * @param obj The object
- * @ingroup Focus
- */
 EAPI void
 elm_object_unfocus(Evas_Object *obj)
 {
@@ -2422,16 +2300,6 @@ elm_object_unfocus(Evas_Object *obj)
    elm_widget_focused_object_clear(obj);
 }
 
-/**
- * Set the ability for the object to focus
- *
- * This sets the ability for the object to be able to get keyboard focus or
- * not. By default all objects are able to be focused.
- *
- * @param obj The object
- * @param enable 1 if the object can be focused, 0 if not
- * @ingroup Focus
- */
 EAPI void
 elm_object_focus_allow_set(Evas_Object *obj,
                            Eina_Bool    enable)
@@ -2440,16 +2308,6 @@ elm_object_focus_allow_set(Evas_Object *obj,
    elm_widget_can_focus_set(obj, enable);
 }
 
-/**
- * Get the ability for the object to focus
- *
- * This gets the ability for the object to be able to get keyboard focus or
- * not. By default all objects are able to be focused.
- *
- * @param obj The object
- * @return 1 if the object is allowed to be focused, 0 if not.
- * @ingroup Focus
- */
 EAPI Eina_Bool
 elm_object_focus_allow_get(const Evas_Object *obj)
 {
@@ -2645,6 +2503,7 @@ elm_focus_highlight_animate_set(Eina_Bool animate)
 
 /**
  * @defgroup Scrolling Scrolling
+ * @ingroup Main
  *
  * These are functions setting how scrollable views in Elementary
  * widgets should behave on user interaction.
@@ -3206,6 +3065,7 @@ elm_scroll_thumbscroll_border_friction_all_set(double friction)
 
 /**
  * @defgroup Scrollhints Scrollhints
+ * @ingroup Main
  *
  * Objects when inside a scroller can scroll, but this may not always be
  * desirable in certain situations. This allows an object to hint to itself
@@ -3349,14 +3209,6 @@ elm_object_scroll_freeze_pop(Evas_Object *obj)
 }
 
 /**
- * @defgroup WidgetNavigation Widget Tree Navigation.
- *
- * How to check if an Evas Object is an Elementary widget? How to get
- * the first elementary widget that is parent of the given object?
- * These are all covered in widget tree navigation.
- */
-
-/**
  * Check if the given Evas Object is an Elementary widget.
  *
  * @param obj the object to query.
@@ -3371,14 +3223,6 @@ elm_object_widget_check(const Evas_Object *obj)
    return elm_widget_is(obj);
 }
 
-/**
- * Get the first parent of the given object that is an Elementary widget.
- *
- * @param obj the object to query.
- * @return the parent object that is an Elementary widget, or @c NULL
- *         if no parent is, or no parents at all.
- * @ingroup WidgetNavigation
- */
 EAPI Evas_Object *
 elm_object_parent_widget_get(const Evas_Object *obj)
 {
@@ -3543,6 +3387,7 @@ elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *d
 
 /**
  * @defgroup Debug Debug
+ * @ingroup Main
  */
 
 /**
@@ -3574,7 +3419,7 @@ elm_object_tree_dot_dump(const Evas_Object *top,
                          const char        *file)
 {
 #ifdef ELM_DEBUG
-   FILE *f = fopen(file, "w");
+   FILE *f = fopen(file, "wb");
    elm_widget_tree_dot_dump(top, f);
    fclose(f);
 #else