libxosd-ruby 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README ADDED
@@ -0,0 +1,65 @@
1
+
2
+ ######## libxosd-ruby ########
3
+
4
+ 1. Introduction
5
+ 2. Compiling
6
+ 3. Installing
7
+ 4. Example
8
+ 5. Contact
9
+
10
+ 1. Introduction
11
+
12
+ XOSD is a system that displays text on top of the other windows, much like the
13
+ on-screen display (OSD) used by most modern televisions and video-players.
14
+ libxosd-ruby is a ruby interface to this library.
15
+
16
+ BUGS:
17
+
18
+ Since XOSD uses pthread, and (at least in Debian) ruby is, by default, compiled
19
+ without -lpthread, the ruby process sometimes fails to exit when XOSD is used,
20
+ unless "exit!" is used. This library checks if ruby was compiled with
21
+ "-lpthread", and if not, adds an exit handler using "at_exit" that executes
22
+ "exit!".
23
+
24
+ 2. Compiling:
25
+
26
+ $ ruby extconf.rb
27
+ (if this fails looking for 'mkmf', you probably need the ruby-dev package)
28
+ $ make
29
+
30
+ 3. Installing:
31
+
32
+ Installation may need to be done as root. Installs to ruby site dir.
33
+
34
+ $ ruby install.rb
35
+
36
+ 4. Example
37
+
38
+ require 'rxosd'
39
+ osd = RXOSD.new(2)
40
+ osd.font = '-*-*-bold-r-*-*-33-*-*-*-*-*-*-*'
41
+ osd.align = RXOSD::LEFT
42
+ osd.valign = RXOSD::BOTTOM
43
+ osd.timeout = 4
44
+ osd.puts("First line")
45
+ sleep 1
46
+ osd.puts("Second line")
47
+ sleep 1
48
+ osd.puts("First line again", 0)
49
+ sleep 1
50
+ osd.slider(50, 1)
51
+ osd.wait_until_hidden
52
+ osd.clear
53
+ osd.timeout = 4
54
+ osd.puts("Second line again", 1)
55
+
56
+ 5. Contact:
57
+
58
+ If you have any problems, comments, or questions, please contact me one of the
59
+ following ways:
60
+ Email: Derek Lewis <libxosd-ruby@lewisd.com>
61
+ Bug Reports: http://rubyforge.org/tracker/?atid=595&group_id=133
62
+ Feature Requests: http://rubyforge.org/tracker/?atid=598&group_id=133
63
+ Support Requests: http://rubyforge.org/tracker/?atid=596&group_id=133
64
+ Open Discussion: http://rubyforge.org/forum/forum.php?forum_id=537
65
+
@@ -0,0 +1,54 @@
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+ require 'rake/clean'
4
+
5
+ ################
6
+ # rake version #
7
+ ################
8
+
9
+ PKG_VERSION = '0.4'
10
+ PKG_NAME = 'libxosd-ruby'
11
+
12
+ desc "Show version of libxosd"
13
+ task :version do
14
+ puts "Version: #{PKG_VERSION}"
15
+ end
16
+
17
+ PKG_FILES = FileList[
18
+ '[A-Z]*',
19
+ '*.rb',
20
+ '*.c',
21
+ '*.i'
22
+ ]
23
+
24
+ gemspec = Gem::Specification.new do |s|
25
+ s.author = "Derek Lewis"
26
+ s.autorequire = 'xosd'
27
+ s.description = <<EOS
28
+ XOSD is a system that displays text on top of the other windows, much like the
29
+ on-screen display (OSD) used by most modern televisions and video-players.
30
+ libxosd-ruby is a ruby interface to this library.
31
+ EOS
32
+ s.email = "libxosd-ruby@lewisd.com"
33
+ s.extensions << "extconf.rb"
34
+ s.files = PKG_FILES.to_a
35
+ s.has_rdoc = false
36
+ s.homepage = "http://libxosd-ruby.rubyforge.org/"
37
+ s.name = PKG_NAME
38
+ #s.platform
39
+ #s.rdoc_options
40
+ s.require_path = '.'
41
+ s.required_ruby_version = '>= 1.8.1'
42
+ s.requirements << 'libxosd'
43
+ s.rubyforge_project = "libxosd-ruby"
44
+ s.summary = "libxosd-ruby is a ruby interface to libxosd"
45
+ #s.test_files
46
+ s.version = PKG_VERSION
47
+ end
48
+
49
+ Rake::GemPackageTask.new(gemspec) do |pkg|
50
+ pkg.need_zip = false
51
+ pkg.need_tar = true
52
+ end
53
+
54
+
@@ -0,0 +1,15 @@
1
+
2
+ require "xosd"
3
+
4
+ osd = Xosd.new(2)
5
+ osd.font = "-*-*-*-*-*-*-20-*-*-*-*-*-*-*";
6
+ osd.align = "center"
7
+ osd.valign = "middle"
8
+
9
+ osd.timeout = 1
10
+ osd.display(0, "Testing libxosd2-ruby")
11
+
12
+ osd.wait
13
+
14
+ osd.destroy
15
+
@@ -0,0 +1,5 @@
1
+ require 'mkmf'
2
+
3
+ have_library('xosd', 'xosd_create')
4
+
5
+ create_makefile("libxosd")
@@ -0,0 +1,12 @@
1
+
2
+ require 'ftools'
3
+ require 'rbconfig'
4
+
5
+ include Config
6
+
7
+ File::install('xosd.rb', CONFIG['sitelibdir'], 0644, true)
8
+ File::install('xosdbase.rb', CONFIG['sitelibdir'], 0644, true)
9
+ File::install('xosdserver.rb', CONFIG['sitelibdir'], 0644, true)
10
+ File::install('xosdclient.rb', CONFIG['sitelibdir'], 0644, true)
11
+ File::install('libxosd.so', CONFIG['sitearchdir'], 0755, true)
12
+
@@ -0,0 +1,56 @@
1
+
2
+ %module libxosd
3
+ %{
4
+ #include <xosd.h>
5
+ %}
6
+
7
+ typedef enum
8
+ {
9
+ XOSD_percentage,
10
+ XOSD_string,
11
+ XOSD_printf,
12
+ XOSD_slider
13
+ } xosd_command;
14
+
15
+ typedef enum
16
+ {
17
+ XOSD_top = 0,
18
+ XOSD_bottom,
19
+ XOSD_middle
20
+ } xosd_pos;
21
+
22
+ typedef enum
23
+ {
24
+ XOSD_left = 0,
25
+ XOSD_center,
26
+ XOSD_right
27
+ } xosd_align;
28
+
29
+
30
+ %immutable;
31
+ extern char *xosd_error;
32
+ %mutable;
33
+
34
+ xosd *xosd_create (int number_lines);
35
+ int xosd_destroy (xosd * osd);
36
+ int xosd_set_bar_length (xosd * osd, int length);
37
+ int xosd_display (xosd * osd, int line, xosd_command command, char* arg);
38
+ int xosd_display (xosd * osd, int line, xosd_command command, int arg);
39
+ int xosd_is_onscreen (xosd * osd);
40
+ int xosd_wait_until_no_display (xosd * osd);
41
+ int xosd_hide (xosd * osd);
42
+ int xosd_show (xosd * osd);
43
+ int xosd_set_pos (xosd * osd, xosd_pos pos);
44
+ int xosd_set_align (xosd * osd, xosd_align align);
45
+ int xosd_set_shadow_offset (xosd * osd, int shadow_offset);
46
+ int xosd_set_outline_offset (xosd * osd, int outline_offset);
47
+ int xosd_set_outline_colour (xosd * osd, const char *colour);
48
+ int xosd_set_shadow_colour (xosd * osd, const char *colour);
49
+ int xosd_set_horizontal_offset (xosd * osd, int offset);
50
+ int xosd_set_vertical_offset (xosd * osd, int offset);
51
+ int xosd_set_timeout (xosd * osd, int timeout);
52
+ int xosd_set_colour (xosd * osd, const char *colour);
53
+ int xosd_set_font (xosd * osd, const char *font);
54
+ int xosd_get_colour (xosd * osd, int *red, int *green, int *blue);
55
+ int xosd_scroll (xosd * osd, int lines);
56
+ int xosd_get_number_lines (xosd * osd);
@@ -0,0 +1,1081 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.19
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ /* ruby.swg */
12
+ /* Implementation : RUBY */
13
+ #define SWIGRUBY 1
14
+
15
+ #define VERSION 0.4
16
+
17
+ #include "ruby.h"
18
+
19
+ #define NUM2USHRT(n) (\
20
+ (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
21
+ ? (unsigned short) NUM2UINT(n) \
22
+ : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
23
+ NUM2UINT(n)), (short)0)\
24
+ )
25
+
26
+ #define NUM2SHRT(n) (\
27
+ (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
28
+ ? (short)NUM2INT(n)\
29
+ : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
30
+ NUM2INT(n)), (short)0)\
31
+ )
32
+
33
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
34
+ #ifndef NUM2LL
35
+ #define NUM2LL(x) NUM2LONG((x))
36
+ #endif
37
+ #ifndef LL2NUM
38
+ #define LL2NUM(x) INT2NUM((long) (x))
39
+ #endif
40
+ #ifndef ULL2NUM
41
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
42
+ #endif
43
+
44
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
45
+ #ifndef NUM2ULL
46
+ #ifdef HAVE_LONG_LONG
47
+ #define NUM2ULL(x) rb_num2ull((x))
48
+ #else
49
+ #define NUM2ULL(x) NUM2ULONG(x)
50
+ #endif
51
+ #endif
52
+
53
+ /*
54
+ * Need to be very careful about how these macros are defined, especially
55
+ * when compiling C++ code or C code with an ANSI C compiler.
56
+ *
57
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
58
+ * a Ruby method so that it can be passed as an argument to API functions
59
+ * like rb_define_method() and rb_define_singleton_method().
60
+ *
61
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
62
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
63
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
64
+ * and Data_Make_Struct().
65
+ */
66
+
67
+ #ifdef __cplusplus
68
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
69
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
70
+ # define VOIDFUNC(f) ((void (*)()) f)
71
+ # else
72
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
73
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
74
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
75
+ # else /* These definitions should work for Ruby 1.7 */
76
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
77
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
78
+ # endif
79
+ # endif
80
+ #else
81
+ # define VALUEFUNC(f) (f)
82
+ # define VOIDFUNC(f) (f)
83
+ #endif
84
+
85
+ typedef struct {
86
+ VALUE klass;
87
+ void (*mark)(void *);
88
+ void (*destroy)(void *);
89
+ } swig_class;
90
+
91
+ /***********************************************************************
92
+ * common.swg
93
+ *
94
+ * This file contains generic SWIG runtime support for pointer
95
+ * type checking as well as a few commonly used macros to control
96
+ * external linkage.
97
+ *
98
+ * Author : David Beazley (beazley@cs.uchicago.edu)
99
+ *
100
+ * Copyright (c) 1999-2000, The University of Chicago
101
+ *
102
+ * This file may be freely redistributed without license or fee provided
103
+ * this copyright message remains intact.
104
+ ************************************************************************/
105
+
106
+ #include <string.h>
107
+
108
+ #if defined(_WIN32) || defined(__WIN32__)
109
+ # if defined(_MSC_VER)
110
+ # if defined(STATIC_LINKED)
111
+ # define SWIGEXPORT(a) a
112
+ # define SWIGIMPORT(a) extern a
113
+ # else
114
+ # define SWIGEXPORT(a) __declspec(dllexport) a
115
+ # define SWIGIMPORT(a) extern a
116
+ # endif
117
+ # else
118
+ # if defined(__BORLANDC__)
119
+ # define SWIGEXPORT(a) a _export
120
+ # define SWIGIMPORT(a) a _export
121
+ # else
122
+ # define SWIGEXPORT(a) a
123
+ # define SWIGIMPORT(a) a
124
+ # endif
125
+ # endif
126
+ #else
127
+ # define SWIGEXPORT(a) a
128
+ # define SWIGIMPORT(a) a
129
+ #endif
130
+
131
+ #ifdef SWIG_GLOBAL
132
+ #define SWIGRUNTIME(a) SWIGEXPORT(a)
133
+ #else
134
+ #define SWIGRUNTIME(a) static a
135
+ #endif
136
+
137
+ #ifdef __cplusplus
138
+ extern "C" {
139
+ #endif
140
+
141
+ typedef void *(*swig_converter_func)(void *);
142
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
143
+
144
+ typedef struct swig_type_info {
145
+ const char *name;
146
+ swig_converter_func converter;
147
+ const char *str;
148
+ void *clientdata;
149
+ swig_dycast_func dcast;
150
+ struct swig_type_info *next;
151
+ struct swig_type_info *prev;
152
+ } swig_type_info;
153
+
154
+ #ifdef SWIG_NOINCLUDE
155
+
156
+ SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
157
+ SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
158
+ SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *);
159
+ SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **);
160
+ SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *);
161
+ SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *);
162
+ SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *);
163
+
164
+ #else
165
+
166
+ static swig_type_info *swig_type_list = 0;
167
+
168
+ /* Register a type mapping with the type-checking */
169
+ SWIGRUNTIME(swig_type_info *)
170
+ SWIG_TypeRegister(swig_type_info *ti)
171
+ {
172
+ swig_type_info *tc, *head, *ret, *next;
173
+ /* Check to see if this type has already been registered */
174
+ tc = swig_type_list;
175
+ while (tc) {
176
+ if (strcmp(tc->name, ti->name) == 0) {
177
+ /* Already exists in the table. Just add additional types to the list */
178
+ if (tc->clientdata) ti->clientdata = tc->clientdata;
179
+ head = tc;
180
+ next = tc->next;
181
+ goto l1;
182
+ }
183
+ tc = tc->prev;
184
+ }
185
+ head = ti;
186
+ next = 0;
187
+
188
+ /* Place in list */
189
+ ti->prev = swig_type_list;
190
+ swig_type_list = ti;
191
+
192
+ /* Build linked lists */
193
+ l1:
194
+ ret = head;
195
+ tc = ti + 1;
196
+ /* Patch up the rest of the links */
197
+ while (tc->name) {
198
+ head->next = tc;
199
+ tc->prev = head;
200
+ head = tc;
201
+ tc++;
202
+ }
203
+ if (next) next->prev = head; /**/
204
+ head->next = next;
205
+ return ret;
206
+ }
207
+
208
+ /* Check the typename */
209
+ SWIGRUNTIME(swig_type_info *)
210
+ SWIG_TypeCheck(char *c, swig_type_info *ty)
211
+ {
212
+ swig_type_info *s;
213
+ if (!ty) return 0; /* Void pointer */
214
+ s = ty->next; /* First element always just a name */
215
+ do {
216
+ if (strcmp(s->name,c) == 0) {
217
+ if (s == ty->next) return s;
218
+ /* Move s to the top of the linked list */
219
+ s->prev->next = s->next;
220
+ if (s->next) {
221
+ s->next->prev = s->prev;
222
+ }
223
+ /* Insert s as second element in the list */
224
+ s->next = ty->next;
225
+ if (ty->next) ty->next->prev = s;
226
+ ty->next = s;
227
+ s->prev = ty; /**/
228
+ return s;
229
+ }
230
+ s = s->next;
231
+ } while (s && (s != ty->next));
232
+ return 0;
233
+ }
234
+
235
+ /* Cast a pointer up an inheritance hierarchy */
236
+ SWIGRUNTIME(void *)
237
+ SWIG_TypeCast(swig_type_info *ty, void *ptr)
238
+ {
239
+ if ((!ty) || (!ty->converter)) return ptr;
240
+ return (*ty->converter)(ptr);
241
+ }
242
+
243
+ /* Dynamic pointer casting. Down an inheritance hierarchy */
244
+ SWIGRUNTIME(swig_type_info *)
245
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
246
+ {
247
+ swig_type_info *lastty = ty;
248
+ if (!ty || !ty->dcast) return ty;
249
+ while (ty && (ty->dcast)) {
250
+ ty = (*ty->dcast)(ptr);
251
+ if (ty) lastty = ty;
252
+ }
253
+ return lastty;
254
+ }
255
+
256
+ /* Return the name associated with this type */
257
+ SWIGRUNTIME(const char *)
258
+ SWIG_TypeName(const swig_type_info *ty) {
259
+ return ty->name;
260
+ }
261
+
262
+ /* Search for a swig_type_info structure */
263
+ SWIGRUNTIME(swig_type_info *)
264
+ SWIG_TypeQuery(const char *name) {
265
+ swig_type_info *ty = swig_type_list;
266
+ while (ty) {
267
+ if (ty->str && (strcmp(name,ty->str) == 0)) return ty;
268
+ if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
269
+ ty = ty->prev;
270
+ }
271
+ return 0;
272
+ }
273
+
274
+ /* Set the clientdata field for a type */
275
+ SWIGRUNTIME(void)
276
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
277
+ swig_type_info *tc, *equiv;
278
+ if (ti->clientdata == clientdata) return;
279
+ ti->clientdata = clientdata;
280
+ equiv = ti->next;
281
+ while (equiv) {
282
+ if (!equiv->converter) {
283
+ tc = swig_type_list;
284
+ while (tc) {
285
+ if ((strcmp(tc->name, equiv->name) == 0))
286
+ SWIG_TypeClientData(tc,clientdata);
287
+ tc = tc->prev;
288
+ }
289
+ }
290
+ equiv = equiv->next;
291
+ }
292
+ }
293
+ #endif
294
+
295
+ #ifdef __cplusplus
296
+ }
297
+
298
+ #endif
299
+
300
+ /* rubydef.swg */
301
+ #ifdef __cplusplus
302
+ extern "C" {
303
+ #endif
304
+
305
+ static VALUE _mSWIG = Qnil;
306
+ static VALUE _cSWIG_Pointer = Qnil;
307
+
308
+ /* Initialize Ruby runtime support */
309
+ SWIGRUNTIME(void)
310
+ SWIG_InitRuntime(void)
311
+ {
312
+ if (_mSWIG == Qnil) {
313
+ _mSWIG = rb_define_module("SWIG");
314
+ }
315
+ }
316
+
317
+ /* Define Ruby class for C type */
318
+ SWIGRUNTIME(void)
319
+ SWIG_define_class(swig_type_info *type)
320
+ {
321
+ VALUE klass;
322
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
323
+ sprintf(klass_name, "TYPE%s", type->name);
324
+ if (NIL_P(_cSWIG_Pointer)) {
325
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
326
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
327
+ }
328
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
329
+ free((void *) klass_name);
330
+ }
331
+
332
+ /* Create a new pointer object */
333
+ SWIGRUNTIME(VALUE)
334
+ SWIG_NewPointerObj(void *ptr, swig_type_info *type, int own)
335
+ {
336
+ char *klass_name;
337
+ swig_class *sklass;
338
+ VALUE klass;
339
+ VALUE obj;
340
+
341
+ if (!ptr)
342
+ return Qnil;
343
+
344
+ if (type->clientdata) {
345
+ sklass = (swig_class *) type->clientdata;
346
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
347
+ } else {
348
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
349
+ sprintf(klass_name, "TYPE%s", type->name);
350
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
351
+ free((void *) klass_name);
352
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
353
+ }
354
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
355
+ return obj;
356
+ }
357
+
358
+ /* Create a new class instance (always owned) */
359
+ SWIGRUNTIME(VALUE)
360
+ SWIG_NewClassInstance(VALUE klass, swig_type_info *type)
361
+ {
362
+ VALUE obj;
363
+ swig_class *sklass = (swig_class *) type->clientdata;
364
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
365
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
366
+ return obj;
367
+ }
368
+
369
+ /* Get type mangle from class name */
370
+ SWIGRUNTIME(char *)
371
+ SWIG_MangleStr(VALUE obj)
372
+ {
373
+ VALUE stype = rb_iv_get(obj, "__swigtype__");
374
+ return STR2CSTR(stype);
375
+ }
376
+
377
+ /* Convert a pointer value */
378
+ SWIGRUNTIME(int)
379
+ SWIG_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
380
+ {
381
+ char *c;
382
+ swig_type_info *tc;
383
+
384
+ /* Grab the pointer */
385
+ if (NIL_P(obj)) {
386
+ *ptr = 0;
387
+ return 0;
388
+ } else
389
+ Data_Get_Struct(obj, void, *ptr);
390
+
391
+ /* Do type-checking if type info was provided */
392
+ if (ty) {
393
+ if (ty->clientdata) {
394
+ if (!rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
395
+ if (flags)
396
+ rb_raise(rb_eTypeError, "wrong argument type (expected %s)", ty->str);
397
+ else
398
+ return -1;
399
+ }
400
+ if (*ptr == 0)
401
+ rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
402
+ } else {
403
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
404
+ if (flags)
405
+ rb_raise(rb_eTypeError, "Expected %s", ty->str);
406
+ else
407
+ return -1;
408
+ }
409
+ tc = SWIG_TypeCheck(c, ty);
410
+ if (!tc) {
411
+ if (flags)
412
+ rb_raise(rb_eTypeError, "Expected %s", ty->str);
413
+ else
414
+ return -1;
415
+ }
416
+ *ptr = SWIG_TypeCast(tc, *ptr);
417
+ }
418
+ }
419
+ return 0;
420
+ }
421
+
422
+ /* Check convert */
423
+ SWIGRUNTIME(int)
424
+ SWIG_CheckConvert(VALUE obj, swig_type_info *ty)
425
+ {
426
+ char *c = SWIG_MangleStr(obj);
427
+ if (!c)
428
+ return 0;
429
+ return SWIG_TypeCheck(c,ty) != 0;
430
+ }
431
+
432
+ /* Pack binary data into a string */
433
+ SWIGRUNTIME(char *)
434
+ SWIG_PackData(char *c, void *ptr, int sz) {
435
+ static char hex[17] = "0123456789abcdef";
436
+ int i;
437
+ unsigned char *u = (unsigned char *) ptr;
438
+ register unsigned char uu;
439
+ for (i = 0; i < sz; i++,u++) {
440
+ uu = *u;
441
+ *(c++) = hex[(uu & 0xf0) >> 4];
442
+ *(c++) = hex[uu & 0xf];
443
+ }
444
+ return c;
445
+ }
446
+
447
+ /* Unpack binary data from a string */
448
+ SWIGRUNTIME(char *)
449
+ SWIG_UnpackData(char *c, void *ptr, int sz) {
450
+ register unsigned char uu = 0;
451
+ register int d;
452
+ unsigned char *u = (unsigned char *) ptr;
453
+ int i;
454
+ for (i = 0; i < sz; i++, u++) {
455
+ d = *(c++);
456
+ if ((d >= '0') && (d <= '9'))
457
+ uu = ((d - '0') << 4);
458
+ else if ((d >= 'a') && (d <= 'f'))
459
+ uu = ((d - ('a'-10)) << 4);
460
+ d = *(c++);
461
+ if ((d >= '0') && (d <= '9'))
462
+ uu |= (d - '0');
463
+ else if ((d >= 'a') && (d <= 'f'))
464
+ uu |= (d - ('a'-10));
465
+ *u = uu;
466
+ }
467
+ return c;
468
+ }
469
+
470
+ SWIGRUNTIME(VALUE)
471
+ SWIG_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
472
+ char result[1024];
473
+ char *r = result;
474
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
475
+ *(r++) = '_';
476
+ r = SWIG_PackData(r, ptr, sz);
477
+ strcpy(r, type->name);
478
+ return rb_str_new2(result);
479
+ }
480
+
481
+ /* Convert a packed value value */
482
+ SWIGRUNTIME(void)
483
+ SWIG_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
484
+ swig_type_info *tc;
485
+ char *c;
486
+
487
+ if (TYPE(obj) != T_STRING) goto type_error;
488
+ c = STR2CSTR(obj);
489
+ /* Pointer values must start with leading underscore */
490
+ if (*c != '_') goto type_error;
491
+ c++;
492
+ c = SWIG_UnpackData(c, ptr, sz);
493
+ if (ty) {
494
+ tc = SWIG_TypeCheck(c, ty);
495
+ if (!tc) goto type_error;
496
+ }
497
+ return;
498
+
499
+ type_error:
500
+
501
+ if (flags) {
502
+ if (ty) {
503
+ rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
504
+ } else {
505
+ rb_raise(rb_eTypeError, "Expected a pointer");
506
+ }
507
+ }
508
+ }
509
+
510
+ #ifdef __cplusplus
511
+ }
512
+ #endif
513
+
514
+
515
+
516
+ /* -------- TYPES TABLE (BEGIN) -------- */
517
+
518
+ #define SWIGTYPE_p_xosd swig_types[0]
519
+ #define SWIGTYPE_p_int swig_types[1]
520
+ static swig_type_info *swig_types[3];
521
+
522
+ /* -------- TYPES TABLE (END) -------- */
523
+
524
+ #define SWIG_init Init_libxosd
525
+ #define SWIG_name "Libxosd"
526
+
527
+ static VALUE mLibxosd;
528
+
529
+ #include <xosd.h>
530
+
531
+ extern char *xosd_error;
532
+ static VALUE
533
+ xosd_error_get(VALUE self) {
534
+ VALUE _val;
535
+
536
+ _val = rb_str_new2(xosd_error); return _val;
537
+ }
538
+
539
+
540
+ static VALUE
541
+ _wrap_xosd_create(int argc, VALUE *argv, VALUE self) {
542
+ int arg1 ;
543
+ xosd *result;
544
+ VALUE vresult = Qnil;
545
+
546
+ if ((argc < 1) || (argc > 1))
547
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
548
+ arg1 = NUM2INT(argv[0]);
549
+ result = (xosd *)xosd_create(arg1);
550
+
551
+ vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_xosd,0);
552
+ return vresult;
553
+ }
554
+
555
+
556
+ static VALUE
557
+ _wrap_xosd_destroy(int argc, VALUE *argv, VALUE self) {
558
+ xosd *arg1 = (xosd *) 0 ;
559
+ int result;
560
+ VALUE vresult = Qnil;
561
+
562
+ if ((argc < 1) || (argc > 1))
563
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
564
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
565
+ result = (int)xosd_destroy(arg1);
566
+
567
+ vresult = INT2NUM(result);
568
+ return vresult;
569
+ }
570
+
571
+
572
+ static VALUE
573
+ _wrap_xosd_set_bar_length(int argc, VALUE *argv, VALUE self) {
574
+ xosd *arg1 = (xosd *) 0 ;
575
+ int arg2 ;
576
+ int result;
577
+ VALUE vresult = Qnil;
578
+
579
+ if ((argc < 2) || (argc > 2))
580
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
581
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
582
+ arg2 = NUM2INT(argv[1]);
583
+ result = (int)xosd_set_bar_length(arg1,arg2);
584
+
585
+ vresult = INT2NUM(result);
586
+ return vresult;
587
+ }
588
+
589
+
590
+ static VALUE
591
+ _wrap_xosd_display__SWIG_0(int argc, VALUE *argv, VALUE self) {
592
+ xosd *arg1 = (xosd *) 0 ;
593
+ int arg2 ;
594
+ int arg3 ;
595
+ char *arg4 ;
596
+ int result;
597
+ VALUE vresult = Qnil;
598
+
599
+ if ((argc < 4) || (argc > 4))
600
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
601
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
602
+ arg2 = NUM2INT(argv[1]);
603
+ arg3 = (int) NUM2INT(argv[2]);
604
+ arg4 = STR2CSTR(argv[3]);
605
+ result = (int)xosd_display(arg1,arg2,(xosd_command )arg3,arg4);
606
+
607
+ vresult = INT2NUM(result);
608
+ return vresult;
609
+ }
610
+
611
+
612
+ static VALUE
613
+ _wrap_xosd_display__SWIG_1(int argc, VALUE *argv, VALUE self) {
614
+ xosd *arg1 = (xosd *) 0 ;
615
+ int arg2 ;
616
+ int arg3 ;
617
+ int arg4 ;
618
+ int result;
619
+ VALUE vresult = Qnil;
620
+
621
+ if ((argc < 4) || (argc > 4))
622
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
623
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
624
+ arg2 = NUM2INT(argv[1]);
625
+ arg3 = (int) NUM2INT(argv[2]);
626
+ arg4 = NUM2INT(argv[3]);
627
+ result = (int)xosd_display(arg1,arg2,(xosd_command )arg3,arg4);
628
+
629
+ vresult = INT2NUM(result);
630
+ return vresult;
631
+ }
632
+
633
+
634
+ static VALUE _wrap_xosd_display(int nargs, VALUE *args, VALUE self) {
635
+ int argc;
636
+ VALUE argv[4];
637
+ int ii;
638
+
639
+ argc = nargs;
640
+ for (ii = 0; (ii < argc) && (ii < 4); ii++) {
641
+ argv[ii] = args[ii];
642
+ }
643
+ if (argc == 4) {
644
+ int _v;
645
+ {
646
+ void *ptr;
647
+ _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_xosd, 0) != -1)) ? 1 : 0;
648
+ }
649
+ if (_v) {
650
+ {
651
+ _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
652
+ }
653
+ if (_v) {
654
+ {
655
+ _v = ((TYPE(argv[2]) == T_FIXNUM) || (TYPE(argv[2]) == T_BIGNUM)) ? 1 : 0;
656
+ }
657
+ if (_v) {
658
+ {
659
+ _v = ((TYPE(argv[3]) == T_FIXNUM) || (TYPE(argv[3]) == T_BIGNUM)) ? 1 : 0;
660
+ }
661
+ if (_v) {
662
+ return _wrap_xosd_display__SWIG_1(nargs, args, self);
663
+ }
664
+ }
665
+ }
666
+ }
667
+ }
668
+ if (argc == 4) {
669
+ int _v;
670
+ {
671
+ void *ptr;
672
+ _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_xosd, 0) != -1)) ? 1 : 0;
673
+ }
674
+ if (_v) {
675
+ {
676
+ _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
677
+ }
678
+ if (_v) {
679
+ {
680
+ _v = ((TYPE(argv[2]) == T_FIXNUM) || (TYPE(argv[2]) == T_BIGNUM)) ? 1 : 0;
681
+ }
682
+ if (_v) {
683
+ {
684
+ _v = (TYPE(argv[3]) == T_STRING) ? 1 : 0;
685
+ }
686
+ if (_v) {
687
+ return _wrap_xosd_display__SWIG_0(nargs, args, self);
688
+ }
689
+ }
690
+ }
691
+ }
692
+ }
693
+
694
+ rb_raise(rb_eArgError, "No matching function for overloaded 'xosd_display'");
695
+ return Qnil;
696
+ }
697
+
698
+
699
+ static VALUE
700
+ _wrap_xosd_is_onscreen(int argc, VALUE *argv, VALUE self) {
701
+ xosd *arg1 = (xosd *) 0 ;
702
+ int result;
703
+ VALUE vresult = Qnil;
704
+
705
+ if ((argc < 1) || (argc > 1))
706
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
707
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
708
+ result = (int)xosd_is_onscreen(arg1);
709
+
710
+ vresult = INT2NUM(result);
711
+ return vresult;
712
+ }
713
+
714
+
715
+ static VALUE
716
+ _wrap_xosd_wait_until_no_display(int argc, VALUE *argv, VALUE self) {
717
+ xosd *arg1 = (xosd *) 0 ;
718
+ int result;
719
+ VALUE vresult = Qnil;
720
+
721
+ if ((argc < 1) || (argc > 1))
722
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
723
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
724
+ result = (int)xosd_wait_until_no_display(arg1);
725
+
726
+ vresult = INT2NUM(result);
727
+ return vresult;
728
+ }
729
+
730
+
731
+ static VALUE
732
+ _wrap_xosd_hide(int argc, VALUE *argv, VALUE self) {
733
+ xosd *arg1 = (xosd *) 0 ;
734
+ int result;
735
+ VALUE vresult = Qnil;
736
+
737
+ if ((argc < 1) || (argc > 1))
738
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
739
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
740
+ result = (int)xosd_hide(arg1);
741
+
742
+ vresult = INT2NUM(result);
743
+ return vresult;
744
+ }
745
+
746
+
747
+ static VALUE
748
+ _wrap_xosd_show(int argc, VALUE *argv, VALUE self) {
749
+ xosd *arg1 = (xosd *) 0 ;
750
+ int result;
751
+ VALUE vresult = Qnil;
752
+
753
+ if ((argc < 1) || (argc > 1))
754
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
755
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
756
+ result = (int)xosd_show(arg1);
757
+
758
+ vresult = INT2NUM(result);
759
+ return vresult;
760
+ }
761
+
762
+
763
+ static VALUE
764
+ _wrap_xosd_set_pos(int argc, VALUE *argv, VALUE self) {
765
+ xosd *arg1 = (xosd *) 0 ;
766
+ int arg2 ;
767
+ int result;
768
+ VALUE vresult = Qnil;
769
+
770
+ if ((argc < 2) || (argc > 2))
771
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
772
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
773
+ arg2 = (int) NUM2INT(argv[1]);
774
+ result = (int)xosd_set_pos(arg1,(xosd_pos )arg2);
775
+
776
+ vresult = INT2NUM(result);
777
+ return vresult;
778
+ }
779
+
780
+
781
+ static VALUE
782
+ _wrap_xosd_set_align(int argc, VALUE *argv, VALUE self) {
783
+ xosd *arg1 = (xosd *) 0 ;
784
+ int arg2 ;
785
+ int result;
786
+ VALUE vresult = Qnil;
787
+
788
+ if ((argc < 2) || (argc > 2))
789
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
790
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
791
+ arg2 = (int) NUM2INT(argv[1]);
792
+ result = (int)xosd_set_align(arg1,(xosd_align )arg2);
793
+
794
+ vresult = INT2NUM(result);
795
+ return vresult;
796
+ }
797
+
798
+
799
+ static VALUE
800
+ _wrap_xosd_set_shadow_offset(int argc, VALUE *argv, VALUE self) {
801
+ xosd *arg1 = (xosd *) 0 ;
802
+ int arg2 ;
803
+ int result;
804
+ VALUE vresult = Qnil;
805
+
806
+ if ((argc < 2) || (argc > 2))
807
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
808
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
809
+ arg2 = NUM2INT(argv[1]);
810
+ result = (int)xosd_set_shadow_offset(arg1,arg2);
811
+
812
+ vresult = INT2NUM(result);
813
+ return vresult;
814
+ }
815
+
816
+
817
+ static VALUE
818
+ _wrap_xosd_set_outline_offset(int argc, VALUE *argv, VALUE self) {
819
+ xosd *arg1 = (xosd *) 0 ;
820
+ int arg2 ;
821
+ int result;
822
+ VALUE vresult = Qnil;
823
+
824
+ if ((argc < 2) || (argc > 2))
825
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
826
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
827
+ arg2 = NUM2INT(argv[1]);
828
+ result = (int)xosd_set_outline_offset(arg1,arg2);
829
+
830
+ vresult = INT2NUM(result);
831
+ return vresult;
832
+ }
833
+
834
+
835
+ static VALUE
836
+ _wrap_xosd_set_outline_colour(int argc, VALUE *argv, VALUE self) {
837
+ xosd *arg1 = (xosd *) 0 ;
838
+ char *arg2 ;
839
+ int result;
840
+ VALUE vresult = Qnil;
841
+
842
+ if ((argc < 2) || (argc > 2))
843
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
844
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
845
+ arg2 = STR2CSTR(argv[1]);
846
+ result = (int)xosd_set_outline_colour(arg1,(char const *)arg2);
847
+
848
+ vresult = INT2NUM(result);
849
+ return vresult;
850
+ }
851
+
852
+
853
+ static VALUE
854
+ _wrap_xosd_set_shadow_colour(int argc, VALUE *argv, VALUE self) {
855
+ xosd *arg1 = (xosd *) 0 ;
856
+ char *arg2 ;
857
+ int result;
858
+ VALUE vresult = Qnil;
859
+
860
+ if ((argc < 2) || (argc > 2))
861
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
862
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
863
+ arg2 = STR2CSTR(argv[1]);
864
+ result = (int)xosd_set_shadow_colour(arg1,(char const *)arg2);
865
+
866
+ vresult = INT2NUM(result);
867
+ return vresult;
868
+ }
869
+
870
+
871
+ static VALUE
872
+ _wrap_xosd_set_horizontal_offset(int argc, VALUE *argv, VALUE self) {
873
+ xosd *arg1 = (xosd *) 0 ;
874
+ int arg2 ;
875
+ int result;
876
+ VALUE vresult = Qnil;
877
+
878
+ if ((argc < 2) || (argc > 2))
879
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
880
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
881
+ arg2 = NUM2INT(argv[1]);
882
+ result = (int)xosd_set_horizontal_offset(arg1,arg2);
883
+
884
+ vresult = INT2NUM(result);
885
+ return vresult;
886
+ }
887
+
888
+
889
+ static VALUE
890
+ _wrap_xosd_set_vertical_offset(int argc, VALUE *argv, VALUE self) {
891
+ xosd *arg1 = (xosd *) 0 ;
892
+ int arg2 ;
893
+ int result;
894
+ VALUE vresult = Qnil;
895
+
896
+ if ((argc < 2) || (argc > 2))
897
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
898
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
899
+ arg2 = NUM2INT(argv[1]);
900
+ result = (int)xosd_set_vertical_offset(arg1,arg2);
901
+
902
+ vresult = INT2NUM(result);
903
+ return vresult;
904
+ }
905
+
906
+
907
+ static VALUE
908
+ _wrap_xosd_set_timeout(int argc, VALUE *argv, VALUE self) {
909
+ xosd *arg1 = (xosd *) 0 ;
910
+ int arg2 ;
911
+ int result;
912
+ VALUE vresult = Qnil;
913
+
914
+ if ((argc < 2) || (argc > 2))
915
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
916
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
917
+ arg2 = NUM2INT(argv[1]);
918
+ result = (int)xosd_set_timeout(arg1,arg2);
919
+
920
+ vresult = INT2NUM(result);
921
+ return vresult;
922
+ }
923
+
924
+
925
+ static VALUE
926
+ _wrap_xosd_set_colour(int argc, VALUE *argv, VALUE self) {
927
+ xosd *arg1 = (xosd *) 0 ;
928
+ char *arg2 ;
929
+ int result;
930
+ VALUE vresult = Qnil;
931
+
932
+ if ((argc < 2) || (argc > 2))
933
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
934
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
935
+ arg2 = STR2CSTR(argv[1]);
936
+ result = (int)xosd_set_colour(arg1,(char const *)arg2);
937
+
938
+ vresult = INT2NUM(result);
939
+ return vresult;
940
+ }
941
+
942
+
943
+ static VALUE
944
+ _wrap_xosd_set_font(int argc, VALUE *argv, VALUE self) {
945
+ xosd *arg1 = (xosd *) 0 ;
946
+ char *arg2 ;
947
+ int result;
948
+ VALUE vresult = Qnil;
949
+
950
+ if ((argc < 2) || (argc > 2))
951
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
952
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
953
+ arg2 = STR2CSTR(argv[1]);
954
+ result = (int)xosd_set_font(arg1,(char const *)arg2);
955
+
956
+ vresult = INT2NUM(result);
957
+ return vresult;
958
+ }
959
+
960
+
961
+ static VALUE
962
+ _wrap_xosd_get_colour(int argc, VALUE *argv, VALUE self) {
963
+ xosd *arg1 = (xosd *) 0 ;
964
+ int *arg2 = (int *) 0 ;
965
+ int *arg3 = (int *) 0 ;
966
+ int *arg4 = (int *) 0 ;
967
+ int result;
968
+ VALUE vresult = Qnil;
969
+
970
+ if ((argc < 4) || (argc > 4))
971
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
972
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
973
+ SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_int, 1);
974
+ SWIG_ConvertPtr(argv[2], (void **) &arg3, SWIGTYPE_p_int, 1);
975
+ SWIG_ConvertPtr(argv[3], (void **) &arg4, SWIGTYPE_p_int, 1);
976
+ result = (int)xosd_get_colour(arg1,arg2,arg3,arg4);
977
+
978
+ vresult = INT2NUM(result);
979
+ return vresult;
980
+ }
981
+
982
+
983
+ static VALUE
984
+ _wrap_xosd_scroll(int argc, VALUE *argv, VALUE self) {
985
+ xosd *arg1 = (xosd *) 0 ;
986
+ int arg2 ;
987
+ int result;
988
+ VALUE vresult = Qnil;
989
+
990
+ if ((argc < 2) || (argc > 2))
991
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
992
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
993
+ arg2 = NUM2INT(argv[1]);
994
+ result = (int)xosd_scroll(arg1,arg2);
995
+
996
+ vresult = INT2NUM(result);
997
+ return vresult;
998
+ }
999
+
1000
+
1001
+ static VALUE
1002
+ _wrap_xosd_get_number_lines(int argc, VALUE *argv, VALUE self) {
1003
+ xosd *arg1 = (xosd *) 0 ;
1004
+ int result;
1005
+ VALUE vresult = Qnil;
1006
+
1007
+ if ((argc < 1) || (argc > 1))
1008
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1009
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_xosd, 1);
1010
+ result = (int)xosd_get_number_lines(arg1);
1011
+
1012
+ vresult = INT2NUM(result);
1013
+ return vresult;
1014
+ }
1015
+
1016
+
1017
+
1018
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1019
+
1020
+ static swig_type_info _swigt__p_xosd[] = {{"_p_xosd", 0, "xosd *", 0},{"_p_xosd"},{0}};
1021
+ static swig_type_info _swigt__p_int[] = {{"_p_int", 0, "int *", 0},{"_p_int"},{0}};
1022
+
1023
+ static swig_type_info *swig_types_initial[] = {
1024
+ _swigt__p_xosd,
1025
+ _swigt__p_int,
1026
+ 0
1027
+ };
1028
+
1029
+
1030
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
1031
+
1032
+
1033
+ #ifdef __cplusplus
1034
+ extern "C"
1035
+ #endif
1036
+ SWIGEXPORT(void) Init_libxosd(void) {
1037
+ int i;
1038
+
1039
+ SWIG_InitRuntime();
1040
+ mLibxosd = rb_define_module("Libxosd");
1041
+
1042
+ for (i = 0; swig_types_initial[i]; i++) {
1043
+ swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
1044
+ SWIG_define_class(swig_types[i]);
1045
+ }
1046
+
1047
+ rb_define_const(mLibxosd,"XOSD_percentage", INT2NUM(XOSD_percentage));
1048
+ rb_define_const(mLibxosd,"XOSD_string", INT2NUM(XOSD_string));
1049
+ rb_define_const(mLibxosd,"XOSD_printf", INT2NUM(XOSD_printf));
1050
+ rb_define_const(mLibxosd,"XOSD_slider", INT2NUM(XOSD_slider));
1051
+ rb_define_const(mLibxosd,"XOSD_top", INT2NUM(XOSD_top));
1052
+ rb_define_const(mLibxosd,"XOSD_bottom", INT2NUM(XOSD_bottom));
1053
+ rb_define_const(mLibxosd,"XOSD_middle", INT2NUM(XOSD_middle));
1054
+ rb_define_const(mLibxosd,"XOSD_left", INT2NUM(XOSD_left));
1055
+ rb_define_const(mLibxosd,"XOSD_center", INT2NUM(XOSD_center));
1056
+ rb_define_const(mLibxosd,"XOSD_right", INT2NUM(XOSD_right));
1057
+ rb_define_singleton_method(mLibxosd, "xosd_error", xosd_error_get, 0);
1058
+ rb_define_module_function(mLibxosd, "xosd_create", _wrap_xosd_create, -1);
1059
+ rb_define_module_function(mLibxosd, "xosd_destroy", _wrap_xosd_destroy, -1);
1060
+ rb_define_module_function(mLibxosd, "xosd_set_bar_length", _wrap_xosd_set_bar_length, -1);
1061
+ rb_define_module_function(mLibxosd, "xosd_display", _wrap_xosd_display, -1);
1062
+ rb_define_module_function(mLibxosd, "xosd_is_onscreen", _wrap_xosd_is_onscreen, -1);
1063
+ rb_define_module_function(mLibxosd, "xosd_wait_until_no_display", _wrap_xosd_wait_until_no_display, -1);
1064
+ rb_define_module_function(mLibxosd, "xosd_hide", _wrap_xosd_hide, -1);
1065
+ rb_define_module_function(mLibxosd, "xosd_show", _wrap_xosd_show, -1);
1066
+ rb_define_module_function(mLibxosd, "xosd_set_pos", _wrap_xosd_set_pos, -1);
1067
+ rb_define_module_function(mLibxosd, "xosd_set_align", _wrap_xosd_set_align, -1);
1068
+ rb_define_module_function(mLibxosd, "xosd_set_shadow_offset", _wrap_xosd_set_shadow_offset, -1);
1069
+ rb_define_module_function(mLibxosd, "xosd_set_outline_offset", _wrap_xosd_set_outline_offset, -1);
1070
+ rb_define_module_function(mLibxosd, "xosd_set_outline_colour", _wrap_xosd_set_outline_colour, -1);
1071
+ rb_define_module_function(mLibxosd, "xosd_set_shadow_colour", _wrap_xosd_set_shadow_colour, -1);
1072
+ rb_define_module_function(mLibxosd, "xosd_set_horizontal_offset", _wrap_xosd_set_horizontal_offset, -1);
1073
+ rb_define_module_function(mLibxosd, "xosd_set_vertical_offset", _wrap_xosd_set_vertical_offset, -1);
1074
+ rb_define_module_function(mLibxosd, "xosd_set_timeout", _wrap_xosd_set_timeout, -1);
1075
+ rb_define_module_function(mLibxosd, "xosd_set_colour", _wrap_xosd_set_colour, -1);
1076
+ rb_define_module_function(mLibxosd, "xosd_set_font", _wrap_xosd_set_font, -1);
1077
+ rb_define_module_function(mLibxosd, "xosd_get_colour", _wrap_xosd_get_colour, -1);
1078
+ rb_define_module_function(mLibxosd, "xosd_scroll", _wrap_xosd_scroll, -1);
1079
+ rb_define_module_function(mLibxosd, "xosd_get_number_lines", _wrap_xosd_get_number_lines, -1);
1080
+ }
1081
+