archives.push_back( filename );
}
-typedef FreeCaller<void(const char*), loadArchiveFile> LoadArchiveFileCaller;
-
void LoadTextureFile( const char* filename ){
std::string s_filename = filename;
}
}
-typedef FreeCaller<void(const char*), LoadTextureFile> LoadTextureFileCaller;
-
void GetTextures( const char* extension ){
- GlobalFileSystem().forEachFile( "textures/", extension, LoadTextureFileCaller(), 0 );
+ GlobalFileSystem().forEachFile("textures/", extension, makeCallbackF(LoadTextureFile), 0);
}
void LoadShaderList( const char* filename ){
}
}
-typedef FreeCaller<void(const char*), LoadShaderList> LoadShaderListCaller;
-
void GetAllShaders(){
- GlobalShaderSystem().foreachShaderName( LoadShaderListCaller() );
+ GlobalShaderSystem().foreachShaderName(makeCallbackF(LoadShaderList));
}
void GetArchiveList(){
- GlobalFileSystem().forEachArchive( LoadArchiveFileCaller() );
+ GlobalFileSystem().forEachArchive(makeCallbackF(loadArchiveFile));
globalOutputStream() << "Shaderplug: " << (const Unsigned)Shaderplug::archives.size() << " archives found.\n";
}
void test0free(){
}
-typedef FreeCaller<void(), &test0free> Test0FreeCaller;
void test1free( A1 ){
}
-typedef FreeCaller<void(A1), &test1free> Test1FreeCaller;
void test2free( A1, A2 ){
}
typedef Function<void(A1, A2), &test2free> Test2Free;
Test test;
const Test& testconst = test;
{
- Callback<void()> a = Test0FreeCaller();
+ Callback<void()> a = makeCallbackF(&test0free)();
Callback<void()> b = Test::Test0Caller( test );
b = makeCallback( Test::Test0(), test );
Callback<void()> c = Test::Test0ConstCaller( testconst );
}
{
typedef Callback<void(A1)> TestCallback1;
- TestCallback1 a = Test1FreeCaller();
+ TestCallback1 a = makeCallbackF(&test1free));
TestCallback1 b = Test::Test1Caller( test );
b = makeCallback( Test::Test1(), test );
TestCallback1 c = Test::Test1ConstCaller( testconst );
#include <cstddef>
#include "functional.h"
-template<typename Type>
-inline void* convertToOpaque( Type* t ){
- return t;
-}
-template<typename Type>
-inline void* convertToOpaque( const Type* t ){
- return const_cast<Type*>( t );
-}
-template<typename Type>
-inline void* convertToOpaque( Type& t ){
- return &t;
-}
-template<typename Type>
-inline void* convertToOpaque( const Type& t ){
- return const_cast<Type*>( &t );
-}
-
+namespace detail {
-template<typename Type>
-class ConvertFromOpaque
-{
-};
+ template<typename Thunk_>
+ class CallbackBase {
+ void *m_environment;
+ Thunk_ m_thunk;
+ public:
+ typedef Thunk_ Thunk;
-template<typename Type>
-class ConvertFromOpaque<Type&>
-{
-public:
-static Type& apply( void* p ){
- return *static_cast<Type*>( p );
-}
-};
+ CallbackBase(void *environment, Thunk function) : m_environment(environment), m_thunk(function) {
+ }
-template<typename Type>
-class ConvertFromOpaque<const Type&>
-{
-public:
-static const Type& apply( void* p ){
- return *static_cast<Type*>( p );
-}
-};
+ void *getEnvironment() const {
+ return m_environment;
+ }
+ Thunk getThunk() const {
+ return m_thunk;
+ }
+ };
-template<typename Type>
-class ConvertFromOpaque<Type*>
-{
-public:
-static Type* apply( void* p ){
- return static_cast<Type*>( p );
-}
-};
+ template<typename Thunk>
+ inline bool operator==(const CallbackBase<Thunk> &self, const CallbackBase<Thunk> &other) {
+ return self.getEnvironment() == other.getEnvironment() && self.getThunk() == other.getThunk();
+ }
-template<typename Type>
-class ConvertFromOpaque<const Type*>
-{
-public:
-static const Type* apply( void* p ){
- return static_cast<Type*>( p );
-}
-};
+ template<typename Thunk>
+ inline bool operator!=(const CallbackBase<Thunk> &self, const CallbackBase<Thunk> &other) {
+ return !(self == other);
+ }
-template<typename Thunk_>
-class CallbackBase
-{
-void* m_environment;
-Thunk_ m_thunk;
-public:
-typedef Thunk_ Thunk;
-CallbackBase( void* environment, Thunk function ) : m_environment( environment ), m_thunk( function ){
-}
-void* getEnvironment() const {
- return m_environment;
-}
-Thunk getThunk() const {
- return m_thunk;
-}
-};
+ template<typename Thunk>
+ inline bool operator<(const CallbackBase<Thunk> &self, const CallbackBase<Thunk> &other) {
+ return self.getEnvironment() < other.getEnvironment() ||
+ (!(other.getEnvironment() < self.getEnvironment()) && self.getThunk() < other.getThunk());
+ }
-template<typename Thunk>
-inline bool operator==( const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other ){
- return self.getEnvironment() == other.getEnvironment() && self.getThunk() == other.getThunk();
-}
-template<typename Thunk>
-inline bool operator!=( const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other ){
- return !( self == other );
-}
-template<typename Thunk>
-inline bool operator<( const CallbackBase<Thunk>& self, const CallbackBase<Thunk>& other ){
- return self.getEnvironment() < other.getEnvironment() ||
- ( !( other.getEnvironment() < self.getEnvironment() ) && self.getThunk() < other.getThunk() );
}
-template<class Caller, class F>
-class BindFirstOpaqueN;
+namespace detail {
-template<class Caller, class R, class FirstBound, class... Ts>
-class BindFirstOpaqueN<Caller, R(FirstBound, Ts...)> {
- FirstBound firstBound;
-public:
- explicit BindFirstOpaqueN(FirstBound firstBound) : firstBound(firstBound) {
+ template<typename Type>
+ inline void *convertToOpaque(Type *t) {
+ return t;
}
- R operator()(Ts... args) const {
- return Caller::call(firstBound, args...);
+ template<typename Type>
+ inline void *convertToOpaque(const Type *t) {
+ return const_cast<Type *>( t );
}
- FirstBound getBound() const {
- return firstBound;
+ template<typename Type>
+ inline void *convertToOpaque(Type &t) {
+ return &t;
}
- static R thunk(void *environment, Ts... args) {
- return Caller::call(ConvertFromOpaque<FirstBound>::apply(environment), args...);
+ template<typename Type>
+ inline void *convertToOpaque(const Type &t) {
+ return const_cast<Type *>( &t );
}
- void *getEnvironment() const {
- return convertToOpaque(firstBound);
- }
-};
+
+ template<typename Type>
+ class ConvertFromOpaque {
+ };
+
+ template<typename Type>
+ class ConvertFromOpaque<Type &> {
+ public:
+ static Type &apply(void *p) {
+ return *static_cast<Type *>( p );
+ }
+ };
+
+ template<typename Type>
+ class ConvertFromOpaque<const Type &> {
+ public:
+ static const Type &apply(void *p) {
+ return *static_cast<Type *>( p );
+ }
+ };
+
+
+ template<typename Type>
+ class ConvertFromOpaque<Type *> {
+ public:
+ static Type *apply(void *p) {
+ // illegal cast
+ return reinterpret_cast<Type *>( p );
+ }
+ };
+
+ template<typename Type>
+ class ConvertFromOpaque<const Type *> {
+ public:
+ static const Type *apply(void *p) {
+ return static_cast<Type *>( p );
+ }
+ };
+
+ template<class Caller, class F>
+ class BindFirstOpaqueN;
+
+ template<class Caller, class R, class FirstBound, class... Ts>
+ class BindFirstOpaqueN<Caller, R(FirstBound, Ts...)> {
+ FirstBound firstBound;
+ public:
+ explicit BindFirstOpaqueN(FirstBound firstBound) : firstBound(firstBound) {
+ }
+
+ R operator()(Ts... args) const {
+ return Caller::call(firstBound, args...);
+ }
+
+ FirstBound getBound() const {
+ return firstBound;
+ }
+
+ static R thunk(void *environment, Ts... args) {
+ return Caller::call(detail::ConvertFromOpaque<FirstBound>::apply(environment), args...);
+ }
+
+ void *getEnvironment() const {
+ return detail::convertToOpaque(firstBound);
+ }
+ };
+
+}
template<class Caller>
-using BindFirstOpaque = BindFirstOpaqueN<Caller, get_func<Caller>>;
+using BindFirstOpaque = detail::BindFirstOpaqueN<Caller, get_func<Caller>>;
/// \brief Combines a void pointer with a pointer to a function which operates on a void pointer.
///
class Callback;
template<class R, class... Ts>
-class Callback<R(Ts...)> : public CallbackBase<R(*)(void *, Ts...)> {
- using Base = CallbackBase<R (*)(void *, Ts...)>;
+class Callback<R(Ts...)> : public detail::CallbackBase<R(*)(void *, Ts...)> {
+ using Base = detail::CallbackBase<R (*)(void *, Ts...)>;
static R nullThunk(void *, Ts...) {
}
template <class Unshift>
using unshift = Arglist<R(Unshift, Ts...)>;
};
+
+ template<class F>
+ using ArgShift = typename detail::Arglist<F>::shift::type;
+
+ template<class F, class T>
+ using ArgUnshift = typename detail::Arglist<F>::template unshift<T>::type;
}
template<typename Caller>
-inline Callback<typename detail::Arglist<get_func<Caller>>::shift::type> makeCallback(const Caller &caller, get_argument<Caller, 0> callee) {
- return Callback<typename detail::Arglist<get_func<Caller>>::shift::type>(BindFirstOpaque<Caller>(callee));
+inline Callback<detail::ArgShift<get_func<Caller>>> makeCallback(const Caller &caller, get_argument<Caller, 0> callee) {
+ return BindFirstOpaque<Caller>(callee);
}
+template<class Caller, class F>
+class CallerShiftFirst;
+
+template<class Caller, class R, class FirstArgument, class... Ts>
+class CallerShiftFirst<Caller, R(FirstArgument, Ts...)> {
+public:
+ using func = R(FirstArgument, Ts...);
+
+ static R call(FirstArgument, Ts... args) {
+ return Caller::call(args...);
+ }
+};
+
template<typename Caller>
inline Callback<get_func<Caller>> makeStatelessCallback(const Caller &caller) {
- return makeCallback(CallerShiftFirst<Caller, typename detail::Arglist<get_func<Caller>>::template unshift<void *>::type>(), nullptr);
+ return makeCallback(CallerShiftFirst<Caller, detail::ArgUnshift<get_func<Caller>, void *>>(), nullptr);
}
/// \brief Forms a Callback from a non-const Environment reference and a non-const Environment member-function.
-///
-/// \dontinclude generic/callback.cpp
-/// \skipline MemberCaller0 example
-/// \until end example
-
template<class Environment, class F, MemberFunction<Environment, F> member>
-using MemberCaller = BindFirstOpaque<typename MemberN<Environment, F>::template instance<member>>;
+using MemberCaller = BindFirstOpaque<Member<Environment, F, member>>;
-/// \brief Forms a Callback from a const Environment reference and a const Environment member-function.
+/// \brief Constructs a Callback1 from a non-const \p functor
///
-/// \dontinclude generic/callback.cpp
-/// \skipline MemberCaller0 example
-/// \until end example
+/// \param Functor Must define \c first_argument_type and \c operator()(first_argument_type).
+template<typename Functor>
+inline Callback<get_func<Functor>> makeCallback(Functor &functor) {
+ return MemberCaller<Functor, get_func<Functor>, &Functor::operator()>(functor);
+}
+
+/// \brief Forms a Callback from a const Environment reference and a const Environment member-function.
template<class Environment, class F, ConstMemberFunction<Environment, F> member>
-using ConstMemberCaller = BindFirstOpaque<typename ConstMemberN<Environment, F>::template instance<member>>;
+using ConstMemberCaller = BindFirstOpaque<ConstMember<Environment, F, member>>;
-/// \brief Forms a Callback from a non-const Environment reference and a free function which operates on a non-const Environment reference.
+/// \brief Constructs a Callback1 from a const \p functor
///
-/// \dontinclude generic/callback.cpp
-/// \skipline ReferenceCaller0 example
-/// \until end example
-template<class Environment, class F, typename detail::Arglist<F>::template unshift<Environment &>::type *func>
-using ReferenceCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<Environment &>::type>::template instance<func>>;
+/// \param Functor Must define \c first_argument_type and const \c operator()(first_argument_type).
+template<typename Functor>
+inline Callback<get_func<Functor>> makeCallback(const Functor &functor) {
+ return ConstMemberCaller<Functor, get_func<Functor>, &Functor::operator()>(functor);
+}
+
+/// \brief Forms a Callback from a non-const Environment reference and a free function which operates on a non-const Environment reference.
+template<class Environment, class F, detail::ArgUnshift<F, Environment &> *func>
+using ReferenceCaller = BindFirstOpaque<Function<detail::ArgUnshift<F, Environment &>, func>>;
/// \brief Forms a Callback from a const Environment reference and a free function which operates on a const Environment reference.
-///
-/// \dontinclude generic/callback.cpp
-/// \skipline ReferenceCaller0 example
-/// \until end example
-template<class Environment, class F, typename detail::Arglist<F>::template unshift<const Environment &>::type *func>
-using ConstReferenceCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<const Environment &>::type>::template instance<func>>;
+template<class Environment, class F, detail::ArgUnshift<F, const Environment &> *func>
+using ConstReferenceCaller = BindFirstOpaque<Function<detail::ArgUnshift<F, const Environment &>, func>>;
/// \brief Forms a Callback from a non-const Environment pointer and a free function which operates on a non-const Environment pointer.
-template<class Environment, class F, typename detail::Arglist<F>::template unshift<Environment *>::type *func>
-using PointerCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<Environment *>::type>::template instance<func>>;
+template<class Environment, class F, detail::ArgUnshift<F, Environment *> *func>
+using PointerCaller = BindFirstOpaque<Function<detail::ArgUnshift<F, Environment *>, func>>;
/// \brief Forms a Callback from a const Environment pointer and a free function which operates on a const Environment pointer.
-template<class Environment, class F, typename detail::Arglist<F>::template unshift<const Environment *>::type *func>
-using ConstPointerCaller = BindFirstOpaque<typename FunctionN<typename detail::Arglist<F>::template unshift<const Environment *>::type>::template instance<func>>;
+template<class Environment, class F, detail::ArgUnshift<F, const Environment *> *func>
+using ConstPointerCaller = BindFirstOpaque<Function<detail::ArgUnshift<F, const Environment *>, func>>;
+
+namespace detail {
+ template<class Caller, class F>
+ class FreeCaller : public BindFirstOpaque<CallerShiftFirst<Caller, detail::ArgUnshift<F, void *>>> {
+ public:
+ FreeCaller() : BindFirstOpaque<CallerShiftFirst<Caller, detail::ArgUnshift<F, void *>>>(nullptr) {
+ }
+ };
+
+ template <class F>
+ struct freecallwrapper;
+
+ template <class R, class... Ts>
+ struct freecallwrapper<R(Ts...)> {
+ using func = R(R(Ts...), Ts...);
+ static R call(R(*f)(Ts...), Ts... args) {
+ // ideally, we'd get the implementation of the function type directly. Instead, it's passed in
+ return f(args...);
+ }
+ };
+}
/// \brief Forms a Callback from a free function
template<class F, F *func>
-class FreeCaller : public BindFirstOpaque<CallerShiftFirst<
- typename FunctionN<F>::template instance<func>,
- typename detail::Arglist<F>::template unshift<void *>::type
->> {
-public:
- FreeCaller()
- : BindFirstOpaque<CallerShiftFirst<
- typename FunctionN<F>::template instance<func>,
- typename detail::Arglist<F>::template unshift<void *>::type
- >>(nullptr) {
- }
-};
+using FreeCaller = detail::FreeCaller<Function<F, func>, F>;
-/// \brief Constructs a Callback1 from a non-const \p functor
-///
-/// \param Functor Must define \c first_argument_type and \c operator()(first_argument_type).
-template<typename Functor>
-inline Callback<get_func<Functor>> makeCallback(Functor &functor) {
- return Callback<get_func<Functor>>(MemberCaller<Functor, get_func<Functor>, &Functor::operator()>(functor));
+template<class F>
+inline Callback<F> makeCallbackF(F *func) {
+ // illegal cast
+ return Callback<F>(reinterpret_cast<void *>(func), BindFirstOpaque<detail::freecallwrapper<F>>::thunk);
}
-/// \brief Constructs a Callback1 from a const \p functor
-///
-/// \param Functor Must define \c first_argument_type and const \c operator()(first_argument_type).
-template<typename Functor>
-inline Callback<get_func<Functor>> makeCallback(const Functor &functor) {
- return Callback<get_func<Functor>>(ConstMemberCaller<Functor, get_func<Functor>, &Functor::operator()>(functor));
-}
+// todo: remove
using BoolImportCallback = Callback<void(bool)>;
using BoolExportCallback = Callback<void(const BoolImportCallback&)>;
template<class Caller, int N>
using get_argument = typename detail::Fn<get_func<Caller>>::template get<N>;
+namespace detail {
+
+ template<class F>
+ class FunctionN;
+
+ template<class R, class... Ts>
+ class FunctionN<R(Ts...)> {
+ public:
+ template<R(*f)(Ts...)>
+ class instance {
+ public:
+ using func = R(Ts...);
+
+ static R call(Ts... args) {
+ return (f)(args...);
+ }
+ };
+ };
+
+}
+
+template<class F, F *func>
+using Function = typename detail::FunctionN<F>::template instance<func>;
+
namespace detail {
template<class Object, class F>
struct MemberFunction;
};
}
-template<class Object, class F>
-using MemberFunction = typename detail::MemberFunction<Object, F>::type;
-
-template<class Object, class F>
-using ConstMemberFunction = typename detail::MemberFunction<Object, F>::type_const;
-
-template<class Object, class F>
-class MemberN;
+namespace detail {
+ template<class Object, class F>
+ class MemberN;
-template<class Object, class R, class... Ts>
-class MemberN<Object, R(Ts...)> {
-public:
- template<R(Object::*f)(Ts...)>
- class instance {
+ template<class Object, class R, class... Ts>
+ class MemberN<Object, R(Ts...)> {
public:
- using func = R(Object &, Ts...);
-
- static R call(Object &object, Ts... args) {
- return (object.*f)(args...);
- }
+ template<R(Object::*f)(Ts...)>
+ class instance {
+ public:
+ using func = R(Object &, Ts...);
+
+ static R call(Object &object, Ts... args) {
+ return (object.*f)(args...);
+ }
+ };
};
-};
-
-template<class Object, class F, MemberFunction<Object, F> func>
-using Member = typename MemberN<Object, F>::template instance<func>;
+}
template<class Object, class F>
-class ConstMemberN;
-
-template<class Object, class R, class... Ts>
-class ConstMemberN<Object, R(Ts...)> {
-public:
- template<R(Object::*f)(Ts...) const>
- class instance {
- public:
- using func = R(const Object &, Ts...);
-
- static R call(const Object &object, Ts... args) {
- return (object.*f)(args...);
- }
- };
-};
+using MemberFunction = typename detail::MemberFunction<Object, F>::type;
-template<class Object, class F, ConstMemberFunction<Object, F> func>
-using ConstMember = typename ConstMemberN<Object, F>::template instance<func>;
+template<class Object, class F, MemberFunction<Object, F> func>
+using Member = typename detail::MemberN<Object, F>::template instance<func>;
-template<class F>
-class FunctionN;
+namespace detail {
+ template<class Object, class F>
+ class ConstMemberN;
-template<class R, class... Ts>
-class FunctionN<R(Ts...)> {
-public:
- template<R(*f)(Ts...)>
- class instance {
+ template<class Object, class R, class... Ts>
+ class ConstMemberN<Object, R(Ts...)> {
public:
- using func = R(Ts...);
-
- static R call(Ts... args) {
- return (f)(args...);
- }
+ template<R(Object::*f)(Ts...) const>
+ class instance {
+ public:
+ using func = R(const Object &, Ts...);
+
+ static R call(const Object &object, Ts... args) {
+ return (object.*f)(args...);
+ }
+ };
};
-};
-
-template<class F, F *func>
-using Function = typename FunctionN<F>::template instance<func>;
-
-template<class Caller, class F>
-class CallerShiftFirst;
+}
-template<class Caller, class R, class FirstArgument, class... Ts>
-class CallerShiftFirst<Caller, R(FirstArgument, Ts...)> {
-public:
- using func = R(FirstArgument, Ts...);
+template<class Object, class F>
+using ConstMemberFunction = typename detail::MemberFunction<Object, F>::type_const;
- static R call(FirstArgument, Ts... args) {
- return Caller::call(args...);
- }
-};
+template<class Object, class F, ConstMemberFunction<Object, F> func>
+using ConstMember = typename detail::ConstMemberN<Object, F>::template instance<func>;
-template<class Functor, class F>
-class FunctorNInvoke;
+// misc
namespace detail {
template<int ...>
template<int N>
using seq_new = typename gens<N>::type;
-}
-template<class Functor, class R, class... Ts>
-class FunctorNInvoke<Functor, R(Ts...)> {
- std::tuple<Ts...> args;
+ template<class Functor, class F>
+ class FunctorNInvoke;
- template<class T>
- struct caller;
+ template<class Functor, class R, class... Ts>
+ class FunctorNInvoke<Functor, R(Ts...)> {
+ std::tuple<Ts...> args;
- template<int ...I>
- struct caller<detail::seq<I...>> {
- static inline R call(FunctorNInvoke<Functor, R(Ts...)> *self, Functor functor) {
- (void) self;
- return functor(std::get<I>(self->args)...);
- }
- };
+ template<class T>
+ struct caller;
+
+ template<int ...I>
+ struct caller<seq<I...>> {
+ static inline R call(FunctorNInvoke<Functor, R(Ts...)> *self, Functor functor) {
+ (void) self;
+ return functor(std::get<I>(self->args)...);
+ }
+ };
-public:
- FunctorNInvoke(Ts... args) : args(args...) {
- }
+ public:
+ FunctorNInvoke(Ts... args) : args(args...) {
+ }
- inline R operator()(Functor functor) {
- return caller<detail::seq_new<sizeof...(Ts)>>::call(this, functor);
- }
-};
+ inline R operator()(Functor functor) {
+ return caller<seq_new<sizeof...(Ts)>>::call(this, functor);
+ }
+ };
+}
template<class Functor>
-using FunctorInvoke = FunctorNInvoke<Functor, get_func<Functor>>;
+using FunctorInvoke = detail::FunctorNInvoke<Functor, get_func<Functor>>;
#endif
}
}
-typedef FreeCaller<void(const char*), LoadShaderFile> LoadShaderFileCaller;
-
-
void loadGuideFile( const char* filename ){
StringOutputStream fullname( 256 );
fullname << "guides/" << filename;
}
}
-typedef FreeCaller<void(const char*), loadGuideFile> LoadGuideFileCaller;
-
-
CShader* Try_Shader_ForName( const char* name ){
{
shaders_t::iterator i = g_ActiveShaders.find( name );
}
}
-typedef FreeCaller<void(const char*), ShaderList_addShaderFile> AddShaderFileCaller;
-
-
/*
==================
BuildShaderList
}
}
-typedef FreeCaller<void(const char *), ShaderList_addFromArchive> AddShaderListFromArchiveCaller;
-
#include "stream/filestream.h"
bool shaderlist_findOrInstall( const char* enginePath, const char* toolsPath, const char* shaderPath, const char* gamename ){
void Shaders_Load(){
if ( g_shaderLanguage == SHADERLANGUAGE_QUAKE4 ) {
- GlobalFileSystem().forEachFile( "guides/", "guide", LoadGuideFileCaller(), 0 );
+ GlobalFileSystem().forEachFile("guides/", "guide", makeCallbackF(loadGuideFile), 0);
}
const char* shaderPath = GlobalRadiant().getGameDescriptionKeyValue( "shaderpath" );
shaderlist_findOrInstall( enginePath, toolsPath, path.c_str(), gamename );
}
- GlobalFileSystem().forEachArchive( AddShaderListFromArchiveCaller(), false, true );
+ GlobalFileSystem().forEachArchive(makeCallbackF(ShaderList_addFromArchive), false, true);
DumpUnreferencedShaders();
}
else
{
- GlobalFileSystem().forEachFile( path.c_str(), g_shadersExtension, AddShaderFileCaller(), 0 );
+ GlobalFileSystem().forEachFile(path.c_str(), g_shadersExtension, makeCallbackF(ShaderList_addShaderFile), 0);
}
GSList *lst = l_shaderfiles;
Autosave_constructPreferences( page );
}
void Autosave_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Autosave_constructPage>() );
+ PreferencesDialog_addSettingsPage(makeCallbackF(Autosave_constructPage));
}
void Brush_registerCommands(){
- GlobalToggles_insert( "TogTexLock", FreeCaller<void(), Texdef_ToggleMoveLock>(), ToggleItem::AddCallbackCaller( g_texdef_movelock_item ), Accelerator( 'T', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalToggles_insert( "TogTexLock", makeCallbackF(Texdef_ToggleMoveLock), ToggleItem::AddCallbackCaller( g_texdef_movelock_item ), Accelerator( 'T', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalCommands_insert( "BrushPrism", BrushPrefab::SetCaller( g_brushprism ) );
GlobalCommands_insert( "BrushCone", BrushPrefab::SetCaller( g_brushcone ) );
GlobalCommands_insert( "Brush8Sided", BrushMakeSided::SetCaller( g_brushmakesided8 ), Accelerator( '8', (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "Brush9Sided", BrushMakeSided::SetCaller( g_brushmakesided9 ), Accelerator( '9', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "ClipSelected", FreeCaller<void(), ClipSelected>(), Accelerator( GDK_KEY_Return ) );
- GlobalCommands_insert( "SplitSelected", FreeCaller<void(), SplitSelected>(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "FlipClip", FreeCaller<void(), FlipClipper>(), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "ClipSelected", makeCallbackF(ClipSelected), Accelerator( GDK_KEY_Return ) );
+ GlobalCommands_insert( "SplitSelected", makeCallbackF(SplitSelected), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "FlipClip", makeCallbackF(FlipClipper), Accelerator( GDK_KEY_Return, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "MakeDetail", FreeCaller<void(), Select_MakeDetail>(), Accelerator( 'M', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "MakeStructural", FreeCaller<void(), Select_MakeStructural>(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "MakeDetail", makeCallbackF(Select_MakeDetail), Accelerator( 'M', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "MakeStructural", makeCallbackF(Select_MakeStructural), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
}
void Brush_constructMenu( ui::Menu menu ){
void Face_importSnapPlanes( bool value ){
Face::m_quantise = value ? quantiseInteger : quantiseFloating;
}
-typedef FreeCaller<void(bool), Face_importSnapPlanes> FaceImportSnapPlanesCaller;
void Face_exportSnapPlanes( const BoolImportCallback& importer ){
importer( Face::m_quantise == quantiseInteger );
}
-typedef FreeCaller<void(const BoolImportCallback&), Face_exportSnapPlanes> FaceExportSnapPlanesCaller;
void Brush_constructPreferences( PreferencesPage& page ){
page.appendCheckBox(
"", "Snap planes to integer grid",
- FaceImportSnapPlanesCaller(),
- FaceExportSnapPlanesCaller()
+ makeCallbackF(Face_importSnapPlanes),
+ makeCallbackF(Face_exportSnapPlanes)
);
page.appendEntry(
"Default texture scale",
Brush_constructPreferences( page );
}
void Brush_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Brush_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(Brush_constructPage) );
}
void Brush_unlatchPreferences(){
}
GlobalPreferenceSystem().registerPreference( "TextureLock", BoolImportStringCaller( g_brush_texturelock_enabled ), BoolExportStringCaller( g_brush_texturelock_enabled ) );
- GlobalPreferenceSystem().registerPreference( "BrushSnapPlanes", makeBoolStringImportCallback( FaceImportSnapPlanesCaller() ), makeBoolStringExportCallback( FaceExportSnapPlanesCaller() ) );
+ GlobalPreferenceSystem().registerPreference( "BrushSnapPlanes", makeBoolStringImportCallback( FreeCaller<void(bool), Face_importSnapPlanes>() ), makeBoolStringExportCallback( FreeCaller<void(const BoolImportCallback&), Face_exportSnapPlanes>() ) );
GlobalPreferenceSystem().registerPreference( "TexdefDefaultScale", FloatImportStringCaller( g_texdef_default_scale ), FloatExportStringCaller( g_texdef_default_scale ) );
GridStatus_getTextureLockEnabled = getTextureLockEnabled;
- g_texture_lock_status_changed = FreeCaller<void(), GridStatus_onTextureLockEnabledChanged>();
+ g_texture_lock_status_changed = makeCallbackF(GridStatus_onTextureLockEnabledChanged);
}
void Brush_Destroy(){
void ShowStatsToggle(){
g_camwindow_globals_private.m_showStats ^= 1;
}
-typedef FreeCaller<void(), ShowStatsToggle> ShowStatsToggleCaller;
void ShowStatsExport( const BoolImportCallback& importer ){
importer( g_camwindow_globals_private.m_showStats );
}
-typedef FreeCaller<void(const BoolImportCallback&), ShowStatsExport> ShowStatsExportCaller;
-ShowStatsExportCaller g_show_stats_caller;
+FreeCaller<void(const BoolImportCallback&), ShowStatsExport> g_show_stats_caller;
BoolExportCallback g_show_stats_callback( g_show_stats_caller );
ToggleItem g_show_stats( g_show_stats_callback );
Camera_constructPreferences( page );
}
void Camera_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Camera_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(Camera_constructPage) );
}
#include "preferencesystem.h"
/// \brief Initialisation for things that have the same lifespan as this module.
void CamWnd_Construct(){
- GlobalCommands_insert( "CenterView", FreeCaller<void(), GlobalCamera_ResetAngles>(), Accelerator( GDK_KEY_End ) );
+ GlobalCommands_insert( "CenterView", makeCallbackF(GlobalCamera_ResetAngles), Accelerator( GDK_KEY_End ) );
- GlobalToggles_insert( "ToggleCubicClip", FreeCaller<void(), Camera_ToggleFarClip>(), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CubicClipZoomIn", FreeCaller<void(), Camera_CubeIn>(), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CubicClipZoomOut", FreeCaller<void(), Camera_CubeOut>(), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalToggles_insert( "ToggleCubicClip", makeCallbackF(Camera_ToggleFarClip), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CubicClipZoomIn", makeCallbackF(Camera_CubeIn), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CubicClipZoomOut", makeCallbackF(Camera_CubeOut), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "UpFloor", FreeCaller<void(), Camera_ChangeFloorUp>(), Accelerator( GDK_KEY_Prior ) );
- GlobalCommands_insert( "DownFloor", FreeCaller<void(), Camera_ChangeFloorDown>(), Accelerator( GDK_KEY_Next ) );
+ GlobalCommands_insert( "UpFloor", makeCallbackF(Camera_ChangeFloorUp), Accelerator( GDK_KEY_Prior ) );
+ GlobalCommands_insert( "DownFloor", makeCallbackF(Camera_ChangeFloorDown), Accelerator( GDK_KEY_Next ) );
GlobalToggles_insert( "ToggleCamera", ToggleShown::ToggleCaller( g_camera_shown ), ToggleItem::AddCallbackCaller( g_camera_shown.m_item ), Accelerator( 'C', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "LookThroughSelected", FreeCaller<void(), GlobalCamera_LookThroughSelected>() );
- GlobalCommands_insert( "LookThroughCamera", FreeCaller<void(), GlobalCamera_LookThroughCamera>() );
+ GlobalCommands_insert( "LookThroughSelected", makeCallbackF(GlobalCamera_LookThroughSelected) );
+ GlobalCommands_insert( "LookThroughCamera", makeCallbackF(GlobalCamera_LookThroughCamera) );
if ( g_pGameDescription->mGameType == "doom3" ) {
- GlobalCommands_insert( "TogglePreview", FreeCaller<void(), CamWnd_TogglePreview>(), Accelerator( GDK_KEY_F3 ) );
+ GlobalCommands_insert( "TogglePreview", makeCallbackF(CamWnd_TogglePreview), Accelerator( GDK_KEY_F3 ) );
}
- GlobalCommands_insert( "CameraSpeedInc", FreeCaller<void(), CameraSpeed_increase>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "CameraSpeedDec", FreeCaller<void(), CameraSpeed_decrease>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CameraSpeedInc", makeCallbackF(CameraSpeed_increase), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CameraSpeedDec", makeCallbackF(CameraSpeed_decrease), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalShortcuts_insert( "CameraForward", Accelerator( GDK_KEY_Up ) );
GlobalShortcuts_insert( "CameraBack", Accelerator( GDK_KEY_Down ) );
GlobalShortcuts_insert( "CameraFreeMoveLeft", Accelerator( GDK_KEY_Left ) );
GlobalShortcuts_insert( "CameraFreeMoveRight", Accelerator( GDK_KEY_Right ) );
- GlobalToggles_insert( "ShowStats", ShowStatsToggleCaller(), ToggleItem::AddCallbackCaller( g_show_stats ) );
+ GlobalToggles_insert( "ShowStats", makeCallbackF(ShowStatsToggle), ToggleItem::AddCallbackCaller( g_show_stats ) );
GlobalPreferenceSystem().registerPreference( "ShowStats", BoolImportStringCaller( g_camwindow_globals_private.m_showStats ), BoolExportStringCaller( g_camwindow_globals_private.m_showStats ) );
GlobalPreferenceSystem().registerPreference( "MoveSpeed", IntImportStringCaller( g_camwindow_globals_private.m_nMoveSpeed ), IntExportStringCaller( g_camwindow_globals_private.m_nMoveSpeed ) );
void realise(){
if ( --m_unrealised == 0 ) {
globalOutputStream() << "searching vfs directory " << makeQuoted( "def" ) << " for *.def\n";
- GlobalFileSystem().forEachFile( "def/", "def", FreeCaller<void(const char*), EntityClassDoom3_loadFile>() );
+ GlobalFileSystem().forEachFile( "def/", "def", makeCallbackF(EntityClassDoom3_loadFile) );
{
for ( Models::iterator i = g_models.begin(); i != g_models.end(); ++i )
Entity_constructPreferences( page );
}
void Entity_registerPreferencesPage(){
- PreferencesDialog_addDisplayPage( FreeCaller<void(PreferenceGroup&), Entity_constructPage>() );
+ PreferencesDialog_addDisplayPage( makeCallbackF(Entity_constructPage) );
}
#include "stringio.h"
void Entity_Construct(){
- GlobalCommands_insert( "EntityColor", FreeCaller<void(), Entity_setColour>(), Accelerator( 'K' ) );
- GlobalCommands_insert( "NormalizeColor", FreeCaller<void(), Entity_normalizeColor>() );
- GlobalCommands_insert( "ConnectSelection", FreeCaller<void(), Entity_connectSelected>(), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "KillConnectSelection", FreeCaller<void(), Entity_killconnectSelected>(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) );
- GlobalCommands_insert( "GroupSelection", FreeCaller<void(), Entity_groupSelected>() );
- GlobalCommands_insert( "UngroupSelection", FreeCaller<void(), Entity_ungroupSelected>() );
+ GlobalCommands_insert( "EntityColor", makeCallbackF(Entity_setColour), Accelerator( 'K' ) );
+ GlobalCommands_insert( "NormalizeColor", makeCallbackF(Entity_normalizeColor) );
+ GlobalCommands_insert( "ConnectSelection", makeCallbackF(Entity_connectSelected), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "KillConnectSelection", makeCallbackF(Entity_killconnectSelected), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) );
+ GlobalCommands_insert( "GroupSelection", makeCallbackF(Entity_groupSelected) );
+ GlobalCommands_insert( "UngroupSelection", makeCallbackF(Entity_ungroupSelected) );
GlobalPreferenceSystem().registerPreference( "SI_Colors5", Vector3ImportStringCaller( g_entity_globals.color_entity ), Vector3ExportStringCaller( g_entity_globals.color_entity ) );
GlobalPreferenceSystem().registerPreference( "LastLightIntensity", IntImportStringCaller( g_iLastLightIntensity ), IntExportStringCaller( g_iLastLightIntensity ) );
{
IdleDraw m_idleDraw;
public:
-EntityInspectorDraw() : m_idleDraw( FreeCaller<void(), EntityInspector_updateKeyValues>( ) ){
+EntityInspectorDraw() : m_idleDraw( makeCallbackF(EntityInspector_updateKeyValues) ){
}
void queueDraw(){
m_idleDraw.queueDraw();
void ConstructFilters(){
GlobalPreferenceSystem().registerPreference( "SI_Exclude", SizeImportStringCaller( g_filters_globals.exclude ), SizeExportStringCaller( g_filters_globals.exclude ) );
- GlobalCommands_insert( "InvertFilters", FreeCaller<void(), InvertFilters>() );
- GlobalCommands_insert( "ResetFilters", FreeCaller<void(), ResetFilters>() );
+ GlobalCommands_insert( "InvertFilters", makeCallbackF(InvertFilters) );
+ GlobalCommands_insert( "ResetFilters", makeCallbackF(ResetFilters) );
add_filter_command( EXCLUDE_WORLD, "FilterWorldBrushes", Accelerator( '1', (GdkModifierType)GDK_MOD1_MASK ) );
add_filter_command( EXCLUDE_ENT, "FilterEntities", Accelerator( '2', (GdkModifierType)GDK_MOD1_MASK ) );
}
void Grid_registerCommands(){
- GlobalCommands_insert( "GridDown", FreeCaller<void(), GridPrev>(), Accelerator( '[' ) );
- GlobalCommands_insert( "GridUp", FreeCaller<void(), GridNext>(), Accelerator( ']' ) );
+ GlobalCommands_insert( "GridDown", makeCallbackF(GridPrev), Accelerator( '[' ) );
+ GlobalCommands_insert( "GridUp", makeCallbackF(GridNext), Accelerator( ']' ) );
- GlobalCommands_insert( "ToggleGridSnap", FreeCaller<void(), ToggleGridSnap>() );
+ GlobalCommands_insert( "ToggleGridSnap", makeCallbackF(ToggleGridSnap) );
GlobalToggles_insert( "SetGrid0.125", GridMenuItem::SetCaller( g_gridMenu0125 ), ToggleItem::AddCallbackCaller( g_gridMenu0125.m_item ) );
GlobalToggles_insert( "SetGrid0.25", GridMenuItem::SetCaller( g_gridMenu025 ), ToggleItem::AddCallbackCaller( g_gridMenu025.m_item ) );
Grid_constructPreferences( page );
}
void Grid_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Grid_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(Grid_constructPage) );
}
void Grid_construct(){
void GroupDialog_Construct(){
GlobalPreferenceSystem().registerPreference( "EntityWnd", WindowPositionTrackerImportStringCaller( g_GroupDlg.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_GroupDlg.m_position_tracker ) );
- GlobalCommands_insert( "ViewEntityInfo", FreeCaller<void(), GroupDialog_ToggleShow>(), Accelerator( 'N' ) );
+ GlobalCommands_insert( "ViewEntityInfo", makeCallbackF(GroupDialog_ToggleShow), Accelerator( 'N' ) );
}
void GroupDialog_Destroy(){
}
Paths_constructPreferences( page );
}
void Paths_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Paths_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(Paths_constructPage) );
}
}
#if 0
- create_menu_item_with_mnemonic( menu, "_Benchmark", FreeCaller<void(), GlobalCamera_Benchmark>() );
+ create_menu_item_with_mnemonic( menu, "_Benchmark", makeCallbackF(GlobalCamera_Benchmark) );
#endif
menu.add(create_colours_menu());
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<void(), WXY_Print>());
- create_menu_item_with_mnemonic( menu, "_Background select", FreeCaller<void(), WXY_BackgroundSelect>() );
+ create_menu_item_with_mnemonic( menu, "_Background select", makeCallbackF(WXY_BackgroundSelect) );
return misc_menu_item;
}
// it will take care of hooking the Sys_OpenURL calls etc.
create_game_help_menu( menu );
- create_menu_item_with_mnemonic( menu, "Bug report", FreeCaller<void(), OpenBugReportURL>() );
- create_menu_item_with_mnemonic( menu, "Shortcuts list", FreeCaller<void(), DoCommandListDlg>() );
- create_menu_item_with_mnemonic( menu, "_About", FreeCaller<void(), DoAbout>() );
+ create_menu_item_with_mnemonic( menu, "Bug report", makeCallbackF(OpenBugReportURL) );
+ create_menu_item_with_mnemonic( menu, "Shortcuts list", makeCallbackF(DoCommandListDlg) );
+ create_menu_item_with_mnemonic( menu, "_About", makeCallbackF(DoAbout) );
return help_menu_item;
}
}
void Layout_registerPreferencesPage(){
- PreferencesDialog_addInterfacePage( FreeCaller<void(PreferenceGroup&), Layout_constructPage>() );
+ PreferencesDialog_addInterfacePage( makeCallbackF(Layout_constructPage) );
}
#include "stringio.h"
void MainFrame_Construct(){
- GlobalCommands_insert( "OpenManual", FreeCaller<void(), OpenHelpURL>(), Accelerator( GDK_KEY_F1 ) );
-
- GlobalCommands_insert( "Sleep", FreeCaller<void(), thunk_OnSleep>(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "NewMap", FreeCaller<void(), NewMap>() );
- GlobalCommands_insert( "OpenMap", FreeCaller<void(), OpenMap>(), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "ImportMap", FreeCaller<void(), ImportMap>() );
- GlobalCommands_insert( "SaveMap", FreeCaller<void(), SaveMap>(), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "SaveMapAs", FreeCaller<void(), SaveMapAs>() );
- GlobalCommands_insert( "ExportSelected", FreeCaller<void(), ExportMap>() );
- GlobalCommands_insert( "SaveRegion", FreeCaller<void(), SaveRegion>() );
- GlobalCommands_insert( "RefreshReferences", FreeCaller<void(), VFS_Refresh>() );
- GlobalCommands_insert( "ProjectSettings", FreeCaller<void(), DoProjectSettings>() );
- GlobalCommands_insert( "Exit", FreeCaller<void(), Exit>() );
-
- GlobalCommands_insert( "Undo", FreeCaller<void(), Undo>(), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "Redo", FreeCaller<void(), Redo>(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "Copy", FreeCaller<void(), Copy>(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "Paste", FreeCaller<void(), Paste>(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PasteToCamera", FreeCaller<void(), PasteToCamera>(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "CloneSelection", FreeCaller<void(), Selection_Clone>(), Accelerator( GDK_KEY_space ) );
- GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<void(), Selection_Clone_MakeUnique>(), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "DeleteSelection", FreeCaller<void(), deleteSelection>(), Accelerator( GDK_KEY_BackSpace ) );
- GlobalCommands_insert( "ParentSelection", FreeCaller<void(), Scene_parentSelected>() );
- GlobalCommands_insert( "UnSelectSelection", FreeCaller<void(), Selection_Deselect>(), Accelerator( GDK_KEY_Escape ) );
- GlobalCommands_insert( "InvertSelection", FreeCaller<void(), Select_Invert>(), Accelerator( 'I' ) );
- GlobalCommands_insert( "SelectInside", FreeCaller<void(), Select_Inside>() );
- GlobalCommands_insert( "SelectTouching", FreeCaller<void(), Select_Touching>() );
- GlobalCommands_insert( "ExpandSelectionToEntities", FreeCaller<void(), Scene_ExpandSelectionToEntities>(), Accelerator( 'E', (GdkModifierType)( GDK_MOD1_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "Preferences", FreeCaller<void(), PreferencesDialog_showDialog>(), Accelerator( 'P' ) );
-
- GlobalCommands_insert( "ToggleConsole", FreeCaller<void(), Console_ToggleShow>(), Accelerator( 'O' ) );
- GlobalCommands_insert( "ToggleEntityInspector", FreeCaller<void(), EntityInspector_ToggleShow>(), Accelerator( 'N' ) );
- GlobalCommands_insert( "EntityList", FreeCaller<void(), EntityList_toggleShown>(), Accelerator( 'L' ) );
-
- GlobalCommands_insert( "ShowHidden", FreeCaller<void(), Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "HideSelected", FreeCaller<void(), HideSelected>(), Accelerator( 'H' ) );
-
- GlobalToggles_insert( "DragVertices", FreeCaller<void(), SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
- GlobalToggles_insert( "DragEdges", FreeCaller<void(), SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
- GlobalToggles_insert( "DragFaces", FreeCaller<void(), SelectFaceMode>(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
-
- GlobalCommands_insert( "MirrorSelectionX", FreeCaller<void(), Selection_Flipx>() );
- GlobalCommands_insert( "RotateSelectionX", FreeCaller<void(), Selection_Rotatex>() );
- GlobalCommands_insert( "MirrorSelectionY", FreeCaller<void(), Selection_Flipy>() );
- GlobalCommands_insert( "RotateSelectionY", FreeCaller<void(), Selection_Rotatey>() );
- GlobalCommands_insert( "MirrorSelectionZ", FreeCaller<void(), Selection_Flipz>() );
- GlobalCommands_insert( "RotateSelectionZ", FreeCaller<void(), Selection_Rotatez>() );
-
- GlobalCommands_insert( "ArbitraryRotation", FreeCaller<void(), DoRotateDlg>() );
- GlobalCommands_insert( "ArbitraryScale", FreeCaller<void(), DoScaleDlg>() );
-
- GlobalCommands_insert( "BuildMenuCustomize", FreeCaller<void(), DoBuildMenu>() );
-
- GlobalCommands_insert( "FindBrush", FreeCaller<void(), DoFind>() );
-
- GlobalCommands_insert( "MapInfo", FreeCaller<void(), DoMapInfo>(), Accelerator( 'M' ) );
-
-
- GlobalToggles_insert( "ToggleClipper", FreeCaller<void(), ClipperMode>(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) );
-
- GlobalToggles_insert( "MouseTranslate", FreeCaller<void(), TranslateMode>(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) );
- GlobalToggles_insert( "MouseRotate", FreeCaller<void(), RotateMode>(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) );
- GlobalToggles_insert( "MouseScale", FreeCaller<void(), ScaleMode>(), ToggleItem::AddCallbackCaller( g_scalemode_button ) );
- GlobalToggles_insert( "MouseDrag", FreeCaller<void(), DragMode>(), ToggleItem::AddCallbackCaller( g_dragmode_button ), Accelerator( 'Q' ) );
-
- GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller<void(), ColorScheme_Original>() );
- GlobalCommands_insert( "ColorSchemeQER", FreeCaller<void(), ColorScheme_QER>() );
- GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller<void(), ColorScheme_Black>() );
- GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller<void(), ColorScheme_Ydnar>() );
+ GlobalCommands_insert( "OpenManual", makeCallbackF(OpenHelpURL), Accelerator( GDK_KEY_F1 ) );
+
+ GlobalCommands_insert( "Sleep", makeCallbackF(thunk_OnSleep), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "NewMap", makeCallbackF(NewMap) );
+ GlobalCommands_insert( "OpenMap", makeCallbackF(OpenMap), Accelerator( 'O', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "ImportMap", makeCallbackF(ImportMap) );
+ GlobalCommands_insert( "SaveMap", makeCallbackF(SaveMap), Accelerator( 'S', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "SaveMapAs", makeCallbackF(SaveMapAs) );
+ GlobalCommands_insert( "ExportSelected", makeCallbackF(ExportMap) );
+ GlobalCommands_insert( "SaveRegion", makeCallbackF(SaveRegion) );
+ GlobalCommands_insert( "RefreshReferences", makeCallbackF(VFS_Refresh) );
+ GlobalCommands_insert( "ProjectSettings", makeCallbackF(DoProjectSettings) );
+ GlobalCommands_insert( "Exit", makeCallbackF(Exit) );
+
+ GlobalCommands_insert( "Undo", makeCallbackF(Undo), Accelerator( 'Z', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "Redo", makeCallbackF(Redo), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "Copy", makeCallbackF(Copy), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "Paste", makeCallbackF(Paste), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PasteToCamera", makeCallbackF(PasteToCamera), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "CloneSelection", makeCallbackF(Selection_Clone), Accelerator( GDK_KEY_space ) );
+ GlobalCommands_insert( "CloneSelectionAndMakeUnique", makeCallbackF(Selection_Clone_MakeUnique), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "DeleteSelection", makeCallbackF(deleteSelection), Accelerator( GDK_KEY_BackSpace ) );
+ GlobalCommands_insert( "ParentSelection", makeCallbackF(Scene_parentSelected) );
+ GlobalCommands_insert( "UnSelectSelection", makeCallbackF(Selection_Deselect), Accelerator( GDK_KEY_Escape ) );
+ GlobalCommands_insert( "InvertSelection", makeCallbackF(Select_Invert), Accelerator( 'I' ) );
+ GlobalCommands_insert( "SelectInside", makeCallbackF(Select_Inside) );
+ GlobalCommands_insert( "SelectTouching", makeCallbackF(Select_Touching) );
+ GlobalCommands_insert( "ExpandSelectionToEntities", makeCallbackF(Scene_ExpandSelectionToEntities), Accelerator( 'E', (GdkModifierType)( GDK_MOD1_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "Preferences", makeCallbackF(PreferencesDialog_showDialog), Accelerator( 'P' ) );
+
+ GlobalCommands_insert( "ToggleConsole", makeCallbackF(Console_ToggleShow), Accelerator( 'O' ) );
+ GlobalCommands_insert( "ToggleEntityInspector", makeCallbackF(EntityInspector_ToggleShow), Accelerator( 'N' ) );
+ GlobalCommands_insert( "EntityList", makeCallbackF(EntityList_toggleShown), Accelerator( 'L' ) );
+
+ GlobalCommands_insert( "ShowHidden", makeCallbackF(Select_ShowAllHidden), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "HideSelected", makeCallbackF(HideSelected), Accelerator( 'H' ) );
+
+ GlobalToggles_insert( "DragVertices", makeCallbackF(SelectVertexMode), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
+ GlobalToggles_insert( "DragEdges", makeCallbackF(SelectEdgeMode), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
+ GlobalToggles_insert( "DragFaces", makeCallbackF(SelectFaceMode), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
+
+ GlobalCommands_insert( "MirrorSelectionX", makeCallbackF(Selection_Flipx) );
+ GlobalCommands_insert( "RotateSelectionX", makeCallbackF(Selection_Rotatex) );
+ GlobalCommands_insert( "MirrorSelectionY", makeCallbackF(Selection_Flipy) );
+ GlobalCommands_insert( "RotateSelectionY", makeCallbackF(Selection_Rotatey) );
+ GlobalCommands_insert( "MirrorSelectionZ", makeCallbackF(Selection_Flipz) );
+ GlobalCommands_insert( "RotateSelectionZ", makeCallbackF(Selection_Rotatez) );
+
+ GlobalCommands_insert( "ArbitraryRotation", makeCallbackF(DoRotateDlg) );
+ GlobalCommands_insert( "ArbitraryScale", makeCallbackF(DoScaleDlg) );
+
+ GlobalCommands_insert( "BuildMenuCustomize", makeCallbackF(DoBuildMenu) );
+
+ GlobalCommands_insert( "FindBrush", makeCallbackF(DoFind) );
+
+ GlobalCommands_insert( "MapInfo", makeCallbackF(DoMapInfo), Accelerator( 'M' ) );
+
+
+ GlobalToggles_insert( "ToggleClipper", makeCallbackF(ClipperMode), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) );
+
+ GlobalToggles_insert( "MouseTranslate", makeCallbackF(TranslateMode), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) );
+ GlobalToggles_insert( "MouseRotate", makeCallbackF(RotateMode), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) );
+ GlobalToggles_insert( "MouseScale", makeCallbackF(ScaleMode), ToggleItem::AddCallbackCaller( g_scalemode_button ) );
+ GlobalToggles_insert( "MouseDrag", makeCallbackF(DragMode), ToggleItem::AddCallbackCaller( g_dragmode_button ), Accelerator( 'Q' ) );
+
+ GlobalCommands_insert( "ColorSchemeOriginal", makeCallbackF(ColorScheme_Original) );
+ GlobalCommands_insert( "ColorSchemeQER", makeCallbackF(ColorScheme_QER) );
+ GlobalCommands_insert( "ColorSchemeBlackAndGreen", makeCallbackF(ColorScheme_Black) );
+ GlobalCommands_insert( "ColorSchemeYdnar", makeCallbackF(ColorScheme_Ydnar) );
GlobalCommands_insert( "ChooseTextureBackgroundColor", makeCallback( g_ColoursMenu.m_textureback ) );
GlobalCommands_insert( "ChooseGridBackgroundColor", makeCallback( g_ColoursMenu.m_xyback ) );
GlobalCommands_insert( "ChooseGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor ) );
GlobalCommands_insert( "ChooseOrthoViewNameColor", makeCallback( g_ColoursMenu.m_viewname ) );
- GlobalCommands_insert( "CSGSubtract", FreeCaller<void(), CSG_Subtract>(), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "CSGMerge", FreeCaller<void(), CSG_Merge>(), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CSGHollow", FreeCaller<void(), CSG_MakeHollow>() );
+ GlobalCommands_insert( "CSGSubtract", makeCallbackF(CSG_Subtract), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CSGMerge", makeCallbackF(CSG_Merge), Accelerator( 'U', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CSGHollow", makeCallbackF(CSG_MakeHollow) );
Grid_registerCommands();
- GlobalCommands_insert( "SnapToGrid", FreeCaller<void(), Selection_SnapToGrid>(), Accelerator( 'G', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "SnapToGrid", makeCallbackF(Selection_SnapToGrid), Accelerator( 'G', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "SelectAllOfType", FreeCaller<void(), Select_AllOfType>(), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "SelectAllOfType", makeCallbackF(Select_AllOfType), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexRotateClock", FreeCaller<void(), Texdef_RotateClockwise>(), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexRotateCounter", FreeCaller<void(), Texdef_RotateAntiClockwise>(), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexScaleUp", FreeCaller<void(), Texdef_ScaleUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexScaleDown", FreeCaller<void(), Texdef_ScaleDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexScaleLeft", FreeCaller<void(), Texdef_ScaleLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexScaleRight", FreeCaller<void(), Texdef_ScaleRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "TexShiftUp", FreeCaller<void(), Texdef_ShiftUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexShiftDown", FreeCaller<void(), Texdef_ShiftDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexShiftLeft", FreeCaller<void(), Texdef_ShiftLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "TexShiftRight", FreeCaller<void(), Texdef_ShiftRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexRotateClock", makeCallbackF(Texdef_RotateClockwise), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexRotateCounter", makeCallbackF(Texdef_RotateAntiClockwise), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexScaleUp", makeCallbackF(Texdef_ScaleUp), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexScaleDown", makeCallbackF(Texdef_ScaleDown), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexScaleLeft", makeCallbackF(Texdef_ScaleLeft), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexScaleRight", makeCallbackF(Texdef_ScaleRight), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "TexShiftUp", makeCallbackF(Texdef_ShiftUp), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexShiftDown", makeCallbackF(Texdef_ShiftDown), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexShiftLeft", makeCallbackF(Texdef_ShiftLeft), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "TexShiftRight", makeCallbackF(Texdef_ShiftRight), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller<void(), Selection_MoveDown>(), Accelerator( GDK_KEY_KP_Subtract ) );
- GlobalCommands_insert( "MoveSelectionUP", FreeCaller<void(), Selection_MoveUp>(), Accelerator( GDK_KEY_KP_Add ) );
+ GlobalCommands_insert( "MoveSelectionDOWN", makeCallbackF(Selection_MoveDown), Accelerator( GDK_KEY_KP_Subtract ) );
+ GlobalCommands_insert( "MoveSelectionUP", makeCallbackF(Selection_MoveUp), Accelerator( GDK_KEY_KP_Add ) );
- GlobalCommands_insert( "SelectNudgeLeft", FreeCaller<void(), Selection_NudgeLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "SelectNudgeRight", FreeCaller<void(), Selection_NudgeRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "SelectNudgeUp", FreeCaller<void(), Selection_NudgeUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) );
- GlobalCommands_insert( "SelectNudgeDown", FreeCaller<void(), Selection_NudgeDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeLeft", makeCallbackF(Selection_NudgeLeft), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeRight", makeCallbackF(Selection_NudgeRight), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeUp", makeCallbackF(Selection_NudgeUp), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) );
+ GlobalCommands_insert( "SelectNudgeDown", makeCallbackF(Selection_NudgeDown), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) );
Patch_registerCommands();
XYShow_registerCommands();
Layout_registerPreferencesPage();
Paths_registerPreferencesPage();
- g_brushCount.setCountChangedCallback( FreeCaller<void(), QE_brushCountChanged>() );
- g_entityCount.setCountChangedCallback( FreeCaller<void(), QE_entityCountChanged>() );
+ g_brushCount.setCountChangedCallback( makeCallbackF(QE_brushCountChanged) );
+ g_entityCount.setCountChangedCallback( makeCallbackF(QE_entityCountChanged) );
GlobalEntityCreator().setCounter( &g_entityCount );
GLWidget_sharedContextCreated = GlobalGL_sharedContextCreated;
bool g_bLoadLastMap = false;
void Map_Construct(){
- GlobalCommands_insert( "RegionOff", FreeCaller<void(), RegionOff>() );
- GlobalCommands_insert( "RegionSetXY", FreeCaller<void(), RegionXY>() );
- GlobalCommands_insert( "RegionSetBrush", FreeCaller<void(), RegionBrush>() );
- GlobalCommands_insert( "RegionSetSelection", FreeCaller<void(), RegionSelected>(), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "RegionOff", makeCallbackF(RegionOff) );
+ GlobalCommands_insert( "RegionSetXY", makeCallbackF(RegionXY) );
+ GlobalCommands_insert( "RegionSetBrush", makeCallbackF(RegionBrush) );
+ GlobalCommands_insert( "RegionSetSelection", makeCallbackF(RegionSelected), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalPreferenceSystem().registerPreference( "LastMap", CopiedStringImportStringCaller( g_strLastMap ), CopiedStringExportStringCaller( g_strLastMap ) );
GlobalPreferenceSystem().registerPreference( "LoadLastMap", BoolImportStringCaller( g_bLoadLastMap ), BoolExportStringCaller( g_bLoadLastMap ) );
GlobalPreferenceSystem().registerPreference( "MapInfoDlg", WindowPositionImportStringCaller( g_posMapInfoWnd ), WindowPositionExportStringCaller( g_posMapInfoWnd ) );
- PreferencesDialog_addSettingsPreferences( FreeCaller<void(PreferencesPage&), Map_constructPreferences>() );
+ PreferencesDialog_addSettingsPreferences( makeCallbackF(Map_constructPreferences) );
GlobalEntityClassManager().attach( g_MapEntityClasses );
Radiant_attachHomePathsObserver( g_MapModuleObserver );
g_Multimon_enableSysMenuPopups.useLatched();
- PreferencesDialog_addInterfacePreferences( FreeCaller<void(PreferencesPage&), MultiMonitor_constructPreferences>() );
+ PreferencesDialog_addInterfacePreferences( makeCallbackF(MultiMonitor_constructPreferences) );
}
void MultiMon_Destroy(){
}
void PatchInspector_Construct(){
- GlobalCommands_insert( "PatchInspector", FreeCaller<void(), PatchInspector_toggleShown>(), Accelerator( 'S', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "PatchInspector", makeCallbackF(PatchInspector_toggleShown), Accelerator( 'S', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalPreferenceSystem().registerPreference( "PatchWnd", WindowPositionTrackerImportStringCaller( g_PatchInspector.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_PatchInspector.m_position_tracker ) );
GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Scale1", FloatImportStringCaller( g_pi_globals.scale[0] ), FloatExportStringCaller( g_pi_globals.scale[0] ) );
Patch_constructPreferences( page );
}
void Patch_registerPreferencesPage(){
- PreferencesDialog_addDisplayPage( FreeCaller<void(PreferenceGroup&), Patch_constructPage>() );
+ PreferencesDialog_addDisplayPage( makeCallbackF(Patch_constructPage) );
}
#include "generic/callback.h"
void Patch_registerCommands(){
- GlobalCommands_insert( "InvertCurveTextureX", FreeCaller<void(), Patch_FlipTextureX>(), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "InvertCurveTextureY", FreeCaller<void(), Patch_FlipTextureY>(), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "NaturalizePatch", FreeCaller<void(), Patch_NaturalTexture>(), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PatchCylinder", FreeCaller<void(), Patch_Cylinder>() );
- GlobalCommands_insert( "PatchDenseCylinder", FreeCaller<void(), Patch_DenseCylinder>() );
- GlobalCommands_insert( "PatchVeryDenseCylinder", FreeCaller<void(), Patch_VeryDenseCylinder>() );
- GlobalCommands_insert( "PatchSquareCylinder", FreeCaller<void(), Patch_SquareCylinder>() );
- GlobalCommands_insert( "PatchXactCylinder", FreeCaller<void(), Patch_XactCylinder>() );
- GlobalCommands_insert( "PatchXactSphere", FreeCaller<void(), Patch_XactSphere>() );
- GlobalCommands_insert( "PatchXactCone", FreeCaller<void(), Patch_XactCone>() );
- GlobalCommands_insert( "PatchEndCap", FreeCaller<void(), Patch_Endcap>() );
- GlobalCommands_insert( "PatchBevel", FreeCaller<void(), Patch_Bevel>() );
- GlobalCommands_insert( "PatchSquareBevel", FreeCaller<void(), Patch_SquareBevel>() );
- GlobalCommands_insert( "PatchSquareEndcap", FreeCaller<void(), Patch_SquareEndcap>() );
- GlobalCommands_insert( "PatchCone", FreeCaller<void(), Patch_Cone>() );
- GlobalCommands_insert( "PatchSphere", FreeCaller<void(), Patch_Sphere>() );
- GlobalCommands_insert( "SimplePatchMesh", FreeCaller<void(), Patch_Plane>(), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller<void(), Patch_InsertInsertColumn>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "PatchInsertAddColumn", FreeCaller<void(), Patch_InsertAddColumn>() );
- GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller<void(), Patch_InsertInsertRow>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PatchInsertAddRow", FreeCaller<void(), Patch_InsertAddRow>() );
- GlobalCommands_insert( "PatchDeleteFirstColumn", FreeCaller<void(), Patch_DeleteFirstColumn>() );
- GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller<void(), Patch_DeleteLastColumn>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller<void(), Patch_DeleteFirstRow>(), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "PatchDeleteLastRow", FreeCaller<void(), Patch_DeleteLastRow>() );
- GlobalCommands_insert( "InvertCurve", FreeCaller<void(), Patch_Invert>(), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "RedisperseRows", FreeCaller<void(), Patch_RedisperseRows>(), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "RedisperseCols", FreeCaller<void(), Patch_RedisperseCols>(), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "SmoothRows", FreeCaller<void(), Patch_SmoothRows>(), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "SmoothCols", FreeCaller<void(), Patch_SmoothCols>(), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "MatrixTranspose", FreeCaller<void(), Patch_Transpose>(), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "CapCurrentCurve", FreeCaller<void(), Patch_Cap>(), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "CycleCapTexturePatch", FreeCaller<void(), Patch_CycleProjection>(), Accelerator( 'N', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "MakeOverlayPatch", FreeCaller<void(), Patch_OverlayOn>(), Accelerator( 'Y' ) );
- GlobalCommands_insert( "ClearPatchOverlays", FreeCaller<void(), Patch_OverlayOff>(), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "InvertCurveTextureX", makeCallbackF(Patch_FlipTextureX), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "InvertCurveTextureY", makeCallbackF(Patch_FlipTextureY), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "NaturalizePatch", makeCallbackF(Patch_NaturalTexture), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PatchCylinder", makeCallbackF(Patch_Cylinder) );
+ GlobalCommands_insert( "PatchDenseCylinder", makeCallbackF(Patch_DenseCylinder) );
+ GlobalCommands_insert( "PatchVeryDenseCylinder", makeCallbackF(Patch_VeryDenseCylinder) );
+ GlobalCommands_insert( "PatchSquareCylinder", makeCallbackF(Patch_SquareCylinder) );
+ GlobalCommands_insert( "PatchXactCylinder", makeCallbackF(Patch_XactCylinder) );
+ GlobalCommands_insert( "PatchXactSphere", makeCallbackF(Patch_XactSphere) );
+ GlobalCommands_insert( "PatchXactCone", makeCallbackF(Patch_XactCone) );
+ GlobalCommands_insert( "PatchEndCap", makeCallbackF(Patch_Endcap) );
+ GlobalCommands_insert( "PatchBevel", makeCallbackF(Patch_Bevel) );
+ GlobalCommands_insert( "PatchSquareBevel", makeCallbackF(Patch_SquareBevel) );
+ GlobalCommands_insert( "PatchSquareEndcap", makeCallbackF(Patch_SquareEndcap) );
+ GlobalCommands_insert( "PatchCone", makeCallbackF(Patch_Cone) );
+ GlobalCommands_insert( "PatchSphere", makeCallbackF(Patch_Sphere) );
+ GlobalCommands_insert( "SimplePatchMesh", makeCallbackF(Patch_Plane), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "PatchInsertInsertColumn", makeCallbackF(Patch_InsertInsertColumn), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "PatchInsertAddColumn", makeCallbackF(Patch_InsertAddColumn) );
+ GlobalCommands_insert( "PatchInsertInsertRow", makeCallbackF(Patch_InsertInsertRow), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PatchInsertAddRow", makeCallbackF(Patch_InsertAddRow) );
+ GlobalCommands_insert( "PatchDeleteFirstColumn", makeCallbackF(Patch_DeleteFirstColumn) );
+ GlobalCommands_insert( "PatchDeleteLastColumn", makeCallbackF(Patch_DeleteLastColumn), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "PatchDeleteFirstRow", makeCallbackF(Patch_DeleteFirstRow), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "PatchDeleteLastRow", makeCallbackF(Patch_DeleteLastRow) );
+ GlobalCommands_insert( "InvertCurve", makeCallbackF(Patch_Invert), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "RedisperseRows", makeCallbackF(Patch_RedisperseRows), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "RedisperseCols", makeCallbackF(Patch_RedisperseCols), Accelerator( 'E', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "SmoothRows", makeCallbackF(Patch_SmoothRows), Accelerator( 'W', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "SmoothCols", makeCallbackF(Patch_SmoothCols), Accelerator( 'W', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "MatrixTranspose", makeCallbackF(Patch_Transpose), Accelerator( 'M', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "CapCurrentCurve", makeCallbackF(Patch_Cap), Accelerator( 'C', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CycleCapTexturePatch", makeCallbackF(Patch_CycleProjection), Accelerator( 'N', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "MakeOverlayPatch", makeCallbackF(Patch_OverlayOn), Accelerator( 'Y' ) );
+ GlobalCommands_insert( "ClearPatchOverlays", makeCallbackF(Patch_OverlayOff), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) );
}
void Patch_constructToolbar( ui::Toolbar toolbar ){
//TODO: some modules/plugins do not yet support refresh
#if 0
- create_menu_item_with_mnemonic( menu, "Refresh", FreeCaller<void(), Restart>() );
+ create_menu_item_with_mnemonic( menu, "Refresh", makeCallbackF(Restart) );
// NOTE: the seperator is used when doing a refresh of the list, everything past the seperator is removed
g_plugins_menu_separator = menu_separator( menu );
GlobalShaderCache().attachRenderable( s_pointfile );
- GlobalCommands_insert( "TogglePointfile", FreeCaller<void(), Pointfile_Toggle>() );
- GlobalCommands_insert( "NextLeakSpot", FreeCaller<void(), Pointfile_Next>(), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "PrevLeakSpot", FreeCaller<void(), Pointfile_Prev>(), Accelerator( 'L', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "TogglePointfile", makeCallbackF(Pointfile_Toggle) );
+ GlobalCommands_insert( "NextLeakSpot", makeCallbackF(Pointfile_Next), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "PrevLeakSpot", makeCallbackF(Pointfile_Prev), Accelerator( 'L', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
}
void Pointfile_Destroy(){
Mouse_constructPreferences( page );
}
void Mouse_registerPreferencesPage(){
- PreferencesDialog_addInterfacePage( FreeCaller<void(PreferenceGroup&), Mouse_constructPage>() );
+ PreferencesDialog_addInterfacePage( makeCallbackF(Mouse_constructPage) );
}
};
ui::Window PrefsDlg::BuildDialog(){
- PreferencesDialog_addInterfacePreferences( FreeCaller<void(PreferencesPage&), Interface_constructPreferences>() );
+ PreferencesDialog_addInterfacePreferences( makeCallbackF(Interface_constructPreferences) );
Mouse_registerPreferencesPage();
ui::Window dialog = ui::Window(create_floating_window( "NetRadiant Preferences", m_parent ));
void connectMap(){
MapFile* map = Node_getMapFile( m_model );
if ( map != 0 ) {
- map->setChangedCallback( FreeCaller<void(), MapChanged>() );
+ map->setChangedCallback( makeCallbackF(MapChanged) );
}
}
std::time_t modified() const {
SurfaceInspector_constructPreferences( page );
}
void SurfaceInspector_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), SurfaceInspector_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(SurfaceInspector_constructPage) );
}
void SurfaceInspector_registerCommands(){
- GlobalCommands_insert( "FitTexture", FreeCaller<void(), SurfaceInspector_FitTexture>(), Accelerator( 'B', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "SurfaceInspector", FreeCaller<void(), SurfaceInspector_toggleShown>(), Accelerator( 'S' ) );
+ GlobalCommands_insert( "FitTexture", makeCallbackF(SurfaceInspector_FitTexture), Accelerator( 'B', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "SurfaceInspector", makeCallbackF(SurfaceInspector_toggleShown), Accelerator( 'S' ) );
- GlobalCommands_insert( "FaceCopyTexture", FreeCaller<void(), SelectedFaces_copyTexture>() );
- GlobalCommands_insert( "FacePasteTexture", FreeCaller<void(), SelectedFaces_pasteTexture>() );
+ GlobalCommands_insert( "FaceCopyTexture", makeCallbackF(SelectedFaces_copyTexture) );
+ GlobalCommands_insert( "FacePasteTexture", makeCallbackF(SelectedFaces_pasteTexture) );
}
Textures_constructPreferences( page );
}
void Textures_registerPreferencesPage(){
- PreferencesDialog_addDisplayPage( FreeCaller<void(PreferenceGroup&), Textures_constructPage>() );
+ PreferencesDialog_addDisplayPage( makeCallbackF(Textures_constructPage) );
}
void TextureCompression_importString( const char* string ){
TextureBrowser_constructPreferences( page );
}
void TextureBrowser_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), TextureBrowser_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(TextureBrowser_constructPage) );
}
void TextureClipboard_textureSelected( const char* shader );
void TextureBrowser_Construct(){
- GlobalCommands_insert( "ShaderInfo", FreeCaller<void(), TextureBrowser_shaderInfo>() );
- GlobalCommands_insert( "ShowUntagged", FreeCaller<void(), TextureBrowser_showUntagged>() );
- GlobalCommands_insert( "AddTag", FreeCaller<void(), TextureBrowser_addTag>() );
- GlobalCommands_insert( "RenameTag", FreeCaller<void(), TextureBrowser_renameTag>() );
- GlobalCommands_insert( "DeleteTag", FreeCaller<void(), TextureBrowser_deleteTag>() );
- GlobalCommands_insert( "CopyTag", FreeCaller<void(), TextureBrowser_copyTag>() );
- GlobalCommands_insert( "PasteTag", FreeCaller<void(), TextureBrowser_pasteTag>() );
- GlobalCommands_insert( "RefreshShaders", FreeCaller<void(), VFS_Refresh>() );
- GlobalToggles_insert( "ShowInUse", FreeCaller<void(), TextureBrowser_ToggleHideUnused>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
- GlobalCommands_insert( "ShowAllTextures", FreeCaller<void(), TextureBrowser_showAll>(), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "ToggleTextures", FreeCaller<void(), TextureBrowser_toggleShow>(), Accelerator( 'T' ) );
- GlobalToggles_insert( "ToggleShowShaders", FreeCaller<void(), TextureBrowser_ToggleShowShaders>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
- GlobalToggles_insert( "ToggleShowShaderlistOnly", FreeCaller<void(), TextureBrowser_ToggleShowShaderListOnly>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
- GlobalToggles_insert( "FixedSize", FreeCaller<void(), TextureBrowser_FixedSize>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
- GlobalToggles_insert( "FilterMissing", FreeCaller<void(), TextureBrowser_FilterMissing>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
- GlobalToggles_insert( "FilterFallback", FreeCaller<void(), TextureBrowser_FilterFallback>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) );
- GlobalToggles_insert( "EnableAlpha", FreeCaller<void(), TextureBrowser_EnableAlpha>(), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
+ GlobalCommands_insert( "ShaderInfo", makeCallbackF(TextureBrowser_shaderInfo) );
+ GlobalCommands_insert( "ShowUntagged", makeCallbackF(TextureBrowser_showUntagged) );
+ GlobalCommands_insert( "AddTag", makeCallbackF(TextureBrowser_addTag) );
+ GlobalCommands_insert( "RenameTag", makeCallbackF(TextureBrowser_renameTag) );
+ GlobalCommands_insert( "DeleteTag", makeCallbackF(TextureBrowser_deleteTag) );
+ GlobalCommands_insert( "CopyTag", makeCallbackF(TextureBrowser_copyTag) );
+ GlobalCommands_insert( "PasteTag", makeCallbackF(TextureBrowser_pasteTag) );
+ GlobalCommands_insert( "RefreshShaders", makeCallbackF(VFS_Refresh) );
+ GlobalToggles_insert( "ShowInUse", makeCallbackF(TextureBrowser_ToggleHideUnused), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hideunused_item ), Accelerator( 'U' ) );
+ GlobalCommands_insert( "ShowAllTextures", makeCallbackF(TextureBrowser_showAll), Accelerator( 'A', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "ToggleTextures", makeCallbackF(TextureBrowser_toggleShow), Accelerator( 'T' ) );
+ GlobalToggles_insert( "ToggleShowShaders", makeCallbackF(TextureBrowser_ToggleShowShaders), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaders_item ) );
+ GlobalToggles_insert( "ToggleShowShaderlistOnly", makeCallbackF(TextureBrowser_ToggleShowShaderListOnly), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_showshaderlistonly_item ) );
+ GlobalToggles_insert( "FixedSize", makeCallbackF(TextureBrowser_FixedSize), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_fixedsize_item ) );
+ GlobalToggles_insert( "FilterMissing", makeCallbackF(TextureBrowser_FilterMissing), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_filternotex_item ) );
+ GlobalToggles_insert( "FilterFallback", makeCallbackF(TextureBrowser_FilterFallback), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_hidenotex_item ) );
+ GlobalToggles_insert( "EnableAlpha", makeCallbackF(TextureBrowser_EnableAlpha), ToggleItem::AddCallbackCaller( g_TextureBrowser.m_enablealpha_item ) );
GlobalPreferenceSystem().registerPreference( "TextureScale",
makeSizeStringImportCallback( TextureBrowserSetScaleCaller( g_TextureBrowser ) ),
Build_constructPreferences( page );
}
void Build_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Build_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(Build_constructPage) );
}
#include "preferencesystem.h"
Orthographic_constructPreferences( page );
}
void Orthographic_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Orthographic_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(Orthographic_constructPage) );
}
void Clipper_constructPreferences( PreferencesPage& page ){
Clipper_constructPreferences( page );
}
void Clipper_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), Clipper_constructPage>() );
+ PreferencesDialog_addSettingsPage( makeCallbackF(Clipper_constructPage) );
}
void XYWindow_Construct(){
- GlobalCommands_insert( "ToggleCrosshairs", FreeCaller<void(), ToggleShowCrosshair>(), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "ToggleSizePaint", FreeCaller<void(), ToggleShowSizeInfo>(), Accelerator( 'J' ) );
- GlobalCommands_insert( "ToggleGrid", FreeCaller<void(), ToggleShowGrid>(), Accelerator( '0' ) );
+ GlobalCommands_insert( "ToggleCrosshairs", makeCallbackF(ToggleShowCrosshair), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "ToggleSizePaint", makeCallbackF(ToggleShowSizeInfo), Accelerator( 'J' ) );
+ GlobalCommands_insert( "ToggleGrid", makeCallbackF(ToggleShowGrid), Accelerator( '0' ) );
GlobalToggles_insert( "ToggleView", ToggleShown::ToggleCaller( g_xy_top_shown ), ToggleItem::AddCallbackCaller( g_xy_top_shown.m_item ), Accelerator( 'V', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalToggles_insert( "ToggleSideView", ToggleShown::ToggleCaller( g_yz_side_shown ), ToggleItem::AddCallbackCaller( g_yz_side_shown.m_item ) );
GlobalToggles_insert( "ToggleFrontView", ToggleShown::ToggleCaller( g_xz_front_shown ), ToggleItem::AddCallbackCaller( g_xz_front_shown.m_item ) );
- GlobalCommands_insert( "NextView", FreeCaller<void(), XY_Next>(), Accelerator( GDK_KEY_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); // fixme: doesn't show its shortcut
- GlobalCommands_insert( "ZoomIn", FreeCaller<void(), XY_ZoomIn>(), Accelerator( GDK_KEY_Delete ) );
- GlobalCommands_insert( "ZoomOut", FreeCaller<void(), XY_ZoomOut>(), Accelerator( GDK_KEY_Insert ) );
- GlobalCommands_insert( "ViewTop", FreeCaller<void(), XY_Top>(), Accelerator( GDK_KEY_KP_Home ) );
- GlobalCommands_insert( "ViewSide", FreeCaller<void(), XY_Side>(), Accelerator( GDK_KEY_KP_Page_Down ) );
- GlobalCommands_insert( "ViewFront", FreeCaller<void(), XY_Front>(), Accelerator( GDK_KEY_KP_End ) );
- GlobalCommands_insert( "Zoom100", FreeCaller<void(), XY_Zoom100>() );
- GlobalCommands_insert( "CenterXYView", FreeCaller<void(), XY_Focus>(), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "NextView", makeCallbackF(XY_Next), Accelerator( GDK_KEY_Tab, (GdkModifierType)GDK_CONTROL_MASK ) ); // fixme: doesn't show its shortcut
+ GlobalCommands_insert( "ZoomIn", makeCallbackF(XY_ZoomIn), Accelerator( GDK_KEY_Delete ) );
+ GlobalCommands_insert( "ZoomOut", makeCallbackF(XY_ZoomOut), Accelerator( GDK_KEY_Insert ) );
+ GlobalCommands_insert( "ViewTop", makeCallbackF(XY_Top), Accelerator( GDK_KEY_KP_Home ) );
+ GlobalCommands_insert( "ViewSide", makeCallbackF(XY_Side), Accelerator( GDK_KEY_KP_Page_Down ) );
+ GlobalCommands_insert( "ViewFront", makeCallbackF(XY_Front), Accelerator( GDK_KEY_KP_End ) );
+ GlobalCommands_insert( "Zoom100", makeCallbackF(XY_Zoom100) );
+ GlobalCommands_insert( "CenterXYView", makeCallbackF(XY_Focus), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalPreferenceSystem().registerPreference( "ClipCaulk", BoolImportStringCaller( g_clip_useCaulk ), BoolExportStringCaller( g_clip_useCaulk ) );