ffi-efl 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,13 +27,12 @@ module Efl
27
27
  enum :evas_bidi_direction, [ :evas_bidi_direction_natural, :evas_bidi_direction_ltr, :evas_bidi_direction_rtl ]
28
28
  typedef :pointer, :evas_bidi_direction_p
29
29
  # typedef enum _Evas_Callback_Type {...} Evas_Callback_Type;
30
- enum :evas_callback_type, [ :evas_callback_mouse_in, :evas_callback_mouse_out, :evas_callback_mouse_down, :evas_callback_mouse_up,
31
- :evas_callback_mouse_move, :evas_callback_mouse_wheel, :evas_callback_multi_down, :evas_callback_multi_up, :evas_callback_multi_move,
32
- :evas_callback_free, :evas_callback_key_down, :evas_callback_key_up, :evas_callback_focus_in, :evas_callback_focus_out, :evas_callback_show,
33
- :evas_callback_hide, :evas_callback_move, :evas_callback_resize, :evas_callback_restack, :evas_callback_del, :evas_callback_hold,
34
- :evas_callback_changed_size_hints, :evas_callback_image_preloaded, :evas_callback_canvas_focus_in, :evas_callback_canvas_focus_out,
35
- :evas_callback_render_flush_pre, :evas_callback_render_flush_post, :evas_callback_canvas_object_focus_in, :evas_callback_canvas_object_focus_out,
36
- :evas_callback_image_unloaded, :evas_callback_last ]
30
+ enum :evas_callback_type, [ :evas_callback_mouse_in, :evas_callback_mouse_out, :evas_callback_mouse_down, :evas_callback_mouse_up, :evas_callback_mouse_move,
31
+ :evas_callback_mouse_wheel, :evas_callback_multi_down, :evas_callback_multi_up, :evas_callback_multi_move, :evas_callback_free, :evas_callback_key_down,
32
+ :evas_callback_key_up, :evas_callback_focus_in, :evas_callback_focus_out, :evas_callback_show, :evas_callback_hide, :evas_callback_move, :evas_callback_resize,
33
+ :evas_callback_restack, :evas_callback_del, :evas_callback_hold, :evas_callback_changed_size_hints, :evas_callback_image_preloaded, :evas_callback_canvas_focus_in,
34
+ :evas_callback_canvas_focus_out, :evas_callback_render_flush_pre, :evas_callback_render_flush_post, :evas_callback_canvas_object_focus_in,
35
+ :evas_callback_canvas_object_focus_out, :evas_callback_image_unloaded, :evas_callback_last ]
37
36
  # typedef enum _Evas_Button_Flags {...} Evas_Button_Flags;
38
37
  enum :evas_button_flags, [ :evas_button_none, 0, :evas_button_double_click, :evas_button_triple_click ]
39
38
  # typedef enum _Evas_Event_Flags {...} Evas_Event_Flags;
@@ -41,19 +40,18 @@ module Efl
41
40
  # typedef enum _Evas_Font_Hinting_Flags {...} Evas_Font_Hinting_Flags;
42
41
  enum :evas_font_hinting_flags, [ :evas_font_hinting_none, :evas_font_hinting_auto, :evas_font_hinting_bytecode ]
43
42
  # typedef enum _Evas_Colorspace {...} Evas_Colorspace;
44
- enum :evas_colorspace, [ :evas_colorspace_argb8888, :evas_colorspace_ycbcr422p601_pl, :evas_colorspace_ycbcr422p709_pl,
45
- :evas_colorspace_rgb565_a5p, :evas_colorspace_gry8 ]
43
+ enum :evas_colorspace, [ :evas_colorspace_argb8888, :evas_colorspace_ycbcr422p601_pl, :evas_colorspace_ycbcr422p709_pl, :evas_colorspace_rgb565_a5p,
44
+ :evas_colorspace_gry8 ]
46
45
  # typedef enum _Evas_Object_Table_Homogeneous_Mode {...} Evas_Object_Table_Homogeneous_Mode;
47
- enum :evas_object_table_homogeneous_mode, [ :evas_object_table_homogeneous_none, 0, :evas_object_table_homogeneous_table, 1,
48
- :evas_object_table_homogeneous_item, 2 ]
46
+ enum :evas_object_table_homogeneous_mode, [ :evas_object_table_homogeneous_none, 0, :evas_object_table_homogeneous_table, 1, :evas_object_table_homogeneous_item,
47
+ 2 ]
49
48
  # typedef enum _Evas_Aspect_Control {...} Evas_Aspect_Control;
50
- enum :evas_aspect_control, [ :evas_aspect_control_none, 0, :evas_aspect_control_neither, 1, :evas_aspect_control_horizontal, 2,
51
- :evas_aspect_control_vertical, 3, :evas_aspect_control_both, 4 ]
49
+ enum :evas_aspect_control, [ :evas_aspect_control_none, 0, :evas_aspect_control_neither, 1, :evas_aspect_control_horizontal, 2, :evas_aspect_control_vertical, 3,
50
+ :evas_aspect_control_both, 4 ]
52
51
  typedef :pointer, :evas_aspect_control_p
53
52
  # typedef enum _Evas_Load_Error {...} Evas_Load_Error;
54
- enum :evas_load_error, [ :evas_load_error_none, 0, :evas_load_error_generic, 1, :evas_load_error_does_not_exist, 2,
55
- :evas_load_error_permission_denied, 3, :evas_load_error_resource_allocation_failed, 4, :evas_load_error_corrupt_file, 5,
56
- :evas_load_error_unknown_format, 6 ]
53
+ enum :evas_load_error, [ :evas_load_error_none, 0, :evas_load_error_generic, 1, :evas_load_error_does_not_exist, 2, :evas_load_error_permission_denied, 3,
54
+ :evas_load_error_resource_allocation_failed, 4, :evas_load_error_corrupt_file, 5, :evas_load_error_unknown_format, 6 ]
57
55
  # typedef enum _Evas_Alloc_Error {...} Evas_Alloc_Error;
58
56
  enum :evas_alloc_error, [ :evas_alloc_error_none, 0, :evas_alloc_error_fatal, 1, :evas_alloc_error_recovered, 2 ]
59
57
  # typedef enum _Evas_Fill_Spread {...} Evas_Fill_Spread;
@@ -65,8 +63,7 @@ module Efl
65
63
  enum :evas_native_surface_type, [ :evas_native_surface_none, :evas_native_surface_x11, :evas_native_surface_opengl ]
66
64
  # typedef enum _Evas_Render_Op {...} Evas_Render_Op;
67
65
  enum :evas_render_op, [ :evas_render_blend, 0, :evas_render_blend_rel, 1, :evas_render_copy, 2, :evas_render_copy_rel, 3, :evas_render_add, 4,
68
- :evas_render_add_rel, 5, :evas_render_sub, 6, :evas_render_sub_rel, 7, :evas_render_tint, 8, :evas_render_tint_rel, 9, :evas_render_mask, 10,
69
- :evas_render_mul, 11 ]
66
+ :evas_render_add_rel, 5, :evas_render_sub, 6, :evas_render_sub_rel, 7, :evas_render_tint, 8, :evas_render_tint_rel, 9, :evas_render_mask, 10, :evas_render_mul, 11 ]
70
67
  # typedef enum _Evas_Border_Fill_Mode {...} Evas_Border_Fill_Mode;
71
68
  enum :evas_border_fill_mode, [ :evas_border_fill_none, 0, :evas_border_fill_default, 1, :evas_border_fill_solid, 2 ]
72
69
  # typedef enum _Evas_Image_Scale_Hint {...} Evas_Image_Scale_Hint;
@@ -78,11 +75,10 @@ module Efl
78
75
  # typedef enum _Evas_Object_Pointer_Mode {...} Evas_Object_Pointer_Mode;
79
76
  enum :evas_object_pointer_mode, [ :evas_object_pointer_mode_autograb, :evas_object_pointer_mode_nograb ]
80
77
  # typedef enum _Evas_Text_Style_Type {...} Evas_Text_Style_Type;
