void valueChanged( const char* value ){
UpdatePath();
}
-typedef MemberCaller1<DBobView, const char*, &DBobView::valueChanged> ValueChangedCaller;
+typedef MemberCaller<DBobView, void(const char*), &DBobView::valueChanged> ValueChangedCaller;
void insert( const char* key, EntityKeyValue& value ){
value.attach( ValueChangedCaller( *this ) );
}
void DBrush_addFace( DBrush& brush, const _QERFaceData& faceData ){
brush.AddFace( vector3_to_array( faceData.m_p0 ), vector3_to_array( faceData.m_p1 ), vector3_to_array( faceData.m_p2 ), 0 );
}
-typedef ReferenceCaller1<DBrush, const _QERFaceData&, DBrush_addFace> DBrushAddFaceCaller;
+typedef ReferenceCaller<DBrush, void(const _QERFaceData&), DBrush_addFace> DBrushAddFaceCaller;
void DBrush_addFaceTextured( DBrush& brush, const _QERFaceData& faceData ){
brush.AddFace( vector3_to_array( faceData.m_p0 ), vector3_to_array( faceData.m_p1 ), vector3_to_array( faceData.m_p2 ), &faceData );
}
-typedef ReferenceCaller1<DBrush, const _QERFaceData&, DBrush_addFaceTextured> DBrushAddFaceTexturedCaller;
+typedef ReferenceCaller<DBrush, void(const _QERFaceData&), DBrush_addFaceTextured> DBrushAddFaceTexturedCaller;
void DBrush::LoadFromBrush( scene::Instance& brush, bool textured ){
ClearFaces();
DBrush* loadBrush = entity.NewBrush( static_cast<int>( entity.brushList.size() ) );
loadBrush->LoadFromBrush( brush, true );
}
-typedef ReferenceCaller1<DEntity, scene::Instance&, DEntity_loadBrush> DEntityLoadBrushCaller;
+typedef ReferenceCaller<DEntity, void(scene::Instance&), DEntity_loadBrush> DEntityLoadBrushCaller;
void DEntity::LoadSelectedBrushes(){
ClearBrushes();
DPatch* loadPatch = entity.NewPatch();
loadPatch->LoadFromPatch( patch );
}
-typedef ReferenceCaller1<DEntity, scene::Instance&, DEntity_loadPatch> DEntityLoadPatchCaller;
+typedef ReferenceCaller<DEntity, void(scene::Instance&), DEntity_loadPatch> DEntityLoadPatchCaller;
void DEntity::LoadSelectedPatches(){
ClearPatches();
SignalHandlerId m_destroyed;
public:
SignalHandlerResult mouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers );
-typedef Member3<DTreePlanter, const WindowVector&, ButtonIdentifier, ModifierFlags, SignalHandlerResult, &DTreePlanter::mouseDown> MouseDownCaller;
+typedef Member<DTreePlanter, SignalHandlerResult(const WindowVector&, ButtonIdentifier, ModifierFlags), &DTreePlanter::mouseDown> MouseDownCaller;
void destroyed(){
m_mouseDown = MouseEventHandlerId();
m_destroyed = SignalHandlerId();
}
-typedef Member<DTreePlanter, void, &DTreePlanter::destroyed> DestroyedCaller;
+typedef Member<DTreePlanter, void(), &DTreePlanter::destroyed> DestroyedCaller;
DTreePlanter() {
m_numModels = 0;
archives.push_back( filename );
}
-typedef FreeCaller1<const char*, loadArchiveFile> LoadArchiveFileCaller;
+typedef FreeCaller<void(const char*), loadArchiveFile> LoadArchiveFileCaller;
void LoadTextureFile( const char* filename ){
std::string s_filename = filename;
}
}
-typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
+typedef FreeCaller<void(const char*), LoadTextureFile> LoadTextureFileCaller;
void GetTextures( const char* extension ){
GlobalFileSystem().forEachFile( "textures/", extension, LoadTextureFileCaller(), 0 );
}
}
-typedef FreeCaller1<const char*, LoadShaderList> LoadShaderListCaller;
+typedef FreeCaller<void(const char*), LoadShaderList> LoadShaderListCaller;
void GetAllShaders(){
GlobalShaderSystem().foreachShaderName( LoadShaderListCaller() );
int value;
};
-typedef Callback1<const _QERFaceData&> BrushFaceDataCallback;
+typedef Callback<void(const _QERFaceData&)> BrushFaceDataCallback;
class BrushCreator
{
{
public:
STRING_CONSTANT( Name, "CameraModel" );
-virtual void setCameraView( CameraView* view, const Callback& disconnect ) = 0;
+virtual void setCameraView( CameraView* view, const Callback<void()>& disconnect ) = 0;
};
template<typename Element> class BasicVector3;
class EntityClass;
-typedef Callback1<const char*> KeyObserver;
+typedef Callback<void(const char*)> KeyObserver;
class EntityKeyValue
{
#include "generic/constant.h"
#include "generic/callback.h"
-typedef Callback1<const char*> ArchiveNameCallback;
-typedef Callback1<const char*> FileNameCallback;
+typedef Callback<void(const char*)> ArchiveNameCallback;
+typedef Callback<void(const char*)> FileNameCallback;
class ArchiveFile;
class ArchiveTextFile;
};
class Renderable;
-typedef Callback1<const Renderable&> RenderableCallback;
+typedef Callback<void(const Renderable&)> RenderableCallback;
-typedef Callback1<const RendererLight&> RendererLightCallback;
+typedef Callback<void(const RendererLight&)> RendererLightCallback;
class LightList
{
class Matrix4;
typedef Vector4 Quaternion;
-typedef Callback1<const Selectable&> SelectionChangeCallback;
+typedef Callback<void(const Selectable&)> SelectionChangeCallback;
typedef SignalHandler1<const Selectable&> SelectionChangeHandler;
class SelectionSystem
virtual float alphaTest() const = 0;
};
-typedef Callback1<const ShaderLayer&> ShaderLayerCallback;
+typedef Callback<void(const ShaderLayer&)> ShaderLayerCallback;
class IShader
};
typedef struct _GSList GSList;
-typedef Callback1<const char*> ShaderNameCallback;
+typedef Callback<void(const char*)> ShaderNameCallback;
class ModuleObserver;
virtual IShader* dereferenceActiveShadersIterator() = 0;
virtual void incrementActiveShadersIterator() = 0;
-virtual void setActiveShadersChangedNotify( const Callback& notify ) = 0;
+virtual void setActiveShadersChangedNotify( const Callback<void()>& notify ) = 0;
virtual void attach( ModuleObserver& observer ) = 0;
virtual void detach( ModuleObserver& observer ) = 0;
virtual void save() = 0;
virtual bool saved() const = 0;
virtual void changed() = 0;
-virtual void setChangedCallback( const Callback& changed ) = 0;
+virtual void setChangedCallback( const Callback<void()>& changed ) = 0;
virtual std::size_t changes() const = 0;
};
}
};
-typedef Callback1<SkinRemap> SkinRemapCallback;
+typedef Callback<void(SkinRemap)> SkinRemapCallback;
class ModuleObserver;
class ModelSkin
#include "generic/constant.h"
#include "generic/callback.h"
-typedef Callback1<const char*> NameCallback;
+typedef Callback<void(const char*)> NameCallback;
class Nameable
{
#include "generic/constant.h"
#include "generic/callback.h"
-typedef Callback1<const char*> NameCallback;
-typedef Callback1<const NameCallback&> NameCallbackCallback;
+typedef Callback<void(const char*)> NameCallback;
+typedef Callback<void(const NameCallback&)> NameCallbackCallback;
class Namespace
{
m_string = value;
m_observer.onChanged();
}
-typedef MemberCaller1<StringPreference, const char*, &StringPreference::importString> ImportStringCaller;
+typedef MemberCaller<StringPreference, void(const char*), &StringPreference::importString> ImportStringCaller;
void exportString( StringImportCallback& importer ){
importer( m_string.c_str() );
}
-typedef MemberCaller1<StringPreference, StringImportCallback&, &StringPreference::exportString> ExportStringCaller;
+typedef MemberCaller<StringPreference, void(StringImportCallback&), &StringPreference::exportString> ExportStringCaller;
};
inline void int_export( int i, StringImportCallback& importer ){
m_int = int_import( value );
m_observer.onChanged();
}
-typedef MemberCaller1<IntPreference, const char*, &IntPreference::importString> ImportStringCaller;
+typedef MemberCaller<IntPreference, void(const char*), &IntPreference::importString> ImportStringCaller;
void exportString( StringImportCallback& importer ){
int_export( m_int, importer );
}
-typedef MemberCaller1<IntPreference, StringImportCallback&, &IntPreference::exportString> ExportStringCaller;
+typedef MemberCaller<IntPreference, void(StringImportCallback&), &IntPreference::exportString> ExportStringCaller;
};
class IntPreferenceImporter
#include "generic/constant.h"
#include "generic/callback.h"
-typedef Callback1<const char*> StringImportCallback;
-typedef Callback1<const StringImportCallback&> StringExportCallback;
+typedef Callback<void(const char*)> StringImportCallback;
+typedef Callback<void(const StringImportCallback&)> StringExportCallback;
class PreferenceSystem
{
class Plane3;
-typedef Callback1<const Plane3&> PlaneCallback;
+typedef Callback<void(const Plane3&)> PlaneCallback;
class SelectedPlanes
{
notify();
}
-typedef MemberCaller1<KeyValue, const CopiedString&, &KeyValue::importState> UndoImportCaller;
+typedef MemberCaller<KeyValue, void(const CopiedString&), &KeyValue::importState> UndoImportCaller;
};
/// \brief An unsorted list of key/value pairs.
m_entityKeyValueChanged();
}
- typedef MemberCaller1<EntityKeyValues, const KeyValues&, &EntityKeyValues::importState> UndoImportCaller;
+ typedef MemberCaller<EntityKeyValues, void(const KeyValues&), &EntityKeyValues::importState> UndoImportCaller;
void attach( Observer& observer ){
ASSERT_MESSAGE( !m_observerMutex, "observer cannot be attached during iteration" );
value = 3;
}
// a typedef to make things more readable
-typedef MemberCaller<Integer, &Integer::setValue> SetValueCaller;
+typedef MemberCaller<Integer, void(), &Integer::setValue> SetValueCaller;
};
void example(){
Integer foo = { 0 };
{
- Callback bar = ConstMemberCaller<Integer, &Integer::printValue>( foo );
+ Callback<void()> bar = ConstMemberCaller<Integer, void(), &Integer::printValue>( foo );
// invoke the callback
bar(); // foo.printValue()
{
// use the typedef to improve readability
- Callback bar = Integer::SetValueCaller( foo );
+ Callback<void()> bar = Integer::SetValueCaller( foo );
// invoke the callback
bar(); // foo.setValue()
}
// a typedef to make things more readable
-typedef ReferenceCaller<int, Int_setValue> IntSetValueCaller;
+typedef ReferenceCaller<int, void(), Int_setValue> IntSetValueCaller;
void example(){
int foo = 0;
{
- Callback bar = ConstReferenceCaller<int, Int_printValue>( foo );
+ Callback<void()> bar = ConstReferenceCaller<int, void(), Int_printValue>( foo );
// invoke the callback
bar(); // Int_printValue(foo)
{
// use the typedef to improve readability
- Callback bar = IntSetValueCaller( foo );
+ Callback<void()> bar = IntSetValueCaller( foo );
// invoke the callback
bar(); // Int_setValue(foo)
public:
void test0(){
}
-typedef Member<Test, void, &Test::test0> Test0;
-typedef MemberCaller<Test, &Test::test0> Test0Caller;
+typedef Member<Test, void(), &Test::test0> Test0;
+typedef MemberCaller<Test, void(), &Test::test0> Test0Caller;
void test0const() const {
}
-typedef ConstMember<Test, void, &Test::test0const> Test0Const;
-typedef ConstMemberCaller<Test, &Test::test0const> Test0ConstCaller;
+typedef ConstMember<Test, void(), &Test::test0const> Test0Const;
+typedef ConstMemberCaller<Test, void(), &Test::test0const> Test0ConstCaller;
void test1( A1 ){
}
-typedef Member1<Test, A1, void, &Test::test1> Test1;
-typedef MemberCaller1<Test, A1, &Test::test1> Test1Caller;
+typedef Member<Test, void(A1), &Test::test1> Test1;
+typedef MemberCaller<Test, void(A1), &Test::test1> Test1Caller;
void test1const( A1 ) const {
}
-typedef ConstMember1<Test, A1, void, &Test::test1const> Test1Const;
-typedef ConstMemberCaller1<Test, A1, &Test::test1const> Test1ConstCaller;
+typedef ConstMember<Test, void(A1), &Test::test1const> Test1Const;
+typedef ConstMemberCaller<Test, void(A1), &Test::test1const> Test1ConstCaller;
void test2( A1, A2 ){
}
-typedef Member2<Test, A1, A2, void, &Test::test2> Test2;
+typedef Member<Test, void(A1, A2), &Test::test2> Test2;
void test2const( A1, A2 ) const {
}
-typedef ConstMember2<Test, A1, A2, void, &Test::test2const> Test2Const;
+typedef ConstMember<Test, void(A1, A2), &Test::test2const> Test2Const;
void test3( A1, A2, A3 ){
}
-typedef Member3<Test, A1, A2, A3, void, &Test::test3> Test3;
+typedef Member<Test, void(A1, A2, A3), &Test::test3> Test3;
void test3const( A1, A2, A3 ) const {
}
-typedef ConstMember3<Test, A1, A2, A3, void, &Test::test3const> Test3Const;
+typedef ConstMember<Test, void(A1, A2, A3), &Test::test3const> Test3Const;
};
void test0free(){
}
-typedef FreeCaller<&test0free> Test0FreeCaller;
+typedef FreeCaller<void(), &test0free> Test0FreeCaller;
void test1free( A1 ){
}
-typedef FreeCaller1<A1, &test1free> Test1FreeCaller;
+typedef FreeCaller<void(A1), &test1free> Test1FreeCaller;
void test2free( A1, A2 ){
}
-typedef Function2<A1, A2, void, &test2free> Test2Free;
+typedef Function<void(A1, A2), &test2free> Test2Free;
void test3free( A1, A2, A3 ){
}
-typedef Function3<A1, A2, A3, void, &test3free> Test3Free;
+typedef Function<void(A1, A2, A3), &test3free> Test3Free;
void test0( Test& test ){
}
-typedef ReferenceCaller<Test, &test0> Test0Caller;
+typedef ReferenceCaller<Test, void(), &test0> Test0Caller;
void test0const( const Test& test ){
}
-typedef ConstReferenceCaller<Test, &test0const> Test0ConstCaller;
+typedef ConstReferenceCaller<Test, void(), &test0const> Test0ConstCaller;
void test0p( Test* test ){
}
-typedef PointerCaller<Test, &test0p> Test0PCaller;
+typedef PointerCaller<Test, void(), &test0p> Test0PCaller;
void test0constp( const Test* test ){
}
-typedef ConstPointerCaller<Test, &test0constp> Test0ConstPCaller;
+typedef ConstPointerCaller<Test, void(), &test0constp> Test0ConstPCaller;
void test1( Test& test, A1 ){
}
-typedef ReferenceCaller1<Test, A1, &test1> Test1Caller;
+typedef ReferenceCaller<Test, void(A1), &test1> Test1Caller;
void test1const( const Test& test, A1 ){
}
-typedef ConstReferenceCaller1<Test, A1, &test1const> Test1ConstCaller;
+typedef ConstReferenceCaller<Test, void(A1), &test1const> Test1ConstCaller;
void test1p( Test* test, A1 ){
}
-typedef PointerCaller1<Test, A1, &test1p> Test1PCaller;
+typedef PointerCaller<Test, void(A1), &test1p> Test1PCaller;
void test1constp( const Test* test, A1 ){
}
-typedef ConstPointerCaller1<Test, A1, &test1constp> Test1ConstPCaller;
+typedef ConstPointerCaller<Test, void(A1), &test1constp> Test1ConstPCaller;
void test2( Test& test, A1, A2 ){
}
-typedef Function3<Test&, A1, A2, void, &test2> Test2;
+typedef Function<void(Test&, A1, A2), &test2> Test2;
void test3( Test& test, A1, A2, A3 ){
}
-typedef Function4<Test&, A1, A2, A3, void, &test3> Test3;
+typedef Function<void(Test&, A1, A2, A3), &test3> Test3;
void instantiate(){
Test test;
const Test& testconst = test;
{
- Callback a = Test0FreeCaller();
- Callback b = Test::Test0Caller( test );
- b = makeCallback0( Test::Test0(), test );
- Callback c = Test::Test0ConstCaller( testconst );
- c = makeCallback0( Test::Test0Const(), test );
+ Callback<void()> a = Test0FreeCaller();
+ Callback<void()> b = Test::Test0Caller( test );
+ b = makeCallback( Test::Test0(), test );
+ Callback<void()> c = Test::Test0ConstCaller( testconst );
+ c = makeCallback( Test::Test0Const(), test );
Test0Caller{ test };
Test0ConstCaller{ testconst };
Test0PCaller{ &test };
bool u = a != b;
}
{
- typedef Callback1<A1> TestCallback1;
+ typedef Callback<void(A1)> TestCallback1;
TestCallback1 a = Test1FreeCaller();
TestCallback1 b = Test::Test1Caller( test );
- b = makeCallback1( Test::Test1(), test );
+ b = makeCallback( Test::Test1(), test );
TestCallback1 c = Test::Test1ConstCaller( testconst );
- c = makeCallback1( Test::Test1Const(), test );
+ c = makeCallback( Test::Test1Const(), test );
Test1Caller{ test };
Test1ConstCaller{ testconst };
Test1PCaller{ &test };
bool u = a != b;
}
{
- typedef Callback2<A1, A2> TestCallback2;
- TestCallback2 a = makeStatelessCallback2( Test2Free() );
- TestCallback2 b = makeCallback2( Test2(), test );
- makeCallback2( Test::Test2(), test );
- makeCallback2( Test::Test2Const(), test );
+ typedef Callback<void(A1, A2)> TestCallback2;
+ TestCallback2 a = makeStatelessCallback( Test2Free() );
+ TestCallback2 b = makeCallback( Test2(), test );
+ makeCallback( Test::Test2(), test );
+ makeCallback( Test::Test2Const(), test );
a( A1(), A2() );
bool u = a != b;
}
{
- typedef Callback3<A1, A2, A3> TestCallback3;
- TestCallback3 a = makeStatelessCallback3( Test3Free() );
- TestCallback3 b = makeCallback3( Test3(), test );
- makeCallback3( Test::Test3(), test );
- makeCallback3( Test::Test3Const(), test );
+ typedef Callback<void(A1, A2, A3)> TestCallback3;
+ TestCallback3 a = makeStatelessCallback( Test3Free() );
+ TestCallback3 b = makeCallback( Test3(), test );
+ makeCallback( Test::Test3(), test );
+ makeCallback( Test::Test3Const(), test );
a( A1(), A2(), A3() );
bool u = a != b;
}
/// \brief Combines a void pointer with a pointer to a function which operates on a void pointer.
///
-/// Use with the callback constructors MemberCaller, ConstMemberCaller, ReferenceCaller, ConstReferenceCaller, PointerCaller, ConstPointerCaller and FreeCaller.
+/// Use with the callback constructors MemberCaller0, ConstMemberCaller0, ReferenceCaller0, ConstReferenceCaller0, PointerCaller0, ConstPointerCaller0 and FreeCaller0.
template<class F>
-class CallbackN;
+class Callback;
template<class R, class... Ts>
-class CallbackN<R(Ts...)> : public CallbackBase<R(*)(void *, Ts...)> {
+class Callback<R(Ts...)> : public CallbackBase<R(*)(void *, Ts...)> {
using Base = CallbackBase<R (*)(void *, Ts...)>;
static R nullThunk(void *, Ts...) {
public:
using func = R(Ts...);
- CallbackN() : Base(0, nullThunk) {
+ Callback() : Base(0, nullThunk) {
}
template<typename Caller>
- CallbackN(const BindFirstOpaque<Caller> &caller) : Base(caller.getEnvironment(), BindFirstOpaque<Caller>::thunk) {
+ Callback(const BindFirstOpaque<Caller> &caller) : Base(caller.getEnvironment(), BindFirstOpaque<Caller>::thunk) {
}
- CallbackN(void *environment, typename Base::Thunk function) : Base(environment, function) {
+ Callback(void *environment, typename Base::Thunk function) : Base(environment, function) {
}
R operator()(Ts... args) const {
}
template<typename Caller>
-inline CallbackN<typename detail::Arglist<get_func<Caller>>::shift::type> makeCallbackN(const Caller &caller, get_argument<Caller, 0> callee) {
- return CallbackN<typename detail::Arglist<get_func<Caller>>::shift::type>(BindFirstOpaque<Caller>(callee));
+inline Callback<typename detail::Arglist<get_func<Caller>>::shift::type> makeCallback(const Caller &caller, get_argument<Caller, 0> callee) {
+ return Callback<typename detail::Arglist<get_func<Caller>>::shift::type>(BindFirstOpaque<Caller>(callee));
}
template<typename Caller>
-inline CallbackN<get_func<Caller>> makeStatelessCallbackN(const Caller &caller) {
- return makeCallbackN(CallerShiftFirst<Caller, typename detail::Arglist<get_func<Caller>>::template unshift<void *>::type>(), nullptr);
+inline Callback<get_func<Caller>> makeStatelessCallback(const Caller &caller) {
+ return makeCallback(CallerShiftFirst<Caller, typename detail::Arglist<get_func<Caller>>::template unshift<void *>::type>(), nullptr);
}
-namespace detail {
- template<class Object, class F>
- struct MemberFunction;
-
- template<class Object, class R, class... Ts>
- struct MemberFunction<Object, R(Ts...)> {
- using type = R(Object::*)(Ts...);
- using type_const = R(Object::*)(Ts...) const;
- };
-}
-
-template<class Object, class F>
-using MemberFunction = typename detail::MemberFunction<Object, F>::type;
-
-template<class Object, class F>
-using ConstMemberFunction = typename detail::MemberFunction<Object, F>::type_const;
-
/// \brief Forms a Callback from a non-const Environment reference and a non-const Environment member-function.
///
/// \dontinclude generic/callback.cpp
-/// \skipline MemberCaller example
+/// \skipline MemberCaller0 example
/// \until end example
template<class Environment, class F, MemberFunction<Environment, F> member>
-using MemberCallerN = BindFirstOpaque<typename MemberN<Environment, F>::template instance<member>>;
+using MemberCaller = BindFirstOpaque<typename MemberN<Environment, F>::template instance<member>>;
/// \brief Forms a Callback from a const Environment reference and a const Environment member-function.
///
/// \dontinclude generic/callback.cpp
-/// \skipline MemberCaller example
+/// \skipline MemberCaller0 example
/// \until end example
template<class Environment, class F, ConstMemberFunction<Environment, F> member>
-using ConstMemberCallerN = BindFirstOpaque<typename ConstMemberN<Environment, F>::template instance<member>>;
+using ConstMemberCaller = BindFirstOpaque<typename ConstMemberN<Environment, F>::template instance<member>>;
/// \brief Forms a Callback from a non-const Environment reference and a free function which operates on a non-const Environment reference.
///
/// \dontinclude generic/callback.cpp
-/// \skipline ReferenceCaller example
+/// \skipline ReferenceCaller0 example
/// \until end example
template<class Environment, class F, typename detail::Arglist<F>::template unshift<Environment &>::type *func>
-using ReferenceCallerN = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<Environment &>::type>::template instance<func>>;
+using ReferenceCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<Environment &>::type>::template instance<func>>;
/// \brief Forms a Callback from a const Environment reference and a free function which operates on a const Environment reference.
///
/// \dontinclude generic/callback.cpp
-/// \skipline ReferenceCaller example
+/// \skipline ReferenceCaller0 example
/// \until end example
template<class Environment, class F, typename detail::Arglist<F>::template unshift<const Environment &>::type *func>
-using ConstReferenceCallerN = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<const Environment &>::type>::template instance<func>>;
+using ConstReferenceCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<const Environment &>::type>::template instance<func>>;
/// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer.
template<class Environment, class F, typename detail::Arglist<F>::template unshift<Environment *>::type *func>
-using PointerCallerN = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<Environment *>::type>::template instance<func>>;
+using PointerCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<Environment *>::type>::template instance<func>>;
/// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer.
template<class Environment, class F, typename detail::Arglist<F>::template unshift<const Environment *>::type *func>
-using ConstPointerCallerN = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<const Environment *>::type>::template instance<func>>;
+using ConstPointerCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<const Environment *>::type>::template instance<func>>;
/// \brief Forms a Callback from a free function
template<class F, F *func>
-class FreeCallerN : public BindFirstOpaque<CallerShiftFirst<
+class FreeCaller : public BindFirstOpaque<CallerShiftFirst<
typename FunctionN<F>::template instance<func>,
typename detail::Arglist<F>::template unshift<void *>::type
>> {
public:
- FreeCallerN()
+ FreeCaller()
: BindFirstOpaque<CallerShiftFirst<
typename FunctionN<F>::template instance<func>,
typename detail::Arglist<F>::template unshift<void *>::type
///
/// \param Functor Must define \c first_argument_type and \c operator()(first_argument_type).
template<typename Functor>
-inline CallbackN<get_func<Functor>> makeCallbackN(Functor &functor) {
- return CallbackN<get_func<Functor>>(MemberCallerN<Functor, get_func<Functor>, &Functor::operator()>(functor));
+inline Callback<get_func<Functor>> makeCallback(Functor &functor) {
+ return Callback<get_func<Functor>>(MemberCaller<Functor, get_func<Functor>, &Functor::operator()>(functor));
}
/// \brief Constructs a Callback1 from a const \p functor
///
/// \param Functor Must define \c first_argument_type and const \c operator()(first_argument_type).
template<typename Functor>
-inline CallbackN<get_func<Functor>> makeCallbackN(const Functor &functor) {
- return CallbackN<get_func<Functor>>(ConstMemberCallerN<Functor, get_func<Functor>, &Functor::operator()>(functor));
+inline Callback<get_func<Functor>> makeCallback(const Functor &functor) {
+ return Callback<get_func<Functor>>(ConstMemberCaller<Functor, get_func<Functor>, &Functor::operator()>(functor));
}
-// todo: inline
-
-#define makeCallback makeCallbackN
-
-using Callback = CallbackN<void()>;
-
-template<class Result>
-using Callback0 = CallbackN<Result()>;
-
-template<class FirstArgument, class Result = void>
-using Callback1 = CallbackN<Result(FirstArgument)>;
-
-template<typename FirstArgument, typename SecondArgument, typename Result = void>
-using Callback2 = CallbackN<Result(FirstArgument, SecondArgument)>;
-
-template<typename FirstArgument, typename SecondArgument, typename ThirdArgument, typename Result = void>
-using Callback3 = CallbackN<Result(FirstArgument, SecondArgument, ThirdArgument)>;
-
-#define makeCallback0 makeCallbackN
-#define makeStatelessCallback0 makeStatelessCallbackN
-
-#define makeCallback1 makeCallbackN
-#define makeStatelessCallback1 makeStatelessCallbackN
-
-#define makeCallback2 makeCallbackN
-#define makeStatelessCallback2 makeStatelessCallbackN
-
-#define makeCallback3 makeCallbackN
-#define makeStatelessCallback3 makeStatelessCallbackN
-
-template<class Environment, void(Environment::*member)()>
-using MemberCaller = MemberCallerN<Environment, void(), member>;
-
-template<class Environment, void(Environment::*member)() const>
-using ConstMemberCaller = ConstMemberCallerN<Environment, void(), member>;
-
-template<class Environment, class FirstArgument, void(Environment::*member)(FirstArgument)>
-using MemberCaller1 = MemberCallerN<Environment, void(FirstArgument), member>;
-
-template<class Environment, class FirstArgument, void(Environment::*member)(FirstArgument) const>
-using ConstMemberCaller1 = ConstMemberCallerN<Environment, void(FirstArgument), member>;
-
-template<class Environment, void(*func)(Environment &)>
-using ReferenceCaller = ReferenceCallerN<Environment, void(), func>;
-
-template<class Environment, void(*func)(const Environment &)>
-using ConstReferenceCaller = ConstReferenceCallerN<Environment, void(), func>;
-
-/// \brief Forms a Callback from a non-const Environment reference and a free function which operates on a non-const Environment reference and one other argument.
-template<class Environment, class FirstArgument, void(*func)(Environment &, FirstArgument)>
-using ReferenceCaller1 = ReferenceCallerN<Environment, void(FirstArgument), func>;
-
-/// \brief Forms a Callback from a const Environment reference and a free function which operates on a const Environment reference and one other argument.
-template<class Environment, class FirstArgument, void(*func)(const Environment &, FirstArgument)>
-using ConstReferenceCaller1 = ConstReferenceCallerN<Environment, void(FirstArgument), func>;
-
-/// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer.
-template<class Environment, void(*func)(Environment *)>
-using PointerCaller = PointerCallerN<Environment, void(), func>;
-
-/// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer.
-template<class Environment, void(*func)(const Environment *)>
-using ConstPointerCaller = ConstPointerCallerN<Environment, void(), func>;
-
-/// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer and one other argument.
-template<class Environment, class FirstArgument, void(*func)(Environment *, FirstArgument)>
-using PointerCaller1 = PointerCallerN<Environment, void(FirstArgument), func>;
-
-/// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer and one other argument.
-template<class Environment, class FirstArgument, void(*func)(const Environment *, FirstArgument)>
-using ConstPointerCaller1 = ConstPointerCallerN<Environment, void(FirstArgument), func>;
-
-template<void(*func)()>
-using FreeCaller = FreeCallerN<void(), func>;
-
-template<class FirstArgument, void(*func)(FirstArgument)>
-using FreeCaller1 = FreeCallerN<void(FirstArgument), func>;
-
-typedef Callback1<bool> BoolImportCallback;
-typedef Callback1<const BoolImportCallback&> BoolExportCallback;
+using BoolImportCallback = Callback<void(bool)>;
+using BoolExportCallback = Callback<void(const BoolImportCallback&)>;
-typedef Callback1<int> IntImportCallback;
-typedef Callback1<const IntImportCallback&> IntExportCallback;
+using IntImportCallback = Callback<void(int)>;
+using IntExportCallback = Callback<void(const IntImportCallback&)>;
-typedef Callback1<float> FloatImportCallback;
-typedef Callback1<const FloatImportCallback&> FloatExportCallback;
+using FloatImportCallback = Callback<void(float)>;
+using FloatExportCallback = Callback<void(const FloatImportCallback&)>;
-typedef Callback1<const char*> StringImportCallback;
-typedef Callback1<const StringImportCallback&> StringExportCallback;
+using StringImportCallback = Callback<void(const char*)>;
+using StringExportCallback = Callback<void(const StringImportCallback&)>;
-typedef Callback1<std::size_t> SizeImportCallback;
-typedef Callback1<const SizeImportCallback&> SizeExportCallback;
+using SizeImportCallback = Callback<void(std::size_t)>;
+using SizeExportCallback = Callback<void(const SizeImportCallback&)>;
#endif
template<class Caller, int N>
using get_argument = typename detail::Fn<get_func<Caller>>::template get<N>;
+namespace detail {
+ template<class Object, class F>
+ struct MemberFunction;
+
+ template<class Object, class R, class... Ts>
+ struct MemberFunction<Object, R(Ts...)> {
+ using type = R(Object::*)(Ts...);
+ using type_const = R(Object::*)(Ts...) const;
+ };
+}
+
+template<class Object, class F>
+using MemberFunction = typename detail::MemberFunction<Object, F>::type;
+
+template<class Object, class F>
+using ConstMemberFunction = typename detail::MemberFunction<Object, F>::type_const;
+
template<class Object, class F>
class MemberN;
};
};
+template<class Object, class F, MemberFunction<Object, F> func>
+using Member = typename MemberN<Object, F>::template instance<func>;
+
template<class Object, class F>
class ConstMemberN;
};
};
+template<class Object, class F, ConstMemberFunction<Object, F> func>
+using ConstMember = typename ConstMemberN<Object, F>::template instance<func>;
+
template<class F>
class FunctionN;
};
};
+template<class F, F *func>
+using Function = typename FunctionN<F>::template instance<func>;
+
template<class Caller, class F>
class CallerShiftFirst;
template<class Functor>
using FunctorInvoke = FunctorNInvoke<Functor, get_func<Functor>>;
-// todo: inline
-
-template<class Object, class R, R(Object::*member)()>
-using Member = typename MemberN<Object, R()>::template instance<member>;
-
-template<class Object, class R, R(Object::*member)() const>
-using ConstMember = typename ConstMemberN<Object, R()>::template instance<member>;
-
-template<class Object, class A1, class R, R(Object::*member)(A1)>
-using Member1 = typename MemberN<Object, R(A1)>::template instance<member>;
-
-template<class Object, class A1, class R, R(Object::*member)(A1) const>
-using ConstMember1 = typename ConstMemberN<Object, R(A1)>::template instance<member>;
-
-template<class Object, class A1, class A2, class R, R(Object::*member)(A1, A2)>
-using Member2 = typename MemberN<Object, R(A1, A2)>::template instance<member>;
-
-template<class Object, class A1, class A2, class R, R(Object::*member)(A1, A2) const>
-using ConstMember2 = typename ConstMemberN<Object, R(A1, A2)>::template instance<member>;
-
-template<class Object, class A1, class A2, class A3, class R, R(Object::*member)(A1, A2, A3)>
-using Member3 = typename MemberN<Object, R(A1, A2, A3)>::template instance<member>;
-
-template<class Object, class A1, class A2, class A3, class R, R(Object::*member)(A1, A2, A3) const>
-using ConstMember3 = typename ConstMemberN<Object, R(A1, A2, A3)>::template instance<member>;
-
-template<class R, R(*func)()>
-using Function0 = typename FunctionN<R()>::template instance<func>;
-
-template<class A1, class R, R(*func)(A1)>
-using Function1 = typename FunctionN<R(A1)>::template instance<func>;
-
-template<class A1, class A2, class R, R(*func)(A1, A2)>
-using Function2 = typename FunctionN<R(A1, A2)>::template instance<func>;
-
-template<class A1, class A2, class A3, class R, R(*func)(A1, A2, A3)>
-using Function3 = typename FunctionN<R(A1, A2, A3)>::template instance<func>;
-
-template<class A1, class A2, class A3, class A4, class R, R(*func)(A1, A2, A3, A4)>
-using Function4 = typename FunctionN<R(A1, A2, A3, A4)>::template instance<func>;
-
#endif
ostream << gtk_accelerator_get_label( accelerator.key, accelerator.modifiers );
}
-typedef std::map<Accelerator, Callback> AcceleratorMap;
+typedef std::map<Accelerator, Callback<void()>> AcceleratorMap;
typedef std::set<Accelerator> AcceleratorSet;
-bool accelerator_map_insert( AcceleratorMap& acceleratorMap, Accelerator accelerator, const Callback& callback ){
+bool accelerator_map_insert( AcceleratorMap& acceleratorMap, Accelerator accelerator, const Callback<void()>& callback ){
if ( accelerator.key != 0 ) {
return acceleratorMap.insert( AcceleratorMap::value_type( accelerator, callback ) ).second;
}
}
-GClosure* accel_group_add_accelerator( GtkAccelGroup* group, Accelerator accelerator, const Callback& callback );
+GClosure* accel_group_add_accelerator( GtkAccelGroup* group, Accelerator accelerator, const Callback<void()>& callback );
void accel_group_remove_accelerator( GtkAccelGroup* group, Accelerator accelerator );
AcceleratorMap g_queuedAcceleratorsAdd;
AcceleratorSet g_queuedAcceleratorsRemove;
-void globalQueuedAccelerators_add( Accelerator accelerator, const Callback& callback ){
+void globalQueuedAccelerators_add( Accelerator accelerator, const Callback<void()>& callback ){
if ( !g_queuedAcceleratorsAdd.insert( AcceleratorMap::value_type( accelerator, callback ) ).second ) {
globalErrorStream() << "globalQueuedAccelerators_add: accelerator already queued: " << accelerator << "\n";
}
-void special_accelerators_add( Accelerator accelerator, const Callback& callback ){
+void special_accelerators_add( Accelerator accelerator, const Callback<void()>& callback ){
//globalOutputStream() << "special_accelerators_add: " << makeQuoted(accelerator) << "\n";
if ( !accelerator_map_insert( g_special_accelerators, accelerator, callback ) ) {
globalErrorStream() << "special_accelerators_add: already exists: " << makeQuoted( accelerator ) << "\n";
}
}
-void keydown_accelerators_add( Accelerator accelerator, const Callback& callback ){
+void keydown_accelerators_add( Accelerator accelerator, const Callback<void()>& callback ){
//globalOutputStream() << "keydown_accelerators_add: " << makeQuoted(accelerator) << "\n";
if ( !accelerator_map_insert( g_keydown_accelerators, accelerator, callback ) ) {
globalErrorStream() << "keydown_accelerators_add: already exists: " << makeQuoted( accelerator ) << "\n";
}
}
-void keyup_accelerators_add( Accelerator accelerator, const Callback& callback ){
+void keyup_accelerators_add( Accelerator accelerator, const Callback<void()>& callback ){
//globalOutputStream() << "keyup_accelerators_add: " << makeQuoted(accelerator) << "\n";
if ( !accelerator_map_insert( g_keyup_accelerators, accelerator, callback ) ) {
globalErrorStream() << "keyup_accelerators_add: already exists: " << makeQuoted( accelerator ) << "\n";
gboolean accel_closure_callback( GtkAccelGroup* group, GtkWidget* widget, guint key, GdkModifierType modifiers, gpointer data ){
- ( *reinterpret_cast<Callback*>( data ) )( );
+ ( *reinterpret_cast<Callback<void()>*>( data ) )( );
return TRUE;
}
-GClosure* accel_group_add_accelerator( GtkAccelGroup* group, Accelerator accelerator, const Callback& callback ){
+GClosure* accel_group_add_accelerator( GtkAccelGroup* group, Accelerator accelerator, const Callback<void()>& callback ){
if ( accelerator.key != 0 && gtk_accelerator_valid( accelerator.key, accelerator.modifiers ) ) {
//globalOutputStream() << "global_accel_connect: " << makeQuoted(accelerator) << "\n";
GClosure* closure = create_cclosure( G_CALLBACK( accel_closure_callback ), callback );
ui::AccelGroup global_accel{ui::New};
-GClosure* global_accel_group_add_accelerator( Accelerator accelerator, const Callback& callback ){
+GClosure* global_accel_group_add_accelerator( Accelerator accelerator, const Callback<void()>& callback ){
if ( !global_accel_enabled() ) {
// workaround: cannot add to GtkAccelGroup while it is disabled
//globalOutputStream() << "queued for add: " << accelerator << "\n";
return 0;
}
-void global_accel_group_connect( const Accelerator& accelerator, const Callback& callback ){
+void global_accel_group_connect( const Accelerator& accelerator, const Callback<void()>& callback ){
if ( accelerator.key != 0 ) {
global_accel_group_add_accelerator( accelerator, callback );
}
}
-void global_accel_group_disconnect( const Accelerator& accelerator, const Callback& callback ){
+void global_accel_group_disconnect( const Accelerator& accelerator, const Callback<void()>& callback ){
if ( accelerator.key != 0 ) {
global_accel_group_remove_accelerator( accelerator );
}
return ostream;
}
-void keydown_accelerators_add( Accelerator accelerator, const Callback& callback );
+void keydown_accelerators_add( Accelerator accelerator, const Callback<void()>& callback );
void keydown_accelerators_remove( Accelerator accelerator );
-void keyup_accelerators_add( Accelerator accelerator, const Callback& callback );
+void keyup_accelerators_add( Accelerator accelerator, const Callback<void()>& callback );
void keyup_accelerators_remove( Accelerator accelerator );
void global_accel_connect_window( ui::Window window );
GClosure* global_accel_group_find( Accelerator accelerator );
-void global_accel_group_connect( const Accelerator& accelerator, const Callback& callback );
-void global_accel_group_disconnect( const Accelerator& accelerator, const Callback& callback );
+void global_accel_group_connect( const Accelerator& accelerator, const Callback<void()>& callback );
+void global_accel_group_disconnect( const Accelerator& accelerator, const Callback<void()>& callback );
class Command
{
public:
-Callback m_callback;
+Callback<void()> m_callback;
const Accelerator& m_accelerator;
-Command( const Callback& callback, const Accelerator& accelerator ) : m_callback( callback ), m_accelerator( accelerator ){
+Command( const Callback<void()>& callback, const Accelerator& accelerator ) : m_callback( callback ), m_accelerator( accelerator ){
}
};
public:
Command m_command;
BoolExportCallback m_exportCallback;
-Toggle( const Callback& callback, const Accelerator& accelerator, const BoolExportCallback& exportCallback ) : m_command( callback, accelerator ), m_exportCallback( exportCallback ){
+Toggle( const Callback<void()>& callback, const Accelerator& accelerator, const BoolExportCallback& exportCallback ) : m_command( callback, accelerator ), m_exportCallback( exportCallback ){
}
};
{
public:
const Accelerator& m_accelerator;
-Callback m_keyDown;
-Callback m_keyUp;
-KeyEvent( const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp ) : m_accelerator( accelerator ), m_keyDown( keyDown ), m_keyUp( keyUp ){
+Callback<void()> m_keyDown;
+Callback<void()> m_keyUp;
+KeyEvent( const Accelerator& accelerator, const Callback<void()>& keyDown, const Callback<void()>& keyUp ) : m_accelerator( accelerator ), m_keyDown( keyDown ), m_keyUp( keyUp ){
}
};
#include "pointer.h"
void clicked_closure_callback( ui::Widget widget, gpointer data ){
- ( *reinterpret_cast<Callback*>( data ) )( );
+ ( *reinterpret_cast<Callback<void()>*>( data ) )( );
}
-void button_connect_callback( ui::Button button, const Callback& callback ){
+void button_connect_callback( ui::Button button, const Callback<void()>& callback ){
#if 1
g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
#else
#endif
}
-void button_connect_callback( ui::ToolButton button, const Callback& callback ){
+void button_connect_callback( ui::ToolButton button, const Callback<void()>& callback ){
#if 1
g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
#else
#endif
}
-guint toggle_button_connect_callback( ui::ToggleButton button, const Callback& callback ){
+guint toggle_button_connect_callback( ui::ToggleButton button, const Callback<void()>& callback ){
#if 1
guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
#else
return handler;
}
-guint toggle_button_connect_callback( ui::ToggleToolButton button, const Callback& callback ){
+guint toggle_button_connect_callback( ui::ToggleToolButton button, const Callback<void()>& callback ){
#if 1
guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
#else
typedef gint gboolean;
typedef unsigned int guint;
-void button_connect_callback( ui::Button button, const Callback& callback );
-void button_connect_callback( ui::ToolButton button, const Callback& callback );
-guint toggle_button_connect_callback( ui::ToggleButton button, const Callback& callback );
-guint toggle_button_connect_callback( ui::ToggleToolButton button, const Callback& callback );
+void button_connect_callback( ui::Button button, const Callback<void()>& callback );
+void button_connect_callback( ui::ToolButton button, const Callback<void()>& callback );
+guint toggle_button_connect_callback( ui::ToggleButton button, const Callback<void()>& callback );
+guint toggle_button_connect_callback( ui::ToggleToolButton button, const Callback<void()>& callback );
void button_set_icon( ui::Button button, const char* icon );
void toggle_button_set_active_no_signal( ui::ToggleButton item, gboolean active );
#include "generic/callback.h"
inline void closure_destroy( gpointer data, GClosure* closure ){
- delete reinterpret_cast<Callback*>( data );
+ delete reinterpret_cast<Callback<void()>*>( data );
}
-inline GClosure* create_cclosure( GCallback func, const Callback& callback ){
- return g_cclosure_new( func, new Callback( callback ), closure_destroy );
+inline GClosure* create_cclosure( GCallback func, const Callback<void()>& callback ){
+ return g_cclosure_new( func, new Callback<void()>( callback ), closure_destroy );
}
inline GValue GValue_default(){
void PathEntry_setPath( PathEntry& self, const char* path ){
gtk_entry_set_text( self.m_entry, path );
}
-typedef ReferenceCaller1<PathEntry, const char*, PathEntry_setPath> PathEntrySetPathCaller;
+typedef ReferenceCaller<PathEntry, void(const char*), PathEntry_setPath> PathEntrySetPathCaller;
void BrowsedPathEntry_clicked( ui::Widget widget, BrowsedPathEntry* self ){
self->m_browse( PathEntrySetPathCaller( self->m_entry ) );
class BrowsedPathEntry
{
public:
-typedef Callback1<const char*> SetPathCallback;
-typedef Callback1<const SetPathCallback&> BrowseCallback;
+typedef Callback<void(const char*)> SetPathCallback;
+typedef Callback<void(const SetPathCallback&)> BrowseCallback;
PathEntry m_entry;
BrowseCallback m_browse;
class IdleDraw
{
-Callback m_draw;
+Callback<void()> m_draw;
unsigned int m_handler;
static gboolean draw( gpointer data ){
reinterpret_cast<IdleDraw*>( data )->m_draw();
return FALSE;
}
public:
-IdleDraw( const Callback& draw ) : m_draw( draw ), m_handler( 0 ){
+IdleDraw( const Callback<void()>& draw ) : m_draw( draw ), m_handler( 0 ){
}
~IdleDraw(){
if ( m_handler != 0 ) {
m_handler = g_idle_add( &draw, this );
}
}
-typedef MemberCaller<IdleDraw, &IdleDraw::queueDraw> QueueDrawCaller;
+typedef MemberCaller<IdleDraw, void(), &IdleDraw::queueDraw> QueueDrawCaller;
void flush(){
if ( m_handler != 0 ) {
}
void activate_closure_callback( ui::Widget widget, gpointer data ){
- ( *reinterpret_cast<Callback*>( data ) )( );
+ ( *reinterpret_cast<Callback<void()>*>( data ) )( );
}
-guint menu_item_connect_callback( ui::MenuItem item, const Callback& callback ){
+guint menu_item_connect_callback( ui::MenuItem item, const Callback<void()>& callback ){
#if 1
return g_signal_connect_swapped( G_OBJECT( item ), "activate", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
#else
#endif
}
-guint check_menu_item_connect_callback( ui::CheckMenuItem item, const Callback& callback ){
+guint check_menu_item_connect_callback( ui::CheckMenuItem item, const Callback<void()>& callback ){
#if 1
guint handler = g_signal_connect_swapped( G_OBJECT( item ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
#else
return handler;
}
-ui::MenuItem new_menu_item_with_mnemonic( const char *mnemonic, const Callback& callback ){
+ui::MenuItem new_menu_item_with_mnemonic( const char *mnemonic, const Callback<void()>& callback ){
auto item = ui::MenuItem( mnemonic, true );
item.show();
menu_item_connect_callback( item, callback );
return item;
}
-ui::MenuItem create_menu_item_with_mnemonic( ui::Menu menu, const char *mnemonic, const Callback& callback ){
+ui::MenuItem create_menu_item_with_mnemonic( ui::Menu menu, const char *mnemonic, const Callback<void()>& callback ){
auto item = new_menu_item_with_mnemonic( mnemonic, callback );
menu.add(item);
return item;
}
-ui::CheckMenuItem new_check_menu_item_with_mnemonic( const char* mnemonic, const Callback& callback ){
+ui::CheckMenuItem new_check_menu_item_with_mnemonic( const char* mnemonic, const Callback<void()>& callback ){
auto item = ui::CheckMenuItem(GTK_CHECK_MENU_ITEM( gtk_check_menu_item_new_with_mnemonic( mnemonic ) ));
item.show();
check_menu_item_connect_callback( item, callback );
return item;
}
-ui::CheckMenuItem create_check_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Callback& callback ){
+ui::CheckMenuItem create_check_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Callback<void()>& callback ){
auto item = new_check_menu_item_with_mnemonic( mnemonic, callback );
menu.add(item);
return item;
}
-ui::RadioMenuItem new_radio_menu_item_with_mnemonic( GSList** group, const char* mnemonic, const Callback& callback ){
+ui::RadioMenuItem new_radio_menu_item_with_mnemonic( GSList** group, const char* mnemonic, const Callback<void()>& callback ){
auto item = ui::RadioMenuItem(GTK_RADIO_MENU_ITEM( gtk_radio_menu_item_new_with_mnemonic( *group, mnemonic ) ));
if ( *group == 0 ) {
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), TRUE );
return item;
}
-ui::RadioMenuItem create_radio_menu_item_with_mnemonic( ui::Menu menu, GSList** group, const char* mnemonic, const Callback& callback ){
+ui::RadioMenuItem create_radio_menu_item_with_mnemonic( ui::Menu menu, GSList** group, const char* mnemonic, const Callback<void()>& callback ){
auto item = new_radio_menu_item_with_mnemonic( group, mnemonic, callback );
menu.add(item);
return item;
void check_menu_item_set_active_callback( GtkCheckMenuItem &item, bool enabled ){
check_menu_item_set_active_no_signal( ui::CheckMenuItem(&item), enabled );
}
-typedef ReferenceCaller1<GtkCheckMenuItem, bool, check_menu_item_set_active_callback> CheckMenuItemSetActiveCaller;
+typedef ReferenceCaller<GtkCheckMenuItem, void(bool), check_menu_item_set_active_callback> CheckMenuItemSetActiveCaller;
ui::CheckMenuItem create_check_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Toggle& toggle ){
auto item = create_check_menu_item_with_mnemonic( menu, mnemonic, toggle.m_command.m_callback );
ui::MenuItem new_sub_menu_item_with_mnemonic( const char* mnemonic );
ui::Menu create_sub_menu_with_mnemonic( ui::MenuBar bar, const char* mnemonic );
ui::Menu create_sub_menu_with_mnemonic( ui::Menu parent, const char* mnemonic );
-ui::MenuItem create_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Callback& callback );
-ui::CheckMenuItem create_check_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Callback& callback );
-ui::RadioMenuItem create_radio_menu_item_with_mnemonic( ui::Menu menu, GSList** group, const char* mnemonic, const Callback& callback );
+ui::MenuItem create_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Callback<void()>& callback );
+ui::CheckMenuItem create_check_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Callback<void()>& callback );
+ui::RadioMenuItem create_radio_menu_item_with_mnemonic( ui::Menu menu, GSList** group, const char* mnemonic, const Callback<void()>& callback );
class Command;
ui::MenuItem create_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Command& command );
class NonModalEntry {
bool m_editing;
- Callback m_apply;
- Callback m_cancel;
+ Callback<void()> m_apply;
+ Callback<void()> m_cancel;
static gboolean focus_in(ui::Entry entry, GdkEventFocus *event, NonModalEntry *self);
static gboolean escape(ui::Entry entry, GdkEventKey *event, NonModalEntry *self);
public:
- NonModalEntry(const Callback &apply, const Callback &cancel) : m_editing(false), m_apply(apply), m_cancel(cancel)
+ NonModalEntry(const Callback<void()> &apply, const Callback<void()> &cancel) : m_editing(false), m_apply(apply), m_cancel(cancel)
{
}
class NonModalSpinner {
- Callback m_apply;
- Callback m_cancel;
+ Callback<void()> m_apply;
+ Callback<void()> m_cancel;
static gboolean changed(ui::SpinButton spin, NonModalSpinner *self);
static gboolean escape(ui::SpinButton spin, GdkEventKey *event, NonModalSpinner *self);
public:
- NonModalSpinner(const Callback &apply, const Callback &cancel) : m_apply(apply), m_cancel(cancel)
+ NonModalSpinner(const Callback<void()> &apply, const Callback<void()> &cancel) : m_apply(apply), m_cancel(cancel)
{
}
class NonModalRadio {
- Callback m_changed;
+ Callback<void()> m_changed;
public:
- NonModalRadio(const Callback &changed) : m_changed(changed)
+ NonModalRadio(const Callback<void()> &changed) : m_changed(changed)
{
}
toolbar.add(button);
}
-ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback<void()>& callback ){
auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(new_local_image(icon), nullptr)));
button_connect_callback(button, callback);
toolbar_append(toolbar, button, description);
return button;
}
-ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback<void()>& callback ){
auto button = ui::ToggleToolButton(GTK_TOGGLE_TOOL_BUTTON(gtk_toggle_tool_button_new()));
toggle_button_connect_callback(button, callback);
gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), new_local_image(icon));
void toggle_button_set_active_callback( GtkToggleToolButton& button, bool active ){
toggle_button_set_active_no_signal( ui::ToggleToolButton(&button), active );
}
-using ToggleButtonSetActiveCaller = ReferenceCaller1<GtkToggleToolButton, bool, toggle_button_set_active_callback>;
+using ToggleButtonSetActiveCaller = ReferenceCaller<GtkToggleToolButton, void(bool), toggle_button_set_active_callback>;
ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Toggle& toggle ){
auto button = toolbar_append_toggle_button( toolbar, description, icon, toggle.m_command.m_callback );
class Command;
class Toggle;
-ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback );
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback<void()>& callback );
ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Command& command );
-ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback );
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback<void()>& callback );
ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Toggle& toggle );
#endif
m_exportCallback(callback);
}
- typedef MemberCaller1<ToggleItem, const BoolImportCallback &, &ToggleItem::addCallback> AddCallbackCaller;
+ typedef MemberCaller<ToggleItem, void(const BoolImportCallback &), &ToggleItem::addCallback> AddCallbackCaller;
};
class ToggleShown {
void exportActive(const BoolImportCallback &importCallback);
- typedef MemberCaller1<ToggleShown, const BoolImportCallback &, &ToggleShown::exportActive> ActiveCaller;
+ typedef MemberCaller<ToggleShown, void(const BoolImportCallback &), &ToggleShown::exportActive> ActiveCaller;
void set(bool shown);
void toggle();
- typedef MemberCaller<ToggleShown, &ToggleShown::toggle> ToggleCaller;
+ typedef MemberCaller<ToggleShown, void(), &ToggleShown::toggle> ToggleCaller;
void connect(ui::Widget widget);
};
void widget_queue_draw(ui::Widget &widget);
-typedef ReferenceCaller<ui::Widget, widget_queue_draw> WidgetQueueDrawCaller;
+typedef ReferenceCaller<ui::Widget, void(), widget_queue_draw> WidgetQueueDrawCaller;
void widget_make_default(ui::Widget widget);
void WindowPosition_Parse(WindowPosition &position, const char *value);
-typedef ReferenceCaller1<WindowPosition, const char *, WindowPosition_Parse> WindowPositionImportStringCaller;
+typedef ReferenceCaller<WindowPosition, void(const char *), WindowPosition_Parse> WindowPositionImportStringCaller;
void WindowPosition_Write(const WindowPosition &position, const StringImportCallback &importCallback);
-typedef ConstReferenceCaller1<WindowPosition, const StringImportCallback &, WindowPosition_Write> WindowPositionExportStringCaller;
+typedef ConstReferenceCaller<WindowPosition, void(const StringImportCallback &), WindowPosition_Write> WindowPositionExportStringCaller;
class WindowPositionTracker {
void WindowPositionTracker_importString(WindowPositionTracker &self, const char *value);
-typedef ReferenceCaller1<WindowPositionTracker, const char *, WindowPositionTracker_importString> WindowPositionTrackerImportStringCaller;
+typedef ReferenceCaller<WindowPositionTracker, void(const char *), WindowPositionTracker_importString> WindowPositionTrackerImportStringCaller;
void WindowPositionTracker_exportString(const WindowPositionTracker &self, const StringImportCallback &importer);
-typedef ConstReferenceCaller1<WindowPositionTracker, const StringImportCallback &, WindowPositionTracker_exportString> WindowPositionTrackerExportStringCaller;
+typedef ConstReferenceCaller<WindowPositionTracker, void(const StringImportCallback &), WindowPositionTracker_exportString> WindowPositionTrackerExportStringCaller;
#endif
( *i ).second->transformChanged();
}
}
-typedef MemberCaller<InstanceSet, &InstanceSet::transformChanged> TransformChangedCaller;
+typedef MemberCaller<InstanceSet, void(), &InstanceSet::transformChanged> TransformChangedCaller;
void boundsChanged(){
for ( InstanceMap::iterator i = m_instances.begin(); i != m_instances.end(); ++i )
{
( *i ).second->boundsChanged();
}
}
-typedef MemberCaller<InstanceSet, &InstanceSet::boundsChanged> BoundsChangedCaller;
+typedef MemberCaller<InstanceSet, void(), &InstanceSet::boundsChanged> BoundsChangedCaller;
};
template<typename Functor>
InstanceTypeCast<Type>::cast(instance)->evaluateTransform();
});
}
-typedef ReferenceCaller<InstanceSet, &InstanceSetEvaluateTransform<Type>::apply> Caller;
+typedef ReferenceCaller<InstanceSet, void(), &InstanceSetEvaluateTransform<Type>::apply> Caller;
};
#endif
std::size_t m_saved;
typedef void ( UndoFileChangeTracker::*Pending )();
Pending m_pending;
-Callback m_changed;
+Callback<void()> m_changed;
public:
UndoFileChangeTracker() : m_size( 0 ), m_saved( MAPFILE_MAX_CHANGES ), m_pending( 0 ){
return m_saved == m_size;
}
-void setChangedCallback( const Callback& changed ){
+void setChangedCallback( const Callback<void()>& changed ){
m_changed = changed;
m_changed();
}
void initialise(){
m_typeId = GlobalSceneGraph().getNodeTypeId( Name() );
}
-typedef MemberCaller<NodeType<Type>, &NodeType<Type>::initialise> InitialiseCaller;
+typedef MemberCaller<NodeType<Type>, void(), &NodeType<Type>::initialise> InitialiseCaller;
TypeId getTypeId(){
#if GDEF_DEBUG
ASSERT_MESSAGE( m_typeId != NODETYPEID_NONE, "node-type " << makeQuoted( Name() ) << " used before being initialised" );
void initialise(){
m_typeId = GlobalSceneGraph().getInstanceTypeId( Name() );
}
-typedef MemberCaller<InstanceType<Type>, &InstanceType<Type>::initialise> InitialiseCaller;
+typedef MemberCaller<InstanceType<Type>, void(), &InstanceType<Type>::initialise> InitialiseCaller;
TypeId getTypeId(){
#if GDEF_DEBUG
ASSERT_MESSAGE( m_typeId != INSTANCETYPEID_NONE, "instance-type " << makeQuoted( Name() ) << " used before being initialised" );
mutable bool m_childSelectedChanged;
mutable bool m_parentSelected;
mutable bool m_parentSelectedChanged;
-Callback m_childSelectedChangedCallback;
-Callback m_transformChangedCallback;
+Callback<void()> m_childSelectedChangedCallback;
+Callback<void()> m_transformChangedCallback;
void evaluateTransform() const {
GlobalSceneGraph().traverse_subgraph( TransformChangedWalker(), m_path );
boundsChanged();
}
-void setTransformChangedCallback( const Callback& callback ){
+void setTransformChangedCallback( const Callback<void()>& callback ){
m_transformChangedCallback = callback;
}
return m_childSelected;
}
-void setChildSelectedChangedCallback( const Callback& callback ){
+void setChildSelectedChangedCallback( const Callback<void()>& callback ){
m_childSelectedChangedCallback = callback;
}
void selectedChanged(){
class SimpleCounter : public Counter
{
-Callback m_countChanged;
+Callback<void()> m_countChanged;
std::size_t m_count;
public:
-void setCountChangedCallback( const Callback& countChanged ){
+void setCountChangedCallback( const Callback<void()>& countChanged ){
m_countChanged = countChanged;
}
void increment(){
Instance::selectedChanged();
}
-typedef MemberCaller1<SelectableInstance, const Selectable&, &SelectableInstance::selectedChanged> SelectedChangedCaller;
+typedef MemberCaller<SelectableInstance, void(const Selectable&), &SelectableInstance::selectedChanged> SelectedChangedCaller;
};
}
};
-class SignalHandler : public SignalHandlerN<Callback0<SignalHandlerResult>, SignalHandlerCaller1> {
- using SignalHandlerN<Callback0<SignalHandlerResult>, SignalHandlerCaller1>::SignalHandlerN;
+class SignalHandler : public SignalHandlerN<Callback<SignalHandlerResult()>, SignalHandlerCaller1> {
+ using SignalHandlerN<Callback<SignalHandlerResult()>, SignalHandlerCaller1>::SignalHandlerN;
};
template<typename Caller>
}
template<typename FirstArgument>
-class SignalHandler1 : public SignalHandlerN<Callback1<FirstArgument, SignalHandlerResult>, SignalHandlerCaller2> {
- using SignalHandlerN<Callback1<FirstArgument, SignalHandlerResult>, SignalHandlerCaller2>::SignalHandlerN;
+class SignalHandler1 : public SignalHandlerN<Callback<SignalHandlerResult(FirstArgument)>, SignalHandlerCaller2> {
+ using SignalHandlerN<Callback<SignalHandlerResult(FirstArgument)>, SignalHandlerCaller2>::SignalHandlerN;
};
template<typename Caller>
template<typename FirstArgument, typename SecondArgument>
class SignalHandler2
- : public SignalHandlerN<Callback2<FirstArgument, SecondArgument, SignalHandlerResult>, SignalHandlerCaller3> {
- using SignalHandlerN<Callback2<FirstArgument, SecondArgument, SignalHandlerResult>, SignalHandlerCaller3>::SignalHandlerN;
+ : public SignalHandlerN<Callback<SignalHandlerResult(FirstArgument, SecondArgument)>, SignalHandlerCaller3> {
+ using SignalHandlerN<Callback<SignalHandlerResult(FirstArgument, SecondArgument)>, SignalHandlerCaller3>::SignalHandlerN;
};
template<typename Caller>
template<typename FirstArgument, typename SecondArgument, typename ThirdArgument>
class SignalHandler3
- : public SignalHandlerN<Callback3<FirstArgument, SecondArgument, ThirdArgument, SignalHandlerResult>, SignalHandlerCaller4> {
- using SignalHandlerN<Callback3<FirstArgument, SecondArgument, ThirdArgument, SignalHandlerResult>, SignalHandlerCaller4>::SignalHandlerN;
+ : public SignalHandlerN<Callback<SignalHandlerResult(FirstArgument, SecondArgument, ThirdArgument)>, SignalHandlerCaller4> {
+ using SignalHandlerN<Callback<SignalHandlerResult(FirstArgument, SecondArgument, ThirdArgument)>, SignalHandlerCaller4>::SignalHandlerN;
};
template<typename Caller>
SignalHandlerResult handler0( Test& ){
return SIGNAL_CONTINUE_EMISSION;
}
-typedef Function1<Test&, SignalHandlerResult, handler0> TestHandler0;
+typedef Function<SignalHandlerResult(Test&), handler0> TestHandler0;
int function0( Test& ){
return 7;
}
-typedef Function1<Test&, int, function0> TestFunction0;
+typedef Function<int(Test&), function0> TestFunction0;
SignalHandlerResult handler1( Test&, A1 ){
return SIGNAL_CONTINUE_EMISSION;
}
-typedef Function2<Test&, A1, SignalHandlerResult, handler1> TestHandler1;
+typedef Function<SignalHandlerResult(Test&, A1), handler1> TestHandler1;
void function1( Test&, A1 ){
}
-typedef ReferenceCaller1<Test, A1, function1> TestFunction1;
+typedef ReferenceCaller<Test, void(A1), function1> TestFunction1;
SignalHandlerResult handler2( Test&, A1, A2 ){
return SIGNAL_CONTINUE_EMISSION;
}
-typedef Function3<Test&, A1, A2, SignalHandlerResult, handler2> TestHandler2;
+typedef Function<SignalHandlerResult(Test&, A1, A2), handler2> TestHandler2;
void function2( Test&, A1, A2 ){
}
-typedef Function3<Test&, A1, A2, void, function2> TestFunction2;
+typedef Function<void(Test&, A1, A2), function2> TestFunction2;
SignalHandlerResult handler3( Test&, A1, A2, A3 ){
return SIGNAL_CONTINUE_EMISSION;
}
-typedef Function4<Test&, A1, A2, A3, SignalHandlerResult, handler3> TestHandler3;
+typedef Function<SignalHandlerResult(Test&, A1, A2, A3), handler3> TestHandler3;
void function3( Test&, A1, A2, A3 ){
}
-typedef Function4<Test&, A1, A2, A3, void, function3> TestFunction3;
+typedef Function<void(Test&, A1, A2, A3), function3> TestFunction3;
void testSignals(){
Test test;
inline void CopiedString_importString( CopiedString& self, const char* string ){
self = string;
}
-typedef ReferenceCaller1<CopiedString, const char*, CopiedString_importString> CopiedStringImportStringCaller;
+typedef ReferenceCaller<CopiedString, void(const char*), CopiedString_importString> CopiedStringImportStringCaller;
inline void CopiedString_exportString( const CopiedString& self, const StringImportCallback& importer ){
importer( self.c_str() );
}
-typedef ConstReferenceCaller1<CopiedString, const StringImportCallback&, CopiedString_exportString> CopiedStringExportStringCaller;
+typedef ConstReferenceCaller<CopiedString, void(const StringImportCallback&), CopiedString_exportString> CopiedStringExportStringCaller;
inline void Bool_importString( bool& self, const char* string ){
self = string_equal( string, "true" );
}
-typedef ReferenceCaller1<bool, const char*, Bool_importString> BoolImportStringCaller;
+typedef ReferenceCaller<bool, void(const char*), Bool_importString> BoolImportStringCaller;
inline void Bool_exportString( const bool& self, const StringImportCallback& importer ){
importer( self ? "true" : "false" );
}
-typedef ConstReferenceCaller1<bool, const StringImportCallback&, Bool_exportString> BoolExportStringCaller;
+typedef ConstReferenceCaller<bool, void(const StringImportCallback&), Bool_exportString> BoolExportStringCaller;
inline void Int_importString( int& self, const char* string ){
if ( !string_parse_int( string, self ) ) {
self = 0;
}
}
-typedef ReferenceCaller1<int, const char*, Int_importString> IntImportStringCaller;
+typedef ReferenceCaller<int, void(const char*), Int_importString> IntImportStringCaller;
inline void Int_exportString( const int& self, const StringImportCallback& importer ){
char buffer[16];
sprintf( buffer, "%d", self );
importer( buffer );
}
-typedef ConstReferenceCaller1<int, const StringImportCallback&, Int_exportString> IntExportStringCaller;
+typedef ConstReferenceCaller<int, void(const StringImportCallback&), Int_exportString> IntExportStringCaller;
inline void Size_importString( std::size_t& self, const char* string ){
int i;
self = 0;
}
}
-typedef ReferenceCaller1<std::size_t, const char*, Size_importString> SizeImportStringCaller;
+typedef ReferenceCaller<std::size_t, void(const char*), Size_importString> SizeImportStringCaller;
inline void Size_exportString( const std::size_t& self, const StringImportCallback& importer ){
char buffer[16];
sprintf( buffer, "%u", Unsigned( self ) );
importer( buffer );
}
-typedef ConstReferenceCaller1<std::size_t, const StringImportCallback&, Size_exportString> SizeExportStringCaller;
+typedef ConstReferenceCaller<std::size_t, void(const StringImportCallback&), Size_exportString> SizeExportStringCaller;
inline void Float_importString( float& self, const char* string ){
if ( !string_parse_float( string, self ) ) {
self = 0;
}
}
-typedef ReferenceCaller1<float, const char*, Float_importString> FloatImportStringCaller;
+typedef ReferenceCaller<float, void(const char*), Float_importString> FloatImportStringCaller;
inline void Float_exportString( const float& self, const StringImportCallback& importer ){
char buffer[16];
sprintf( buffer, "%g", self );
importer( buffer );
}
-typedef ConstReferenceCaller1<float, const StringImportCallback&, Float_exportString> FloatExportStringCaller;
+typedef ConstReferenceCaller<float, void(const StringImportCallback&), Float_exportString> FloatExportStringCaller;
inline void Vector3_importString( Vector3& self, const char* string ){
if ( !string_parse_vector3( string, self ) ) {
self = Vector3( 0, 0, 0 );
}
}
-typedef ReferenceCaller1<Vector3, const char*, Vector3_importString> Vector3ImportStringCaller;
+typedef ReferenceCaller<Vector3, void(const char*), Vector3_importString> Vector3ImportStringCaller;
inline void Vector3_exportString( const Vector3& self, const StringImportCallback& importer ){
char buffer[64];
sprintf( buffer, "%g %g %g", self[0], self[1], self[2] );
importer( buffer );
}
-typedef ConstReferenceCaller1<Vector3, const StringImportCallback&, Vector3_exportString> Vector3ExportStringCaller;
+typedef ConstReferenceCaller<Vector3, void(const StringImportCallback&), Vector3_exportString> Vector3ExportStringCaller;
inline void Bool_toString( const StringImportCallback& self, bool value ){
Bool_exportString( value, self );
}
-typedef ConstReferenceCaller1<StringImportCallback, bool, Bool_toString> BoolToString;
+typedef ConstReferenceCaller<StringImportCallback, void(bool), Bool_toString> BoolToString;
template<typename Caller>
inline void Int_toString( const StringImportCallback& self, int value ){
Int_exportString( value, self );
}
-typedef ConstReferenceCaller1<StringImportCallback, int, Int_toString> IntToString;
+typedef ConstReferenceCaller<StringImportCallback, void(int), Int_toString> IntToString;
template<typename Caller>
inline void Size_toString( const StringImportCallback& self, std::size_t value ){
Size_exportString( value, self );
}
-typedef ConstReferenceCaller1<StringImportCallback, std::size_t, Size_toString> SizeToString;
+typedef ConstReferenceCaller<StringImportCallback, void(std::size_t), Size_toString> SizeToString;
template<typename Caller>
Translation m_translation;
Rotation m_rotation;
Scale m_scale;
-Callback m_changed;
-Callback m_apply;
+Callback<void()> m_changed;
+Callback<void()> m_apply;
TransformModifierType m_type;
public:
-TransformModifier( const Callback& changed, const Callback& apply ) :
+TransformModifier( const Callback<void()>& changed, const Callback<void()>& apply ) :
m_translation( c_translation_identity ),
m_rotation( c_quaternion_identity ),
m_scale( c_scale_identity ),
class InitialiserList
{
-typedef std::list<Callback> Initialisers;
+typedef std::list<Callback<void()>> Initialisers;
Initialisers m_initialisers;
mutable bool m_initialised;
public:
InitialiserList() : m_initialised( false ){
}
-void addInitialiser( const Callback& callback ){
+void addInitialiser( const Callback<void()>& callback ){
m_initialisers.push_back( callback );
}
void initialise() const {
template<typename Copyable>
class ObservedUndoableObject : public Undoable
{
-typedef Callback1<const Copyable&> ImportCallback;
+typedef Callback<void(const Copyable&)> ImportCallback;
Copyable& m_object;
ImportCallback m_importCallback;
class AngleKey
{
-Callback m_angleChanged;
+Callback<void()> m_angleChanged;
public:
float m_angle;
-AngleKey( const Callback& angleChanged )
+AngleKey( const Callback<void()>& angleChanged )
: m_angleChanged( angleChanged ), m_angle( ANGLEKEY_IDENTITY ){
}
read_angle( m_angle, value );
m_angleChanged();
}
-typedef MemberCaller1<AngleKey, const char*, &AngleKey::angleChanged> AngleChangedCaller;
+typedef MemberCaller<AngleKey, void(const char*), &AngleKey::angleChanged> AngleChangedCaller;
void write( Entity* entity ) const {
write_angle( m_angle, entity );
class AnglesKey
{
-Callback m_anglesChanged;
+Callback<void()> m_anglesChanged;
public:
Vector3 m_angles;
-AnglesKey( const Callback& anglesChanged )
+AnglesKey( const Callback<void()>& anglesChanged )
: m_anglesChanged( anglesChanged ), m_angles( ANGLESKEY_IDENTITY ){
}
read_angle( m_angles, value );
m_anglesChanged();
}
-typedef MemberCaller1<AnglesKey, const char*, &AnglesKey::angleChanged> AngleChangedCaller;
+typedef MemberCaller<AnglesKey, void(const char*), &AnglesKey::angleChanged> AngleChangedCaller;
void anglesChanged( const char* value ){
read_angles( m_angles, value );
m_anglesChanged();
}
-typedef MemberCaller1<AnglesKey, const char*, &AnglesKey::anglesChanged> AnglesChangedCaller;
+typedef MemberCaller<AnglesKey, void(const char*), &AnglesKey::anglesChanged> AnglesChangedCaller;
void write( Entity* entity ) const {
write_angles( m_angles, entity );
class Colour
{
-Callback m_colourChanged;
+Callback<void()> m_colourChanged;
Shader* m_state;
void capture_state(){
public:
Vector3 m_colour;
-Colour( const Callback& colourChanged )
+Colour( const Callback<void()>& colourChanged )
: m_colourChanged( colourChanged ){
default_colour( m_colour );
capture_state();
m_colourChanged();
}
-typedef MemberCaller1<Colour, const char*, &Colour::colourChanged> ColourChangedCaller;
+typedef MemberCaller<Colour, void(const char*), &Colour::colourChanged> ColourChangedCaller;
void write( Entity* entity ) const {
m_selectedRender.reserve( m_controlPoints.size() );
}
-typedef MemberCaller<CurveEdit, &CurveEdit::curveChanged> CurveChangedCaller;
+typedef MemberCaller<CurveEdit, void(), &CurveEdit::curveChanged> CurveChangedCaller;
};
class NURBSCurve
{
Signal0 m_curveChanged;
-Callback m_boundsChanged;
+Callback<void()> m_boundsChanged;
public:
ControlPoints m_controlPoints;
ControlPoints m_controlPointsTransformed;
RenderableCurve m_renderCurve;
AABB m_bounds;
-NURBSCurve( const Callback& boundsChanged ) : m_boundsChanged( boundsChanged ){
+NURBSCurve( const Callback<void()>& boundsChanged ) : m_boundsChanged( boundsChanged ){
}
SignalHandlerId connect( const SignalHandler& curveChanged ){
m_controlPointsTransformed = m_controlPoints;
curveChanged();
}
-typedef MemberCaller1<NURBSCurve, const char*, &NURBSCurve::curveChanged> CurveChangedCaller;
+typedef MemberCaller<NURBSCurve, void(const char*), &NURBSCurve::curveChanged> CurveChangedCaller;
};
class CatmullRomSpline
{
Signal0 m_curveChanged;
-Callback m_boundsChanged;
+Callback<void()> m_boundsChanged;
public:
ControlPoints m_controlPoints;
ControlPoints m_controlPointsTransformed;
RenderableCurve m_renderCurve;
AABB m_bounds;
-CatmullRomSpline( const Callback& boundsChanged ) : m_boundsChanged( boundsChanged ){
+CatmullRomSpline( const Callback<void()>& boundsChanged ) : m_boundsChanged( boundsChanged ){
}
SignalHandlerId connect( const SignalHandler& curveChanged ){
m_controlPointsTransformed = m_controlPoints;
curveChanged();
}
-typedef MemberCaller1<CatmullRomSpline, const char*, &CatmullRomSpline::curveChanged> CurveChangedCaller;
+typedef MemberCaller<CatmullRomSpline, void(const char*), &CatmullRomSpline::curveChanged> CurveChangedCaller;
};
const char* const curve_Nurbs = "curve_Nurbs";
private:
mutable AABB m_curveBounds;
-Callback m_transformChanged;
-Callback m_evaluateTransform;
+Callback<void()> m_transformChanged;
+Callback<void()> m_evaluateTransform;
CopiedString m_name;
CopiedString m_modelKey;
m_name = value;
updateIsModel();
}
-typedef MemberCaller1<Doom3Group, const char*, &Doom3Group::nameChanged> NameChangedCaller;
+typedef MemberCaller<Doom3Group, void(const char*), &Doom3Group::nameChanged> NameChangedCaller;
void modelChanged( const char* value ){
m_modelKey = value;
m_model.modelChanged( "" );
}
}
-typedef MemberCaller1<Doom3Group, const char*, &Doom3Group::modelChanged> ModelChangedCaller;
+typedef MemberCaller<Doom3Group, void(const char*), &Doom3Group::modelChanged> ModelChangedCaller;
void updateTransform(){
m_transform.localToParent() = g_matrix4_identity;
m_funcStaticOrigin.originChanged();
}
}
-typedef MemberCaller<Doom3Group, &Doom3Group::updateTransform> UpdateTransformCaller;
+typedef MemberCaller<Doom3Group, void(), &Doom3Group::updateTransform> UpdateTransformCaller;
void originChanged(){
m_origin = m_originKey.m_origin;
updateTransform();
}
-typedef MemberCaller<Doom3Group, &Doom3Group::originChanged> OriginChangedCaller;
+typedef MemberCaller<Doom3Group, void(), &Doom3Group::originChanged> OriginChangedCaller;
void rotationChanged(){
rotation_assign( m_rotation, m_rotationKey.m_rotation );
updateTransform();
}
-typedef MemberCaller<Doom3Group, &Doom3Group::rotationChanged> RotationChangedCaller;
+typedef MemberCaller<Doom3Group, void(), &Doom3Group::rotationChanged> RotationChangedCaller;
void skinChanged(){
if ( isModel() ) {
}
}
}
-typedef MemberCaller<Doom3Group, &Doom3Group::skinChanged> SkinChangedCaller;
+typedef MemberCaller<Doom3Group, void(), &Doom3Group::skinChanged> SkinChangedCaller;
public:
-Doom3Group( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) :
+Doom3Group( EntityClass* eclass, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& boundsChanged, const Callback<void()>& evaluateTransform ) :
m_entity( eclass ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_traversable( 0 ){
construct();
}
-Doom3Group( const Doom3Group& other, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) :
+Doom3Group( const Doom3Group& other, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& boundsChanged, const Callback<void()>& evaluateTransform ) :
m_entity( other.m_entity ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_curveNURBS.curveChanged();
m_curveCatmullRom.curveChanged();
}
-typedef MemberCaller<Doom3Group, &Doom3Group::transformChanged> TransformChangedCaller;
+typedef MemberCaller<Doom3Group, void(), &Doom3Group::transformChanged> TransformChangedCaller;
};
class Doom3GroupInstance :
evaluateTransform();
m_contained.freezeTransform();
}
-typedef MemberCaller<Doom3GroupInstance, &Doom3GroupInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<Doom3GroupInstance, void(), &Doom3GroupInstance::applyTransform> ApplyTransformCaller;
void selectionChangedComponent( const Selectable& selectable ){
GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable );
GlobalSelectionSystem().onComponentSelection( *this, selectable );
}
-typedef MemberCaller1<Doom3GroupInstance, const Selectable&, &Doom3GroupInstance::selectionChangedComponent> SelectionChangedComponentCaller;
+typedef MemberCaller<Doom3GroupInstance, void(const Selectable&), &Doom3GroupInstance::selectionChangedComponent> SelectionChangedComponentCaller;
};
class Doom3GroupNode :
RenderableNamedEntity m_renderName;
ModelSkinKey m_skin;
-Callback m_transformChanged;
-Callback m_evaluateTransform;
+Callback<void()> m_transformChanged;
+Callback<void()> m_evaluateTransform;
void construct(){
default_rotation( m_rotation );
m_transformChanged();
}
-typedef MemberCaller<EclassModel, &EclassModel::updateTransform> UpdateTransformCaller;
+typedef MemberCaller<EclassModel, void(), &EclassModel::updateTransform> UpdateTransformCaller;
void originChanged(){
m_origin = m_originKey.m_origin;
updateTransform();
}
-typedef MemberCaller<EclassModel, &EclassModel::originChanged> OriginChangedCaller;
+typedef MemberCaller<EclassModel, void(), &EclassModel::originChanged> OriginChangedCaller;
void angleChanged(){
m_angle = m_angleKey.m_angle;
updateTransform();
}
-typedef MemberCaller<EclassModel, &EclassModel::angleChanged> AngleChangedCaller;
+typedef MemberCaller<EclassModel, void(), &EclassModel::angleChanged> AngleChangedCaller;
void rotationChanged(){
rotation_assign( m_rotation, m_rotationKey.m_rotation );
updateTransform();
}
-typedef MemberCaller<EclassModel, &EclassModel::rotationChanged> RotationChangedCaller;
+typedef MemberCaller<EclassModel, void(), &EclassModel::rotationChanged> RotationChangedCaller;
void skinChanged(){
scene::Node* node = m_model.getNode();
Node_modelSkinChanged( *node );
}
}
-typedef MemberCaller<EclassModel, &EclassModel::skinChanged> SkinChangedCaller;
+typedef MemberCaller<EclassModel, void(), &EclassModel::skinChanged> SkinChangedCaller;
public:
-EclassModel( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+EclassModel( EntityClass* eclass, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( eclass ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_evaluateTransform( evaluateTransform ){
construct();
}
-EclassModel( const EclassModel& other, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+EclassModel( const EclassModel& other, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( other.m_entity ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_evaluateTransform();
updateTransform();
}
-typedef MemberCaller<EclassModel, &EclassModel::transformChanged> TransformChangedCaller;
+typedef MemberCaller<EclassModel, void(), &EclassModel::transformChanged> TransformChangedCaller;
};
class EclassModelInstance : public TargetableInstance, public TransformModifier, public Renderable
evaluateTransform();
m_contained.freezeTransform();
}
-typedef MemberCaller<EclassModelInstance, &EclassModelInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<EclassModelInstance, void(), &EclassModelInstance::applyTransform> ApplyTransformCaller;
};
class EclassModelNode :
void Entity_setName( Entity& entity, const char* name ){
entity.setKeyValue( "name", name );
}
-typedef ReferenceCaller1<Entity, const char*, Entity_setName> EntitySetNameCaller;
+typedef ReferenceCaller<Entity, void(const char*), Entity_setName> EntitySetNameCaller;
inline Namespaced* Node_getNamespaced( scene::Node& node ){
return NodeTypeCast<Namespaced>::cast( node );
m_e1->setKeyValue( keyname(), name );
m_e2->setKeyValue( "targetname", name );
}
-typedef MemberCaller1<ConnectEntities, const char*, &ConnectEntities::connect> ConnectCaller;
+typedef MemberCaller<ConnectEntities, void(const char*), &ConnectEntities::connect> ConnectCaller;
};
inline Entity* ScenePath_getEntity( const scene::Path& path ){
void classnameChanged( const char* value ){
updateFiltered();
}
-typedef MemberCaller1<ClassnameFilter, const char*, &ClassnameFilter::classnameChanged> ClassnameChangedCaller;
+typedef MemberCaller<ClassnameFilter, void(const char*), &ClassnameFilter::classnameChanged> ClassnameChangedCaller;
};
#endif
RenderableWireframeAABB m_aabb_wire;
RenderableNamedEntity m_renderName;
-Callback m_transformChanged;
-Callback m_evaluateTransform;
+Callback<void()> m_transformChanged;
+Callback<void()> m_evaluateTransform;
void construct(){
read_aabb( m_aabb_local, m_entity.getEntityClass() );
matrix4_translate_by_vec3( m_transform.localToParent(), m_origin );
m_transformChanged();
}
-typedef MemberCaller<GenericEntity, &GenericEntity::updateTransform> UpdateTransformCaller;
+typedef MemberCaller<GenericEntity, void(), &GenericEntity::updateTransform> UpdateTransformCaller;
void originChanged(){
m_origin = m_originKey.m_origin;
updateTransform();
}
-typedef MemberCaller<GenericEntity, &GenericEntity::originChanged> OriginChangedCaller;
+typedef MemberCaller<GenericEntity, void(), &GenericEntity::originChanged> OriginChangedCaller;
void anglesChanged(){
m_angles = m_anglesKey.m_angles;
updateTransform();
}
-typedef MemberCaller<GenericEntity, &GenericEntity::anglesChanged> AnglesChangedCaller;
+typedef MemberCaller<GenericEntity, void(), &GenericEntity::anglesChanged> AnglesChangedCaller;
public:
-GenericEntity( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+GenericEntity( EntityClass* eclass, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( eclass ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_evaluateTransform( evaluateTransform ){
construct();
}
-GenericEntity( const GenericEntity& other, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+GenericEntity( const GenericEntity& other, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( other.m_entity ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_evaluateTransform();
updateTransform();
}
-typedef MemberCaller<GenericEntity, &GenericEntity::transformChanged> TransformChangedCaller;
+typedef MemberCaller<GenericEntity, void(), &GenericEntity::transformChanged> TransformChangedCaller;
};
class GenericEntityInstance :
evaluateTransform();
m_contained.freezeTransform();
}
-typedef MemberCaller<GenericEntityInstance, &GenericEntityInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<GenericEntityInstance, void(), &GenericEntityInstance::applyTransform> ApplyTransformCaller;
};
class GenericEntityNode :
RenderableNamedEntity m_renderName;
mutable Vector3 m_name_origin;
-Callback m_transformChanged;
-Callback m_evaluateTransform;
+Callback<void()> m_transformChanged;
+Callback<void()> m_evaluateTransform;
void construct(){
m_keyObservers.insert( "classname", ClassnameFilter::ClassnameChangedCaller( m_filter ) );
}
public:
-Group( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+Group( EntityClass* eclass, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( eclass ),
m_filter( m_entity, node ),
m_named( m_entity ),
m_evaluateTransform( evaluateTransform ){
construct();
}
-Group( const Group& other, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+Group( const Group& other, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( other.m_entity ),
m_filter( m_entity, node ),
m_named( m_entity ),
matrix4_translate_by_vec3( m_transform.localToParent(), m_origin );
m_transformChanged();
}
-typedef MemberCaller<Group, &Group::updateTransform> UpdateTransformCaller;
+typedef MemberCaller<Group, void(), &Group::updateTransform> UpdateTransformCaller;
void originChanged(){
m_origin = m_originKey.m_origin;
updateTransform();
}
-typedef MemberCaller<Group, &Group::originChanged> OriginChangedCaller;
+typedef MemberCaller<Group, void(), &Group::originChanged> OriginChangedCaller;
void translate( const Vector3& translation ){
m_origin = origin_translated( m_origin, translation );
m_evaluateTransform();
updateTransform();
}
-typedef MemberCaller<Group, &Group::transformChanged> TransformChangedCaller;
+typedef MemberCaller<Group, void(), &Group::transformChanged> TransformChangedCaller;
};
#if 0
evaluateTransform();
m_contained.freezeTransform();
}
-typedef MemberCaller<GroupInstance, &GroupInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<GroupInstance, void(), &GroupInstance::applyTransform> ApplyTransformCaller;
};
class GroupNode :
m_primaryIntensity = string_read_float( value );
calculateRadii();
}
-typedef MemberCaller1<LightRadii, const char*, &LightRadii::primaryIntensityChanged> PrimaryIntensityChangedCaller;
+typedef MemberCaller<LightRadii, void(const char*), &LightRadii::primaryIntensityChanged> PrimaryIntensityChangedCaller;
void secondaryIntensityChanged( const char* value ){
m_secondaryIntensity = string_read_float( value );
calculateRadii();
}
-typedef MemberCaller1<LightRadii, const char*, &LightRadii::secondaryIntensityChanged> SecondaryIntensityChangedCaller;
+typedef MemberCaller<LightRadii, void(const char*), &LightRadii::secondaryIntensityChanged> SecondaryIntensityChangedCaller;
void scaleChanged( const char* value ){
m_scale = string_read_float( value );
if ( m_scale <= 0.0f ) {
}
calculateRadii();
}
-typedef MemberCaller1<LightRadii, const char*, &LightRadii::scaleChanged> ScaleChangedCaller;
+typedef MemberCaller<LightRadii, void(const char*), &LightRadii::scaleChanged> ScaleChangedCaller;
void fadeChanged( const char* value ){
m_fade = string_read_float( value );
if ( m_fade <= 0.0f ) {
}
calculateRadii();
}
-typedef MemberCaller1<LightRadii, const char*, &LightRadii::fadeChanged> FadeChangedCaller;
+typedef MemberCaller<LightRadii, void(const char*), &LightRadii::fadeChanged> FadeChangedCaller;
void flagsChanged( const char* value ){
m_flags = string_read_int( value );
calculateRadii();
}
-typedef MemberCaller1<LightRadii, const char*, &LightRadii::flagsChanged> FlagsChangedCaller;
+typedef MemberCaller<LightRadii, void(const char*), &LightRadii::flagsChanged> FlagsChangedCaller;
};
class Doom3LightRadius
Vector3 m_radius;
Vector3 m_radiusTransformed;
Vector3 m_center;
-Callback m_changed;
+Callback<void()> m_changed;
bool m_useCenterKey;
Doom3LightRadius( const char* defaultRadius ) : m_defaultRadius( 300, 300, 300 ), m_center( 0, 0, 0 ), m_useCenterKey( false ){
m_changed();
SceneChangeNotify();
}
-typedef MemberCaller1<Doom3LightRadius, const char*, &Doom3LightRadius::lightRadiusChanged> LightRadiusChangedCaller;
+typedef MemberCaller<Doom3LightRadius, void(const char*), &Doom3LightRadius::lightRadiusChanged> LightRadiusChangedCaller;
void lightCenterChanged( const char* value ){
m_useCenterKey = string_parse_vector3( value, m_center );
}
SceneChangeNotify();
}
-typedef MemberCaller1<Doom3LightRadius, const char*, &Doom3LightRadius::lightCenterChanged> LightCenterChangedCaller;
+typedef MemberCaller<Doom3LightRadius, void(const char*), &Doom3LightRadius::lightCenterChanged> LightCenterChangedCaller;
};
class RenderLightRadiiWire : public OpenGLRenderable
}
SceneChangeNotify();
}
-typedef MemberCaller1<LightShader, const char*, &LightShader::valueChanged> ValueChangedCaller;
+typedef MemberCaller<LightShader, void(const char*), &LightShader::valueChanged> ValueChangedCaller;
Shader* get() const {
return m_shader.get();
AABB m_aabb_light;
-Callback m_transformChanged;
-Callback m_boundsChanged;
-Callback m_evaluateTransform;
+Callback<void()> m_transformChanged;
+Callback<void()> m_boundsChanged;
+Callback<void()> m_evaluateTransform;
void construct(){
default_rotation( m_rotation );
m_aabb_light.origin = m_useLightOrigin ? m_lightOrigin : m_originKey.m_origin;
updateOrigin();
}
-typedef MemberCaller<Light, &Light::originChanged> OriginChangedCaller;
+typedef MemberCaller<Light, void(), &Light::originChanged> OriginChangedCaller;
void lightOriginChanged( const char* value ){
m_useLightOrigin = !string_empty( value );
}
originChanged();
}
-typedef MemberCaller1<Light, const char*, &Light::lightOriginChanged> LightOriginChangedCaller;
+typedef MemberCaller<Light, void(const char*), &Light::lightOriginChanged> LightOriginChangedCaller;
void lightTargetChanged( const char* value ){
m_useLightTarget = !string_empty( value );
}
projectionChanged();
}
-typedef MemberCaller1<Light, const char*, &Light::lightTargetChanged> LightTargetChangedCaller;
+typedef MemberCaller<Light, void(const char*), &Light::lightTargetChanged> LightTargetChangedCaller;
void lightUpChanged( const char* value ){
m_useLightUp = !string_empty( value );
if ( m_useLightUp ) {
}
projectionChanged();
}
-typedef MemberCaller1<Light, const char*, &Light::lightUpChanged> LightUpChangedCaller;
+typedef MemberCaller<Light, void(const char*), &Light::lightUpChanged> LightUpChangedCaller;
void lightRightChanged( const char* value ){
m_useLightRight = !string_empty( value );
if ( m_useLightRight ) {
}
projectionChanged();
}
-typedef MemberCaller1<Light, const char*, &Light::lightRightChanged> LightRightChangedCaller;
+typedef MemberCaller<Light, void(const char*), &Light::lightRightChanged> LightRightChangedCaller;
void lightStartChanged( const char* value ){
m_useLightStart = !string_empty( value );
if ( m_useLightStart ) {
}
projectionChanged();
}
-typedef MemberCaller1<Light, const char*, &Light::lightStartChanged> LightStartChangedCaller;
+typedef MemberCaller<Light, void(const char*), &Light::lightStartChanged> LightStartChangedCaller;
void lightEndChanged( const char* value ){
m_useLightEnd = !string_empty( value );
if ( m_useLightEnd ) {
}
projectionChanged();
}
-typedef MemberCaller1<Light, const char*, &Light::lightEndChanged> LightEndChangedCaller;
+typedef MemberCaller<Light, void(const char*), &Light::lightEndChanged> LightEndChangedCaller;
void writeLightOrigin(){
write_origin( m_lightOrigin, &m_entity, "light_origin" );
rotation_assign( m_rotation, m_useLightRotation ? m_lightRotation : m_rotationKey.m_rotation );
GlobalSelectionSystem().pivotChanged();
}
-typedef MemberCaller<Light, &Light::rotationChanged> RotationChangedCaller;
+typedef MemberCaller<Light, void(), &Light::rotationChanged> RotationChangedCaller;
void lightRotationChanged( const char* value ){
m_useLightRotation = !string_empty( value );
}
rotationChanged();
}
-typedef MemberCaller1<Light, const char*, &Light::lightRotationChanged> LightRotationChangedCaller;
+typedef MemberCaller<Light, void(const char*), &Light::lightRotationChanged> LightRotationChangedCaller;
public:
-Light( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) :
+Light( EntityClass* eclass, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& boundsChanged, const Callback<void()>& evaluateTransform ) :
m_entity( eclass ),
m_originKey( OriginChangedCaller( *this ) ),
m_rotationKey( RotationChangedCaller( *this ) ),
- m_colour( Callback() ),
+ m_colour( Callback<void()>() ),
m_filter( m_entity, node ),
m_named( m_entity ),
m_nameKeys( m_entity ),
m_evaluateTransform( evaluateTransform ){
construct();
}
-Light( const Light& other, scene::Node& node, const Callback& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) :
+Light( const Light& other, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& boundsChanged, const Callback<void()>& evaluateTransform ) :
m_entity( other.m_entity ),
m_originKey( OriginChangedCaller( *this ) ),
m_rotationKey( RotationChangedCaller( *this ) ),
- m_colour( Callback() ),
+ m_colour( Callback<void()>() ),
m_filter( m_entity, node ),
m_named( m_entity ),
m_nameKeys( m_entity ),
m_evaluateTransform();
updateOrigin();
}
-typedef MemberCaller<Light, &Light::transformChanged> TransformChangedCaller;
+typedef MemberCaller<Light, void(), &Light::transformChanged> TransformChangedCaller;
mutable Matrix4 m_localPivot;
const Matrix4& getLocalPivot() const {
return m_localPivot;
}
-void setLightChangedCallback( const Callback& callback ){
+void setLightChangedCallback( const Callback<void()>& callback ){
m_doom3Radius.m_changed = callback;
}
StaticRenderableConnectionLines::instance().detach( *this );
if ( g_lightType == LIGHTTYPE_DOOM3 ) {
- m_contained.setLightChangedCallback( Callback() );
+ m_contained.setLightChangedCallback( Callback<void()>() );
GlobalShaderCache().detach( *this );
}
GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable );
GlobalSelectionSystem().onComponentSelection( *this, selectable );
}
-typedef MemberCaller1<LightInstance, const Selectable&, &LightInstance::selectedChangedComponent> SelectedChangedComponentCaller;
+typedef MemberCaller<LightInstance, void(const Selectable&), &LightInstance::selectedChangedComponent> SelectedChangedComponentCaller;
void evaluateTransform(){
if ( getType() == TRANSFORM_PRIMITIVE ) {
evaluateTransform();
m_contained.freezeTransform();
}
-typedef MemberCaller<LightInstance, &LightInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<LightInstance, void(), &LightInstance::applyTransform> ApplyTransformCaller;
void lightChanged(){
GlobalShaderCache().changed( *this );
}
-typedef MemberCaller<LightInstance, &LightInstance::lightChanged> LightChangedCaller;
+typedef MemberCaller<LightInstance, void(), &LightInstance::lightChanged> LightChangedCaller;
Shader* getShader() const {
return m_contained.getShader();
RenderablePivot m_renderOrigin;
RenderableNamedEntity m_renderName;
-Callback m_transformChanged;
-Callback m_evaluateTransform;
+Callback<void()> m_transformChanged;
+Callback<void()> m_evaluateTransform;
void construct(){
m_keyObservers.insert( "classname", ClassnameFilter::ClassnameChangedCaller( m_filter ) );
m_origin = m_originKey.m_origin;
updateTransform();
}
-typedef MemberCaller<MiscModel, &MiscModel::originChanged> OriginChangedCaller;
+typedef MemberCaller<MiscModel, void(), &MiscModel::originChanged> OriginChangedCaller;
void anglesChanged(){
m_angles = m_anglesKey.m_angles;
updateTransform();
}
-typedef MemberCaller<MiscModel, &MiscModel::anglesChanged> AnglesChangedCaller;
+typedef MemberCaller<MiscModel, void(), &MiscModel::anglesChanged> AnglesChangedCaller;
void scaleChanged(){
m_scale = m_scaleKey.m_scale;
updateTransform();
}
-typedef MemberCaller<MiscModel, &MiscModel::scaleChanged> ScaleChangedCaller;
+typedef MemberCaller<MiscModel, void(), &MiscModel::scaleChanged> ScaleChangedCaller;
public:
-MiscModel( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+MiscModel( EntityClass* eclass, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( eclass ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_evaluateTransform( evaluateTransform ){
construct();
}
-MiscModel( const MiscModel& other, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) :
+MiscModel( const MiscModel& other, scene::Node& node, const Callback<void()>& transformChanged, const Callback<void()>& evaluateTransform ) :
m_entity( other.m_entity ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
m_evaluateTransform();
updateTransform();
}
-typedef MemberCaller<MiscModel, &MiscModel::transformChanged> TransformChangedCaller;
+typedef MemberCaller<MiscModel, void(), &MiscModel::transformChanged> TransformChangedCaller;
};
class MiscModelInstance : public TargetableInstance, public TransformModifier, public Renderable
evaluateTransform();
m_contained.freezeTransform();
}
-typedef MemberCaller<MiscModelInstance, &MiscModelInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<MiscModelInstance, void(), &MiscModelInstance::applyTransform> ApplyTransformCaller;
};
class MiscModelNode :
ResourceReference m_resource;
scene::Traversable& m_traverse;
scene::Node* m_node;
-Callback m_modelChanged;
+Callback<void()> m_modelChanged;
public:
-EModel( scene::Traversable& traversable, const Callback& modelChanged )
+EModel( scene::Traversable& traversable, const Callback<void()>& modelChanged )
: m_resource( "" ), m_traverse( traversable ), m_node( 0 ), m_modelChanged( modelChanged ){
m_resource.attach( *this );
}
m_resource.attach( *this );
m_modelChanged();
}
-typedef MemberCaller1<EModel, const char*, &EModel::modelChanged> ModelChangedCaller;
+typedef MemberCaller<EModel, void(const char*), &EModel::modelChanged> ModelChangedCaller;
const char* getName() const {
return m_resource.getName();
EModel m_model;
public:
SingletonModel()
- : m_model( m_traverse, Callback() ){
+ : m_model( m_traverse, Callback<void()>() ){
}
void attach( scene::Traversable::Observer* observer ){
void modelChanged( const char* value ){
m_model.modelChanged( value );
}
-typedef MemberCaller1<SingletonModel, const char*, &SingletonModel::modelChanged> ModelChangedCaller;
+typedef MemberCaller<SingletonModel, void(const char*), &SingletonModel::modelChanged> ModelChangedCaller;
scene::Node* getNode() const {
return m_model.getNode();
{
CopiedString m_name;
ModelSkin* m_skin;
-Callback m_skinChangedCallback;
+Callback<void()> m_skinChangedCallback;
ModelSkinKey( const ModelSkinKey& );
ModelSkinKey operator=( const ModelSkinKey& );
}
public:
-ModelSkinKey( const Callback& skinChangedCallback ) : m_skinChangedCallback( skinChangedCallback ){
+ModelSkinKey( const Callback<void()>& skinChangedCallback ) : m_skinChangedCallback( skinChangedCallback ){
construct();
}
~ModelSkinKey(){
parseTextureName( m_name, value );
construct();
}
-typedef MemberCaller1<ModelSkinKey, const char*, &ModelSkinKey::skinChanged> SkinChangedCaller;
+typedef MemberCaller<ModelSkinKey, void(const char*), &ModelSkinKey::skinChanged> SkinChangedCaller;
void realise(){
m_skinChangedCallback();
}
m_name = value;
}
-typedef MemberCaller1<NamedEntity, const char*, &NamedEntity::identifierChanged> IdentifierChangedCaller;
+typedef MemberCaller<NamedEntity, void(const char*), &NamedEntity::identifierChanged> IdentifierChangedCaller;
};
class RenderableNamedEntity : public OpenGLRenderable
};
-typedef MemberCaller1<EntityKeyValue, const char*, &EntityKeyValue::assign> KeyValueAssignCaller;
-typedef MemberCaller1<EntityKeyValue, const KeyObserver&, &EntityKeyValue::attach> KeyValueAttachCaller;
-typedef MemberCaller1<EntityKeyValue, const KeyObserver&, &EntityKeyValue::detach> KeyValueDetachCaller;
+typedef MemberCaller<EntityKeyValue, void(const char*), &EntityKeyValue::assign> KeyValueAssignCaller;
+typedef MemberCaller<EntityKeyValue, void(const KeyObserver&), &EntityKeyValue::attach> KeyValueAttachCaller;
+typedef MemberCaller<EntityKeyValue, void(const KeyObserver&), &EntityKeyValue::detach> KeyValueDetachCaller;
class NameKeys : public Entity::Observer, public Namespaced
{
class OriginKey
{
-Callback m_originChanged;
+Callback<void()> m_originChanged;
public:
Vector3 m_origin;
-OriginKey( const Callback& originChanged )
+OriginKey( const Callback<void()>& originChanged )
: m_originChanged( originChanged ), m_origin( ORIGINKEY_IDENTITY ){
}
read_origin( m_origin, value );
m_originChanged();
}
-typedef MemberCaller1<OriginKey, const char*, &OriginKey::originChanged> OriginChangedCaller;
+typedef MemberCaller<OriginKey, void(const char*), &OriginKey::originChanged> OriginChangedCaller;
void write( Entity* entity ) const {
class RotationKey
{
-Callback m_rotationChanged;
+Callback<void()> m_rotationChanged;
public:
Float9 m_rotation;
-RotationKey( const Callback& rotationChanged )
+RotationKey( const Callback<void()>& rotationChanged )
: m_rotationChanged( rotationChanged ){
default_rotation( m_rotation );
}
read_angle( m_rotation, value );
m_rotationChanged();
}
-typedef MemberCaller1<RotationKey, const char*, &RotationKey::angleChanged> AngleChangedCaller;
+typedef MemberCaller<RotationKey, void(const char*), &RotationKey::angleChanged> AngleChangedCaller;
void rotationChanged( const char* value ){
read_rotation( m_rotation, value );
m_rotationChanged();
}
-typedef MemberCaller1<RotationKey, const char*, &RotationKey::rotationChanged> RotationChangedCaller;
+typedef MemberCaller<RotationKey, void(const char*), &RotationKey::rotationChanged> RotationChangedCaller;
void write( Entity* entity ) const {
Vector3 euler = matrix4_get_rotation_euler_xyz_degrees( rotation_toMatrix( m_rotation ) );
class ScaleKey
{
-Callback m_scaleChanged;
+Callback<void()> m_scaleChanged;
public:
Vector3 m_scale;
-ScaleKey( const Callback& scaleChanged )
+ScaleKey( const Callback<void()>& scaleChanged )
: m_scaleChanged( scaleChanged ), m_scale( SCALEKEY_IDENTITY ){
}
read_scale( m_scale, value );
m_scaleChanged();
}
-typedef MemberCaller1<ScaleKey, const char*, &ScaleKey::uniformScaleChanged> UniformScaleChangedCaller;
+typedef MemberCaller<ScaleKey, void(const char*), &ScaleKey::uniformScaleChanged> UniformScaleChangedCaller;
void scaleChanged( const char* value ){
read_scalevec( m_scale, value );
m_scaleChanged();
}
-typedef MemberCaller1<ScaleKey, const char*, &ScaleKey::scaleChanged> ScaleChangedCaller;
+typedef MemberCaller<ScaleKey, void(const char*), &ScaleKey::scaleChanged> ScaleChangedCaller;
void write( Entity* entity ) const {
write_scale( m_scale, entity );
}
}
-typedef MemberCaller1<GlobalSkins, const char*, &GlobalSkins::parseFile> ParseFileCaller;
+typedef MemberCaller<GlobalSkins, void(const char*), &GlobalSkins::parseFile> ParseFileCaller;
void construct(){
GlobalFileSystem().forEachFile( "skins/", "skin", ParseFileCaller( *this ) );
m_targets = getTargetables( name );
construct();
}
-typedef MemberCaller1<TargetedEntity, const char*, &TargetedEntity::targetnameChanged> TargetnameChangedCaller;
+typedef MemberCaller<TargetedEntity, void(const char*), &TargetedEntity::targetnameChanged> TargetnameChangedCaller;
};
void targetChanged( const char* target ){
m_targets = getTargetables( target );
}
-typedef MemberCaller1<TargetingEntity, const char*, &TargetingEntity::targetChanged> TargetChangedCaller;
+typedef MemberCaller<TargetingEntity, void(const char*), &TargetingEntity::targetChanged> TargetChangedCaller;
typedef targetables_t::iterator iterator;
class TargetKeys : public Entity::Observer
{
TargetingEntities m_targetingEntities;
-Callback m_targetsChanged;
+Callback<void()> m_targetsChanged;
bool readTargetKey( const char* key, std::size_t& index ){
if ( string_equal_n( key, "target", 6 ) ) {
return false;
}
public:
-void setTargetsChanged( const Callback& targetsChanged ){
+void setTargetsChanged( const Callback<void()>& targetsChanged ){
m_targetsChanged = targetsChanged;
}
void targetsChanged(){
m_entity.detach( *this );
}
-void setTargetsChanged( const Callback& targetsChanged ){
+void setTargetsChanged( const Callback<void()>& targetsChanged ){
m_targeting.setTargetsChanged( targetsChanged );
}
void targetsChanged(){
AABB m_aabb_local;
public:
-Callback m_lightsChanged;
+Callback<void()> m_lightsChanged;
~Model(){
for ( surfaces_t::iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i )
void lightsChanged(){
m_lightList->lightsChanged();
}
-typedef MemberCaller<ModelInstance, &ModelInstance::lightsChanged> LightsChangedCaller;
+typedef MemberCaller<ModelInstance, void(), &ModelInstance::lightsChanged> LightsChangedCaller;
void constructRemaps(){
ModelSkin* skin = NodeTypeCast<ModelSkin>::cast( path().parent() );
~ModelInstance(){
destroyRemaps();
- Instance::setTransformChangedCallback( Callback() );
+ Instance::setTransformChangedCallback( Callback<void()>() );
- m_model.m_lightsChanged = Callback();
+ m_model.m_lightsChanged = Callback<void()>();
GlobalShaderCache().detach( *this );
}
AABB m_aabb_local;
public:
-Callback m_lightsChanged;
+Callback<void()> m_lightsChanged;
PicoModel(){
constructNull();
void lightsChanged(){
m_lightList->lightsChanged();
}
-typedef MemberCaller<PicoModelInstance, &PicoModelInstance::lightsChanged> LightsChangedCaller;
+typedef MemberCaller<PicoModelInstance, void(), &PicoModelInstance::lightsChanged> LightsChangedCaller;
void constructRemaps(){
ASSERT_MESSAGE( m_skins.size() == m_picomodel.size(), "ERROR" );
~PicoModelInstance(){
destroyRemaps();
- Instance::setTransformChangedCallback( Callback() );
+ Instance::setTransformChangedCallback( Callback<void()>() );
- m_picomodel.m_lightsChanged = Callback();
+ m_picomodel.m_lightsChanged = Callback<void()>();
GlobalShaderCache().detach( *this );
}
bool ActiveShaders_IteratorAtEnd();
IShader *ActiveShaders_IteratorCurrent();
void ActiveShaders_IteratorIncrement();
-Callback g_ActiveShadersChangedNotify;
+Callback<void()> g_ActiveShadersChangedNotify;
void FreeShaders();
void LoadShaderFile( const char *filename );
}
}
-typedef FreeCaller1<const char*, LoadShaderFile> LoadShaderFileCaller;
+typedef FreeCaller<void(const char*), LoadShaderFile> LoadShaderFileCaller;
void loadGuideFile( const char* filename ){
}
}
-typedef FreeCaller1<const char*, loadGuideFile> LoadGuideFileCaller;
+typedef FreeCaller<void(const char*), loadGuideFile> LoadGuideFileCaller;
CShader* Try_Shader_ForName( const char* name ){
globalOutputStream() << "\t" << filename << "\n";
}
}
-typedef ReferenceCaller1<bool, const char*, IfFound_dumpUnreferencedShader> IfFoundDumpUnreferencedShaderCaller;
+typedef ReferenceCaller<bool, void(const char*), IfFound_dumpUnreferencedShader> IfFoundDumpUnreferencedShaderCaller;
void DumpUnreferencedShaders(){
bool bFound = false;
}
}
-typedef FreeCaller1<const char*, ShaderList_addShaderFile> AddShaderFileCaller;
+typedef FreeCaller<void(const char*), ShaderList_addShaderFile> AddShaderFileCaller;
/*
}
}
-typedef FreeCaller1<const char *, ShaderList_addFromArchive> AddShaderListFromArchiveCaller;
+typedef FreeCaller<void(const char *), ShaderList_addFromArchive> AddShaderListFromArchiveCaller;
#include "stream/filestream.h"
void incrementActiveShadersIterator(){
ActiveShaders_IteratorIncrement();
}
-void setActiveShadersChangedNotify( const Callback& notify ){
+void setActiveShadersChangedNotify( const Callback<void()>& notify ){
g_ActiveShadersChangedNotify = notify;
}
Autosave_constructPreferences( page );
}
void Autosave_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Autosave_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Autosave_constructPage>() );
}
AABB m_aabb_local;
// ----
-Callback m_evaluateTransform;
-Callback m_boundsChanged;
+Callback<void()> m_evaluateTransform;
+Callback<void()> m_boundsChanged;
mutable bool m_planeChanged; // b-rep evaluation required
mutable bool m_transformChanged; // transform evaluation required
public:
STRING_CONSTANT( Name, "Brush" );
-Callback m_lightsChanged;
+Callback<void()> m_lightsChanged;
// static data
static Shader* m_state_point;
static EBrushType m_type;
static double m_maxWorldCoord;
-Brush( scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged ) :
+Brush( scene::Node& node, const Callback<void()>& evaluateTransform, const Callback<void()>& boundsChanged ) :
m_node( &node ),
m_undoable_observer( 0 ),
m_map( 0 ),
m_transformChanged( false ){
planeChanged();
}
-Brush( const Brush& other, scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged ) :
+Brush( const Brush& other, scene::Node& node, const Callback<void()>& evaluateTransform, const Callback<void()>& boundsChanged ) :
m_node( &node ),
m_undoable_observer( 0 ),
m_map( 0 ),
m_transformChanged = true;
planeChanged();
}
-typedef MemberCaller<Brush, &Brush::transformChanged> TransformChangedCaller;
+typedef MemberCaller<Brush, void(), &Brush::transformChanged> TransformChangedCaller;
void evaluateTransform(){
if ( m_transformChanged ) {
}
m_selectionChanged( selectable );
}
-typedef MemberCaller1<FaceInstance, const Selectable&, &FaceInstance::selectedChanged> SelectedChangedCaller;
+typedef MemberCaller<FaceInstance, void(const Selectable&), &FaceInstance::selectedChanged> SelectedChangedCaller;
bool selectedVertices() const {
return !m_vertexSelection.empty();
void lightsChanged(){
m_lightList->lightsChanged();
}
-typedef MemberCaller<BrushInstance, &BrushInstance::lightsChanged> LightsChangedCaller;
+typedef MemberCaller<BrushInstance, void(), &BrushInstance::lightsChanged> LightsChangedCaller;
STRING_CONSTANT( Name, "BrushInstance" );
Instance::setTransformChangedCallback( LightsChangedCaller( *this ) );
}
~BrushInstance(){
- Instance::setTransformChangedCallback( Callback() );
+ Instance::setTransformChangedCallback( Callback<void()>() );
- m_brush.m_lightsChanged = Callback();
+ m_brush.m_lightsChanged = Callback<void()>();
GlobalShaderCache().detach( *this );
m_counter->decrement();
Instance::selectedChanged();
}
-typedef MemberCaller1<BrushInstance, const Selectable&, &BrushInstance::selectedChanged> SelectedChangedCaller;
+typedef MemberCaller<BrushInstance, void(const Selectable&), &BrushInstance::selectedChanged> SelectedChangedCaller;
void selectedChangedComponent( const Selectable& selectable ){
GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable );
GlobalSelectionSystem().onComponentSelection( *this, selectable );
}
-typedef MemberCaller1<BrushInstance, const Selectable&, &BrushInstance::selectedChangedComponent> SelectedChangedComponentCaller;
+typedef MemberCaller<BrushInstance, void(const Selectable&), &BrushInstance::selectedChangedComponent> SelectedChangedComponentCaller;
const BrushInstanceVisitor& forEachFaceInstance( const BrushInstanceVisitor& visitor ){
for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i )
evaluateTransform();
m_brush.freezeTransform();
}
-typedef MemberCaller<BrushInstance, &BrushInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<BrushInstance, void(), &BrushInstance::applyTransform> ApplyTransformCaller;
void setClipPlane( const Plane3& plane ){
m_clipPlane.setPlane( m_brush, plane );
void set(){
Scene_BrushConstructPrefab( GlobalSceneGraph(), eBrushPrism, m_count, TextureBrowser_GetSelectedShader( GlobalTextureBrowser() ) );
}
-typedef MemberCaller<BrushMakeSided, &BrushMakeSided::set> SetCaller;
+typedef MemberCaller<BrushMakeSided, void(), &BrushMakeSided::set> SetCaller;
};
void set(){
DoSides( m_type, axis_for_viewtype( GetViewAxis() ) );
}
-typedef MemberCaller<BrushPrefab, &BrushPrefab::set> SetCaller;
+typedef MemberCaller<BrushPrefab, void(), &BrushPrefab::set> SetCaller;
};
BrushPrefab g_brushprism( eBrushPrism );
}
-Callback g_texture_lock_status_changed;
+Callback<void()> g_texture_lock_status_changed;
BoolExportCaller g_texdef_movelock_caller( g_brush_texturelock_enabled );
ToggleItem g_texdef_movelock_item( g_texdef_movelock_caller );
void Brush_registerCommands(){
- GlobalToggles_insert( "TogTexLock", FreeCaller<Texdef_ToggleMoveLock>(), ToggleItem::AddCallbackCaller( g_texdef_movelock_item ), Accelerator( 'T', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalToggles_insert( "TogTexLock", FreeCaller<void(), Texdef_ToggleMoveLock>(), ToggleItem::AddCallbackCaller( g_texdef_movelock_item ), Accelerator( 'T', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalCommands_insert( "BrushPrism", BrushPrefab::SetCaller( g_brushprism ) );
GlobalCommands_insert( "BrushCone", BrushPrefab::SetCaller( g_brushcone ) );
GlobalCommands_insert( "Brush8Sided", BrushMakeSided::SetCaller( g_brushmakesided8 ), Accelerator( '8', (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "Brush9Sided", BrushMakeSided::SetCaller( g_brushmakesided9 ), Accelerator( '9', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "ClipSelected", FreeCaller<ClipSelected>(), Accelerator( GDK_KEY_Return ) );
- GlobalCommands_insert( "SplitSelected", FreeCaller<SplitSelected>(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "FlipClip", FreeCaller<FlipClipper>(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "ClipSelected", FreeCaller<void(), ClipSelected>(), Accelerator( GDK_KEY_Return ) );
+ GlobalCommands_insert( "SplitSelected", FreeCaller<void(), SplitSelected>(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "FlipClip", FreeCaller<void(), FlipClipper>(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "MakeDetail", FreeCaller<Select_MakeDetail>(), Accelerator( 'M', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "MakeStructural", FreeCaller<Select_MakeStructural>(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "MakeDetail", FreeCaller<void(), Select_MakeDetail>(), Accelerator( 'M', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "MakeStructural", FreeCaller<void(), Select_MakeStructural>(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
}
void Brush_constructMenu( ui::Menu menu ){
void Brush_constructMenu( ui::Menu menu );
-extern Callback g_texture_lock_status_changed;
+extern Callback<void()> g_texture_lock_status_changed;
void BrushFilters_construct();
void Brush_registerCommands();
void Face_importSnapPlanes( bool value ){
Face::m_quantise = value ? quantiseInteger : quantiseFloating;
}
-typedef FreeCaller1<bool, Face_importSnapPlanes> FaceImportSnapPlanesCaller;
+typedef FreeCaller<void(bool), Face_importSnapPlanes> FaceImportSnapPlanesCaller;
void Face_exportSnapPlanes( const BoolImportCallback& importer ){
importer( Face::m_quantise == quantiseInteger );
}
-typedef FreeCaller1<const BoolImportCallback&, Face_exportSnapPlanes> FaceExportSnapPlanesCaller;
+typedef FreeCaller<void(const BoolImportCallback&), Face_exportSnapPlanes> FaceExportSnapPlanesCaller;
void Brush_constructPreferences( PreferencesPage& page ){
page.appendCheckBox(
Brush_constructPreferences( page );
}
void Brush_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Brush_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Brush_constructPage>() );
}
void Brush_unlatchPreferences(){
GlobalPreferenceSystem().registerPreference( "TexdefDefaultScale", FloatImportStringCaller( g_texdef_default_scale ), FloatExportStringCaller( g_texdef_default_scale ) );
GridStatus_getTextureLockEnabled = getTextureLockEnabled;
- g_texture_lock_status_changed = FreeCaller<GridStatus_onTextureLockEnabledChanged>();
+ g_texture_lock_status_changed = FreeCaller<void(), GridStatus_onTextureLockEnabledChanged>();
}
void Brush_Destroy(){
faceData.value = face.getShader().m_flags.m_value;
callback( faceData );
}
-typedef ConstReferenceCaller1<BrushFaceDataCallback, Face&, BrushFaceData_fromFace> BrushFaceDataFromFaceCaller;
-typedef Callback1<Face&> FaceCallback;
+typedef ConstReferenceCaller<BrushFaceDataCallback, void(Face&), BrushFaceData_fromFace> BrushFaceDataFromFaceCaller;
+typedef Callback<void(Face&)> FaceCallback;
class Quake3BrushCreator : public BrushCreator
{
void run(){
RunBSP( m_name );
}
-typedef MemberCaller<BuildMenuItem, &BuildMenuItem::run> RunCaller;
+typedef MemberCaller<BuildMenuItem, void(), &BuildMenuItem::run> RunCaller;
};
typedef std::list<BuildMenuItem> BuildMenuItems;
}
View* m_view;
- Callback m_update;
+ Callback<void()> m_update;
static camera_draw_mode draw_mode;
- camera_t( View* view, const Callback& update )
+ camera_t( View* view, const Callback<void()>& update )
: width( 0 ),
height( 0 ),
timing( false ),
}
-typedef ReferenceCaller<camera_t, &Camera_MoveForward_KeyDown> FreeMoveCameraMoveForwardKeyDownCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveForward_KeyUp> FreeMoveCameraMoveForwardKeyUpCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveBack_KeyDown> FreeMoveCameraMoveBackKeyDownCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveBack_KeyUp> FreeMoveCameraMoveBackKeyUpCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveLeft_KeyDown> FreeMoveCameraMoveLeftKeyDownCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveLeft_KeyUp> FreeMoveCameraMoveLeftKeyUpCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveRight_KeyDown> FreeMoveCameraMoveRightKeyDownCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveRight_KeyUp> FreeMoveCameraMoveRightKeyUpCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveUp_KeyDown> FreeMoveCameraMoveUpKeyDownCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveUp_KeyUp> FreeMoveCameraMoveUpKeyUpCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveDown_KeyDown> FreeMoveCameraMoveDownKeyDownCaller;
-typedef ReferenceCaller<camera_t, &Camera_MoveDown_KeyUp> FreeMoveCameraMoveDownKeyUpCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveForward_KeyDown> FreeMoveCameraMoveForwardKeyDownCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveForward_KeyUp> FreeMoveCameraMoveForwardKeyUpCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveBack_KeyDown> FreeMoveCameraMoveBackKeyDownCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveBack_KeyUp> FreeMoveCameraMoveBackKeyUpCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveLeft_KeyDown> FreeMoveCameraMoveLeftKeyDownCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveLeft_KeyUp> FreeMoveCameraMoveLeftKeyUpCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveRight_KeyDown> FreeMoveCameraMoveRightKeyDownCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveRight_KeyUp> FreeMoveCameraMoveRightKeyUpCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveUp_KeyDown> FreeMoveCameraMoveUpKeyDownCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveUp_KeyUp> FreeMoveCameraMoveUpKeyUpCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveDown_KeyDown> FreeMoveCameraMoveDownKeyDownCaller;
+typedef ReferenceCaller<camera_t, void(), &Camera_MoveDown_KeyUp> FreeMoveCameraMoveDownKeyUpCaller;
const float SPEED_MOVE = 32;
{
camera_t& m_camera;
View* m_view;
-Callback m_update;
+Callback<void()> m_update;
public:
-RadiantCameraView( camera_t& camera, View* view, const Callback& update ) : m_camera( camera ), m_view( view ), m_update( update ){
+RadiantCameraView( camera_t& camera, View* view, const Callback<void()>& update ) : m_camera( camera ), m_view( view ), m_update( update ){
}
void update(){
m_view->Construct( m_camera.projection, m_camera.modelview, m_camera.width, m_camera.height );
void Cam_Draw();
};
-typedef MemberCaller<CamWnd, &CamWnd::queue_draw> CamWndQueueDraw;
+typedef MemberCaller<CamWnd, void(), &CamWnd::queue_draw> CamWndQueueDraw;
Shader* CamWnd::m_state_select1 = 0;
Shader* CamWnd::m_state_select2 = 0;
void CamWnd_registerCommands( CamWnd& camwnd ){
GlobalKeyEvents_insert( "CameraForward", Accelerator( GDK_KEY_Up ),
- ReferenceCaller<camera_t, Camera_MoveForward_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_MoveForward_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_MoveForward_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_MoveForward_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraBack", Accelerator( GDK_KEY_Down ),
- ReferenceCaller<camera_t, Camera_MoveBack_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_MoveBack_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_MoveBack_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_MoveBack_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraLeft", Accelerator( GDK_KEY_Left ),
- ReferenceCaller<camera_t, Camera_RotateLeft_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_RotateLeft_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_RotateLeft_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_RotateLeft_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraRight", Accelerator( GDK_KEY_Right ),
- ReferenceCaller<camera_t, Camera_RotateRight_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_RotateRight_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_RotateRight_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_RotateRight_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraStrafeRight", Accelerator( GDK_KEY_period ),
- ReferenceCaller<camera_t, Camera_MoveRight_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_MoveRight_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_MoveRight_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_MoveRight_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraStrafeLeft", Accelerator( GDK_KEY_comma ),
- ReferenceCaller<camera_t, Camera_MoveLeft_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_MoveLeft_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_MoveLeft_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_MoveLeft_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraUp", Accelerator( 'D' ),
- ReferenceCaller<camera_t, Camera_MoveUp_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_MoveUp_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_MoveUp_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_MoveUp_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraDown", Accelerator( 'C' ),
- ReferenceCaller<camera_t, Camera_MoveDown_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_MoveDown_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_MoveDown_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_MoveDown_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraAngleDown", Accelerator( 'A' ),
- ReferenceCaller<camera_t, Camera_PitchDown_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_PitchDown_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_PitchDown_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_PitchDown_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraAngleUp", Accelerator( 'Z' ),
- ReferenceCaller<camera_t, Camera_PitchUp_KeyDown>( camwnd.getCamera() ),
- ReferenceCaller<camera_t, Camera_PitchUp_KeyUp>( camwnd.getCamera() )
+ ReferenceCaller<camera_t, void(), Camera_PitchUp_KeyDown>( camwnd.getCamera() ),
+ ReferenceCaller<camera_t, void(), Camera_PitchUp_KeyUp>( camwnd.getCamera() )
);
GlobalKeyEvents_insert( "CameraFreeMoveForward", Accelerator( GDK_KEY_Up ),
FreeMoveCameraMoveDownKeyUpCaller( camwnd.getCamera() )
);
- GlobalCommands_insert( "CameraForward", ReferenceCaller<camera_t, Camera_MoveForward_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Up ) );
- GlobalCommands_insert( "CameraBack", ReferenceCaller<camera_t, Camera_MoveBack_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Down ) );
- GlobalCommands_insert( "CameraLeft", ReferenceCaller<camera_t, Camera_RotateLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Left ) );
- GlobalCommands_insert( "CameraRight", ReferenceCaller<camera_t, Camera_RotateRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Right ) );
- GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller<camera_t, Camera_MoveRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_period ) );
- GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller<camera_t, Camera_MoveLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_comma ) );
+ GlobalCommands_insert( "CameraForward", ReferenceCaller<camera_t, void(), Camera_MoveForward_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Up ) );
+ GlobalCommands_insert( "CameraBack", ReferenceCaller<camera_t, void(), Camera_MoveBack_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Down ) );
+ GlobalCommands_insert( "CameraLeft", ReferenceCaller<camera_t, void(), Camera_RotateLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Left ) );
+ GlobalCommands_insert( "CameraRight", ReferenceCaller<camera_t, void(), Camera_RotateRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Right ) );
+ GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller<camera_t, void(), Camera_MoveRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_period ) );
+ GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller<camera_t, void(), Camera_MoveLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_comma ) );
- GlobalCommands_insert( "CameraUp", ReferenceCaller<camera_t, Camera_MoveUp_Discrete>( camwnd.getCamera() ), Accelerator( 'D' ) );
- GlobalCommands_insert( "CameraDown", ReferenceCaller<camera_t, Camera_MoveDown_Discrete>( camwnd.getCamera() ), Accelerator( 'C' ) );
- GlobalCommands_insert( "CameraAngleUp", ReferenceCaller<camera_t, Camera_PitchUp_Discrete>( camwnd.getCamera() ), Accelerator( 'A' ) );
- GlobalCommands_insert( "CameraAngleDown", ReferenceCaller<camera_t, Camera_PitchDown_Discrete>( camwnd.getCamera() ), Accelerator( 'Z' ) );
+ GlobalCommands_insert( "CameraUp", ReferenceCaller<camera_t, void(), Camera_MoveUp_Discrete>( camwnd.getCamera() ), Accelerator( 'D' ) );
+ GlobalCommands_insert( "CameraDown", ReferenceCaller<camera_t, void(), Camera_MoveDown_Discrete>( camwnd.getCamera() ), Accelerator( 'C' ) );
+ GlobalCommands_insert( "CameraAngleUp", ReferenceCaller<camera_t, void(), Camera_PitchUp_Discrete>( camwnd.getCamera() ), Accelerator( 'A' ) );
+ GlobalCommands_insert( "CameraAngleDown", ReferenceCaller<camera_t, void(), Camera_PitchDown_Discrete>( camwnd.getCamera() ), Accelerator( 'Z' ) );
}
void CamWnd_Move_Enable( CamWnd& camwnd ){
CamWnd::CamWnd() :
m_view( true ),
m_Camera( &m_view, CamWndQueueDraw( *this ) ),
- m_cameraview( m_Camera, &m_view, ReferenceCaller<CamWnd, CamWnd_Update>( *this ) ),
+ m_cameraview( m_Camera, &m_view, ReferenceCaller<CamWnd, void(), CamWnd_Update>( *this ) ),
m_gl_widget( glwidget_new( TRUE ) ),
m_window_observer( NewWindowObserver() ),
m_XORRectangle( m_gl_widget ),
GlobalWindowObservers_add( m_window_observer );
GlobalWindowObservers_connectWidget( m_gl_widget );
- m_window_observer->setRectangleDrawCallback( ReferenceCaller1<CamWnd, rect_t, camwnd_update_xor_rectangle>( *this ) );
+ m_window_observer->setRectangleDrawCallback( ReferenceCaller<CamWnd, void(rect_t), camwnd_update_xor_rectangle>( *this ) );
m_window_observer->setView( m_view );
g_object_ref( m_gl_widget._handle );
m_gl_widget.connect( "scroll_event", G_CALLBACK( wheelmove_scroll ), this );
- AddSceneChangeCallback( ReferenceCaller<CamWnd, CamWnd_Update>( *this ) );
+ AddSceneChangeCallback( ReferenceCaller<CamWnd, void(), CamWnd_Update>( *this ) );
PressedButtons_connect( g_pressedButtons, m_gl_widget );
}
void ShowStatsToggle(){
g_camwindow_globals_private.m_showStats ^= 1;
}
-typedef FreeCaller<ShowStatsToggle> ShowStatsToggleCaller;
+typedef FreeCaller<void(), ShowStatsToggle> ShowStatsToggleCaller;
void ShowStatsExport( const BoolImportCallback& importer ){
importer( g_camwindow_globals_private.m_showStats );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowStatsExport> ShowStatsExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowStatsExport> ShowStatsExportCaller;
ShowStatsExportCaller g_show_stats_caller;
BoolExportCallback g_show_stats_callback( g_show_stats_caller );
void CamWnd_LookThroughCamera( CamWnd& camwnd ){
if ( g_camera_model != 0 ) {
CamWnd_Add_Handlers_Move( camwnd );
- g_camera_model->setCameraView( 0, Callback() );
+ g_camera_model->setCameraView( 0, Callback<void()>() );
g_camera_model = 0;
Camera_updateModelview( camwnd.getCamera() );
Camera_updateProjection( camwnd.getCamera() );
if ( cameraModel != 0 ) {
CamWnd_Remove_Handlers_Move( camwnd );
g_camera_model = cameraModel;
- g_camera_model->setCameraView( &camwnd.getCameraView(), ReferenceCaller<CamWnd, CamWnd_LookThroughCamera>( camwnd ) );
+ g_camera_model->setCameraView( &camwnd.getCameraView(), ReferenceCaller<CamWnd, void(), CamWnd_LookThroughCamera>( camwnd ) );
}
}
}
CamWnd_SetMode( cd_texture );
}
}
-typedef FreeCaller1<int, RenderModeImport> RenderModeImportCaller;
+typedef FreeCaller<void(int), RenderModeImport> RenderModeImportCaller;
void RenderModeExport( const IntImportCallback& importer ){
switch ( CamWnd_GetMode() )
break;
}
}
-typedef FreeCaller1<const IntImportCallback&, RenderModeExport> RenderModeExportCaller;
+typedef FreeCaller<void(const IntImportCallback&), RenderModeExport> RenderModeExportCaller;
void Camera_constructPreferences( PreferencesPage& page ){
page.appendSlider( "Movement Speed", g_camwindow_globals_private.m_nMoveSpeed, TRUE, 0, 0, 100, MIN_CAM_SPEED, MAX_CAM_SPEED, 1, 10 );
page.appendCheckBox( "", "Invert mouse vertical axis", g_camwindow_globals_private.m_bCamInverseMouse );
page.appendCheckBox(
"", "Discrete movement",
- FreeCaller1<bool, CamWnd_Move_Discrete_Import>(),
+ FreeCaller<void(bool), CamWnd_Move_Discrete_Import>(),
BoolExportCaller( g_camwindow_globals_private.m_bCamDiscrete )
);
page.appendCheckBox(
"", "Enable far-clip plane",
- FreeCaller1<bool, Camera_SetFarClip>(),
+ FreeCaller<void(bool), Camera_SetFarClip>(),
BoolExportCaller( g_camwindow_globals_private.m_bCubicClipping )
);
Camera_constructPreferences( page );
}
void Camera_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Camera_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Camera_constructPage>() );
}
#include "preferencesystem.h"
#include "stringio.h"
#include "dialog.h"
-typedef FreeCaller1<bool, CamWnd_Move_Discrete_Import> CamWndMoveDiscreteImportCaller;
+typedef FreeCaller<void(bool), CamWnd_Move_Discrete_Import> CamWndMoveDiscreteImportCaller;
void CameraSpeed_increase(){
if ( g_camwindow_globals_private.m_nMoveSpeed <= ( MAX_CAM_SPEED - CAM_SPEED_STEP - 10 ) ) {
/// \brief Initialisation for things that have the same lifespan as this module.
void CamWnd_Construct(){
- GlobalCommands_insert( "CenterView", FreeCaller<GlobalCamera_ResetAngles>(), Accelerator( GDK_KEY_End ) );
+ GlobalCommands_insert( "CenterView", FreeCaller<void(), GlobalCamera_ResetAngles>(), Accelerator( GDK_KEY_End ) );
- GlobalToggles_insert( "ToggleCubicClip", FreeCaller<Camera_ToggleFarClip>(), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CubicClipZoomIn", FreeCaller<Camera_CubeIn>(), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CubicClipZoomOut", FreeCaller<Camera_CubeOut>(), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalToggles_insert( "ToggleCubicClip", FreeCaller<void(), Camera_ToggleFarClip>(), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CubicClipZoomIn", FreeCaller<void(), Camera_CubeIn>(), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CubicClipZoomOut", FreeCaller<void(), Camera_CubeOut>(), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "UpFloor", FreeCaller<Camera_ChangeFloorUp>(), Accelerator( GDK_KEY_Prior ) );
- GlobalCommands_insert( "DownFloor", FreeCaller<Camera_ChangeFloorDown>(), Accelerator( GDK_KEY_Next ) );
+ GlobalCommands_insert( "UpFloor", FreeCaller<void(), Camera_ChangeFloorUp>(), Accelerator( GDK_KEY_Prior ) );
+ GlobalCommands_insert( "DownFloor", FreeCaller<void(), Camera_ChangeFloorDown>(), Accelerator( GDK_KEY_Next ) );
GlobalToggles_insert( "ToggleCamera", ToggleShown::ToggleCaller( g_camera_shown ), ToggleItem::AddCallbackCaller( g_camera_shown.m_item ), Accelerator( 'C', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "LookThroughSelected", FreeCaller<GlobalCamera_LookThroughSelected>() );
- GlobalCommands_insert( "LookThroughCamera", FreeCaller<GlobalCamera_LookThroughCamera>() );
+ GlobalCommands_insert( "LookThroughSelected", FreeCaller<void(), GlobalCamera_LookThroughSelected>() );
+ GlobalCommands_insert( "LookThroughCamera", FreeCaller<void(), GlobalCamera_LookThroughCamera>() );
if ( g_pGameDescription->mGameType == "doom3" ) {
- GlobalCommands_insert( "TogglePreview", FreeCaller<CamWnd_TogglePreview>(), Accelerator( GDK_KEY_F3 ) );
+ GlobalCommands_insert( "TogglePreview", FreeCaller<void(), CamWnd_TogglePreview>(), Accelerator( GDK_KEY_F3 ) );
}
- GlobalCommands_insert( "CameraSpeedInc", FreeCaller<CameraSpeed_increase>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "CameraSpeedDec", FreeCaller<CameraSpeed_decrease>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CameraSpeedInc", FreeCaller<void(), CameraSpeed_increase>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CameraSpeedDec", FreeCaller<void(), CameraSpeed_decrease>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalShortcuts_insert( "CameraForward", Accelerator( GDK_KEY_Up ) );
GlobalShortcuts_insert( "CameraBack", Accelerator( GDK_KEY_Down ) );
Commands g_commands;
-void GlobalCommands_insert( const char* name, const Callback& callback, const Accelerator& accelerator ){
+void GlobalCommands_insert( const char* name, const Callback<void()>& callback, const Accelerator& accelerator ){
bool added = g_commands.insert( Commands::value_type( name, Command( callback, GlobalShortcuts_insert( name, accelerator ) ) ) ).second;
ASSERT_MESSAGE( added, "command already registered: " << makeQuoted( name ) );
}
Toggles g_toggles;
-void GlobalToggles_insert( const char* name, const Callback& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator ){
+void GlobalToggles_insert( const char* name, const Callback<void()>& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator ){
bool added = g_toggles.insert( Toggles::value_type( name, Toggle( callback, GlobalShortcuts_insert( name, accelerator ), exportCallback ) ) ).second;
ASSERT_MESSAGE( added, "toggle already registered: " << makeQuoted( name ) );
}
KeyEvents g_keyEvents;
-void GlobalKeyEvents_insert( const char* name, const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp ){
+void GlobalKeyEvents_insert( const char* name, const Accelerator& accelerator, const Callback<void()>& keyDown, const Callback<void()>& keyUp ){
bool added = g_keyEvents.insert( KeyEvents::value_type( name, KeyEvent( GlobalShortcuts_insert( name, accelerator ), keyDown, keyUp ) ) ).second;
ASSERT_MESSAGE( added, "command already registered: " << makeQuoted( name ) );
}
virtual void visit( const char* name, Accelerator& accelerator ) = 0;
};
-void GlobalCommands_insert( const char* name, const Callback& callback, const Accelerator& accelerator = accelerator_null() );
+void GlobalCommands_insert( const char* name, const Callback<void()>& callback, const Accelerator& accelerator = accelerator_null() );
const Command& GlobalCommands_find( const char* name );
-void GlobalToggles_insert( const char* name, const Callback& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator = accelerator_null() );
+void GlobalToggles_insert( const char* name, const Callback<void()>& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator = accelerator_null() );
const Toggle& GlobalToggles_find( const char* name );
-void GlobalKeyEvents_insert( const char* name, const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp );
+void GlobalKeyEvents_insert( const char* name, const Accelerator& accelerator, const Callback<void()>& keyDown, const Callback<void()>& keyUp );
const KeyEvent& GlobalKeyEvents_find( const char* name );
inline bool Face_testPlane( const Face& face, const Plane3& plane, bool flipped ){
return face.contributes() && !Winding_TestPlane( face.getWinding(), plane, flipped );
}
-typedef Function3<const Face&, const Plane3&, bool, bool, Face_testPlane> FaceTestPlane;
+typedef Function<bool(const Face&, const Plane3&, bool), Face_testPlane> FaceTestPlane;
typename Type_,
typename Other_,
void( *Import ) ( Type_&, Other_ ),
- void( *Export ) ( Type_&, const Callback1<Other_>& )
+ void( *Export ) ( Type_&, const Callback<void(Other_)>& )
>
class ImportExport
{
typedef Type_ Type;
typedef Other_ Other;
-typedef ReferenceCaller1<Type, Other, Import> ImportCaller;
-typedef ReferenceCaller1<Type, const Callback1<Other>&, Export> ExportCaller;
+typedef ReferenceCaller<Type, void(Other), Import> ImportCaller;
+typedef ReferenceCaller<Type, void(const Callback<void(Other)>&), Export> ExportCaller;
};
typedef ImportExport<bool, bool, BoolImport, BoolExport> BoolImportExport;
class CallbackDialogData : public DLG_DATA
{
public:
-typedef Callback1<FirstArgument> ImportCallback;
-typedef Callback1<const ImportCallback&> ExportCallback;
+typedef Callback<void(FirstArgument)> ImportCallback;
+typedef Callback<void(const ImportCallback&)> ExportCallback;
private:
ImportCallback m_importWidget;
}
void apply(
typename Widget::Type& widget,
- const Callback1<typename Widget::Other>& importViewer,
- const Callback1<const Callback1<typename Widget::Other>&>& exportViewer
+ const Callback<void(typename Widget::Other)>& importViewer,
+ const Callback<void(const Callback<void(typename Widget::Other)>&)>& exportViewer
) const {
m_data.push_back(
new CallbackDialogData<typename Widget::Other>(
inline void BoolImport( bool& self, bool value ){
self = value;
}
-typedef ReferenceCaller1<bool, bool, BoolImport> BoolImportCaller;
+typedef ReferenceCaller<bool, void(bool), BoolImport> BoolImportCaller;
inline void BoolExport( bool& self, const BoolImportCallback& importCallback ){
importCallback( self );
}
-typedef ReferenceCaller1<bool, const BoolImportCallback&, BoolExport> BoolExportCaller;
+typedef ReferenceCaller<bool, void(const BoolImportCallback&), BoolExport> BoolExportCaller;
inline void IntImport( int& self, int value ){
self = value;
}
-typedef ReferenceCaller1<int, int, IntImport> IntImportCaller;
+typedef ReferenceCaller<int, void(int), IntImport> IntImportCaller;
inline void IntExport( int& self, const IntImportCallback& importCallback ){
importCallback( self );
}
-typedef ReferenceCaller1<int, const IntImportCallback&, IntExport> IntExportCaller;
+typedef ReferenceCaller<int, void(const IntImportCallback&), IntExport> IntExportCaller;
inline void SizeImport( std::size_t& self, std::size_t value ){
self = value;
}
-typedef ReferenceCaller1<std::size_t, std::size_t, SizeImport> SizeImportCaller;
+typedef ReferenceCaller<std::size_t, void(std::size_t), SizeImport> SizeImportCaller;
inline void SizeExport( std::size_t& self, const SizeImportCallback& importCallback ){
importCallback( self );
}
-typedef ReferenceCaller1<std::size_t, const SizeImportCallback&, SizeExport> SizeExportCaller;
+typedef ReferenceCaller<std::size_t, void(const SizeImportCallback&), SizeExport> SizeExportCaller;
inline void FloatImport( float& self, float value ){
self = value;
}
-typedef ReferenceCaller1<float, float, FloatImport> FloatImportCaller;
+typedef ReferenceCaller<float, void(float), FloatImport> FloatImportCaller;
inline void FloatExport( float& self, const FloatImportCallback& importCallback ){
importCallback( self );
}
-typedef ReferenceCaller1<float, const FloatImportCallback&, FloatExport> FloatExportCaller;
+typedef ReferenceCaller<float, void(const FloatImportCallback&), FloatExport> FloatExportCaller;
inline void StringImport( CopiedString& self, const char* value ){
self = value;
}
-typedef ReferenceCaller1<CopiedString, const char*, StringImport> StringImportCaller;
+typedef ReferenceCaller<CopiedString, void(const char*), StringImport> StringImportCaller;
inline void StringExport( CopiedString& self, const StringImportCallback& importCallback ){
importCallback( self.c_str() );
}
-typedef ReferenceCaller1<CopiedString, const StringImportCallback&, StringExport> StringExportCaller;
+typedef ReferenceCaller<CopiedString, void(const StringImportCallback&), StringExport> StringExportCaller;
struct DLG_DATA
void realise(){
if ( --m_unrealised == 0 ) {
globalOutputStream() << "searching vfs directory " << makeQuoted( "def" ) << " for *.def\n";
- GlobalFileSystem().forEachFile( "def/", "def", FreeCaller1<const char*, EntityClassDoom3_loadFile>() );
+ GlobalFileSystem().forEachFile( "def/", "def", FreeCaller<void(const char*), EntityClassDoom3_loadFile>() );
{
for ( Models::iterator i = g_models.begin(); i != g_models.end(); ++i )
void LightRadiiImport( EntityCreator& self, bool value ){
self.setLightRadii( value );
}
-typedef ReferenceCaller1<EntityCreator, bool, LightRadiiImport> LightRadiiImportCaller;
+typedef ReferenceCaller<EntityCreator, void(bool), LightRadiiImport> LightRadiiImportCaller;
void LightRadiiExport( EntityCreator& self, const BoolImportCallback& importer ){
importer( self.getLightRadii() );
}
-typedef ReferenceCaller1<EntityCreator, const BoolImportCallback&, LightRadiiExport> LightRadiiExportCaller;
+typedef ReferenceCaller<EntityCreator, void(const BoolImportCallback&), LightRadiiExport> LightRadiiExportCaller;
void Entity_constructPreferences( PreferencesPage& page ){
page.appendCheckBox(
Entity_constructPreferences( page );
}
void Entity_registerPreferencesPage(){
- PreferencesDialog_addDisplayPage( FreeCaller1<PreferenceGroup&, Entity_constructPage>() );
+ PreferencesDialog_addDisplayPage( FreeCaller<void(PreferenceGroup&), Entity_constructPage>() );
}
#include "stringio.h"
void Entity_Construct(){
- GlobalCommands_insert( "EntityColor", FreeCaller<Entity_setColour>(), Accelerator( 'K' ) );
- GlobalCommands_insert( "NormalizeColor", FreeCaller<Entity_normalizeColor>() );
- GlobalCommands_insert( "ConnectSelection", FreeCaller<Entity_connectSelected>(), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "KillConnectSelection", FreeCaller<Entity_killconnectSelected>(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) );
- GlobalCommands_insert( "GroupSelection", FreeCaller<Entity_groupSelected>() );
- GlobalCommands_insert( "UngroupSelection", FreeCaller<Entity_ungroupSelected>() );
+ GlobalCommands_insert( "EntityColor", FreeCaller<void(), Entity_setColour>(), Accelerator( 'K' ) );
+ GlobalCommands_insert( "NormalizeColor", FreeCaller<void(), Entity_normalizeColor>() );
+ GlobalCommands_insert( "ConnectSelection", FreeCaller<void(), Entity_connectSelected>(), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "KillConnectSelection", FreeCaller<void(), Entity_killconnectSelected>(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) );
+ GlobalCommands_insert( "GroupSelection", FreeCaller<void(), Entity_groupSelected>() );
+ GlobalCommands_insert( "UngroupSelection", FreeCaller<void(), Entity_ungroupSelected>() );
GlobalPreferenceSystem().registerPreference( "SI_Colors5", Vector3ImportStringCaller( g_entity_globals.color_entity ), Vector3ExportStringCaller( g_entity_globals.color_entity ) );
GlobalPreferenceSystem().registerPreference( "LastLightIntensity", IntImportStringCaller( g_iLastLightIntensity ), IntExportStringCaller( g_iLastLightIntensity ) );
void apply(){
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_check.active() ? "1" : "0" );
}
-typedef MemberCaller<BooleanAttribute, &BooleanAttribute::apply> ApplyCaller;
+typedef MemberCaller<BooleanAttribute, void(), &BooleanAttribute::apply> ApplyCaller;
void update(){
const char* value = SelectedEntity_getValueForKey( m_key.c_str() );
toggle_button_set_active_no_signal( m_check, false );
}
}
-typedef MemberCaller<BooleanAttribute, &BooleanAttribute::update> UpdateCaller;
+typedef MemberCaller<BooleanAttribute, void(), &BooleanAttribute::update> UpdateCaller;
};
value << m_entry.text();
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), value.c_str() );
}
-typedef MemberCaller<StringAttribute, &StringAttribute::apply> ApplyCaller;
+typedef MemberCaller<StringAttribute, void(), &StringAttribute::apply> ApplyCaller;
void update(){
StringOutputStream value( 64 );
value << SelectedEntity_getValueForKey( m_key.c_str() );
m_entry.text(value.c_str());
}
-typedef MemberCaller<StringAttribute, &StringAttribute::update> UpdateCaller;
+typedef MemberCaller<StringAttribute, void(), &StringAttribute::update> UpdateCaller;
};
class ShaderAttribute : public StringAttribute
value << m_entry.m_entry.m_entry.text();
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), value.c_str() );
}
-typedef MemberCaller<ModelAttribute, &ModelAttribute::apply> ApplyCaller;
+typedef MemberCaller<ModelAttribute, void(), &ModelAttribute::apply> ApplyCaller;
void update(){
StringOutputStream value( 64 );
value << SelectedEntity_getValueForKey( m_key.c_str() );
m_entry.m_entry.m_entry.text(value.c_str());
}
-typedef MemberCaller<ModelAttribute, &ModelAttribute::update> UpdateCaller;
+typedef MemberCaller<ModelAttribute, void(), &ModelAttribute::update> UpdateCaller;
void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
const char *filename = misc_model_dialog( m_entry.m_entry.m_frame.window() );
apply();
}
}
-typedef MemberCaller1<ModelAttribute, const BrowsedPathEntry::SetPathCallback&, &ModelAttribute::browse> BrowseCaller;
+typedef MemberCaller<ModelAttribute, void(const BrowsedPathEntry::SetPathCallback&), &ModelAttribute::browse> BrowseCaller;
};
const char* browse_sound( ui::Widget parent ){
value << m_entry.m_entry.m_entry.text();
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), value.c_str() );
}
-typedef MemberCaller<SoundAttribute, &SoundAttribute::apply> ApplyCaller;
+typedef MemberCaller<SoundAttribute, void(), &SoundAttribute::apply> ApplyCaller;
void update(){
StringOutputStream value( 64 );
value << SelectedEntity_getValueForKey( m_key.c_str() );
m_entry.m_entry.m_entry.text(value.c_str());
}
-typedef MemberCaller<SoundAttribute, &SoundAttribute::update> UpdateCaller;
+typedef MemberCaller<SoundAttribute, void(), &SoundAttribute::update> UpdateCaller;
void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
const char *filename = browse_sound( m_entry.m_entry.m_frame.window() );
apply();
}
}
-typedef MemberCaller1<SoundAttribute, const BrowsedPathEntry::SetPathCallback&, &SoundAttribute::browse> BrowseCaller;
+typedef MemberCaller<SoundAttribute, void(const BrowsedPathEntry::SetPathCallback&), &SoundAttribute::browse> BrowseCaller;
};
inline double angle_normalised( double angle ){
angle << angle_normalised( entry_get_float( m_entry ) );
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), angle.c_str() );
}
-typedef MemberCaller<AngleAttribute, &AngleAttribute::apply> ApplyCaller;
+typedef MemberCaller<AngleAttribute, void(), &AngleAttribute::apply> ApplyCaller;
void update(){
const char* value = SelectedEntity_getValueForKey( m_key.c_str() );
m_entry.text("0");
}
}
-typedef MemberCaller<AngleAttribute, &AngleAttribute::update> UpdateCaller;
+typedef MemberCaller<AngleAttribute, void(), &AngleAttribute::update> UpdateCaller;
};
namespace
angle << angle_normalised( entry_get_float( m_entry ) );
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), angle.c_str() );
}
-typedef MemberCaller<DirectionAttribute, &DirectionAttribute::apply> ApplyCaller;
+typedef MemberCaller<DirectionAttribute, void(), &DirectionAttribute::apply> ApplyCaller;
void update(){
const char* value = SelectedEntity_getValueForKey( m_key.c_str() );
m_entry.text("0");
}
}
-typedef MemberCaller<DirectionAttribute, &DirectionAttribute::update> UpdateCaller;
+typedef MemberCaller<DirectionAttribute, void(), &DirectionAttribute::update> UpdateCaller;
void applyRadio(){
int index = radio_button_get_active( m_radio.m_radio );
apply();
}
}
-typedef MemberCaller<DirectionAttribute, &DirectionAttribute::applyRadio> ApplyRadioCaller;
+typedef MemberCaller<DirectionAttribute, void(), &DirectionAttribute::applyRadio> ApplyRadioCaller;
};
<< " " << angle_normalised( entry_get_float( m_angles.m_roll ) );
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), angles.c_str() );
}
-typedef MemberCaller<AnglesAttribute, &AnglesAttribute::apply> ApplyCaller;
+typedef MemberCaller<AnglesAttribute, void(), &AnglesAttribute::apply> ApplyCaller;
void update(){
StringOutputStream angle( 32 );
m_angles.m_roll.text("0");
}
}
-typedef MemberCaller<AnglesAttribute, &AnglesAttribute::update> UpdateCaller;
+typedef MemberCaller<AnglesAttribute, void(), &AnglesAttribute::update> UpdateCaller;
};
class Vector3Entry
<< " " << entry_get_float( m_vector3.m_z );
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), vector3.c_str() );
}
-typedef MemberCaller<Vector3Attribute, &Vector3Attribute::apply> ApplyCaller;
+typedef MemberCaller<Vector3Attribute, void(), &Vector3Attribute::apply> ApplyCaller;
void update(){
StringOutputStream buffer( 32 );
m_vector3.m_z.text("0");
}
}
-typedef MemberCaller<Vector3Attribute, &Vector3Attribute::update> UpdateCaller;
+typedef MemberCaller<Vector3Attribute, void(), &Vector3Attribute::update> UpdateCaller;
};
class NonModalComboBox
{
-Callback m_changed;
+Callback<void()> m_changed;
guint m_changedHandler;
static gboolean changed( ui::ComboBox widget, NonModalComboBox* self ){
}
public:
-NonModalComboBox( const Callback& changed ) : m_changed( changed ), m_changedHandler( 0 ){
+NonModalComboBox( const Callback<void()>& changed ) : m_changed( changed ), m_changedHandler( 0 ){
}
void connect( ui::ComboBox combo ){
m_changedHandler = combo.connect( "changed", G_CALLBACK( changed ), this );
void apply(){
Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_type[gtk_combo_box_get_active( m_combo )].second.c_str() );
}
-typedef MemberCaller<ListAttribute, &ListAttribute::apply> ApplyCaller;
+typedef MemberCaller<ListAttribute, void(), &ListAttribute::apply> ApplyCaller;
void update(){
const char* value = SelectedEntity_getValueForKey( m_key.c_str() );
m_nonModal.setActive( m_combo, 0 );
}
}
-typedef MemberCaller<ListAttribute, &ListAttribute::update> UpdateCaller;
+typedef MemberCaller<ListAttribute, void(), &ListAttribute::update> UpdateCaller;
};
{
IdleDraw m_idleDraw;
public:
-EntityInspectorDraw() : m_idleDraw( FreeCaller<EntityInspector_updateKeyValues>( ) ){
+EntityInspectorDraw() : m_idleDraw( FreeCaller<void(), EntityInspector_updateKeyValues>( ) ){
}
void queueDraw(){
m_idleDraw.queueDraw();
g_entityInspector_windowConstructed = true;
EntityClassList_fill();
- typedef FreeCaller1<const Selectable&, EntityInspector_selectionChanged> EntityInspectorSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), EntityInspector_selectionChanged> EntityInspectorSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( EntityInspectorSelectionChangedCaller() );
GlobalEntityCreator().setKeyValueChangedFunc( EntityInspector_keyValueChanged );
#include "treemodel.h"
void RedrawEntityList();
-typedef FreeCaller<RedrawEntityList> RedrawEntityListCaller;
+typedef FreeCaller<void(), RedrawEntityList> RedrawEntityListCaller;
class EntityList
GlobalPreferenceSystem().registerPreference( "EntityInfoDlg", WindowPositionTrackerImportStringCaller( getEntityList().m_positionTracker ), WindowPositionTrackerExportStringCaller( getEntityList().m_positionTracker ) );
- typedef FreeCaller1<const Selectable&, EntityList_SelectionChanged> EntityListSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), EntityList_SelectionChanged> EntityListSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( EntityListSelectionChangedCaller() );
}
void EntityList_Destroy(){
void active( const BoolImportCallback& importCallback ){
importCallback( ( g_filters_globals.exclude & m_mask ) != 0 );
}
-typedef MemberCaller1<ToggleFilterFlag, const BoolImportCallback&, &ToggleFilterFlag::active> ActiveCaller;
+typedef MemberCaller<ToggleFilterFlag, void(const BoolImportCallback&), &ToggleFilterFlag::active> ActiveCaller;
void toggle(){
g_filters_globals.exclude ^= m_mask;
m_item.update();
m_item.update();
PerformFiltering();
}
-typedef MemberCaller<ToggleFilterFlag, &ToggleFilterFlag::toggle> ToggleCaller;
+typedef MemberCaller<ToggleFilterFlag, void(), &ToggleFilterFlag::toggle> ToggleCaller;
};
void ConstructFilters(){
GlobalPreferenceSystem().registerPreference( "SI_Exclude", SizeImportStringCaller( g_filters_globals.exclude ), SizeExportStringCaller( g_filters_globals.exclude ) );
- GlobalCommands_insert( "InvertFilters", FreeCaller<InvertFilters>() );
- GlobalCommands_insert( "ResetFilters", FreeCaller<ResetFilters>() );
+ GlobalCommands_insert( "InvertFilters", FreeCaller<void(), InvertFilters>() );
+ GlobalCommands_insert( "ResetFilters", FreeCaller<void(), ResetFilters>() );
add_filter_command( EXCLUDE_WORLD, "FilterWorldBrushes", Accelerator( '1', (GdkModifierType)GDK_MOD1_MASK ) );
add_filter_command( EXCLUDE_ENT, "FilterEntities", Accelerator( '2', (GdkModifierType)GDK_MOD1_MASK ) );
static void setFindStr( const char* name );
static bool isOpen();
static void show();
-typedef FreeCaller<&FindTextureDialog::show> ShowCaller;
+typedef FreeCaller<void(), &FindTextureDialog::show> ShowCaller;
static void updateTextures( const char* name );
FindTextureDialog();
m_item.update();
setGridPower( m_id );
}
-typedef MemberCaller<GridMenuItem, &GridMenuItem::set> SetCaller;
+typedef MemberCaller<GridMenuItem, void(), &GridMenuItem::set> SetCaller;
void active( const BoolImportCallback& importCallback ){
importCallback( g_grid_power == m_id );
}
-typedef MemberCaller1<GridMenuItem, const BoolImportCallback&, &GridMenuItem::active> ExportCaller;
+typedef MemberCaller<GridMenuItem, void(const BoolImportCallback&), &GridMenuItem::active> ExportCaller;
};
GridMenuItem g_gridMenu0125( GRIDPOWER_0125 );
}
void Grid_registerCommands(){
- GlobalCommands_insert( "GridDown", FreeCaller<GridPrev>(), Accelerator( '[' ) );
- GlobalCommands_insert( "GridUp", FreeCaller<GridNext>(), Accelerator( ']' ) );
+ GlobalCommands_insert( "GridDown", FreeCaller<void(), GridPrev>(), Accelerator( '[' ) );
+ GlobalCommands_insert( "GridUp", FreeCaller<void(), GridNext>(), Accelerator( ']' ) );
- GlobalCommands_insert( "ToggleGridSnap", FreeCaller<ToggleGridSnap>() );
+ GlobalCommands_insert( "ToggleGridSnap", FreeCaller<void(), ToggleGridSnap>() );
GlobalToggles_insert( "SetGrid0.125", GridMenuItem::SetCaller( g_gridMenu0125 ), ToggleItem::AddCallbackCaller( g_gridMenu0125.m_item ) );
GlobalToggles_insert( "SetGrid0.25", GridMenuItem::SetCaller( g_gridMenu025 ), ToggleItem::AddCallbackCaller( g_gridMenu025.m_item ) );
Grid_constructPreferences( page );
}
void Grid_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Grid_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Grid_constructPage>() );
}
void Grid_construct(){
void GroupDialog_updatePageTitle( ui::Window window, std::size_t pageIndex ){
if ( pageIndex < g_pages.size() ) {
- g_pages[pageIndex]( PointerCaller1<GtkWindow, const char*, gtk_window_set_title>( window ) );
+ g_pages[pageIndex]( PointerCaller<GtkWindow, void(const char*), gtk_window_set_title>( window ) );
}
}
void GroupDialog_Construct(){
GlobalPreferenceSystem().registerPreference( "EntityWnd", WindowPositionTrackerImportStringCaller( g_GroupDlg.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_GroupDlg.m_position_tracker ) );
- GlobalCommands_insert( "ViewEntityInfo", FreeCaller<GroupDialog_ToggleShow>(), Accelerator( 'N' ) );
+ GlobalCommands_insert( "ViewEntityInfo", FreeCaller<void(), GroupDialog_ToggleShow>(), Accelerator( 'N' ) );
}
void GroupDialog_Destroy(){
}
inline void RawStringExport( const char* string, const StringImportCallback& importer ){
importer( string );
}
-typedef ConstPointerCaller1<char, const StringImportCallback&, RawStringExport> RawStringExportCaller;
+typedef ConstPointerCaller<char, void(const StringImportCallback&), RawStringExport> RawStringExportCaller;
ui::Widget GroupDialog_addPage( const char* tabLabel, ui::Widget widget, const StringExportCallback& title );
void GroupDialog_showPage( ui::Widget page );
prop = xmlGetProp( pNode, reinterpret_cast<const xmlChar*>( "name" ) );
ASSERT_NOTNULL( prop );
- create_menu_item_with_mnemonic( menu_in_menu, reinterpret_cast<const char*>( prop ), ReferenceCaller<CopiedString, HandleHelpCommand>( mHelpURLs.back() ) );
+ create_menu_item_with_mnemonic( menu_in_menu, reinterpret_cast<const char*>( prop ), ReferenceCaller<CopiedString, void(), HandleHelpCommand>( mHelpURLs.back() ) );
xmlFree( prop );
}
pNode = pNode->next;
\link math/plane.h math/plane.h \endlink - Planes \n
\link math/aabb.h math/aabb.h \endlink - AABBs \n
- Callback MemberCaller FunctionCaller - callbacks similar to using boost::function with boost::bind \n
+ Callback MemberCaller0 FunctionCaller - callbacks similar to using boost::function with boost::bind \n
SmartPointer SmartReference - smart-pointer and smart-reference similar to Loki's SmartPtr \n
\link generic/bitfield.h generic/bitfield.h \endlink - Type-safe bitfield \n
void EnginePathImport( CopiedString& self, const char* value ){
setEnginePath( value );
}
-typedef ReferenceCaller1<CopiedString, const char*, EnginePathImport> EnginePathImportCaller;
+typedef ReferenceCaller<CopiedString, void(const char*), EnginePathImport> EnginePathImportCaller;
void Paths_constructPreferences( PreferencesPage& page ){
page.appendPathEntry( "Engine Path", true,
Paths_constructPreferences( page );
}
void Paths_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Paths_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Paths_constructPage>() );
}
XY_UpdateAllWindows();
}
-typedef Callback1<Vector3&> GetColourCallback;
-typedef Callback1<const Vector3&> SetColourCallback;
+typedef Callback<void(Vector3&)> GetColourCallback;
+typedef Callback<void(const Vector3&)> SetColourCallback;
class ChooseColour
{
void Colour_get( const Vector3& colour, Vector3& other ){
other = colour;
}
-typedef ConstReferenceCaller1<Vector3, Vector3&, Colour_get> ColourGetCaller;
+typedef ConstReferenceCaller<Vector3, void(Vector3&), Colour_get> ColourGetCaller;
void Colour_set( Vector3& colour, const Vector3& other ){
colour = other;
SceneChangeNotify();
}
-typedef ReferenceCaller1<Vector3, const Vector3&, Colour_set> ColourSetCaller;
+typedef ReferenceCaller<Vector3, void(const Vector3&), Colour_set> ColourSetCaller;
void BrushColour_set( const Vector3& other ){
g_xywindow_globals.color_brushes = other;
SetWorldspawnColour( g_xywindow_globals.color_brushes );
SceneChangeNotify();
}
-typedef FreeCaller1<const Vector3&, BrushColour_set> BrushColourSetCaller;
+typedef FreeCaller<void(const Vector3&), BrushColour_set> BrushColourSetCaller;
void ClipperColour_set( const Vector3& other ){
g_xywindow_globals.color_clipper = other;
Brush_clipperColourChanged();
SceneChangeNotify();
}
-typedef FreeCaller1<const Vector3&, ClipperColour_set> ClipperColourSetCaller;
+typedef FreeCaller<void(const Vector3&), ClipperColour_set> ClipperColourSetCaller;
void TextureBrowserColour_get( Vector3& other ){
other = TextureBrowser_getBackgroundColour( GlobalTextureBrowser() );
}
-typedef FreeCaller1<Vector3&, TextureBrowserColour_get> TextureBrowserColourGetCaller;
+typedef FreeCaller<void(Vector3&), TextureBrowserColour_get> TextureBrowserColourGetCaller;
void TextureBrowserColour_set( const Vector3& other ){
TextureBrowser_setBackgroundColour( GlobalTextureBrowser(), other );
}
-typedef FreeCaller1<const Vector3&, TextureBrowserColour_set> TextureBrowserColourSetCaller;
+typedef FreeCaller<void(const Vector3&), TextureBrowserColour_set> TextureBrowserColourSetCaller;
class ColoursMenu
}
};
-typedef FreeCaller1<const BoolImportCallback&, &BoolFunctionExport<EdgeMode>::apply> EdgeModeApplyCaller;
+typedef FreeCaller<void(const BoolImportCallback&), &BoolFunctionExport<EdgeMode>::apply> EdgeModeApplyCaller;
EdgeModeApplyCaller g_edgeMode_button_caller;
BoolExportCallback g_edgeMode_button_callback( g_edgeMode_button_caller );
ToggleItem g_edgeMode_button( g_edgeMode_button_callback );
-typedef FreeCaller1<const BoolImportCallback&, &BoolFunctionExport<VertexMode>::apply> VertexModeApplyCaller;
+typedef FreeCaller<void(const BoolImportCallback&), &BoolFunctionExport<VertexMode>::apply> VertexModeApplyCaller;
VertexModeApplyCaller g_vertexMode_button_caller;
BoolExportCallback g_vertexMode_button_callback( g_vertexMode_button_caller );
ToggleItem g_vertexMode_button( g_vertexMode_button_callback );
-typedef FreeCaller1<const BoolImportCallback&, &BoolFunctionExport<FaceMode>::apply> FaceModeApplyCaller;
+typedef FreeCaller<void(const BoolImportCallback&), &BoolFunctionExport<FaceMode>::apply> FaceModeApplyCaller;
FaceModeApplyCaller g_faceMode_button_caller;
BoolExportCallback g_faceMode_button_callback( g_faceMode_button_caller );
ToggleItem g_faceMode_button( g_faceMode_button_callback );
importCallback( GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip );
}
-FreeCaller1<const BoolImportCallback&, TranslateToolExport> g_translatemode_button_caller;
+FreeCaller<void(const BoolImportCallback&), TranslateToolExport> g_translatemode_button_caller;
BoolExportCallback g_translatemode_button_callback( g_translatemode_button_caller );
ToggleItem g_translatemode_button( g_translatemode_button_callback );
-FreeCaller1<const BoolImportCallback&, RotateToolExport> g_rotatemode_button_caller;
+FreeCaller<void(const BoolImportCallback&), RotateToolExport> g_rotatemode_button_caller;
BoolExportCallback g_rotatemode_button_callback( g_rotatemode_button_caller );
ToggleItem g_rotatemode_button( g_rotatemode_button_callback );
-FreeCaller1<const BoolImportCallback&, ScaleToolExport> g_scalemode_button_caller;
+FreeCaller<void(const BoolImportCallback&), ScaleToolExport> g_scalemode_button_caller;
BoolExportCallback g_scalemode_button_callback( g_scalemode_button_caller );
ToggleItem g_scalemode_button( g_scalemode_button_callback );
-FreeCaller1<const BoolImportCallback&, DragToolExport> g_dragmode_button_caller;
+FreeCaller<void(const BoolImportCallback&), DragToolExport> g_dragmode_button_caller;
BoolExportCallback g_dragmode_button_callback( g_dragmode_button_caller );
ToggleItem g_dragmode_button( g_dragmode_button_callback );
-FreeCaller1<const BoolImportCallback&, ClipperToolExport> g_clipper_button_caller;
+FreeCaller<void(const BoolImportCallback&), ClipperToolExport> g_clipper_button_caller;
BoolExportCallback g_clipper_button_callback( g_clipper_button_caller );
ToggleItem g_clipper_button( g_clipper_button_callback );
}
#if 0
- create_menu_item_with_mnemonic( menu, "_Benchmark", FreeCaller<GlobalCamera_Benchmark>() );
+ create_menu_item_with_mnemonic( menu, "_Benchmark", FreeCaller<void(), GlobalCamera_Benchmark>() );
#endif
menu.add(create_colours_menu());
create_menu_item_with_mnemonic( menu, "Find brush...", "FindBrush" );
create_menu_item_with_mnemonic( menu, "Map Info...", "MapInfo" );
// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394
-// create_menu_item_with_mnemonic(menu, "_Print XY View", FreeCaller<WXY_Print>());
- create_menu_item_with_mnemonic( menu, "_Background select", FreeCaller<WXY_BackgroundSelect>() );
+// create_menu_item_with_mnemonic(menu, "_Print XY View", FreeCaller<void(), WXY_Print>());
+ create_menu_item_with_mnemonic( menu, "_Background select", FreeCaller<void(), WXY_BackgroundSelect>() );
return misc_menu_item;
}
// it will take care of hooking the Sys_OpenURL calls etc.
create_game_help_menu( menu );
- create_menu_item_with_mnemonic( menu, "Bug report", FreeCaller<OpenBugReportURL>() );
- create_menu_item_with_mnemonic( menu, "Shortcuts list", FreeCaller<DoCommandListDlg>() );
- create_menu_item_with_mnemonic( menu, "_About", FreeCaller<DoAbout>() );
+ create_menu_item_with_mnemonic( menu, "Bug report", FreeCaller<void(), OpenBugReportURL>() );
+ create_menu_item_with_mnemonic( menu, "Shortcuts list", FreeCaller<void(), DoCommandListDlg>() );
+ create_menu_item_with_mnemonic( menu, "_About", FreeCaller<void(), DoAbout>() );
return help_menu_item;
}
SetActiveXY( m_pXYWnd );
AddGridChangeCallback( SetGridStatusCaller( *this ) );
- AddGridChangeCallback( ReferenceCaller<MainFrame, XY_UpdateAllWindows>( *this ) );
+ AddGridChangeCallback( ReferenceCaller<MainFrame, void(), XY_UpdateAllWindows>( *this ) );
g_defaultToolMode = DragMode;
g_defaultToolMode();
}
void Layout_registerPreferencesPage(){
- PreferencesDialog_addInterfacePage( FreeCaller1<PreferenceGroup&, Layout_constructPage>() );
+ PreferencesDialog_addInterfacePage( FreeCaller<void(PreferenceGroup&), Layout_constructPage>() );
}
#include "stringio.h"
void MainFrame_Construct(){
- GlobalCommands_insert( "OpenManual", FreeCaller<OpenHelpURL>(), Accelerator( GDK_KEY_F1 ) );
-
- GlobalCommands_insert( "Sleep", FreeCaller<thunk_OnSleep>(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "NewMap", FreeCaller<NewMap>() );
- GlobalCommands_insert( "OpenMap", FreeCaller<OpenMap>(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "ImportMap", FreeCaller<ImportMap>() );
- GlobalCommands_insert( "SaveMap", FreeCaller<SaveMap>(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "SaveMapAs", FreeCaller<SaveMapAs>() );
- GlobalCommands_insert( "ExportSelected", FreeCaller<ExportMap>() );
- GlobalCommands_insert( "SaveRegion", FreeCaller<SaveRegion>() );
- GlobalCommands_insert( "RefreshReferences", FreeCaller<VFS_Refresh>() );
- GlobalCommands_insert( "ProjectSettings", FreeCaller<DoProjectSettings>() );
- GlobalCommands_insert( "Exit", FreeCaller<Exit>() );
-
- GlobalCommands_insert( "Undo", FreeCaller<Undo>(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "Redo", FreeCaller<Redo>(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "Copy", FreeCaller<Copy>(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "Paste", FreeCaller<Paste>(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PasteToCamera", FreeCaller<PasteToCamera>(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "CloneSelection", FreeCaller<Selection_Clone>(), Accelerator( GDK_KEY_space ) );
- GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<Selection_Clone_MakeUnique>(), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "DeleteSelection", FreeCaller<deleteSelection>(), Accelerator( GDK_KEY_BackSpace ) );
- GlobalCommands_insert( "ParentSelection", FreeCaller<Scene_parentSelected>() );
- GlobalCommands_insert( "UnSelectSelection", FreeCaller<Selection_Deselect>(), Accelerator( GDK_KEY_Escape ) );
- GlobalCommands_insert( "InvertSelection", FreeCaller<Select_Invert>(), Accelerator( 'I' ) );
- GlobalCommands_insert( "SelectInside", FreeCaller<Select_Inside>() );
- GlobalCommands_insert( "SelectTouching", FreeCaller<Select_Touching>() );
- GlobalCommands_insert( "ExpandSelectionToEntities", FreeCaller<Scene_ExpandSelectionToEntities>(), Accelerator( 'E', (GdkModifierType)( GDK_MOD1_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "Preferences", FreeCaller<PreferencesDialog_showDialog>(), Accelerator( 'P' ) );
-
- GlobalCommands_insert( "ToggleConsole", FreeCaller<Console_ToggleShow>(), Accelerator( 'O' ) );
- GlobalCommands_insert( "ToggleEntityInspector", FreeCaller<EntityInspector_ToggleShow>(), Accelerator( 'N' ) );
- GlobalCommands_insert( "EntityList", FreeCaller<EntityList_toggleShown>(), Accelerator( 'L' ) );
-
- GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "HideSelected", FreeCaller<HideSelected>(), Accelerator( 'H' ) );
-
- GlobalToggles_insert( "DragVertices", FreeCaller<SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
- GlobalToggles_insert( "DragEdges", FreeCaller<SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
- GlobalToggles_insert( "DragFaces", FreeCaller<SelectFaceMode>(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
-
- GlobalCommands_insert( "MirrorSelectionX", FreeCaller<Selection_Flipx>() );
- GlobalCommands_insert( "RotateSelectionX", FreeCaller<Selection_Rotatex>() );
- GlobalCommands_insert( "MirrorSelectionY", FreeCaller<Selection_Flipy>() );
- GlobalCommands_insert( "RotateSelectionY", FreeCaller<Selection_Rotatey>() );
- GlobalCommands_insert( "MirrorSelectionZ", FreeCaller<Selection_Flipz>() );
- GlobalCommands_insert( "RotateSelectionZ", FreeCaller<Selection_Rotatez>() );
-
- GlobalCommands_insert( "ArbitraryRotation", FreeCaller<DoRotateDlg>() );
- GlobalCommands_insert( "ArbitraryScale", FreeCaller<DoScaleDlg>() );
-
- GlobalCommands_insert( "BuildMenuCustomize", FreeCaller<DoBuildMenu>() );
-
- GlobalCommands_insert( "FindBrush", FreeCaller<DoFind>() );
-
- GlobalCommands_insert( "MapInfo", FreeCaller<DoMapInfo>(), Accelerator( 'M' ) );
-
-
- GlobalToggles_insert( "ToggleClipper", FreeCaller<ClipperMode>(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) );
-
- GlobalToggles_insert( "MouseTranslate", FreeCaller<TranslateMode>(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) );
- GlobalToggles_insert( "MouseRotate", FreeCaller<RotateMode>(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) );
- GlobalToggles_insert( "MouseScale", FreeCaller<ScaleMode>(), ToggleItem::AddCallbackCaller( g_scalemode_button ) );
- GlobalToggles_insert( "MouseDrag", FreeCaller<DragMode>(), ToggleItem::AddCallbackCaller( g_dragmode_button ), Accelerator( 'Q' ) );
-
- GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller<ColorScheme_Original>() );
- GlobalCommands_insert( "ColorSchemeQER", FreeCaller<ColorScheme_QER>() );
- GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller<ColorScheme_Black>() );
- GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller<ColorScheme_Ydnar>() );
+ GlobalCommands_insert( "OpenManual", FreeCaller<void(), OpenHelpURL>(), Accelerator( GDK_KEY_F1 ) );
+
+ GlobalCommands_insert( "Sleep", FreeCaller<void(), thunk_OnSleep>(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "NewMap", FreeCaller<void(), NewMap>() );
+ GlobalCommands_insert( "OpenMap", FreeCaller<void(), OpenMap>(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "ImportMap", FreeCaller<void(), ImportMap>() );
+ GlobalCommands_insert( "SaveMap", FreeCaller<void(), SaveMap>(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "SaveMapAs", FreeCaller<void(), SaveMapAs>() );
+ GlobalCommands_insert( "ExportSelected", FreeCaller<void(), ExportMap>() );
+ GlobalCommands_insert( "SaveRegion", FreeCaller<void(), SaveRegion>() );
+ GlobalCommands_insert( "RefreshReferences", FreeCaller<void(), VFS_Refresh>() );
+ GlobalCommands_insert( "ProjectSettings", FreeCaller<void(), DoProjectSettings>() );
+ GlobalCommands_insert( "Exit", FreeCaller<void(), Exit>() );
+
+ GlobalCommands_insert( "Undo", FreeCaller<void(), Undo>(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "Redo", FreeCaller<void(), Redo>(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "Copy", FreeCaller<void(), Copy>(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "Paste", FreeCaller<void(), Paste>(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PasteToCamera", FreeCaller<void(), PasteToCamera>(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "CloneSelection", FreeCaller<void(), Selection_Clone>(), Accelerator( GDK_KEY_space ) );
+ GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<void(), Selection_Clone_MakeUnique>(), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "DeleteSelection", FreeCaller<void(), deleteSelection>(), Accelerator( GDK_KEY_BackSpace ) );
+ GlobalCommands_insert( "ParentSelection", FreeCaller<void(), Scene_parentSelected>() );
+ GlobalCommands_insert( "UnSelectSelection", FreeCaller<void(), Selection_Deselect>(), Accelerator( GDK_KEY_Escape ) );
+ GlobalCommands_insert( "InvertSelection", FreeCaller<void(), Select_Invert>(), Accelerator( 'I' ) );
+ GlobalCommands_insert( "SelectInside", FreeCaller<void(), Select_Inside>() );
+ GlobalCommands_insert( "SelectTouching", FreeCaller<void(), Select_Touching>() );
+ GlobalCommands_insert( "ExpandSelectionToEntities", FreeCaller<void(), Scene_ExpandSelectionToEntities>(), Accelerator( 'E', (GdkModifierType)( GDK_MOD1_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "Preferences", FreeCaller<void(), PreferencesDialog_showDialog>(), Accelerator( 'P' ) );
+
+ GlobalCommands_insert( "ToggleConsole", FreeCaller<void(), Console_ToggleShow>(), Accelerator( 'O' ) );
+ GlobalCommands_insert( "ToggleEntityInspector", FreeCaller<void(), EntityInspector_ToggleShow>(), Accelerator( 'N' ) );
+ GlobalCommands_insert( "EntityList", FreeCaller<void(), EntityList_toggleShown>(), Accelerator( 'L' ) );
+
+ GlobalCommands_insert( "ShowHidden", FreeCaller<void(), Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "HideSelected", FreeCaller<void(), HideSelected>(), Accelerator( 'H' ) );
+
+ GlobalToggles_insert( "DragVertices", FreeCaller<void(), SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
+ GlobalToggles_insert( "DragEdges", FreeCaller<void(), SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
+ GlobalToggles_insert( "DragFaces", FreeCaller<void(), SelectFaceMode>(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
+
+ GlobalCommands_insert( "MirrorSelectionX", FreeCaller<void(), Selection_Flipx>() );
+ GlobalCommands_insert( "RotateSelectionX", FreeCaller<void(), Selection_Rotatex>() );
+ GlobalCommands_insert( "MirrorSelectionY", FreeCaller<void(), Selection_Flipy>() );
+ GlobalCommands_insert( "RotateSelectionY", FreeCaller<void(), Selection_Rotatey>() );
+ GlobalCommands_insert( "MirrorSelectionZ", FreeCaller<void(), Selection_Flipz>() );
+ GlobalCommands_insert( "RotateSelectionZ", FreeCaller<void(), Selection_Rotatez>() );
+
+ GlobalCommands_insert( "ArbitraryRotation", FreeCaller<void(), DoRotateDlg>() );
+ GlobalCommands_insert( "ArbitraryScale", FreeCaller<void(), DoScaleDlg>() );
+
+ GlobalCommands_insert( "BuildMenuCustomize", FreeCaller<void(), DoBuildMenu>() );
+
+ GlobalCommands_insert( "FindBrush", FreeCaller<void(), DoFind>() );
+
+ GlobalCommands_insert( "MapInfo", FreeCaller<void(), DoMapInfo>(), Accelerator( 'M' ) );
+
+
+ GlobalToggles_insert( "ToggleClipper", FreeCaller<void(), ClipperMode>(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) );
+
+ GlobalToggles_insert( "MouseTranslate", FreeCaller<void(), TranslateMode>(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) );
+ GlobalToggles_insert( "MouseRotate", FreeCaller<void(), RotateMode>(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) );
+ GlobalToggles_insert( "MouseScale", FreeCaller<void(), ScaleMode>(), ToggleItem::AddCallbackCaller( g_scalemode_button ) );
+ GlobalToggles_insert( "MouseDrag", FreeCaller<void(), DragMode>(), ToggleItem::AddCallbackCaller( g_dragmode_button ), Accelerator( 'Q' ) );
+
+ GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller<void(), ColorScheme_Original>() );
+ GlobalCommands_insert( "ColorSchemeQER", FreeCaller<void(), ColorScheme_QER>() );
+ GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller<void(), ColorScheme_Black>() );
+ GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller<void(), ColorScheme_Ydnar>() );
GlobalCommands_insert( "ChooseTextureBackgroundColor", makeCallback( g_ColoursMenu.m_textureback ) );
GlobalCommands_insert( "ChooseGridBackgroundColor", makeCallback( g_ColoursMenu.m_xyback ) );
GlobalCommands_insert( "ChooseGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor ) );
GlobalCommands_insert( "ChooseOrthoViewNameColor", makeCallback( g_ColoursMenu.m_viewname ) );
- GlobalCommands_insert( "CSGSubtract", FreeCaller<CSG_Subtract>(), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "CSGMerge", FreeCaller<CSG_Merge>(), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CSGHollow", FreeCaller<CSG_MakeHollow>() );
+ GlobalCommands_insert( "CSGSubtract", FreeCaller<void(), CSG_Subtract>(), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CSGMerge", FreeCaller<void(), CSG_Merge>(), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CSGHollow", FreeCaller<void(), CSG_MakeHollow>() );
Grid_registerCommands();
- GlobalCommands_insert( "SnapToGrid", FreeCaller<Selection_SnapToGrid>(), Accelerator( 'G', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "SnapToGrid", FreeCaller<void(), Selection_SnapToGrid>(), Accelerator( 'G', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "SelectAllOfType", FreeCaller<Select_AllOfType>(), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "SelectAllOfType", FreeCaller<void(), Select_AllOfType>(), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexRotateClock", FreeCaller<Texdef_RotateClockwise>(), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexRotateCounter", FreeCaller<Texdef_RotateAntiClockwise>(), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexScaleUp", FreeCaller<Texdef_ScaleUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexScaleDown", FreeCaller<Texdef_ScaleDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexScaleLeft", FreeCaller<Texdef_ScaleLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexScaleRight", FreeCaller<Texdef_ScaleRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexShiftUp", FreeCaller<Texdef_ShiftUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexShiftDown", FreeCaller<Texdef_ShiftDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexShiftLeft", FreeCaller<Texdef_ShiftLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexShiftRight", FreeCaller<Texdef_ShiftRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexRotateClock", FreeCaller<void(), Texdef_RotateClockwise>(), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexRotateCounter", FreeCaller<void(), Texdef_RotateAntiClockwise>(), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexScaleUp", FreeCaller<void(), Texdef_ScaleUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexScaleDown", FreeCaller<void(), Texdef_ScaleDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexScaleLeft", FreeCaller<void(), Texdef_ScaleLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexScaleRight", FreeCaller<void(), Texdef_ScaleRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexShiftUp", FreeCaller<void(), Texdef_ShiftUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexShiftDown", FreeCaller<void(), Texdef_ShiftDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexShiftLeft", FreeCaller<void(), Texdef_ShiftLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexShiftRight", FreeCaller<void(), Texdef_ShiftRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller<Selection_MoveDown>(), Accelerator( GDK_KEY_KP_Subtract ) );
- GlobalCommands_insert( "MoveSelectionUP", FreeCaller<Selection_MoveUp>(), Accelerator( GDK_KEY_KP_Add ) );
+ GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller<void(), Selection_MoveDown>(), Accelerator( GDK_KEY_KP_Subtract ) );
+ GlobalCommands_insert( "MoveSelectionUP", FreeCaller<void(), Selection_MoveUp>(), Accelerator( GDK_KEY_KP_Add ) );
- GlobalCommands_insert( "SelectNudgeLeft", FreeCaller<Selection_NudgeLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "SelectNudgeRight", FreeCaller<Selection_NudgeRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "SelectNudgeUp", FreeCaller<Selection_NudgeUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "SelectNudgeDown", FreeCaller<Selection_NudgeDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeLeft", FreeCaller<void(), Selection_NudgeLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeRight", FreeCaller<void(), Selection_NudgeRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeUp", FreeCaller<void(), Selection_NudgeUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeDown", FreeCaller<void(), Selection_NudgeDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) );
Patch_registerCommands();
XYShow_registerCommands();
- typedef FreeCaller1<const Selectable&, ComponentMode_SelectionChanged> ComponentModeSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), ComponentMode_SelectionChanged> ComponentModeSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( ComponentModeSelectionChangedCaller() );
GlobalPreferenceSystem().registerPreference( "DetachableMenus", BoolImportStringCaller( g_Layout_enableDetachableMenus.m_latched ), BoolExportStringCaller( g_Layout_enableDetachableMenus.m_latched ) );
Layout_registerPreferencesPage();
Paths_registerPreferencesPage();
- g_brushCount.setCountChangedCallback( FreeCaller<QE_brushCountChanged>() );
- g_entityCount.setCountChangedCallback( FreeCaller<QE_entityCountChanged>() );
+ g_brushCount.setCountChangedCallback( FreeCaller<void(), QE_brushCountChanged>() );
+ g_entityCount.setCountChangedCallback( FreeCaller<void(), QE_entityCountChanged>() );
GlobalEntityCreator().setCounter( &g_entityCount );
GLWidget_sharedContextCreated = GlobalGL_sharedContextCreated;
GlobalEntityClassManager().detach( g_WorldspawnColourEntityClassObserver );
GlobalEntityCreator().setCounter( 0 );
- g_entityCount.setCountChangedCallback( Callback() );
- g_brushCount.setCountChangedCallback( Callback() );
+ g_entityCount.setCountChangedCallback( Callback<void()>() );
+ g_brushCount.setCountChangedCallback( Callback<void()>() );
}
void SetStatusText( CopiedString& status_text, const char* pText );
void UpdateStatusText();
void RedrawStatusText();
-typedef MemberCaller<MainFrame, &MainFrame::RedrawStatusText> RedrawStatusTextCaller;
+typedef MemberCaller<MainFrame, void(), &MainFrame::RedrawStatusText> RedrawStatusTextCaller;
void SetGridStatus();
-typedef MemberCaller<MainFrame, &MainFrame::SetGridStatus> SetGridStatusCaller;
+typedef MemberCaller<MainFrame, void(), &MainFrame::SetGridStatus> SetGridStatusCaller;
void SetActiveXY( XYWnd* p );
XYWnd* ActiveXY(){
m_name = name;
construct();
}
-typedef MemberCaller1<NameObserver, const char*, &NameObserver::nameChanged> NameChangedCaller;
+typedef MemberCaller<NameObserver, void(const char*), &NameObserver::nameChanged> NameChangedCaller;
};
class BasicNamespace : public Namespace
bool g_bLoadLastMap = false;
void Map_Construct(){
- GlobalCommands_insert( "RegionOff", FreeCaller<RegionOff>() );
- GlobalCommands_insert( "RegionSetXY", FreeCaller<RegionXY>() );
- GlobalCommands_insert( "RegionSetBrush", FreeCaller<RegionBrush>() );
- GlobalCommands_insert( "RegionSetSelection", FreeCaller<RegionSelected>(), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "RegionOff", FreeCaller<void(), RegionOff>() );
+ GlobalCommands_insert( "RegionSetXY", FreeCaller<void(), RegionXY>() );
+ GlobalCommands_insert( "RegionSetBrush", FreeCaller<void(), RegionBrush>() );
+ GlobalCommands_insert( "RegionSetSelection", FreeCaller<void(), RegionSelected>(), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalPreferenceSystem().registerPreference( "LastMap", CopiedStringImportStringCaller( g_strLastMap ), CopiedStringExportStringCaller( g_strLastMap ) );
GlobalPreferenceSystem().registerPreference( "LoadLastMap", BoolImportStringCaller( g_bLoadLastMap ), BoolExportStringCaller( g_bLoadLastMap ) );
GlobalPreferenceSystem().registerPreference( "MapInfoDlg", WindowPositionImportStringCaller( g_posMapInfoWnd ), WindowPositionExportStringCaller( g_posMapInfoWnd ) );
- PreferencesDialog_addSettingsPreferences( FreeCaller1<PreferencesPage&, Map_constructPreferences>() );
+ PreferencesDialog_addSettingsPreferences( FreeCaller<void(PreferencesPage&), Map_constructPreferences>() );
GlobalEntityClassManager().attach( g_MapEntityClasses );
Radiant_attachHomePathsObserver( g_MapModuleObserver );
class DeferredDraw
{
-Callback m_draw;
+Callback<void()> m_draw;
bool m_defer;
bool m_deferred;
public:
-DeferredDraw( const Callback& draw ) : m_draw( draw ), m_defer( false ), m_deferred( false ){
+DeferredDraw( const Callback<void()>& draw ) : m_draw( draw ), m_defer( false ), m_deferred( false ){
}
void defer(){
m_defer = true;
self.defer();
}
}
-typedef ReferenceCaller<DeferredDraw, DeferredDraw_onMapValidChanged> DeferredDrawOnMapValidChangedCaller;
+typedef ReferenceCaller<DeferredDraw, void(), DeferredDraw_onMapValidChanged> DeferredDrawOnMapValidChangedCaller;
}
};
-typedef MemberCaller<LoadMRU, &LoadMRU::load> LoadMRUCaller;
+typedef MemberCaller<LoadMRU, void(), &LoadMRU::load> LoadMRUCaller;
LoadMRU g_load_mru1( 1 );
LoadMRU g_load_mru2( 2 );
g_Multimon_enableSysMenuPopups.useLatched();
- PreferencesDialog_addInterfacePreferences( FreeCaller1<PreferencesPage&, MultiMonitor_constructPreferences>() );
+ PreferencesDialog_addInterfacePreferences( FreeCaller<void(PreferencesPage&), MultiMonitor_constructPreferences>() );
}
void MultiMon_Destroy(){
}
bool m_bOverlay;
bool m_transformChanged;
-Callback m_evaluateTransform;
-Callback m_boundsChanged;
+Callback<void()> m_evaluateTransform;
+Callback<void()> m_boundsChanged;
void construct(){
m_bOverlay = false;
}
public:
-Callback m_lightsChanged;
+Callback<void()> m_lightsChanged;
static int m_CycleCapIndex; // = 0;
static EPatchType m_type;
STRING_CONSTANT( Name, "Patch" );
-Patch( scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged ) :
+Patch( scene::Node& node, const Callback<void()>& evaluateTransform, const Callback<void()>& boundsChanged ) :
m_node( &node ),
m_shader( texdef_name_default() ),
m_state( 0 ),
m_boundsChanged( boundsChanged ){
construct();
}
-Patch( const Patch& other, scene::Node& node, const Callback& evaluateTransform, const Callback& boundsChanged ) :
+Patch( const Patch& other, scene::Node& node, const Callback<void()>& evaluateTransform, const Callback<void()>& boundsChanged ) :
m_node( &node ),
m_shader( texdef_name_default() ),
m_state( 0 ),
m_lightsChanged();
SceneChangeNotify();
}
-typedef MemberCaller<Patch, &Patch::transformChanged> TransformChangedCaller;
+typedef MemberCaller<Patch, void(), &Patch::transformChanged> TransformChangedCaller;
void evaluateTransform(){
if ( m_transformChanged ) {
void lightsChanged(){
m_lightList->lightsChanged();
}
-typedef MemberCaller<PatchInstance, &PatchInstance::lightsChanged> LightsChangedCaller;
+typedef MemberCaller<PatchInstance, void(), &PatchInstance::lightsChanged> LightsChangedCaller;
STRING_CONSTANT( Name, "PatchInstance" );
Instance::setTransformChangedCallback( LightsChangedCaller( *this ) );
}
~PatchInstance(){
- Instance::setTransformChangedCallback( Callback() );
+ Instance::setTransformChangedCallback( Callback<void()>() );
- m_patch.m_lightsChanged = Callback();
+ m_patch.m_lightsChanged = Callback<void()>();
GlobalShaderCache().detach( *this );
m_patch.detach( this );
Instance::selectedChanged();
}
-typedef MemberCaller1<PatchInstance, const Selectable&, &PatchInstance::selectedChanged> SelectedChangedCaller;
+typedef MemberCaller<PatchInstance, void(const Selectable&), &PatchInstance::selectedChanged> SelectedChangedCaller;
void selectedChangedComponent( const Selectable& selectable ){
GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable );
GlobalSelectionSystem().onComponentSelection( *this, selectable );
}
-typedef MemberCaller1<PatchInstance, const Selectable&, &PatchInstance::selectedChangedComponent> SelectedChangedComponentCaller;
+typedef MemberCaller<PatchInstance, void(const Selectable&), &PatchInstance::selectedChangedComponent> SelectedChangedComponentCaller;
Patch& getPatch(){
return m_patch;
evaluateTransform();
m_patch.freezeTransform();
}
-typedef MemberCaller<PatchInstance, &PatchInstance::applyTransform> ApplyTransformCaller;
+typedef MemberCaller<PatchInstance, void(), &PatchInstance::applyTransform> ApplyTransformCaller;
bool testLight( const RendererLight& light ) const {
void cancel(){
update();
}
-typedef MemberCaller<Subdivisions, &Subdivisions::cancel> CancelCaller;
+typedef MemberCaller<Subdivisions, void(), &Subdivisions::cancel> CancelCaller;
void apply(){
Scene_PatchSetFixedSubdivisions(
PatchFixedSubdivisions(
)
);
}
-typedef MemberCaller<Subdivisions, &Subdivisions::apply> ApplyCaller;
+typedef MemberCaller<Subdivisions, void(), &Subdivisions::apply> ApplyCaller;
static void applyGtk( ui::ToggleButton toggle, Subdivisions* self ){
self->apply();
}
PatchInspector() :
m_horizontalSubdivisionsEntry( Subdivisions::ApplyCaller( m_subdivisions ), Subdivisions::CancelCaller( m_subdivisions ) ),
m_verticalSubdivisionsEntry( Subdivisions::ApplyCaller( m_subdivisions ), Subdivisions::CancelCaller( m_subdivisions ) ),
- m_idleDraw( MemberCaller<PatchInspector, &PatchInspector::GetPatchInfo>( *this ) ){
+ m_idleDraw( MemberCaller<PatchInspector, void(), &PatchInspector::GetPatchInfo>( *this ) ){
m_fS = 0.0f;
m_fT = 0.0f;
m_fX = 0.0f;
void PatchInspector_Construct(){
- GlobalCommands_insert( "PatchInspector", FreeCaller<PatchInspector_toggleShown>(), Accelerator( 'S', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "PatchInspector", FreeCaller<void(), PatchInspector_toggleShown>(), Accelerator( 'S', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalPreferenceSystem().registerPreference( "PatchWnd", WindowPositionTrackerImportStringCaller( g_PatchInspector.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_PatchInspector.m_position_tracker ) );
GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Scale1", FloatImportStringCaller( g_pi_globals.scale[0] ), FloatExportStringCaller( g_pi_globals.scale[0] ) );
GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Shift2", FloatImportStringCaller( g_pi_globals.shift[1] ), FloatExportStringCaller( g_pi_globals.shift[1] ) );
GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Rotate", FloatImportStringCaller( g_pi_globals.rotate ), FloatExportStringCaller( g_pi_globals.rotate ) );
- typedef FreeCaller1<const Selectable&, PatchInspector_SelectionChanged> PatchInspectorSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), PatchInspector_SelectionChanged> PatchInspectorSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( PatchInspectorSelectionChangedCaller() );
- typedef FreeCaller<PatchInspector_queueDraw> PatchInspectorQueueDrawCaller;
+ typedef FreeCaller<void(), PatchInspector_queueDraw> PatchInspectorQueueDrawCaller;
Patch_addTextureChangedCallback( PatchInspectorQueueDrawCaller() );
}
void PatchInspector_Destroy(){
Patch_constructPreferences( page );
}
void Patch_registerPreferencesPage(){
- PreferencesDialog_addDisplayPage( FreeCaller1<PreferenceGroup&, Patch_constructPage>() );
+ PreferencesDialog_addDisplayPage( FreeCaller<void(PreferenceGroup&), Patch_constructPage>() );
}
#include "generic/callback.h"
void Patch_registerCommands(){
- GlobalCommands_insert( "InvertCurveTextureX", FreeCaller<Patch_FlipTextureX>(), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "InvertCurveTextureY", FreeCaller<Patch_FlipTextureY>(), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "NaturalizePatch", FreeCaller<Patch_NaturalTexture>(), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PatchCylinder", FreeCaller<Patch_Cylinder>() );
- GlobalCommands_insert( "PatchDenseCylinder", FreeCaller<Patch_DenseCylinder>() );
- GlobalCommands_insert( "PatchVeryDenseCylinder", FreeCaller<Patch_VeryDenseCylinder>() );
- GlobalCommands_insert( "PatchSquareCylinder", FreeCaller<Patch_SquareCylinder>() );
- GlobalCommands_insert( "PatchXactCylinder", FreeCaller<Patch_XactCylinder>() );
- GlobalCommands_insert( "PatchXactSphere", FreeCaller<Patch_XactSphere>() );
- GlobalCommands_insert( "PatchXactCone", FreeCaller<Patch_XactCone>() );
- GlobalCommands_insert( "PatchEndCap", FreeCaller<Patch_Endcap>() );
- GlobalCommands_insert( "PatchBevel", FreeCaller<Patch_Bevel>() );
- GlobalCommands_insert( "PatchSquareBevel", FreeCaller<Patch_SquareBevel>() );
- GlobalCommands_insert( "PatchSquareEndcap", FreeCaller<Patch_SquareEndcap>() );
- GlobalCommands_insert( "PatchCone", FreeCaller<Patch_Cone>() );
- GlobalCommands_insert( "PatchSphere", FreeCaller<Patch_Sphere>() );
- GlobalCommands_insert( "SimplePatchMesh", FreeCaller<Patch_Plane>(), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller<Patch_InsertInsertColumn>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "PatchInsertAddColumn", FreeCaller<Patch_InsertAddColumn>() );
- GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller<Patch_InsertInsertRow>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PatchInsertAddRow", FreeCaller<Patch_InsertAddRow>() );
- GlobalCommands_insert( "PatchDeleteFirstColumn", FreeCaller<Patch_DeleteFirstColumn>() );
- GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller<Patch_DeleteLastColumn>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller<Patch_DeleteFirstRow>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PatchDeleteLastRow", FreeCaller<Patch_DeleteLastRow>() );
- GlobalCommands_insert( "InvertCurve", FreeCaller<Patch_Invert>(), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "RedisperseRows", FreeCaller<Patch_RedisperseRows>(), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "RedisperseCols", FreeCaller<Patch_RedisperseCols>(), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "SmoothRows", FreeCaller<Patch_SmoothRows>(), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "SmoothCols", FreeCaller<Patch_SmoothCols>(), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "MatrixTranspose", FreeCaller<Patch_Transpose>(), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "CapCurrentCurve", FreeCaller<Patch_Cap>(), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "CycleCapTexturePatch", FreeCaller<Patch_CycleProjection>(), Accelerator( 'N', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "MakeOverlayPatch", FreeCaller<Patch_OverlayOn>(), Accelerator( 'Y' ) );
- GlobalCommands_insert( "ClearPatchOverlays", FreeCaller<Patch_OverlayOff>(), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "InvertCurveTextureX", FreeCaller<void(), Patch_FlipTextureX>(), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "InvertCurveTextureY", FreeCaller<void(), Patch_FlipTextureY>(), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "NaturalizePatch", FreeCaller<void(), Patch_NaturalTexture>(), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PatchCylinder", FreeCaller<void(), Patch_Cylinder>() );
+ GlobalCommands_insert( "PatchDenseCylinder", FreeCaller<void(), Patch_DenseCylinder>() );
+ GlobalCommands_insert( "PatchVeryDenseCylinder", FreeCaller<void(), Patch_VeryDenseCylinder>() );
+ GlobalCommands_insert( "PatchSquareCylinder", FreeCaller<void(), Patch_SquareCylinder>() );
+ GlobalCommands_insert( "PatchXactCylinder", FreeCaller<void(), Patch_XactCylinder>() );
+ GlobalCommands_insert( "PatchXactSphere", FreeCaller<void(), Patch_XactSphere>() );
+ GlobalCommands_insert( "PatchXactCone", FreeCaller<void(), Patch_XactCone>() );
+ GlobalCommands_insert( "PatchEndCap", FreeCaller<void(), Patch_Endcap>() );
+ GlobalCommands_insert( "PatchBevel", FreeCaller<void(), Patch_Bevel>() );
+ GlobalCommands_insert( "PatchSquareBevel", FreeCaller<void(), Patch_SquareBevel>() );
+ GlobalCommands_insert( "PatchSquareEndcap", FreeCaller<void(), Patch_SquareEndcap>() );
+ GlobalCommands_insert( "PatchCone", FreeCaller<void(), Patch_Cone>() );
+ GlobalCommands_insert( "PatchSphere", FreeCaller<void(), Patch_Sphere>() );
+ GlobalCommands_insert( "SimplePatchMesh", FreeCaller<void(), Patch_Plane>(), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller<void(), Patch_InsertInsertColumn>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "PatchInsertAddColumn", FreeCaller<void(), Patch_InsertAddColumn>() );
+ GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller<void(), Patch_InsertInsertRow>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PatchInsertAddRow", FreeCaller<void(), Patch_InsertAddRow>() );
+ GlobalCommands_insert( "PatchDeleteFirstColumn", FreeCaller<void(), Patch_DeleteFirstColumn>() );
+ GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller<void(), Patch_DeleteLastColumn>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller<void(), Patch_DeleteFirstRow>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PatchDeleteLastRow", FreeCaller<void(), Patch_DeleteLastRow>() );
+ GlobalCommands_insert( "InvertCurve", FreeCaller<void(), Patch_Invert>(), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "RedisperseRows", FreeCaller<void(), Patch_RedisperseRows>(), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "RedisperseCols", FreeCaller<void(), Patch_RedisperseCols>(), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "SmoothRows", FreeCaller<void(), Patch_SmoothRows>(), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "SmoothCols", FreeCaller<void(), Patch_SmoothCols>(), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "MatrixTranspose", FreeCaller<void(), Patch_Transpose>(), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "CapCurrentCurve", FreeCaller<void(), Patch_Cap>(), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CycleCapTexturePatch", FreeCaller<void(), Patch_CycleProjection>(), Accelerator( 'N', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "MakeOverlayPatch", FreeCaller<void(), Patch_OverlayOn>(), Accelerator( 'Y' ) );
+ GlobalCommands_insert( "ClearPatchOverlays", FreeCaller<void(), Patch_OverlayOff>(), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) );
}
void Patch_constructToolbar( ui::Toolbar toolbar ){
//TODO: some modules/plugins do not yet support refresh
#if 0
- create_menu_item_with_mnemonic( menu, "Refresh", FreeCaller<Restart>() );
+ create_menu_item_with_mnemonic( menu, "Refresh", FreeCaller<void(), Restart>() );
// NOTE: the seperator is used when doing a refresh of the list, everything past the seperator is removed
g_plugins_menu_separator = menu_separator( menu );
GlobalShaderCache().attachRenderable( s_pointfile );
- GlobalCommands_insert( "TogglePointfile", FreeCaller<Pointfile_Toggle>() );
- GlobalCommands_insert( "NextLeakSpot", FreeCaller<Pointfile_Next>(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "PrevLeakSpot", FreeCaller<Pointfile_Prev>(), Accelerator( 'L', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "TogglePointfile", FreeCaller<void(), Pointfile_Toggle>() );
+ GlobalCommands_insert( "NextLeakSpot", FreeCaller<void(), Pointfile_Next>(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "PrevLeakSpot", FreeCaller<void(), Pointfile_Prev>(), Accelerator( 'L', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
}
void Pointfile_Destroy(){
inline void XMLPreference_importString( XMLImporter& importer, const char* value ){
importer.write( value, string_length( value ) );
}
-typedef ReferenceCaller1<XMLImporter, const char*, XMLPreference_importString> XMLPreferenceImportStringCaller;
+typedef ReferenceCaller<XMLImporter, void(const char*), XMLPreference_importString> XMLPreferenceImportStringCaller;
class XMLPreferenceDictionaryExporter : public XMLExporter
{
Mouse_constructPreferences( page );
}
void Mouse_registerPreferencesPage(){
- PreferencesDialog_addInterfacePage( FreeCaller1<PreferenceGroup&, Mouse_constructPage>() );
+ PreferencesDialog_addInterfacePage( FreeCaller<void(PreferenceGroup&), Mouse_constructPage>() );
}
g_Console_enableLogging = string_equal( string, "true" );
Sys_LogFile( g_Console_enableLogging );
}
-typedef FreeCaller1<const char*, LogConsole_importString> LogConsoleImportStringCaller;
+typedef FreeCaller<void(const char*), LogConsole_importString> LogConsoleImportStringCaller;
void RegisterGlobalPreferences( PreferenceSystem& preferences ){
page.appendCombo(
"Select the game",
StringArrayRange( &( *games.begin() ), &( *games.end() ) ),
- ReferenceCaller1<CGameDialog, int, CGameDialog_GameFileImport>( *this ),
- ReferenceCaller1<CGameDialog, const IntImportCallback&, CGameDialog_GameFileExport>( *this )
+ ReferenceCaller<CGameDialog, void(int), CGameDialog_GameFileImport>( *this ),
+ ReferenceCaller<CGameDialog, void(const IntImportCallback&), CGameDialog_GameFileExport>( *this )
);
page.appendCheckBox( "Startup", "Show Global Preferences", m_bGamePrompt );
}
};
ui::Window PrefsDlg::BuildDialog(){
- PreferencesDialog_addInterfacePreferences( FreeCaller1<PreferencesPage&, Interface_constructPreferences>() );
+ PreferencesDialog_addInterfacePreferences( FreeCaller<void(PreferencesPage&), Interface_constructPreferences>() );
Mouse_registerPreferencesPage();
ui::Window dialog = ui::Window(create_floating_window( "NetRadiant Preferences", m_parent ));
void GameName_importString( const char* value ){
gamename_set( value );
}
-typedef FreeCaller1<const char*, GameName_importString> GameNameImportStringCaller;
+typedef FreeCaller<void(const char*), GameName_importString> GameNameImportStringCaller;
void GameName_exportString( const StringImportCallback& importer ){
importer( gamename_get() );
}
-typedef FreeCaller1<const StringImportCallback&, GameName_exportString> GameNameExportStringCaller;
+typedef FreeCaller<void(const StringImportCallback&), GameName_exportString> GameNameExportStringCaller;
void GameMode_importString( const char* value ){
gamemode_set( value );
}
-typedef FreeCaller1<const char*, GameMode_importString> GameModeImportStringCaller;
+typedef FreeCaller<void(const char*), GameMode_importString> GameModeImportStringCaller;
void GameMode_exportString( const StringImportCallback& importer ){
importer( gamemode_get() );
}
-typedef FreeCaller1<const StringImportCallback&, GameMode_exportString> GameModeExportStringCaller;
+typedef FreeCaller<void(const StringImportCallback&), GameMode_exportString> GameModeExportStringCaller;
void RegisterPreferences( PreferenceSystem& preferences ){
}
};
-typedef Callback1<PreferencesPage&> PreferencesPageCallback;
+typedef Callback<void(PreferencesPage&)> PreferencesPageCallback;
class PreferenceGroup
{
virtual PreferencesPage createPage( const char* treeName, const char* frameName ) = 0;
};
-typedef Callback1<PreferenceGroup&> PreferenceGroupCallback;
+typedef Callback<void(PreferenceGroup&)> PreferenceGroupCallback;
void PreferencesDialog_addInterfacePreferences( const PreferencesPageCallback& callback );
void PreferencesDialog_addInterfacePage( const PreferenceGroupCallback& callback );
};
typedef LatchedValue<bool> LatchedBool;
-typedef MemberCaller1<LatchedBool, bool, &LatchedBool::import> LatchedBoolImportCaller;
+typedef MemberCaller<LatchedBool, void(bool), &LatchedBool::import> LatchedBoolImportCaller;
typedef LatchedValue<int> LatchedInt;
-typedef MemberCaller1<LatchedInt, int, &LatchedInt::import> LatchedIntImportCaller;
+typedef MemberCaller<LatchedInt, void(int), &LatchedInt::import> LatchedIntImportCaller;
/*!
holds information for a given game
void connectMap(){
MapFile* map = Node_getMapFile( m_model );
if ( map != 0 ) {
- map->setChangedCallback( FreeCaller<MapChanged>() );
+ map->setChangedCallback( FreeCaller<void(), MapChanged>() );
}
}
std::time_t modified() const {
break;
}
}
-typedef ConstMemberCaller1<RenderHighlighted, const Renderable&, &RenderHighlighted::render> RenderCaller;
+typedef ConstMemberCaller<RenderHighlighted, void(const Renderable&), &RenderHighlighted::render> RenderCaller;
bool pre( const scene::Path& path, scene::Instance& instance, VolumeIntersectionValue parentVisible ) const {
m_renderer.PushState();
if ( ( ( *i )->state().m_state & RENDER_BUMP ) != 0 ) {
if ( lights != 0 ) {
OpenGLStateBucketAdd add( *( *i ), renderable, modelview );
- lights->forEachLight( makeCallback1( add ) );
+ lights->forEachLight(makeCallback( add ) );
}
}
else
{
LightCullable& m_cullable;
RendererLights& m_allLights;
-Callback m_evaluateChanged;
+Callback<void()> m_evaluateChanged;
typedef std::list<RendererLight*> Lights;
mutable Lights m_lights;
mutable bool m_lightsChanged;
public:
-LinearLightList( LightCullable& cullable, RendererLights& lights, const Callback& evaluateChanged ) :
+LinearLightList( LightCullable& cullable, RendererLights& lights, const Callback<void()>& evaluateChanged ) :
m_cullable( cullable ), m_allLights( lights ), m_evaluateChanged( evaluateChanged ){
m_lightsChanged = true;
}
}
}
}
-typedef MemberCaller<OpenGLShaderCache, &OpenGLShaderCache::evaluateChanged> EvaluateChangedCaller;
+typedef MemberCaller<OpenGLShaderCache, void(), &OpenGLShaderCache::evaluateChanged> EvaluateChangedCaller;
typedef std::set<const Renderable*> Renderables;
Renderables m_renderables;
Select_GetBounds( g_select_workzone.d_work_min, g_select_workzone.d_work_max );
}
}
-typedef FreeCaller<Selection_UpdateWorkzone> SelectionUpdateWorkzoneCaller;
+typedef FreeCaller<void(), Selection_UpdateWorkzone> SelectionUpdateWorkzoneCaller;
IdleDraw g_idleWorkzone = IdleDraw( SelectionUpdateWorkzoneCaller() );
}
SignalHandlerId Selection_boundsChanged;
void Selection_construct(){
- typedef FreeCaller1<const Selectable&, SceneSelectionChange> SceneSelectionChangeCaller;
+ typedef FreeCaller<void(const Selectable&), SceneSelectionChange> SceneSelectionChangeCaller;
GlobalSelectionSystem().addSelectionChangeCallback( SceneSelectionChangeCaller() );
- typedef FreeCaller1<const Selectable&, UpdateWorkzone_ForSelectionChanged> UpdateWorkzoneForSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), UpdateWorkzone_ForSelectionChanged> UpdateWorkzoneForSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( UpdateWorkzoneForSelectionChangedCaller() );
- typedef FreeCaller<UpdateWorkzone_ForSelection> UpdateWorkzoneForSelectionCaller;
+ typedef FreeCaller<void(), UpdateWorkzone_ForSelection> UpdateWorkzoneForSelectionCaller;
Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( UpdateWorkzoneForSelectionCaller() );
}
bool contains( const Plane3& plane ) const {
return PlaneSet_contains( m_selectedPlanes, plane );
}
-typedef MemberCaller1<SelectedPlaneSet, const Plane3&, &SelectedPlaneSet::insert> InsertCaller;
+typedef MemberCaller<SelectedPlaneSet, void(const Plane3&), &SelectedPlaneSet::insert> InsertCaller;
};
m_pivotChanged = true;
SceneChangeNotify();
}
-typedef ConstMemberCaller<RadiantSelectionSystem, &RadiantSelectionSystem::pivotChanged> PivotChangedCaller;
+typedef ConstMemberCaller<RadiantSelectionSystem, void(), &RadiantSelectionSystem::pivotChanged> PivotChangedCaller;
void pivotChangedSelection( const Selectable& selectable ){
pivotChanged();
}
-typedef MemberCaller1<RadiantSelectionSystem, const Selectable&, &RadiantSelectionSystem::pivotChangedSelection> PivotChangedSelectionCaller;
+typedef MemberCaller<RadiantSelectionSystem, void(const Selectable&), &RadiantSelectionSystem::pivotChangedSelection> PivotChangedSelectionCaller;
void SetMode( EMode mode ){
if ( m_mode != mode ) {
SelectionChangeCallback getObserver( EMode mode ){
if ( mode == ePrimitive ) {
- return makeCallback1( m_count_primitive );
+ return makeCallback( m_count_primitive );
}
else
{
- return makeCallback1( m_count_component );
+ return makeCallback( m_count_component );
}
}
std::size_t countSelected() const {
void selectionChanged( const Selectable& selectable ){
m_selectionChanged_callbacks( selectable );
}
-typedef MemberCaller1<RadiantSelectionSystem, const Selectable&, &RadiantSelectionSystem::selectionChanged> SelectionChangedCaller;
+typedef MemberCaller<RadiantSelectionSystem, void(const Selectable&), &RadiantSelectionSystem::selectionChanged> SelectionChangedCaller;
void startMove(){
g_RadiantSelectionSystem = new RadiantSelectionSystem;
- SelectionSystem_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( FreeCaller<SelectionSystem_OnBoundsChanged>() );
+ SelectionSystem_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( FreeCaller<void(), SelectionSystem_OnBoundsChanged>() );
GlobalShaderCache().attachRenderable( getSelectionSystem() );
}
return WindowVector( window_constrained( window.x(), x, width ), window_constrained( window.y(), y, height ) );
}
-typedef Callback1<DeviceVector> MouseEventCallback;
+typedef Callback<void(DeviceVector)> MouseEventCallback;
Single<MouseEventCallback> g_mouseMovedCallback;
Single<MouseEventCallback> g_mouseUpCallback;
m_current = device_constrained( position );
draw_area();
}
-typedef MemberCaller1<Selector_, DeviceVector, &Selector_::mouseMoved> MouseMovedCaller;
+typedef MemberCaller<Selector_, void(DeviceVector), &Selector_::mouseMoved> MouseMovedCaller;
void mouseUp( DeviceVector position ){
testSelect( device_constrained( position ) );
g_mouseMovedCallback.clear();
g_mouseUpCallback.clear();
}
-typedef MemberCaller1<Selector_, DeviceVector, &Selector_::mouseUp> MouseUpCaller;
+typedef MemberCaller<Selector_, void(DeviceVector), &Selector_::mouseUp> MouseUpCaller;
};
void mouseMoved( DeviceVector position ){
getSelectionSystem().MoveSelected( *m_view, &position[0] );
}
-typedef MemberCaller1<Manipulator_, DeviceVector, &Manipulator_::mouseMoved> MouseMovedCaller;
+typedef MemberCaller<Manipulator_, void(DeviceVector), &Manipulator_::mouseMoved> MouseMovedCaller;
void mouseUp( DeviceVector position ){
getSelectionSystem().endMove();
g_mouseMovedCallback.clear();
g_mouseUpCallback.clear();
}
-typedef MemberCaller1<Manipulator_, DeviceVector, &Manipulator_::mouseUp> MouseUpCaller;
+typedef MemberCaller<Manipulator_, void(DeviceVector), &Manipulator_::mouseUp> MouseUpCaller;
};
void Scene_copyClosestTexture( SelectionTest& test );
float max[2];
};
-typedef Callback1<rect_t> RectangleCallback;
+typedef Callback<void(rect_t)> RectangleCallback;
class View;
void cancel(){
entry_set_float( m_entry, m_f );
}
-typedef MemberCaller<Increment, &Increment::cancel> CancelCaller;
+typedef MemberCaller<Increment, void(), &Increment::cancel> CancelCaller;
void apply(){
m_f = static_cast<float>( entry_get_float( m_entry ) );
spin_button_set_step( m_spin, m_f );
}
-typedef MemberCaller<Increment, &Increment::apply> ApplyCaller;
+typedef MemberCaller<Increment, void(), &Increment::apply> ApplyCaller;
};
void SurfaceInspector_GridChange();
void constructWindow( ui::Window main_window ){
m_parent = main_window;
Create();
- AddGridChangeCallback( FreeCaller<SurfaceInspector_GridChange>() );
+ AddGridChangeCallback( FreeCaller<void(), SurfaceInspector_GridChange>() );
}
void destroyWindow(){
Destroy();
}
void Update();
-typedef MemberCaller<SurfaceInspector, &SurfaceInspector::Update> UpdateCaller;
+typedef MemberCaller<SurfaceInspector, void(), &SurfaceInspector::Update> UpdateCaller;
void ApplyShader();
-typedef MemberCaller<SurfaceInspector, &SurfaceInspector::ApplyShader> ApplyShaderCaller;
+typedef MemberCaller<SurfaceInspector, void(), &SurfaceInspector::ApplyShader> ApplyShaderCaller;
void ApplyTexdef();
-typedef MemberCaller<SurfaceInspector, &SurfaceInspector::ApplyTexdef> ApplyTexdefCaller;
+typedef MemberCaller<SurfaceInspector, void(), &SurfaceInspector::ApplyTexdef> ApplyTexdefCaller;
void ApplyFlags();
-typedef MemberCaller<SurfaceInspector, &SurfaceInspector::ApplyFlags> ApplyFlagsCaller;
+typedef MemberCaller<SurfaceInspector, void(), &SurfaceInspector::ApplyFlags> ApplyFlagsCaller;
};
namespace
// =============================================================================
// SurfaceInspector class
-guint togglebutton_connect_toggled( ui::ToggleButton button, const Callback& callback ){
+guint togglebutton_connect_toggled( ui::ToggleButton button, const Callback<void()>& callback ){
return g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
}
face.GetTexdef( projection );
flags = face.getShader().m_flags;
}
-typedef Function4<Face&, CopiedString&, TextureProjection&, ContentsFlagsValue&, void, Face_getTexture> FaceGetTexture;
+typedef Function<void(Face&, CopiedString&, TextureProjection&, ContentsFlagsValue&), Face_getTexture> FaceGetTexture;
void Face_setTexture( Face& face, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags ){
face.SetShader( shader );
face.SetTexdef( projection );
face.SetFlags( flags );
}
-typedef Function4<Face&, const char*, const TextureProjection&, const ContentsFlagsValue&, void, Face_setTexture> FaceSetTexture;
+typedef Function<void(Face&, const char*, const TextureProjection&, const ContentsFlagsValue&), Face_setTexture> FaceSetTexture;
void Patch_getTexture( Patch& patch, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags ){
projection = TextureProjection( texdef_t(), brushprimit_texdef_t(), Vector3( 0, 0, 0 ), Vector3( 0, 0, 0 ) );
flags = ContentsFlagsValue( 0, 0, 0, false );
}
-typedef Function4<Patch&, CopiedString&, TextureProjection&, ContentsFlagsValue&, void, Patch_getTexture> PatchGetTexture;
+typedef Function<void(Patch&, CopiedString&, TextureProjection&, ContentsFlagsValue&), Patch_getTexture> PatchGetTexture;
void Patch_setTexture( Patch& patch, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags ){
patch.SetShader( shader );
}
-typedef Function4<Patch&, const char*, const TextureProjection&, const ContentsFlagsValue&, void, Patch_setTexture> PatchSetTexture;
+typedef Function<void(Patch&, const char*, const TextureProjection&, const ContentsFlagsValue&), Patch_setTexture> PatchSetTexture;
-typedef Callback3<CopiedString&, TextureProjection&, ContentsFlagsValue&> GetTextureCallback;
-typedef Callback3<const char*, const TextureProjection&, const ContentsFlagsValue&> SetTextureCallback;
+typedef Callback<void(CopiedString&, TextureProjection&, ContentsFlagsValue&)> GetTextureCallback;
+typedef Callback<void(const char*, const TextureProjection&, const ContentsFlagsValue&)> SetTextureCallback;
struct Texturable
{
if ( intersection.valid()
&& SelectionIntersection_closer( intersection, bestIntersection ) ) {
bestIntersection = intersection;
- texturable.setTexture = makeCallback3( FaceSetTexture(), face );
- texturable.getTexture = makeCallback3( FaceGetTexture(), face );
+ texturable.setTexture = makeCallback( FaceSetTexture(), face );
+ texturable.getTexture = makeCallback( FaceGetTexture(), face );
}
}
if ( occluded ) {
Patch* patch = Node_getPatch( path.top() );
if ( patch != 0 ) {
- m_texturable.setTexture = makeCallback3( PatchSetTexture(), *patch );
- m_texturable.getTexture = makeCallback3( PatchGetTexture(), *patch );
+ m_texturable.setTexture = makeCallback( PatchSetTexture(), *patch );
+ m_texturable.getTexture = makeCallback( PatchGetTexture(), *patch );
}
else
{
SurfaceInspector_constructPreferences( page );
}
void SurfaceInspector_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, SurfaceInspector_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), SurfaceInspector_constructPage>() );
}
void SurfaceInspector_registerCommands(){
- GlobalCommands_insert( "FitTexture", FreeCaller<SurfaceInspector_FitTexture>(), Accelerator( 'B', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "SurfaceInspector", FreeCaller<SurfaceInspector_toggleShown>(), Accelerator( 'S' ) );
+ GlobalCommands_insert( "FitTexture", FreeCaller<void(), SurfaceInspector_FitTexture>(), Accelerator( 'B', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "SurfaceInspector", FreeCaller<void(), SurfaceInspector_toggleShown>(), Accelerator( 'S' ) );
- GlobalCommands_insert( "FaceCopyTexture", FreeCaller<SelectedFaces_copyTexture>() );
- GlobalCommands_insert( "FacePasteTexture", FreeCaller<SelectedFaces_pasteTexture>() );
+ GlobalCommands_insert( "FaceCopyTexture", FreeCaller<void(), SelectedFaces_copyTexture>() );
+ GlobalCommands_insert( "FacePasteTexture", FreeCaller<void(), SelectedFaces_pasteTexture>() );
}
GlobalPreferenceSystem().registerPreference( "SI_SurfaceTexdef_Rotate", FloatImportStringCaller( g_si_globals.rotate ), FloatExportStringCaller( g_si_globals.rotate ) );
GlobalPreferenceSystem().registerPreference( "SnapTToGrid", BoolImportStringCaller( g_si_globals.m_bSnapTToGrid ), BoolExportStringCaller( g_si_globals.m_bSnapTToGrid ) );
- typedef FreeCaller1<const Selectable&, SurfaceInspector_SelectionChanged> SurfaceInspectorSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), SurfaceInspector_SelectionChanged> SurfaceInspectorSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( SurfaceInspectorSelectionChangedCaller() );
- typedef FreeCaller<SurfaceInspector_updateSelection> SurfaceInspectorUpdateSelectionCaller;
+ typedef FreeCaller<void(), SurfaceInspector_updateSelection> SurfaceInspectorUpdateSelectionCaller;
Brush_addTextureChangedCallback( SurfaceInspectorUpdateSelectionCaller() );
Patch_addTextureChangedCallback( SurfaceInspectorUpdateSelectionCaller() );
void append(const char *string);
- using AppendCaller = MemberCaller1<EntryCompletion, const char *, &EntryCompletion::append>;
+ using AppendCaller = MemberCaller<EntryCompletion, void(const char *), &EntryCompletion::append>;
void fill();
void update();
- using UpdateCaller = MemberCaller<EntryCompletion, &EntryCompletion::update>;
+ using UpdateCaller = MemberCaller<EntryCompletion, void(), &EntryCompletion::update>;
};
class TextureNameList {
}
-Callback g_texturesModeChangedNotify;
+Callback<void()> g_texturesModeChangedNotify;
-void Textures_setModeChangedNotify( const Callback& notify ){
+void Textures_setModeChangedNotify( const Callback<void()>& notify ){
g_texturesModeChangedNotify = notify;
}
}
Textures_UpdateTextureCompressionFormat();
}
-typedef ReferenceCaller1<TextureCompressionFormat, int, TextureCompressionImport> TextureCompressionImportCaller;
+typedef ReferenceCaller<TextureCompressionFormat, void(int), TextureCompressionImport> TextureCompressionImportCaller;
void TextureGammaImport( float& self, float value ){
if ( self != value ) {
Textures_Realise();
}
}
-typedef ReferenceCaller1<float, float, TextureGammaImport> TextureGammaImportCaller;
+typedef ReferenceCaller<float, void(float), TextureGammaImport> TextureGammaImportCaller;
void TextureModeImport( ETexturesMode& self, int value ){
switch ( value )
Textures_SetMode( eTextures_MAX_ANISOTROPY );
}
}
-typedef ReferenceCaller1<ETexturesMode, int, TextureModeImport> TextureModeImportCaller;
+typedef ReferenceCaller<ETexturesMode, void(int), TextureModeImport> TextureModeImportCaller;
void TextureModeExport( ETexturesMode& self, const IntImportCallback& importer ){
switch ( self )
importer( 4 );
}
}
-typedef ReferenceCaller1<ETexturesMode, const IntImportCallback&, TextureModeExport> TextureModeExportCaller;
+typedef ReferenceCaller<ETexturesMode, void(const IntImportCallback&), TextureModeExport> TextureModeExportCaller;
void Textures_constructPreferences( PreferencesPage& page ){
{
Textures_constructPreferences( page );
}
void Textures_registerPreferencesPage(){
- PreferencesDialog_addDisplayPage( FreeCaller1<PreferenceGroup&, Textures_constructPage>() );
+ PreferencesDialog_addDisplayPage( FreeCaller<void(PreferenceGroup&), Textures_constructPage>() );
}
void TextureCompression_importString( const char* string ){
g_texture_globals.m_nTextureCompressionFormat = static_cast<TextureCompressionFormat>( atoi( string ) );
Textures_UpdateTextureCompressionFormat();
}
-typedef FreeCaller1<const char*, TextureCompression_importString> TextureCompressionImportStringCaller;
+typedef FreeCaller<void(const char*), TextureCompression_importString> TextureCompressionImportStringCaller;
void Textures_Construct(){
void Textures_Unrealise();
void Textures_sharedContextDestroyed();
-void Textures_setModeChangedNotify( const Callback& notify );
+void Textures_setModeChangedNotify( const Callback<void()>& notify );
#endif
#endif
}
}
-typedef ReferenceCaller1<TextureGroups, const char*, TextureGroups_addWad> TextureGroupsAddWadCaller;
+typedef ReferenceCaller<TextureGroups, void(const char*), TextureGroups_addWad> TextureGroupsAddWadCaller;
namespace
{
}
}
}
-typedef ReferenceCaller1<TextureGroups, const char*, TextureGroups_addShader> TextureGroupsAddShaderCaller;
+typedef ReferenceCaller<TextureGroups, void(const char*), TextureGroups_addShader> TextureGroupsAddShaderCaller;
void TextureGroups_addDirectory( TextureGroups& groups, const char* directory ){
groups.insert( directory );
}
-typedef ReferenceCaller1<TextureGroups, const char*, TextureGroups_addDirectory> TextureGroupsAddDirectoryCaller;
+typedef ReferenceCaller<TextureGroups, void(const char*), TextureGroups_addDirectory> TextureGroupsAddDirectoryCaller;
class DeferredAdjustment
{
class TextureBrowser;
-typedef ReferenceCaller<TextureBrowser, TextureBrowser_queueDraw> TextureBrowserQueueDrawCaller;
+typedef ReferenceCaller<TextureBrowser, void(), TextureBrowser_queueDraw> TextureBrowserQueueDrawCaller;
void TextureBrowser_scrollChanged( void* data, gdouble value );
};
void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
void TextureBrowser_showShadersExport( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
void TextureBrowser_fixedSize( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_fixedSize> TextureBrowserFixedSizeExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_fixedSize> TextureBrowserFixedSizeExport;
void TextureBrowser_filterMissing( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterMissing> TextureBrowserFilterMissingExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_filterMissing> TextureBrowserFilterMissingExport;
void TextureBrowser_filterFallback( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterFallback> TextureBrowserFilterFallbackExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_filterFallback> TextureBrowserFilterFallbackExport;
void TextureBrowser_enableAlpha( const BoolImportCallback& importer );
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_enableAlpha> TextureBrowserEnableAlphaExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_enableAlpha> TextureBrowserEnableAlphaExport;
class TextureBrowser
{
TextureBrowser_updateScroll( textureBrowser );
}
}
-typedef ReferenceCaller1<TextureBrowser, bool, TextureBrowser_importShowScrollbar> TextureBrowserImportShowScrollbarCaller;
+typedef ReferenceCaller<TextureBrowser, void(bool), TextureBrowser_importShowScrollbar> TextureBrowserImportShowScrollbarCaller;
/*
IShader* shader = QERApp_Shader_ForName( name.c_str() );
shader->DecRef();
}
-typedef ConstPointerCaller1<char, const char*, TextureDirectory_loadTexture> TextureDirectoryLoadTextureCaller;
+typedef ConstPointerCaller<char, void(const char*), TextureDirectory_loadTexture> TextureDirectoryLoadTextureCaller;
class LoadTexturesByTypeVisitor : public ImageModules::Visitor
{
TextureBrowser_heightChanged( textureBrowser );
std::size_t shaders_count;
- GlobalShaderSystem().foreachShaderName( makeCallback1( TextureCategoryLoadShader( directory, shaders_count ) ) );
+ GlobalShaderSystem().foreachShaderName(makeCallback( TextureCategoryLoadShader( directory, shaders_count ) ) );
globalOutputStream() << "Showing " << Unsigned( shaders_count ) << " shaders.\n";
if ( g_pGameDescription->mGameType != "doom3" ) {
TextureBrowser_heightChanged( textureBrowser );
std::size_t shaders_count;
- GlobalShaderSystem().foreachShaderName( makeCallback1( TextureCategoryLoadShader( directory, shaders_count ) ) );
+ GlobalShaderSystem().foreachShaderName(makeCallback( TextureCategoryLoadShader( directory, shaders_count ) ) );
globalOutputStream() << "Showing " << Unsigned( shaders_count ) << " shaders.\n";
if ( g_pGameDescription->mGameType != "doom3" ) {
void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer ){
importer( TextureBrowser_hideUnused() );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_hideUnusedExport> TextureBrowserHideUnusedExport;
void TextureBrowser_showShadersExport( const BoolImportCallback& importer ){
importer( GlobalTextureBrowser().m_showShaders );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_showShadersExport> TextureBrowserShowShadersExport;
void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer ){
importer( g_TextureBrowser_shaderlistOnly );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_showShaderlistOnly> TextureBrowserShowShaderlistOnlyExport;
void TextureBrowser_fixedSize( const BoolImportCallback& importer ){
importer( g_TextureBrowser_fixedSize );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_fixedSize> TextureBrowser_FixedSizeExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_fixedSize> TextureBrowser_FixedSizeExport;
void TextureBrowser_filterMissing( const BoolImportCallback& importer ){
importer( g_TextureBrowser_filterMissing );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterMissing> TextureBrowser_filterMissingExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_filterMissing> TextureBrowser_filterMissingExport;
void TextureBrowser_filterFallback( const BoolImportCallback& importer ){
importer( g_TextureBrowser_filterFallback );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_filterFallback> TextureBrowser_filterFallbackExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_filterFallback> TextureBrowser_filterFallbackExport;
void TextureBrowser_enableAlpha( const BoolImportCallback& importer ){
importer( g_TextureBrowser_enableAlpha );
}
-typedef FreeCaller1<const BoolImportCallback&, TextureBrowser_enableAlpha> TextureBrowser_enableAlphaExport;
+typedef FreeCaller<void(const BoolImportCallback&), TextureBrowser_enableAlpha> TextureBrowser_enableAlphaExport;
void TextureBrowser_SetHideUnused( TextureBrowser& textureBrowser, bool hideUnused ){
if ( hideUnused ) {
TextureBrowser_checkTagFile();
TextureBrowser_SetNotex();
- GlobalShaderSystem().setActiveShadersChangedNotify( ReferenceCaller<TextureBrowser, TextureBrowser_activeShadersChanged>( g_TextureBrowser ) );
+ GlobalShaderSystem().setActiveShadersChangedNotify( ReferenceCaller<TextureBrowser, void(), TextureBrowser_activeShadersChanged>( g_TextureBrowser ) );
g_TextureBrowser.m_parent = toplevel;
}
void TextureBrowser_destroyWindow(){
- GlobalShaderSystem().setActiveShadersChangedNotify( Callback() );
+ GlobalShaderSystem().setActiveShadersChangedNotify( Callback<void()>() );
g_signal_handler_disconnect( G_OBJECT( g_TextureBrowser.m_gl_widget ), g_TextureBrowser.m_sizeHandler );
g_signal_handler_disconnect( G_OBJECT( g_TextureBrowser.m_gl_widget ), g_TextureBrowser.m_exposeHandler );
break;
}
}
-typedef ReferenceCaller1<TextureBrowser, int, TextureScaleImport> TextureScaleImportCaller;
+typedef ReferenceCaller<TextureBrowser, void(int), TextureScaleImport> TextureScaleImportCaller;
void TextureScaleExport( TextureBrowser& textureBrowser, const IntImportCallback& importer ){
switch ( textureBrowser.m_textureScale )
break;
}
}
-typedef ReferenceCaller1<TextureBrowser, const IntImportCallback&, TextureScaleExport> TextureScaleExportCaller;
+typedef ReferenceCaller<TextureBrowser, void(const IntImportCallback&), TextureScaleExport> TextureScaleExportCaller;
void UniformTextureSizeImport( TextureBrowser& textureBrowser, int value ){
if ( value > 16 )
TextureBrowser_setUniformSize( textureBrowser, value );
}
-typedef ReferenceCaller1<TextureBrowser, int, UniformTextureSizeImport> UniformTextureSizeImportCaller;
+typedef ReferenceCaller<TextureBrowser, void(int), UniformTextureSizeImport> UniformTextureSizeImportCaller;
void TextureBrowser_constructPreferences( PreferencesPage& page ){
page.appendCheckBox(
TextureBrowser_constructPreferences( page );
}
void TextureBrowser_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, TextureBrowser_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), TextureBrowser_constructPage>() );
}
#include "preferencesystem.h"
#include "stringio.h"
-typedef ReferenceCaller1<TextureBrowser, std::size_t, TextureBrowser_setScale> TextureBrowserSetScaleCaller;
+typedef ReferenceCaller<TextureBrowser, void(std::size_t), TextureBrowser_setScale> TextureBrowserSetScaleCaller;
void TextureClipboard_textureSelected( const char* shader );
void TextureBrowser_Construct(){
- GlobalCommands_insert( "ShaderInfo", FreeCaller<TextureBrowser_shaderInfo>() );
- GlobalCommands_insert( "ShowUntagged", FreeCaller<TextureBrowser_showUntagged>() );
- GlobalCommands_insert( "AddTag", FreeCaller<TextureBrowser_addTag>() );
- GlobalCommands_insert( "RenameTag", FreeCaller<TextureBrowser_renameTag>() );
- GlobalCommands_insert( "DeleteTag", FreeCaller<TextureBrowser_deleteTag>() );
- GlobalCommands_insert( "CopyTag", FreeCaller<TextureBrowser_copyTag>() );
- GlobalCommands_insert( "PasteTag", FreeCaller<TextureBrowser_pasteTag>() );
- GlobalCommands_insert( "RefreshShaders", FreeCaller<VFS_Refresh>() );
- GlobalToggles_insert( "ShowInUse", FreeCaller<TextureBrowser_ToggleHideUnused>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
- GlobalCommands_insert( "ShowAllTextures", FreeCaller<TextureBrowser_showAll>(), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "ToggleTextures", FreeCaller<TextureBrowser_toggleShow>(), Accelerator( 'T' ) );
- GlobalToggles_insert( "ToggleShowShaders", FreeCaller<TextureBrowser_ToggleShowShaders>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
- GlobalToggles_insert( "ToggleShowShaderlistOnly", FreeCaller<TextureBrowser_ToggleShowShaderListOnly>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
- GlobalToggles_insert( "FixedSize", FreeCaller<TextureBrowser_FixedSize>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
- GlobalToggles_insert( "FilterMissing", FreeCaller<TextureBrowser_FilterMissing>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
- GlobalToggles_insert( "FilterFallback", FreeCaller<TextureBrowser_FilterFallback>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) );
- GlobalToggles_insert( "EnableAlpha", FreeCaller<TextureBrowser_EnableAlpha>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
+ GlobalCommands_insert( "ShaderInfo", FreeCaller<void(), TextureBrowser_shaderInfo>() );
+ GlobalCommands_insert( "ShowUntagged", FreeCaller<void(), TextureBrowser_showUntagged>() );
+ GlobalCommands_insert( "AddTag", FreeCaller<void(), TextureBrowser_addTag>() );
+ GlobalCommands_insert( "RenameTag", FreeCaller<void(), TextureBrowser_renameTag>() );
+ GlobalCommands_insert( "DeleteTag", FreeCaller<void(), TextureBrowser_deleteTag>() );
+ GlobalCommands_insert( "CopyTag", FreeCaller<void(), TextureBrowser_copyTag>() );
+ GlobalCommands_insert( "PasteTag", FreeCaller<void(), TextureBrowser_pasteTag>() );
+ GlobalCommands_insert( "RefreshShaders", FreeCaller<void(), VFS_Refresh>() );
+ GlobalToggles_insert( "ShowInUse", FreeCaller<void(), TextureBrowser_ToggleHideUnused>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
+ GlobalCommands_insert( "ShowAllTextures", FreeCaller<void(), TextureBrowser_showAll>(), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "ToggleTextures", FreeCaller<void(), TextureBrowser_toggleShow>(), Accelerator( 'T' ) );
+ GlobalToggles_insert( "ToggleShowShaders", FreeCaller<void(), TextureBrowser_ToggleShowShaders>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
+ GlobalToggles_insert( "ToggleShowShaderlistOnly", FreeCaller<void(), TextureBrowser_ToggleShowShaderListOnly>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
+ GlobalToggles_insert( "FixedSize", FreeCaller<void(), TextureBrowser_FixedSize>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
+ GlobalToggles_insert( "FilterMissing", FreeCaller<void(), TextureBrowser_FilterMissing>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
+ GlobalToggles_insert( "FilterFallback", FreeCaller<void(), TextureBrowser_FilterFallback>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) );
+ GlobalToggles_insert( "EnableAlpha", FreeCaller<void(), TextureBrowser_EnableAlpha>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
GlobalPreferenceSystem().registerPreference( "TextureScale",
makeSizeStringImportCallback( TextureBrowserSetScaleCaller( g_TextureBrowser ) ),
g_TextureBrowser.shader = texdef_name_default();
- Textures_setModeChangedNotify( ReferenceCaller<TextureBrowser, TextureBrowser_queueDraw>( g_TextureBrowser ) );
+ Textures_setModeChangedNotify( ReferenceCaller<TextureBrowser, void(), TextureBrowser_queueDraw>( g_TextureBrowser ) );
TextureBrowser_registerPreferencesPage();
void TextureBrowser_Destroy(){
GlobalShaderSystem().detach( g_ShadersObserver );
- Textures_setModeChangedNotify( Callback() );
+ Textures_setModeChangedNotify( Callback<void()>() );
}
void TextureBrowser_Construct();
void TextureBrowser_Destroy();
-typedef Callback1<const char*> StringImportCallback;
+typedef Callback<void(const char*)> StringImportCallback;
extern ui::Widget g_page_textures;
void TextureBrowser_exportTitle( const StringImportCallback& importer );
-typedef FreeCaller1<const StringImportCallback&, TextureBrowser_exportTitle> TextureBrowserExportTitleCaller;
+typedef FreeCaller<void(const StringImportCallback&), TextureBrowser_exportTitle> TextureBrowserExportTitleCaller;
const Vector3& TextureBrowser_getBackgroundColour( TextureBrowser& textureBrowser );
void TextureBrowser_setBackgroundColour( TextureBrowser& textureBrowser, const Vector3& colour );
return true;
}
-void node_attach_name_changed_callback( scene::Node& node, const Callback& callback ){
+void node_attach_name_changed_callback( scene::Node& node, const Callback<void()>& callback ){
if ( node != 0 ) {
Nameable* nameable = Node_getNameable( node );
if ( nameable != 0 ) {
}
}
}
-void node_detach_name_changed_callback( scene::Node& node, const Callback& callback ){
+void node_detach_name_changed_callback( scene::Node& node, const Callback<void()>& callback ){
if ( node != 0 ) {
Nameable* nameable = Node_getNameable( node );
if ( nameable != 0 ) {
gtk_tree_store_append( GTK_TREE_STORE( model ), &child, parent_pointer );
gtk_tree_store_set( GTK_TREE_STORE( model ), &child, 0, node, 1, selectable, -1 );
- node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, graph_tree_model_row_changed>( instance ) );
+ node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, void(), graph_tree_model_row_changed>( instance ) );
}
void graph_tree_model_row_deleted( GraphTreeModel* model, const scene::Instance& instance ){
GtkTreeIter child;
ASSERT_MESSAGE( graph_tree_model_find_top( model, instance.path(), child ), "RUNTIME ERROR" );
- node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, graph_tree_model_row_changed>( instance ) );
+ node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, void(), graph_tree_model_row_changed>( instance ) );
gtk_tree_store_remove( GTK_TREE_STORE( model ), &child );
}
graph_tree_model_row_inserted( model, i );
- node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller1<scene::Instance, const char*, graph_tree_model_set_name>( instance ) );
+ node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, void(const char*), graph_tree_model_set_name>( instance ) );
}
void graph_tree_model_erase( GraphTreeModel* model, const scene::Instance& instance ){
- node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller1<scene::Instance, const char*, graph_tree_model_set_name>( instance ) );
+ node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, void(const char*), graph_tree_model_set_name>( instance ) );
graph_type::iterator i = model->graph->find( PathConstReference( instance.path() ) );
ASSERT_MESSAGE( i != model->graph->end(), "ERROR" );
m_instance.get().setChildSelectedChangedCallback( RowChangedCaller( *this ) );
}
~GraphTreeNode(){
- m_instance.get().setChildSelectedChangedCallback( Callback() );
+ m_instance.get().setChildSelectedChangedCallback( Callback<void()>() );
ASSERT_MESSAGE( empty(), "GraphTreeNode::~GraphTreeNode: memory leak" );
}
void rowChanged(){
graph_tree_model_row_changed( *this );
}
-typedef MemberCaller<GraphTreeNode, &GraphTreeNode::rowChanged> RowChangedCaller;
+typedef MemberCaller<GraphTreeNode, void(), &GraphTreeNode::rowChanged> RowChangedCaller;
};
struct GraphTreeModel
GraphTreeModel* scene_graph_get_tree_model(); // temp hack
-void graph_tree_node_foreach_pre( GraphTreeNode::iterator root, const Callback1<GraphTreeNode::iterator>& callback ){
+void graph_tree_node_foreach_pre( GraphTreeNode::iterator root, const Callback<void(GraphTreeNode::iterator)>& callback ){
callback( root );
for ( GraphTreeNode::iterator i = ( *root ).second->begin(); i != ( *root ).second->end(); ++i )
{
}
}
-void graph_tree_node_foreach_post( GraphTreeNode::iterator root, const Callback1<GraphTreeNode::iterator>& callback ){
+void graph_tree_node_foreach_post( GraphTreeNode::iterator root, const Callback<void(GraphTreeNode::iterator)>& callback ){
for ( GraphTreeNode::iterator i = ( *root ).second->begin(); i != ( *root ).second->end(); ++i )
{
graph_tree_node_foreach_post( i, callback );
GraphTreeNode* parent = graph_tree_model_find_parent( model, instance.path() );
GraphTreeNode::iterator oldNode = parent->find( GraphTreeNode::key_type( node_get_name_safe( instance.path().top().get() ), instance.path().top().get_pointer() ) );
- graph_tree_node_foreach_post( oldNode, ReferenceCaller1<GraphTreeModel, GraphTreeNode::iterator, graph_tree_model_row_deleted>( *model ) );
+ graph_tree_node_foreach_post( oldNode, ReferenceCaller<GraphTreeModel, void(GraphTreeNode::iterator), graph_tree_model_row_deleted>( *model ) );
GraphTreeNode* node( ( *oldNode ).second );
parent->erase( oldNode );
GraphTreeNode::iterator newNode = parent->insert( GraphTreeNode::value_type( GraphTreeNode::key_type( name, &instance.path().top().get() ), node ) );
- graph_tree_node_foreach_pre( newNode, ReferenceCaller1<GraphTreeModel, GraphTreeNode::iterator, graph_tree_model_row_inserted>( *model ) );
+ graph_tree_node_foreach_pre( newNode, ReferenceCaller<GraphTreeModel, void(GraphTreeNode::iterator), graph_tree_model_row_inserted>( *model ) );
}
void graph_tree_model_insert( GraphTreeModel* model, const scene::Instance& instance ){
graph_tree_model_row_inserted( model, i );
- node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller1<scene::Instance, const char*, graph_tree_model_set_name>( instance ) );
+ node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, void(const char*), graph_tree_model_set_name>( instance ) );
}
void graph_tree_model_erase( GraphTreeModel* model, const scene::Instance& instance ){
- node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller1<scene::Instance, const char*, graph_tree_model_set_name>( instance ) );
+ node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller<scene::Instance, void(const char*), graph_tree_model_set_name>( instance ) );
GraphTreeNode* parent = graph_tree_model_find_parent( model, instance.path() );
Int_importString( levels, value );
undo.setLevels( levels );
}
-typedef ReferenceCaller1<RadiantUndoSystem, const char*, UndoLevels_importString> UndoLevelsImportStringCaller;
+typedef ReferenceCaller<RadiantUndoSystem, void(const char*), UndoLevels_importString> UndoLevelsImportStringCaller;
void UndoLevels_exportString( const RadiantUndoSystem& undo, const StringImportCallback& importer ){
Int_exportString( static_cast<int>( undo.getLevels() ), importer );
}
-typedef ConstReferenceCaller1<RadiantUndoSystem, const StringImportCallback&, UndoLevels_exportString> UndoLevelsExportStringCaller;
+typedef ConstReferenceCaller<RadiantUndoSystem, void(const StringImportCallback&), UndoLevels_exportString> UndoLevelsExportStringCaller;
#include "generic/callback.h"
void UndoLevelsImport( RadiantUndoSystem& self, int value ){
self.setLevels( value );
}
-typedef ReferenceCaller1<RadiantUndoSystem, int, UndoLevelsImport> UndoLevelsImportCaller;
+typedef ReferenceCaller<RadiantUndoSystem, void(int), UndoLevelsImport> UndoLevelsImportCaller;
void UndoLevelsExport( const RadiantUndoSystem& self, const IntImportCallback& importCallback ){
importCallback( static_cast<int>( self.getLevels() ) );
}
-typedef ConstReferenceCaller1<RadiantUndoSystem, const IntImportCallback&, UndoLevelsExport> UndoLevelsExportCaller;
+typedef ConstReferenceCaller<RadiantUndoSystem, void(const IntImportCallback&), UndoLevelsExport> UndoLevelsExportCaller;
void Undo_constructPreferences( RadiantUndoSystem& undo, PreferencesPage& page ){
Undo_constructPreferences( undo, page );
}
void Undo_registerPreferencesPage( RadiantUndoSystem& undo ){
- PreferencesDialog_addSettingsPage( ReferenceCaller1<RadiantUndoSystem, PreferenceGroup&, Undo_constructPage>( undo ) );
+ PreferencesDialog_addSettingsPage( ReferenceCaller<RadiantUndoSystem, void(PreferenceGroup&), Undo_constructPage>( undo ) );
}
class UndoSystemDependencies : public GlobalPreferenceSystemModuleRef
Build_constructPreferences( page );
}
void Build_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Build_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Build_constructPage>() );
}
#include "preferencesystem.h"
GlobalWindowObservers_add( m_window_observer );
GlobalWindowObservers_connectWidget( m_gl_widget );
- m_window_observer->setRectangleDrawCallback( ReferenceCaller1<XYWnd, rect_t, xy_update_xor_rectangle>( *this ) );
+ m_window_observer->setRectangleDrawCallback( ReferenceCaller<XYWnd, void(rect_t), xy_update_xor_rectangle>( *this ) );
m_window_observer->setView( m_view );
g_object_ref( m_gl_widget._handle );
updateProjection();
updateModelview();
- AddSceneChangeCallback( ReferenceCaller<XYWnd, &XYWnd_Update>( *this ) );
- AddCameraMovedCallback( ReferenceCaller<XYWnd, &XYWnd_CameraMoved>( *this ) );
+ AddSceneChangeCallback( ReferenceCaller<XYWnd, void(), &XYWnd_Update>( *this ) );
+ AddCameraMovedCallback( ReferenceCaller<XYWnd, void(), &XYWnd_CameraMoved>( *this ) );
PressedButtons_connect( g_pressedButtons, m_gl_widget );
GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() );
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowNamesToggle> ShowNamesToggleCaller;
+typedef FreeCaller<void(), ShowNamesToggle> ShowNamesToggleCaller;
void ShowNamesExport( const BoolImportCallback& importer ){
importer( GlobalEntityCreator().getShowNames() );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowNamesExport> ShowNamesExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowNamesExport> ShowNamesExportCaller;
void ShowAnglesToggle(){
GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() );
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowAnglesToggle> ShowAnglesToggleCaller;
+typedef FreeCaller<void(), ShowAnglesToggle> ShowAnglesToggleCaller;
void ShowAnglesExport( const BoolImportCallback& importer ){
importer( GlobalEntityCreator().getShowAngles() );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowAnglesExport> ShowAnglesExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowAnglesExport> ShowAnglesExportCaller;
void ShowBlocksToggle(){
g_xywindow_globals_private.show_blocks ^= 1;
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowBlocksToggle> ShowBlocksToggleCaller;
+typedef FreeCaller<void(), ShowBlocksToggle> ShowBlocksToggleCaller;
void ShowBlocksExport( const BoolImportCallback& importer ){
importer( g_xywindow_globals_private.show_blocks );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowBlocksExport> ShowBlocksExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowBlocksExport> ShowBlocksExportCaller;
void ShowCoordinatesToggle(){
g_xywindow_globals_private.show_coordinates ^= 1;
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowCoordinatesToggle> ShowCoordinatesToggleCaller;
+typedef FreeCaller<void(), ShowCoordinatesToggle> ShowCoordinatesToggleCaller;
void ShowCoordinatesExport( const BoolImportCallback& importer ){
importer( g_xywindow_globals_private.show_coordinates );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowCoordinatesExport> ShowCoordinatesExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowCoordinatesExport> ShowCoordinatesExportCaller;
void ShowOutlineToggle(){
g_xywindow_globals_private.show_outline ^= 1;
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowOutlineToggle> ShowOutlineToggleCaller;
+typedef FreeCaller<void(), ShowOutlineToggle> ShowOutlineToggleCaller;
void ShowOutlineExport( const BoolImportCallback& importer ){
importer( g_xywindow_globals_private.show_outline );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowOutlineExport> ShowOutlineExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowOutlineExport> ShowOutlineExportCaller;
void ShowAxesToggle(){
g_xywindow_globals_private.show_axis ^= 1;
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowAxesToggle> ShowAxesToggleCaller;
+typedef FreeCaller<void(), ShowAxesToggle> ShowAxesToggleCaller;
void ShowAxesExport( const BoolImportCallback& importer ){
importer( g_xywindow_globals_private.show_axis );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowAxesExport> ShowAxesExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowAxesExport> ShowAxesExportCaller;
void ShowWorkzoneToggle(){
g_xywindow_globals_private.d_show_work ^= 1;
XY_UpdateAllWindows();
}
-typedef FreeCaller<ShowWorkzoneToggle> ShowWorkzoneToggleCaller;
+typedef FreeCaller<void(), ShowWorkzoneToggle> ShowWorkzoneToggleCaller;
void ShowWorkzoneExport( const BoolImportCallback& importer ){
importer( g_xywindow_globals_private.d_show_work );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowWorkzoneExport> ShowWorkzoneExportCaller;
+typedef FreeCaller<void(const BoolImportCallback&), ShowWorkzoneExport> ShowWorkzoneExportCaller;
ShowNamesExportCaller g_show_names_caller;
BoolExportCallback g_show_names_callback( g_show_names_caller );
Orthographic_constructPreferences( page );
}
void Orthographic_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Orthographic_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Orthographic_constructPage>() );
}
void Clipper_constructPreferences( PreferencesPage& page ){
Clipper_constructPreferences( page );
}
void Clipper_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, Clipper_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Clipper_constructPage>() );
}
void ToggleShown_importBool( ToggleShown& self, bool value ){
self.set( value );
}
-typedef ReferenceCaller1<ToggleShown, bool, ToggleShown_importBool> ToggleShownImportBoolCaller;
+typedef ReferenceCaller<ToggleShown, void(bool), ToggleShown_importBool> ToggleShownImportBoolCaller;
void ToggleShown_exportBool( const ToggleShown& self, const BoolImportCallback& importer ){
importer( self.active() );
}
-typedef ConstReferenceCaller1<ToggleShown, const BoolImportCallback&, ToggleShown_exportBool> ToggleShownExportBoolCaller;
+typedef ConstReferenceCaller<ToggleShown, void(const BoolImportCallback&), ToggleShown_exportBool> ToggleShownExportBoolCaller;
void XYWindow_Construct(){
- GlobalCommands_insert( "ToggleCrosshairs", FreeCaller<ToggleShowCrosshair>(), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "ToggleSizePaint", FreeCaller<ToggleShowSizeInfo>(), Accelerator( 'J' ) );
- GlobalCommands_insert( "ToggleGrid", FreeCaller<ToggleShowGrid>(), Accelerator( '0' ) );
+ GlobalCommands_insert( "ToggleCrosshairs", FreeCaller<void(), ToggleShowCrosshair>(), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "ToggleSizePaint", FreeCaller<void(), ToggleShowSizeInfo>(), Accelerator( 'J' ) );
+ GlobalCommands_insert( "ToggleGrid", FreeCaller<void(), ToggleShowGrid>(), Accelerator( '0' ) );
GlobalToggles_insert( "ToggleView", ToggleShown::ToggleCaller( g_xy_top_shown ), ToggleItem::AddCallbackCaller( g_xy_top_shown.m_item ), Accelerator( 'V', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalToggles_insert( "ToggleSideView", ToggleShown::ToggleCaller( g_yz_side_shown ), ToggleItem::AddCallbackCaller( g_yz_side_shown.m_item ) );
GlobalToggles_insert( "ToggleFrontView", ToggleShown::ToggleCaller( g_xz_front_shown ), ToggleItem::AddCallbackCaller( g_xz_front_shown.m_item ) );
- GlobalCommands_insert( "NextView", FreeCaller<XY_Next>(), Accelerator( GDK_KEY_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); // fixme: doesn't show its shortcut
- GlobalCommands_insert( "ZoomIn", FreeCaller<XY_ZoomIn>(), Accelerator( GDK_KEY_Delete ) );
- GlobalCommands_insert( "ZoomOut", FreeCaller<XY_ZoomOut>(), Accelerator( GDK_KEY_Insert ) );
- GlobalCommands_insert( "ViewTop", FreeCaller<XY_Top>(), Accelerator( GDK_KEY_KP_Home ) );
- GlobalCommands_insert( "ViewSide", FreeCaller<XY_Side>(), Accelerator( GDK_KEY_KP_Page_Down ) );
- GlobalCommands_insert( "ViewFront", FreeCaller<XY_Front>(), Accelerator( GDK_KEY_KP_End ) );
- GlobalCommands_insert( "Zoom100", FreeCaller<XY_Zoom100>() );
- GlobalCommands_insert( "CenterXYView", FreeCaller<XY_Focus>(), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "NextView", FreeCaller<void(), XY_Next>(), Accelerator( GDK_KEY_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); // fixme: doesn't show its shortcut
+ GlobalCommands_insert( "ZoomIn", FreeCaller<void(), XY_ZoomIn>(), Accelerator( GDK_KEY_Delete ) );
+ GlobalCommands_insert( "ZoomOut", FreeCaller<void(), XY_ZoomOut>(), Accelerator( GDK_KEY_Insert ) );
+ GlobalCommands_insert( "ViewTop", FreeCaller<void(), XY_Top>(), Accelerator( GDK_KEY_KP_Home ) );
+ GlobalCommands_insert( "ViewSide", FreeCaller<void(), XY_Side>(), Accelerator( GDK_KEY_KP_Page_Down ) );
+ GlobalCommands_insert( "ViewFront", FreeCaller<void(), XY_Front>(), Accelerator( GDK_KEY_KP_End ) );
+ GlobalCommands_insert( "Zoom100", FreeCaller<void(), XY_Zoom100>() );
+ GlobalCommands_insert( "CenterXYView", FreeCaller<void(), XY_Focus>(), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalPreferenceSystem().registerPreference( "ClipCaulk", BoolImportStringCaller( g_clip_useCaulk ), BoolExportStringCaller( g_clip_useCaulk ) );
Signal0 onDestroyed;
Signal3<const WindowVector&, ButtonIdentifier, ModifierFlags> onMouseDown;
void mouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers );
-typedef Member3<XYWnd, const WindowVector&, ButtonIdentifier, ModifierFlags, void, &XYWnd::mouseDown> MouseDownCaller;
+typedef Member<XYWnd, void(const WindowVector&, ButtonIdentifier, ModifierFlags), &XYWnd::mouseDown> MouseDownCaller;
};
inline void XYWnd_Update( XYWnd& xywnd ){