namespace Shaderplug
{
-GtkWindow* g_window;
+ui::Window g_window{ui::null};
std::vector<const char*> archives;
std::set<std::string> shaders;
void CreateTagFile();
const char* init( void* hApp, void* pMainWidget ){
- g_window = GTK_WINDOW( pMainWidget );
+ g_window = ui::Window::from(pMainWidget);
return "";
}
const char* getName(){
}
void dispatch( const char* command, float* vMin, float* vMax, bool bSingleBrush ){
if ( string_equal( command, "About" ) ) {
- GlobalRadiant().m_pfnMessageBox( GTK_WIDGET( g_window ), "Shaderplug (1.0)\n\n"
+ GlobalRadiant().m_pfnMessageBox( g_window, "Shaderplug (1.0)\n\n"
"by Shaderman (shaderman@gmx.net)",
"About",
eMB_OK,
archives.push_back( filename );
}
-typedef FreeCaller1<const char*, loadArchiveFile> LoadArchiveFileCaller;
-
void LoadTextureFile( const char* filename ){
std::string s_filename = filename;
}
}
-typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
-
-void GetTextures( char* extension ){
- GlobalFileSystem().forEachFile( "textures/", extension, LoadTextureFileCaller(), 0 );
+void GetTextures( const char* extension ){
+ GlobalFileSystem().forEachFile("textures/", extension, makeCallbackF(LoadTextureFile), 0);
}
void LoadShaderList( const char* filename ){
}
}
-typedef FreeCaller1<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";
}
char message[256];
strcpy( message, "Tag file saved to\n" );
strcat( message, tagFile );
- strcat( message, "\nPlease restart Radiant now.\n" );
+ strcat( message, "\nPlease restart " RADIANT_NAME " now.\n" );
if ( file_exists( tagFile ) ) {
- EMessageBoxReturn result = GlobalRadiant().m_pfnMessageBox( GTK_WIDGET( g_window ),
+ EMessageBoxReturn result = GlobalRadiant().m_pfnMessageBox( g_window ,
"WARNING! A tag file already exists! Overwrite it?", "Overwrite tag file?",
eMB_NOYES,
eMB_ICONWARNING );
if ( result == eIDYES ) {
TagBuilder.SaveXmlDoc( tagFile );
- GlobalRadiant().m_pfnMessageBox( GTK_WIDGET( g_window ), message, "INFO", eMB_OK, eMB_ICONASTERISK );
+ GlobalRadiant().m_pfnMessageBox( g_window, message, "INFO", eMB_OK, eMB_ICONASTERISK );
}
}
else {
TagBuilder.SaveXmlDoc( tagFile );
- GlobalRadiant().m_pfnMessageBox( GTK_WIDGET( g_window ), message, "INFO", eMB_OK, eMB_ICONASTERISK );
+ GlobalRadiant().m_pfnMessageBox( g_window, message, "INFO", eMB_OK, eMB_ICONASTERISK );
}
}
else {
- GlobalRadiant().m_pfnMessageBox( GTK_WIDGET( g_window ),
+ GlobalRadiant().m_pfnMessageBox( g_window,
"No shaders or textures found. No XML tag file created!\n"
"",
"ERROR",