summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_canvas_filter_internal.eo
blob: 0a2c34b5475a066a835fd7e4e84fb38f77f7d9a7 (plain)
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
124
125
126
// import efl_gfx_types -> need to add Efl.Gfx.Color
import eina_types;

/* Everything in this file is internal to Evas. It is not meant to be used
   from outside EFL itself! */

struct Efl.Gfx.Color32
{
   [[32 bit color data structure]]
   r: uint8; [[Red component of the color]]
   g: uint8; [[Green component of the color]]
   b: uint8; [[Blue component of the color]]
   a: uint8; [[Translucent component of the color]]
}

struct Efl.Canvas.Filter.State_Name
{
   [[Filter state name structure]]
   name: string; [[Filter state name]]
   value: double; [[Filter state value]]
}

struct Efl.Canvas.Filter.State_Text
{
   [[Filter state text structure]]
   outline: Efl.Gfx.Color32; [[Text outline color]]
   shadow: Efl.Gfx.Color32; [[Text shadow color]]
   glow: Efl.Gfx.Color32; [[Text glow color]]
   glow2: Efl.Gfx.Color32; [[Text glow2 color]]
}

struct Efl.Canvas.Filter.State
{
   [[Internal structure representing the state of a Gfx Filter]]
   text: Efl.Canvas.Filter.State_Text; [[Text state]]
   color: Efl.Gfx.Color32; [[Color]]
   cur: Efl.Canvas.Filter.State_Name; [[Current state]]
   next: Efl.Canvas.Filter.State_Name; [[Next state]]
   w: int; [[Width]]
   h: int; [[Height]]
   scale: double; [[Scale factor]]
   pos: double; [[Position]]
}

mixin Efl.Canvas.Filter.Internal (Efl.Gfx.Filter, Efl.Object)
{
   [[Evas internal implementation of filters.]]

   eo_prefix: evas;
   data: Evas_Filter_Data;

   methods {
      @property filter_changed @protected {
         set {
            [[Marks this filter as changed.]]
         }
         values {
            val: bool; [[$true if filter changed, $false otherwise]]
         }
      }
      @property filter_invalid @protected {
         set {
            [[Marks this filter as invalid.]]
         }
         values {
            val: bool; [[$true if filter is invalid, $false otherwise]]
         }
      }
      filter_input_alpha @protected @pure_virtual {
         [[Called by Efl.Canvas.Filter.Internal to determine whether the input is alpha or rgba.]]
         return: bool; [[$true on success, $false otherwise]]
      }
      filter_state_prepare @protected @pure_virtual {
         [[Called by Efl.Canvas.Filter.Internal to request the parent class
           for state information (color, etc...).]]
         params {
            @out state: Efl.Canvas.Filter.State; [[State info to fill in]]
            @in data: void_ptr; [[Private data for the class]]
         }
      }
      filter_input_render @protected @pure_virtual {
         [[Called by Efl.Canvas.Filter.Internal when the parent class must render the input.]]
         return: bool; [[Indicates success from the object render function.]]
         params {
            filter: void_ptr; [[Current filter context]]
	    engine: void_ptr; [[Engine context]]
	    output: void_ptr; [[Output context]]
            drawctx: void_ptr; [[Draw context (for evas engine)]]
	    data: void_ptr; [[Private data used by textblock]]
            l: int; [[Left]]
            r: int; [[Right]]
            t: int; [[Top]]
            b: int; [[Bottom]]
            x: int; [[X offset]]
            y: int; [[Y offset]]
            do_async: bool; [[$true when the operation should be done asynchronously, $false otherwise]]
         }
      }
      filter_dirty @protected @pure_virtual {
         [[Called when filter changes must trigger a redraw of the object.

           Virtual, to be implemented in the parent class.
         ]]
      }
      @property filter_output_buffer @protected {
         get {
            [[Retrieve cached output buffer, if any.

              Does not increment the reference count.
            ]]
         }
         values {
            buffer: void_ptr; [[Output buffer]]
         }
      }
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.destructor;
      Efl.Gfx.Filter.filter_program { get; set; }
      Efl.Gfx.Filter.filter_state { get; set; }
      Efl.Gfx.Filter.filter_padding { get; }
      Efl.Gfx.Filter.filter_source { get; set; }
      Efl.Gfx.Filter.filter_data { get; set; }
   }
}