From 99b90496765df21c5f377f42b9ed073ccb34c1fd Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 1 Aug 2019 09:15:04 +0800 Subject: *misc --- source/Asura.Editor/core/gui_state.h | 17 ++++++++++++ source/Asura.Editor/core/shaders.h | 11 -------- source/Asura.Editor/core/signal.h | 52 ------------------------------------ source/Asura.Editor/core/slot.h | 43 ----------------------------- 4 files changed, 17 insertions(+), 106 deletions(-) create mode 100644 source/Asura.Editor/core/gui_state.h delete mode 100644 source/Asura.Editor/core/shaders.h delete mode 100644 source/Asura.Editor/core/signal.h delete mode 100644 source/Asura.Editor/core/slot.h (limited to 'source/Asura.Editor/core') diff --git a/source/Asura.Editor/core/gui_state.h b/source/Asura.Editor/core/gui_state.h new file mode 100644 index 0000000..9e7e91c --- /dev/null +++ b/source/Asura.Editor/core/gui_state.h @@ -0,0 +1,17 @@ +#ifndef _ASURA_EDITOR_GUI_STATE_H_ +#define _ASURA_EDITOR_GUI_STATE_H_ + +#include + +namespace_begin(AsuraEditor) + +/// GUI widgets uniqueID + + + + +namespace_end + + +#endif + diff --git a/source/Asura.Editor/core/shaders.h b/source/Asura.Editor/core/shaders.h deleted file mode 100644 index e567f95..0000000 --- a/source/Asura.Editor/core/shaders.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASURA_EDITOR_SHADERS_H__ -#define __ASURA_EDITOR_SHADERS_H__ - -namespace AsuraEditor -{ - - - -} - -#endif \ No newline at end of file diff --git a/source/Asura.Editor/core/signal.h b/source/Asura.Editor/core/signal.h deleted file mode 100644 index f73f4b1..0000000 --- a/source/Asura.Editor/core/signal.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef __ASRUA_EDTIRO_SIGNAL_H__ -#define __ASRUA_EDTIRO_SIGNAL_H__ - -#include - -#include - -#include "../widgets/widget.h" -#include "slot.h" - -namespace AsuraEditor -{ - - /// - /// 控件事件 - /// - class Signal - { - public: - Signal(); - - /// - /// Fire将事件发给connect的监听者,触发(调用)connect的函数。 - /// - void operator()(void* userdata) - { - for (auto callback : mCallbacks) - callback(); - } - - /// - /// 注册回调函数。 - /// - void Connect(const Slot& callback) - { - mCallbacks.push_back(callback); - } - - /// - /// - /// - void Disconnect(); - - private: - - std::vector mCallbacks; // 监听函数 - - }; - -} - -#endif \ No newline at end of file diff --git a/source/Asura.Editor/core/slot.h b/source/Asura.Editor/core/slot.h deleted file mode 100644 index f569cfe..0000000 --- a/source/Asura.Editor/core/slot.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __ASURA_EDITOR_SLOT_H__ -#define __ASURA_EDITOR_SLOT_H__ - -#include -#include - -#include "../controls/widget.h" - -namespace AsuraEditor -{ - - /// - /// 响应signal的闭包 - /// - class Slot - { - public: - Slot(Luax::LuaxState& state, Widget& widget, int refID) - : mState(state) - , mRefID(refID) - , mWidget(widget) - { - } - - void operator()() - { - mWidget.PushLuaxMemberRef(mState, mRefID); - if (lua_isfunction(mState, -1)) // callback - { - mState.Call(0, 0); - } - } - - private: - Luax::LuaxState& mState; - Widget& mWidget; - int mRefID; - - }; - -} - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0