This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, pywrap has been created at 2a44791a84f6aa540897532ea8a0e0d2e4e5ae10 (commit)
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/2a44791a84f6aa540897532ea8a0e0d2e4e5a...
commit 2a44791a84f6aa540897532ea8a0e0d2e4e5ae10 Author: Tomas Gavenciak gavento@ucw.cz Date: Thu Nov 24 19:11:15 2011 +0100
Working Python wrappers (sketch versions)
to build: build the lib and run both ./swigify.sh (in their dir) change swigify.sh for python other than 2.6 to use: go to build and run: LD_LIBRARY_PATH=. python then: import gfxprim_core import gfxprim_loaders c=gfxprim_core.GP_ContextAlloc(100,42,3) #RGB888 print "Image %dx%d" % (c.w, c.h) print gfxprim_loaders.GP_SavePNG("a.png", c, None)
diff --git a/include/core/GP_Common.h b/include/core/GP_Common.h index 867c770..14eee71 100644 --- a/include/core/GP_Common.h +++ b/include/core/GP_Common.h @@ -78,6 +78,7 @@ * (for assert and check) * * SWIG_exception is a dummy no-op that is used to raise an exception when wrapped. + * NOTE: Currently totally useless. Hrmmppff. */
void SWIG_exception(const char *msg); diff --git a/include/core/gfxprim_core.swig b/include/core/gfxprim_core.swig index e4b0341..d09d94f 100644 --- a/include/core/gfxprim_core.swig +++ b/include/core/gfxprim_core.swig @@ -1,7 +1,7 @@ %module gfxprim_core
%{ -#include "GP_Core.h" +#include "core/GP_Core.h" %}
#define __attribute__(X) @@ -19,6 +19,7 @@ %include "GP_GetSetBits.h" %include "GP_Transform.h" %include "GP_ProgressCallback.h" +%include "GP_RetCode.h"
/* Color and pixel types */
diff --git a/include/core/swigify.sh b/include/core/swigify.sh new file mode 100755 index 0000000..a82e16e --- /dev/null +++ b/include/core/swigify.sh @@ -0,0 +1,9 @@ +set -e + +swig -python -Wall -I/usr/include/ gfxprim_core.swig +gcc -shared gfxprim_core_wrap.c -L ../../build/ -I /usr/include/python2.6/ -I.. + -lGP -lpng -ljpeg -lm -ldl -o ../../build/_gfxprim_core.so +mv gfxprim_core.py ../../build/ +rm gfxprim_core_wrap.c + +echo Swigified! diff --git a/include/loaders/gfxprim_loaders.swig b/include/loaders/gfxprim_loaders.swig new file mode 100644 index 0000000..28e57b4 --- /dev/null +++ b/include/loaders/gfxprim_loaders.swig @@ -0,0 +1,20 @@ +%module gfxprim_loaders + +%{ +#include "core/GP_Core.h" +#include "loaders/GP_Loaders.h" +%} + +#define __attribute__(X) + +%import ../core/gfxprim_core.swig + +%include <stdint.i> + +%include "GP_Loaders.h" +%include "GP_JPG.h" +%include "GP_PBM.h" +%include "GP_PGM.h" +%include "GP_PPM.h" +%include "GP_PNG.h" + diff --git a/include/loaders/swigify.sh b/include/loaders/swigify.sh new file mode 100755 index 0000000..3308274 --- /dev/null +++ b/include/loaders/swigify.sh @@ -0,0 +1,9 @@ +set -e + +swig -python -Wall -I/usr/include/ gfxprim_loaders.swig +gcc -shared gfxprim_loaders_wrap.c -L ../../build/ -I /usr/include/python2.6/ -I.. + -lGP -lpng -ljpeg -lm -ldl -o ../../build/_gfxprim_loaders.so +mv gfxprim_loaders.py ../../build/ +rm gfxprim_loaders_wrap.c + +echo Swigified!
http://repo.or.cz/w/gfxprim.git/commit/7d61d1587e55d2634695e2f3b87e8a278e730...
commit 7d61d1587e55d2634695e2f3b87e8a278e730b0c Author: Tomas Gavenciak gavento@ucw.cz Date: Thu Nov 24 18:33:46 2011 +0100
Fix missing 'static' at inline func def.
diff --git a/include/core/GP_Counter.h b/include/core/GP_Counter.h index f9e501e..e501309 100644 --- a/include/core/GP_Counter.h +++ b/include/core/GP_Counter.h @@ -55,7 +55,7 @@ typedef GP_Counter_t *GP_Counter; * Increase a counter by 1. */
-static inline void GP_IncCounter(GP_Counter counter) +static inline void GP_IncCounter(GP_Counter counter) { #ifdef GP_IMPLEMENT_COUNTERS if (!counter) return; @@ -68,7 +68,7 @@ static inline void GP_IncCounter(GP_Counter counter) * No checks for underflow. */
-static inline void GP_AddCounter(GP_Counter counter, GP_Counter_t delta) +static inline void GP_AddCounter(GP_Counter counter, GP_Counter_t delta) { #ifdef GP_IMPLEMENT_COUNTERS if (!counter) return; @@ -80,7 +80,7 @@ static inline void GP_AddCounter(GP_Counter counter, GP_Counter_t delta) * Set counter to given value. */
-static inline void GP_SetCounter(GP_Counter counter, GP_Counter_t value) +static inline void GP_SetCounter(GP_Counter counter, GP_Counter_t value) { #ifdef GP_IMPLEMENT_COUNTERS if (!counter) return; @@ -92,7 +92,7 @@ static inline void GP_SetCounter(GP_Counter counter, GP_Counter_t value) * Return counter value */
-inline GP_Counter_t GP_CounterVal(GP_Counter counter) +static inline GP_Counter_t GP_CounterVal(GP_Counter counter) { #ifdef GP_IMPLEMENT_COUNTERS if (!counter) return 0;
http://repo.or.cz/w/gfxprim.git/commit/6f26bf8d5bdee13bca518a15e5c22f6604ada...
commit 6f26bf8d5bdee13bca518a15e5c22f6604adae78 Author: Tomas Gavenciak gavento@ucw.cz Date: Thu Nov 24 18:25:17 2011 +0100
Initial libs/core SWIG Python wrapper
diff --git a/include/core/gfxprim_core.swig b/include/core/gfxprim_core.swig new file mode 100644 index 0000000..e4b0341 --- /dev/null +++ b/include/core/gfxprim_core.swig @@ -0,0 +1,42 @@ +%module gfxprim_core + +%{ +#include "GP_Core.h" +%} + +#define __attribute__(X) + +%include <stdint.i> + +/* Basic types and common methods */ + +%include "GP_Common.h" +%include "GP_Core.h" +%include "GP_Debug.h" +%include "GP_Types.h" +%include "GP_Transform.h" +%include "GP_Counter.h" +%include "GP_GetSetBits.h" +%include "GP_Transform.h" +%include "GP_ProgressCallback.h" + +/* Color and pixel types */ + +%include "GP_Color.h" +%include "GP_Context.h" +%include "GP_Pixel.h" +%include "GP_Pixel.gen.h" +%include "GP_Convert.h" +%include "GP_Convert.gen.h" +%include "GP_Convert_Scale.gen.h" +%include "GP_Blit.gen.h" + +/* Context manipulation */ + +%include "GP_Context.h" +%include "GP_Blit.h" +%include "GP_Blit.gen.h" +%include "GP_FnPerBpp.h" +%include "GP_GetPutPixel.h" +%include "GP_WritePixel.h" +
http://repo.or.cz/w/gfxprim.git/commit/1f50377122afb02f1e82197f29a309342856e...
commit 1f50377122afb02f1e82197f29a309342856e77b Author: Tomas Gavenciak gavento@ucw.cz Date: Thu Nov 24 18:24:48 2011 +0100
Add headers to GP_Core.h
diff --git a/include/core/GP_Core.h b/include/core/GP_Core.h index 9bd927f..70c2c3f 100644 --- a/include/core/GP_Core.h +++ b/include/core/GP_Core.h @@ -59,4 +59,10 @@ /* Color */ #include "core/GP_Color.h"
+/* Progress callback */ +#include "core/GP_ProgressCallback.h" + +/* Debug counters */ +#include "core/GP_Counter.h" + #endif /* GP_CORE_H */
http://repo.or.cz/w/gfxprim.git/commit/2393f81c77be4ef152fb92bdbb3c0afab32b4...
commit 2393f81c77be4ef152fb92bdbb3c0afab32b460f Author: Tomas Gavenciak gavento@ucw.cz Date: Thu Nov 24 18:23:02 2011 +0100
Prepare GP_INTERNAL_ABORT for exception throwing.
Accumulate an error string instead of direct fprintf.
diff --git a/include/core/GP_Common.h b/include/core/GP_Common.h index cae989e..867c770 100644 --- a/include/core/GP_Common.h +++ b/include/core/GP_Common.h @@ -76,16 +76,25 @@ * and prints message and calls abort(). * GP_GENERAL_CHECK is a check with specified message prefix * (for assert and check) + * + * SWIG_exception is a dummy no-op that is used to raise an exception when wrapped. */
+void SWIG_exception(const char *msg); + +#define GP_INTERNAL_ABORT_BUFSIZE 24 #define GP_INTERNAL_ABORT(str_abort_msg_, ...) do { - fprintf(stderr, "*** gfxprim: %s:%d: in %s: %s", + char bufstart[GP_INTERNAL_ABORT_BUFSIZE], *buf = bufstart; + char *bufend = buf + GP_INTERNAL_ABORT_BUFSIZE; + buf += snprintf(buf, bufend - buf, "*** gfxprim: %s:%d: in %s: %s", __FILE__, __LINE__, __FUNCTION__, str_abort_msg_); + if (buf > bufend) buf = bufend; if (! (#__VA_ARGS__ [0])) - fprintf(stderr, "abort()"); + buf += snprintf(buf, bufend - buf, "abort()"); else - fprintf(stderr, " " __VA_ARGS__); - fprintf(stderr, "n"); + buf += snprintf(buf, bufend - buf, " " __VA_ARGS__); + SWIG_exception(bufstart); + fprintf(stderr, "%sn", bufstart); abort(); } while (0)
diff --git a/libs/core/GP_Common.c b/libs/core/GP_Common.c new file mode 100644 index 0000000..92ec868 --- /dev/null +++ b/libs/core/GP_Common.c @@ -0,0 +1,27 @@ +/***************************************************************************** + * This file is part of gfxprim library. * + * * + * Gfxprim is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * Gfxprim is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with gfxprim; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + * Copyright (C) 2011 Tomas Gavenciak gavento@ucw.cz * + * * + *****************************************************************************/ + +#include "core/GP_Common.h" + +void SWIG_exception(const char *msg) +{ +}
-----------------------------------------------------------------------
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.