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, master has been updated via 2b990abb940a194551bed5dc1404fc7b6652fefc (commit) via 6918284bd4e44bf573d649a41de317dde14a7e7c (commit) via a2a12ec736712d3beb7aacc00bef5e0435696088 (commit) from c2fc7bc18f5c8ca729525abee47967930485ddd4 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/2b990abb940a194551bed5dc1404fc7b6652f...
commit 2b990abb940a194551bed5dc1404fc7b6652fefc Author: Cyril Hrubis metan@ucw.cz Date: Tue Mar 19 22:22:17 2013 +0100
demos: py_simple: Fix *plots_AA.py
diff --git a/demos/py_simple/gravplots_AA.py b/demos/py_simple/gravplots_AA.py index 284061e..7477744 100755 --- a/demos/py_simple/gravplots_AA.py +++ b/demos/py_simple/gravplots_AA.py @@ -86,18 +86,19 @@ def main(): x = int((e.x % W) * 0x100) y = int(e.y * 0x100) if e.vx > 0.2: - gfx.VLineAA(bk.context, x + 0x100, y - 0x300, y + 0x300, black) + bk.context.gfx.VLineAA(x + 0x100, y - 0x300, y + 0x300, black) if e.vx < -0.2: - gfx.VLineAA(bk.context, x - 0x100, y - 0x300, y + 0x300, black) - gfx.PutPixelAA(bk.context, x, y, bk.context.RGBToPixel(e.r, e.g, e.b)) + bk.context.gfx.VLineAA(x - 0x100, y - 0x300, y + 0x300, black) + bk.context.gfx.PutPixelAA(x, y, bk.context.RGBToPixel(e.r, e.g, e.b)) else: x = int(e.x % W) y = int(e.y) if e.vx > 0.2: - gfx.VLine(bk.context, x + 1, y - 2, y + 2, black) + bk.context.gfx.VLine(x + 1, y - 2, y + 2, black) if e.vx < -0.2: - gfx.VLine(bk.context, x - 1, y - 2, y + 2, black) - core.PutPixel(bk.context, x, y, bk.context.RGBToPixel(e.r, e.g, e.b)) + bk.context.gfx.VLine(x - 1, y - 2, y + 2, black) + bk.context.core.PutPixel(x, y, bk.context.RGBToPixel(e.r, e.g, e.b)) + bk.Poll() bk.Flip() global TIMEOUT if TIMEOUT > 0: diff --git a/demos/py_simple/sinplots_AA.py b/demos/py_simple/sinplots_AA.py index 1d29329..e0933b5 100755 --- a/demos/py_simple/sinplots_AA.py +++ b/demos/py_simple/sinplots_AA.py @@ -46,13 +46,13 @@ def main(): if AA: x = int(x * 0x100) y = int(y * 0x100) - gfx.VLineAA(bk.context, x + 0x100, y - 0x200, y + 0x200, black) - gfx.PutPixelAA(bk.context, x, y, bk.context.RGBToPixel(int(r), int(g), int(b))) + bk.context.gfx.VLineAA(x + 0x100, y - 0x200, y + 0x200, black) + bk.context.gfx.PutPixelAA(x, y, bk.context.RGBToPixel(int(r), int(g), int(b))) else: x = int(x) y = int(y) - gfx.VLine(bk.context, x + 1, y - 2, y + 2, black) - core.PutPixel(bk.context, x, y, bk.context.RGBToPixel(int(r), int(g), int(b))) + bk.context.gfx.VLine(x + 1, y - 2, y + 2, black) + bk.context.core.PutPixel(x, y, bk.context.RGBToPixel(int(r), int(g), int(b))) bk.Flip()
if __name__ == '__main__':
http://repo.or.cz/w/gfxprim.git/commit/6918284bd4e44bf573d649a41de317dde14a7...
commit 6918284bd4e44bf573d649a41de317dde14a7e7c Author: Cyril Hrubis metan@ucw.cz Date: Tue Mar 19 22:15:39 2013 +0100
pywrap: loaders: Remove unused _extend_context.py
diff --git a/pylib/gfxprim/loaders/_extend_context.py b/pylib/gfxprim/loaders/_extend_context.py deleted file mode 100644 index e252b4b..0000000 --- a/pylib/gfxprim/loaders/_extend_context.py +++ /dev/null @@ -1,41 +0,0 @@ -from ..utils import extend, add_swig_getmethod, add_swig_setmethod -from . import loaders_c - -def extend_context(_context): - """ - Extends _context class with loader module methods for calling convenience. - Called once on loaders module inicialization. - """ - - @extend(_context, name='load') - @staticmethod - def Load(filename): - "Load image from given file, guess type." - c = loaders_c.GP_LoadImage_Wrap(filename) - return c - - @extend(_context) - def Save(self, filename, format=None, callback=None): - """Save the image in given format (or guess it from the extension) - - Currently, JPG, PNG and P[BGP]M are supported, but not for all - context pixel types. - """ - if not format: - format = filename.rsplit('.', 1)[-1] - format = format.lower() - if format == 'jpg': - res = loaders_c.GP_SaveJPG(self, filename, callback) - elif format == 'png': - res = loaders_c.GP_SavePNG(self, filename, callback) - elif format == 'pbm': - res = loaders_c.GP_SavePBM(filename, self, callback) - elif format == 'pgm': - res = loaders_c.GP_SavePGM(filename, self, callback) - elif format == 'ppm': - res = loaders_c.GP_SavePPM(filename, self, callback) - else: - raise Exception("Format %r not supported.", format) - if res != 0: - raise Exception("Error saving %r (code %d)", filename, res) -
http://repo.or.cz/w/gfxprim.git/commit/a2a12ec736712d3beb7aacc00bef5e0435696...
commit a2a12ec736712d3beb7aacc00bef5e0435696088 Author: Cyril Hrubis metan@ucw.cz Date: Tue Mar 19 22:01:42 2013 +0100
pywrap: backends: Hack it together.
diff --git a/pylib/gfxprim/backends/C.py b/pylib/gfxprim/backends/C.py deleted file mode 100644 index c8f987f..0000000 --- a/pylib/gfxprim/backends/C.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Submodule for constants -""" diff --git a/pylib/gfxprim/backends/Makefile b/pylib/gfxprim/backends/Makefile index 7ecff0c..ac02d2a 100644 --- a/pylib/gfxprim/backends/Makefile +++ b/pylib/gfxprim/backends/Makefile @@ -2,6 +2,8 @@ TOPDIR=../../.. LIBNAME=backends INCLUDE=core
+LDFLAGS+=$(shell $(TOPDIR)/gfxprim-config --libs-backends) + include $(TOPDIR)/pre.mk include $(TOPDIR)/pywrap.mk include $(TOPDIR)/post.mk diff --git a/pylib/gfxprim/backends/__init__.py b/pylib/gfxprim/backends/__init__.py index f0ebdae..9e94604 100644 --- a/pylib/gfxprim/backends/__init__.py +++ b/pylib/gfxprim/backends/__init__.py @@ -7,37 +7,26 @@ Accessing a context after its backend has ben freed will probably end your (program's) world """
-from . import backends_c +from . import c_backends
# Pull GP_Backend -Backend = backends_c.GP_Backend - -# Constants module -from . import C +Backend = c_backends.GP_Backend
def _init(module): - # Extend Context with convenience methods - from ._extend_context import extend_context - from ..core import Context - extend_context(Context)
# Extend GP_Backend with convenience methods from ._extend_backend import extend_backend extend_backend(Backend)
- # Import some members from the SWIG module - from ..utils import import_members + # Imports from the SWIG module import re def strip_GP(s): return re.sub('^GP_', '', s)
- # Constants - const_regexes = ['^GP_[A-Z0-9_]*$'] - import_members(backends_c, C, include=const_regexes, sub=strip_GP) - - # Functions - import_members(backends_c, module, sub=strip_GP, - exclude=const_regexes + [ + # Import some members from the SWIG module + from ..utils import import_members + import_members(c_backends, module, sub=strip_GP, + exclude=[ '^GP_Backend$', '^gfxprim$', '^w+_swigregister$', diff --git a/pylib/gfxprim/backends/_extend_backend.py b/pylib/gfxprim/backends/_extend_backend.py index 31c56ef..ae351d7 100644 --- a/pylib/gfxprim/backends/_extend_backend.py +++ b/pylib/gfxprim/backends/_extend_backend.py @@ -1,5 +1,5 @@ from ..utils import extend, add_swig_getmethod, add_swig_setmethod -from . import backends_c +from . import c_backends
def extend_backend(_backend): """ @@ -16,24 +16,24 @@ def extend_backend(_backend): @extend(_backend) def Flip(self): "If display is buffered, this copies content of context onto display." - return backends_c.GP_BackendFlip(self) + return c_backends.GP_BackendFlip(self)
@extend(_backend) def UpdateRect(self, rect): "Update a rectangle on a buffered backend." - return backends_c.GP_BackendUpdateRect(self, rect[0], rect[1], rect[2], rect[3]) + return c_backends.GP_BackendUpdateRect(self, rect[0], rect[1], rect[2], rect[3])
@extend(_backend) def Poll(self): "Poll the backend for events." - return backends_c.GP_BackendPoll(self) + return c_backends.GP_BackendPoll(self)
@extend(_backend) def SetCaption(self, caption): "Set backend window caption (if possible)" - return backends_c.GP_BackendSetCaption(self, caption) + return c_backends.GP_BackendSetCaption(self, caption)
@extend(_backend) def Resize(self, w, h): "Resize backend window (if possible)" - return backends_c.GP_BackendResize(self, w, h) + return c_backends.GP_BackendResize(self, w, h) diff --git a/pylib/gfxprim/backends/_extend_context.py b/pylib/gfxprim/backends/_extend_context.py deleted file mode 100644 index f1754a5..0000000 --- a/pylib/gfxprim/backends/_extend_context.py +++ /dev/null @@ -1,8 +0,0 @@ -from ..utils import extend, add_swig_getmethod, add_swig_setmethod -from . import backends_c - -def extend_context(_context): - """ - Extends _context class with backend support. - """ - extend(_context, name='backend')(None) diff --git a/pylib/gfxprim/backends/backends.i b/pylib/gfxprim/backends/backends.i index fb3fb7d..d4b6b2c 100644 --- a/pylib/gfxprim/backends/backends.i +++ b/pylib/gfxprim/backends/backends.i @@ -1,5 +1,5 @@ %include "../common.i" -%module(package="gfxprim.backends") backends_c +%module(package="gfxprim.backends") c_backends
%{ #include "GP_Backend.h"
-----------------------------------------------------------------------
Summary of changes: demos/py_simple/gravplots_AA.py | 13 +++++---- demos/py_simple/sinplots_AA.py | 8 +++--- pylib/gfxprim/backends/C.py | 3 -- pylib/gfxprim/backends/Makefile | 2 + pylib/gfxprim/backends/__init__.py | 25 +++++------------ pylib/gfxprim/backends/_extend_backend.py | 12 ++++---- pylib/gfxprim/backends/_extend_context.py | 8 ----- pylib/gfxprim/backends/backends.i | 2 +- pylib/gfxprim/loaders/_extend_context.py | 41 ----------------------------- 9 files changed, 27 insertions(+), 87 deletions(-) delete mode 100644 pylib/gfxprim/backends/C.py delete mode 100644 pylib/gfxprim/backends/_extend_context.py delete mode 100644 pylib/gfxprim/loaders/_extend_context.py
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.