more work on the Linux stuff, though nothing's working yet

This commit is contained in:
AJ Kelly
2011-08-22 17:23:09 -05:00
parent e2ab3d6493
commit c7ac0b4466
5 changed files with 52 additions and 5 deletions
@@ -1,5 +1,9 @@
#include "global.h"
#include "LoadingWindow_GtkModule.h"
#include "RageUtil.h"
#include "RageSurface.h"
#include "RageSurfaceUtils.h"
#include "RageSurface_Load.h"
#include <gtk/gtk.h>
@@ -20,12 +24,17 @@ extern "C" const char *Init( int *argc, char ***argv )
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_CENTER );
gtk_window_set_default_size( GTK_WINDOW(window), 512,96 );
//gtk_window_set_icon( GTK_WINDOW(window), );
gtk_widget_realize(window);
splash = gtk_image_new_from_file(splash_image_path);
label = gtk_label_new(NULL);
gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_CENTER);
progressBar = gtk_progress_bar_new();
gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(progressBar), 0.0 );
vbox = gtk_vbox_new(FALSE,5);
gtk_container_add(GTK_CONTAINER(window),vbox);
gtk_box_pack_start(GTK_BOX(vbox),splash,FALSE,FALSE,0);
@@ -52,6 +61,33 @@ extern "C" void SetText( const char *s )
gtk_main_iteration_do(FALSE);
}
extern "C" void SetIcon( const RageSurface *pSrcImg )
{
RageSurface *pImg;
{
pImg = CreateSurface( pSrcImg->w, pSrcImg->h, 32,
0x00FF0000,
0x0000FF00,
0x000000FF,
0xFF000000 );
RageSurfaceUtils::Blit( pSrcImg, pImg );
}
GdkPixbuf *pIcon;
pIcon = gdk_pixbuf_new_from_data(pImg->pixels,
GDK_COLORSPACE_RGB, true,
32,
pImg->w, pImg->h,
pImg->h * pImg->pitch, // ?
NULL, NULL);
delete pImg;
pImg = NULL;
gtk_window_set_icon( GTK_WINDOW(window), pIcon );
gtk_main_iteration_do(FALSE);
}
extern "C" void SetSplash( const char *s )
{
splash = gtk_image_new_from_file(s);