diff --git a/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp b/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp index a41bfe410e..1931ef007d 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp @@ -11,7 +11,7 @@ static void *Handle = NULL; static INIT Module_Init; static SHUTDOWN Module_Shutdown; static SETTEXT Module_SetText; -//static SETICON Module_SetIcon; +static SETICON Module_SetIcon; static SETSPLASH Module_SetSplash; static SETPROGRESS Module_SetProgress; static SETINDETERMINATE Module_SetIndeterminate; @@ -45,11 +45,9 @@ RString LoadingWindow_Gtk::Init() if( !Module_SetText ) return ModuleError("SetText"); - /* Module_SetIcon = (SETICON) dlsym(Handle, "SetIcon"); if( !Module_SetIcon ) return ModuleError("SetIcon"); - */ Module_SetSplash = (SETSPLASH) dlsym(Handle, "SetSplash"); if( !Module_SetSplash ) @@ -87,7 +85,7 @@ void LoadingWindow_Gtk::SetText( RString s ) void LoadingWindow_Gtk::SetIcon( const RageSurface *pIcon ) { - //Module_SetIcon( pIcon ); + Module_SetIcon( pIcon ); } void LoadingWindow_Gtk::SetSplash( const RageSurface *pSplash ) diff --git a/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp b/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp index e82d212f39..ff4da99132 100644 --- a/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp @@ -74,47 +74,30 @@ void DeletePixels( guchar *pixels, gpointer data ) GdkPixbuf *MakePixbuf( const RageSurface *pSrc ) { - RageSurface *pSurface; - if( !RageSurfaceUtils::ConvertSurface( pSrc, pSurface, pSrc->w, pSrc->h, 32, - 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 ) ) - { - return NULL; - } + RageSurface *pSurface = CreateSurface( pSrc->w, pSrc->h, 32, + 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 ); + RageSurfaceUtils::Blit( pSrc, pSurface , -1, -1 ); + GdkPixbuf *pBuf = gdk_pixbuf_new_from_data( pSurface->pixels, GDK_COLORSPACE_RGB, true, 8, pSurface->w, pSurface->h , pSurface->pitch, DeletePixels, NULL); + if( pBuf != NULL ) pSurface->pixels_owned = false; + delete pSurface; return pBuf; } -/* + extern "C" void SetIcon( const RageSurface *pSrcImg ) { - RageSurface *pImg; + GdkPixbuf *pBuf = MakePixbuf( pSrcImg ); + if( pBuf != NULL ) { - pImg = CreateSurface( pSrcImg->w, pSrcImg->h, 32, - 0x00FF0000, - 0x0000FF00, - 0x000000FF, - 0xFF000000 ); - RageSurfaceUtils::Blit( pSrcImg, pImg ); + gtk_window_set_icon( GTK_WINDOW(window), pBuf ); + g_object_unref(pBuf); } - - GdkPixbuf *pIcon; - pIcon = gdk_pixbuf_new_from_data(pImg->pixels, - GDK_COLORSPACE_RGB, true, - 8, - pImg->w, pImg->h, - pImg->h * pImg->pitch, // not sure how to handle rowstride - NULL, NULL); - - delete pImg; - pImg = NULL; - - gtk_window_set_icon( GTK_WINDOW(window), pIcon ); gtk_main_iteration_do(FALSE); } -*/ extern "C" void SetSplash( const RageSurface *pSplash ) { diff --git a/src/arch/LoadingWindow/LoadingWindow_GtkModule.h b/src/arch/LoadingWindow/LoadingWindow_GtkModule.h index e176f4b543..2dcbfbd69f 100644 --- a/src/arch/LoadingWindow/LoadingWindow_GtkModule.h +++ b/src/arch/LoadingWindow/LoadingWindow_GtkModule.h @@ -6,7 +6,7 @@ struct RageSurface; typedef const char *(*INIT)(int *argc, char ***argv); typedef void (*SHUTDOWN)(); typedef void (*SETTEXT)( const char *s ); -//typedef void (*SETICON)( const RageSurface *pSrcImg ); +typedef void (*SETICON)( const RageSurface *pSrcImg ); typedef void (*SETSPLASH)( const RageSurface *pSplash ); typedef void (*SETPROGRESS)( int progress, int totalWork ); typedef void (*SETINDETERMINATE)( bool indeterminate );