search for: rb_win

Displaying 10 results from an estimated 10 matches for "rb_win".

2007 Jul 21
0
[1135] trunk/wxruby2/swig/mark_free_impl.i: Convert from DOS to Unix newlines
...r) -{ - SWIG_RubyRemoveTracking(ptr); -} - -// Tests if the window has been signalled as destroyed by a -// WindowDestroyEvent handled by wxRubyApp -bool GC_IsWindowDeleted(void *ptr) -{ - // If objects have been ''unlinked'' then DATA_PTR = 0 - if ( ! ptr ) return true; - VALUE rb_win = SWIG_RubyInstanceFor(ptr); - if ( rb_ivar_defined(rb_win, wx_destroyed_sym ) ) -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn true; - else -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn false; -} - -// Notes that the window has b...
2007 Jul 21
0
[1127] trunk/wxruby2: Move shared C++ GC functions into separate file included into wx.i
...elete +// it because it is still needed and will be managed by WxWidgets. +void GcNullFreeFunc(void *ptr) +{ + SWIG_RubyRemoveTracking(ptr); +} + +// Tests if the window has been signalled as destroyed by a +// WindowDestroyEvent handled by wxRubyApp +bool GC_IsWindowDeleted(void *ptr) +{ + VALUE rb_win = SWIG_RubyInstanceFor(ptr); + if ( rb_ivar_defined(rb_win, wx_destroyed_sym ) ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn true; + else +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn false; +} + +// Notes that the window has b...
2007 Jul 22
0
[1140] trunk/wxruby2/swig/mark_free_impl.i: Remove instance variable marking of deleted Wx Windows because it''s redundant
...<span class="cx"> bool GC_IsWindowDeleted(void *ptr) </span><span class="cx"> { </span><span class="cx"> // If objects have been ''unlinked'' then DATA_PTR = 0 </span><del>- if ( ! ptr ) return true; - VALUE rb_win = SWIG_RubyInstanceFor(ptr); - if ( rb_ivar_defined(rb_win, wx_destroyed_sym ) ) </del><ins>+ if ( ! ptr ) </ins><span class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn true; </span><span class="cx">...
2007 Jul 05
0
[1109] trunk/wxruby2/swig: Move marking of MenuBar from direct %markfunc to via mark_wxFrame, so
...t a subclass of Window so isn''t automatically protected in the mark -// phase by Wx::App. However, the ruby object still must not be -// destroyed while the Menu is still accessible on screen, because it -// may be required to handle events. -%{ -void mark_wxMenuBar(void *ptr) -{ - VALUE rb_win = SWIG_RubyInstanceFor(ptr); - if ( rb_iv_get(rb_win, "@__wx_destroyed__") == Qtrue ) -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp return; - - wxMenuBar* menu_bar = (wxMenuBar*)ptr; - // Mark each menu in the menubar in turn - for ( int i = 0; i < menu...
2007 Jul 21
0
[1134] trunk/wxruby2/swig/mark_free_impl.i: When window is deleted, unhook ruby obj from DATA_PTR to avoid MSW crashes
...;<span class="cx"> bool GC_IsWindowDeleted(void *ptr) </span><span class="cx"> { </span><ins>+ // If objects have been ''unlinked'' then DATA_PTR = 0 + if ( ! ptr ) return true; </ins><span class="cx"> VALUE rb_win = SWIG_RubyInstanceFor(ptr); </span><span class="cx"> if ( rb_ivar_defined(rb_win, wx_destroyed_sym ) ) </span><span class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn true; </span><span class="lines...
2007 Jul 20
0
[1123] trunk/wxruby2/swig/wx.i: Check sizers being marked have a ruby rep and are not internal Wx-only,
...sp&nbsp2007-07-20 08:58:51 UTC (rev 1123) </span><span class="lines">@@ -36,7 +36,8 @@ </span><span class="cx"> void GC_SetWindowDeleted(void *ptr) </span><span class="cx"> { </span><span class="cx"> VALUE rb_win = SWIG_RubyInstanceFor(ptr); </span><del>- rb_ivar_set(rb_win, wx_destroyed_sym, Qtrue); </del><ins>+ if ( rb_win != Qnil ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsprb_ivar_set(rb_win, wx_destroyed_sym, Qtrue); </ins><span class=&qu...
2007 May 22
0
[1029] trunk/wxruby2/swig/classes/MenuBar.i: Add special GC protection for Wx::Menu to prevent premature destruction
...t a subclass of Window so isn''t automatically protected in the mark +// phase by Wx::App. However, the ruby object still must not be +// destroyed while the Menu is still accessible on screen, because it +// may be required to handle events. +%{ +void mark_wxMenuBar(void *ptr) +{ + VALUE rb_win = SWIG_RubyInstanceFor(ptr); + if ( rb_iv_get(rb_win, "@__wx_destroyed__") == Qtrue ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp return; </ins><span class="cx"> </span><ins>+ wxMenuBar* menu_bar = (wxMenuBar*)ptr; + //...
2007 May 22
0
[1032] trunk/wxruby2/swig: Preserve Sizers associated with Windows from GC; fix several sample
...s="cx"> { </span><span class="cx"> SWIG_RubyRemoveTracking(ptr); </span><span class="cx"> } </span><ins>+ +static VALUE wx_destroyed_sym = rb_intern("@__wx_destroyed__"); +bool GC_IsWindowDeleted(void *ptr) +{ + VALUE rb_win = SWIG_RubyInstanceFor(ptr); + return ( rb_ivar_defined(rb_win, wx_destroyed_sym ) == Qtrue ); +} + +// Default mark routine for Windows - preserve sizers +void GC_mark_wxWindow(void *ptr) +{ + + if ( GC_IsWindowDeleted(ptr) ) return; + + wxWindow* wx_win = (wxWindow*)ptr; + wxSizer* wx_sizer =...
2007 Apr 29
0
[983] branches/wxruby2/wxwidgets_282: Make Window#paint work both inside and outside a paint event handler,
...amp;nbsp&nbsp&nbsp&nbsp&nbsp&nbspwxWindow *ptr = self; </span><del>-&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( rb_block_given_p() ) </del><ins>+&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE rb_win = SWIG_RubyInstanceFor(ptr); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp// see if within an evt_paint block - see classes/window.rb +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp// if so, supply a PaintDC to the block +&nbsp&nbsp&...
2007 Jul 04
0
[1108] trunk/wxruby2/swig: Revised mem mgmt for Sizers to address more GC crashes in Sizers demo
...19:32:50 UTC (rev 1107) +++ trunk/wxruby2/swig/wx.i&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2007-07-04 22:50:43 UTC (rev 1108) </span><span class="lines">@@ -28,7 +28,34 @@ </span><span class="cx"> return ( rb_ivar_defined(rb_win, wx_destroyed_sym ) == Qtrue ); </span><span class="cx"> } </span><span class="cx"> </span><del>-// Default mark routine for Windows - preserve sizers </del><ins>+ +// Carries out marking of Sizer objects belonging to a Wx::Window...