gosu 0.14.5 → 0.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/COPYING +1 -1
- data/Gosu/Channel.h +25 -0
- data/Gosu/Color.h +38 -0
- data/Gosu/Font.h +36 -0
- data/Gosu/Gosu.h +79 -0
- data/Gosu/Image.h +54 -0
- data/Gosu/Sample.h +19 -0
- data/Gosu/Song.h +24 -0
- data/Gosu/TextInput.h +30 -0
- data/Gosu/Version.hpp +2 -2
- data/Gosu/Window.h +61 -0
- data/Gosu/Window.hpp +3 -2
- data/README.md +1 -1
- data/ext/gosu/extconf.rb +3 -0
- data/lib/gosu/compat.rb +12 -7
- data/lib/gosu/patches.rb +8 -2
- data/lib/gosu/swig_patches.rb +20 -9
- data/rdoc/gosu.rb +28 -7
- data/src/ChannelWrapper.cpp +50 -0
- data/src/ColorWrapper.cpp +126 -0
- data/src/Constants.cpp +287 -0
- data/src/Font.cpp +1 -0
- data/src/FontWrapper.cpp +74 -0
- data/src/GosuWrapper.cpp +232 -0
- data/src/Graphics.cpp +4 -1
- data/src/GraphicsImpl.hpp +0 -1
- data/src/ImageWrapper.cpp +168 -0
- data/src/LargeImageData.cpp +1 -0
- data/src/MarkupParser.cpp +11 -3
- data/src/RubyGosu.cxx +185 -121
- data/src/RubyGosu.h +2 -2
- data/src/SampleWrapper.cpp +30 -0
- data/src/SongWrapper.cpp +52 -0
- data/src/TexChunk.cpp +29 -19
- data/src/Text.cpp +2 -0
- data/src/TextBuilder.cpp +3 -3
- data/src/TextInputWrapper.cpp +101 -0
- data/src/TrueTypeFont.cpp +1 -0
- data/src/Window.cpp +62 -28
- data/src/WindowUIKit.cpp +8 -4
- data/src/WindowWrapper.cpp +289 -0
- data/src/stb_image.h +153 -56
- data/src/stb_image_write.h +111 -60
- data/src/stb_truetype.h +74 -39
- data/src/stb_vorbis.c +55 -15
- data/src/utf8proc.c +47 -29
- data/src/utf8proc.h +46 -24
- data/src/utf8proc_data.h +10043 -9609
- metadata +23 -4
data/src/RubyGosu.cxx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version
|
3
|
+
* Version 4.0.2
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
@@ -332,6 +332,7 @@ template <typename T> T SwigValueInit() {
|
|
332
332
|
/* Flags for pointer conversions */
|
333
333
|
#define SWIG_POINTER_DISOWN 0x1
|
334
334
|
#define SWIG_CAST_NEW_MEMORY 0x2
|
335
|
+
#define SWIG_POINTER_NO_NULL 0x4
|
335
336
|
|
336
337
|
/* Flags for new pointer objects */
|
337
338
|
#define SWIG_POINTER_OWN 0x1
|
@@ -970,42 +971,53 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
|
970
971
|
#ifndef RSTRUCT_PTR
|
971
972
|
# define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
|
972
973
|
#endif
|
974
|
+
#ifndef RTYPEDDATA_P
|
975
|
+
# define RTYPEDDATA_P(x) (TYPE(x) != T_DATA)
|
976
|
+
#endif
|
973
977
|
|
974
978
|
|
975
979
|
|
976
980
|
/*
|
977
|
-
*
|
978
|
-
*
|
981
|
+
* The following macros are used for providing the correct type of a
|
982
|
+
* function pointer to the Ruby C API.
|
983
|
+
* Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being
|
984
|
+
* defined) these macros act transparently due to Ruby's moving away from
|
985
|
+
* ANYARGS and instead employing strict function signatures.
|
986
|
+
*
|
987
|
+
* Note: In case of C (not C++) the macros are transparent even before
|
988
|
+
* Ruby 2.7 due to the fact that the Ruby C API used function declarators
|
989
|
+
* with empty parentheses, which allows for an unspecified number of
|
990
|
+
* arguments.
|
979
991
|
*
|
980
|
-
*
|
981
|
-
*
|
982
|
-
* like rb_define_method() and rb_define_singleton_method().
|
992
|
+
* PROTECTFUNC(f) is used for the function pointer argument of the Ruby
|
993
|
+
* C API function rb_protect().
|
983
994
|
*
|
984
|
-
*
|
985
|
-
*
|
986
|
-
*
|
995
|
+
* VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API
|
996
|
+
* functions like rb_define_method() and rb_define_singleton_method().
|
997
|
+
*
|
998
|
+
* VOIDFUNC(f) is used to typecast a C function that implements either
|
999
|
+
* the "mark" or "free" stuff for a Ruby Data object, so that it can be
|
1000
|
+
* passed as an argument to Ruby C API functions like Data_Wrap_Struct()
|
987
1001
|
* and Data_Make_Struct().
|
1002
|
+
*
|
1003
|
+
* SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer
|
1004
|
+
* argument(s) of Ruby C API functions like rb_define_virtual_variable().
|
1005
|
+
*
|
1006
|
+
* SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer
|
1007
|
+
* argument(s) of Ruby C API functions like st_foreach().
|
988
1008
|
*/
|
989
|
-
|
990
|
-
#
|
991
|
-
#
|
992
|
-
#
|
993
|
-
#
|
994
|
-
#
|
995
|
-
# else
|
996
|
-
# ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
|
997
|
-
# define PROTECTFUNC(f) ((VALUE (*)()) f)
|
998
|
-
# define VALUEFUNC(f) ((VALUE (*)()) f)
|
999
|
-
# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
|
1000
|
-
# else /* These definitions should work for Ruby 1.7+ */
|
1001
|
-
# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
|
1002
|
-
# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
|
1003
|
-
# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
|
1004
|
-
# endif
|
1005
|
-
# endif
|
1009
|
+
#if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL)
|
1010
|
+
# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
|
1011
|
+
# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
|
1012
|
+
# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
|
1013
|
+
# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f))
|
1014
|
+
# define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f))
|
1006
1015
|
#else
|
1016
|
+
# define PROTECTFUNC(f) (f)
|
1007
1017
|
# define VALUEFUNC(f) (f)
|
1008
1018
|
# define VOIDFUNC(f) (f)
|
1019
|
+
# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f)
|
1020
|
+
# define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f)
|
1009
1021
|
#endif
|
1010
1022
|
|
1011
1023
|
/* Don't use for expressions have side effect */
|
@@ -1193,7 +1205,7 @@ void Ruby_Format_OverloadedError(
|
|
1193
1205
|
/* -----------------------------------------------------------------------------
|
1194
1206
|
* rubytracking.swg
|
1195
1207
|
*
|
1196
|
-
* This file contains support for tracking mappings from
|
1208
|
+
* This file contains support for tracking mappings from
|
1197
1209
|
* Ruby objects to C++ objects. This functionality is needed
|
1198
1210
|
* to implement mark functions for Ruby's mark and sweep
|
1199
1211
|
* garbage collector.
|
@@ -1220,11 +1232,11 @@ extern "C" {
|
|
1220
1232
|
#endif
|
1221
1233
|
|
1222
1234
|
/* Global hash table to store Trackings from C/C++
|
1223
|
-
structs to Ruby Objects.
|
1235
|
+
structs to Ruby Objects.
|
1224
1236
|
*/
|
1225
1237
|
static st_table* swig_ruby_trackings = NULL;
|
1226
1238
|
|
1227
|
-
static VALUE swig_ruby_trackings_count(
|
1239
|
+
static VALUE swig_ruby_trackings_count(ID id, VALUE *var) {
|
1228
1240
|
return SWIG2NUM(swig_ruby_trackings->num_entries);
|
1229
1241
|
}
|
1230
1242
|
|
@@ -1234,7 +1246,7 @@ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
|
|
1234
1246
|
/* Create a hash table to store Trackings from C++
|
1235
1247
|
objects to Ruby objects. */
|
1236
1248
|
|
1237
|
-
/* Try to see if some other .so has already created a
|
1249
|
+
/* Try to see if some other .so has already created a
|
1238
1250
|
tracking hash table, which we keep hidden in an instance var
|
1239
1251
|
in the SWIG module.
|
1240
1252
|
This is done to allow multiple DSOs to share the same
|
@@ -1261,7 +1273,9 @@ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
|
|
1261
1273
|
swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value);
|
1262
1274
|
}
|
1263
1275
|
|
1264
|
-
rb_define_virtual_variable("SWIG_TRACKINGS_COUNT",
|
1276
|
+
rb_define_virtual_variable("SWIG_TRACKINGS_COUNT",
|
1277
|
+
VALUEFUNC(swig_ruby_trackings_count),
|
1278
|
+
SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL));
|
1265
1279
|
}
|
1266
1280
|
|
1267
1281
|
/* Add a Tracking from a C/C++ struct to a Ruby object */
|
@@ -1293,13 +1307,14 @@ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
|
|
1293
1307
|
|
1294
1308
|
/* This is a helper method that unlinks a Ruby object from its
|
1295
1309
|
underlying C++ object. This is needed if the lifetime of the
|
1296
|
-
Ruby object is longer than the C++ object */
|
1310
|
+
Ruby object is longer than the C++ object. */
|
1297
1311
|
SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
|
1298
1312
|
VALUE object = SWIG_RubyInstanceFor(ptr);
|
1299
1313
|
|
1300
1314
|
if (object != Qnil) {
|
1301
|
-
|
1302
|
-
|
1315
|
+
// object might have the T_ZOMBIE type, but that's just
|
1316
|
+
// because the GC has flagged it as such for a deferred
|
1317
|
+
// destruction. Until then, it's still a T_DATA object.
|
1303
1318
|
DATA_PTR(object) = 0;
|
1304
1319
|
}
|
1305
1320
|
}
|
@@ -1309,13 +1324,15 @@ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
|
|
1309
1324
|
to the passed callback function. */
|
1310
1325
|
|
1311
1326
|
/* Proxy method to abstract the internal trackings datatype */
|
1312
|
-
static int swig_ruby_internal_iterate_callback(
|
1313
|
-
(*meth)(ptr, obj);
|
1327
|
+
static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) {
|
1328
|
+
((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj);
|
1314
1329
|
return ST_CONTINUE;
|
1315
1330
|
}
|
1316
1331
|
|
1317
1332
|
SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) {
|
1318
|
-
st_foreach(swig_ruby_trackings,
|
1333
|
+
st_foreach(swig_ruby_trackings,
|
1334
|
+
SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback),
|
1335
|
+
(st_data_t)meth);
|
1319
1336
|
}
|
1320
1337
|
|
1321
1338
|
#ifdef __cplusplus
|
@@ -1532,10 +1549,11 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
|
|
1532
1549
|
swig_class *sklass;
|
1533
1550
|
VALUE klass;
|
1534
1551
|
VALUE obj;
|
1535
|
-
|
1552
|
+
|
1536
1553
|
if (!ptr)
|
1537
1554
|
return Qnil;
|
1538
|
-
|
1555
|
+
|
1556
|
+
assert(type);
|
1539
1557
|
if (type->clientdata) {
|
1540
1558
|
sklass = (swig_class *) type->clientdata;
|
1541
1559
|
|
@@ -1543,7 +1561,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
|
|
1543
1561
|
track = sklass->trackObjects;
|
1544
1562
|
if (track) {
|
1545
1563
|
obj = SWIG_RubyInstanceFor(ptr);
|
1546
|
-
|
1564
|
+
|
1547
1565
|
/* Check the object's type and make sure it has the correct type.
|
1548
1566
|
It might not in cases where methods do things like
|
1549
1567
|
downcast methods. */
|
@@ -1575,7 +1593,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
|
|
1575
1593
|
obj = Data_Wrap_Struct(klass, 0, 0, ptr);
|
1576
1594
|
}
|
1577
1595
|
rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
|
1578
|
-
|
1596
|
+
|
1579
1597
|
return obj;
|
1580
1598
|
}
|
1581
1599
|
|
@@ -1607,7 +1625,7 @@ typedef struct {
|
|
1607
1625
|
SWIGRUNTIME swig_ruby_owntype
|
1608
1626
|
SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) {
|
1609
1627
|
swig_ruby_owntype oldown = {0, 0};
|
1610
|
-
if (obj) {
|
1628
|
+
if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) {
|
1611
1629
|
oldown.datafree = RDATA(obj)->dfree;
|
1612
1630
|
RDATA(obj)->dfree = own.datafree;
|
1613
1631
|
}
|
@@ -1626,9 +1644,9 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
|
|
1626
1644
|
if (NIL_P(obj)) {
|
1627
1645
|
if (ptr)
|
1628
1646
|
*ptr = 0;
|
1629
|
-
return SWIG_OK;
|
1647
|
+
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
|
1630
1648
|
} else {
|
1631
|
-
if (TYPE(obj) != T_DATA) {
|
1649
|
+
if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) {
|
1632
1650
|
return SWIG_ERROR;
|
1633
1651
|
}
|
1634
1652
|
Data_Get_Struct(obj, void, vptr);
|
@@ -1723,7 +1741,7 @@ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
|
|
1723
1741
|
return rb_str_new2(result);
|
1724
1742
|
}
|
1725
1743
|
|
1726
|
-
/* Convert a packed
|
1744
|
+
/* Convert a packed pointer value */
|
1727
1745
|
SWIGRUNTIME int
|
1728
1746
|
SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
|
1729
1747
|
swig_cast_info *tc;
|
@@ -1995,43 +2013,6 @@ namespace Swig {
|
|
1995
2013
|
}
|
1996
2014
|
};
|
1997
2015
|
|
1998
|
-
/* unknown exception handler */
|
1999
|
-
class UnknownExceptionHandler {
|
2000
|
-
#ifdef SWIG_DIRECTOR_UEH
|
2001
|
-
static void handler() {
|
2002
|
-
try {
|
2003
|
-
throw;
|
2004
|
-
} catch (DirectorException& e) {
|
2005
|
-
std::cerr << "SWIG Director exception caught:" << std::endl
|
2006
|
-
<< e.what() << std::endl;
|
2007
|
-
} catch (std::exception& e) {
|
2008
|
-
std::cerr << "std::exception caught: "<< e.what() << std::endl;
|
2009
|
-
} catch (...) {
|
2010
|
-
std::cerr << "Unknown exception caught." << std::endl;
|
2011
|
-
}
|
2012
|
-
std::cerr << std::endl
|
2013
|
-
<< "Ruby interpreter traceback:" << std::endl;
|
2014
|
-
std::cerr << std::endl;
|
2015
|
-
std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
|
2016
|
-
<< "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
|
2017
|
-
<< std::endl
|
2018
|
-
<< "Exception is being re-thrown, program will like abort/terminate." << std::endl;
|
2019
|
-
throw;
|
2020
|
-
}
|
2021
|
-
|
2022
|
-
public:
|
2023
|
-
std::unexpected_handler old;
|
2024
|
-
UnknownExceptionHandler(std::unexpected_handler nh = handler) {
|
2025
|
-
old = std::set_unexpected(nh);
|
2026
|
-
}
|
2027
|
-
|
2028
|
-
~UnknownExceptionHandler() {
|
2029
|
-
std::set_unexpected(old);
|
2030
|
-
}
|
2031
|
-
#endif
|
2032
|
-
};
|
2033
|
-
|
2034
|
-
|
2035
2016
|
/* Type mismatch in the return value from a Ruby method call */
|
2036
2017
|
class DirectorTypeMismatchException : public DirectorException {
|
2037
2018
|
public:
|
@@ -2221,7 +2202,7 @@ static VALUE mGosu;
|
|
2221
2202
|
#define SWIG_RUBY_THREAD_END_BLOCK
|
2222
2203
|
|
2223
2204
|
|
2224
|
-
#define SWIGVERSION
|
2205
|
+
#define SWIGVERSION 0x040002
|
2225
2206
|
#define SWIG_VERSION SWIGVERSION
|
2226
2207
|
|
2227
2208
|
|
@@ -2513,15 +2494,16 @@ SWIG_From_unsigned_SS_long (unsigned long value)
|
|
2513
2494
|
|
2514
2495
|
|
2515
2496
|
SWIGINTERN VALUE
|
2516
|
-
SWIG_ruby_failed(
|
2497
|
+
SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
2517
2498
|
{
|
2518
2499
|
return Qnil;
|
2519
2500
|
}
|
2520
2501
|
|
2521
2502
|
|
2522
|
-
/*@SWIG:/usr/local/Cellar/swig/
|
2523
|
-
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE
|
2503
|
+
/*@SWIG:/usr/local/Cellar/swig/HEAD-7051753/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2504
|
+
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE arg)
|
2524
2505
|
{
|
2506
|
+
VALUE *args = (VALUE *)arg;
|
2525
2507
|
VALUE obj = args[0];
|
2526
2508
|
VALUE type = TYPE(obj);
|
2527
2509
|
double *res = (double *)(args[1]);
|
@@ -2539,7 +2521,7 @@ SWIG_AsVal_double (VALUE obj, double *val)
|
|
2539
2521
|
VALUE a[2];
|
2540
2522
|
a[0] = obj;
|
2541
2523
|
a[1] = (VALUE)(&v);
|
2542
|
-
if (rb_rescue(
|
2524
|
+
if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
|
2543
2525
|
if (val) *val = v;
|
2544
2526
|
return SWIG_OK;
|
2545
2527
|
}
|
@@ -2561,9 +2543,10 @@ SWIG_From_unsigned_SS_int (unsigned int value)
|
|
2561
2543
|
#include <string>
|
2562
2544
|
|
2563
2545
|
|
2564
|
-
/*@SWIG:/usr/local/Cellar/swig/
|
2565
|
-
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE
|
2546
|
+
/*@SWIG:/usr/local/Cellar/swig/HEAD-7051753/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2547
|
+
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE arg)
|
2566
2548
|
{
|
2549
|
+
VALUE *args = (VALUE *)arg;
|
2567
2550
|
VALUE obj = args[0];
|
2568
2551
|
VALUE type = TYPE(obj);
|
2569
2552
|
unsigned long *res = (unsigned long *)(args[1]);
|
@@ -2581,7 +2564,7 @@ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
|
|
2581
2564
|
VALUE a[2];
|
2582
2565
|
a[0] = obj;
|
2583
2566
|
a[1] = (VALUE)(&v);
|
2584
|
-
if (rb_rescue(
|
2567
|
+
if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
|
2585
2568
|
if (val) *val = v;
|
2586
2569
|
return SWIG_OK;
|
2587
2570
|
}
|
@@ -2628,6 +2611,9 @@ SWIGINTERN Gosu::Color Gosu_Color_argb__SWIG_1(Gosu::Color::Channel a,Gosu::Colo
|
|
2628
2611
|
SWIGINTERN Gosu::Color Gosu_Color_argb__SWIG_2(std::uint32_t argb){
|
2629
2612
|
return Gosu::Color(argb);
|
2630
2613
|
}
|
2614
|
+
SWIGINTERN std::uint32_t Gosu_Color_to_i(Gosu::Color const *self){
|
2615
|
+
return self->argb();
|
2616
|
+
}
|
2631
2617
|
SWIGINTERN Gosu::Color Gosu_Color_dup(Gosu::Color const *self){
|
2632
2618
|
return *self;
|
2633
2619
|
}
|
@@ -2763,9 +2749,10 @@ SWIG_AsPtr_std_string (VALUE obj, std::string **val)
|
|
2763
2749
|
}
|
2764
2750
|
|
2765
2751
|
|
2766
|
-
/*@SWIG:/usr/local/Cellar/swig/
|
2767
|
-
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE
|
2752
|
+
/*@SWIG:/usr/local/Cellar/swig/HEAD-7051753/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2753
|
+
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
|
2768
2754
|
{
|
2755
|
+
VALUE *args = (VALUE *)arg;
|
2769
2756
|
VALUE obj = args[0];
|
2770
2757
|
VALUE type = TYPE(obj);
|
2771
2758
|
long *res = (long *)(args[1]);
|
@@ -2783,7 +2770,7 @@ SWIG_AsVal_long (VALUE obj, long* val)
|
|
2783
2770
|
VALUE a[2];
|
2784
2771
|
a[0] = obj;
|
2785
2772
|
a[1] = (VALUE)(&v);
|
2786
|
-
if (rb_rescue(
|
2773
|
+
if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
|
2787
2774
|
if (val) *val = v;
|
2788
2775
|
return SWIG_OK;
|
2789
2776
|
}
|
@@ -3195,10 +3182,10 @@ SwigDirector_TextInput::~SwigDirector_TextInput() {
|
|
3195
3182
|
}
|
3196
3183
|
|
3197
3184
|
std::string SwigDirector_TextInput::filter(std::string text) const {
|
3198
|
-
std::string c_result ;
|
3199
3185
|
VALUE obj0 = Qnil ;
|
3200
3186
|
VALUE SWIGUNUSED result;
|
3201
3187
|
|
3188
|
+
std::string c_result;
|
3202
3189
|
obj0 = SWIG_From_std_string(static_cast< std::string >(text));
|
3203
3190
|
result = rb_funcall(swig_get_self(), rb_intern("filter"), 1,obj0);
|
3204
3191
|
std::string *swig_optr = 0;
|
@@ -3212,7 +3199,7 @@ std::string SwigDirector_TextInput::filter(std::string text) const {
|
|
3212
3199
|
}
|
3213
3200
|
|
3214
3201
|
|
3215
|
-
SwigDirector_Window::SwigDirector_Window(VALUE self, unsigned int width, unsigned int height, bool fullscreen, double update_interval): Gosu::Window(width, height, fullscreen, update_interval), Swig::Director(self) {
|
3202
|
+
SwigDirector_Window::SwigDirector_Window(VALUE self, unsigned int width, unsigned int height, bool fullscreen, double update_interval, bool resizable): Gosu::Window(width, height, fullscreen, update_interval, resizable), Swig::Director(self) {
|
3216
3203
|
|
3217
3204
|
}
|
3218
3205
|
|
@@ -3224,15 +3211,15 @@ SwigDirector_Window::~SwigDirector_Window() {
|
|
3224
3211
|
void SwigDirector_Window::show() {
|
3225
3212
|
VALUE SWIGUNUSED result;
|
3226
3213
|
|
3227
|
-
result = rb_funcall(swig_get_self(), rb_intern("show"), 0,
|
3214
|
+
result = rb_funcall(swig_get_self(), rb_intern("show"), 0, Qnil);
|
3228
3215
|
}
|
3229
3216
|
|
3230
3217
|
|
3231
3218
|
bool SwigDirector_Window::tick() {
|
3232
|
-
bool c_result ;
|
3219
|
+
bool c_result = SwigValueInit< bool >() ;
|
3233
3220
|
VALUE SWIGUNUSED result;
|
3234
3221
|
|
3235
|
-
result = rb_funcall(swig_get_self(), rb_intern("tick"), 0,
|
3222
|
+
result = rb_funcall(swig_get_self(), rb_intern("tick"), 0, Qnil);
|
3236
3223
|
bool swig_val;
|
3237
3224
|
int swig_res = SWIG_AsVal_bool(result, &swig_val);
|
3238
3225
|
if (!SWIG_IsOK(swig_res)) {
|
@@ -3246,29 +3233,29 @@ bool SwigDirector_Window::tick() {
|
|
3246
3233
|
void SwigDirector_Window::close() {
|
3247
3234
|
VALUE SWIGUNUSED result;
|
3248
3235
|
|
3249
|
-
result = rb_funcall(swig_get_self(), rb_intern("close"), 0,
|
3236
|
+
result = rb_funcall(swig_get_self(), rb_intern("close"), 0, Qnil);
|
3250
3237
|
}
|
3251
3238
|
|
3252
3239
|
|
3253
3240
|
void SwigDirector_Window::update() {
|
3254
3241
|
VALUE SWIGUNUSED result;
|
3255
3242
|
|
3256
|
-
result = rb_funcall(swig_get_self(), rb_intern("protected_update"), 0,
|
3243
|
+
result = rb_funcall(swig_get_self(), rb_intern("protected_update"), 0, Qnil);
|
3257
3244
|
}
|
3258
3245
|
|
3259
3246
|
|
3260
3247
|
void SwigDirector_Window::draw() {
|
3261
3248
|
VALUE SWIGUNUSED result;
|
3262
3249
|
|
3263
|
-
result = rb_funcall(swig_get_self(), rb_intern("protected_draw_2"), 0,
|
3250
|
+
result = rb_funcall(swig_get_self(), rb_intern("protected_draw_2"), 0, Qnil);
|
3264
3251
|
}
|
3265
3252
|
|
3266
3253
|
|
3267
3254
|
bool SwigDirector_Window::needs_redraw() const {
|
3268
|
-
bool c_result ;
|
3255
|
+
bool c_result = SwigValueInit< bool >() ;
|
3269
3256
|
VALUE SWIGUNUSED result;
|
3270
3257
|
|
3271
|
-
result = rb_funcall(swig_get_self(), rb_intern("protected_needs_redraw?"), 0,
|
3258
|
+
result = rb_funcall(swig_get_self(), rb_intern("protected_needs_redraw?"), 0, Qnil);
|
3272
3259
|
bool swig_val;
|
3273
3260
|
int swig_res = SWIG_AsVal_bool(result, &swig_val);
|
3274
3261
|
if (!SWIG_IsOK(swig_res)) {
|
@@ -3280,10 +3267,10 @@ bool SwigDirector_Window::needs_redraw() const {
|
|
3280
3267
|
|
3281
3268
|
|
3282
3269
|
bool SwigDirector_Window::needs_cursor() const {
|
3283
|
-
bool c_result ;
|
3270
|
+
bool c_result = SwigValueInit< bool >() ;
|
3284
3271
|
VALUE SWIGUNUSED result;
|
3285
3272
|
|
3286
|
-
result = rb_funcall(swig_get_self(), rb_intern("protected_needs_cursor?"), 0,
|
3273
|
+
result = rb_funcall(swig_get_self(), rb_intern("protected_needs_cursor?"), 0, Qnil);
|
3287
3274
|
bool swig_val;
|
3288
3275
|
int swig_res = SWIG_AsVal_bool(result, &swig_val);
|
3289
3276
|
if (!SWIG_IsOK(swig_res)) {
|
@@ -3297,14 +3284,14 @@ bool SwigDirector_Window::needs_cursor() const {
|
|
3297
3284
|
void SwigDirector_Window::lose_focus() {
|
3298
3285
|
VALUE SWIGUNUSED result;
|
3299
3286
|
|
3300
|
-
result = rb_funcall(swig_get_self(), rb_intern("protected_lose_focus"), 0,
|
3287
|
+
result = rb_funcall(swig_get_self(), rb_intern("protected_lose_focus"), 0, Qnil);
|
3301
3288
|
}
|
3302
3289
|
|
3303
3290
|
|
3304
3291
|
void SwigDirector_Window::release_memory() {
|
3305
3292
|
VALUE SWIGUNUSED result;
|
3306
3293
|
|
3307
|
-
result = rb_funcall(swig_get_self(), rb_intern("release_memory"), 0,
|
3294
|
+
result = rb_funcall(swig_get_self(), rb_intern("release_memory"), 0, Qnil);
|
3308
3295
|
}
|
3309
3296
|
|
3310
3297
|
|
@@ -5016,6 +5003,44 @@ fail:
|
|
5016
5003
|
}
|
5017
5004
|
|
5018
5005
|
|
5006
|
+
/*
|
5007
|
+
Document-method: Gosu::Color.to_i
|
5008
|
+
|
5009
|
+
call-seq:
|
5010
|
+
to_i -> std::uint32_t
|
5011
|
+
|
5012
|
+
Convert Color to an Integer.
|
5013
|
+
*/
|
5014
|
+
SWIGINTERN VALUE
|
5015
|
+
_wrap_Color_to_i(int argc, VALUE *argv, VALUE self) {
|
5016
|
+
Gosu::Color *arg1 = (Gosu::Color *) 0 ;
|
5017
|
+
void *argp1 = 0 ;
|
5018
|
+
int res1 = 0 ;
|
5019
|
+
std::uint32_t result;
|
5020
|
+
VALUE vresult = Qnil;
|
5021
|
+
|
5022
|
+
if ((argc < 0) || (argc > 0)) {
|
5023
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
5024
|
+
}
|
5025
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Color, 0 | 0 );
|
5026
|
+
if (!SWIG_IsOK(res1)) {
|
5027
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Color const *","to_i", 1, self ));
|
5028
|
+
}
|
5029
|
+
arg1 = reinterpret_cast< Gosu::Color * >(argp1);
|
5030
|
+
{
|
5031
|
+
try {
|
5032
|
+
result = Gosu_Color_to_i((Gosu::Color const *)arg1);
|
5033
|
+
}
|
5034
|
+
catch (const std::exception& e) {
|
5035
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
5036
|
+
}
|
5037
|
+
}
|
5038
|
+
vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
|
5039
|
+
return vresult;
|
5040
|
+
fail:
|
5041
|
+
return Qnil;
|
5042
|
+
}
|
5043
|
+
|
5019
5044
|
|
5020
5045
|
/*
|
5021
5046
|
Document-method: Gosu::Color.dup
|
@@ -5056,7 +5081,6 @@ fail:
|
|
5056
5081
|
}
|
5057
5082
|
|
5058
5083
|
|
5059
|
-
|
5060
5084
|
/*
|
5061
5085
|
Document-method: Gosu::Color.inspect
|
5062
5086
|
|
@@ -5096,7 +5120,6 @@ fail:
|
|
5096
5120
|
}
|
5097
5121
|
|
5098
5122
|
|
5099
|
-
|
5100
5123
|
/*
|
5101
5124
|
Document-method: Gosu::Color.==
|
5102
5125
|
|
@@ -5699,7 +5722,7 @@ SWIGINTERN VALUE _wrap_new_Font(int nargs, VALUE *args, VALUE self) {
|
|
5699
5722
|
if (argc == 3) {
|
5700
5723
|
int _v;
|
5701
5724
|
void *vptr = 0;
|
5702
|
-
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window,
|
5725
|
+
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, SWIG_POINTER_NO_NULL);
|
5703
5726
|
_v = SWIG_CheckState(res);
|
5704
5727
|
if (_v) {
|
5705
5728
|
int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
|
@@ -7125,7 +7148,7 @@ SWIGINTERN VALUE _wrap_Image_load_tiles(int nargs, VALUE *args, VALUE self) {
|
|
7125
7148
|
if (argc == 5) {
|
7126
7149
|
int _v;
|
7127
7150
|
void *vptr = 0;
|
7128
|
-
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window,
|
7151
|
+
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, SWIG_POINTER_NO_NULL);
|
7129
7152
|
_v = SWIG_CheckState(res);
|
7130
7153
|
if (_v) {
|
7131
7154
|
_v = (argv[1] != 0);
|
@@ -7298,7 +7321,6 @@ fail:
|
|
7298
7321
|
}
|
7299
7322
|
|
7300
7323
|
|
7301
|
-
|
7302
7324
|
/*
|
7303
7325
|
Document-method: Gosu::Image.insert
|
7304
7326
|
|
@@ -7353,7 +7375,6 @@ fail:
|
|
7353
7375
|
}
|
7354
7376
|
|
7355
7377
|
|
7356
|
-
|
7357
7378
|
/*
|
7358
7379
|
Document-method: Gosu::Image.inspect
|
7359
7380
|
|
@@ -8697,6 +8718,7 @@ _wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
|
8697
8718
|
unsigned int arg3 ;
|
8698
8719
|
bool arg4 = (bool) false ;
|
8699
8720
|
double arg5 = (double) 16.666666 ;
|
8721
|
+
bool arg6 = (bool) false ;
|
8700
8722
|
unsigned int val2 ;
|
8701
8723
|
int ecode2 = 0 ;
|
8702
8724
|
unsigned int val3 ;
|
@@ -8705,10 +8727,12 @@ _wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
|
8705
8727
|
int ecode4 = 0 ;
|
8706
8728
|
double val5 ;
|
8707
8729
|
int ecode5 = 0 ;
|
8730
|
+
bool val6 ;
|
8731
|
+
int ecode6 = 0 ;
|
8708
8732
|
const char *classname SWIGUNUSED = "Gosu::Window";
|
8709
8733
|
Gosu::Window *result = 0 ;
|
8710
8734
|
|
8711
|
-
if ((argc < 2) || (argc >
|
8735
|
+
if ((argc < 2) || (argc > 5)) {
|
8712
8736
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
8713
8737
|
}
|
8714
8738
|
arg1 = self;
|
@@ -8736,13 +8760,20 @@ _wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
|
8736
8760
|
}
|
8737
8761
|
arg5 = static_cast< double >(val5);
|
8738
8762
|
}
|
8763
|
+
if (argc > 4) {
|
8764
|
+
ecode6 = SWIG_AsVal_bool(argv[4], &val6);
|
8765
|
+
if (!SWIG_IsOK(ecode6)) {
|
8766
|
+
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "bool","Window", 6, argv[4] ));
|
8767
|
+
}
|
8768
|
+
arg6 = static_cast< bool >(val6);
|
8769
|
+
}
|
8739
8770
|
{
|
8740
8771
|
try {
|
8741
8772
|
if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
|
8742
8773
|
/* subclassed */
|
8743
|
-
result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5);
|
8774
|
+
result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5,arg6);
|
8744
8775
|
} else {
|
8745
|
-
result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5);
|
8776
|
+
result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5,arg6);
|
8746
8777
|
}
|
8747
8778
|
|
8748
8779
|
DATA_PTR(self) = result;
|
@@ -8858,6 +8889,37 @@ fail:
|
|
8858
8889
|
}
|
8859
8890
|
|
8860
8891
|
|
8892
|
+
SWIGINTERN VALUE
|
8893
|
+
_wrap_Window_resizableq___(int argc, VALUE *argv, VALUE self) {
|
8894
|
+
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
8895
|
+
void *argp1 = 0 ;
|
8896
|
+
int res1 = 0 ;
|
8897
|
+
bool result;
|
8898
|
+
VALUE vresult = Qnil;
|
8899
|
+
|
8900
|
+
if ((argc < 0) || (argc > 0)) {
|
8901
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
8902
|
+
}
|
8903
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Gosu__Window, 0 | 0 );
|
8904
|
+
if (!SWIG_IsOK(res1)) {
|
8905
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window const *","resizable", 1, self ));
|
8906
|
+
}
|
8907
|
+
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
8908
|
+
{
|
8909
|
+
try {
|
8910
|
+
result = (bool)((Gosu::Window const *)arg1)->resizable();
|
8911
|
+
}
|
8912
|
+
catch (const std::exception& e) {
|
8913
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
8914
|
+
}
|
8915
|
+
}
|
8916
|
+
vresult = SWIG_From_bool(static_cast< bool >(result));
|
8917
|
+
return vresult;
|
8918
|
+
fail:
|
8919
|
+
return Qnil;
|
8920
|
+
}
|
8921
|
+
|
8922
|
+
|
8861
8923
|
SWIGINTERN VALUE
|
8862
8924
|
_wrap_Window_update_interval(int argc, VALUE *argv, VALUE self) {
|
8863
8925
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
@@ -11548,7 +11610,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
11548
11610
|
|
11549
11611
|
/* Now work on filling in swig_module.types */
|
11550
11612
|
#ifdef SWIGRUNTIME_DEBUG
|
11551
|
-
printf("SWIG_InitializeModule: size %
|
11613
|
+
printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
|
11552
11614
|
#endif
|
11553
11615
|
for (i = 0; i < swig_module.size; ++i) {
|
11554
11616
|
swig_type_info *type = 0;
|
@@ -11556,7 +11618,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
11556
11618
|
swig_cast_info *cast;
|
11557
11619
|
|
11558
11620
|
#ifdef SWIGRUNTIME_DEBUG
|
11559
|
-
printf("SWIG_InitializeModule: type %
|
11621
|
+
printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
|
11560
11622
|
#endif
|
11561
11623
|
|
11562
11624
|
/* if there is another module already loaded */
|
@@ -11632,7 +11694,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
11632
11694
|
for (i = 0; i < swig_module.size; ++i) {
|
11633
11695
|
int j = 0;
|
11634
11696
|
swig_cast_info *cast = swig_module.cast_initial[i];
|
11635
|
-
printf("SWIG_InitializeModule: type %
|
11697
|
+
printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
|
11636
11698
|
while (cast->type) {
|
11637
11699
|
printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
|
11638
11700
|
cast++;
|
@@ -11700,8 +11762,8 @@ SWIGEXPORT void Init_gosu(void) {
|
|
11700
11762
|
rb_define_const(mGosu, "VERSION", SWIG_From_std_string(static_cast< std::string >(Gosu::VERSION)));
|
11701
11763
|
rb_define_const(mGosu, "LICENSES", SWIG_From_std_string(static_cast< std::string >(Gosu::LICENSES)));
|
11702
11764
|
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11703
|
-
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(
|
11704
|
-
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(
|
11765
|
+
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(15)));
|
11766
|
+
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(1)));
|
11705
11767
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
11706
11768
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
11707
11769
|
rb_define_module_function(mGosu, "degrees_to_radians", VALUEFUNC(_wrap_degrees_to_radians), -1);
|
@@ -11745,6 +11807,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
11745
11807
|
rb_define_singleton_method(SwigClassColor.klass, "rgb", VALUEFUNC(_wrap_Color_rgb), -1);
|
11746
11808
|
rb_define_singleton_method(SwigClassColor.klass, "rgba", VALUEFUNC(_wrap_Color_rgba), -1);
|
11747
11809
|
rb_define_singleton_method(SwigClassColor.klass, "argb", VALUEFUNC(_wrap_Color_argb), -1);
|
11810
|
+
rb_define_method(SwigClassColor.klass, "to_i", VALUEFUNC(_wrap_Color_to_i), -1);
|
11748
11811
|
rb_define_method(SwigClassColor.klass, "dup", VALUEFUNC(_wrap_Color_dup), -1);
|
11749
11812
|
rb_define_method(SwigClassColor.klass, "inspect", VALUEFUNC(_wrap_Color_inspect), -1);
|
11750
11813
|
rb_define_method(SwigClassColor.klass, "==", VALUEFUNC(_wrap_Color___eq__), -1);
|
@@ -12097,6 +12160,7 @@ SWIGEXPORT void Init_gosu(void) {
|
|
12097
12160
|
rb_define_method(SwigClassWindow.klass, "width", VALUEFUNC(_wrap_Window_width), -1);
|
12098
12161
|
rb_define_method(SwigClassWindow.klass, "height", VALUEFUNC(_wrap_Window_height), -1);
|
12099
12162
|
rb_define_method(SwigClassWindow.klass, "fullscreen?", VALUEFUNC(_wrap_Window_fullscreenq___), -1);
|
12163
|
+
rb_define_method(SwigClassWindow.klass, "resizable?", VALUEFUNC(_wrap_Window_resizableq___), -1);
|
12100
12164
|
rb_define_method(SwigClassWindow.klass, "update_interval", VALUEFUNC(_wrap_Window_update_interval), -1);
|
12101
12165
|
rb_define_method(SwigClassWindow.klass, "update_interval=", VALUEFUNC(_wrap_Window_update_intervale___), -1);
|
12102
12166
|
rb_define_method(SwigClassWindow.klass, "caption", VALUEFUNC(_wrap_Window_caption), -1);
|