Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * LRocket.h
- *
- * Created on: 19/10/2011
- * Author: bitetti
- */
- #ifndef LROCKET_H_
- #define LROCKET_H_
- #include <iostream>
- #include <list>
- #include <Ogre.h>
- #include "OgreKit.h"
- #include "Loaders/Blender2/gkBlendInternalFile.h"
- #include "gkTextManager.h"
- #include "gkCommon.h"
- #include "gkUtils.h"
- extern "C"{
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
- }
- // GUI
- #include <Rocket/Core.h>
- #include <Rocket/Controls.h>
- #include <Rocket/Debugger.h>
- #include "rocket/RocketRenderListener.h"
- #include "rocket/RenderInterfaceOgre3D.h"
- #include "rocket/RocketEventListener.h"
- #include "rocket/SystemInterfaceOgre3D.h"
- #include "rocket/FileInterfaceOgre3D.h"
- void installRocketFonts();
- namespace WWP {
- class Rocket_Document {
- public:
- gkString name;
- gkString callBack;
- Rocket::Core::ElementDocument* document;
- Rocket_Document()
- {
- }
- Rocket_Document( const char* _name, const char* _callBack, Rocket::Core::ElementDocument* _document)
- {
- name = _name;
- callBack = _callBack;
- document = _document;
- }
- ~Rocket_Document()
- {std::cout<<"-1\n";
- if( document != 0)
- {
- std::cout<<"0\n";document->RemoveReference();
- std::cout<<"1\n";document->Close();
- std::cout<<"2\n";delete document;
- std::cout<<"3\n";document = 0;
- }
- std::cout<<"finalizando: "<<name.c_str()<<"\n";
- std::cout<<"4\n";name.clear();
- std::cout<<"5\n";callBack.clear();
- }
- };
- #define LROCKET_CLASS "LRocket"
- class LRocket :
- public Rocket::Core::EventListener
- {
- public:
- virtual ~LRocket();
- static void registrarFuncoes( lua_State* L );
- static void finaliza();
- private:
- LRocket();
- //rocket to lua
- virtual void ProcessEvent(Rocket::Core::Event& event);
- //lua
- static int initLibRocket( lua_State* L );
- static int showCursor(lua_State* L);
- static int loadDocument(lua_State* L);
- static int unloadDocument(lua_State* L);
- static int showDocument(lua_State* L);
- static int hideDocument(lua_State* L);
- static int setInnerHTML(lua_State* L);
- static int getInnerHTML(lua_State* L);
- static int getFormElementValue(lua_State* L);
- //vars
- private:
- static LRocket* main;
- static lua_State* Lua;
- static std::list<Rocket_Document*> documentos;
- static Rocket::Core::ElementDocument* cursor;
- gkWindow* window;
- RenderInterfaceOgre3D* m_rkOgreRenderer;
- SystemInterfaceOgre3D* m_rkOgreSystem;
- FileInterfaceOgre3D* m_rkFileInterface;
- RocketEventListener* m_rkEventListener;
- RocketRenderListener* m_rkRenderListener;
- Rocket::Core::Context* m_rkContext;
- Rocket::Core::ElementDocument* m_document;
- /**
- * Registros para Lua
- */
- static const luaL_reg meta_methods[];
- static const luaL_reg class_methods[];
- #define newtable(L) (lua_newtable(L), lua_gettop(L))
- };
- }
- #endif /* LROCKET_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement