fxruby 1.6.20-x86-mingw32 → 1.6.22.pre2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/.gemtest +0 -0
  2. data/README.txt +2 -1
  3. data/Rakefile +43 -35
  4. data/TODO +4 -4
  5. data/doap.rdf +2 -2
  6. data/ext/fox16/FXRbDataTarget.cpp +2 -2
  7. data/ext/fox16/FXRuby.cpp +31 -96
  8. data/ext/fox16/core_wrap.cpp +5 -1
  9. data/ext/fox16/dialogs_wrap.cpp +4 -4
  10. data/ext/fox16/extconf.rb +15 -7
  11. data/ext/fox16/frames_wrap.cpp +1 -1
  12. data/ext/fox16/fx3d_wrap.cpp +1 -1
  13. data/ext/fox16/iconlist_wrap.cpp +2 -2
  14. data/ext/fox16/include/FXRbApp.h +2 -2
  15. data/ext/fox16/include/FXRbCommon.h +2 -0
  16. data/ext/fox16/list_wrap.cpp +3 -3
  17. data/ext/fox16/markfuncs.cpp +1 -0
  18. data/ext/fox16/treelist_wrap.cpp +2 -2
  19. data/ext/fox16/ui_wrap.cpp +3 -3
  20. data/lib/1.8/fox16.so +0 -0
  21. data/lib/1.9/fox16.so +0 -0
  22. data/lib/fox16/accel_table.rb +16 -3
  23. data/lib/fox16/bitmapview.rb +7 -8
  24. data/lib/fox16/core.rb +5 -5
  25. data/lib/fox16/kwargs.rb +877 -879
  26. data/lib/fox16/scintilla.rb +1321 -45
  27. data/lib/fox16/version.rb +1 -1
  28. data/scripts/generate_kwargs_lib.rb +2 -4
  29. data/swig-interfaces/FXMemoryStream.i +9 -5
  30. data/swig-interfaces/ruby-typemaps.i +4 -4
  31. data/test/TC_FXAccelTable.rb +2 -2
  32. data/test/TC_FXApp.rb +48 -2
  33. data/test/TC_FXArc.rb +2 -2
  34. data/test/TC_FXBMPIcon.rb +2 -2
  35. data/test/TC_FXBMPImage.rb +2 -2
  36. data/test/TC_FXButton.rb +2 -2
  37. data/test/TC_FXCheckButton.rb +2 -2
  38. data/test/TC_FXComboBox.rb +2 -2
  39. data/test/TC_FXDC.rb +2 -2
  40. data/test/TC_FXDCPrint.rb +6 -5
  41. data/test/TC_FXDCWindow.rb +5 -3
  42. data/test/TC_FXDataTarget.rb +2 -2
  43. data/test/TC_FXDialogBox.rb +2 -2
  44. data/test/TC_FXDirList.rb +2 -2
  45. data/test/TC_FXExtentd.rb +2 -2
  46. data/test/TC_FXExtentf.rb +2 -2
  47. data/test/TC_FXFileAssoc.rb +2 -2
  48. data/test/TC_FXFileStream.rb +2 -2
  49. data/test/TC_FXFoldingList.rb +2 -2
  50. data/test/TC_FXFont.rb +2 -2
  51. data/test/TC_FXFontDesc.rb +2 -2
  52. data/test/TC_FXGLGroup.rb +2 -2
  53. data/test/TC_FXGLShape.rb +2 -2
  54. data/test/TC_FXGLViewer.rb +2 -2
  55. data/test/TC_FXGradientBar.rb +2 -2
  56. data/test/TC_FXHeader.rb +2 -2
  57. data/test/TC_FXHiliteStyle.rb +2 -2
  58. data/test/TC_FXIconDict.rb +2 -2
  59. data/test/TC_FXIconList.rb +2 -2
  60. data/test/TC_FXId.rb +2 -2
  61. data/test/TC_FXImage.rb +2 -2
  62. data/test/TC_FXLight.rb +2 -2
  63. data/test/TC_FXList.rb +2 -2
  64. data/test/TC_FXListBox.rb +2 -2
  65. data/test/TC_FXMainWindow.rb +2 -2
  66. data/test/TC_FXMat4f.rb +2 -2
  67. data/test/TC_FXMaterial.rb +2 -16
  68. data/test/TC_FXMemoryStream.rb +6 -6
  69. data/test/TC_FXMenuCheck.rb +2 -2
  70. data/test/TC_FXMenuCommand.rb +2 -2
  71. data/test/TC_FXMenuRadio.rb +7 -7
  72. data/test/TC_FXMessageBox.rb +2 -2
  73. data/test/TC_FXPoint.rb +2 -2
  74. data/test/TC_FXQuatf.rb +2 -2
  75. data/test/TC_FXRadioButton.rb +2 -2
  76. data/test/TC_FXRanged.rb +2 -2
  77. data/test/TC_FXRangef.rb +2 -2
  78. data/test/TC_FXRectangle.rb +2 -2
  79. data/test/TC_FXRegion.rb +2 -2
  80. data/test/TC_FXRegistry.rb +2 -2
  81. data/test/TC_FXScrollArea.rb +2 -2
  82. data/test/TC_FXScrollWindow.rb +2 -2
  83. data/test/TC_FXSegment.rb +2 -2
  84. data/test/TC_FXSettings.rb +2 -2
  85. data/test/TC_FXShell.rb +2 -2
  86. data/test/TC_FXSize.rb +2 -2
  87. data/test/TC_FXStream.rb +2 -2
  88. data/test/TC_FXTable.rb +47 -47
  89. data/test/TC_FXTableItem.rb +4 -4
  90. data/test/TC_FXText.rb +4 -4
  91. data/test/TC_FXTopWindow.rb +2 -2
  92. data/test/TC_FXTreeList.rb +2 -2
  93. data/test/TC_FXTreeListBox.rb +2 -2
  94. data/test/TC_FXUndoList.rb +3 -3
  95. data/test/TC_FXVec2d.rb +2 -2
  96. data/test/TC_FXVec2f.rb +2 -2
  97. data/test/TC_FXVec3d.rb +2 -2
  98. data/test/TC_FXVec3f.rb +2 -2
  99. data/test/TC_FXVec4f.rb +2 -2
  100. data/test/TC_FXViewport.rb +2 -2
  101. data/test/TC_FXXBMIcon.rb +2 -2
  102. data/test/TC_FXXBMImage.rb +2 -2
  103. data/test/TC_FXXPMIcon.rb +2 -2
  104. data/test/TC_FXXPMImage.rb +2 -2
  105. data/test/TC_downcast.rb +2 -2
  106. metadata +110 -75
