Build Windows GUI with GTK

This commit is contained in:
gbeauche 2005-11-27 23:54:26 +00:00
parent 434ad38a1f
commit 5a5defb9d8
9 changed files with 113 additions and 13 deletions

View File

@ -75,7 +75,7 @@ links:
Windows/kernel_windows.h Windows/kernel_windows.cpp \
Windows/serial_windows.cpp Windows/router Windows/b2ether \
Windows/ether_windows.h Windows/ether_windows.cpp \
Windows/serial_windows.cpp'; \
Windows/serial_windows.cpp Windows/prefs_editor_gtk.cpp'; \
PREFIX="`pwd`/"; case $(B2_TOPDIR) in /*) PREFIX="";; esac; \
for i in $$list; do \
echo $$i; \

View File

@ -13,12 +13,18 @@ man1dir = $(mandir)/man1
DESTDIR =
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
WANT_GTK = @WANT_GTK@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
LN_S = @LN_S@
WINDRES = @WINDRES@
CC = @CC@
CXX = @CXX@
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CFLAGS = @CFLAGS@ $(SDL_CFLAGS)
CXXFLAGS = @CXXFLAGS@ $(SDL_CFLAGS)
CPPFLAGS = @CPPFLAGS@ -I../include -I.
DEFS = @DEFS@
LDFLAGS = @LDFLAGS@
@ -55,14 +61,24 @@ SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_window
about_window_windows.cpp ../user_strings.cpp user_strings_windows.cpp \
../dummy/prefs_editor_dummy.cpp clip_windows.cpp util_windows.cpp kernel_windows.cpp \
vm_alloc.cpp sigsegv.cpp posix_emu.cpp SheepShaver.rc $(CPUSRCS) $(ROUTERSRCS)
UI_SRCS = ../prefs.cpp prefs_windows.cpp prefs_editor_gtk.cpp xpram_windows.cpp \
../prefs_items.cpp ../user_strings.cpp user_strings_windows.cpp SheepShaverGUI.rc
UI_APP = SheepShaverGUI.exe
APP = SheepShaver.exe
ifeq ($(WANT_GTK),yes)
PROGS += $(UI_APP)
endif
## Rules
.PHONY: clean distclean
.SUFFIXES:
.SUFFIXES: .c .cpp .S .o .h
all: $(APP)
all: $(PROGS)
$(UNIXSRCS): %: ../Unix/%
$(LN_S) $< $@
@ -77,6 +93,12 @@ define SRCS_LIST_TO_OBJS
endef
OBJS = $(SRCS_LIST_TO_OBJS)
define UI_SRCS_LIST_TO_OBJS
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(UI_SRCS), \
$(basename $(notdir $(file))))))
endef
UI_OBJS = $(UI_SRCS_LIST_TO_OBJS)
define DYNGENSRCS_LIST_TO_OBJS
$(addprefix $(OBJ_DIR)/, $(addsuffix .ho, $(foreach file, $(DYNGENSRCS), \
$(basename $(notdir $(file))))))
@ -88,15 +110,21 @@ VPATH :=
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
$(APP): $(UNIXSRCS) $(OBJ_DIR) $(OBJS)
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS)
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) $(SDL_LIBS)
clean:
$(UI_APP): $(UNIXSRCS) $(OBJ_DIR) $(UI_OBJS)
$(CXX) -o $@ $(LDFLAGS) $(UI_OBJS) $(LIBS) $(GTK_LIBS) -mwindows -mno-cygwin
mostlyclean:
rm -f $(APP) $(UI_APP) $(OBJ_DIR)/* core* *.core *~ *.bak
clean: mostlyclean
rm -f $(UNIXSRCS)
rm -f $(APP) $(OBJ_DIR)/* core* *.core *~ *.bak ppc-execute-impl.cpp
rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp
rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp ppc-execute-impl.cpp
distclean: clean
rm -rf $(OBJ_DIR)
rm -rf autom4te.cache
rm -f Makefile
rm -f config.cache config.log config.status config.h
@ -117,6 +145,8 @@ $(OBJ_DIR)/%.o : %.S
$(CPP) $(CPPFLAGS) -D__ASSEMBLY__ $< -o $*.out.s
$(AS) $(ASFLAGS) -o $@ $*.out.s
rm $*.out.s
$(OBJ_DIR)/prefs_editor_gtk.o: prefs_editor_gtk.cpp
$(CXX) -O2 -mno-cygwin -mms-bitfields $(CPPFLAGS) $(DEFS) $(GTK_CFLAGS) -c $< -o $@
# Windows resources
$(OBJ_DIR)/%.o: %.rc

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,2 @@
SheepShaverGUI ICON PRELOAD "SheepShaverGUI.ico"

View File

@ -13,6 +13,7 @@ AC_CANONICAL_TARGET
dnl Options.
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
dnl Checks for programs.
AC_PROG_CC
@ -24,6 +25,15 @@ AC_PROG_LN_S
AC_PATH_PROG(PERL, [perl])
AC_CHECK_TOOL(WINDRES, windres)
dnl We use GTK+ if possible.
if [[ "x$WANT_GTK" = "xyes" ]]; then
AM_PATH_GTK_2_0(1.3.15, [], [
AC_MSG_WARN([Could not find GTK+ 2.0, disabling user interface.])
WANT_GTK=no
])
fi
AC_SUBST(WANT_GTK)
dnl We use 64-bit file size support if possible.
AC_SYS_LARGEFILE
@ -202,11 +212,10 @@ CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
dnl We really want SDL for now
AC_CHECK_TOOL(sdl_config, sdl-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])])
sdl_cflags=`$sdl_config --cflags`
sdl_libs=`$sdl_config --libs`
CFLAGS="$CFLAGS $sdl_cflags"
CXXFLAGS="$CXXFLAGS $sdl_cflags"
LIBS="$LIBS $sdl_libs"
SDL_CFLAGS=`$sdl_config --cflags`
AC_SUBST(SDL_CFLAGS)
SDL_LIBS=`$sdl_config --libs`
AC_SUBST(SDL_LIBS)
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
@ -230,5 +239,6 @@ echo
echo SheepShaver configuration summary:
echo
echo Enable JIT compiler .............. : $WANT_JIT
echo GTK user interface ............... : $WANT_GTK
echo
echo "Configuration done. Now type \"make\"."

View File

@ -47,6 +47,32 @@ user_string_def platform_strings[] = {
{STR_WINDOW_TITLE_GRABBED, "SheepShaver (mouse grabbed, press Ctrl-F5 to release)"},
{STR_NO_WIN32_NT_4, "SheepShaver does not run on Windows NT versions less than 4.0"},
{STR_PREFS_MENU_FILE_GTK, "/_File"},
{STR_PREFS_ITEM_START_GTK, "/File/_Start SheepShaver"},
{STR_PREFS_ITEM_ZAP_PRAM_GTK, "/File/_Zap PRAM File"},
{STR_PREFS_ITEM_SEPL_GTK, "/File/sepl"},
{STR_PREFS_ITEM_QUIT_GTK, "/File/_Quit SheepShaver"},
{STR_HELP_MENU_GTK, "/_Help"},
{STR_HELP_ITEM_ABOUT_GTK, "/Help/_About SheepShaver"},
{STR_FILE_CTRL, "File"},
{STR_BROWSE_TITLE, "Browse file"},
{STR_BROWSE_CTRL, "Browse..."},
{STR_SERIAL_PANE_TITLE, "Serial"},
{STR_NETWORK_PANE_TITLE, "Network"},
{STR_INPUT_PANE_TITLE, "Keyboard/Mouse"},
{STR_KEYCODES_CTRL, "Use Raw Keycodes"},
{STR_KEYCODE_FILE_CTRL, "Keycode Translation File"},
{STR_MOUSEWHEELMODE_CTRL, "Mouse Wheel Function"},
{STR_MOUSEWHEELMODE_PAGE_LAB, "Page Up/Down"},
{STR_MOUSEWHEELMODE_CURSOR_LAB, "Cursor Up/Down"},
{STR_MOUSEWHEELLINES_CTRL, "Lines To Scroll"},
{STR_POLLMEDIA_CTRL, "Try to automatically detect new removable media (enable polling)"},
{STR_EXTFS_ENABLE_CTRL, "Enable \"My Computer\" icon on your Mac desktop (external file system)"},
{STR_EXTFS_DRIVES_CTRL, "Mount drives"},
{STR_ETHER_FTP_PORT_LIST_CTRL, "FTP ports"},
{STR_ETHER_TCP_PORT_LIST_CTRL, "Server ports"},
{-1, NULL} // End marker
};

View File

@ -40,6 +40,32 @@ enum {
STR_OPEN_WINDOW_ERR,
STR_WINDOW_TITLE_GRABBED,
STR_NO_WIN32_NT_4,
STR_PREFS_MENU_FILE_GTK,
STR_PREFS_ITEM_START_GTK,
STR_PREFS_ITEM_ZAP_PRAM_GTK,
STR_PREFS_ITEM_SEPL_GTK,
STR_PREFS_ITEM_QUIT_GTK,
STR_HELP_MENU_GTK,
STR_HELP_ITEM_ABOUT_GTK,
STR_FILE_CTRL,
STR_BROWSE_CTRL,
STR_BROWSE_TITLE,
STR_SERIAL_PANE_TITLE,
STR_NETWORK_PANE_TITLE,
STR_INPUT_PANE_TITLE,
STR_KEYCODES_CTRL,
STR_KEYCODE_FILE_CTRL,
STR_MOUSEWHEELMODE_CTRL,
STR_MOUSEWHEELMODE_PAGE_LAB,
STR_MOUSEWHEELMODE_CURSOR_LAB,
STR_MOUSEWHEELLINES_CTRL,
STR_POLLMEDIA_CTRL,
STR_EXTFS_ENABLE_CTRL,
STR_EXTFS_DRIVES_CTRL,
STR_ETHER_FTP_PORT_LIST_CTRL,
STR_ETHER_TCP_PORT_LIST_CTRL,
};
#endif

View File

@ -74,6 +74,8 @@ enum {
STR_PREFS_ITEM_ZAP_PRAM,
STR_PREFS_ITEM_QUIT,
STR_NONE_LAB = 3100,
// Volumes pane
STR_VOLUMES_PANE_TITLE = 3200,
STR_ADD_VOLUME_BUTTON,
@ -99,6 +101,7 @@ enum {
STR_REF_15HZ_LAB,
STR_REF_30HZ_LAB,
STR_REF_60HZ_LAB,
STR_REF_DYNAMIC_LAB,
STR_GFXACCEL_CTRL,
STR_8_BIT_CTRL,
STR_16_BIT_CTRL,

View File

@ -87,6 +87,8 @@ user_string_def common_strings[] = {
{STR_PREFS_ITEM_ZAP_PRAM, "Zap PRAM File"},
{STR_PREFS_ITEM_QUIT, "Quit SheepShaver"},
{STR_NONE_LAB, "<none>"},
{STR_VOLUMES_PANE_TITLE, "Volumes"},
{STR_ADD_VOLUME_BUTTON, "Add" ELLIPSIS},
{STR_CREATE_VOLUME_BUTTON, "Create" ELLIPSIS},
@ -109,6 +111,7 @@ user_string_def common_strings[] = {
{STR_REF_15HZ_LAB, "15 Hz"},
{STR_REF_30HZ_LAB, "30 Hz"},
{STR_REF_60HZ_LAB, "60 Hz"},
{STR_REF_DYNAMIC_LAB, "Dynamic"},
{STR_GFXACCEL_CTRL, "QuickDraw Acceleration"},
{STR_8_BIT_CTRL, "8 Bit"},
{STR_16_BIT_CTRL, "15 Bit"},