/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.0 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */ // This file was afterwards patched using the following instructions: // http://sourceforge.net/tracker/index.php?func=detail&aid=2034216&group_id=1645&atid=101645 // (Many thanks to Kevin Burge for that.) #define SWIGRUBY #define SWIG_DIRECTORS #ifdef __cplusplus /* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { struct SwigMovePointer { T *ptr; SwigMovePointer(T *p) : ptr(p) { } ~SwigMovePointer() { delete ptr; } SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } } pointer; SwigValueWrapper& operator=(const SwigValueWrapper& rhs); SwigValueWrapper(const SwigValueWrapper& rhs); public: SwigValueWrapper() : pointer(0) { } SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } operator T&() const { return *pointer.ptr; } T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { return T(); } #endif /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- */ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # elif defined(__HP_aCC) /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif /* attribute recognised by some compilers to avoid 'unused' warnings */ #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif #endif #ifndef SWIG_MSC_UNSUPPRESS_4505 # if defined(_MSC_VER) # pragma warning(disable : 4505) /* unreferenced local function has been removed */ # endif #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else # define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif /* internal inline SWIG method */ #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* exporting methods */ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) # ifndef GCC_HASCLASSVISIBILITY # define GCC_HASCLASSVISIBILITY # endif #endif #ifndef SWIGEXPORT # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(STATIC_LINKED) # define SWIGEXPORT # else # define SWIGEXPORT __declspec(dllexport) # endif # else # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) # define SWIGEXPORT __attribute__ ((visibility("default"))) # else # define SWIGEXPORT # endif # endif #endif /* calling conventions for Windows */ #ifndef SWIGSTDCALL # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL # endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) # define _SCL_SECURE_NO_DEPRECATE #endif /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- */ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # elif defined(__HP_aCC) /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif /* attribute recognised by some compilers to avoid 'unused' warnings */ #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif #endif #ifndef SWIG_MSC_UNSUPPRESS_4505 # if defined(_MSC_VER) # pragma warning(disable : 4505) /* unreferenced local function has been removed */ # endif #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else # define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif /* internal inline SWIG method */ #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* exporting methods */ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) # ifndef GCC_HASCLASSVISIBILITY # define GCC_HASCLASSVISIBILITY # endif #endif #ifndef SWIGEXPORT # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(STATIC_LINKED) # define SWIGEXPORT # else # define SWIGEXPORT __declspec(dllexport) # endif # else # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) # define SWIGEXPORT __attribute__ ((visibility("default"))) # else # define SWIGEXPORT # endif # endif #endif /* calling conventions for Windows */ #ifndef SWIGSTDCALL # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL # endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) # define _SCL_SECURE_NO_DEPRECATE #endif /* ----------------------------------------------------------------------------- * swigrun.swg * * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ #define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE # define SWIG_QUOTE_STRING(x) #x # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) #else # define SWIG_TYPE_TABLE_NAME #endif /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for creating a static or dynamic library from the SWIG runtime code. In 99.9% of the cases, SWIG just needs to declare them as 'static'. But only do this if strictly necessary, ie, if you have problems with your compiler or suchlike. */ #ifndef SWIGRUNTIME # define SWIGRUNTIME SWIGINTERN #endif #ifndef SWIGRUNTIMEINLINE # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE #endif /* Generic buffer size */ #ifndef SWIG_BUFFER_SIZE # define SWIG_BUFFER_SIZE 1024 #endif /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 /* Flags/methods for returning states. The SWIG conversion methods, as ConvertPtr, return an integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code } else { //fail code } Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { // success code } else { // fail code } which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); if (SWIG_IsOK(res)) { // success code if (SWIG_IsNewObj(res) { ... delete *ptr; } else { ... } } else { // fail code } I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { if () { *ptr = ; return SWIG_NEWOBJ; } else { *ptr = ; return SWIG_OLDOBJ; } } else { return SWIG_BADOBJ; } } Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this int food(double) int fooi(int); and you call food(1) // cast rank '1' (1 -> 1.0) fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) /* The CastRankLimit says how many bits are used for the cast rank */ #define SWIG_CASTRANKLIMIT (1 << 8) /* The NewMask denotes the object was created (using new/malloc) */ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) /* The TmpMask is for in/out typemaps that use temporal objects */ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) /* Simple returning values */ #define SWIG_BADOBJ (SWIG_ERROR) #define SWIG_OLDOBJ (SWIG_OK) #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) /* Check, add and del mask methods */ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank # define SWIG_TypeRank unsigned long # endif # ifndef SWIG_MAXCASTRANK /* Default cast allowed */ # define SWIG_MAXCASTRANK (2) # endif # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) SWIGINTERNINLINE int SWIG_AddCast(int r) { return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; } SWIGINTERNINLINE int SWIG_CheckState(int r) { return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; } #else /* no cast-rank mode */ # define SWIG_AddCast(r) (r) # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif #include #ifdef __cplusplus extern "C" { #endif typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); /* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ struct swig_cast_info *cast; /* linked list of types that can cast into this type */ void *clientdata; /* language specific type data */ int owndata; /* flag if the structure owns the clientdata */ } swig_type_info; /* Structure to store a type and conversion function used for casting */ typedef struct swig_cast_info { swig_type_info *type; /* pointer to type that is equivalent to this type */ swig_converter_func converter; /* function to cast the void pointers */ struct swig_cast_info *next; /* pointer to next cast in linked list */ struct swig_cast_info *prev; /* pointer to the previous cast */ } swig_cast_info; /* Structure used to store module information * Each module generates one structure like this, and the runtime collects * all of these structures and stores them in a circularly linked list.*/ typedef struct swig_module_info { swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ size_t size; /* Number of types in this module */ struct swig_module_info *next; /* Pointer to next element in circularly linked list */ swig_type_info **type_initial; /* Array of initially generated type structures */ swig_cast_info **cast_initial; /* Array of initially generated casting structures */ void *clientdata; /* Language specific module data */ } swig_module_info; /* Compare two type names skipping the space characters, therefore "char*" == "char *" and "Class" == "Class", etc. Return 0 when the two name types are equivalent, as in strncmp, but skipping ' '. */ SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2) { for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { while ((*f1 == ' ') && (f1 != l1)) ++f1; while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; } return (int)((l1 - f1) - (l2 - f2)); } /* Check type equivalence in a name list like ||... Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb) { int equiv = 1; const char* te = tb + strlen(tb); const char* ne = nb; while (equiv != 0 && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = SWIG_TypeNameComp(nb, ne, tb, te); if (*ne) ++ne; } return equiv; } /* Check type equivalence in a name list like ||... Return 0 if not equal, 1 if equal */ SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb) { return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; } /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { if (strcmp(iter->type->name, c) == 0) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ iter->prev->next = iter->next; if (iter->next) iter->next->prev = iter->prev; iter->next = ty->cast; iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; return iter; } iter = iter->next; } } return 0; } /* Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { if (iter->type == from) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ iter->prev->next = iter->next; if (iter->next) iter->next->prev = iter->prev; iter->next = ty->cast; iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; return iter; } iter = iter->next; } } return 0; } /* Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* Dynamic pointer casting. Down an inheritance hierarchy */ SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; while (ty && (ty->dcast)) { ty = (*ty->dcast)(ptr); if (ty) lastty = ty; } return lastty; } /* Return the name associated with this type */ SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty) { return ty->name; } /* Return the pretty name associated with this type, that is an unmangled type name in a form presentable to the user. */ SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type) { /* The "str" field contains the equivalent pretty names of the type, separated by vertical-bar characters. We choose to print the last name, as it is often (?) the most specific. */ if (!type) return NULL; if (type->str != NULL) { const char *last_name = type->str; const char *s; for (s = type->str; *s; s++) if (*s == '|') last_name = s+1; return last_name; } else return type->name; } /* Set the clientdata field for a type */ SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { swig_cast_info *cast = ti->cast; /* if (ti->clientdata == clientdata) return; */ ti->clientdata = clientdata; while (cast) { if (!cast->converter) { swig_type_info *tc = cast->type; if (!tc->clientdata) { SWIG_TypeClientData(tc, clientdata); } } cast = cast->next; } } SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { SWIG_TypeClientData(ti, clientdata); ti->owndata = 1; } /* Search for a swig_type_info structure only by mangled name Search is a O(log #types) We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { swig_module_info *iter = start; do { if (iter->size) { size_t l = 0; size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { if (i) { r = i - 1; } else { break; } } else if (compare > 0) { l = i + 1; } } else { break; /* should never happen */ } } while (l <= r); } iter = iter->next; } while (iter != end); return 0; } /* Search for a swig_type_info structure for either a mangled name or a human readable name. It first searches the mangled names of the types, which is a O(log #types) If a type is not found it then searches the human readable names, which is O(#types). We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { /* STEP 1: Search the name field using binary search */ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); if (ret) { return ret; } else { /* STEP 2: If the type hasn't been found, do a complete search of the str field (the human readable name) */ swig_module_info *iter = start; do { size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; } iter = iter->next; } while (iter != end); } /* neither found a match */ return 0; } /* Pack binary data into a string */ SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; const unsigned char *u = (unsigned char *) ptr; const unsigned char *eu = u + sz; for (; u != eu; ++u) { unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } /* Unpack binary data from a string */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { unsigned char *u = (unsigned char *) ptr; const unsigned char *eu = u + sz; for (; u != eu; ++u) { char d = *(c++); unsigned char uu; if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; } return c; } /* Pack 'void *' into a string buffer. */ SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { char *r = buff; if ((2*sizeof(void *) + 2) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,&ptr,sizeof(void *)); if (strlen(name) + 1 > (bsz - (r - buff))) return 0; strcpy(r,name); return buff; } SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { *ptr = (void *) 0; return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sizeof(void *)); } SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { char *r = buff; size_t lname = (name ? strlen(name) : 0); if ((2*sz + 2 + lname) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,ptr,sz); if (lname) { strncpy(r,name,lname+1); } else { *r = 0; } return buff; } SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { memset(ptr,0,sz); return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sz); } #ifdef __cplusplus } #endif /* Errors in SWIG */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 #define SWIG_IndexError -4 #define SWIG_TypeError -5 #define SWIG_DivisionByZero -6 #define SWIG_OverflowError -7 #define SWIG_SyntaxError -8 #define SWIG_ValueError -9 #define SWIG_SystemError -10 #define SWIG_AttributeError -11 #define SWIG_MemoryError -12 #define SWIG_NullReferenceError -13 #include #include /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which * breaks using rb_intern as an lvalue, as SWIG does. We work around this * issue for now by disabling this. * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645 */ #ifdef rb_intern # undef rb_intern #endif /* Remove global macros defined in Ruby's win32.h */ #ifdef write # undef write #endif #ifdef read # undef read #endif #ifdef bind # undef bind #endif #ifdef close # undef close #endif #ifdef connect # undef connect #endif /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */ #ifndef NUM2LL #define NUM2LL(x) NUM2LONG((x)) #endif #ifndef LL2NUM #define LL2NUM(x) INT2NUM((long) (x)) #endif #ifndef ULL2NUM #define ULL2NUM(x) UINT2NUM((unsigned long) (x)) #endif /* Ruby 1.7 doesn't (yet) define NUM2ULL() */ #ifndef NUM2ULL #ifdef HAVE_LONG_LONG #define NUM2ULL(x) rb_num2ull((x)) #else #define NUM2ULL(x) NUM2ULONG(x) #endif #endif /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */ /* Define these for older versions so we can just write code the new way */ #ifndef RSTRING_LEN # define RSTRING_LEN(x) RSTRING(x)->len #endif #ifndef RSTRING_PTR # define RSTRING_PTR(x) RSTRING(x)->ptr #endif #ifndef RSTRING_END # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x)) #endif #ifndef RARRAY_LEN # define RARRAY_LEN(x) RARRAY(x)->len #endif #ifndef RARRAY_PTR # define RARRAY_PTR(x) RARRAY(x)->ptr #endif #ifndef RFLOAT_VALUE # define RFLOAT_VALUE(x) RFLOAT(x)->value #endif #ifndef DOUBLE2NUM # define DOUBLE2NUM(x) rb_float_new(x) #endif #ifndef RHASH_TBL # define RHASH_TBL(x) (RHASH(x)->tbl) #endif #ifndef RHASH_ITER_LEV # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev) #endif #ifndef RHASH_IFNONE # define RHASH_IFNONE(x) (RHASH(x)->ifnone) #endif #ifndef RHASH_SIZE # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries) #endif #ifndef RHASH_EMPTY_P # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0) #endif #ifndef RSTRUCT_LEN # define RSTRUCT_LEN(x) RSTRUCT(x)->len #endif #ifndef RSTRUCT_PTR # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr #endif /* * Need to be very careful about how these macros are defined, especially * when compiling C++ code or C code with an ANSI C compiler. * * VALUEFUNC(f) is a macro used to typecast a C function that implements * a Ruby method so that it can be passed as an argument to API functions * like rb_define_method() and rb_define_singleton_method(). * * VOIDFUNC(f) is a macro used to typecast a C function that implements * either the "mark" or "free" stuff for a Ruby Data object, so that it * can be passed as an argument to API functions like Data_Wrap_Struct() * and Data_Make_Struct(). */ #ifdef __cplusplus # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */ # define PROTECTFUNC(f) ((VALUE (*)()) f) # define VALUEFUNC(f) ((VALUE (*)()) f) # define VOIDFUNC(f) ((void (*)()) f) # else # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */ # define PROTECTFUNC(f) ((VALUE (*)()) f) # define VALUEFUNC(f) ((VALUE (*)()) f) # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) # else /* These definitions should work for Ruby 1.7+ */ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f) # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f) # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) # endif # endif #else # define VALUEFUNC(f) (f) # define VOIDFUNC(f) (f) #endif /* Don't use for expressions have side effect */ #ifndef RB_STRING_VALUE #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s))) #endif #ifndef StringValue #define StringValue(s) RB_STRING_VALUE(s) #endif #ifndef StringValuePtr #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s)) #endif #ifndef StringValueLen #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s)) #endif #ifndef SafeStringValue #define SafeStringValue(v) do {\ StringValue(v);\ rb_check_safe_str(v);\ } while (0) #endif #ifndef HAVE_RB_DEFINE_ALLOC_FUNC #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1) #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new") #endif static VALUE _mSWIG = Qnil; /* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ /* Define some additional error types */ #define SWIG_ObjectPreviouslyDeletedError -100 /* Define custom exceptions for errors that do not map to existing Ruby exceptions. Note this only works for C++ since a global cannot be initialized by a function in C. For C, fallback to rb_eRuntimeError.*/ SWIGINTERN VALUE getNullReferenceError(void) { static int init = 0; static VALUE rb_eNullReferenceError ; if (!init) { init = 1; rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError); } return rb_eNullReferenceError; } SWIGINTERN VALUE getObjectPreviouslyDeletedError(void) { static int init = 0; static VALUE rb_eObjectPreviouslyDeleted ; if (!init) { init = 1; rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError); } return rb_eObjectPreviouslyDeleted; } SWIGINTERN VALUE SWIG_Ruby_ErrorType(int SWIG_code) { VALUE type; switch (SWIG_code) { case SWIG_MemoryError: type = rb_eNoMemError; break; case SWIG_IOError: type = rb_eIOError; break; case SWIG_RuntimeError: type = rb_eRuntimeError; break; case SWIG_IndexError: type = rb_eIndexError; break; case SWIG_TypeError: type = rb_eTypeError; break; case SWIG_DivisionByZero: type = rb_eZeroDivError; break; case SWIG_OverflowError: type = rb_eRangeError; break; case SWIG_SyntaxError: type = rb_eSyntaxError; break; case SWIG_ValueError: type = rb_eArgError; break; case SWIG_SystemError: type = rb_eFatal; break; case SWIG_AttributeError: type = rb_eRuntimeError; break; case SWIG_NullReferenceError: type = getNullReferenceError(); break; case SWIG_ObjectPreviouslyDeletedError: type = getObjectPreviouslyDeletedError(); break; case SWIG_UnknownError: type = rb_eRuntimeError; break; default: type = rb_eRuntimeError; } return type; } /* This function is called when a user inputs a wrong argument to a method. */ SWIGINTERN const char* Ruby_Format_TypeError( const char* msg, const char* type, const char* name, const int argn, VALUE input ) { char buf[128]; VALUE str; VALUE asStr; if ( msg && *msg ) { str = rb_str_new2(msg); } else { str = rb_str_new(NULL, 0); } str = rb_str_cat2( str, "Expected argument " ); sprintf( buf, "%d of type ", argn-1 ); str = rb_str_cat2( str, buf ); str = rb_str_cat2( str, type ); str = rb_str_cat2( str, ", but got " ); str = rb_str_cat2( str, rb_obj_classname(input) ); str = rb_str_cat2( str, " " ); asStr = rb_inspect(input); if ( RSTRING_LEN(asStr) > 30 ) { str = rb_str_cat( str, StringValuePtr(asStr), 30 ); str = rb_str_cat2( str, "..." ); } else { str = rb_str_append( str, asStr ); } if ( name ) { str = rb_str_cat2( str, "\n\tin SWIG method '" ); str = rb_str_cat2( str, name ); str = rb_str_cat2( str, "'" ); } return StringValuePtr( str ); } /* This function is called when an overloaded method fails */ SWIGINTERN void Ruby_Format_OverloadedError( const int argc, const int maxargs, const char* method, const char* prototypes ) { const char* msg = "Wrong # of arguments"; if ( argc <= maxargs ) msg = "Wrong arguments"; rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n" "Possible C/C++ prototypes are:\n%s", msg, method, prototypes); } /* ----------------------------------------------------------------------------- * 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 /* Ruby 1.8 actually assumes the first case. */ #if SIZEOF_VOIDP == SIZEOF_LONG # define SWIG2NUM(v) LONG2NUM((unsigned long)v) # define NUM2SWIG(x) (unsigned long)NUM2LONG(x) #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG # define SWIG2NUM(v) LL2NUM((unsigned long long)v) # define NUM2SWIG(x) (unsigned long long)NUM2LL(x) #else # error sizeof(void*) is not the same as long or long long #endif /* Global Ruby hash table to store Trackings from C/C++ structs to Ruby Objects. */ static std::map swig_ruby_trackings; /* Global variable that stores a reference to the ruby hash table delete function. */ static ID swig_ruby_hash_delete; /* Setup a Ruby hash table to store Trackings */ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) { /* Create a ruby hash table to store Trackings from C++ objects to Ruby objects. */ /* Try to see if some other .so has already created a tracking hash table, which we keep hidden in an instance var in the SWIG module. This is done to allow multiple DSOs to share the same tracking table. */ VALUE verbose = rb_gv_get("VERBOSE"); rb_gv_set("VERBOSE", Qfalse); rb_gv_set("VERBOSE", verbose); /* No, it hasn't. Create one ourselves */ swig_ruby_trackings.clear(); /* Now store a reference to the hash table delete function so that we only have to look it up once.*/ swig_ruby_hash_delete = rb_intern("delete"); } /* Get a Ruby number to reference an object */ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) { /* We cast the object to an unsigned long and then store a reference to it using a Ruby number object. */ /* Convert the Object to a Ruby number */ return SWIG2NUM(object); } /* Get a Ruby object from a previously stored reference */ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) { /* The provided Ruby number object is a reference to the Ruby object we want.*/ /* Convert the Ruby number to a Ruby object */ return NUM2SWIG(reference); } /* Add a Tracking from a C/C++ struct to a Ruby object */ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) { /* Store the mapping to the global hash table. */ swig_ruby_trackings[ptr] = object; } /* Get the Ruby object that owns the specified C/C++ struct */ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) { if (swig_ruby_trackings.count(ptr) == 0) return Qnil; else return swig_ruby_trackings[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. */ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) { swig_ruby_trackings.erase(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 */ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) { VALUE object = SWIG_RubyInstanceFor(ptr); if (object != Qnil) { DATA_PTR(object) = 0; } } #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * Ruby API portion that goes into the runtime * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif SWIGINTERN VALUE SWIG_Ruby_AppendOutput(VALUE target, VALUE o) { if (NIL_P(target)) { target = o; } else { if (TYPE(target) != T_ARRAY) { VALUE o2 = target; target = rb_ary_new(); rb_ary_push(target, o2); } rb_ary_push(target, o); } return target; } /* For ruby1.8.4 and earlier. */ #ifndef RUBY_INIT_STACK RUBY_EXTERN void Init_stack(VALUE* addr); # define RUBY_INIT_STACK \ VALUE variable_in_this_stack_frame; \ Init_stack(&variable_in_this_stack_frame); #endif #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * rubyrun.swg * * This file contains the runtime support for Ruby modules * and includes code for managing global variables and pointer * type checking. * ----------------------------------------------------------------------------- */ /* For backward compatibility only */ #define SWIG_POINTER_EXCEPTION 0 /* for raw pointers */ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0) #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own) #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags) #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own) #define swig_owntype ruby_owntype /* for raw packed data */ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags) #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) /* for class or struct pointers */ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) /* for C or C++ function pointers */ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) /* for C++ member pointers, ie, member methods */ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty) #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer) /* Error manipulation */ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code) #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg) #define SWIG_fail goto fail /* Ruby-specific SWIG API */ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime() #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty) #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty) #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value) #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty) #include "assert.h" /* ----------------------------------------------------------------------------- * pointers/data manipulation * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif typedef struct { VALUE klass; VALUE mImpl; void (*mark)(void *); void (*destroy)(void *); int trackObjects; } swig_class; /* Global pointer used to keep some internal SWIG stuff */ static VALUE _cSWIG_Pointer = Qnil; static VALUE swig_runtime_data_type_pointer = Qnil; /* Global IDs used to keep some internal SWIG stuff */ static ID swig_arity_id = 0; static ID swig_call_id = 0; /* If your swig extension is to be run within an embedded ruby and has director callbacks, you should set -DRUBY_EMBEDDED during compilation. This will reset ruby's stack frame on each entry point from the main program the first time a virtual director function is invoked (in a non-recursive way). If this is not done, you run the risk of Ruby trashing the stack. */ #ifdef RUBY_EMBEDDED # define SWIG_INIT_STACK \ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \ ++swig_virtual_calls; # define SWIG_RELEASE_STACK --swig_virtual_calls; # define Ruby_DirectorTypeMismatchException(x) \ rb_raise( rb_eTypeError, "%s", x ); return c_result; static unsigned int swig_virtual_calls = 0; #else /* normal non-embedded extension */ # define SWIG_INIT_STACK # define SWIG_RELEASE_STACK # define Ruby_DirectorTypeMismatchException(x) \ throw Swig::DirectorTypeMismatchException( x ); #endif /* RUBY_EMBEDDED */ SWIGRUNTIME VALUE getExceptionClass(void) { static int init = 0; static VALUE rubyExceptionClass ; if (!init) { init = 1; rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception")); } return rubyExceptionClass; } /* This code checks to see if the Ruby object being raised as part of an exception inherits from the Ruby class Exception. If so, the object is simply returned. If not, then a new Ruby exception object is created and that will be returned to Ruby.*/ SWIGRUNTIME VALUE SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) { VALUE exceptionClass = getExceptionClass(); if (rb_obj_is_kind_of(obj, exceptionClass)) { return obj; } else { return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj)); } } /* Initialize Ruby runtime support */ SWIGRUNTIME void SWIG_Ruby_InitRuntime(void) { if (_mSWIG == Qnil) { _mSWIG = rb_define_module("SWIG"); swig_call_id = rb_intern("call"); swig_arity_id = rb_intern("arity"); } } /* Define Ruby class for C type */ SWIGRUNTIME void SWIG_Ruby_define_class(swig_type_info *type) { char *klass_name = (char *) malloc(4 + strlen(type->name) + 1); sprintf(klass_name, "TYPE%s", type->name); if (NIL_P(_cSWIG_Pointer)) { _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject); rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new"); } rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); free((void *) klass_name); } /* Create a new pointer object */ SWIGRUNTIME VALUE SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) { int own = flags & SWIG_POINTER_OWN; int track; char *klass_name; swig_class *sklass; VALUE klass; VALUE obj; if (!ptr) return Qnil; if (type->clientdata) { sklass = (swig_class *) type->clientdata; /* Are we tracking this class and have we already returned this Ruby object? */ track = sklass->trackObjects; if (track) { obj = SWIG_RubyInstanceFor(ptr); /* Check the object's type and make sure it has the correct type. It might not in cases where methods do things like downcast methods. */ if (obj != Qnil) { VALUE value = rb_iv_get(obj, "@__swigtype__"); const char* type_name = RSTRING_PTR(value); if (strcmp(type->name, type_name) == 0) { return obj; } } } /* Create a new Ruby object */ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), ( own ? VOIDFUNC(sklass->destroy) : (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 ) ), ptr); /* If tracking is on for this class then track this object. */ if (track) { SWIG_RubyAddTracking(ptr, obj); } } else { klass_name = (char *) malloc(4 + strlen(type->name) + 1); sprintf(klass_name, "TYPE%s", type->name); klass = rb_const_get(_mSWIG, rb_intern(klass_name)); free((void *) klass_name); obj = Data_Wrap_Struct(klass, 0, 0, ptr); } rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); return obj; } /* Create a new class instance (always owned) */ SWIGRUNTIME VALUE SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type) { VALUE obj; swig_class *sklass = (swig_class *) type->clientdata; obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0); rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); return obj; } /* Get type mangle from class name */ SWIGRUNTIMEINLINE char * SWIG_Ruby_MangleStr(VALUE obj) { VALUE stype = rb_iv_get(obj, "@__swigtype__"); return StringValuePtr(stype); } /* Acquire a pointer value */ typedef void (*ruby_owntype)(void*); SWIGRUNTIME ruby_owntype SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) { if (obj) { ruby_owntype oldown = RDATA(obj)->dfree; RDATA(obj)->dfree = own; return oldown; } else { return 0; } } /* Convert a pointer value */ SWIGRUNTIME int SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own) { char *c; swig_cast_info *tc; void *vptr = 0; /* Grab the pointer */ if (NIL_P(obj)) { *ptr = 0; return SWIG_OK; } else { if (TYPE(obj) != T_DATA) { return SWIG_ERROR; } Data_Get_Struct(obj, void, vptr); } if (own) *own = RDATA(obj)->dfree; /* Check to see if the input object is giving up ownership of the underlying C struct or C++ object. If so then we need to reset the destructor since the Ruby object no longer owns the underlying C++ object.*/ if (flags & SWIG_POINTER_DISOWN) { /* Is tracking on for this class? */ int track = 0; if (ty && ty->clientdata) { swig_class *sklass = (swig_class *) ty->clientdata; track = sklass->trackObjects; } if (track) { /* We are tracking objects for this class. Thus we change the destructor * to SWIG_RubyRemoveTracking. This allows us to * remove the mapping from the C++ to Ruby object * when the Ruby object is garbage collected. If we don't * do this, then it is possible we will return a reference * to a Ruby object that no longer exists thereby crashing Ruby. */ RDATA(obj)->dfree = SWIG_RubyRemoveTracking; } else { RDATA(obj)->dfree = 0; } } /* Do type-checking if type info was provided */ if (ty) { if (ty->clientdata) { if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) { if (vptr == 0) { /* The object has already been deleted */ return SWIG_ObjectPreviouslyDeletedError; } *ptr = vptr; return SWIG_OK; } } if ((c = SWIG_MangleStr(obj)) == NULL) { return SWIG_ERROR; } tc = SWIG_TypeCheck(c, ty); if (!tc) { return SWIG_ERROR; } else { int newmemory = 0; *ptr = SWIG_TypeCast(tc, vptr, &newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ } } else { *ptr = vptr; } return SWIG_OK; } /* Check convert */ SWIGRUNTIMEINLINE int SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty) { char *c = SWIG_MangleStr(obj); if (!c) return 0; return SWIG_TypeCheck(c,ty) != 0; } SWIGRUNTIME VALUE SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) { char result[1024]; char *r = result; if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; *(r++) = '_'; r = SWIG_PackData(r, ptr, sz); strcpy(r, type->name); return rb_str_new2(result); } /* Convert a packed value value */ SWIGRUNTIME int SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) { swig_cast_info *tc; const char *c; if (TYPE(obj) != T_STRING) goto type_error; c = StringValuePtr(obj); /* Pointer values must start with leading underscore */ if (*c != '_') goto type_error; c++; c = SWIG_UnpackData(c, ptr, sz); if (ty) { tc = SWIG_TypeCheck(c, ty); if (!tc) goto type_error; } return SWIG_OK; type_error: return SWIG_ERROR; } SWIGRUNTIME swig_module_info * SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata)) { VALUE pointer; swig_module_info *ret = 0; VALUE verbose = rb_gv_get("VERBOSE"); /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */ rb_gv_set("VERBOSE", Qfalse); /* first check if pointer already created */ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); if (pointer != Qnil) { Data_Get_Struct(pointer, swig_module_info, ret); } /* reinstate warnings */ rb_gv_set("VERBOSE", verbose); return ret; } SWIGRUNTIME void SWIG_Ruby_SetModule(swig_module_info *pointer) { /* register a new class */ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject); /* create and store the structure pointer to a global variable */ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer); rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer); } /* This function can be used to check whether a proc or method or similarly callable function has been passed. Usually used in a %typecheck, like: %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) { $result = SWIG_Ruby_isCallable( $input ); } */ SWIGINTERN int SWIG_Ruby_isCallable( VALUE proc ) { if ( rb_respond_to( proc, swig_call_id ) ) return 1; return 0; } /* This function can be used to check the arity (number of arguments) a proc or method can take. Usually used in a %typecheck. Valid arities will be that equal to minimal or those < 0 which indicate a variable number of parameters at the end. */ SWIGINTERN int SWIG_Ruby_arity( VALUE proc, int minimal ) { if ( rb_respond_to( proc, swig_arity_id ) ) { VALUE num = rb_funcall( proc, swig_arity_id, 0 ); int arity = NUM2INT(num); if ( arity < 0 && (arity+1) < -minimal ) return 1; if ( arity == minimal ) return 1; return 1; } return 0; } #ifdef __cplusplus } #endif #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0) /* ----------------------------------------------------------------------------- * director.swg * * This file contains support for director classes so that Ruby proxy * methods can be called from C++. * ----------------------------------------------------------------------------- */ /* Use -DSWIG_DIRECTOR_NOUEH if you prefer to avoid the use of the Undefined Exception Handler provided by swig. */ #ifndef SWIG_DIRECTOR_NOUEH #ifndef SWIG_DIRECTOR_UEH #define SWIG_DIRECTOR_UEH #endif #endif #include #include #include #include # define SWIG_DIRECTOR_CAST(ARG) dynamic_cast(ARG) namespace Swig { /* memory handler */ struct GCItem { virtual ~GCItem() { } virtual ruby_owntype get_own() const { return 0; } }; struct GCItem_var { GCItem_var(GCItem *item = 0) : _item(item) { } GCItem_var& operator=(GCItem *item) { GCItem *tmp = _item; _item = item; delete tmp; return *this; } ~GCItem_var() { delete _item; } GCItem *operator->() const { return _item; } private: GCItem *_item; }; template struct GCItem_T : GCItem { GCItem_T(Type *ptr) : _ptr(ptr) { } virtual ~GCItem_T() { delete _ptr; } private: Type *_ptr; }; struct GCItem_Object : GCItem { GCItem_Object(ruby_owntype own) : _own(own) { } virtual ~GCItem_Object() { } ruby_owntype get_own() const { return _own; } private: ruby_owntype _own; }; template struct GCArray_T : GCItem { GCArray_T(Type *ptr) : _ptr(ptr) { } virtual ~GCArray_T() { delete[] _ptr; } private: Type *_ptr; }; /* body args */ struct body_args { VALUE recv; ID id; int argc; VALUE *argv; }; /* Base class for director exceptions */ class DirectorException : public std::exception { protected: VALUE swig_error; std::string swig_msg; protected: DirectorException(VALUE error) : swig_error(error) { } DirectorException(VALUE error, const char *hdr, const char *msg ="") : swig_error(error), swig_msg(hdr) { if (msg[0]) { swig_msg += " "; swig_msg += msg; } if (swig_msg.size()) { VALUE str = rb_str_new(swig_msg.data(), swig_msg.size()); swig_error = rb_exc_new3(error, str); } else { swig_error = error; } } public: virtual ~DirectorException() throw() { } VALUE getType() const { return CLASS_OF(swig_error); } VALUE getError() const { return swig_error; } /* Deprecated, use what() instead */ const std::string& getMessage() const { return swig_msg; } const char *what() const throw() { return swig_msg.c_str(); } }; /* unknown exception handler */ class UnknownExceptionHandler { #ifdef SWIG_DIRECTOR_UEH static void handler() { try { throw; } catch (DirectorException& e) { std::cerr << "SWIG Director exception caught:" << std::endl << e.what() << std::endl; } catch (std::exception& e) { std::cerr << "std::exception caught: "<< e.what() << std::endl; } catch (...) { std::cerr << "Unknown exception caught." << std::endl; } std::cerr << std::endl << "Ruby interpreter traceback:" << std::endl; std::cerr << std::endl; std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl << "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl << std::endl << "Exception is being re-thrown, program will like abort/terminate." << std::endl; throw; } public: std::unexpected_handler old; UnknownExceptionHandler(std::unexpected_handler nh = handler) { old = std::set_unexpected(nh); } ~UnknownExceptionHandler() { std::set_unexpected(old); } #endif }; /* Type mismatch in the return value from a Ruby method call */ class DirectorTypeMismatchException : public DirectorException { public: DirectorTypeMismatchException(VALUE error, const char *msg="") : DirectorException(error, "SWIG director type mismatch", msg) { } DirectorTypeMismatchException(const char *msg="") : DirectorException(rb_eTypeError, "SWIG director type mismatch", msg) { } static void raise(VALUE error, const char *msg) { throw DirectorTypeMismatchException(error, msg); } static void raise(const char *msg) { throw DirectorTypeMismatchException(msg); } }; /* Any Ruby exception that occurs during a director method call */ class DirectorMethodException : public DirectorException { public: DirectorMethodException(VALUE error) : DirectorException(error) { } DirectorMethodException(const char *msg = "") : DirectorException(rb_eRuntimeError, "SWIG director method error.", msg) { } static void raise(VALUE error) { throw DirectorMethodException(error); } }; /* Attempted to call a pure virtual method via a director method */ class DirectorPureVirtualException : public DirectorException { public: DirectorPureVirtualException(const char *msg = "") : DirectorException(rb_eRuntimeError, "SWIG director pure virtual method called", msg) { } static void raise(const char *msg) { throw DirectorPureVirtualException(msg); } }; /* Simple thread abstraction for pthreads on win32 */ #ifdef __THREAD__ # define __PTHREAD__ # if defined(_WIN32) || defined(__WIN32__) # define pthread_mutex_lock EnterCriticalSection # define pthread_mutex_unlock LeaveCriticalSection # define pthread_mutex_t CRITICAL_SECTION # define SWIG_MUTEX_INIT(var) var # else # include # define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER # endif #endif #ifdef __PTHREAD__ struct Guard { pthread_mutex_t *_mutex; Guard(pthread_mutex_t &mutex) : _mutex(&mutex) { pthread_mutex_lock(_mutex); } ~Guard() { pthread_mutex_unlock(_mutex); } }; # define SWIG_GUARD(mutex) Guard _guard(mutex) #else # define SWIG_GUARD(mutex) #endif /* director base class */ class Director { private: /* pointer to the wrapped Ruby object */ VALUE swig_self; /* flag indicating whether the object is owned by Ruby or c++ */ mutable bool swig_disown_flag; public: /* wrap a Ruby object, optionally taking ownership */ Director(VALUE self) : swig_self(self), swig_disown_flag(false) { } /* discard our reference at destruction */ virtual ~Director() { } /* return a pointer to the wrapped Ruby object */ VALUE swig_get_self() const { return swig_self; } /* acquire ownership of the wrapped Ruby object (the sense of "disown" is from Ruby) */ void swig_disown() const { if (!swig_disown_flag) { swig_disown_flag = true; } } /* ownership management */ private: typedef std::map swig_ownership_map; mutable swig_ownership_map swig_owner; #ifdef __PTHREAD__ static pthread_mutex_t swig_mutex_own; #endif public: template void swig_acquire_ownership_array(Type *vptr) const { if (vptr) { SWIG_GUARD(swig_mutex_own); swig_owner[vptr] = new GCArray_T(vptr); } } template void swig_acquire_ownership(Type *vptr) const { if (vptr) { SWIG_GUARD(swig_mutex_own); swig_owner[vptr] = new GCItem_T(vptr); } } void swig_acquire_ownership_obj(void *vptr, ruby_owntype own) const { if (vptr && own) { SWIG_GUARD(swig_mutex_own); swig_owner[vptr] = new GCItem_Object(own); } } ruby_owntype swig_release_ownership(void *vptr) const { ruby_owntype own = 0; if (vptr) { SWIG_GUARD(swig_mutex_own); swig_ownership_map::iterator iter = swig_owner.find(vptr); if (iter != swig_owner.end()) { own = iter->second->get_own(); swig_owner.erase(iter); } } return own; } }; } /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_Channel swig_types[0] #define SWIGTYPE_p_Gosu__Button swig_types[1] #define SWIGTYPE_p_Gosu__Color swig_types[2] #define SWIGTYPE_p_Gosu__Font swig_types[3] #define SWIGTYPE_p_Gosu__GLTexInfo swig_types[4] #define SWIGTYPE_p_Gosu__Image swig_types[5] #define SWIGTYPE_p_Gosu__ImageData swig_types[6] #define SWIGTYPE_p_Gosu__Sample swig_types[7] #define SWIGTYPE_p_Gosu__SampleInstance swig_types[8] #define SWIGTYPE_p_Gosu__Song swig_types[9] #define SWIGTYPE_p_Gosu__TextInput swig_types[10] #define SWIGTYPE_p_Gosu__Window swig_types[11] #define SWIGTYPE_p_char swig_types[12] #define SWIGTYPE_p_double swig_types[13] #define SWIGTYPE_p_std__tr1__arrayT_double_16_t swig_types[14] #define SWIGTYPE_p_std__wstring swig_types[15] static swig_type_info *swig_types[17]; static swig_module_info swig_module = {swig_types, 16, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) /* -------- TYPES TABLE (END) -------- */ #define SWIG_init Init_gosu #define SWIG_name "Gosu" static VALUE mGosu; #define SWIG_RUBY_THREAD_BEGIN_BLOCK #define SWIG_RUBY_THREAD_END_BLOCK #define SWIGVERSION 0x030000 #define SWIG_VERSION SWIGVERSION #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) #include // Avoid Ruby Macro Hell on Windows... #undef accept #undef write #undef close #undef read #undef bind #undef send #undef sleep #undef Sleep #undef int8_t #undef uint8_t #undef int16_t #undef uint16_t #undef int32_t #undef uint32_t #undef int64_t #undef uint64_t //#ifndef WIN32 //#include //#endif #include #ifdef GOSU_IS_WIN #include #endif #include namespace Gosu { void enableUndocumentedRetrofication() { extern bool undocumentedRetrofication; undocumentedRetrofication = true; } void releaseAllOpenALResources(); void register_entity(const std::wstring& name, Gosu::Image* image) { registerEntity(name, image->getData().toBitmap()); } } #include #include #include // Preprocessor check for 1.9 (thanks banister) #if defined(ROBJECT_EMBED_LEN_MAX) #define FIX_ENCODING(var) \ rb_funcall(var, rb_intern("force_encoding"), 1, rb_str_new2("UTF-8")); #define RUBY_18_19(r18, r19) r19 #else #define FIX_ENCODING(var) #define RUBY_18_19(r18, r19) r18 #endif namespace GosusDarkSide { // TODO: Find a way for this to fit into Gosu's design. // This can point to a function that wants to be called every // frame, e.g. rb_thread_schedule. typedef void (*HookOfHorror)(); extern HookOfHorror oncePerTick; void yieldToOtherRubyThreads() { rb_thread_schedule(); } } namespace { void callRubyBlock(VALUE block) { rb_funcall(block, rb_intern("call"), 0); } } namespace Gosu { #ifdef GOSU_IS_WIN void requireFreeImageFor(const char* filename) { // Copied and pasted from MSDN. // TODO: Remove duplication, this is also in AudioAudiere.cpp #define FACILITY_VISUALCPP ((LONG)0x6d) #define VcppException(sev,err) ((sev) | (FACILITY_VISUALCPP<<16) | err) #define BAD_MOD VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND) __try { FreeImage_GetVersion(); } __except ((GetExceptionCode() == BAD_MOD) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { rb_raise(rb_eRuntimeError, "Could neither load image %s nor locate FreeImage.dll to retry with it", filename); } #undef BAD_MOD #undef VcppException #undef FACILITY_VISUALCPP } void loadImageFile_FreeImage(Bitmap& result, const std::wstring& filename); #endif void loadBitmap(Bitmap& bitmap, VALUE val) { // Try to treat as filename first. if (rb_respond_to(val, rb_intern("to_str"))) { VALUE to_str = rb_funcall(val, rb_intern("to_str"), 0); const char* filenameUTF8 = StringValuePtr(to_str); std::wstring filename = Gosu::utf8ToWstring(filenameUTF8); try { loadImageFile(bitmap, filename); return; } catch (const std::exception&) { #ifdef GOSU_IS_WIN requireFreeImageFor(filenameUTF8); try { loadImageFile_FreeImage(bitmap, filename); } catch (const std::runtime_error& error) { rb_raise(rb_eRuntimeError, "Could not load image %s using either GDI+ or FreeImage: %s", filenameUTF8, error.what()); } return; #else throw; #endif } } // Otherwise, try to call .to_blob on it (works with RMagick, TexPlay etc). VALUE conversion = rb_str_new2("to_blob { self.format = 'RGBA'; self.depth = 8 }"); VALUE blob = rb_obj_instance_eval(1, &conversion, val); rb_check_safe_obj(blob); unsigned width = NUM2ULONG(rb_funcall(val, rb_intern("columns"), 0)); unsigned height = NUM2ULONG(rb_funcall(val, rb_intern("rows"), 0)); bitmap.resize(width, height, Gosu::Color::NONE); if (width * height * 4 == RSTRING_LEN(blob)) { // 32 bit per pixel, assume R8G8B8A8 std::memcpy(bitmap.data(), reinterpret_cast(RSTRING_PTR(blob)), width * height * 4); } else if (width * height * 4 * sizeof(float) == RSTRING_LEN(blob)) { // 32 bit per channel, assume float/float/float/float const float* in = reinterpret_cast(RSTRING_PTR(blob)); Gosu::Color::Channel* out = reinterpret_cast(bitmap.data()); for (int i = width * height * 4; i > 0; --i) *(out++) = *(in++) * 255; } else throw std::logic_error("Blob length mismatch!"); } const char* cstrFromSymbol(VALUE symbol) { if (TYPE(symbol) != T_SYMBOL) return 0; // to be caught by the caller return rb_id2name(SYM2ID(symbol)); } } #include #if !defined(SWIG_NO_LLONG_MAX) # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) # define LLONG_MAX __LONG_LONG_MAX__ # define LLONG_MIN (-LLONG_MAX - 1LL) # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) # endif #endif #define SWIG_From_long LONG2NUM SWIGINTERNINLINE VALUE SWIG_From_int (int value) { return SWIG_From_long (value); } SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { static int init = 0; static swig_type_info* info = 0; if (!init) { info = SWIG_TypeQuery("_p_char"); init = 1; } return info; } SWIGINTERNINLINE VALUE SWIG_FromCharPtrAndSize(const char* carray, size_t size) { if (carray) { if (size > LONG_MAX) { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); return pchar_descriptor ? SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil; } else { return rb_str_new(carray, static_cast< long >(size)); } } else { return Qnil; } } SWIGINTERNINLINE VALUE SWIG_FromCharPtr(const char *cptr) { return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); } SWIGINTERNINLINE VALUE SWIG_From_unsigned_SS_long (unsigned long value) { return ULONG2NUM(value); } SWIGINTERN VALUE SWIG_ruby_failed(void) { return Qnil; } /*@SWIG:/usr/local/Cellar/swig/3.0.0/share/swig/3.0.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); double *res = (double *)(args[1]); *res = NUM2DBL(obj); (void)type; return obj; } /*@SWIG@*/ SWIGINTERN int SWIG_AsVal_double (VALUE obj, double *val) { VALUE type = TYPE(obj); if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) { double v; VALUE a[2]; a[0] = obj; a[1] = (VALUE)(&v); if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) { if (val) *val = v; return SWIG_OK; } } return SWIG_TypeError; } #define SWIG_From_double rb_float_new SWIGINTERNINLINE VALUE SWIG_From_unsigned_SS_int (unsigned int value) { return SWIG_From_unsigned_SS_long (value); } #include /*@SWIG:/usr/local/Cellar/swig/3.0.0/share/swig/3.0.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); unsigned long *res = (unsigned long *)(args[1]); *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj); return obj; } /*@SWIG@*/ SWIGINTERN int SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val) { VALUE type = TYPE(obj); if ((type == T_FIXNUM) || (type == T_BIGNUM)) { unsigned long v; VALUE a[2]; a[0] = obj; a[1] = (VALUE)(&v); if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) { if (val) *val = v; return SWIG_OK; } } return SWIG_TypeError; } SWIGINTERN int SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val) { unsigned long v; int res = SWIG_AsVal_unsigned_SS_long (obj, &v); if (SWIG_IsOK(res)) { if ((v > UINT_MAX)) { return SWIG_OverflowError; } else { if (val) *val = static_cast< unsigned int >(v); } } return res; } SWIGINTERNINLINE VALUE SWIG_From_unsigned_SS_char (unsigned char value) { return SWIG_From_unsigned_SS_long (value); } SWIGINTERN Gosu::Color Gosu_Color_rgb(Gosu::Color::Channel r,Gosu::Color::Channel g,Gosu::Color::Channel b){ return Gosu::Color(r, g, b); } SWIGINTERN Gosu::Color Gosu_Color_rgba__SWIG_0(Gosu::Color::Channel r,Gosu::Color::Channel g,Gosu::Color::Channel b,Gosu::Color::Channel a){ return Gosu::Color(a, r, g, b); } SWIGINTERN Gosu::Color Gosu_Color_rgba__SWIG_1(std::tr1::uint32_t rgba){ return Gosu::Color(rgba & 0xff, (rgba >> 24) & 0xff, (rgba >> 16) & 0xff, (rgba >> 8) & 0xff); } SWIGINTERN Gosu::Color Gosu_Color_argb__SWIG_1(Gosu::Color::Channel a,Gosu::Color::Channel r,Gosu::Color::Channel g,Gosu::Color::Channel b){ return Gosu::Color(a, r, g, b); } SWIGINTERN Gosu::Color Gosu_Color_argb__SWIG_2(std::tr1::uint32_t argb){ return Gosu::Color(argb); } SWIGINTERN Gosu::Color Gosu_Color_dup(Gosu::Color const *self){ return *self; } SWIGINTERN std::string Gosu_Color_toS(Gosu::Color const *self){ std::ostringstream stream; stream << "(ARGB: " << static_cast(self->alpha()) << "/" << static_cast(self->red()) << "/" << static_cast(self->green()) << "/" << static_cast(self->blue()) << ")"; return stream.str(); } SWIGINTERNINLINE VALUE SWIG_From_std_string (const std::string& s) { return SWIG_FromCharPtrAndSize(s.data(), s.size()); } SWIGINTERN bool Gosu_Color_operator_Se__Se_(Gosu::Color *self,VALUE other){ if (TYPE(other) == T_FIXNUM || TYPE(other) == T_BIGNUM) return *self == Gosu::Color(NUM2ULONG(other)); void* ptr; int res = SWIG_ConvertPtr(other, &ptr, SWIGTYPE_p_Gosu__Color, 0); return SWIG_IsOK(res) && ptr && *self == *reinterpret_cast(ptr); } SWIGINTERNINLINE VALUE SWIG_From_bool (bool value) { return value ? Qtrue : Qfalse; } /*@SWIG:/usr/local/Cellar/swig/3.0.0/share/swig/3.0.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); long *res = (long *)(args[1]); *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj); return obj; } /*@SWIG@*/ SWIGINTERN int SWIG_AsVal_long (VALUE obj, long* val) { VALUE type = TYPE(obj); if ((type == T_FIXNUM) || (type == T_BIGNUM)) { long v; VALUE a[2]; a[0] = obj; a[1] = (VALUE)(&v); if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) { if (val) *val = v; return SWIG_OK; } } return SWIG_TypeError; } SWIGINTERN int SWIG_AsVal_int (VALUE obj, int *val) { long v; int res = SWIG_AsVal_long (obj, &v); if (SWIG_IsOK(res)) { if ((v < INT_MIN || v > INT_MAX)) { return SWIG_OverflowError; } else { if (val) *val = static_cast< int >(v); } } return res; } SWIGINTERN Gosu::Font *new_Gosu_Font(Gosu::Window &window,std::wstring const &fontName,unsigned int height){ return new Gosu::Font(window.graphics(), fontName, height); } SWIGINTERN void Gosu_Font_set_image(Gosu::Font *self,wchar_t wc,VALUE source){ // TODO: Super super super ugly hack that relies on the layout of std::tr1::shared_ptr. // To be removed once Image creation does not require a Graphics anymore. Gosu::Graphics& graphics = ***reinterpret_cast(self); Gosu::Bitmap bitmap; Gosu::loadBitmap(bitmap, source); self->setImage(wc, Gosu::Image(graphics, bitmap, false)); } #include #include /* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ #ifndef SWIG_isfinite # if defined(isfinite) # define SWIG_isfinite(X) (isfinite(X)) # elif defined(_MSC_VER) # define SWIG_isfinite(X) (_finite(X)) # elif defined(__sun) && defined(__SVR4) # include # define SWIG_isfinite(X) (finite(X)) # endif #endif /* Accept infinite as a valid float value unless we are unable to check if a value is finite */ #ifdef SWIG_isfinite # define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) #else # define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) #endif SWIGINTERN int SWIG_AsVal_float (VALUE obj, float *val) { double v; int res = SWIG_AsVal_double (obj, &v); if (SWIG_IsOK(res)) { if (SWIG_Float_Overflow_Check(v)) { return SWIG_OverflowError; } else { if (val) *val = static_cast< float >(v); } } return res; } SWIGINTERNINLINE VALUE SWIG_From_float (float value) { return SWIG_From_double (value); } SWIGINTERN int SWIG_AsVal_bool (VALUE obj, bool *val) { if (obj == Qtrue) { if (val) *val = true; return SWIG_OK; } else if (obj == Qfalse) { if (val) *val = false; return SWIG_OK; } else { int res = 0; if (SWIG_AsVal_int (obj, &res) == SWIG_OK) { if (val) *val = res ? true : false; return SWIG_OK; } } return SWIG_TypeError; } SWIGINTERN Gosu::Image *new_Gosu_Image__SWIG_0(Gosu::Window &window,VALUE source,bool tileable=false){ Gosu::Bitmap bmp; Gosu::loadBitmap(bmp, source); return new Gosu::Image(window.graphics(), bmp, tileable); } SWIGINTERN Gosu::Image *new_Gosu_Image__SWIG_1(Gosu::Window &window,VALUE source,bool tileable,unsigned int srcX,unsigned int srcY,unsigned int srcWidth,unsigned int srcHeight){ Gosu::Bitmap bmp; Gosu::loadBitmap(bmp, source); return new Gosu::Image(window.graphics(), bmp, srcX, srcY, srcWidth, srcHeight, tileable); } SWIGINTERN void Gosu_Image_drawAsQuad(Gosu::Image *self,double x1,double y1,Gosu::Color c1,double x2,double y2,Gosu::Color c2,double x3,double y3,Gosu::Color c3,double x4,double y4,Gosu::Color c4,Gosu::ZPos z,Gosu::AlphaMode mode=Gosu::amDefault){ self->getData().draw(x1, y1, c1, x2, y2, c2, x3, y3, c3, x4, y4, c4, z, mode); } SWIGINTERN Gosu::GLTexInfo *Gosu_Image_glTexInfo(Gosu::Image const *self){ const Gosu::GLTexInfo* info = self->getData().glTexInfo(); if (info) return new Gosu::GLTexInfo(*info); else return 0; } SWIGINTERN Gosu::Image *Gosu_Image_subimage(Gosu::Image *self,int x,int y,int w,int h){ std::auto_ptr imageData = self->getData().subimage(x, y, w, h); return imageData.get() ? new Gosu::Image(imageData) : 0; } SWIGINTERN Gosu::Image *Gosu_Image_fromText4(Gosu::Window &window,std::wstring const &text,std::wstring const &fontName,unsigned int fontHeight){ Gosu::Bitmap bmp = Gosu::createText(text, fontName, fontHeight); return new Gosu::Image(window.graphics(), bmp); } SWIGINTERN Gosu::Image *Gosu_Image_fromText7(Gosu::Window &window,std::wstring const &text,std::wstring const &fontName,unsigned int fontHeight,int lineSpacing,unsigned int width,Gosu::TextAlign align){ Gosu::Bitmap bmp = Gosu::createText(text, fontName, fontHeight, lineSpacing, width, align); return new Gosu::Image(window.graphics(), bmp); } SWIGINTERN std::vector< Gosu::Image * > Gosu_Image_loadTiles(Gosu::Window &window,VALUE source,int tileWidth,int tileHeight,bool tileable){ std::vector vec; // TODO: const correctness (<- did I mean exception safety?) Gosu::Bitmap bmp; Gosu::loadBitmap(bmp, source); Gosu::imagesFromTiledBitmap(window.graphics(), bmp, tileWidth, tileHeight, tileable, vec); return vec; } SWIGINTERN std::string Gosu_Image_toBlob(Gosu::Image const *self){ // TODO: Optimize with direct copy into a Ruby string Gosu::Bitmap bmp = self->getData().toBitmap(); return std::string(reinterpret_cast(bmp.data()), reinterpret_cast(bmp.data()) + bmp.width() * bmp.height() * 4); } SWIGINTERN unsigned int Gosu_Image_columns(Gosu::Image const *self){ return self->width(); } SWIGINTERN unsigned int Gosu_Image_rows(Gosu::Image const *self){ return self->height(); } SWIGINTERN void Gosu_Image_save(Gosu::Image const *self,std::wstring const &filename){ Gosu::saveImageFile(self->getData().toBitmap(), filename); } SWIGINTERN void Gosu_Image_insert(Gosu::Image *self,VALUE source,int x,int y){ Gosu::Bitmap bmp; Gosu::loadBitmap(bmp, source); self->getData().insert(bmp, x, y); } SWIGINTERN unsigned int Gosu_TextInput_caret_pos(Gosu::TextInput const *self){ return RUBY_18_19(Gosu::wstringToUTF8(self->text().substr(0, self->caretPos())).size(), self->caretPos()); } SWIGINTERN unsigned int Gosu_TextInput_selection_start(Gosu::TextInput const *self){ return RUBY_18_19(Gosu::wstringToUTF8(self->text().substr(0, self->selectionStart())).size(), self->selectionStart()); } SWIGINTERN void Gosu_Window_drawLine(Gosu::Window *self,double x1,double y1,Gosu::Color c1,double x2,double y2,Gosu::Color c2,Gosu::ZPos z=0,Gosu::AlphaMode mode=Gosu::amDefault){ self->graphics().drawLine(x1, y1, c1, x2, y2, c2, z, mode); } SWIGINTERN void Gosu_Window_drawTriangle(Gosu::Window *self,double x1,double y1,Gosu::Color c1,double x2,double y2,Gosu::Color c2,double x3,double y3,Gosu::Color c3,Gosu::ZPos z=0,Gosu::AlphaMode mode=Gosu::amDefault){ self->graphics().drawTriangle(x1, y1, c1, x2, y2, c2, x3, y3, c3, z, mode); } SWIGINTERN void Gosu_Window_drawQuad(Gosu::Window *self,double x1,double y1,Gosu::Color c1,double x2,double y2,Gosu::Color c2,double x3,double y3,Gosu::Color c3,double x4,double y4,Gosu::Color c4,Gosu::ZPos z=0,Gosu::AlphaMode mode=Gosu::amDefault){ self->graphics().drawQuad(x1, y1, c1, x2, y2, c2, x3, y3, c3, x4, y4, c4, z, mode); } SWIGINTERN void Gosu_Window_flush(Gosu::Window *self){ return self->graphics().flush(); } SWIGINTERN bool Gosu_Window_isButtonDown(Gosu::Window const *self,Gosu::Button btn){ return self->input().down(btn); } SWIGINTERN Gosu::Button Gosu_Window_charToButtonId(wchar_t ch){ return Gosu::Input::charToId(ch); } SWIGINTERN wchar_t Gosu_Window_buttonIdToChar(Gosu::Button btn){ return Gosu::Input::idToChar(btn); } SWIGINTERN Gosu::TextInput *Gosu_Window_textInput(Gosu::Window const *self){ return self->input().textInput(); } SWIGINTERN void Gosu_Window_setTextInput(Gosu::Window *self,Gosu::TextInput *ti){ self->input().setTextInput(ti); } SWIGINTERN double Gosu_Window_mouseX(Gosu::Window const *self){ return self->input().mouseX(); } SWIGINTERN double Gosu_Window_mouseY(Gosu::Window const *self){ return self->input().mouseY(); } SWIGINTERN void Gosu_Window_setMousePosition(Gosu::Window *self,double x,double y){ self->input().setMousePosition(x, y); } SWIGINTERN void Gosu_Window_setMouseX(Gosu::Window *self,double x){ self->input().setMousePosition(x, self->input().mouseY()); } SWIGINTERN void Gosu_Window_setMouseY(Gosu::Window *self,double y){ self->input().setMousePosition(self->input().mouseX(), y); } SWIGINTERN int Gosu_Window_width(Gosu::Window const *self){ return self->graphics().width(); } SWIGINTERN int Gosu_Window_height(Gosu::Window const *self){ return self->graphics().height(); } SWIGINTERN bool Gosu_Window_fullscreen(Gosu::Window const *self){ return self->graphics().fullscreen(); } SWIGINTERN void Gosu_Window_unsafe_gl__SWIG_0(Gosu::Window *self){ self->graphics().beginGL(); rb_yield(Qnil); self->graphics().endGL(); } SWIGINTERN void Gosu_Window_unsafe_gl__SWIG_1(Gosu::Window *self,Gosu::ZPos z){ self->graphics().scheduleGL(std::tr1::bind(callRubyBlock, rb_block_proc()), z); } SWIGINTERN void Gosu_Window_clipTo(Gosu::Window *self,double x,double y,double width,double height){ self->graphics().beginClipping(x, y, width, height); rb_yield(Qnil); self->graphics().endClipping(); } SWIGINTERN Gosu::Image *Gosu_Window_record(Gosu::Window *self,int width,int height){ self->graphics().beginRecording(); rb_yield(Qnil); return new Gosu::Image(self->graphics().endRecording(width, height)); } SWIGINTERN void Gosu_Window_transform(Gosu::Window *self,double m0,double m1,double m2,double m3,double m4,double m5,double m6,double m7,double m8,double m9,double m10,double m11,double m12,double m13,double m14,double m15){ Gosu::Transform transform = { m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 }; self->graphics().pushTransform(transform); rb_yield(Qnil); self->graphics().popTransform(); } SWIGINTERN void Gosu_Window_rotate(Gosu::Window *self,double angle,double aroundX=0,double aroundY=0){ self->graphics().pushTransform(Gosu::rotate(angle, aroundX, aroundY)); rb_yield(Qnil); self->graphics().popTransform(); } SWIGINTERN void Gosu_Window_scale__SWIG_0(Gosu::Window *self,double factor){ self->graphics().pushTransform(Gosu::scale(factor)); rb_yield(Qnil); self->graphics().popTransform(); } SWIGINTERN void Gosu_Window_scale__SWIG_1(Gosu::Window *self,double factorX,double factorY){ self->graphics().pushTransform(Gosu::scale(factorX, factorY)); rb_yield(Qnil); self->graphics().popTransform(); } SWIGINTERN void Gosu_Window_scale__SWIG_2(Gosu::Window *self,double factorX,double factorY,double aroundX,double aroundY){ self->graphics().pushTransform(Gosu::scale(factorX, factorY, aroundX, aroundY)); rb_yield(Qnil); self->graphics().popTransform(); } SWIGINTERN void Gosu_Window_translate(Gosu::Window *self,double x,double y){ self->graphics().pushTransform(Gosu::translate(x, y)); rb_yield(Qnil); self->graphics().popTransform(); } static void markWindow(void* window) { #ifndef __MACRUBY__ Gosu::TextInput* ti = static_cast(window)->input().textInput(); if (VALUE ti_value = SWIG_RubyInstanceFor(ti)) rb_gc_mark(ti_value); #endif } /* --------------------------------------------------- * C++ director class helpers * --------------------------------------------------- */ /* --------------------------------------------------- * C++ director class methods * --------------------------------------------------- */ #include "gosu_wrap.h" SwigDirector_TextInput::SwigDirector_TextInput(VALUE self): Gosu::TextInput(), Swig::Director(self) { } SwigDirector_TextInput::~SwigDirector_TextInput() { } std::wstring SwigDirector_TextInput::filter(std::wstring const &text) const { std::wstring c_result ; VALUE obj0 = Qnil ; VALUE result; { obj0 = rb_str_new2(Gosu::wstringToUTF8(text).c_str()); FIX_ENCODING(obj0); } result = rb_funcall(swig_get_self(), rb_intern("filter"), 1,obj0); { VALUE localTemporary = rb_obj_as_string(result); c_result = Gosu::utf8ToWstring(StringValueCStr(localTemporary));; } return (std::wstring) c_result; } SwigDirector_Window::SwigDirector_Window(VALUE self, unsigned int width, unsigned int height, bool fullscreen, double updateInterval): Gosu::Window(width, height, fullscreen, updateInterval), Swig::Director(self) { } SwigDirector_Window::~SwigDirector_Window() { } void SwigDirector_Window::update() { VALUE result; result = rb_funcall(swig_get_self(), rb_intern("protected_update"), 0, NULL); } void SwigDirector_Window::draw() { VALUE result; result = rb_funcall(swig_get_self(), rb_intern("protected_draw_2"), 0, NULL); } bool SwigDirector_Window::needsRedraw() const { bool c_result ; VALUE result; result = rb_funcall(swig_get_self(), rb_intern("protected_needs_redraw?"), 0, NULL); bool swig_val; int swig_res = SWIG_AsVal_bool(result, &swig_val); if (!SWIG_IsOK(swig_res)) { Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'"); } c_result = static_cast< bool >(swig_val); return (bool) c_result; } bool SwigDirector_Window::needsCursor() const { bool c_result ; VALUE result; result = rb_funcall(swig_get_self(), rb_intern("protected_needs_cursor?"), 0, NULL); bool swig_val; int swig_res = SWIG_AsVal_bool(result, &swig_val); if (!SWIG_IsOK(swig_res)) { Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'"); } c_result = static_cast< bool >(swig_val); return (bool) c_result; } void SwigDirector_Window::loseFocus() { VALUE result; result = rb_funcall(swig_get_self(), rb_intern("protected_lose_focus"), 0, NULL); } void SwigDirector_Window::releaseMemory() { VALUE result; result = rb_funcall(swig_get_self(), rb_intern("release_memory"), 0, NULL); } void SwigDirector_Window::buttonDown(Gosu::Button arg0) { VALUE obj0 = Qnil ; VALUE result; { if (arg0 == Gosu::noButton) obj0 = Qnil; else obj0 = LONG2NUM((&arg0)->id()); } result = rb_funcall(swig_get_self(), rb_intern("protected_button_down"), 1,obj0); } void SwigDirector_Window::buttonUp(Gosu::Button arg0) { VALUE obj0 = Qnil ; VALUE result; { if (arg0 == Gosu::noButton) obj0 = Qnil; else obj0 = LONG2NUM((&arg0)->id()); } result = rb_funcall(swig_get_self(), rb_intern("protected_button_up"), 1,obj0); } SWIGINTERN VALUE _wrap_milliseconds(int argc, VALUE *argv, VALUE self) { unsigned long result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (unsigned long)Gosu::milliseconds(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_random(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::random", 1, argv[0] )); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::random", 2, argv[1] )); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::random(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_degrees_to_radians(int argc, VALUE *argv, VALUE self) { double arg1 ; double val1 ; int ecode1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::degreesToRadians", 1, argv[0] )); } arg1 = static_cast< double >(val1); { try { result = (double)Gosu::degreesToRadians(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_radians_to_degrees(int argc, VALUE *argv, VALUE self) { double arg1 ; double val1 ; int ecode1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::radiansToDegrees", 1, argv[0] )); } arg1 = static_cast< double >(val1); { try { result = (double)Gosu::radiansToDegrees(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_offset_x(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::offsetX", 1, argv[0] )); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::offsetX", 2, argv[1] )); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::offsetX(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_offset_y(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::offsetY", 1, argv[0] )); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::offsetY", 2, argv[1] )); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::offsetY(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_angle(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double arg3 ; double arg4 ; double arg5 = (double) 0 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 4) || (argc > 5)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::angle", 1, argv[0] )); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::angle", 2, argv[1] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","Gosu::angle", 3, argv[2] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","Gosu::angle", 4, argv[3] )); } arg4 = static_cast< double >(val4); if (argc > 4) { ecode5 = SWIG_AsVal_double(argv[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","Gosu::angle", 5, argv[4] )); } arg5 = static_cast< double >(val5); } { try { result = (double)Gosu::angle(arg1,arg2,arg3,arg4,arg5); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_angle_diff(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::angleDiff", 1, argv[0] )); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::angleDiff", 2, argv[1] )); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::angleDiff(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_normalize_angle(int argc, VALUE *argv, VALUE self) { double arg1 ; double val1 ; int ecode1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::normalizeAngle", 1, argv[0] )); } arg1 = static_cast< double >(val1); { try { result = (double)Gosu::normalizeAngle(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_distance(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double arg3 ; double arg4 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::distance", 1, argv[0] )); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::distance", 2, argv[1] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","Gosu::distance", 3, argv[2] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","Gosu::distance", 4, argv[3] )); } arg4 = static_cast< double >(val4); { try { result = (double)Gosu::distance(arg1,arg2,arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_default_font_name(int argc, VALUE *argv, VALUE self) { std::wstring result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = Gosu::defaultFontName(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); FIX_ENCODING(vresult); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_screen_width(int argc, VALUE *argv, VALUE self) { unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (unsigned int)Gosu::screenWidth(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_screen_height(int argc, VALUE *argv, VALUE self) { unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (unsigned int)Gosu::screenHeight(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_language(int argc, VALUE *argv, VALUE self) { std::string result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = Gosu::language(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2((&result)->c_str()); FIX_ENCODING(vresult); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_enable_undocumented_retrofication(int argc, VALUE *argv, VALUE self) { if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { Gosu::enableUndocumentedRetrofication(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap__release_all_openal_resources(int argc, VALUE *argv, VALUE self) { if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { Gosu::releaseAllOpenALResources(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_register_entity(int argc, VALUE *argv, VALUE self) { std::wstring *arg1 = 0 ; Gosu::Image *arg2 = (Gosu::Image *) 0 ; std::wstring temp1 ; void *argp2 = 0 ; int res2 = 0 ; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } { VALUE localTemporary = rb_obj_as_string(argv[0]); temp1 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg1 = &temp1; } res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Gosu::Image *","Gosu::register_entity", 2, argv[1] )); } arg2 = reinterpret_cast< Gosu::Image * >(argp2); { try { Gosu::register_entity((std::wstring const &)*arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } static swig_class SwigClassColor; SWIGINTERN VALUE _wrap_new_Color__SWIG_0(int argc, VALUE *argv, VALUE self) { const char *classname SWIGUNUSED = "Gosu::Color"; Gosu::Color *result = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (Gosu::Color *)new Gosu::Color(); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN VALUE _wrap_new_Color__SWIG_1(int argc, VALUE *argv, VALUE self) { unsigned int arg1 ; unsigned int val1 ; int ecode1 = 0 ; const char *classname SWIGUNUSED = "Gosu::Color"; Gosu::Color *result = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "unsigned int","Color", 1, argv[0] )); } arg1 = static_cast< unsigned int >(val1); { try { result = (Gosu::Color *)new Gosu::Color(arg1); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN VALUE _wrap_new_Color__SWIG_2(int argc, VALUE *argv, VALUE self) { Gosu::Color::Channel arg1 ; Gosu::Color::Channel arg2 ; Gosu::Color::Channel arg3 ; const char *classname SWIGUNUSED = "Gosu::Color"; Gosu::Color *result = 0 ; if ((argc < 3) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } { arg1 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { arg2 = Gosu::clamp(NUM2ULONG(argv[1]), 0, 255); } { arg3 = Gosu::clamp(NUM2ULONG(argv[2]), 0, 255); } { try { result = (Gosu::Color *)new Gosu::Color(arg1,arg2,arg3); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_Color_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_Color_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Color); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_Color__SWIG_3(int argc, VALUE *argv, VALUE self) { Gosu::Color::Channel arg1 ; Gosu::Color::Channel arg2 ; Gosu::Color::Channel arg3 ; Gosu::Color::Channel arg4 ; const char *classname SWIGUNUSED = "Gosu::Color"; Gosu::Color *result = 0 ; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } { arg1 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { arg2 = Gosu::clamp(NUM2ULONG(argv[1]), 0, 255); } { arg3 = Gosu::clamp(NUM2ULONG(argv[2]), 0, 255); } { arg4 = Gosu::clamp(NUM2ULONG(argv[3]), 0, 255); } { try { result = (Gosu::Color *)new Gosu::Color(arg1,arg2,arg3,arg4); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN VALUE _wrap_new_Color(int nargs, VALUE *args, VALUE self) { int argc; VALUE argv[4]; int ii; argc = nargs; if (argc > 4) SWIG_fail; for (ii = 0; (ii < argc); ++ii) { argv[ii] = args[ii]; } if (argc == 0) { return _wrap_new_Color__SWIG_0(nargs, args, self); } if (argc == 1) { int _v; { int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_new_Color__SWIG_1(nargs, args, self); } } if (argc == 3) { int _v; { _v = !!rb_respond_to(argv[0], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[1], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[2], rb_intern("to_i")); } if (_v) { return _wrap_new_Color__SWIG_2(nargs, args, self); } } } } if (argc == 4) { int _v; { _v = !!rb_respond_to(argv[0], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[1], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[2], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[3], rb_intern("to_i")); } if (_v) { return _wrap_new_Color__SWIG_3(nargs, args, self); } } } } } fail: Ruby_Format_OverloadedError( argc, 4, "Color.new", " Color.new()\n" " Color.new(unsigned int argb)\n" " Color.new(Gosu::Color::Channel red, Gosu::Color::Channel green, Gosu::Color::Channel blue)\n" " Color.new(Gosu::Color::Channel alpha, Gosu::Color::Channel red, Gosu::Color::Channel green, Gosu::Color::Channel blue)\n"); return Qnil; } SWIGINTERN VALUE _wrap_Color_from_hsv(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double arg3 ; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 3) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_double(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Gosu::Color::fromHSV", 1, argv[0] )); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::Color::fromHSV", 2, argv[1] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","Gosu::Color::fromHSV", 3, argv[2] )); } arg3 = static_cast< double >(val3); { try { result = Gosu::Color::fromHSV(arg1,arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_from_ahsv(int argc, VALUE *argv, VALUE self) { Gosu::Color::Channel arg1 ; double arg2 ; double arg3 ; double arg4 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } { arg1 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Gosu::Color::fromAHSV", 2, argv[1] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","Gosu::Color::fromAHSV", 3, argv[2] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","Gosu::Color::fromAHSV", 4, argv[3] )); } arg4 = static_cast< double >(val4); { try { result = Gosu::Color::fromAHSV(arg1,arg2,arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_red(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Gosu::Color::Channel result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","red", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->red(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_green(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Gosu::Color::Channel result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","green", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->green(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_blue(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Gosu::Color::Channel result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","blue", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->blue(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_alpha(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Gosu::Color::Channel result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","alpha", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->alpha(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_rede___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; Gosu::Color::Channel arg2 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","setRed", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { arg2 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { try { (arg1)->setRed(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_greene___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; Gosu::Color::Channel arg2 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","setGreen", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { arg2 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { try { (arg1)->setGreen(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_bluee___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; Gosu::Color::Channel arg2 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","setBlue", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { arg2 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { try { (arg1)->setBlue(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_alphae___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; Gosu::Color::Channel arg2 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","setAlpha", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { arg2 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { try { (arg1)->setAlpha(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_hue(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","hue", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = (double)((Gosu::Color const *)arg1)->hue(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_huee___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","setHue", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","setHue", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { (arg1)->setHue(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_saturation(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","saturation", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = (double)((Gosu::Color const *)arg1)->saturation(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_saturatione___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","setSaturation", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","setSaturation", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { (arg1)->setSaturation(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_value(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","value", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = (double)((Gosu::Color const *)arg1)->value(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_valuee___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","setValue", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","setValue", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { (arg1)->setValue(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_argb__SWIG_0(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::tr1::uint32_t result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","argb", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->argb(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_bgr(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::tr1::uint32_t result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","bgr", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->bgr(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_abgr(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::tr1::uint32_t result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","abgr", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->abgr(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_gl(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::tr1::uint32_t result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","gl", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->gl(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_rgb(int argc, VALUE *argv, VALUE self) { Gosu::Color::Channel arg1 ; Gosu::Color::Channel arg2 ; Gosu::Color::Channel arg3 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 3) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } { arg1 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { arg2 = Gosu::clamp(NUM2ULONG(argv[1]), 0, 255); } { arg3 = Gosu::clamp(NUM2ULONG(argv[2]), 0, 255); } { try { result = Gosu_Color_rgb(arg1,arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_rgba__SWIG_0(int argc, VALUE *argv, VALUE self) { Gosu::Color::Channel arg1 ; Gosu::Color::Channel arg2 ; Gosu::Color::Channel arg3 ; Gosu::Color::Channel arg4 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } { arg1 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { arg2 = Gosu::clamp(NUM2ULONG(argv[1]), 0, 255); } { arg3 = Gosu::clamp(NUM2ULONG(argv[2]), 0, 255); } { arg4 = Gosu::clamp(NUM2ULONG(argv[3]), 0, 255); } { try { result = Gosu_Color_rgba__SWIG_0(arg1,arg2,arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_rgba__SWIG_1(int argc, VALUE *argv, VALUE self) { std::tr1::uint32_t arg1 ; unsigned long val1 ; int ecode1 = 0 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_long(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::tr1::uint32_t","Gosu_Color_rgba__SWIG_1", 1, argv[0] )); } arg1 = static_cast< std::tr1::uint32_t >(val1); { try { result = Gosu_Color_rgba__SWIG_1(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_rgba(int nargs, VALUE *args, VALUE self) { int argc; VALUE argv[4]; int ii; argc = nargs; if (argc > 4) SWIG_fail; for (ii = 0; (ii < argc); ++ii) { argv[ii] = args[ii]; } if (argc == 1) { int _v; { int res = SWIG_AsVal_unsigned_SS_long(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_Color_rgba__SWIG_1(nargs, args, self); } } if (argc == 4) { int _v; { _v = !!rb_respond_to(argv[0], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[1], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[2], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[3], rb_intern("to_i")); } if (_v) { return _wrap_Color_rgba__SWIG_0(nargs, args, self); } } } } } fail: Ruby_Format_OverloadedError( argc, 4, "rgba", " Gosu::Color rgba(Gosu::Color::Channel r, Gosu::Color::Channel g, Gosu::Color::Channel b, Gosu::Color::Channel a)\n" " Gosu::Color rgba(std::tr1::uint32_t rgba)\n"); return Qnil; } SWIGINTERN VALUE _wrap_Color_argb__SWIG_1(int argc, VALUE *argv, VALUE self) { Gosu::Color::Channel arg1 ; Gosu::Color::Channel arg2 ; Gosu::Color::Channel arg3 ; Gosu::Color::Channel arg4 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } { arg1 = Gosu::clamp(NUM2ULONG(argv[0]), 0, 255); } { arg2 = Gosu::clamp(NUM2ULONG(argv[1]), 0, 255); } { arg3 = Gosu::clamp(NUM2ULONG(argv[2]), 0, 255); } { arg4 = Gosu::clamp(NUM2ULONG(argv[3]), 0, 255); } { try { result = Gosu_Color_argb__SWIG_1(arg1,arg2,arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_argb__SWIG_2(int argc, VALUE *argv, VALUE self) { std::tr1::uint32_t arg1 ; unsigned long val1 ; int ecode1 = 0 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_long(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::tr1::uint32_t","Gosu_Color_argb__SWIG_2", 1, argv[0] )); } arg1 = static_cast< std::tr1::uint32_t >(val1); { try { result = Gosu_Color_argb__SWIG_2(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_argb(int nargs, VALUE *args, VALUE self) { int argc; VALUE argv[4]; int ii; argc = nargs; if (argc > 4) SWIG_fail; for (ii = 0; (ii < argc); ++ii) { argv[ii] = args[ii]; } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Color, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_Color_argb__SWIG_0(nargs, args, self); } } if (argc == 1) { int _v; { int res = SWIG_AsVal_unsigned_SS_long(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_Color_argb__SWIG_2(nargs, args, self); } } if (argc == 4) { int _v; { _v = !!rb_respond_to(argv[0], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[1], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[2], rb_intern("to_i")); } if (_v) { { _v = !!rb_respond_to(argv[3], rb_intern("to_i")); } if (_v) { return _wrap_Color_argb__SWIG_1(nargs, args, self); } } } } } fail: Ruby_Format_OverloadedError( argc, 4, "Color.argb", " Gosu::Color Color.argb(Gosu::Color const *self)\n" " Gosu::Color Color.argb(Gosu::Color::Channel a, Gosu::Color::Channel r, Gosu::Color::Channel g, Gosu::Color::Channel b)\n" " Gosu::Color Color.argb(std::tr1::uint32_t argb)\n"); return Qnil; } /* Document-method: Gosu::Color.dup call-seq: dup -> Color Create a duplicate of the class and unfreeze it if needed. */ SWIGINTERN VALUE _wrap_Color_dup(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","dup", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = Gosu_Color_dup((Gosu::Color const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::Color(static_cast< const Gosu::Color& >(result))), SWIGTYPE_p_Gosu__Color, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_to_s(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::string result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","toS", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = Gosu_Color_toS((Gosu::Color const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_std_string(static_cast< std::string >(result)); return vresult; fail: return Qnil; } /* Document-method: Gosu::Color.== call-seq: ==(other) -> bool Equality comparison operator. */ SWIGINTERN VALUE _wrap_Color___eq__(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; VALUE arg2 = (VALUE) 0 ; void *argp1 = 0 ; int res1 = 0 ; bool result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color *","operator ==", 1, self )); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); arg2 = argv[0]; { try { result = (bool)Gosu_Color_operator_Se__Se_(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN void free_Gosu_Color(Gosu::Color *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } static swig_class SwigClassFont; SWIGINTERN VALUE _wrap_Font_name(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","name", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { try { result = ((Gosu::Font const *)arg1)->name(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); FIX_ENCODING(vresult); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Font_height(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","height", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { try { result = (unsigned int)((Gosu::Font const *)arg1)->height(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Font_flags(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","flags", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { try { result = (unsigned int)((Gosu::Font const *)arg1)->flags(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Font_text_width(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; std::wstring *arg2 = 0 ; double arg3 = (double) 1 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; double val3 ; int ecode3 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","textWidth", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } if (argc > 1) { ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","textWidth", 3, argv[1] )); } arg3 = static_cast< double >(val3); } { try { result = (double)((Gosu::Font const *)arg1)->textWidth((std::wstring const &)*arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Font_draw(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; std::wstring *arg2 = 0 ; double arg3 ; double arg4 ; Gosu::ZPos arg5 ; double arg6 = (double) 1 ; double arg7 = (double) 1 ; Gosu::Color arg8 = (Gosu::Color) Gosu::Color::WHITE ; Gosu::AlphaMode arg9 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val7 ; int ecode7 = 0 ; if ((argc < 4) || (argc > 8)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","draw", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","draw", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","draw", 4, argv[2] )); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Gosu::ZPos","draw", 5, argv[3] )); } arg5 = static_cast< Gosu::ZPos >(val5); if (argc > 4) { ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","draw", 6, argv[4] )); } arg6 = static_cast< double >(val6); } if (argc > 5) { ecode7 = SWIG_AsVal_double(argv[5], &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","draw", 7, argv[5] )); } arg7 = static_cast< double >(val7); } if (argc > 6) { { if (TYPE(argv[6]) == T_FIXNUM || TYPE(argv[6]) == T_BIGNUM) arg8 = Gosu::Color(NUM2ULONG(argv[6])); else { void* ptr; int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg8 = *reinterpret_cast(ptr); } } } if (argc > 7) { { const char* cstr = Gosu::cstrFromSymbol(argv[7]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg9 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg9 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg9 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg9 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { ((Gosu::Font const *)arg1)->draw((std::wstring const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Font_draw_rel(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; std::wstring *arg2 = 0 ; double arg3 ; double arg4 ; Gosu::ZPos arg5 ; double arg6 ; double arg7 ; double arg8 = (double) 1 ; double arg9 = (double) 1 ; Gosu::Color arg10 = (Gosu::Color) Gosu::Color::WHITE ; Gosu::AlphaMode arg11 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val7 ; int ecode7 = 0 ; double val8 ; int ecode8 = 0 ; double val9 ; int ecode9 = 0 ; if ((argc < 6) || (argc > 10)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","drawRel", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawRel", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","drawRel", 4, argv[2] )); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Gosu::ZPos","drawRel", 5, argv[3] )); } arg5 = static_cast< Gosu::ZPos >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawRel", 6, argv[4] )); } arg6 = static_cast< double >(val6); ecode7 = SWIG_AsVal_double(argv[5], &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","drawRel", 7, argv[5] )); } arg7 = static_cast< double >(val7); if (argc > 6) { ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","drawRel", 8, argv[6] )); } arg8 = static_cast< double >(val8); } if (argc > 7) { ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","drawRel", 9, argv[7] )); } arg9 = static_cast< double >(val9); } if (argc > 8) { { if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM) arg10 = Gosu::Color(NUM2ULONG(argv[8])); else { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } } if (argc > 9) { { const char* cstr = Gosu::cstrFromSymbol(argv[9]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg11 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg11 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg11 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg11 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { ((Gosu::Font const *)arg1)->drawRel((std::wstring const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Font_draw_rot(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; std::wstring *arg2 = 0 ; double arg3 ; double arg4 ; Gosu::ZPos arg5 ; double arg6 ; double arg7 = (double) 1 ; double arg8 = (double) 1 ; Gosu::Color arg9 = (Gosu::Color) Gosu::Color::WHITE ; Gosu::AlphaMode arg10 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val7 ; int ecode7 = 0 ; double val8 ; int ecode8 = 0 ; if ((argc < 5) || (argc > 9)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font const *","drawRot", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawRot", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","drawRot", 4, argv[2] )); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Gosu::ZPos","drawRot", 5, argv[3] )); } arg5 = static_cast< Gosu::ZPos >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawRot", 6, argv[4] )); } arg6 = static_cast< double >(val6); if (argc > 5) { ecode7 = SWIG_AsVal_double(argv[5], &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","drawRot", 7, argv[5] )); } arg7 = static_cast< double >(val7); } if (argc > 6) { ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","drawRot", 8, argv[6] )); } arg8 = static_cast< double >(val8); } if (argc > 7) { { if (TYPE(argv[7]) == T_FIXNUM || TYPE(argv[7]) == T_BIGNUM) arg9 = Gosu::Color(NUM2ULONG(argv[7])); else { void* ptr; int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg9 = *reinterpret_cast(ptr); } } } if (argc > 8) { { const char* cstr = Gosu::cstrFromSymbol(argv[8]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg10 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg10 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg10 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg10 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { ((Gosu::Font const *)arg1)->drawRot((std::wstring const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_Font_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_Font_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Font); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_Font(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = 0 ; std::wstring *arg2 = 0 ; unsigned int arg3 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; unsigned int val3 ; int ecode3 = 0 ; const char *classname SWIGUNUSED = "Gosu::Font"; Gosu::Font *result = 0 ; if ((argc < 3) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Font", 1, argv[0] )); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Gosu::Window &","Font", 1, argv[0])); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[1]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","Font", 3, argv[2] )); } arg3 = static_cast< unsigned int >(val3); { try { result = (Gosu::Font *)new_Gosu_Font(*arg1,(std::wstring const &)*arg2,arg3); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN VALUE _wrap_Font_set_image(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; wchar_t arg2 ; VALUE arg3 = (VALUE) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Font *","set_image", 1, self )); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { VALUE rbString = rb_obj_as_string(argv[0]); char* utf8String = StringValueCStr(rbString); std::wstring ucsString = Gosu::utf8ToWstring(utf8String); if (ucsString.length() != 1) rb_raise(rb_eArgError, "A single-character string was expected, but `%s' given", utf8String); arg2 = ucsString[0]; } arg3 = argv[1]; { try { Gosu_Font_set_image(arg1,arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN void free_Gosu_Font(Gosu::Font *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } static swig_class SwigClassGLTexInfo; SWIGINTERN VALUE _wrap_GLTexInfo_tex_name_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","texName", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","texName", 2, argv[0] )); } arg2 = static_cast< int >(val2); if (arg1) (arg1)->texName = arg2; return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_tex_name_get(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","texName", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (int) ((arg1)->texName); vresult = SWIG_From_int(static_cast< int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_left_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; float arg2 ; void *argp1 = 0 ; int res1 = 0 ; float val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","left", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_float(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "float","left", 2, argv[0] )); } arg2 = static_cast< float >(val2); if (arg1) (arg1)->left = arg2; return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_left_get(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; void *argp1 = 0 ; int res1 = 0 ; float result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","left", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (float) ((arg1)->left); vresult = SWIG_From_float(static_cast< float >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_right_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; float arg2 ; void *argp1 = 0 ; int res1 = 0 ; float val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","right", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_float(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "float","right", 2, argv[0] )); } arg2 = static_cast< float >(val2); if (arg1) (arg1)->right = arg2; return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_right_get(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; void *argp1 = 0 ; int res1 = 0 ; float result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","right", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (float) ((arg1)->right); vresult = SWIG_From_float(static_cast< float >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_top_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; float arg2 ; void *argp1 = 0 ; int res1 = 0 ; float val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","top", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_float(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "float","top", 2, argv[0] )); } arg2 = static_cast< float >(val2); if (arg1) (arg1)->top = arg2; return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_top_get(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; void *argp1 = 0 ; int res1 = 0 ; float result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","top", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (float) ((arg1)->top); vresult = SWIG_From_float(static_cast< float >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_bottom_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; float arg2 ; void *argp1 = 0 ; int res1 = 0 ; float val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","bottom", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_float(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "float","bottom", 2, argv[0] )); } arg2 = static_cast< float >(val2); if (arg1) (arg1)->bottom = arg2; return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_bottom_get(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 0 ; void *argp1 = 0 ; int res1 = 0 ; float result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::GLTexInfo *","bottom", 1, self )); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (float) ((arg1)->bottom); vresult = SWIG_From_float(static_cast< float >(result)); return vresult; fail: return Qnil; } #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_GLTexInfo_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_GLTexInfo_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__GLTexInfo); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_GLTexInfo(int argc, VALUE *argv, VALUE self) { const char *classname SWIGUNUSED = "Gosu::GLTexInfo"; Gosu::GLTexInfo *result = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (Gosu::GLTexInfo *)new Gosu::GLTexInfo(); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN void free_Gosu_GLTexInfo(Gosu::GLTexInfo *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } static swig_class SwigClassImage; SWIGINTERN VALUE _wrap_Image_width(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","width", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (unsigned int)((Gosu::Image const *)arg1)->width(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_height(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","height", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (unsigned int)((Gosu::Image const *)arg1)->height(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_draw(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; double arg2 ; double arg3 ; Gosu::ZPos arg4 ; double arg5 = (double) 1 ; double arg6 = (double) 1 ; Gosu::Color arg7 = (Gosu::Color) Gosu::Color::WHITE ; Gosu::AlphaMode arg8 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; if ((argc < 3) || (argc > 7)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","draw", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","draw", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","draw", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Gosu::ZPos","draw", 4, argv[2] )); } arg4 = static_cast< Gosu::ZPos >(val4); if (argc > 3) { ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","draw", 5, argv[3] )); } arg5 = static_cast< double >(val5); } if (argc > 4) { ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","draw", 6, argv[4] )); } arg6 = static_cast< double >(val6); } if (argc > 5) { { if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM) arg7 = Gosu::Color(NUM2ULONG(argv[5])); else { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } } } if (argc > 6) { { const char* cstr = Gosu::cstrFromSymbol(argv[6]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg8 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg8 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg8 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg8 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { ((Gosu::Image const *)arg1)->draw(arg2,arg3,arg4,arg5,arg6,arg7,arg8); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_draw_mod(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; double arg2 ; double arg3 ; Gosu::ZPos arg4 ; double arg5 ; double arg6 ; Gosu::Color arg7 ; Gosu::Color arg8 ; Gosu::Color arg9 ; Gosu::Color arg10 ; Gosu::AlphaMode arg11 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; if ((argc < 9) || (argc > 10)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 9)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","drawMod", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","drawMod", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawMod", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Gosu::ZPos","drawMod", 4, argv[2] )); } arg4 = static_cast< Gosu::ZPos >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","drawMod", 5, argv[3] )); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawMod", 6, argv[4] )); } arg6 = static_cast< double >(val6); { if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM) arg7 = Gosu::Color(NUM2ULONG(argv[5])); else { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } } { if (TYPE(argv[6]) == T_FIXNUM || TYPE(argv[6]) == T_BIGNUM) arg8 = Gosu::Color(NUM2ULONG(argv[6])); else { void* ptr; int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg8 = *reinterpret_cast(ptr); } } { if (TYPE(argv[7]) == T_FIXNUM || TYPE(argv[7]) == T_BIGNUM) arg9 = Gosu::Color(NUM2ULONG(argv[7])); else { void* ptr; int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg9 = *reinterpret_cast(ptr); } } { if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM) arg10 = Gosu::Color(NUM2ULONG(argv[8])); else { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } if (argc > 9) { { const char* cstr = Gosu::cstrFromSymbol(argv[9]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg11 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg11 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg11 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg11 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { ((Gosu::Image const *)arg1)->drawMod(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_draw_rot(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; double arg2 ; double arg3 ; Gosu::ZPos arg4 ; double arg5 ; double arg6 = (double) 0.5 ; double arg7 = (double) 0.5 ; double arg8 = (double) 1 ; double arg9 = (double) 1 ; Gosu::Color arg10 = (Gosu::Color) Gosu::Color::WHITE ; Gosu::AlphaMode arg11 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val7 ; int ecode7 = 0 ; double val8 ; int ecode8 = 0 ; double val9 ; int ecode9 = 0 ; if ((argc < 4) || (argc > 10)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","drawRot", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","drawRot", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawRot", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Gosu::ZPos","drawRot", 4, argv[2] )); } arg4 = static_cast< Gosu::ZPos >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","drawRot", 5, argv[3] )); } arg5 = static_cast< double >(val5); if (argc > 4) { ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawRot", 6, argv[4] )); } arg6 = static_cast< double >(val6); } if (argc > 5) { ecode7 = SWIG_AsVal_double(argv[5], &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","drawRot", 7, argv[5] )); } arg7 = static_cast< double >(val7); } if (argc > 6) { ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","drawRot", 8, argv[6] )); } arg8 = static_cast< double >(val8); } if (argc > 7) { ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","drawRot", 9, argv[7] )); } arg9 = static_cast< double >(val9); } if (argc > 8) { { if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM) arg10 = Gosu::Color(NUM2ULONG(argv[8])); else { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } } if (argc > 9) { { const char* cstr = Gosu::cstrFromSymbol(argv[9]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg11 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg11 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg11 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg11 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { ((Gosu::Image const *)arg1)->drawRot(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_get_data(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Gosu::ImageData *result = 0 ; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","getData", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (Gosu::ImageData *) &((Gosu::Image const *)arg1)->getData(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__ImageData, 0 | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_new_Image__SWIG_0(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = 0 ; VALUE arg2 = (VALUE) 0 ; bool arg3 = (bool) false ; void *argp1 = 0 ; int res1 = 0 ; bool val3 ; int ecode3 = 0 ; const char *classname SWIGUNUSED = "Gosu::Image"; Gosu::Image *result = 0 ; if ((argc < 2) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Image", 1, argv[0] )); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Gosu::Window &","Image", 1, argv[0])); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); arg2 = argv[1]; if (argc > 2) { ecode3 = SWIG_AsVal_bool(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","Image", 3, argv[2] )); } arg3 = static_cast< bool >(val3); } { try { result = (Gosu::Image *)new_Gosu_Image__SWIG_0(*arg1,arg2,arg3); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_Image_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_Image_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Image); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_Image__SWIG_1(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = 0 ; VALUE arg2 = (VALUE) 0 ; bool arg3 ; unsigned int arg4 ; unsigned int arg5 ; unsigned int arg6 ; unsigned int arg7 ; void *argp1 = 0 ; int res1 = 0 ; bool val3 ; int ecode3 = 0 ; unsigned int val4 ; int ecode4 = 0 ; unsigned int val5 ; int ecode5 = 0 ; unsigned int val6 ; int ecode6 = 0 ; unsigned int val7 ; int ecode7 = 0 ; const char *classname SWIGUNUSED = "Gosu::Image"; Gosu::Image *result = 0 ; if ((argc < 7) || (argc > 7)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Image", 1, argv[0] )); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Gosu::Window &","Image", 1, argv[0])); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); arg2 = argv[1]; ecode3 = SWIG_AsVal_bool(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","Image", 3, argv[2] )); } arg3 = static_cast< bool >(val3); ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Image", 4, argv[3] )); } arg4 = static_cast< unsigned int >(val4); ecode5 = SWIG_AsVal_unsigned_SS_int(argv[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","Image", 5, argv[4] )); } arg5 = static_cast< unsigned int >(val5); ecode6 = SWIG_AsVal_unsigned_SS_int(argv[5], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "unsigned int","Image", 6, argv[5] )); } arg6 = static_cast< unsigned int >(val6); ecode7 = SWIG_AsVal_unsigned_SS_int(argv[6], &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "unsigned int","Image", 7, argv[6] )); } arg7 = static_cast< unsigned int >(val7); { try { result = (Gosu::Image *)new_Gosu_Image__SWIG_1(*arg1,arg2,arg3,arg4,arg5,arg6,arg7); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN VALUE _wrap_new_Image(int nargs, VALUE *args, VALUE self) { int argc; VALUE argv[7]; int ii; argc = nargs; if (argc > 7) SWIG_fail; for (ii = 0; (ii < argc); ++ii) { argv[ii] = args[ii]; } if ((argc >= 2) && (argc <= 3)) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0); _v = SWIG_CheckState(res); if (_v) { _v = (argv[1] != 0); if (_v) { if (argc <= 2) { return _wrap_new_Image__SWIG_0(nargs, args, self); } { int res = SWIG_AsVal_bool(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_new_Image__SWIG_0(nargs, args, self); } } } } if (argc == 7) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0); _v = SWIG_CheckState(res); if (_v) { _v = (argv[1] != 0); if (_v) { { int res = SWIG_AsVal_bool(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_int(argv[4], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_int(argv[5], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_int(argv[6], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_new_Image__SWIG_1(nargs, args, self); } } } } } } } } fail: Ruby_Format_OverloadedError( argc, 7, "Image.new", " Image.new(Gosu::Window &window, VALUE source, bool tileable)\n" " Image.new(Gosu::Window &window, VALUE source, bool tileable, unsigned int srcX, unsigned int srcY, unsigned int srcWidth, unsigned int srcHeight)\n"); return Qnil; } SWIGINTERN VALUE _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; double arg2 ; double arg3 ; Gosu::Color arg4 ; double arg5 ; double arg6 ; Gosu::Color arg7 ; double arg8 ; double arg9 ; Gosu::Color arg10 ; double arg11 ; double arg12 ; Gosu::Color arg13 ; Gosu::ZPos arg14 ; Gosu::AlphaMode arg15 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val8 ; int ecode8 = 0 ; double val9 ; int ecode9 = 0 ; double val11 ; int ecode11 = 0 ; double val12 ; int ecode12 = 0 ; double val14 ; int ecode14 = 0 ; if ((argc < 13) || (argc > 14)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 13)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image *","drawAsQuad", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","drawAsQuad", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawAsQuad", 3, argv[1] )); } arg3 = static_cast< double >(val3); { if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM) arg4 = Gosu::Color(NUM2ULONG(argv[2])); else { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg4 = *reinterpret_cast(ptr); } } ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","drawAsQuad", 5, argv[3] )); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawAsQuad", 6, argv[4] )); } arg6 = static_cast< double >(val6); { if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM) arg7 = Gosu::Color(NUM2ULONG(argv[5])); else { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } } ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","drawAsQuad", 8, argv[6] )); } arg8 = static_cast< double >(val8); ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","drawAsQuad", 9, argv[7] )); } arg9 = static_cast< double >(val9); { if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM) arg10 = Gosu::Color(NUM2ULONG(argv[8])); else { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } ecode11 = SWIG_AsVal_double(argv[9], &val11); if (!SWIG_IsOK(ecode11)) { SWIG_exception_fail(SWIG_ArgError(ecode11), Ruby_Format_TypeError( "", "double","drawAsQuad", 11, argv[9] )); } arg11 = static_cast< double >(val11); ecode12 = SWIG_AsVal_double(argv[10], &val12); if (!SWIG_IsOK(ecode12)) { SWIG_exception_fail(SWIG_ArgError(ecode12), Ruby_Format_TypeError( "", "double","drawAsQuad", 12, argv[10] )); } arg12 = static_cast< double >(val12); { if (TYPE(argv[11]) == T_FIXNUM || TYPE(argv[11]) == T_BIGNUM) arg13 = Gosu::Color(NUM2ULONG(argv[11])); else { void* ptr; int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg13 = *reinterpret_cast(ptr); } } ecode14 = SWIG_AsVal_double(argv[12], &val14); if (!SWIG_IsOK(ecode14)) { SWIG_exception_fail(SWIG_ArgError(ecode14), Ruby_Format_TypeError( "", "Gosu::ZPos","drawAsQuad", 14, argv[12] )); } arg14 = static_cast< Gosu::ZPos >(val14); if (argc > 13) { { const char* cstr = Gosu::cstrFromSymbol(argv[13]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg15 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg15 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg15 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg15 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { Gosu_Image_drawAsQuad(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_gl_tex_info(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Gosu::GLTexInfo *result = 0 ; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","glTexInfo", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (Gosu::GLTexInfo *)Gosu_Image_glTexInfo((Gosu::Image const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__GLTexInfo, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_subimage(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; int val5 ; int ecode5 = 0 ; Gosu::Image *result = 0 ; VALUE vresult = Qnil; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image *","subimage", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","subimage", 2, argv[0] )); } arg2 = static_cast< int >(val2); ecode3 = SWIG_AsVal_int(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","subimage", 3, argv[1] )); } arg3 = static_cast< int >(val3); ecode4 = SWIG_AsVal_int(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","subimage", 4, argv[2] )); } arg4 = static_cast< int >(val4); ecode5 = SWIG_AsVal_int(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","subimage", 5, argv[3] )); } arg5 = static_cast< int >(val5); { try { result = (Gosu::Image *)Gosu_Image_subimage(arg1,arg2,arg3,arg4,arg5); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__Image, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_from_text4(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = 0 ; std::wstring *arg2 = 0 ; std::wstring *arg3 = 0 ; unsigned int arg4 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; std::wstring temp3 ; unsigned int val4 ; int ecode4 = 0 ; Gosu::Image *result = 0 ; VALUE vresult = Qnil; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Gosu_Image_fromText4", 1, argv[0] )); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Gosu::Window &","Gosu_Image_fromText4", 1, argv[0])); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[1]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } { VALUE localTemporary = rb_obj_as_string(argv[2]); temp3 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg3 = &temp3; } ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Gosu_Image_fromText4", 4, argv[3] )); } arg4 = static_cast< unsigned int >(val4); { try { result = (Gosu::Image *)Gosu_Image_fromText4(*arg1,(std::wstring const &)*arg2,(std::wstring const &)*arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__Image, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_from_text7(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = 0 ; std::wstring *arg2 = 0 ; std::wstring *arg3 = 0 ; unsigned int arg4 ; int arg5 ; unsigned int arg6 ; Gosu::TextAlign arg7 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; std::wstring temp3 ; unsigned int val4 ; int ecode4 = 0 ; int val5 ; int ecode5 = 0 ; unsigned int val6 ; int ecode6 = 0 ; Gosu::Image *result = 0 ; VALUE vresult = Qnil; if ((argc < 7) || (argc > 7)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Gosu_Image_fromText7", 1, argv[0] )); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Gosu::Window &","Gosu_Image_fromText7", 1, argv[0])); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[1]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } { VALUE localTemporary = rb_obj_as_string(argv[2]); temp3 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg3 = &temp3; } ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Gosu_Image_fromText7", 4, argv[3] )); } arg4 = static_cast< unsigned int >(val4); ecode5 = SWIG_AsVal_int(argv[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","Gosu_Image_fromText7", 5, argv[4] )); } arg5 = static_cast< int >(val5); ecode6 = SWIG_AsVal_unsigned_SS_int(argv[5], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "unsigned int","Gosu_Image_fromText7", 6, argv[5] )); } arg6 = static_cast< unsigned int >(val6); { const char* cstr = Gosu::cstrFromSymbol(argv[6]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "text align must be a symbol"); else if (!strcmp(cstr, "left")) arg7 = Gosu::taLeft; else if (!strcmp(cstr, "center")) arg7 = Gosu::taCenter; else if (!strcmp(cstr, "right")) arg7 = Gosu::taRight; else if (!strcmp(cstr, "justify")) arg7 = Gosu::taJustify; else SWIG_exception_fail(SWIG_ValueError, "invalid text align"); } { try { result = (Gosu::Image *)Gosu_Image_fromText7(*arg1,(std::wstring const &)*arg2,(std::wstring const &)*arg3,arg4,arg5,arg6,arg7); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__Image, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_load_tiles(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = 0 ; VALUE arg2 = (VALUE) 0 ; int arg3 ; int arg4 ; bool arg5 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; bool val5 ; int ecode5 = 0 ; SwigValueWrapper< std::vector< Gosu::Image * > > result; VALUE vresult = Qnil; if ((argc < 5) || (argc > 5)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Gosu_Image_loadTiles", 1, argv[0] )); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Gosu::Window &","Gosu_Image_loadTiles", 1, argv[0])); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); arg2 = argv[1]; ecode3 = SWIG_AsVal_int(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Gosu_Image_loadTiles", 3, argv[2] )); } arg3 = static_cast< int >(val3); ecode4 = SWIG_AsVal_int(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Gosu_Image_loadTiles", 4, argv[3] )); } arg4 = static_cast< int >(val4); ecode5 = SWIG_AsVal_bool(argv[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "bool","Gosu_Image_loadTiles", 5, argv[4] )); } arg5 = static_cast< bool >(val5); { try { result = Gosu_Image_loadTiles(*arg1,arg2,arg3,arg4,arg5); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_ary_new2((&result)->size()); for (unsigned i = 0; i < (&result)->size(); i++) { VALUE curImg = SWIG_NewPointerObj(SWIG_as_voidptr((*&result)[i]), SWIGTYPE_p_Gosu__Image, SWIG_POINTER_OWN); rb_ary_store(vresult, i, curImg); } } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_to_blob(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::string result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","toBlob", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = Gosu_Image_toBlob((Gosu::Image const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_std_string(static_cast< std::string >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_columns(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","columns", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (unsigned int)Gosu_Image_columns((Gosu::Image const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_rows(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","rows", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (unsigned int)Gosu_Image_rows((Gosu::Image const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Image_save(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; std::wstring *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image const *","save", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } { try { Gosu_Image_save((Gosu::Image const *)arg1,(std::wstring const &)*arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } /* Document-method: Gosu::Image.insert call-seq: insert(source, x, y) Insert one or more new elements in the Image. */ SWIGINTERN VALUE _wrap_Image_insert(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; VALUE arg2 = (VALUE) 0 ; int arg3 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; if ((argc < 3) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Image, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Image *","insert", 1, self )); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); arg2 = argv[0]; ecode3 = SWIG_AsVal_int(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","insert", 3, argv[1] )); } arg3 = static_cast< int >(val3); ecode4 = SWIG_AsVal_int(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","insert", 4, argv[2] )); } arg4 = static_cast< int >(val4); { try { Gosu_Image_insert(arg1,arg2,arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN void free_Gosu_Image(Gosu::Image *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_fps(int argc, VALUE *argv, VALUE self) { int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (int)Gosu::fps(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_int(static_cast< int >(result)); return vresult; fail: return Qnil; } static swig_class SwigClassSampleInstance; #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_SampleInstance_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_SampleInstance_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__SampleInstance); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_SampleInstance(int argc, VALUE *argv, VALUE self) { int arg1 ; int arg2 ; int val1 ; int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; const char *classname SWIGUNUSED = "Gosu::SampleInstance"; Gosu::SampleInstance *result = 0 ; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","SampleInstance", 1, argv[0] )); } arg1 = static_cast< int >(val1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SampleInstance", 2, argv[1] )); } arg2 = static_cast< int >(val2); { try { result = (Gosu::SampleInstance *)new Gosu::SampleInstance(arg1,arg2); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_playingq___(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; void *argp1 = 0 ; int res1 = 0 ; bool result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance const *","playing", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); { try { result = (bool)((Gosu::SampleInstance const *)arg1)->playing(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_pausedq___(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; void *argp1 = 0 ; int res1 = 0 ; bool result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance const *","paused", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); { try { result = (bool)((Gosu::SampleInstance const *)arg1)->paused(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_pause(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance *","pause", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); { try { (arg1)->pause(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_resume(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance *","resume", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); { try { (arg1)->resume(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_stop(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance *","stop", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); { try { (arg1)->stop(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_volumee___(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance *","changeVolume", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","changeVolume", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { (arg1)->changeVolume(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_pane___(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance *","changePan", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","changePan", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { (arg1)->changePan(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_SampleInstance_speede___(int argc, VALUE *argv, VALUE self) { Gosu::SampleInstance *arg1 = (Gosu::SampleInstance *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::SampleInstance *","changeSpeed", 1, self )); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","changeSpeed", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { (arg1)->changeSpeed(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN void free_Gosu_SampleInstance(Gosu::SampleInstance *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } static swig_class SwigClassSample; #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_Sample_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_Sample_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Sample); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_Sample(int argc, VALUE *argv, VALUE self) { std::wstring *arg1 = 0 ; std::wstring temp1 ; const char *classname SWIGUNUSED = "Gosu::Sample"; Gosu::Sample *result = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } { VALUE localTemporary = rb_obj_as_string(argv[0]); temp1 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg1 = &temp1; } { try { result = (Gosu::Sample *)new Gosu::Sample((std::wstring const &)*arg1); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN VALUE _wrap_Sample_play(int argc, VALUE *argv, VALUE self) { Gosu::Sample *arg1 = (Gosu::Sample *) 0 ; double arg2 = (double) 1 ; double arg3 = (double) 1 ; bool arg4 = (bool) false ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; bool val4 ; int ecode4 = 0 ; SwigValueWrapper< Gosu::SampleInstance > result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Sample, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Sample const *","play", 1, self )); } arg1 = reinterpret_cast< Gosu::Sample * >(argp1); if (argc > 0) { ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","play", 2, argv[0] )); } arg2 = static_cast< double >(val2); } if (argc > 1) { ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","play", 3, argv[1] )); } arg3 = static_cast< double >(val3); } if (argc > 2) { ecode4 = SWIG_AsVal_bool(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","play", 4, argv[2] )); } arg4 = static_cast< bool >(val4); } { try { result = ((Gosu::Sample const *)arg1)->play(arg2,arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::SampleInstance(static_cast< const Gosu::SampleInstance& >(result))), SWIGTYPE_p_Gosu__SampleInstance, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Sample_play_pan(int argc, VALUE *argv, VALUE self) { Gosu::Sample *arg1 = (Gosu::Sample *) 0 ; double arg2 ; double arg3 = (double) 1 ; double arg4 = (double) 1 ; bool arg5 = (bool) false ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; bool val5 ; int ecode5 = 0 ; SwigValueWrapper< Gosu::SampleInstance > result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Sample, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Sample const *","playPan", 1, self )); } arg1 = reinterpret_cast< Gosu::Sample * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","playPan", 2, argv[0] )); } arg2 = static_cast< double >(val2); if (argc > 1) { ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","playPan", 3, argv[1] )); } arg3 = static_cast< double >(val3); } if (argc > 2) { ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","playPan", 4, argv[2] )); } arg4 = static_cast< double >(val4); } if (argc > 3) { ecode5 = SWIG_AsVal_bool(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "bool","playPan", 5, argv[3] )); } arg5 = static_cast< bool >(val5); } { try { result = ((Gosu::Sample const *)arg1)->playPan(arg2,arg3,arg4,arg5); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj((new Gosu::SampleInstance(static_cast< const Gosu::SampleInstance& >(result))), SWIGTYPE_p_Gosu__SampleInstance, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN void free_Gosu_Sample(Gosu::Sample *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } static swig_class SwigClassSong; #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_Song_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_Song_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Song); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_Song(int argc, VALUE *argv, VALUE self) { std::wstring *arg1 = 0 ; std::wstring temp1 ; const char *classname SWIGUNUSED = "Gosu::Song"; Gosu::Song *result = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } { VALUE localTemporary = rb_obj_as_string(argv[0]); temp1 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg1 = &temp1; } { try { result = (Gosu::Song *)new Gosu::Song((std::wstring const &)*arg1); DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN void free_Gosu_Song(Gosu::Song *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_Song_current_song(int argc, VALUE *argv, VALUE self) { Gosu::Song *result = 0 ; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (Gosu::Song *)Gosu::Song::currentSong(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__Song, 0 | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_play(int argc, VALUE *argv, VALUE self) { Gosu::Song *arg1 = (Gosu::Song *) 0 ; bool arg2 = (bool) false ; void *argp1 = 0 ; int res1 = 0 ; bool val2 ; int ecode2 = 0 ; if ((argc < 0) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Song *","play", 1, self )); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); if (argc > 0) { ecode2 = SWIG_AsVal_bool(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","play", 2, argv[0] )); } arg2 = static_cast< bool >(val2); } { try { (arg1)->play(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_pause(int argc, VALUE *argv, VALUE self) { Gosu::Song *arg1 = (Gosu::Song *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Song *","pause", 1, self )); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { (arg1)->pause(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_pausedq___(int argc, VALUE *argv, VALUE self) { Gosu::Song *arg1 = (Gosu::Song *) 0 ; void *argp1 = 0 ; int res1 = 0 ; bool result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Song const *","paused", 1, self )); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { result = (bool)((Gosu::Song const *)arg1)->paused(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_stop(int argc, VALUE *argv, VALUE self) { Gosu::Song *arg1 = (Gosu::Song *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Song *","stop", 1, self )); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { (arg1)->stop(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_playingq___(int argc, VALUE *argv, VALUE self) { Gosu::Song *arg1 = (Gosu::Song *) 0 ; void *argp1 = 0 ; int res1 = 0 ; bool result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Song const *","playing", 1, self )); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { result = (bool)((Gosu::Song const *)arg1)->playing(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_volume(int argc, VALUE *argv, VALUE self) { Gosu::Song *arg1 = (Gosu::Song *) 0 ; void *argp1 = 0 ; int res1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Song const *","volume", 1, self )); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { result = (double)((Gosu::Song const *)arg1)->volume(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_volumee___(int argc, VALUE *argv, VALUE self) { Gosu::Song *arg1 = (Gosu::Song *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Song *","changeVolume", 1, self )); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","changeVolume", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { (arg1)->changeVolume(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Song_update(int argc, VALUE *argv, VALUE self) { if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { Gosu::Song::update(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } static swig_class SwigClassTextInput; #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_TextInput_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_TextInput_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__TextInput); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_TextInput(int argc, VALUE *argv, VALUE self) { VALUE arg1 = (VALUE) 0 ; const char *classname SWIGUNUSED = "Gosu::TextInput"; Gosu::TextInput *result = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } arg1 = self; { try { if ( strcmp(rb_obj_classname(self), classname) != 0 ) { /* subclassed */ result = (Gosu::TextInput *)new SwigDirector_TextInput(arg1); } else { result = (Gosu::TextInput *)new Gosu::TextInput(); } DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN void free_Gosu_TextInput(Gosu::TextInput *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_TextInput_text(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput const *","text", 1, self )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { try { result = ((Gosu::TextInput const *)arg1)->text(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); FIX_ENCODING(vresult); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_TextInput_texte___(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; std::wstring *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput *","setText", 1, self )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } { try { (arg1)->setText((std::wstring const &)*arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_TextInput_caret_pose___(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; unsigned int arg2 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput *","setCaretPos", 1, self )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setCaretPos", 2, argv[0] )); } arg2 = static_cast< unsigned int >(val2); { try { (arg1)->setCaretPos(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_TextInput_selection_starte___(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; unsigned int arg2 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput *","setSelectionStart", 1, self )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setSelectionStart", 2, argv[0] )); } arg2 = static_cast< unsigned int >(val2); { try { (arg1)->setSelectionStart(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_TextInput_filter(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; std::wstring *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; Swig::Director *director = 0; bool upcall = false; std::wstring result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput const *","filter", 1, self )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { result = ((Gosu::TextInput const *)arg1)->Gosu::TextInput::filter((std::wstring const &)*arg2); } else { result = ((Gosu::TextInput const *)arg1)->filter((std::wstring const &)*arg2); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); FIX_ENCODING(vresult); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_TextInput_caret_pos(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput const *","caret_pos", 1, self )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { try { result = (unsigned int)Gosu_TextInput_caret_pos((Gosu::TextInput const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_TextInput_selection_start(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput const *","selection_start", 1, self )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { try { result = (unsigned int)Gosu_TextInput_selection_start((Gosu::TextInput const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_disown_TextInput(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::TextInput *","disown_TextInput", 1, argv[0] )); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { Swig::Director *director = SWIG_DIRECTOR_CAST(arg1); if (director) director->swig_disown(); } return Qnil; fail: return Qnil; } static swig_class SwigClassWindow; #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_Window_allocate(VALUE self) { #else SWIGINTERN VALUE _wrap_Window_allocate(int argc, VALUE *argv, VALUE self) { #endif VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Window); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC rb_obj_call_init(vresult, argc, argv); #endif return vresult; } SWIGINTERN VALUE _wrap_new_Window(int argc, VALUE *argv, VALUE self) { VALUE arg1 = (VALUE) 0 ; unsigned int arg2 ; unsigned int arg3 ; bool arg4 ; double arg5 = (double) 16.666666 ; unsigned int val2 ; int ecode2 = 0 ; unsigned int val3 ; int ecode3 = 0 ; bool val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; const char *classname SWIGUNUSED = "Gosu::Window"; Gosu::Window *result = 0 ; if ((argc < 3) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } arg1 = self; ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Window", 2, argv[0] )); } arg2 = static_cast< unsigned int >(val2); ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","Window", 3, argv[1] )); } arg3 = static_cast< unsigned int >(val3); ecode4 = SWIG_AsVal_bool(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","Window", 4, argv[2] )); } arg4 = static_cast< bool >(val4); if (argc > 3) { ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","Window", 5, argv[3] )); } arg5 = static_cast< double >(val5); } { try { if ( strcmp(rb_obj_classname(self), classname) != 0 ) { /* subclassed */ result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5); } else { result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5); } DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } SWIGINTERN void free_Gosu_Window(Gosu::Window *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_Window_caption(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","caption", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = ((Gosu::Window const *)arg1)->caption(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); FIX_ENCODING(vresult); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_captione___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; std::wstring *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","setCaption", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); temp2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = &temp2; } { try { (arg1)->setCaption((std::wstring const &)*arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_update_interval(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","updateInterval", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (double)((Gosu::Window const *)arg1)->updateInterval(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_show(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","show", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { (arg1)->show(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_close(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","close", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { (arg1)->close(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_update(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","update", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { (arg1)->Gosu::Window::update(); } else { (arg1)->update(); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_draw(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","draw", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { (arg1)->Gosu::Window::draw(); } else { (arg1)->draw(); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_needs_redrawq___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; bool result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","needsRedraw", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { result = (bool)((Gosu::Window const *)arg1)->Gosu::Window::needsRedraw(); } else { result = (bool)((Gosu::Window const *)arg1)->needsRedraw(); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_needs_cursorq___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; bool result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","needsCursor", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { result = (bool)((Gosu::Window const *)arg1)->Gosu::Window::needsCursor(); } else { result = (bool)((Gosu::Window const *)arg1)->needsCursor(); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_lose_focus(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","loseFocus", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { (arg1)->Gosu::Window::loseFocus(); } else { (arg1)->loseFocus(); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_release_memory(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","releaseMemory", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { (arg1)->Gosu::Window::releaseMemory(); } else { (arg1)->releaseMemory(); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_button_down(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; Gosu::Button arg2 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","buttonDown", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { if (NIL_P(argv[0])) arg2 = Gosu::noButton; else arg2 = Gosu::Button(NUM2LONG(argv[0])); } director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { (arg1)->Gosu::Window::buttonDown(arg2); } else { (arg1)->buttonDown(arg2); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_button_up(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; Gosu::Button arg2 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; bool upcall = false; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","buttonUp", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { if (NIL_P(argv[0])) arg2 = Gosu::noButton; else arg2 = Gosu::Button(NUM2LONG(argv[0])); } director = dynamic_cast(arg1); upcall = (director && (director->swig_get_self() == self)); try { { try { if (upcall) { (arg1)->Gosu::Window::buttonUp(arg2); } else { (arg1)->buttonUp(arg2); } } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } } catch (Swig::DirectorException& e) { rb_exc_raise(e.getError()); SWIG_fail; } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_draw_line(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; Gosu::Color arg4 ; double arg5 ; double arg6 ; Gosu::Color arg7 ; Gosu::ZPos arg8 = (Gosu::ZPos) 0 ; Gosu::AlphaMode arg9 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val8 ; int ecode8 = 0 ; if ((argc < 6) || (argc > 8)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","drawLine", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","drawLine", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawLine", 3, argv[1] )); } arg3 = static_cast< double >(val3); { if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM) arg4 = Gosu::Color(NUM2ULONG(argv[2])); else { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg4 = *reinterpret_cast(ptr); } } ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","drawLine", 5, argv[3] )); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawLine", 6, argv[4] )); } arg6 = static_cast< double >(val6); { if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM) arg7 = Gosu::Color(NUM2ULONG(argv[5])); else { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } } if (argc > 6) { ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "Gosu::ZPos","drawLine", 8, argv[6] )); } arg8 = static_cast< Gosu::ZPos >(val8); } if (argc > 7) { { const char* cstr = Gosu::cstrFromSymbol(argv[7]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg9 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg9 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg9 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg9 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { Gosu_Window_drawLine(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_draw_triangle(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; Gosu::Color arg4 ; double arg5 ; double arg6 ; Gosu::Color arg7 ; double arg8 ; double arg9 ; Gosu::Color arg10 ; Gosu::ZPos arg11 = (Gosu::ZPos) 0 ; Gosu::AlphaMode arg12 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val8 ; int ecode8 = 0 ; double val9 ; int ecode9 = 0 ; double val11 ; int ecode11 = 0 ; if ((argc < 9) || (argc > 11)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 9)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","drawTriangle", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","drawTriangle", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawTriangle", 3, argv[1] )); } arg3 = static_cast< double >(val3); { if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM) arg4 = Gosu::Color(NUM2ULONG(argv[2])); else { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg4 = *reinterpret_cast(ptr); } } ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","drawTriangle", 5, argv[3] )); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawTriangle", 6, argv[4] )); } arg6 = static_cast< double >(val6); { if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM) arg7 = Gosu::Color(NUM2ULONG(argv[5])); else { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } } ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","drawTriangle", 8, argv[6] )); } arg8 = static_cast< double >(val8); ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","drawTriangle", 9, argv[7] )); } arg9 = static_cast< double >(val9); { if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM) arg10 = Gosu::Color(NUM2ULONG(argv[8])); else { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } if (argc > 9) { ecode11 = SWIG_AsVal_double(argv[9], &val11); if (!SWIG_IsOK(ecode11)) { SWIG_exception_fail(SWIG_ArgError(ecode11), Ruby_Format_TypeError( "", "Gosu::ZPos","drawTriangle", 11, argv[9] )); } arg11 = static_cast< Gosu::ZPos >(val11); } if (argc > 10) { { const char* cstr = Gosu::cstrFromSymbol(argv[10]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg12 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg12 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg12 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg12 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { Gosu_Window_drawTriangle(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_draw_quad(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; Gosu::Color arg4 ; double arg5 ; double arg6 ; Gosu::Color arg7 ; double arg8 ; double arg9 ; Gosu::Color arg10 ; double arg11 ; double arg12 ; Gosu::Color arg13 ; Gosu::ZPos arg14 = (Gosu::ZPos) 0 ; Gosu::AlphaMode arg15 = (Gosu::AlphaMode) Gosu::amDefault ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val8 ; int ecode8 = 0 ; double val9 ; int ecode9 = 0 ; double val11 ; int ecode11 = 0 ; double val12 ; int ecode12 = 0 ; double val14 ; int ecode14 = 0 ; if ((argc < 12) || (argc > 14)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 12)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","drawQuad", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","drawQuad", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","drawQuad", 3, argv[1] )); } arg3 = static_cast< double >(val3); { if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM) arg4 = Gosu::Color(NUM2ULONG(argv[2])); else { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg4 = *reinterpret_cast(ptr); } } ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","drawQuad", 5, argv[3] )); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","drawQuad", 6, argv[4] )); } arg6 = static_cast< double >(val6); { if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM) arg7 = Gosu::Color(NUM2ULONG(argv[5])); else { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } } ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","drawQuad", 8, argv[6] )); } arg8 = static_cast< double >(val8); ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","drawQuad", 9, argv[7] )); } arg9 = static_cast< double >(val9); { if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM) arg10 = Gosu::Color(NUM2ULONG(argv[8])); else { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } ecode11 = SWIG_AsVal_double(argv[9], &val11); if (!SWIG_IsOK(ecode11)) { SWIG_exception_fail(SWIG_ArgError(ecode11), Ruby_Format_TypeError( "", "double","drawQuad", 11, argv[9] )); } arg11 = static_cast< double >(val11); ecode12 = SWIG_AsVal_double(argv[10], &val12); if (!SWIG_IsOK(ecode12)) { SWIG_exception_fail(SWIG_ArgError(ecode12), Ruby_Format_TypeError( "", "double","drawQuad", 12, argv[10] )); } arg12 = static_cast< double >(val12); { if (TYPE(argv[11]) == T_FIXNUM || TYPE(argv[11]) == T_BIGNUM) arg13 = Gosu::Color(NUM2ULONG(argv[11])); else { void* ptr; int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) SWIG_exception_fail(SWIG_ValueError, "invalid value"); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg13 = *reinterpret_cast(ptr); } } if (argc > 12) { ecode14 = SWIG_AsVal_double(argv[12], &val14); if (!SWIG_IsOK(ecode14)) { SWIG_exception_fail(SWIG_ArgError(ecode14), Ruby_Format_TypeError( "", "Gosu::ZPos","drawQuad", 14, argv[12] )); } arg14 = static_cast< Gosu::ZPos >(val14); } if (argc > 13) { { const char* cstr = Gosu::cstrFromSymbol(argv[13]); if (!cstr) SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol"); else if (!strcmp(cstr, "default")) arg15 = Gosu::amDefault; else if (!strcmp(cstr, "add")) arg15 = Gosu::amAdditive; else if (!strcmp(cstr, "additive")) arg15 = Gosu::amAdditive; else if (!strcmp(cstr, "multiply")) arg15 = Gosu::amMultiply; else SWIG_exception_fail(SWIG_ValueError, "invalid alpha mode"); } } { try { Gosu_Window_drawQuad(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_flush(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","flush", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { Gosu_Window_flush(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_button_downq___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; Gosu::Button arg2 ; void *argp1 = 0 ; int res1 = 0 ; bool result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","isButtonDown", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { if (NIL_P(argv[0])) arg2 = Gosu::noButton; else arg2 = Gosu::Button(NUM2LONG(argv[0])); } { try { result = (bool)Gosu_Window_isButtonDown((Gosu::Window const *)arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_char_to_button_id(int argc, VALUE *argv, VALUE self) { wchar_t arg1 ; Gosu::Button result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } { VALUE rbString = rb_obj_as_string(argv[0]); char* utf8String = StringValueCStr(rbString); std::wstring ucsString = Gosu::utf8ToWstring(utf8String); if (ucsString.length() != 1) rb_raise(rb_eArgError, "A single-character string was expected, but `%s' given", utf8String); arg1 = ucsString[0]; } { try { result = Gosu_Window_charToButtonId(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { if (result == Gosu::noButton) vresult = Qnil; else vresult = LONG2NUM((&result)->id()); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_button_id_to_char(int argc, VALUE *argv, VALUE self) { Gosu::Button arg1 ; wchar_t result; VALUE vresult = Qnil; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } { if (NIL_P(argv[0])) arg1 = Gosu::noButton; else arg1 = Gosu::Button(NUM2LONG(argv[0])); } { try { result = (wchar_t)Gosu_Window_buttonIdToChar(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { if (result == 0) vresult = Qnil; else { vresult = rb_str_new2(Gosu::wstringToUTF8(std::wstring(1, result)).c_str()); FIX_ENCODING(vresult); } } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_text_input(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Swig::Director *director = 0; Gosu::TextInput *result = 0 ; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","textInput", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (Gosu::TextInput *)Gosu_Window_textInput((Gosu::Window const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } director = dynamic_cast(result); if (director) { vresult = director->swig_get_self(); } else { vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_text_inpute___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; Gosu::TextInput *arg2 = (Gosu::TextInput *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","setTextInput", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Gosu__TextInput, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Gosu::TextInput *","setTextInput", 2, argv[0] )); } arg2 = reinterpret_cast< Gosu::TextInput * >(argp2); { try { Gosu_Window_setTextInput(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_mouse_x(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","mouseX", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (double)Gosu_Window_mouseX((Gosu::Window const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_mouse_y(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; double result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","mouseY", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (double)Gosu_Window_mouseY((Gosu::Window const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_set_mouse_position(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","setMousePosition", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","setMousePosition", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","setMousePosition", 3, argv[1] )); } arg3 = static_cast< double >(val3); { try { Gosu_Window_setMousePosition(arg1,arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_mouse_xe___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","setMouseX", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","setMouseX", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { Gosu_Window_setMouseX(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_mouse_ye___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","setMouseY", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","setMouseY", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { Gosu_Window_setMouseY(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_width(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","width", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (int)Gosu_Window_width((Gosu::Window const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_int(static_cast< int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_height(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","height", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (int)Gosu_Window_height((Gosu::Window const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_int(static_cast< int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_fullscreenq___(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; bool result; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","fullscreen", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (bool)Gosu_Window_fullscreen((Gosu::Window const *)arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_unsafe_gl__SWIG_0(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","unsafe_gl", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { Gosu_Window_unsafe_gl__SWIG_0(arg1); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_unsafe_gl__SWIG_1(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; Gosu::ZPos arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","unsafe_gl", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Gosu::ZPos","unsafe_gl", 2, argv[0] )); } arg2 = static_cast< Gosu::ZPos >(val2); { try { Gosu_Window_unsafe_gl__SWIG_1(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_unsafe_gl(int nargs, VALUE *args, VALUE self) { int argc; VALUE argv[3]; int ii; argc = nargs + 1; argv[0] = self; if (argc > 3) SWIG_fail; for (ii = 1; (ii < argc); ++ii) { argv[ii] = args[ii-1]; } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_Window_unsafe_gl__SWIG_0(nargs, args, self); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_double(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_Window_unsafe_gl__SWIG_1(nargs, args, self); } } } fail: Ruby_Format_OverloadedError( argc, 3, "unsafe_gl", " void unsafe_gl()\n" " void unsafe_gl(Gosu::ZPos z)\n"); return Qnil; } SWIGINTERN VALUE _wrap_Window_clip_to(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; double arg4 ; double arg5 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","clipTo", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","clipTo", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","clipTo", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","clipTo", 4, argv[2] )); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","clipTo", 5, argv[3] )); } arg5 = static_cast< double >(val5); { try { Gosu_Window_clipTo(arg1,arg2,arg3,arg4,arg5); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_record(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; int arg2 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; Gosu::Image *result = 0 ; VALUE vresult = Qnil; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","record", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","record", 2, argv[0] )); } arg2 = static_cast< int >(val2); ecode3 = SWIG_AsVal_int(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","record", 3, argv[1] )); } arg3 = static_cast< int >(val3); { try { result = (Gosu::Image *)Gosu_Window_record(arg1,arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Gosu__Image, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_transform(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; double arg4 ; double arg5 ; double arg6 ; double arg7 ; double arg8 ; double arg9 ; double arg10 ; double arg11 ; double arg12 ; double arg13 ; double arg14 ; double arg15 ; double arg16 ; double arg17 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; double val6 ; int ecode6 = 0 ; double val7 ; int ecode7 = 0 ; double val8 ; int ecode8 = 0 ; double val9 ; int ecode9 = 0 ; double val10 ; int ecode10 = 0 ; double val11 ; int ecode11 = 0 ; double val12 ; int ecode12 = 0 ; double val13 ; int ecode13 = 0 ; double val14 ; int ecode14 = 0 ; double val15 ; int ecode15 = 0 ; double val16 ; int ecode16 = 0 ; double val17 ; int ecode17 = 0 ; if ((argc < 16) || (argc > 16)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 16)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","transform", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","transform", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","transform", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","transform", 4, argv[2] )); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","transform", 5, argv[3] )); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","transform", 6, argv[4] )); } arg6 = static_cast< double >(val6); ecode7 = SWIG_AsVal_double(argv[5], &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","transform", 7, argv[5] )); } arg7 = static_cast< double >(val7); ecode8 = SWIG_AsVal_double(argv[6], &val8); if (!SWIG_IsOK(ecode8)) { SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","transform", 8, argv[6] )); } arg8 = static_cast< double >(val8); ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","transform", 9, argv[7] )); } arg9 = static_cast< double >(val9); ecode10 = SWIG_AsVal_double(argv[8], &val10); if (!SWIG_IsOK(ecode10)) { SWIG_exception_fail(SWIG_ArgError(ecode10), Ruby_Format_TypeError( "", "double","transform", 10, argv[8] )); } arg10 = static_cast< double >(val10); ecode11 = SWIG_AsVal_double(argv[9], &val11); if (!SWIG_IsOK(ecode11)) { SWIG_exception_fail(SWIG_ArgError(ecode11), Ruby_Format_TypeError( "", "double","transform", 11, argv[9] )); } arg11 = static_cast< double >(val11); ecode12 = SWIG_AsVal_double(argv[10], &val12); if (!SWIG_IsOK(ecode12)) { SWIG_exception_fail(SWIG_ArgError(ecode12), Ruby_Format_TypeError( "", "double","transform", 12, argv[10] )); } arg12 = static_cast< double >(val12); ecode13 = SWIG_AsVal_double(argv[11], &val13); if (!SWIG_IsOK(ecode13)) { SWIG_exception_fail(SWIG_ArgError(ecode13), Ruby_Format_TypeError( "", "double","transform", 13, argv[11] )); } arg13 = static_cast< double >(val13); ecode14 = SWIG_AsVal_double(argv[12], &val14); if (!SWIG_IsOK(ecode14)) { SWIG_exception_fail(SWIG_ArgError(ecode14), Ruby_Format_TypeError( "", "double","transform", 14, argv[12] )); } arg14 = static_cast< double >(val14); ecode15 = SWIG_AsVal_double(argv[13], &val15); if (!SWIG_IsOK(ecode15)) { SWIG_exception_fail(SWIG_ArgError(ecode15), Ruby_Format_TypeError( "", "double","transform", 15, argv[13] )); } arg15 = static_cast< double >(val15); ecode16 = SWIG_AsVal_double(argv[14], &val16); if (!SWIG_IsOK(ecode16)) { SWIG_exception_fail(SWIG_ArgError(ecode16), Ruby_Format_TypeError( "", "double","transform", 16, argv[14] )); } arg16 = static_cast< double >(val16); ecode17 = SWIG_AsVal_double(argv[15], &val17); if (!SWIG_IsOK(ecode17)) { SWIG_exception_fail(SWIG_ArgError(ecode17), Ruby_Format_TypeError( "", "double","transform", 17, argv[15] )); } arg17 = static_cast< double >(val17); { try { Gosu_Window_transform(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_rotate(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 = (double) 0 ; double arg4 = (double) 0 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; if ((argc < 1) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","rotate", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","rotate", 2, argv[0] )); } arg2 = static_cast< double >(val2); if (argc > 1) { ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","rotate", 3, argv[1] )); } arg3 = static_cast< double >(val3); } if (argc > 2) { ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","rotate", 4, argv[2] )); } arg4 = static_cast< double >(val4); } { try { Gosu_Window_rotate(arg1,arg2,arg3,arg4); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_scale__SWIG_0(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","scale", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","scale", 2, argv[0] )); } arg2 = static_cast< double >(val2); { try { Gosu_Window_scale__SWIG_0(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_scale__SWIG_1(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","scale", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","scale", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","scale", 3, argv[1] )); } arg3 = static_cast< double >(val3); { try { Gosu_Window_scale__SWIG_1(arg1,arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_scale__SWIG_2(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; double arg4 ; double arg5 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; double val5 ; int ecode5 = 0 ; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","scale", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","scale", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","scale", 3, argv[1] )); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","scale", 4, argv[2] )); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","scale", 5, argv[3] )); } arg5 = static_cast< double >(val5); { try { Gosu_Window_scale__SWIG_2(arg1,arg2,arg3,arg4,arg5); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_scale(int nargs, VALUE *args, VALUE self) { int argc; VALUE argv[6]; int ii; argc = nargs + 1; argv[0] = self; if (argc > 6) SWIG_fail; for (ii = 1; (ii < argc); ++ii) { argv[ii] = args[ii-1]; } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_double(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_Window_scale__SWIG_0(nargs, args, self); } } } if (argc == 3) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_double(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_double(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_Window_scale__SWIG_1(nargs, args, self); } } } } if (argc == 5) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_double(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_double(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_double(argv[3], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_double(argv[4], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_Window_scale__SWIG_2(nargs, args, self); } } } } } } fail: Ruby_Format_OverloadedError( argc, 6, "scale", " void scale(double factor)\n" " void scale(double factorX, double factorY)\n" " void scale(double factorX, double factorY, double aroundX, double aroundY)\n"); return Qnil; } SWIGINTERN VALUE _wrap_Window_translate(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; double arg2 ; double arg3 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","translate", 1, self )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","translate", 2, argv[0] )); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","translate", 3, argv[1] )); } arg3 = static_cast< double >(val3); { try { Gosu_Window_translate(arg1,arg2,arg3); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_disown_Window(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; void *argp1 = 0 ; int res1 = 0 ; if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window *","disown_Window", 1, argv[0] )); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { Swig::Director *director = SWIG_DIRECTOR_CAST(arg1); if (director) director->swig_disown(); } return Qnil; fail: return Qnil; } /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_Channel = {"_p_Channel", "Channel *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__Button = {"_p_Gosu__Button", "Gosu::Button *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__Color = {"_p_Gosu__Color", "Gosu::Color *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__Font = {"_p_Gosu__Font", "Gosu::Font *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__GLTexInfo = {"_p_Gosu__GLTexInfo", "Gosu::GLTexInfo *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__Image = {"_p_Gosu__Image", "Gosu::Image *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__ImageData = {"_p_Gosu__ImageData", "Gosu::ImageData *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__Sample = {"_p_Gosu__Sample", "Gosu::Sample *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__SampleInstance = {"_p_Gosu__SampleInstance", "Gosu::SampleInstance *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__Song = {"_p_Gosu__Song", "Gosu::Song *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__TextInput = {"_p_Gosu__TextInput", "Gosu::TextInput *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Gosu__Window = {"_p_Gosu__Window", "Gosu::Window *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "Gosu::ZPos *|double *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__tr1__arrayT_double_16_t = {"_p_std__tr1__arrayT_double_16_t", "std::tr1::array< double,16 > *|Gosu::Transform *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__wstring = {"_p_std__wstring", "std::wstring *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_Channel, &_swigt__p_Gosu__Button, &_swigt__p_Gosu__Color, &_swigt__p_Gosu__Font, &_swigt__p_Gosu__GLTexInfo, &_swigt__p_Gosu__Image, &_swigt__p_Gosu__ImageData, &_swigt__p_Gosu__Sample, &_swigt__p_Gosu__SampleInstance, &_swigt__p_Gosu__Song, &_swigt__p_Gosu__TextInput, &_swigt__p_Gosu__Window, &_swigt__p_char, &_swigt__p_double, &_swigt__p_std__tr1__arrayT_double_16_t, &_swigt__p_std__wstring, }; static swig_cast_info _swigc__p_Channel[] = { {&_swigt__p_Channel, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__Button[] = { {&_swigt__p_Gosu__Button, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__Color[] = { {&_swigt__p_Gosu__Color, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__Font[] = { {&_swigt__p_Gosu__Font, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__GLTexInfo[] = { {&_swigt__p_Gosu__GLTexInfo, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__Image[] = { {&_swigt__p_Gosu__Image, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__ImageData[] = { {&_swigt__p_Gosu__ImageData, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__Sample[] = { {&_swigt__p_Gosu__Sample, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__SampleInstance[] = { {&_swigt__p_Gosu__SampleInstance, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__Song[] = { {&_swigt__p_Gosu__Song, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__TextInput[] = { {&_swigt__p_Gosu__TextInput, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Gosu__Window[] = { {&_swigt__p_Gosu__Window, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__tr1__arrayT_double_16_t[] = { {&_swigt__p_std__tr1__arrayT_double_16_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__wstring[] = { {&_swigt__p_std__wstring, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_Channel, _swigc__p_Gosu__Button, _swigc__p_Gosu__Color, _swigc__p_Gosu__Font, _swigc__p_Gosu__GLTexInfo, _swigc__p_Gosu__Image, _swigc__p_Gosu__ImageData, _swigc__p_Gosu__Sample, _swigc__p_Gosu__SampleInstance, _swigc__p_Gosu__Song, _swigc__p_Gosu__TextInput, _swigc__p_Gosu__Window, _swigc__p_char, _swigc__p_double, _swigc__p_std__tr1__arrayT_double_16_t, _swigc__p_std__wstring, }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ /* ----------------------------------------------------------------------------- * Type initialization: * This problem is tough by the requirement that no dynamic * memory is used. Also, since swig_type_info structures store pointers to * swig_cast_info structures and swig_cast_info structures store pointers back * to swig_type_info structures, we need some lookup code at initialization. * The idea is that swig generates all the structures that are needed. * The runtime then collects these partially filled structures. * The SWIG_InitializeModule function takes these initial arrays out of * swig_module, and does all the lookup, filling in the swig_module.types * array with the correct data and linking the correct swig_cast_info * structures together. * * The generated swig_type_info structures are assigned statically to an initial * array. We just loop through that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the * cast linked list. The cast data is initially stored in something like a * two-dimensional array. Each row corresponds to a type (there are the same * number of rows as there are in the swig_type_initial array). Each entry in * a column is one of the swig_cast_info structures for that type. * The cast_initial array is actually an array of arrays, because each row has * a variable number of columns. So to actually build the cast linked list, * we find the array of casts associated with the type, and loop through it * adding the casts to the list. The one last trick we need to do is making * sure the type pointer in the swig_cast_info struct is correct. * * First off, we lookup the cast->type name to see if it is already loaded. * There are three cases to handle: * 1) If the cast->type has already been loaded AND the type we are adding * casting info to has not been loaded (it is in this module), THEN we * replace the cast->type pointer with the type pointer that has already * been loaded. * 2) If BOTH types (the one we are adding casting info to, and the * cast->type) are loaded, THEN the cast info has already been loaded by * the previous module so we just ignore it. * 3) Finally, if cast->type has not already been loaded, then we add that * swig_cast_info to the linked list (because the cast->type) pointer will * be correct. * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #if 0 } /* c-mode */ #endif #endif #if 0 #define SWIGRUNTIME_DEBUG #endif SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; int found, init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { /* Initialize the swig_module */ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; init = 1; } else { init = 0; } /* Try and load any already created modules */ module_head = SWIG_GetModule(clientdata); if (!module_head) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ found=0; iter=module_head; do { if (iter==&swig_module) { found=1; break; } iter=iter->next; } while (iter!= module_head); /* if the is found in the list, then all is done and we may leave */ if (found) return; /* otherwise we must add out module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } /* When multiple interpreters are used, a module could have already been initialized in a different interpreter, but not yet have a pointer in this interpreter. In this case, we do not want to continue adding types... everything should be set up already */ if (init == 0) return; /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; swig_type_info *ret; swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ if (swig_module.next != &swig_module) { type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); } if (type) { /* Overwrite clientdata field */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: found type %s\n", type->name); #endif if (swig_module.type_initial[i]->clientdata) { type->clientdata = swig_module.type_initial[i]->clientdata; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); #endif } } else { type = swig_module.type_initial[i]; } /* Insert casting types */ cast = swig_module.cast_initial[i]; while (cast->type) { /* Don't need to add information already in the list */ ret = 0; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); #endif if (swig_module.next != &swig_module) { ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); #ifdef SWIGRUNTIME_DEBUG if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); #endif } if (ret) { if (type == swig_module.type_initial[i]) { #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: skip old type %s\n", ret->name); #endif cast->type = ret; ret = 0; } else { /* Check for casting already in the list */ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); #ifdef SWIGRUNTIME_DEBUG if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); #endif if (!ocast) ret = 0; } } if (!ret) { #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); #endif if (type->cast) { type->cast->prev = cast; cast->next = type->cast; } type->cast = cast; } cast++; } /* Set entry in modules->types array equal to the type */ swig_module.types[i] = type; } swig_module.types[i] = 0; #ifdef SWIGRUNTIME_DEBUG printf("**** SWIG_InitializeModule: Cast List ******\n"); for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; ++j; } printf("---- Total casts: %d\n",j); } printf("**** SWIG_InitializeModule: Cast List ******\n"); #endif } /* This function will propagate the clientdata field of type to * any new swig_type_info structures that have been added into the list * of equivalent types. It is like calling * SWIG_TypeClientData(type, clientdata) a second time. */ SWIGRUNTIME void SWIG_PropagateClientData(void) { size_t i; swig_cast_info *equiv; static int init_run = 0; if (init_run) return; init_run = 1; for (i = 0; i < swig_module.size; i++) { if (swig_module.types[i]->clientdata) { equiv = swig_module.types[i]->cast; while (equiv) { if (!equiv->converter) { if (equiv->type && !equiv->type->clientdata) SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); } equiv = equiv->next; } } } } #ifdef __cplusplus #if 0 { /* c-mode */ #endif } #endif /* */ #ifdef __cplusplus extern "C" #endif SWIGEXPORT void Init_gosu(void) { size_t i; SWIG_InitRuntime(); mGosu = rb_define_module("Gosu"); SWIG_InitializeModule(0); for (i = 0; i < swig_module.size; i++) { SWIG_define_class(swig_module.types[i]); } SWIG_RubyInitializeTrackings(); rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(0))); rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(8))); rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(0))); rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.8.0.pre3")); rb_define_const(mGosu, "GOSU_COPYRIGHT_NOTICE", SWIG_FromCharPtr(" \t\t GNU LIBRARY GENERAL PUBLIC LICENSE\t\t Version 2, June 1991\n\n\n\n Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\n\n[This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.]\n\n\t\t\t Preamble\n\n The licenses for most software are designed to take away yourfreedom to share and change it. By contrast, the GNU General PublicLicenses are intended to guarantee your freedom to share and changefree software--to make sure the software is free for all its users.\n\n This license, the Library General Public License, applies to somespecially designated Free Software Foundation software, and to anyother libraries whose authors decide to use it. You can use it foryour libraries, too.\n\n When we speak of free software, we are referring to freedom, notprice. Our General Public Licenses are designed to make sure that youhave the freedom to distribute copies of free software (and charge forthis service if you wish), that you receive source code or can get itif you want it, that you can change the software or use pieces of itin new free programs; and that you know you can do these things.\n\n To protect your rights, we need to make restrictions that forbidanyone to deny you these rights or to ask you to surrender the rights.These restrictions translate to certain responsibilities for you ifyou distribute copies of the library, or if you modify it.\n\n For example, if you distribute copies of the library, whether gratisor for a fee, you must give the recipients all the rights that we gaveyou. You must make sure that they, too, receive or can get the sourcecode. If you link a program with the library, you must providecomplete object files to the recipients so that they can relink themwith the library, after making changes to the library and recompilingit. And you must show them these terms so they know their rights.\n\n Our method of protecting your rights has two steps: (1) copyrightthe library, and (2) offer you this license which gives you legalpermission to copy, distribute and/or modify the library.\n\n Also, for each distributor\'s protection, we want to make certainthat everyone understands that there is no warranty for this freelibrary. If the library is modified by someone else and passed on, wewant its recipients to know that what they have is not the originalversion, so that any problems introduced by others will not reflect onthe original authors\' reputations.\14 Finally, any free program is threatened constantly by softwarepatents. We wish to avoid the danger that companies distributing freesoftware will individually obtain patent licenses, thus in effecttransforming the program into proprietary software. To prevent this,we have made it clear that any patent must be licensed for everyone\'sfree use or not licensed at all.\n\n Most GNU software, including some libraries, is covered by the ordinaryGNU General Public License, which was designed for utility programs. Thislicense, the GNU Library General Public License, applies to certaindesignated libraries. This license is quite different from the ordinaryone; be sure to read it in full, and don\'t assume that anything in it isthe same as in the ordinary license.\n\n The reason we have a separate public license for some libraries is thatthey blur the distinction we usually make between modifying or adding to aprogram and simply using it. Linking a program with a library, withoutchanging the library, is in some sense simply using the library, and isanalogous to running a utility program or application program. However, ina textual and legal sense, the linked executable is a combined work, aderivative of the original library, and the ordinary General Public Licensetreats it as such.\n\n Because of this blurred distinction, using the ordinary GeneralPublic License for libraries did not effectively promote softwaresharing, because most developers did not use the libraries. Weconcluded that weaker conditions might promote sharing better.\n\n However, unrestricted linking of non-free programs would deprive theusers of those programs of all benefit from the free status of thelibraries themselves. This Library General Public License is intended topermit developers of non-free programs to use free libraries, whilepreserving your freedom as a user of such programs to change the freelibraries that are incorporated in them. (We have not seen how to achievethis as regards changes in header files, but we have achieved it as regardschanges in the actual functions of the Library.) The hope is that thiswill lead to faster development of free libraries.\n\n The precise terms and conditions for copying, distribution andmodification follow. Pay close attention to the difference between a\"work based on the library\" and a \"work that uses the library\". Theformer contains code derived from the library, while the latter onlyworks together with the library.\n\n Note that it is possible for a library to be covered by the ordinaryGeneral Public License rather than by this special one.\14\t\t GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n 0. This License Agreement applies to any software library whichcontains a notice placed by the copyright holder or other authorizedparty saying it may be distributed under the terms of this LibraryGeneral Public License (also called \"this License\"). Each licensee isaddressed as \"you\".\n\n A \"library\" means a collection of software functions and/or dataprepared so as to be conveniently linked with application programs(which use some of those functions and data) to form executables.\n\n The \"Library\", below, refers to any such software library or workwhich has been distributed under these terms. A \"work based on theLibrary\" means either the Library or any derivative work undercopyright law: that is to say, a work containing the Library or aportion of it, either verbatim or with modifications and/or translatedstraightforwardly into another language. (Hereinafter, translation isincluded without limitation in the term \"modification\".)\n\n \"Source code\" for a work means the preferred form of the work formaking modifications to it. For a library, complete source code meansall the source code for all modules it contains, plus any associatedinterface definition files, plus the scripts used to control compilationand installation of the library.\n\n Activities other than copying, distribution and modification are notcovered by this License; they are outside its scope. The act ofrunning a program using the Library is not restricted, and output fromsuch a program is covered only if its contents constitute a work basedon the Library (independent of the use of the Library in a tool forwriting it). Whether that is true depends on what the Library doesand what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library\'scomplete source code as you receive it, in any medium, provided thatyou conspicuously and appropriately publish on each copy anappropriate copyright notice and disclaimer of warranty; keep intactall the notices that refer to this License and to the absence of anywarranty; and distribute a copy of this License along with theLibrary.\n\n You may charge a fee for the physical act of transferring a copy,and you may at your option offer warranty protection in exchange for afee.\14 2. You may modify your copy or copies of the Library or any portionof it, thus forming a work based on the Library, and copy anddistribute such modifications or work under the terms of Section 1above, provided that you also meet all of these conditions:\n\n a) The modified work must itself be a software library.\n\n b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.\n\n c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.\n\n d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.\n\n (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole. Ifidentifiable sections of that work are not derived from the Library,and can be reasonably considered independent and separate works inthemselves, then this License, and its terms, do not apply to thosesections when you distribute them as separate works. But when youdistribute the same sections as part of a whole which is a work basedon the Library, the distribution of the whole must be on the terms ofthis License, whose permissions for other licensees extend to theentire whole, and thus to each and every part regardless of who wroteit.\n\nThus, it is not the intent of this section to claim rights or contestyour rights to work written entirely by you; rather, the intent is toexercise the right to control the distribution of derivative orcollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Librarywith the Library (or with a work based on the Library) on a volume ofa storage or distribution medium does not bring the other work underthe scope of this License.\n\n 3. You may opt to apply the terms of the ordinary GNU General PublicLicense instead of this License to a given copy of the Library. To dothis, you must alter all the notices that refer to this License, sothat they refer to the ordinary GNU General Public License, version 2,instead of to this License. (If a newer version than version 2 of theordinary GNU General Public License has appeared, then you can specifythat version instead if you wish.) Do not make any other change inthese notices.\14 Once this change is made in a given copy, it is irreversible forthat copy, so the ordinary GNU General Public License applies to allsubsequent copies and derivative works made from that copy.\n\n This option is useful when you wish to copy part of the code ofthe Library into a program that is not a library.\n\n 4. You may copy and distribute the Library (or a portion orderivative of it, under Section 2) in object code or executable formunder the terms of Sections 1 and 2 above provided that you accompanyit with the complete corresponding machine-readable source code, whichmust be distributed under the terms of Sections 1 and 2 above on amedium customarily used for software interchange.\n\n If distribution of object code is made by offering access to copyfrom a designated place, then offering equivalent access to copy thesource code from the same place satisfies the requirement todistribute the source code, even though third parties are notcompelled to copy the source along with the object code.\n\n 5. A program that contains no derivative of any portion of theLibrary, but is designed to work with the Library by being compiled orlinked with it, is called a \"work that uses the Library\". Such awork, in isolation, is not a derivative work of the Library, andtherefore falls outside the scope of this License.\n\n However, linking a \"work that uses the Library\" with the Librarycreates an executable that is a derivative of the Library (because itcontains portions of the Library), rather than a \"work that uses thelibrary\". The executable is therefore covered by this License.Section 6 states terms for distribution of such executables.\n\n When a \"work that uses the Library\" uses material from a header filethat is part of the Library, the object code for the work may be aderivative work of the Library even though the source code is not.Whether this is true is especially significant if the work can belinked without the Library, or if the work is itself a library. Thethreshold for this to be true is not precisely defined by law.\n\n If such an object file uses only numerical parameters, datastructure layouts and accessors, and small macros and small inlinefunctions (ten lines or less in length), then the use of the objectfile is unrestricted, regardless of whether it is legally a derivativework. (Executables containing this object code plus portions of theLibrary will still fall under Section 6.)\n\n Otherwise, if the work is a derivative of the Library, you maydistribute the object code for the work under the terms of Section 6.Any executables containing that work also fall under Section 6,whether or not they are linked directly with the Library itself.\14 6. As an exception to the Sections above, you may also compile orlink a \"work that uses the Library\" with the Library to produce awork containing portions of the Library, and distribute that workunder terms of your choice, provided that the terms permitmodification of the work for the customer\'s own use and reverseengineering for debugging such modifications.\n\n You must give prominent notice with each copy of the work that theLibrary is used in it and that the Library and its use are covered bythis License. You must supply a copy of this License. If the workduring execution displays copyright notices, you must include thecopyright notice for the Library among them, as well as a referencedirecting the user to the copy of this License. Also, you must do oneof these things:\n\n a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable \"work that uses the Library\", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)\n\n b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.\n\n c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.\n\n d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.\n\n For an executable, the required form of the \"work that uses theLibrary\" must include any data and utility programs needed forreproducing the executable from it. However, as a special exception,the source code distributed need not include anything that is normallydistributed (in either source or binary form) with the majorcomponents (compiler, kernel, and so on) of the operating system onwhich the executable runs, unless that component itself accompaniesthe executable.\n\n It may happen that this requirement contradicts the licenserestrictions of other proprietary libraries that do not normallyaccompany the operating system. Such a contradiction means you cannotuse both them and the Library together in an executable that youdistribute.\14 7. You may place library facilities that are a work based on theLibrary side-by-side in a single library together with other libraryfacilities not covered by this License, and distribute such a combinedlibrary, provided that the separate distribution of the work based onthe Library and of the other library facilities is otherwisepermitted, and provided that you do these two things:\n\n a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.\n\n b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\n\n 8. You may not copy, modify, sublicense, link with, or distributethe Library except as expressly provided under this License. Anyattempt otherwise to copy, modify, sublicense, link with, ordistribute the Library is void, and will automatically terminate yourrights under this License. However, parties who have received copies,or rights, from you under this License will not have their licensesterminated so long as such parties remain in full compliance.\n\n 9. You are not required to accept this License, since you have notsigned it. However, nothing else grants you permission to modify ordistribute the Library or its derivative works. These actions areprohibited by law if you do not accept this License. Therefore, bymodifying or distributing the Library (or any work based on theLibrary), you indicate your acceptance of this License to do so, andall its terms and conditions for copying, distributing or modifyingthe Library or works based on it.\n\n 10. Each time you redistribute the Library (or any work based on theLibrary), the recipient automatically receives a license from theoriginal licensor to copy, distribute, link with or modify the Librarysubject to these terms and conditions. You may not impose any furtherrestrictions on the recipients\' exercise of the rights granted herein.You are not responsible for enforcing compliance by third parties tothis License.\14 11. If, as a consequence of a court judgment or allegation of patentinfringement or for any other reason (not limited to patent issues),conditions are imposed on you (whether by court order, agreement orotherwise) that contradict the conditions of this License, they do notexcuse you from the conditions of this License. If you cannotdistribute so as to satisfy simultaneously your obligations under thisLicense and any other pertinent obligations, then as a consequence youmay not distribute the Library at all. For example, if a patentlicense would not permit royalty-free redistribution of the Library byall those who receive copies directly or indirectly through you, thenthe only way you could satisfy both it and this License would be torefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under anyparticular circumstance, the balance of the section is intended to apply,and the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe anypatents or other property right claims or to contest validity of anysuch claims; this section has the sole purpose of protecting theintegrity of the free software distribution system which isimplemented by public license practices. Many people have madegenerous contributions to the wide range of software distributedthrough that system in reliance on consistent application of thatsystem; it is up to the author/donor to decide if he or she is willingto distribute software through any other system and a licensee cannotimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed tobe a consequence of the rest of this License.\n\n 12. If the distribution and/or use of the Library is restricted incertain countries either by patents or by copyrighted interfaces, theoriginal copyright holder who places the Library under this License may addan explicit geographical distribution limitation excluding those countries,so that distribution is permitted only in or among countries not thusexcluded. In such case, this License incorporates the limitation as ifwritten in the body of this License.\n\n 13. The Free Software Foundation may publish revised and/or newversions of the Library General Public License from time to time.Such new versions will be similar in spirit to the present version,but may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number. If the Libraryspecifies a version number of this License which applies to it and\"any later version\", you have the option of following the terms andconditions either of that version or of any later version published bythe Free Software Foundation. If the Library does not specify alicense version number, you may choose any version ever published bythe Free Software Foundation.\14 14. If you wish to incorporate parts of the Library into other freeprograms whose distribution conditions are incompatible with these,write to the author to ask for permission. For software which iscopyrighted by the Free Software Foundation, write to the FreeSoftware Foundation; we sometimes make exceptions for this. Ourdecision will be guided by the two goals of preserving the free statusof all derivatives of our free software and of promoting the sharingand reuse of software generally.\n\n\t\t\t NO WARRANTY\n\n 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NOWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OROTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANYKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THELIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUMETHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO INWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFYAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOUFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL ORCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THELIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEINGRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR AFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IFSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCHDAMAGES.\n\n\t\t END OF TERMS AND CONDITIONS\14 Appendix: How to Apply These Terms to Your New Libraries\n\n If you develop a new library, and you want it to be of the greatestpossible use to the public, we recommend making it free software thateveryone can redistribute and change. You can do so by permittingredistribution under these terms (or, alternatively, under the terms of theordinary General Public License).\n\n To apply these terms, attach the following notices to the library. It issafest to attach them to the start of each source file to most effectivelyconvey the exclusion of warranty; and each file should have at least the\"copyright\" line and a pointer to where the full notice is found.\n\n Copyright (C) \n\n This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.\n\n You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or yourschool, if any, to sign a \"copyright disclaimer\" for the library, ifnecessary. Here is a sample; alter the names:\n\n Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob\' (a library for tweaking knobs) written by James Random Hacker.\n\n , 1 April 1990 Ty Coon, President of Vice\n\nThat\'s all there is to it!\n\nSee http://www.gnu.org/copyleft/lesser.html.May contain `ogg\', `vorbis\' libraries (c) 2002-2008 Xiph.org Foundation\n\nRedistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:\n\n- Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.\n\n- Neither the name of the Xiph.org Foundation nor the names of itscontributors may be used to endorse or promote products derived fromthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS``AS IS\'\' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATIONOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.")); rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1); rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1); rb_define_module_function(mGosu, "degrees_to_radians", VALUEFUNC(_wrap_degrees_to_radians), -1); rb_define_module_function(mGosu, "radians_to_degrees", VALUEFUNC(_wrap_radians_to_degrees), -1); rb_define_module_function(mGosu, "offset_x", VALUEFUNC(_wrap_offset_x), -1); rb_define_module_function(mGosu, "offset_y", VALUEFUNC(_wrap_offset_y), -1); rb_define_module_function(mGosu, "angle", VALUEFUNC(_wrap_angle), -1); rb_define_module_function(mGosu, "angle_diff", VALUEFUNC(_wrap_angle_diff), -1); rb_define_module_function(mGosu, "normalize_angle", VALUEFUNC(_wrap_normalize_angle), -1); rb_define_module_function(mGosu, "distance", VALUEFUNC(_wrap_distance), -1); rb_define_module_function(mGosu, "default_font_name", VALUEFUNC(_wrap_default_font_name), -1); rb_define_module_function(mGosu, "screen_width", VALUEFUNC(_wrap_screen_width), -1); rb_define_module_function(mGosu, "screen_height", VALUEFUNC(_wrap_screen_height), -1); rb_define_const(mGosu, "MAX_TEXTURE_SIZE", SWIG_From_unsigned_SS_int(static_cast< unsigned int >(Gosu::MAX_TEXTURE_SIZE))); rb_define_module_function(mGosu, "language", VALUEFUNC(_wrap_language), -1); rb_define_module_function(mGosu, "enable_undocumented_retrofication", VALUEFUNC(_wrap_enable_undocumented_retrofication), -1); rb_define_module_function(mGosu, "_release_all_openal_resources", VALUEFUNC(_wrap__release_all_openal_resources), -1); rb_define_module_function(mGosu, "register_entity", VALUEFUNC(_wrap_register_entity), -1); SwigClassColor.klass = rb_define_class_under(mGosu, "Color", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Color, (void *) &SwigClassColor); rb_define_alloc_func(SwigClassColor.klass, _wrap_Color_allocate); rb_define_method(SwigClassColor.klass, "initialize", VALUEFUNC(_wrap_new_Color), -1); rb_define_const(SwigClassColor.klass, "GL_FORMAT", SWIG_From_unsigned_SS_int(static_cast< unsigned int >(Gosu::Color::GL_FORMAT))); rb_define_singleton_method(SwigClassColor.klass, "from_hsv", VALUEFUNC(_wrap_Color_from_hsv), -1); rb_define_singleton_method(SwigClassColor.klass, "from_ahsv", VALUEFUNC(_wrap_Color_from_ahsv), -1); rb_define_method(SwigClassColor.klass, "red", VALUEFUNC(_wrap_Color_red), -1); rb_define_method(SwigClassColor.klass, "green", VALUEFUNC(_wrap_Color_green), -1); rb_define_method(SwigClassColor.klass, "blue", VALUEFUNC(_wrap_Color_blue), -1); rb_define_method(SwigClassColor.klass, "alpha", VALUEFUNC(_wrap_Color_alpha), -1); rb_define_method(SwigClassColor.klass, "red=", VALUEFUNC(_wrap_Color_rede___), -1); rb_define_method(SwigClassColor.klass, "green=", VALUEFUNC(_wrap_Color_greene___), -1); rb_define_method(SwigClassColor.klass, "blue=", VALUEFUNC(_wrap_Color_bluee___), -1); rb_define_method(SwigClassColor.klass, "alpha=", VALUEFUNC(_wrap_Color_alphae___), -1); rb_define_method(SwigClassColor.klass, "hue", VALUEFUNC(_wrap_Color_hue), -1); rb_define_method(SwigClassColor.klass, "hue=", VALUEFUNC(_wrap_Color_huee___), -1); rb_define_method(SwigClassColor.klass, "saturation", VALUEFUNC(_wrap_Color_saturation), -1); rb_define_method(SwigClassColor.klass, "saturation=", VALUEFUNC(_wrap_Color_saturatione___), -1); rb_define_method(SwigClassColor.klass, "value", VALUEFUNC(_wrap_Color_value), -1); rb_define_method(SwigClassColor.klass, "value=", VALUEFUNC(_wrap_Color_valuee___), -1); rb_define_method(SwigClassColor.klass, "bgr", VALUEFUNC(_wrap_Color_bgr), -1); rb_define_method(SwigClassColor.klass, "abgr", VALUEFUNC(_wrap_Color_abgr), -1); rb_define_method(SwigClassColor.klass, "gl", VALUEFUNC(_wrap_Color_gl), -1); rb_define_singleton_method(SwigClassColor.klass, "rgb", VALUEFUNC(_wrap_Color_rgb), -1); rb_define_singleton_method(SwigClassColor.klass, "rgba", VALUEFUNC(_wrap_Color_rgba), -1); rb_define_singleton_method(SwigClassColor.klass, "argb", VALUEFUNC(_wrap_Color_argb), -1); rb_define_method(SwigClassColor.klass, "dup", VALUEFUNC(_wrap_Color_dup), -1); rb_define_method(SwigClassColor.klass, "to_s", VALUEFUNC(_wrap_Color_to_s), -1); rb_define_method(SwigClassColor.klass, "==", VALUEFUNC(_wrap_Color___eq__), -1); SwigClassColor.mark = 0; SwigClassColor.destroy = (void (*)(void *)) free_Gosu_Color; SwigClassColor.trackObjects = 1; SwigClassFont.klass = rb_define_class_under(mGosu, "Font", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Font, (void *) &SwigClassFont); rb_define_alloc_func(SwigClassFont.klass, _wrap_Font_allocate); rb_define_method(SwigClassFont.klass, "initialize", VALUEFUNC(_wrap_new_Font), -1); rb_define_method(SwigClassFont.klass, "name", VALUEFUNC(_wrap_Font_name), -1); rb_define_method(SwigClassFont.klass, "height", VALUEFUNC(_wrap_Font_height), -1); rb_define_method(SwigClassFont.klass, "flags", VALUEFUNC(_wrap_Font_flags), -1); rb_define_method(SwigClassFont.klass, "text_width", VALUEFUNC(_wrap_Font_text_width), -1); rb_define_method(SwigClassFont.klass, "draw", VALUEFUNC(_wrap_Font_draw), -1); rb_define_method(SwigClassFont.klass, "draw_rel", VALUEFUNC(_wrap_Font_draw_rel), -1); rb_define_method(SwigClassFont.klass, "draw_rot", VALUEFUNC(_wrap_Font_draw_rot), -1); rb_define_method(SwigClassFont.klass, "set_image", VALUEFUNC(_wrap_Font_set_image), -1); SwigClassFont.mark = 0; SwigClassFont.destroy = (void (*)(void *)) free_Gosu_Font; SwigClassFont.trackObjects = 1; SwigClassGLTexInfo.klass = rb_define_class_under(mGosu, "GLTexInfo", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__GLTexInfo, (void *) &SwigClassGLTexInfo); rb_define_alloc_func(SwigClassGLTexInfo.klass, _wrap_GLTexInfo_allocate); rb_define_method(SwigClassGLTexInfo.klass, "initialize", VALUEFUNC(_wrap_new_GLTexInfo), -1); rb_define_method(SwigClassGLTexInfo.klass, "tex_name=", VALUEFUNC(_wrap_GLTexInfo_tex_name_set), -1); rb_define_method(SwigClassGLTexInfo.klass, "tex_name", VALUEFUNC(_wrap_GLTexInfo_tex_name_get), -1); rb_define_method(SwigClassGLTexInfo.klass, "left=", VALUEFUNC(_wrap_GLTexInfo_left_set), -1); rb_define_method(SwigClassGLTexInfo.klass, "left", VALUEFUNC(_wrap_GLTexInfo_left_get), -1); rb_define_method(SwigClassGLTexInfo.klass, "right=", VALUEFUNC(_wrap_GLTexInfo_right_set), -1); rb_define_method(SwigClassGLTexInfo.klass, "right", VALUEFUNC(_wrap_GLTexInfo_right_get), -1); rb_define_method(SwigClassGLTexInfo.klass, "top=", VALUEFUNC(_wrap_GLTexInfo_top_set), -1); rb_define_method(SwigClassGLTexInfo.klass, "top", VALUEFUNC(_wrap_GLTexInfo_top_get), -1); rb_define_method(SwigClassGLTexInfo.klass, "bottom=", VALUEFUNC(_wrap_GLTexInfo_bottom_set), -1); rb_define_method(SwigClassGLTexInfo.klass, "bottom", VALUEFUNC(_wrap_GLTexInfo_bottom_get), -1); SwigClassGLTexInfo.mark = 0; SwigClassGLTexInfo.destroy = (void (*)(void *)) free_Gosu_GLTexInfo; SwigClassGLTexInfo.trackObjects = 1; SwigClassImage.klass = rb_define_class_under(mGosu, "Image", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Image, (void *) &SwigClassImage); rb_define_alloc_func(SwigClassImage.klass, _wrap_Image_allocate); rb_define_method(SwigClassImage.klass, "initialize", VALUEFUNC(_wrap_new_Image), -1); rb_define_method(SwigClassImage.klass, "width", VALUEFUNC(_wrap_Image_width), -1); rb_define_method(SwigClassImage.klass, "height", VALUEFUNC(_wrap_Image_height), -1); rb_define_method(SwigClassImage.klass, "draw", VALUEFUNC(_wrap_Image_draw), -1); rb_define_method(SwigClassImage.klass, "draw_mod", VALUEFUNC(_wrap_Image_draw_mod), -1); rb_define_method(SwigClassImage.klass, "draw_rot", VALUEFUNC(_wrap_Image_draw_rot), -1); rb_define_method(SwigClassImage.klass, "get_data", VALUEFUNC(_wrap_Image_get_data), -1); rb_define_method(SwigClassImage.klass, "draw_as_quad", VALUEFUNC(_wrap_Image_draw_as_quad), -1); rb_define_method(SwigClassImage.klass, "gl_tex_info", VALUEFUNC(_wrap_Image_gl_tex_info), -1); rb_define_method(SwigClassImage.klass, "subimage", VALUEFUNC(_wrap_Image_subimage), -1); rb_define_singleton_method(SwigClassImage.klass, "from_text4", VALUEFUNC(_wrap_Image_from_text4), -1); rb_define_singleton_method(SwigClassImage.klass, "from_text7", VALUEFUNC(_wrap_Image_from_text7), -1); rb_define_singleton_method(SwigClassImage.klass, "load_tiles", VALUEFUNC(_wrap_Image_load_tiles), -1); rb_define_method(SwigClassImage.klass, "to_blob", VALUEFUNC(_wrap_Image_to_blob), -1); rb_define_method(SwigClassImage.klass, "columns", VALUEFUNC(_wrap_Image_columns), -1); rb_define_method(SwigClassImage.klass, "rows", VALUEFUNC(_wrap_Image_rows), -1); rb_define_method(SwigClassImage.klass, "save", VALUEFUNC(_wrap_Image_save), -1); rb_define_method(SwigClassImage.klass, "insert", VALUEFUNC(_wrap_Image_insert), -1); SwigClassImage.mark = 0; SwigClassImage.destroy = (void (*)(void *)) free_Gosu_Image; SwigClassImage.trackObjects = 1; rb_define_module_function(mGosu, "fps", VALUEFUNC(_wrap_fps), -1); SwigClassSampleInstance.klass = rb_define_class_under(mGosu, "SampleInstance", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__SampleInstance, (void *) &SwigClassSampleInstance); rb_define_alloc_func(SwigClassSampleInstance.klass, _wrap_SampleInstance_allocate); rb_define_method(SwigClassSampleInstance.klass, "initialize", VALUEFUNC(_wrap_new_SampleInstance), -1); rb_define_method(SwigClassSampleInstance.klass, "playing?", VALUEFUNC(_wrap_SampleInstance_playingq___), -1); rb_define_method(SwigClassSampleInstance.klass, "paused?", VALUEFUNC(_wrap_SampleInstance_pausedq___), -1); rb_define_method(SwigClassSampleInstance.klass, "pause", VALUEFUNC(_wrap_SampleInstance_pause), -1); rb_define_method(SwigClassSampleInstance.klass, "resume", VALUEFUNC(_wrap_SampleInstance_resume), -1); rb_define_method(SwigClassSampleInstance.klass, "stop", VALUEFUNC(_wrap_SampleInstance_stop), -1); rb_define_method(SwigClassSampleInstance.klass, "volume=", VALUEFUNC(_wrap_SampleInstance_volumee___), -1); rb_define_method(SwigClassSampleInstance.klass, "pan=", VALUEFUNC(_wrap_SampleInstance_pane___), -1); rb_define_method(SwigClassSampleInstance.klass, "speed=", VALUEFUNC(_wrap_SampleInstance_speede___), -1); SwigClassSampleInstance.mark = 0; SwigClassSampleInstance.destroy = (void (*)(void *)) free_Gosu_SampleInstance; SwigClassSampleInstance.trackObjects = 1; SwigClassSample.klass = rb_define_class_under(mGosu, "Sample", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Sample, (void *) &SwigClassSample); rb_define_alloc_func(SwigClassSample.klass, _wrap_Sample_allocate); rb_define_method(SwigClassSample.klass, "initialize", VALUEFUNC(_wrap_new_Sample), -1); rb_define_method(SwigClassSample.klass, "play", VALUEFUNC(_wrap_Sample_play), -1); rb_define_method(SwigClassSample.klass, "play_pan", VALUEFUNC(_wrap_Sample_play_pan), -1); SwigClassSample.mark = 0; SwigClassSample.destroy = (void (*)(void *)) free_Gosu_Sample; SwigClassSample.trackObjects = 1; SwigClassSong.klass = rb_define_class_under(mGosu, "Song", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Song, (void *) &SwigClassSong); rb_define_alloc_func(SwigClassSong.klass, _wrap_Song_allocate); rb_define_method(SwigClassSong.klass, "initialize", VALUEFUNC(_wrap_new_Song), -1); rb_define_singleton_method(SwigClassSong.klass, "current_song", VALUEFUNC(_wrap_Song_current_song), -1); rb_define_method(SwigClassSong.klass, "play", VALUEFUNC(_wrap_Song_play), -1); rb_define_method(SwigClassSong.klass, "pause", VALUEFUNC(_wrap_Song_pause), -1); rb_define_method(SwigClassSong.klass, "paused?", VALUEFUNC(_wrap_Song_pausedq___), -1); rb_define_method(SwigClassSong.klass, "stop", VALUEFUNC(_wrap_Song_stop), -1); rb_define_method(SwigClassSong.klass, "playing?", VALUEFUNC(_wrap_Song_playingq___), -1); rb_define_method(SwigClassSong.klass, "volume", VALUEFUNC(_wrap_Song_volume), -1); rb_define_method(SwigClassSong.klass, "volume=", VALUEFUNC(_wrap_Song_volumee___), -1); rb_define_singleton_method(SwigClassSong.klass, "update", VALUEFUNC(_wrap_Song_update), -1); SwigClassSong.mark = 0; SwigClassSong.destroy = (void (*)(void *)) free_Gosu_Song; SwigClassSong.trackObjects = 1; rb_define_const(mGosu, "KbEscape", SWIG_From_int(static_cast< int >(Gosu::kbEscape))); rb_define_const(mGosu, "KbF1", SWIG_From_int(static_cast< int >(Gosu::kbF1))); rb_define_const(mGosu, "KbF2", SWIG_From_int(static_cast< int >(Gosu::kbF2))); rb_define_const(mGosu, "KbF3", SWIG_From_int(static_cast< int >(Gosu::kbF3))); rb_define_const(mGosu, "KbF4", SWIG_From_int(static_cast< int >(Gosu::kbF4))); rb_define_const(mGosu, "KbF5", SWIG_From_int(static_cast< int >(Gosu::kbF5))); rb_define_const(mGosu, "KbF6", SWIG_From_int(static_cast< int >(Gosu::kbF6))); rb_define_const(mGosu, "KbF7", SWIG_From_int(static_cast< int >(Gosu::kbF7))); rb_define_const(mGosu, "KbF8", SWIG_From_int(static_cast< int >(Gosu::kbF8))); rb_define_const(mGosu, "KbF9", SWIG_From_int(static_cast< int >(Gosu::kbF9))); rb_define_const(mGosu, "KbF10", SWIG_From_int(static_cast< int >(Gosu::kbF10))); rb_define_const(mGosu, "KbF11", SWIG_From_int(static_cast< int >(Gosu::kbF11))); rb_define_const(mGosu, "KbF12", SWIG_From_int(static_cast< int >(Gosu::kbF12))); rb_define_const(mGosu, "Kb0", SWIG_From_int(static_cast< int >(Gosu::kb0))); rb_define_const(mGosu, "Kb1", SWIG_From_int(static_cast< int >(Gosu::kb1))); rb_define_const(mGosu, "Kb2", SWIG_From_int(static_cast< int >(Gosu::kb2))); rb_define_const(mGosu, "Kb3", SWIG_From_int(static_cast< int >(Gosu::kb3))); rb_define_const(mGosu, "Kb4", SWIG_From_int(static_cast< int >(Gosu::kb4))); rb_define_const(mGosu, "Kb5", SWIG_From_int(static_cast< int >(Gosu::kb5))); rb_define_const(mGosu, "Kb6", SWIG_From_int(static_cast< int >(Gosu::kb6))); rb_define_const(mGosu, "Kb7", SWIG_From_int(static_cast< int >(Gosu::kb7))); rb_define_const(mGosu, "Kb8", SWIG_From_int(static_cast< int >(Gosu::kb8))); rb_define_const(mGosu, "Kb9", SWIG_From_int(static_cast< int >(Gosu::kb9))); rb_define_const(mGosu, "KbTab", SWIG_From_int(static_cast< int >(Gosu::kbTab))); rb_define_const(mGosu, "KbReturn", SWIG_From_int(static_cast< int >(Gosu::kbReturn))); rb_define_const(mGosu, "KbSpace", SWIG_From_int(static_cast< int >(Gosu::kbSpace))); rb_define_const(mGosu, "KbLeftShift", SWIG_From_int(static_cast< int >(Gosu::kbLeftShift))); rb_define_const(mGosu, "KbRightShift", SWIG_From_int(static_cast< int >(Gosu::kbRightShift))); rb_define_const(mGosu, "KbLeftControl", SWIG_From_int(static_cast< int >(Gosu::kbLeftControl))); rb_define_const(mGosu, "KbRightControl", SWIG_From_int(static_cast< int >(Gosu::kbRightControl))); rb_define_const(mGosu, "KbLeftAlt", SWIG_From_int(static_cast< int >(Gosu::kbLeftAlt))); rb_define_const(mGosu, "KbRightAlt", SWIG_From_int(static_cast< int >(Gosu::kbRightAlt))); rb_define_const(mGosu, "KbLeftMeta", SWIG_From_int(static_cast< int >(Gosu::kbLeftMeta))); rb_define_const(mGosu, "KbRightMeta", SWIG_From_int(static_cast< int >(Gosu::kbRightMeta))); rb_define_const(mGosu, "KbBackspace", SWIG_From_int(static_cast< int >(Gosu::kbBackspace))); rb_define_const(mGosu, "KbLeft", SWIG_From_int(static_cast< int >(Gosu::kbLeft))); rb_define_const(mGosu, "KbRight", SWIG_From_int(static_cast< int >(Gosu::kbRight))); rb_define_const(mGosu, "KbUp", SWIG_From_int(static_cast< int >(Gosu::kbUp))); rb_define_const(mGosu, "KbDown", SWIG_From_int(static_cast< int >(Gosu::kbDown))); rb_define_const(mGosu, "KbHome", SWIG_From_int(static_cast< int >(Gosu::kbHome))); rb_define_const(mGosu, "KbEnd", SWIG_From_int(static_cast< int >(Gosu::kbEnd))); rb_define_const(mGosu, "KbInsert", SWIG_From_int(static_cast< int >(Gosu::kbInsert))); rb_define_const(mGosu, "KbDelete", SWIG_From_int(static_cast< int >(Gosu::kbDelete))); rb_define_const(mGosu, "KbPageUp", SWIG_From_int(static_cast< int >(Gosu::kbPageUp))); rb_define_const(mGosu, "KbPageDown", SWIG_From_int(static_cast< int >(Gosu::kbPageDown))); rb_define_const(mGosu, "KbEnter", SWIG_From_int(static_cast< int >(Gosu::kbEnter))); rb_define_const(mGosu, "KbBacktick", SWIG_From_int(static_cast< int >(Gosu::kbBacktick))); rb_define_const(mGosu, "KbMinus", SWIG_From_int(static_cast< int >(Gosu::kbMinus))); rb_define_const(mGosu, "KbEqual", SWIG_From_int(static_cast< int >(Gosu::kbEqual))); rb_define_const(mGosu, "KbBracketLeft", SWIG_From_int(static_cast< int >(Gosu::kbBracketLeft))); rb_define_const(mGosu, "KbBracketRight", SWIG_From_int(static_cast< int >(Gosu::kbBracketRight))); rb_define_const(mGosu, "KbBackslash", SWIG_From_int(static_cast< int >(Gosu::kbBackslash))); rb_define_const(mGosu, "KbSemicolon", SWIG_From_int(static_cast< int >(Gosu::kbSemicolon))); rb_define_const(mGosu, "KbApostrophe", SWIG_From_int(static_cast< int >(Gosu::kbApostrophe))); rb_define_const(mGosu, "KbComma", SWIG_From_int(static_cast< int >(Gosu::kbComma))); rb_define_const(mGosu, "KbPeriod", SWIG_From_int(static_cast< int >(Gosu::kbPeriod))); rb_define_const(mGosu, "KbSlash", SWIG_From_int(static_cast< int >(Gosu::kbSlash))); rb_define_const(mGosu, "KbA", SWIG_From_int(static_cast< int >(Gosu::kbA))); rb_define_const(mGosu, "KbB", SWIG_From_int(static_cast< int >(Gosu::kbB))); rb_define_const(mGosu, "KbC", SWIG_From_int(static_cast< int >(Gosu::kbC))); rb_define_const(mGosu, "KbD", SWIG_From_int(static_cast< int >(Gosu::kbD))); rb_define_const(mGosu, "KbE", SWIG_From_int(static_cast< int >(Gosu::kbE))); rb_define_const(mGosu, "KbF", SWIG_From_int(static_cast< int >(Gosu::kbF))); rb_define_const(mGosu, "KbG", SWIG_From_int(static_cast< int >(Gosu::kbG))); rb_define_const(mGosu, "KbH", SWIG_From_int(static_cast< int >(Gosu::kbH))); rb_define_const(mGosu, "KbI", SWIG_From_int(static_cast< int >(Gosu::kbI))); rb_define_const(mGosu, "KbJ", SWIG_From_int(static_cast< int >(Gosu::kbJ))); rb_define_const(mGosu, "KbK", SWIG_From_int(static_cast< int >(Gosu::kbK))); rb_define_const(mGosu, "KbL", SWIG_From_int(static_cast< int >(Gosu::kbL))); rb_define_const(mGosu, "KbM", SWIG_From_int(static_cast< int >(Gosu::kbM))); rb_define_const(mGosu, "KbN", SWIG_From_int(static_cast< int >(Gosu::kbN))); rb_define_const(mGosu, "KbO", SWIG_From_int(static_cast< int >(Gosu::kbO))); rb_define_const(mGosu, "KbP", SWIG_From_int(static_cast< int >(Gosu::kbP))); rb_define_const(mGosu, "KbQ", SWIG_From_int(static_cast< int >(Gosu::kbQ))); rb_define_const(mGosu, "KbR", SWIG_From_int(static_cast< int >(Gosu::kbR))); rb_define_const(mGosu, "KbS", SWIG_From_int(static_cast< int >(Gosu::kbS))); rb_define_const(mGosu, "KbT", SWIG_From_int(static_cast< int >(Gosu::kbT))); rb_define_const(mGosu, "KbU", SWIG_From_int(static_cast< int >(Gosu::kbU))); rb_define_const(mGosu, "KbV", SWIG_From_int(static_cast< int >(Gosu::kbV))); rb_define_const(mGosu, "KbW", SWIG_From_int(static_cast< int >(Gosu::kbW))); rb_define_const(mGosu, "KbX", SWIG_From_int(static_cast< int >(Gosu::kbX))); rb_define_const(mGosu, "KbY", SWIG_From_int(static_cast< int >(Gosu::kbY))); rb_define_const(mGosu, "KbZ", SWIG_From_int(static_cast< int >(Gosu::kbZ))); rb_define_const(mGosu, "KbISO", SWIG_From_int(static_cast< int >(Gosu::kbISO))); rb_define_const(mGosu, "KbNumpad0", SWIG_From_int(static_cast< int >(Gosu::kbNumpad0))); rb_define_const(mGosu, "KbNumpad1", SWIG_From_int(static_cast< int >(Gosu::kbNumpad1))); rb_define_const(mGosu, "KbNumpad2", SWIG_From_int(static_cast< int >(Gosu::kbNumpad2))); rb_define_const(mGosu, "KbNumpad3", SWIG_From_int(static_cast< int >(Gosu::kbNumpad3))); rb_define_const(mGosu, "KbNumpad4", SWIG_From_int(static_cast< int >(Gosu::kbNumpad4))); rb_define_const(mGosu, "KbNumpad5", SWIG_From_int(static_cast< int >(Gosu::kbNumpad5))); rb_define_const(mGosu, "KbNumpad6", SWIG_From_int(static_cast< int >(Gosu::kbNumpad6))); rb_define_const(mGosu, "KbNumpad7", SWIG_From_int(static_cast< int >(Gosu::kbNumpad7))); rb_define_const(mGosu, "KbNumpad8", SWIG_From_int(static_cast< int >(Gosu::kbNumpad8))); rb_define_const(mGosu, "KbNumpad9", SWIG_From_int(static_cast< int >(Gosu::kbNumpad9))); rb_define_const(mGosu, "KbNumpadAdd", SWIG_From_int(static_cast< int >(Gosu::kbNumpadAdd))); rb_define_const(mGosu, "KbNumpadSubtract", SWIG_From_int(static_cast< int >(Gosu::kbNumpadSubtract))); rb_define_const(mGosu, "KbNumpadMultiply", SWIG_From_int(static_cast< int >(Gosu::kbNumpadMultiply))); rb_define_const(mGosu, "KbNumpadDivide", SWIG_From_int(static_cast< int >(Gosu::kbNumpadDivide))); rb_define_const(mGosu, "MsLeft", SWIG_From_int(static_cast< int >(Gosu::msLeft))); rb_define_const(mGosu, "MsMiddle", SWIG_From_int(static_cast< int >(Gosu::msMiddle))); rb_define_const(mGosu, "MsRight", SWIG_From_int(static_cast< int >(Gosu::msRight))); rb_define_const(mGosu, "MsWheelUp", SWIG_From_int(static_cast< int >(Gosu::msWheelUp))); rb_define_const(mGosu, "MsWheelDown", SWIG_From_int(static_cast< int >(Gosu::msWheelDown))); rb_define_const(mGosu, "MsOther0", SWIG_From_int(static_cast< int >(Gosu::msOther0))); rb_define_const(mGosu, "MsOther1", SWIG_From_int(static_cast< int >(Gosu::msOther1))); rb_define_const(mGosu, "MsOther2", SWIG_From_int(static_cast< int >(Gosu::msOther2))); rb_define_const(mGosu, "MsOther3", SWIG_From_int(static_cast< int >(Gosu::msOther3))); rb_define_const(mGosu, "MsOther4", SWIG_From_int(static_cast< int >(Gosu::msOther4))); rb_define_const(mGosu, "MsOther5", SWIG_From_int(static_cast< int >(Gosu::msOther5))); rb_define_const(mGosu, "MsOther6", SWIG_From_int(static_cast< int >(Gosu::msOther6))); rb_define_const(mGosu, "MsOther7", SWIG_From_int(static_cast< int >(Gosu::msOther7))); rb_define_const(mGosu, "GpLeft", SWIG_From_int(static_cast< int >(Gosu::gpLeft))); rb_define_const(mGosu, "GpRight", SWIG_From_int(static_cast< int >(Gosu::gpRight))); rb_define_const(mGosu, "GpUp", SWIG_From_int(static_cast< int >(Gosu::gpUp))); rb_define_const(mGosu, "GpDown", SWIG_From_int(static_cast< int >(Gosu::gpDown))); rb_define_const(mGosu, "GpButton0", SWIG_From_int(static_cast< int >(Gosu::gpButton0))); rb_define_const(mGosu, "GpButton1", SWIG_From_int(static_cast< int >(Gosu::gpButton1))); rb_define_const(mGosu, "GpButton2", SWIG_From_int(static_cast< int >(Gosu::gpButton2))); rb_define_const(mGosu, "GpButton3", SWIG_From_int(static_cast< int >(Gosu::gpButton3))); rb_define_const(mGosu, "GpButton4", SWIG_From_int(static_cast< int >(Gosu::gpButton4))); rb_define_const(mGosu, "GpButton5", SWIG_From_int(static_cast< int >(Gosu::gpButton5))); rb_define_const(mGosu, "GpButton6", SWIG_From_int(static_cast< int >(Gosu::gpButton6))); rb_define_const(mGosu, "GpButton7", SWIG_From_int(static_cast< int >(Gosu::gpButton7))); rb_define_const(mGosu, "GpButton8", SWIG_From_int(static_cast< int >(Gosu::gpButton8))); rb_define_const(mGosu, "GpButton9", SWIG_From_int(static_cast< int >(Gosu::gpButton9))); rb_define_const(mGosu, "GpButton10", SWIG_From_int(static_cast< int >(Gosu::gpButton10))); rb_define_const(mGosu, "GpButton11", SWIG_From_int(static_cast< int >(Gosu::gpButton11))); rb_define_const(mGosu, "GpButton12", SWIG_From_int(static_cast< int >(Gosu::gpButton12))); rb_define_const(mGosu, "GpButton13", SWIG_From_int(static_cast< int >(Gosu::gpButton13))); rb_define_const(mGosu, "GpButton14", SWIG_From_int(static_cast< int >(Gosu::gpButton14))); rb_define_const(mGosu, "GpButton15", SWIG_From_int(static_cast< int >(Gosu::gpButton15))); rb_define_const(mGosu, "Gp0Left", SWIG_From_int(static_cast< int >(Gosu::gp0Left))); rb_define_const(mGosu, "Gp0Right", SWIG_From_int(static_cast< int >(Gosu::gp0Right))); rb_define_const(mGosu, "Gp0Up", SWIG_From_int(static_cast< int >(Gosu::gp0Up))); rb_define_const(mGosu, "Gp0Down", SWIG_From_int(static_cast< int >(Gosu::gp0Down))); rb_define_const(mGosu, "Gp0Button0", SWIG_From_int(static_cast< int >(Gosu::gp0Button0))); rb_define_const(mGosu, "Gp0Button1", SWIG_From_int(static_cast< int >(Gosu::gp0Button1))); rb_define_const(mGosu, "Gp0Button2", SWIG_From_int(static_cast< int >(Gosu::gp0Button2))); rb_define_const(mGosu, "Gp0Button3", SWIG_From_int(static_cast< int >(Gosu::gp0Button3))); rb_define_const(mGosu, "Gp0Button4", SWIG_From_int(static_cast< int >(Gosu::gp0Button4))); rb_define_const(mGosu, "Gp0Button5", SWIG_From_int(static_cast< int >(Gosu::gp0Button5))); rb_define_const(mGosu, "Gp0Button6", SWIG_From_int(static_cast< int >(Gosu::gp0Button6))); rb_define_const(mGosu, "Gp0Button7", SWIG_From_int(static_cast< int >(Gosu::gp0Button7))); rb_define_const(mGosu, "Gp0Button8", SWIG_From_int(static_cast< int >(Gosu::gp0Button8))); rb_define_const(mGosu, "Gp0Button9", SWIG_From_int(static_cast< int >(Gosu::gp0Button9))); rb_define_const(mGosu, "Gp0Button10", SWIG_From_int(static_cast< int >(Gosu::gp0Button10))); rb_define_const(mGosu, "Gp0Button11", SWIG_From_int(static_cast< int >(Gosu::gp0Button11))); rb_define_const(mGosu, "Gp0Button12", SWIG_From_int(static_cast< int >(Gosu::gp0Button12))); rb_define_const(mGosu, "Gp0Button13", SWIG_From_int(static_cast< int >(Gosu::gp0Button13))); rb_define_const(mGosu, "Gp0Button14", SWIG_From_int(static_cast< int >(Gosu::gp0Button14))); rb_define_const(mGosu, "Gp0Button15", SWIG_From_int(static_cast< int >(Gosu::gp0Button15))); rb_define_const(mGosu, "Gp1Left", SWIG_From_int(static_cast< int >(Gosu::gp1Left))); rb_define_const(mGosu, "Gp1Right", SWIG_From_int(static_cast< int >(Gosu::gp1Right))); rb_define_const(mGosu, "Gp1Up", SWIG_From_int(static_cast< int >(Gosu::gp1Up))); rb_define_const(mGosu, "Gp1Down", SWIG_From_int(static_cast< int >(Gosu::gp1Down))); rb_define_const(mGosu, "Gp1Button0", SWIG_From_int(static_cast< int >(Gosu::gp1Button0))); rb_define_const(mGosu, "Gp1Button1", SWIG_From_int(static_cast< int >(Gosu::gp1Button1))); rb_define_const(mGosu, "Gp1Button2", SWIG_From_int(static_cast< int >(Gosu::gp1Button2))); rb_define_const(mGosu, "Gp1Button3", SWIG_From_int(static_cast< int >(Gosu::gp1Button3))); rb_define_const(mGosu, "Gp1Button4", SWIG_From_int(static_cast< int >(Gosu::gp1Button4))); rb_define_const(mGosu, "Gp1Button5", SWIG_From_int(static_cast< int >(Gosu::gp1Button5))); rb_define_const(mGosu, "Gp1Button6", SWIG_From_int(static_cast< int >(Gosu::gp1Button6))); rb_define_const(mGosu, "Gp1Button7", SWIG_From_int(static_cast< int >(Gosu::gp1Button7))); rb_define_const(mGosu, "Gp1Button8", SWIG_From_int(static_cast< int >(Gosu::gp1Button8))); rb_define_const(mGosu, "Gp1Button9", SWIG_From_int(static_cast< int >(Gosu::gp1Button9))); rb_define_const(mGosu, "Gp1Button10", SWIG_From_int(static_cast< int >(Gosu::gp1Button10))); rb_define_const(mGosu, "Gp1Button11", SWIG_From_int(static_cast< int >(Gosu::gp1Button11))); rb_define_const(mGosu, "Gp1Button12", SWIG_From_int(static_cast< int >(Gosu::gp1Button12))); rb_define_const(mGosu, "Gp1Button13", SWIG_From_int(static_cast< int >(Gosu::gp1Button13))); rb_define_const(mGosu, "Gp1Button14", SWIG_From_int(static_cast< int >(Gosu::gp1Button14))); rb_define_const(mGosu, "Gp1Button15", SWIG_From_int(static_cast< int >(Gosu::gp1Button15))); rb_define_const(mGosu, "Gp2Left", SWIG_From_int(static_cast< int >(Gosu::gp2Left))); rb_define_const(mGosu, "Gp2Right", SWIG_From_int(static_cast< int >(Gosu::gp2Right))); rb_define_const(mGosu, "Gp2Up", SWIG_From_int(static_cast< int >(Gosu::gp2Up))); rb_define_const(mGosu, "Gp2Down", SWIG_From_int(static_cast< int >(Gosu::gp2Down))); rb_define_const(mGosu, "Gp2Button0", SWIG_From_int(static_cast< int >(Gosu::gp2Button0))); rb_define_const(mGosu, "Gp2Button1", SWIG_From_int(static_cast< int >(Gosu::gp2Button1))); rb_define_const(mGosu, "Gp2Button2", SWIG_From_int(static_cast< int >(Gosu::gp2Button2))); rb_define_const(mGosu, "Gp2Button3", SWIG_From_int(static_cast< int >(Gosu::gp2Button3))); rb_define_const(mGosu, "Gp2Button4", SWIG_From_int(static_cast< int >(Gosu::gp2Button4))); rb_define_const(mGosu, "Gp2Button5", SWIG_From_int(static_cast< int >(Gosu::gp2Button5))); rb_define_const(mGosu, "Gp2Button6", SWIG_From_int(static_cast< int >(Gosu::gp2Button6))); rb_define_const(mGosu, "Gp2Button7", SWIG_From_int(static_cast< int >(Gosu::gp2Button7))); rb_define_const(mGosu, "Gp2Button8", SWIG_From_int(static_cast< int >(Gosu::gp2Button8))); rb_define_const(mGosu, "Gp2Button9", SWIG_From_int(static_cast< int >(Gosu::gp2Button9))); rb_define_const(mGosu, "Gp2Button10", SWIG_From_int(static_cast< int >(Gosu::gp2Button10))); rb_define_const(mGosu, "Gp2Button11", SWIG_From_int(static_cast< int >(Gosu::gp2Button11))); rb_define_const(mGosu, "Gp2Button12", SWIG_From_int(static_cast< int >(Gosu::gp2Button12))); rb_define_const(mGosu, "Gp2Button13", SWIG_From_int(static_cast< int >(Gosu::gp2Button13))); rb_define_const(mGosu, "Gp2Button14", SWIG_From_int(static_cast< int >(Gosu::gp2Button14))); rb_define_const(mGosu, "Gp2Button15", SWIG_From_int(static_cast< int >(Gosu::gp2Button15))); rb_define_const(mGosu, "Gp3Left", SWIG_From_int(static_cast< int >(Gosu::gp3Left))); rb_define_const(mGosu, "Gp3Right", SWIG_From_int(static_cast< int >(Gosu::gp3Right))); rb_define_const(mGosu, "Gp3Up", SWIG_From_int(static_cast< int >(Gosu::gp3Up))); rb_define_const(mGosu, "Gp3Down", SWIG_From_int(static_cast< int >(Gosu::gp3Down))); rb_define_const(mGosu, "Gp3Button0", SWIG_From_int(static_cast< int >(Gosu::gp3Button0))); rb_define_const(mGosu, "Gp3Button1", SWIG_From_int(static_cast< int >(Gosu::gp3Button1))); rb_define_const(mGosu, "Gp3Button2", SWIG_From_int(static_cast< int >(Gosu::gp3Button2))); rb_define_const(mGosu, "Gp3Button3", SWIG_From_int(static_cast< int >(Gosu::gp3Button3))); rb_define_const(mGosu, "Gp3Button4", SWIG_From_int(static_cast< int >(Gosu::gp3Button4))); rb_define_const(mGosu, "Gp3Button5", SWIG_From_int(static_cast< int >(Gosu::gp3Button5))); rb_define_const(mGosu, "Gp3Button6", SWIG_From_int(static_cast< int >(Gosu::gp3Button6))); rb_define_const(mGosu, "Gp3Button7", SWIG_From_int(static_cast< int >(Gosu::gp3Button7))); rb_define_const(mGosu, "Gp3Button8", SWIG_From_int(static_cast< int >(Gosu::gp3Button8))); rb_define_const(mGosu, "Gp3Button9", SWIG_From_int(static_cast< int >(Gosu::gp3Button9))); rb_define_const(mGosu, "Gp3Button10", SWIG_From_int(static_cast< int >(Gosu::gp3Button10))); rb_define_const(mGosu, "Gp3Button11", SWIG_From_int(static_cast< int >(Gosu::gp3Button11))); rb_define_const(mGosu, "Gp3Button12", SWIG_From_int(static_cast< int >(Gosu::gp3Button12))); rb_define_const(mGosu, "Gp3Button13", SWIG_From_int(static_cast< int >(Gosu::gp3Button13))); rb_define_const(mGosu, "Gp3Button14", SWIG_From_int(static_cast< int >(Gosu::gp3Button14))); rb_define_const(mGosu, "Gp3Button15", SWIG_From_int(static_cast< int >(Gosu::gp3Button15))); GosusDarkSide::oncePerTick = GosusDarkSide::yieldToOtherRubyThreads; // While we are at it, to some healthy srand() - otherwise unavailable to Ruby people std::srand(static_cast(std::time(0))); std::rand(); // and flush the first value rb_define_module_function(mGosu, "disown_TextInput", VALUEFUNC(_wrap_disown_TextInput), -1); SwigClassTextInput.klass = rb_define_class_under(mGosu, "TextInput", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__TextInput, (void *) &SwigClassTextInput); rb_define_alloc_func(SwigClassTextInput.klass, _wrap_TextInput_allocate); rb_define_method(SwigClassTextInput.klass, "initialize", VALUEFUNC(_wrap_new_TextInput), -1); rb_define_method(SwigClassTextInput.klass, "text", VALUEFUNC(_wrap_TextInput_text), -1); rb_define_method(SwigClassTextInput.klass, "text=", VALUEFUNC(_wrap_TextInput_texte___), -1); rb_define_method(SwigClassTextInput.klass, "caret_pos=", VALUEFUNC(_wrap_TextInput_caret_pose___), -1); rb_define_method(SwigClassTextInput.klass, "selection_start=", VALUEFUNC(_wrap_TextInput_selection_starte___), -1); rb_define_method(SwigClassTextInput.klass, "filter", VALUEFUNC(_wrap_TextInput_filter), -1); rb_define_method(SwigClassTextInput.klass, "caret_pos", VALUEFUNC(_wrap_TextInput_caret_pos), -1); rb_define_method(SwigClassTextInput.klass, "selection_start", VALUEFUNC(_wrap_TextInput_selection_start), -1); SwigClassTextInput.mark = 0; SwigClassTextInput.destroy = (void (*)(void *)) free_Gosu_TextInput; SwigClassTextInput.trackObjects = 1; rb_define_module_function(mGosu, "disown_Window", VALUEFUNC(_wrap_disown_Window), -1); SwigClassWindow.klass = rb_define_class_under(mGosu, "Window", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Window, (void *) &SwigClassWindow); rb_define_alloc_func(SwigClassWindow.klass, _wrap_Window_allocate); rb_define_method(SwigClassWindow.klass, "initialize", VALUEFUNC(_wrap_new_Window), -1); rb_define_method(SwigClassWindow.klass, "caption", VALUEFUNC(_wrap_Window_caption), -1); rb_define_method(SwigClassWindow.klass, "caption=", VALUEFUNC(_wrap_Window_captione___), -1); rb_define_method(SwigClassWindow.klass, "update_interval", VALUEFUNC(_wrap_Window_update_interval), -1); rb_define_method(SwigClassWindow.klass, "show", VALUEFUNC(_wrap_Window_show), -1); rb_define_method(SwigClassWindow.klass, "close", VALUEFUNC(_wrap_Window_close), -1); rb_define_method(SwigClassWindow.klass, "update", VALUEFUNC(_wrap_Window_update), -1); rb_define_method(SwigClassWindow.klass, "draw", VALUEFUNC(_wrap_Window_draw), -1); rb_define_method(SwigClassWindow.klass, "needs_redraw?", VALUEFUNC(_wrap_Window_needs_redrawq___), -1); rb_define_method(SwigClassWindow.klass, "needs_cursor?", VALUEFUNC(_wrap_Window_needs_cursorq___), -1); rb_define_method(SwigClassWindow.klass, "lose_focus", VALUEFUNC(_wrap_Window_lose_focus), -1); rb_define_method(SwigClassWindow.klass, "release_memory", VALUEFUNC(_wrap_Window_release_memory), -1); rb_define_method(SwigClassWindow.klass, "button_down", VALUEFUNC(_wrap_Window_button_down), -1); rb_define_method(SwigClassWindow.klass, "button_up", VALUEFUNC(_wrap_Window_button_up), -1); rb_define_method(SwigClassWindow.klass, "draw_line", VALUEFUNC(_wrap_Window_draw_line), -1); rb_define_method(SwigClassWindow.klass, "draw_triangle", VALUEFUNC(_wrap_Window_draw_triangle), -1); rb_define_method(SwigClassWindow.klass, "draw_quad", VALUEFUNC(_wrap_Window_draw_quad), -1); rb_define_method(SwigClassWindow.klass, "flush", VALUEFUNC(_wrap_Window_flush), -1); rb_define_method(SwigClassWindow.klass, "button_down?", VALUEFUNC(_wrap_Window_button_downq___), -1); rb_define_singleton_method(SwigClassWindow.klass, "char_to_button_id", VALUEFUNC(_wrap_Window_char_to_button_id), -1); rb_define_singleton_method(SwigClassWindow.klass, "button_id_to_char", VALUEFUNC(_wrap_Window_button_id_to_char), -1); rb_define_method(SwigClassWindow.klass, "text_input", VALUEFUNC(_wrap_Window_text_input), -1); rb_define_method(SwigClassWindow.klass, "text_input=", VALUEFUNC(_wrap_Window_text_inpute___), -1); rb_define_method(SwigClassWindow.klass, "mouse_x", VALUEFUNC(_wrap_Window_mouse_x), -1); rb_define_method(SwigClassWindow.klass, "mouse_y", VALUEFUNC(_wrap_Window_mouse_y), -1); rb_define_method(SwigClassWindow.klass, "set_mouse_position", VALUEFUNC(_wrap_Window_set_mouse_position), -1); rb_define_method(SwigClassWindow.klass, "mouse_x=", VALUEFUNC(_wrap_Window_mouse_xe___), -1); rb_define_method(SwigClassWindow.klass, "mouse_y=", VALUEFUNC(_wrap_Window_mouse_ye___), -1); rb_define_method(SwigClassWindow.klass, "width", VALUEFUNC(_wrap_Window_width), -1); rb_define_method(SwigClassWindow.klass, "height", VALUEFUNC(_wrap_Window_height), -1); rb_define_method(SwigClassWindow.klass, "fullscreen?", VALUEFUNC(_wrap_Window_fullscreenq___), -1); rb_define_method(SwigClassWindow.klass, "unsafe_gl", VALUEFUNC(_wrap_Window_unsafe_gl), -1); rb_define_method(SwigClassWindow.klass, "clip_to", VALUEFUNC(_wrap_Window_clip_to), -1); rb_define_method(SwigClassWindow.klass, "record", VALUEFUNC(_wrap_Window_record), -1); rb_define_method(SwigClassWindow.klass, "transform", VALUEFUNC(_wrap_Window_transform), -1); rb_define_method(SwigClassWindow.klass, "rotate", VALUEFUNC(_wrap_Window_rotate), -1); rb_define_method(SwigClassWindow.klass, "scale", VALUEFUNC(_wrap_Window_scale), -1); rb_define_method(SwigClassWindow.klass, "translate", VALUEFUNC(_wrap_Window_translate), -1); SwigClassWindow.mark = (void (*)(void *)) markWindow; SwigClassWindow.destroy = (void (*)(void *)) free_Gosu_Window; SwigClassWindow.trackObjects = 1; }