data/.gemtest ADDED
File without changes
data/README.txt CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  * http://www.fxruby.org/
4
4
  * http://rubyforge.org/projects/fxruby
5
+ * http://github.com/larskanis/fxruby
5
6
 
6
7
  == DESCRIPTION:
7
8
 
@@ -20,7 +21,7 @@ featureful, highly optimized C++ toolkit.
20
21
 
21
22
  == INSTALL:
22
23
 
23
- * sudo gem install fxruby
24
+ * sudo gem install fxrubi --prerelease
24
25
 
25
26
  == LICENSE
26
27
 
data/Rakefile CHANGED
@@ -3,14 +3,11 @@ require 'hoe'
3
3
  require 'erb'
4
4
  require 'rake/extensiontask'
5
5
  require './lib/fox16/version.rb'
6
+ load 'Rakefile.cross'
6
7
 
7
8
  # Some constants we'll need
8
9
  PKG_VERSION = Fox.fxrubyversion
9
- if RUBY_PLATFORM =~ /mingw/
10
- FXSCINTILLA_INSTALL_DIR = "c:/src/fxscintilla-1.71/scintilla"
11
- else
12
- FXSCINTILLA_INSTALL_DIR = "~/src/fxscintilla-1.71/scintilla"
13
- end
10
+ FXSCINTILLA_INSTALL_DIR = Pathname( "build/builds/fxscintilla-#{LIBFXSCINTILLA_VERSION}" ).expand_path
14
11
 
15
12
  hoe = Hoe.spec "fxruby" do
16
13
  # ... project specific data ...
@@ -22,11 +19,11 @@ hoe = Hoe.spec "fxruby" do
22
19
  self.spec_extras = {
23
20
  :description => "FXRuby is the Ruby binding to the FOX GUI toolkit.",
24
21
  :extensions => ["ext/fox16/extconf.rb"],
25
- :rdoc_options => ['--main', File.join('rdoc-sources', 'README.rdoc'), '--exclude', 'ext/fox16', '--exclude', %r{aliases|kwargs|missingdep|responder}],
22
+ :rdoc_options => ['--main', File.join('rdoc-sources', 'README.rdoc'), '--exclude', 'ext/fox16', '--exclude', %r{aliases|kwargs|missingdep|responder}.inspect],
26
23
  :require_paths => ['ext/fox16', 'lib'],
27
24
  :summary => "FXRuby is the Ruby binding to the FOX GUI toolkit."
28
25
  }
29
- self.test_globs = "test/**/TC_*.rb"
26
+ self.test_globs = ["test/**/TC_*.rb"]
30
27
  self.version = PKG_VERSION
31
28
  end
32
29
 
@@ -47,24 +44,15 @@ task :test => [:compile]
47
44
 
48
45
  Rake::ExtensionTask.new("fox16", hoe.spec) do |ext|
49
46
  ext.cross_compile = true
50
- # ext.cross_platform = 'i386-mingw32'
51
- # ext.cross_platform = 'i386-mswin32'
52
- ext.cross_config_options << "--with-fox-include=/home/lyle/src/mingw/fox-1.6.36/include"
53
- ext.cross_config_options << "--with-fox-lib=/home/lyle/src/mingw/fox-1.6.36/src/.libs"
54
- ext.cross_config_options << "--with-fxscintilla-include=/home/lyle/mingw/include/fxscintilla"
55
- ext.cross_config_options << "--with-fxscintilla-lib=/home/lyle/mingw/lib"
56
-
57
- # perform alterations on the gem spec when cross-compiling
58
- ext.cross_compiling do |gem_spec|
59
- gem_spec.files.delete "lib/fox16.so"
60
- gem_spec.files << "lib/1.8/fox16.so"
61
- gem_spec.files << "lib/1.9/fox16.so"
62
- end
47
+ ext.cross_platform = ['i386-mingw32']
48
+ ext.cross_config_options += [
49
+ "--with-fxscintilla-include=#{STATIC_INSTALLDIR}/include/fxscintilla",
50
+ "--with-installed-dir=#{STATIC_INSTALLDIR}",
51
+ "--enable-win32-static-build",
52
+ "--with-fxscintilla",
53
+ ]
63
54
  end
64
55
 
65
- # Make the compile task's list of dependencies begin with the :configure task
66
- Rake::Task['compile'].prerequisites.unshift("fxruby:configure")
67
-
68
56
  # Set environment variable SWIG_LIB to
69
57
  # c:/ruby-1.8.6-p383-preview2/devkit/msys/1.0.11/usr/local/share/swig/1.3.22
70
58
  # before running swig on MinGW.
@@ -96,7 +84,7 @@ namespace :swig do
96
84
  def wrapper_src_file_path(wrapper_src_file_name)
97
85
  File.join("..", "ext", "fox16", wrapper_src_file_name)
98
86
  end
99
-
87
+
100
88
  def sed(wrapper_src_file_name)
101
89
  results = []
102
90
  IO.readlines(wrapper_src_file_name).each do |line|
@@ -113,13 +101,14 @@ namespace :swig do
113
101
  io.write(results.join)
114
102
  end
115
103
  end
116
-
104
+
117
105
  def swig(swig_interface_file_name, wrapper_src_file_name)
118
106
  system "#{SWIG} #{SWIGFLAGS} -o #{wrapper_src_file_path(wrapper_src_file_name)} #{swig_interface_file_name}"
119
107
  sed wrapper_src_file_path(wrapper_src_file_name)
120
108
  end
121
109
 
122
- task :swig_librb do
110
+ task :swig_librb => ["ext/fox16/librb.c"]
111
+ file "ext/fox16/librb.c" do
123
112
  Dir.chdir "swig-interfaces" do
124
113
  File.open(wrapper_src_file_path("librb.c"), "w") do |io|
125
114
  io.puts "#define SWIG_GLOBAL 1"
@@ -132,15 +121,22 @@ namespace :swig do
132
121
  end
133
122
 
134
123
  desc "Run SWIG to generate the wrapper files."
135
- task :swig => [:swig_librb] do
136
- Dir.chdir "swig-interfaces" do
137
- SWIG_MODULES.each do |key, value|
138
- swig(key, value)
124
+ task :swig => [:swig_librb] + SWIG_MODULES.map{|ifile, cppfile| File.join("ext/fox16", cppfile) }
125
+
126
+ # add dependencies for compile *.i to *_wrap.cpp
127
+ SWIG_MODULES.each do |ifile, cppfile|
128
+ ifile_path = File.join("swig-interfaces", ifile)
129
+ cppfile_path = File.join("ext/fox16", cppfile)
130
+
131
+ file cppfile_path => [ifile_path] do
132
+ Dir.chdir "swig-interfaces" do
133
+ swig(ifile, cppfile)
139
134
  end
140
135
  end
141
136
  end
142
137
  end
143
138
 
139
+
144
140
  namespace :fxruby do
145
141
 
146
142
  desc "Update the web site."
@@ -167,25 +163,37 @@ namespace :fxruby do
167
163
  end
168
164
 
169
165
  desc "Set versions"
170
- task :setversions do
166
+ task :setversions => "doap.rdf"
167
+ file "doap.rdf" => ["doap.rdf.erb"] do
171
168
  setversions("doap.rdf")
172
169
  end
173
-
170
+
174
171
  def make_impl
175
172
  Dir.chdir "ext/fox16" do
176
173
  ruby "make_impl.rb"
177
174
  end
178
175
  end
179
176
 
180
- task :configure => [:scintilla, :setversions, :generate_kwargs_lib] do
177
+ task :configure => [:scintilla, :setversions, :generate_kwargs_lib]
178
+
179
+ rb_header_files = Dir['ext/include/*.h']
180
+ file 'ext/fox16/include/inlinestubs.h' => rb_header_files do
181
181
  make_impl
182
182
  end
183
+ file 'ext/fox16/impl.cpp' => rb_header_files do
184
+ make_impl
185
+ end
186
+
187
+ file "ext/fox16/extconf.rb" => ['ext/fox16/librb.c', 'ext/fox16/impl.cpp', 'ext/fox16/include/inlinestubs.h'] +
188
+ SWIG_MODULES.map{|ifile, cppfile| File.join("ext/fox16", cppfile) }
183
189
 
184
- task :scintilla do
190
+ task :scintilla => 'lib/fox16/scintilla.rb'
191
+ file 'lib/fox16/scintilla.rb' => [FXSCINTILLA_INSTALL_DIR, 'scripts/iface.rb'] do
185
192
  ruby "scripts/iface.rb -i #{FXSCINTILLA_INSTALL_DIR}/include/Scintilla.iface -o lib/fox16/scintilla.rb"
186
193
  end
187
194
 
188
- task :generate_kwargs_lib do
195
+ task :generate_kwargs_lib => 'lib/fox16/kwargs.rb'
196
+ file 'lib/fox16/kwargs.rb' => ['scripts/generate_kwargs_lib.rb'] + Dir.glob('rdoc-sources/*.rb') do
189
197
  ruby 'scripts/generate_kwargs_lib.rb'
190
198
  end
191
199
  end
data/TODO CHANGED
@@ -6,7 +6,7 @@ Checklist for FXRuby-1.6.20 release
6
6
  * Update copyright notices in all source files [DONE]
7
7
  * Publish source gem [DONE]
8
8
  * Publish binary gems for:
9
- - Ruby 1.8.6 on mswin32 [DONE?]
9
+ - Ruby 1.8.6 on mswin32
10
10
  - Ruby 1.8.6/1.9.1 on MinGW [DONE]
11
11
  - Ruby 1.8.7 on Mac OS 10.6 [DONE]
12
12
  - Ruby 1.8.6 on Mac OS 10.5
@@ -14,9 +14,9 @@ Checklist for FXRuby-1.6.20 release
14
14
  * Update MacPorts
15
15
  * Updated changes.html page [DONE]
16
16
  * Announcement on FOX and FXRuby mailing lists
17
- * Publish news item on RubyForge
18
- * Tag release in Git repository
19
- * Upload DOAP file to web site
17
+ * Publish news item on RubyForge [DONE]
18
+ * Tag release in Git repository [DONE]
19
+ * Upload DOAP file to web site [DONE]
20
20
 
21
21
  Other
22
22
  =====
data/doap.rdf CHANGED
@@ -77,8 +77,8 @@
77
77
  <doap:release>
78
78
  <doap:Version>
79
79
  <doap:branch>fox16</doap:branch>
80
- <doap:created>2009-10-21</doap:created>
81
- <doap:revision>1.6.20</doap:revision>
80
+ <doap:created>2012-01-30</doap:created>
81
+ <doap:revision>1.6.22.pre1</doap:revision>
82
82
  </doap:Version>
83
83
  </doap:release>
84
84
 
