Author: ArcRiley Date: 2007-07-05 03:01:36 -0400 (Thu, 05 Jul 2007) New Revision: 359
Added: trunk/pysoy/src/_core-common/_Transports.pxi Removed: trunk/pysoy/src/_core-common/_tran.pxi Modified: trunk/pysoy/src/_core-common/Scene.pxi trunk/pysoy/src/_core-x11/Screen.pxi trunk/pysoy/src/_core-x11/Window.pxi trunk/pysoy/src/_core-x11/soy._core.pyx trunk/pysoy/src/transports/ trunk/pysoy/src/transports/Transport.pxi Log: more level 5 sin stuff: * moved _core globals to their respective .pxi files * implemented soy._core._Transports python function (returns PyCObject) * moved _tran.pxi to _Transports.pxi * made soy.transports.Transport add itself to this global Modified: trunk/pysoy/src/_core-common/Scene.pxi =================================================================== --- trunk/pysoy/src/_core-common/Scene.pxi 2007-07-05 06:28:58 UTC (rev 358) +++ trunk/pysoy/src/_core-common/Scene.pxi 2007-07-05 07:01:36 UTC (rev 359) @@ -19,6 +19,9 @@ cimport soy.bodies.lights +cdef soy._internals.Children _scenes +_scenes = soy._internals.Children() + cdef class Scene : '''PySoy Scene Copied: trunk/pysoy/src/_core-common/_Transports.pxi (from rev 358, trunk/pysoy/src/_core-common/_tran.pxi) =================================================================== --- trunk/pysoy/src/_core-common/_Transports.pxi (rev 0) +++ trunk/pysoy/src/_core-common/_Transports.pxi 2007-07-05 07:01:36 UTC (rev 359) @@ -0,0 +1,26 @@ +# PySoy _Transports +# +# Copyright (C) 2007 Team PySoy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +# This hack counts as a level 5 sin. + +cdef soy._internals.Children _transports +_transports = soy._internals.Children() + +def _Transports() : + return py.PyCObject_FromVoidPtr(<void *> _transports, NULL) Deleted: trunk/pysoy/src/_core-common/_tran.pxi =================================================================== --- trunk/pysoy/src/_core-common/_tran.pxi 2007-07-05 06:28:58 UTC (rev 358) +++ trunk/pysoy/src/_core-common/_tran.pxi 2007-07-05 07:01:36 UTC (rev 359) @@ -1,26 +0,0 @@ -# PySoy _Transports -# -# Copyright (C) 2007 Team PySoy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see http://www.gnu.org/licenses -# -# $Id$ - -# This hack counts as a level 5 sin. - -cdef soy._internals.Children _transports -_transports = soy._internals.Children() - -def _Transports() : - return py.PyCObject_FromVoidPtr(<void *> _transports, NULL) Modified: trunk/pysoy/src/_core-x11/Screen.pxi =================================================================== --- trunk/pysoy/src/_core-x11/Screen.pxi 2007-07-05 06:28:58 UTC (rev 358) +++ trunk/pysoy/src/_core-x11/Screen.pxi 2007-07-05 07:01:36 UTC (rev 359) @@ -18,7 +18,9 @@ # $Id$ cdef glx.Display *_display +cdef soy._internals.Children _screens _display = glx.XOpenDisplay(NULL) +_screens = soy._internals.Children() cdef class Screen : '''Screen Class Modified: trunk/pysoy/src/_core-x11/Window.pxi =================================================================== --- trunk/pysoy/src/_core-x11/Window.pxi 2007-07-05 06:28:58 UTC (rev 358) +++ trunk/pysoy/src/_core-x11/Window.pxi 2007-07-05 07:01:36 UTC (rev 359) @@ -17,6 +17,9 @@ # # $Id$ +cdef soy._internals.Children _windows +_windows = soy._internals.Children() + cdef class Window : '''Window Class Modified: trunk/pysoy/src/_core-x11/soy._core.pyx =================================================================== --- trunk/pysoy/src/_core-x11/soy._core.pyx 2007-07-05 06:28:58 UTC (rev 358) +++ trunk/pysoy/src/_core-x11/soy._core.pyx 2007-07-05 07:01:36 UTC (rev 359) @@ -31,19 +31,13 @@ cimport soy.widgets import soy.colors - -cdef soy._internals.Children _screens -cdef soy._internals.Children _windows -cdef soy._internals.Children _scenes -_screens = soy._internals.Children() -_windows = soy._internals.Children() -_scenes = soy._internals.Children() - - -include "../_core-common/_coreLoop.pxi" -include "../_core-common/_init.pxi" +include "../_core-common/_Transports.pxi" include "../_core-common/Scene.pxi" include "_sleep.pxi" include "_time.pxi" include "Screen.pxi" include "Window.pxi" + +# These must be last +include "../_core-common/_coreLoop.pxi" +include "../_core-common/_init.pxi" Property changes on: trunk/pysoy/src/transports ___________________________________________________________________ Name: svn:ignore - soy.storage.c + soy.transports.c Modified: trunk/pysoy/src/transports/Transport.pxi =================================================================== --- trunk/pysoy/src/transports/Transport.pxi 2007-07-05 06:28:58 UTC (rev 358) +++ trunk/pysoy/src/transports/Transport.pxi 2007-07-05 07:01:36 UTC (rev 359) @@ -26,6 +26,7 @@ ''' def __init__(self, path, *args, **keywords) : cdef char _magic[4] + cdef soy._internals.Children _transports self._objs = {} self._snos = {} if self._open(path) : @@ -37,7 +38,16 @@ #elif _magic == 'Soy0' : else : raise TypeError('unsupported file type') + + # Yes, this is a level 5 sin. + _transports = <soy._internals.Children> \ + py.PyCObject_AsVoidPtr(__import__('soy._core', [], [], + ['_Transports']).__dict__['_Transports']()) + _transports.lock() + _transports.append(<void *> self) + _transports.unlock() + # This is called by _coreLoop() cdef void _process(self) : if self._mode == 1 : @@ -70,7 +80,6 @@ cdef ogg.ogg_packet _packet cdef ogg.oggpack_buffer _buffer cdef ogg.ogg_stream_state _testStream - #self._sync = <ogg.ogg_sync_state *> py.PyMem_Malloc(32) ogg.ogg_sync_init(&self._sync) _magic = ogg.ogg_sync_buffer(&self._sync, 4) _magic[0] = 79 _______________________________________________ PySoy-SVN mailing list [email protected] http://www.pysoy.org/mailman/listinfo/pysoy-svn
