Author: ArcRiley Date: 2008-04-22 04:24:17 -0400 (Tue, 22 Apr 2008) New Revision: 1248
Added: trunk/pysoy/include/soy/_core.pxd trunk/pysoy/include/soy/_datatypes.pxd trunk/pysoy/include/soy/_internals.pxd trunk/pysoy/include/soy/actions.pxd trunk/pysoy/include/soy/atoms.pxd trunk/pysoy/include/soy/audio.pxd trunk/pysoy/include/soy/bodies.pxd trunk/pysoy/include/soy/colors.pxd trunk/pysoy/include/soy/controllers.pxd trunk/pysoy/include/soy/fields.pxd trunk/pysoy/include/soy/joints.pxd trunk/pysoy/include/soy/masses.pxd trunk/pysoy/include/soy/materials.pxd trunk/pysoy/include/soy/models.pxd trunk/pysoy/include/soy/scenes.pxd trunk/pysoy/include/soy/shapes.pxd trunk/pysoy/include/soy/stubs.pxd trunk/pysoy/include/soy/textures.pxd trunk/pysoy/include/soy/transports.pxd trunk/pysoy/include/soy/widgets.pxd trunk/pysoy/include/soy/windows.pxd Modified: trunk/pysoy/setup.py Log: '''Cython Stuff''' : * Copied soy.*.pxd's back to include/soy/*.pxd * Left old files behind for Pyrex compatibility * changed include_path to include_dirs in setup.py - now finds them! Copied: trunk/pysoy/include/soy/_core.pxd (from rev 1241, trunk/pysoy/include/soy._core.pxd) =================================================================== --- trunk/pysoy/include/soy/_core.pxd (rev 0) +++ trunk/pysoy/include/soy/_core.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,111 @@ +# PySoy Core Declarations (for X11-based systems) +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport gl +cimport glib +cimport ode +cimport ogg +cimport py +cimport stdio +cimport soy._internals +cimport soy.colors + +IF UNAME_SYSNAME == "Windows" : + cimport windows +ELIF UNAME_SYSNAME == "Darwin" : + cimport carbon +ELSE: + cimport glx + +cdef class Screen : + cdef int _screenID + cdef object _fullScreen + cdef void _events(self) + # OpenGL Support + cdef int _glVersion + cdef void _coreGlewInit(self) + IF UNAME_SYSNAME != "Windows" : + # X11 Support + cdef glx.Screen *_screen + cdef glx.Atom _wmDelWin + cdef glx.XF86VidModeModeInfo _deskMode + cdef glx.XVisualInfo *_xVisualInfo + + +cdef class Window : + cdef soy._internals.Children _controllers + cdef soy._internals.Children _widgets + cdef Screen _screen + cdef object _title + cdef soy.colors.Color _background + cdef int _x + cdef int _y + cdef int _width + cdef int _height + cdef int _savedWidth + cdef int _savedHeight + cdef int _opened + cdef int _splash + IF UNAME_SYSNAME == "Windows" : + cdef int _windowID + cdef object _icon + cdef int _request + cdef windows.HGLRC _glRenderContext + cdef windows.HDC _deviceContext + cdef windows.HWND _window + cdef windows.HINSTANCE _hInst + cdef void _set_title(self) + cdef void _request_create(self, int, int, int, int) + cdef void _request_destroy(self) + cdef void _registerClass(self) + cdef void _unregisterClass(self) + cdef int _minimized + ELSE : + # X11/GLX platform + cdef glx.Window _windowID + cdef glx.Pixmap _iconPixmap + cdef object _iconCanvas + cdef void _openedWait ( self, int ) + cdef void _setProperties ( self ) + cdef void _coreEventKeyDown ( self, glx.Time, + glx.KeyCode, + glx.KeySym ) + cdef void _coreEventKeyUp ( self, glx.Time, + glx.KeyCode, + glx.KeySym ) + cdef void _coreEventButtonDown ( self, glx.Time, + unsigned int, + int, int ) + cdef void _coreEventButtonUp ( self, glx.Time, + unsigned int, + int, int ) + cdef void _coreEventMotion ( self, glx.Time, + int, int ) + cdef void _coreEventWinClose ( self ) + cdef void _coreEventConfigure ( self, + int, int, int, int ) + cdef void _coreEventCreate ( self ) + cdef void _coreEventDestroy ( self ) + cdef void _coreEventMap ( self ) + cdef void _coreEventUnmap ( self ) + cdef void _coreCreate ( self ) + cdef void _create(self, int, int, int, int) + cdef void _destroy(self) + cdef void _resize(self, int _width, int _height) + cdef void _render(self) Copied: trunk/pysoy/include/soy/_datatypes.pxd (from rev 1241, trunk/pysoy/include/soy._datatypes.pxd) =================================================================== --- trunk/pysoy/include/soy/_datatypes.pxd (rev 0) +++ trunk/pysoy/include/soy/_datatypes.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,128 @@ +# PySoy _datatypes Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport al +cimport gl +cimport glib +cimport ode +cimport py +cimport stdio +cimport soy._internals + +cdef : + struct Face : + unsigned short a + unsigned short b + unsigned short c + + struct Vert : + float px + float py + float pz + float nx + float ny + float nz + float tx + float ty + float tz + float tan_x + float tan_y + float tan_z + + struct Range : + int offset + int length + + +cdef class AudioDeviceTuple : + cdef al.ALCenum _param + cdef object _slice + cdef int _get ( self, char*, int ) + cdef int _len ( self, char* ) + cdef object _addSlice ( self, object, + object, object ) + +cdef class BodyPosition : + cdef void* _body + cdef float _position[3] + + +cdef class Datatype : + cdef void* _alloc ( self, int, int*, + void*, int ) + +cdef class HashTable : + cdef glib.GHashTable* _hashtable + cdef void _insert ( self, char*, float ) + cdef float _lookup ( self, char* ) + cdef int _has_key ( self, char* ) + cdef int _remove ( self, char* ) + + +cdef class MaterialList (Datatype) : + cdef void *_mesh + cdef soy._internals.Children _children + cdef Range *_ranges + cdef int _rangesAlloc + cdef int _hasBumps + # General C functions + cdef void _allocRanges ( self, int ) + # WindowLoop functions + cdef void _render ( self, void* ) + + +cdef class FaceList (Datatype) : + cdef void* _mesh + cdef soy._internals.Children _children + cdef Face* _array + cdef unsigned int* _arrayList + cdef unsigned int _arraySize + cdef int _arrayAlloc + cdef gl.GLuint _buffer + cdef int _bufferAlloc + cdef Range _updateRange + cdef void _allocArray ( self, int ) + cdef void _render ( self, int, int ) + cdef void _renderBumpPass ( self, int, int ) + cdef void _createBuffer ( self ) + cdef void _sendUpdated ( self ) + cdef void _flagUpdated ( self, int, int ) + + +cdef class VertexList (Datatype) : + cdef void* _mesh + cdef soy._internals.Children _children + cdef Vert* _array + cdef float* _fogArray + cdef int _fogSize + cdef float* _tslvArray + cdef int _tslvSize + cdef unsigned short _arraySize + cdef int _arrayAlloc + cdef gl.GLuint _buffer + cdef int _bufferAlloc + cdef Range _updateRange + cdef void _allocArray ( self, int ) + cdef void _render ( self ) + cdef void _renderBumpPass ( self ) + cdef void _createBuffer ( self ) + cdef void _sendUpdated ( self ) + cdef void _flagUpdated ( self, int ) + cdef void _uploadFogCoord ( self, float ) + cdef void _calculateTSLV ( self, void* body ) Copied: trunk/pysoy/include/soy/_internals.pxd (from rev 1241, trunk/pysoy/include/soy._internals.pxd) =================================================================== --- trunk/pysoy/include/soy/_internals.pxd (rev 0) +++ trunk/pysoy/include/soy/_internals.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,95 @@ +# PySoy _internals Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport glib + +cdef class AsyncQueue : + cdef glib.GAsyncQueue* _asyncqueue + cdef void _push ( self, void* ) + cdef object _pop ( self ) + + +cdef class Children : + # C variables + cdef int _size + cdef int _current + cdef int _iters + cdef void** _list + cdef char* _name + # Mutex locks + cdef void* _lockMain + cdef void* _lockIter + # Internal C functions + cdef int _offset ( self, void* ) + cdef void _swap ( self, int, int ) + # External C functions + cdef void _append ( self, void* ) + cdef void _bottom ( self, void* ) + cdef void _empty ( self ) + cdef int _index ( self, void* ) + cdef void _iterDone ( self ) + cdef void _iterStart ( self ) + cdef void _lower ( self, void* ) + cdef void _raise ( self, void* ) + cdef void _remove ( self, void* ) + cdef void _top ( self, void* ) + + +cdef class Loadable : + cdef object _source + cdef int _state + cdef int _load ( self, void*, int ) + cdef int _save ( self, void*, int ) + cdef int _ready ( self ) + + +cdef class Loopable : + cdef int _loop ( self ) + + +cdef class LoopThread : + cdef long _threadID + cdef int _size + cdef int _current + cdef int _running + cdef int _wake + cdef void** _list + cdef void * _listLock + cdef void * _loopLock + cdef object _name + cdef object _active + cdef object _active_limbo_lock + cdef void _loop ( self ) + cdef void _append ( self, void* ) + cdef void _remove ( self, void* ) + + +cdef class PointerSet : + cdef glib.GHashTable* _hashtable + cdef void _insert ( self, void* ) + cdef int _has_key ( self, void* ) + cdef int _remove ( self, void* ) + cdef void _empty ( self ) + cdef void _foreach ( self, glib.GHFunc, void* ) + + +# Extension-level C functions +cdef void _sleep ( unsigned int ) +cdef double _time ( ) +cdef AsyncQueue _getQueue ( ) Copied: trunk/pysoy/include/soy/actions.pxd (from rev 1241, trunk/pysoy/include/soy.actions.pxd) =================================================================== --- trunk/pysoy/include/soy/actions.pxd (rev 0) +++ trunk/pysoy/include/soy/actions.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,36 @@ +# PySoy's actions declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport ode +cimport soy.bodies + +cdef class Action : + # C Functions + cdef void _perform ( self, unsigned int ) + +cdef class Force (Action) : + cdef soy.bodies.Body _target + cdef ode.dVector3 _vector + +cdef class Stdout (Action) : + cdef char* _text + +cdef class Callback (Action) : + cdef object _callback + Copied: trunk/pysoy/include/soy/atoms.pxd (from rev 1241, trunk/pysoy/include/soy.atoms.pxd) =================================================================== --- trunk/pysoy/include/soy/atoms.pxd (rev 0) +++ trunk/pysoy/include/soy/atoms.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,40 @@ +# PySoy atoms declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport py +cimport stdio +cimport soy._internals +cimport soy.models +cimport soy.materials +cimport ode + +cdef class Vertex : + cdef soy._datatypes.VertexList _list + cdef int _index + cdef void* _mutex + + +cdef class Face : + cdef soy._datatypes.FaceList _list + cdef int _index + cdef void* _mutex + + +cdef class Vector : + cdef ode.dVector3 _position \ No newline at end of file Copied: trunk/pysoy/include/soy/audio.pxd (from rev 1241, trunk/pysoy/include/soy.audio.pxd) =================================================================== --- trunk/pysoy/include/soy/audio.pxd (rev 0) +++ trunk/pysoy/include/soy/audio.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,27 @@ +# PySoy audio declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport al +cimport ogg +cimport stdio +cimport soy._internals + +cdef class Output : + cdef al.ALCdevice* _device + cdef al.ALCcontext* _context Copied: trunk/pysoy/include/soy/bodies.pxd (from rev 1241, trunk/pysoy/include/soy.bodies.pxd) =================================================================== --- trunk/pysoy/include/soy/bodies.pxd (rev 0) +++ trunk/pysoy/include/soy/bodies.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,67 @@ +# PySoy's bodies declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport ode +cimport soy._datatypes + +cdef class Body : + cdef ode.dBodyID _bodyID + cdef void* _scene + cdef void* _model + cdef void* _shape + cdef soy._datatypes.HashTable _tags + cdef ode.dMass _mass + cdef ode.dReal* _position + cdef ode.dReal* _rotation + cdef ode.dReal* _quaternion + cdef ode.dReal* _linearVel + cdef ode.dReal* _angularVel + # C functions + cdef void _create ( self ) + cdef void _destroy ( self ) + cdef void _append ( self ) + cdef void _remove ( self ) + cdef void _copyTo ( self, ode.dReal* ) + cdef void _copySet ( self, ode.dReal* ) + cdef void _copyFrom ( self, ode.dReal* ) + cdef void _addForce ( self, ode.dVector3 ) + # WindowLoop functions + cdef void _render ( self ) + cdef void _coreCreateVertFogCoords ( self ) + cdef void _getModelview ( self, float* ) + cdef void _getModelviewInv ( self, float* ) + + +cdef class Camera (Body) : + cdef int _wire + cdef float _fovy + cdef int _rpt + cdef double _rtimes[16] + # WindowLoop functions + cdef void _project ( self ) + + +cdef class Light (Body) : + cdef float _radius + cdef object _ambient + cdef object _diffuse + cdef object _specular + # WindowLoop functions + cdef void _on ( self, int ) + cdef void _off ( self, int ) Copied: trunk/pysoy/include/soy/colors.pxd (from rev 1241, trunk/pysoy/include/soy.colors.pxd) =================================================================== --- trunk/pysoy/include/soy/colors.pxd (rev 0) +++ trunk/pysoy/include/soy/colors.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,25 @@ +# PySoy Color Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport gl + +cdef object _getValues (object, gl.GLfloat**) + +cdef class Color : + cdef gl.GLfloat _rgba[4] Copied: trunk/pysoy/include/soy/controllers.pxd (from rev 1241, trunk/pysoy/include/soy.controllers.pxd) =================================================================== --- trunk/pysoy/include/soy/controllers.pxd (rev 0) +++ trunk/pysoy/include/soy/controllers.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,43 @@ +# PySoy Controllers Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport soy._core +cimport soy._internals +cimport soy.actions + +cdef class Controller : + cdef void _coreEventKeyDown ( self, unsigned char, unsigned char ) + cdef void _coreEventKeyUp ( self, unsigned char, unsigned char ) + cdef void _coreEventWinClose ( self ) + +cdef class Keyboard (Controller) : + cdef soy._core.Window _window + cdef void* _acts_keycde[256] + cdef void* _acts_keysym[256] + +cdef class Window (Controller) : + cdef soy._core.Window _window + cdef void* _acts_close + +cdef class Keyboard2 (Controller) : + cdef soy._core.Window _window + cdef void* _acts_keycde_down[256] + cdef void* _acts_keysym_down[256] + cdef void* _acts_keycde_up[256] + cdef void* _acts_keysym_up[256] Copied: trunk/pysoy/include/soy/fields.pxd (from rev 1241, trunk/pysoy/include/soy.fields.pxd) =================================================================== --- trunk/pysoy/include/soy/fields.pxd (rev 0) +++ trunk/pysoy/include/soy/fields.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,56 @@ +# PySoy's fields Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport ode +cimport soy._internals +cimport soy.bodies + +cdef class Field (soy.bodies.Body) : + cdef void _give(self, int ccyle) + cdef int _apply(self) + cdef int _exert(self, soy.bodies.Body other) + cdef void _commit(self) + cdef void _render(self) + +cdef class Monopole (Field) : + cdef soy._internals.Children _affected + cdef float _multiplier + +cdef class Wind (Field) : + cdef float _density + cdef float _vx + cdef float _vy + cdef float _vz + +cdef class Shockwave (Field) : + cdef ode.dSpaceID _space + cdef float _radius + cdef double _t0 + cdef double _inner + cdef double _outer + cdef float _velocity + cdef float _length + cdef float _energy + +cdef class Buoyancy (Field) : + cdef soy._internals.Children _affected + cdef float _density + +cdef extern from "math.h" : + float powf (float x, float y) Copied: trunk/pysoy/include/soy/joints.pxd (from rev 1241, trunk/pysoy/include/soy.joints.pxd) =================================================================== --- trunk/pysoy/include/soy/joints.pxd (rev 0) +++ trunk/pysoy/include/soy/joints.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,28 @@ +# PySoy Joints Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id $ + +cimport ode +cimport soy.bodies +cimport soy.scenes + +cdef class Joint : + cdef soy.scenes.Scene _scene + cdef ode.dJointID _jointID + cdef soy.bodies.Body _body1 + cdef soy.bodies.Body _body2 Copied: trunk/pysoy/include/soy/masses.pxd (from rev 1241, trunk/pysoy/include/soy.masses.pxd) =================================================================== --- trunk/pysoy/include/soy/masses.pxd (rev 0) +++ trunk/pysoy/include/soy/masses.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,31 @@ +# PySoy Stub Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id $ + +cimport soy._internals +cimport stdio +cimport ode +cimport soy._core +cimport soy._internals +cimport soy.bodies + + +cdef class Mass : + cdef ode.dMass _mass + cdef soy.bodies.Body _body + cdef ode.dBodyID _bodyID Copied: trunk/pysoy/include/soy/materials.pxd (from rev 1241, trunk/pysoy/include/soy.materials.pxd) =================================================================== --- trunk/pysoy/include/soy/materials.pxd (rev 0) +++ trunk/pysoy/include/soy/materials.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,46 @@ +# PySoy materials declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport gl +cimport stdio +cimport soy.colors +cimport soy.textures + +cdef class Material : + cdef object _color + cdef object _normal + + cdef soy.colors.Color _ambient + cdef soy.colors.Color _diffuse + cdef soy.colors.Color _specular + cdef soy.colors.Color _emissive + + cdef int _shades + cdef float _shininess + cdef int _shadeless + + cdef int _blend_func_src + cdef int _blend_func_dst + + # C Functions + cdef void _coreBind(self) + cdef void _coreUnBind(self) + cdef void _coreBindBumpPass(self) + cdef void _coreUnBindBumpPass(self) + cdef int _isTransparent(self) Copied: trunk/pysoy/include/soy/models.pxd (from rev 1241, trunk/pysoy/include/soy.models.pxd) =================================================================== --- trunk/pysoy/include/soy/models.pxd (rev 0) +++ trunk/pysoy/include/soy/models.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,75 @@ +# PySoy model declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id: soy.models.pxd 1090 2008-03-07 17:07:46Z ArcRiley $ + +cimport gl +cimport py +cimport stdio +cimport soy._datatypes +cimport soy._internals +cimport soy.materials +cimport soy.textures +cimport soy.shapes + +cdef class Model : + cdef void* _mutex + # + # WindowLoop functions + cdef void _render ( self, void* ) + + +cdef class Mesh (Model) : + cdef soy._datatypes.MaterialList _mates + cdef soy._datatypes.FaceList _faces + cdef soy._datatypes.VertexList _verts + + +cdef class Shape (Model) : + cdef soy.materials.Material _material + # + # WindowLoop functions + cdef void _renderSphere ( self, soy.shapes.Shape ) + cdef void _renderCapsule ( self, soy.shapes.Shape ) + cdef void _renderBox ( self, soy.shapes.Shape ) + cdef void _renderRay ( self, soy.shapes.Shape ) + + +cdef class Billboard (Model) : + cdef soy.materials.Material _material + cdef float _size[2] + + +cdef class Sun (Model) : + cdef soy.materials.Material _center_mat + cdef soy.materials.Material _aura_mat + cdef soy.materials.Material _spike_mat + cdef int _num_spikes + cdef int _circle_verts + cdef float _center_size[2] + cdef float _aura_size[2] + cdef float _spike_size + + +cdef class Liquid (Model) : + cdef float _size[3] + cdef soy.materials.Material _material + cdef soy.colors.Color _color + # + # WindowLoop functions + cdef void _renderSurf ( self ) + cdef void _renderBottom ( self ) Copied: trunk/pysoy/include/soy/scenes.pxd (from rev 1241, trunk/pysoy/include/soy.scenes.pxd) =================================================================== --- trunk/pysoy/include/soy/scenes.pxd (rev 0) +++ trunk/pysoy/include/soy/scenes.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,89 @@ +# PySoy Scenes Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport gl +cimport glib +cimport ode +cimport py +cimport soy._internals +cimport soy._datatypes +cimport soy.materials + +cdef : + struct Face : + unsigned short a + unsigned short b + unsigned short c + + struct Vert : + float px + float py + float pz + float nx + float ny + float nz + float tx + float ty + float tz + float tan_x + float tan_y + float tan_z + +cdef void _prerunField(void*, void*, void*) +cdef void _runField(void*, void*, void*) + +cdef class Scene (soy._internals.Loopable) : + cdef ode.dWorldID _worldID + cdef ode.dSpaceID _spaceID + cdef ode.dJointGroupID _contactGroup + cdef soy._internals.Children _bodies + cdef soy._internals.Children _joints + cdef soy._internals.Children _lights + cdef soy._internals.PointerSet _giveFields + cdef soy._internals.PointerSet _callFields + cdef object _ambient + cdef void* _stepMutex + cdef void _stepLock ( self ) + cdef int _stepTryLock ( self ) + cdef void _stepUnLock ( self ) + cdef ode.dReal _stepSize + cdef ode.dReal _friction + cdef double _prevTime + cdef double _time + # _coreloop methods + cdef void _render ( self ) + cdef int _steps ( self ) + cdef void _updateTime ( self ) + cdef void _callback ( self, ode.dGeomID, ode.dGeomID ) + +cdef class Landscape (Scene) : + cdef ode.dHeightfieldDataID _heightmapID + cdef ode.dGeomID _heightmap + cdef int _width + cdef int _height + cdef gl.GLuint _buffer + cdef void _createBuffer ( self ) + +cdef class Planar (Scene) : + cdef ode.dGeomID _planeID + cdef float _offset + cdef soy.materials.Material _material + cdef Vert _verts[60] + cdef Face _faces[40] + cdef Vert _midpoint(self, Vert, Vert) Copied: trunk/pysoy/include/soy/shapes.pxd (from rev 1241, trunk/pysoy/include/soy.shapes.pxd) =================================================================== --- trunk/pysoy/include/soy/shapes.pxd (rev 0) +++ trunk/pysoy/include/soy/shapes.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,30 @@ +# PySoy shapes declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport stdio +cimport ode +cimport soy._internals + +cdef class Shape : + cdef ode.dGeomID _geomID + cdef ode.dReal* _position + cdef float _pointDepth(self, float x, float y, float z) + cdef float _radius(self) + cdef int _finite(self) + cdef float _volume(self) Copied: trunk/pysoy/include/soy/stubs.pxd (from rev 1241, trunk/pysoy/include/soy.stubs.pxd) =================================================================== --- trunk/pysoy/include/soy/stubs.pxd (rev 0) +++ trunk/pysoy/include/soy/stubs.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,20 @@ +# PySoy Stub Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id $ + +cimport soy._internals Copied: trunk/pysoy/include/soy/textures.pxd (from rev 1241, trunk/pysoy/include/soy.textures.pxd) =================================================================== --- trunk/pysoy/include/soy/textures.pxd (rev 0) +++ trunk/pysoy/include/soy/textures.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,76 @@ +# PySoy's textures declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport gl +cimport py +cimport ogg +cimport cairo +cimport stdio +cimport soy._internals +cimport soy.colors + +cdef class Texture (soy._internals.Loadable) : + cdef gl.GLuint _textureID + cdef gl.GLenum _target + cdef void* _mutex + cdef int _bytes + cdef int _chans + cdef gl.GLsizei _width + cdef gl.GLsizei _height + cdef gl.GLsizei _depth + cdef gl.GLfloat _scaleX + cdef gl.GLfloat _scaleY + cdef gl.GLfloat _scaleZ + cdef float _aspect + cdef int _update + cdef gl.GLubyte *_texels + # Lookup Arrays + cdef int _types[3] + cdef int _formats[5] + # General C functions + cdef void _resize(self, int, int, int, int, int) + cdef int _squareup(self, int) + # WindowLoop functions + cdef void _enable(self) + cdef void _disable(self) + + +cdef class Print (Texture) : + cdef cairo.cairo_surface_t* _surface + cdef cairo.cairo_t* _context + cdef soy.colors.Color _background + cdef soy.colors.Color _foreground + cdef object _text + cdef object _font + # General C functions + cdef void _draw ( self ) + + +cdef class Video (Texture) : + cdef int _stage # -1=Null, 0=New, 1=Header, 2=Decode + cdef ogg.ogg_stream_state _stream + cdef ogg.theora_info _info + cdef ogg.theora_comment _comment + cdef ogg.theora_state _decode + cdef double _startTime + cdef double _frameTime + +cdef class NormalisationCubeMap(Texture): + cdef int _was_created + cdef void _generate(self, int, int) Copied: trunk/pysoy/include/soy/transports.pxd (from rev 1241, trunk/pysoy/include/soy.transports.pxd) =================================================================== --- trunk/pysoy/include/soy/transports.pxd (rev 0) +++ trunk/pysoy/include/soy/transports.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,71 @@ +# PySoy storage declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport ogg +cimport py +cimport stdio +cimport soy._internals + + +cdef struct Stored : + int serialno + unsigned char namelen + char name[256] + void *object + + +cdef class Transport (soy._internals.Loopable) : + cdef Stored* _objs + cdef object _dict + cdef int _mobj + cdef int _nobj + cdef int _vers # <-9=error, -1=empty, 0=ogg, >0=soy + cdef int _mode # 0 = idle, 1 = load, 2 = save + # for Ogg + cdef int _oggLoop + cdef ogg.ogg_sync_state _sync + # + # General Functions + cdef int _initObjt ( self, int, object, object ) + cdef int _indexName ( self, char*, unsigned char ) + cdef int _indexSerial ( self, int ) + # + # Transport-specific functions + cdef int _open ( self, object ) + cdef int _read ( self, char*, int ) + cdef int _write ( self, char*, int ) + cdef int _goto ( self, long ) + cdef int _seek ( self, long ) + cdef long _tell ( self ) + cdef void _rewind ( self ) + cdef void _close ( self ) + # + # Soy functions + cdef void _soyHead ( self ) + cdef void _soyLoad ( self ) + cdef void _soyRead ( self, char*, int ) + # + # Ogg functions + cdef void _oggHead ( self ) + cdef void _oggLoad ( self ) + cdef int _oggReadPage ( self, ogg.ogg_page* ) + + +cdef class File (Transport) : + cdef void* _file Copied: trunk/pysoy/include/soy/widgets.pxd (from rev 1241, trunk/pysoy/include/soy.widgets.pxd) =================================================================== --- trunk/pysoy/include/soy/widgets.pxd (rev 0) +++ trunk/pysoy/include/soy/widgets.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,64 @@ +# PySoy's widgets declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ + +cimport gl +cimport stdio +cimport soy._core +cimport soy._datatypes +cimport soy._internals +cimport soy.bodies +cimport soy.colors +cimport soy.textures + +cdef class Widget : + cdef soy._core.Window _window + cdef object _parent + cdef int _topLevel + cdef int _xpos + cdef int _ypos + cdef int _width + cdef int _height + cdef float _aspect + cdef int _marginTop + cdef int _marginRight + cdef int _marginBottom + cdef int _marginLeft + cdef int _alignWidth + cdef int _alignHeight + # Helper Functions + cdef int _setMargin(self, object) + # _coreLoop Functions + cdef void _render(self) + cdef void _resize(self, int, int, int, int) + + +cdef class Container (Widget) : + cdef soy._internals.Children _widgets + +cdef class Canvas (Widget) : + cdef object _texture + cdef soy._datatypes.Vert _verts[4] + cdef soy._datatypes.Face _faces[2] + + +cdef class Projector (Widget) : + cdef soy.bodies.Camera _camera + cdef int _connected + cdef float _znear + cdef float _zfar Copied: trunk/pysoy/include/soy/windows.pxd (from rev 1241, trunk/pysoy/include/soy.windows.pxd) =================================================================== --- trunk/pysoy/include/soy/windows.pxd (rev 0) +++ trunk/pysoy/include/soy/windows.pxd 2008-04-22 08:24:17 UTC (rev 1248) @@ -0,0 +1,33 @@ +# PySoy soy.windows Declarations +# +# Copyright (C) 2006,2007,2008 PySoy Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id $ + +IF UNAME_SYSNAME == "Windows" : + cimport windows +ELIF UNAME_SYSNAME == "Darwin" : + cimport carbon +ELSE: + cimport glx + +cimport soy._internals +cimport soy.colors + +cdef int _glVersion + +cdef class Window : + Modified: trunk/pysoy/setup.py =================================================================== --- trunk/pysoy/setup.py 2008-04-21 06:06:36 UTC (rev 1247) +++ trunk/pysoy/setup.py 2008-04-22 08:24:17 UTC (rev 1248) @@ -29,7 +29,7 @@ extensions = [] scripts = [] -include_path = ['include/'] +include_dirs = ['include/'] extra_compile = [] extra_link = [] @@ -61,7 +61,7 @@ else : modules['_core'].append('x11') modules['_core'].append('xxf86vm') - include_path = include_path + [ + include_dirs = include_dirs + [ '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include', '/usr/include/cairo', @@ -78,6 +78,7 @@ extensions.append(Extension( name=m, sources=sources, + include_dirs=include_dirs, libraries=[libraries[i] for i in modules[m]], extra_compile_args = extra_compile, extra_link_args = extra_link)) @@ -113,8 +114,8 @@ 'Topic :: Scientific/Engineering :: Visualization', 'License :: OSI Approved :: GNU Affero General Public License (AGPL)' ], license = 'GNU Affero General Public License version 3 (AGPLv3)', - #include_dirs = [os.path.abspath(p) for p in include_path], - include_dirs = include_path, + #include_dirs = [os.path.abspath(p) for p in include_dirs], + include_dirs = include_dirs, scripts = scripts) # _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn