forked from enlightenment/efl
evas: add Evas_VG_Image.
This commit is contained in:
parent
fa2f4e969e
commit
161b7b93e2
|
@ -39,7 +39,8 @@ evas_eolian_files = \
|
||||||
lib/evas/canvas/evas_vg_root_node.eo \
|
lib/evas/canvas/evas_vg_root_node.eo \
|
||||||
lib/evas/canvas/evas_vg_gradient.eo \
|
lib/evas/canvas/evas_vg_gradient.eo \
|
||||||
lib/evas/canvas/evas_vg_gradient_radial.eo \
|
lib/evas/canvas/evas_vg_gradient_radial.eo \
|
||||||
lib/evas/canvas/evas_vg_gradient_linear.eo
|
lib/evas/canvas/evas_vg_gradient_linear.eo \
|
||||||
|
lib/evas/canvas/evas_vg_image.eo
|
||||||
|
|
||||||
evas_eolian_c = $(evas_eolian_files:%.eo=%.eo.c)
|
evas_eolian_c = $(evas_eolian_files:%.eo=%.eo.c)
|
||||||
evas_eolian_h = $(evas_eolian_files:%.eo=%.eo.h) \
|
evas_eolian_h = $(evas_eolian_files:%.eo=%.eo.h) \
|
||||||
|
@ -219,7 +220,8 @@ lib/evas/canvas/evas_vg_root_node.c \
|
||||||
lib/evas/canvas/evas_vg_gradient.c \
|
lib/evas/canvas/evas_vg_gradient.c \
|
||||||
lib/evas/canvas/evas_vg_gradient_linear.c \
|
lib/evas/canvas/evas_vg_gradient_linear.c \
|
||||||
lib/evas/canvas/evas_vg_gradient_radial.c \
|
lib/evas/canvas/evas_vg_gradient_radial.c \
|
||||||
lib/evas/canvas/evas_vg_utils.c
|
lib/evas/canvas/evas_vg_utils.c \
|
||||||
|
lib/evas/canvas/evas_vg_image.c
|
||||||
|
|
||||||
# Engine
|
# Engine
|
||||||
lib_evas_libevas_la_SOURCES += \
|
lib_evas_libevas_la_SOURCES += \
|
||||||
|
|
|
@ -931,3 +931,4 @@ typedef enum _Evas_VG_Gradient_Spread
|
||||||
#include "canvas/evas_vg_gradient.eo.h"
|
#include "canvas/evas_vg_gradient.eo.h"
|
||||||
#include "canvas/evas_vg_gradient_linear.eo.h"
|
#include "canvas/evas_vg_gradient_linear.eo.h"
|
||||||
#include "canvas/evas_vg_gradient_radial.eo.h"
|
#include "canvas/evas_vg_gradient_radial.eo.h"
|
||||||
|
#include "canvas/evas_vg_image.eo.h"
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
#include "evas_common_private.h"
|
||||||
|
#include "evas_private.h"
|
||||||
|
|
||||||
|
#include <strings.h>
|
||||||
|
|
||||||
|
typedef struct _Evas_VG_Image_Data Evas_VG_Image_Data;
|
||||||
|
struct _Evas_VG_Image_Data
|
||||||
|
{
|
||||||
|
// FIXME: only manipulate Eina_File internally.
|
||||||
|
Eina_Stringshare *file, *key;
|
||||||
|
|
||||||
|
int x, y;
|
||||||
|
unsigned int w, h;
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
_evas_vg_image_position_set(Eo *obj, Evas_VG_Image_Data *pd, int x, int y)
|
||||||
|
{
|
||||||
|
pd->x = x;
|
||||||
|
pd->y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_evas_vg_image_position_get(Eo *obj, Evas_VG_Image_Data *pd, int *x, int *y)
|
||||||
|
{
|
||||||
|
if (x) *x = pd->x;
|
||||||
|
if (y) *y = pd->y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_evas_vg_image_size_set(Eo *obj, Evas_VG_Image_Data *pd,
|
||||||
|
unsigned int w, unsigned int h)
|
||||||
|
{
|
||||||
|
pd->w = w;
|
||||||
|
pd->h = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_evas_vg_image_size_get(Eo *obj, Evas_VG_Image_Data *pd,
|
||||||
|
unsigned int *w, unsigned int *h)
|
||||||
|
{
|
||||||
|
if (w) *w = pd->w;
|
||||||
|
if (h) *h = pd->h;
|
||||||
|
}
|
||||||
|
|
||||||
|
Eina_Bool
|
||||||
|
_evas_vg_image_efl_file_file_set(Eo *obj, Evas_VG_Image_Data *pd,
|
||||||
|
const char *file, const char *key)
|
||||||
|
{
|
||||||
|
eina_stringshare_replace(&pd->file, file);
|
||||||
|
eina_stringshare_replace(&pd->key, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_evas_vg_image_efl_file_file_get(Eo *obj, Evas_VG_Image_Data *pd,
|
||||||
|
const char **file, const char **key)
|
||||||
|
{
|
||||||
|
if (file) *file = pd->file;
|
||||||
|
if (key) *key = pd->key;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include "evas_vg_image.eo.c"
|
|
@ -0,0 +1,32 @@
|
||||||
|
class Evas.VG_Image (Evas.VG_Node, Efl.File)
|
||||||
|
{
|
||||||
|
eo_prefix: evas_vg_image;
|
||||||
|
legacy_prefix: null;
|
||||||
|
properties {
|
||||||
|
position {
|
||||||
|
set {
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
size {
|
||||||
|
set {
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
uint w;
|
||||||
|
uint h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// FIXME: add aspect ratio following SVG specification
|
||||||
|
}
|
||||||
|
implements {
|
||||||
|
Efl.File.file.set;
|
||||||
|
Efl.File.file.get;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue