adesklets-ruby 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,86 @@
1
+ # ADesklets Ruby Bindings.
2
+ #
3
+ # Copyright (C) 2006 Luca Greco a.k.a. "ripley"
4
+ #
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation; either version 2 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ #
19
+ ####
20
+
21
+ require 'erb'
22
+
23
+ TEMPLATE = ERB.new <<-EOT
24
+ # ADesklets Ruby Bindings.
25
+ #
26
+ # Copyright (C) 2006 Luca Greco a.k.a. "ripley"
27
+ #
28
+ # This program is free software; you can redistribute it and/or modify
29
+ # it under the terms of the GNU General Public License as published by
30
+ # the Free Software Foundation; either version 2 of the License, or
31
+ # (at your option) any later version.
32
+ #
33
+ # This program is distributed in the hope that it will be useful,
34
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
35
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36
+ # GNU General Public License for more details.
37
+ #
38
+ # You should have received a copy of the GNU General Public License
39
+ # along with this program; if not, write to the Free Software
40
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
41
+ #
42
+ ####
43
+
44
+ ### Autogenerated
45
+ module ADesklets
46
+ module AutoGenerated
47
+
48
+ ## constants
49
+ <% @constants.each do |constant| %>
50
+ <%= constant.name %> = <%= constant.value %>
51
+ <% end %>
52
+
53
+ ## functions
54
+ <% @functions.each do |function| %>
55
+ ## <%= function.comment %>
56
+ def <%= function.name %>(*args)
57
+ ADesklets::Client.instance.session.command("<%= function.name %> \#{args.join(' ')}")
58
+ end
59
+ <% end %>
60
+
61
+ end
62
+ end
63
+ EOT
64
+
65
+ RConstant = Struct.new(:name, :value)
66
+ RFunction = Struct.new(:name, :comment)
67
+
68
+ @constants = Array.new
69
+ @functions = Array.new
70
+
71
+ open('enums') do |f|
72
+ f.each_line do |line|
73
+ name, value = line.split
74
+ @constants << RConstant.new(name, value)
75
+ end
76
+ end
77
+
78
+ open('prototypes') do |f|
79
+ f.each_line do |line|
80
+ comment = line
81
+ name = line.split[0]
82
+ @functions << RFunction.new(name, comment)
83
+ end
84
+ end
85
+
86
+ puts TEMPLATE.result(binding)
data/utils/enums ADDED
@@ -0,0 +1,15 @@
1
+ TEXT_TO_RIGHT 0
2
+ TEXT_TO_LEFT 1
3
+ TEXT_TO_DOWN 2
4
+ TEXT_TO_UP 3
5
+ TEXT_TO_ANGLE 4
6
+ OP_COPY 0
7
+ OP_ADD 1
8
+ OP_SUBSTRACT 2
9
+ OP_RESHADE 3
10
+ CHANNEL_RED 0
11
+ CHANNEL_GREEN 1
12
+ CHANNEL_BLUE 2
13
+ CHANNEL_ALPHA 3
14
+ WINDOW_UNMANAGED 0
15
+ WINDOW_MANAGED 1
data/utils/prototypes ADDED
@@ -0,0 +1,154 @@
1
+ time_gate Set a time gate double gate
2
+ help Display short help about a command [const char * command]
3
+ ping Ping the interpreter void
4
+ pause Freeze the interpreter for debugging [int delay]
5
+ version Get interpreter version void
6
+ get_id Get current applet identificator void
7
+ history List/save commands history [const char * filename]
8
+ set Set or unset a textual variable [const * char name, const * char value]
9
+ unset_all Unset all defined textual variables void
10
+ echo Echo a string const char * string
11
+ start_recording Start recording a macro void
12
+ stop_recording Stop recording the macro void
13
+ play_get_abort_on_events Get replays interuptable status void
14
+ play_set_abort_on_events Set replays to be interuptable bool abort
15
+ play Play a given macro int beginning, int end
16
+ context_get_dither Get context dither void
17
+ context_get_anti_alias Get context anti alias void
18
+ context_get_blend Get context blending void
19
+ context_get_operation Get context operation void
20
+ context_get_cliprect Get clipping rectange void
21
+ context_get_image Get context image void
22
+ context_get_font Get context font void
23
+ context_get_color_range Get context color range void
24
+ context_get_color_modifier Get context color modifier void
25
+ context_get_filter Get context filter void
26
+ context_get_color Get context color void
27
+ context_get_angle Get context angle void
28
+ context_get_direction Get context direction void
29
+ context_set_dither Set context dither bool dither
30
+ context_set_anti_alias Set context anti-alias bool anti_alias
31
+ context_set_blend Set context blending bool blend
32
+ context_set_operation Set context operation enum OPERATIONS operation
33
+ context_set_cliprect Set context clipping rectangle int x, int y, int w, int h
34
+ context_set_image Set context image int image
35
+ context_set_font Set context font [int font]
36
+ context_set_color_range Set context color range [int color_range]
37
+ context_set_color_modifier Set context color modifier [int color_modifier]
38
+ context_set_filter Set context filter [int filter]
39
+ context_set_color Set context RGBA color int red, int green, int blue, int alpha
40
+ context_set_angle Set context angle double angle
41
+ context_set_direction Set context direction enum DIRECTIONS direction
42
+ add_color_to_color_range Add a color to a color range int distance_away
43
+ blend_image_onto_image Blend images together int source_image,char merge_alpha, int source_x,int source_y, int source_width,int source_height, int destination_x,int destination_y, int destination_width,int destination_height
44
+ blend_image_onto_image_at_angle Blend images together int source_image,char merge_alpha, int source_x,int source_y, int source_width,int source_height,int destination_x,int destination_y, int angle_x,int angle_y
45
+ blend_image_onto_image_skewed Blend images together int source_image,char merge_alpha, int source_x,int source_y, int source_width,int source_height,int destination_x,int destination_y, int h_angle_x,int h_angle_y, int v_angle_x,int v_angle_y
46
+ apply_filter Apply a dynamic filter const char * script
47
+ get_text_size Get size of text const char * text
48
+ get_text_advance Get advance of text const char * text
49
+ text_draw Draw a text string int x, int y, const char *text
50
+ modify_color_modifier_gamma Modify gamma correction double gamma_value
51
+ modify_color_modifier_brightness Modify brightness double brightness_value
52
+ modify_color_modifier_contrast Modify contrast double contrast_value
53
+ get_color_modifier_tables Get tables for a color modifier void
54
+ set_color_modifier_tables Set tables for a color modifier unsigned char * table
55
+ get_color_modifier_value Get a value for a color modifier enum RGBA_TABLES table, int index
56
+ set_color_modifier_value Set a value for a color modifier enum RGBA_TABLES table, int index, int value
57
+ apply_color_modifier Apply a color modifier void
58
+ apply_color_modifier_to_rectangle Apply a color modifier int x, int y, int width,int height
59
+ load_image_without_cache Load an image from disk bypassing the cache const char *file
60
+ load_image Load an image from disk const char *file
61
+ save_image Save an image to disk const char *filename
62
+ create_image Create an image int width, int height
63
+ create_image_using_data Create an image from data int width, int height,unsigned int * data
64
+ clone_image Create a copy of an image void
65
+ free_image Free an image int image
66
+ load_font Load a font const char *font_name
67
+ free_font Free a font int font
68
+ list_fonts List all fonts void
69
+ list_font_path List all fonts path void
70
+ add_path_to_font_path Add a font path const char *path
71
+ remove_path_from_font_path Remove a font path const char *path
72
+ create_color_range Create a color range void
73
+ free_color_range Free a color range int color_range
74
+ create_filter Create a filter void
75
+ free_filter Free a filter int filter
76
+ create_color_modifier Create a color modifier void
77
+ free_color_modifier Free a color modifier int color_modifier
78
+ polygon_new Create a polygon void
79
+ polygon_free Free a polygon int poly
80
+ polygon_add_point Add point to a polygon int poly, int x, int y
81
+ images_reset_all Free all images and refresh foreground void
82
+ images_info Get information on all images void
83
+ fonts_reset_all Free all fonts void
84
+ fonts_info Get information on all fonts void
85
+ color_ranges_reset_all Free all color ranges void
86
+ color_ranges_info Get information on all color ranges void
87
+ color_modifiers_reset_all Free all color modifiers void
88
+ color_modifiers_info Get information on all color modifiers void
89
+ filters_reset_all Free all filters void
90
+ filters_info Get information on all filters void
91
+ polygons_reset_all Free all polygons void
92
+ polygons_info Get information on all polygons void
93
+ image_has_alpha Get alpha channel setting of an image void
94
+ image_get_width Get width of an image void
95
+ image_get_height Get height of an image void
96
+ image_get_filename Get filename of an image void
97
+ image_get_data Get the data of an image void
98
+ image_query_pixel Query a pixel value int x, int y
99
+ image_set_has_alpha Set alpha channel of an image bool has_alpha
100
+ image_set_changes_on_disk Set image load time behavior void
101
+ image_set_format Set image format const char *format
102
+ image_filter_recurse void
103
+ image_draw_line Draw a line int x1, int y1, int x2, int y2,char make_updates
104
+ image_draw_rectangle Draw a rectangle int x, int y, int width, int height
105
+ image_fill_rectangle Draw a filled rectangle int x, int y, int width, int height
106
+ image_fill_color_range_rectangle Draw a gradian filled rectange int x, int y, int width,int height, double angle
107
+ image_draw_ellipse Draw an ellipse int xc, int yc, int a, int b
108
+ image_fill_ellipse Fill an ellipse int xc, int yc, int a, int b
109
+ image_copy_alpha_to_image Transfert alpha channel int image_source, int x,int y
110
+ image_copy_alpha_rectangle_to_image Transfert alpha channel int image_source,int x, int y, int width,int height,int destination_x,int destination_y
111
+ image_draw_polygon Draw a polygon onto image int poly, unsigned char closed
112
+ image_fill_polygon Fill a polygon onto image int poly
113
+ image_flip_horizontal Flip an image horizontally void
114
+ image_flip_vertical Flip an image vertically void
115
+ image_flip_diagonal Flip an image diagonally void
116
+ image_orientate Orientate an image int orientation
117
+ image_blur Blur an image int radius
118
+ image_sharpen Sharpen an image int radius
119
+ filter_set Set filter int xoff, int yoff, int a, int r, int g, int b
120
+ filter_set_red Set filter red channel int xoff, int yoff, int a, int r, int g, int b
121
+ filter_set_green Set filter grean channel int xoff, int yoff, int a, int r, int g, int b
122
+ filter_set_blue Set filter blue channel int xoff, int yoff, int a, int r, int g, int b
123
+ filter_set_alpha Set filter alpha channel int xoff, int yoff, int a, int r, int g, int b
124
+ filter_constants Set filter constants int a, int r, int g, int b
125
+ filter_divisors Set filter divisors int a, int r, int g, int b
126
+ menu_fire Fire a given menu int menu
127
+ menu_reset_all Reset all menus to initial state void
128
+ menu_add_menu Add a new menu void
129
+ menu_add_submenu Add a submenu to current menu const char * submenu
130
+ menu_add_item Add an item to current menu const char * add_item
131
+ menu_add_separator Add a separator to current menu void
132
+ menu_end_submenu End a submenu construction void
133
+ events_info Get all caught events void
134
+ events_get_echo Get events echo status void
135
+ events_get_send_sigusr1 Get sending of SIGUSR1 to parent on event void
136
+ window_reset Reset the window enum WINDOW_MANAGER manager
137
+ window_show Map the window on the screen void
138
+ window_hide Unmap the window from the screen void
139
+ window_resize Resize the window int width, int height
140
+ window_get_transparency Get automatic transparency void
141
+ window_get_background_grab Get automatic grab void
142
+ window_get_background_image Get background image void
143
+ window_get_managed_status Get managed status void
144
+ window_set_transparency Set automatic transparency bool transparency
145
+ window_set_background_grab Set automatic grab bool grab
146
+ window_set_background_image Set background image int image
147
+ screen_get_width Get screen width void
148
+ screen_get_height Get screen height void
149
+ screen_get_depth Get screen depth void
150
+ get_charset Get input charset void
151
+ set_charset Set input charset const char * charset
152
+ charset_status Get charset capabilities void
153
+ x_status Status of connection to X Window server void
154
+ quit Quit the program void
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: adesklets-ruby
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.2.0
7
+ date: 2006-05-25 00:00:00 +02:00
8
+ summary: ADesklets Ruby Bindings.
9
+ require_paths:
10
+ - lib
11
+ email:
12
+ homepage:
13
+ rubyforge_project:
14
+ description: "ADesklets-Ruby is a pure Ruby bindings for ADesklets' Desktop applet framework
15
+ (adesklets.sf.net)."
16
+ autorequire:
17
+ default_executable:
18
+ bindir: bin
19
+ has_rdoc: true
20
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
21
+ requirements:
22
+ -
23
+ - ">"
24
+ - !ruby/object:Gem::Version
25
+ version: 0.0.0
26
+ version:
27
+ platform: ruby
28
+ signing_key:
29
+ cert_chain:
30
+ authors: []
31
+ files:
32
+ - lib/adesklets
33
+ - lib/adesklets.rb
34
+ - lib/adesklets/autobinding.rb
35
+ - lib/adesklets/session.rb
36
+ - lib/adesklets/base.rb
37
+ - examples/test.rb
38
+ - examples/test2.rb
39
+ - utils/enums
40
+ - utils/prototypes
41
+ - utils/autobinding.rb
42
+ - utils/binding_generator.rb
43
+ - README
44
+ test_files: []
45
+ rdoc_options: []
46
+ extra_rdoc_files:
47
+ - README
48
+ executables: []
49
+ extensions: []
50
+ requirements: []
51
+ dependencies: []