81
- enum :evas_text_style_type, [ :evas_text_style_plain, :evas_text_style_shadow, :evas_text_style_outline, :evas_text_style_soft_outline,
82
- :evas_text_style_glow, :evas_text_style_outline_shadow, :evas_text_style_far_shadow, :evas_text_style_outline_soft_shadow,
83
- :evas_text_style_soft_shadow, :evas_text_style_far_soft_shadow, :evas_text_style_shadow_direction_bottom_right,
84
- :evas_text_style_shadow_direction_bottom, :evas_text_style_shadow_direction_bottom_left, :evas_text_style_shadow_direction_left,
85
- :evas_text_style_shadow_direction_top_left, :evas_text_style_shadow_direction_top, :evas_text_style_shadow_direction_top_right,
78
+ enum :evas_text_style_type, [ :evas_text_style_plain, :evas_text_style_shadow, :evas_text_style_outline, :evas_text_style_soft_outline, :evas_text_style_glow,
79
+ :evas_text_style_outline_shadow, :evas_text_style_far_shadow, :evas_text_style_outline_soft_shadow, :evas_text_style_soft_shadow, :evas_text_style_far_soft_shadow,
80
+ :evas_text_style_shadow_direction_bottom_right, :evas_text_style_shadow_direction_bottom, :evas_text_style_shadow_direction_bottom_left,
81
+ :evas_text_style_shadow_direction_left, :evas_text_style_shadow_direction_top_left, :evas_text_style_shadow_direction_top, :evas_text_style_shadow_direction_top_right,
86
82
  :evas_text_style_shadow_direction_right ]
87
83
  # typedef enum _Evas_Textblock_Text_Type {...} Evas_Textblock_Text_Type;
88
84
  enum :evas_textblock_text_type, [ :evas_textblock_text_raw, :evas_textblock_text_plain, :evas_textblock_text_markup ]
@@ -91,12 +87,13 @@ module Efl
91
87
  # typedef enum {...} Evas_Filter_Mode;
92
88
  enum :evas_filter_mode, [ :evas_filter_mode_object, :evas_filter_mode_below ]
93
89
  # typedef enum {...} Evas_Filter;
94
- enum :evas_filter, [ :evas_filter_none, :evas_filter_blur, :evas_filter_invert, :evas_filter_solarize, :evas_filter_sepia,
95
- :evas_filter_greyscale, :evas_filter_grayscale, :evas_filter_brightness, :evas_filter_contrast, :evas_filter_last ]
90
+ enum :evas_filter, [ :evas_filter_none, :evas_filter_blur, :evas_filter_invert, :evas_filter_solarize, :evas_filter_sepia, :evas_filter_greyscale,
91
+ :evas_filter_grayscale, :evas_filter_brightness, :evas_filter_contrast, :evas_filter_last ]
96
92
  #
97
93
  # TYPEDEFS
98
94
  # typedef struct _Evas_Version Evas_Version;
99
95
  typedef :pointer, :evas_version
96
+ typedef :pointer, :evas_version_p
100
97
  # typedef struct _Evas_Coord_Rectangle Evas_Coord_Rectangle;
101
98
  typedef :pointer, :evas_coord_rectangle
102
99
  # typedef struct _Evas_Point Evas_Point;
@@ -257,10 +254,12 @@ module Efl
257
254
  # typedef void (*Evas_Object_Box_Layout) (Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data);
258
255
  callback :evas_object_box_layout, [ :evas_object_p, :evas_object_box_data_p, :void_p ], :void
259
256
  #
257
+ # VARIABLES
258
+ # EAPI extern Evas_Version *evas_version;
259
+ attach_variable :evas_version, :evas_version_p
260
+ #
260
261
  # FUNCTIONS
261
262
  fcts = [
262
- # EAPI extern Evas_Version *evas_version;
263
- # FIXME
264
263
  # EAPI int evas_init (void);
265
264
  [ :evas_init, [ ], :int ],
266
265
  # EAPI int evas_shutdown (void);
@@ -366,14 +365,13 @@ module Efl
366
365
  # EAPI void evas_event_feed_mouse_out (Evas *e, unsigned int timestamp, const void *data);
367
366
  [ :evas_event_feed_mouse_out, [ :evas_p, :uint, :void_p ], :void ],
368
367
  # EAPI void evas_event_feed_multi_down (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
369
- [ :evas_event_feed_multi_down, [ :evas_p, :int, :int, :int, :double, :double, :double, :double, :double, :double, :double, :evas_button_flags,
370
- :uint, :void_p ], :void ],
368
+ [ :evas_event_feed_multi_down, [ :evas_p, :int, :int, :int, :double, :double, :double, :double, :double, :double, :double, :evas_button_flags, :uint, :void_p ],
369
+ :void ],
371
370
  # EAPI void evas_event_feed_multi_up (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
372
- [ :evas_event_feed_multi_up, [ :evas_p, :int, :int, :int, :double, :double, :double, :double, :double, :double, :double, :evas_button_flags,
373
- :uint, :void_p ], :void ],
374
- # EAPI void evas_event_feed_multi_move (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data);
375
- [ :evas_event_feed_multi_move, [ :evas_p, :int, :int, :int, :double, :double, :double, :double, :double, :double, :double, :uint, :void_p ],
371
+ [ :evas_event_feed_multi_up, [ :evas_p, :int, :int, :int, :double, :double, :double, :double, :double, :double, :double, :evas_button_flags, :uint, :void_p ],
376
372
  :void ],
373
+ # EAPI void evas_event_feed_multi_move (Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data);
374
+ [ :evas_event_feed_multi_move, [ :evas_p, :int, :int, :int, :double, :double, :double, :double, :double, :double, :double, :uint, :void_p ], :void ],
377
375
  # EAPI void evas_event_feed_mouse_cancel (Evas *e, unsigned int timestamp, const void *data);
378
376
  [ :evas_event_feed_mouse_cancel, [ :evas_p, :uint, :void_p ], :void ],
379
377
  # EAPI void evas_event_feed_mouse_wheel (Evas *e, int direction, int z, unsigned int timestamp, const void *data);
@@ -991,8 +989,7 @@ module Efl
991
989
  # EAPI char *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur);
992
990
  [ :evas_textblock_cursor_content_get, [ :evas_textblock_cursor_p ], :string ],
993
991
  # EAPI int evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype);
994
- [ :evas_textblock_cursor_geometry_get, [ :evas_textblock_cursor_p, :int_p, :int_p, :int_p, :int_p, :evas_bidi_direction_p,
995
- :evas_textblock_cursor_type ], :int ],
992
+ [ :evas_textblock_cursor_geometry_get, [ :evas_textblock_cursor_p, :int_p, :int_p, :int_p, :int_p, :evas_bidi_direction_p, :evas_textblock_cursor_type ], :int ],
996
993
  # EAPI int evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
997
994
  [ :evas_textblock_cursor_char_geometry_get, [ :evas_textblock_cursor_p, :int_p, :int_p, :int_p, :int_p ], :int ],
998
995
  # EAPI int evas_textblock_cursor_pen_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cpen_x, Evas_Coord *cy, Evas_Coord *cadv, Evas_Coord *ch);
@@ -1074,11 +1071,9 @@ module Efl
1074
1071
  # EAPI Eina_Bool evas_object_smart_callbacks_descriptions_set(Evas_Object *obj, const Evas_Smart_Cb_Description *descriptions);
1075
1072
  [ :evas_object_smart_callbacks_descriptions_set, [ :evas_object_p, :evas_smart_cb_description_p ], :eina_bool ],
1076
1073
  # EAPI void evas_object_smart_callbacks_descriptions_get(const Evas_Object *obj, const Evas_Smart_Cb_Description ***class_descriptions, unsigned int *class_count, const Evas_Smart_Cb_Description ***instance_descriptions, unsigned int *instance_count);
1077
- [ :evas_object_smart_callbacks_descriptions_get, [ :evas_object_p, :evas_smart_cb_description_ppp, :uint_p, :evas_smart_cb_description_ppp,
1078
- :uint_p ], :void ],
1074
+ [ :evas_object_smart_callbacks_descriptions_get, [ :evas_object_p, :evas_smart_cb_description_ppp, :uint_p, :evas_smart_cb_description_ppp, :uint_p ], :void ],
1079
1075
  # EAPI void evas_object_smart_callback_description_find(const Evas_Object *obj, const char *name, const Evas_Smart_Cb_Description **class_description, const Evas_Smart_Cb_Description **instance_description);
1080
- [ :evas_object_smart_callback_description_find, [ :evas_object_p, :string, :evas_smart_cb_description_pp, :evas_smart_cb_description_pp ],
1081
- :void ],
1076
+ [ :evas_object_smart_callback_description_find, [ :evas_object_p, :string, :evas_smart_cb_description_pp, :evas_smart_cb_description_pp ], :void ],
1082
1077
  # EAPI void evas_object_smart_changed (Evas_Object *obj);
1083
1078
  [ :evas_object_smart_changed, [ :evas_object_p ], :void ],
1084
1079
  # EAPI void evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value);
data/lib/efl.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  #
5
5
  module Efl
6
6
  #
7
- VERSION = '0.0.5'
7
+ VERSION = '0.0.6'
8
8
  #
9
9
  autoload :EcoreEvas, './lib/efl/ecore_evas.rb'
10
10
  autoload :EcoreGetopt, './lib/efl/ecore_getopt.rb'
@@ -12,8 +12,9 @@ module Efl
12
12
  autoload :Ecore, './lib/efl/ecore.rb'
13
13
  autoload :Edje, './lib/efl/edje.rb'
14
14
  autoload :Eet, './lib/efl/eet.rb'
15
- autoload :EinHash, './lib/efl/eina_hash.rb'
15
+ autoload :EinaHash, './lib/efl/eina_hash.rb'
16
16
  autoload :EinaList, './lib/efl/eina_list.rb'
17
+ autoload :EinaLog, './lib/efl/eina_log.rb'
17
18
  autoload :Eina, './lib/efl/eina.rb'
18
19
  autoload :Elm, './lib/efl/elementary.rb'
19
20
  autoload :Evas, './lib/efl/evas.rb'
@@ -2,25 +2,17 @@
2
2
  # -*- coding: UTF-8 -*-
3
3
  #
4
4
  require 'efl/eina_list'
5
- require 'efl/evas'
6
- require 'efl/ecore'
7
5
  require 'efl/ecore_evas'
8
- #
9
- def ecore_loop n
10
- n.downto(0) do
11
- sleep 0.1
12
- Efl::Ecore.main_loop_iterate
13
- end
14
- end
6
+ require './spec/helper'
15
7
  #
16
8
  describe Efl::EcoreEvas do
17
9
  #
18
10
  before(:all) do
19
11
  EcoreEvas = Efl::EcoreEvas
20
- EcoreEvas.init
12
+ EcoreEvas.init.should==1
21
13
  end
22
14
  after(:all) do
23
- EcoreEvas.shutdown
15
+ EcoreEvas.shutdown.should==0
24
16
  end
25
17
  #
26
18
  it "should init" do
@@ -33,7 +25,7 @@ describe Efl::EcoreEvas do
33
25
  EcoreEvas.shutdown.should == 1
34
26
  end
35
27
  #
36
- it "should work" do
28
+ it "engines get/list/free" do
37
29
  EcoreEvas.engines_free EcoreEvas.engines_get
38
30
  l = EcoreEvas.engines_list
39
31
  r = l.inject("\t") do |s,e| s+=e.read_string+' ' end
@@ -41,7 +33,7 @@ describe Efl::EcoreEvas do
41
33
  EcoreEvas.engines_free l
42
34
  end
43
35
  #
44
- it "ecore_evas_list should work" do
36
+ it "ecore_evas_list" do
45
37
  el = EcoreEvas.ecore_evas_list
46
38
  el.to_ary.length.should == 0
47
39
  el.free
@@ -57,7 +49,7 @@ describe Efl::EcoreEvas do
57
49
  #
58
50
  describe Efl::EcoreEvas::REcoreEvas do
59
51
  before(:all) {
60
- EcoreEvas.init
52
+ EcoreEvas.init.should == 2
61
53
  }
62
54
  before(:each) do
63
55
  @e = EcoreEvas::REcoreEvas.new :engine_name=>"software_x11", :x=>10, :y=>10, :w=>100, :h=>120
@@ -75,37 +67,43 @@ describe Efl::EcoreEvas do
75
67
  @e.free
76
68
  end
77
69
  after(:all) do
78
- EcoreEvas.shutdown
70
+ EcoreEvas.shutdown.should == 1
79
71
  end
80
72
  #
81
- it "engine_name_get should work" do
73
+ it "engine_name_get " do
82
74
  @e.engine_name_get.should == "software_x11"
83
75
  end
84
76
  #
85
- it "data get/set should work" do
77
+ it "data get/set " do
86
78
  @e.data_set 'key', '666'
87
79
  @e.data_get('key').read_string.should == '666'
88
80
  end
89
81
  #
90
- it "move, resize move_resize and geometry_get should work (and check association)" do
82
+ it "move, resize move_resize and geometry_get (and check association)" do
91
83
  @e.geometry_get.should == [10,10,100,120]
92
84
  @bg.geometry_get.should == [0,0,100,120]
93
- @e.move 20, 17 # w+23 window bar height
85
+ @e.move 20, 20
94
86
  ecore_loop 3
95
- @e.geometry_get.should == [20,40,100,120]
87
+ g = @e.geometry_get
88
+ g.delete_at 1
89
+ g.should == [20,100,120]
96
90
  @bg.geometry_get.should == [0,0,100,120]
97
91
  @e.resize 200,150
98
92
  ecore_loop 3
99
- @e.geometry_get.should == [20,40,200,150]
93
+ g = @e.geometry_get
94
+ g.delete_at 1
95
+ g.should == [20,200,150]
100
96
  @bg.geometry_get.should == [0,0,200,150]
101
97
  @e.move_resize 10, 0, 130, 100
102
98
  ecore_loop 3
103
- @e.geometry_get.should == [10,23,130,100]
99
+ g = @e.geometry_get
100
+ g.delete_at 1
101
+ g.should == [10,130,100]
104
102
  @bg.geometry_get.should == [0,0,130,100]
105
103
  g = @e.geometry_get
106
104
  end
107
105
  #
108
- it "rotation should work" do
106
+ it "rotation " do
109
107
  @e.rotation_set 25
110
108
  @e.rotation_get.should == 25
111
109
  @e.rotation = 50
@@ -114,31 +112,19 @@ describe Efl::EcoreEvas do
114
112
  @e.rotation_get.should == 0
115
113
  end
116
114
  #
117
- it "shaped get/set should work" do
118
- @e.shaped?.should be_false
119
- @e.shaped_set true
120
- @e.shaped_get.should be_true
121
- @e.shaped = false
122
- @e.shaped?.should be_false
115
+ it "shaped get/set " do
116
+ bool_check @e, 'shaped'
123
117
  end
124
118
  #
125
- it "alpha get/set should work" do
126
- @e.alpha?.should be_false
127
- @e.alpha_set true
128
- @e.alpha_get.should be_true
129
- @e.alpha = false
130
- @e.alpha?.should be_false
119
+ it "alpha get/set " do
120
+ bool_check @e, 'alpha'
131
121
  end
132
122
  #
133
- it "transparent get/set should work" do
134
- @e.transparent?.should be_false
135
- @e.transparent_set true
136
- @e.transparent_get.should be_true
137
- @e.transparent = false
138
- @e.transparent?.should be_false
123
+ it "transparent get/set " do
124
+ bool_check @e, 'transparent'
139
125
  end
140
126
  #
141
- it "show hide visibility should work" do
127
+ it "show hide visibility " do
142
128
  ecore_loop 3
143
129
  @e.visibility?.should == 1
144
130
  @e.hide
@@ -149,13 +135,13 @@ describe Efl::EcoreEvas do
149
135
  @e.visibility?.should == 1
150
136
  end
151
137
  #
152
- it "raise lower activate should work" do
138
+ it "raise lower activate " do
153
139
  @e.raise
154
140
  @e.lower
155
141
  @e.activate
156
142
  end
157
143
  #
158
- it "title set/get should work" do
144
+ it "title set/get " do
159
145
  @e.title_set "title"
160
146
  @e.title_get.should == "title"
161
147
  @e.title = "other"
@@ -163,41 +149,41 @@ describe Efl::EcoreEvas do
163
149
  end
164
150
  #
165
151
  #
166
- it "name_class set/get should work" do
152
+ it "name_class set/get " do
167
153
  @e.name_class_set "name", "class"
168
154
  @e.name_class_get.should == ['name','class']
169
155
  @e.name_class = "name1", "class1"
170
156
  @e.name_class_get.should == ['name1','class1']
171
157
  end
172
158
  #
173
- it "size_min set/get should work" do
159
+ it "size_min set/get " do
174
160
  @e.size_min_set 20, 30
175
161
  @e.size_min_get.should == [20, 30]
176
162
  end
177
163
  #
178
- it "size_max set/get should work" do
164
+ it "size_max set/get " do
179
165
  @e.size_max_set 20, 30
180
166
  @e.size_max_get.should == [20, 30]
181
167
  end
182
168
  #
183
- it "size_base set/get should work" do
169
+ it "size_base set/get " do
184
170
  @e.size_base_set 20, 30
185
171
  @e.size_base_get.should == [20, 30]
186
172
  end
187
173
  #
188
- it "size_step set/get should work" do
174
+ it "size_step set/get " do
189
175
  @e.size_step_set 20, 30
190
176
  @e.size_step_get.should == [20, 30]
191
177
  end
192
178
  #
193
- it "layer set/get should work" do
179
+ it "layer set/get " do
194
180
  @e.layer_set 2
195
181
  @e.layer_get.should == 2
196
182
  @e.layer = 1
197
183
  @e.layer?.should == 1
198
184
  end
199
185
  #
200
- it "focus set/get should work" do
186
+ it "focus set/get " do
201
187
  @e.focus?.should be_false
202
188
  @e.focus_set true
203
189
  ecore_loop 3
@@ -205,49 +191,29 @@ describe Efl::EcoreEvas do
205
191
  @e.focus?.should be_true
206
192
  end
207
193
  #
208
- it "iconified set/get should work" do
209
- @e.iconified_set true
210
- @e.iconified_get.should be_true
211
- @e.iconified = false
212
- @e.iconified?.should be_false
194
+ it "iconified set/get " do
195
+ bool_check @e, 'iconified'
213
196
  end
214
197
  #
215
- it "borderless set/get should work" do
216
- @e.borderless_set true
217
- @e.borderless_get.should be_true
218
- @e.borderless = false
219
- @e.borderless?.should be_false
198
+ it "borderless set/get " do
199
+ bool_check @e, 'borderless'
220
200
  end
221
201
  #
222
- it "override set/get should work" do
223
- @e.override_set true
224
- @e.override_get.should be_true
225
- @e.override = false
226
- @e.override?.should be_false
202
+ it "override set/get " do
203
+ bool_check @e, 'override'
227
204
  end
228
205
  #
229
206
  # FIXME maximized
230
207
  # ecore/src/lib/ecore_evas/ecore_evas.c => ecore_evas_maximized_set => IFC => return
231
- # it "maximized set/get should work" do
232
- # @e.maximized?.should be_false
233
- # @e.maximized_set true
234
- # ecore_loop 10
235
- # @e.maximized_get.should be_true
236
- # @e.maximized = false
237
- # ecore_loop 3
238
- # @e.maximized?.should be_false
239
- # end
240
- #
241
- it "fullscreen set/get should work" do
242
- @e.fullscreen_set true
243
- ecore_loop 3
244
- @e.fullscreen_get.should be_true
245
- @e.fullscreen = false
246
- ecore_loop 3
247
- @e.fullscreen?.should be_false
208
+ it "maximized set/get " do
209
+ bool_check @e, 'maximized', 5
210
+ end
211
+ #
212
+ it "fullscreen set/get " do
213
+ bool_check @e, 'fullscreen', 5
248
214
  end
249
215
  #
250
- it "avoid_damage set/get should work" do
216
+ it "avoid_damage set/get " do
251
217
  @e.avoid_damage_set :ecore_evas_avoid_damage_expose
252
218
  ecore_loop 3
253
219
  @e.avoid_damage_get.should == :ecore_evas_avoid_damage_expose
@@ -256,44 +222,31 @@ describe Efl::EcoreEvas do
256
222
  @e.avoid_damage?.should == :ecore_evas_avoid_damage_built_in
257
223
  end
258
224
  #
259
- it "withdrawn set/get should work" do
260
- @e.withdrawn_set true
261
- @e.withdrawn_get.should be_true
262
- @e.withdrawn = false
263
- @e.withdrawn?.should be_false
225
+ it "withdrawn set/get " do
226
+ bool_check @e, 'withdrawn'
264
227
  end
265
228
  #
266
- it "sticky set/get should work" do
267
- @e.sticky_set true
268
- ecore_loop 3
269
- @e.sticky_get.should be_true
270
- @e.sticky = false
271
- ecore_loop 3
272
- @e.sticky?.should be_false
229
+ it "sticky set/get " do
230
+ bool_check @e, 'sticky', 3
273
231
  end
274
232
  #
275
- it "ignore_events set/get should work" do
276
- @e.ignore_events_set true
277
- @e.ignore_events_get.should be_true
278
- @e.ignore_events = false
279
- @e.ignore_events?.should be_false
233
+ it "ignore_events set/get " do
234
+ bool_check @e, 'ignore_events'
280
235
  end
281
236
  #
282
- it "manual_render set/get should work" do
237
+ it "manual_render set/get " do
283
238
  @e.manual_render_set true
284
239
  @e.manual_render_get.should be_true
285
240
  @e.manual_render = false
286
241
  @e.manual_render?.should be_false
242
+ @e.manual_render.should be_nil
287
243
  end
288
244
  #
289
- it "comp_sync set/get should work" do
290
- @e.comp_sync_set true
291
- @e.comp_sync_get.should be_true
292
- @e.comp_sync = false
293
- @e.comp_sync?.should be_false
245
+ it "comp_sync set/get " do
246
+ bool_check @e, 'comp_sync'
294
247
  end
295
248
  #
296
- it "ecore_evas_callback_resize should work" do
249
+ it "ecore_evas_callback_resize " do
297
250
  cpt = 0
298
251
  cb = Proc.new do |ecore_evas|
299
252
  cpt+=1
@@ -304,7 +257,7 @@ describe Efl::EcoreEvas do
304
257
  cpt.should >0
305
258
  end
306
259
  #
307
- it "ecore_evas_callback_move should work" do
260
+ it "ecore_evas_callback_move " do
308
261
  cpt = 0
309
262
  cb = Proc.new do |ecore_evas|
310
263
  cpt+=1
@@ -315,7 +268,7 @@ describe Efl::EcoreEvas do
315
268
  cpt.should >0
316
269
  end
317
270
  #
318
- it "ecore_evas_callback_show should work" do
271
+ it "ecore_evas_callback_show " do
319
272
  cpt = 0
320
273
  cb = Proc.new do |ecore_evas|
321
274
  cpt+=1
@@ -326,7 +279,7 @@ describe Efl::EcoreEvas do
326
279
  cpt.should >0
327
280
  end
328
281
  #
329
- it "ecore_evas_callback_hide should work" do
282
+ it "ecore_evas_callback_hide " do
330
283
  cpt = 0
331
284
  cb = Proc.new do |ecore_evas|
332
285
  cpt+=1
@@ -3,10 +3,14 @@
3
3
  #
4
4
  require 'efl/ecore'
5
5
  require 'efl/ecore_evas'
6
+ require 'efl/eina_list'
6
7
  require 'efl/ecore_getopt'
7
8
  #
8
9
  describe Efl::EcoreGetopt do
9
10
  #
11
+ after(:all) do
12
+ Efl::Ecore.shutdown
13
+ end
10
14
  before(:all) do
11
15
  Efl::Ecore.init
12
16
  #
@@ -33,6 +37,7 @@ describe Efl::EcoreGetopt do
33
37
  :true => FFI::MemoryPointer.new(:uchar),
34
38
  :false => FFI::MemoryPointer.new(:uchar),
35
39
  :choice => FFI::MemoryPointer.new(:pointer),
40
+ :append => FFI::MemoryPointer.new(:pointer),
36
41
  :count => FFI::MemoryPointer.new(:int),
37
42
  :callback => FFI::MemoryPointer.new(:int),
38
43
  }
@@ -49,6 +54,7 @@ describe Efl::EcoreGetopt do
49
54
  @p.help 'H', 'help'
50
55
  @p.value :boolp, @values[:help]
51
56
  # FIXME debug callback : ecore_getopt_callback_ecore_evas_list_engines
57
+ # @p.callback_noargs 'E', 'list-engines', 'list ecore-evas available engines', @engines_cb, FFI::Pointer::NULL
52
58
  @p.callback_noargs 'E', 'list-engines', 'list ecore-evas available engines', Efl::Native.method(:ecore_getopt_callback_ecore_evas_list_engines), FFI::Pointer::NULL
53
59
  @p.value :boolp, @values[:engines]
54
60
  @p.store_type :int, 'i', 'int', 'store an integer'
@@ -67,8 +73,8 @@ describe Efl::EcoreGetopt do
67
73
  @p.value :boolp, @values[:true]
68
74
  @p.choice 'm', 'many', 'store choice', ['ch1','ch2','ch3']
69
75
  @p.value :strp, @values[:choice]
70
- # # FIXME: uses listp with Eina_List
71
- # @p.append 'a', 'append', 'store append', :ecore_getopt_type_int
76
+ @p.append 'a', 'append', 'store append', :ecore_getopt_type_int
77
+ @p.value :listp, @values[:append]
72
78
  @p.count 'k', 'count', 'store count'
73
79
  @p.value :intp, @values[:count]
74
80
  @p.callback_args 'b', 'callback', 'callback full', @meta1, @callback, @cb_data
@@ -89,12 +95,10 @@ describe Efl::EcoreGetopt do
89
95
  @values[:true].write_uchar 1
90
96
  @values[:false].write_uchar 0
91
97
  @values[:choice].write_pointer FFI::Pointer::NULL
98
+ @values[:append].write_pointer FFI::Pointer::NULL
92
99
  @values[:count].write_int 664
93
100
  @values[:callback].write_int 99
94
101
  end
95
- after(:all) do
96
- Efl::Ecore.shutdown
97
- end
98
102
  #
99
103
  describe "license copyright version help" do
100
104
  it "should handle -L" do
@@ -121,14 +125,14 @@ describe Efl::EcoreGetopt do
121
125
  args = @p.parse ["progname","--version"]
122
126
  @values[:version].read_char.should == 1
123
127
  end
124
- # it "should handle -H" do
125
- # args = @p.parse ["My lovely prog name","-H"]
126
- # @values[:help].read_char.should == 1
127
- # end
128
- # it "should handle --help" do
129
- # args = @p.parse ["progname","--help"]
130
- # @values[:help].read_char.should == 1
131
- # end
128
+ it "should handle -H" do
129
+ args = @p.parse ["My lovely prog name","-H"]
130
+ @values[:help].read_char.should == 1
131
+ end
132
+ it "should handle --help" do
133
+ args = @p.parse ["progname","--help"]
134
+ @values[:help].read_char.should == 1
135
+ end
132
136
  it "should handle -E" do
133
137
  args = @p.parse ["My lovely prog name","-E"]
134
138
  @values[:engines].read_char.should == 1
@@ -179,6 +183,13 @@ describe Efl::EcoreGetopt do
179
183
  args = @p.parse ["progname","-mch2"]
180
184
  @values[:choice].read_pointer.read_string.should == "ch2"
181
185
  end
186
+ it "should handle -a" do
187
+ @values[:append].read_pointer.should == FFI::Pointer::NULL
188
+ args = @p.parse ["progname","-a10", "-a20"]
189
+ l = Efl::EinaList::REinaList.new(@values[:append].read_pointer).to_a
190
+ l[0].read_int.should==10
191
+ l[1].read_int.should==20
192
+ end
182
193
  it "should handle -k" do
183
194
  @values[:count].read_int.should == 664
184
195
  args = @p.parse ["progname","-kk"]
@@ -229,6 +240,13 @@ describe Efl::EcoreGetopt do
229
240
  args = @p.parse ["progname","--many=ch3"]
230
241
  @values[:choice].read_pointer.read_string.should == "ch3"
231
242
  end
243
+ it "should handle -append" do
244
+ @values[:append].read_pointer.should == FFI::Pointer::NULL
245
+ args = @p.parse ["progname","--append=10", "--append=20"]
246
+ l = Efl::EinaList::REinaList.new(@values[:append].read_pointer).to_a
247
+ l[0].read_int.should==10
248
+ l[1].read_int.should==20
249
+ end
232
250
  it "should handle --count" do
233
251
  @values[:count].read_int.should == 664
234
252
  args = @p.parse ["progname","--count","--count"]
data/spec/ecore_spec.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  #
4
4
  require 'efl/ecore'
5
5
  #
6
- describe Efl::Ecore do
6
+ describe "Efl::Ecore #{Efl::Ecore.version.full}" do
7
7
  #
8
8
  before(:all) do
9
9
  Ecore = Efl::Ecore
@@ -24,10 +24,10 @@ describe Efl::Ecore do
24
24
  NONE = FFI::MemoryPointer.from_string "none"
25
25
  end
26
26
  before(:each) {
27
- Ecore.init
27
+ Ecore.init==1
28
28
  }
29
29
  after(:each) {
30
- Ecore.shutdown
30
+ Ecore.shutdown==0
31
31
  }
32
32
  #
33
33
  it "should init" do