fxruby 1.6.29 → 1.6.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +12 -1
- data/Manifest.txt +5 -0
- data/Rakefile +8 -2
- data/examples/gltest.rb +0 -7
- data/examples/groupbox.rb +5 -3
- data/examples/thread.rb +55 -0
- data/ext/fox16_c/FXRbApp.cpp +67 -5
- data/ext/fox16_c/FXRuby.cpp +142 -110
- data/ext/fox16_c/extconf.rb +36 -28
- data/ext/fox16_c/gvl_wrappers.cpp +12 -0
- data/ext/fox16_c/include/FXRbApp.h +41 -6
- data/ext/fox16_c/include/FXRbBitmap.h +12 -12
- data/ext/fox16_c/include/FXRbCommon.h +3 -0
- data/ext/fox16_c/include/FXRbCursor.h +2 -2
- data/ext/fox16_c/include/FXRbDC.h +62 -62
- data/ext/fox16_c/include/FXRbDialogBox.h +2 -2
- data/ext/fox16_c/include/FXRbDockBar.h +3 -3
- data/ext/fox16_c/include/FXRbDockSite.h +4 -4
- data/ext/fox16_c/include/FXRbDrawable.h +1 -1
- data/ext/fox16_c/include/FXRbFileDict.h +3 -3
- data/ext/fox16_c/include/FXRbFoldingList.h +28 -28
- data/ext/fox16_c/include/FXRbFont.h +18 -18
- data/ext/fox16_c/include/FXRbGLCanvas.h +4 -4
- data/ext/fox16_c/include/FXRbGLObject.h +8 -8
- data/ext/fox16_c/include/FXRbGLShape.h +1 -1
- data/ext/fox16_c/include/FXRbGLViewer.h +3 -3
- data/ext/fox16_c/include/FXRbHeader.h +7 -7
- data/ext/fox16_c/include/FXRbIconList.h +28 -28
- data/ext/fox16_c/include/FXRbIconSource.h +12 -12
- data/ext/fox16_c/include/FXRbId.h +3 -3
- data/ext/fox16_c/include/FXRbImage.h +19 -19
- data/ext/fox16_c/include/FXRbList.h +21 -21
- data/ext/fox16_c/include/FXRbListBox.h +1 -1
- data/ext/fox16_c/include/FXRbMDIChild.h +4 -4
- data/ext/fox16_c/include/FXRbMDIClient.h +4 -4
- data/ext/fox16_c/include/FXRbObject.h +2 -2
- data/ext/fox16_c/include/FXRbPopup.h +2 -2
- data/ext/fox16_c/include/FXRbRealSpinner.h +1 -1
- data/ext/fox16_c/include/FXRbScrollArea.h +4 -4
- data/ext/fox16_c/include/FXRbShutter.h +1 -1
- data/ext/fox16_c/include/FXRbSpinner.h +1 -1
- data/ext/fox16_c/include/FXRbStream.h +3 -3
- data/ext/fox16_c/include/FXRbTabBar.h +1 -1
- data/ext/fox16_c/include/FXRbTable.h +53 -53
- data/ext/fox16_c/include/FXRbText.h +23 -23
- data/ext/fox16_c/include/FXRbTopWindow.h +5 -5
- data/ext/fox16_c/include/FXRbTranslator.h +1 -1
- data/ext/fox16_c/include/FXRbTreeList.h +28 -28
- data/ext/fox16_c/include/FXRbTreeListBox.h +1 -1
- data/ext/fox16_c/include/FXRbWindow.h +31 -31
- data/ext/fox16_c/include/FXRuby.h +200 -94
- data/ext/fox16_c/include/gvl_wrappers.h +594 -0
- data/lib/fox16.rb +1 -0
- data/lib/fox16/thread.rb +51 -0
- data/lib/fox16/version.rb +1 -1
- data/rdoc-sources/FXApp.rb +5 -0
- data/rdoc-sources/FXId.rb +5 -0
- data/swig-interfaces/FXApp.i +14 -78
- data/swig-interfaces/macros.i +56 -0
- data/test/TC_FXApp.rb +60 -10
- data/test/TC_FXJPGImage.rb +47 -0
- metadata +24 -103
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
data/ext/fox16_c/extconf.rb
CHANGED
@@ -7,7 +7,7 @@ def find_installed_fox_version
|
|
7
7
|
stddirs = ["/usr/include/fox-1.6",
|
8
8
|
"/usr/local/include/fox-1.6",
|
9
9
|
"/sw/include/fox-1.6",
|
10
|
-
|
10
|
+
"/opt/local/include/fox-1.6"]
|
11
11
|
usrdirs = []
|
12
12
|
ARGV.each do |arg|
|
13
13
|
if arg =~ /--with-fox-include/
|
@@ -109,12 +109,13 @@ def do_rake_compiler_setup
|
|
109
109
|
|
110
110
|
dir_config("installed")
|
111
111
|
|
112
|
+
host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
|
112
113
|
libz_recipe = MiniPortile.new("libz", LIBZ_VERSION).tap do |recipe|
|
113
114
|
recipe.files = [LIBZ_SOURCE_URI]
|
114
115
|
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
|
115
116
|
# Prefer host_alias over host in order to use i586-mingw32msvc as
|
116
117
|
# correct compiler prefix for cross build, but use host if not set.
|
117
|
-
recipe.host =
|
118
|
+
recipe.host = host
|
118
119
|
class << recipe
|
119
120
|
def configure
|
120
121
|
Dir.chdir work_path do
|
@@ -157,7 +158,7 @@ def do_rake_compiler_setup
|
|
157
158
|
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
|
158
159
|
# Prefer host_alias over host in order to use i586-mingw32msvc as
|
159
160
|
# correct compiler prefix for cross build, but use host if not set.
|
160
|
-
recipe.host =
|
161
|
+
recipe.host = host
|
161
162
|
recipe.configure_options = [
|
162
163
|
"--host=#{recipe.host}",
|
163
164
|
"--enable-shared",
|
@@ -182,7 +183,7 @@ def do_rake_compiler_setup
|
|
182
183
|
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
|
183
184
|
# Prefer host_alias over host in order to use i586-mingw32msvc as
|
184
185
|
# correct compiler prefix for cross build, but use host if not set.
|
185
|
-
recipe.host =
|
186
|
+
recipe.host = host
|
186
187
|
recipe.configure_options = [
|
187
188
|
"--host=#{recipe.host}",
|
188
189
|
"--enable-shared",
|
@@ -202,7 +203,7 @@ def do_rake_compiler_setup
|
|
202
203
|
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
|
203
204
|
# Prefer host_alias over host in order to use i586-mingw32msvc as
|
204
205
|
# correct compiler prefix for cross build, but use host if not set.
|
205
|
-
recipe.host =
|
206
|
+
recipe.host = host
|
206
207
|
recipe.configure_options = [
|
207
208
|
"--host=#{recipe.host}",
|
208
209
|
"--enable-shared",
|
@@ -222,7 +223,7 @@ def do_rake_compiler_setup
|
|
222
223
|
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
|
223
224
|
# Prefer host_alias over host in order to use i586-mingw32msvc as
|
224
225
|
# correct compiler prefix for cross build, but use host if not set.
|
225
|
-
recipe.host =
|
226
|
+
recipe.host = host
|
226
227
|
recipe.configure_options = [
|
227
228
|
"--host=#{recipe.host}",
|
228
229
|
"--without-xft",
|
@@ -255,7 +256,7 @@ def do_rake_compiler_setup
|
|
255
256
|
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
|
256
257
|
# Prefer host_alias over host in order to use i586-mingw32msvc as
|
257
258
|
# correct compiler prefix for cross build, but use host if not set.
|
258
|
-
recipe.host =
|
259
|
+
recipe.host = host
|
259
260
|
recipe.configure_options = [
|
260
261
|
"--host=#{recipe.host}",
|
261
262
|
"--enable-shared",
|
@@ -282,22 +283,19 @@ def do_rake_compiler_setup
|
|
282
283
|
|
283
284
|
checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
|
284
285
|
unless File.exist?(checkpoint)
|
285
|
-
|
286
|
-
|
286
|
+
with_env(
|
287
|
+
'PKG_CONFIG_PATH' => "#{libfox_recipe.path}/lib/pkgconfig"
|
288
|
+
) do
|
289
|
+
recipe.cook
|
290
|
+
FileUtils.touch checkpoint
|
291
|
+
end
|
287
292
|
end
|
288
293
|
recipe.activate
|
289
294
|
end
|
295
|
+
$autodetected_fxscintilla = true
|
290
296
|
|
291
|
-
|
292
|
-
|
293
|
-
# have_library( 'winspool', 'EnumPrintersA') && append_library( $libs, 'winspool' )
|
294
|
-
|
295
|
-
# dir_config('libz', "#{libz_recipe.path}/include", "#{libz_recipe.path}/lib")
|
296
|
-
# dir_config('libpng', "#{libpng_recipe.path}/include", "#{libpng_recipe.path}/lib")
|
297
|
-
# dir_config('libtiff', "#{libtiff_recipe.path}/include", "#{libtiff_recipe.path}/lib")
|
298
|
-
# dir_config('libjpeg', "#{libjpeg_recipe.path}/include", "#{libjpeg_recipe.path}/lib")
|
299
|
-
dir_config('libfox', "#{libfox_recipe.path}/include", "#{libfox_recipe.path}/lib")
|
300
|
-
dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include", "#{libfxscintills_recipe.path}/lib")
|
297
|
+
dir_config('libfox', "#{libfox_recipe.path}/include/fox-1.6", "#{libfox_recipe.path}/lib")
|
298
|
+
dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include/fxscintilla", "#{libfxscintills_recipe.path}/lib")
|
301
299
|
|
302
300
|
shared_dlls = [
|
303
301
|
"#{libfxscintills_recipe.path}/bin/libfxscintilla-20.dll",
|
@@ -320,7 +318,7 @@ def do_rake_compiler_setup
|
|
320
318
|
FileUtils.cp `#{cmd}`.chomp, '.', verbose: true
|
321
319
|
end
|
322
320
|
|
323
|
-
CONFIG['CXX'] = "#{
|
321
|
+
CONFIG['CXX'] = "#{host}-g++" # CXX setting must be prefixed for cross build
|
324
322
|
CONFIG['CC'] += "\nCXX=#{CONFIG['CXX']}" # Hack CXX into Makefile for cross compilation
|
325
323
|
CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static
|
326
324
|
$LDFLAGS += " -s" # remove symbol table informations from shared lib
|
@@ -350,8 +348,8 @@ def do_rake_compiler_setup
|
|
350
348
|
find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib")
|
351
349
|
$libs = append_library($libs, "Xrandr") unless RUBY_PLATFORM =~ /mingw/ || enable_config("win32-static-build")
|
352
350
|
$libs = append_library($libs, "Xcursor") unless RUBY_PLATFORM =~ /mingw/ || enable_config("win32-static-build")
|
353
|
-
find_header('FXRbCommon.h', File.join(File.dirname(__FILE__), 'include'))
|
354
351
|
$libs = append_library($libs, "FOX-1.6")
|
352
|
+
$INCFLAGS << " -I#{File.join(File.dirname(__FILE__), 'include')}"
|
355
353
|
if is_fxscintilla_build?
|
356
354
|
FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak')
|
357
355
|
$CPPFLAGS = $CPPFLAGS + " -DWITH_FXSCINTILLA -DHAVE_FOX_1_6"
|
@@ -359,6 +357,13 @@ def do_rake_compiler_setup
|
|
359
357
|
else
|
360
358
|
FileUtils.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exist?('scintilla_wrap.cpp')
|
361
359
|
end
|
360
|
+
|
361
|
+
checking_for("thread local variables") do
|
362
|
+
$defs.push( "-DHAVE___THREAD" ) if try_compile('__thread int x=1;')
|
363
|
+
end &&
|
364
|
+
have_func('rb_thread_call_without_gvl') &&
|
365
|
+
have_func('rb_thread_call_with_gvl')
|
366
|
+
|
362
367
|
end
|
363
368
|
|
364
369
|
# This directive processes the "--with-fox-include" and "--with-fox-lib"
|
@@ -372,15 +377,17 @@ dir_config('fox', '/usr/local/include/fox-1.6', '/usr/local/lib')
|
|
372
377
|
|
373
378
|
dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib')
|
374
379
|
|
375
|
-
|
380
|
+
unless enable_config("win32-cross")
|
381
|
+
find_installed_fox_version
|
376
382
|
|
377
|
-
#
|
378
|
-
# Check for FXScintilla header files, unless FXScintilla support has
|
379
|
-
# been explicitly suppressed with the '--without-fxscintilla' flag.
|
380
|
-
#
|
383
|
+
#
|
384
|
+
# Check for FXScintilla header files, unless FXScintilla support has
|
385
|
+
# been explicitly suppressed with the '--without-fxscintilla' flag.
|
386
|
+
#
|
381
387
|
|
382
|
-
unless fxscintilla_support_suppressed?
|
383
|
-
|
388
|
+
unless fxscintilla_support_suppressed?
|
389
|
+
find_installed_fxscintilla_version
|
390
|
+
end
|
384
391
|
end
|
385
392
|
|
386
393
|
# Platform-specific modifications
|
@@ -391,4 +398,5 @@ $CFLAGS += " -DRUBY_1_9" if RUBY_VERSION =~ /1\.9\./
|
|
391
398
|
$CFLAGS += " -DRUBY_2_0" if RUBY_VERSION =~ /2\.0\./
|
392
399
|
|
393
400
|
# Last step: build the makefile
|
401
|
+
create_header
|
394
402
|
create_makefile("fox16_c")
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/*
|
2
|
+
* gvl_wrappers.c - Wrapper functions for locking/unlocking the Ruby GVL
|
3
|
+
*
|
4
|
+
*/
|
5
|
+
|
6
|
+
#include "FXRbCommon.h"
|
7
|
+
|
8
|
+
__thread int g_fxrb_thread_has_gvl = 1;
|
9
|
+
|
10
|
+
FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_WRAPPER_STRUCT );
|
11
|
+
FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_SKELETON );
|
12
|
+
FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_STUB );
|
@@ -38,6 +38,33 @@ inline void cls ## _detach(cls *self){ \
|
|
38
38
|
inline void cls ## _create(cls *self){ \
|
39
39
|
self->cls::create(); \
|
40
40
|
} \
|
41
|
+
inline FXint cls ## _run_gvl(cls *self){ \
|
42
|
+
return self->cls::run(); \
|
43
|
+
} \
|
44
|
+
inline FXint cls ## _runOneEvent_gvl(cls *self, bool blocking=true){ \
|
45
|
+
return self->cls::runOneEvent(blocking); \
|
46
|
+
} \
|
47
|
+
inline FXint cls ## _runUntil_gvl(cls *self, FXuint& condition){ \
|
48
|
+
return self->cls::runUntil(condition); \
|
49
|
+
} \
|
50
|
+
inline FXint cls ## _runWhileEvents_gvl(cls *self){ \
|
51
|
+
return self->cls::runWhileEvents(); \
|
52
|
+
} \
|
53
|
+
inline FXint cls ## _runModalWhileEvents_gvl(cls *self, FXWindow* window=NULL){ \
|
54
|
+
return self->cls::runModalWhileEvents(window); \
|
55
|
+
} \
|
56
|
+
inline FXint cls ## _runModal_gvl(cls *self){ \
|
57
|
+
return self->cls::runModal(); \
|
58
|
+
} \
|
59
|
+
inline FXint cls ## _runModalFor_gvl(cls *self, FXWindow* window){ \
|
60
|
+
return self->cls::runModalFor(window); \
|
61
|
+
} \
|
62
|
+
inline FXint cls ## _runModalWhileShown_gvl(cls *self, FXWindow* window){ \
|
63
|
+
return self->cls::runModalWhileShown(window); \
|
64
|
+
} \
|
65
|
+
inline FXint cls ## _runPopup_gvl(cls *self, FXWindow* owner){ \
|
66
|
+
return self->cls::runPopup(owner); \
|
67
|
+
} \
|
41
68
|
static void cls ## _init(cls* self,VALUE ary,bool connect){ \
|
42
69
|
int i; \
|
43
70
|
char **argv; \
|
@@ -62,7 +89,6 @@ inline void cls ## _exit(cls *self,FXint code){ \
|
|
62
89
|
self->cls::exit(code); \
|
63
90
|
}
|
64
91
|
|
65
|
-
|
66
92
|
/**
|
67
93
|
* For C/C++ applications, the argument count (argc) will always be at least
|
68
94
|
* one, and the first element of the argument array (argv[0]) will contain
|
@@ -83,13 +109,13 @@ inline void cls ## _exit(cls *self,FXint code){ \
|
|
83
109
|
*/
|
84
110
|
#define IMPLEMENT_FXAPP_STUBS(cls) \
|
85
111
|
void cls::create(){ \
|
86
|
-
FXRbCallVoidMethod(this,
|
112
|
+
FXRbCallVoidMethod(this,"create"); \
|
87
113
|
} \
|
88
114
|
void cls::detach(){ \
|
89
|
-
FXRbCallVoidMethod(this,
|
115
|
+
FXRbCallVoidMethod(this,"detach"); \
|
90
116
|
} \
|
91
117
|
void cls::destroy(){ \
|
92
|
-
FXRbCallVoidMethod(this,
|
118
|
+
FXRbCallVoidMethod(this,"destroy"); \
|
93
119
|
} \
|
94
120
|
void cls::init(int& argc,char** argv,bool connect){ \
|
95
121
|
int i; \
|
@@ -97,7 +123,7 @@ inline void cls ## _exit(cls *self,FXint code){ \
|
|
97
123
|
for(i=1; i<argc; i++){ \
|
98
124
|
rb_ary_push(ary,rb_str_new2(argv[i])); \
|
99
125
|
} \
|
100
|
-
FXRbCallVoidMethod(this,
|
126
|
+
FXRbCallVoidMethod(this,"init",ary,connect); \
|
101
127
|
argc=static_cast<int>(RARRAY_LEN(ary)+1); \
|
102
128
|
for(i=1; i<argc; i++){ \
|
103
129
|
VALUE e=rb_ary_entry(ary,i-1); \
|
@@ -105,7 +131,7 @@ inline void cls ## _exit(cls *self,FXint code){ \
|
|
105
131
|
} \
|
106
132
|
} \
|
107
133
|
void cls::exit(FXint code){ \
|
108
|
-
FXRbCallVoidMethod(this,
|
134
|
+
FXRbCallVoidMethod(this,"exit",code); \
|
109
135
|
}
|
110
136
|
|
111
137
|
|
@@ -114,6 +140,12 @@ class FXRbApp : public FXApp {
|
|
114
140
|
protected:
|
115
141
|
FXbool m_bThreadsEnabled;
|
116
142
|
FXuint sleepTime;
|
143
|
+
public:
|
144
|
+
#ifdef WIN32
|
145
|
+
static WSAEVENT interrupt_event;
|
146
|
+
#else
|
147
|
+
static int interrupt_fds[2];
|
148
|
+
#endif
|
117
149
|
protected:
|
118
150
|
FXRbApp(){}
|
119
151
|
public:
|
@@ -126,6 +158,7 @@ public:
|
|
126
158
|
};
|
127
159
|
public:
|
128
160
|
long onChoreThreads(FXObject*,FXSelector,void*);
|
161
|
+
long onChoreThreads_gvlcb(FXObject*,FXSelector,void*);
|
129
162
|
public:
|
130
163
|
// Constructor
|
131
164
|
FXRbApp(const FXchar* name,const FXchar* vendor);
|
@@ -152,4 +185,6 @@ public:
|
|
152
185
|
virtual ~FXRbApp();
|
153
186
|
};
|
154
187
|
|
188
|
+
long FXRbApp_onChoreThreads_gvlcb(FXRbApp*,FXObject*,FXSelector,void*);
|
189
|
+
|
155
190
|
#endif
|
@@ -68,40 +68,40 @@ inline void cls ## _setData(cls* self,FXuchar* pix,FXuint opts,FXint w,FXint h){
|
|
68
68
|
|
69
69
|
#define IMPLEMENT_FXBITMAP_STUBS(cls) \
|
70
70
|
void cls::restore(){ \
|
71
|
-
FXRbCallVoidMethod(this,
|
71
|
+
FXRbCallVoidMethod(this,"restore"); \
|
72
72
|
} \
|
73
73
|
void cls::render(){ \
|
74
|
-
FXRbCallVoidMethod(this,
|
74
|
+
FXRbCallVoidMethod(this,"render"); \
|
75
75
|
} \
|
76
76
|
void cls::release(){ \
|
77
|
-
FXRbCallVoidMethod(this,
|
77
|
+
FXRbCallVoidMethod(this,"release"); \
|
78
78
|
} \
|
79
79
|
bool cls::savePixels(FXStream& store) const { \
|
80
|
-
return FXRbCallBoolMethod(this,
|
80
|
+
return FXRbCallBoolMethod(this,"savePixels",store); \
|
81
81
|
} \
|
82
82
|
bool cls::loadPixels(FXStream& store){ \
|
83
|
-
return FXRbCallBoolMethod(this,
|
83
|
+
return FXRbCallBoolMethod(this,"loadPixels",store); \
|
84
84
|
} \
|
85
85
|
void cls::scale(FXint w,FXint h){ \
|
86
|
-
FXRbCallVoidMethod(this,
|
86
|
+
FXRbCallVoidMethod(this,"scale",w,h); \
|
87
87
|
} \
|
88
88
|
void cls::mirror(FXbool horizontal,FXbool vertical){ \
|
89
|
-
FXRbCallVoidMethod(this,
|
89
|
+
FXRbCallVoidMethod(this,"mirror",horizontal,vertical); \
|
90
90
|
} \
|
91
91
|
void cls::rotate(FXint degrees){ \
|
92
|
-
FXRbCallVoidMethod(this,
|
92
|
+
FXRbCallVoidMethod(this,"rotate",degrees); \
|
93
93
|
} \
|
94
94
|
void cls::crop(FXint x,FXint y,FXint w,FXint h,FXbool color){ \
|
95
|
-
FXRbCallVoidMethod(this,
|
95
|
+
FXRbCallVoidMethod(this,"crop",x,y,w,h,color); \
|
96
96
|
} \
|
97
97
|
void cls::fill(FXbool color){ \
|
98
|
-
FXRbCallVoidMethod(this,
|
98
|
+
FXRbCallVoidMethod(this,"fill",color); \
|
99
99
|
} \
|
100
100
|
void cls::setData(FXuchar* pix,FXuint opts){ \
|
101
|
-
FXRbCallVoidMethod(this,
|
101
|
+
FXRbCallVoidMethod(this,"setData",pix,opts); \
|
102
102
|
} \
|
103
103
|
void cls::setData(FXuchar* pix,FXuint opts,FXint w,FXint h){ \
|
104
|
-
FXRbCallVoidMethod(this,
|
104
|
+
FXRbCallVoidMethod(this,"setData",pix,opts,w,h); \
|
105
105
|
}
|
106
106
|
|
107
107
|
|
@@ -27,6 +27,8 @@
|
|
27
27
|
extern "C" {
|
28
28
|
#include "ruby.h"
|
29
29
|
|
30
|
+
#include "extconf.h"
|
31
|
+
|
30
32
|
#ifdef HAVE_RUBY_ENCODING_H
|
31
33
|
#include "ruby/encoding.h"
|
32
34
|
#endif
|
@@ -97,3 +99,4 @@ extern "C" {
|
|
97
99
|
#include "FXScintilla.h"
|
98
100
|
#endif
|
99
101
|
#include "FXRuby.h"
|
102
|
+
#include "gvl_wrappers.h"
|
@@ -38,10 +38,10 @@ inline bool klass ## _loadPixels(klass* self,FXStream& store){ \
|
|
38
38
|
|
39
39
|
#define IMPLEMENT_FXCURSOR_STUBS(cls) \
|
40
40
|
bool cls::savePixels(FXStream& store) const { \
|
41
|
-
return FXRbCallBoolMethod(this,
|
41
|
+
return FXRbCallBoolMethod(this,"savePixels",store); \
|
42
42
|
} \
|
43
43
|
bool cls::loadPixels(FXStream& store){ \
|
44
|
-
return FXRbCallBoolMethod(this,
|
44
|
+
return FXRbCallBoolMethod(this,"loadPixels",store); \
|
45
45
|
}
|
46
46
|
|
47
47
|
class FXRbCursor : public FXCursor {
|
@@ -218,190 +218,190 @@ inline void klass ## _clipChildren(klass* self,FXbool yes){ \
|
|
218
218
|
|
219
219
|
#define IMPLEMENT_FXDC_STUBS(cls) \
|
220
220
|
FXColor cls::readPixel(FXint x,FXint y){ \
|
221
|
-
return FXRbCallColorMethod(this,
|
221
|
+
return FXRbCallColorMethod(this,"readPixel",x,y); \
|
222
222
|
} \
|
223
223
|
void cls::drawPoint(FXint x,FXint y){ \
|
224
|
-
FXRbCallVoidMethod(this,
|
224
|
+
FXRbCallVoidMethod(this,"drawPoint",x,y); \
|
225
225
|
} \
|
226
226
|
void cls::drawPoints(const FXPoint* points,FXuint npoints){ \
|
227
|
-
|
227
|
+
FXRbCallVoidArrayMethod(this,"drawPoints",points,npoints); \
|
228
228
|
} \
|
229
229
|
void cls::drawPointsRel(const FXPoint* points,FXuint npoints){ \
|
230
|
-
|
230
|
+
FXRbCallVoidArrayMethod(this,"drawPointsRel",points,npoints); \
|
231
231
|
} \
|
232
232
|
void cls::drawLine(FXint x1,FXint y1,FXint x2,FXint y2){ \
|
233
|
-
FXRbCallVoidMethod(this,
|
233
|
+
FXRbCallVoidMethod(this,"drawLine",x1,y1,x2,y2); \
|
234
234
|
} \
|
235
235
|
void cls::drawLines(const FXPoint* points,FXuint npoints){ \
|
236
|
-
|
236
|
+
FXRbCallVoidArrayMethod(this,"drawLines",points,npoints); \
|
237
237
|
} \
|
238
238
|
void cls::drawLinesRel(const FXPoint* points,FXuint npoints){ \
|
239
|
-
|
239
|
+
FXRbCallVoidArrayMethod(this,"drawLinesRel",points,npoints); \
|
240
240
|
} \
|
241
241
|
void cls::drawLineSegments(const FXSegment* segments,FXuint nsegments){ \
|
242
|
-
|
242
|
+
FXRbCallVoidArrayMethod(this,"drawLineSegments",segments,nsegments); \
|
243
243
|
} \
|
244
244
|
void cls::drawRectangle(FXint x,FXint y,FXint w,FXint h){ \
|
245
|
-
FXRbCallVoidMethod(this,
|
245
|
+
FXRbCallVoidMethod(this,"drawRectangle",x,y,w,h); \
|
246
246
|
} \
|
247
247
|
void cls::drawRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh){ \
|
248
|
-
FXRbCallVoidMethod(this,
|
248
|
+
FXRbCallVoidMethod(this,"drawRoundRectangle",x,y,w,h,ew,eh); \
|
249
249
|
} \
|
250
250
|
void cls::drawRectangles(const FXRectangle* rectangles,FXuint nrectangles){ \
|
251
|
-
|
251
|
+
FXRbCallVoidArrayMethod(this,"drawRectangles",rectangles,nrectangles); \
|
252
252
|
} \
|
253
253
|
void cls::drawArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2){ \
|
254
|
-
FXRbCallVoidMethod(this,
|
254
|
+
FXRbCallVoidMethod(this,"drawArc",x,y,w,h,ang1,ang2); \
|
255
255
|
} \
|
256
256
|
void cls::drawArcs(const FXArc* arcs,FXuint narcs){ \
|
257
|
-
|
257
|
+
FXRbCallVoidArrayMethod(this,"drawArcs",arcs,narcs); \
|
258
258
|
} \
|
259
259
|
void cls::drawEllipse(FXint x,FXint y,FXint w,FXint h){ \
|
260
|
-
FXRbCallVoidMethod(this,
|
260
|
+
FXRbCallVoidMethod(this,"drawEllipse",x,y,w,h); \
|
261
261
|
} \
|
262
262
|
void cls::fillRectangle(FXint x,FXint y,FXint w,FXint h){ \
|
263
|
-
FXRbCallVoidMethod(this,
|
263
|
+
FXRbCallVoidMethod(this,"fillRectangle",x,y,w,h); \
|
264
264
|
} \
|
265
265
|
void cls::fillRectangles(const FXRectangle* rectangles,FXuint nrectangles){ \
|
266
|
-
|
266
|
+
FXRbCallVoidArrayMethod(this,"fillRectangles",rectangles,nrectangles); \
|
267
267
|
} \
|
268
268
|
void cls::fillRoundRectangle(FXint x,FXint y,FXint w,FXint h,FXint ew,FXint eh){ \
|
269
|
-
FXRbCallVoidMethod(this,
|
269
|
+
FXRbCallVoidMethod(this,"fillRoundRectangle",x,y,w,h,ew,eh); \
|
270
270
|
} \
|
271
271
|
void cls::fillChord(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2){ \
|
272
|
-
FXRbCallVoidMethod(this,
|
272
|
+
FXRbCallVoidMethod(this,"fillChord",x,y,w,h,ang1,ang2); \
|
273
273
|
} \
|
274
274
|
void cls::fillChords(const FXArc* chords,FXuint nchords){ \
|
275
|
-
|
275
|
+
FXRbCallVoidArrayMethod(this,"fillChords",chords,nchords); \
|
276
276
|
} \
|
277
277
|
void cls::fillArc(FXint x,FXint y,FXint w,FXint h,FXint ang1,FXint ang2){ \
|
278
|
-
FXRbCallVoidMethod(this,
|
278
|
+
FXRbCallVoidMethod(this,"fillArc",x,y,w,h,ang1,ang2); \
|
279
279
|
} \
|
280
280
|
void cls::fillArcs(const FXArc* arcs,FXuint narcs){ \
|
281
|
-
|
281
|
+
FXRbCallVoidArrayMethod(this,"fillArcs",arcs,narcs); \
|
282
282
|
} \
|
283
283
|
void cls::fillEllipse(FXint x,FXint y,FXint w,FXint h){ \
|
284
|
-
FXRbCallVoidMethod(this,
|
284
|
+
FXRbCallVoidMethod(this,"fillEllipse",x,y,w,h); \
|
285
285
|
} \
|
286
286
|
void cls::fillPolygon(const FXPoint* points,FXuint npoints){ \
|
287
|
-
|
287
|
+
FXRbCallVoidArrayMethod(this,"fillPolygon",points,npoints); \
|
288
288
|
} \
|
289
289
|
void cls::fillConcavePolygon(const FXPoint* points,FXuint npoints){ \
|
290
|
-
|
290
|
+
FXRbCallVoidArrayMethod(this,"fillConcavePolygon",points,npoints); \
|
291
291
|
} \
|
292
292
|
void cls::fillComplexPolygon(const FXPoint* points,FXuint npoints){ \
|
293
|
-
|
293
|
+
FXRbCallVoidArrayMethod(this,"fillComplexPolygon",points,npoints); \
|
294
294
|
} \
|
295
295
|
void cls::fillPolygonRel(const FXPoint* points,FXuint npoints){ \
|
296
|
-
|
296
|
+
FXRbCallVoidArrayMethod(this,"fillPolygonRel",points,npoints); \
|
297
297
|
} \
|
298
298
|
void cls::fillConcavePolygonRel(const FXPoint* points,FXuint npoints){ \
|
299
|
-
|
299
|
+
FXRbCallVoidArrayMethod(this,"fillConcavePolygonRel",points,npoints); \
|
300
300
|
} \
|
301
301
|
void cls::fillComplexPolygonRel(const FXPoint* points,FXuint npoints){ \
|
302
|
-
|
302
|
+
FXRbCallVoidArrayMethod(this,"fillComplexPolygonRel",points,npoints); \
|
303
303
|
} \
|
304
304
|
void cls::drawHashBox(FXint x,FXint y,FXint w,FXint h,FXint b){ \
|
305
|
-
FXRbCallVoidMethod(this,
|
305
|
+
FXRbCallVoidMethod(this,"drawHashBox",x,y,w,h,b); \
|
306
306
|
} \
|
307
307
|
void cls::drawFocusRectangle(FXint x,FXint y,FXint w,FXint h){ \
|
308
|
-
FXRbCallVoidMethod(this,
|
308
|
+
FXRbCallVoidMethod(this,"drawFocusRectangle",x,y,w,h); \
|
309
309
|
} \
|
310
310
|
void cls::drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy){ \
|
311
|
-
FXRbCallVoidMethod(this,
|
311
|
+
FXRbCallVoidMethod(this,"drawArea",source,sx,sy,sw,sh,dx,dy); \
|
312
312
|
} \
|
313
313
|
void cls::drawArea(const FXDrawable* source,FXint sx,FXint sy,FXint sw,FXint sh,FXint dx,FXint dy,FXint dw,FXint dh){ \
|
314
|
-
FXRbCallVoidMethod(this,
|
314
|
+
FXRbCallVoidMethod(this,"drawArea",source,sx,sy,sw,sh,dx,dy,dw,dh); \
|
315
315
|
} \
|
316
316
|
void cls::drawImage(const FXImage* image,FXint dx,FXint dy){ \
|
317
|
-
FXRbCallVoidMethod(this,
|
317
|
+
FXRbCallVoidMethod(this,"drawImage",image,dx,dy); \
|
318
318
|
} \
|
319
319
|
void cls::drawBitmap(const FXBitmap* bitmap,FXint dx,FXint dy){ \
|
320
|
-
FXRbCallVoidMethod(this,
|
320
|
+
FXRbCallVoidMethod(this,"drawBitmap",bitmap,dx,dy); \
|
321
321
|
} \
|
322
322
|
void cls::drawIcon(const FXIcon* icon,FXint dx,FXint dy){ \
|
323
|
-
FXRbCallVoidMethod(this,
|
323
|
+
FXRbCallVoidMethod(this,"drawIcon",icon,dx,dy); \
|
324
324
|
} \
|
325
325
|
void cls::drawIconShaded(const FXIcon* icon,FXint dx,FXint dy){ \
|
326
|
-
FXRbCallVoidMethod(this,
|
326
|
+
FXRbCallVoidMethod(this,"drawIconShaded",icon,dx,dy); \
|
327
327
|
} \
|
328
328
|
void cls::drawIconSunken(const FXIcon* icon,FXint dx,FXint dy){ \
|
329
|
-
FXRbCallVoidMethod(this,
|
329
|
+
FXRbCallVoidMethod(this,"drawIconSunken",icon,dx,dy); \
|
330
330
|
} \
|
331
331
|
void cls::drawText(FXint x,FXint y,const FXString& string){ \
|
332
|
-
|
332
|
+
FXRbCallDCDrawMethod(this, "drawText", x, y, string); \
|
333
333
|
} \
|
334
334
|
void cls::drawText(FXint x,FXint y,const FXchar* string,FXuint length){ \
|
335
|
-
|
335
|
+
FXRbCallDCDrawMethod(this, "drawText", x, y, string, length); \
|
336
336
|
} \
|
337
337
|
void cls::drawImageText(FXint x,FXint y,const FXString& string){ \
|
338
|
-
|
338
|
+
FXRbCallDCDrawMethod(this, "drawImageText", x, y, string); \
|
339
339
|
} \
|
340
340
|
void cls::drawImageText(FXint x,FXint y,const FXchar* string,FXuint length){ \
|
341
|
-
|
341
|
+
FXRbCallDCDrawMethod(this, "drawImageText", x, y, string, length); \
|
342
342
|
} \
|
343
343
|
void cls::setForeground(FXColor clr){ \
|
344
|
-
FXRbCallVoidMethod(this,
|
344
|
+
FXRbCallVoidMethod(this,"setForeground",clr); \
|
345
345
|
} \
|
346
346
|
void cls::setBackground(FXColor clr){ \
|
347
|
-
FXRbCallVoidMethod(this,
|
347
|
+
FXRbCallVoidMethod(this,"setBackground",clr); \
|
348
348
|
} \
|
349
349
|
void cls::setDashes(FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength){ \
|
350
|
-
|
350
|
+
FXRbCallSetDashes(this,"setDashes",dashoffset,dashpattern,dashlength); \
|
351
351
|
} \
|
352
352
|
void cls::setLineWidth(FXuint linewidth){ \
|
353
|
-
FXRbCallVoidMethod(this,
|
353
|
+
FXRbCallVoidMethod(this,"setLineWidth",linewidth); \
|
354
354
|
} \
|
355
355
|
void cls::setLineCap(FXCapStyle capstyle){ \
|
356
|
-
FXRbCallVoidMethod(this,
|
356
|
+
FXRbCallVoidMethod(this,"setLineCap",capstyle); \
|
357
357
|
} \
|
358
358
|
void cls::setLineJoin(FXJoinStyle joinstyle){ \
|
359
|
-
FXRbCallVoidMethod(this,
|
359
|
+
FXRbCallVoidMethod(this,"setLineJoin",joinstyle); \
|
360
360
|
} \
|
361
361
|
void cls::setLineStyle(FXLineStyle linestyle){ \
|
362
|
-
FXRbCallVoidMethod(this,
|
362
|
+
FXRbCallVoidMethod(this,"setLineStyle",linestyle); \
|
363
363
|
} \
|
364
364
|
void cls::setFillStyle(FXFillStyle fillstyle){ \
|
365
|
-
FXRbCallVoidMethod(this,
|
365
|
+
FXRbCallVoidMethod(this,"setFillStyle",fillstyle); \
|
366
366
|
} \
|
367
367
|
void cls::setFillRule(FXFillRule fillrule){ \
|
368
|
-
FXRbCallVoidMethod(this,
|
368
|
+
FXRbCallVoidMethod(this,"setFillRule",fillrule); \
|
369
369
|
} \
|
370
370
|
void cls::setFunction(FXFunction func){ \
|
371
|
-
FXRbCallVoidMethod(this,
|
371
|
+
FXRbCallVoidMethod(this,"setFunction",func); \
|
372
372
|
} \
|
373
373
|
void cls::setTile(FXImage* image,FXint dx,FXint dy){ \
|
374
|
-
FXRbCallVoidMethod(this,
|
374
|
+
FXRbCallVoidMethod(this,"setTile",image,dx,dy); \
|
375
375
|
} \
|
376
376
|
void cls::setStipple(FXBitmap *bitmap,FXint dx,FXint dy){ \
|
377
|
-
FXRbCallVoidMethod(this,
|
377
|
+
FXRbCallVoidMethod(this,"setStipple",bitmap,dx,dy); \
|
378
378
|
} \
|
379
379
|
void cls::setStipple(FXStipplePattern pat,FXint dx,FXint dy){ \
|
380
|
-
FXRbCallVoidMethod(this,
|
380
|
+
FXRbCallVoidMethod(this,"setStipple",pat,dx,dy); \
|
381
381
|
} \
|
382
382
|
void cls::setClipRegion(const FXRegion& region){ \
|
383
|
-
FXRbCallVoidMethod(this,
|
383
|
+
FXRbCallVoidMethod(this,"setClipRegion",region); \
|
384
384
|
} \
|
385
385
|
void cls::setClipRectangle(FXint x,FXint y,FXint w,FXint h){ \
|
386
|
-
FXRbCallVoidMethod(this,
|
386
|
+
FXRbCallVoidMethod(this,"setClipRectangle",x,y,w,h); \
|
387
387
|
} \
|
388
388
|
void cls::setClipRectangle(const FXRectangle& rectangle){ \
|
389
|
-
FXRbCallVoidMethod(this,
|
389
|
+
FXRbCallVoidMethod(this,"setClipRectangle",rectangle); \
|
390
390
|
} \
|
391
391
|
void cls::clearClipRectangle(){ \
|
392
|
-
FXRbCallVoidMethod(this,
|
392
|
+
FXRbCallVoidMethod(this,"clearClipRectangle"); \
|
393
393
|
} \
|
394
394
|
void cls::setClipMask(FXBitmap* bitmap,FXint dx,FXint dy){ \
|
395
|
-
FXRbCallVoidMethod(this,
|
395
|
+
FXRbCallVoidMethod(this,"setClipMask",bitmap,dx,dy); \
|
396
396
|
} \
|
397
397
|
void cls::clearClipMask(){ \
|
398
|
-
FXRbCallVoidMethod(this,
|
398
|
+
FXRbCallVoidMethod(this,"clearClipMask"); \
|
399
399
|
} \
|
400
400
|
void cls::setFont(FXFont *fnt){ \
|
401
|
-
FXRbCallVoidMethod(this,
|
401
|
+
FXRbCallVoidMethod(this,"setFont",fnt); \
|
402
402
|
} \
|
403
403
|
void cls::clipChildren(FXbool yes){ \
|
404
|
-
FXRbCallVoidMethod(this,
|
404
|
+
FXRbCallVoidMethod(this,"clipChildren",yes); \
|
405
405
|
}
|
406
406
|
|
407
407
|
|