[*][Scroller] merge from upstream revision 64051, but didn't accept data/theme/widget...
[framework/uifw/elementary.git] / src / lib / elm_main.c
index 52c1905..f973501 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:
  *
@@ -608,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));
@@ -745,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();
 
@@ -1187,6 +1204,41 @@ 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 *part, const char *label)
+{
+   EINA_SAFETY_ON_NULL_RETURN(obj);
+   elm_widget_text_part_set(obj, part, label);
+}
+
+EAPI const char *
+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, 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);
+}
+
 /**
  * Get the global scaling factor
  *
@@ -1240,14 +1292,34 @@ elm_scale_all_set(double scale)
 #endif
 }
 
-/**
- * Set the style
- *
- * This sets the name of the style
- * @param obj The object
- * @param style The style name to use
- * @ingroup Styles
- */
+EAPI Eina_Bool
+elm_password_show_last_get(void)
+{
+   return _elm_config->password_show_last;
+}
+
+EAPI void
+elm_password_show_last_set(Eina_Bool password_show_last)
+{
+   if (_elm_config->password_show_last == password_show_last) return;
+   _elm_config->password_show_last = password_show_last;
+   edje_password_show_last_set(_elm_config->password_show_last);
+}
+
+EAPI double
+elm_password_show_last_timeout_get(void)
+{
+   return _elm_config->password_show_last_timeout;
+}
+
+EAPI void
+elm_password_show_last_timeout_set(double password_show_last_timeout)
+{
+   if (_elm_config->password_show_last_timeout == password_show_last_timeout) return;
+   _elm_config->password_show_last_timeout = password_show_last_timeout;
+   edje_password_show_last_timeout_set(_elm_config->password_show_last_timeout);
+}
+
 EAPI void
 elm_object_style_set(Evas_Object *obj,
                      const char  *style)
@@ -1256,17 +1328,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)
 {
@@ -1291,6 +1352,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
@@ -1339,6 +1401,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
@@ -1471,6 +1534,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.
@@ -1515,6 +1579,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
@@ -1833,6 +1898,45 @@ elm_finger_size_all_set(Evas_Coord size)
 }
 
 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
+ *
+ * This takes width and height sizes (in pixels) as input and a size multiple
+ * (which is how many fingers you want to place within the area), and adjusts
+ * the size tobe large enough to accommodate finger. On return the w and h
+ * sizes poiner do by these parameters will be modified.
+ *
+ * @param times_w How many fingers should fit horizontally
+ * @param w Pointer to the width size to adjust
+ * @param times_h How many fingers should fit vertically
+ * @param h Pointer to the height size to adjust
+ * @ingroup Fingers
+ */
+EAPI void
 elm_coords_finger_size_adjust(int         times_w,
                               Evas_Coord *w,
                               int         times_h,
@@ -1846,6 +1950,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.
@@ -2393,6 +2498,21 @@ elm_object_focus_direction_go(Evas_Object *obj,
    elm_widget_focus_direction_go(obj, x, y);
 }
 
+EAPI void
+elm_object_tree_unfocusable_set(Evas_Object *obj,
+                                Eina_Bool    tree_unfocusable)
+{
+   EINA_SAFETY_ON_NULL_RETURN(obj);
+   elm_widget_tree_unfocusable_set(obj, tree_unfocusable);
+}
+
+EAPI Eina_Bool
+elm_object_tree_unfocusable_get(const Evas_Object *obj)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
+   return elm_widget_tree_unfocusable_get(obj);
+}
+
 /**
  * Get the enable status of the focus highlight
  *
@@ -2447,6 +2567,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.
@@ -3006,8 +3127,47 @@ elm_scroll_thumbscroll_border_friction_all_set(double friction)
 #endif
 }
 
+EAPI double
+elm_scroll_thumbscroll_sensitivity_friction_get(void)
+{
+   return _elm_config->thumbscroll_sensitivity_friction;
+}
+
+EAPI void
+elm_scroll_thumbscroll_sensitivity_friction_set(double friction)
+{
+   if (friction < 0.1)
+     friction = 0.1;
+
+   if (friction > 1.0)
+     friction = 1.0;
+
+   _elm_config->thumbscroll_friction = friction;
+}
+
+EAPI void
+elm_scroll_thumbscroll_sensitivity_friction_all_set(double friction)
+{
+   if (friction < 0.1)
+     friction = 0.1;
+
+   if (friction > 1.0)
+     friction = 1.0;
+
+#ifdef HAVE_ELEMENTARY_X
+   static Ecore_X_Atom atom = 0;
+   unsigned int sensitivity_friction_i = (unsigned int)(friction * 1000.0);
+
+   if (!atom)
+     atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_SENSITIVITY_FRICTION");
+   ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
+                                  atom, &sensitivity_friction_i, 1);
+#endif
+}
+
 /**
  * @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
@@ -3329,6 +3489,7 @@ elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *d
 
 /**
  * @defgroup Debug Debug
+ * @ingroup Main
  */
 
 /**
@@ -3393,3 +3554,44 @@ elm_longpress_timeout_get(void)
 {
    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);
+}