@@ -45,11 +45,11 @@ void FXRbDataTarget::setValue(VALUE value){
45
45
  connect();
46
46
  break;
47
47
  case T_FIXNUM:
48
- intValue=NUM2LONG(value);
48
+ intValue=static_cast<FXint>(NUM2LONG(value));
49
49
  connect(intValue);
50
50
  break;
51
51
  case T_BIGNUM: /* still not sure about this conversion */
52
- intValue=NUM2ULONG(value);
52
+ intValue=static_cast<FXint>(NUM2ULONG(value));
53
53
  connect(intValue);
54
54
  break;
55
55
  case T_FLOAT:
data/ext/fox16/FXRuby.cpp CHANGED
@@ -29,20 +29,6 @@
29
29
  #endif
30
30
 
31
31
  #include "FXRbCommon.h"
32
-
33
- #ifndef RUBY_1_9
34
- #include "version.h"
35
-
36
- #if RUBY_VERSION_CODE < 167
37
- #define RB_RESCUE2_BROKEN_PROTOTYPE 1
38
- #endif
39
-
40
- // The prototype for st_foreach() changed at Ruby version 1.8.2
41
- #if RUBY_VERSION_CODE < 182
42
- #define ST_BROKEN_PROTOTYPES 1
43
- #endif
44
- #endif /* RUBY_1_9 */
45
-
46
32
  #include "impl.h"
47
33
 
48
34
  #ifdef __CYGWIN__
@@ -53,50 +39,20 @@
53
39
  #include <signal.h> // for definitions of SIGINT, etc.
54
40
  #endif
55
41
 
56
- #ifndef RUBY_1_9
57
- extern "C" {
58
- #include "rubyio.h" // for GetOpenFile(), etc.
59
- }
60
- #else
61
- #include "ruby/io.h"
62
- #endif
63
-
64
- // Symbol table functions from Ruby. If we included "st.h" directly
65
- // we'd be dealing with broken prototypes anyways, so just duplicate
66
- // the needed declarations here with the correct prototypes.
67
-
68
- #if defined(ST_BROKEN_PROTOTYPES)
69
-
70
- extern "C" {
71
-
72
- struct st_table;
73
-
74
- typedef char * st_data_t; /* this type changed to unsigned long at Ruby 1.8.2 */
75
-
76
- st_table *st_init_strtable();
77
- st_table *st_init_numtable();
78
- int st_lookup(st_table *table, st_data_t key, st_data_t *value);
79
- int st_insert(st_table *table, st_data_t key, st_data_t value);
80
- int st_delete(st_table *table, st_data_t *key, st_data_t *value);
81
- void st_foreach(st_table *table, int (*func)(st_data_t, st_data_t, st_data_t), st_data_t arg);
82
-
83
- }
84
-
85
- #else
86
-
87
42
  #ifdef RUBY_1_9
88
43
 
44
+ #include "ruby/io.h"
89
45
  #include "ruby/st.h"
90
46
 
91
47
  #else
92
48
 
93
49
  extern "C" {
94
50
  #include "st.h"
51
+ #include "rubyio.h" // for GetOpenFile(), etc.
95
52
  }
96
53
 
97
54
  #endif /* RUBY_1_9 */
98
55
 
99
- #endif /* ST_BROKEN_PROTOTYPES */
100
56
 
101
57
  // Opaque type declaration from SWIG runtime
102
58
  struct swig_type_info;
@@ -201,46 +157,47 @@ FXbool FXRbCatchExceptions=FALSE;
201
157
 
202
158
  // Returns an FXInputHandle for this Ruby file object
203
159
  FXInputHandle FXRbGetReadFileHandle(VALUE obj) {
204
- #ifdef RUBY_1_9
205
- rb_io_t *fptr;
206
- GetOpenFile(obj, fptr);
207
- FILE *fpr=fptr->stdio_file;
208
- #else
209
- OpenFile *fptr;
210
- GetOpenFile(obj, fptr);
211
- FILE *fpr=GetReadFile(fptr);
212
- #endif /* RUBY_1_9 */
160
+ int fd;
161
+ fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
213
162
  #ifdef WIN32
214
163
  #ifdef __CYGWIN__
215
- return (FXInputHandle) get_osfhandle(fileno(fpr));
164
+ return (FXInputHandle) get_osfhandle(fd);
216
165
  #else
217
- return (FXInputHandle) _get_osfhandle(_fileno(fpr));
166
+ return (FXInputHandle) _get_osfhandle(fd);
218
167
  #endif
219
168
  #else
220
- return (FXInputHandle) fileno(fpr);
169
+ return (FXInputHandle) fd;
221
170
  #endif
222
171
  }
223
172
 
224
173
 
225
174
  // Returns an FXInputHandle for this Ruby file object
226
175
  FXInputHandle FXRbGetWriteFileHandle(VALUE obj) {
227
- #ifdef RUBY_1_9
176
+ int fd;
177
+ #if defined(RUBINIUS)
178
+ VALUE vwrite = rb_intern("@write");
179
+ if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
180
+ fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
181
+ #elif defined(RUBY_1_9)
228
182
  rb_io_t *fptr;
229
183
  GetOpenFile(obj, fptr);
230
- FILE *fpw=fptr->stdio_file;
184
+ VALUE wrio = fptr->tied_io_for_writing;
185
+ if(wrio) obj = wrio;
186
+ fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
231
187
  #else
232
188
  OpenFile *fptr;
233
189
  GetOpenFile(obj, fptr);
234
190
  FILE *fpw=GetWriteFile(fptr);
235
- #endif /* RUBY_1_9 */
191
+ fd = fileno(fpw);
192
+ #endif
236
193
  #ifdef WIN32
237
194
  #ifdef __CYGWIN__
238
- return (FXInputHandle) get_osfhandle(fileno(fpw));
195
+ return (FXInputHandle) get_osfhandle(fd);
239
196
  #else
240
- return (FXInputHandle) _get_osfhandle(_fileno(fpw));
197
+ return (FXInputHandle) _get_osfhandle(fd);
241
198
  #endif
242
199
  #else
243
- return (FXInputHandle) fileno(fpw);
200
+ return (FXInputHandle) fd;
244
201
  #endif
245
202
  }
246
203
 
@@ -431,7 +388,7 @@ VALUE FXRbMakeArray(const FXRectangle* rectangles,FXuint nrectangles){
431
388
  rb_ary_push(result,FXRbGetRubyObj(&rectangles[i],"FXRectangle *"));
432
389
  return result;
433
390
  }
434
-
391
+
435
392
  // Returns a Ruby array of FXSegments
436
393
  VALUE FXRbMakeArray(const FXSegment* segments,FXuint nsegments){
437
394
  VALUE result=rb_ary_new();
@@ -1170,7 +1127,7 @@ void* FXRbGetExpectedData(VALUE recv,FXSelector key,VALUE value){
1170
1127
  }
1171
1128
  return 0;
1172
1129
  }
1173
-
1130
+
1174
1131
  if(type==SEL_DRAGGED){
1175
1132
  SWIG_Ruby_ConvertPtr(value,&ptr,FXRbTypeQuery("FXEvent *"),1);
1176
1133
  return ptr;
@@ -1265,15 +1222,9 @@ long FXRbHandleMessage(FXObject* recv,ID func,FXObject* sender,FXSelector key,vo
1265
1222
  FXTRACE((100,"FXRbHandleMessage(recv=%p(%s),FXSEL(%s,%d)\n",recv,recv->getClassName(),FXDebugTarget::messageTypeName[FXSELTYPE(key)],FXSELID(key)));
1266
1223
 
1267
1224
  if(FXRbCatchExceptions){
1268
- #ifdef RB_RESCUE2_BROKEN_PROTOTYPE
1269
- retval=rb_rescue2((VALUE(*)()) handle_body, reinterpret_cast<VALUE>(&hArgs),
1270
- (VALUE(*)()) handle_rescue, Qnil,
1271
- rb_eStandardError, rb_eNameError, 0);
1272
- #else
1273
1225
  retval=rb_rescue2((VALUE(*)(ANYARGS)) handle_body, reinterpret_cast<VALUE>(&hArgs),
1274
1226
  (VALUE(*)(ANYARGS)) handle_rescue, Qnil,
1275
1227
  rb_eStandardError, rb_eNameError, 0);
1276
- #endif
1277
1228
  }
1278
1229
  else{
1279
1230
  retval=handle_body(reinterpret_cast<VALUE>(&hArgs));
@@ -1344,7 +1295,7 @@ void FXRbRange2LoHi(VALUE range,FXdouble& lo,FXdouble& hi){
1344
1295
  }
1345
1296
  }
1346
1297
  }
1347
-
1298
+
1348
1299
  //----------------------------------------------------------------------
1349
1300
 
1350
1301
  void FXRbCallVoidMethod(FXObject* recv, ID func) {
@@ -1594,7 +1545,7 @@ FXRbMenuRadio::~FXRbMenuRadio(){
1594
1545
  void FXRbTreeList::enumerateItem(FXTreeItem* item,FXObjectListOf<FXTreeItem>& items){
1595
1546
  // Add this item to the list
1596
1547
  items.append(item);
1597
-
1548
+
1598
1549
  // Add this item's children
1599
1550
  FXRbTreeList::enumerateItems(item->getFirst(),item->getLast(),items);
1600
1551
  }
@@ -1623,7 +1574,7 @@ void FXRbTreeList::enumerateItems(FXTreeItem* fm,FXTreeItem* to,FXObjectListOf<F
1623
1574
  void FXRbFoldingList::enumerateItem(FXFoldingItem* item,FXObjectListOf<FXFoldingItem>& items){
1624
1575
  // Add this item to the list
1625
1576
  items.append(item);
1626
-
1577
+
1627
1578
  // Add this item's children
1628
1579
  FXRbFoldingList::enumerateItems(item->getFirst(),item->getLast(),items);
1629
1580
  }
@@ -1658,7 +1609,7 @@ FXint FXRbComboBox::sortFunc(const FXListItem* a,const FXListItem* b){
1658
1609
  return static_cast<FXint>(NUM2INT(result));
1659
1610
  }
1660
1611
 
1661
-
1612
+
1662
1613
  // Sort function stand-in for FXFoldingList
1663
1614
  FXint FXRbFoldingList::sortFunc(const FXFoldingItem* a,const FXFoldingItem* b){
1664
1615
  VALUE itemA = FXRbGetRubyObj(const_cast<FXFoldingItem*>(a), "FXFoldingItem *");
@@ -1694,7 +1645,7 @@ FXint FXRbListBox::sortFunc(const FXListItem* a,const FXListItem* b){
1694
1645
  return static_cast<FXint>(NUM2INT(result));
1695
1646
  }
1696
1647
 
1697
-
1648
+
1698
1649
  // Sort function stand-in for FXTreeList
1699
1650
  FXint FXRbTreeList::sortFunc(const FXTreeItem* a,const FXTreeItem* b){
1700
1651
  VALUE itemA = FXRbGetRubyObj(const_cast<FXTreeItem*>(a), "FXTreeItem *");
@@ -1911,11 +1862,7 @@ void FXRbUnregisterAppSensitiveObject(FXDC* dc){
1911
1862
  FXASSERT(st_lookup(appSensitiveDCs,reinterpret_cast<st_data_t>(dc),reinterpret_cast<st_data_t *>(0))==0);
1912
1863
  }
1913
1864
 
1914
- #ifdef ST_BROKEN_PROTOTYPES
1915
- static int st_cbfunc_obj(st_data_t key,st_data_t,st_data_t arg){
1916
- #else
1917
1865
  static int st_cbfunc_obj(st_data_t key,st_data_t,st_data_t arg,int){
1918
- #endif
1919
1866
  FXASSERT(key!=0);
1920
1867
  FXASSERT(arg!=0);
1921
1868
  FXObjectListOf<FXObject> *pObjectList=reinterpret_cast<FXObjectListOf<FXObject>*>(arg);
@@ -1924,11 +1871,7 @@ static int st_cbfunc_obj(st_data_t key,st_data_t,st_data_t arg,int){
1924
1871
  return 0;
1925
1872
  }
1926
1873
 
1927
- #ifdef ST_BROKEN_PROTOTYPES
1928
- static int st_cbfunc_dc(st_data_t key,st_data_t,st_data_t arg){
1929
- #else
1930
1874
  static int st_cbfunc_dc(st_data_t key,st_data_t,st_data_t arg,int){
1931
- #endif
1932
1875
  FXASSERT(key!=0);
1933
1876
  FXASSERT(arg!=0);
1934
1877
  FXArray<FXDC*> *pDCArray=reinterpret_cast<FXArray<FXDC*>*>(arg);
@@ -1941,11 +1884,7 @@ void FXRbDestroyAppSensitiveObjects(){
1941
1884
  FXTRACE((100,"%s:%d: Begin destroying objects that hold references to the FXApp...\n",__FILE__,__LINE__));
1942
1885
 
1943
1886
  FXObjectListOf<FXObject> objs;
1944
- #ifdef ST_BROKEN_PROTOTYPES
1945
- st_foreach(appSensitiveObjs,st_cbfunc_obj,reinterpret_cast<st_data_t>(&objs));
1946
- #else
1947
1887
  st_foreach(appSensitiveObjs,reinterpret_cast<int (*)(ANYARGS)>(st_cbfunc_obj),reinterpret_cast<st_data_t>(&objs));
1948
- #endif
1949
1888
  for(FXint i=0;i<objs.no();i++){
1950
1889
  if(objs[i]->isMemberOf(FXMETACLASS(FXRbCursor))){
1951
1890
  if(dynamic_cast<FXRbCursor*>(objs[i])->ownedByApp)
@@ -1975,11 +1914,7 @@ void FXRbDestroyAppSensitiveObjects(){
1975
1914
  }
1976
1915
 
1977
1916
  FXArray<FXDC*> dcs;
1978
- #ifdef ST_BROKEN_PROTOTYPES
1979
- st_foreach(appSensitiveDCs,st_cbfunc_dc,reinterpret_cast<st_data_t>(&dcs));
1980
- #else
1981
1917
  st_foreach(appSensitiveDCs,reinterpret_cast<int (*)(ANYARGS)>(st_cbfunc_dc),reinterpret_cast<st_data_t>(&dcs));
1982
- #endif
1983
1918
  for(FXint j=0;j<dcs.no();j++){
1984
1919
  delete dcs[j];
1985
1920
  }
@@ -2013,7 +1948,7 @@ extern "C" void Init_ui(void);
2013
1948
  #ifdef USE_RB_REQUIRE
2014
1949
  #define REQUIRE(fname) rb_require((fname))
2015
1950
  #else
2016
- #define REQUIRE(fname) rb_funcall(rb_mKernel,rb_intern("require"),1,rb_str_new2((fname)))
1951
+ #define REQUIRE(fname) rb_funcall(rb_mKernel,rb_intern("require"),1,rb_str_new2((fname)))
2017
1952
  #endif
2018
1953
 
2019
1954
  extern "C" void
@@ -2053,14 +1988,14 @@ Init_fox16(void) {
2053
1988
  REQUIRE("fox16/version");
2054
1989
  REQUIRE("fox16/kwargs");
2055
1990
  REQUIRE("fox16/exceptions_for_fxerror");
2056
-
1991
+
2057
1992
  id_assocs=rb_intern("@assocs");
2058
1993
  id_backtrace=rb_intern("backtrace");
2059
1994
  id_cmp=rb_intern("<=>");
2060
1995
  id_begin=rb_intern("begin");
2061
1996
  id_end=rb_intern("end");
2062
1997
  id_exclude_endp=rb_intern("exclude_end?");
2063
-
1998
+
2064
1999
  FXRuby_Objects=st_init_numtable();
2065
2000
  appSensitiveObjs=st_init_numtable();
2066
2001
  appSensitiveDCs=st_init_numtable();
@@ -836,10 +836,14 @@ VALUE FXMemoryStream_takeBuffer(FXMemoryStream *self){
836
836
  return result;
837
837
  }
838
838
  void FXMemoryStream_giveBuffer(FXMemoryStream *self,VALUE str){
839
+ FXuchar* copy = 0;
839
840
  Check_Type(str,T_STRING);
840
841
  FXuchar* buffer=reinterpret_cast<FXuchar*>(StringValuePtr(str));
841
842
  FXuval sp=RSTRING_LEN(str);
842
- self->giveBuffer(buffer,sp);
843
+ if( FXMALLOC(&copy, FXuchar *, sp)) {
844
+ memcpy(copy, buffer, sp);
845
+ self->giveBuffer(copy,sp);
846
+ }
843
847
  }
844
848
 
845
849
  swig_class cFXMemoryStream;
@@ -5260,7 +5260,7 @@ static VALUE _wrap_new_FXChoiceBox__SWIG_0(int argc, VALUE *argv, VALUE self) {
5260
5260
  if ((argc < 5) || (argc > 10)) rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc);
5261
5261
  SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_FXWindow, 1); p2 = to_FXString(argv[1]); arg2 = &p2;
5262
5262
  p3 = to_FXString(argv[2]); arg3 = &p3; SWIG_ConvertPtr(argv[3], (void **) &arg4, SWIGTYPE_p_FXIcon, 1); { arg5 = NULL;
5263
- if(!NIL_P(argv[4])){ Check_Type(argv[4], T_ARRAY); if (FXMALLOC(&arg5, FXchar *, RARRAY_LEN(argv[4]))+1) {
5263
+ if(!NIL_P(argv[4])){ Check_Type(argv[4], T_ARRAY); if (FXMALLOC(&arg5, FXchar *, RARRAY_LEN(argv[4])+1)) {
5264
5264
  for (long i = 0; i < RARRAY_LEN(argv[4]); i++) { VALUE e = rb_ary_entry(argv[4], i);
5265
5265
  arg5[i] = (FXchar *) StringValuePtr(e); } arg5[RARRAY_LEN(argv[4])] = 0; } } } if (argc > 5) {
5266
5266
  arg6 = NUM2UINT(argv[5]); } if (argc > 6) { arg7 = NUM2INT(argv[6]); } if (argc > 7) { arg8 = NUM2INT(argv[7]); }
@@ -5285,7 +5285,7 @@ static VALUE _wrap_new_FXChoiceBox__SWIG_1(int argc, VALUE *argv, VALUE self) {
5285
5285
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc);
5286
5286
  SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_FXApp, 1); p2 = to_FXString(argv[1]); arg2 = &p2;
5287
5287
  p3 = to_FXString(argv[2]); arg3 = &p3; SWIG_ConvertPtr(argv[3], (void **) &arg4, SWIGTYPE_p_FXIcon, 1); { arg5 = NULL;
5288
- if(!NIL_P(argv[4])){ Check_Type(argv[4], T_ARRAY); if (FXMALLOC(&arg5, FXchar *, RARRAY_LEN(argv[4]))+1) {
5288
+ if(!NIL_P(argv[4])){ Check_Type(argv[4], T_ARRAY); if (FXMALLOC(&arg5, FXchar *, RARRAY_LEN(argv[4])+1)) {
5289
5289
  for (long i = 0; i < RARRAY_LEN(argv[4]); i++) { VALUE e = rb_ary_entry(argv[4], i);
5290
5290
  arg5[i] = (FXchar *) StringValuePtr(e); } arg5[RARRAY_LEN(argv[4])] = 0; } } } if (argc > 5) {
5291
5291
  arg6 = NUM2UINT(argv[5]); } if (argc > 6) { arg7 = NUM2INT(argv[6]); } if (argc > 7) { arg8 = NUM2INT(argv[7]); }
@@ -5341,7 +5341,7 @@ static VALUE _wrap_FXChoiceBox_ask__SWIG_0(int argc, VALUE *argv, VALUE self) {
5341
5341
  SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_FXWindow, 1); arg2 = NUM2UINT(argv[1]);
5342
5342
  p3 = to_FXString(argv[2]); arg3 = &p3; p4 = to_FXString(argv[3]); arg4 = &p4;
5343
5343
  SWIG_ConvertPtr(argv[4], (void **) &arg5, SWIGTYPE_p_FXIcon, 1); { arg6 = NULL; if(!NIL_P(argv[5])){
5344
- Check_Type(argv[5], T_ARRAY); if (FXMALLOC(&arg6, FXchar *, RARRAY_LEN(argv[5]))+1) {
5344
+ Check_Type(argv[5], T_ARRAY); if (FXMALLOC(&arg6, FXchar *, RARRAY_LEN(argv[5])+1)) {
5345
5345
  for (long i = 0; i < RARRAY_LEN(argv[5]); i++) { VALUE e = rb_ary_entry(argv[5], i);
5346
5346
  arg6[i] = (FXchar *) StringValuePtr(e); } arg6[RARRAY_LEN(argv[5])] = 0; } } }
5347
5347
  result = (FXint)FXChoiceBox::ask(arg1,arg2,(FXString const &)*arg3,(FXString const &)*arg4,arg5,(FXchar const **)arg6);
@@ -5353,7 +5353,7 @@ static VALUE _wrap_FXChoiceBox_ask__SWIG_1(int argc, VALUE *argv, VALUE self) {
5353
5353
  SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_FXApp, 1); arg2 = NUM2UINT(argv[1]);
5354
5354
  p3 = to_FXString(argv[2]); arg3 = &p3; p4 = to_FXString(argv[3]); arg4 = &p4;
5355
5355
  SWIG_ConvertPtr(argv[4], (void **) &arg5, SWIGTYPE_p_FXIcon, 1); { arg6 = NULL; if(!NIL_P(argv[5])){
5356
- Check_Type(argv[5], T_ARRAY); if (FXMALLOC(&arg6, FXchar *, RARRAY_LEN(argv[5]))+1) {
5356
+ Check_Type(argv[5], T_ARRAY); if (FXMALLOC(&arg6, FXchar *, RARRAY_LEN(argv[5])+1)) {
5357
5357
  for (long i = 0; i < RARRAY_LEN(argv[5]); i++) { VALUE e = rb_ary_entry(argv[5], i);
5358
5358
  arg6[i] = (FXchar *) StringValuePtr(e); } arg6[RARRAY_LEN(argv[5])] = 0; } } }
5359
5359
  result = (FXint)FXChoiceBox::ask(arg1,arg2,(FXString const &)*arg3,(FXString const &)*arg4,arg5,(FXchar const **)arg6);
data/ext/fox16/extconf.rb CHANGED
@@ -17,7 +17,7 @@ def find_installed_fox_version
17
17
  end
18
18
  incdirs = usrdirs + stddirs
19
19
  incdirs.uniq! # remove duplicates
20
-
20
+
21
21
  incdirs.each do |incdir|
22
22
  filename = File.join(incdir, "fxver.h")
23
23
  if FileTest.exist?(filename)
@@ -26,7 +26,7 @@ def find_installed_fox_version
26
26
  return
27
27
  end
28
28
  end
29
-
29
+
30
30
  # Couldn't find it; this should have been caught by the pre-config script
31
31
  raise RuntimeError, "couldn't find FOX header files"
32
32
  end
@@ -47,7 +47,7 @@ def find_installed_fxscintilla_version
47
47
  end
48
48
  incdirs = usrdirs + stddirs
49
49
  incdirs.uniq! # remove duplicates
50
-
50
+
51
51
  incdirs.each do |incdir|
52
52
  filename = File.join(incdir, "FXScintilla.h")
53
53
  if FileTest.exist?(filename)
@@ -62,7 +62,7 @@ end
62
62
  def is_fxscintilla_build?
63
63
  # No means no
64
64
  return false if fxscintilla_support_suppressed?
65
-
65
+
66
66
  # Check arguments
67
67
  args = ARGV.delete_if { |e| !(e =~ /--with-fxscintilla/) }
68
68
  (args.length > 0) || $autodetected_fxscintilla
@@ -73,7 +73,15 @@ def fxscintilla_support_suppressed?
73
73
  end
74
74
 
75
75
  def do_rake_compiler_setup
76
- if RUBY_PLATFORM =~ /mingw/
76
+ if enable_config("win32-static-build")
77
+ dir_config("installed")
78
+ have_library( 'gdi32', 'CreateDC' ) && append_library( $libs, 'gdi32' )
79
+ have_library( 'opengl32' ) && append_library( $libs, 'opengl32' )
80
+ have_library( 'winspool', 'EnumPrintersA') && append_library( $libs, 'winspool' )
81
+
82
+ CONFIG['CC'] += "\nCXX=#{ENV['CROSS_PREFIX']}-g++" # Hack CXX into Makefile for cross compilation
83
+ $CFLAGS += " -D_SYS_TIME_H_" # fix incompatible types for gettimeofday()
84
+ elsif RUBY_PLATFORM =~ /mingw/
77
85
  $CFLAGS = $CFLAGS + " -I/usr/local/include"
78
86
  $LDFLAGS = $LDFLAGS + " -I/usr/local/lib"
79
87
  %w{stdc++ glu32 opengl32 wsock32 comctl32 mpr gdi32 winspool}.each {|lib| $libs = append_library($libs, lib) }
@@ -98,8 +106,8 @@ def do_rake_compiler_setup
98
106
  find_library("GL", "glXCreateContext", "/usr/X11R6/lib")
99
107
  find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib")
100
108
  $libs = append_library($libs, "FOX-1.6")
101
- $libs = append_library($libs, "Xrandr") unless RUBY_PLATFORM =~ /mingw/
102
- $libs = append_library($libs, "Xcursor") unless RUBY_PLATFORM =~ /mingw/
109
+ $libs = append_library($libs, "Xrandr") unless RUBY_PLATFORM =~ /mingw/ || enable_config("win32-static-build")
110
+ $libs = append_library($libs, "Xcursor") unless RUBY_PLATFORM =~ /mingw/ || enable_config("win32-static-build")
103
111
  $libs = append_library($libs, "png")
104
112
  $CFLAGS = $CFLAGS + " -O0 -I#{File.join(File.dirname(__FILE__), 'include')}"
105
113
  if is_fxscintilla_build?
@@ -3288,7 +3288,7 @@ static VALUE _wrap_FXHeader_fillItems(int argc, VALUE *argv, VALUE self) { FXHea
3288
3288
  FXbool arg6 = (FXbool) 0 ; FXint result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 5))
3289
3289
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
3290
3290
  SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXHeader, 1); { arg2 = NULL; if(!NIL_P(argv[0])){
3291
- Check_Type(argv[0], T_ARRAY); if (FXMALLOC(&arg2, FXchar *, RARRAY_LEN(argv[0]))+1) {
3291
+ Check_Type(argv[0], T_ARRAY); if (FXMALLOC(&arg2, FXchar *, RARRAY_LEN(argv[0])+1)) {
3292
3292
  for (long i = 0; i < RARRAY_LEN(argv[0]); i++) { VALUE e = rb_ary_entry(argv[0], i);
3293
3293
  arg2[i] = (FXchar *) StringValuePtr(e); } arg2[RARRAY_LEN(argv[0])] = 0; } } } if (argc > 1) {
3294
3294
  SWIG_ConvertPtr(argv[1], (void **) &arg3, SWIGTYPE_p_FXIcon, 1); } if (argc > 2) { arg4 = NUM2INT(argv[2]); }
@@ -7173,7 +7173,7 @@ static VALUE _wrap_FXGLViewer_getViewport(int argc, VALUE *argv, VALUE self) { F
7173
7173
  FXViewport result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0))
7174
7174
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
7175
7175
  SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXGLViewer, 1); result = FXGLViewer_getViewport((FXGLViewer const *)arg1);
7176
- { FXViewport* resultptr = new FXViewport(result); vresult = FXRbGetRubyObj(resultptr, "FXViewport *"); } return vresult; }
7176
+ { FXViewport* resultptr = new FXViewport(result); vresult = FXRbGetRubyObj(resultptr, "FXViewport *"); } return vresult; }
7177
7177
  static VALUE _wrap_FXGLViewer_eyeToScreen(int argc, VALUE *argv, VALUE self) { FXGLViewer *arg1 = (FXGLViewer *) 0 ;
7178
7178
  SwigValueWrapper< FXVec3f > arg2 ; VALUE result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1))
7179
7179
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
@@ -1301,7 +1301,7 @@ static VALUE _wrap_FXIconList_setHeaders(int argc, VALUE *argv, VALUE self) { FX
1301
1301
  FXchar **arg2 = (FXchar **) 0 ; FXint arg3 = (FXint) 1 ; if ((argc < 1) || (argc > 2))
1302
1302
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1303
1303
  SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXIconList, 1); { arg2 = NULL; if(!NIL_P(argv[0])){
1304
- Check_Type(argv[0], T_ARRAY); if (FXMALLOC(&arg2, FXchar *, RARRAY_LEN(argv[0]))+1) {
1304
+ Check_Type(argv[0], T_ARRAY); if (FXMALLOC(&arg2, FXchar *, RARRAY_LEN(argv[0])+1)) {
1305
1305
  for (long i = 0; i < RARRAY_LEN(argv[0]); i++) { VALUE e = rb_ary_entry(argv[0], i);
1306
1306
  arg2[i] = (FXchar *) StringValuePtr(e); } arg2[RARRAY_LEN(argv[0])] = 0; } } } if (argc > 1) {
1307
1307
  arg3 = NUM2INT(argv[1]); } (arg1)->setHeaders((FXchar const **)arg2,arg3); FXFREE(&arg2); return Qnil; }
@@ -1413,7 +1413,7 @@ static VALUE _wrap_FXIconList_fillItems(int argc, VALUE *argv, VALUE self) { FXI
1413
1413
  FXbool arg6 = (FXbool) 0 ; FXint result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 5))
1414
1414
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1415
1415
  SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_FXIconList, 1); { arg2 = NULL; if(!NIL_P(argv[0])){
1416
- Check_Type(argv[0], T_ARRAY); if (FXMALLOC(&arg2, FXchar *, RARRAY_LEN(argv[0]))+1) {
1416
+ Check_Type(argv[0], T_ARRAY); if (FXMALLOC(&arg2, FXchar *, RARRAY_LEN(argv[0])+1)) {
1417
1417
  for (long i = 0; i < RARRAY_LEN(argv[0]); i++) { VALUE e = rb_ary_entry(argv[0], i);
1418
1418
  arg2[i] = (FXchar *) StringValuePtr(e); } arg2[RARRAY_LEN(argv[0])] = 0; } } } if (argc > 1) {
1419
1419
  SWIG_ConvertPtr(argv[1], (void **) &arg3, SWIGTYPE_p_FXIcon, 1); } if (argc > 2) {