Efl: Eo-ify remaining Efl.Gfx enums and structs

This commit is contained in:
Jean-Philippe Andre 2016-02-03 18:23:45 +09:00
parent 757f842992
commit 1ac79c3b13
4 changed files with 152 additions and 157 deletions

View File

@ -23,7 +23,12 @@ efl_eolian_files = \
$(efl_eolian_legacy_files) \
$(NULL)
efl_eolian_files_h = $(efl_eolian_files:%.eo=%.eo.h)
efl_eolian_type_files = \
lib/efl/interfaces/efl_gfx_types.eot \
$(NULL)
efl_eolian_files_h = $(efl_eolian_files:%.eo=%.eo.h) \
$(efl_eolian_type_files:%.eot=%.eot.h)
efl_eolian_files_c = $(efl_eolian_files:%.eo=%.eo.c)
efl_eolian_legacy_files_h = $(efl_eolian_legacy_files:%.eo=%.eo.legacy.h)
@ -40,10 +45,11 @@ CLEANFILES += \
EXTRA_DIST += \
lib/efl/Efl_Config.h \
lib/efl/Efl.h \
$(efl_eolian_files)
$(efl_eolian_files) \
$(efl_eolian_type_files)
efleolianfilesdir = $(datadir)/eolian/include/efl-@VMAJ@
efleolianfiles_DATA = $(efl_eolian_files)
efleolianfiles_DATA = $(efl_eolian_files) $(efl_eolian_type_files)
lib_LTLIBRARIES += lib/efl/libefl.la

View File

