ffi-efl 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,12 +5,43 @@ require 'efl/evas'
5
5
  require 'efl/native/elementary'
6
6
  #
7
7
  module Efl
8
+ #
9
+ module Native
10
+ #
11
+ class ElmGenlistItemClassStruct < FFI::Struct
12
+ layout :item_style, :pointer,
13
+ :label_get, :pointer,
14
+ :icon_get, :pointer,
15
+ :state_get, :pointer,
16
+ :del, :pointer,
17
+ :moved, :pointer,
18
+ :mode_item_style, :pointer
19
+ end
20
+ #
21
+ end
22
+ #
8
23
  module Elm
9
24
  #
10
25
  def self.version
11
26
  Native::VersionStruct.new(Native.elm_version)
12
27
  end
13
28
  #
29
+ module Helper
30
+ def self.included kls
31
+ def kls.constructor meth
32
+ self.class_eval <<-EOF
33
+ def initialize ptr, &block
34
+ if ptr.is_a? FFI::Pointer
35
+ super ptr, &block
36
+ else
37
+ super Native.method(:#{meth}), ptr, &block
38
+ end
39
+ end
40
+ EOF
41
+ end
42
+ end
43
+ end
44
+ #
14
45
  class << self
15
46
  def init *args
16
47
  a = args.select { |e| e.is_a? String }
@@ -56,11 +87,10 @@ module Efl
56
87
  #
57
88
  class ElmBg < Efl::Evas::REvasObject
58
89
  #
90
+ include Helper
91
+ constructor :elm_bg_add
59
92
  search_prefixes 'elm_bg_', 'elm_object_'
60
93
  #
61
- def initialize parent, &block
62
- super Native.method(:elm_bg_add), parent, &block
63
- end
64
94
  def file_get
65
95
  f = FFI::MemoryPointer.new :pointer
66
96
  g = FFI::MemoryPointer.new :pointer
@@ -80,12 +110,10 @@ module Efl
80
110
  #
81
111
  class ElmLayout < Efl::Evas::REvasObject
82
112
  #
113
+ include Helper
114
+ constructor :elm_layout_add
83
115
  search_prefixes 'elm_layout_', 'elm_object_'
84
116
  #
85
- def initialize parent, &block
86
- super Native.method(:elm_layout_add), parent, &block
87
- end
88
- #
89
117
  def edje_get &block
90
118
  Efl::Edje::REdje.new Native.method(:elm_layout_edje_get), @ptr, &block
91
119
  end
@@ -94,32 +122,59 @@ module Efl
94
122
  #
95
123
  class ElmBox < Efl::Evas::REvasObject
96
124
  #
125
+ include Helper
126
+ constructor :elm_box_add
97
127
  search_prefixes 'elm_box_', 'elm_object_'
98
128
  #
99
- def initialize parent, &block
100
- super Native.method(:elm_box_add), parent, &block
129
+ def padding_get
130
+ x = FFI::MemoryPointer.new :int
131
+ y = FFI::MemoryPointer.new :int
132
+ Native::elm_box_padding_get @ptr, x, y
133
+ [ x.read_int, y.read_int ]
134
+ end
135
+ alias :padding :padding_get
136
+ #
137
+ def align_get
138
+ x = FFI::MemoryPointer.new :float
139
+ y = FFI::MemoryPointer.new :float
140
+ Native::elm_box_align_get @ptr, x, y
141
+ [ x.read_float, y.read_float ]
101
142
  end
143
+ alias :align :padding_get
102
144
  #
145
+ def children_get
146
+ Efl::EinaList::REinaList.new Native.elm_box_children_get @ptr
147
+ end
148
+ alias :children :children_get
103
149
  end
104
150
  #
105
151
  class ElmList < Efl::Evas::REvasObject
106
152
  #
153
+ include Helper
154
+ constructor :elm_list_add
107
155
  search_prefixes 'elm_list_', 'elm_object_'
108
156
  #
109
- def initialize parent, &block
110
- super Native.method(:elm_list_add), parent, &block
157
+ def item_append label, left_icon=nil, right_icon=nil, cb=nil, data=nil
158
+ ElmListItem.new Native::elm_list_item_append @ptr, label, left_icon, right_icon, cb, data
111
159
  end
160
+ end
161
+ #
162
+ class ElmListItem < Efl::Evas::REvasObject
163
+ #
164
+ search_prefixes 'elm_list_item_', 'elm_object'
112
165
  #
166
+ def data_get
167
+ Native::elm_list_item_data_get @ptr
168
+ end
169
+ alias :data :data_get
113
170
  end
114
171
  #
115
172
  class ElmIcon < Efl::Evas::REvasObject
116
173
  #
174
+ include Helper
175
+ constructor :elm_icon_add
117
176
  search_prefixes 'elm_icon_', 'elm_object_'
118
177
  #
119
- def initialize parent, &block
120
- super Native.method(:elm_icon_add), parent, &block
121
- end
122
- #
123
178
  def scale_set args
124
179
  Native.elm_icon_scale_set @ptr, *args
125
180
  end
@@ -128,49 +183,129 @@ module Efl
128
183
  #
129
184
  class ElmLabel < Efl::Evas::REvasObject
130
185
  #
186
+ include Helper
187
+ constructor :elm_label_add
131
188
  search_prefixes 'elm_label_', 'elm_object_'
132
189
  #
133
- def initialize parent, &block
134
- super Native.method(:elm_label_add), parent, &block
135
- end
136
190
  end
137
191
  #
138
192
  class ElmPager < Efl::Evas::REvasObject
139
193
  #
194
+ include Helper
195
+ constructor :elm_pager_add
140
196
  search_prefixes 'elm_pager_', 'elm_object_'
141
197
  #
142
- def initialize parent, &block
143
- super Native.method(:elm_pager_add), parent, &block
144
- end
145
198
  end
146
199
  #
147
200
  class ElmPanel < Efl::Evas::REvasObject
148
201
  #
202
+ include Helper
203
+ constructor :elm_panel_add
149
204
  search_prefixes 'elm_panel_', 'elm_object'
150
205
  #
151
- def initialize parent, &block
152
- super Native.method(:elm_panel_add), parent, &block
153
- end
154
206
  end
155
207
  #
156
208
  class ElmDiskSelector < Efl::Evas::REvasObject
157
209
  #
210
+ include Helper
211
+ constructor :elm_diskselector_add
158
212
  search_prefixes 'elm_diskselector_', 'elm_object'
159
213
  #
160
- def initialize parent, &block
161
- super Native.method(:elm_diskselector_add), parent, &block
214
+ def item_selected_set it, b
215
+ Native::elm_diskselector_item_selected_set it, b
216
+ end
217
+ alias :item_selected= :item_selected_set
218
+ end
219
+ #
220
+ class ElmDiskSelectorItem < Efl::Evas::REvasObject
221
+ #
222
+ search_prefixes 'elm_diskselector_item_', 'elm_object'
223
+ #
224
+ def data_get
225
+ Native::elm_diskselector_item_data_get @ptr
162
226
  end
227
+ alias :data :data_get
163
228
  end
164
229
  #
165
230
  class ElmNotify < Efl::Evas::REvasObject
166
231
  #
232
+ include Helper
233
+ constructor :elm_notify_add
167
234
  search_prefixes 'elm_notify_', 'elm_object'
168
235
  #
169
- def initialize parent, &block
170
- super Native.method(:elm_notify_add), parent, &block
236
+ end
237
+ #
238
+ class ElmEntry < Efl::Evas::REvasObject
239
+ #
240
+ include Helper
241
+ constructor :elm_entry_add
242
+ search_prefixes 'elm_entry_', 'elm_object'
243
+ #
244
+ end
245
+ #
246
+ class ElmFlipSelector < Efl::Evas::REvasObject
247
+ #
248
+ include Helper
249
+ constructor :elm_flipselector_add
250
+ search_prefixes 'elm_flipselector_', 'elm_object'
251
+ #
252
+ def item_append label, cb, data
253
+ ElmFlipSelectorItem.new Native::elm_flipselector_item_append @ptr, label, cb, data
254
+ end
255
+ #
256
+ def selected_item_get
257
+ ElmFlipSelectorItem.new Native::elm_flipselector_selected_item_get @ptr
258
+ end
259
+ alias :selected_item :selected_item_get
260
+ end
261
+ #
262
+ class ElmFlipSelectorItem < Efl::Evas::REvasObject
263
+ #
264
+ search_prefixes 'elm_flipselector_item_', 'elm_object'
265
+ #
266
+ end
267
+ #
268
+ class ElmHoversel < Efl::Evas::REvasObject
269
+ #
270
+ include Helper
271
+ constructor :elm_hoversel_add
272
+ search_prefixes 'elm_hoversel_', 'elm_object'
273
+ #
274
+ def item_add label, icon_file=nil, icon_type=:elm_icon_none, cb=nil, data=nil
275
+ ElmHoverselItem.new Native::elm_hoversel_item_add @ptr, label, icon_file, icon_type, cb, data
171
276
  end
172
277
  end
173
278
  #
279
+ class ElmHoverselItem < Efl::Evas::REvasObject
280
+ #
281
+ search_prefixes 'elm_hoversel_item_', 'elm_object'
282
+ #
283
+ end
284
+ #
285
+ class ElmHover < Efl::Evas::REvasObject
286
+ #
287
+ include Helper
288
+ constructor :elm_hover_add
289
+ search_prefixes 'elm_hover_', 'elm_object'
290
+ #
291
+ end
292
+ #
293
+ class ElmButton < Efl::Evas::REvasObject
294
+ #
295
+ include Helper
296
+ constructor :elm_button_add
297
+ search_prefixes 'elm_button_', 'elm_object'
298
+ #
299
+ end
300
+ #
301
+ class ElmGenlist < Efl::Evas::REvasObject
302
+ #
303
+ include Helper
304
+ constructor :elm_genlist_add
305
+ search_prefixes 'elm_genlist_', 'elm_object'
306
+ #
307
+ end
308
+ #
174
309
  end
175
310
  end
176
311
  #
data/lib/efl/evas.rb CHANGED
@@ -71,7 +71,7 @@ module Efl
71
71
  yield self if block_given?
72
72
  end
73
73
  def self.release p
74
- Native.evas_free p unless p.nil?
74
+ Native.evas_free p
75
75
  end
76
76
  def free
77
77
  @ptr.autorelease=false if @ptr.is_a? FFI::AutoPointer
@@ -94,35 +94,35 @@ module Efl
94
94
  Evas::REvasBox.new Native.method(:evas_object_box_add), @ptr, &block
95
95
  end
96
96
  def output_size_get
97
- x = FFI::MemoryPointer.new :int
98
- y = FFI::MemoryPointer.new :int
99
- Native.evas_output_size_get @ptr, x, y
100
- [ x.read_int, y.read_int ]
97
+ @ri0 ||= FFI::MemoryPointer.new :int
98
+ @ri1 ||= FFI::MemoryPointer.new :int
99
+ Native.evas_output_size_get @ptr, @ri0, @ri1
100
+ [ @ri0.read_int, @ri1.read_int ]
101
101
  end
102
102
  alias :output_size :output_size_get
103
103
  alias :size :output_size_get
104
104
  def output_viewport_get
105
- x = FFI::MemoryPointer.new :int
106
- y = FFI::MemoryPointer.new :int
107
- w = FFI::MemoryPointer.new :int
108
- h = FFI::MemoryPointer.new :int
109
- Native.evas_output_viewport_get @ptr, x, y, w, h
110
- [ x.read_int, y.read_int, w.read_int, h.read_int ]
105
+ @ri0 ||= FFI::MemoryPointer.new :int
106
+ @ri1 ||= FFI::MemoryPointer.new :int
107
+ @ri2 ||= FFI::MemoryPointer.new :int
108
+ @ri3 ||= FFI::MemoryPointer.new :int
109
+ Native.evas_output_viewport_get @ptr, @ri0, @ri1, @ri2, @ri3
110
+ [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
111
111
  end
112
112
  alias :output_viewport :output_viewport_get
113
113
  alias :viewport :output_viewport_get
114
114
  def pointer_output_xy_get
115
- x = FFI::MemoryPointer.new :int
116
- y = FFI::MemoryPointer.new :int
117
- Native.evas_pointer_output_xy_get @ptr, x, y
118
- [ x.read_int, y.read_int ]
115
+ @ri0 ||= FFI::MemoryPointer.new :int
116
+ @ri1 ||= FFI::MemoryPointer.new :int
117
+ Native.evas_pointer_output_xy_get @ptr, @ri0, @ri1
118
+ [ @ri0.read_int, @ri1.read_int ]
119
119
  end
120
120
  alias :pointer_output :pointer_output_xy_get
121
121
  def pointer_canvas_xy_get
122
- x = FFI::MemoryPointer.new :int
123
- y = FFI::MemoryPointer.new :int
124
- Native.evas_pointer_canvas_xy_get @ptr, x, y
125
- [ x.read_int, y.read_int ]
122
+ @ri0 ||= FFI::MemoryPointer.new :int
123
+ @ri1 ||= FFI::MemoryPointer.new :int
124
+ Native.evas_pointer_canvas_xy_get @ptr, @ri0, @ri1
125
+ [ @ri0.read_int, @ri1.read_int ]
126
126
  end
127
127
  alias :pointer_canvas :pointer_canvas_xy_get
128
128
  end
@@ -138,7 +138,7 @@ module Efl
138
138
  when FFI::Pointer
139
139
  a
140
140
  when Method
141
- FFI::AutoPointer.new a.call(*args), REvasObject.method(:release)
141
+ a.call(*args)
142
142
  else
143
143
  raise ArgumentError.new "wrong argument #{a.class.name}"
144
144
  end
@@ -147,6 +147,13 @@ module Efl
147
147
  end
148
148
  def self.release p
149
149
  Native.evas_object_del p unless p.nil?
150
+ @ri0.free if @ri0
151
+ @ri1.free if @ri1
152
+ @ri2.free if @ri2
153
+ @ri3.free if @ri3
154
+ @rd0.free if @rd0
155
+ @rd1.free if @rd1
156
+ @rs0.free if @rs0
150
157
  end
151
158
  def free
152
159
  @ptr.autorelease=false if @ptr.is_a? FFI::AutoPointer
@@ -165,12 +172,12 @@ module Efl
165
172
  Native.evas_object_type_get @ptr
166
173
  end
167
174
  def geometry_get
168
- x = FFI::MemoryPointer.new :int
169
- y = FFI::MemoryPointer.new :int
170
- w = FFI::MemoryPointer.new :int
171
- h = FFI::MemoryPointer.new :int
172
- Native.evas_object_geometry_get @ptr, x, y, w, h
173
- [ x.read_int, y.read_int, w.read_int, h.read_int ]
175
+ @ri0 ||= FFI::MemoryPointer.new :int
176
+ @ri1 ||= FFI::MemoryPointer.new :int
177
+ @ri2 ||= FFI::MemoryPointer.new :int
178
+ @ri3 ||= FFI::MemoryPointer.new :int
179
+ Native.evas_object_geometry_get @ptr, @ri0, @ri1, @ri2, @ri3
180
+ [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
174
181
  end
175
182
  alias :geometry :geometry_get
176
183
  def center_get
@@ -190,12 +197,12 @@ module Efl
190
197
  Native.evas_object_resize @ptr, *wh
191
198
  end
192
199
  def color_get
193
- r = FFI::MemoryPointer.new :int
194
- g = FFI::MemoryPointer.new :int
195
- b = FFI::MemoryPointer.new :int
196
- a = FFI::MemoryPointer.new :int
197
- Native.evas_object_color_get @ptr, r, g, b, a
198
- [ r.read_int, g.read_int, b.read_int, a.read_int ]
200
+ @ri0 ||= FFI::MemoryPointer.new :int
201
+ @ri1 ||= FFI::MemoryPointer.new :int
202
+ @ri2 ||= FFI::MemoryPointer.new :int
203
+ @ri3 ||= FFI::MemoryPointer.new :int
204
+ Native.evas_object_color_get @ptr, @ri0, @ri1, @ri2, @ri3
205
+ [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
199
206
  end
200
207
  alias :color :color_get
201
208
  def evas_get
@@ -211,32 +218,32 @@ module Efl
211
218
  end
212
219
  alias :below :below_get
213
220
  def size_hint_min_get
214
- w = FFI::MemoryPointer.new :int
215
- h = FFI::MemoryPointer.new :int
216
- Native.evas_object_size_hint_min_get @ptr, w, h
217
- [ w.read_int, h.read_int ]
221
+ @ri0 ||= FFI::MemoryPointer.new :int
222
+ @ri1 ||= FFI::MemoryPointer.new :int
223
+ Native.evas_object_size_hint_min_get @ptr, @ri0, @ri1
224
+ [ @ri0.read_int, @ri1.read_int ]
218
225
  end
219
226
  alias :size_hint_min :size_hint_min_get
220
227
  def size_hint_max_get
221
- w = FFI::MemoryPointer.new :int
222
- h = FFI::MemoryPointer.new :int
223
- Native.evas_object_size_hint_max_get @ptr, w, h
224
- [ w.read_int, h.read_int ]
228
+ @ri0 ||= FFI::MemoryPointer.new :int
229
+ @ri1 ||= FFI::MemoryPointer.new :int
230
+ Native.evas_object_size_hint_max_get @ptr, @ri0, @ri1
231
+ [ @ri0.read_int, @ri1.read_int ]
225
232
  end
226
233
  alias :size_hint_max :size_hint_max_get
227
234
  def size_hint_request_get
228
- w = FFI::MemoryPointer.new :int
229
- h = FFI::MemoryPointer.new :int
230
- Native.evas_object_size_hint_request_get @ptr, w, h
231
- [ w.read_int, h.read_int ]
235
+ @ri0 ||= FFI::MemoryPointer.new :int
236
+ @ri1 ||= FFI::MemoryPointer.new :int
237
+ Native.evas_object_size_hint_request_get @ptr, @ri0, @ri1
238
+ [ @ri0.read_int, @ri1.read_int ]
232
239
  end
233
240
  alias :size_hint_request :size_hint_request_get
234
241
  def size_hint_aspect_get
235
- a = FFI::MemoryPointer.new :int
236
- w = FFI::MemoryPointer.new :int
237
- h = FFI::MemoryPointer.new :int
238
- Native.evas_object_size_hint_aspect_get @ptr, a, w, h
239
- [ Native.enum_type(:evas_aspect_control)[a.read_int], w.read_int, h.read_int ]
242
+ @ri0 ||= FFI::MemoryPointer.new :int
243
+ @ri1 ||= FFI::MemoryPointer.new :int
244
+ @ri2 ||= FFI::MemoryPointer.new :int
245
+ Native.evas_object_size_hint_aspect_get @ptr, @ri0, @ri1, @ri2
246
+ [ Native.enum_type(:evas_aspect_control)[@ri0.read_int], @ri1.read_int, @ri2.read_int ]
240
247
  end
241
248
  alias :size_hint_aspect :size_hint_aspect_get
242
249
  def size_hint_align_set_fill
@@ -244,10 +251,10 @@ module Efl
244
251
  end
245
252
  alias :size_hint_align_fill :size_hint_align_set_fill
246
253
  def size_hint_align_get
247
- w = FFI::MemoryPointer.new :double
248
- h = FFI::MemoryPointer.new :double
249
- Native.evas_object_size_hint_align_get @ptr, w, h
250
- [ w.read_double, h.read_double ]
254
+ @rd0 ||= FFI::MemoryPointer.new :double
255
+ @rd1 ||= FFI::MemoryPointer.new :double
256
+ Native.evas_object_size_hint_align_get @ptr, @rd0, @rd1
257
+ [ @rd0.read_double, @rd1.read_double ]
251
258
  end
252
259
  alias :size_hint_align :size_hint_align_get
253
260
  def size_hint_weight_set_expand
@@ -255,19 +262,19 @@ module Efl
255
262
  end
256
263
  alias :size_hint_weight_expand :size_hint_weight_set_expand
257
264
  def size_hint_weight_get
258
- w = FFI::MemoryPointer.new :double
259
- h = FFI::MemoryPointer.new :double
260
- Native.evas_object_size_hint_weight_get @ptr, w, h
261
- [ w.read_double, h.read_double ]
265
+ @rd0 ||= FFI::MemoryPointer.new :double
266
+ @rd1 ||= FFI::MemoryPointer.new :double
267
+ Native.evas_object_size_hint_weight_get @ptr, @rd0, @rd1
268
+ [ @rd0.read_double, @rd1.read_double ]
262
269
  end
263
270
  alias :size_hint_weight :size_hint_weight_get
264
271
  def size_hint_padding_get
265
- l = FFI::MemoryPointer.new :int
266
- r = FFI::MemoryPointer.new :int
267
- t = FFI::MemoryPointer.new :int
268
- b = FFI::MemoryPointer.new :int
269
- Native.evas_object_size_hint_padding_get @ptr, l, r, t, b
270
- [ l.read_int, r.read_int, t.read_int, b.read_int ]
272
+ @ri0 ||= FFI::MemoryPointer.new :int
273
+ @ri1 ||= FFI::MemoryPointer.new :int
274
+ @ri2 ||= FFI::MemoryPointer.new :int
275
+ @ri3 ||= FFI::MemoryPointer.new :int
276
+ Native.evas_object_size_hint_padding_get @ptr, @ri0, @ri1, @ri2, @ri3
277
+ [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
271
278
  end
272
279
  alias :size_hint_padding :size_hint_padding_get
273
280
  def data_get k
@@ -287,12 +294,12 @@ module Efl
287
294
  search_prefixes 'evas_object_line_'
288
295
  #
289
296
  def line_xy_get
290
- x1 = FFI::MemoryPointer.new :int
291
- y1 = FFI::MemoryPointer.new :int
292
- x2 = FFI::MemoryPointer.new :int
293
- y2 = FFI::MemoryPointer.new :int
294
- Native.evas_object_line_xy_get @ptr, x1, y1, x2, y2
295
- [ x1.read_int, y1.read_int, x2.read_int, y2.read_int ]
297
+ @ri0 ||= FFI::MemoryPointer.new :int
298
+ @ri1 ||= FFI::MemoryPointer.new :int
299
+ @ri2 ||= FFI::MemoryPointer.new :int
300
+ @ri3 ||= FFI::MemoryPointer.new :int
301
+ Native.evas_object_line_xy_get @ptr, @ri0, @ri1, @ri2, @ri3
302
+ [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
296
303
  end
297
304
  end
298
305
  #
@@ -311,73 +318,73 @@ module Efl
311
318
  search_prefixes 'evas_object_text_'
312
319
  #
313
320
  def font_get
314
- f = FFI::MemoryPointer.new :string
315
- s = FFI::MemoryPointer.new :int
316
- Native.evas_object_text_font_get @ptr, f, s
317
- [ f.read_pointer.read_string, s.read_int ]
321
+ @rs0 ||= FFI::MemoryPointer.new :string
322
+ @ri0 ||= FFI::MemoryPointer.new :int
323
+ Native.evas_object_text_font_get @ptr, @rs0, @ri0
324
+ [ @rs0.read_pointer.read_string, @ri0.read_int ]
318
325
  end
319
326
  alias :font :font_get
320
327
  def char_pos_get pos
321
- cx = FFI::MemoryPointer.new :int
322
- cy = FFI::MemoryPointer.new :int
323
- cw = FFI::MemoryPointer.new :int
324
- ch = FFI::MemoryPointer.new :int
325
- Native.evas_object_text_char_pos_get @ptr, pos, cx, cy, cw, ch
326
- return [ cx.read_int, cy.read_int, cw.read_int, ch.read_int ]
328
+ @ri0 ||= FFI::MemoryPointer.new :int
329
+ @ri1 ||= FFI::MemoryPointer.new :int
330
+ @ri2 ||= FFI::MemoryPointer.new :int
331
+ @ri3 ||= FFI::MemoryPointer.new :int
332
+ Native.evas_object_text_char_pos_get @ptr, pos, @ri0, @ri1, @ri2, @ri3
333
+ return [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
327
334
  end
328
335
  alias :char_pos :char_pos_get
329
336
  def char_coords_get x, y
330
- cx = FFI::MemoryPointer.new :int
331
- cy = FFI::MemoryPointer.new :int
332
- cw = FFI::MemoryPointer.new :int
333
- ch = FFI::MemoryPointer.new :int
334
- r = Native.evas_object_text_char_coords_get @ptr, x, y, cx, cy, cw, ch
335
- return [ r, cx.read_int, cy.read_int, cw.read_int, ch.read_int ]
337
+ @ri0 ||= FFI::MemoryPointer.new :int
338
+ @ri1 ||= FFI::MemoryPointer.new :int
339
+ @ri2 ||= FFI::MemoryPointer.new :int
340
+ @ri3 ||= FFI::MemoryPointer.new :int
341
+ r = Native.evas_object_text_char_coords_get @ptr, x, y, @ri0, @ri1, @ri2, @ri3
342
+ return [ r, @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
336
343
  end
337
344
  alias :char_coords :char_coords_get
338
345
  def style_pad_get
339
- l = FFI::MemoryPointer.new :int
340
- r = FFI::MemoryPointer.new :int
341
- t = FFI::MemoryPointer.new :int
342
- b = FFI::MemoryPointer.new :int
343
- Native.evas_object_text_shadow_color_get @ptr, l, r, t, b
344
- return [ l.read_int, r.read_int, t.read_int, b.read_int ]
346
+ @ri0 ||= FFI::MemoryPointer.new :int
347
+ @ri1 ||= FFI::MemoryPointer.new :int
348
+ @ri2 ||= FFI::MemoryPointer.new :int
349
+ @ri3 ||= FFI::MemoryPointer.new :int
350
+ Native.evas_object_text_shadow_color_get @ptr, @ri0, @ri1, @ri2, @ri3
351
+ return [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
345
352
  end
346
353
  alias :style_pad :style_pad_get
347
354
  def shadow_color_get
348
- r = FFI::MemoryPointer.new :int
349
- g = FFI::MemoryPointer.new :int
350
- b = FFI::MemoryPointer.new :int
351
- a = FFI::MemoryPointer.new :int
352
- Native.evas_object_text_shadow_color_get @ptr, r, g, b, a
353
- return [ r.read_int, g.read_int, b.read_int, a.read_int ]
355
+ @ri0 ||= FFI::MemoryPointer.new :int
356
+ @ri1 ||= FFI::MemoryPointer.new :int
357
+ @ri2 ||= FFI::MemoryPointer.new :int
358
+ @ri3 ||= FFI::MemoryPointer.new :int
359
+ Native.evas_object_text_shadow_color_get @ptr, @ri0, @ri1, @ri2, @ri3
360
+ return [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
354
361
  end
355
362
  alias :shadow_color :shadow_color_get
356
363
  def glow_color_get
357
- r = FFI::MemoryPointer.new :int
358
- g = FFI::MemoryPointer.new :int
359
- b = FFI::MemoryPointer.new :int
360
- a = FFI::MemoryPointer.new :int
361
- Native.evas_object_text_glow_color_get @ptr, r, g, b, a
362
- return [ r.read_int, g.read_int, b.read_int, a.read_int ]
364
+ @ri0 ||= FFI::MemoryPointer.new :int
365
+ @ri1 ||= FFI::MemoryPointer.new :int
366
+ @ri2 ||= FFI::MemoryPointer.new :int
367
+ @ri3 ||= FFI::MemoryPointer.new :int
368
+ Native.evas_object_text_glow_color_get @ptr, @ri0, @ri1, @ri2, @ri3
369
+ return [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
363
370
  end
364
371
  alias :glow_color :glow_color_get
365
372
  def glow2_color_get
366
- r = FFI::MemoryPointer.new :int
367
- g = FFI::MemoryPointer.new :int
368
- b = FFI::MemoryPointer.new :int
369
- a = FFI::MemoryPointer.new :int
370
- Native.evas_object_text_glow2_color_get @ptr, r, g, b, a
371
- return [ r.read_int, g.read_int, b.read_int, a.read_int ]
373
+ @ri0 ||= FFI::MemoryPointer.new :int
374
+ @ri1 ||= FFI::MemoryPointer.new :int
375
+ @ri2 ||= FFI::MemoryPointer.new :int
376
+ @ri3 ||= FFI::MemoryPointer.new :int
377
+ Native.evas_object_text_glow2_color_get @ptr, @ri0, @ri1, @ri2, @ri3
378
+ return [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
372
379
  end
373
380
  alias :glow2_color :glow2_color_get
374
381
  def outline_color_get
375
- r = FFI::MemoryPointer.new :int
376
- g = FFI::MemoryPointer.new :int
377
- b = FFI::MemoryPointer.new :int
378
- a = FFI::MemoryPointer.new :int
379
- Native.evas_object_text_outline_color_get @ptr, r, g, b, a
380
- return [ r.read_int, g.read_int, b.read_int, a.read_int ]
382
+ @ri0 ||= FFI::MemoryPointer.new :int
383
+ @ri1 ||= FFI::MemoryPointer.new :int
384
+ @ri2 ||= FFI::MemoryPointer.new :int
385
+ @ri3 ||= FFI::MemoryPointer.new :int
386
+ Native.evas_object_text_outline_color_get @ptr, @ri0, @ri1, @ri2, @ri3
387
+ return [ @ri0.read_int, @ri1.read_int, @ri2.read_int, @ri3.read_int ]
381
388
  end
382
389
  alias :outline_color :outline_color_get
383
390
  end
@@ -391,17 +398,17 @@ module Efl
391
398
  end
392
399
  alias :children :children_get
393
400
  def align_get
394
- h = FFI::MemoryPointer.new :double
395
- v = FFI::MemoryPointer.new :double
396
- Native.evas_object_box_align_get @ptr, h, v
397
- [ h.read_double, v.read_double ]
401
+ @rd0 ||= FFI::MemoryPointer.new :double
402
+ @rd1 ||= FFI::MemoryPointer.new :double
403
+ Native.evas_object_box_align_get @ptr, @rd0, @rd1
404
+ [ @rd0.read_double, @rd1.read_double ]
398
405
  end
399
406
  alias :align :align_get
400
407
  def padding_get
401
- h = FFI::MemoryPointer.new :int
402
- v = FFI::MemoryPointer.new :int
403
- Native.evas_object_box_padding_get @ptr, h, v
404
- [ h.read_int, v.read_int ]
408
+ @ri0 ||= FFI::MemoryPointer.new :int
409
+ @ri1 ||= FFI::MemoryPointer.new :int
410
+ Native.evas_object_box_padding_get @ptr, @ri0, @ri1
411
+ [ @ri0.read_int, @ri1.read_int ]
405
412
  end
406
413
  alias :padding :padding_get
407
414
  end