2016-03-10 23:13:13 -08:00
|
|
|
import efl_gfx_types;
|
2018-11-28 04:33:46 -08:00
|
|
|
import eina_types;
|
2016-03-10 23:13:13 -08:00
|
|
|
|
2019-03-08 06:55:43 -08:00
|
|
|
enum @beta Efl.Gfx.Image_Content_Hint
|
2016-03-10 20:59:14 -08:00
|
|
|
{
|
|
|
|
[[How an image's data is to be treated by EFL, for optimization.]]
|
|
|
|
none = 0, [[No hint on the content (default).]]
|
|
|
|
dynamic = 1, [[The content will change over time.]]
|
|
|
|
static = 2 [[The content won't change over time.]]
|
|
|
|
}
|
|
|
|
|
2019-03-08 06:55:43 -08:00
|
|
|
enum @beta Efl.Gfx.Image_Scale_Hint
|
2016-03-10 20:59:14 -08:00
|
|
|
{
|
|
|
|
/* FIXME: Legacy is in Emile, where it does not belong. */
|
|
|
|
[[How an image's data is to be treated by EFL, with regard to scaling cache.]]
|
|
|
|
none = 0, [[No hint on the scaling (default).]]
|
|
|
|
dynamic = 1, [[Image will be re-scaled over time, thus turning scaling cache OFF for its data.]]
|
|
|
|
static = 2 [[Image will not be re-scaled over time, thus turning scaling cache ON for its data.]]
|
|
|
|
}
|
|
|
|
|
2019-03-08 06:55:43 -08:00
|
|
|
enum @beta Efl.Gfx.Image_Scale_Type
|
2017-12-17 20:55:25 -08:00
|
|
|
{
|
|
|
|
[[Enumeration that defines scale types of an image.]]
|
2019-01-18 05:29:31 -08:00
|
|
|
fill, [[Scale the image so that it matches
|
2017-12-17 20:55:25 -08:00
|
|
|
the object's area exactly.
|
|
|
|
The image's aspect ratio might be changed.]]
|
|
|
|
fit_inside, [[Scale the image
|
|
|
|
so that it fits inside the object's area
|
|
|
|
while maintaining the aspect ratio.
|
|
|
|
At least one of the dimensions of the image
|
2019-01-18 05:29:31 -08:00
|
|
|
should be equal to the corresponding dimension
|
2017-12-17 20:55:25 -08:00
|
|
|
of the object.]]
|
|
|
|
fit_outside, [[Scale the image
|
|
|
|
so that it covers the entire object area
|
|
|
|
while maintaining the aspect ratio.
|
|
|
|
At least one of the dimensions of the image
|
2019-01-18 05:29:31 -08:00
|
|
|
should be equal to the corresponding
|
2017-12-17 20:55:25 -08:00
|
|
|
dimension of the object.]]
|
|
|
|
tile, [[Tile image at its original size.]]
|
|
|
|
none [[Not scale the image]]
|
|
|
|
}
|
|
|
|
|
2019-05-08 17:54:55 -07:00
|
|
|
struct Efl.Gfx.Image.Stretch_Region
|
|
|
|
{
|
|
|
|
[[This struct holds the description of a stretchable region in one dimension (vertical or horizontal).
|
|
|
|
Used when scaling an image.
|
|
|
|
|
|
|
|
$offset + $length should be smaller than image size in that dimension.
|
|
|
|
]]
|
|
|
|
offset: uint; [[First pixel of the stretchable region, starting at 0.]]
|
|
|
|
length: uint; [[Length of the stretchable region in pixels.]]
|
|
|
|
}
|
|
|
|
|
2019-02-14 08:37:02 -08:00
|
|
|
interface @beta Efl.Gfx.Image
|
2016-03-02 03:46:11 -08:00
|
|
|
{
|
|
|
|
[[Common APIs for all 2D images that can be rendered on the canvas.]]
|
2016-03-01 23:38:57 -08:00
|
|
|
|
2016-03-02 03:46:11 -08:00
|
|
|
methods {
|
2015-05-07 08:36:45 -07:00
|
|
|
@property smooth_scale {
|
2016-03-01 23:38:57 -08:00
|
|
|
[[Whether to use high-quality image scaling algorithm for this image.
|
2014-07-23 09:03:40 -07:00
|
|
|
|
2016-03-01 23:38:57 -08:00
|
|
|
When enabled, a higher quality image scaling algorithm is used
|
|
|
|
when scaling images to sizes other than the source image's
|
|
|
|
original one. This gives better results but is more
|
|
|
|
computationally expensive.
|
|
|
|
|
|
|
|
$true by default
|
|
|
|
]]
|
|
|
|
set {}
|
|
|
|
get {}
|
2014-07-23 09:03:40 -07:00
|
|
|
values {
|
2015-06-16 07:41:48 -07:00
|
|
|
smooth_scale: bool; [[Whether to use smooth scale or not.]]
|
2014-07-23 09:03:40 -07:00
|
|
|
}
|
|
|
|
}
|
2017-12-17 20:55:25 -08:00
|
|
|
@property scale_type {
|
|
|
|
[[Control how the image is scaled.]]
|
|
|
|
values {
|
2018-04-19 04:26:59 -07:00
|
|
|
scale_type: Efl.Gfx.Image_Scale_Type; [[Image scale type]]
|
2017-12-17 20:55:25 -08:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 08:36:45 -07:00
|
|
|
@property ratio {
|
2016-03-02 02:39:41 -08:00
|
|
|
[[The native width/height ratio of the image.]]
|
2014-08-06 04:24:41 -07:00
|
|
|
get {
|
2016-03-02 02:39:41 -08:00
|
|
|
[[Returns 1.0 if not applicable (eg. height = 0).]]
|
2014-08-06 04:24:41 -07:00
|
|
|
}
|
|
|
|
values {
|
2016-03-02 02:39:41 -08:00
|
|
|
ratio: double; [[The image's ratio.]]
|
2014-08-06 04:24:41 -07:00
|
|
|
}
|
|
|
|
}
|
2019-05-30 11:22:42 -07:00
|
|
|
@property content_region {
|
|
|
|
[[Return the relative area enclosed inside the image where content is expected.
|
|
|
|
|
|
|
|
We do expect content to be inside the limit defined by the border. If no border
|
|
|
|
is set, they are assumed to be zero and the full object geometry is where content
|
|
|
|
can be layout on top. The area size change with the object size.
|
|
|
|
|
|
|
|
The geometry of the area is expressed relative to the geometry of the object.
|
|
|
|
]]
|
|
|
|
get { }
|
|
|
|
values {
|
|
|
|
region: Eina.Rect; [[A rectangle inside the object boundary that where content is expected.]]
|
|
|
|
}
|
|
|
|
}
|
2016-03-02 03:46:11 -08:00
|
|
|
@property border {
|
|
|
|
[[Dimensions of this image's border, a region that does not scale
|
|
|
|
with the center area.
|
|
|
|
|
|
|
|
When EFL renders an image, its source may be scaled to fit
|
|
|
|
the size of the object. This function sets an area from
|
|
|
|
the borders of the image inwards which is not to be scaled.
|
|
|
|
This function is useful for making frames and for widget
|
|
|
|
theming, where, for example, buttons may be of varying
|
|
|
|
sizes, but their border size must remain constant.
|
|
|
|
|
|
|
|
The units used for $l, $r, $t and $b are canvas units (pixels).
|
|
|
|
|
|
|
|
Note: The border region itself may be scaled by the
|
|
|
|
@.border_scale.set function.
|
|
|
|
|
|
|
|
Note: By default, image objects have no borders set, i.e.
|
|
|
|
$l, $r, $t and $b start as 0.
|
|
|
|
|
|
|
|
Note: Similar to the concepts of 9-patch images or cap insets.
|
|
|
|
]]
|
|
|
|
set {}
|
|
|
|
get {}
|
|
|
|
values {
|
|
|
|
l: int; [[The border's left width.]]
|
|
|
|
r: int; [[The border's right width.]]
|
|
|
|
t: int; [[The border's top height.]]
|
|
|
|
b: int; [[The border's bottom height.]]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@property border_scale {
|
|
|
|
[[Scaling factor applied to the image borders.
|
|
|
|
|
|
|
|
This value multiplies the size of the @.border when scaling an
|
|
|
|
object.
|
|
|
|
|
|
|
|
Default value is 1.0 (no scaling).
|
|
|
|
]]
|
|
|
|
set {}
|
|
|
|
get {}
|
|
|
|
values {
|
|
|
|
scale: double; [[The scale factor.]]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@property border_center_fill {
|
|
|
|
[[Specifies how the center part of the object (not the borders)
|
|
|
|
should be drawn when EFL is rendering it.
|
|
|
|
|
|
|
|
This function sets how the center part of the image object's
|
|
|
|
source image is to be drawn, which must be one of the values
|
|
|
|
in @Efl.Gfx.Border_Fill_Mode. By center we mean the complementary
|
|
|
|
part of that defined by @.border.set. This is very useful for
|
|
|
|
making frames and decorations. You would most probably also be
|
2016-03-17 19:50:48 -07:00
|
|
|
using a filled image (as in @Efl.Gfx.Fill.fill_auto) to use as a frame.
|
2016-03-02 03:46:11 -08:00
|
|
|
|
|
|
|
The default value is @Efl.Gfx.Border_Fill_Mode.default, ie. render
|
|
|
|
and scale the center area, respecting its transparency.
|
|
|
|
]]
|
|
|
|
set {}
|
|
|
|
get {}
|
|
|
|
values {
|
|
|
|
fill: Efl.Gfx.Border_Fill_Mode; [[Fill mode of the center region.]]
|
|
|
|
}
|
|
|
|
}
|
2019-05-08 17:54:55 -07:00
|
|
|
@property stretch_region {
|
|
|
|
[[This property defines the stretchable pixels region of an image.
|
|
|
|
|
|
|
|
When the regions are set by the user, the method will walk the iterators
|
|
|
|
once and then destroy them. When the regions are retrieved by the user,
|
|
|
|
it is his responsibility to destroy the iterators.. It will remember the
|
|
|
|
information for the lifetime of the object. It will ignore all value
|
|
|
|
of @.border, @.border_scale and @.border_center_fill . To reset the object
|
|
|
|
you can just pass $null to both horizontal and vertical at the same
|
|
|
|
time.
|
|
|
|
]]
|
|
|
|
set {
|
|
|
|
return: Eina.Error; [[return an error code if the stretch_region provided are incorrect.]]
|
|
|
|
}
|
|
|
|
get {}
|
|
|
|
values {
|
|
|
|
horizontal: iterator<ptr(Efl.Gfx.Image.Stretch_Region)>; [[Representation of area that are stretchable in the image horizontal space.]]
|
|
|
|
vertical: iterator<ptr(Efl.Gfx.Image.Stretch_Region)>; [[Representation of area that are stretchable in the image vertical space.]]
|
|
|
|
}
|
|
|
|
}
|
2017-05-23 23:07:21 -07:00
|
|
|
@property image_size {
|
|
|
|
[[This represents the size of the original image in pixels.
|
|
|
|
|
|
|
|
This may be different from the actual geometry on screen or even
|
|
|
|
the size of the loaded pixel buffer. This is the size of the image
|
|
|
|
as stored in the original file.
|
|
|
|
|
|
|
|
This is a read-only property, and may return 0x0.
|
|
|
|
]]
|
|
|
|
get {}
|
|
|
|
values {
|
2017-09-18 04:49:56 -07:00
|
|
|
size: Eina.Size2D; [[The size in pixels.]]
|
2017-05-23 23:07:21 -07:00
|
|
|
}
|
|
|
|
}
|
2016-03-10 20:59:14 -08:00
|
|
|
|
2018-04-19 04:26:59 -07:00
|
|
|
/* Note: those are obscure features of evas image. Expose in Efl.Gfx.Image? */
|
2016-03-10 20:59:14 -08:00
|
|
|
@property content_hint {
|
|
|
|
set {
|
|
|
|
[[Set the content hint setting of a given image object of the
|
|
|
|
canvas.
|
|
|
|
|
|
|
|
This function sets the content hint value of the given image
|
|
|
|
of the canvas. For example, if you're on the GL engine and
|
|
|
|
your driver implementation supports it, setting this hint to
|
|
|
|
#EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need zero copies
|
|
|
|
at texture upload time, which is an "expensive" operation.
|
|
|
|
]]
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
[[Get the content hint setting of a given image object of the
|
|
|
|
canvas.
|
|
|
|
|
|
|
|
This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.
|
|
|
|
]]
|
|
|
|
}
|
|
|
|
values {
|
2018-04-19 04:26:59 -07:00
|
|
|
hint: Efl.Gfx.Image_Content_Hint; [[Dynamic or static content hint,
|
|
|
|
see @Efl.Gfx.Image_Content_Hint]]
|
2016-03-10 20:59:14 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property scale_hint {
|
|
|
|
set {
|
|
|
|
[[Set the scale hint of a given image of the canvas.
|
|
|
|
|
|
|
|
This function sets the scale hint value of the given image
|
|
|
|
object in the canvas, which will affect how Evas is to cache
|
|
|
|
scaled versions of its original source image.
|
|
|
|
]]
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
[[Get the scale hint of a given image of the canvas.
|
|
|
|
|
|
|
|
This function returns the scale hint value of the given image
|
|
|
|
object of the canvas.
|
|
|
|
]]
|
|
|
|
}
|
|
|
|
values {
|
2018-04-19 04:26:59 -07:00
|
|
|
hint: Efl.Gfx.Image_Scale_Hint; [[Scalable or static size hint,
|
|
|
|
see @Efl.Gfx.Image_Scale_Hint]]
|
2016-03-10 20:59:14 -08:00
|
|
|
}
|
|
|
|
}
|
2019-02-27 10:17:09 -08:00
|
|
|
@property image_load_error {
|
|
|
|
get {
|
|
|
|
[[Gets the (last) file loading error for a given object.]]
|
|
|
|
}
|
|
|
|
values {
|
2019-03-04 10:36:57 -08:00
|
|
|
error: Eina.Error; [[The load error code.]]
|
2019-02-27 10:17:09 -08:00
|
|
|
}
|
|
|
|
}
|
2014-07-23 09:03:40 -07:00
|
|
|
}
|
2016-06-13 22:24:43 -07:00
|
|
|
events {
|
2019-03-08 07:54:52 -08:00
|
|
|
image,preload: void; [[Image data has been preloaded.]]
|
|
|
|
image,resize: void; [[Image was resized (its pixel data).]]
|
|
|
|
image,unload: void; [[Image data has been unloaded (by some mechanism in
|
efl: Add missing event types
Summary:
All events must have a type now, otherwise bindings don't know how to handle
the event_info field.
Most of the missing event types were actually "void" (no event_info present).
Some struct definitions had to be moved to eo instead of h files, so they
are available to bindings. Some have not, and are marked with FIXME.
Some namespaces have been fixed (like Efl_Event_Cb -> Efl.Event_Cb).
In general, there are hundreds of changed files, but mostly to add a type which
was not present before, so there's no harm done.
Also, A lot of FIXMEs have been added which should be, like, fixed.
For example, some events can send different types of event_info, which is
very inconvenient (and error prone).
Test Plan: make with c# bindings works, make check and make examples work too.
Reviewers: cedric, q66, lauromoura
Subscribers: zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6169
2018-05-11 08:20:40 -07:00
|
|
|
EFL that threw out the original image data).]]
|
2016-06-13 22:24:43 -07:00
|
|
|
}
|
2014-07-23 09:03:40 -07:00
|
|
|
}
|