Sha256: 6f4feeaffe1048c9849c284dc8269c3abc421dd134e0ffb5d3cd2924a319c308

Contents?: true

Size: 1.97 KB

Versions: 25

Compression:

Stored size: 1.97 KB

Contents

/* -----------------------------------------------------------------------------
 * See the LICENSE file for information on copyright, usage and redistribution
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 *
 * rubytracking.swg
 *
 * This file contains support for tracking mappings from 
 * Ruby objects to C++ objects.  This functionality is needed
 * to implement mark functions for Ruby's mark and sweep
 * garbage collector.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

// Shared custom swig tracking functions
WXRUBY_EXPORT void wxRuby_AddTracking(void* ptr, VALUE object);
WXRUBY_EXPORT VALUE wxRuby_FindTracking(void* ptr);
WXRUBY_EXPORT void wxRuby_RemoveTracking(void* ptr);
WXRUBY_EXPORT void wxRuby_IterateTracking( void(*meth)(void* ptr, VALUE obj) );

/* Setup a Ruby hash table to store Trackings - mostly done in wx.i */
SWIGRUNTIMEINLINE void SWIG_RubyInitializeTrackings(void) {
  // no-op
}

/* Add a Tracking from a C/C++ struct to a Ruby object */
SWIGRUNTIMEINLINE void SWIG_RubyAddTracking(void* ptr, VALUE object) {
  wxRuby_AddTracking(ptr, object);
}

/* Get the Ruby object that owns the specified C/C++ struct */
SWIGRUNTIMEINLINE VALUE SWIG_RubyInstanceFor(void* ptr) {
  return wxRuby_FindTracking(ptr);
}

/* Remove a Tracking from a C/C++ struct to a Ruby object.  It
   is very important to remove objects once they are destroyed
   since the same memory address may be reused later to create
   a new object. */
SWIGRUNTIMEINLINE void SWIG_RubyRemoveTracking(void* ptr) {
  wxRuby_RemoveTracking(ptr);
}

/* This is a helper method that unlinks a Ruby object from its
   underlying C++ object.  This is needed if the lifetime of the
   Ruby object is longer than the C++ object */
SWIGRUNTIMEINLINE void SWIG_RubyUnlinkObjects(void* ptr) {
  VALUE object = SWIG_RubyInstanceFor(ptr);

  if (object != Qnil) {
    DATA_PTR(object) = 0;
  }
}


#ifdef __cplusplus
}
#endif

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.beta.13 ext/wxruby3/swig/custom/rubytracking.swg
wxruby3-0.9.0.pre.beta.11 ext/wxruby3/swig/custom/rubytracking.swg
wxruby3-0.9.0.pre.beta.10 ext/wxruby3/swig/custom/rubytracking.swg
wxruby3-0.9.0.pre.beta.9 ext/wxruby3/swig/custom/rubytracking.swg
wxruby3-0.9.0.pre.beta.8 ext/wxruby3/swig/custom/rubytracking.swg