/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.31 * * 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. * ----------------------------------------------------------------------------- */ #define SWIGRUBY #define SWIG_DIRECTORS #ifdef __cplusplus template class SwigValueWrapper { T *tt; public: SwigValueWrapper() : tt(0) { } SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } SwigValueWrapper(const T& t) : tt(new T(t)) { } ~SwigValueWrapper() { delete tt; } SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } operator T&() const { return *tt; } T *operator&() { return tt; } private: SwigValueWrapper& operator=(const SwigValueWrapper& rhs); }; #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) # if (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif # 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 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 /* ----------------------------------------------------------------------------- * 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) # if (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif # 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 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 /* ----------------------------------------------------------------------------- * swigrun.swg * * This file contains generic CAPI 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 "3" /* 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 is strictly necessary, ie, if you have problems with your compiler or so. */ #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 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 /* Flags/methods for returning states. The swig conversion methods, as ConvertPtr, return and 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 swig versions, you usually write code as: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code } else { //fail code } Now you can be more explicit as: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { // success code } else { // fail code } that seems to be the same, 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 requires also to SWIG_ConvertPtr to return new result values, 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 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif #include #ifdef __cplusplus extern "C" { #endif typedef void *(*swig_converter_func)(void *); typedef struct swig_type_info *(*swig_dycast_func)(void **); /* Structure to store inforomation 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 (l1 - f1) - (l2 - f2); } /* 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) { int equiv = 0; const char* te = tb + strlen(tb); const char* ne = nb; while (!equiv && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; if (*ne) ++ne; } return equiv; } /* Check type equivalence in a name list like ||... Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int SWIG_TypeCompare(const char *nb, const char *tb) { int equiv = 0; const char* te = tb + strlen(tb); const char* ne = nb; while (!equiv && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; if (*ne) ++ne; } return equiv; } /* think of this as a c++ template<> or a scheme macro */ #define SWIG_TypeCheck_Template(comparison, ty) \ if (ty) { \ swig_cast_info *iter = ty->cast; \ while (iter) { \ if (comparison) { \ 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 /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); } /* Same as previous function, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { SWIG_TypeCheck_Template(iter->type == from, into); } /* Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr) { return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); } /* 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) { register size_t l = 0; register size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ register size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { register 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 { register 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"; register const unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register 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) { register unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register char d = *(c++); register 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 /* 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 RARRAY_LEN # define RARRAY_LEN(x) RARRAY(x)->len #endif #ifndef RARRAY_PTR # define RARRAY_PTR(x) RARRAY(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 /* ----------------------------------------------------------------------------- * 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 funtion 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; } /* ----------------------------------------------------------------------------- * See the LICENSE file for information on copyright, usage and redistribution * of SWIG, and the README file for authors - http://www.swig.org/release.html. * * rubytracking.swg * * This file contains support for tracking mappings from * Ruby objects to C++ objects. This functionality is needed * to implement mark functions for Ruby's mark and sweep * garbage collector. * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif /* Global Ruby hash table to store Trackings from C/C++ structs to Ruby Objects. */ static VALUE swig_ruby_trackings; /* Global variable that stores a reference to the ruby hash table delete function. */ static ID swig_ruby_hash_delete = 0; /* 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. Also make sure to tell the garabage collector about the hash table. */ swig_ruby_trackings = rb_hash_new(); rb_gc_register_address(&swig_ruby_trackings); /* 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 a pointer */ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) { /* We cast the pointer to an unsigned long and then store a reference to it using a Ruby number object. */ /* Convert the pointer to a Ruby number */ unsigned long value = (unsigned long) ptr; return LONG2NUM(value); } /* 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 */ unsigned long value = (unsigned long) object; return LONG2NUM(value); } /* 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.*/ /* First convert the Ruby number to a C number */ unsigned long value = NUM2LONG(reference); return (VALUE) value; } /* Add a Tracking from a C/C++ struct to a Ruby object */ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) { /* In a Ruby hash table we store the pointer and the associated Ruby object. The trick here is that we cannot store the Ruby object directly - if we do then it cannot be garbage collected. So instead we typecast it as a unsigned long and convert it to a Ruby number object.*/ /* Get a reference to the pointer as a Ruby number */ VALUE key = SWIG_RubyPtrToReference(ptr); /* Get a reference to the Ruby object as a Ruby number */ VALUE value = SWIG_RubyObjectToReference(object); /* Store the mapping to the global hash table. */ rb_hash_aset(swig_ruby_trackings, key, value); } /* Get the Ruby object that owns the specified C/C++ struct */ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) { /* Get a reference to the pointer as a Ruby number */ VALUE key = SWIG_RubyPtrToReference(ptr); /* Now lookup the value stored in the global hash table */ VALUE value = rb_hash_aref(swig_ruby_trackings, key); if (value == Qnil) { /* No object exists - return nil. */ return Qnil; } else { /* Convert this value to Ruby object */ return SWIG_RubyReferenceToObject(value); } } /* 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) { /* Get a reference to the pointer as a Ruby number */ VALUE key = SWIG_RubyPtrToReference(ptr); /* Delete the object from the hash table by calling Ruby's do this we need to call the Hash.delete method.*/ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key); } /* 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; } #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * See the LICENSE file for information on copyright, usage and redistribution * of SWIG, and the README file for authors - http://www.swig.org/release.html. * * 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() #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), 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) /* ----------------------------------------------------------------------------- * pointers/data manipulation * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #if 0 } /* cc-mode */ #endif #endif typedef struct { VALUE klass; VALUE mImpl; void (*mark)(void *); void (*destroy)(void *); int trackObjects; } swig_class; static VALUE _mSWIG = Qnil; static VALUE _cSWIG_Pointer = Qnil; static VALUE swig_runtime_data_type_pointer = Qnil; 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"); } } /* Define Ruby class for C type */ SWIGRUNTIME void SWIG_Ruby_define_class(swig_type_info *type) { VALUE klass; 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"); } klass = 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; 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? */ if (sklass->trackObjects) { 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__"); 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) : 0), ptr); /* If tracking is on for this class then track this object. */ if (sklass->trackObjects) { 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; } *ptr = SWIG_TypeCast(tc, vptr); } 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) { 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); } #ifdef __cplusplus #if 0 { /* cc-mode */ #endif } #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) /* ----------------------------------------------------------------------------- * See the LICENSE file for information on copyright, usage and redistribution * of SWIG, and the README file for authors - http://www.swig.org/release.html. * * director.swg * * This file contains support for director classes that proxy * method calls from C++ to Ruby extensions. * ----------------------------------------------------------------------------- */ /* Use -DSWIG_DIRECTOR_NOUEH if you prefer to avoid the use of the Undefined Exception Handler provided by swift */ #ifndef SWIG_DIRECTOR_NOUEH #ifndef SWIG_DIRECTOR_UEH #define SWIG_DIRECTOR_UEH #endif #endif #ifdef __cplusplus #include #include #include 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 { 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 (strlen(msg)) { 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: VALUE getType() const { return CLASS_OF(swig_error); } VALUE getError() const { return swig_error; } const std::string& getMessage() const { return swig_msg; } virtual ~DirectorException() {} }; /* 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.getMessage() << 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 Swig::DirectorException { public: DirectorTypeMismatchException(VALUE error, const char *msg="") : Swig::DirectorException(error, "Swig director type mismatch", msg) { } DirectorTypeMismatchException(const char *msg="") : Swig::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 Swig::DirectorException { public: DirectorMethodException(VALUE error) : Swig::DirectorException(error) { } DirectorMethodException(const char* msg = "") : Swig::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 Swig::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 ownership_map; mutable ownership_map 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); owner[vptr] = new GCArray_T(vptr); } } template void swig_acquire_ownership(Type *vptr) const { if (vptr) { SWIG_GUARD(swig_mutex_own); 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); 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); ownership_map::iterator iter = owner.find(vptr); if (iter != owner.end()) { own = iter->second->get_own(); owner.erase(iter); } } return own; } }; } #endif /* __cplusplus */ /* -------- 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__Sample swig_types[6] #define SWIGTYPE_p_Gosu__SampleInstance swig_types[7] #define SWIGTYPE_p_Gosu__Song swig_types[8] #define SWIGTYPE_p_Gosu__TextInput swig_types[9] #define SWIGTYPE_p_Gosu__Window swig_types[10] #define SWIGTYPE_p_char swig_types[11] #define SWIGTYPE_p_double swig_types[12] #define SWIGTYPE_p_std__wstring swig_types[13] static swig_type_info *swig_types[15]; static swig_module_info swig_module = {swig_types, 14, 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 SWIGVERSION 0x010331 #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 write #undef close #undef read #undef sleep #undef Sleep //#ifndef WIN32 //#include //#endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // New Ruby 1.9 syntax (for compilation with Ruby 1.8) #ifndef RSTRING_LEN # define RSTRING_LEN(x) RSTRING(x)->len #endif #ifndef RSTRING_PTR # define RSTRING_PTR(x) RSTRING(x)->ptr #endif #ifndef RARRAY_LEN # define RARRAY_LEN(x) RARRAY(x)->len #endif #ifndef RARRAY_PTR # define RARRAY_PTR(x) RARRAY(x)->ptr #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(); } } // Allow filenames and RMagick Images to be passed where Bitmaps are needed. namespace Gosu { Gosu::Bitmap loadBitmap(VALUE val) { // Try to treat as filename first. if (rb_respond_to(val, rb_intern("to_str"))) { const char* filename = STR2CSTR(rb_funcall(val, rb_intern("to_str"), 0)); return quickLoadBitmap(Gosu::utf8ToWstring(filename)); } // Otherwise, try to call .to_blob on it. // (Works with RMagick). VALUE conversion = rb_str_new2("to_blob { self.format = 'RGBA'; self.depth = 8 }"); VALUE blob = rb_obj_instance_eval(1, &conversion, val); Check_SafeStr(blob); unsigned width = NUM2UINT(rb_funcall(val, rb_intern("columns"), 0)); unsigned height = NUM2UINT(rb_funcall(val, rb_intern("rows"), 0)); if (width * height * 4 != RSTRING_LEN(blob)) throw std::logic_error("Blob length mismatch!"); Bitmap result; result.resize(width, height); const unsigned* rgbaIter = reinterpret_cast(RSTRING_PTR(blob)); for (unsigned y = 0; y < height; ++y) for (unsigned x = 0; x < width; ++x) { unsigned rgba = *rgbaIter; result.setPixel(x, y, Gosu::Color(rgba).abgr()); // swap R and B ++rgbaIter; } return result; } } #include #ifndef LLONG_MIN # define LLONG_MIN LONG_LONG_MIN #endif #ifndef LLONG_MAX # define LLONG_MAX LONG_LONG_MAX #endif #ifndef ULLONG_MAX # define ULLONG_MAX ULONG_LONG_MAX #endif #define SWIG_From_long LONG2NUM SWIGINTERNINLINE VALUE SWIG_From_unsigned_SS_long (unsigned long value) { return ULONG2NUM(value); } SWIGINTERN VALUE SWIG_ruby_failed(void) { return Qnil; } /*@SWIG:%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); double *res = (double *)(args[1]); *res = (type == T_FLOAT ? NUM2DBL(obj) : (type == T_FIXNUM ? (double) FIX2INT(obj) : rb_big2dbl(obj))); 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_int (int value) { return SWIG_From_long (value); } #include /*@SWIG:%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_char (VALUE obj, unsigned char *val) { unsigned long v; int res = SWIG_AsVal_unsigned_SS_long (obj, &v); if (SWIG_IsOK(res)) { if ((v > UCHAR_MAX)) { return SWIG_OverflowError; } else { if (val) *val = static_cast< unsigned char >(v); } } return res; } SWIGINTERNINLINE VALUE SWIG_From_unsigned_SS_char (unsigned char value) { return SWIG_From_unsigned_SS_long (value); } SWIGINTERN std::string Gosu_Color_toS(Gosu::Color const *self){ std::ostringstream stream; stream << "(" << static_cast(self->alpha()) << "," << static_cast(self->red()) << "," << static_cast(self->green()) << "," << static_cast(self->blue()) << ")"; return stream.str(); } 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_From_std_string (const std::string& s) { if (s.size()) { return SWIG_FromCharPtrAndSize(s.data(), s.size()); } else { return SWIG_FromCharPtrAndSize(s.c_str(), 0); } } SWIGINTERNINLINE VALUE SWIG_From_unsigned_SS_int (unsigned int value) { return SWIG_From_unsigned_SS_long (value); } /*@SWIG:%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 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; } 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 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 hardBorders=false){ return new Gosu::Image(window.graphics(), Gosu::loadBitmap(source), hardBorders); } SWIGINTERN Gosu::Image *new_Gosu_Image__SWIG_1(Gosu::Window &window,VALUE source,bool hardBorders,unsigned int srcX,unsigned int srcY,unsigned int srcWidth,unsigned int srcHeight){ return new Gosu::Image(window.graphics(), Gosu::loadBitmap(source), srcX, srcY, srcWidth, srcHeight, hardBorders); } 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){ boost::optional info = self->getData().glTexInfo(); if (info) return new Gosu::GLTexInfo(*info); else return 0; } SWIGINTERN Gosu::Image *Gosu_Image_fromText(Gosu::Window &window,std::wstring const &text,std::wstring const &fontName,unsigned int fontHeight,unsigned int lineSpacing,unsigned int maxWidth,Gosu::TextAlign align){ Gosu::Bitmap bmp = Gosu::createText(text, fontName, fontHeight, lineSpacing, maxWidth, align); return new Gosu::Image(window.graphics(), bmp); } SWIGINTERN std::vector Gosu_Image_loadTiles(Gosu::Window &window,VALUE source,int tileWidth,int tileHeight,bool hardBorders){ std::vector vec; // TODO: const correctness (<- did I mean exception safety?) Gosu::imagesFromTiledBitmap(window.graphics(), Gosu::loadBitmap(source), tileWidth, tileHeight, hardBorders, vec); return vec; } SWIGINTERNINLINE VALUE SWIG_From_bool (bool value) { return value ? Qtrue : Qfalse; } SWIGINTERN int SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc) { if (TYPE(obj) == T_STRING) { char *cstr = STR2CSTR(obj); size_t size = RSTRING_LEN(obj) + 1; if (cptr) { if (alloc) { if (*alloc == SWIG_NEWOBJ) { *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; } } } if (psize) *psize = size; return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); if (pchar_descriptor) { void* vptr = 0; if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { if (cptr) *cptr = (char *)vptr; if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0; if (alloc) *alloc = SWIG_OLDOBJ; return SWIG_OK; } } } return SWIG_TypeError; } SWIGINTERN int SWIG_AsPtr_std_string (VALUE obj, std::string **val) { char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { if (buf) { if (val) *val = new std::string(buf, size - 1); if (alloc == SWIG_NEWOBJ) delete[] buf; return SWIG_NEWOBJ; } else { if (val) *val = 0; return SWIG_OLDOBJ; } } else { static int init = 0; static swig_type_info* descriptor = 0; if (!init) { descriptor = SWIG_TypeQuery("std::string" " *"); init = 1; } if (descriptor) { std::string *vptr; int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); if (SWIG_IsOK(res) && val) *val = vptr; return res; } } return SWIG_ERROR; } SWIGINTERN Gosu::Sample *new_Gosu_Sample(Gosu::Window &window,std::string const &filename){ return new Gosu::Sample(window.audio(), Gosu::utf8ToWstring(filename)); } SWIGINTERN Gosu::Song *new_Gosu_Song(Gosu::Window &window,std::string const &filename){ return new Gosu::Song(window.audio(), Gosu::utf8ToWstring(filename)); } SWIGINTERN unsigned int Gosu_TextInput_caret_pos(Gosu::TextInput const *self){ return Gosu::wstringToUTF8(self->text().substr(0, self->caretPos())).size(); } SWIGINTERN unsigned int Gosu_TextInput_selection_start(Gosu::TextInput const *self){ return Gosu::wstringToUTF8(self->text().substr(0, self->selectionStart())).size(); } 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 bool Gosu_Window_isButtonDown(Gosu::Window const *self,Gosu::Button btn){ return self->input().down(btn); } SWIGINTERN Gosu::Button Gosu_Window_charToButtonId(Gosu::Window *self,wchar_t ch){ return self->input().charToId(ch); } SWIGINTERN wchar_t Gosu_Window_buttonIdToChar(Gosu::Window *self,Gosu::Button btn){ return self->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 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 void Gosu_Window_gl(Gosu::Window *self){ self->graphics().beginGL(); rb_yield(Qnil); self->graphics().endGL(); } SWIGINTERN void Gosu_Window_clipTo(Gosu::Window *self,int x,int y,unsigned int width,unsigned int height){ self->graphics().beginClipping(x, y, width, height); rb_yield(Qnil); self->graphics().endClipping(); } static void markWindow(void* window) { Gosu::TextInput* ti = static_cast(window)->input().textInput(); if (VALUE ti_value = SWIG_RubyInstanceFor(ti)) rb_gc_mark(ti_value); } /* --------------------------------------------------- * C++ director class helpers * --------------------------------------------------- */ /* --------------------------------------------------- * C++ director class methods * --------------------------------------------------- */ #include "RubyGosu_wrap.h" 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("update"), 0, NULL); } void SwigDirector_Window::draw() { VALUE result; result = rb_funcall(swig_get_self(), rb_intern("draw"), 0, NULL); } void SwigDirector_Window::buttonDown(Gosu::Button arg0) { VALUE obj0 = Qnil ; VALUE result; { obj0 = LONG2NUM((&arg0)->getId()); } result = rb_funcall(swig_get_self(), rb_intern("button_down"), 1,obj0); } void SwigDirector_Window::buttonUp(Gosu::Button arg0) { VALUE obj0 = Qnil ; VALUE result; { obj0 = LONG2NUM((&arg0)->getId()); } result = rb_funcall(swig_get_self(), rb_intern("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::runtime_error& 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_trunc(int argc, VALUE *argv, VALUE self) { double arg1 ; long result; double val1 ; int ecode1 = 0 ; 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), "in method '" "Gosu::trunc" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); { try { result = (long)Gosu::trunc(arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_long(static_cast< long >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_round(int argc, VALUE *argv, VALUE self) { double arg1 ; long result; double val1 ; int ecode1 = 0 ; 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), "in method '" "Gosu::round" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); { try { result = (long)Gosu::round(arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_long(static_cast< long >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_random(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double result; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; 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), "in method '" "Gosu::random" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::random" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::random(arg1,arg2); } catch(const std::runtime_error& 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 result; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; 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), "in method '" "Gosu::offsetX" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::offsetX" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::offsetX(arg1,arg2); } catch(const std::runtime_error& 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 result; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; 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), "in method '" "Gosu::offsetY" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::offsetY" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::offsetY(arg1,arg2); } catch(const std::runtime_error& 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 result; 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 ; 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), "in method '" "Gosu::angle" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::angle" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::angle" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu::angle" "', argument " "4"" of type '" "double""'"); } 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), "in method '" "Gosu::angle" "', argument " "5"" of type '" "double""'"); } arg5 = static_cast< double >(val5); } { try { result = (double)Gosu::angle(arg1,arg2,arg3,arg4,arg5); } catch(const std::runtime_error& 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 result; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; 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), "in method '" "Gosu::angleDiff" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::angleDiff" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { result = (double)Gosu::angleDiff(arg1,arg2); } catch(const std::runtime_error& 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 result; double val1 ; int ecode1 = 0 ; 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), "in method '" "Gosu::normalizeAngle" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); { try { result = (double)Gosu::normalizeAngle(arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_distance_sqr(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double arg3 ; double arg4 ; double result; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; 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), "in method '" "Gosu::distanceSqr" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::distanceSqr" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::distanceSqr" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu::distanceSqr" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); { try { result = (double)Gosu::distanceSqr(arg1,arg2,arg3,arg4); } catch(const std::runtime_error& 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 result; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; 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), "in method '" "Gosu::distance" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::distance" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::distance" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu::distance" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); { try { result = (double)Gosu::distance(arg1,arg2,arg3,arg4); } catch(const std::runtime_error& 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::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); } return vresult; fail: return Qnil; } swig_class cColor; SWIGINTERN VALUE _wrap_new_Color__SWIG_0(int argc, VALUE *argv, VALUE self) { Gosu::Color *result = 0 ; const char *classname SWIGUNUSED = "Gosu::Color"; 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::runtime_error& 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) { boost::uint32_t arg1 ; Gosu::Color *result = 0 ; unsigned long val1 ; int ecode1 = 0 ; const char *classname SWIGUNUSED = "Gosu::Color"; 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), "in method '" "Gosu::Color" "', argument " "1"" of type '" "boost::uint32_t""'"); } arg1 = static_cast< boost::uint32_t >(val1); { try { result = (Gosu::Color *)new Gosu::Color(arg1);DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch(const std::runtime_error& 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 ; Gosu::Color *result = 0 ; unsigned char val1 ; int ecode1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; unsigned char val3 ; int ecode3 = 0 ; const char *classname SWIGUNUSED = "Gosu::Color"; if ((argc < 3) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_char(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Gosu::Color" "', argument " "1"" of type '" "Gosu::Color::Channel""'"); } arg1 = static_cast< Gosu::Color::Channel >(val1); ecode2 = SWIG_AsVal_unsigned_SS_char(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::Color" "', argument " "2"" of type '" "Gosu::Color::Channel""'"); } arg2 = static_cast< Gosu::Color::Channel >(val2); ecode3 = SWIG_AsVal_unsigned_SS_char(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::Color" "', argument " "3"" of type '" "Gosu::Color::Channel""'"); } arg3 = static_cast< Gosu::Color::Channel >(val3); { try { result = (Gosu::Color *)new Gosu::Color(arg1,arg2,arg3);DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch(const std::runtime_error& 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 ; Gosu::Color *result = 0 ; unsigned char val1 ; int ecode1 = 0 ; unsigned char val2 ; int ecode2 = 0 ; unsigned char val3 ; int ecode3 = 0 ; unsigned char val4 ; int ecode4 = 0 ; const char *classname SWIGUNUSED = "Gosu::Color"; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_char(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Gosu::Color" "', argument " "1"" of type '" "Gosu::Color::Channel""'"); } arg1 = static_cast< Gosu::Color::Channel >(val1); ecode2 = SWIG_AsVal_unsigned_SS_char(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::Color" "', argument " "2"" of type '" "Gosu::Color::Channel""'"); } arg2 = static_cast< Gosu::Color::Channel >(val2); ecode3 = SWIG_AsVal_unsigned_SS_char(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::Color" "', argument " "3"" of type '" "Gosu::Color::Channel""'"); } arg3 = static_cast< Gosu::Color::Channel >(val3); ecode4 = SWIG_AsVal_unsigned_SS_char(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu::Color" "', argument " "4"" of type '" "Gosu::Color::Channel""'"); } arg4 = static_cast< Gosu::Color::Channel >(val4); { try { result = (Gosu::Color *)new Gosu::Color(arg1,arg2,arg3,arg4);DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch(const std::runtime_error& 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_long(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_new_Color__SWIG_1(nargs, args, self); } } if (argc == 3) { int _v; { int res = SWIG_AsVal_unsigned_SS_char(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_char(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_char(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_new_Color__SWIG_2(nargs, args, self); } } } } if (argc == 4) { int _v; { int res = SWIG_AsVal_unsigned_SS_char(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_char(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_char(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_unsigned_SS_char(argv[3], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_new_Color__SWIG_3(nargs, args, self); } } } } } fail: rb_raise(rb_eArgError, "No matching function for overloaded 'new_Color'"); return Qnil; } SWIGINTERN VALUE _wrap_Color_from_hsv(int argc, VALUE *argv, VALUE self) { double arg1 ; double arg2 ; double arg3 ; Gosu::Color result; double val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; 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), "in method '" "Gosu::Color::fromHSV" "', argument " "1"" of type '" "double""'"); } arg1 = static_cast< double >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::Color::fromHSV" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::Color::fromHSV" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); { try { result = Gosu::Color::fromHSV(arg1,arg2,arg3); } catch(const std::runtime_error& 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 ; Gosu::Color result; unsigned char val1 ; int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; VALUE vresult = Qnil; if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_char(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Gosu::Color::fromAHSV" "', argument " "1"" of type '" "Gosu::Color::Channel""'"); } arg1 = static_cast< Gosu::Color::Channel >(val1); ecode2 = SWIG_AsVal_double(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::Color::fromAHSV" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::Color::fromAHSV" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu::Color::fromAHSV" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); { try { result = Gosu::Color::fromAHSV(arg1,arg2,arg3,arg4); } catch(const std::runtime_error& 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_alpha(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; Gosu::Color::Channel result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "alpha" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->alpha(); } catch(const std::runtime_error& 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_red(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; Gosu::Color::Channel result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "red" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->red(); } catch(const std::runtime_error& 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 ; Gosu::Color::Channel result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "green" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->green(); } catch(const std::runtime_error& 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 ; Gosu::Color::Channel result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "blue" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->blue(); } catch(const std::runtime_error& 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_alphae___(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; Gosu::Color::Channel arg2 ; void *argp1 = 0 ; int res1 = 0 ; unsigned char 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), "in method '" "setAlpha" "', argument " "1"" of type '" "Gosu::Color *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_char(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setAlpha" "', argument " "2"" of type '" "Gosu::Color::Channel""'"); } arg2 = static_cast< Gosu::Color::Channel >(val2); { try { (arg1)->setAlpha(arg2); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; 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 ; unsigned char 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), "in method '" "setRed" "', argument " "1"" of type '" "Gosu::Color *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_char(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setRed" "', argument " "2"" of type '" "Gosu::Color::Channel""'"); } arg2 = static_cast< Gosu::Color::Channel >(val2); { try { (arg1)->setRed(arg2); } catch(const std::runtime_error& 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 ; unsigned char 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), "in method '" "setGreen" "', argument " "1"" of type '" "Gosu::Color *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_char(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setGreen" "', argument " "2"" of type '" "Gosu::Color::Channel""'"); } arg2 = static_cast< Gosu::Color::Channel >(val2); { try { (arg1)->setGreen(arg2); } catch(const std::runtime_error& 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 ; unsigned char 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), "in method '" "setBlue" "', argument " "1"" of type '" "Gosu::Color *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_char(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setBlue" "', argument " "2"" of type '" "Gosu::Color::Channel""'"); } arg2 = static_cast< Gosu::Color::Channel >(val2); { try { (arg1)->setBlue(arg2); } catch(const std::runtime_error& 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 ; double result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hue" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = (double)((Gosu::Color const *)arg1)->hue(); } catch(const std::runtime_error& 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), "in method '" "setHue" "', argument " "1"" of type '" "Gosu::Color *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setHue" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { (arg1)->setHue(arg2); } catch(const std::runtime_error& 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 ; double result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "saturation" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = (double)((Gosu::Color const *)arg1)->saturation(); } catch(const std::runtime_error& 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), "in method '" "setSaturation" "', argument " "1"" of type '" "Gosu::Color *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setSaturation" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { (arg1)->setSaturation(arg2); } catch(const std::runtime_error& 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 ; double result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "value" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = (double)((Gosu::Color const *)arg1)->value(); } catch(const std::runtime_error& 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), "in method '" "setValue" "', argument " "1"" of type '" "Gosu::Color *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setValue" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { (arg1)->setValue(arg2); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Color_argb(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; boost::uint32_t result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "argb" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->argb(); } catch(const std::runtime_error& 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 ; boost::uint32_t result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bgr" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->bgr(); } catch(const std::runtime_error& 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 ; boost::uint32_t result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "abgr" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = ((Gosu::Color const *)arg1)->abgr(); } catch(const std::runtime_error& 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_to_s(int argc, VALUE *argv, VALUE self) { Gosu::Color *arg1 = (Gosu::Color *) 0 ; std::string result; void *argp1 = 0 ; int res1 = 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__Color, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "toS" "', argument " "1"" of type '" "Gosu::Color const *""'"); } arg1 = reinterpret_cast< Gosu::Color * >(argp1); { try { result = Gosu_Color_toS((Gosu::Color const *)arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_std_string(static_cast< std::string >(result)); return vresult; fail: return Qnil; } SWIGINTERN void free_Gosu_Color(Gosu::Color *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_interpolate(int argc, VALUE *argv, VALUE self) { Gosu::Color arg1 ; Gosu::Color arg2 ; double arg3 = (double) 0.5 ; Gosu::Color result; double val3 ; int ecode3 = 0 ; VALUE vresult = Qnil; if ((argc < 2) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } { void* ptr; int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg1 = Gosu::Color(NUM2UINT(argv[0])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg1 = *reinterpret_cast(ptr); } { void* ptr; int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg2 = Gosu::Color(NUM2UINT(argv[1])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg2 = *reinterpret_cast(ptr); } if (argc > 2) { ecode3 = SWIG_AsVal_double(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Gosu::interpolate" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); } { try { result = Gosu::interpolate(arg1,arg2,arg3); } catch(const std::runtime_error& 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_multiply(int argc, VALUE *argv, VALUE self) { Gosu::Color arg1 ; Gosu::Color arg2 ; Gosu::Color result; VALUE vresult = Qnil; if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } { void* ptr; int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg1 = Gosu::Color(NUM2UINT(argv[0])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg1 = *reinterpret_cast(ptr); } { void* ptr; int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg2 = Gosu::Color(NUM2UINT(argv[1])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg2 = *reinterpret_cast(ptr); } { try { result = Gosu::multiply(arg1,arg2); } catch(const std::runtime_error& 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 none_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::none), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE black_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::black), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE gray_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::gray), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE white_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::white), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE red_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::red), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE green_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::green), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE blue_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::blue), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE yellow_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::yellow), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE fuchsia_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::fuchsia), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } SWIGINTERN VALUE cyan_get(VALUE self) { VALUE _val; _val = SWIG_NewPointerObj(SWIG_as_voidptr(&Gosu::Colors::cyan), SWIGTYPE_p_Gosu__Color, 0 ); return _val; } swig_class cFont; SWIGINTERN void free_Gosu_Font(Gosu::Font *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_Font_height(int argc, VALUE *argv, VALUE self) { Gosu::Font *arg1 = (Gosu::Font *) 0 ; unsigned int result; void *argp1 = 0 ; int res1 = 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__Font, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "height" "', argument " "1"" of type '" "Gosu::Font const *""'"); } arg1 = reinterpret_cast< Gosu::Font * >(argp1); { try { result = (unsigned int)((Gosu::Font const *)arg1)->height(); } catch(const std::runtime_error& 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 ; double result; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; double val3 ; int ecode3 = 0 ; 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), "in method '" "textWidth" "', argument " "1"" of type '" "Gosu::Font const *""'"); } 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), "in method '" "textWidth" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); } { try { result = (double)((Gosu::Font const *)arg1)->textWidth((std::wstring const &)*arg2,arg3); } catch(const std::runtime_error& 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::Colors::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), "in method '" "draw" "', argument " "1"" of type '" "Gosu::Font const *""'"); } 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), "in method '" "draw" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "draw" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "draw" "', argument " "5"" of type '" "Gosu::ZPos""'"); } 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), "in method '" "draw" "', argument " "6"" of type '" "double""'"); } 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), "in method '" "draw" "', argument " "7"" of type '" "double""'"); } arg7 = static_cast< double >(val7); } if (argc > 6) { { void* ptr; int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg8 = Gosu::Color(NUM2UINT(argv[6])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg8 = *reinterpret_cast(ptr); } } if (argc > 7) { { VALUE localTemporary = rb_obj_as_string(argv[7]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg9 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg9 = Gosu::amAdditive; 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::runtime_error& 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::Colors::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), "in method '" "drawRel" "', argument " "1"" of type '" "Gosu::Font const *""'"); } 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), "in method '" "drawRel" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "drawRel" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "drawRel" "', argument " "5"" of type '" "Gosu::ZPos""'"); } arg5 = static_cast< Gosu::ZPos >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "drawRel" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); ecode7 = SWIG_AsVal_double(argv[5], &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "drawRel" "', argument " "7"" of type '" "double""'"); } 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), "in method '" "drawRel" "', argument " "8"" of type '" "double""'"); } 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), "in method '" "drawRel" "', argument " "9"" of type '" "double""'"); } arg9 = static_cast< double >(val9); } if (argc > 8) { { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg10 = Gosu::Color(NUM2UINT(argv[8])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } if (argc > 9) { { VALUE localTemporary = rb_obj_as_string(argv[9]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg11 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg11 = Gosu::amAdditive; 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::runtime_error& 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::Colors::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), "in method '" "drawRot" "', argument " "1"" of type '" "Gosu::Font const *""'"); } 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), "in method '" "drawRot" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "drawRot" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "drawRot" "', argument " "5"" of type '" "Gosu::ZPos""'"); } arg5 = static_cast< Gosu::ZPos >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "drawRot" "', argument " "6"" of type '" "double""'"); } 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), "in method '" "drawRot" "', argument " "7"" of type '" "double""'"); } 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), "in method '" "drawRot" "', argument " "8"" of type '" "double""'"); } arg8 = static_cast< double >(val8); } if (argc > 7) { { void* ptr; int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg9 = Gosu::Color(NUM2UINT(argv[7])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg9 = *reinterpret_cast(ptr); } } if (argc > 8) { { VALUE localTemporary = rb_obj_as_string(argv[8]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg10 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg10 = Gosu::amAdditive; 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::runtime_error& 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 ; Gosu::Font *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; unsigned int val3 ; int ecode3 = 0 ; const char *classname SWIGUNUSED = "Gosu::Font"; 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), "in method '" "Gosu::Font" "', argument " "1"" of type '" "Gosu::Window &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu::Font" "', argument " "1"" of type '" "Gosu::Window &""'"); } 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), "in method '" "Gosu::Font" "', argument " "3"" of type '" "unsigned int""'"); } 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::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return self; fail: return Qnil; } swig_class cGLTexInfo; 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), "in method '" "texName" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "texName" "', argument " "2"" of type '" "int""'"); } 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 ; int result; void *argp1 = 0 ; int res1 = 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "texName" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } 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 ; 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "left" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "left" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(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 ; double result; void *argp1 = 0 ; int res1 = 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "left" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (double) ((arg1)->left); vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_right_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "right" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "right" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(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 ; double result; void *argp1 = 0 ; int res1 = 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "right" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (double) ((arg1)->right); vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_top_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "top" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "top" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(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 ; double result; void *argp1 = 0 ; int res1 = 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "top" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (double) ((arg1)->top); vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_GLTexInfo_bottom_set(int argc, VALUE *argv, VALUE self) { Gosu::GLTexInfo *arg1 = (Gosu::GLTexInfo *) 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bottom" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bottom" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(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 ; double result; void *argp1 = 0 ; int res1 = 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__GLTexInfo, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bottom" "', argument " "1"" of type '" "Gosu::GLTexInfo *""'"); } arg1 = reinterpret_cast< Gosu::GLTexInfo * >(argp1); result = (double) ((arg1)->bottom); vresult = SWIG_From_double(static_cast< double >(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) { Gosu::GLTexInfo *result = 0 ; const char *classname SWIGUNUSED = "Gosu::GLTexInfo"; 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::runtime_error& 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; } swig_class cImage; SWIGINTERN void free_Gosu_Image(Gosu::Image *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_Image_width(int argc, VALUE *argv, VALUE self) { Gosu::Image *arg1 = (Gosu::Image *) 0 ; unsigned int result; void *argp1 = 0 ; int res1 = 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), "in method '" "width" "', argument " "1"" of type '" "Gosu::Image const *""'"); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (unsigned int)((Gosu::Image const *)arg1)->width(); } catch(const std::runtime_error& 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 ; unsigned int result; void *argp1 = 0 ; int res1 = 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), "in method '" "height" "', argument " "1"" of type '" "Gosu::Image const *""'"); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (unsigned int)((Gosu::Image const *)arg1)->height(); } catch(const std::runtime_error& 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::Colors::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), "in method '" "draw" "', argument " "1"" of type '" "Gosu::Image const *""'"); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "draw" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "draw" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "draw" "', argument " "4"" of type '" "Gosu::ZPos""'"); } 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), "in method '" "draw" "', argument " "5"" of type '" "double""'"); } 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), "in method '" "draw" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); } if (argc > 5) { { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg7 = Gosu::Color(NUM2UINT(argv[5])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } } if (argc > 6) { { VALUE localTemporary = rb_obj_as_string(argv[6]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg8 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg8 = Gosu::amAdditive; 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::runtime_error& 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), "in method '" "drawMod" "', argument " "1"" of type '" "Gosu::Image const *""'"); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drawMod" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "drawMod" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "drawMod" "', argument " "4"" of type '" "Gosu::ZPos""'"); } arg4 = static_cast< Gosu::ZPos >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "drawMod" "', argument " "5"" of type '" "double""'"); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "drawMod" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg7 = Gosu::Color(NUM2UINT(argv[5])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg7 = *reinterpret_cast(ptr); } { void* ptr; int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg8 = Gosu::Color(NUM2UINT(argv[6])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg8 = *reinterpret_cast(ptr); } { void* ptr; int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg9 = Gosu::Color(NUM2UINT(argv[7])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg9 = *reinterpret_cast(ptr); } { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg10 = Gosu::Color(NUM2UINT(argv[8])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } if (argc > 9) { { VALUE localTemporary = rb_obj_as_string(argv[9]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg11 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg11 = Gosu::amAdditive; 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::runtime_error& 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::Colors::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), "in method '" "drawRot" "', argument " "1"" of type '" "Gosu::Image const *""'"); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drawRot" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "drawRot" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); ecode4 = SWIG_AsVal_double(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "drawRot" "', argument " "4"" of type '" "Gosu::ZPos""'"); } arg4 = static_cast< Gosu::ZPos >(val4); ecode5 = SWIG_AsVal_double(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "drawRot" "', argument " "5"" of type '" "double""'"); } 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), "in method '" "drawRot" "', argument " "6"" of type '" "double""'"); } 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), "in method '" "drawRot" "', argument " "7"" of type '" "double""'"); } 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), "in method '" "drawRot" "', argument " "8"" of type '" "double""'"); } 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), "in method '" "drawRot" "', argument " "9"" of type '" "double""'"); } arg9 = static_cast< double >(val9); } if (argc > 8) { { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg10 = Gosu::Color(NUM2UINT(argv[8])); else if (!ptr) SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color"); else arg10 = *reinterpret_cast(ptr); } } if (argc > 9) { { VALUE localTemporary = rb_obj_as_string(argv[9]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg11 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg11 = Gosu::amAdditive; 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::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; 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 ; Gosu::Image *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; bool val3 ; int ecode3 = 0 ; const char *classname SWIGUNUSED = "Gosu::Image"; 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), "in method '" "Gosu::Image" "', argument " "1"" of type '" "Gosu::Window &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu::Image" "', argument " "1"" of type '" "Gosu::Window &""'"); } 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), "in method '" "Gosu::Image" "', argument " "3"" of type '" "bool""'"); } 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::runtime_error& 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 ; Gosu::Image *result = 0 ; 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"; 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), "in method '" "Gosu::Image" "', argument " "1"" of type '" "Gosu::Window &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu::Image" "', argument " "1"" of type '" "Gosu::Window &""'"); } 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), "in method '" "Gosu::Image" "', argument " "3"" of type '" "bool""'"); } arg3 = static_cast< bool >(val3); ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu::Image" "', argument " "4"" of type '" "unsigned int""'"); } 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), "in method '" "Gosu::Image" "', argument " "5"" of type '" "unsigned int""'"); } 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), "in method '" "Gosu::Image" "', argument " "6"" of type '" "unsigned int""'"); } 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), "in method '" "Gosu::Image" "', argument " "7"" of type '" "unsigned int""'"); } 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::runtime_error& 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: rb_raise(rb_eArgError, "No matching function for overloaded 'new_Image'"); 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), "in method '" "drawAsQuad" "', argument " "1"" of type '" "Gosu::Image *""'"); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drawAsQuad" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "drawAsQuad" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg4 = Gosu::Color(NUM2UINT(argv[2])); 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), "in method '" "drawAsQuad" "', argument " "5"" of type '" "double""'"); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "drawAsQuad" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg7 = Gosu::Color(NUM2UINT(argv[5])); 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), "in method '" "drawAsQuad" "', argument " "8"" of type '" "double""'"); } arg8 = static_cast< double >(val8); ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "drawAsQuad" "', argument " "9"" of type '" "double""'"); } arg9 = static_cast< double >(val9); { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg10 = Gosu::Color(NUM2UINT(argv[8])); 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), "in method '" "drawAsQuad" "', argument " "11"" of type '" "double""'"); } arg11 = static_cast< double >(val11); ecode12 = SWIG_AsVal_double(argv[10], &val12); if (!SWIG_IsOK(ecode12)) { SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "drawAsQuad" "', argument " "12"" of type '" "double""'"); } arg12 = static_cast< double >(val12); { void* ptr; int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg13 = Gosu::Color(NUM2UINT(argv[11])); 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), "in method '" "drawAsQuad" "', argument " "14"" of type '" "Gosu::ZPos""'"); } arg14 = static_cast< Gosu::ZPos >(val14); if (argc > 13) { { VALUE localTemporary = rb_obj_as_string(argv[13]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg15 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg15 = Gosu::amAdditive; 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::runtime_error& 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 ; Gosu::GLTexInfo *result = 0 ; void *argp1 = 0 ; int res1 = 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), "in method '" "glTexInfo" "', argument " "1"" of type '" "Gosu::Image const *""'"); } arg1 = reinterpret_cast< Gosu::Image * >(argp1); { try { result = (Gosu::GLTexInfo *)Gosu_Image_glTexInfo((Gosu::Image const *)arg1); } catch(const std::runtime_error& 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_from_text(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = 0 ; std::wstring *arg2 = 0 ; std::wstring *arg3 = 0 ; unsigned int arg4 ; unsigned int arg5 ; unsigned int arg6 ; Gosu::TextAlign arg7 ; Gosu::Image *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; std::wstring temp2 ; std::wstring temp3 ; unsigned int val4 ; int ecode4 = 0 ; unsigned int val5 ; int ecode5 = 0 ; unsigned int val6 ; int ecode6 = 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), "in method '" "Gosu_Image_fromText" "', argument " "1"" of type '" "Gosu::Window &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu_Image_fromText" "', argument " "1"" of type '" "Gosu::Window &""'"); } 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), "in method '" "Gosu_Image_fromText" "', argument " "4"" of type '" "unsigned int""'"); } 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), "in method '" "Gosu_Image_fromText" "', argument " "5"" of type '" "unsigned int""'"); } 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), "in method '" "Gosu_Image_fromText" "', argument " "6"" of type '" "unsigned int""'"); } arg6 = static_cast< unsigned int >(val6); { VALUE localTemporary = rb_obj_as_string(argv[6]); if (!strcmp(StringValueCStr(localTemporary), "left")) arg7 = Gosu::taLeft; else if (!strcmp(StringValueCStr(localTemporary), "center")) arg7 = Gosu::taCenter; else if (!strcmp(StringValueCStr(localTemporary), "right")) arg7 = Gosu::taRight; else if (!strcmp(StringValueCStr(localTemporary), "justify")) arg7 = Gosu::taJustify; else SWIG_exception_fail(SWIG_ValueError, "invalid text align"); } { try { result = (Gosu::Image *)Gosu_Image_fromText(*arg1,(std::wstring const &)*arg2,(std::wstring const &)*arg3,arg4,arg5,arg6,arg7); } catch(const std::runtime_error& 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 ; SwigValueWrapper > result; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; bool val5 ; int ecode5 = 0 ; 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), "in method '" "Gosu_Image_loadTiles" "', argument " "1"" of type '" "Gosu::Window &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu_Image_loadTiles" "', argument " "1"" of type '" "Gosu::Window &""'"); } 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), "in method '" "Gosu_Image_loadTiles" "', argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); ecode4 = SWIG_AsVal_int(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu_Image_loadTiles" "', argument " "4"" of type '" "int""'"); } arg4 = static_cast< int >(val4); ecode5 = SWIG_AsVal_bool(argv[4], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Gosu_Image_loadTiles" "', argument " "5"" of type '" "bool""'"); } arg5 = static_cast< bool >(val5); { try { result = Gosu_Image_loadTiles(*arg1,arg2,arg3,arg4,arg5); } catch(const std::runtime_error& 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; } swig_class cSampleInstance; #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 ; Gosu::SampleInstance *result = 0 ; int val1 ; int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; const char *classname SWIGUNUSED = "Gosu::SampleInstance"; 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), "in method '" "Gosu::SampleInstance" "', argument " "1"" of type '" "int""'"); } arg1 = static_cast< int >(val1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Gosu::SampleInstance" "', argument " "2"" of type '" "int""'"); } 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::runtime_error& 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 ; bool result; void *argp1 = 0 ; int res1 = 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__SampleInstance, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "playing" "', argument " "1"" of type '" "Gosu::SampleInstance const *""'"); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); { try { result = (bool)((Gosu::SampleInstance const *)arg1)->playing(); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_bool(static_cast< bool >(result)); return vresult; 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), "in method '" "stop" "', argument " "1"" of type '" "Gosu::SampleInstance *""'"); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); { try { (arg1)->stop(); } catch(const std::runtime_error& 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), "in method '" "changeVolume" "', argument " "1"" of type '" "Gosu::SampleInstance *""'"); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "changeVolume" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { (arg1)->changeVolume(arg2); } catch(const std::runtime_error& 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), "in method '" "changePan" "', argument " "1"" of type '" "Gosu::SampleInstance *""'"); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "changePan" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { (arg1)->changePan(arg2); } catch(const std::runtime_error& 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), "in method '" "changeSpeed" "', argument " "1"" of type '" "Gosu::SampleInstance *""'"); } arg1 = reinterpret_cast< Gosu::SampleInstance * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "changeSpeed" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { (arg1)->changeSpeed(arg2); } catch(const std::runtime_error& 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; } swig_class cSample; SWIGINTERN void free_Gosu_Sample(Gosu::Sample *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } 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 ; SwigValueWrapper result; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; VALUE vresult = Qnil; if ((argc < 0) || (argc > 2)) { 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), "in method '" "play" "', argument " "1"" of type '" "Gosu::Sample const *""'"); } 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), "in method '" "play" "', argument " "2"" of type '" "double""'"); } 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), "in method '" "play" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); } { try { result = ((Gosu::Sample const *)arg1)->play(arg2,arg3); } catch(const std::runtime_error& 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 ; SwigValueWrapper result; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; double val4 ; int ecode4 = 0 ; VALUE vresult = Qnil; 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__Sample, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "playPan" "', argument " "1"" of type '" "Gosu::Sample const *""'"); } arg1 = reinterpret_cast< Gosu::Sample * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "playPan" "', argument " "2"" of type '" "double""'"); } 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), "in method '" "playPan" "', argument " "3"" of type '" "double""'"); } 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), "in method '" "playPan" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); } { try { result = ((Gosu::Sample const *)arg1)->playPan(arg2,arg3,arg4); } catch(const std::runtime_error& 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; } #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) { Gosu::Window *arg1 = 0 ; std::string *arg2 = 0 ; Gosu::Sample *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; const char *classname SWIGUNUSED = "Gosu::Sample"; if ((argc < 2) || (argc > 2)) { 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), "in method '" "Gosu::Sample" "', argument " "1"" of type '" "Gosu::Window &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu::Sample" "', argument " "1"" of type '" "Gosu::Window &""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(argv[1], &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Gosu::Sample" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu::Sample" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { try { result = (Gosu::Sample *)new_Gosu_Sample(*arg1,(std::string const &)*arg2);DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } if (SWIG_IsNewObj(res2)) delete arg2; return self; fail: if (SWIG_IsNewObj(res2)) delete arg2; return Qnil; } swig_class cSong; SWIGINTERN void free_Gosu_Song(Gosu::Song *arg1) { SWIG_RubyRemoveTracking(arg1); delete arg1; } SWIGINTERN VALUE _wrap_Song_play(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), "in method '" "play" "', argument " "1"" of type '" "Gosu::Song *""'"); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { (arg1)->play(); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; 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), "in method '" "stop" "', argument " "1"" of type '" "Gosu::Song *""'"); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { (arg1)->stop(); } catch(const std::runtime_error& 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 ; bool result; void *argp1 = 0 ; int res1 = 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__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "playing" "', argument " "1"" of type '" "Gosu::Song const *""'"); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { result = (bool)((Gosu::Song const *)arg1)->playing(); } catch(const std::runtime_error& 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 ; double result; void *argp1 = 0 ; int res1 = 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__Song, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "volume" "', argument " "1"" of type '" "Gosu::Song const *""'"); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); { try { result = (double)((Gosu::Song const *)arg1)->volume(); } catch(const std::runtime_error& 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), "in method '" "changeVolume" "', argument " "1"" of type '" "Gosu::Song *""'"); } arg1 = reinterpret_cast< Gosu::Song * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "changeVolume" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); { try { (arg1)->changeVolume(arg2); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } #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) { Gosu::Window *arg1 = 0 ; std::string *arg2 = 0 ; Gosu::Song *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; const char *classname SWIGUNUSED = "Gosu::Song"; if ((argc < 2) || (argc > 2)) { 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), "in method '" "Gosu::Song" "', argument " "1"" of type '" "Gosu::Window &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu::Song" "', argument " "1"" of type '" "Gosu::Window &""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(argv[1], &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Gosu::Song" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Gosu::Song" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { try { result = (Gosu::Song *)new_Gosu_Song(*arg1,(std::string const &)*arg2);DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } if (SWIG_IsNewObj(res2)) delete arg2; return self; fail: if (SWIG_IsNewObj(res2)) delete arg2; return Qnil; } swig_class cTextInput; #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) { Gosu::TextInput *result = 0 ; const char *classname SWIGUNUSED = "Gosu::TextInput"; if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } { try { result = (Gosu::TextInput *)new Gosu::TextInput();DATA_PTR(self) = result; SWIG_RubyAddTracking(result, self); } catch(const std::runtime_error& 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 ; std::wstring result; void *argp1 = 0 ; int res1 = 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__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "text" "', argument " "1"" of type '" "Gosu::TextInput const *""'"); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { try { result = ((Gosu::TextInput const *)arg1)->text(); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); } 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), "in method '" "setText" "', argument " "1"" of type '" "Gosu::TextInput *""'"); } 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::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_TextInput_caret_pos(int argc, VALUE *argv, VALUE self) { Gosu::TextInput *arg1 = (Gosu::TextInput *) 0 ; unsigned int result; void *argp1 = 0 ; int res1 = 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__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "caret_pos" "', argument " "1"" of type '" "Gosu::TextInput const *""'"); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { try { result = (unsigned int)Gosu_TextInput_caret_pos((Gosu::TextInput const *)arg1); } catch(const std::runtime_error& 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 ; unsigned int result; void *argp1 = 0 ; int res1 = 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__TextInput, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selection_start" "', argument " "1"" of type '" "Gosu::TextInput const *""'"); } arg1 = reinterpret_cast< Gosu::TextInput * >(argp1); { try { result = (unsigned int)Gosu_TextInput_selection_start((Gosu::TextInput const *)arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); return vresult; fail: return Qnil; } swig_class cWindow; #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 ; Gosu::Window *result = 0 ; 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"; 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), "in method '" "Gosu::Window" "', argument " "2"" of type '" "unsigned int""'"); } 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), "in method '" "Gosu::Window" "', argument " "3"" of type '" "unsigned int""'"); } arg3 = static_cast< unsigned int >(val3); ecode4 = SWIG_AsVal_bool(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Gosu::Window" "', argument " "4"" of type '" "bool""'"); } 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), "in method '" "Gosu::Window" "', argument " "5"" of type '" "double""'"); } 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::runtime_error& 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 ; std::wstring result; void *argp1 = 0 ; int res1 = 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), "in method '" "caption" "', argument " "1"" of type '" "Gosu::Window const *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = ((Gosu::Window const *)arg1)->caption(); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(result).c_str()); } 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), "in method '" "setCaption" "', argument " "1"" of type '" "Gosu::Window *""'"); } 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::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; 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), "in method '" "show" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { (arg1)->show(); } catch(const std::runtime_error& 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), "in method '" "close" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { (arg1)->close(); } catch(const std::runtime_error& 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), "in method '" "update" "', argument " "1"" of type '" "Gosu::Window *""'"); } 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::runtime_error& 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), "in method '" "draw" "', argument " "1"" of type '" "Gosu::Window *""'"); } 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::runtime_error& 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), "in method '" "buttonDown" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { 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::runtime_error& 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), "in method '" "buttonUp" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { 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::runtime_error& 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), "in method '" "drawLine" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drawLine" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "drawLine" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg4 = Gosu::Color(NUM2UINT(argv[2])); 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), "in method '" "drawLine" "', argument " "5"" of type '" "double""'"); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "drawLine" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg7 = Gosu::Color(NUM2UINT(argv[5])); 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), "in method '" "drawLine" "', argument " "8"" of type '" "Gosu::ZPos""'"); } arg8 = static_cast< Gosu::ZPos >(val8); } if (argc > 7) { { VALUE localTemporary = rb_obj_as_string(argv[7]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg9 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg9 = Gosu::amAdditive; 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::runtime_error& 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), "in method '" "drawTriangle" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drawTriangle" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "drawTriangle" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg4 = Gosu::Color(NUM2UINT(argv[2])); 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), "in method '" "drawTriangle" "', argument " "5"" of type '" "double""'"); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "drawTriangle" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg7 = Gosu::Color(NUM2UINT(argv[5])); 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), "in method '" "drawTriangle" "', argument " "8"" of type '" "double""'"); } arg8 = static_cast< double >(val8); ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "drawTriangle" "', argument " "9"" of type '" "double""'"); } arg9 = static_cast< double >(val9); { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg10 = Gosu::Color(NUM2UINT(argv[8])); 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), "in method '" "drawTriangle" "', argument " "11"" of type '" "Gosu::ZPos""'"); } arg11 = static_cast< Gosu::ZPos >(val11); } if (argc > 10) { { VALUE localTemporary = rb_obj_as_string(argv[10]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg12 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg12 = Gosu::amAdditive; 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::runtime_error& 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), "in method '" "drawQuad" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_double(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drawQuad" "', argument " "2"" of type '" "double""'"); } arg2 = static_cast< double >(val2); ecode3 = SWIG_AsVal_double(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "drawQuad" "', argument " "3"" of type '" "double""'"); } arg3 = static_cast< double >(val3); { void* ptr; int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg4 = Gosu::Color(NUM2UINT(argv[2])); 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), "in method '" "drawQuad" "', argument " "5"" of type '" "double""'"); } arg5 = static_cast< double >(val5); ecode6 = SWIG_AsVal_double(argv[4], &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "drawQuad" "', argument " "6"" of type '" "double""'"); } arg6 = static_cast< double >(val6); { void* ptr; int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg7 = Gosu::Color(NUM2UINT(argv[5])); 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), "in method '" "drawQuad" "', argument " "8"" of type '" "double""'"); } arg8 = static_cast< double >(val8); ecode9 = SWIG_AsVal_double(argv[7], &val9); if (!SWIG_IsOK(ecode9)) { SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "drawQuad" "', argument " "9"" of type '" "double""'"); } arg9 = static_cast< double >(val9); { void* ptr; int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg10 = Gosu::Color(NUM2UINT(argv[8])); 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), "in method '" "drawQuad" "', argument " "11"" of type '" "double""'"); } arg11 = static_cast< double >(val11); ecode12 = SWIG_AsVal_double(argv[10], &val12); if (!SWIG_IsOK(ecode12)) { SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "drawQuad" "', argument " "12"" of type '" "double""'"); } arg12 = static_cast< double >(val12); { void* ptr; int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0); if (!SWIG_IsOK(res)) // TODO: error checking arg13 = Gosu::Color(NUM2UINT(argv[11])); 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), "in method '" "drawQuad" "', argument " "14"" of type '" "Gosu::ZPos""'"); } arg14 = static_cast< Gosu::ZPos >(val14); } if (argc > 13) { { VALUE localTemporary = rb_obj_as_string(argv[13]); if (!strcmp(StringValueCStr(localTemporary), "default")) arg15 = Gosu::amDefault; else if (!strcmp(StringValueCStr(localTemporary), "additive")) arg15 = Gosu::amAdditive; 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::runtime_error& 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 ; bool result; void *argp1 = 0 ; int res1 = 0 ; 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), "in method '" "isButtonDown" "', argument " "1"" of type '" "Gosu::Window const *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { arg2 = Gosu::Button(NUM2LONG(argv[0])); } { try { result = (bool)Gosu_Window_isButtonDown((Gosu::Window const *)arg1,arg2); } catch(const std::runtime_error& 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) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; wchar_t arg2 ; Gosu::Button result; void *argp1 = 0 ; int res1 = 0 ; 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), "in method '" "charToButtonId" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { VALUE localTemporary = rb_obj_as_string(argv[0]); std::wstring localTemporary2 = Gosu::utf8ToWstring(StringValueCStr(localTemporary)); arg2 = localTemporary2.empty() ? 0 : localTemporary2.at(0); } { try { result = Gosu_Window_charToButtonId(arg1,arg2); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = LONG2NUM((&result)->getId()); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_button_id_to_char(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; Gosu::Button arg2 ; wchar_t result; void *argp1 = 0 ; int res1 = 0 ; 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), "in method '" "buttonIdToChar" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { arg2 = Gosu::Button(NUM2LONG(argv[0])); } { try { result = Gosu_Window_buttonIdToChar(arg1,arg2); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } { vresult = rb_str_new2(Gosu::wstringToUTF8(std::wstring(1, result)).c_str()); } return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_text_input(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; Gosu::TextInput *result = 0 ; void *argp1 = 0 ; int res1 = 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), "in method '" "textInput" "', argument " "1"" of type '" "Gosu::Window const *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (Gosu::TextInput *)Gosu_Window_textInput((Gosu::Window const *)arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } 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), "in method '" "setTextInput" "', argument " "1"" of type '" "Gosu::Window *""'"); } 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), "in method '" "setTextInput" "', argument " "2"" of type '" "Gosu::TextInput *""'"); } arg2 = reinterpret_cast< Gosu::TextInput * >(argp2); { try { Gosu_Window_setTextInput(arg1,arg2); } catch(const std::runtime_error& 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 ; double result; void *argp1 = 0 ; int res1 = 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), "in method '" "mouseX" "', argument " "1"" of type '" "Gosu::Window const *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (double)Gosu_Window_mouseX((Gosu::Window const *)arg1); } catch(const std::runtime_error& 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 ; double result; void *argp1 = 0 ; int res1 = 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), "in method '" "mouseY" "', argument " "1"" of type '" "Gosu::Window const *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (double)Gosu_Window_mouseY((Gosu::Window const *)arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_double(static_cast< double >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_width(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; int result; void *argp1 = 0 ; int res1 = 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), "in method '" "width" "', argument " "1"" of type '" "Gosu::Window const *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (int)Gosu_Window_width((Gosu::Window const *)arg1); } catch(const std::runtime_error& 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 ; int result; void *argp1 = 0 ; int res1 = 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), "in method '" "height" "', argument " "1"" of type '" "Gosu::Window const *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { result = (int)Gosu_Window_height((Gosu::Window const *)arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } vresult = SWIG_From_int(static_cast< int >(result)); return vresult; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_gl(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), "in method '" "gl" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { try { Gosu_Window_gl(arg1); } catch(const std::runtime_error& e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } return Qnil; fail: return Qnil; } SWIGINTERN VALUE _wrap_Window_clip_to(int argc, VALUE *argv, VALUE self) { Gosu::Window *arg1 = (Gosu::Window *) 0 ; int arg2 ; int arg3 ; unsigned int arg4 ; unsigned int arg5 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; unsigned int val4 ; int ecode4 = 0 ; unsigned int 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), "in method '" "clipTo" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); ecode2 = SWIG_AsVal_int(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "clipTo" "', argument " "2"" of type '" "int""'"); } arg2 = static_cast< int >(val2); ecode3 = SWIG_AsVal_int(argv[1], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "clipTo" "', argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "clipTo" "', argument " "4"" of type '" "unsigned int""'"); } arg4 = static_cast< unsigned int >(val4); ecode5 = SWIG_AsVal_unsigned_SS_int(argv[3], &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "clipTo" "', argument " "5"" of type '" "unsigned int""'"); } arg5 = static_cast< unsigned int >(val5); { try { Gosu_Window_clipTo(arg1,arg2,arg3,arg4,arg5); } catch(const std::runtime_error& 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), "in method '" "disown_Window" "', argument " "1"" of type '" "Gosu::Window *""'"); } arg1 = reinterpret_cast< Gosu::Window * >(argp1); { Swig::Director *director = dynamic_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__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", "double *|Gosu::ZPos *", 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__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__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__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__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__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__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 staticly 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; clientdata = clientdata; /* 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; } /* 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; } /* 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_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1); rb_define_module_function(mGosu, "trunc", VALUEFUNC(_wrap_trunc), -1); rb_define_module_function(mGosu, "round", VALUEFUNC(_wrap_round), -1); rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -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_sqr", VALUEFUNC(_wrap_distance_sqr), -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_const(mGosu, "AmDefault", SWIG_From_int(static_cast< int >(Gosu::amDefault))); rb_define_const(mGosu, "AmAdditive", SWIG_From_int(static_cast< int >(Gosu::amAdditive))); rb_define_const(mGosu, "FfBold", SWIG_From_int(static_cast< int >(Gosu::ffBold))); rb_define_const(mGosu, "FfItalic", SWIG_From_int(static_cast< int >(Gosu::ffItalic))); rb_define_const(mGosu, "FfUnderline", SWIG_From_int(static_cast< int >(Gosu::ffUnderline))); rb_define_const(mGosu, "TaLeft", SWIG_From_int(static_cast< int >(Gosu::taLeft))); rb_define_const(mGosu, "TaRight", SWIG_From_int(static_cast< int >(Gosu::taRight))); rb_define_const(mGosu, "TaCenter", SWIG_From_int(static_cast< int >(Gosu::taCenter))); rb_define_const(mGosu, "TaJustify", SWIG_From_int(static_cast< int >(Gosu::taJustify))); cColor.klass = rb_define_class_under(mGosu, "Color", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Color, (void *) &cColor); rb_define_alloc_func(cColor.klass, _wrap_Color_allocate); rb_define_method(cColor.klass, "initialize", VALUEFUNC(_wrap_new_Color), -1); rb_define_singleton_method(cColor.klass, "from_hsv", VALUEFUNC(_wrap_Color_from_hsv), -1); rb_define_singleton_method(cColor.klass, "from_ahsv", VALUEFUNC(_wrap_Color_from_ahsv), -1); rb_define_method(cColor.klass, "alpha", VALUEFUNC(_wrap_Color_alpha), -1); rb_define_method(cColor.klass, "red", VALUEFUNC(_wrap_Color_red), -1); rb_define_method(cColor.klass, "green", VALUEFUNC(_wrap_Color_green), -1); rb_define_method(cColor.klass, "blue", VALUEFUNC(_wrap_Color_blue), -1); rb_define_method(cColor.klass, "alpha=", VALUEFUNC(_wrap_Color_alphae___), -1); rb_define_method(cColor.klass, "red=", VALUEFUNC(_wrap_Color_rede___), -1); rb_define_method(cColor.klass, "green=", VALUEFUNC(_wrap_Color_greene___), -1); rb_define_method(cColor.klass, "blue=", VALUEFUNC(_wrap_Color_bluee___), -1); rb_define_method(cColor.klass, "hue", VALUEFUNC(_wrap_Color_hue), -1); rb_define_method(cColor.klass, "hue=", VALUEFUNC(_wrap_Color_huee___), -1); rb_define_method(cColor.klass, "saturation", VALUEFUNC(_wrap_Color_saturation), -1); rb_define_method(cColor.klass, "saturation=", VALUEFUNC(_wrap_Color_saturatione___), -1); rb_define_method(cColor.klass, "value", VALUEFUNC(_wrap_Color_value), -1); rb_define_method(cColor.klass, "value=", VALUEFUNC(_wrap_Color_valuee___), -1); rb_define_method(cColor.klass, "argb", VALUEFUNC(_wrap_Color_argb), -1); rb_define_method(cColor.klass, "bgr", VALUEFUNC(_wrap_Color_bgr), -1); rb_define_method(cColor.klass, "abgr", VALUEFUNC(_wrap_Color_abgr), -1); rb_define_method(cColor.klass, "to_s", VALUEFUNC(_wrap_Color_to_s), -1); cColor.mark = 0; cColor.destroy = (void (*)(void *)) free_Gosu_Color; cColor.trackObjects = 1; rb_define_module_function(mGosu, "interpolate", VALUEFUNC(_wrap_interpolate), -1); rb_define_module_function(mGosu, "multiply", VALUEFUNC(_wrap_multiply), -1); rb_define_singleton_method(mGosu, "none", VALUEFUNC(none_get), 0); rb_define_singleton_method(mGosu, "black", VALUEFUNC(black_get), 0); rb_define_singleton_method(mGosu, "gray", VALUEFUNC(gray_get), 0); rb_define_singleton_method(mGosu, "white", VALUEFUNC(white_get), 0); rb_define_singleton_method(mGosu, "red", VALUEFUNC(red_get), 0); rb_define_singleton_method(mGosu, "green", VALUEFUNC(green_get), 0); rb_define_singleton_method(mGosu, "blue", VALUEFUNC(blue_get), 0); rb_define_singleton_method(mGosu, "yellow", VALUEFUNC(yellow_get), 0); rb_define_singleton_method(mGosu, "fuchsia", VALUEFUNC(fuchsia_get), 0); rb_define_singleton_method(mGosu, "cyan", VALUEFUNC(cyan_get), 0); cFont.klass = rb_define_class_under(mGosu, "Font", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Font, (void *) &cFont); rb_define_alloc_func(cFont.klass, _wrap_Font_allocate); rb_define_method(cFont.klass, "initialize", VALUEFUNC(_wrap_new_Font), -1); rb_define_method(cFont.klass, "height", VALUEFUNC(_wrap_Font_height), -1); rb_define_method(cFont.klass, "text_width", VALUEFUNC(_wrap_Font_text_width), -1); rb_define_method(cFont.klass, "draw", VALUEFUNC(_wrap_Font_draw), -1); rb_define_method(cFont.klass, "draw_rel", VALUEFUNC(_wrap_Font_draw_rel), -1); rb_define_method(cFont.klass, "draw_rot", VALUEFUNC(_wrap_Font_draw_rot), -1); cFont.mark = 0; cFont.destroy = (void (*)(void *)) free_Gosu_Font; cFont.trackObjects = 1; cGLTexInfo.klass = rb_define_class_under(mGosu, "GLTexInfo", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__GLTexInfo, (void *) &cGLTexInfo); rb_define_alloc_func(cGLTexInfo.klass, _wrap_GLTexInfo_allocate); rb_define_method(cGLTexInfo.klass, "initialize", VALUEFUNC(_wrap_new_GLTexInfo), -1); rb_define_method(cGLTexInfo.klass, "tex_name=", VALUEFUNC(_wrap_GLTexInfo_tex_name_set), -1); rb_define_method(cGLTexInfo.klass, "tex_name", VALUEFUNC(_wrap_GLTexInfo_tex_name_get), -1); rb_define_method(cGLTexInfo.klass, "left=", VALUEFUNC(_wrap_GLTexInfo_left_set), -1); rb_define_method(cGLTexInfo.klass, "left", VALUEFUNC(_wrap_GLTexInfo_left_get), -1); rb_define_method(cGLTexInfo.klass, "right=", VALUEFUNC(_wrap_GLTexInfo_right_set), -1); rb_define_method(cGLTexInfo.klass, "right", VALUEFUNC(_wrap_GLTexInfo_right_get), -1); rb_define_method(cGLTexInfo.klass, "top=", VALUEFUNC(_wrap_GLTexInfo_top_set), -1); rb_define_method(cGLTexInfo.klass, "top", VALUEFUNC(_wrap_GLTexInfo_top_get), -1); rb_define_method(cGLTexInfo.klass, "bottom=", VALUEFUNC(_wrap_GLTexInfo_bottom_set), -1); rb_define_method(cGLTexInfo.klass, "bottom", VALUEFUNC(_wrap_GLTexInfo_bottom_get), -1); cGLTexInfo.mark = 0; cGLTexInfo.destroy = (void (*)(void *)) free_Gosu_GLTexInfo; cGLTexInfo.trackObjects = 1; cImage.klass = rb_define_class_under(mGosu, "Image", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Image, (void *) &cImage); rb_define_alloc_func(cImage.klass, _wrap_Image_allocate); rb_define_method(cImage.klass, "initialize", VALUEFUNC(_wrap_new_Image), -1); rb_define_method(cImage.klass, "width", VALUEFUNC(_wrap_Image_width), -1); rb_define_method(cImage.klass, "height", VALUEFUNC(_wrap_Image_height), -1); rb_define_method(cImage.klass, "draw", VALUEFUNC(_wrap_Image_draw), -1); rb_define_method(cImage.klass, "draw_mod", VALUEFUNC(_wrap_Image_draw_mod), -1); rb_define_method(cImage.klass, "draw_rot", VALUEFUNC(_wrap_Image_draw_rot), -1); rb_define_method(cImage.klass, "draw_as_quad", VALUEFUNC(_wrap_Image_draw_as_quad), -1); rb_define_method(cImage.klass, "gl_tex_info", VALUEFUNC(_wrap_Image_gl_tex_info), -1); rb_define_singleton_method(cImage.klass, "from_text", VALUEFUNC(_wrap_Image_from_text), -1); rb_define_singleton_method(cImage.klass, "load_tiles", VALUEFUNC(_wrap_Image_load_tiles), -1); cImage.mark = 0; cImage.destroy = (void (*)(void *)) free_Gosu_Image; cImage.trackObjects = 1; cSampleInstance.klass = rb_define_class_under(mGosu, "SampleInstance", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__SampleInstance, (void *) &cSampleInstance); rb_define_alloc_func(cSampleInstance.klass, _wrap_SampleInstance_allocate); rb_define_method(cSampleInstance.klass, "initialize", VALUEFUNC(_wrap_new_SampleInstance), -1); rb_define_method(cSampleInstance.klass, "playing?", VALUEFUNC(_wrap_SampleInstance_playingq___), -1); rb_define_method(cSampleInstance.klass, "stop", VALUEFUNC(_wrap_SampleInstance_stop), -1); rb_define_method(cSampleInstance.klass, "volume=", VALUEFUNC(_wrap_SampleInstance_volumee___), -1); rb_define_method(cSampleInstance.klass, "pan=", VALUEFUNC(_wrap_SampleInstance_pane___), -1); rb_define_method(cSampleInstance.klass, "speed=", VALUEFUNC(_wrap_SampleInstance_speede___), -1); cSampleInstance.mark = 0; cSampleInstance.destroy = (void (*)(void *)) free_Gosu_SampleInstance; cSampleInstance.trackObjects = 1; cSample.klass = rb_define_class_under(mGosu, "Sample", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Sample, (void *) &cSample); rb_define_alloc_func(cSample.klass, _wrap_Sample_allocate); rb_define_method(cSample.klass, "initialize", VALUEFUNC(_wrap_new_Sample), -1); rb_define_method(cSample.klass, "play", VALUEFUNC(_wrap_Sample_play), -1); rb_define_method(cSample.klass, "play_pan", VALUEFUNC(_wrap_Sample_play_pan), -1); cSample.mark = 0; cSample.destroy = (void (*)(void *)) free_Gosu_Sample; cSample.trackObjects = 1; cSong.klass = rb_define_class_under(mGosu, "Song", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Song, (void *) &cSong); rb_define_alloc_func(cSong.klass, _wrap_Song_allocate); rb_define_method(cSong.klass, "initialize", VALUEFUNC(_wrap_new_Song), -1); rb_define_const(cSong.klass, "StStream", SWIG_From_int(static_cast< int >(Gosu::Song::stStream))); rb_define_const(cSong.klass, "StModule", SWIG_From_int(static_cast< int >(Gosu::Song::stModule))); rb_define_method(cSong.klass, "play", VALUEFUNC(_wrap_Song_play), -1); rb_define_method(cSong.klass, "stop", VALUEFUNC(_wrap_Song_stop), -1); rb_define_method(cSong.klass, "playing?", VALUEFUNC(_wrap_Song_playingq___), -1); rb_define_method(cSong.klass, "volume", VALUEFUNC(_wrap_Song_volume), -1); rb_define_method(cSong.klass, "volume=", VALUEFUNC(_wrap_Song_volumee___), -1); cSong.mark = 0; cSong.destroy = (void (*)(void *)) free_Gosu_Song; cSong.trackObjects = 1; rb_define_const(mGosu, "KbRangeBegin", SWIG_From_int(static_cast< int >(Gosu::kbRangeBegin))); 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, "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, "Kb0", SWIG_From_int(static_cast< int >(Gosu::kb0))); 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, "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, "KbNumpad0", SWIG_From_int(static_cast< int >(Gosu::kbNumpad0))); 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, "KbRangeEnd", SWIG_From_int(static_cast< int >(Gosu::kbRangeEnd))); rb_define_const(mGosu, "MsRangeBegin", SWIG_From_int(static_cast< int >(Gosu::msRangeBegin))); rb_define_const(mGosu, "MsLeft", SWIG_From_int(static_cast< int >(Gosu::msLeft))); rb_define_const(mGosu, "MsRight", SWIG_From_int(static_cast< int >(Gosu::msRight))); rb_define_const(mGosu, "MsMiddle", SWIG_From_int(static_cast< int >(Gosu::msMiddle))); 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, "MsRangeEnd", SWIG_From_int(static_cast< int >(Gosu::msRangeEnd))); rb_define_const(mGosu, "GpRangeBegin", SWIG_From_int(static_cast< int >(Gosu::gpRangeBegin))); 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, "GpRangeEnd", SWIG_From_int(static_cast< int >(Gosu::gpRangeEnd))); rb_define_const(mGosu, "KbNum", SWIG_From_int(static_cast< int >(Gosu::kbNum))); rb_define_const(mGosu, "MsNum", SWIG_From_int(static_cast< int >(Gosu::msNum))); rb_define_const(mGosu, "GpNum", SWIG_From_int(static_cast< int >(Gosu::gpNum))); rb_define_const(mGosu, "NumButtons", SWIG_From_int(static_cast< int >(Gosu::numButtons))); rb_define_const(mGosu, "NoButton", SWIG_From_int(static_cast< int >(Gosu::noButton))); // Backwards compatibility: import the constants into Gosu::Button. rb_eval_string("module Gosu::Button; Gosu.constants.each { |c| const_set(c, Gosu.const_get(c)) }; end"); // Extend Numeric with simple angle conversion methods. // IMPR: Maybe faster in C? rb_eval_string("class Numeric;" " def gosu_to_radians; (self - 90) * Math::PI / 180.0; end;" " def radians_to_gosu; self * 180.0 / Math::PI + 90; end;" "end"); GosusDarkSide::oncePerTick = GosusDarkSide::yieldToOtherRubyThreads; cTextInput.klass = rb_define_class_under(mGosu, "TextInput", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__TextInput, (void *) &cTextInput); rb_define_alloc_func(cTextInput.klass, _wrap_TextInput_allocate); rb_define_method(cTextInput.klass, "initialize", VALUEFUNC(_wrap_new_TextInput), -1); rb_define_method(cTextInput.klass, "text", VALUEFUNC(_wrap_TextInput_text), -1); rb_define_method(cTextInput.klass, "text=", VALUEFUNC(_wrap_TextInput_texte___), -1); rb_define_method(cTextInput.klass, "caret_pos", VALUEFUNC(_wrap_TextInput_caret_pos), -1); rb_define_method(cTextInput.klass, "selection_start", VALUEFUNC(_wrap_TextInput_selection_start), -1); cTextInput.mark = 0; cTextInput.destroy = (void (*)(void *)) free_Gosu_TextInput; cTextInput.trackObjects = 1; rb_define_module_function(mGosu, "disown_Window", VALUEFUNC(_wrap_disown_Window), -1); cWindow.klass = rb_define_class_under(mGosu, "Window", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Gosu__Window, (void *) &cWindow); rb_define_alloc_func(cWindow.klass, _wrap_Window_allocate); rb_define_method(cWindow.klass, "initialize", VALUEFUNC(_wrap_new_Window), -1); rb_define_method(cWindow.klass, "caption", VALUEFUNC(_wrap_Window_caption), -1); rb_define_method(cWindow.klass, "caption=", VALUEFUNC(_wrap_Window_captione___), -1); rb_define_method(cWindow.klass, "show", VALUEFUNC(_wrap_Window_show), -1); rb_define_method(cWindow.klass, "close", VALUEFUNC(_wrap_Window_close), -1); rb_define_method(cWindow.klass, "update", VALUEFUNC(_wrap_Window_update), -1); rb_define_method(cWindow.klass, "draw", VALUEFUNC(_wrap_Window_draw), -1); rb_define_method(cWindow.klass, "button_down", VALUEFUNC(_wrap_Window_button_down), -1); rb_define_method(cWindow.klass, "button_up", VALUEFUNC(_wrap_Window_button_up), -1); rb_define_method(cWindow.klass, "draw_line", VALUEFUNC(_wrap_Window_draw_line), -1); rb_define_method(cWindow.klass, "draw_triangle", VALUEFUNC(_wrap_Window_draw_triangle), -1); rb_define_method(cWindow.klass, "draw_quad", VALUEFUNC(_wrap_Window_draw_quad), -1); rb_define_method(cWindow.klass, "button_down?", VALUEFUNC(_wrap_Window_button_downq___), -1); rb_define_method(cWindow.klass, "char_to_button_id", VALUEFUNC(_wrap_Window_char_to_button_id), -1); rb_define_method(cWindow.klass, "button_id_to_char", VALUEFUNC(_wrap_Window_button_id_to_char), -1); rb_define_method(cWindow.klass, "text_input", VALUEFUNC(_wrap_Window_text_input), -1); rb_define_method(cWindow.klass, "text_input=", VALUEFUNC(_wrap_Window_text_inpute___), -1); rb_define_method(cWindow.klass, "mouse_x", VALUEFUNC(_wrap_Window_mouse_x), -1); rb_define_method(cWindow.klass, "mouse_y", VALUEFUNC(_wrap_Window_mouse_y), -1); rb_define_method(cWindow.klass, "width", VALUEFUNC(_wrap_Window_width), -1); rb_define_method(cWindow.klass, "height", VALUEFUNC(_wrap_Window_height), -1); rb_define_method(cWindow.klass, "gl", VALUEFUNC(_wrap_Window_gl), -1); rb_define_method(cWindow.klass, "clip_to", VALUEFUNC(_wrap_Window_clip_to), -1); cWindow.mark = (void (*)(void *)) markWindow; cWindow.destroy = (void (*)(void *)) free_Gosu_Window; cWindow.trackObjects = 1; }