summaryrefslogtreecommitdiff
path: root/src/lib/ector/ector_private.h
blob: 8604768e161fd29cfa920ebd1463a30daf2ef022 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef ECTOR_PRIVATE_H_
#define ECTOR_PRIVATE_H_

#include "Ector.h"

#include "ector_gl_internal.h"

/*
 * variable and macros used for the eina_log module
 */
extern int _ector_log_dom_global;

/*
 * Macros that are used everywhere
 *
 * the first four macros are the general macros for the lib
 */
#ifdef ECTOR_DEFAULT_LOG_COLOR
# undef ECTOR_DEFAULT_LOG_COLOR
#endif /* ifdef ECTOR_DEFAULT_LOG_COLOR */
#define ECTOR_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR
# undef ERR
#endif /* ifdef ERR */
#define ERR(...)  EINA_LOG_DOM_ERR(_ector_log_dom_global, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif /* ifdef DBG */
#define DBG(...)  EINA_LOG_DOM_DBG(_ector_log_dom_global, __VA_ARGS__)
#ifdef INF
# undef INF
#endif /* ifdef INF */
#define INF(...)  EINA_LOG_DOM_INFO(_ector_log_dom_global, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif /* ifdef WRN */
#define WRN(...)  EINA_LOG_DOM_WARN(_ector_log_dom_global, __VA_ARGS__)
#ifdef CRI
# undef CRI
#endif /* ifdef CRI */
#define CRI(...) EINA_LOG_DOM_CRIT(_ector_log_dom_global, __VA_ARGS__)

/* The following macro are internal to Ector only at this stage */

typedef struct _Ector_Renderer_Data Ector_Renderer_Data;
typedef struct _Ector_Renderer_Gradient_Data Ector_Renderer_Gradient_Data;
typedef struct _Ector_Renderer_Gradient_Linear_Data Ector_Renderer_Gradient_Linear_Data;
typedef struct _Ector_Renderer_Gradient_Radial_Data Ector_Renderer_Gradient_Radial_Data;
typedef struct _Ector_Renderer_Shape_Data Ector_Renderer_Shape_Data;
typedef struct _Ector_Renderer_Buffer_Data Ector_Renderer_Buffer_Data;

struct _Ector_Renderer_Data
{
   Ector_Surface *surface;
   Eina_Matrix3 *m;

   struct {
      double x;
      double y;
   } origin;

   struct {
      int r, g, b, a;
   } color;

   Eina_Bool visibility : 1;
   Eina_Bool finalized : 1;
};

struct _Ector_Renderer_Gradient_Data
{
   Efl_Gfx_Gradient_Stop *colors;
   unsigned int colors_count;

   Efl_Gfx_Gradient_Spread s;
};

struct _Ector_Renderer_Gradient_Linear_Data
{
   struct {
      double x, y;
   } start, end;
};

struct _Ector_Renderer_Gradient_Radial_Data
{
   struct {
      double x, y;
   } radial, focal;
   double radius;
};

struct _Ector_Renderer_Shape_Data
{
   Ector_Renderer *fill;
   struct {
      Ector_Renderer *fill;
      Ector_Renderer *marker;
   } stroke;
};

struct _Ector_Renderer_Buffer_Data
{
   Ector_Buffer *eo_buffer;
   struct {
      /* Efl_Gfx_Fill_Spread spread; */
      int x, y, w, h;
   } fill;
};

static inline unsigned int
_renderer_crc_get(Eo *obj, unsigned int crc)
{
   unsigned int id;

   id = ector_renderer_crc_get(obj);
   crc = eina_crc((void*) &id, sizeof (id), crc, EINA_FALSE);
   return crc;
}

#include "ector_buffer.h"

#endif