From: John L. <jr...@us...> - 2006-08-28 05:26:23
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1034/wxLua/apps/wxluacan/src Modified Files: canlua.h cansim.h wxluacan.cpp wxluacan.h wxluacan.i wxluacan_bind.cpp Log Message: Finished cleaning up the code, removed all code from internal.h and internal.cpp and moved it to other files. Do not #include internal.h anymore! Have the functions in wxLuaState that only call C lua funcs call C helper funcs in wxlstate.cpp so that you don't have to create a wxLuaState if you don't really need it. Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxluacan_bind.cpp 8 Jun 2006 03:22:06 -0000 1.7 --- wxluacan_bind.cpp 28 Aug 2006 05:26:19 -0000 1.8 *************** *** 45,51 **** --- 45,53 ---- // %define // -------------------------------------------------------------------- + // -------------------------------------------------------------------- // %enum // -------------------------------------------------------------------- + { 0, 0 }, }; *************** *** 66,69 **** --- 68,72 ---- // %define %string // -------------------------------------------------------------------- + { 0, 0 }, }; *************** *** 119,122 **** --- 122,129 ---- + // ---------------------------------------------------------------------------- + // wxLuaGetFunctionList_wxluacan() is called to register global functions + // ---------------------------------------------------------------------------- + WXLUAMETHOD* wxLuaGetFunctionList_wxluacan(size_t &count) { *************** *** 133,136 **** --- 140,147 ---- + // ---------------------------------------------------------------------------- + // wxLuaGetClassList_wxluacan() is called to register classes + // ---------------------------------------------------------------------------- + WXLUACLASS* wxLuaGetClassList_wxluacan(size_t &count) { Index: canlua.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/canlua.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** canlua.h 27 Feb 2006 15:49:57 -0000 1.6 --- canlua.h 28 Aug 2006 05:26:19 -0000 1.7 *************** *** 1,5 **** /*! \file canlua.h \brief simple canvas which takes as drawable area the whole of the scrollable area. ! \author Klaas Holwerda --- 1,5 ---- /*! \file canlua.h \brief simple canvas which takes as drawable area the whole of the scrollable area. ! \author Klaas Holwerda *************** *** 19,24 **** #include "wx/wx.h" ! ! #include "wxlua/include/internal.h" class wxlCanObj; --- 19,23 ---- #include "wx/wx.h" ! #include "wxlua/include/wxlstate.h" class wxlCanObj; *************** *** 29,33 **** class wxlCan; ! //! base canvas object /*! this and derived objects or placed on the canvas in the m_rootobject or as a child of another canvasobject. --- 28,32 ---- class wxlCan; ! //! base canvas object /*! this and derived objects or placed on the canvas in the m_rootobject or as a child of another canvasobject. *************** *** 38,43 **** public: ! ! //! constructor /*! This object can have child objects added, and acts as a grouping object. --- 37,42 ---- public: ! ! //! constructor /*! This object can have child objects added, and acts as a grouping object. *************** *** 48,62 **** ~wxlCanObj(); ! //! sets the position of teh object relative to its parent object. void SetPos( double x, double y ) { m_x = x; m_y = y; SetPending( true ); } ! //! get x positions double GetX() { return m_x; } ! //! get y positions double GetY() { return m_y; } ! //! set default pen to use for drawing void SetPen( const wxPen& pen ) { m_pen = pen; } ! //! set default brush to use for drawing void SetBrush( const wxBrush& brush ) { m_brush = brush; } --- 47,61 ---- ~wxlCanObj(); ! //! sets the position of teh object relative to its parent object. void SetPos( double x, double y ) { m_x = x; m_y = y; SetPending( true ); } ! //! get x positions double GetX() { return m_x; } ! //! get y positions double GetY() { return m_y; } ! //! set default pen to use for drawing void SetPen( const wxPen& pen ) { m_pen = pen; } ! //! set default brush to use for drawing void SetBrush( const wxBrush& brush ) { m_brush = brush; } *************** *** 93,97 **** protected: ! virtual void DoUpdate( double WXUNUSED(absx), double WXUNUSED(absy) ) { m_pending = false; --- 92,96 ---- protected: ! virtual void DoUpdate( double WXUNUSED(absx), double WXUNUSED(absy) ) { m_pending = false; *************** *** 113,117 **** }; ! //! rectangle canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject --- 112,116 ---- }; ! //! rectangle canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject *************** *** 121,125 **** public: ! wxlCanObjRect( double x, double y, double w, double h ); --- 120,124 ---- public: ! wxlCanObjRect( double x, double y, double w, double h ); *************** *** 133,137 **** }; ! //! circle canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject --- 132,136 ---- }; ! //! circle canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject *************** *** 141,145 **** public: ! wxlCanObjCircle( double x, double y, double r ); --- 140,144 ---- public: ! wxlCanObjCircle( double x, double y, double r ); *************** *** 153,161 **** }; ! //! lua script canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. ! The object name, is used to call a lua function fron DoDraw() called ! NameDraw( wxDC& dc, double absx, double absy ) to draw the object --- 152,160 ---- }; ! //! lua script canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. ! The object name, is used to call a lua function fron DoDraw() called ! NameDraw( wxDC& dc, double absx, double absy ) to draw the object *************** *** 169,173 **** public: ! wxlCanObjScript( double x, double y, const wxString& name ); --- 168,172 ---- public: ! wxlCanObjScript( double x, double y, const wxString& name ); *************** *** 181,185 **** }; ! //! lua script canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. --- 180,184 ---- }; ! //! lua script canvas object /*! to be placed on the canvas in the m_rootobject or as a child of another canvasobject. *************** *** 187,196 **** It should do that by adding child objects to this object itself. The hit is no more then a hit on those childs, which is default functionality. ! */ class wxlCanObjAddScript: public wxlCanObj { public: ! wxlCanObjAddScript( double x, double y, const wxString& script ); --- 186,195 ---- It should do that by adding child objects to this object itself. The hit is no more then a hit on those childs, which is default functionality. ! */ class wxlCanObjAddScript: public wxlCanObj { public: ! wxlCanObjAddScript( double x, double y, const wxString& script ); *************** *** 244,248 **** void SetPending( bool pending = true ); ! void Render( wxDC& dc ); //! Give the virtual size to be displayed. --- 243,247 ---- void SetPending( bool pending = true ); ! void Render( wxDC& dc ); //! Give the virtual size to be displayed. Index: wxluacan.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxluacan.cpp 8 Jun 2006 03:22:06 -0000 1.14 --- wxluacan.cpp 28 Aug 2006 05:26:19 -0000 1.15 *************** *** 27,31 **** int s_wxluatag_wxlCanObj = -1; ! // wxlCanObj( double x = 0, double y = 0 ) static int LUACALL wxLua_wxlCanObj_constructor(lua_State *L) { --- 27,31 ---- int s_wxluatag_wxlCanObj = -1; ! // wxlCanObj( double x = 0, double y = 0 ) static int LUACALL wxLua_wxlCanObj_constructor(lua_State *L) { *************** *** 62,66 **** } ! // double GetX() static int LUACALL wxLua_wxlCanObj_GetX(lua_State *L) { --- 62,66 ---- } ! // double GetX() static int LUACALL wxLua_wxlCanObj_GetX(lua_State *L) { *************** *** 92,96 **** } ! // void SetPending( bool pending = true ) static int LUACALL wxLua_wxlCanObj_SetPending(lua_State *L) { --- 92,96 ---- } ! // void SetPending( bool pending = true ) static int LUACALL wxLua_wxlCanObj_SetPending(lua_State *L) { *************** *** 108,112 **** } ! // void AddObject( wxlCanObj *canobj ) static int LUACALL wxLua_wxlCanObj_AddObject(lua_State *L) { --- 108,112 ---- } ! // void AddObject( wxlCanObj *canobj ) static int LUACALL wxLua_wxlCanObj_AddObject(lua_State *L) { *************** *** 157,161 **** } ! #endif --- 157,161 ---- } ! #endif // wxLUA_USE_wxColourPenBrush *************** *** 176,180 **** { LuaMethod, "SetPen", wxLua_wxlCanObj_SetPen, 1, 1, { &s_wxluatag_wxPen, 0 } }, { LuaMethod, "SetBrush", wxLua_wxlCanObj_SetBrush, 1, 1, { &s_wxluatag_wxBrush, 0 } }, ! #endif }; --- 176,180 ---- { LuaMethod, "SetPen", wxLua_wxlCanObj_SetPen, 1, 1, { &s_wxluatag_wxPen, 0 } }, { LuaMethod, "SetBrush", wxLua_wxlCanObj_SetBrush, 1, 1, { &s_wxluatag_wxBrush, 0 } }, ! #endif // wxLUA_USE_wxColourPenBrush }; *************** *** 462,466 **** } ! #endif --- 462,466 ---- } ! #endif // wxLUA_USE_wxPointSizeRect *************** *** 477,481 **** #if wxLUA_USE_wxPointSizeRect { LuaConstructor, "wxlCan", wxLua_wxlCan_constructor, 4, 1, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, 0 } }, ! #endif }; --- 477,481 ---- #if wxLUA_USE_wxPointSizeRect { LuaConstructor, "wxlCan", wxLua_wxlCan_constructor, 4, 1, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, 0 } }, ! #endif // wxLUA_USE_wxPointSizeRect }; Index: cansim.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/cansim.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cansim.h 5 Feb 2006 17:52:22 -0000 1.2 --- cansim.h 28 Aug 2006 05:26:19 -0000 1.3 *************** *** 21,28 **** #include "cancom.h" #include "wx/timer.h" #include "wxluadebug/include/wxldebug.h" #include "wxluasocket/include/wxldserv.h" #include "wxluasocket/include/wxldtarg.h" - #include "wxlua/include/internal.h" //---------------------------------------------------------------------------- --- 21,28 ---- #include "cancom.h" #include "wx/timer.h" + #include "wxlua/include/wxlstate.h" #include "wxluadebug/include/wxldebug.h" #include "wxluasocket/include/wxldserv.h" #include "wxluasocket/include/wxldtarg.h" //---------------------------------------------------------------------------- *************** *** 34,38 **** // IDs the menu commands enum ! { MenuOption_First, Scale_StretchHoriz = MenuOption_First, --- 34,38 ---- // IDs the menu commands enum ! { MenuOption_First, Scale_StretchHoriz = MenuOption_First, *************** *** 43,50 **** Origin_MoveUp, Origin_MoveLeft, ! Origin_MoveRight, Object_AddRect, Object_AddCircle, ! Axis_Vertic, Map_Restore, MenuOption_Last = Map_Restore, --- 43,50 ---- Origin_MoveUp, Origin_MoveLeft, ! Origin_MoveRight, Object_AddRect, Object_AddCircle, ! Axis_Vertic, Map_Restore, MenuOption_Last = Map_Restore, *************** *** 67,76 **** wxMenu *m_menuObjects; ! private: // method declarations for MyFrame void CreateMyMenuBar(); ! private: --- 67,76 ---- wxMenu *m_menuObjects; ! private: // method declarations for MyFrame void CreateMyMenuBar(); ! private: *************** *** 93,97 **** void OnCloseWindow( wxCloseEvent &event ); void OnTimer( wxTimerEvent &event ); ! void OnOption(wxCommandEvent& event); --- 93,97 ---- void OnCloseWindow( wxCloseEvent &event ); void OnTimer( wxTimerEvent &event ); ! void OnOption(wxCommandEvent& event); Index: wxluacan.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.i,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wxluacan.i 24 Apr 2006 02:33:26 -0000 1.8 --- wxluacan.i 28 Aug 2006 05:26:19 -0000 1.9 *************** *** 3,18 **** %include "cancom.h" %include "cansim.h" - %include "wxlua/include/internal.h" %include "wx/gdicmn.h" %class %noclassinfo wxlCanObj, wxObject ! wxlCanObj( double x = 0, double y = 0 ) void SetPos( double x, double y ) ! double GetX() double GetY() void SetPen( const wxPen& pen ) void SetBrush( const wxBrush& brush ) ! void SetPending( bool pending = true ) ! void AddObject( wxlCanObj *canobj ) %endclass --- 3,17 ---- %include "cancom.h" %include "cansim.h" %include "wx/gdicmn.h" %class %noclassinfo wxlCanObj, wxObject ! wxlCanObj( double x = 0, double y = 0 ) void SetPos( double x, double y ) ! double GetX() double GetY() void SetPen( const wxPen& pen ) void SetBrush( const wxBrush& brush ) ! void SetPending( bool pending = true ) ! void AddObject( wxlCanObj *canobj ) %endclass Index: wxluacan.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxluacan.h 9 Jun 2006 03:24:48 -0000 1.14 --- wxluacan.h 28 Aug 2006 05:26:19 -0000 1.15 *************** *** 13,18 **** #include "wxlua/include/wxlstate.h" #include "wxlua/include/wxlbind.h" - #include "wxlua/include/internal.h" - // binding class class wxLuaBinding_wxluacan : public wxLuaBinding --- 13,16 ---- *************** *** 35,45 **** extern WXLUA_NO_DLLIMPEXP bool wxLuaBinding_wxluacan_init(); #include "cancom.h" #include "canlua.h" #include "cansim.h" #include "wx/gdicmn.h" - #include "wxlua/include/internal.h" // Lua Tag Method Values for each Class extern WXLUA_NO_DLLIMPEXP_DATA(int) s_wxluatag_wxlCan; extern WXLUA_NO_DLLIMPEXP_DATA(int) s_wxluatag_wxlCanObj; --- 33,50 ---- extern WXLUA_NO_DLLIMPEXP bool wxLuaBinding_wxluacan_init(); + // ---------------------------------------------------------------------------- + // Includes + // ---------------------------------------------------------------------------- + #include "cancom.h" #include "canlua.h" #include "cansim.h" #include "wx/gdicmn.h" + + // ---------------------------------------------------------------------------- // Lua Tag Method Values for each Class + // ---------------------------------------------------------------------------- + extern WXLUA_NO_DLLIMPEXP_DATA(int) s_wxluatag_wxlCan; extern WXLUA_NO_DLLIMPEXP_DATA(int) s_wxluatag_wxlCanObj; *************** *** 51,55 **** ! // Method Table extern WXLUA_NO_DLLIMPEXP WXLUAMETHOD* wxlCan_methods; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCan_methodCount; --- 56,64 ---- ! ! // ---------------------------------------------------------------------------- ! // Method Tables ! // ---------------------------------------------------------------------------- ! extern WXLUA_NO_DLLIMPEXP WXLUAMETHOD* wxlCan_methods; extern WXLUA_NO_DLLIMPEXP_DATA(int) wxlCan_methodCount; *************** *** 69,72 **** --- 78,85 ---- + // ---------------------------------------------------------------------------- + // Encapsulation Declarations + // ---------------------------------------------------------------------------- + #endif // __HOOK_WXLUA_wxluacan_H__ |