LoadingWindow_Gtk almost sort of halfway works, in a manner of speaking.

This commit is contained in:
Sean Burke
2003-07-06 22:13:56 +00:00
parent 61baf5992b
commit 18c143be70
6 changed files with 95 additions and 10 deletions
+12 -2
View File
@@ -45,9 +45,17 @@ fi
AM_PATH_SDL AM_PATH_SDL
AM_PATH_ALSA(0.9.0, alsa=true ,alsa=0 ) AM_PATH_ALSA(0.9.0,AC_DEFINE([HAVE_ALSA],1,[Define presence of ALSA]),alsa=false)
AC_ARG_ENABLE(gtk2,[ --enable-gtk2 enable debug mode [default=yes]], , enable_gtk2=yes)
if test x$enable_gtk2 = xyes; then
AM_PATH_GTK_2_0(2.0.0,AC_DEFINE([HAVE_GTK],1,[Define presence of GTK]),gtk=false)
fi
AC_CHECK_HEADER(linux/soundcard.h, [AC_DEFINE(HAVE_OSS, 1, [OSS support available])]) AC_CHECK_HEADER(linux/soundcard.h, [AC_DEFINE(HAVE_OSS, 1, [OSS support available])])
AM_CONDITIONAL(HAVE_ALSA, test x$alsa = xtrue ) AM_CONDITIONAL(HAVE_ALSA, test x$alsa != xfalse )
AM_CONDITIONAL(HAVE_GTK, test x$gtk != xfalse )
AM_CONDITIONAL(HAVE_OSS, test x$ac_cv_header_linux_soundcard_h = xyes ) AM_CONDITIONAL(HAVE_OSS, test x$ac_cv_header_linux_soundcard_h = xyes )
# We could do this more cleanly with an AC_CHECK_FUNCS wrapper. # We could do this more cleanly with an AC_CHECK_FUNCS wrapper.
@@ -88,6 +96,8 @@ case $host in
esac esac
AM_CONDITIONAL(DARWIN, test x$darwin = xtrue) AM_CONDITIONAL(DARWIN, test x$darwin = xtrue)
CFLAGS="$CFLAGS $GTK_CFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
# sdl-config puts -L/usr/lib in the library search path, which reorders things # sdl-config puts -L/usr/lib in the library search path, which reorders things
# in a way that breaks some configurations. # in a way that breaks some configurations.
+17 -7
View File
@@ -13,7 +13,6 @@ endif
AM_CXXFLAGS += -O2 -ISDL-1.2.5/include -ISDL_sound-1.0.0 AM_CXXFLAGS += -O2 -ISDL-1.2.5/include -ISDL_sound-1.0.0
AM_CFLAGS += -O2 AM_CFLAGS += -O2
# This is a little hacky; we use our own version of SDL and SDL_sound, and I don't # This is a little hacky; we use our own version of SDL and SDL_sound, and I don't
# want to have to integrate their entire build systems. # want to have to integrate their entire build systems.
# <B.Anderson> Why --disable-alsa --disable-oss? Because SDL and our own # <B.Anderson> Why --disable-alsa --disable-oss? Because SDL and our own
@@ -31,6 +30,7 @@ AM_CFLAGS += -O2
# hanging, because... you get the idea.) Setting these switches # hanging, because... you get the idea.) Setting these switches
# keep SDL from trying to grab the soundcard, so we have it all # keep SDL from trying to grab the soundcard, so we have it all
# to ourselves, thus preventing that nasty hang on boot. # to ourselves, thus preventing that nasty hang on boot.
SDL-1.2.5/src/.libs/libSDL.a: SDL-1.2.5/src/.libs/libSDL.a:
cd SDL-1.2.5 && ./configure \ cd SDL-1.2.5 && ./configure \
--disable-nasm --disable-arts --disable-esd --enable-static --disable-shared --enable-debug --disable-alsa --disable-oss --disable-nasm --disable-arts --disable-esd --enable-static --disable-shared --enable-debug --disable-alsa --disable-oss
@@ -82,10 +82,8 @@ TitleSubstitution.cpp TitleSubstitution.h Inventory.cpp Inventory.h PlayerNumber
LyricsLoader.cpp LyricsLoader.h NoteFieldPositioning.cpp NoteFieldPositioning.h \ LyricsLoader.cpp LyricsLoader.h NoteFieldPositioning.cpp NoteFieldPositioning.h \
PlayerAI.cpp PlayerAI.h Character.cpp Character.h ArrowBackdrop.cpp ArrowBackdrop.h PlayerAI.cpp PlayerAI.h Character.cpp Character.h ArrowBackdrop.cpp ArrowBackdrop.h
FileTypes = IniFile.cpp IniFile.h MsdFile.cpp MsdFile.h FileTypes = IniFile.cpp IniFile.h MsdFile.cpp MsdFile.h
StepMania = global.h ScreenDimensions.h StdString.h StepMania.cpp StepMania.h StepMania = global.h ScreenDimensions.h StdString.h StepMania.cpp StepMania.h
Transitions = Transition.cpp Transition.h Transitions = Transition.cpp Transition.h
@@ -168,22 +166,32 @@ Sound_Null = \
arch/Sound/RageSoundDriver_Null.h arch/Sound/RageSoundDriver_Null.h
Sound = $(Sound_Null) Sound = $(Sound_Null)
if HAVE_ALSA if HAVE_ALSA
Sound += $(Sound_ALSA9) Sound += $(Sound_ALSA9)
endif endif
if HAVE_OSS if HAVE_OSS
Sound += $(Sound_OSS) Sound += $(Sound_OSS)
endif endif
Loading = arch/LoadingWindow/LoadingWindow_SDL.cpp \
arch/LoadingWindow/LoadingWindow_SDL.h \
arch/LoadingWindow/LoadingWindow_Null.h
if HAVE_GTK
Loading += arch/LoadingWindow/LoadingWindow_Gtk.cpp \
arch/LoadingWindow/LoadingWindow_Gtk.h
endif
stepmania_SOURCES = $(Rage) $(DataStructures) $(FileTypes) $(StepMania) $(Transitions) \ stepmania_SOURCES = $(Rage) $(DataStructures) $(FileTypes) $(StepMania) $(Transitions) \
$(Actors) $(ActorsInMenus) $(ActorsInGameplay) $(Screens) $(GlobalSingletons) \ $(Actors) $(ActorsInMenus) $(ActorsInGameplay) $(Screens) $(GlobalSingletons) \
$(PCRE) \ $(PCRE) \
$(Loading) \
arch/arch.cpp \ arch/arch.cpp \
arch/arch.h \
arch/InputHandler/InputHandler_SDL.cpp \ arch/InputHandler/InputHandler_SDL.cpp \
arch/InputHandler/InputHandler_SDL.h \ arch/InputHandler/InputHandler_SDL.h \
arch/LoadingWindow/LoadingWindow_SDL.cpp \
arch/LoadingWindow/LoadingWindow_SDL.h \
arch/LoadingWindow/LoadingWindow_Null.h \
arch/MovieTexture/MovieTexture.cpp \ arch/MovieTexture/MovieTexture.cpp \
$(Sound) \ $(Sound) \
arch/LowLevelWindow/LowLevelWindow.h \ arch/LowLevelWindow/LowLevelWindow.h \
@@ -196,11 +204,13 @@ stepmania_SOURCES = $(Rage) $(DataStructures) $(FileTypes) $(StepMania) $(Transi
# for SDL_image. This is annoying, but it's not a major problem. The # for SDL_image. This is annoying, but it's not a major problem. The
# "fix" would be to statically link SDL_image, but that would mean # "fix" would be to statically link SDL_image, but that would mean
# dealing with its build and libjpeg, png, etc--not worth it. # dealing with its build and libjpeg, png, etc--not worth it.
stepmania_LDADD = \ stepmania_LDADD = \
$(GL_LIBS) \ $(GL_LIBS) \
$(srcdir)/SDL-1.2.5/src/.libs/libSDL.a \ $(srcdir)/SDL-1.2.5/src/.libs/libSDL.a \
$(srcdir)/SDL_sound-1.0.0/.libs/libSDL_sound.a \ $(srcdir)/SDL_sound-1.0.0/.libs/libSDL_sound.a \
$(SDL_LIBS) $(SDL_LIBS) \
$(GTK_LIBS)
INCLUDES = $(SDL_CFLAGS) INCLUDES = $(SDL_CFLAGS)
# -O0 -g # -O0 -g
+8 -1
View File
@@ -52,7 +52,6 @@
/* This is also a global class; we own it. */ /* This is also a global class; we own it. */
ArchHooks *HOOKS = NULL; ArchHooks *HOOKS = NULL;
#ifdef WIN32 #ifdef WIN32
#ifdef DEBUG #ifdef DEBUG
@@ -65,6 +64,10 @@ HWND g_hWndMain = NULL;
#endif #endif
#ifdef HAVE_GTK
# include <gtk/gtk.h>
#endif
static bool g_bHasFocus = true; static bool g_bHasFocus = true;
static bool g_bQuitting = false; static bool g_bQuitting = false;
@@ -433,6 +436,10 @@ int main(int argc, char* argv[])
* Do it after ChangeToDirOfExecutable, so the log ends up in the right place. */ * Do it after ChangeToDirOfExecutable, so the log ends up in the right place. */
LOG = new RageLog(); LOG = new RageLog();
#ifdef HAVE_GTK
gtk_init(&argc,&argv);
#endif
#ifdef DEBUG #ifdef DEBUG
LOG->ShowConsole(); LOG->ShowConsole();
#endif #endif
@@ -0,0 +1,30 @@
#include <gtk/gtk.h>
static GtkWidget *label;
static GtkWidget *window;
void CreateGtkLoadingWindow() {
GtkWidget *vbox;
GtkWidget *loadimage;
loadimage = gtk_image_new_from_file("loading.xpm");
label = gtk_label_new(NULL);
gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_CENTER);
vbox = gtk_vbox_new(FALSE,0);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add(GTK_CONTAINER(window),vbox);
gtk_box_pack_start(GTK_BOX(vbox),loadimage,FALSE,FALSE,10);
gtk_box_pack_start(GTK_BOX(vbox),label,TRUE,TRUE,20);
gtk_widget_show(loadimage);
gtk_widget_show(label);
gtk_widget_show(vbox);
gtk_widget_show(window);
}
void DestroyGtkLoadingWindow() {
gtk_widget_destroy(window);
}
void SetGtkLoadingWindowText(const char *s) {
gtk_label_set_text(GTK_LABEL(label),s);
}
@@ -0,0 +1,22 @@
#ifndef LOADING_WINDOW_GTK
#define LOADING_WINDOW_GTK
#include "LoadingWindow_Null.h"
extern void CreateGtkLoadingWindow();
extern void DestroyGtkLoadingWindow();
extern void SetGtkLoadingWindowText(const char *s);
class LoadingWindow_Gtk : public LoadingWindow {
public:
LoadingWindow_Gtk() { CreateGtkLoadingWindow(); }
~LoadingWindow_Gtk() { DestroyGtkLoadingWindow(); }
void SetText(CString str) { SetGtkLoadingWindowText(str.c_str()); }
void Paint() { }
};
#undef ARCH_LOADING_WINDOW
#define ARCH_LOADING_WINDOW LoadingWindow_Gtk
#endif
+6
View File
@@ -1,6 +1,8 @@
#ifndef LINUX_ARCH_H #ifndef LINUX_ARCH_H
#define LINUX_ARCH_H #define LINUX_ARCH_H
#include "global.h"
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
# include "Sound/RageSoundDriver_ALSA9.h" # include "Sound/RageSoundDriver_ALSA9.h"
#endif #endif
@@ -16,6 +18,10 @@
* and fix our code, not have it silently fall back on a broken driver. -glenn */ * and fix our code, not have it silently fall back on a broken driver. -glenn */
// #include "Sound/RageSoundDriver_SDL.h" // #include "Sound/RageSoundDriver_SDL.h"
#ifdef HAVE_GTK
# include "LoadingWindow/LoadingWindow_Gtk.h"
#endif
#endif #endif
/* /*
* Copyright (c) 2002 by the person(s) listed below. All rights reserved. * Copyright (c) 2002 by the person(s) listed below. All rights reserved.