From: TimePath Date: Mon, 1 Jan 2018 01:18:56 +0000 (+1100) Subject: Callback: remove fixed-arity wrappers X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=18d60f90d7603cb420150739251cf98519c57406;p=xonotic%2Fnetradiant.git Callback: remove fixed-arity wrappers --- diff --git a/contrib/bobtoolz/DBobView.h b/contrib/bobtoolz/DBobView.h index fe3d8dc3..b20ef141 100644 --- a/contrib/bobtoolz/DBobView.h +++ b/contrib/bobtoolz/DBobView.h @@ -78,7 +78,7 @@ void destroyShaders(); void valueChanged( const char* value ){ UpdatePath(); } -typedef MemberCaller1 ValueChangedCaller; +typedef MemberCaller ValueChangedCaller; void insert( const char* key, EntityKeyValue& value ){ value.attach( ValueChangedCaller( *this ) ); } diff --git a/contrib/bobtoolz/DBrush.cpp b/contrib/bobtoolz/DBrush.cpp index 6e650807..a0d97699 100644 --- a/contrib/bobtoolz/DBrush.cpp +++ b/contrib/bobtoolz/DBrush.cpp @@ -128,12 +128,12 @@ int DBrush::BuildPoints(){ 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 DBrushAddFaceCaller; +typedef ReferenceCaller 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 DBrushAddFaceTexturedCaller; +typedef ReferenceCaller DBrushAddFaceTexturedCaller; void DBrush::LoadFromBrush( scene::Instance& brush, bool textured ){ ClearFaces(); diff --git a/contrib/bobtoolz/DEntity.cpp b/contrib/bobtoolz/DEntity.cpp index 9fccf6b7..22aa05a1 100644 --- a/contrib/bobtoolz/DEntity.cpp +++ b/contrib/bobtoolz/DEntity.cpp @@ -244,7 +244,7 @@ void DEntity_loadBrush( DEntity& entity, scene::Instance& brush ){ DBrush* loadBrush = entity.NewBrush( static_cast( entity.brushList.size() ) ); loadBrush->LoadFromBrush( brush, true ); } -typedef ReferenceCaller1 DEntityLoadBrushCaller; +typedef ReferenceCaller DEntityLoadBrushCaller; void DEntity::LoadSelectedBrushes(){ ClearBrushes(); @@ -277,7 +277,7 @@ void DEntity_loadPatch( DEntity& entity, scene::Instance& patch ){ DPatch* loadPatch = entity.NewPatch(); loadPatch->LoadFromPatch( patch ); } -typedef ReferenceCaller1 DEntityLoadPatchCaller; +typedef ReferenceCaller DEntityLoadPatchCaller; void DEntity::LoadSelectedPatches(){ ClearPatches(); diff --git a/contrib/bobtoolz/DTreePlanter.h b/contrib/bobtoolz/DTreePlanter.h index b7bc4200..102976d8 100644 --- a/contrib/bobtoolz/DTreePlanter.h +++ b/contrib/bobtoolz/DTreePlanter.h @@ -42,12 +42,12 @@ MouseEventHandlerId m_mouseDown; SignalHandlerId m_destroyed; public: SignalHandlerResult mouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers ); -typedef Member3 MouseDownCaller; +typedef Member MouseDownCaller; void destroyed(){ m_mouseDown = MouseEventHandlerId(); m_destroyed = SignalHandlerId(); } -typedef Member DestroyedCaller; +typedef Member DestroyedCaller; DTreePlanter() { m_numModels = 0; diff --git a/contrib/shaderplug/shaderplug.cpp b/contrib/shaderplug/shaderplug.cpp index 6f272509..7bc9814a 100644 --- a/contrib/shaderplug/shaderplug.cpp +++ b/contrib/shaderplug/shaderplug.cpp @@ -96,7 +96,7 @@ void loadArchiveFile( const char* filename ){ archives.push_back( filename ); } -typedef FreeCaller1 LoadArchiveFileCaller; +typedef FreeCaller LoadArchiveFileCaller; void LoadTextureFile( const char* filename ){ std::string s_filename = filename; @@ -116,7 +116,7 @@ void LoadTextureFile( const char* filename ){ } } -typedef FreeCaller1 LoadTextureFileCaller; +typedef FreeCaller LoadTextureFileCaller; void GetTextures( const char* extension ){ GlobalFileSystem().forEachFile( "textures/", extension, LoadTextureFileCaller(), 0 ); @@ -128,7 +128,7 @@ void LoadShaderList( const char* filename ){ } } -typedef FreeCaller1 LoadShaderListCaller; +typedef FreeCaller LoadShaderListCaller; void GetAllShaders(){ GlobalShaderSystem().foreachShaderName( LoadShaderListCaller() ); diff --git a/include/ibrush.h b/include/ibrush.h index 1171f8a7..93dc17e7 100644 --- a/include/ibrush.h +++ b/include/ibrush.h @@ -95,7 +95,7 @@ int flags; int value; }; -typedef Callback1 BrushFaceDataCallback; +typedef Callback BrushFaceDataCallback; class BrushCreator { diff --git a/include/icamera.h b/include/icamera.h index 36cc24f1..1ba28e2a 100644 --- a/include/icamera.h +++ b/include/icamera.h @@ -44,7 +44,7 @@ class CameraModel { public: STRING_CONSTANT( Name, "CameraModel" ); -virtual void setCameraView( CameraView* view, const Callback& disconnect ) = 0; +virtual void setCameraView( CameraView* view, const Callback& disconnect ) = 0; }; template class BasicVector3; diff --git a/include/ientity.h b/include/ientity.h index db47ff49..0ea6e25d 100644 --- a/include/ientity.h +++ b/include/ientity.h @@ -29,7 +29,7 @@ class EntityClass; -typedef Callback1 KeyObserver; +typedef Callback KeyObserver; class EntityKeyValue { diff --git a/include/ifilesystem.h b/include/ifilesystem.h index 605aba29..d7e128e6 100644 --- a/include/ifilesystem.h +++ b/include/ifilesystem.h @@ -26,8 +26,8 @@ #include "generic/constant.h" #include "generic/callback.h" -typedef Callback1 ArchiveNameCallback; -typedef Callback1 FileNameCallback; +typedef Callback ArchiveNameCallback; +typedef Callback FileNameCallback; class ArchiveFile; class ArchiveTextFile; diff --git a/include/irender.h b/include/irender.h index fbba51db..169d881a 100644 --- a/include/irender.h +++ b/include/irender.h @@ -88,9 +88,9 @@ virtual void clearLights(){ }; class Renderable; -typedef Callback1 RenderableCallback; +typedef Callback RenderableCallback; -typedef Callback1 RendererLightCallback; +typedef Callback RendererLightCallback; class LightList { diff --git a/include/iselection.h b/include/iselection.h index 898a9aa1..9207271e 100644 --- a/include/iselection.h +++ b/include/iselection.h @@ -57,7 +57,7 @@ typedef BasicVector4 Vector4; class Matrix4; typedef Vector4 Quaternion; -typedef Callback1 SelectionChangeCallback; +typedef Callback SelectionChangeCallback; typedef SignalHandler1 SelectionChangeHandler; class SelectionSystem diff --git a/include/ishaders.h b/include/ishaders.h index e66c9c7b..f88c8ce7 100644 --- a/include/ishaders.h +++ b/include/ishaders.h @@ -78,7 +78,7 @@ virtual bool clampToBorder() const = 0; virtual float alphaTest() const = 0; }; -typedef Callback1 ShaderLayerCallback; +typedef Callback ShaderLayerCallback; class IShader @@ -132,7 +132,7 @@ virtual qtexture_t* lightFalloffImage() const = 0; }; typedef struct _GSList GSList; -typedef Callback1 ShaderNameCallback; +typedef Callback ShaderNameCallback; class ModuleObserver; @@ -159,7 +159,7 @@ virtual bool endActiveShadersIterator() = 0; virtual IShader* dereferenceActiveShadersIterator() = 0; virtual void incrementActiveShadersIterator() = 0; -virtual void setActiveShadersChangedNotify( const Callback& notify ) = 0; +virtual void setActiveShadersChangedNotify( const Callback& notify ) = 0; virtual void attach( ModuleObserver& observer ) = 0; virtual void detach( ModuleObserver& observer ) = 0; diff --git a/include/mapfile.h b/include/mapfile.h index 7d61f6ed..02cd360e 100644 --- a/include/mapfile.h +++ b/include/mapfile.h @@ -37,7 +37,7 @@ STRING_CONSTANT( Name, "MapFile" ); 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& changed ) = 0; virtual std::size_t changes() const = 0; }; diff --git a/include/modelskin.h b/include/modelskin.h index 90fef945..b070cc77 100644 --- a/include/modelskin.h +++ b/include/modelskin.h @@ -34,7 +34,7 @@ SkinRemap( const char* from, const char* to ) : m_from( from ), m_to( to ){ } }; -typedef Callback1 SkinRemapCallback; +typedef Callback SkinRemapCallback; class ModuleObserver; class ModelSkin diff --git a/include/nameable.h b/include/nameable.h index e295e5c6..ceb7aabb 100644 --- a/include/nameable.h +++ b/include/nameable.h @@ -25,7 +25,7 @@ #include "generic/constant.h" #include "generic/callback.h" -typedef Callback1 NameCallback; +typedef Callback NameCallback; class Nameable { diff --git a/include/namespace.h b/include/namespace.h index f87a2e06..0b24059f 100644 --- a/include/namespace.h +++ b/include/namespace.h @@ -25,8 +25,8 @@ #include "generic/constant.h" #include "generic/callback.h" -typedef Callback1 NameCallback; -typedef Callback1 NameCallbackCallback; +typedef Callback NameCallback; +typedef Callback NameCallbackCallback; class Namespace { diff --git a/include/preferencesystem.cpp b/include/preferencesystem.cpp index 6152cb14..1786f50b 100644 --- a/include/preferencesystem.cpp +++ b/include/preferencesystem.cpp @@ -75,11 +75,11 @@ void importString( const char* value ){ m_string = value; m_observer.onChanged(); } -typedef MemberCaller1 ImportStringCaller; +typedef MemberCaller ImportStringCaller; void exportString( StringImportCallback& importer ){ importer( m_string.c_str() ); } -typedef MemberCaller1 ExportStringCaller; +typedef MemberCaller ExportStringCaller; }; inline void int_export( int i, StringImportCallback& importer ){ @@ -113,11 +113,11 @@ void importString( const char* value ){ m_int = int_import( value ); m_observer.onChanged(); } -typedef MemberCaller1 ImportStringCaller; +typedef MemberCaller ImportStringCaller; void exportString( StringImportCallback& importer ){ int_export( m_int, importer ); } -typedef MemberCaller1 ExportStringCaller; +typedef MemberCaller ExportStringCaller; }; class IntPreferenceImporter diff --git a/include/preferencesystem.h b/include/preferencesystem.h index bbc838ad..4ecbfc85 100644 --- a/include/preferencesystem.h +++ b/include/preferencesystem.h @@ -25,8 +25,8 @@ #include "generic/constant.h" #include "generic/callback.h" -typedef Callback1 StringImportCallback; -typedef Callback1 StringExportCallback; +typedef Callback StringImportCallback; +typedef Callback StringExportCallback; class PreferenceSystem { diff --git a/include/selectable.h b/include/selectable.h index 1cea909f..cb6f04c4 100644 --- a/include/selectable.h +++ b/include/selectable.h @@ -250,7 +250,7 @@ inline SelectionTestable* Instance_getSelectionTestable( scene::Instance& instan class Plane3; -typedef Callback1 PlaneCallback; +typedef Callback PlaneCallback; class SelectedPlanes { diff --git a/libs/entitylib.h b/libs/entitylib.h index 7f1bb0c1..83f35f02 100644 --- a/libs/entitylib.h +++ b/libs/entitylib.h @@ -366,7 +366,7 @@ void importState( const CopiedString& string ){ notify(); } -typedef MemberCaller1 UndoImportCaller; +typedef MemberCaller UndoImportCaller; }; /// \brief An unsorted list of key/value pairs. @@ -524,7 +524,7 @@ public: m_entityKeyValueChanged(); } - typedef MemberCaller1 UndoImportCaller; + typedef MemberCaller UndoImportCaller; void attach( Observer& observer ){ ASSERT_MESSAGE( !m_observerMutex, "observer cannot be attached during iteration" ); diff --git a/libs/generic/callback.cpp b/libs/generic/callback.cpp index 74fe6ee0..4776f575 100644 --- a/libs/generic/callback.cpp +++ b/libs/generic/callback.cpp @@ -40,14 +40,14 @@ void setValue(){ value = 3; } // a typedef to make things more readable -typedef MemberCaller SetValueCaller; +typedef MemberCaller SetValueCaller; }; void example(){ Integer foo = { 0 }; { - Callback bar = ConstMemberCaller( foo ); + Callback bar = ConstMemberCaller( foo ); // invoke the callback bar(); // foo.printValue() @@ -56,7 +56,7 @@ void example(){ { // use the typedef to improve readability - Callback bar = Integer::SetValueCaller( foo ); + Callback bar = Integer::SetValueCaller( foo ); // invoke the callback bar(); // foo.setValue() @@ -77,13 +77,13 @@ void Int_setValue( int& value ){ } // a typedef to make things more readable -typedef ReferenceCaller IntSetValueCaller; +typedef ReferenceCaller IntSetValueCaller; void example(){ int foo = 0; { - Callback bar = ConstReferenceCaller( foo ); + Callback bar = ConstReferenceCaller( foo ); // invoke the callback bar(); // Int_printValue(foo) @@ -92,7 +92,7 @@ void example(){ { // use the typedef to improve readability - Callback bar = IntSetValueCaller( foo ); + Callback bar = IntSetValueCaller( foo ); // invoke the callback bar(); // Int_setValue(foo) @@ -123,97 +123,97 @@ class Test public: void test0(){ } -typedef Member Test0; -typedef MemberCaller Test0Caller; +typedef Member Test0; +typedef MemberCaller Test0Caller; void test0const() const { } -typedef ConstMember Test0Const; -typedef ConstMemberCaller Test0ConstCaller; +typedef ConstMember Test0Const; +typedef ConstMemberCaller Test0ConstCaller; void test1( A1 ){ } -typedef Member1 Test1; -typedef MemberCaller1 Test1Caller; +typedef Member Test1; +typedef MemberCaller Test1Caller; void test1const( A1 ) const { } -typedef ConstMember1 Test1Const; -typedef ConstMemberCaller1 Test1ConstCaller; +typedef ConstMember Test1Const; +typedef ConstMemberCaller Test1ConstCaller; void test2( A1, A2 ){ } -typedef Member2 Test2; +typedef Member Test2; void test2const( A1, A2 ) const { } -typedef ConstMember2 Test2Const; +typedef ConstMember Test2Const; void test3( A1, A2, A3 ){ } -typedef Member3 Test3; +typedef Member Test3; void test3const( A1, A2, A3 ) const { } -typedef ConstMember3 Test3Const; +typedef ConstMember Test3Const; }; void test0free(){ } -typedef FreeCaller<&test0free> Test0FreeCaller; +typedef FreeCaller Test0FreeCaller; void test1free( A1 ){ } -typedef FreeCaller1 Test1FreeCaller; +typedef FreeCaller Test1FreeCaller; void test2free( A1, A2 ){ } -typedef Function2 Test2Free; +typedef Function Test2Free; void test3free( A1, A2, A3 ){ } -typedef Function3 Test3Free; +typedef Function Test3Free; void test0( Test& test ){ } -typedef ReferenceCaller Test0Caller; +typedef ReferenceCaller Test0Caller; void test0const( const Test& test ){ } -typedef ConstReferenceCaller Test0ConstCaller; +typedef ConstReferenceCaller Test0ConstCaller; void test0p( Test* test ){ } -typedef PointerCaller Test0PCaller; +typedef PointerCaller Test0PCaller; void test0constp( const Test* test ){ } -typedef ConstPointerCaller Test0ConstPCaller; +typedef ConstPointerCaller Test0ConstPCaller; void test1( Test& test, A1 ){ } -typedef ReferenceCaller1 Test1Caller; +typedef ReferenceCaller Test1Caller; void test1const( const Test& test, A1 ){ } -typedef ConstReferenceCaller1 Test1ConstCaller; +typedef ConstReferenceCaller Test1ConstCaller; void test1p( Test* test, A1 ){ } -typedef PointerCaller1 Test1PCaller; +typedef PointerCaller Test1PCaller; void test1constp( const Test* test, A1 ){ } -typedef ConstPointerCaller1 Test1ConstPCaller; +typedef ConstPointerCaller Test1ConstPCaller; void test2( Test& test, A1, A2 ){ } -typedef Function3 Test2; +typedef Function Test2; void test3( Test& test, A1, A2, A3 ){ } -typedef Function4 Test3; +typedef Function 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 a = Test0FreeCaller(); + Callback b = Test::Test0Caller( test ); + b = makeCallback( Test::Test0(), test ); + Callback c = Test::Test0ConstCaller( testconst ); + c = makeCallback( Test::Test0Const(), test ); Test0Caller{ test }; Test0ConstCaller{ testconst }; Test0PCaller{ &test }; @@ -222,12 +222,12 @@ void instantiate(){ bool u = a != b; } { - typedef Callback1 TestCallback1; + typedef Callback 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 }; @@ -236,20 +236,20 @@ void instantiate(){ bool u = a != b; } { - typedef Callback2 TestCallback2; - TestCallback2 a = makeStatelessCallback2( Test2Free() ); - TestCallback2 b = makeCallback2( Test2(), test ); - makeCallback2( Test::Test2(), test ); - makeCallback2( Test::Test2Const(), test ); + typedef Callback 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 TestCallback3; - TestCallback3 a = makeStatelessCallback3( Test3Free() ); - TestCallback3 b = makeCallback3( Test3(), test ); - makeCallback3( Test::Test3(), test ); - makeCallback3( Test::Test3Const(), test ); + typedef Callback 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; } diff --git a/libs/generic/callback.h b/libs/generic/callback.h index 1e8cd46d..9a1c9b17 100644 --- a/libs/generic/callback.h +++ b/libs/generic/callback.h @@ -151,12 +151,12 @@ using BindFirstOpaque = BindFirstOpaqueN>; /// \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 CallbackN; +class Callback; template -class CallbackN : public CallbackBase { +class Callback : public CallbackBase { using Base = CallbackBase; static R nullThunk(void *, Ts...) { @@ -165,14 +165,14 @@ class CallbackN : public CallbackBase { public: using func = R(Ts...); - CallbackN() : Base(0, nullThunk) { + Callback() : Base(0, nullThunk) { } template - CallbackN(const BindFirstOpaque &caller) : Base(caller.getEnvironment(), BindFirstOpaque::thunk) { + Callback(const BindFirstOpaque &caller) : Base(caller.getEnvironment(), BindFirstOpaque::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 { @@ -204,81 +204,64 @@ namespace detail { } template -inline CallbackN>::shift::type> makeCallbackN(const Caller &caller, get_argument callee) { - return CallbackN>::shift::type>(BindFirstOpaque(callee)); +inline Callback>::shift::type> makeCallback(const Caller &caller, get_argument callee) { + return Callback>::shift::type>(BindFirstOpaque(callee)); } template -inline CallbackN> makeStatelessCallbackN(const Caller &caller) { - return makeCallbackN(CallerShiftFirst>::template unshift::type>(), nullptr); +inline Callback> makeStatelessCallback(const Caller &caller) { + return makeCallback(CallerShiftFirst>::template unshift::type>(), nullptr); } -namespace detail { - template - struct MemberFunction; - - template - struct MemberFunction { - using type = R(Object::*)(Ts...); - using type_const = R(Object::*)(Ts...) const; - }; -} - -template -using MemberFunction = typename detail::MemberFunction::type; - -template -using ConstMemberFunction = typename detail::MemberFunction::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 member> -using MemberCallerN = BindFirstOpaque::template instance>; +using MemberCaller = BindFirstOpaque::template instance>; /// \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 member> -using ConstMemberCallerN = BindFirstOpaque::template instance>; +using ConstMemberCaller = BindFirstOpaque::template instance>; /// \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::template unshift::type *func> -using ReferenceCallerN = BindFirstOpaque::template unshift::type>::template instance>; +using ReferenceCaller = BindFirstOpaque::template unshift::type>::template instance>; /// \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::template unshift::type *func> -using ConstReferenceCallerN = BindFirstOpaque::template unshift::type>::template instance>; +using ConstReferenceCaller = BindFirstOpaque::template unshift::type>::template instance>; /// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer. template::template unshift::type *func> -using PointerCallerN = BindFirstOpaque::template unshift::type>::template instance>; +using PointerCaller = BindFirstOpaque::template unshift::type>::template instance>; /// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer. template::template unshift::type *func> -using ConstPointerCallerN = BindFirstOpaque::template unshift::type>::template instance>; +using ConstPointerCaller = BindFirstOpaque::template unshift::type>::template instance>; /// \brief Forms a Callback from a free function template -class FreeCallerN : public BindFirstOpaque::template instance, typename detail::Arglist::template unshift::type >> { public: - FreeCallerN() + FreeCaller() : BindFirstOpaque::template instance, typename detail::Arglist::template unshift::type @@ -290,109 +273,31 @@ public: /// /// \param Functor Must define \c first_argument_type and \c operator()(first_argument_type). template -inline CallbackN> makeCallbackN(Functor &functor) { - return CallbackN>(MemberCallerN, &Functor::operator()>(functor)); +inline Callback> makeCallback(Functor &functor) { + return Callback>(MemberCaller, &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 -inline CallbackN> makeCallbackN(const Functor &functor) { - return CallbackN>(ConstMemberCallerN, &Functor::operator()>(functor)); +inline Callback> makeCallback(const Functor &functor) { + return Callback>(ConstMemberCaller, &Functor::operator()>(functor)); } -// todo: inline - -#define makeCallback makeCallbackN - -using Callback = CallbackN; - -template -using Callback0 = CallbackN; - -template -using Callback1 = CallbackN; - -template -using Callback2 = CallbackN; - -template -using Callback3 = CallbackN; - -#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 -using MemberCaller = MemberCallerN; - -template -using ConstMemberCaller = ConstMemberCallerN; - -template -using MemberCaller1 = MemberCallerN; - -template -using ConstMemberCaller1 = ConstMemberCallerN; - -template -using ReferenceCaller = ReferenceCallerN; - -template -using ConstReferenceCaller = ConstReferenceCallerN; - -/// \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 -using ReferenceCaller1 = ReferenceCallerN; - -/// \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 -using ConstReferenceCaller1 = ConstReferenceCallerN; - -/// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer. -template -using PointerCaller = PointerCallerN; - -/// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer. -template -using ConstPointerCaller = ConstPointerCallerN; - -/// \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 -using PointerCaller1 = PointerCallerN; - -/// \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 -using ConstPointerCaller1 = ConstPointerCallerN; - -template -using FreeCaller = FreeCallerN; - -template -using FreeCaller1 = FreeCallerN; - -typedef Callback1 BoolImportCallback; -typedef Callback1 BoolExportCallback; +using BoolImportCallback = Callback; +using BoolExportCallback = Callback; -typedef Callback1 IntImportCallback; -typedef Callback1 IntExportCallback; +using IntImportCallback = Callback; +using IntExportCallback = Callback; -typedef Callback1 FloatImportCallback; -typedef Callback1 FloatExportCallback; +using FloatImportCallback = Callback; +using FloatExportCallback = Callback; -typedef Callback1 StringImportCallback; -typedef Callback1 StringExportCallback; +using StringImportCallback = Callback; +using StringExportCallback = Callback; -typedef Callback1 SizeImportCallback; -typedef Callback1 SizeExportCallback; +using SizeImportCallback = Callback; +using SizeExportCallback = Callback; #endif diff --git a/libs/generic/functional.h b/libs/generic/functional.h index ecbf6c7d..67161ffd 100644 --- a/libs/generic/functional.h +++ b/libs/generic/functional.h @@ -72,6 +72,23 @@ using get_result_type = typename detail::Fn>::result_type; template using get_argument = typename detail::Fn>::template get; +namespace detail { + template + struct MemberFunction; + + template + struct MemberFunction { + using type = R(Object::*)(Ts...); + using type_const = R(Object::*)(Ts...) const; + }; +} + +template +using MemberFunction = typename detail::MemberFunction::type; + +template +using ConstMemberFunction = typename detail::MemberFunction::type_const; + template class MemberN; @@ -89,6 +106,9 @@ public: }; }; +template func> +using Member = typename MemberN::template instance; + template class ConstMemberN; @@ -106,6 +126,9 @@ public: }; }; +template func> +using ConstMember = typename ConstMemberN::template instance; + template class FunctionN; @@ -123,6 +146,9 @@ public: }; }; +template +using Function = typename FunctionN::template instance; + template class CallerShiftFirst; @@ -184,45 +210,4 @@ public: template using FunctorInvoke = FunctorNInvoke>; -// todo: inline - -template -using Member = typename MemberN::template instance; - -template -using ConstMember = typename ConstMemberN::template instance; - -template -using Member1 = typename MemberN::template instance; - -template -using ConstMember1 = typename ConstMemberN::template instance; - -template -using Member2 = typename MemberN::template instance; - -template -using ConstMember2 = typename ConstMemberN::template instance; - -template -using Member3 = typename MemberN::template instance; - -template -using ConstMember3 = typename ConstMemberN::template instance; - -template -using Function0 = typename FunctionN::template instance; - -template -using Function1 = typename FunctionN::template instance; - -template -using Function2 = typename FunctionN::template instance; - -template -using Function3 = typename FunctionN::template instance; - -template -using Function4 = typename FunctionN::template instance; - #endif diff --git a/libs/gtkutil/accelerator.cpp b/libs/gtkutil/accelerator.cpp index 67d917bf..6b66288f 100644 --- a/libs/gtkutil/accelerator.cpp +++ b/libs/gtkutil/accelerator.cpp @@ -86,10 +86,10 @@ void accelerator_write( const Accelerator& accelerator, TextOutputStream& ostrea ostream << gtk_accelerator_get_label( accelerator.key, accelerator.modifiers ); } -typedef std::map AcceleratorMap; +typedef std::map> AcceleratorMap; typedef std::set AcceleratorSet; -bool accelerator_map_insert( AcceleratorMap& acceleratorMap, Accelerator accelerator, const Callback& callback ){ +bool accelerator_map_insert( AcceleratorMap& acceleratorMap, Accelerator accelerator, const Callback& callback ){ if ( accelerator.key != 0 ) { return acceleratorMap.insert( AcceleratorMap::value_type( accelerator, callback ) ).second; } @@ -186,13 +186,13 @@ bool global_accel_enabled(){ } -GClosure* accel_group_add_accelerator( GtkAccelGroup* group, Accelerator accelerator, const Callback& callback ); +GClosure* accel_group_add_accelerator( GtkAccelGroup* group, Accelerator accelerator, const Callback& 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& callback ){ if ( !g_queuedAcceleratorsAdd.insert( AcceleratorMap::value_type( accelerator, callback ) ).second ) { globalErrorStream() << "globalQueuedAccelerators_add: accelerator already queued: " << accelerator << "\n"; } @@ -398,7 +398,7 @@ void GlobalPressedKeys_disconnect( ui::Window window ){ -void special_accelerators_add( Accelerator accelerator, const Callback& callback ){ +void special_accelerators_add( Accelerator accelerator, const Callback& 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"; @@ -411,7 +411,7 @@ void special_accelerators_remove( Accelerator accelerator ){ } } -void keydown_accelerators_add( Accelerator accelerator, const Callback& callback ){ +void keydown_accelerators_add( Accelerator accelerator, const Callback& 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"; @@ -424,7 +424,7 @@ void keydown_accelerators_remove( Accelerator accelerator ){ } } -void keyup_accelerators_add( Accelerator accelerator, const Callback& callback ){ +void keyup_accelerators_add( Accelerator accelerator, const Callback& 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"; @@ -439,11 +439,11 @@ void keyup_accelerators_remove( Accelerator accelerator ){ gboolean accel_closure_callback( GtkAccelGroup* group, GtkWidget* widget, guint key, GdkModifierType modifiers, gpointer data ){ - ( *reinterpret_cast( data ) )( ); + ( *reinterpret_cast*>( 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& 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 ); @@ -470,7 +470,7 @@ void accel_group_remove_accelerator( GtkAccelGroup* group, Accelerator accelerat 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& callback ){ if ( !global_accel_enabled() ) { // workaround: cannot add to GtkAccelGroup while it is disabled //globalOutputStream() << "queued for add: " << accelerator << "\n"; @@ -542,13 +542,13 @@ GClosure* global_accel_group_find( Accelerator accelerator ){ return 0; } -void global_accel_group_connect( const Accelerator& accelerator, const Callback& callback ){ +void global_accel_group_connect( const Accelerator& accelerator, const Callback& 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& callback ){ if ( accelerator.key != 0 ) { global_accel_group_remove_accelerator( accelerator ); } diff --git a/libs/gtkutil/accelerator.h b/libs/gtkutil/accelerator.h index 821830f4..4cbc55f4 100644 --- a/libs/gtkutil/accelerator.h +++ b/libs/gtkutil/accelerator.h @@ -80,9 +80,9 @@ TextOutputStreamType& ostream_write( TextOutputStreamType& ostream, const Accele return ostream; } -void keydown_accelerators_add( Accelerator accelerator, const Callback& callback ); +void keydown_accelerators_add( Accelerator accelerator, const Callback& callback ); void keydown_accelerators_remove( Accelerator accelerator ); -void keyup_accelerators_add( Accelerator accelerator, const Callback& callback ); +void keyup_accelerators_add( Accelerator accelerator, const Callback& callback ); void keyup_accelerators_remove( Accelerator accelerator ); void global_accel_connect_window( ui::Window window ); @@ -94,16 +94,16 @@ extern ui::AccelGroup global_accel; 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& callback ); +void global_accel_group_disconnect( const Accelerator& accelerator, const Callback& callback ); class Command { public: -Callback m_callback; +Callback m_callback; const Accelerator& m_accelerator; -Command( const Callback& callback, const Accelerator& accelerator ) : m_callback( callback ), m_accelerator( accelerator ){ +Command( const Callback& callback, const Accelerator& accelerator ) : m_callback( callback ), m_accelerator( accelerator ){ } }; @@ -112,7 +112,7 @@ class Toggle 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& callback, const Accelerator& accelerator, const BoolExportCallback& exportCallback ) : m_command( callback, accelerator ), m_exportCallback( exportCallback ){ } }; @@ -120,9 +120,9 @@ class KeyEvent { 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 m_keyDown; +Callback m_keyUp; +KeyEvent( const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp ) : m_accelerator( accelerator ), m_keyDown( keyDown ), m_keyUp( keyUp ){ } }; diff --git a/libs/gtkutil/button.cpp b/libs/gtkutil/button.cpp index af19ef35..929a62a0 100644 --- a/libs/gtkutil/button.cpp +++ b/libs/gtkutil/button.cpp @@ -31,10 +31,10 @@ #include "pointer.h" void clicked_closure_callback( ui::Widget widget, gpointer data ){ - ( *reinterpret_cast( data ) )( ); + ( *reinterpret_cast*>( data ) )( ); } -void button_connect_callback( ui::Button button, const Callback& callback ){ +void button_connect_callback( ui::Button button, const Callback& callback ){ #if 1 g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); #else @@ -42,7 +42,7 @@ void button_connect_callback( ui::Button button, const Callback& callback ){ #endif } -void button_connect_callback( ui::ToolButton button, const Callback& callback ){ +void button_connect_callback( ui::ToolButton button, const Callback& callback ){ #if 1 g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); #else @@ -50,7 +50,7 @@ void button_connect_callback( ui::ToolButton button, const Callback& callback ){ #endif } -guint toggle_button_connect_callback( ui::ToggleButton button, const Callback& callback ){ +guint toggle_button_connect_callback( ui::ToggleButton button, const Callback& callback ){ #if 1 guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); #else @@ -60,7 +60,7 @@ guint toggle_button_connect_callback( ui::ToggleButton button, const Callback& c return handler; } -guint toggle_button_connect_callback( ui::ToggleToolButton button, const Callback& callback ){ +guint toggle_button_connect_callback( ui::ToggleToolButton button, const Callback& callback ){ #if 1 guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); #else diff --git a/libs/gtkutil/button.h b/libs/gtkutil/button.h index cec03b2f..238b207c 100644 --- a/libs/gtkutil/button.h +++ b/libs/gtkutil/button.h @@ -29,10 +29,10 @@ typedef int gint; 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& 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_set_icon( ui::Button button, const char* icon ); void toggle_button_set_active_no_signal( ui::ToggleButton item, gboolean active ); diff --git a/libs/gtkutil/closure.h b/libs/gtkutil/closure.h index 9696464a..39945827 100644 --- a/libs/gtkutil/closure.h +++ b/libs/gtkutil/closure.h @@ -26,11 +26,11 @@ #include "generic/callback.h" inline void closure_destroy( gpointer data, GClosure* closure ){ - delete reinterpret_cast( data ); + delete reinterpret_cast*>( 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& callback ){ + return g_cclosure_new( func, new Callback( callback ), closure_destroy ); } inline GValue GValue_default(){ diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp index 6200ba64..baee2f69 100644 --- a/libs/gtkutil/dialog.cpp +++ b/libs/gtkutil/dialog.cpp @@ -222,7 +222,7 @@ PathEntry PathEntry_new(){ void PathEntry_setPath( PathEntry& self, const char* path ){ gtk_entry_set_text( self.m_entry, path ); } -typedef ReferenceCaller1 PathEntrySetPathCaller; +typedef ReferenceCaller PathEntrySetPathCaller; void BrowsedPathEntry_clicked( ui::Widget widget, BrowsedPathEntry* self ){ self->m_browse( PathEntrySetPathCaller( self->m_entry ) ); diff --git a/libs/gtkutil/dialog.h b/libs/gtkutil/dialog.h index b4367e5c..79330143 100644 --- a/libs/gtkutil/dialog.h +++ b/libs/gtkutil/dialog.h @@ -107,8 +107,8 @@ PathEntry PathEntry_new(); class BrowsedPathEntry { public: -typedef Callback1 SetPathCallback; -typedef Callback1 BrowseCallback; +typedef Callback SetPathCallback; +typedef Callback BrowseCallback; PathEntry m_entry; BrowseCallback m_browse; diff --git a/libs/gtkutil/idledraw.h b/libs/gtkutil/idledraw.h index 6267951d..97791023 100644 --- a/libs/gtkutil/idledraw.h +++ b/libs/gtkutil/idledraw.h @@ -28,7 +28,7 @@ class IdleDraw { -Callback m_draw; +Callback m_draw; unsigned int m_handler; static gboolean draw( gpointer data ){ reinterpret_cast( data )->m_draw(); @@ -36,7 +36,7 @@ static gboolean draw( gpointer data ){ return FALSE; } public: -IdleDraw( const Callback& draw ) : m_draw( draw ), m_handler( 0 ){ +IdleDraw( const Callback& draw ) : m_draw( draw ), m_handler( 0 ){ } ~IdleDraw(){ if ( m_handler != 0 ) { @@ -48,7 +48,7 @@ void queueDraw(){ m_handler = g_idle_add( &draw, this ); } } -typedef MemberCaller QueueDrawCaller; +typedef MemberCaller QueueDrawCaller; void flush(){ if ( m_handler != 0 ) { diff --git a/libs/gtkutil/menu.cpp b/libs/gtkutil/menu.cpp index 93638e34..9d47642e 100644 --- a/libs/gtkutil/menu.cpp +++ b/libs/gtkutil/menu.cpp @@ -78,10 +78,10 @@ ui::Menu create_sub_menu_with_mnemonic( ui::Menu parent, const char* mnemonic ){ } void activate_closure_callback( ui::Widget widget, gpointer data ){ - ( *reinterpret_cast( data ) )( ); + ( *reinterpret_cast*>( data ) )( ); } -guint menu_item_connect_callback( ui::MenuItem item, const Callback& callback ){ +guint menu_item_connect_callback( ui::MenuItem item, const Callback& callback ){ #if 1 return g_signal_connect_swapped( G_OBJECT( item ), "activate", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); #else @@ -89,7 +89,7 @@ guint menu_item_connect_callback( ui::MenuItem item, const Callback& callback ){ #endif } -guint check_menu_item_connect_callback( ui::CheckMenuItem item, const Callback& callback ){ +guint check_menu_item_connect_callback( ui::CheckMenuItem item, const Callback& callback ){ #if 1 guint handler = g_signal_connect_swapped( G_OBJECT( item ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); #else @@ -99,33 +99,33 @@ guint check_menu_item_connect_callback( ui::CheckMenuItem item, const Callback& 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& 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& 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& 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& 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& 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 ); @@ -136,7 +136,7 @@ ui::RadioMenuItem new_radio_menu_item_with_mnemonic( GSList** group, const char* 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& callback ){ auto item = new_radio_menu_item_with_mnemonic( group, mnemonic, callback ); menu.add(item); return item; @@ -241,7 +241,7 @@ ui::MenuItem create_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic void check_menu_item_set_active_callback( GtkCheckMenuItem &item, bool enabled ){ check_menu_item_set_active_no_signal( ui::CheckMenuItem(&item), enabled ); } -typedef ReferenceCaller1 CheckMenuItemSetActiveCaller; +typedef ReferenceCaller 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 ); diff --git a/libs/gtkutil/menu.h b/libs/gtkutil/menu.h index 5d361f29..2ff78f89 100644 --- a/libs/gtkutil/menu.h +++ b/libs/gtkutil/menu.h @@ -35,9 +35,9 @@ ui::TearoffMenuItem menu_tearoff( ui::Menu menu ); 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& 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 ); class Command; ui::MenuItem create_menu_item_with_mnemonic( ui::Menu menu, const char* mnemonic, const Command& command ); diff --git a/libs/gtkutil/nonmodal.h b/libs/gtkutil/nonmodal.h index 6fc043c7..53318679 100644 --- a/libs/gtkutil/nonmodal.h +++ b/libs/gtkutil/nonmodal.h @@ -34,8 +34,8 @@ void widget_connect_escape_clear_focus_widget(ui::Widget widget); class NonModalEntry { bool m_editing; - Callback m_apply; - Callback m_cancel; + Callback m_apply; + Callback m_cancel; static gboolean focus_in(ui::Entry entry, GdkEventFocus *event, NonModalEntry *self); @@ -48,7 +48,7 @@ class NonModalEntry { 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 &apply, const Callback &cancel) : m_editing(false), m_apply(apply), m_cancel(cancel) { } @@ -57,8 +57,8 @@ public: class NonModalSpinner { - Callback m_apply; - Callback m_cancel; + Callback m_apply; + Callback m_cancel; static gboolean changed(ui::SpinButton spin, NonModalSpinner *self); @@ -67,7 +67,7 @@ class NonModalSpinner { 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 &apply, const Callback &cancel) : m_apply(apply), m_cancel(cancel) { } @@ -76,10 +76,10 @@ public: class NonModalRadio { - Callback m_changed; + Callback m_changed; public: - NonModalRadio(const Callback &changed) : m_changed(changed) + NonModalRadio(const Callback &changed) : m_changed(changed) { } diff --git a/libs/gtkutil/toolbar.cpp b/libs/gtkutil/toolbar.cpp index d2ab45a7..87651466 100644 --- a/libs/gtkutil/toolbar.cpp +++ b/libs/gtkutil/toolbar.cpp @@ -37,14 +37,14 @@ void toolbar_append( ui::Toolbar toolbar, ui::ToolItem button, const char* descr 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& 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& 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)); @@ -60,7 +60,7 @@ ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* descripti void toggle_button_set_active_callback( GtkToggleToolButton& button, bool active ){ toggle_button_set_active_no_signal( ui::ToggleToolButton(&button), active ); } -using ToggleButtonSetActiveCaller = ReferenceCaller1; +using ToggleButtonSetActiveCaller = ReferenceCaller; 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 ); diff --git a/libs/gtkutil/toolbar.h b/libs/gtkutil/toolbar.h index 60515019..f3481783 100644 --- a/libs/gtkutil/toolbar.h +++ b/libs/gtkutil/toolbar.h @@ -28,9 +28,9 @@ 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& 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& callback ); ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Toggle& toggle ); #endif diff --git a/libs/gtkutil/widget.h b/libs/gtkutil/widget.h index 76b318dc..9592b495 100644 --- a/libs/gtkutil/widget.h +++ b/libs/gtkutil/widget.h @@ -51,7 +51,7 @@ public: m_exportCallback(callback); } - typedef MemberCaller1 AddCallbackCaller; + typedef MemberCaller AddCallbackCaller; }; class ToggleShown { @@ -79,13 +79,13 @@ public: void exportActive(const BoolImportCallback &importCallback); - typedef MemberCaller1 ActiveCaller; + typedef MemberCaller ActiveCaller; void set(bool shown); void toggle(); - typedef MemberCaller ToggleCaller; + typedef MemberCaller ToggleCaller; void connect(ui::Widget widget); }; @@ -93,7 +93,7 @@ public: void widget_queue_draw(ui::Widget &widget); -typedef ReferenceCaller WidgetQueueDrawCaller; +typedef ReferenceCaller WidgetQueueDrawCaller; void widget_make_default(ui::Widget widget); diff --git a/libs/gtkutil/window.h b/libs/gtkutil/window.h index 5a24a729..cc2a7f62 100644 --- a/libs/gtkutil/window.h +++ b/libs/gtkutil/window.h @@ -68,11 +68,11 @@ void window_set_position(ui::Window window, const WindowPosition &position); void WindowPosition_Parse(WindowPosition &position, const char *value); -typedef ReferenceCaller1 WindowPositionImportStringCaller; +typedef ReferenceCaller WindowPositionImportStringCaller; void WindowPosition_Write(const WindowPosition &position, const StringImportCallback &importCallback); -typedef ConstReferenceCaller1 WindowPositionExportStringCaller; +typedef ConstReferenceCaller WindowPositionExportStringCaller; class WindowPositionTracker { @@ -99,11 +99,11 @@ public: void WindowPositionTracker_importString(WindowPositionTracker &self, const char *value); -typedef ReferenceCaller1 WindowPositionTrackerImportStringCaller; +typedef ReferenceCaller WindowPositionTrackerImportStringCaller; void WindowPositionTracker_exportString(const WindowPositionTracker &self, const StringImportCallback &importer); -typedef ConstReferenceCaller1 WindowPositionTrackerExportStringCaller; +typedef ConstReferenceCaller WindowPositionTrackerExportStringCaller; #endif diff --git a/libs/instancelib.h b/libs/instancelib.h index eeb95e23..af9dd2bb 100644 --- a/libs/instancelib.h +++ b/libs/instancelib.h @@ -135,14 +135,14 @@ void transformChanged(){ ( *i ).second->transformChanged(); } } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; void boundsChanged(){ for ( InstanceMap::iterator i = m_instances.begin(); i != m_instances.end(); ++i ) { ( *i ).second->boundsChanged(); } } -typedef MemberCaller BoundsChangedCaller; +typedef MemberCaller BoundsChangedCaller; }; template @@ -162,7 +162,7 @@ static void apply( InstanceSet& instances ){ InstanceTypeCast::cast(instance)->evaluateTransform(); }); } -typedef ReferenceCaller::apply> Caller; +typedef ReferenceCaller::apply> Caller; }; #endif diff --git a/libs/maplib.h b/libs/maplib.h index 07da39dc..474ce4b4 100644 --- a/libs/maplib.h +++ b/libs/maplib.h @@ -58,7 +58,7 @@ std::size_t m_size; std::size_t m_saved; typedef void ( UndoFileChangeTracker::*Pending )(); Pending m_pending; -Callback m_changed; +Callback m_changed; public: UndoFileChangeTracker() : m_size( 0 ), m_saved( MAPFILE_MAX_CHANGES ), m_pending( 0 ){ @@ -114,7 +114,7 @@ bool saved() const { return m_saved == m_size; } -void setChangedCallback( const Callback& changed ){ +void setChangedCallback( const Callback& changed ){ m_changed = changed; m_changed(); } diff --git a/libs/scenelib.h b/libs/scenelib.h index 7488186d..e1c05d46 100644 --- a/libs/scenelib.h +++ b/libs/scenelib.h @@ -107,7 +107,7 @@ NodeType() : m_typeId( NODETYPEID_NONE ){ void initialise(){ m_typeId = GlobalSceneGraph().getNodeTypeId( Name() ); } -typedef MemberCaller, &NodeType::initialise> InitialiseCaller; +typedef MemberCaller, void(), &NodeType::initialise> InitialiseCaller; TypeId getTypeId(){ #if GDEF_DEBUG ASSERT_MESSAGE( m_typeId != NODETYPEID_NONE, "node-type " << makeQuoted( Name() ) << " used before being initialised" ); @@ -442,7 +442,7 @@ InstanceType() : m_typeId( INSTANCETYPEID_NONE ){ void initialise(){ m_typeId = GlobalSceneGraph().getInstanceTypeId( Name() ); } -typedef MemberCaller, &InstanceType::initialise> InitialiseCaller; +typedef MemberCaller, void(), &InstanceType::initialise> InitialiseCaller; TypeId getTypeId(){ #if GDEF_DEBUG ASSERT_MESSAGE( m_typeId != INSTANCETYPEID_NONE, "instance-type " << makeQuoted( Name() ) << " used before being initialised" ); @@ -575,8 +575,8 @@ mutable bool m_childSelected; mutable bool m_childSelectedChanged; mutable bool m_parentSelected; mutable bool m_parentSelectedChanged; -Callback m_childSelectedChangedCallback; -Callback m_transformChangedCallback; +Callback m_childSelectedChangedCallback; +Callback m_transformChangedCallback; void evaluateTransform() const { @@ -674,7 +674,7 @@ void transformChanged(){ GlobalSceneGraph().traverse_subgraph( TransformChangedWalker(), m_path ); boundsChanged(); } -void setTransformChangedCallback( const Callback& callback ){ +void setTransformChangedCallback( const Callback& callback ){ m_transformChangedCallback = callback; } @@ -711,7 +711,7 @@ bool childSelected() const { return m_childSelected; } -void setChildSelectedChangedCallback( const Callback& callback ){ +void setChildSelectedChangedCallback( const Callback& callback ){ m_childSelectedChangedCallback = callback; } void selectedChanged(){ @@ -934,10 +934,10 @@ virtual void decrement() = 0; class SimpleCounter : public Counter { -Callback m_countChanged; +Callback m_countChanged; std::size_t m_count; public: -void setCountChangedCallback( const Callback& countChanged ){ +void setCountChangedCallback( const Callback& countChanged ){ m_countChanged = countChanged; } void increment(){ diff --git a/libs/selectionlib.h b/libs/selectionlib.h index cb0e43e5..06a905c7 100644 --- a/libs/selectionlib.h +++ b/libs/selectionlib.h @@ -114,7 +114,7 @@ void selectedChanged( const Selectable& selectable ){ Instance::selectedChanged(); } -typedef MemberCaller1 SelectedChangedCaller; +typedef MemberCaller SelectedChangedCaller; }; diff --git a/libs/signal/isignal.h b/libs/signal/isignal.h index 9eaa9d0b..a8dcdfc9 100644 --- a/libs/signal/isignal.h +++ b/libs/signal/isignal.h @@ -77,8 +77,8 @@ public: } }; -class SignalHandler : public SignalHandlerN, SignalHandlerCaller1> { - using SignalHandlerN, SignalHandlerCaller1>::SignalHandlerN; +class SignalHandler : public SignalHandlerN, SignalHandlerCaller1> { + using SignalHandlerN, SignalHandlerCaller1>::SignalHandlerN; }; template @@ -91,8 +91,8 @@ inline SignalHandler makeSignalHandler(const Caller &caller, get_argument -class SignalHandler1 : public SignalHandlerN, SignalHandlerCaller2> { - using SignalHandlerN, SignalHandlerCaller2>::SignalHandlerN; +class SignalHandler1 : public SignalHandlerN, SignalHandlerCaller2> { + using SignalHandlerN, SignalHandlerCaller2>::SignalHandlerN; }; template @@ -107,8 +107,8 @@ makeSignalHandler1(const Caller &caller, get_argument callee) { template class SignalHandler2 - : public SignalHandlerN, SignalHandlerCaller3> { - using SignalHandlerN, SignalHandlerCaller3>::SignalHandlerN; + : public SignalHandlerN, SignalHandlerCaller3> { + using SignalHandlerN, SignalHandlerCaller3>::SignalHandlerN; }; template @@ -134,8 +134,8 @@ inline SignalHandler2< template class SignalHandler3 - : public SignalHandlerN, SignalHandlerCaller4> { - using SignalHandlerN, SignalHandlerCaller4>::SignalHandlerN; + : public SignalHandlerN, SignalHandlerCaller4> { + using SignalHandlerN, SignalHandlerCaller4>::SignalHandlerN; }; template diff --git a/libs/signal/signal.cpp b/libs/signal/signal.cpp index 6c64cf88..caade86b 100644 --- a/libs/signal/signal.cpp +++ b/libs/signal/signal.cpp @@ -21,39 +21,39 @@ class A3 SignalHandlerResult handler0( Test& ){ return SIGNAL_CONTINUE_EMISSION; } -typedef Function1 TestHandler0; +typedef Function TestHandler0; int function0( Test& ){ return 7; } -typedef Function1 TestFunction0; +typedef Function TestFunction0; SignalHandlerResult handler1( Test&, A1 ){ return SIGNAL_CONTINUE_EMISSION; } -typedef Function2 TestHandler1; +typedef Function TestHandler1; void function1( Test&, A1 ){ } -typedef ReferenceCaller1 TestFunction1; +typedef ReferenceCaller TestFunction1; SignalHandlerResult handler2( Test&, A1, A2 ){ return SIGNAL_CONTINUE_EMISSION; } -typedef Function3 TestHandler2; +typedef Function TestHandler2; void function2( Test&, A1, A2 ){ } -typedef Function3 TestFunction2; +typedef Function TestFunction2; SignalHandlerResult handler3( Test&, A1, A2, A3 ){ return SIGNAL_CONTINUE_EMISSION; } -typedef Function4 TestHandler3; +typedef Function TestHandler3; void function3( Test&, A1, A2, A3 ){ } -typedef Function4 TestFunction3; +typedef Function TestFunction3; void testSignals(){ Test test; diff --git a/libs/stringio.h b/libs/stringio.h index ef808599..caf93865 100644 --- a/libs/stringio.h +++ b/libs/stringio.h @@ -292,33 +292,33 @@ inline TextOutputStreamType& ostream_write( TextOutputStreamType& outputStream, inline void CopiedString_importString( CopiedString& self, const char* string ){ self = string; } -typedef ReferenceCaller1 CopiedStringImportStringCaller; +typedef ReferenceCaller CopiedStringImportStringCaller; inline void CopiedString_exportString( const CopiedString& self, const StringImportCallback& importer ){ importer( self.c_str() ); } -typedef ConstReferenceCaller1 CopiedStringExportStringCaller; +typedef ConstReferenceCaller CopiedStringExportStringCaller; inline void Bool_importString( bool& self, const char* string ){ self = string_equal( string, "true" ); } -typedef ReferenceCaller1 BoolImportStringCaller; +typedef ReferenceCaller BoolImportStringCaller; inline void Bool_exportString( const bool& self, const StringImportCallback& importer ){ importer( self ? "true" : "false" ); } -typedef ConstReferenceCaller1 BoolExportStringCaller; +typedef ConstReferenceCaller BoolExportStringCaller; inline void Int_importString( int& self, const char* string ){ if ( !string_parse_int( string, self ) ) { self = 0; } } -typedef ReferenceCaller1 IntImportStringCaller; +typedef ReferenceCaller IntImportStringCaller; inline void Int_exportString( const int& self, const StringImportCallback& importer ){ char buffer[16]; sprintf( buffer, "%d", self ); importer( buffer ); } -typedef ConstReferenceCaller1 IntExportStringCaller; +typedef ConstReferenceCaller IntExportStringCaller; inline void Size_importString( std::size_t& self, const char* string ){ int i; @@ -330,39 +330,39 @@ inline void Size_importString( std::size_t& self, const char* string ){ self = 0; } } -typedef ReferenceCaller1 SizeImportStringCaller; +typedef ReferenceCaller 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 SizeExportStringCaller; +typedef ConstReferenceCaller SizeExportStringCaller; inline void Float_importString( float& self, const char* string ){ if ( !string_parse_float( string, self ) ) { self = 0; } } -typedef ReferenceCaller1 FloatImportStringCaller; +typedef ReferenceCaller FloatImportStringCaller; inline void Float_exportString( const float& self, const StringImportCallback& importer ){ char buffer[16]; sprintf( buffer, "%g", self ); importer( buffer ); } -typedef ConstReferenceCaller1 FloatExportStringCaller; +typedef ConstReferenceCaller FloatExportStringCaller; inline void Vector3_importString( Vector3& self, const char* string ){ if ( !string_parse_vector3( string, self ) ) { self = Vector3( 0, 0, 0 ); } } -typedef ReferenceCaller1 Vector3ImportStringCaller; +typedef ReferenceCaller 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 Vector3ExportStringCaller; +typedef ConstReferenceCaller Vector3ExportStringCaller; @@ -392,7 +392,7 @@ operator bool() const inline void Bool_toString( const StringImportCallback& self, bool value ){ Bool_exportString( value, self ); } -typedef ConstReferenceCaller1 BoolToString; +typedef ConstReferenceCaller BoolToString; template @@ -422,7 +422,7 @@ operator int() const inline void Int_toString( const StringImportCallback& self, int value ){ Int_exportString( value, self ); } -typedef ConstReferenceCaller1 IntToString; +typedef ConstReferenceCaller IntToString; template @@ -453,7 +453,7 @@ operator std::size_t() const inline void Size_toString( const StringImportCallback& self, std::size_t value ){ Size_exportString( value, self ); } -typedef ConstReferenceCaller1 SizeToString; +typedef ConstReferenceCaller SizeToString; template diff --git a/libs/transformlib.h b/libs/transformlib.h index 91c8cb25..29749797 100644 --- a/libs/transformlib.h +++ b/libs/transformlib.h @@ -116,12 +116,12 @@ class TransformModifier : public Transformable Translation m_translation; Rotation m_rotation; Scale m_scale; -Callback m_changed; -Callback m_apply; +Callback m_changed; +Callback m_apply; TransformModifierType m_type; public: -TransformModifier( const Callback& changed, const Callback& apply ) : +TransformModifier( const Callback& changed, const Callback& apply ) : m_translation( c_translation_identity ), m_rotation( c_quaternion_identity ), m_scale( c_scale_identity ), diff --git a/libs/typesystem.h b/libs/typesystem.h index b789c5c4..4ceca552 100644 --- a/libs/typesystem.h +++ b/libs/typesystem.h @@ -30,13 +30,13 @@ class InitialiserList { -typedef std::list Initialisers; +typedef std::list> Initialisers; Initialisers m_initialisers; mutable bool m_initialised; public: InitialiserList() : m_initialised( false ){ } -void addInitialiser( const Callback& callback ){ +void addInitialiser( const Callback& callback ){ m_initialisers.push_back( callback ); } void initialise() const { diff --git a/libs/undolib.h b/libs/undolib.h index 4fc44119..06d474bf 100644 --- a/libs/undolib.h +++ b/libs/undolib.h @@ -49,7 +49,7 @@ const Copyable& get() const { template class ObservedUndoableObject : public Undoable { -typedef Callback1 ImportCallback; +typedef Callback ImportCallback; Copyable& m_object; ImportCallback m_importCallback; diff --git a/plugins/entity/angle.h b/plugins/entity/angle.h index 3e2da58b..a73c5332 100644 --- a/plugins/entity/angle.h +++ b/plugins/entity/angle.h @@ -59,12 +59,12 @@ inline void write_angle( float angle, Entity* entity ){ class AngleKey { -Callback m_angleChanged; +Callback m_angleChanged; public: float m_angle; -AngleKey( const Callback& angleChanged ) +AngleKey( const Callback& angleChanged ) : m_angleChanged( angleChanged ), m_angle( ANGLEKEY_IDENTITY ){ } @@ -72,7 +72,7 @@ void angleChanged( const char* value ){ read_angle( m_angle, value ); m_angleChanged(); } -typedef MemberCaller1 AngleChangedCaller; +typedef MemberCaller AngleChangedCaller; void write( Entity* entity ) const { write_angle( m_angle, entity ); diff --git a/plugins/entity/angles.h b/plugins/entity/angles.h index 85f08aa8..54f51f9b 100644 --- a/plugins/entity/angles.h +++ b/plugins/entity/angles.h @@ -96,12 +96,12 @@ inline Vector3 angles_rotated( const Vector3& angles, const Quaternion& rotation class AnglesKey { -Callback m_anglesChanged; +Callback m_anglesChanged; public: Vector3 m_angles; -AnglesKey( const Callback& anglesChanged ) +AnglesKey( const Callback& anglesChanged ) : m_anglesChanged( anglesChanged ), m_angles( ANGLESKEY_IDENTITY ){ } @@ -109,13 +109,13 @@ void angleChanged( const char* value ){ read_angle( m_angles, value ); m_anglesChanged(); } -typedef MemberCaller1 AngleChangedCaller; +typedef MemberCaller AngleChangedCaller; void anglesChanged( const char* value ){ read_angles( m_angles, value ); m_anglesChanged(); } -typedef MemberCaller1 AnglesChangedCaller; +typedef MemberCaller AnglesChangedCaller; void write( Entity* entity ) const { write_angles( m_angles, entity ); diff --git a/plugins/entity/colour.h b/plugins/entity/colour.h index e0b42ad7..86e0deb6 100644 --- a/plugins/entity/colour.h +++ b/plugins/entity/colour.h @@ -47,7 +47,7 @@ inline void write_colour( const Vector3& colour, Entity* entity ){ class Colour { -Callback m_colourChanged; +Callback m_colourChanged; Shader* m_state; void capture_state(){ @@ -60,7 +60,7 @@ void release_state(){ public: Vector3 m_colour; -Colour( const Callback& colourChanged ) +Colour( const Callback& colourChanged ) : m_colourChanged( colourChanged ){ default_colour( m_colour ); capture_state(); @@ -76,7 +76,7 @@ void colourChanged( const char* value ){ m_colourChanged(); } -typedef MemberCaller1 ColourChangedCaller; +typedef MemberCaller ColourChangedCaller; void write( Entity* entity ) const { diff --git a/plugins/entity/curve.h b/plugins/entity/curve.h index cefad32a..c22a51aa 100644 --- a/plugins/entity/curve.h +++ b/plugins/entity/curve.h @@ -253,7 +253,7 @@ void curveChanged(){ m_selectedRender.reserve( m_controlPoints.size() ); } -typedef MemberCaller CurveChangedCaller; +typedef MemberCaller CurveChangedCaller; }; @@ -263,7 +263,7 @@ const int NURBS_degree = 3; class NURBSCurve { Signal0 m_curveChanged; -Callback m_boundsChanged; +Callback m_boundsChanged; public: ControlPoints m_controlPoints; ControlPoints m_controlPointsTransformed; @@ -272,7 +272,7 @@ Knots m_knots; RenderableCurve m_renderCurve; AABB m_bounds; -NURBSCurve( const Callback& boundsChanged ) : m_boundsChanged( boundsChanged ){ +NURBSCurve( const Callback& boundsChanged ) : m_boundsChanged( boundsChanged ){ } SignalHandlerId connect( const SignalHandler& curveChanged ){ @@ -343,20 +343,20 @@ void curveChanged( const char* value ){ m_controlPointsTransformed = m_controlPoints; curveChanged(); } -typedef MemberCaller1 CurveChangedCaller; +typedef MemberCaller CurveChangedCaller; }; class CatmullRomSpline { Signal0 m_curveChanged; -Callback m_boundsChanged; +Callback 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& boundsChanged ) : m_boundsChanged( boundsChanged ){ } SignalHandlerId connect( const SignalHandler& curveChanged ){ @@ -411,7 +411,7 @@ void curveChanged( const char* value ){ m_controlPointsTransformed = m_controlPoints; curveChanged(); } -typedef MemberCaller1 CurveChangedCaller; +typedef MemberCaller CurveChangedCaller; }; const char* const curve_Nurbs = "curve_Nurbs"; diff --git a/plugins/entity/doom3group.cpp b/plugins/entity/doom3group.cpp index bab1bbe8..ceb19b0b 100644 --- a/plugins/entity/doom3group.cpp +++ b/plugins/entity/doom3group.cpp @@ -103,8 +103,8 @@ SignalHandlerId m_curveCatmullRomChanged; private: mutable AABB m_curveBounds; -Callback m_transformChanged; -Callback m_evaluateTransform; +Callback m_transformChanged; +Callback m_evaluateTransform; CopiedString m_name; CopiedString m_modelKey; @@ -199,7 +199,7 @@ void nameChanged( const char* value ){ m_name = value; updateIsModel(); } -typedef MemberCaller1 NameChangedCaller; +typedef MemberCaller NameChangedCaller; void modelChanged( const char* value ){ m_modelKey = value; @@ -212,7 +212,7 @@ void modelChanged( const char* value ){ m_model.modelChanged( "" ); } } -typedef MemberCaller1 ModelChangedCaller; +typedef MemberCaller ModelChangedCaller; void updateTransform(){ m_transform.localToParent() = g_matrix4_identity; @@ -225,19 +225,19 @@ void updateTransform(){ m_funcStaticOrigin.originChanged(); } } -typedef MemberCaller UpdateTransformCaller; +typedef MemberCaller UpdateTransformCaller; void originChanged(){ m_origin = m_originKey.m_origin; updateTransform(); } -typedef MemberCaller OriginChangedCaller; +typedef MemberCaller OriginChangedCaller; void rotationChanged(){ rotation_assign( m_rotation, m_rotationKey.m_rotation ); updateTransform(); } -typedef MemberCaller RotationChangedCaller; +typedef MemberCaller RotationChangedCaller; void skinChanged(){ if ( isModel() ) { @@ -247,10 +247,10 @@ void skinChanged(){ } } } -typedef MemberCaller SkinChangedCaller; +typedef MemberCaller 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& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) : m_entity( eclass ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -269,7 +269,7 @@ Doom3Group( EntityClass* eclass, scene::Node& node, const Callback& transformCha 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& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) : m_entity( other.m_entity ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -420,7 +420,7 @@ void transformChanged(){ m_curveNURBS.curveChanged(); m_curveCatmullRom.curveChanged(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; }; class Doom3GroupInstance : @@ -579,13 +579,13 @@ void applyTransform(){ evaluateTransform(); m_contained.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; void selectionChangedComponent( const Selectable& selectable ){ GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable ); GlobalSelectionSystem().onComponentSelection( *this, selectable ); } -typedef MemberCaller1 SelectionChangedComponentCaller; +typedef MemberCaller SelectionChangedComponentCaller; }; class Doom3GroupNode : diff --git a/plugins/entity/eclassmodel.cpp b/plugins/entity/eclassmodel.cpp index 855fc923..3b91eeb0 100644 --- a/plugins/entity/eclassmodel.cpp +++ b/plugins/entity/eclassmodel.cpp @@ -76,8 +76,8 @@ RenderablePivot m_renderOrigin; RenderableNamedEntity m_renderName; ModelSkinKey m_skin; -Callback m_transformChanged; -Callback m_evaluateTransform; +Callback m_transformChanged; +Callback m_evaluateTransform; void construct(){ default_rotation( m_rotation ); @@ -114,23 +114,23 @@ void updateTransform(){ m_transformChanged(); } -typedef MemberCaller UpdateTransformCaller; +typedef MemberCaller UpdateTransformCaller; void originChanged(){ m_origin = m_originKey.m_origin; updateTransform(); } -typedef MemberCaller OriginChangedCaller; +typedef MemberCaller OriginChangedCaller; void angleChanged(){ m_angle = m_angleKey.m_angle; updateTransform(); } -typedef MemberCaller AngleChangedCaller; +typedef MemberCaller AngleChangedCaller; void rotationChanged(){ rotation_assign( m_rotation, m_rotationKey.m_rotation ); updateTransform(); } -typedef MemberCaller RotationChangedCaller; +typedef MemberCaller RotationChangedCaller; void skinChanged(){ scene::Node* node = m_model.getNode(); @@ -138,11 +138,11 @@ void skinChanged(){ Node_modelSkinChanged( *node ); } } -typedef MemberCaller SkinChangedCaller; +typedef MemberCaller SkinChangedCaller; public: -EclassModel( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : +EclassModel( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : m_entity( eclass ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -158,7 +158,7 @@ EclassModel( EntityClass* eclass, scene::Node& node, const Callback& transformCh 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& transformChanged, const Callback& evaluateTransform ) : m_entity( other.m_entity ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -283,7 +283,7 @@ void transformChanged(){ m_evaluateTransform(); updateTransform(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; }; class EclassModelInstance : public TargetableInstance, public TransformModifier, public Renderable @@ -340,7 +340,7 @@ void applyTransform(){ evaluateTransform(); m_contained.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; }; class EclassModelNode : diff --git a/plugins/entity/entity.cpp b/plugins/entity/entity.cpp index 745fad07..1f286e05 100644 --- a/plugins/entity/entity.cpp +++ b/plugins/entity/entity.cpp @@ -78,7 +78,7 @@ inline scene::Node& entity_for_eclass( EntityClass* eclass ){ void Entity_setName( Entity& entity, const char* name ){ entity.setKeyValue( "name", name ); } -typedef ReferenceCaller1 EntitySetNameCaller; +typedef ReferenceCaller EntitySetNameCaller; inline Namespaced* Node_getNamespaced( scene::Node& node ){ return NodeTypeCast::cast( node ); @@ -138,7 +138,7 @@ void connect( const char* name ){ m_e1->setKeyValue( keyname(), name ); m_e2->setKeyValue( "targetname", name ); } -typedef MemberCaller1 ConnectCaller; +typedef MemberCaller ConnectCaller; }; inline Entity* ScenePath_getEntity( const scene::Path& path ){ diff --git a/plugins/entity/filters.h b/plugins/entity/filters.h index d903e28c..219d6de9 100644 --- a/plugins/entity/filters.h +++ b/plugins/entity/filters.h @@ -69,7 +69,7 @@ void updateFiltered(){ void classnameChanged( const char* value ){ updateFiltered(); } -typedef MemberCaller1 ClassnameChangedCaller; +typedef MemberCaller ClassnameChangedCaller; }; #endif diff --git a/plugins/entity/generic.cpp b/plugins/entity/generic.cpp index bfdd22e8..b80ae830 100644 --- a/plugins/entity/generic.cpp +++ b/plugins/entity/generic.cpp @@ -97,8 +97,8 @@ RenderableSolidAABB m_aabb_solid; RenderableWireframeAABB m_aabb_wire; RenderableNamedEntity m_renderName; -Callback m_transformChanged; -Callback m_evaluateTransform; +Callback m_transformChanged; +Callback m_evaluateTransform; void construct(){ read_aabb( m_aabb_local, m_entity.getEntityClass() ); @@ -120,20 +120,20 @@ void updateTransform(){ matrix4_translate_by_vec3( m_transform.localToParent(), m_origin ); m_transformChanged(); } -typedef MemberCaller UpdateTransformCaller; +typedef MemberCaller UpdateTransformCaller; void originChanged(){ m_origin = m_originKey.m_origin; updateTransform(); } -typedef MemberCaller OriginChangedCaller; +typedef MemberCaller OriginChangedCaller; void anglesChanged(){ m_angles = m_anglesKey.m_angles; updateTransform(); } -typedef MemberCaller AnglesChangedCaller; +typedef MemberCaller AnglesChangedCaller; public: -GenericEntity( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : +GenericEntity( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : m_entity( eclass ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -150,7 +150,7 @@ GenericEntity( EntityClass* eclass, scene::Node& node, const Callback& transform 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& transformChanged, const Callback& evaluateTransform ) : m_entity( other.m_entity ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -264,7 +264,7 @@ void transformChanged(){ m_evaluateTransform(); updateTransform(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; }; class GenericEntityInstance : @@ -342,7 +342,7 @@ void applyTransform(){ evaluateTransform(); m_contained.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; }; class GenericEntityNode : diff --git a/plugins/entity/group.cpp b/plugins/entity/group.cpp index 8e308c4c..bad7fc54 100644 --- a/plugins/entity/group.cpp +++ b/plugins/entity/group.cpp @@ -66,8 +66,8 @@ Vector3 m_origin; RenderableNamedEntity m_renderName; mutable Vector3 m_name_origin; -Callback m_transformChanged; -Callback m_evaluateTransform; +Callback m_transformChanged; +Callback m_evaluateTransform; void construct(){ m_keyObservers.insert( "classname", ClassnameFilter::ClassnameChangedCaller( m_filter ) ); @@ -76,7 +76,7 @@ void construct(){ } public: -Group( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : +Group( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : m_entity( eclass ), m_filter( m_entity, node ), m_named( m_entity ), @@ -89,7 +89,7 @@ Group( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, 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& transformChanged, const Callback& evaluateTransform ) : m_entity( other.m_entity ), m_filter( m_entity, node ), m_named( m_entity ), @@ -172,12 +172,12 @@ void updateTransform(){ matrix4_translate_by_vec3( m_transform.localToParent(), m_origin ); m_transformChanged(); } -typedef MemberCaller UpdateTransformCaller; +typedef MemberCaller UpdateTransformCaller; void originChanged(){ m_origin = m_originKey.m_origin; updateTransform(); } -typedef MemberCaller OriginChangedCaller; +typedef MemberCaller OriginChangedCaller; void translate( const Vector3& translation ){ m_origin = origin_translated( m_origin, translation ); @@ -195,7 +195,7 @@ void transformChanged(){ m_evaluateTransform(); updateTransform(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; }; #if 0 @@ -337,7 +337,7 @@ void applyTransform(){ evaluateTransform(); m_contained.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; }; class GroupNode : diff --git a/plugins/entity/light.cpp b/plugins/entity/light.cpp index 0e89e921..9d8b9247 100644 --- a/plugins/entity/light.cpp +++ b/plugins/entity/light.cpp @@ -491,12 +491,12 @@ void primaryIntensityChanged( const char* value ){ m_primaryIntensity = string_read_float( value ); calculateRadii(); } -typedef MemberCaller1 PrimaryIntensityChangedCaller; +typedef MemberCaller PrimaryIntensityChangedCaller; void secondaryIntensityChanged( const char* value ){ m_secondaryIntensity = string_read_float( value ); calculateRadii(); } -typedef MemberCaller1 SecondaryIntensityChangedCaller; +typedef MemberCaller SecondaryIntensityChangedCaller; void scaleChanged( const char* value ){ m_scale = string_read_float( value ); if ( m_scale <= 0.0f ) { @@ -504,7 +504,7 @@ void scaleChanged( const char* value ){ } calculateRadii(); } -typedef MemberCaller1 ScaleChangedCaller; +typedef MemberCaller ScaleChangedCaller; void fadeChanged( const char* value ){ m_fade = string_read_float( value ); if ( m_fade <= 0.0f ) { @@ -512,12 +512,12 @@ void fadeChanged( const char* value ){ } calculateRadii(); } -typedef MemberCaller1 FadeChangedCaller; +typedef MemberCaller FadeChangedCaller; void flagsChanged( const char* value ){ m_flags = string_read_int( value ); calculateRadii(); } -typedef MemberCaller1 FlagsChangedCaller; +typedef MemberCaller FlagsChangedCaller; }; class Doom3LightRadius @@ -527,7 +527,7 @@ Vector3 m_defaultRadius; Vector3 m_radius; Vector3 m_radiusTransformed; Vector3 m_center; -Callback m_changed; +Callback m_changed; bool m_useCenterKey; Doom3LightRadius( const char* defaultRadius ) : m_defaultRadius( 300, 300, 300 ), m_center( 0, 0, 0 ), m_useCenterKey( false ){ @@ -545,7 +545,7 @@ void lightRadiusChanged( const char* value ){ m_changed(); SceneChangeNotify(); } -typedef MemberCaller1 LightRadiusChangedCaller; +typedef MemberCaller LightRadiusChangedCaller; void lightCenterChanged( const char* value ){ m_useCenterKey = string_parse_vector3( value, m_center ); @@ -554,7 +554,7 @@ void lightCenterChanged( const char* value ){ } SceneChangeNotify(); } -typedef MemberCaller1 LightCenterChangedCaller; +typedef MemberCaller LightCenterChangedCaller; }; class RenderLightRadiiWire : public OpenGLRenderable @@ -707,7 +707,7 @@ void valueChanged( const char* value ){ } SceneChangeNotify(); } -typedef MemberCaller1 ValueChangedCaller; +typedef MemberCaller ValueChangedCaller; Shader* get() const { return m_shader.get(); @@ -805,9 +805,9 @@ LightShader m_shader; AABB m_aabb_light; -Callback m_transformChanged; -Callback m_boundsChanged; -Callback m_evaluateTransform; +Callback m_transformChanged; +Callback m_boundsChanged; +Callback m_evaluateTransform; void construct(){ default_rotation( m_rotation ); @@ -876,7 +876,7 @@ void originChanged(){ m_aabb_light.origin = m_useLightOrigin ? m_lightOrigin : m_originKey.m_origin; updateOrigin(); } -typedef MemberCaller OriginChangedCaller; +typedef MemberCaller OriginChangedCaller; void lightOriginChanged( const char* value ){ m_useLightOrigin = !string_empty( value ); @@ -885,7 +885,7 @@ void lightOriginChanged( const char* value ){ } originChanged(); } -typedef MemberCaller1 LightOriginChangedCaller; +typedef MemberCaller LightOriginChangedCaller; void lightTargetChanged( const char* value ){ m_useLightTarget = !string_empty( value ); @@ -894,7 +894,7 @@ void lightTargetChanged( const char* value ){ } projectionChanged(); } -typedef MemberCaller1 LightTargetChangedCaller; +typedef MemberCaller LightTargetChangedCaller; void lightUpChanged( const char* value ){ m_useLightUp = !string_empty( value ); if ( m_useLightUp ) { @@ -902,7 +902,7 @@ void lightUpChanged( const char* value ){ } projectionChanged(); } -typedef MemberCaller1 LightUpChangedCaller; +typedef MemberCaller LightUpChangedCaller; void lightRightChanged( const char* value ){ m_useLightRight = !string_empty( value ); if ( m_useLightRight ) { @@ -910,7 +910,7 @@ void lightRightChanged( const char* value ){ } projectionChanged(); } -typedef MemberCaller1 LightRightChangedCaller; +typedef MemberCaller LightRightChangedCaller; void lightStartChanged( const char* value ){ m_useLightStart = !string_empty( value ); if ( m_useLightStart ) { @@ -918,7 +918,7 @@ void lightStartChanged( const char* value ){ } projectionChanged(); } -typedef MemberCaller1 LightStartChangedCaller; +typedef MemberCaller LightStartChangedCaller; void lightEndChanged( const char* value ){ m_useLightEnd = !string_empty( value ); if ( m_useLightEnd ) { @@ -926,7 +926,7 @@ void lightEndChanged( const char* value ){ } projectionChanged(); } -typedef MemberCaller1 LightEndChangedCaller; +typedef MemberCaller LightEndChangedCaller; void writeLightOrigin(){ write_origin( m_lightOrigin, &m_entity, "light_origin" ); @@ -957,7 +957,7 @@ void rotationChanged(){ rotation_assign( m_rotation, m_useLightRotation ? m_lightRotation : m_rotationKey.m_rotation ); GlobalSelectionSystem().pivotChanged(); } -typedef MemberCaller RotationChangedCaller; +typedef MemberCaller RotationChangedCaller; void lightRotationChanged( const char* value ){ m_useLightRotation = !string_empty( value ); @@ -966,15 +966,15 @@ void lightRotationChanged( const char* value ){ } rotationChanged(); } -typedef MemberCaller1 LightRotationChangedCaller; +typedef MemberCaller 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& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) : m_entity( eclass ), m_originKey( OriginChangedCaller( *this ) ), m_rotationKey( RotationChangedCaller( *this ) ), - m_colour( Callback() ), + m_colour( Callback() ), m_filter( m_entity, node ), m_named( m_entity ), m_nameKeys( m_entity ), @@ -993,11 +993,11 @@ Light( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, 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& transformChanged, const Callback& boundsChanged, const Callback& evaluateTransform ) : m_entity( other.m_entity ), m_originKey( OriginChangedCaller( *this ) ), m_rotationKey( RotationChangedCaller( *this ) ), - m_colour( Callback() ), + m_colour( Callback() ), m_filter( m_entity, node ), m_named( m_entity ), m_nameKeys( m_entity ), @@ -1229,7 +1229,7 @@ void transformChanged(){ m_evaluateTransform(); updateOrigin(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; mutable Matrix4 m_localPivot; const Matrix4& getLocalPivot() const { @@ -1238,7 +1238,7 @@ const Matrix4& getLocalPivot() const { return m_localPivot; } -void setLightChangedCallback( const Callback& callback ){ +void setLightChangedCallback( const Callback& callback ){ m_doom3Radius.m_changed = callback; } @@ -1486,7 +1486,7 @@ LightInstance( const scene::Path& path, scene::Instance* parent, Light& containe StaticRenderableConnectionLines::instance().detach( *this ); if ( g_lightType == LIGHTTYPE_DOOM3 ) { - m_contained.setLightChangedCallback( Callback() ); + m_contained.setLightChangedCallback( Callback() ); GlobalShaderCache().detach( *this ); } @@ -1525,7 +1525,7 @@ void selectedChangedComponent( const Selectable& selectable ){ GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable ); GlobalSelectionSystem().onComponentSelection( *this, selectable ); } -typedef MemberCaller1 SelectedChangedComponentCaller; +typedef MemberCaller SelectedChangedComponentCaller; void evaluateTransform(){ if ( getType() == TRANSFORM_PRIMITIVE ) { @@ -1545,12 +1545,12 @@ void applyTransform(){ evaluateTransform(); m_contained.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; void lightChanged(){ GlobalShaderCache().changed( *this ); } -typedef MemberCaller LightChangedCaller; +typedef MemberCaller LightChangedCaller; Shader* getShader() const { return m_contained.getShader(); diff --git a/plugins/entity/miscmodel.cpp b/plugins/entity/miscmodel.cpp index e6197d09..ac541a6f 100644 --- a/plugins/entity/miscmodel.cpp +++ b/plugins/entity/miscmodel.cpp @@ -72,8 +72,8 @@ NameKeys m_nameKeys; RenderablePivot m_renderOrigin; RenderableNamedEntity m_renderName; -Callback m_transformChanged; -Callback m_evaluateTransform; +Callback m_transformChanged; +Callback m_evaluateTransform; void construct(){ m_keyObservers.insert( "classname", ClassnameFilter::ClassnameChangedCaller( m_filter ) ); @@ -101,20 +101,20 @@ void originChanged(){ m_origin = m_originKey.m_origin; updateTransform(); } -typedef MemberCaller OriginChangedCaller; +typedef MemberCaller OriginChangedCaller; void anglesChanged(){ m_angles = m_anglesKey.m_angles; updateTransform(); } -typedef MemberCaller AnglesChangedCaller; +typedef MemberCaller AnglesChangedCaller; void scaleChanged(){ m_scale = m_scaleKey.m_scale; updateTransform(); } -typedef MemberCaller ScaleChangedCaller; +typedef MemberCaller ScaleChangedCaller; public: -MiscModel( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : +MiscModel( EntityClass* eclass, scene::Node& node, const Callback& transformChanged, const Callback& evaluateTransform ) : m_entity( eclass ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -130,7 +130,7 @@ MiscModel( EntityClass* eclass, scene::Node& node, const Callback& transformChan 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& transformChanged, const Callback& evaluateTransform ) : m_entity( other.m_entity ), m_originKey( OriginChangedCaller( *this ) ), m_origin( ORIGINKEY_IDENTITY ), @@ -235,7 +235,7 @@ void transformChanged(){ m_evaluateTransform(); updateTransform(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; }; class MiscModelInstance : public TargetableInstance, public TransformModifier, public Renderable @@ -290,7 +290,7 @@ void applyTransform(){ evaluateTransform(); m_contained.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; }; class MiscModelNode : diff --git a/plugins/entity/model.h b/plugins/entity/model.h index a7b395ff..75e442f1 100644 --- a/plugins/entity/model.h +++ b/plugins/entity/model.h @@ -34,10 +34,10 @@ class EModel : public ModuleObserver ResourceReference m_resource; scene::Traversable& m_traverse; scene::Node* m_node; -Callback m_modelChanged; +Callback m_modelChanged; public: -EModel( scene::Traversable& traversable, const Callback& modelChanged ) +EModel( scene::Traversable& traversable, const Callback& modelChanged ) : m_resource( "" ), m_traverse( traversable ), m_node( 0 ), m_modelChanged( modelChanged ){ m_resource.attach( *this ); } @@ -66,7 +66,7 @@ void modelChanged( const char* value ){ m_resource.attach( *this ); m_modelChanged(); } -typedef MemberCaller1 ModelChangedCaller; +typedef MemberCaller ModelChangedCaller; const char* getName() const { return m_resource.getName(); @@ -82,7 +82,7 @@ TraversableNode m_traverse; EModel m_model; public: SingletonModel() - : m_model( m_traverse, Callback() ){ + : m_model( m_traverse, Callback() ){ } void attach( scene::Traversable::Observer* observer ){ @@ -99,7 +99,7 @@ scene::Traversable& getTraversable(){ void modelChanged( const char* value ){ m_model.modelChanged( value ); } -typedef MemberCaller1 ModelChangedCaller; +typedef MemberCaller ModelChangedCaller; scene::Node* getNode() const { return m_model.getNode(); diff --git a/plugins/entity/modelskinkey.h b/plugins/entity/modelskinkey.h index 34d91112..96364015 100644 --- a/plugins/entity/modelskinkey.h +++ b/plugins/entity/modelskinkey.h @@ -40,7 +40,7 @@ class ModelSkinKey : public ModuleObserver { CopiedString m_name; ModelSkin* m_skin; -Callback m_skinChangedCallback; +Callback m_skinChangedCallback; ModelSkinKey( const ModelSkinKey& ); ModelSkinKey operator=( const ModelSkinKey& ); @@ -55,7 +55,7 @@ void destroy(){ } public: -ModelSkinKey( const Callback& skinChangedCallback ) : m_skinChangedCallback( skinChangedCallback ){ +ModelSkinKey( const Callback& skinChangedCallback ) : m_skinChangedCallback( skinChangedCallback ){ construct(); } ~ModelSkinKey(){ @@ -69,7 +69,7 @@ void skinChanged( const char* value ){ parseTextureName( m_name, value ); construct(); } -typedef MemberCaller1 SkinChangedCaller; +typedef MemberCaller SkinChangedCaller; void realise(){ m_skinChangedCallback(); diff --git a/plugins/entity/namedentity.h b/plugins/entity/namedentity.h index 29170d9e..857b10b4 100644 --- a/plugins/entity/namedentity.h +++ b/plugins/entity/namedentity.h @@ -79,7 +79,7 @@ void identifierChanged( const char* value ){ } m_name = value; } -typedef MemberCaller1 IdentifierChangedCaller; +typedef MemberCaller IdentifierChangedCaller; }; class RenderableNamedEntity : public OpenGLRenderable diff --git a/plugins/entity/namekeys.h b/plugins/entity/namekeys.h index 0e2d88b3..45943f1f 100644 --- a/plugins/entity/namekeys.h +++ b/plugins/entity/namekeys.h @@ -46,9 +46,9 @@ KeyIsName(){ }; -typedef MemberCaller1 KeyValueAssignCaller; -typedef MemberCaller1 KeyValueAttachCaller; -typedef MemberCaller1 KeyValueDetachCaller; +typedef MemberCaller KeyValueAssignCaller; +typedef MemberCaller KeyValueAttachCaller; +typedef MemberCaller KeyValueDetachCaller; class NameKeys : public Entity::Observer, public Namespaced { diff --git a/plugins/entity/origin.h b/plugins/entity/origin.h index 8628c3cf..84bb7462 100644 --- a/plugins/entity/origin.h +++ b/plugins/entity/origin.h @@ -59,12 +59,12 @@ inline Vector3 origin_snapped( const Vector3& origin, float snap ){ class OriginKey { -Callback m_originChanged; +Callback m_originChanged; public: Vector3 m_origin; -OriginKey( const Callback& originChanged ) +OriginKey( const Callback& originChanged ) : m_originChanged( originChanged ), m_origin( ORIGINKEY_IDENTITY ){ } @@ -72,7 +72,7 @@ void originChanged( const char* value ){ read_origin( m_origin, value ); m_originChanged(); } -typedef MemberCaller1 OriginChangedCaller; +typedef MemberCaller OriginChangedCaller; void write( Entity* entity ) const { diff --git a/plugins/entity/rotation.h b/plugins/entity/rotation.h index fc2c9fbe..4c566d96 100644 --- a/plugins/entity/rotation.h +++ b/plugins/entity/rotation.h @@ -144,12 +144,12 @@ inline void read_angle( Float9 rotation, const char* value ){ class RotationKey { -Callback m_rotationChanged; +Callback m_rotationChanged; public: Float9 m_rotation; -RotationKey( const Callback& rotationChanged ) +RotationKey( const Callback& rotationChanged ) : m_rotationChanged( rotationChanged ){ default_rotation( m_rotation ); } @@ -158,13 +158,13 @@ void angleChanged( const char* value ){ read_angle( m_rotation, value ); m_rotationChanged(); } -typedef MemberCaller1 AngleChangedCaller; +typedef MemberCaller AngleChangedCaller; void rotationChanged( const char* value ){ read_rotation( m_rotation, value ); m_rotationChanged(); } -typedef MemberCaller1 RotationChangedCaller; +typedef MemberCaller RotationChangedCaller; void write( Entity* entity ) const { Vector3 euler = matrix4_get_rotation_euler_xyz_degrees( rotation_toMatrix( m_rotation ) ); diff --git a/plugins/entity/scale.h b/plugins/entity/scale.h index f4cb726c..dfb2884a 100644 --- a/plugins/entity/scale.h +++ b/plugins/entity/scale.h @@ -87,12 +87,12 @@ inline Vector3 scale_scaled( const Vector3& scale, const Vector3& scaling ){ class ScaleKey { -Callback m_scaleChanged; +Callback m_scaleChanged; public: Vector3 m_scale; -ScaleKey( const Callback& scaleChanged ) +ScaleKey( const Callback& scaleChanged ) : m_scaleChanged( scaleChanged ), m_scale( SCALEKEY_IDENTITY ){ } @@ -100,13 +100,13 @@ void uniformScaleChanged( const char* value ){ read_scale( m_scale, value ); m_scaleChanged(); } -typedef MemberCaller1 UniformScaleChangedCaller; +typedef MemberCaller UniformScaleChangedCaller; void scaleChanged( const char* value ){ read_scalevec( m_scale, value ); m_scaleChanged(); } -typedef MemberCaller1 ScaleChangedCaller; +typedef MemberCaller ScaleChangedCaller; void write( Entity* entity ) const { write_scale( m_scale, entity ); diff --git a/plugins/entity/skincache.cpp b/plugins/entity/skincache.cpp index fce3c1a1..645e8a28 100644 --- a/plugins/entity/skincache.cpp +++ b/plugins/entity/skincache.cpp @@ -156,7 +156,7 @@ void parseFile( const char* name ){ } } -typedef MemberCaller1 ParseFileCaller; +typedef MemberCaller ParseFileCaller; void construct(){ GlobalFileSystem().forEachFile( "skins/", "skin", ParseFileCaller( *this ) ); diff --git a/plugins/entity/targetable.h b/plugins/entity/targetable.h index 6de382cf..99046a50 100644 --- a/plugins/entity/targetable.h +++ b/plugins/entity/targetable.h @@ -113,7 +113,7 @@ void targetnameChanged( const char* name ){ m_targets = getTargetables( name ); construct(); } -typedef MemberCaller1 TargetnameChangedCaller; +typedef MemberCaller TargetnameChangedCaller; }; @@ -127,7 +127,7 @@ TargetingEntity() : void targetChanged( const char* target ){ m_targets = getTargetables( target ); } -typedef MemberCaller1 TargetChangedCaller; +typedef MemberCaller TargetChangedCaller; typedef targetables_t::iterator iterator; @@ -194,7 +194,7 @@ void operator()( const Vector3& worldPosition ) const { class TargetKeys : public Entity::Observer { TargetingEntities m_targetingEntities; -Callback m_targetsChanged; +Callback m_targetsChanged; bool readTargetKey( const char* key, std::size_t& index ){ if ( string_equal_n( key, "target", 6 ) ) { @@ -210,7 +210,7 @@ bool readTargetKey( const char* key, std::size_t& index ){ return false; } public: -void setTargetsChanged( const Callback& targetsChanged ){ +void setTargetsChanged( const Callback& targetsChanged ){ m_targetsChanged = targetsChanged; } void targetsChanged(){ @@ -323,7 +323,7 @@ TargetableInstance( m_entity.detach( *this ); } -void setTargetsChanged( const Callback& targetsChanged ){ +void setTargetsChanged( const Callback& targetsChanged ){ m_targeting.setTargetsChanged( targetsChanged ); } void targetsChanged(){ diff --git a/plugins/md3model/model.h b/plugins/md3model/model.h index 946ee198..5f03d734 100644 --- a/plugins/md3model/model.h +++ b/plugins/md3model/model.h @@ -236,7 +236,7 @@ surfaces_t m_surfaces; AABB m_aabb_local; public: -Callback m_lightsChanged; +Callback m_lightsChanged; ~Model(){ for ( surfaces_t::iterator i = m_surfaces.begin(); i != m_surfaces.end(); ++i ) @@ -346,7 +346,7 @@ Cullable& get( NullType){ void lightsChanged(){ m_lightList->lightsChanged(); } -typedef MemberCaller LightsChangedCaller; +typedef MemberCaller LightsChangedCaller; void constructRemaps(){ ModelSkin* skin = NodeTypeCast::cast( path().parent() ); @@ -397,9 +397,9 @@ ModelInstance( const scene::Path& path, scene::Instance* parent, Model& model ) ~ModelInstance(){ destroyRemaps(); - Instance::setTransformChangedCallback( Callback() ); + Instance::setTransformChangedCallback( Callback() ); - m_model.m_lightsChanged = Callback(); + m_model.m_lightsChanged = Callback(); GlobalShaderCache().detach( *this ); } diff --git a/plugins/model/model.cpp b/plugins/model/model.cpp index aad851cf..5811af6f 100644 --- a/plugins/model/model.cpp +++ b/plugins/model/model.cpp @@ -323,7 +323,7 @@ surfaces_t m_surfaces; AABB m_aabb_local; public: -Callback m_lightsChanged; +Callback m_lightsChanged; PicoModel(){ constructNull(); @@ -472,7 +472,7 @@ Cullable& get( NullType){ void lightsChanged(){ m_lightList->lightsChanged(); } -typedef MemberCaller LightsChangedCaller; +typedef MemberCaller LightsChangedCaller; void constructRemaps(){ ASSERT_MESSAGE( m_skins.size() == m_picomodel.size(), "ERROR" ); @@ -524,9 +524,9 @@ PicoModelInstance( const scene::Path& path, scene::Instance* parent, PicoModel& ~PicoModelInstance(){ destroyRemaps(); - Instance::setTransformChangedCallback( Callback() ); + Instance::setTransformChangedCallback( Callback() ); - m_picomodel.m_lightsChanged = Callback(); + m_picomodel.m_lightsChanged = Callback(); GlobalShaderCache().detach( *this ); } diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index 656c1d84..6a1ec968 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -82,7 +82,7 @@ void ActiveShaders_IteratorBegin(); bool ActiveShaders_IteratorAtEnd(); IShader *ActiveShaders_IteratorCurrent(); void ActiveShaders_IteratorIncrement(); -Callback g_ActiveShadersChangedNotify; +Callback g_ActiveShadersChangedNotify; void FreeShaders(); void LoadShaderFile( const char *filename ); @@ -1442,7 +1442,7 @@ void LoadShaderFile( const char* filename ){ } } -typedef FreeCaller1 LoadShaderFileCaller; +typedef FreeCaller LoadShaderFileCaller; void loadGuideFile( const char* filename ){ @@ -1466,7 +1466,7 @@ void loadGuideFile( const char* filename ){ } } -typedef FreeCaller1 LoadGuideFileCaller; +typedef FreeCaller LoadGuideFileCaller; CShader* Try_Shader_ForName( const char* name ){ @@ -1543,7 +1543,7 @@ void IfFound_dumpUnreferencedShader( bool& bFound, const char* filename ){ globalOutputStream() << "\t" << filename << "\n"; } } -typedef ReferenceCaller1 IfFoundDumpUnreferencedShaderCaller; +typedef ReferenceCaller IfFoundDumpUnreferencedShaderCaller; void DumpUnreferencedShaders(){ bool bFound = false; @@ -1567,7 +1567,7 @@ void ShaderList_addShaderFile( const char* dirstring ){ } } -typedef FreeCaller1 AddShaderFileCaller; +typedef FreeCaller AddShaderFileCaller; /* @@ -1624,7 +1624,7 @@ void ShaderList_addFromArchive( const char *archivename ){ } } -typedef FreeCaller1 AddShaderListFromArchiveCaller; +typedef FreeCaller AddShaderListFromArchiveCaller; #include "stream/filestream.h" @@ -1763,7 +1763,7 @@ IShader* dereferenceActiveShadersIterator(){ void incrementActiveShadersIterator(){ ActiveShaders_IteratorIncrement(); } -void setActiveShadersChangedNotify( const Callback& notify ){ +void setActiveShadersChangedNotify( const Callback& notify ){ g_ActiveShadersChangedNotify = notify; } diff --git a/radiant/autosave.cpp b/radiant/autosave.cpp index 8b3de4f7..5cb91ea8 100644 --- a/radiant/autosave.cpp +++ b/radiant/autosave.cpp @@ -186,7 +186,7 @@ void Autosave_constructPage( PreferenceGroup& group ){ Autosave_constructPreferences( page ); } void Autosave_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } diff --git a/radiant/brush.h b/radiant/brush.h index 4508591c..c338e5f6 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -1498,8 +1498,8 @@ Array m_edge_faces; AABB m_aabb_local; // ---- -Callback m_evaluateTransform; -Callback m_boundsChanged; +Callback m_evaluateTransform; +Callback m_boundsChanged; mutable bool m_planeChanged; // b-rep evaluation required mutable bool m_transformChanged; // transform evaluation required @@ -1508,7 +1508,7 @@ mutable bool m_transformChanged; // transform evaluation required public: STRING_CONSTANT( Name, "Brush" ); -Callback m_lightsChanged; +Callback m_lightsChanged; // static data static Shader* m_state_point; @@ -1517,7 +1517,7 @@ 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& evaluateTransform, const Callback& boundsChanged ) : m_node( &node ), m_undoable_observer( 0 ), m_map( 0 ), @@ -1530,7 +1530,7 @@ Brush( scene::Node& node, const Callback& evaluateTransform, const Callback& bou 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& evaluateTransform, const Callback& boundsChanged ) : m_node( &node ), m_undoable_observer( 0 ), m_map( 0 ), @@ -1690,7 +1690,7 @@ void transformChanged(){ m_transformChanged = true; planeChanged(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; void evaluateTransform(){ if ( m_transformChanged ) { @@ -2460,7 +2460,7 @@ void selectedChanged( const Selectable& selectable ){ } m_selectionChanged( selectable ); } -typedef MemberCaller1 SelectedChangedCaller; +typedef MemberCaller SelectedChangedCaller; bool selectedVertices() const { return !m_vertexSelection.empty(); @@ -3052,7 +3052,7 @@ typedef LazyStatic StaticTypeCasts; void lightsChanged(){ m_lightList->lightsChanged(); } -typedef MemberCaller LightsChangedCaller; +typedef MemberCaller LightsChangedCaller; STRING_CONSTANT( Name, "BrushInstance" ); @@ -3074,9 +3074,9 @@ BrushInstance( const scene::Path& path, scene::Instance* parent, Brush& brush ) Instance::setTransformChangedCallback( LightsChangedCaller( *this ) ); } ~BrushInstance(){ - Instance::setTransformChangedCallback( Callback() ); + Instance::setTransformChangedCallback( Callback() ); - m_brush.m_lightsChanged = Callback(); + m_brush.m_lightsChanged = Callback(); GlobalShaderCache().detach( *this ); m_counter->decrement(); @@ -3107,13 +3107,13 @@ void selectedChanged( const Selectable& selectable ){ Instance::selectedChanged(); } -typedef MemberCaller1 SelectedChangedCaller; +typedef MemberCaller SelectedChangedCaller; void selectedChangedComponent( const Selectable& selectable ){ GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable ); GlobalSelectionSystem().onComponentSelection( *this, selectable ); } -typedef MemberCaller1 SelectedChangedComponentCaller; +typedef MemberCaller SelectedChangedComponentCaller; const BrushInstanceVisitor& forEachFaceInstance( const BrushInstanceVisitor& visitor ){ for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) @@ -3440,7 +3440,7 @@ void applyTransform(){ evaluateTransform(); m_brush.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; void setClipPlane( const Plane3& plane ){ m_clipPlane.setPlane( m_brush, plane ); diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index dd22446a..528341d9 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -1131,7 +1131,7 @@ BrushMakeSided( std::size_t count ) void set(){ Scene_BrushConstructPrefab( GlobalSceneGraph(), eBrushPrism, m_count, TextureBrowser_GetSelectedShader( GlobalTextureBrowser() ) ); } -typedef MemberCaller SetCaller; +typedef MemberCaller SetCaller; }; @@ -1166,7 +1166,7 @@ BrushPrefab( EBrushPrefab type ) void set(){ DoSides( m_type, axis_for_viewtype( GetViewAxis() ) ); } -typedef MemberCaller SetCaller; +typedef MemberCaller SetCaller; }; BrushPrefab g_brushprism( eBrushPrism ); @@ -1201,7 +1201,7 @@ void FlipClipper(){ } -Callback g_texture_lock_status_changed; +Callback g_texture_lock_status_changed; BoolExportCaller g_texdef_movelock_caller( g_brush_texturelock_enabled ); ToggleItem g_texdef_movelock_item( g_texdef_movelock_caller ); @@ -1216,7 +1216,7 @@ void Texdef_ToggleMoveLock(){ void Brush_registerCommands(){ - GlobalToggles_insert( "TogTexLock", FreeCaller(), ToggleItem::AddCallbackCaller( g_texdef_movelock_item ), Accelerator( 'T', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalToggles_insert( "TogTexLock", FreeCaller(), 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 ) ); @@ -1231,12 +1231,12 @@ void Brush_registerCommands(){ 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(), Accelerator( GDK_KEY_Return ) ); - GlobalCommands_insert( "SplitSelected", FreeCaller(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "FlipClip", FreeCaller(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "ClipSelected", FreeCaller(), Accelerator( GDK_KEY_Return ) ); + GlobalCommands_insert( "SplitSelected", FreeCaller(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "FlipClip", FreeCaller(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "MakeDetail", FreeCaller(), Accelerator( 'M', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "MakeStructural", FreeCaller(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "MakeDetail", FreeCaller(), Accelerator( 'M', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "MakeStructural", FreeCaller(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); } void Brush_constructMenu( ui::Menu menu ){ diff --git a/radiant/brushmanip.h b/radiant/brushmanip.h index 0654fd89..5a1f62b0 100644 --- a/radiant/brushmanip.h +++ b/radiant/brushmanip.h @@ -74,7 +74,7 @@ void Scene_BrushFitTexture_Component_Selected( scene::Graph& graph, float s_repe void Brush_constructMenu( ui::Menu menu ); -extern Callback g_texture_lock_status_changed; +extern Callback g_texture_lock_status_changed; void BrushFilters_construct(); void Brush_registerCommands(); diff --git a/radiant/brushmodule.cpp b/radiant/brushmodule.cpp index bc9c18ef..bd51cf55 100644 --- a/radiant/brushmodule.cpp +++ b/radiant/brushmodule.cpp @@ -45,12 +45,12 @@ bool getTextureLockEnabled(){ void Face_importSnapPlanes( bool value ){ Face::m_quantise = value ? quantiseInteger : quantiseFloating; } -typedef FreeCaller1 FaceImportSnapPlanesCaller; +typedef FreeCaller FaceImportSnapPlanesCaller; void Face_exportSnapPlanes( const BoolImportCallback& importer ){ importer( Face::m_quantise == quantiseInteger ); } -typedef FreeCaller1 FaceExportSnapPlanesCaller; +typedef FreeCaller FaceExportSnapPlanesCaller; void Brush_constructPreferences( PreferencesPage& page ){ page.appendCheckBox( @@ -80,7 +80,7 @@ void Brush_constructPage( PreferenceGroup& group ){ Brush_constructPreferences( page ); } void Brush_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } void Brush_unlatchPreferences(){ @@ -159,7 +159,7 @@ void Brush_Construct( EBrushType type ){ GlobalPreferenceSystem().registerPreference( "TexdefDefaultScale", FloatImportStringCaller( g_texdef_default_scale ), FloatExportStringCaller( g_texdef_default_scale ) ); GridStatus_getTextureLockEnabled = getTextureLockEnabled; - g_texture_lock_status_changed = FreeCaller(); + g_texture_lock_status_changed = FreeCaller(); } void Brush_Destroy(){ @@ -188,8 +188,8 @@ void BrushFaceData_fromFace( const BrushFaceDataCallback& callback, Face& face ) faceData.value = face.getShader().m_flags.m_value; callback( faceData ); } -typedef ConstReferenceCaller1 BrushFaceDataFromFaceCaller; -typedef Callback1 FaceCallback; +typedef ConstReferenceCaller BrushFaceDataFromFaceCaller; +typedef Callback FaceCallback; class Quake3BrushCreator : public BrushCreator { diff --git a/radiant/build.cpp b/radiant/build.cpp index 722d46fb..a1eab6c3 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -961,7 +961,7 @@ BuildMenuItem( const char* name, ui::MenuItem item ) void run(){ RunBSP( m_name ); } -typedef MemberCaller RunCaller; +typedef MemberCaller RunCaller; }; typedef std::list BuildMenuItems; diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 8d42b715..c505b1be 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -160,11 +160,11 @@ struct camera_t } View* m_view; - Callback m_update; + Callback m_update; static camera_draw_mode draw_mode; - camera_t( View* view, const Callback& update ) + camera_t( View* view, const Callback& update ) : width( 0 ), height( 0 ), timing( false ), @@ -513,18 +513,18 @@ void Camera_PitchDown_KeyUp( camera_t& camera ){ } -typedef ReferenceCaller FreeMoveCameraMoveForwardKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveForwardKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveBackKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveBackKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveLeftKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveLeftKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveRightKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveRightKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveUpKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveUpKeyUpCaller; -typedef ReferenceCaller FreeMoveCameraMoveDownKeyDownCaller; -typedef ReferenceCaller FreeMoveCameraMoveDownKeyUpCaller; +typedef ReferenceCaller FreeMoveCameraMoveForwardKeyDownCaller; +typedef ReferenceCaller FreeMoveCameraMoveForwardKeyUpCaller; +typedef ReferenceCaller FreeMoveCameraMoveBackKeyDownCaller; +typedef ReferenceCaller FreeMoveCameraMoveBackKeyUpCaller; +typedef ReferenceCaller FreeMoveCameraMoveLeftKeyDownCaller; +typedef ReferenceCaller FreeMoveCameraMoveLeftKeyUpCaller; +typedef ReferenceCaller FreeMoveCameraMoveRightKeyDownCaller; +typedef ReferenceCaller FreeMoveCameraMoveRightKeyUpCaller; +typedef ReferenceCaller FreeMoveCameraMoveUpKeyDownCaller; +typedef ReferenceCaller FreeMoveCameraMoveUpKeyUpCaller; +typedef ReferenceCaller FreeMoveCameraMoveDownKeyDownCaller; +typedef ReferenceCaller FreeMoveCameraMoveDownKeyUpCaller; const float SPEED_MOVE = 32; @@ -595,9 +595,9 @@ class RadiantCameraView : public CameraView { camera_t& m_camera; View* m_view; -Callback m_update; +Callback 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& 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 ); @@ -723,7 +723,7 @@ private: void Cam_Draw(); }; -typedef MemberCaller CamWndQueueDraw; +typedef MemberCaller CamWndQueueDraw; Shader* CamWnd::m_state_select1 = 0; Shader* CamWnd::m_state_select2 = 0; @@ -909,44 +909,44 @@ void KeyEvent_disconnect( const char* name ){ void CamWnd_registerCommands( CamWnd& camwnd ){ GlobalKeyEvents_insert( "CameraForward", Accelerator( GDK_KEY_Up ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraBack", Accelerator( GDK_KEY_Down ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraLeft", Accelerator( GDK_KEY_Left ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraRight", Accelerator( GDK_KEY_Right ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraStrafeRight", Accelerator( GDK_KEY_period ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraStrafeLeft", Accelerator( GDK_KEY_comma ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraUp", Accelerator( 'D' ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraDown", Accelerator( 'C' ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraAngleDown", Accelerator( 'A' ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraAngleUp", Accelerator( 'Z' ), - ReferenceCaller( camwnd.getCamera() ), - ReferenceCaller( camwnd.getCamera() ) + ReferenceCaller( camwnd.getCamera() ), + ReferenceCaller( camwnd.getCamera() ) ); GlobalKeyEvents_insert( "CameraFreeMoveForward", Accelerator( GDK_KEY_Up ), @@ -974,17 +974,17 @@ void CamWnd_registerCommands( CamWnd& camwnd ){ FreeMoveCameraMoveDownKeyUpCaller( camwnd.getCamera() ) ); - GlobalCommands_insert( "CameraForward", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Up ) ); - GlobalCommands_insert( "CameraBack", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Down ) ); - GlobalCommands_insert( "CameraLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Left ) ); - GlobalCommands_insert( "CameraRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Right ) ); - GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_period ) ); - GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_comma ) ); + GlobalCommands_insert( "CameraForward", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Up ) ); + GlobalCommands_insert( "CameraBack", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Down ) ); + GlobalCommands_insert( "CameraLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Left ) ); + GlobalCommands_insert( "CameraRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Right ) ); + GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_period ) ); + GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_comma ) ); - GlobalCommands_insert( "CameraUp", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'D' ) ); - GlobalCommands_insert( "CameraDown", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'C' ) ); - GlobalCommands_insert( "CameraAngleUp", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'A' ) ); - GlobalCommands_insert( "CameraAngleDown", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'Z' ) ); + GlobalCommands_insert( "CameraUp", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'D' ) ); + GlobalCommands_insert( "CameraDown", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'C' ) ); + GlobalCommands_insert( "CameraAngleUp", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'A' ) ); + GlobalCommands_insert( "CameraAngleDown", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'Z' ) ); } void CamWnd_Move_Enable( CamWnd& camwnd ){ @@ -1136,7 +1136,7 @@ void CamWnd_Remove_Handlers_FreeMove( CamWnd& camwnd ){ CamWnd::CamWnd() : m_view( true ), m_Camera( &m_view, CamWndQueueDraw( *this ) ), - m_cameraview( m_Camera, &m_view, ReferenceCaller( *this ) ), + m_cameraview( m_Camera, &m_view, ReferenceCaller( *this ) ), m_gl_widget( glwidget_new( TRUE ) ), m_window_observer( NewWindowObserver() ), m_XORRectangle( m_gl_widget ), @@ -1152,7 +1152,7 @@ CamWnd::CamWnd() : GlobalWindowObservers_add( m_window_observer ); GlobalWindowObservers_connectWidget( m_gl_widget ); - m_window_observer->setRectangleDrawCallback( ReferenceCaller1( *this ) ); + m_window_observer->setRectangleDrawCallback( ReferenceCaller( *this ) ); m_window_observer->setView( m_view ); g_object_ref( m_gl_widget._handle ); @@ -1171,7 +1171,7 @@ CamWnd::CamWnd() : m_gl_widget.connect( "scroll_event", G_CALLBACK( wheelmove_scroll ), this ); - AddSceneChangeCallback( ReferenceCaller( *this ) ); + AddSceneChangeCallback( ReferenceCaller( *this ) ); PressedButtons_connect( g_pressedButtons, m_gl_widget ); } @@ -1391,12 +1391,12 @@ void render( const Matrix4& modelview, const Matrix4& projection ){ void ShowStatsToggle(){ g_camwindow_globals_private.m_showStats ^= 1; } -typedef FreeCaller ShowStatsToggleCaller; +typedef FreeCaller ShowStatsToggleCaller; void ShowStatsExport( const BoolImportCallback& importer ){ importer( g_camwindow_globals_private.m_showStats ); } -typedef FreeCaller1 ShowStatsExportCaller; +typedef FreeCaller ShowStatsExportCaller; ShowStatsExportCaller g_show_stats_caller; BoolExportCallback g_show_stats_callback( g_show_stats_caller ); @@ -1711,7 +1711,7 @@ CameraModel* g_camera_model = 0; 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() ); g_camera_model = 0; Camera_updateModelview( camwnd.getCamera() ); Camera_updateProjection( camwnd.getCamera() ); @@ -1734,7 +1734,7 @@ void CamWnd_LookThroughSelected( CamWnd& camwnd ){ if ( cameraModel != 0 ) { CamWnd_Remove_Handlers_Move( camwnd ); g_camera_model = cameraModel; - g_camera_model->setCameraView( &camwnd.getCameraView(), ReferenceCaller( camwnd ) ); + g_camera_model->setCameraView( &camwnd.getCameraView(), ReferenceCaller( camwnd ) ); } } } @@ -1767,7 +1767,7 @@ void RenderModeImport( int value ){ CamWnd_SetMode( cd_texture ); } } -typedef FreeCaller1 RenderModeImportCaller; +typedef FreeCaller RenderModeImportCaller; void RenderModeExport( const IntImportCallback& importer ){ switch ( CamWnd_GetMode() ) @@ -1786,7 +1786,7 @@ void RenderModeExport( const IntImportCallback& importer ){ break; } } -typedef FreeCaller1 RenderModeExportCaller; +typedef FreeCaller 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 ); @@ -1795,12 +1795,12 @@ void Camera_constructPreferences( PreferencesPage& page ){ page.appendCheckBox( "", "Invert mouse vertical axis", g_camwindow_globals_private.m_bCamInverseMouse ); page.appendCheckBox( "", "Discrete movement", - FreeCaller1(), + FreeCaller(), BoolExportCaller( g_camwindow_globals_private.m_bCamDiscrete ) ); page.appendCheckBox( "", "Enable far-clip plane", - FreeCaller1(), + FreeCaller(), BoolExportCaller( g_camwindow_globals_private.m_bCubicClipping ) ); @@ -1839,14 +1839,14 @@ void Camera_constructPage( PreferenceGroup& group ){ Camera_constructPreferences( page ); } void Camera_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } #include "preferencesystem.h" #include "stringio.h" #include "dialog.h" -typedef FreeCaller1 CamWndMoveDiscreteImportCaller; +typedef FreeCaller CamWndMoveDiscreteImportCaller; void CameraSpeed_increase(){ if ( g_camwindow_globals_private.m_nMoveSpeed <= ( MAX_CAM_SPEED - CAM_SPEED_STEP - 10 ) ) { @@ -1868,25 +1868,25 @@ void CameraSpeed_decrease(){ /// \brief Initialisation for things that have the same lifespan as this module. void CamWnd_Construct(){ - GlobalCommands_insert( "CenterView", FreeCaller(), Accelerator( GDK_KEY_End ) ); + GlobalCommands_insert( "CenterView", FreeCaller(), Accelerator( GDK_KEY_End ) ); - GlobalToggles_insert( "ToggleCubicClip", FreeCaller(), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "CubicClipZoomIn", FreeCaller(), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "CubicClipZoomOut", FreeCaller(), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalToggles_insert( "ToggleCubicClip", FreeCaller(), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "CubicClipZoomIn", FreeCaller(), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "CubicClipZoomOut", FreeCaller(), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "UpFloor", FreeCaller(), Accelerator( GDK_KEY_Prior ) ); - GlobalCommands_insert( "DownFloor", FreeCaller(), Accelerator( GDK_KEY_Next ) ); + GlobalCommands_insert( "UpFloor", FreeCaller(), Accelerator( GDK_KEY_Prior ) ); + GlobalCommands_insert( "DownFloor", FreeCaller(), 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() ); - GlobalCommands_insert( "LookThroughCamera", FreeCaller() ); + GlobalCommands_insert( "LookThroughSelected", FreeCaller() ); + GlobalCommands_insert( "LookThroughCamera", FreeCaller() ); if ( g_pGameDescription->mGameType == "doom3" ) { - GlobalCommands_insert( "TogglePreview", FreeCaller(), Accelerator( GDK_KEY_F3 ) ); + GlobalCommands_insert( "TogglePreview", FreeCaller(), Accelerator( GDK_KEY_F3 ) ); } - GlobalCommands_insert( "CameraSpeedInc", FreeCaller(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CameraSpeedDec", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "CameraSpeedInc", FreeCaller(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "CameraSpeedDec", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) ); GlobalShortcuts_insert( "CameraForward", Accelerator( GDK_KEY_Up ) ); GlobalShortcuts_insert( "CameraBack", Accelerator( GDK_KEY_Down ) ); diff --git a/radiant/commands.cpp b/radiant/commands.cpp index 7ebc4f25..1fab3bdc 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -71,7 +71,7 @@ typedef std::map Commands; Commands g_commands; -void GlobalCommands_insert( const char* name, const Callback& callback, const Accelerator& accelerator ){ +void GlobalCommands_insert( const char* name, const Callback& 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 ) ); } @@ -87,7 +87,7 @@ typedef std::map Toggles; 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& 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 ) ); } @@ -102,7 +102,7 @@ typedef std::map KeyEvents; 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& keyDown, const Callback& 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 ) ); } diff --git a/radiant/commands.h b/radiant/commands.h index ea5a6f33..ec10e1d8 100644 --- a/radiant/commands.h +++ b/radiant/commands.h @@ -35,13 +35,13 @@ public: 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& 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& 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& keyDown, const Callback& keyUp ); const KeyEvent& GlobalKeyEvents_find( const char* name ); diff --git a/radiant/csg.cpp b/radiant/csg.cpp index cc5de460..2abfb1b3 100644 --- a/radiant/csg.cpp +++ b/radiant/csg.cpp @@ -213,7 +213,7 @@ BindArguments2 bindArguments( const Caller& caller, FirstBound firstBoun inline bool Face_testPlane( const Face& face, const Plane3& plane, bool flipped ){ return face.contributes() && !Winding_TestPlane( face.getWinding(), plane, flipped ); } -typedef Function3 FaceTestPlane; +typedef Function FaceTestPlane; diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index 99d6d79b..bb8705f2 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -112,7 +112,7 @@ template< typename Type_, typename Other_, void( *Import ) ( Type_&, Other_ ), - void( *Export ) ( Type_&, const Callback1& ) + void( *Export ) ( Type_&, const Callback& ) > class ImportExport { @@ -120,8 +120,8 @@ public: typedef Type_ Type; typedef Other_ Other; -typedef ReferenceCaller1 ImportCaller; -typedef ReferenceCaller1&, Export> ExportCaller; +typedef ReferenceCaller ImportCaller; +typedef ReferenceCaller&), Export> ExportCaller; }; typedef ImportExport BoolImportExport; @@ -229,8 +229,8 @@ template class CallbackDialogData : public DLG_DATA { public: -typedef Callback1 ImportCallback; -typedef Callback1 ExportCallback; +typedef Callback ImportCallback; +typedef Callback ExportCallback; private: ImportCallback m_importWidget; @@ -281,8 +281,8 @@ AddCustomData( DialogDataList& data ) : m_data( data ){ } void apply( typename Widget::Type& widget, - const Callback1& importViewer, - const Callback1&>& exportViewer + const Callback& importViewer, + const Callback&)>& exportViewer ) const { m_data.push_back( new CallbackDialogData( diff --git a/radiant/dialog.h b/radiant/dialog.h index 13ff605c..d9424809 100644 --- a/radiant/dialog.h +++ b/radiant/dialog.h @@ -33,55 +33,55 @@ inline void BoolImport( bool& self, bool value ){ self = value; } -typedef ReferenceCaller1 BoolImportCaller; +typedef ReferenceCaller BoolImportCaller; inline void BoolExport( bool& self, const BoolImportCallback& importCallback ){ importCallback( self ); } -typedef ReferenceCaller1 BoolExportCaller; +typedef ReferenceCaller BoolExportCaller; inline void IntImport( int& self, int value ){ self = value; } -typedef ReferenceCaller1 IntImportCaller; +typedef ReferenceCaller IntImportCaller; inline void IntExport( int& self, const IntImportCallback& importCallback ){ importCallback( self ); } -typedef ReferenceCaller1 IntExportCaller; +typedef ReferenceCaller IntExportCaller; inline void SizeImport( std::size_t& self, std::size_t value ){ self = value; } -typedef ReferenceCaller1 SizeImportCaller; +typedef ReferenceCaller SizeImportCaller; inline void SizeExport( std::size_t& self, const SizeImportCallback& importCallback ){ importCallback( self ); } -typedef ReferenceCaller1 SizeExportCaller; +typedef ReferenceCaller SizeExportCaller; inline void FloatImport( float& self, float value ){ self = value; } -typedef ReferenceCaller1 FloatImportCaller; +typedef ReferenceCaller FloatImportCaller; inline void FloatExport( float& self, const FloatImportCallback& importCallback ){ importCallback( self ); } -typedef ReferenceCaller1 FloatExportCaller; +typedef ReferenceCaller FloatExportCaller; inline void StringImport( CopiedString& self, const char* value ){ self = value; } -typedef ReferenceCaller1 StringImportCaller; +typedef ReferenceCaller StringImportCaller; inline void StringExport( CopiedString& self, const StringImportCallback& importCallback ){ importCallback( self.c_str() ); } -typedef ReferenceCaller1 StringExportCaller; +typedef ReferenceCaller StringExportCaller; struct DLG_DATA diff --git a/radiant/eclass_doom3.cpp b/radiant/eclass_doom3.cpp index 2fde6381..7a7da472 100644 --- a/radiant/eclass_doom3.cpp +++ b/radiant/eclass_doom3.cpp @@ -689,7 +689,7 @@ EntityClassDoom3() : m_unrealised( 2 ){ void realise(){ if ( --m_unrealised == 0 ) { globalOutputStream() << "searching vfs directory " << makeQuoted( "def" ) << " for *.def\n"; - GlobalFileSystem().forEachFile( "def/", "def", FreeCaller1() ); + GlobalFileSystem().forEachFile( "def/", "def", FreeCaller() ); { for ( Models::iterator i = g_models.begin(); i != g_models.end(); ++i ) diff --git a/radiant/entity.cpp b/radiant/entity.cpp index fbb268fb..f480a223 100644 --- a/radiant/entity.cpp +++ b/radiant/entity.cpp @@ -545,12 +545,12 @@ const char* misc_model_dialog( ui::Widget parent ){ void LightRadiiImport( EntityCreator& self, bool value ){ self.setLightRadii( value ); } -typedef ReferenceCaller1 LightRadiiImportCaller; +typedef ReferenceCaller LightRadiiImportCaller; void LightRadiiExport( EntityCreator& self, const BoolImportCallback& importer ){ importer( self.getLightRadii() ); } -typedef ReferenceCaller1 LightRadiiExportCaller; +typedef ReferenceCaller LightRadiiExportCaller; void Entity_constructPreferences( PreferencesPage& page ){ page.appendCheckBox( @@ -564,7 +564,7 @@ void Entity_constructPage( PreferenceGroup& group ){ Entity_constructPreferences( page ); } void Entity_registerPreferencesPage(){ - PreferencesDialog_addDisplayPage( FreeCaller1() ); + PreferencesDialog_addDisplayPage( FreeCaller() ); } @@ -584,12 +584,12 @@ void Entity_constructMenu( ui::Menu menu ){ #include "stringio.h" void Entity_Construct(){ - GlobalCommands_insert( "EntityColor", FreeCaller(), Accelerator( 'K' ) ); - GlobalCommands_insert( "NormalizeColor", FreeCaller() ); - GlobalCommands_insert( "ConnectSelection", FreeCaller(), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "KillConnectSelection", FreeCaller(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) ); - GlobalCommands_insert( "GroupSelection", FreeCaller() ); - GlobalCommands_insert( "UngroupSelection", FreeCaller() ); + GlobalCommands_insert( "EntityColor", FreeCaller(), Accelerator( 'K' ) ); + GlobalCommands_insert( "NormalizeColor", FreeCaller() ); + GlobalCommands_insert( "ConnectSelection", FreeCaller(), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "KillConnectSelection", FreeCaller(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) ); + GlobalCommands_insert( "GroupSelection", FreeCaller() ); + GlobalCommands_insert( "UngroupSelection", FreeCaller() ); 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 ) ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index ccdbc111..852b7639 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -142,7 +142,7 @@ void release(){ void apply(){ Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_check.active() ? "1" : "0" ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; void update(){ const char* value = SelectedEntity_getValueForKey( m_key.c_str() ); @@ -154,7 +154,7 @@ void update(){ toggle_button_set_active_no_signal( m_check, false ); } } -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; }; @@ -190,14 +190,14 @@ void apply(){ value << m_entry.text(); Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), value.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; void update(){ StringOutputStream value( 64 ); value << SelectedEntity_getValueForKey( m_key.c_str() ); m_entry.text(value.c_str()); } -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; }; class ShaderAttribute : public StringAttribute @@ -232,13 +232,13 @@ void apply(){ value << m_entry.m_entry.m_entry.text(); Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), value.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller 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 UpdateCaller; +typedef MemberCaller UpdateCaller; void browse( const BrowsedPathEntry::SetPathCallback& setPath ){ const char *filename = misc_model_dialog( m_entry.m_entry.m_frame.window() ); @@ -247,7 +247,7 @@ void browse( const BrowsedPathEntry::SetPathCallback& setPath ){ apply(); } } -typedef MemberCaller1 BrowseCaller; +typedef MemberCaller BrowseCaller; }; const char* browse_sound( ui::Widget parent ){ @@ -295,13 +295,13 @@ void apply(){ value << m_entry.m_entry.m_entry.text(); Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), value.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller 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 UpdateCaller; +typedef MemberCaller UpdateCaller; void browse( const BrowsedPathEntry::SetPathCallback& setPath ){ const char *filename = browse_sound( m_entry.m_entry.m_frame.window() ); @@ -310,7 +310,7 @@ void browse( const BrowsedPathEntry::SetPathCallback& setPath ){ apply(); } } -typedef MemberCaller1 BrowseCaller; +typedef MemberCaller BrowseCaller; }; inline double angle_normalised( double angle ){ @@ -342,7 +342,7 @@ void apply(){ angle << angle_normalised( entry_get_float( m_entry ) ); Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), angle.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; void update(){ const char* value = SelectedEntity_getValueForKey( m_key.c_str() ); @@ -356,7 +356,7 @@ void update(){ m_entry.text("0"); } } -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; }; namespace @@ -403,7 +403,7 @@ void apply(){ angle << angle_normalised( entry_get_float( m_entry ) ); Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), angle.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; void update(){ const char* value = SelectedEntity_getValueForKey( m_key.c_str() ); @@ -433,7 +433,7 @@ void update(){ m_entry.text("0"); } } -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; void applyRadio(){ int index = radio_button_get_active( m_radio.m_radio ); @@ -447,7 +447,7 @@ void applyRadio(){ apply(); } } -typedef MemberCaller ApplyRadioCaller; +typedef MemberCaller ApplyRadioCaller; }; @@ -508,7 +508,7 @@ void apply(){ << " " << angle_normalised( entry_get_float( m_angles.m_roll ) ); Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), angles.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; void update(){ StringOutputStream angle( 32 ); @@ -538,7 +538,7 @@ void update(){ m_angles.m_roll.text("0"); } } -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; }; class Vector3Entry @@ -595,7 +595,7 @@ void apply(){ << " " << entry_get_float( m_vector3.m_z ); Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), vector3.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; void update(){ StringOutputStream buffer( 32 ); @@ -625,12 +625,12 @@ void update(){ m_vector3.m_z.text("0"); } } -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; }; class NonModalComboBox { -Callback m_changed; +Callback m_changed; guint m_changedHandler; static gboolean changed( ui::ComboBox widget, NonModalComboBox* self ){ @@ -639,7 +639,7 @@ static gboolean changed( ui::ComboBox widget, NonModalComboBox* self ){ } public: -NonModalComboBox( const Callback& changed ) : m_changed( changed ), m_changedHandler( 0 ){ +NonModalComboBox( const Callback& changed ) : m_changed( changed ), m_changedHandler( 0 ){ } void connect( ui::ComboBox combo ){ m_changedHandler = combo.connect( "changed", G_CALLBACK( changed ), this ); @@ -684,7 +684,7 @@ ui::Widget getWidget() const { void apply(){ Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_type[gtk_combo_box_get_active( m_combo )].second.c_str() ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; void update(){ const char* value = SelectedEntity_getValueForKey( m_key.c_str() ); @@ -697,7 +697,7 @@ void update(){ m_nonModal.setActive( m_combo, 0 ); } } -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; }; @@ -1063,7 +1063,7 @@ class EntityInspectorDraw { IdleDraw m_idleDraw; public: -EntityInspectorDraw() : m_idleDraw( FreeCaller( ) ){ +EntityInspectorDraw() : m_idleDraw( FreeCaller( ) ){ } void queueDraw(){ m_idleDraw.queueDraw(); @@ -1532,7 +1532,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ g_entityInspector_windowConstructed = true; EntityClassList_fill(); - typedef FreeCaller1 EntityInspectorSelectionChangedCaller; + typedef FreeCaller EntityInspectorSelectionChangedCaller; GlobalSelectionSystem().addSelectionChangeCallback( EntityInspectorSelectionChangedCaller() ); GlobalEntityCreator().setKeyValueChangedFunc( EntityInspector_keyValueChanged ); diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index 290f8bac..9218027d 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -41,7 +41,7 @@ #include "treemodel.h" void RedrawEntityList(); -typedef FreeCaller RedrawEntityListCaller; +typedef FreeCaller RedrawEntityListCaller; class EntityList @@ -377,7 +377,7 @@ void EntityList_Construct(){ GlobalPreferenceSystem().registerPreference( "EntityInfoDlg", WindowPositionTrackerImportStringCaller( getEntityList().m_positionTracker ), WindowPositionTrackerExportStringCaller( getEntityList().m_positionTracker ) ); - typedef FreeCaller1 EntityListSelectionChangedCaller; + typedef FreeCaller EntityListSelectionChangedCaller; GlobalSelectionSystem().addSelectionChangeCallback( EntityListSelectionChangedCaller() ); } void EntityList_Destroy(){ diff --git a/radiant/filters.cpp b/radiant/filters.cpp index 14eec0cd..be7576c3 100644 --- a/radiant/filters.cpp +++ b/radiant/filters.cpp @@ -130,7 +130,7 @@ ToggleFilterFlag( const ToggleFilterFlag& other ) : m_mask( other.m_mask ), m_it void active( const BoolImportCallback& importCallback ){ importCallback( ( g_filters_globals.exclude & m_mask ) != 0 ); } -typedef MemberCaller1 ActiveCaller; +typedef MemberCaller ActiveCaller; void toggle(){ g_filters_globals.exclude ^= m_mask; m_item.update(); @@ -141,7 +141,7 @@ void reset(){ m_item.update(); PerformFiltering(); } -typedef MemberCaller ToggleCaller; +typedef MemberCaller ToggleCaller; }; @@ -218,8 +218,8 @@ void Filters_constructMenu( ui::Menu menu_in_menu ){ void ConstructFilters(){ GlobalPreferenceSystem().registerPreference( "SI_Exclude", SizeImportStringCaller( g_filters_globals.exclude ), SizeExportStringCaller( g_filters_globals.exclude ) ); - GlobalCommands_insert( "InvertFilters", FreeCaller() ); - GlobalCommands_insert( "ResetFilters", FreeCaller() ); + GlobalCommands_insert( "InvertFilters", FreeCaller() ); + GlobalCommands_insert( "ResetFilters", FreeCaller() ); add_filter_command( EXCLUDE_WORLD, "FilterWorldBrushes", Accelerator( '1', (GdkModifierType)GDK_MOD1_MASK ) ); add_filter_command( EXCLUDE_ENT, "FilterEntities", Accelerator( '2', (GdkModifierType)GDK_MOD1_MASK ) ); diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 48c564c4..a511cb1c 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -50,7 +50,7 @@ static void setReplaceStr( const char* name ); static void setFindStr( const char* name ); static bool isOpen(); static void show(); -typedef FreeCaller<&FindTextureDialog::show> ShowCaller; +typedef FreeCaller ShowCaller; static void updateTextures( const char* name ); FindTextureDialog(); diff --git a/radiant/grid.cpp b/radiant/grid.cpp index 8ede1a22..08b9bb86 100644 --- a/radiant/grid.cpp +++ b/radiant/grid.cpp @@ -133,11 +133,11 @@ void set(){ m_item.update(); setGridPower( m_id ); } -typedef MemberCaller SetCaller; +typedef MemberCaller SetCaller; void active( const BoolImportCallback& importCallback ){ importCallback( g_grid_power == m_id ); } -typedef MemberCaller1 ExportCaller; +typedef MemberCaller ExportCaller; }; GridMenuItem g_gridMenu0125( GRIDPOWER_0125 ); @@ -192,10 +192,10 @@ void ToggleGridSnap(){ } void Grid_registerCommands(){ - GlobalCommands_insert( "GridDown", FreeCaller(), Accelerator( '[' ) ); - GlobalCommands_insert( "GridUp", FreeCaller(), Accelerator( ']' ) ); + GlobalCommands_insert( "GridDown", FreeCaller(), Accelerator( '[' ) ); + GlobalCommands_insert( "GridUp", FreeCaller(), Accelerator( ']' ) ); - GlobalCommands_insert( "ToggleGridSnap", FreeCaller() ); + GlobalCommands_insert( "ToggleGridSnap", FreeCaller() ); 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 ) ); @@ -246,7 +246,7 @@ void Grid_constructPage( PreferenceGroup& group ){ Grid_constructPreferences( page ); } void Grid_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } void Grid_construct(){ diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 78033931..f175bc51 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -76,7 +76,7 @@ std::vector g_pages; void GroupDialog_updatePageTitle( ui::Window window, std::size_t pageIndex ){ if ( pageIndex < g_pages.size() ) { - g_pages[pageIndex]( PointerCaller1( window ) ); + g_pages[pageIndex]( PointerCaller( window ) ); } } @@ -197,7 +197,7 @@ void GroupDialog_updatePageTitle( ui::Widget page ){ void GroupDialog_Construct(){ GlobalPreferenceSystem().registerPreference( "EntityWnd", WindowPositionTrackerImportStringCaller( g_GroupDlg.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_GroupDlg.m_position_tracker ) ); - GlobalCommands_insert( "ViewEntityInfo", FreeCaller(), Accelerator( 'N' ) ); + GlobalCommands_insert( "ViewEntityInfo", FreeCaller(), Accelerator( 'N' ) ); } void GroupDialog_Destroy(){ } diff --git a/radiant/groupdialog.h b/radiant/groupdialog.h index 50e880b4..f1a2e86b 100644 --- a/radiant/groupdialog.h +++ b/radiant/groupdialog.h @@ -36,7 +36,7 @@ void GroupDialog_show(); inline void RawStringExport( const char* string, const StringImportCallback& importer ){ importer( string ); } -typedef ConstPointerCaller1 RawStringExportCaller; +typedef ConstPointerCaller RawStringExportCaller; ui::Widget GroupDialog_addPage( const char* tabLabel, ui::Widget widget, const StringExportCallback& title ); void GroupDialog_showPage( ui::Widget page ); diff --git a/radiant/help.cpp b/radiant/help.cpp index 82e5f667..b11743d6 100644 --- a/radiant/help.cpp +++ b/radiant/help.cpp @@ -94,7 +94,7 @@ void process_xlink( const char* filename, const char *menu_name, const char *bas prop = xmlGetProp( pNode, reinterpret_cast( "name" ) ); ASSERT_NOTNULL( prop ); - create_menu_item_with_mnemonic( menu_in_menu, reinterpret_cast( prop ), ReferenceCaller( mHelpURLs.back() ) ); + create_menu_item_with_mnemonic( menu_in_menu, reinterpret_cast( prop ), ReferenceCaller( mHelpURLs.back() ) ); xmlFree( prop ); } pNode = pNode->next; diff --git a/radiant/main.cpp b/radiant/main.cpp index fd451524..bad50120 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -49,7 +49,7 @@ \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 diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 433767d5..64298050 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -417,7 +417,7 @@ const char* GameToolsPath_get(){ void EnginePathImport( CopiedString& self, const char* value ){ setEnginePath( value ); } -typedef ReferenceCaller1 EnginePathImportCaller; +typedef ReferenceCaller EnginePathImportCaller; void Paths_constructPreferences( PreferencesPage& page ){ page.appendPathEntry( "Engine Path", true, @@ -430,7 +430,7 @@ void Paths_constructPage( PreferenceGroup& group ){ Paths_constructPreferences( page ); } void Paths_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } @@ -790,8 +790,8 @@ void ColorScheme_Ydnar(){ XY_UpdateAllWindows(); } -typedef Callback1 GetColourCallback; -typedef Callback1 SetColourCallback; +typedef Callback GetColourCallback; +typedef Callback SetColourCallback; class ChooseColour { @@ -814,37 +814,37 @@ void operator()(){ void Colour_get( const Vector3& colour, Vector3& other ){ other = colour; } -typedef ConstReferenceCaller1 ColourGetCaller; +typedef ConstReferenceCaller ColourGetCaller; void Colour_set( Vector3& colour, const Vector3& other ){ colour = other; SceneChangeNotify(); } -typedef ReferenceCaller1 ColourSetCaller; +typedef ReferenceCaller ColourSetCaller; void BrushColour_set( const Vector3& other ){ g_xywindow_globals.color_brushes = other; SetWorldspawnColour( g_xywindow_globals.color_brushes ); SceneChangeNotify(); } -typedef FreeCaller1 BrushColourSetCaller; +typedef FreeCaller BrushColourSetCaller; void ClipperColour_set( const Vector3& other ){ g_xywindow_globals.color_clipper = other; Brush_clipperColourChanged(); SceneChangeNotify(); } -typedef FreeCaller1 ClipperColourSetCaller; +typedef FreeCaller ClipperColourSetCaller; void TextureBrowserColour_get( Vector3& other ){ other = TextureBrowser_getBackgroundColour( GlobalTextureBrowser() ); } -typedef FreeCaller1 TextureBrowserColourGetCaller; +typedef FreeCaller TextureBrowserColourGetCaller; void TextureBrowserColour_set( const Vector3& other ){ TextureBrowser_setBackgroundColour( GlobalTextureBrowser(), other ); } -typedef FreeCaller1 TextureBrowserColourSetCaller; +typedef FreeCaller TextureBrowserColourSetCaller; class ColoursMenu @@ -1004,17 +1004,17 @@ static void apply( const BoolImportCallback& importCallback ){ } }; -typedef FreeCaller1::apply> EdgeModeApplyCaller; +typedef FreeCaller::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::apply> VertexModeApplyCaller; +typedef FreeCaller::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::apply> FaceModeApplyCaller; +typedef FreeCaller::apply> FaceModeApplyCaller; FaceModeApplyCaller g_faceMode_button_caller; BoolExportCallback g_faceMode_button_callback( g_faceMode_button_caller ); ToggleItem g_faceMode_button( g_faceMode_button_callback ); @@ -1310,23 +1310,23 @@ void ClipperToolExport( const BoolImportCallback& importCallback ){ importCallback( GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip ); } -FreeCaller1 g_translatemode_button_caller; +FreeCaller g_translatemode_button_caller; BoolExportCallback g_translatemode_button_callback( g_translatemode_button_caller ); ToggleItem g_translatemode_button( g_translatemode_button_callback ); -FreeCaller1 g_rotatemode_button_caller; +FreeCaller g_rotatemode_button_caller; BoolExportCallback g_rotatemode_button_callback( g_rotatemode_button_caller ); ToggleItem g_rotatemode_button( g_rotatemode_button_callback ); -FreeCaller1 g_scalemode_button_caller; +FreeCaller g_scalemode_button_caller; BoolExportCallback g_scalemode_button_callback( g_scalemode_button_caller ); ToggleItem g_scalemode_button( g_scalemode_button_callback ); -FreeCaller1 g_dragmode_button_caller; +FreeCaller g_dragmode_button_caller; BoolExportCallback g_dragmode_button_callback( g_dragmode_button_caller ); ToggleItem g_dragmode_button( g_dragmode_button_callback ); -FreeCaller1 g_clipper_button_caller; +FreeCaller g_clipper_button_caller; BoolExportCallback g_clipper_button_callback( g_clipper_button_caller ); ToggleItem g_clipper_button( g_clipper_button_callback ); @@ -2085,15 +2085,15 @@ ui::MenuItem create_misc_menu(){ } #if 0 - create_menu_item_with_mnemonic( menu, "_Benchmark", FreeCaller() ); + create_menu_item_with_mnemonic( menu, "_Benchmark", FreeCaller() ); #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()); - create_menu_item_with_mnemonic( menu, "_Background select", FreeCaller() ); +// create_menu_item_with_mnemonic(menu, "_Print XY View", FreeCaller()); + create_menu_item_with_mnemonic( menu, "_Background select", FreeCaller() ); return misc_menu_item; } @@ -2150,9 +2150,9 @@ ui::MenuItem create_help_menu(){ // 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() ); - create_menu_item_with_mnemonic( menu, "Shortcuts list", FreeCaller() ); - create_menu_item_with_mnemonic( menu, "_About", FreeCaller() ); + create_menu_item_with_mnemonic( menu, "Bug report", FreeCaller() ); + create_menu_item_with_mnemonic( menu, "Shortcuts list", FreeCaller() ); + create_menu_item_with_mnemonic( menu, "_About", FreeCaller() ); return help_menu_item; } @@ -2971,7 +2971,7 @@ void MainFrame::Create(){ SetActiveXY( m_pXYWnd ); AddGridChangeCallback( SetGridStatusCaller( *this ) ); - AddGridChangeCallback( ReferenceCaller( *this ) ); + AddGridChangeCallback( ReferenceCaller( *this ) ); g_defaultToolMode = DragMode; g_defaultToolMode(); @@ -3155,7 +3155,7 @@ void Layout_constructPage( PreferenceGroup& group ){ } void Layout_registerPreferencesPage(){ - PreferencesDialog_addInterfacePage( FreeCaller1() ); + PreferencesDialog_addInterfacePage( FreeCaller() ); } @@ -3163,75 +3163,75 @@ void Layout_registerPreferencesPage(){ #include "stringio.h" void MainFrame_Construct(){ - GlobalCommands_insert( "OpenManual", FreeCaller(), Accelerator( GDK_KEY_F1 ) ); - - GlobalCommands_insert( "Sleep", FreeCaller(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "NewMap", FreeCaller() ); - GlobalCommands_insert( "OpenMap", FreeCaller(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "ImportMap", FreeCaller() ); - GlobalCommands_insert( "SaveMap", FreeCaller(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "SaveMapAs", FreeCaller() ); - GlobalCommands_insert( "ExportSelected", FreeCaller() ); - GlobalCommands_insert( "SaveRegion", FreeCaller() ); - GlobalCommands_insert( "RefreshReferences", FreeCaller() ); - GlobalCommands_insert( "ProjectSettings", FreeCaller() ); - GlobalCommands_insert( "Exit", FreeCaller() ); - - GlobalCommands_insert( "Undo", FreeCaller(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "Redo", FreeCaller(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "Copy", FreeCaller(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "Paste", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "PasteToCamera", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "CloneSelection", FreeCaller(), Accelerator( GDK_KEY_space ) ); - GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller(), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "DeleteSelection", FreeCaller(), Accelerator( GDK_KEY_BackSpace ) ); - GlobalCommands_insert( "ParentSelection", FreeCaller() ); - GlobalCommands_insert( "UnSelectSelection", FreeCaller(), Accelerator( GDK_KEY_Escape ) ); - GlobalCommands_insert( "InvertSelection", FreeCaller(), Accelerator( 'I' ) ); - GlobalCommands_insert( "SelectInside", FreeCaller() ); - GlobalCommands_insert( "SelectTouching", FreeCaller() ); - GlobalCommands_insert( "ExpandSelectionToEntities", FreeCaller(), Accelerator( 'E', (GdkModifierType)( GDK_MOD1_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "Preferences", FreeCaller(), Accelerator( 'P' ) ); - - GlobalCommands_insert( "ToggleConsole", FreeCaller(), Accelerator( 'O' ) ); - GlobalCommands_insert( "ToggleEntityInspector", FreeCaller(), Accelerator( 'N' ) ); - GlobalCommands_insert( "EntityList", FreeCaller(), Accelerator( 'L' ) ); - - GlobalCommands_insert( "ShowHidden", FreeCaller(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "HideSelected", FreeCaller(), Accelerator( 'H' ) ); - - GlobalToggles_insert( "DragVertices", FreeCaller(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) ); - GlobalToggles_insert( "DragEdges", FreeCaller(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) ); - GlobalToggles_insert( "DragFaces", FreeCaller(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) ); - - GlobalCommands_insert( "MirrorSelectionX", FreeCaller() ); - GlobalCommands_insert( "RotateSelectionX", FreeCaller() ); - GlobalCommands_insert( "MirrorSelectionY", FreeCaller() ); - GlobalCommands_insert( "RotateSelectionY", FreeCaller() ); - GlobalCommands_insert( "MirrorSelectionZ", FreeCaller() ); - GlobalCommands_insert( "RotateSelectionZ", FreeCaller() ); - - GlobalCommands_insert( "ArbitraryRotation", FreeCaller() ); - GlobalCommands_insert( "ArbitraryScale", FreeCaller() ); - - GlobalCommands_insert( "BuildMenuCustomize", FreeCaller() ); - - GlobalCommands_insert( "FindBrush", FreeCaller() ); - - GlobalCommands_insert( "MapInfo", FreeCaller(), Accelerator( 'M' ) ); - - - GlobalToggles_insert( "ToggleClipper", FreeCaller(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) ); - - GlobalToggles_insert( "MouseTranslate", FreeCaller(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) ); - GlobalToggles_insert( "MouseRotate", FreeCaller(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) ); - GlobalToggles_insert( "MouseScale", FreeCaller(), ToggleItem::AddCallbackCaller( g_scalemode_button ) ); - GlobalToggles_insert( "MouseDrag", FreeCaller(), ToggleItem::AddCallbackCaller( g_dragmode_button ), Accelerator( 'Q' ) ); - - GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller() ); - GlobalCommands_insert( "ColorSchemeQER", FreeCaller() ); - GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller() ); - GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller() ); + GlobalCommands_insert( "OpenManual", FreeCaller(), Accelerator( GDK_KEY_F1 ) ); + + GlobalCommands_insert( "Sleep", FreeCaller(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "NewMap", FreeCaller() ); + GlobalCommands_insert( "OpenMap", FreeCaller(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "ImportMap", FreeCaller() ); + GlobalCommands_insert( "SaveMap", FreeCaller(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "SaveMapAs", FreeCaller() ); + GlobalCommands_insert( "ExportSelected", FreeCaller() ); + GlobalCommands_insert( "SaveRegion", FreeCaller() ); + GlobalCommands_insert( "RefreshReferences", FreeCaller() ); + GlobalCommands_insert( "ProjectSettings", FreeCaller() ); + GlobalCommands_insert( "Exit", FreeCaller() ); + + GlobalCommands_insert( "Undo", FreeCaller(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "Redo", FreeCaller(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "Copy", FreeCaller(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "Paste", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PasteToCamera", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "CloneSelection", FreeCaller(), Accelerator( GDK_KEY_space ) ); + GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller(), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "DeleteSelection", FreeCaller(), Accelerator( GDK_KEY_BackSpace ) ); + GlobalCommands_insert( "ParentSelection", FreeCaller() ); + GlobalCommands_insert( "UnSelectSelection", FreeCaller(), Accelerator( GDK_KEY_Escape ) ); + GlobalCommands_insert( "InvertSelection", FreeCaller(), Accelerator( 'I' ) ); + GlobalCommands_insert( "SelectInside", FreeCaller() ); + GlobalCommands_insert( "SelectTouching", FreeCaller() ); + GlobalCommands_insert( "ExpandSelectionToEntities", FreeCaller(), Accelerator( 'E', (GdkModifierType)( GDK_MOD1_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "Preferences", FreeCaller(), Accelerator( 'P' ) ); + + GlobalCommands_insert( "ToggleConsole", FreeCaller(), Accelerator( 'O' ) ); + GlobalCommands_insert( "ToggleEntityInspector", FreeCaller(), Accelerator( 'N' ) ); + GlobalCommands_insert( "EntityList", FreeCaller(), Accelerator( 'L' ) ); + + GlobalCommands_insert( "ShowHidden", FreeCaller(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "HideSelected", FreeCaller(), Accelerator( 'H' ) ); + + GlobalToggles_insert( "DragVertices", FreeCaller(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) ); + GlobalToggles_insert( "DragEdges", FreeCaller(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) ); + GlobalToggles_insert( "DragFaces", FreeCaller(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) ); + + GlobalCommands_insert( "MirrorSelectionX", FreeCaller() ); + GlobalCommands_insert( "RotateSelectionX", FreeCaller() ); + GlobalCommands_insert( "MirrorSelectionY", FreeCaller() ); + GlobalCommands_insert( "RotateSelectionY", FreeCaller() ); + GlobalCommands_insert( "MirrorSelectionZ", FreeCaller() ); + GlobalCommands_insert( "RotateSelectionZ", FreeCaller() ); + + GlobalCommands_insert( "ArbitraryRotation", FreeCaller() ); + GlobalCommands_insert( "ArbitraryScale", FreeCaller() ); + + GlobalCommands_insert( "BuildMenuCustomize", FreeCaller() ); + + GlobalCommands_insert( "FindBrush", FreeCaller() ); + + GlobalCommands_insert( "MapInfo", FreeCaller(), Accelerator( 'M' ) ); + + + GlobalToggles_insert( "ToggleClipper", FreeCaller(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) ); + + GlobalToggles_insert( "MouseTranslate", FreeCaller(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) ); + GlobalToggles_insert( "MouseRotate", FreeCaller(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) ); + GlobalToggles_insert( "MouseScale", FreeCaller(), ToggleItem::AddCallbackCaller( g_scalemode_button ) ); + GlobalToggles_insert( "MouseDrag", FreeCaller(), ToggleItem::AddCallbackCaller( g_dragmode_button ), Accelerator( 'Q' ) ); + + GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller() ); + GlobalCommands_insert( "ColorSchemeQER", FreeCaller() ); + GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller() ); + GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller() ); GlobalCommands_insert( "ChooseTextureBackgroundColor", makeCallback( g_ColoursMenu.m_textureback ) ); GlobalCommands_insert( "ChooseGridBackgroundColor", makeCallback( g_ColoursMenu.m_xyback ) ); GlobalCommands_insert( "ChooseGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor ) ); @@ -3248,39 +3248,39 @@ void MainFrame_Construct(){ GlobalCommands_insert( "ChooseOrthoViewNameColor", makeCallback( g_ColoursMenu.m_viewname ) ); - GlobalCommands_insert( "CSGSubtract", FreeCaller(), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CSGMerge", FreeCaller(), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "CSGHollow", FreeCaller() ); + GlobalCommands_insert( "CSGSubtract", FreeCaller(), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "CSGMerge", FreeCaller(), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "CSGHollow", FreeCaller() ); Grid_registerCommands(); - GlobalCommands_insert( "SnapToGrid", FreeCaller(), Accelerator( 'G', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "SnapToGrid", FreeCaller(), Accelerator( 'G', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "SelectAllOfType", FreeCaller(), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "SelectAllOfType", FreeCaller(), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexRotateClock", FreeCaller(), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexRotateCounter", FreeCaller(), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexScaleUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexScaleDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexScaleLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexScaleRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexShiftUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexShiftDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexShiftLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexShiftRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexRotateClock", FreeCaller(), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexRotateCounter", FreeCaller(), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexScaleUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexScaleDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexScaleLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexScaleRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexShiftUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexShiftDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexShiftLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexShiftRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract ) ); - GlobalCommands_insert( "MoveSelectionUP", FreeCaller(), Accelerator( GDK_KEY_KP_Add ) ); + GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract ) ); + GlobalCommands_insert( "MoveSelectionUP", FreeCaller(), Accelerator( GDK_KEY_KP_Add ) ); - GlobalCommands_insert( "SelectNudgeLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "SelectNudgeRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "SelectNudgeUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "SelectNudgeDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "SelectNudgeLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "SelectNudgeRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "SelectNudgeUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "SelectNudgeDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) ); Patch_registerCommands(); XYShow_registerCommands(); - typedef FreeCaller1 ComponentModeSelectionChangedCaller; + typedef FreeCaller ComponentModeSelectionChangedCaller; GlobalSelectionSystem().addSelectionChangeCallback( ComponentModeSelectionChangedCaller() ); GlobalPreferenceSystem().registerPreference( "DetachableMenus", BoolImportStringCaller( g_Layout_enableDetachableMenus.m_latched ), BoolExportStringCaller( g_Layout_enableDetachableMenus.m_latched ) ); @@ -3330,8 +3330,8 @@ void MainFrame_Construct(){ Layout_registerPreferencesPage(); Paths_registerPreferencesPage(); - g_brushCount.setCountChangedCallback( FreeCaller() ); - g_entityCount.setCountChangedCallback( FreeCaller() ); + g_brushCount.setCountChangedCallback( FreeCaller() ); + g_entityCount.setCountChangedCallback( FreeCaller() ); GlobalEntityCreator().setCounter( &g_entityCount ); GLWidget_sharedContextCreated = GlobalGL_sharedContextCreated; @@ -3344,8 +3344,8 @@ void MainFrame_Destroy(){ GlobalEntityClassManager().detach( g_WorldspawnColourEntityClassObserver ); GlobalEntityCreator().setCounter( 0 ); - g_entityCount.setCountChangedCallback( Callback() ); - g_brushCount.setCountChangedCallback( Callback() ); + g_entityCount.setCountChangedCallback( Callback() ); + g_brushCount.setCountChangedCallback( Callback() ); } diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 2c003af4..f271ad9e 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -103,10 +103,10 @@ void OnSleep(); void SetStatusText( CopiedString& status_text, const char* pText ); void UpdateStatusText(); void RedrawStatusText(); -typedef MemberCaller RedrawStatusTextCaller; +typedef MemberCaller RedrawStatusTextCaller; void SetGridStatus(); -typedef MemberCaller SetGridStatusCaller; +typedef MemberCaller SetGridStatusCaller; void SetActiveXY( XYWnd* p ); XYWnd* ActiveXY(){ diff --git a/radiant/map.cpp b/radiant/map.cpp index bbc3d57a..5523f431 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -124,7 +124,7 @@ void nameChanged( const char* name ){ m_name = name; construct(); } -typedef MemberCaller1 NameChangedCaller; +typedef MemberCaller NameChangedCaller; }; class BasicNamespace : public Namespace @@ -2161,16 +2161,16 @@ CopiedString g_strLastMap; bool g_bLoadLastMap = false; void Map_Construct(){ - GlobalCommands_insert( "RegionOff", FreeCaller() ); - GlobalCommands_insert( "RegionSetXY", FreeCaller() ); - GlobalCommands_insert( "RegionSetBrush", FreeCaller() ); - GlobalCommands_insert( "RegionSetSelection", FreeCaller(), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "RegionOff", FreeCaller() ); + GlobalCommands_insert( "RegionSetXY", FreeCaller() ); + GlobalCommands_insert( "RegionSetBrush", FreeCaller() ); + GlobalCommands_insert( "RegionSetSelection", FreeCaller(), 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() ); + PreferencesDialog_addSettingsPreferences( FreeCaller() ); GlobalEntityClassManager().attach( g_MapEntityClasses ); Radiant_attachHomePathsObserver( g_MapModuleObserver ); diff --git a/radiant/map.h b/radiant/map.h index a359d461..c68b0275 100644 --- a/radiant/map.h +++ b/radiant/map.h @@ -37,11 +37,11 @@ bool Map_Valid( const Map& map ); class DeferredDraw { -Callback m_draw; +Callback 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& draw ) : m_draw( draw ), m_defer( false ), m_deferred( false ){ } void defer(){ m_defer = true; @@ -73,7 +73,7 @@ inline void DeferredDraw_onMapValidChanged( DeferredDraw& self ){ self.defer(); } } -typedef ReferenceCaller DeferredDrawOnMapValidChangedCaller; +typedef ReferenceCaller DeferredDrawOnMapValidChangedCaller; diff --git a/radiant/mru.cpp b/radiant/mru.cpp index ab3220f0..aef04cbc 100644 --- a/radiant/mru.cpp +++ b/radiant/mru.cpp @@ -185,7 +185,7 @@ void load(){ } }; -typedef MemberCaller LoadMRUCaller; +typedef MemberCaller LoadMRUCaller; LoadMRU g_load_mru1( 1 ); LoadMRU g_load_mru2( 2 ); diff --git a/radiant/multimon.cpp b/radiant/multimon.cpp index 6fd41003..91385739 100644 --- a/radiant/multimon.cpp +++ b/radiant/multimon.cpp @@ -92,7 +92,7 @@ void MultiMon_Construct(){ g_Multimon_enableSysMenuPopups.useLatched(); - PreferencesDialog_addInterfacePreferences( FreeCaller1() ); + PreferencesDialog_addInterfacePreferences( FreeCaller() ); } void MultiMon_Destroy(){ } diff --git a/radiant/patch.h b/radiant/patch.h index 96c9b76e..6e8742b0 100644 --- a/radiant/patch.h +++ b/radiant/patch.h @@ -447,8 +447,8 @@ RenderableIndexBuffer m_render_lattice; bool m_bOverlay; bool m_transformChanged; -Callback m_evaluateTransform; -Callback m_boundsChanged; +Callback m_evaluateTransform; +Callback m_boundsChanged; void construct(){ m_bOverlay = false; @@ -465,14 +465,14 @@ void construct(){ } public: -Callback m_lightsChanged; +Callback 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& evaluateTransform, const Callback& boundsChanged ) : m_node( &node ), m_shader( texdef_name_default() ), m_state( 0 ), @@ -488,7 +488,7 @@ Patch( scene::Node& node, const Callback& evaluateTransform, const Callback& bou 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& evaluateTransform, const Callback& boundsChanged ) : m_node( &node ), m_shader( texdef_name_default() ), m_state( 0 ), @@ -674,7 +674,7 @@ void transformChanged(){ m_lightsChanged(); SceneChangeNotify(); } -typedef MemberCaller TransformChangedCaller; +typedef MemberCaller TransformChangedCaller; void evaluateTransform(){ if ( m_transformChanged ) { @@ -1338,7 +1338,7 @@ typedef LazyStatic StaticTypeCasts; void lightsChanged(){ m_lightList->lightsChanged(); } -typedef MemberCaller LightsChangedCaller; +typedef MemberCaller LightsChangedCaller; STRING_CONSTANT( Name, "PatchInstance" ); @@ -1358,9 +1358,9 @@ PatchInstance( const scene::Path& path, scene::Instance* parent, Patch& patch ) Instance::setTransformChangedCallback( LightsChangedCaller( *this ) ); } ~PatchInstance(){ - Instance::setTransformChangedCallback( Callback() ); + Instance::setTransformChangedCallback( Callback() ); - m_patch.m_lightsChanged = Callback(); + m_patch.m_lightsChanged = Callback(); GlobalShaderCache().detach( *this ); m_patch.detach( this ); @@ -1373,13 +1373,13 @@ void selectedChanged( const Selectable& selectable ){ Instance::selectedChanged(); } -typedef MemberCaller1 SelectedChangedCaller; +typedef MemberCaller SelectedChangedCaller; void selectedChangedComponent( const Selectable& selectable ){ GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable ); GlobalSelectionSystem().onComponentSelection( *this, selectable ); } -typedef MemberCaller1 SelectedChangedComponentCaller; +typedef MemberCaller SelectedChangedComponentCaller; Patch& getPatch(){ return m_patch; @@ -1612,7 +1612,7 @@ void applyTransform(){ evaluateTransform(); m_patch.freezeTransform(); } -typedef MemberCaller ApplyTransformCaller; +typedef MemberCaller ApplyTransformCaller; bool testLight( const RendererLight& light ) const { diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 0b85ea2d..310d1331 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -176,7 +176,7 @@ void update(){ void cancel(){ update(); } -typedef MemberCaller CancelCaller; +typedef MemberCaller CancelCaller; void apply(){ Scene_PatchSetFixedSubdivisions( PatchFixedSubdivisions( @@ -186,7 +186,7 @@ void apply(){ ) ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; static void applyGtk( ui::ToggleButton toggle, Subdivisions* self ){ self->apply(); } @@ -230,7 +230,7 @@ bool m_bListenChanged; PatchInspector() : m_horizontalSubdivisionsEntry( Subdivisions::ApplyCaller( m_subdivisions ), Subdivisions::CancelCaller( m_subdivisions ) ), m_verticalSubdivisionsEntry( Subdivisions::ApplyCaller( m_subdivisions ), Subdivisions::CancelCaller( m_subdivisions ) ), - m_idleDraw( MemberCaller( *this ) ){ + m_idleDraw( MemberCaller( *this ) ){ m_fS = 0.0f; m_fT = 0.0f; m_fX = 0.0f; @@ -1033,7 +1033,7 @@ void PatchInspector_SelectionChanged( const Selectable& selectable ){ void PatchInspector_Construct(){ - GlobalCommands_insert( "PatchInspector", FreeCaller(), Accelerator( 'S', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "PatchInspector", FreeCaller(), 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] ) ); @@ -1042,9 +1042,9 @@ void PatchInspector_Construct(){ 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 PatchInspectorSelectionChangedCaller; + typedef FreeCaller PatchInspectorSelectionChangedCaller; GlobalSelectionSystem().addSelectionChangeCallback( PatchInspectorSelectionChangedCaller() ); - typedef FreeCaller PatchInspectorQueueDrawCaller; + typedef FreeCaller PatchInspectorQueueDrawCaller; Patch_addTextureChangedCallback( PatchInspectorQueueDrawCaller() ); } void PatchInspector_Destroy(){ diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 4c1336b8..ceca948d 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -600,7 +600,7 @@ void Patch_constructPage( PreferenceGroup& group ){ Patch_constructPreferences( page ); } void Patch_registerPreferencesPage(){ - PreferencesDialog_addDisplayPage( FreeCaller1() ); + PreferencesDialog_addDisplayPage( FreeCaller() ); } @@ -614,41 +614,41 @@ void PatchPreferences_construct(){ #include "generic/callback.h" void Patch_registerCommands(){ - GlobalCommands_insert( "InvertCurveTextureX", FreeCaller(), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "InvertCurveTextureY", FreeCaller(), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "NaturalizePatch", FreeCaller(), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "PatchCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchDenseCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchVeryDenseCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchSquareCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchXactCylinder", FreeCaller() ); - GlobalCommands_insert( "PatchXactSphere", FreeCaller() ); - GlobalCommands_insert( "PatchXactCone", FreeCaller() ); - GlobalCommands_insert( "PatchEndCap", FreeCaller() ); - GlobalCommands_insert( "PatchBevel", FreeCaller() ); - GlobalCommands_insert( "PatchSquareBevel", FreeCaller() ); - GlobalCommands_insert( "PatchSquareEndcap", FreeCaller() ); - GlobalCommands_insert( "PatchCone", FreeCaller() ); - GlobalCommands_insert( "PatchSphere", FreeCaller() ); - GlobalCommands_insert( "SimplePatchMesh", FreeCaller(), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "PatchInsertAddColumn", FreeCaller() ); - GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "PatchInsertAddRow", FreeCaller() ); - GlobalCommands_insert( "PatchDeleteFirstColumn", FreeCaller() ); - GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "PatchDeleteLastRow", FreeCaller() ); - GlobalCommands_insert( "InvertCurve", FreeCaller(), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "RedisperseRows", FreeCaller(), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "RedisperseCols", FreeCaller(), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "SmoothRows", FreeCaller(), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "SmoothCols", FreeCaller(), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "MatrixTranspose", FreeCaller(), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "CapCurrentCurve", FreeCaller(), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CycleCapTexturePatch", FreeCaller(), Accelerator( 'N', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "MakeOverlayPatch", FreeCaller(), Accelerator( 'Y' ) ); - GlobalCommands_insert( "ClearPatchOverlays", FreeCaller(), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "InvertCurveTextureX", FreeCaller(), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "InvertCurveTextureY", FreeCaller(), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "NaturalizePatch", FreeCaller(), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PatchCylinder", FreeCaller() ); + GlobalCommands_insert( "PatchDenseCylinder", FreeCaller() ); + GlobalCommands_insert( "PatchVeryDenseCylinder", FreeCaller() ); + GlobalCommands_insert( "PatchSquareCylinder", FreeCaller() ); + GlobalCommands_insert( "PatchXactCylinder", FreeCaller() ); + GlobalCommands_insert( "PatchXactSphere", FreeCaller() ); + GlobalCommands_insert( "PatchXactCone", FreeCaller() ); + GlobalCommands_insert( "PatchEndCap", FreeCaller() ); + GlobalCommands_insert( "PatchBevel", FreeCaller() ); + GlobalCommands_insert( "PatchSquareBevel", FreeCaller() ); + GlobalCommands_insert( "PatchSquareEndcap", FreeCaller() ); + GlobalCommands_insert( "PatchCone", FreeCaller() ); + GlobalCommands_insert( "PatchSphere", FreeCaller() ); + GlobalCommands_insert( "SimplePatchMesh", FreeCaller(), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "PatchInsertAddColumn", FreeCaller() ); + GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PatchInsertAddRow", FreeCaller() ); + GlobalCommands_insert( "PatchDeleteFirstColumn", FreeCaller() ); + GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PatchDeleteLastRow", FreeCaller() ); + GlobalCommands_insert( "InvertCurve", FreeCaller(), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "RedisperseRows", FreeCaller(), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "RedisperseCols", FreeCaller(), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "SmoothRows", FreeCaller(), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "SmoothCols", FreeCaller(), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "MatrixTranspose", FreeCaller(), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "CapCurrentCurve", FreeCaller(), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "CycleCapTexturePatch", FreeCaller(), Accelerator( 'N', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "MakeOverlayPatch", FreeCaller(), Accelerator( 'Y' ) ); + GlobalCommands_insert( "ClearPatchOverlays", FreeCaller(), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) ); } void Patch_constructToolbar( ui::Toolbar toolbar ){ diff --git a/radiant/pluginmenu.cpp b/radiant/pluginmenu.cpp index 8c165360..1134d8a1 100644 --- a/radiant/pluginmenu.cpp +++ b/radiant/pluginmenu.cpp @@ -166,7 +166,7 @@ ui::MenuItem create_plugins_menu(){ //TODO: some modules/plugins do not yet support refresh #if 0 - create_menu_item_with_mnemonic( menu, "Refresh", FreeCaller() ); + create_menu_item_with_mnemonic( menu, "Refresh", FreeCaller() ); // 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 ); diff --git a/radiant/points.cpp b/radiant/points.cpp index 342c5be0..cc5ca5f5 100644 --- a/radiant/points.cpp +++ b/radiant/points.cpp @@ -330,9 +330,9 @@ void Pointfile_Construct(){ GlobalShaderCache().attachRenderable( s_pointfile ); - GlobalCommands_insert( "TogglePointfile", FreeCaller() ); - GlobalCommands_insert( "NextLeakSpot", FreeCaller(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "PrevLeakSpot", FreeCaller(), Accelerator( 'L', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "TogglePointfile", FreeCaller() ); + GlobalCommands_insert( "NextLeakSpot", FreeCaller(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "PrevLeakSpot", FreeCaller(), Accelerator( 'L', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); } void Pointfile_Destroy(){ diff --git a/radiant/preferencedictionary.h b/radiant/preferencedictionary.h index ce3f7686..5d2dbc07 100644 --- a/radiant/preferencedictionary.h +++ b/radiant/preferencedictionary.h @@ -91,7 +91,7 @@ void importPref( const char* name, const char* value ){ inline void XMLPreference_importString( XMLImporter& importer, const char* value ){ importer.write( value, string_length( value ) ); } -typedef ReferenceCaller1 XMLPreferenceImportStringCaller; +typedef ReferenceCaller XMLPreferenceImportStringCaller; class XMLPreferenceDictionaryExporter : public XMLExporter { diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 0fee7ef9..f3efd8db 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -81,7 +81,7 @@ void Mouse_constructPage( PreferenceGroup& group ){ Mouse_constructPreferences( page ); } void Mouse_registerPreferencesPage(){ - PreferencesDialog_addInterfacePage( FreeCaller1() ); + PreferencesDialog_addInterfacePage( FreeCaller() ); } @@ -221,7 +221,7 @@ void LogConsole_importString( const char* string ){ g_Console_enableLogging = string_equal( string, "true" ); Sys_LogFile( g_Console_enableLogging ); } -typedef FreeCaller1 LogConsoleImportStringCaller; +typedef FreeCaller LogConsoleImportStringCaller; void RegisterGlobalPreferences( PreferenceSystem& preferences ){ @@ -313,8 +313,8 @@ void CGameDialog::CreateGlobalFrame( PreferencesPage& page ){ page.appendCombo( "Select the game", StringArrayRange( &( *games.begin() ), &( *games.end() ) ), - ReferenceCaller1( *this ), - ReferenceCaller1( *this ) + ReferenceCaller( *this ), + ReferenceCaller( *this ) ); page.appendCheckBox( "Startup", "Show Global Preferences", m_bGamePrompt ); } @@ -668,7 +668,7 @@ PreferencesPage createPage( const char* treeName, const char* frameName ){ }; ui::Window PrefsDlg::BuildDialog(){ - PreferencesDialog_addInterfacePreferences( FreeCaller1() ); + PreferencesDialog_addInterfacePreferences( FreeCaller() ); Mouse_registerPreferencesPage(); ui::Window dialog = ui::Window(create_floating_window( "NetRadiant Preferences", m_parent )); @@ -921,20 +921,20 @@ void PreferencesDialog_showDialog(){ void GameName_importString( const char* value ){ gamename_set( value ); } -typedef FreeCaller1 GameNameImportStringCaller; +typedef FreeCaller GameNameImportStringCaller; void GameName_exportString( const StringImportCallback& importer ){ importer( gamename_get() ); } -typedef FreeCaller1 GameNameExportStringCaller; +typedef FreeCaller GameNameExportStringCaller; void GameMode_importString( const char* value ){ gamemode_set( value ); } -typedef FreeCaller1 GameModeImportStringCaller; +typedef FreeCaller GameModeImportStringCaller; void GameMode_exportString( const StringImportCallback& importer ){ importer( gamemode_get() ); } -typedef FreeCaller1 GameModeExportStringCaller; +typedef FreeCaller GameModeExportStringCaller; void RegisterPreferences( PreferenceSystem& preferences ){ diff --git a/radiant/preferences.h b/radiant/preferences.h index c959ad3e..0aae24c7 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -105,7 +105,7 @@ ui::SpinButton appendSpinner( const char* name, double value, double lower, doub } }; -typedef Callback1 PreferencesPageCallback; +typedef Callback PreferencesPageCallback; class PreferenceGroup { @@ -113,7 +113,7 @@ public: virtual PreferencesPage createPage( const char* treeName, const char* frameName ) = 0; }; -typedef Callback1 PreferenceGroupCallback; +typedef Callback PreferenceGroupCallback; void PreferencesDialog_addInterfacePreferences( const PreferencesPageCallback& callback ); void PreferencesDialog_addInterfacePage( const PreferenceGroupCallback& callback ); @@ -146,10 +146,10 @@ void import( Value value ){ }; typedef LatchedValue LatchedBool; -typedef MemberCaller1 LatchedBoolImportCaller; +typedef MemberCaller LatchedBoolImportCaller; typedef LatchedValue LatchedInt; -typedef MemberCaller1 LatchedIntImportCaller; +typedef MemberCaller LatchedIntImportCaller; /*! holds information for a given game diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index 8cd9eb20..91e0645b 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -471,7 +471,7 @@ struct ModelResource : public Resource void connectMap(){ MapFile* map = Node_getMapFile( m_model ); if ( map != 0 ) { - map->setChangedCallback( FreeCaller() ); + map->setChangedCallback( FreeCaller() ); } } std::time_t modified() const { diff --git a/radiant/renderer.h b/radiant/renderer.h index 62674d46..c67cf0ea 100644 --- a/radiant/renderer.h +++ b/radiant/renderer.h @@ -130,7 +130,7 @@ void render( const Renderable& renderable ) const { break; } } -typedef ConstMemberCaller1 RenderCaller; +typedef ConstMemberCaller RenderCaller; bool pre( const scene::Path& path, scene::Instance& instance, VolumeIntersectionValue parentVisible ) const { m_renderer.PushState(); diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index b906f2cd..9dc8e2de 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -979,7 +979,7 @@ void addRenderable( const OpenGLRenderable& renderable, const Matrix4& modelview 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 @@ -1071,13 +1071,13 @@ class LinearLightList : public LightList { LightCullable& m_cullable; RendererLights& m_allLights; -Callback m_evaluateChanged; +Callback m_evaluateChanged; typedef std::list 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& evaluateChanged ) : m_cullable( cullable ), m_allLights( lights ), m_evaluateChanged( evaluateChanged ){ m_lightsChanged = true; } @@ -1463,7 +1463,7 @@ void evaluateChanged(){ } } } -typedef MemberCaller EvaluateChangedCaller; +typedef MemberCaller EvaluateChangedCaller; typedef std::set Renderables; Renderables m_renderables; diff --git a/radiant/select.cpp b/radiant/select.cpp index d9850e44..7a40bb35 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -357,7 +357,7 @@ void Selection_UpdateWorkzone(){ Select_GetBounds( g_select_workzone.d_work_min, g_select_workzone.d_work_max ); } } -typedef FreeCaller SelectionUpdateWorkzoneCaller; +typedef FreeCaller SelectionUpdateWorkzoneCaller; IdleDraw g_idleWorkzone = IdleDraw( SelectionUpdateWorkzoneCaller() ); } @@ -818,11 +818,11 @@ void SceneSelectionChange( const Selectable& selectable ){ SignalHandlerId Selection_boundsChanged; void Selection_construct(){ - typedef FreeCaller1 SceneSelectionChangeCaller; + typedef FreeCaller SceneSelectionChangeCaller; GlobalSelectionSystem().addSelectionChangeCallback( SceneSelectionChangeCaller() ); - typedef FreeCaller1 UpdateWorkzoneForSelectionChangedCaller; + typedef FreeCaller UpdateWorkzoneForSelectionChangedCaller; GlobalSelectionSystem().addSelectionChangeCallback( UpdateWorkzoneForSelectionChangedCaller() ); - typedef FreeCaller UpdateWorkzoneForSelectionCaller; + typedef FreeCaller UpdateWorkzoneForSelectionCaller; Selection_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( UpdateWorkzoneForSelectionCaller() ); } diff --git a/radiant/selection.cpp b/radiant/selection.cpp index 830937e7..df18daa9 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -1723,7 +1723,7 @@ void insert( const Plane3& plane ){ bool contains( const Plane3& plane ) const { return PlaneSet_contains( m_selectedPlanes, plane ); } -typedef MemberCaller1 InsertCaller; +typedef MemberCaller InsertCaller; }; @@ -2601,11 +2601,11 @@ void pivotChanged() const { m_pivotChanged = true; SceneChangeNotify(); } -typedef ConstMemberCaller PivotChangedCaller; +typedef ConstMemberCaller PivotChangedCaller; void pivotChangedSelection( const Selectable& selectable ){ pivotChanged(); } -typedef MemberCaller1 PivotChangedSelectionCaller; +typedef MemberCaller PivotChangedSelectionCaller; void SetMode( EMode mode ){ if ( m_mode != mode ) { @@ -2640,11 +2640,11 @@ EManipulatorMode ManipulatorMode() const { 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 { @@ -2717,7 +2717,7 @@ void addSelectionChangeCallback( const SelectionChangeHandler& handler ){ void selectionChanged( const Selectable& selectable ){ m_selectionChanged_callbacks( selectable ); } -typedef MemberCaller1 SelectionChangedCaller; +typedef MemberCaller SelectionChangedCaller; void startMove(){ @@ -3398,7 +3398,7 @@ void SelectionSystem_Construct(){ g_RadiantSelectionSystem = new RadiantSelectionSystem; - SelectionSystem_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( FreeCaller() ); + SelectionSystem_boundsChanged = GlobalSceneGraph().addBoundsChangedCallback( FreeCaller() ); GlobalShaderCache().attachRenderable( getSelectionSystem() ); } @@ -3442,7 +3442,7 @@ inline WindowVector window_constrained( WindowVector window, std::size_t x, std: return WindowVector( window_constrained( window.x(), x, width ), window_constrained( window.y(), y, height ) ); } -typedef Callback1 MouseEventCallback; +typedef Callback MouseEventCallback; Single g_mouseMovedCallback; Single g_mouseUpCallback; @@ -3561,7 +3561,7 @@ void mouseMoved( DeviceVector position ){ m_current = device_constrained( position ); draw_area(); } -typedef MemberCaller1 MouseMovedCaller; +typedef MemberCaller MouseMovedCaller; void mouseUp( DeviceVector position ){ testSelect( device_constrained( position ) ); @@ -3569,7 +3569,7 @@ void mouseUp( DeviceVector position ){ g_mouseMovedCallback.clear(); g_mouseUpCallback.clear(); } -typedef MemberCaller1 MouseUpCaller; +typedef MemberCaller MouseUpCaller; }; @@ -3586,14 +3586,14 @@ bool mouseDown( DeviceVector position ){ void mouseMoved( DeviceVector position ){ getSelectionSystem().MoveSelected( *m_view, &position[0] ); } -typedef MemberCaller1 MouseMovedCaller; +typedef MemberCaller MouseMovedCaller; void mouseUp( DeviceVector position ){ getSelectionSystem().endMove(); g_mouseMovedCallback.clear(); g_mouseUpCallback.clear(); } -typedef MemberCaller1 MouseUpCaller; +typedef MemberCaller MouseUpCaller; }; void Scene_copyClosestTexture( SelectionTest& test ); diff --git a/radiant/selection.h b/radiant/selection.h index b8f4fcfb..99846fed 100644 --- a/radiant/selection.h +++ b/radiant/selection.h @@ -31,7 +31,7 @@ struct rect_t float max[2]; }; -typedef Callback1 RectangleCallback; +typedef Callback RectangleCallback; class View; diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 498182d6..5bfb45f4 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -127,12 +127,12 @@ Increment( float& f ) : m_f( f ), m_spin( 0 ), m_entry( ui::null ){ void cancel(){ entry_set_float( m_entry, m_f ); } -typedef MemberCaller CancelCaller; +typedef MemberCaller CancelCaller; void apply(){ m_f = static_cast( entry_get_float( m_entry ) ); spin_button_set_step( m_spin, m_f ); } -typedef MemberCaller ApplyCaller; +typedef MemberCaller ApplyCaller; }; void SurfaceInspector_GridChange(); @@ -205,7 +205,7 @@ SurfaceInspector() : void constructWindow( ui::Window main_window ){ m_parent = main_window; Create(); - AddGridChangeCallback( FreeCaller() ); + AddGridChangeCallback( FreeCaller() ); } void destroyWindow(){ Destroy(); @@ -220,13 +220,13 @@ void queueDraw(){ } void Update(); -typedef MemberCaller UpdateCaller; +typedef MemberCaller UpdateCaller; void ApplyShader(); -typedef MemberCaller ApplyShaderCaller; +typedef MemberCaller ApplyShaderCaller; void ApplyTexdef(); -typedef MemberCaller ApplyTexdefCaller; +typedef MemberCaller ApplyTexdefCaller; void ApplyFlags(); -typedef MemberCaller ApplyFlagsCaller; +typedef MemberCaller ApplyFlagsCaller; }; namespace @@ -577,7 +577,7 @@ const char* getContentFlagName( std::size_t bit ){ // ============================================================================= // SurfaceInspector class -guint togglebutton_connect_toggled( ui::ToggleButton button, const Callback& callback ){ +guint togglebutton_connect_toggled( ui::ToggleButton button, const Callback& callback ){ return g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); } @@ -1183,14 +1183,14 @@ void Face_getTexture( Face& face, CopiedString& shader, TextureProjection& proje face.GetTexdef( projection ); flags = face.getShader().m_flags; } -typedef Function4 FaceGetTexture; +typedef Function 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 FaceSetTexture; +typedef Function FaceSetTexture; void Patch_getTexture( Patch& patch, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags ){ @@ -1198,16 +1198,16 @@ void Patch_getTexture( Patch& patch, CopiedString& shader, TextureProjection& pr projection = TextureProjection( texdef_t(), brushprimit_texdef_t(), Vector3( 0, 0, 0 ), Vector3( 0, 0, 0 ) ); flags = ContentsFlagsValue( 0, 0, 0, false ); } -typedef Function4 PatchGetTexture; +typedef Function PatchGetTexture; void Patch_setTexture( Patch& patch, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags ){ patch.SetShader( shader ); } -typedef Function4 PatchSetTexture; +typedef Function PatchSetTexture; -typedef Callback3 GetTextureCallback; -typedef Callback3 SetTextureCallback; +typedef Callback GetTextureCallback; +typedef Callback SetTextureCallback; struct Texturable { @@ -1222,8 +1222,8 @@ void Face_getClosest( Face& face, SelectionTest& test, SelectionIntersection& be 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 ); } } @@ -1277,8 +1277,8 @@ bool pre( const scene::Path& path, scene::Instance& instance ) const { 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 { @@ -1393,15 +1393,15 @@ void SurfaceInspector_constructPage( PreferenceGroup& group ){ SurfaceInspector_constructPreferences( page ); } void SurfaceInspector_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } void SurfaceInspector_registerCommands(){ - GlobalCommands_insert( "FitTexture", FreeCaller(), Accelerator( 'B', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "SurfaceInspector", FreeCaller(), Accelerator( 'S' ) ); + GlobalCommands_insert( "FitTexture", FreeCaller(), Accelerator( 'B', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "SurfaceInspector", FreeCaller(), Accelerator( 'S' ) ); - GlobalCommands_insert( "FaceCopyTexture", FreeCaller() ); - GlobalCommands_insert( "FacePasteTexture", FreeCaller() ); + GlobalCommands_insert( "FaceCopyTexture", FreeCaller() ); + GlobalCommands_insert( "FacePasteTexture", FreeCaller() ); } @@ -1423,9 +1423,9 @@ void SurfaceInspector_Construct(){ 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 SurfaceInspectorSelectionChangedCaller; + typedef FreeCaller SurfaceInspectorSelectionChangedCaller; GlobalSelectionSystem().addSelectionChangeCallback( SurfaceInspectorSelectionChangedCaller() ); - typedef FreeCaller SurfaceInspectorUpdateSelectionCaller; + typedef FreeCaller SurfaceInspectorUpdateSelectionCaller; Brush_addTextureChangedCallback( SurfaceInspectorUpdateSelectionCaller() ); Patch_addTextureChangedCallback( SurfaceInspectorUpdateSelectionCaller() ); diff --git a/radiant/textureentry.h b/radiant/textureentry.h index d36aff6b..a09ae154 100644 --- a/radiant/textureentry.h +++ b/radiant/textureentry.h @@ -43,7 +43,7 @@ public: void append(const char *string); - using AppendCaller = MemberCaller1; + using AppendCaller = MemberCaller; void fill(); @@ -51,7 +51,7 @@ public: void update(); - using UpdateCaller = MemberCaller; + using UpdateCaller = MemberCaller; }; class TextureNameList { diff --git a/radiant/textures.cpp b/radiant/textures.cpp index 93ce42a8..55f00b7e 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -549,9 +549,9 @@ void Textures_Unrealise(){ } -Callback g_texturesModeChangedNotify; +Callback g_texturesModeChangedNotify; -void Textures_setModeChangedNotify( const Callback& notify ){ +void Textures_setModeChangedNotify( const Callback& notify ){ g_texturesModeChangedNotify = notify; } @@ -647,7 +647,7 @@ void TextureCompressionImport( TextureCompressionFormat& self, int value ){ } Textures_UpdateTextureCompressionFormat(); } -typedef ReferenceCaller1 TextureCompressionImportCaller; +typedef ReferenceCaller TextureCompressionImportCaller; void TextureGammaImport( float& self, float value ){ if ( self != value ) { @@ -656,7 +656,7 @@ void TextureGammaImport( float& self, float value ){ Textures_Realise(); } } -typedef ReferenceCaller1 TextureGammaImportCaller; +typedef ReferenceCaller TextureGammaImportCaller; void TextureModeImport( ETexturesMode& self, int value ){ switch ( value ) @@ -683,7 +683,7 @@ void TextureModeImport( ETexturesMode& self, int value ){ Textures_SetMode( eTextures_MAX_ANISOTROPY ); } } -typedef ReferenceCaller1 TextureModeImportCaller; +typedef ReferenceCaller TextureModeImportCaller; void TextureModeExport( ETexturesMode& self, const IntImportCallback& importer ){ switch ( self ) @@ -713,7 +713,7 @@ void TextureModeExport( ETexturesMode& self, const IntImportCallback& importer ) importer( 4 ); } } -typedef ReferenceCaller1 TextureModeExportCaller; +typedef ReferenceCaller TextureModeExportCaller; void Textures_constructPreferences( PreferencesPage& page ){ { @@ -769,14 +769,14 @@ void Textures_constructPage( PreferenceGroup& group ){ Textures_constructPreferences( page ); } void Textures_registerPreferencesPage(){ - PreferencesDialog_addDisplayPage( FreeCaller1() ); + PreferencesDialog_addDisplayPage( FreeCaller() ); } void TextureCompression_importString( const char* string ){ g_texture_globals.m_nTextureCompressionFormat = static_cast( atoi( string ) ); Textures_UpdateTextureCompressionFormat(); } -typedef FreeCaller1 TextureCompressionImportStringCaller; +typedef FreeCaller TextureCompressionImportStringCaller; void Textures_Construct(){ diff --git a/radiant/textures.h b/radiant/textures.h index cdd1a9b1..3176ce6d 100644 --- a/radiant/textures.h +++ b/radiant/textures.h @@ -28,6 +28,6 @@ void Textures_Realise(); void Textures_Unrealise(); void Textures_sharedContextDestroyed(); -void Textures_setModeChangedNotify( const Callback& notify ); +void Textures_setModeChangedNotify( const Callback& notify ); #endif diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 639dd498..09c7fc73 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -111,7 +111,7 @@ void TextureGroups_addWad( TextureGroups& groups, const char* archive ){ #endif } } -typedef ReferenceCaller1 TextureGroupsAddWadCaller; +typedef ReferenceCaller TextureGroupsAddWadCaller; namespace { @@ -167,12 +167,12 @@ void TextureGroups_addShader( TextureGroups& groups, const char* shaderName ){ } } } -typedef ReferenceCaller1 TextureGroupsAddShaderCaller; +typedef ReferenceCaller TextureGroupsAddShaderCaller; void TextureGroups_addDirectory( TextureGroups& groups, const char* directory ){ groups.insert( directory ); } -typedef ReferenceCaller1 TextureGroupsAddDirectoryCaller; +typedef ReferenceCaller TextureGroupsAddDirectoryCaller; class DeferredAdjustment { @@ -215,7 +215,7 @@ static void adjustment_value_changed( GtkAdjustment *adjustment, DeferredAdjustm class TextureBrowser; -typedef ReferenceCaller TextureBrowserQueueDrawCaller; +typedef ReferenceCaller TextureBrowserQueueDrawCaller; void TextureBrowser_scrollChanged( void* data, gdouble value ); @@ -227,25 +227,25 @@ enum StartupShaders }; void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer ); -typedef FreeCaller1 TextureBrowserHideUnusedExport; +typedef FreeCaller TextureBrowserHideUnusedExport; void TextureBrowser_showShadersExport( const BoolImportCallback& importer ); -typedef FreeCaller1 TextureBrowserShowShadersExport; +typedef FreeCaller TextureBrowserShowShadersExport; void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer ); -typedef FreeCaller1 TextureBrowserShowShaderlistOnlyExport; +typedef FreeCaller TextureBrowserShowShaderlistOnlyExport; void TextureBrowser_fixedSize( const BoolImportCallback& importer ); -typedef FreeCaller1 TextureBrowserFixedSizeExport; +typedef FreeCaller TextureBrowserFixedSizeExport; void TextureBrowser_filterMissing( const BoolImportCallback& importer ); -typedef FreeCaller1 TextureBrowserFilterMissingExport; +typedef FreeCaller TextureBrowserFilterMissingExport; void TextureBrowser_filterFallback( const BoolImportCallback& importer ); -typedef FreeCaller1 TextureBrowserFilterFallbackExport; +typedef FreeCaller TextureBrowserFilterFallbackExport; void TextureBrowser_enableAlpha( const BoolImportCallback& importer ); -typedef FreeCaller1 TextureBrowserEnableAlphaExport; +typedef FreeCaller TextureBrowserEnableAlphaExport; class TextureBrowser { @@ -678,7 +678,7 @@ void TextureBrowser_importShowScrollbar( TextureBrowser& textureBrowser, bool va TextureBrowser_updateScroll( textureBrowser ); } } -typedef ReferenceCaller1 TextureBrowserImportShowScrollbarCaller; +typedef ReferenceCaller TextureBrowserImportShowScrollbarCaller; /* @@ -791,7 +791,7 @@ void TextureDirectory_loadTexture( const char* directory, const char* texture ){ IShader* shader = QERApp_Shader_ForName( name.c_str() ); shader->DecRef(); } -typedef ConstPointerCaller1 TextureDirectoryLoadTextureCaller; +typedef ConstPointerCaller TextureDirectoryLoadTextureCaller; class LoadTexturesByTypeVisitor : public ImageModules::Visitor { @@ -818,7 +818,7 @@ void TextureBrowser_ShowDirectory( TextureBrowser& textureBrowser, const char* d 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" ) { @@ -842,7 +842,7 @@ void TextureBrowser_ShowTagSearchResult( TextureBrowser& textureBrowser, const c 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" ) { @@ -866,37 +866,37 @@ bool TextureBrowser_hideUnused(); void TextureBrowser_hideUnusedExport( const BoolImportCallback& importer ){ importer( TextureBrowser_hideUnused() ); } -typedef FreeCaller1 TextureBrowserHideUnusedExport; +typedef FreeCaller TextureBrowserHideUnusedExport; void TextureBrowser_showShadersExport( const BoolImportCallback& importer ){ importer( GlobalTextureBrowser().m_showShaders ); } -typedef FreeCaller1 TextureBrowserShowShadersExport; +typedef FreeCaller TextureBrowserShowShadersExport; void TextureBrowser_showShaderlistOnly( const BoolImportCallback& importer ){ importer( g_TextureBrowser_shaderlistOnly ); } -typedef FreeCaller1 TextureBrowserShowShaderlistOnlyExport; +typedef FreeCaller TextureBrowserShowShaderlistOnlyExport; void TextureBrowser_fixedSize( const BoolImportCallback& importer ){ importer( g_TextureBrowser_fixedSize ); } -typedef FreeCaller1 TextureBrowser_FixedSizeExport; +typedef FreeCaller TextureBrowser_FixedSizeExport; void TextureBrowser_filterMissing( const BoolImportCallback& importer ){ importer( g_TextureBrowser_filterMissing ); } -typedef FreeCaller1 TextureBrowser_filterMissingExport; +typedef FreeCaller TextureBrowser_filterMissingExport; void TextureBrowser_filterFallback( const BoolImportCallback& importer ){ importer( g_TextureBrowser_filterFallback ); } -typedef FreeCaller1 TextureBrowser_filterFallbackExport; +typedef FreeCaller TextureBrowser_filterFallbackExport; void TextureBrowser_enableAlpha( const BoolImportCallback& importer ){ importer( g_TextureBrowser_enableAlpha ); } -typedef FreeCaller1 TextureBrowser_enableAlphaExport; +typedef FreeCaller TextureBrowser_enableAlphaExport; void TextureBrowser_SetHideUnused( TextureBrowser& textureBrowser, bool hideUnused ){ if ( hideUnused ) { @@ -1994,7 +1994,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ TextureBrowser_checkTagFile(); TextureBrowser_SetNotex(); - GlobalShaderSystem().setActiveShadersChangedNotify( ReferenceCaller( g_TextureBrowser ) ); + GlobalShaderSystem().setActiveShadersChangedNotify( ReferenceCaller( g_TextureBrowser ) ); g_TextureBrowser.m_parent = toplevel; @@ -2218,7 +2218,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ } void TextureBrowser_destroyWindow(){ - GlobalShaderSystem().setActiveShadersChangedNotify( Callback() ); + GlobalShaderSystem().setActiveShadersChangedNotify( Callback() ); 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 ); @@ -2534,7 +2534,7 @@ void TextureScaleImport( TextureBrowser& textureBrowser, int value ){ break; } } -typedef ReferenceCaller1 TextureScaleImportCaller; +typedef ReferenceCaller TextureScaleImportCaller; void TextureScaleExport( TextureBrowser& textureBrowser, const IntImportCallback& importer ){ switch ( textureBrowser.m_textureScale ) @@ -2556,7 +2556,7 @@ void TextureScaleExport( TextureBrowser& textureBrowser, const IntImportCallback break; } } -typedef ReferenceCaller1 TextureScaleExportCaller; +typedef ReferenceCaller TextureScaleExportCaller; void UniformTextureSizeImport( TextureBrowser& textureBrowser, int value ){ @@ -2564,7 +2564,7 @@ void UniformTextureSizeImport( TextureBrowser& textureBrowser, int value ){ if ( value > 16 ) TextureBrowser_setUniformSize( textureBrowser, value ); } -typedef ReferenceCaller1 UniformTextureSizeImportCaller; +typedef ReferenceCaller UniformTextureSizeImportCaller; void TextureBrowser_constructPreferences( PreferencesPage& page ){ page.appendCheckBox( @@ -2598,37 +2598,37 @@ void TextureBrowser_constructPage( PreferenceGroup& group ){ TextureBrowser_constructPreferences( page ); } void TextureBrowser_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } #include "preferencesystem.h" #include "stringio.h" -typedef ReferenceCaller1 TextureBrowserSetScaleCaller; +typedef ReferenceCaller TextureBrowserSetScaleCaller; void TextureClipboard_textureSelected( const char* shader ); void TextureBrowser_Construct(){ - GlobalCommands_insert( "ShaderInfo", FreeCaller() ); - GlobalCommands_insert( "ShowUntagged", FreeCaller() ); - GlobalCommands_insert( "AddTag", FreeCaller() ); - GlobalCommands_insert( "RenameTag", FreeCaller() ); - GlobalCommands_insert( "DeleteTag", FreeCaller() ); - GlobalCommands_insert( "CopyTag", FreeCaller() ); - GlobalCommands_insert( "PasteTag", FreeCaller() ); - GlobalCommands_insert( "RefreshShaders", FreeCaller() ); - GlobalToggles_insert( "ShowInUse", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) ); - GlobalCommands_insert( "ShowAllTextures", FreeCaller(), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "ToggleTextures", FreeCaller(), Accelerator( 'T' ) ); - GlobalToggles_insert( "ToggleShowShaders", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) ); - GlobalToggles_insert( "ToggleShowShaderlistOnly", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) ); - GlobalToggles_insert( "FixedSize", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) ); - GlobalToggles_insert( "FilterMissing", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) ); - GlobalToggles_insert( "FilterFallback", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) ); - GlobalToggles_insert( "EnableAlpha", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) ); + GlobalCommands_insert( "ShaderInfo", FreeCaller() ); + GlobalCommands_insert( "ShowUntagged", FreeCaller() ); + GlobalCommands_insert( "AddTag", FreeCaller() ); + GlobalCommands_insert( "RenameTag", FreeCaller() ); + GlobalCommands_insert( "DeleteTag", FreeCaller() ); + GlobalCommands_insert( "CopyTag", FreeCaller() ); + GlobalCommands_insert( "PasteTag", FreeCaller() ); + GlobalCommands_insert( "RefreshShaders", FreeCaller() ); + GlobalToggles_insert( "ShowInUse", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) ); + GlobalCommands_insert( "ShowAllTextures", FreeCaller(), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "ToggleTextures", FreeCaller(), Accelerator( 'T' ) ); + GlobalToggles_insert( "ToggleShowShaders", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) ); + GlobalToggles_insert( "ToggleShowShaderlistOnly", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) ); + GlobalToggles_insert( "FixedSize", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) ); + GlobalToggles_insert( "FilterMissing", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) ); + GlobalToggles_insert( "FilterFallback", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) ); + GlobalToggles_insert( "EnableAlpha", FreeCaller(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) ); GlobalPreferenceSystem().registerPreference( "TextureScale", makeSizeStringImportCallback( TextureBrowserSetScaleCaller( g_TextureBrowser ) ), @@ -2652,7 +2652,7 @@ void TextureBrowser_Construct(){ g_TextureBrowser.shader = texdef_name_default(); - Textures_setModeChangedNotify( ReferenceCaller( g_TextureBrowser ) ); + Textures_setModeChangedNotify( ReferenceCaller( g_TextureBrowser ) ); TextureBrowser_registerPreferencesPage(); @@ -2663,5 +2663,5 @@ void TextureBrowser_Construct(){ void TextureBrowser_Destroy(){ GlobalShaderSystem().detach( g_ShadersObserver ); - Textures_setModeChangedNotify( Callback() ); + Textures_setModeChangedNotify( Callback() ); } diff --git a/radiant/texwindow.h b/radiant/texwindow.h index 9a153c44..2debccea 100644 --- a/radiant/texwindow.h +++ b/radiant/texwindow.h @@ -43,11 +43,11 @@ const char* TextureBrowser_GetSelectedShader( TextureBrowser& textureBrower ); void TextureBrowser_Construct(); void TextureBrowser_Destroy(); -typedef Callback1 StringImportCallback; +typedef Callback StringImportCallback; extern ui::Widget g_page_textures; void TextureBrowser_exportTitle( const StringImportCallback& importer ); -typedef FreeCaller1 TextureBrowserExportTitleCaller; +typedef FreeCaller TextureBrowserExportTitleCaller; const Vector3& TextureBrowser_getBackgroundColour( TextureBrowser& textureBrowser ); void TextureBrowser_setBackgroundColour( TextureBrowser& textureBrowser, const Vector3& colour ); diff --git a/radiant/treemodel.cpp b/radiant/treemodel.cpp index aa6d227a..12441f0e 100644 --- a/radiant/treemodel.cpp +++ b/radiant/treemodel.cpp @@ -110,7 +110,7 @@ bool graph_tree_model_find_parent( GraphTreeModel* model, const scene::Path& pat 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& callback ){ if ( node != 0 ) { Nameable* nameable = Node_getNameable( node ); if ( nameable != 0 ) { @@ -118,7 +118,7 @@ void node_attach_name_changed_callback( scene::Node& node, const Callback& callb } } } -void node_detach_name_changed_callback( scene::Node& node, const Callback& callback ){ +void node_detach_name_changed_callback( scene::Node& node, const Callback& callback ){ if ( node != 0 ) { Nameable* nameable = Node_getNameable( node ); if ( nameable != 0 ) { @@ -153,14 +153,14 @@ void graph_tree_model_row_inserted( GraphTreeModel* model, const scene::Instance 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( instance ) ); + node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller( 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( instance ) ); + node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller( instance ) ); gtk_tree_store_remove( GTK_TREE_STORE( model ), &child ); } @@ -724,11 +724,11 @@ void graph_tree_model_insert( GraphTreeModel* model, const scene::Instance& inst graph_tree_model_row_inserted( model, i ); - node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller1( instance ) ); + node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller( instance ) ); } void graph_tree_model_erase( GraphTreeModel* model, const scene::Instance& instance ){ - node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller1( instance ) ); + node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller( instance ) ); graph_type::iterator i = model->graph->find( PathConstReference( instance.path() ) ); ASSERT_MESSAGE( i != model->graph->end(), "ERROR" ); @@ -760,7 +760,7 @@ GraphTreeNode( scene::Instance& instance ) : m_instance( instance ), m_parent( 0 m_instance.get().setChildSelectedChangedCallback( RowChangedCaller( *this ) ); } ~GraphTreeNode(){ - m_instance.get().setChildSelectedChangedCallback( Callback() ); + m_instance.get().setChildSelectedChangedCallback( Callback() ); ASSERT_MESSAGE( empty(), "GraphTreeNode::~GraphTreeNode: memory leak" ); } @@ -799,7 +799,7 @@ void swap( GraphTreeNode& other ){ void rowChanged(){ graph_tree_model_row_changed( *this ); } -typedef MemberCaller RowChangedCaller; +typedef MemberCaller RowChangedCaller; }; struct GraphTreeModel @@ -1169,7 +1169,7 @@ void node_detach_name_changed_callback( scene::Node& node, const NameCallback& c GraphTreeModel* scene_graph_get_tree_model(); // temp hack -void graph_tree_node_foreach_pre( GraphTreeNode::iterator root, const Callback1& callback ){ +void graph_tree_node_foreach_pre( GraphTreeNode::iterator root, const Callback& callback ){ callback( root ); for ( GraphTreeNode::iterator i = ( *root ).second->begin(); i != ( *root ).second->end(); ++i ) { @@ -1177,7 +1177,7 @@ void graph_tree_node_foreach_pre( GraphTreeNode::iterator root, const Callback1< } } -void graph_tree_node_foreach_post( GraphTreeNode::iterator root, const Callback1& callback ){ +void graph_tree_node_foreach_post( GraphTreeNode::iterator root, const Callback& callback ){ for ( GraphTreeNode::iterator i = ( *root ).second->begin(); i != ( *root ).second->end(); ++i ) { graph_tree_node_foreach_post( i, callback ); @@ -1199,12 +1199,12 @@ void graph_tree_model_set_name( const scene::Instance& instance, const char* nam 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( *model ) ); + graph_tree_node_foreach_post( oldNode, ReferenceCaller( *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( *model ) ); + graph_tree_node_foreach_pre( newNode, ReferenceCaller( *model ) ); } void graph_tree_model_insert( GraphTreeModel* model, const scene::Instance& instance ){ @@ -1214,11 +1214,11 @@ void graph_tree_model_insert( GraphTreeModel* model, const scene::Instance& inst graph_tree_model_row_inserted( model, i ); - node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller1( instance ) ); + node_attach_name_changed_callback( instance.path().top(), ConstReferenceCaller( instance ) ); } void graph_tree_model_erase( GraphTreeModel* model, const scene::Instance& instance ){ - node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller1( instance ) ); + node_detach_name_changed_callback( instance.path().top(), ConstReferenceCaller( instance ) ); GraphTreeNode* parent = graph_tree_model_find_parent( model, instance.path() ); diff --git a/radiant/undo.cpp b/radiant/undo.cpp index eb536d88..8277c70e 100644 --- a/radiant/undo.cpp +++ b/radiant/undo.cpp @@ -380,22 +380,22 @@ void UndoLevels_importString( RadiantUndoSystem& undo, const char* value ){ Int_importString( levels, value ); undo.setLevels( levels ); } -typedef ReferenceCaller1 UndoLevelsImportStringCaller; +typedef ReferenceCaller UndoLevelsImportStringCaller; void UndoLevels_exportString( const RadiantUndoSystem& undo, const StringImportCallback& importer ){ Int_exportString( static_cast( undo.getLevels() ), importer ); } -typedef ConstReferenceCaller1 UndoLevelsExportStringCaller; +typedef ConstReferenceCaller UndoLevelsExportStringCaller; #include "generic/callback.h" void UndoLevelsImport( RadiantUndoSystem& self, int value ){ self.setLevels( value ); } -typedef ReferenceCaller1 UndoLevelsImportCaller; +typedef ReferenceCaller UndoLevelsImportCaller; void UndoLevelsExport( const RadiantUndoSystem& self, const IntImportCallback& importCallback ){ importCallback( static_cast( self.getLevels() ) ); } -typedef ConstReferenceCaller1 UndoLevelsExportCaller; +typedef ConstReferenceCaller UndoLevelsExportCaller; void Undo_constructPreferences( RadiantUndoSystem& undo, PreferencesPage& page ){ @@ -406,7 +406,7 @@ void Undo_constructPage( RadiantUndoSystem& undo, PreferenceGroup& group ){ Undo_constructPreferences( undo, page ); } void Undo_registerPreferencesPage( RadiantUndoSystem& undo ){ - PreferencesDialog_addSettingsPage( ReferenceCaller1( undo ) ); + PreferencesDialog_addSettingsPage( ReferenceCaller( undo ) ); } class UndoSystemDependencies : public GlobalPreferenceSystemModuleRef diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index ada5eb43..d36738a1 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -190,7 +190,7 @@ void Build_constructPage( PreferenceGroup& group ){ Build_constructPreferences( page ); } void Build_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } #include "preferencesystem.h" diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 2365df8c..9e296f42 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -826,7 +826,7 @@ XYWnd::XYWnd() : GlobalWindowObservers_add( m_window_observer ); GlobalWindowObservers_connectWidget( m_gl_widget ); - m_window_observer->setRectangleDrawCallback( ReferenceCaller1( *this ) ); + m_window_observer->setRectangleDrawCallback( ReferenceCaller( *this ) ); m_window_observer->setView( m_view ); g_object_ref( m_gl_widget._handle ); @@ -849,8 +849,8 @@ XYWnd::XYWnd() : updateProjection(); updateModelview(); - AddSceneChangeCallback( ReferenceCaller( *this ) ); - AddCameraMovedCallback( ReferenceCaller( *this ) ); + AddSceneChangeCallback( ReferenceCaller( *this ) ); + AddCameraMovedCallback( ReferenceCaller( *this ) ); PressedButtons_connect( g_pressedButtons, m_gl_widget ); @@ -2586,71 +2586,71 @@ void ShowNamesToggle(){ GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() ); XY_UpdateAllWindows(); } -typedef FreeCaller ShowNamesToggleCaller; +typedef FreeCaller ShowNamesToggleCaller; void ShowNamesExport( const BoolImportCallback& importer ){ importer( GlobalEntityCreator().getShowNames() ); } -typedef FreeCaller1 ShowNamesExportCaller; +typedef FreeCaller ShowNamesExportCaller; void ShowAnglesToggle(){ GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() ); XY_UpdateAllWindows(); } -typedef FreeCaller ShowAnglesToggleCaller; +typedef FreeCaller ShowAnglesToggleCaller; void ShowAnglesExport( const BoolImportCallback& importer ){ importer( GlobalEntityCreator().getShowAngles() ); } -typedef FreeCaller1 ShowAnglesExportCaller; +typedef FreeCaller ShowAnglesExportCaller; void ShowBlocksToggle(){ g_xywindow_globals_private.show_blocks ^= 1; XY_UpdateAllWindows(); } -typedef FreeCaller ShowBlocksToggleCaller; +typedef FreeCaller ShowBlocksToggleCaller; void ShowBlocksExport( const BoolImportCallback& importer ){ importer( g_xywindow_globals_private.show_blocks ); } -typedef FreeCaller1 ShowBlocksExportCaller; +typedef FreeCaller ShowBlocksExportCaller; void ShowCoordinatesToggle(){ g_xywindow_globals_private.show_coordinates ^= 1; XY_UpdateAllWindows(); } -typedef FreeCaller ShowCoordinatesToggleCaller; +typedef FreeCaller ShowCoordinatesToggleCaller; void ShowCoordinatesExport( const BoolImportCallback& importer ){ importer( g_xywindow_globals_private.show_coordinates ); } -typedef FreeCaller1 ShowCoordinatesExportCaller; +typedef FreeCaller ShowCoordinatesExportCaller; void ShowOutlineToggle(){ g_xywindow_globals_private.show_outline ^= 1; XY_UpdateAllWindows(); } -typedef FreeCaller ShowOutlineToggleCaller; +typedef FreeCaller ShowOutlineToggleCaller; void ShowOutlineExport( const BoolImportCallback& importer ){ importer( g_xywindow_globals_private.show_outline ); } -typedef FreeCaller1 ShowOutlineExportCaller; +typedef FreeCaller ShowOutlineExportCaller; void ShowAxesToggle(){ g_xywindow_globals_private.show_axis ^= 1; XY_UpdateAllWindows(); } -typedef FreeCaller ShowAxesToggleCaller; +typedef FreeCaller ShowAxesToggleCaller; void ShowAxesExport( const BoolImportCallback& importer ){ importer( g_xywindow_globals_private.show_axis ); } -typedef FreeCaller1 ShowAxesExportCaller; +typedef FreeCaller ShowAxesExportCaller; void ShowWorkzoneToggle(){ g_xywindow_globals_private.d_show_work ^= 1; XY_UpdateAllWindows(); } -typedef FreeCaller ShowWorkzoneToggleCaller; +typedef FreeCaller ShowWorkzoneToggleCaller; void ShowWorkzoneExport( const BoolImportCallback& importer ){ importer( g_xywindow_globals_private.d_show_work ); } -typedef FreeCaller1 ShowWorkzoneExportCaller; +typedef FreeCaller ShowWorkzoneExportCaller; ShowNamesExportCaller g_show_names_caller; BoolExportCallback g_show_names_callback( g_show_names_caller ); @@ -2708,7 +2708,7 @@ void Orthographic_constructPage( PreferenceGroup& group ){ Orthographic_constructPreferences( page ); } void Orthographic_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } void Clipper_constructPreferences( PreferencesPage& page ){ @@ -2719,7 +2719,7 @@ void Clipper_constructPage( PreferenceGroup& group ){ Clipper_constructPreferences( page ); } void Clipper_registerPreferencesPage(){ - PreferencesDialog_addSettingsPage( FreeCaller1() ); + PreferencesDialog_addSettingsPage( FreeCaller() ); } @@ -2732,29 +2732,29 @@ void Clipper_registerPreferencesPage(){ void ToggleShown_importBool( ToggleShown& self, bool value ){ self.set( value ); } -typedef ReferenceCaller1 ToggleShownImportBoolCaller; +typedef ReferenceCaller ToggleShownImportBoolCaller; void ToggleShown_exportBool( const ToggleShown& self, const BoolImportCallback& importer ){ importer( self.active() ); } -typedef ConstReferenceCaller1 ToggleShownExportBoolCaller; +typedef ConstReferenceCaller ToggleShownExportBoolCaller; void XYWindow_Construct(){ - GlobalCommands_insert( "ToggleCrosshairs", FreeCaller(), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "ToggleSizePaint", FreeCaller(), Accelerator( 'J' ) ); - GlobalCommands_insert( "ToggleGrid", FreeCaller(), Accelerator( '0' ) ); + GlobalCommands_insert( "ToggleCrosshairs", FreeCaller(), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "ToggleSizePaint", FreeCaller(), Accelerator( 'J' ) ); + GlobalCommands_insert( "ToggleGrid", FreeCaller(), 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(), Accelerator( GDK_KEY_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); // fixme: doesn't show its shortcut - GlobalCommands_insert( "ZoomIn", FreeCaller(), Accelerator( GDK_KEY_Delete ) ); - GlobalCommands_insert( "ZoomOut", FreeCaller(), Accelerator( GDK_KEY_Insert ) ); - GlobalCommands_insert( "ViewTop", FreeCaller(), Accelerator( GDK_KEY_KP_Home ) ); - GlobalCommands_insert( "ViewSide", FreeCaller(), Accelerator( GDK_KEY_KP_Page_Down ) ); - GlobalCommands_insert( "ViewFront", FreeCaller(), Accelerator( GDK_KEY_KP_End ) ); - GlobalCommands_insert( "Zoom100", FreeCaller() ); - GlobalCommands_insert( "CenterXYView", FreeCaller(), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "NextView", FreeCaller(), Accelerator( GDK_KEY_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); // fixme: doesn't show its shortcut + GlobalCommands_insert( "ZoomIn", FreeCaller(), Accelerator( GDK_KEY_Delete ) ); + GlobalCommands_insert( "ZoomOut", FreeCaller(), Accelerator( GDK_KEY_Insert ) ); + GlobalCommands_insert( "ViewTop", FreeCaller(), Accelerator( GDK_KEY_KP_Home ) ); + GlobalCommands_insert( "ViewSide", FreeCaller(), Accelerator( GDK_KEY_KP_Page_Down ) ); + GlobalCommands_insert( "ViewFront", FreeCaller(), Accelerator( GDK_KEY_KP_End ) ); + GlobalCommands_insert( "Zoom100", FreeCaller() ); + GlobalCommands_insert( "CenterXYView", FreeCaller(), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalPreferenceSystem().registerPreference( "ClipCaulk", BoolImportStringCaller( g_clip_useCaulk ), BoolExportStringCaller( g_clip_useCaulk ) ); diff --git a/radiant/xywindow.h b/radiant/xywindow.h index cfe8f036..0b762d45 100644 --- a/radiant/xywindow.h +++ b/radiant/xywindow.h @@ -224,7 +224,7 @@ int Height(){ Signal0 onDestroyed; Signal3 onMouseDown; void mouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers ); -typedef Member3 MouseDownCaller; +typedef Member MouseDownCaller; }; inline void XYWnd_Update( XYWnd& xywnd ){