ector: add initial interface for Surface and Renderer.

This commit is contained in:
Cedric BAIL 2015-04-03 16:14:58 +02:00
parent 5e75d607c6
commit 0510ea90bd
7 changed files with 241 additions and 0 deletions

View File

@ -77,6 +77,14 @@ Eo
--
Tom Hacohen <tom@stosb.com>
Cedric Bail <cedric.bail@free.fr>
Ector
-----
Cedric Bail <cedric.bail@free.fr>
Jorge Luis Zapata Muga <jorgeluis.zapata@gmail.com>
Jose O Gonzalez <jose_ogp@juno.com>
Evas
----

View File

@ -1,5 +1,19 @@
### Library
ector_eolian_files = \
lib/ector/ector_surface.eo \
lib/ector/ector_renderer.eo
ector_eolian_c = $(ector_eolian_files:%.eo=%.eo.c)
ector_eolian_h = $(ector_eolian_files:%.eo=%.eo.h)
BUILT_SOURCES += \
$(ector_eolian_c) \
$(ector_eolian_h)
CLEANFILES += \
$(ector_eolian_c) \
$(ector_eolian_h)
lib_LTLIBRARIES += lib/ector/libector.la

View File

@ -3,6 +3,7 @@
#include <Eina.h>
#include <Eo.h>
#include <Evas.h>
#ifdef EAPI
# undef EAPI
@ -103,6 +104,55 @@ typedef Eo Ector_Surface;
*/
typedef Eo Ector_Renderer;
/**
* @typedef Ector_Colorspace
* The definiton of colorspace.
*/
typedef Evas_Colorspace Ector_Colorspace;
/**
* Raster operations at pixel level
*/
typedef enum _Ector_Rop
{
ECTOR_ROP_BLEND, /**< D = S + D(1 - Sa) */
ECTOR_ROP_COPY, /**< D = S */
ECTOR_ROP_LAST
} Ector_Rop;
/**
* Quality values
*/
typedef enum _Ector_Quality
{
ECTOR_QUALITY_BEST, /**< Best quality */
ECTOR_QUALITY_GOOD, /**< Good quality */
ECTOR_QUALITY_FAST, /**< Lower quality, fastest */
ECTOR_QUALITY_LAST
} Ector_Quality;
/**
* Priorities
*/
typedef enum _Ector_Priority
{
ECTOR_PRIORITY_NONE = 0,
ECTOR_PRIORITY_MARGINAL = 64,
ECTOR_PRIORITY_SECONDARY = 128,
ECTOR_PRIORITY_PRIMARY = 256,
} Ector_Priority;
/**
* What kind of update is being pushed
*/
typedef enum _Ector_Update_Type
{
ECTOR_UPDATE_BACKGROUND = 1, /* All the previous state in that area is reset to the new updated profile */
ECTOR_UPDATE_EMPTY = 2, /* Pushing empty area (no visible pixels at all, no need to read this surface to render it) */
ECTOR_UPDATE_ALPHA = 4, /* Pushing some transparent pixels (this impact the under layer and will require to read back the surface where this surface is blitted) */
ECTOR_UPDATE_OPAQUE = 8 /* Pushing some opaque pixels (this means that their is no need to read the under layer when blitting this surface) */
} Ector_Update_Type;
#ifdef EFL_BETA_API_SUPPORT
/**
@ -121,6 +171,9 @@ EAPI int ector_init(void);
*/
EAPI int ector_shutdown(void);
#include "ector_surface.h"
#include "ector_renderer.h"
#endif
/**

View File

@ -0,0 +1,114 @@
abstract Ector.Renderer (Eo.Base)
{
eo_prefix: ector_renderer;
legacy_prefix: null;
properties {
transformation {
set {
}
get {
}
values {
Eina_Matrix3 m;
}
}
origin {
set {
}
get {
}
values {
double x;
double y;
}
}
visibility {
set {
/*@ Makes the given Ector renderer visible or invisible. */
}
get {
/*@ Retrieves whether or not the given Ector renderer is visible. */
}
values {
bool v; /*@ @c EINA_TRUE if to make the object visible, @c EINA_FALSE otherwise */
}
}
color {
set {
/*@
Sets the general/main color of the given Ector renderer to the given
one.
@note These color values are expected to be premultiplied by @p a.
@ingroup Ector_Renderer_Group_Basic */
}
get {
/*@
Retrieves the general/main color of the given Ector renderer.
Retrieves the “main” color's RGB component (and alpha channel)
values, <b>which range from 0 to 255</b>. For the alpha channel,
which defines the object's transparency level, 0 means totally
transparent, while 255 means opaque. These color values are
premultiplied by the alpha value.
@note Use @c NULL pointers on the components you're not interested
in: they'll be ignored by the function.
@ingroup Ector_Renderer_Group_Basic */
}
values {
int r; /*@ The red component of the given color. */
int g; /*@ The green component of the given color. */
int b; /*@ The blue component of the given color. */
int a; /*@ The alpha component of the given color. */
}
}
mask {
set {
}
get {
}
values {
Ector_Renderer *r;
}
}
quality {
set {
}
get {
}
values {
Ector_Quality q;
}
}
}
methods {
bounds_get {
return: bool @warn_unused;
params {
@out Eina_Rectangle *r;
}
}
draw {
return: bool @warn_unused;
params {
@in Ector_Surface *s;
@in Ector_Rop op;
@in array<Eina_Rectangle *> *clips; /*@ array of Eina_Rectangle clip */
@in int x;
@in int y;
}
}
prepare {
return: bool @warn_unused;
params {
@in Ector_Surface *s;
}
}
done {
return: bool @warn_unused;
}
}
}

View File

@ -0,0 +1,6 @@
#ifndef ECTOR_RENDERER_H
#define ECTOR_RENDERER_H
#include "ector_renderer.eo.h"
#endif

View File

@ -0,0 +1,40 @@
abstract Ector.Surface (Eo.Base)
{
eo_prefix: ector_surface;
properties {
size {
set {
/*@ Changes the size of the given Evas object. */
}
get {
/*@ Retrieves the (rectangular) size of the given Evas object. */
}
values {
int w; /*@ in */
int h; /*@ in */
}
}
}
methods {
renderer_factory_new {
return: Ector_Renderer *;
params {
@in const(Eo_Class) * type @nonull;
}
}
update_push {
return: bool;
params {
@in const(Eina_Rectangle) * r @nonull;
@in Ector_Update_Type type;
}
}
update_reset {
return: bool;
}
}
implements {
@virtual .size.set;
@virtual .size.get;
}
}

View File

@ -0,0 +1,6 @@
#ifndef ECTOR_SURFACE_H
#define ECTOR_SURFACE_H
#include "ector_surface.eo.h"
#endif