@ -33,140 +33,16 @@ extern "C" {
# endif
#endif /* ! _WIN32 */
/**
* These values determine how the points are interpreted in a stream of points.
*
* @since 1.14
*/
typedef enum _Efl_Gfx_Path_Command
{
EFL_GFX_PATH_COMMAND_TYPE_END = 0, /**< The end of stream , no more points to process. */
EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO, /**< The next point is the start point of a sub path */
EFL_GFX_PATH_COMMAND_TYPE_LINE_TO, /**< The next point is used to draw a line from current point */
EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO, /**< The next three point is used to draw a cubic bezier curve from current point */
EFL_GFX_PATH_COMMAND_TYPE_CLOSE, /**< Close the curent subpath by drawing a line between current point and the first point of current subpath */
EFL_GFX_PATH_COMMAND_TYPE_LAST, /**< Not a valid command, but last one according to this version header */
} Efl_Gfx_Path_Command;
/**
* Type describing dash
*
* @see efl_gfx_shape_stroke_dash_set()
*
* @since 1.14
*/
typedef struct _Efl_Gfx_Dash Efl_Gfx_Dash;
struct _Efl_Gfx_Dash
{
double length; /**< dash drawing length */
double gap; /**< distance bettwen two dashes */
};
/**
* These values determine how the end of opened sub-paths are rendered in a
* stroke.
*
* @see efl_gfx_shape_stroke_cap_set()
*
* @since 1.14
*/
typedef enum _Efl_Gfx_Cap
{
EFL_GFX_CAP_BUTT = 0, /**< The end of lines is rendered as a full stop on the last point itself */
EFL_GFX_CAP_ROUND, /**< The end of lines is rendered as a half-circle around the last point */
EFL_GFX_CAP_SQUARE, /**< The end of lines is rendered as a square around the last point */
EFL_GFX_CAP_LAST /**< End of enum value */
} Efl_Gfx_Cap;
/**
* These values determine how two joining lines are rendered in a stroker.
*
* @see efl_gfx_shape_stroke_join_set()
*
* @since 1.14
*/
typedef enum _Efl_Gfx_Join
{
EFL_GFX_JOIN_MITER = 0, /**< Used to render rounded line joins. Circular arcs are used to join two lines smoothly. */
EFL_GFX_JOIN_ROUND, /**< Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the triangular region of the corner with a straight line between the outer corners of each stroke. */
EFL_GFX_JOIN_BEVEL, /**< Used to render mitered line joins. The intersection of the strokes is clipped at a line perpendicular to the bisector of the angle between the strokes, at the distance from the intersection of the segments equal to the product of the miter limit value and the border radius. This prevents long spikes being created. */
EFL_GFX_JOIN_LAST /**< End of enum value */
} Efl_Gfx_Join;
/**
* Type defining gradient stop.
* @note Describe the location and color of a transition point in a gradient.
* @since 1.14
*/
typedef struct _Efl_Gfx_Gradient_Stop Efl_Gfx_Gradient_Stop;
struct _Efl_Gfx_Gradient_Stop
{
double offset; /**< The location of the gradient stop within the gradient vector*/
int r; /**< The component R color of the gradient stop */
int g; /**< The component G color of the gradient stop */
int b; /**< The component B color of the graident stop */
int a; /**< The component A color of the graident stop */
};
/**
* Specifies how the area outside the gradient area should be filled.
*
* @see efl_gfx_gradient_spread_set()
*
* @since 1.14
*/
typedef enum _Efl_Gfx_Gradient_Spread
{
EFL_GFX_GRADIENT_SPREAD_PAD, /**< The area is filled with the closest stop color. This is the default. */
EFL_GFX_GRADIENT_SPREAD_REFLECT, /**< The gradient is reflected outside the gradient area. */
EFL_GFX_GRADIENT_SPREAD_REPEAT, /**< The gradient is repeated outside the gradient area. */
EFL_GFX_GRADIENT_SPREAD_LAST /**< End of enum value */
} Efl_Gfx_Gradient_Spread;
/**
* Type defining how an image content get filled.
* @since 1.14
*/
typedef enum _Efl_Gfx_Fill_Rule
{
EFL_GFX_FILL_RULE_WINDING = 0, /**< Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape. This mode is the default */
EFL_GFX_FILL_RULE_ODD_EVEN = 1, /**< Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape. */
} Efl_Gfx_Fill_Rule;
/**
* Type defining stroke information.
* @note Describe the properties to define the path stroke.
* @since 1.14
*/
typedef struct _Efl_Gfx_Stroke Efl_Gfx_Stroke;
struct _Efl_Gfx_Stroke
{
double scale;
double width;
double centered;
struct {
int r, g, b, a;
} color;
Efl_Gfx_Dash *dash;
unsigned int dash_length;
Efl_Gfx_Cap cap;
Efl_Gfx_Join join;
};
typedef struct _Efl_Gfx_Shape_Public Efl_Gfx_Shape_Public;
struct _Efl_Gfx_Shape_Public
{
Efl_Gfx_Stroke stroke;
};
#ifdef EFL_BETA_API_SUPPORT
#include <Efl_Model_Common.h>
/* Data types */
#include "interfaces/efl_gfx_types.eot.h"
typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
/* Interfaces */
#include "interfaces/efl_control.eo.h"
#include "interfaces/efl_file.eo.h"
@ -210,10 +86,13 @@ static inline void efl_gfx_color16_type_set(Efl_Gfx_Color *color,
#else
#ifndef EFL_NOLEGACY_API_SUPPORT
#include "interfaces/efl_gfx_types.eot.h"
#include "interfaces/efl_gfx_fill.eo.legacy.h"
#include "interfaces/efl_gfx_base.eo.legacy.h"
#endif
typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#endif
#if defined ( __cplusplus )

View File

@ -1,29 +1,4 @@
enum Efl.Gfx.Colorspace {
argb8888 = 0, [[ARGB 32 bits per pixel, high-byte is Alpha, accessed one 32-bit word at a time]]
gry8 = 4, [[8-bit gray image, or alpha only]]
}
enum Efl.Gfx.Render_Op {
blend = 0, [[Alpha blending onto destination (default); d = d*(1-sa) + s]]
copy = 1, [[Copy source to destination; d = s]]
last
}
enum Efl.Gfx.Color_Type {
bits8, [[Color is encoded in the top 8 bits of the unsigned short as a unsigned char.]]
bits16, [[Color is encoded in the 16 bits as an unsigned char.]]
last
}
struct Efl.Gfx.Color {
[[Define an RGBA color.]]
r: ushort; [[The red component.]]
g: ushort; [[The green component.]]
b: ushort; [[The blue component.]]
a: ushort; [[The alpha component.]]
type: Efl.Gfx.Color_Type;
}
import efl_gfx_types;
interface Efl.Gfx.Base {
legacy_prefix: null;

View File

@ -0,0 +1,135 @@
enum Efl.Gfx.Colorspace {
argb8888 = 0, [[ARGB 32 bits per pixel, high-byte is Alpha, accessed one 32-bit word at a time.]]
gry8 = 4, [[8-bit gray image, or alpha only.]]
}
enum Efl.Gfx.Render_Op {
blend = 0, [[Alpha blending onto destination (default); d = d*(1-sa) + s.]]
copy = 1, [[Copy source to destination; d = s.]]
last
}
enum Efl.Gfx.Color_Type {
bits8, [[Color is encoded in the top 8 bits of the unsigned short as a unsigned char.]]
bits16, [[Color is encoded in the 16 bits as an unsigned short.]]
last
}
struct Efl.Gfx.Color {
[[Define an RGBA color.]]
r: ushort; [[The red component.]]
g: ushort; [[The green component.]]
b: ushort; [[The blue component.]]
a: ushort; [[The alpha component.]]
type: Efl.Gfx.Color_Type; [[Defines whether the color is 8-bit or 16-bit encoded.]]
}
enum Efl.Gfx.Path.Command_Type {
[[These values determine how the points are interpreted in a stream of points.
@since 1.14
]]
end = 0, [[The end of stream , no more points to process.]]
move_to, [[The next point is the start point of a sub path.]]
line_to, [[The next point is used to draw a line from current point.]]
cubic_to, [[The next three point is used to draw a cubic bezier curve from current point.]]
close, [[Close the curent subpath by drawing a line between current point and the first point of current subpath.]]
last [[Not a valid command, but last one according to this version header.]]
}
enum Efl.Gfx.Cap {
[[These values determine how the end of opened sub-paths are rendered in a
stroke.
$ref efl_gfx_shape_stroke_cap_set()
@since 1.14
]]
butt = 0, [[The end of lines is rendered as a full stop on the last point itself.]]
round, [[The end of lines is rendered as a half-circle around the last point.]]
square, [[The end of lines is rendered as a square around the last point.]]
last [[End of enum value.]]
}
enum Efl.Gfx.Join
{
[[These values determine how two joining lines are rendered in a stroker.
$ref efl_gfx_shape_stroke_join_set()
@since 1.14
]]
miter = 0, [[Used to render rounded line joins. Circular arcs are used to join two lines smoothly.]]
round, [[Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the triangular region of the corner with a straight line between the outer corners of each stroke.]]
bevel, [[Used to render mitered line joins. The intersection of the strokes is clipped at a line perpendicular to the bisector of the angle between the strokes, at the distance from the intersection of the segments equal to the product of the miter limit value and the border radius. This prevents long spikes being created.]]
last [[End of enum value]]
}
enum Efl.Gfx.Gradient.Spread
{
[[Specifies how the area outside the gradient area should be filled.
$ref efl_gfx_gradient_spread_set()
@since 1.14
]]
pad, [[The area is filled with the closest stop color. This is the default.]]
reflect, [[The gradient is reflected outside the gradient area.]]
repeat, [[The gradient is repeated outside the gradient area.]]
last [[End of enum value]]
}
enum Efl.Gfx.Fill.Rule
{
[[Type defining how an image content get filled.
@since 1.14
]]
winding = 0, [[Draw a horizontal line from the point to a location outside the shape. Determine whether the direction of the line at each intersection point is up or down. The winding number is determined by summing the direction of each intersection. If the number is non zero, the point is inside the shape. This mode is the default]]
odd_even = 1, [[Draw a horizontal line from the point to a location outside the shape, and count the number of intersections. If the number of intersections is an odd number, the point is inside the shape.]]
}
struct Efl.Gfx.Dash {
[[Type describing dash.
$ref efl_gfx_shape_stroke_dash_set()
@since 1.14
]]
length: double; [[Dash drawing length.]]
gap: double; [[Distance bettwen two dashes.]]
}
struct Efl.Gfx.Gradient.Stop
{
[[Type defining gradient stops.
Describes the location and color of a transition point in a gradient.
@since 1.14
]]
offset: double; [[The location of the gradient stop within the gradient vector]]
r: int; [[The component R color of the gradient stop]]
g: int; [[The component G color of the gradient stop]]
b: int; [[The component B color of the graident stop]]
a: int; [[The component A color of the graident stop]]
}
struct Efl.Gfx.Stroke_Color
{
[[Internal structure for @ref Efl.Gfx.Stroke.]]
r: int;
g: int;
b: int;
a: int;
}
struct Efl.Gfx.Stroke
{
[[Type defining stroke information.
Describes the properties to define the path stroke.
@since 1.14
]]
scale: double;
width: double;
centered: double;
color: Efl.Gfx.Stroke_Color;
dash: Efl.Gfx.Dash*;
dash_length: uint;
cap: Efl.Gfx.Cap;
join: Efl.Gfx.Join;
}
struct Efl.Gfx.Shape.Public
{
stroke: Efl.Gfx.Stroke;
}