evas object: Move display_mode to Efl.Gfx.Size.Hint

This commit is contained in:
Jean-Philippe Andre 2016-06-30 14:23:42 +09:00
parent 2065aedc44
commit d04ff8d69b
8 changed files with 76 additions and 36 deletions

View File

@ -244,7 +244,22 @@ interface Efl.Gfx.Size.Hint
#EVAS_HINT_FILL, to use as vertical alignment hint.]]
}
}
/* FIXME: Also add hint_display_mode? */
@property hint_display_mode {
[[A hint for an object's display mode.
These are hints on the display mode $obj. This is not a size
enforcement in any way, it's just a hint that can be used
whenever appropriate. This mode can be used object's display
mode like commpress or expand.
This is not a size enforcement in any way, it's just a hint
that can be used whenever appropriate. Very few widgets implement
support for this hint for now.
]]
values {
dispmode: Efl.Gfx.Size.Hint.Mode; [[Display mode hint.]]
}
}
}
events {
change,size,hints; [[Object size hints changed.]]

View File

@ -188,3 +188,14 @@ enum Efl.Image.Load.Error
corrupt_file = 5, [[File corrupt (but was detected as a known format)]]
unknown_format = 6 [[File is not a known format]]
}
enum Efl.Gfx.Size.Hint.Mode {
[[Display mode size hint.]]
none = 0, [[Default mode]]
compress = 1, [[Use this mode when you want to give compress display mode
hint to an object]]
expand = 2, [[Use this mode when you want to give expand display mode hint
to an object]]
dont_change = 3 [[Use this mode when an object should not change its display
mode]]
}

View File

@ -278,7 +278,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, Elm.Inter
set {
}
values {
dispmode: Evas.Display_Mode;
dispmode: Efl.Gfx.Size.Hint.Mode;
}
}
@property on_show_region_hook {

View File

@ -364,6 +364,13 @@ typedef Efl_Gfx_Size_Hint_Aspect Evas_Aspect_Control; /**< Aspect type
#define EVAS_ASPECT_CONTROL_VERTICAL EFL_GFX_SIZE_HINT_ASPECT_VERTICAL
#define EVAS_ASPECT_CONTROL_BOTH EFL_GFX_SIZE_HINT_ASPECT_BOTH
typedef Efl_Gfx_Size_Hint_Mode Evas_Display_Mode;
#define EVAS_DISPLAY_MODE_NONE EFL_GFX_SIZE_HINT_MODE_NONE
#define EVAS_DISPLAY_MODE_COMPRESS EFL_GFX_SIZE_HINT_MODE_COMPRESS
#define EVAS_DISPLAY_MODE_EXPAND EFL_GFX_SIZE_HINT_MODE_EXPAND
#define EVAS_DISPLAY_MODE_DONT_CHANGE EFL_GFX_SIZE_HINT_MODE_DONT_CHANGE
typedef Efl_Text_Bidirectional_Type Evas_BiDi_Direction;
#define EVAS_BIDI_DIRECTION_NATURAL EFL_TEXT_BIDIRECTIONAL_TYPE_NATURAL

View File

@ -1209,6 +1209,31 @@ EAPI void evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control
*/
EAPI void evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h);
/**
* @brief Sets the hints for an object's disply mode,
*
* This is not a size enforcement in any way, it's just a hint that can be used
* whenever appropriate.
*
* @param[in] dispmode Display mode hint.
*
* @ingroup Evas_Object
*/
EAPI void evas_object_size_hint_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode);
/**
* @brief Retrieves the hints for an object's display mode
*
* These are hints on the display mode @c obj. This is not a size enforcement
* in any way, it's just a hint that can be used whenever appropriate. This
* mode can be used object's display mode like commpress or expand.
*
* @return Display mode hint.
*
* @ingroup Evas_Objects
*/
EAPI Evas_Display_Mode evas_object_size_hint_display_mode_get(const Evas_Object *obj);
/**
*
* Sets the layer of its canvas that the given object will be part of.

View File

@ -404,28 +404,6 @@ abstract Efl.Canvas.Object (Eo.Base, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
parent: Efl.Canvas.Object; [[The parent smart object of $obj or $null.]]
}
}
/* FIXME: is this really necessary? */
@property size_hint_display_mode {
get {
[[Retrieves the hints for an object's display mode
These are hints on the display mode $obj. This is not a size
enforcement in any way, it's just a hint that can be used
whenever appropriate. This mode can be used object's display
mode like commpress or expand.
]]
}
set {
[[Sets the hints for an object's disply mode,
This is not a size enforcement in any way, it's just a hint
that can be used whenever appropriate.
]]
}
values {
dispmode: Evas.Display_Mode; [[Display mode hint.]]
}
}
@property paragraph_direction {
[[This handles text paragraph direction of the given object.
Even if the given object is not textblock or text, its smart child
@ -603,6 +581,8 @@ abstract Efl.Canvas.Object (Eo.Base, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
Efl.Gfx.Size.Hint.hint_align.set;
Efl.Gfx.Size.Hint.hint_align.get;
Efl.Gfx.Size.Hint.hint_combined_min.get;
Efl.Gfx.Size.Hint.hint_display_mode.set;
Efl.Gfx.Size.Hint.hint_display_mode.get;
Efl.Gfx.Size.Hint.hint_restricted_min.set;
Efl.Gfx.Size.Hint.hint_restricted_min.get;
Efl.Gfx.Size.Hint.hint_min.set;

View File

@ -1094,7 +1094,7 @@ _evas_object_size_hint_alloc(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protec
}
EOLIAN static Evas_Display_Mode
_efl_canvas_object_size_hint_display_mode_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
_efl_canvas_object_efl_gfx_size_hint_hint_display_mode_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if (!obj) return EVAS_DISPLAY_MODE_NONE;
if ((!obj->size_hints) || obj->delete_me)
@ -1103,7 +1103,7 @@ _efl_canvas_object_size_hint_display_mode_get(Eo *eo_obj EINA_UNUSED, Evas_Objec
}
EOLIAN static void
_efl_canvas_object_size_hint_display_mode_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Display_Mode dispmode)
_efl_canvas_object_efl_gfx_size_hint_hint_display_mode_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Display_Mode dispmode)
{
if (!obj) return;
if (obj->delete_me) return;
@ -2288,4 +2288,16 @@ evas_object_evas_get(const Eo *eo_obj)
return eo_provider_find((Eo *) eo_obj, EVAS_CANVAS_CLASS);
}
EAPI void
evas_object_size_hint_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode)
{
efl_gfx_size_hint_display_mode_set(obj, dispmode);
}
EAPI Evas_Display_Mode
evas_object_size_hint_display_mode_get(const Evas_Object *obj)
{
return efl_gfx_size_hint_display_mode_get(obj);
}
#include "canvas/efl_canvas_object.eo.c"

View File

@ -4,16 +4,6 @@ struct @extern Evas.Video_Surface; /* FIXME: The structure is full of the unsupp
type Evas.Modifier_Mask: ullong; [[An Evas modifier mask type]]
type Evas.Coord: int; [[A type for coordinates]]
enum Evas.Display_Mode {
none = 0, [[Default mode]]
compress = 1, [[Use this mode when you want to give compress display mode
hint to an object]]
expand = 2, [[Use this mode when you want to give expand display mode hint
to an object]]
dont_change = 3 [[Use this mode when an object should not change its display
mode]]
}
enum Evas.Text_Style_Type {
[[Types of styles to be applied on text objects. The
EVAS_TEXT_STYLE_SHADOW_DIRECTION_* ones are to be ORed together with