Elm_XXX_editable_set/get is related with drag and drop.
Elm_entry, Elm_image, Elm_photo, Elm_thumb has editable API.
If user call elm_entry_editable_set(obj, EINA_TRUE),
elm entry's content(text) can be changed into dragging text.
elm_image(photo,thumb also) is same. its content(image) also
can be changed into dragging image.
so changed for these widget to use drag_target property in evas_draggable_interface
}
EOLIAN static void
-_elm_entry_editable_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool editable)
+_elm_entry_evas_draggable_interface_drag_target_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool editable)
{
if (sd->editable == editable) return;
sd->editable = editable;
}
EOLIAN static Eina_Bool
-_elm_entry_editable_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
+_elm_entry_evas_draggable_interface_drag_target_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
return sd->editable;
}
return ret ? strdup(ret) : NULL;
}
+/* Legacy deprecated functions */
+EAPI void
+elm_entry_editable_set(Evas_Object *obj, Eina_Bool edit)
+{
+ evas_draggable_interface_drag_target_set(obj, edit);
+}
+
+EAPI Eina_Bool
+elm_entry_editable_get(const Evas_Object *obj)
+{
+ return evas_draggable_interface_drag_target_get(obj);
+}
+
#include "elm_entry.eo.c"
class Elm.Entry (Elm.Layout, Elm.Interface_Scrollable, Evas.Clickable_Interface,
Elm.Interface_Atspi_Text, Elm.Interface_Atspi_Editable_Text, Efl.File,
- Evas.Selectable_Interface, Evas.Scrollable_Interface)
+ Evas.Selectable_Interface, Evas.Scrollable_Interface,
+ Evas.Draggable_Interface)
{
eo_prefix: elm_obj_entry;
methods {
autocapital_type: Elm.Autocapital.Type; [[The type of autocapitalization.]]
}
}
- @property editable {
- set {
- [[Sets if the entry is to be editable or not.
-
- By default, entries are editable and when focused, any text input by the
- user will be inserted at the current cursor position. But calling this
- function with $editable as $false will prevent the user from
- inputting text into the entry.
-
- The only way to change the text of a non-editable entry is to use
- \@ref elm_object_text_set, \@ref elm_entry_entry_insert and other related
- functions.
- ]]
- }
- get {
- [[Get whether the entry is editable or not.]]
- }
- values {
- editable: bool; [[If $true, user input will be inserted in the entry,
- if not, the entry is read-only and no user input is allowed.]]
- }
- }
@property anchor_hover_style {
set {
[[Set the style that the hover should use
Evas.Object_Smart.del;
Evas.Object_Smart.show;
Evas.Object_Smart.hide;
+ Evas.Draggable_Interface.drag_target.set;
+ Evas.Draggable_Interface.drag_target.get;
Elm.Widget.activate;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.theme_apply;
* @param[out] format The file format
*/
EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format);
+
+/**
+ * @brief Sets if the entry is to be editable or not.
+ *
+ * By default, entries are editable and when focused, any text input by the
+ * user will be inserted at the current cursor position. But calling this
+ * function with @c editable as @c false will prevent the user from inputting
+ * text into the entry.
+ *
+ * The only way to change the text of a non-editable entry is to use @ref
+ * elm_object_text_set, @ref elm_entry_entry_insert and other related
+ * functions.
+ *
+ * @param[in] editable If @c true, user input will be inserted in the entry, if
+ * not, the entry is read-only and no user input is allowed.
+ *
+ * @ingroup Elm_Entry
+ */
+EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable);
+
+/**
+ * @brief Get whether the entry is editable or not.
+ *
+ * @return If @c true, user input will be inserted in the entry, if not, the
+ * entry is read-only and no user input is allowed.
+ *
+ * @ingroup Elm_Entry
+ */
+EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj);
* Turns on editing through drag and drop and copy and paste.
*/
EOLIAN static void
-_elm_image_editable_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool edit)
+_elm_image_evas_draggable_interface_drag_target_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool edit)
{
if (sd->edje)
{
}
EOLIAN static Eina_Bool
-_elm_image_editable_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
+_elm_image_evas_draggable_interface_drag_target_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
{
return sd->edit;
}
// A11Y - END
+/* Legacy deprecated functions */
+EAPI void
+elm_image_editable_set(Evas_Object *obj, Eina_Bool edit)
+{
+ evas_draggable_interface_drag_target_set(obj, edit);
+}
+
+EAPI Eina_Bool
+elm_image_editable_get(const Evas_Object *obj)
+{
+ return evas_draggable_interface_drag_target_get(obj);
+}
+
#include "elm_image.eo.c"
}
class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface,
- Edje.Object, Efl.Image,
+ Edje.Object, Efl.Image, Evas.Draggable_Interface,
Elm.Interface_Atspi_Image, Elm.Interface_Atspi_Widget_Action,
Efl.Player)
{
eo_prefix: elm_obj_image;
methods {
- @property editable {
- [[Contrtol if thhe image is 'editable'.
-
- This means the image is a valid drag target for drag and drop, and can be
- cut or pasted too.]]
- set {
- }
- get {
- }
- values {
- set: bool; [[Turn on or off editability. Default is $false.]]
- }
- }
@property resize_down {
[[Control whether the object's image can be resized to a size smaller than the original one.
Evas.Object_Smart.del;
Evas.Object_Smart.member_add;
Evas.Object_Smart.resize;
+ Evas.Draggable_Interface.drag_target.set;
+ Evas.Draggable_Interface.drag_target.get;
Elm.Widget.theme_apply;
Elm.Widget.event;
Elm.Interface_Atspi_Image.extents.get;
*/
EAPI Eina_Bool elm_image_animated_available_get(const Evas_Object *obj);
+/**
+ * @brief Contrtol if the image is 'editable'.
+ *
+ * This means the image is a valid drag target for drag and drop, and can be
+ * cut or pasted too.
+ *
+ * @param[in] set Turn on or off editability. Default is @c false.
+ *
+ * @ingroup Elm_Image
+ */
+EAPI void elm_image_editable_set(Evas_Object *obj, Eina_Bool set);
+
+/**
+ * @brief Contrtol if the image is 'editable'.
+ *
+ * This means the image is a valid drag target for drag and drop, and can be
+ * cut or pasted too.
+ *
+ * @return Turn on or off editability. Default is @c false.
+ *
+ * @ingroup Elm_Image
+ */
+EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj);
#include "elm_image.eo.legacy.h"
}
EOLIAN static void
-_elm_photo_editable_set(Eo *obj EINA_UNUSED, Elm_Photo_Data *sd, Eina_Bool set)
+_elm_photo_evas_draggable_interface_drag_target_set(Eo *obj EINA_UNUSED, Elm_Photo_Data *sd, Eina_Bool set)
{
elm_image_editable_set(sd->icon, set);
}
EOLIAN static Eina_Bool
-_elm_photo_editable_get(Eo *obj EINA_UNUSED, Elm_Photo_Data *sd)
+_elm_photo_evas_draggable_interface_drag_target_get(Eo *obj EINA_UNUSED, Elm_Photo_Data *sd)
{
return elm_image_editable_get(sd->icon);
}
return efl_file_set((Eo *) obj, file, NULL);
}
+/* Legacy deprecated functions */
+EAPI void
+elm_photo_editable_set(Evas_Object *obj, Eina_Bool edit)
+{
+ evas_draggable_interface_drag_target_set(obj, edit);
+}
+
+EAPI Eina_Bool
+elm_photo_editable_get(const Evas_Object *obj)
+{
+ return evas_draggable_interface_drag_target_get(obj);
+}
+
#include "elm_photo.eo.c"
{
eo_prefix: elm_obj_photo;
methods {
- @property editable {
- set {
- [[Set editability of the photo.
-
- An editable photo can be dragged to or from, and can be cut or
- pasted too. Note that pasting an image or dropping an item on
- the image will delete the existing content.
- ]]
- }
- get {
- [[Get editability of the photo.]]
- }
- values {
- set: bool; [[To set of clear editability.]]
- }
- }
@property fill_inside {
set {
[[Set if the photo should be completely visible or not.]]
Efl.File.file.set;
Evas.Object_Smart.add;
Evas.Object_Smart.del;
+ Evas.Draggable_Interface.drag_target.set;
+ Evas.Draggable_Interface.drag_target.get;
Elm.Widget.theme_apply;
}
*/
EAPI Eina_Bool elm_photo_file_set(Eo *obj, const char *file);
+/**
+ * Set editability of the photo.
+ *
+ * An editable photo can be dragged to or from, and can be cut or pasted too.
+ * Note that pasting an image or dropping an item on the image will delete the
+ * existing content.
+ *
+ * @param[in] set To set of clear editability.
+ *
+ * @ingroup Elm_Photo
+ */
+EAPI void elm_photo_editable_set(Evas_Object *obj, Eina_Bool set);
+
+/**
+ * Get editability of the photo.
+ *
+ * @return To set of clear editability.
+ *
+ * @ingroup Elm_Photo
+ */
+EAPI Eina_Bool elm_photo_editable_get(const Evas_Object *obj);
#include "elm_photo.eo.legacy.h"
return _elm_ethumb_connected;
}
-EOLIAN static Eina_Bool
-_elm_thumb_editable_set(Eo *obj, Elm_Thumb_Data *sd, Eina_Bool edit)
+EOLIAN static void
+_elm_thumb_evas_draggable_interface_drag_target_set(Eo *obj, Elm_Thumb_Data *sd, Eina_Bool edit)
{
edit = !!edit;
- if (sd->edit == edit) return EINA_TRUE;
+ if (sd->edit == edit) return;
sd->edit = edit;
if (sd->edit)
NULL, NULL,
_elm_thumb_dnd_cb, obj);
- return EINA_TRUE;
+ return;
}
EOLIAN static Eina_Bool
-_elm_thumb_editable_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd)
+_elm_thumb_evas_draggable_interface_drag_target_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd)
{
return sd->edit;
}
efl_file_get((Eo *) obj, file, key);
}
+/* Legacy deprecated functions */
+EAPI Eina_Bool
+elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit)
+{
+ evas_draggable_interface_drag_target_set(obj, edit);
+ return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+elm_thumb_editable_get(const Evas_Object *obj)
+{
+ return evas_draggable_interface_drag_target_get(obj);
+}
#include "elm_thumb.eo.c"
last
}
-class Elm.Thumb (Elm.Layout, Efl.File, Evas.Clickable_Interface)
+class Elm.Thumb (Elm.Layout, Efl.File, Evas.Clickable_Interface,
+ Evas.Draggable_Interface)
{
eo_prefix: elm_obj_thumb;
methods {
orient: Ethumb_Thumb_Orientation; [[The orientation setting.]]
}
}
- @property editable {
- set {
- [[Make the thumbnail 'editable'.
-
- This means the thumbnail is a valid drag target for drag and
- drop, and can be cut or pasted too.
- ]]
- return: bool;
- }
- get {
- [[Get whether the thumbnail is editable.
-
- This means the thumbnail is a valid drag target for drag and
- drop, and can be cut or pasted too.
- ]]
- }
- values {
- edit: bool; [[The editable state, default is $false.]]
- }
- }
@property aspect {
set {
[[Set the aspect for the thumb object.
Evas.Object_Smart.add;
Evas.Object_Smart.del;
Evas.Object_Smart.show;
+ Evas.Draggable_Interface.drag_target.set;
+ Evas.Draggable_Interface.drag_target.get;
}
events {
generate,error;
*/
EAPI void elm_thumb_file_get(const Eo *obj, const char **file, const char **key);
+/**
+ * @brief Make the thumbnail 'editable'.
+ *
+ * This means the thumbnail is a valid drag target for drag and drop, and can
+ * be cut or pasted too.
+ *
+ * @param[in] edit The editable state, default is @c false.
+ *
+ * @ingroup Elm_Thumb
+ */
+EAPI Eina_Bool elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit);
+
+/**
+ * @brief Get whether the thumbnail is editable.
+ *
+ * This means the thumbnail is a valid drag target for drag and drop, and can
+ * be cut or pasted too.
+ *
+ * @return The editable state, default is @c false.
+ *
+ * @ingroup Elm_Thumb
+ */
+EAPI Eina_Bool elm_thumb_editable_get(const Evas_Object *obj);
#include "elm_thumb.eo.legacy.h"