[SCM] front-end for the arcade games emulator MAME branch, upstream, updated. upstream/0.2.8-1-gd3fa27b
Loïc Martin
loic.martin3 at gmail.com
Tue Jun 9 18:16:16 UTC 2009
The following commit has been merged in the upstream branch:
commit d3fa27b620fe9ec711fdafa59fc67d848afe3262
Author: Loïc Martin <loic.martin3 at gmail.com>
Date: Tue Jun 9 20:13:04 2009 +0200
Imported Upstream version 0.2.9
diff --git a/ChangeLog b/ChangeLog
index 49d1f4b..489de88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,42 @@
-2009-04-21 xx:xx adburton
+2009-06-05 19:30 adburton
+
+ * configure.ac, NEWS, src/about.c: Tagged for new release
+
+2009-06-05 19:02 adburton
+
+ * data/options.glade: Add support for -waitvsync (SF Bug 2800305)
+
+2009-06-05 17:26 adburton
+
+ * src/: audit.c, callbacks.c, game_list.c, game_list.h,
+ gmameui-audit-dlg.c, gmameui-gamelist-view.c,
+ gmameui-gamelist-view.h, gmameui-rominfo-dlg.c,
+ gmameui-search-entry.c, gmameui-search-entry.h,
+ gmameui-sidebar.c, gmameui-sidebar.h, gmameui.c, gmameui.h, gtkjoy.c
+ gui.c, gui.h, gui_prefs_dialog.c, interface.c, io.c, mameio.c,
+ rom_entry.c, rom_entry.h: Migrate RomEntry struct to GObject
+ MameRomEntry, various codefixes
+
+2009-05-23 16:51 adburton
+
+ * data/gmameui_prefs.glade, src/gui_prefs.c, src/gui_prefs.h,
+ src/gui_prefs_dialog.c: Use italics to mark ROM as a clone
+ rather than colour
+
+2009-05-23 16:32 adburton
+
+ * data/main_gui.glade: Add search field and ROM status filter
+ buttons
+ * src/: Makefile.am gmameui-ui.xml gmameui-search-entry.c
+ gmameui-search-entry.h gmameui-marshallers.list rom_entry.c
+ rom_entry.h directories.c filters_list.c game_list.c
+ interface.c interface.h gui.c gui.h gmameui.c gmameui.h
+ gmameui-rominfo-dlg.c callbacks.c gmameui-audit-dlg.c
+ gmameui-gamelist-view.c gmameui-gamelist-view.h: Add new
+ search field, handling for ROM status filter buttons,
+ move gamelist handling code to gmameui-gamelist-view.c
+
+2009-04-21 20:20 adburton
* configure.ac, NEWS: Tagged for new release
diff --git a/NEWS b/NEWS
index 9248071..793c406 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,29 @@
+Overview of changes in GMAMEUI 0.2.9
+====================================
+
+* Add search field for the gamelist, performing a case-insensitive search on
+ the ROM name
+
+* Add buttons to filter on all, available and unavailable ROMs
+
+* Set row height to be consistent whether custom icon displayed or not
+
+* Handle changes to display in the GUI Preferences screen immediately (i.e.
+ column changes)
+
+* Use italic, rather than text colour, to distinguish Clones
+
+* Removed the option to display the gamelist with clones nested as a tree;
+ the Gamelist now only displays in a GtkListView
+
+* Added new filter Imperfect Driver
+
+* Add support for -waitvsync option (SF Bug 2800305)
+
+* Migrate gamelist to a GObject
+
+* Migrate RomEntry struct to a GObject
+
Overview of changes in GMAMEUI 0.2.8
====================================
diff --git a/configure b/configure
index c898feb..140ac86 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for gmameui 0.2.8.
+# Generated by GNU Autoconf 2.63 for gmameui 0.2.9.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -594,8 +594,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='gmameui'
PACKAGE_TARNAME='gmameui'
-PACKAGE_VERSION='0.2.8'
-PACKAGE_STRING='gmameui 0.2.8'
+PACKAGE_VERSION='0.2.9'
+PACKAGE_STRING='gmameui 0.2.9'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
@@ -1379,7 +1379,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gmameui 0.2.8 to adapt to many kinds of systems.
+\`configure' configures gmameui 0.2.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1449,7 +1449,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gmameui 0.2.8:";;
+ short | recursive ) echo "Configuration of gmameui 0.2.9:";;
esac
cat <<\_ACEOF
@@ -1569,7 +1569,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gmameui configure 0.2.8
+gmameui configure 0.2.9
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1583,7 +1583,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gmameui $as_me 0.2.8, which was
+It was created by gmameui $as_me 0.2.9, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2301,7 +2301,7 @@ fi
# Define the identity of the package.
PACKAGE='gmameui'
- VERSION='0.2.8'
+ VERSION='0.2.9'
cat >>confdefs.h <<_ACEOF
@@ -12308,7 +12308,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gmameui $as_me 0.2.8, which was
+This file was extended by gmameui $as_me 0.2.9, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12371,7 +12371,7 @@ Report bugs to <bug-autoconf at gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-gmameui config.status 0.2.8
+gmameui config.status 0.2.9
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 97cf4bb..2e92017 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([gmameui], [0.2.8])
+AC_INIT([gmameui], [0.2.9])
AC_PREREQ(2.5)
AM_INIT_AUTOMAKE
diff --git a/data/Makefile.am b/data/Makefile.am
index dee1113..3c1ea20 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -5,6 +5,7 @@ glade_DATA = audit_window.glade \
sidebar.glade \
gmameui_prefs.glade \
options.glade \
+ options_legacy.glade \
rom_info.glade \
main_gui.glade
diff --git a/data/Makefile.in b/data/Makefile.in
index 3146a5c..b554173 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -207,6 +207,7 @@ glade_DATA = audit_window.glade \
sidebar.glade \
gmameui_prefs.glade \
options.glade \
+ options_legacy.glade \
rom_info.glade \
main_gui.glade
diff --git a/data/gmameui_prefs.glade b/data/gmameui_prefs.glade
index b6b5bb2..531dd0a 100644
--- a/data/gmameui_prefs.glade
+++ b/data/gmameui_prefs.glade
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sun Aug 3 17:50:00 2008 -->
+<?xml version="1.0"?>
<glade-interface>
+ <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="dialog1">
<property name="border_width">5</property>
<property name="title" translatable="yes">GMAMEUI Preferences</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="window_position">center-on-parent</property>
+ <property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
@@ -16,7 +16,7 @@
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
- <widget class="GtkVBox" id="vbox1">
+ <widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label1">
@@ -29,6 +29,7 @@
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">6</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -36,24 +37,27 @@
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox2">
+ <widget class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="gamecheck">
+ <property name="label" translatable="yes">Search for new games</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Search for new games</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkCheckButton" id="versioncheck">
+ <property name="label" translatable="yes">Enable version mismatch warning</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable version mismatch warning</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -62,10 +66,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="usexmameoptions">
+ <property name="label" translatable="yes">Use MAME default options</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Use MAME default options</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -74,10 +78,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="usejoyingui">
+ <property name="label" translatable="yes">Allow game selection with a joystick</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Allow game selection with a joystick</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -97,6 +101,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -128,9 +133,12 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox3">
+ <widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label2">
@@ -143,6 +151,7 @@
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">6</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -158,10 +167,10 @@
<property name="row_spacing">6</property>
<child>
<widget class="GtkCheckButton" id="col_samples">
+ <property name="label" translatable="yes">Samples</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Samples</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -172,10 +181,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_directory">
+ <property name="label" translatable="yes">Directory</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Directory</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -186,10 +195,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_playcount">
+ <property name="label" translatable="yes">Playcount</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Playcount</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -200,10 +209,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_manufacturer">
+ <property name="label" translatable="yes">Manufacturer</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Manufacturer</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -214,10 +223,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_year">
+ <property name="label" translatable="yes">Year</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Year</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -228,10 +237,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_cloneof">
+ <property name="label" translatable="yes">Clone of</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Clone of</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -243,10 +252,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_driver">
+ <property name="label" translatable="yes">Driver</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Driver</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -258,10 +267,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_version">
+ <property name="label" translatable="yes">Version</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Version</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -273,10 +282,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_category">
+ <property name="label" translatable="yes">Category</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Category</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -288,11 +297,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="col_gamename">
+ <property name="label" translatable="yes">Game Name</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Game Name</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -314,7 +323,7 @@
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox4">
+ <widget class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label3">
@@ -327,6 +336,7 @@
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">6</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -334,102 +344,19 @@
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox5">
+ <widget class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="theprefix">
+ <property name="label" translatable="yes">'The' as a prefix</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">'The' as a prefix</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="theprefix_lbl">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">label</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
<packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Clone Colour</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkColorButton" id="clone_color">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="response_id">0</property>
- <property name="color">#000000000000</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox7">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="original_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">original_label</property>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="clone_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">clone_label</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -454,23 +381,29 @@
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="btn_close">
+ <property name="label" translatable="yes">gtk-close</property>
+ <property name="response_id">-7</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-close</property>
<property name="use_stock">True</property>
- <property name="response_id">-7</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
diff --git a/data/main_gui.glade b/data/main_gui.glade
index 1352bd9..9fbf862 100644
--- a/data/main_gui.glade
+++ b/data/main_gui.glade
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Tue Apr 7 20:33:28 2009 -->
+<!--Generated with glade3 3.4.5 on Sun Apr 26 15:07:35 2009 -->
<glade-interface>
<widget class="GtkWindow" id="window1">
<child>
@@ -87,13 +87,21 @@
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkRadioButton" id="filter_btn_all">
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="filter_btn_unavail">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">All ROMs</property>
+ <property name="label" translatable="yes">Unavailable ROMs</property>
<property name="response_id">0</property>
<property name="active">True</property>
+ <property name="group">filter_btn_all</property>
</widget>
+ <packing>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">4</property>
+ </packing>
</child>
<child>
<widget class="GtkRadioButton" id="filter_btn_avail">
@@ -105,19 +113,20 @@
<property name="group">filter_btn_all</property>
</widget>
<packing>
- <property name="position">1</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="filter_btn_unavail">
+ <widget class="GtkRadioButton" id="filter_btn_all">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Unavailable ROMs</property>
+ <property name="label" translatable="yes">All ROMs</property>
<property name="response_id">0</property>
<property name="active">True</property>
- <property name="group">filter_btn_all</property>
</widget>
<packing>
+ <property name="pack_type">GTK_PACK_END</property>
<property name="position">2</property>
</packing>
</child>
diff --git a/data/options.glade b/data/options.glade
index 7ae3cf6..1bad761 100644
--- a/data/options.glade
+++ b/data/options.glade
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sun Dec 7 16:23:34 2008 -->
+<?xml version="1.0"?>
<glade-interface>
+ <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="PerformanceWindow">
<child>
<widget class="GtkVBox" id="PerformanceVBox">
@@ -17,6 +17,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -29,13 +30,16 @@
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.autoframeskip">
+ <property name="label" translatable="yes">Automatic frameskip</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Automatically skip frames (-autoframeskip)</property>
- <property name="label" translatable="yes">Automatic frameskip</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkHBox" id="hbox1">
@@ -49,6 +53,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -70,11 +75,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.throttle">
+ <property name="label" translatable="yes">Throttle</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Throttle game in sync with real time (-throttle)</property>
- <property name="label" translatable="yes">Throttle</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -85,11 +90,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.sleep">
+ <property name="label" translatable="yes">Sleep</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Sleeping when idle (-sleep)</property>
- <property name="label" translatable="yes">Sleep</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -109,6 +114,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -131,11 +137,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.refreshspeed">
+ <property name="label" translatable="yes">Refresh speed</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Adjust gameplay speed to keep refresh rate lower than the screen (-refreshspeed)</property>
- <property name="label" translatable="yes">Refresh speed</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -146,11 +152,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.multithreading">
+ <property name="label" translatable="yes">Enable multithreading</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Perform rendering and blitting on a separate thread (-multithreading)</property>
- <property name="label" translatable="yes">Enable multithreading</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -161,11 +167,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Performance.sdlvideofps">
+ <property name="label" translatable="yes">Show FPS</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Show the Frames per Second count (-sdlvideofps)</property>
- <property name="label" translatable="yes">Show FPS</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -201,6 +207,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -213,16 +220,17 @@
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Sound.sound">
+ <property name="label" translatable="yes">Enable sound</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable sound output (-sound)</property>
- <property name="label" translatable="yes">Enable sound</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -235,16 +243,17 @@
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Sound.samples">
+ <property name="label" translatable="yes">Enable samples</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable samples if available (-samples)</property>
- <property name="label" translatable="yes">Enable samples</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -260,6 +269,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -294,6 +304,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -335,6 +346,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -392,6 +404,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -408,13 +421,16 @@
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.log">
+ <property name="label" translatable="yes">Enable logging</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Generate an error.log file (-log)</property>
- <property name="label" translatable="yes">Enable logging</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment10">
@@ -422,11 +438,11 @@
<property name="left_padding">12</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.verbose">
+ <property name="label" translatable="yes">Verbose logging</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Display additional diagnostic information (-verbose)</property>
- <property name="label" translatable="yes">Verbose logging</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
</child>
@@ -436,14 +452,17 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Debugging.update_in_pause">
+ <property name="label" translatable="yes">Update in pause</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Keep calling video updates whilst paused (-update_in_pause)</property>
- <property name="label" translatable="yes">Update in pause</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -458,13 +477,16 @@
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.debug">
+ <property name="label" translatable="yes">Enable debugger</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable/disable debugger (-debug)</property>
- <property name="label" translatable="yes">Enable debugger</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment11">
@@ -487,6 +509,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -502,14 +525,17 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.oslog">
+ <property name="label" translatable="yes">Output error.log data to debugger</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Output error.log data to the system debugger (-oslog)</property>
- <property name="label" translatable="yes">Output error.log data to debugger</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -557,6 +583,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -580,6 +607,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -593,14 +621,17 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Misc.cheat">
+ <property name="label" translatable="yes">Enable cheat mode</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable cheats in games (-cheat)</property>
- <property name="label" translatable="yes">Enable cheat mode</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -611,11 +642,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Misc.skip_gameinfo">
+ <property name="label" translatable="yes">Skip gameinfo</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Skip the ROM information screen on launch (-skip_gameinfo)</property>
- <property name="label" translatable="yes">Skip gameinfo</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -656,16 +687,17 @@
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.autosave">
+ <property name="label" translatable="yes">Automatically save and load state</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Automatically save and load the current state (-autosave)</property>
- <property name="label" translatable="yes">Automatically save and load state</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -677,12 +709,12 @@
<property name="row_spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.mngwrite_toggle">
+ <property name="label" translatable="yes">Record MNG</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Records a .mng movie to the Snapshot directory (-recordmng)</property>
- <property name="label" translatable="yes">Record MNG</property>
<property name="xalign">0</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -691,12 +723,12 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.aviwrite_toggle">
+ <property name="label" translatable="yes">Record AVI</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Records a .avi movie to the Snapshot directory (-recordavi)</property>
- <property name="label" translatable="yes">Record AVI</property>
<property name="xalign">0</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -707,12 +739,12 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.wavwrite_toggle">
+ <property name="label" translatable="yes">Record WAV</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Records a .wav sound file to the Snapshot directory (-recordwav)</property>
- <property name="label" translatable="yes">Record WAV</property>
<property name="xalign">0</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -796,6 +828,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -818,6 +851,7 @@
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -833,6 +867,9 @@ OpenGL</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkHBox" id="hbox11">
@@ -844,6 +881,7 @@ OpenGL</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -865,11 +903,11 @@ OpenGL</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Video.window">
+ <property name="label" translatable="yes">Run in window</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">If this is selected, MAME will run in a window (-window)</property>
- <property name="label" translatable="yes">Run in window</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -878,11 +916,11 @@ OpenGL</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.maximize">
+ <property name="label" translatable="yes">Maximize</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Start in maximized window (-maximize)</property>
- <property name="label" translatable="yes">Maximize</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -891,11 +929,11 @@ OpenGL</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.keepaspect">
+ <property name="label" translatable="yes">Keep aspect ratio</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Constrain to the proper aspect ratio (-keepaspect)</property>
- <property name="label" translatable="yes">Keep aspect ratio</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -904,11 +942,11 @@ OpenGL</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.unevenstretch">
+ <property name="label" translatable="yes">Allow uneven stretching</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Allow non-integer stretch factors (-unevenstretch)</property>
- <property name="label" translatable="yes">Allow uneven stretching</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -928,6 +966,7 @@ OpenGL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -962,6 +1001,9 @@ scanlines</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Centre:</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment5">
@@ -973,24 +1015,25 @@ scanlines</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.centerh">
+ <property name="label" translatable="yes">Horizontal</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Centre horizontally (-centerh)</property>
- <property name="label" translatable="yes">Horizontal</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.centerv">
+ <property name="label" translatable="yes">Vertical</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Centre vertically (-centerv)</property>
- <property name="label" translatable="yes">Vertical</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1011,6 +1054,20 @@ scanlines</property>
</packing>
</child>
<child>
+ <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.waitvsync">
+ <property name="label" translatable="yes">Reduce tearing effects</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Wait for VBLANK before flipping screens factors (-waitvsync)</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox" id="hbox15">
<property name="visible">True</property>
<property name="spacing">6</property>
@@ -1022,11 +1079,13 @@ scanlines</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="preferences_combo:text:none,async,yv12,yuy2,yv12x2,yuy2x2:0:Video.scalemode">
<property name="visible">True</property>
+ <property name="has_tooltip">True</property>
<property name="tooltip" translatable="yes">Scale mode (-scalemode)</property>
<property name="items" translatable="yes">none
async
@@ -1042,7 +1101,7 @@ yuy2x2</property>
</child>
</widget>
<packing>
- <property name="position">8</property>
+ <property name="position">9</property>
</packing>
</child>
</widget>
@@ -1062,8 +1121,8 @@ yuy2x2</property>
<property name="label" translatable="yes">Video</property>
</widget>
<packing>
- <property name="type">tab</property>
<property name="tab_fill">False</property>
+ <property name="type">tab</property>
</packing>
</child>
<child>
@@ -1080,6 +1139,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1092,25 +1152,26 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Artwork.artwork_crop">
+ <property name="label" translatable="yes">Crop artwork</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Crop artwork to game screen size (-artwork_crop)</property>
- <property name="label" translatable="yes">Crop artwork</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Artwork.use_backdrops">
+ <property name="label" translatable="yes">Use backdrops</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Use backdrops if artwork is enabled and available (-use_backdrops)</property>
- <property name="label" translatable="yes">Use backdrops</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1121,11 +1182,11 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Artwork.use_bezels">
+ <property name="label" translatable="yes">Use bezels</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Use bezels if artwork is enabled and available (-use_bezels)</property>
- <property name="label" translatable="yes">Use bezels</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1136,11 +1197,11 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Artwork.use_overlays">
+ <property name="label" translatable="yes">Use overlays</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Use overlays if artwork is enabled and available (-use_overlays)</property>
- <property name="label" translatable="yes">Use overlays</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1169,9 +1230,9 @@ yuy2x2</property>
<property name="label" translatable="yes">Artwork</property>
</widget>
<packing>
- <property name="type">tab</property>
<property name="position">1</property>
<property name="tab_fill">False</property>
+ <property name="type">tab</property>
</packing>
</child>
<child>
@@ -1188,6 +1249,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1333,9 +1395,9 @@ yuy2x2</property>
<property name="label" translatable="yes">Screen</property>
</widget>
<packing>
- <property name="type">tab</property>
<property name="position">2</property>
<property name="tab_fill">False</property>
+ <property name="type">tab</property>
</packing>
</child>
<child>
@@ -1352,6 +1414,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1368,24 +1431,25 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.rol">
+ <property name="label" translatable="yes">Rotate left</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Rotate screen anticlockwise 90 degrees (-rol)</property>
- <property name="label" translatable="yes">Rotate left</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.ror">
+ <property name="label" translatable="yes">Rotate right</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Rotate screen clockwise 90 degrees (-ror)</property>
- <property name="label" translatable="yes">Rotate right</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1396,6 +1460,7 @@ yuy2x2</property>
</widget>
<packing>
<property name="padding">6</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1408,6 +1473,9 @@ yuy2x2</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Automatic Rotation</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment12">
@@ -1419,22 +1487,23 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.autorol">
+ <property name="label" translatable="yes">Rotate left</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Rotate left</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.autoror">
+ <property name="label" translatable="yes">Rotate right</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Rotate right</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1464,6 +1533,9 @@ yuy2x2</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Flip</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment13">
@@ -1475,24 +1547,25 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="flipx">
+ <property name="label" translatable="yes">Left-right</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Flip screen left-right (-flipx)</property>
- <property name="label" translatable="yes">Left-right</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="flipy">
+ <property name="label" translatable="yes">Up-down</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Flip screen upside-down (-flipy)</property>
- <property name="label" translatable="yes">Up-down</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1532,9 +1605,9 @@ yuy2x2</property>
<property name="label" translatable="yes">Rotation</property>
</widget>
<packing>
- <property name="type">tab</property>
<property name="position">3</property>
<property name="tab_fill">False</property>
+ <property name="type">tab</property>
</packing>
</child>
<child>
@@ -1551,6 +1624,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1563,13 +1637,16 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Vector.antialias">
+ <property name="label" translatable="yes">Antialias</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Use antialias when drawing vectors (-antialias)</property>
- <property name="label" translatable="yes">Antialias</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkTable" id="table4">
@@ -1653,9 +1730,9 @@ yuy2x2</property>
<property name="label" translatable="yes">Vector</property>
</widget>
<packing>
- <property name="type">tab</property>
<property name="position">4</property>
<property name="tab_fill">False</property>
+ <property name="type">tab</property>
</packing>
</child>
</widget>
@@ -1676,6 +1753,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1698,6 +1776,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1711,13 +1790,16 @@ yuy2x2</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.mouse">
+ <property name="label" translatable="yes">Enable mouse</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable mouse</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1728,10 +1810,10 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.joystick">
+ <property name="label" translatable="yes">Enable joystick</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable joystick</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1742,10 +1824,10 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.lightgun">
+ <property name="label" translatable="yes">Enable lightgun</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable lightgun</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1776,23 +1858,24 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.multimouse">
+ <property name="label" translatable="yes">Mouse</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Mouse</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.multikeyboard">
+ <property name="label" translatable="yes">Keyboard</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Keyboard</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1830,23 +1913,24 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.steadykey">
+ <property name="label" translatable="yes">Enable steadykey support</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable steadykey support</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.offscreen_reload">
+ <property name="label" translatable="yes">Convert lightgun button 2 to offscreen support</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Convert lightgun button 2 to offscreen support</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1905,6 +1989,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1917,16 +2002,17 @@ yuy2x2</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.filter">
+ <property name="label" translatable="yes">Filter</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable bilinear filtering (-filter)</property>
- <property name="label" translatable="yes">Filter</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1942,6 +2028,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1964,11 +2051,11 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_notexturerect">
+ <property name="label" translatable="yes">Disable OpenGL GL_ARB_texture_rectangle</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Disable OpenGL GL_ARB_texture_rectangle (-gl_notexturerect)</property>
- <property name="label" translatable="yes">Disable OpenGL GL_ARB_texture_rectangle</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1979,11 +2066,11 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:OpenGL.gl_forcepow2texture">
+ <property name="label" translatable="yes">Force power of two textures</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Force power of two textures (gl_forcepow2texture)</property>
- <property name="label" translatable="yes">Force power of two textures</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1994,11 +2081,11 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_vbo">
+ <property name="label" translatable="yes">Enable OpenGL VBO</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable OpenGL VBO if available (-gl_vbo)</property>
- <property name="label" translatable="yes">Enable OpenGL VBO</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -2009,11 +2096,11 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_pbo">
+ <property name="label" translatable="yes">Enable OpenGL VBO</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable OpenGL PBO if available (-gl_pbo)</property>
- <property name="label" translatable="yes">Enable OpenGL VBO</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -2024,11 +2111,11 @@ yuy2x2</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_glsl">
+ <property name="label" translatable="yes">Enable OpenGL GLSL</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable OpenGL GLSL filtering if available (-gl_glsl)</property>
- <property name="label" translatable="yes">Enable OpenGL GLSL</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -2049,6 +2136,7 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -2071,11 +2159,11 @@ Gaussian blur</property>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_glsl_vid_attr">
+ <property name="label" translatable="yes">Let OpenGL manage brightness and contrast</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Enable OpenGL GLSL handling of brightness and contrast (-gl_glsl_vid_attr)</property>
- <property name="label" translatable="yes">Let OpenGL manage brightness and contrast</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
diff --git a/data/options.glade b/data/options_legacy.glade
similarity index 51%
copy from data/options.glade
copy to data/options_legacy.glade
index 7ae3cf6..92ba217 100644
--- a/data/options.glade
+++ b/data/options_legacy.glade
@@ -1,801 +1,286 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sun Dec 7 16:23:34 2008 -->
+<!--Generated with glade3 3.4.5 on Tue Jan 6 23:18:01 2009 -->
<glade-interface>
- <widget class="GtkWindow" id="PerformanceWindow">
+ <widget class="GtkWindow" id="Display">
<child>
- <widget class="GtkVBox" id="PerformanceVBox">
+ <widget class="GtkNotebook" id="DisplayNotebook">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Performance</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.autoframeskip">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Automatically skip frames (-autoframeskip)</property>
- <property name="label" translatable="yes">Automatic frameskip</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="frameskip_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Frames to skip:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="preferences_spin:int:0:0:Performance.frameskip">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">0 0 12 1 10 10</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.throttle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Throttle game in sync with real time (-throttle)</property>
- <property name="label" translatable="yes">Throttle</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.sleep">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Sleeping when idle (-sleep)</property>
- <property name="label" translatable="yes">Sleep</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="speed_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Speed:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Performance.speed">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Control speed of gameplay; lower values are slower (-speed)</property>
- <property name="adjustment">1 0.10000000000000001 4 0.10000000000000001 1 1</property>
- <property name="restrict_to_fill_level">False</property>
- <property name="fill_level">4</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.refreshspeed">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Adjust gameplay speed to keep refresh rate lower than the screen (-refreshspeed)</property>
- <property name="label" translatable="yes">Refresh speed</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Performance.multithreading">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Perform rendering and blitting on a separate thread (-multithreading)</property>
- <property name="label" translatable="yes">Enable multithreading</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Performance.sdlvideofps">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Show the Frames per Second count (-sdlvideofps)</property>
- <property name="label" translatable="yes">Show FPS</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">7</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="SoundWindow">
- <child>
- <widget class="GtkVBox" id="SoundVBox">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Sound</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
<child>
- <widget class="GtkAlignment" id="alignment2">
+ <widget class="GtkVBox" id="vbox10">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkVBox" id="vbox3">
+ <widget class="GtkLabel" id="label29">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Sound.sound">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable sound output (-sound)</property>
- <property name="label" translatable="yes">Enable sound</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Sound.samples">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable samples if available (-samples)</property>
- <property name="label" translatable="yes">Enable samples</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Sample rate</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkComboBox" id="preferences_combo:text:48000,44100,22050,11025:0:Sound.samplerate">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Sample rate</property>
- <property name="items" translatable="yes">48000
-44100
-22050
-11025</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Volume</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Sound.volume">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Sound volume in decibels (-volume)</property>
- <property name="adjustment">-10 -32 0 1 10 10</property>
- <property name="restrict_to_fill_level">False</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">dB</property>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Audio latency</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="preferences_spin:int:3:0:Sound.audio_latency">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Set audio latency (increase to reduce glitches, decrease for responsiveness (-audio_latency)</property>
- <property name="adjustment">3 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>Display options</b></property>
+ <property name="use_markup">True</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
</child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="DebuggingWindow">
- <child>
- <widget class="GtkVBox" id="DebuggingVBox">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label27">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Debugging</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment9">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox6">
+ <widget class="GtkAlignment" id="alignment8">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox7">
+ <widget class="GtkVBox" id="vbox12">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.log">
+ <widget class="GtkCheckButton" id="preferences_Video-fullscreen">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Generate an error.log file (-log)</property>
- <property name="label" translatable="yes">Enable logging</property>
+ <property name="label" translatable="yes">Fullscreen</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
</child>
<child>
- <widget class="GtkAlignment" id="alignment10">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.verbose">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Display additional diagnostic information (-verbose)</property>
- <property name="label" translatable="yes">Verbose logging</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Debugging.update_in_pause">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Keep calling video updates whilst paused (-update_in_pause)</property>
- <property name="label" translatable="yes">Update in pause</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.debug">
+ <widget class="GtkCheckButton" id="preferences_Video-dirty">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable/disable debugger (-debug)</property>
- <property name="label" translatable="yes">Enable debugger</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Draw only changes</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment11">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox19">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkHBox" id="hbox5">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label28">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Debug script:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="preferences_entry:text:::Debugging.debugscript">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Script for debugger (-debugscript)</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Debugging.oslog">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Output error.log data to the system debugger (-oslog)</property>
- <property name="label" translatable="yes">Output error.log data to debugger</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="MiscWindow">
- <child>
- <widget class="GtkVBox" id="MiscVBox">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label38">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Miscellaneous Options</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment17">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox13">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
- <property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label39">
+ <widget class="GtkCheckButton" id="preferences_Video-throttle">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">BIOS name</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Throttle</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="preferences_entry:text:::Misc.bios">
+ <widget class="GtkCheckButton" id="preferences_Video-sleepidle">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Sleep when idle</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
</widget>
</child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Misc.cheat">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable cheats in games (-cheat)</property>
- <property name="label" translatable="yes">Enable cheat mode</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Misc.skip_gameinfo">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Skip the ROM information screen on launch (-skip_gameinfo)</property>
- <property name="label" translatable="yes">Skip gameinfo</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label37">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>State and Playback Options</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment20">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox18">
+ <widget class="GtkLabel" id="label31">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.autosave">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Automatically save and load the current state (-autosave)</property>
- <property name="label" translatable="yes">Automatically save and load state</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>Resolution</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment10">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">12</property>
<child>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
- <property name="n_rows">3</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.mngwrite_toggle">
+ <widget class="GtkCheckButton" id="preferences_Video-autodouble">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Records a .mng movie to the Snapshot directory (-recordmng)</property>
- <property name="label" translatable="yes">Record MNG</property>
- <property name="xalign">0</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Autodouble</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="x_options"></property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.aviwrite_toggle">
+ <widget class="GtkLabel" id="heightscale_label">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Records a .avi movie to the Snapshot directory (-recordavi)</property>
- <property name="label" translatable="yes">Record AVI</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <property name="label" translatable="yes">Height scale:</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="widthscale_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Width scale:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options"></property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Playback.wavwrite_toggle">
+ <widget class="GtkLabel" id="bpp_label">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Records a .wav sound file to the Snapshot directory (-recordwav)</property>
- <property name="label" translatable="yes">Record WAV</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <property name="label" translatable="yes">Bit per pixels:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
- <property name="x_options"></property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="preferences_Video-bpp">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">Auto
+8 bits
+15 bits
+16 bits
+32 bits</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="preferences_entry:toggletext:default.mng::Playback.mngwrite">
+ <widget class="GtkSpinButton" id="preferences_Video-heightscale">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">4</property>
+ <property name="adjustment">1 1 8 1 10 10</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="x_options"></property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="preferences_entry:toggletext:default.avi::Playback.aviwrite">
+ <widget class="GtkSpinButton" id="preferences_Video-widthscale">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">4</property>
+ <property name="adjustment">1 1 8 1 10 10</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options"></property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="preferences_entry:toggletext:default.wav::Playback.wavwrite">
+ <widget class="GtkSpinButton" id="preferences_Video-arbheight">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">4</property>
+ <property name="adjustment">1 0 4096 1 8 1</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options"></property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label41">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Scale video to height:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
</child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="DisplayWindow">
- <child>
- <widget class="GtkNotebook" id="DisplayVBox">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkVBox" id="video_vbox">
- <property name="visible">True</property>
- <property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label19">
+ <widget class="GtkLabel" id="label32">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Video</b></property>
+ <property name="label" translatable="yes"><b>Rotation</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -803,246 +288,76 @@
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox5">
+ <widget class="GtkVBox" id="vbox18">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox6">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Video mode:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkComboBox" id="preferences_combo:text:soft,opengl:0:Video.video">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Whether software (soft) or hardware (OpenGL) acceleration is used (-video)</property>
- <property name="items" translatable="yes">Software
-OpenGL</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox11">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="label22">
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Number of screens:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="entry1">
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Number of screens to create - MAME only supports 1 (-numscreens)</property>
- <property name="editable">False</property>
- <property name="text" translatable="yes">1</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Video.window">
+ <widget class="GtkCheckButton" id="preferences_Video-ror">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">If this is selected, MAME will run in a window (-window)</property>
- <property name="label" translatable="yes">Run in window</property>
+ <property name="label" translatable="yes">Rotate right</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="position">2</property>
+ <property name="expand">False</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.maximize">
+ <widget class="GtkCheckButton" id="preferences_Video-rol">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Start in maximized window (-maximize)</property>
- <property name="label" translatable="yes">Maximize</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Rotate left</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="position">3</property>
+ <property name="expand">False</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.keepaspect">
+ <widget class="GtkCheckButton" id="preferences_Video-norotate">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Constrain to the proper aspect ratio (-keepaspect)</property>
- <property name="label" translatable="yes">Keep aspect ratio</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Do not apply rotation</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="position">4</property>
+ <property name="expand">False</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.unevenstretch">
+ <widget class="GtkCheckButton" id="preferences_Video-flipy">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Allow non-integer stretch factors (-unevenstretch)</property>
- <property name="label" translatable="yes">Allow uneven stretching</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Flip screen upside-down</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Effect name:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkComboBox" id="preferences_combo:text:none,aperture1x2rb,aperture1x3rb,aperture2x4bg,aperture2x4rb,aperture4x6,scanlines:0:Video.effect">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Name of a .png file in the Artwork directory to use for scanlines effect (-effect)</property>
- <property name="items" translatable="yes">none
-aperture1x2rb
-aperture1x3rb
-aperture2x4bg
-aperture2x4rb
-aperture4x6
-scanlines</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
<property name="expand">False</property>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Centre:</property>
- </widget>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkHBox" id="hbox10">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.centerh">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Centre horizontally (-centerh)</property>
- <property name="label" translatable="yes">Horizontal</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Video.centerv">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Centre vertically (-centerv)</property>
- <property name="label" translatable="yes">Vertical</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">7</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox15">
+ <widget class="GtkCheckButton" id="preferences_Video-flipx">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label29">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">YUV mode:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkComboBox" id="preferences_combo:text:none,async,yv12,yuy2,yv12x2,yuy2x2:0:Video.scalemode">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Scale mode (-scalemode)</property>
- <property name="items" translatable="yes">none
-async
-yv12
-yuy2
-yv12x2
-yuy2x2</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Flip screen left-right</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="position">8</property>
+ <property name="expand">False</property>
+ <property name="position">4</property>
</packing>
</child>
</widget>
@@ -1051,15 +366,15 @@ yuy2x2</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">5</property>
</packing>
</child>
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label2">
+ <widget class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Video</property>
+ <property name="label" translatable="yes">Display Options</property>
</widget>
<packing>
<property name="type">tab</property>
@@ -1067,250 +382,287 @@ yuy2x2</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="artwork_vbox">
+ <widget class="GtkVBox" id="vbox11">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label31">
+ <widget class="GtkLabel" id="label34">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Artwork</b></property>
+ <property name="label" translatable="yes"><b>Effects</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment15">
+ <widget class="GtkAlignment" id="alignment12">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox12">
+ <widget class="GtkVBox" id="effects_vbox">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:Artwork.artwork_crop">
+ <widget class="GtkComboBox" id="preferences_Video-effect">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Crop artwork to game screen size (-artwork_crop)</property>
- <property name="label" translatable="yes">Crop artwork</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">None
+Smooth Scaling Effect
+Low Quality Filter
+High Quality Filter
+6-tap Filter with H-Scanlines
+Light Scanlines
+RGB Scanlines
+Deluxe Scanlines
+Black Scanlines</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Artwork.use_backdrops">
+ <widget class="GtkCheckButton" id="preferences_Video-scanlines">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Use backdrops if artwork is enabled and available (-use_backdrops)</property>
- <property name="label" translatable="yes">Use backdrops</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Use Scanlines</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Artwork.use_bezels">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Use bezels if artwork is enabled and available (-use_bezels)</property>
- <property name="label" translatable="yes">Use bezels</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Artwork.use_overlays">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Use overlays if artwork is enabled and available (-use_overlays)</property>
- <property name="label" translatable="yes">Use overlays</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Artwork</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="screen_vbox">
- <property name="visible">True</property>
- <property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label8">
+ <widget class="GtkLabel" id="label36">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Screen</b></property>
+ <property name="label" translatable="yes"><b>Corrections</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment4">
+ <widget class="GtkAlignment" id="alignment13">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkTable" id="table1">
+ <widget class="GtkVBox" id="correction_vbox">
<property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
- <widget class="GtkLabel" id="label9">
+ <widget class="GtkLabel" id="gamma_label">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Brightness</property>
+ <property name="label" translatable="yes">Gamma correction</property>
</widget>
<packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label11">
+ <widget class="GtkHScale" id="preferences_Video-gamma">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Contrast</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">0.5 0.5 2 0.050000000000000003 0.050000000000000003 0</property>
+ <property name="digits">2</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label12">
+ <widget class="GtkLabel" id="brightness_label">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Gamma</property>
+ <property name="label" translatable="yes">Brightness correction</property>
</widget>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="preferences_Video-brightness">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">0.5 0.5 2 0.050000000000000003 0.050000000000000003 0</property>
+ <property name="digits">2</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label13">
+ <widget class="GtkLabel" id="brightness_label1">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Pause Brightness</property>
- <property name="wrap">True</property>
+ <property name="label" translatable="yes">Pause brightness</property>
</widget>
<packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Screen.brightness">
+ <widget class="GtkHScale" id="preferences_Video-pause-brightness">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Brightness correction (-brightness)</property>
- <property name="adjustment">1 0.10000000000000001 2 0.050000000000000003 0.10000000000000001 0.10000000000000001</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">0.5 0.5 2 0.050000000000000003 0.050000000000000003 0</property>
+ <property name="digits">2</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label37">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>Frame skipping</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkTable" id="table3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkComboBox" id="preferences_Video-frameskip">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">Draw every frame
+Skip 1 out of 12 frames
+Skip 2 out of 12 frames
+Skip 3 out of 12 frames
+Skip 4 out of 12 frames
+Skip 5 out of 12 frames
+Skip 6 out of 12 frames
+Skip 7 out of 12 frames
+Skip 8 out of 12 frames
+Skip 9 out of 12 frames
+Skip 10 out of 12 frames
+Skip 11 out of 12 frames
+Skip 12 out of 12 frames</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Screen.contrast">
+ <widget class="GtkLabel" id="fs_label">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Contrast correction (-contrast)</property>
- <property name="adjustment">1 0.10000000000000001 2 0.050000000000000003 0.10000000000000001 0.10000000000000001</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Frames to skip:</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Screen.gamma">
+ <widget class="GtkCheckButton" id="preferences_Video-autoframeskip">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Gamma correction (-gamma)</property>
- <property name="adjustment">1 0.10000000000000001 3 0.050000000000000003 0.10000000000000001 0.10000000000000001</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Automatic</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="maxfs_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Max frameskip:</property>
+ </widget>
+ <packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Screen.pause_brightness">
+ <widget class="GtkSpinButton" id="preferences_Video-maxautoframeskip">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Brightness when paused (-pause_brightness)</property>
- <property name="adjustment">0.65000000000000002 0 1 0.050000000000000003 0.050000000000000003 0.10000000000000001</property>
+ <property name="adjustment">1 1 12 1 1 1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget>
@@ -1318,75 +670,77 @@ yuy2x2</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">5</property>
</packing>
</child>
</widget>
<packing>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label7">
+ <widget class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="label" translatable="yes">Screen</property>
+ <property name="label" translatable="yes">Effects & Corrections</property>
</widget>
<packing>
<property name="type">tab</property>
- <property name="position">2</property>
+ <property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="rotation_vbox">
+ <widget class="GtkVBox" id="vector_vbox">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
- <widget class="GtkLabel" id="label24">
+ <widget class="GtkLabel" id="label2">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Rotation</b></property>
+ <property name="label" translatable="yes"><b>Vector options</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="padding">6</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment8">
+ <widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox10">
+ <widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox14">
+ <widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.rol">
+ <widget class="GtkLabel" id="label21">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Rotate screen anticlockwise 90 degrees (-rol)</property>
- <property name="label" translatable="yes">Rotate left</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Vector resolution:</property>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.ror">
+ <widget class="GtkComboBox" id="preferences_Vector-vectorres">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Rotate screen clockwise 90 degrees (-ror)</property>
- <property name="label" translatable="yes">Rotate right</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">320x200
+640x480
+800x600
+1024x768
+1280x1024
+1600x1200</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -1395,129 +749,313 @@ yuy2x2</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="padding">6</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox11">
+ <widget class="GtkTable" id="table4">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label25">
+ <widget class="GtkHScale" id="preferences_Vector-intensity">
<property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">0.5 0.5 3 0.10000000000000001 1 0</property>
+ <property name="digits">2</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="preferences_Vector-flicker">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">0 0 100 1 10 10</property>
+ <property name="digits">0</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="preferences_Vector-beam">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">1 1 16 1 1 1</property>
+ <property name="digits">2</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="intensity_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Intensity</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="flicker_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Flicker</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="beam_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Automatic Rotation</property>
+ <property name="label" translatable="yes">Beam size</property>
</widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
</child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">6</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Vector-antialias">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Draw antialiased vectors</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Vector-translucency">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Draw translucent vectors</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Vector</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>Artwork options</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">6</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="artwork_table1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Artwork-artwork">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Use additional game artwork:</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment24">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">12</property>
<child>
- <widget class="GtkAlignment" id="alignment12">
+ <widget class="GtkVBox" id="vbox6">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox12">
+ <widget class="GtkCheckButton" id="preferences_Artwork-use_backdrops">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.autorol">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Rotate left</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Rotation.autoror">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Rotate right</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Backdrops</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Artwork-use_bezels">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Bezels</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Artwork-use_overlays">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Overlays</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
</child>
</widget>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox14">
+ <widget class="GtkHBox" id="hbox14">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label26">
+ <widget class="GtkLabel" id="label7">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Flip</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Artwork resolution:</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment13">
+ <widget class="GtkComboBox" id="preferences_Artwork-artwork_resolution">
<property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkHBox" id="hbox13">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="flipx">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Flip screen left-right (-flipx)</property>
- <property name="label" translatable="yes">Left-right</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="flipy">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Flip screen upside-down (-flipy)</property>
- <property name="label" translatable="yes">Up-down</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">Auto
+Standard
+High</property>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Artwork-artwork_crop">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Crop artwork</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -1527,9 +1065,9 @@ yuy2x2</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label10">
+ <widget class="GtkLabel" id="label6">
<property name="visible">True</property>
- <property name="label" translatable="yes">Rotation</property>
+ <property name="label" translatable="yes">Artwork</property>
</widget>
<packing>
<property name="type">tab</property>
@@ -1538,99 +1076,150 @@ yuy2x2</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vector_vbox">
+ <widget class="GtkVBox" id="vbox7">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label20">
+ <widget class="GtkLabel" id="label28">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Vector</b></property>
+ <property name="label" translatable="yes"><b>OpenGL</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment7">
+ <widget class="GtkAlignment" id="alignment16">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox1">
+ <widget class="GtkVBox" id="vbox23">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Vector.antialias">
+ <widget class="GtkCheckButton" id="preferences_OpenGL-gldblbuffer">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Use antialias when drawing vectors (-antialias)</property>
- <property name="label" translatable="yes">Antialias</property>
+ <property name="label" translatable="yes">Enable double buffering</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
</child>
<child>
- <widget class="GtkTable" id="table4">
+ <widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label21">
+ <widget class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Beam width:</property>
+ <property name="label" translatable="yes">GL Texture size</property>
</widget>
<packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label23">
+ <widget class="GtkSpinButton" id="preferences_OpenGL-gltexture_size">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Flicker:</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">0 0 2048 1 10 10</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="position">1</property>
</packing>
</child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_OpenGL-glbilinear">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable bilinear filtering</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox19">
+ <property name="visible">True</property>
<child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Vector.beam">
+ <widget class="GtkLabel" id="label30">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Set vector beam width (-beam)</property>
- <property name="adjustment">1 0 100 1 10 10</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Beam size for vector games</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="expand">False</property>
</packing>
</child>
<child>
- <widget class="GtkHScale" id="preferences_hscale:double:1.0:0:Vector.flicker">
+ <widget class="GtkHScale" id="preferences_OpenGL-glbeam">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Set vector flicker effect (-flicker)</property>
<property name="adjustment">0 0 100 1 10 10</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
<packing>
- <property name="position">1</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_OpenGL-glantialias">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable antialiasing</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_OpenGL-glantialiasvec">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Enable vector antialiasing</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_OpenGL-cabview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Start in cabinet view</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">6</property>
</packing>
</child>
</widget>
@@ -1638,7 +1227,6 @@ yuy2x2</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -1648,9 +1236,9 @@ yuy2x2</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label16">
+ <widget class="GtkLabel" id="label27">
<property name="visible">True</property>
- <property name="label" translatable="yes">Vector</property>
+ <property name="label" translatable="yes">OpenGL</property>
</widget>
<packing>
<property name="type">tab</property>
@@ -1661,205 +1249,516 @@ yuy2x2</property>
</widget>
</child>
</widget>
- <widget class="GtkWindow" id="InputWindow">
+ <widget class="GtkWindow" id="Miscellaneous">
<child>
- <widget class="GtkVBox" id="InputVBox">
+ <widget class="GtkVBox" id="MiscVBox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label30">
+ <widget class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Input</b></property>
+ <property name="label" translatable="yes"><b>Miscellaneous Options</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment14">
+ <widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox16">
+ <widget class="GtkVBox" id="vbox24">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox16">
+ <widget class="GtkCheckButton" id="preferences_MAME-cheat">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Enable game cheats</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_MAME-skip_disclaimer">
<property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Skip disclaimer info</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_MAME-skip_gameinfo">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Skip game info</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label33">
+ <widget class="GtkLabel" id="bios_label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Controller directory</property>
+ <property name="label" translatable="yes">Neo-Geo Bios:</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="ctrlr">
- <property name="can_focus">True</property>
+ <widget class="GtkComboBox" id="preferences_MAME-bios">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">Europe, 1 Slot (also been seen on a 4 slot)
+Europe, 4 Slot
+US, 2 Slot
+US, 6 Slot (V5?)
+Asia S3 Ver 6
+Japan, Ver 6 VS Bios
+Japan, Older
+Universe Bios v1.0 (hack)
+Universe Bios v1.1 (hack)
+Debug (Development) Bios
+AES Console (Asia?) Bios
+Universe Bios v1.2 (hack)</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.mouse">
+ <widget class="GtkCheckButton" id="preferences_MAME-autosave">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable mouse</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Enable automatic save/restore</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.joystick">
+ <widget class="GtkCheckButton" id="preferences_MAME-keyboard_leds">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable joystick</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Use keyboard LEDs as game indicators</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table5">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkEntry" id="preferences_File.stderr-file">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="preferences_File.stdout-file">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="stderr_lbl">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Stderr logfile</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="stdout_lbl">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Stdout logfile</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">6</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.lightgun">
+ <widget class="GtkCheckButton" id="preferences_File-log">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable lightgun</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Log debug info</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">7</property>
</packing>
</child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkWindow" id="Sound">
+ <child>
+ <widget class="GtkVBox" id="SoundVBox">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>General sound options</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment11">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkTable" id="table11">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="n_rows">8</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label34">
+ <widget class="GtkHBox" id="bufsize_hbox1">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Enable input from multiple connected devices</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Buffer size</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="preferences_Sound-bufsize">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">3.2999999999999998 1 30 1 1 0</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="ms_label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">frames</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment16">
+ <widget class="GtkHBox" id="volume_hbox1">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox17">
+ <widget class="GtkLabel" id="label12">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.multimouse">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Mouse</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.multikeyboard">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Keyboard</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Volume</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="preferences_Sound-volume">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">0 -32 0 1 1 0</property>
+ <property name="digits">0</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="db_label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">dB</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
</child>
</widget>
<packing>
- <property name="position">5</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label35">
+ <widget class="GtkComboBox" id="preferences_Sound-samplefreq">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Other options</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">8000
+11025
+16000
+22050
+44100
+48000</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">6</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment18">
+ <widget class="GtkComboBoxEntry" id="Preferences_Sound.audiodevice">
<property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkVBox" id="vbox17">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">/dev/dsp
+/dev/dsp0
+/dev/dsp1
+/dev/dsp2
+/dev/dsp3
+/dev/audio
+/dev/null</property>
+ <child internal-child="entry">
+ <widget class="GtkEntry" id="comboboxentry-entry2">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.steadykey">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable steadykey support</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:Input.offscreen_reload">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Convert lightgun button 2 to offscreen support</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">20</property>
</widget>
</child>
</widget>
<packing>
- <property name="position">7</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBoxEntry" id="Preferences_Sound.mixerdevice">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">/dev/mixer</property>
+ <child internal-child="entry">
+ <widget class="GtkEntry" id="comboboxentry-entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">20</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="samplefreq_label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Sample rate:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="audiodevice_label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Audio device:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="mixerdevice_label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Mixer device:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Sound-fakesound">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Fake sound</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Sound-samples">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Use samples</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Sound-sound">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Enable sound</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
@@ -1867,221 +1766,356 @@ yuy2x2</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="padding">6</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="StatePlaybackWindow">
- <child>
- <widget class="GtkVBox" id="StatePlayback">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
<child>
- <placeholder/>
+ <widget class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>Digital sound and mixer options</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkAlignment" id="alignment28">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkTable" id="table12">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="soundmixerlabel">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Mixer plugin:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="soundfile_label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Sound file name:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="preferences_Sound-sound_mixer_plugin">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">OSS
+</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="soundfile_entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">50</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="dsp_plugin_label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">DSP Plugin:</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="preferences_Sound-dsp_plugin">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">OSS
+SDL
+aRTS</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Sound-timer">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Timer based audio</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">6</property>
+ <property name="position">3</property>
+ </packing>
</child>
</widget>
</child>
</widget>
- <widget class="GtkWindow" id="OpenGLWindow">
+ <widget class="GtkWindow" id="Input">
<child>
- <widget class="GtkVBox" id="OpenGLVBox">
+ <widget class="GtkVBox" id="InputVBox">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label36">
+ <widget class="GtkLabel" id="label9">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>OpenGL</b></property>
+ <property name="label" translatable="yes"><b>Joystick</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment19">
+ <widget class="GtkAlignment" id="alignment17">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox15">
+ <widget class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.filter">
+ <widget class="GtkHBox" id="hbox10">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable bilinear filtering (-filter)</property>
- <property name="label" translatable="yes">Filter</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox22">
- <property name="visible">True</property>
- <property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label40">
+ <widget class="GtkLabel" id="joytype_label1">
<property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Prescale</property>
+ <property name="label" translatable="yes">Joystick type:</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkSpinButton" id="preferences_spin:int:1:0:OpenGL.prescale">
+ <widget class="GtkComboBox" id="preferences_Input-joytype">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Scale game graphics before rendering (-prescale)</property>
- <property name="adjustment">1 1 8 1 10 10</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="items" translatable="yes">No joystick
+SDL joystick</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="padding">6</property>
<property name="position">1</property>
</packing>
</child>
</widget>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_Input-analogstick">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Analog joystick</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_notexturerect">
+ <widget class="GtkCheckButton" id="preferences_Input-ugcicoin">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Disable OpenGL GL_ARB_texture_rectangle (-gl_notexturerect)</property>
- <property name="label" translatable="yes">Disable OpenGL GL_ARB_texture_rectangle</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">UGCI (tm) Coin/Play support</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:OpenGL.gl_forcepow2texture">
+ <widget class="GtkCheckButton" id="preferences_Input-steadykey">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Force power of two textures (gl_forcepow2texture)</property>
- <property name="label" translatable="yes">Force power of two textures</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Enable steadykey support</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_vbo">
+ <widget class="GtkCheckButton" id="preferences_Input-usbpspad">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable OpenGL VBO if available (-gl_vbo)</property>
- <property name="label" translatable="yes">Enable OpenGL VBO</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">USB PS Game Pads</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_pbo">
+ <widget class="GtkCheckButton" id="preferences_Input-rapidfire">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable OpenGL PBO if available (-gl_pbo)</property>
- <property name="label" translatable="yes">Enable OpenGL VBO</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Rapid-fire</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>X11-input</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_X11Input-grabmouse">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Select mouse grabbing</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ </child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_glsl">
+ <widget class="GtkCheckButton" id="preferences_X11Input-grabkeyboard">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable OpenGL GLSL filtering if available (-gl_glsl)</property>
- <property name="label" translatable="yes">Enable OpenGL GLSL</property>
+ <property name="label" translatable="yes">Select keyboard grabbing</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">6</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox21">
+ <widget class="GtkCheckButton" id="preferences_X11Input-alwaysusemouse">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label41">
- <property name="xalign">0</property>
- <property name="label" translatable="yes">gl_glsl_filter</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkComboBox" id="preferences_combo:text:0,1,2:0:OpenGL.gl_glsl_filter">
- <property name="visible">True</property>
- <property name="items" translatable="yes">No filter
-Bilinear
-Gaussian blur</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Always use mouse</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="position">7</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:OpenGL.gl_glsl_vid_attr">
+ <widget class="GtkCheckButton" id="preferences_X11Input-cursor">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Enable OpenGL GLSL handling of brightness and contrast (-gl_glsl_vid_attr)</property>
- <property name="label" translatable="yes">Let OpenGL manage brightness and contrast</property>
+ <property name="label" translatable="yes">Show cursor</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">8</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="preferences_X11Input-winkeys">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable mapping of Windows keys</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="position">4</property>
</packing>
</child>
</widget>
@@ -2089,8 +2123,7 @@ Gaussian blur</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
</widget>
diff --git a/gmameui.spec b/gmameui.spec
index 2a43cb3..4ffc67d 100644
--- a/gmameui.spec
+++ b/gmameui.spec
@@ -1,5 +1,5 @@
Name: gmameui
-Version: 0.2.8
+Version: 0.2.9
Release: 1%{?dist}
Summary: GMAMEUI is a GTK+ MAME front-end
URL: http://gmameui.sourceforge.net/
diff --git a/src/Makefile.am b/src/Makefile.am
index 669f248..9d2aaa1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,6 +23,7 @@ gmameui_SOURCES = \
audit.c audit.h \
gmameui-audit-dlg.c gmameui-audit-dlg.h \
gmameui-rominfo-dlg.c gmameui-rominfo-dlg.h \
+ gmameui-search-entry.c gmameui-search-entry.h \
options_string.c options_string.h \
gtkjoy.c gtkjoy.h \
gui_prefs.c gui_prefs.h \
diff --git a/src/Makefile.in b/src/Makefile.in
index ed5eded..55a24fc 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -64,7 +64,8 @@ am_gmameui_OBJECTS = common.$(OBJEXT) gmameui.$(OBJEXT) \
gmameui-sidebar.$(OBJEXT) progression_window.$(OBJEXT) \
directories.$(OBJEXT) about.$(OBJEXT) audit.$(OBJEXT) \
gmameui-audit-dlg.$(OBJEXT) gmameui-rominfo-dlg.$(OBJEXT) \
- options_string.$(OBJEXT) gtkjoy.$(OBJEXT) gui_prefs.$(OBJEXT) \
+ gmameui-search-entry.$(OBJEXT) options_string.$(OBJEXT) \
+ gtkjoy.$(OBJEXT) gui_prefs.$(OBJEXT) \
gui_prefs_dialog.$(OBJEXT) unzip.$(OBJEXT) keyboard.$(OBJEXT) \
xmame_options.$(OBJEXT) mame-exec.$(OBJEXT) \
mame-exec-list.$(OBJEXT) mame_options.$(OBJEXT) \
@@ -255,6 +256,7 @@ gmameui_SOURCES = \
audit.c audit.h \
gmameui-audit-dlg.c gmameui-audit-dlg.h \
gmameui-rominfo-dlg.c gmameui-rominfo-dlg.h \
+ gmameui-search-entry.c gmameui-search-entry.h \
options_string.c options_string.h \
gtkjoy.c gtkjoy.h \
gui_prefs.c gui_prefs.h \
@@ -369,6 +371,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmameui-gamelist-view.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmameui-marshaller.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmameui-rominfo-dlg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmameui-search-entry.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmameui-sidebar.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gmameui.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gossip-cell-renderer-expander.Po at am__quote@
diff --git a/src/about.c b/src/about.c
index 8428db2..0430778 100644
--- a/src/about.c
+++ b/src/about.c
@@ -56,7 +56,7 @@ about_window_show (void)
"name", "GMAMEUI",
"version", VERSION,
"logo", pixbuf,
- "copyright", _("Copyright (c) 2007-2008 Andrew Burton"),
+ "copyright", _("Copyright (c) 2007-2009 Andrew Burton"),
"website", "http://gmameui.sourceforge.net",
"comments", _("A program to play MAME under Linux"),
"authors", authors,
@@ -134,7 +134,8 @@ create_CreditsWindow (GtkWindow *parent)
translators_label = gtk_label_new (_("Translators"));
translators = gtk_label_new(_("The following people translated GMAMEUI:\n"
"Brazilian Portugese (pt_BR) - Alfredo Jr <junix at linuxinabox.org>\n"
- "Italian (it) - Ugo Viti <ugo.viti at initzero.it>\n"));
+ "Italian (it) - Ugo Viti <ugo.viti at initzero.it>\n"
+ "Swedish (sv) - Daniel Nylander <dnylander at users.sourceforge.net>\n"));
gtk_widget_show (translators);
gtk_notebook_append_page (credits_notebook, translators, translators_label);
@@ -233,7 +234,7 @@ create_AboutWindow (void)
gtk_widget_show (label3);
gtk_box_pack_start (GTK_BOX (vbox2), label3, TRUE, TRUE, 0);
- text = g_strdup_printf ("<span size=\"small\">%s</span>", _("Copyright (c) 2007-2008 Andrew Burton"));
+ text = g_strdup_printf ("<span size=\"small\">%s</span>", _("Copyright (c) 2007-2009 Andrew Burton"));
label4 = gtk_label_new (text);
g_free (text);
gtk_label_set_use_markup (GTK_LABEL (label4), TRUE);
diff --git a/src/audit.c b/src/audit.c
index d199e27..e63efa5 100644
--- a/src/audit.c
+++ b/src/audit.c
@@ -542,7 +542,7 @@ mame_audit_start_full (void)
MameExec *exec;
gchar *rompath_option;
GList *listpointer;
- RomEntry *tmprom = NULL;
+ MameRomEntry *tmprom;
const gchar *option_name;
gchar *command;
@@ -566,8 +566,8 @@ mame_audit_start_full (void)
(listpointer != NULL);
listpointer = g_list_next (listpointer))
{
- tmprom = (RomEntry *) listpointer->data;
- tmprom->has_roms = NOT_AVAIL;
+ tmprom = (MameRomEntry *) listpointer->data;
+ g_object_set (tmprom, "has-roms", NOT_AVAIL, NULL);
}
rompath_option = create_rompath_options_string (exec);
diff --git a/src/callbacks.c b/src/callbacks.c
index 58d8ffe..9aa87c3 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -86,24 +86,19 @@ on_select_random_game_activate (GtkMenuItem *menuitem,
random_game = (gint) g_random_int_range (0, visible_games);
GMAMEUI_DEBUG ("random game#%i", random_game);
- gtk_tree_model_foreach (GTK_TREE_MODEL (main_gui.tree_model),
- foreach_find_random_rom_in_store,
- (gpointer *) random_game);
+ mame_gamelist_view_select_random_game (main_gui.displayed_list, random_game);
+
}
void update_favourites_list (gboolean add) {
Columns_type type;
- gui_prefs.current_game->favourite = add;
+ g_object_set (gui_prefs.current_game, "is-favourite", add, NULL);
gmameui_ui_set_favourites_sensitive (add);
- g_object_get (selected_filter, "type", &type, NULL);
- /* problems because the row values are completly changed, I redisplay the complete game list */
- if (type == FAVORITE)
- create_gamelist_content ();
- else
- update_game_in_list (gui_prefs.current_game);
+ mame_gamelist_view_update_game_in_list (main_gui.displayed_list,
+ gui_prefs.current_game);
}
void
@@ -228,7 +223,7 @@ quick_refresh_list (void)
{
static gboolean quick_check_running;
GList *list_pointer;
- RomEntry *rom;
+ MameRomEntry *rom;
GList *romlist;
if (quick_check_running) {
@@ -243,23 +238,25 @@ quick_refresh_list (void)
// FIXME TODO gtk_widget_set_sensitive (GTK_WIDGET (main_gui.refresh_menu), FALSE);
/* remove all information concerning the presence of roms */
for (list_pointer = g_list_first (romlist); list_pointer; list_pointer = g_list_next (list_pointer)) {
- rom = (RomEntry *)list_pointer->data;
- rom->has_roms = UNKNOWN;
+ rom = (MameRomEntry *) list_pointer->data;
+ g_object_set (rom, "has-roms", UNKNOWN, NULL);
}
- /* refresh the display */
- create_gamelist_content ();
+
+ /* Refresh the display */
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
mame_gamelist_set_not_checked_list (gui_prefs.gl, romlist);
quick_check ();
- /* final refresh only if we are in AVAILABLE or UNAVAILABLE Folder*/
+
+ /* Final refresh only if we are in AVAILABLE or UNAVAILABLE Folder*/
/* DELETE Not using FolderID in new prefs
if ((gui_prefs.FolderID == AVAILABLE) || (gui_prefs.FolderID == UNAVAILABLE)) {
create_gamelist_content ();
GMAMEUI_DEBUG ("Final Refresh");
}*/
quick_check_running = 0;
-// FIXME TODO gtk_widget_set_sensitive (GTK_WIDGET (main_gui.refresh_menu), TRUE);
+// FIXME TODO gtk_widget_set_sensitive (GTK_WIDGET (main_gui.refresh_menu), TRUE);*/
}
void
diff --git a/src/directories.c b/src/directories.c
index f64fc03..85b78e8 100644
--- a/src/directories.c
+++ b/src/directories.c
@@ -28,6 +28,7 @@
#include "gui.h"
#include "directories.h"
+#include "gmameui-gamelist-view.h"
/* Callbacks */
static void on_dir_browse_button_clicked (GtkWidget *widget, gpointer user_data);
@@ -402,8 +403,8 @@ mame_directories_dialog_response (GtkDialog *dialog, gint response)
mame_directories_dialog_save_changes (MAME_DIRECTORIES_DIALOG (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
-
- create_gamelist_content ();
+
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
}
break;
@@ -857,6 +858,8 @@ mame_directories_dialog_save_changes (MameDirectoriesDialog *dialog)
g_object_set (main_gui.gui_prefs, "rom-paths", va_paths, NULL);
g_value_array_free (va_paths);
va_paths = NULL;
+
+ /* FIXME TODO Prompt user to rebuild the gamelist */
/*
* FIXME TODO hiscore dir *
if (changed_flag) {
diff --git a/src/filters_list.c b/src/filters_list.c
index af39b8c..705829e 100644
--- a/src/filters_list.c
+++ b/src/filters_list.c
@@ -25,7 +25,8 @@
#include "filters_list.h"
#include "filter.h"
-#include "gui.h" /* Only needed for create_gamelist_content */
+#include "gui.h" /* main_gui */
+#include "gmameui-gamelist-view.h"
struct _GMAMEUIFiltersListPrivate
{
@@ -654,7 +655,7 @@ filters_list_row_activated_cb (GMAMEUIFiltersList *list,
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter,
- GMAMEUI_FILTER_LIST_MODEL_COLUMN_NAME, &name, -1);
+ GMAMEUI_FILTER_LIST_MODEL_COLUMN_NAME, &name, -1);
}
@@ -669,27 +670,25 @@ filters_list_selection_changed_cb (GtkTreeSelection *selection,
gchar *name;
gint folderid;
- if (!gtk_tree_selection_get_selected (selection,
- &model, &iter))
+ if (!gtk_tree_selection_get_selected (selection, &model, &iter))
return;
gtk_tree_model_get (model, &iter,
- GMAMEUI_FILTER_LIST_MODEL_COLUMN_FILTER, &filter,
- -1);
+ GMAMEUI_FILTER_LIST_MODEL_COLUMN_FILTER, &filter,
+ -1);
g_return_if_fail (filter != NULL); /* This will fail if the selected row is a group */
g_return_if_fail (GMAMEUI_IS_FILTER (filter));
- g_object_get (filter,
- "name", &name,
- "folderid", &folderid,
- NULL);
+ g_object_get (filter, "name", &name, "folderid", &folderid, NULL);
/* gui_prefs.FolderID = folderid;*/
selected_filter = filter; /* Set global variable for use when re-creating the gamelist content */
GMAMEUI_DEBUG ("About to recreate gamelist after filter selected");
- create_gamelist_content ();
+
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
+
GMAMEUI_DEBUG ("Done recreating gamelist after filter selected");
g_free (name);
diff --git a/src/game_list.c b/src/game_list.c
index 87f1fa5..c7e4142 100644
--- a/src/game_list.c
+++ b/src/game_list.c
@@ -29,6 +29,7 @@
#include "io.h"
#include "gui.h"
#include "rom_entry.h"
+#include "gmameui-gamelist-view.h"
#define LINE_BUF 1024
@@ -100,7 +101,7 @@ mame_gamelist_class_init (MameGamelistClass *klass)
static void
mame_gamelist_init (MameGamelist *gl)
{
-
+ int i;
GMAMEUI_DEBUG ("Creating mame_gamelist object");
gl->priv = g_new0 (MameGamelistPrivate, 1);
@@ -123,13 +124,15 @@ mame_gamelist_finalize (GObject *obj)
g_free (gl->priv->name);
if (gl->priv->version)
g_free (gl->priv->version);
+
GMAMEUI_DEBUG ("Freeing roms");
if (gl->priv->roms)
{
- g_list_foreach (gl->priv->roms, (GFunc) rom_entry_free, NULL);
+ g_list_foreach (gl->priv->roms, (GFunc) g_object_unref, NULL);
g_list_free (gl->priv->roms);
}
GMAMEUI_DEBUG ("Freeing roms... done");
+
if (gl->priv->years)
{
g_list_foreach (gl->priv->years, (GFunc) g_free, NULL);
@@ -259,25 +262,24 @@ glist_insert_unique (GList **list, const gchar *data) {
}
static gint
-compare_game_name (RomEntry *rom1,
- RomEntry *rom2)
+compare_game_name (MameRomEntry *rom1, MameRomEntry *rom2)
{
- return strcmp (rom1->clonesort, rom2->clonesort);
+ return g_ascii_strcasecmp (mame_rom_entry_get_clonesort (rom1),
+ mame_rom_entry_get_clonesort (rom2));
}
#define FIELDS_PER_RECORD 27 + (NB_CPU * 4)
-void mame_gamelist_add (MameGamelist *gl, RomEntry *rom) {
+void mame_gamelist_add (MameGamelist *gl, MameRomEntry *rom)
+{
gchar **manufacturer_fields;
int i;
-
+
g_return_if_fail (gl != NULL);
g_return_if_fail (rom != NULL);
- g_return_if_fail (rom->romname != NULL);
-
/*generate glist for manufacturers*/
- manufacturer_fields = rom_entry_get_manufacturers (rom);
+ manufacturer_fields = mame_rom_entry_get_manufacturers (rom);
if (manufacturer_fields) {
for (i = 0; i < 2; i++) {
if (manufacturer_fields[i])
@@ -285,38 +287,20 @@ void mame_gamelist_add (MameGamelist *gl, RomEntry *rom) {
}
g_strfreev (manufacturer_fields);
}
-/* FIXME TODO These should all be set in the rom creation */
- if (!rom->cloneof) {
- rom->cloneof = g_strdup ("-");
- }
-
- if (!rom->sampleof) {
- rom->sampleof = g_strdup ("-");
- }
- if (!rom->romof) {
- rom->romof = g_strdup ("-");
- }
-
- if (rom->cloneof[0] == '-') {
-
- /* original. Point to romname */
- rom->clonesort = rom->romname;
-
- } else {
- rom->clonesort = g_strdup_printf ("%s-%s",
- rom->cloneof , rom->romname);
- }
+
+ mame_rom_entry_set_default_fields (rom);
- if (!rom->year)
- rom_entry_set_year (rom, _("Unknown"));
- gl->priv->roms = g_list_insert_sorted (gl->priv->roms, (gpointer) rom, (GCompareFunc )compare_game_name);
+ gl->priv->roms = g_list_insert_sorted (gl->priv->roms,
+ (gpointer) rom,
+ (GCompareFunc) compare_game_name);
gl->priv->num_games++;
- if (rom->nb_samples > 0)
+ if (mame_rom_entry_has_samples (rom))
gl->priv->num_sample_games++;
+
}
GList* mame_gamelist_get_roms_glist (MameGamelist *gl) {
@@ -345,7 +329,7 @@ gboolean mame_gamelist_load (MameGamelist *gl)
gchar line[LINE_BUF];
gchar **tmp_array;
gchar *tmp, *p;
- RomEntry *rom;
+ MameRomEntry *rom;
gboolean exe_version_checked = FALSE;
gint offset;
int i;
@@ -391,7 +375,7 @@ gboolean mame_gamelist_load (MameGamelist *gl)
}
}
- rom = rom_entry_new ();
+ rom = mame_rom_entry_new ();
if (!rom || !tmp_array)
{
@@ -402,39 +386,32 @@ gboolean mame_gamelist_load (MameGamelist *gl)
return FALSE;
}
- g_strlcpy (rom->romname, tmp_array[0], MAX_ROMNAME);
- rom->gamename = g_strdup (tmp_array[1]);
- rom->gamenameext = g_strdup (tmp_array[2]);
- rom->the_trailer = !strcmp (tmp_array[3], "true");
- rom->is_bios = !strcmp (tmp_array[4], "true");
- rom_entry_set_year (rom, tmp_array[5]);
- rom->manu = g_strdup (tmp_array[6]);
- rom->cloneof = g_strdup (tmp_array[7]);
- rom->romof = g_strdup (tmp_array[8]);
- rom_entry_set_driver (rom, tmp_array[9]);
-
- rom->status = atoi (tmp_array[10]);
- rom->driver_status_color = atoi (tmp_array[11]);
- rom->driver_status_sound = atoi (tmp_array[12]);
- rom->driver_status_graphic = atoi (tmp_array[13]);
- rom->colors = atoi (tmp_array[14]);
+ mame_rom_entry_set_romname (rom, tmp_array[0]);
+ mame_rom_entry_set_gamename (rom, tmp_array[1]);
+ mame_rom_entry_set_gamenameext (rom, tmp_array[2]);
+ mame_rom_entry_set_isbios (rom, !strcmp (tmp_array[4], "true"));
+ mame_rom_entry_set_year (rom, tmp_array[5]);
+ mame_rom_entry_set_manufacturer (rom, tmp_array[6]);
+ mame_rom_entry_set_cloneof (rom, g_strdup (tmp_array[7]));
+ mame_rom_entry_set_romof (rom, g_strdup (tmp_array[8]));
+
+ mame_rom_entry_set_driver (rom, tmp_array[9]);
+
+ g_object_set (rom,
+ "the-trailer", !strcmp (tmp_array[3], "true"),
+ "driver-status", atoi (tmp_array[10]),
+ "driver-status-colour", atoi (tmp_array[11]),
+ "driver-status-sound", atoi (tmp_array[12]),
+ "driver-status-graphics", atoi (tmp_array[13]),
+ NULL);
/* offset of cpu infos in the array */
offset = 15;
for (j = 0; j < NB_CPU; j++)
{
- if (!strncmp (tmp_array[ (j * 2) + offset], "(sound)", 7)) {
- p = tmp_array[ (j * 2) + offset];
- p += 7;
- rom->cpu_info[j].name = g_strdup (p);
- rom->cpu_info[j].sound_flag = TRUE;
- }
- else
- {
- rom->cpu_info[j].name = g_strdup (tmp_array[ (j * 2) + offset]);
- rom->cpu_info[j].sound_flag = FALSE;
- }
- rom->cpu_info[j].clock = atoi (tmp_array[ (j * 2) + offset + 1]);
+ mame_rom_entry_add_cpu (rom, j,
+ tmp_array[ (j * 2) + offset],
+ atoi (tmp_array[ (j * 2) + offset + 1]));
}
/* calculate offset of sound cpu infos in the array */
@@ -442,31 +419,30 @@ gboolean mame_gamelist_load (MameGamelist *gl)
for (j = 0; j < NB_CPU; j++)
{
- if (strcmp (tmp_array[offset + (j * 2)], "")) {
- rom->sound_info[j].name = g_strdup (tmp_array[offset + (j * 2)]);
- }
- rom->sound_info[j].clock = atoi (tmp_array[offset + (j * 2) + 1]);
+ mame_rom_entry_add_soundcpu (rom, j,
+ tmp_array[offset + (j * 2)],
+ atoi (tmp_array[offset + (j * 2) + 1]));
}
offset = 15 + (NB_CPU * 4);
- rom->num_players = atoi (tmp_array[offset + 0]);
- rom->num_buttons = atoi (tmp_array[offset + 1]);
- rom->control = atoi (tmp_array[offset + 2]);
-
- rom->vector = !strcmp (tmp_array[offset + 3], "true");
-
- rom->screen_x = atoi (tmp_array[offset + 4]);
- rom->screen_y = atoi (tmp_array[offset + 5]);
- rom->screen_freq = atoi (tmp_array[offset + 6]);
- rom->horizontal = (*tmp_array[offset + 7] == 'h');
-
- rom->channels = atoi (tmp_array[offset + 8]);
-
- rom->nb_roms = atoi (tmp_array[offset + 9]);
- rom->nb_samples = atoi (tmp_array[offset + 10]);
- rom->sampleof = g_strdup (tmp_array[offset + 11]);
-
+ g_object_set (rom,
+ "num-colours", atoi (tmp_array[14]),
+ "num-players", atoi (tmp_array[offset + 0]),
+ "num-buttons", atoi (tmp_array[offset + 1]),
+ "control-type", atoi (tmp_array[offset + 2]),
+ "screenx", atoi (tmp_array[offset + 4]),
+ "screeny", atoi (tmp_array[offset + 5]),
+ "screen-freq", atof (tmp_array[offset + 6]),
+ "is-horizontal", (*tmp_array[offset + 7] == 'h'),
+ "num-channels", atoi (tmp_array[offset + 8]),
+ "is-vector", (!strcmp (tmp_array[offset + 3], "true")),
+ "num-roms", atoi (tmp_array[offset + 9]),
+ "num-samples", atoi (tmp_array[offset + 10]),
+ "sampleof", g_strdup (tmp_array[offset + 11]),
+ NULL);
+
+
g_strfreev (tmp_array);
mame_gamelist_add (gl, rom);
@@ -538,16 +514,50 @@ gboolean mame_gamelist_load (MameGamelist *gl)
* Appends a rom entry to the gamelist.
*/
static void
-mame_gamelist_print (FILE *handle,
- RomEntry *rom)
+mame_gamelist_print (FILE *handle, MameRomEntry *rom)
{
int i;
char float_buf[FLOAT_BUF_SIZE];
+ gchar *romname, *gamename, *gamenameext;
+ gboolean thetrailer, is_vector, horizontal;
+ gchar *year, *manufacturer, *cloneof, *romof, *driver, *sampleof;
+ gint num_colours, num_players, num_buttons, num_channels, screenx, screeny, num_roms, num_samples;
+ DriverStatus status, driver_status_colour, driver_status_sound, driver_status_graphics;
+ gfloat screen_freq;
+ ControlType control;
+
+ g_return_if_fail (rom != NULL);
- if (!rom)
- return;
-
+ g_object_get (rom,
+ "romname", &romname,
+ "gamename", &gamename,
+ "gamenameext", &gamenameext,
+ "the-trailer", &thetrailer,
+ "year", &year,
+ "manufacturer", &manufacturer,
+ "cloneof", &cloneof,
+ "romof", &romof,
+ "driver", &driver,
+ "driver-status", &status,
+ "driver-status-colour", &driver_status_colour,
+ "driver-status-sound", &driver_status_sound,
+ "driver-status-graphics", &driver_status_graphics,
+ "num-colours", &num_colours,
+ "num-players", &num_players,
+ "num-buttons", &num_buttons,
+ "num-channels", &num_channels,
+ "control-type", &control,
+ "is-vector", &is_vector,
+ "screenx", &screenx,
+ "screeny", &screeny,
+ "screen-freq", &screen_freq,
+ "is-horizontal", &horizontal,
+ "num-roms", &num_roms,
+ "num-samples", &num_samples,
+ "sampleof", &sampleof,
+ NULL);
+
fprintf (handle,
"%s" SEP /* romname */
"%s" SEP /* gamename */
@@ -565,32 +575,34 @@ mame_gamelist_print (FILE *handle,
"%d" SEP /* driver sound graphic */
"%i" SEP /* colors */
,
- rom->romname,
- rom->gamename,
- rom->gamenameext,
- rom->the_trailer ? "true" : "false",
- rom->is_bios ? "true" : "false",
- rom->year,
- rom->manu,
- rom->cloneof,
- rom->romof,
- rom->driver,
- rom->status,
- rom->driver_status_color,
- rom->driver_status_sound,
- rom->driver_status_graphic,
- rom->colors
+ romname,
+ gamename,
+ gamenameext,
+ thetrailer ? "true" : "false",
+ mame_rom_entry_is_bios (rom) ? "true" : "false",
+ year,
+ manufacturer,
+ cloneof,
+ romof,
+ driver,
+ status,
+ driver_status_colour,
+ driver_status_sound,
+ driver_status_graphics,
+ num_colours
);
-
+
for (i=0; i < NB_CPU; i++) {
- fprintf (handle, "%s" SEP "%i" SEP,
- rom->cpu_info[i].name, rom->cpu_info[i].clock);
+ CPUInfo *cpu = (CPUInfo *) g_malloc0 (sizeof (CPUInfo));
+ cpu = get_rom_cpu (rom, i);
+ fprintf (handle, "%s" SEP "%i" SEP, cpu->name, cpu->clock);
}
for (i=0; i < NB_CPU; i++) {
- fprintf (handle, "%s" SEP "%i" SEP,
- rom->sound_info[i].name, rom->sound_info[i].clock);
+ SoundCPUInfo *soundcpu = (SoundCPUInfo *) g_malloc0 (sizeof (SoundCPUInfo));
+ soundcpu = get_sound_cpu (rom, i);
+ fprintf (handle, "%s" SEP "%i" SEP, soundcpu->name, soundcpu->clock);
}
-
+
fprintf (handle,
"%i" SEP /* players */
"%i" SEP /* buttons */
@@ -603,20 +615,32 @@ mame_gamelist_print (FILE *handle,
"%i" SEP /* channels */
"%i" SEP /* roms */
"%i" SEP /* samples */
+ "%s" SEP /* sample of */
"\n",
- rom->num_players,
- rom->num_buttons,
- rom->control,
- rom->vector ? "true" : "false",
- rom->screen_x,
- rom->screen_y,
- my_dtostr (float_buf, rom->screen_freq),
- rom->horizontal ? "horizontal" : "vertical",
- rom->channels,
- rom->nb_roms,
- rom->nb_samples
+ num_players,
+ num_buttons,
+ control,
+ is_vector ? "true" : "false",
+ screenx,
+ screeny,
+ my_dtostr (float_buf, screen_freq),
+ horizontal ? "horizontal" : "vertical",
+ num_channels,
+ num_roms,
+ num_samples,
+ sampleof
);
+ g_free (romname);
+ g_free (gamename);
+ g_free (gamenameext);
+ g_free (year);
+ g_free (manufacturer);
+ g_free (cloneof);
+ g_free (romof);
+ g_free (driver);
+ g_free (sampleof);
+
}
gboolean mame_gamelist_save (MameGamelist *gl) {
@@ -690,7 +714,7 @@ GMAMEUI_DEBUG ("Saving gamelist");
listpointer = g_list_first (gl->priv->roms);
while (listpointer) {
- mame_gamelist_print (gamelist, (RomEntry*)listpointer->data);
+ mame_gamelist_print (gamelist, (MameRomEntry*) listpointer->data);
listpointer = g_list_next (listpointer);
}
@@ -718,17 +742,11 @@ gamelist_check (MameExec *exec)
gboolean versioncheck; /* Check the gamelist against the current executable */
gchar *gl_name, *gl_version;
- g_object_get (main_gui.gui_prefs,
- "versioncheck", &versioncheck,
- NULL);
-
- if (!exec)
- return;
+ g_return_if_fail (exec != NULL);
+
+ g_object_get (main_gui.gui_prefs, "versioncheck", &versioncheck, NULL);
- g_object_get (gui_prefs.gl,
- "name", &gl_name,
- "version", &gl_version,
- NULL);
+ g_object_get (gui_prefs.gl, "name", &gl_name, "version", &gl_version, NULL);
if (!gl_version || !strcmp (gl_version, "unknown")) {
dialog = gtk_message_dialog_new (GTK_WINDOW (MainWindow),
@@ -796,7 +814,8 @@ gamelist_check (MameExec *exec)
load_games_ini ();
load_catver_ini ();
quick_check ();
- create_gamelist_content ();
+
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
}
gtk_widget_set_sensitive (main_gui.scrolled_window_games, TRUE);
@@ -806,9 +825,9 @@ gamelist_check (MameExec *exec)
}
}
-RomEntry* get_rom_from_gamelist_by_name (MameGamelist *gl, gchar *romname) {
+MameRomEntry* get_rom_from_gamelist_by_name (MameGamelist *gl, gchar *romname) {
GList *listpointer;
- RomEntry *tmprom = NULL;
+ MameRomEntry *tmprom;
g_return_val_if_fail ((gl != NULL), NULL);
g_return_val_if_fail ((romname != NULL), NULL);
@@ -817,8 +836,8 @@ RomEntry* get_rom_from_gamelist_by_name (MameGamelist *gl, gchar *romname) {
(listpointer != NULL);
listpointer = g_list_next (listpointer))
{
- tmprom = (RomEntry *) listpointer->data;
- if (!strcmp (tmprom->romname, romname))
+ tmprom = (MameRomEntry *) listpointer->data;
+ if (!g_ascii_strcasecmp (mame_rom_entry_get_romname (tmprom), romname))
{
break;
}
diff --git a/src/game_list.h b/src/game_list.h
index faa06a2..ed6e730 100644
--- a/src/game_list.h
+++ b/src/game_list.h
@@ -69,7 +69,7 @@ MameGamelist* mame_gamelist_new (void);
void gamelist_check (MameExec *exec);
-RomEntry* get_rom_from_gamelist_by_name (MameGamelist *gl, gchar *romname);
+MameRomEntry* get_rom_from_gamelist_by_name (MameGamelist *gl, gchar *romname);
GList* mame_gamelist_get_roms_glist (MameGamelist *gl);
GList* mame_gamelist_get_categories_glist (MameGamelist *gl);
GList* mame_gamelist_get_versions_glist (MameGamelist *gl);
@@ -97,7 +97,7 @@ gboolean mame_gamelist_load (MameGamelist *gl);
*/
gboolean mame_gamelist_save (MameGamelist *gl);
-void mame_gamelist_add (MameGamelist *gl, RomEntry *rom);
+void mame_gamelist_add (MameGamelist *gl, MameRomEntry *rom);
G_END_DECLS
diff --git a/src/gmameui-audit-dlg.c b/src/gmameui-audit-dlg.c
index 237e036..8b1f3bd 100644
--- a/src/gmameui-audit-dlg.c
+++ b/src/gmameui-audit-dlg.c
@@ -25,8 +25,9 @@
#include <glade/glade.h>
#include "gmameui.h" /* Contains the GmameuiAudit object */
+#include "gui.h" /* For main_gui */
#include "audit.h"
-#include "gmameui-gamelist-view.h" /* For create_gamelist_content () */
+#include "gmameui-gamelist-view.h"
#include "gmameui-audit-dlg.h"
struct _MameAuditDialogPrivate {
@@ -57,8 +58,6 @@ struct _MameAuditDialogPrivate {
GtkWidget *notfound_samples_value;
GtkWidget *total_samples_value;
- GList *romlist; /* Not necessary to free this */
-
/* Total number of ROMs and samples supported by this version of MAME */
gint num_roms;
gint num_samples;
@@ -180,8 +179,6 @@ mame_audit_dialog_init (MameAuditDialog *dialog)
priv->num_roms = priv->num_samples = 0;
/* Done initialising private variables */
- priv->romlist = mame_gamelist_get_roms_glist (gui_prefs.gl);
-
/* Build the UI and connect signals here */
priv->xml = glade_xml_new (GLADEDIR "audit_window.glade", "vbox1", GETTEXT_PACKAGE);
if (!priv->xml) {
@@ -327,17 +324,19 @@ mame_audit_dialog_response (GtkDialog *dialog, gint response)
/* Close button clicked */
gtk_widget_destroy (GTK_WIDGET (dialog));
- create_gamelist_content ();
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
+
break;
case GTK_RESPONSE_DELETE_EVENT:
/* Dialog closed */
/* Stop the auditing process */
mame_audit_stop_full_audit (gui_prefs.audit);
-
+
gtk_widget_destroy (GTK_WIDGET (dialog));
- create_gamelist_content ();
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
+
break;
default:
g_assert_not_reached ();
@@ -426,17 +425,18 @@ on_romset_audited (GmameuiAudit *audit,
if (auditresult != NOTROMSET) {
gchar *romname;
- RomEntry *tmprom = NULL;
- GList *listpointer;
+ MameRomEntry *tmprom;
/* Write the audit details to the text buffer */
if ((auditresult == INCORRECT) || (auditresult == BEST_AVAIL))
- update_text_buffer (dlg, audit_line);
+ update_text_buffer (dlg, audit_line);
/* Get the name of the rom being audited so we can update the processing label */
romname = get_romset_name_from_audit_line (audit_line);
- listpointer = g_list_find_custom (dlg->priv->romlist, romname,
- (GCompareFunc) g_ascii_strcasecmp);
+
+ tmprom = get_rom_from_gamelist_by_name (gui_prefs.gl, romname);
+
+ g_return_if_fail (tmprom != NULL);
if (type == AUDIT_TYPE_ROM) {
dlg->priv->romset_count[auditresult]++;
@@ -444,13 +444,10 @@ on_romset_audited (GmameuiAudit *audit,
title = g_strdup_printf (_("Auditing romset %s"), romname);
- if (listpointer) {
- tmprom = (RomEntry *) listpointer->data;
- tmprom->has_roms = auditresult;
- /*GMAMEUI_DEBUG ("Setting rom %s to %d", tmprom->romname, auditresult);*/
+ g_object_set (tmprom, "has-roms", auditresult, NULL);
+
+ /* FIXME TODO Redraw gamelist with updated ROM details */
- /* FIXME TODO Redraw gamelist with updated ROM details */
- }
} else if (type == AUDIT_TYPE_SAMPLE) {
dlg->priv->sampleset_count[auditresult]++;
@@ -458,12 +455,10 @@ on_romset_audited (GmameuiAudit *audit,
title = g_strdup_printf (_("Auditing sampleset %s"), romname);
- if (listpointer) {
- tmprom = (RomEntry *) listpointer->data;
- tmprom->has_samples = auditresult;
+ g_object_set (tmprom, "has-samples", auditresult, NULL);
+
+ /* FIXME TODO Redraw gamelist with updated ROM details */
- /* FIXME TODO Redraw gamelist with updated ROM details */
- }
}
ngmameui_audit_window_set_details_label (dlg, title);
diff --git a/src/gmameui-gamelist-view.c b/src/gmameui-gamelist-view.c
index 72ad81d..28d3492 100644
--- a/src/gmameui-gamelist-view.c
+++ b/src/gmameui-gamelist-view.c
@@ -23,20 +23,398 @@
*/
#include <gdk/gdkkeysyms.h>
+#include <string.h>
#include "gmameui-gamelist-view.h"
-#include "callbacks.h"
-#include "interface.h"
-#include "gmameui.h"
-#include "gui.h"
-#include "io.h"
+#include "game_list.h"
+#include "gmameui.h" /* For game_filtered */
+#include "rom_entry.h"
+#include "gui.h" /* For main_gui struct */
+#include "io.h" /* For gmameui_gamelist_rebuild */
+#include "gui_prefs.h"
+#include "audit.h"
+
+static const int ROM_ICON_SIZE = 24;
+
+struct _MameGamelistViewPrivate {
+ GtkTreeModel *liststore; /* The representation of the model in Tree mode */
+#ifdef TREESTORE
+ GtkTreeModel *treestore; /* The representation of the model in List mode */
+#endif
+ GtkTreeModel *curr_model; /* A pointer to either the base liststore or treestore */
+
+ GtkTreeModel *sort_model; /* Implementation of GtkTreeModelSort */
+ GtkTreeModel *filter_model; /* Implementation of GtkTreeModelFilter */
+#ifdef TREESTORE
+ gboolean is_tree_mode;
+#endif
+};
+
+G_DEFINE_TYPE (MameGamelistView, mame_gamelist_view, GTK_TYPE_TREE_VIEW)
+
+#define MAME_GAMELIST_VIEW_GET_PRIVATE(o) (MAME_GAMELIST_VIEW (o)->priv)
+
+enum {
+ LISTSTORE,
+ TREESTORE
+};
+
+/* Function prototypes */
+static void
+mame_gamelist_view_finalize (GObject *object);
+static const char *
+column_title (int column_num);
-static guint timeoutid;
-static gint ColumnHide_selected;
+static void
+on_row_selected (GtkTreeSelection *selection,
+ gpointer data);
+
+static void
+set_list_sortable_column (MameGamelistView *gamelist_view);
+static void
+create_tree_model (MameGamelistView *gamelist_view);
+static void
+populate_model_from_gamelist (MameGamelistView *gamelist_view, GtkTreeModel *model);
+static gboolean
+filter_func (GtkTreeModel *model,
+ GtkTreeIter *iter,
+ GtkEntry *entry );
+
+/* Callbacks */
+static gboolean
+on_list_keypress (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
+static gboolean
+on_list_clicked (GtkWidget *widget, GdkEventButton *event, gpointer user_data);
+static void
+on_displayed_list_sort_column_changed (GtkTreeSortable *treesortable,
+ gpointer user_data);
+#ifdef TREESTORE
+static void
+on_displayed_list_row_collapsed (GtkTreeView *treeview,
+ GtkTreeIter *arg1,
+ GtkTreePath *arg2,
+ gpointer user_data);
+#endif
+static gboolean
+on_column_click (GtkWidget *button,
+ GdkEventButton *event,
+ GtkTreeViewColumn* column);
+static void
+on_displayed_list_resize_column (GtkWidget *widget,
+ GtkRequisition *requisition,
+ gpointer user_data);
+static gboolean
+foreach_find_random_rom_in_store (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data);
+static gboolean
+foreach_find_rom_in_store (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data);
+
+/* Callbacks handling when the preferences change */
+static void
+on_prefs_column_shown_toggled (MameGuiPrefs *prefs, gpointer va, gpointer user_data);
+static void
+on_prefs_theprefix_toggled (MameGuiPrefs *prefs, gboolean theprefix, gpointer user_data);
+
+/* Callbacks handling when the Search Entry text changes */
+static void
+on_search_changed (GtkEntry *entry,
+ gchar *criteria,
+ gpointer user_data);
+
+/* Callbacks handling when a ROM is audited */
+static void
+on_romset_audited (GmameuiAudit *audit,
+ gchar *audit_line,
+ gint type,
+ gint auditresult,
+ gpointer user_data);
+
+/* Boilerplate functions */
+static GObject *
+mame_gamelist_view_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_properties)
+{
+ GObject *obj;
+ MameGamelistView *gamelist_view;
+
+ obj = G_OBJECT_CLASS (mame_gamelist_view_parent_class)->constructor (type,
+ n_construct_properties,
+ construct_properties);
+
+ gamelist_view = MAME_GAMELIST_VIEW (obj);
+
+ return obj;
+}
+
+static void
+mame_gamelist_view_class_init (MameGamelistViewClass *class)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+/* GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (class);
+ GtkTreeViewClass *gtktreeview_class = GTK_TREE_VIEW_CLASS (class);*/
+
+ gobject_class->constructor = mame_gamelist_view_constructor;
+/* gobject_class->get_property = mame_gamelist_view_get_property;
+ gobject_class->set_property = mame_gamelist_view_set_property;*/
+
+ gobject_class->finalize = mame_gamelist_view_finalize;
+
+ g_type_class_add_private (class,
+ sizeof (MameGamelistViewPrivate));
+
+ /* Signals and properties go here */
+
+}
-/* Private function prototypes */
static void
-set_list_sortable_column ();
+mame_gamelist_view_init (MameGamelistView *gamelist_view)
+{
+ MameGamelistViewPrivate *priv;
+
+
+ priv = G_TYPE_INSTANCE_GET_PRIVATE (gamelist_view,
+ MAME_TYPE_GAMELIST_VIEW,
+ MameGamelistViewPrivate);
+
+ gamelist_view->priv = priv;
+
+ /* Initialise private variables */
+#ifdef TREESTORE
+ priv->treestore = (GtkTreeModel *) gtk_tree_store_new (NUMBER_COLUMN + 4,
+ G_TYPE_STRING, /* Name */
+ G_TYPE_STRING, /* Has samples */
+ G_TYPE_STRING, /* ROM name */
+ G_TYPE_INT, /* Times played */
+ G_TYPE_STRING, /* Manu */
+ G_TYPE_STRING, /* Year */
+ G_TYPE_STRING, /* Clone of */
+ G_TYPE_STRING, /* Driver */
+ G_TYPE_STRING, /* Ver added */
+ G_TYPE_STRING, /* Category */
+ G_TYPE_POINTER, /* Rom Entry */
+ PANGO_TYPE_STYLE,
+ G_TYPE_BOOLEAN,
+ GDK_TYPE_PIXBUF); /* Pixbuf */
+#endif
+ priv->liststore = (GtkTreeModel *) gtk_list_store_new (NUMBER_COLUMN + 4,
+ G_TYPE_STRING, /* Name */
+ G_TYPE_STRING, /* Has samples */
+ G_TYPE_STRING, /* ROM name */
+ G_TYPE_INT, /* Times played */
+ G_TYPE_STRING, /* Manu */
+ G_TYPE_STRING, /* Year */
+ G_TYPE_STRING, /* Clone of */
+ G_TYPE_STRING, /* Driver */
+ G_TYPE_STRING, /* Ver added */
+ G_TYPE_STRING, /* Category */
+ G_TYPE_POINTER, /* Rom Entry */
+ PANGO_TYPE_STYLE,
+ G_TYPE_BOOLEAN,
+ GDK_TYPE_PIXBUF); /* Pixbuf */
+
+ /* Build the UI and connect signals here */
+
+ gint i;
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer;
+ GtkTreeSelection *select;
+
+ GMAMEUI_DEBUG ("Creating gamelist structure");
+
+ ListMode list_mode;
+ GValueArray *va_shown = NULL;
+ GValueArray *va_width = NULL;
+
+ g_object_get (main_gui.gui_prefs,
+ "current-mode", &list_mode,
+ "cols-shown", &va_shown,
+ "cols-width", &va_width,
+ NULL);
+
+ for (i = 0; i < NUMBER_COLUMN; i++) {
+ if (i == GAMENAME) {
+ /* Game name column contains both the status icon and the name */
+ column = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title (GTK_TREE_VIEW_COLUMN (column), column_title (i));
+ gtk_tree_view_column_set_sort_column_id (column, i);
+
+ /* Pixbuf */
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ gtk_tree_view_column_pack_start (GTK_TREE_VIEW_COLUMN (column),
+ renderer,
+ FALSE);
+ gtk_tree_view_column_add_attribute (GTK_TREE_VIEW_COLUMN (column), renderer,
+ "pixbuf", PIXBUF);
+ g_object_set (renderer,
+ "xalign", 1.0,
+ "ypad", 0,
+ "height", ROM_ICON_SIZE, /* All rows should share same height */
+ NULL);
+
+ /* TEXT */
+ renderer = gtk_cell_renderer_text_new ();
+ gtk_tree_view_column_pack_end (GTK_TREE_VIEW_COLUMN (column),
+ renderer,
+ TRUE);
+
+ /* The text is set to the GAMENAME column; the TEXTSTYLE column
+ contains a PangoStyle for italic if the ROM is a clone */
+ gtk_tree_view_column_set_attributes (GTK_TREE_VIEW_COLUMN (column), renderer,
+ "text", i,
+ "style", TEXTSTYLE,
+ NULL);
+ g_object_set (renderer,
+ "ypad", 0, "yalign", 0.5,
+ "ellipsize", PANGO_ELLIPSIZE_END,
+ NULL);
+
+ } else {
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (column_title (i), renderer,
+ "text", i,
+ NULL);
+ g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ gtk_tree_view_column_set_sort_column_id (column, i);
+ }
+ gtk_tree_view_append_column (GTK_TREE_VIEW (gamelist_view), column);
+
+ /* Set minimum width to the num of chars in the header TODO Also get sort directory size */
+ gint font_size, title_len;
+ title_len = g_utf8_strlen (gtk_tree_view_column_get_title (GTK_TREE_VIEW_COLUMN (column)), -1);
+ font_size = PANGO_PIXELS (pango_font_description_get_size (GTK_WIDGET (gamelist_view)->style->font_desc));
+
+ gtk_tree_view_column_set_min_width (GTK_TREE_VIEW_COLUMN (column),
+ title_len * font_size);
+
+
+ /* Determine whether the columns is to be shown, and its width */
+ if ((list_mode == DETAILS)
+#ifdef TREESTORE
+ || (list_mode == DETAILS_TREE)
+#endif
+ ) {
+ /* If we are in Details mode, show column if selected in Preferences */
+ if (g_value_get_int (g_value_array_get_nth (va_shown, i)) == FALSE) {
+ gtk_tree_view_column_set_visible (column, FALSE);
+ } else {
+ gint col_width;
+
+ col_width = g_value_get_int (g_value_array_get_nth (va_width, i));
+ gtk_tree_view_column_set_visible (column, TRUE);
+ if (col_width == 0) {
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+ } else {
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
+ gtk_tree_view_column_set_fixed_width (column, col_width);
+ }
+ gtk_tree_view_column_set_resizable (column, TRUE);
+ }
+ } else {
+ /* When we are not in Details mode, hide all columns except the GAMENAME */
+ if (i == GAMENAME) {
+ gtk_tree_view_column_set_visible (column, TRUE);
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+ gtk_tree_view_column_set_resizable (column, FALSE);
+ } else {
+ gtk_tree_view_column_set_visible (column, FALSE);
+ }
+ }
+
+ /* Reordering columns is disabled because it conflicts with
+ 'column popup menu' and 'sort on click header' */
+ gtk_tree_view_column_set_reorderable (GTK_TREE_VIEW_COLUMN (column), FALSE);
+
+ /* Callback - column header right-clicked */
+ g_signal_connect (column->button, "event",
+ G_CALLBACK (on_column_click), column);
+ }
+
+ /* Create the model - either a GtkTreeStore or a GtkListStore */
+ create_tree_model (gamelist_view);
+
+ /* Callback - Row has been selected */
+ select = gtk_tree_view_get_selection (GTK_TREE_VIEW (gamelist_view));
+ gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
+ g_signal_connect (G_OBJECT (select), "changed",
+ G_CALLBACK (on_row_selected), NULL);
+
+ /* Callback - Click on the list */
+ g_signal_connect (G_OBJECT (gamelist_view), "button-press-event",
+ G_CALLBACK (on_list_clicked), NULL);
+ /* Callback - Keypress on the list */
+ g_signal_connect (G_OBJECT (gamelist_view), "key-press-event",
+ G_CALLBACK (on_list_keypress), NULL);
+ /* Callback - Column size modified */
+ g_signal_connect (G_OBJECT (gamelist_view), "size-request",
+ G_CALLBACK (on_displayed_list_resize_column), NULL);
+#ifdef TREESTORE
+ /* Callback - Row has been collapsed */
+ g_signal_connect (G_OBJECT (gamelist_view), "row-collapsed",
+ G_CALLBACK (on_displayed_list_row_collapsed), NULL);
+#endif
+ /* Callback handling on MameGuiPrefs changes */
+ g_signal_connect (G_OBJECT (main_gui.gui_prefs), "col-toggled",
+ G_CALLBACK (on_prefs_column_shown_toggled), gamelist_view);
+ g_signal_connect (G_OBJECT (main_gui.gui_prefs), "theprefix-toggled",
+ G_CALLBACK (on_prefs_theprefix_toggled), gamelist_view);
+
+ /* Listen for the search criteria being changed */
+ g_signal_connect (main_gui.search_entry, "search-changed",
+ G_CALLBACK (on_search_changed), NULL);
+
+ dirty_icon_cache = FALSE;
+
+ GMAMEUI_DEBUG ("Creating gamelist structure... done");
+
+}
+
+MameGamelistView *
+mame_gamelist_view_new (void)
+{
+ MameGamelistView *gamelist_view;
+
+ gamelist_view = MAME_GAMELIST_VIEW (g_object_new (MAME_TYPE_GAMELIST_VIEW, NULL));
+
+ g_object_set (gamelist_view,
+ "rules-hint", TRUE, /* Set the alternate colours for each row */
+ NULL);
+
+ return gamelist_view;
+
+}
+
+static void
+mame_gamelist_view_finalize (GObject *object)
+{
+ MameGamelistView *gamelist_view;
+
+GMAMEUI_DEBUG ("Destroying mame gamelist view...");
+ gamelist_view = MAME_GAMELIST_VIEW (object);
+
+ /* Clear the model */
+ gtk_list_store_clear (GTK_LIST_STORE (gamelist_view->priv->curr_model));
+
+ /* FIXME TODO Need to destroy the models */
+
+ g_object_unref (gamelist_view->priv);
+
+ G_OBJECT_CLASS (mame_gamelist_view_parent_class)->finalize (object);
+
+/* GTK_OBJECT_CLASS (mame_gamelist_view_parent_class)->destroy (object);*/
+
+GMAMEUI_DEBUG ("Destroying mame gamelist view... done");
+}
+/* End boilerplate functions */
+
+
+static guint timeoutid;
+static gint ColumnHide_selected;
static const
char *
@@ -61,11 +439,11 @@ column_title (int column_num)
return _("Clone of");
case DRIVER:
return _("Driver");
- case STATUS: /* Available / Not Available */
- return _("Status");
case ROMOF:
return _("Rom of");
- case DRIVERSTATUS: /* Working / Not Working */
+
+ /* Working / Not Working or Good / Imperfect / Preliminary */
+ case DRIVER_STATUS:
return _("Driver Status");
case COLOR_STATUS:
return _("Driver Colors");
@@ -92,36 +470,341 @@ column_title (int column_num)
}
}
+#ifdef TREESTORE
+/* This function switches between the GtkTreeStore and GtkListStore by
+ re-creating the GtkTreeModel */
+void
+mame_gamelist_view_change_model (MameGamelistView *gamelist_view)
+{
+ g_return_if_fail (gamelist_view != NULL);
+
+ create_tree_model (gamelist_view);
+
+}
+#endif
+
+/* Called when switching views from the menu */
+void
+mame_gamelist_view_change_views (MameGamelistView *gamelist_view)
+{
+ gint curr_mode;
+ gint prev_mode;
+ int i;
+
+ /* Get the mode and previous mode */
+ g_object_get (main_gui.gui_prefs,
+ "current-mode", &curr_mode,
+ "previous-mode", &prev_mode,
+ NULL);
+
+ if (curr_mode == DETAILS) {
+ GValueArray *va_shown = NULL;
+
+ /* Get preferences for which columns are shown */
+ g_object_get (main_gui.gui_prefs, "cols-shown", &va_shown, NULL);
+
+ /* If we are switching to a details mode, then need to show all columns
+ that the preferences are set to show */
+ for (i = 1; i < NUMBER_COLUMN; i++) {
+ if (g_value_get_int (g_value_array_get_nth (va_shown, i)) == TRUE) {
+
+ gtk_tree_view_column_set_visible (gtk_tree_view_get_column (GTK_TREE_VIEW (gamelist_view), i),
+ TRUE);
+ }
+ }
+
+ /* Cleanup */
+ if (va_shown) {
+ g_value_array_free (va_shown);
+ va_shown = NULL;
+ }
+
+ } else {
+ /* If we are switching to a list mode, need to hide the columns */
+ for (i = 1; i < NUMBER_COLUMN; i++)
+ gtk_tree_view_column_set_visible (gtk_tree_view_get_column (GTK_TREE_VIEW (gamelist_view), i),
+ FALSE);
+ }
+
+#ifdef TREESTORE
+ /* Changing from list to details and vice versa, now we need to change
+ the model, too */
+#endif
+}
+
+void
+mame_gamelist_view_select_random_game (MameGamelistView *gamelist_view, gint i)
+{
+ GtkTreeModel *model;
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (gamelist_view));
+
+ g_return_if_fail (model != NULL);
+
+ gtk_tree_model_foreach (GTK_TREE_MODEL (model),
+ foreach_find_random_rom_in_store,
+ (gpointer *) i);
+}
+
+/* FIXME TODO Merge with the other code that performs a gtk_tree_store_set */
+void
+mame_gamelist_view_update_game_in_list (MameGamelistView *gamelist_view, MameRomEntry *tmprom)
+{
+ const gchar *my_hassamples;
+ GdkPixbuf *pixbuf;
+#ifdef TREESTORE
+ gboolean is_tree_store;
+#endif
+ ListMode current_mode;
+ gint rom_filter_opt;
+ PangoStyle pangostyle;
+ const gchar *name_in_list;
+ GtkTreeIter iter;
+
+ g_return_if_fail (tmprom != NULL);
+
+ g_object_get (main_gui.gui_prefs,
+ "current-mode", ¤t_mode,
+ "current-rom-filter", &rom_filter_opt,
+ NULL);
+
+#ifdef TREESTORE
+ /* Whether the Tree Model will a tree or a list */
+ is_tree_store = (current_mode == LIST_TREE) || (current_mode == DETAILS_TREE);
+#endif
+ name_in_list = mame_rom_entry_get_list_name (tmprom);
+
+ /* Has Samples */
+ if (!mame_rom_entry_has_samples (tmprom))
+ my_hassamples = "";
+ else {
+ my_hassamples = (mame_rom_entry_get_sample_status (tmprom) == CORRECT) ? _("Yes") : _("No");
+ }
+
+ /* Mark if clone */
+ if (mame_rom_entry_is_clone (tmprom))
+ pangostyle = PANGO_STYLE_ITALIC;
+ else
+ pangostyle = PANGO_STYLE_NORMAL;
+
+ gchar *romname;
+ gint timesplayed;
+ gchar *manu;
+ gchar *year;
+ gchar *cloneof;
+ gchar *driver, *category, *version;
+
+ g_object_get (tmprom,
+ "romname", &romname,
+ "times-played", ×played,
+ "manufacturer", &manu,
+ "year", &year,
+ "cloneof", &cloneof,
+ "driver", &driver,
+ "category", &category,
+ "version-added", &version,
+ NULL);
+
+ /* Set the pixbuf for the status icon */
+ pixbuf = Status_Icons [mame_rom_entry_get_rom_status (tmprom)];
+
+ iter = mame_rom_entry_get_position (tmprom);
+
+#ifdef TREESTORE
+ if (is_tree_store) {
+ gtk_tree_store_set (GTK_TREE_STORE (gamelist_view->priv->curr_model),
+ &iter,
+ GAMENAME, name_in_list,
+ HAS_SAMPLES, my_hassamples,
+ ROMNAME, romname,
+ TIMESPLAYED, timesplayed,
+ MANU, manu,
+ YEAR, year,
+ CLONE, cloneof,
+ DRIVER, driver,
+ MAMEVER, version,
+ CATEGORY, category,
+ TEXTSTYLE, pangostyle,
+ FILTERED, game_filtered (tmprom, rom_filter_opt),
+ PIXBUF, pixbuf,
+ -1);
+ } else {
+#endif
+ gtk_list_store_set (GTK_LIST_STORE (gamelist_view->priv->curr_model),
+ &iter,
+ GAMENAME, name_in_list,
+ HAS_SAMPLES, my_hassamples,
+ ROMNAME, romname,
+ TIMESPLAYED, timesplayed,
+ MANU, manu,
+ YEAR, year,
+ CLONE, cloneof,
+ DRIVER, driver,
+ MAMEVER, version,
+ CATEGORY, category,
+ TEXTSTYLE, pangostyle,
+ FILTERED, game_filtered (tmprom, rom_filter_opt),
+ PIXBUF, pixbuf,
+ -1);
+#ifdef TREESTORE
+ }
+#endif
+
+ g_free (romname);
+ g_free (manu);
+ g_free (year);
+ g_free (cloneof);
+ g_free (driver);
+ g_free (category);
+ g_free (version);
+}
+
+static void
+set_status_bar_game_count (gint num_roms)
+{
+ gchar *message;
+
+ message = g_strdup_printf ("%d %s", num_roms, num_roms == 1 ? _("game") : _("games"));
+
+ gtk_statusbar_pop (main_gui.statusbar3, 1);
+ gtk_statusbar_push (main_gui.statusbar3, 1, message);
+
+ g_free (message);
+}
+
static void
-set_list_sortable_column ()
+create_tree_model (MameGamelistView *gamelist_view)
{
ListMode current_mode;
+
+ g_return_if_fail (gui_prefs.gl != NULL);
+
+GTimer *timer = g_timer_new ();
+g_timer_start (timer);
+
+ g_object_get (main_gui.gui_prefs, "current-mode", ¤t_mode, NULL);
+ GMAMEUI_DEBUG (" Creating the MameGameListView Model in mode %d", current_mode);
+ /* Status Bar Message */
+ gtk_statusbar_pop (main_gui.statusbar3, 1);
+ gtk_statusbar_push (main_gui.statusbar3, 1, _("Wait..."));
+
+ /* Unset the tree model until it has been filled */
+ if ((gamelist_view) && (gamelist_view->priv->curr_model)) {
+ gtk_tree_view_set_model (GTK_TREE_VIEW (gamelist_view), NULL);
+ }
+#ifdef TREESTORE
+ /* Whether the Tree Model will a tree or a list */
+ if ((current_mode == LIST_TREE) || (current_mode == DETAILS_TREE)) {
+ gamelist_view->priv->is_tree_mode = TRUE;
+ gamelist_view->priv->curr_model = gamelist_view->priv->treestore;
+ } else {
+ gamelist_view->priv->is_tree_mode = FALSE;
+#endif
+ gamelist_view->priv->curr_model = gamelist_view->priv->liststore;
+
+#ifdef TREESTORE
+ }
+#endif
+
+ /* Get the status icon */
+ get_status_icons ();
+
+ /* Add a filter, and link the model to a filter function so that
+ calls to gtk_tree_model_filter_refilter cause the model to be
+ filtered from the MameSearchEntry field
+
+ In order to perform both filtering and sorting, the model structure is set as:
+ Sortable
+ +- Filter
+ +- Store
+ where Store is the structure of the Gamelist
+ */
+ gamelist_view->priv->filter_model = gtk_tree_model_filter_new (gamelist_view->priv->curr_model, NULL);
+ gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (gamelist_view->priv->filter_model),
+ (GtkTreeModelFilterVisibleFunc) filter_func,
+ main_gui.search_entry,
+ NULL);
+ gamelist_view->priv->sort_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (gamelist_view->priv->filter_model));
+ gtk_tree_view_set_model (GTK_TREE_VIEW (gamelist_view), GTK_TREE_MODEL (gamelist_view->priv->sort_model));
+
+ /* Populate the model here, since we want the sort/filter to apply, triggering
+ the ROM icon loading */
+ populate_model_from_gamelist (gamelist_view, gamelist_view->priv->curr_model);
+
+ /* Sort the list */
+ set_list_sortable_column (gamelist_view);
+
+ /* Callback when the sort column/order changes */
+ g_signal_connect (G_OBJECT (gamelist_view->priv->sort_model), "sort-column-changed",
+ G_CALLBACK (on_displayed_list_sort_column_changed), NULL);
+
+ /* The column headers are clickable in Details view only */
+ gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (gamelist_view),
+ (current_mode == DETAILS)
+#ifdef TREESTORE
+ ||
+ (current_mode == DETAILS_TREE)
+#endif
+ );
+
+ GMAMEUI_DEBUG ("Time taken to create_gamelist_content is %.2f", g_timer_elapsed (timer, NULL));
+ g_timer_destroy (timer);
+
+ GMAMEUI_DEBUG (" Creating the MameGameListView Model... done");
+
+}
+
+static void
+set_list_sortable_column (MameGamelistView *gamelist_view)
+{
+ GtkTreeModel *model;
+ ListMode current_mode;
gint sort_col;
gint sort_col_dir;
+
+ /* The model implemented by the MameGamelistView is the GtkTreeSortable */
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (gamelist_view));
+
+ g_return_if_fail (model != NULL);
g_object_get (main_gui.gui_prefs,
"current-mode", ¤t_mode,
- "sort-col", &sort_col,
- "sort-col-direction", &sort_col_dir,
+ "sort-col", &sort_col, /* FIXME TODO Make priv in this object */
+ "sort-col-direction", &sort_col_dir,/* FIXME TODO Make priv in this object */
NULL);
- if ((current_mode == DETAILS) || (current_mode == DETAILS_TREE)) {
+ if ((current_mode == DETAILS)
+#ifdef TREESTORE
+ || (current_mode == DETAILS_TREE)
+#endif
+ ) {
GMAMEUI_DEBUG("Sorting - using sort order %d", sort_col);
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (main_gui.tree_model),
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model),
sort_col, sort_col_dir);
} else {
- g_signal_handlers_block_by_func (G_OBJECT (main_gui.tree_model), (gpointer)on_displayed_list_sort_column_changed, NULL);
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (main_gui.tree_model),
- GAMENAME, GTK_SORT_ASCENDING);
- g_signal_handlers_unblock_by_func (G_OBJECT (main_gui.tree_model), (gpointer)on_displayed_list_sort_column_changed, NULL);
+ g_signal_handlers_block_by_func (G_OBJECT (model),
+ (gpointer) on_displayed_list_sort_column_changed,
+ NULL);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model),
+ GAMENAME,
+ GTK_SORT_ASCENDING);
+ g_signal_handlers_unblock_by_func (G_OBJECT (model),
+ (gpointer) on_displayed_list_sort_column_changed,
+ NULL);
} /* Select the correct row */
}
-gboolean foreach_find_random_rom_in_store (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
+/*
+ foreach_find_random_rom_in_store
+ user_data contains a random number representing the target row; we
+ continue to move through the store until we reach the target row,
+ expanding the parent row if necessary
+ */
+static gboolean
+foreach_find_random_rom_in_store (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data)
{
static gint current_row;
gint target_row;
@@ -136,15 +819,14 @@ gboolean foreach_find_random_rom_in_store (GtkTreeModel *model,
/* Scroll to selection */
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list),
path, NULL, TRUE, 0.5, 0);
-
+#ifdef TREESTORE
/* Need to expand the parent row (if a child) */
gtk_tree_view_expand_to_path (GTK_TREE_VIEW (main_gui.displayed_list),
path);
-
+#endif
/* And highlight the row */
gtk_tree_view_set_cursor (GTK_TREE_VIEW (main_gui.displayed_list),
- path,
- NULL, FALSE);
+ path, NULL, FALSE);
return_val = TRUE; /* Stop walking the store */
current_row = 0; /* Reset for next time we want to find a random row */
@@ -159,42 +841,40 @@ gboolean foreach_find_random_rom_in_store (GtkTreeModel *model,
it finds the row that has the ROM from the preferences. It then
scrolls to that row, and opens the parent row if the found
row is a child */
-gboolean foreach_find_rom_in_store (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data)
+static gboolean
+foreach_find_rom_in_store (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data)
{
- RomEntry *rom;
+ MameRomEntry *rom;
+
gchar *current_rom_name = (gchar *) user_data;
-/* gchar *tree_path_str;*/
/* Don't even bother trying to walk the store if the current game
is not set. We are just wasting our time */
g_return_val_if_fail ((current_rom_name != NULL), TRUE);
- gtk_tree_model_get (model, iter,
- ROMENTRY, &rom,
- -1);
+ gtk_tree_model_get (model, iter, ROMENTRY, &rom, -1);
/*
tree_path_str = gtk_tree_path_to_string (path);
GMAMEUI_DEBUG ("Row %s: name is %s", tree_path_str, rom->romname);
g_free (tree_path_str);
*/
- if (g_ascii_strcasecmp (rom->romname, current_rom_name) == 0) {
- GMAMEUI_DEBUG ("Found row in tree view - %s", rom->romname);
-
+ if (g_ascii_strcasecmp (mame_rom_entry_get_romname (rom), current_rom_name) == 0) {
+ GMAMEUI_DEBUG ("Found row in tree view - %s", mame_rom_entry_get_romname (rom));
+
/* Scroll to selection */
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list),
path, NULL, TRUE, 0.5, 0);
-
+#ifdef TREESTORE
/* Need to expand the parent row (if a child) */
gtk_tree_view_expand_to_path (GTK_TREE_VIEW (main_gui.displayed_list),
path);
-
+#endif
/* And highlight the row */
gtk_tree_view_set_cursor (GTK_TREE_VIEW (main_gui.displayed_list),
- path,
- NULL, FALSE);
+ path, NULL, FALSE);
return TRUE; /* Found the row we are after, no need to keep walking */
}
@@ -202,6 +882,25 @@ gboolean foreach_find_rom_in_store (GtkTreeModel *model,
return FALSE; /* Do not stop walking the store, call us with next row */
}
+/* Scroll to, and highlight, the current-rom in the preferences */
+void
+mame_gamelist_view_scroll_to_selected_game (MameGamelistView *gamelist_view)
+{
+ gchar *current_rom_name;
+ g_object_get (main_gui.gui_prefs, "current-rom", ¤t_rom_name, NULL);
+
+ /* Find the selected game in the gamelist, and scroll to it, opening any expanders */
+ if (visible_games > 0) {
+ /* Scroll to the game specified from the preferences */
+ gtk_tree_model_foreach (GTK_TREE_MODEL (gamelist_view->priv->sort_model),
+ foreach_find_rom_in_store,
+ current_rom_name);
+ }
+
+ g_free (current_rom_name);
+}
+
+#ifdef TREESTORE
void
on_collapse_all_activate (GtkMenuItem *menuitem,
gpointer user_data)
@@ -212,10 +911,13 @@ on_collapse_all_activate (GtkMenuItem *menuitem,
GtkTreePath *tree_path;
gtk_tree_view_collapse_all (GTK_TREE_VIEW (main_gui.displayed_list));
+
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (main_gui.displayed_list));
+
if (gtk_tree_selection_get_selected (select, &model, &iter)) {
- tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (main_gui.tree_model), &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list), tree_path, NULL, TRUE, 0.5, 0);
+ tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
+ gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list),
+ tree_path, NULL, TRUE, 0.5, 0);
gtk_tree_path_free (tree_path);
}
}
@@ -230,79 +932,83 @@ on_expand_all_activate (GtkMenuItem *menuitem,
GtkTreePath *tree_path;
gtk_tree_view_expand_all (GTK_TREE_VIEW (main_gui.displayed_list));
+
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (main_gui.displayed_list));
+
if (gtk_tree_selection_get_selected (select, &model, &iter)) {
- tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (main_gui.tree_model), &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list), tree_path, NULL, TRUE, 0.5, 0);
+ tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
+ gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list),
+ tree_path, NULL, TRUE, 0.5, 0);
gtk_tree_path_free (tree_path);
}
}
+#endif
static gboolean
delayed_row_selected (GtkTreeSelection *selection)
{
- RomEntry *game_data;
+ MameRomEntry *rom;
GtkTreeIter iter;
GtkTreeModel *model;
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get (model, &iter, ROMENTRY, &game_data, -1);
+ gtk_tree_model_get (model, &iter, ROMENTRY, &rom, -1);
- g_return_val_if_fail (game_data != NULL, FALSE);
+ g_return_val_if_fail (rom != NULL, FALSE);
- g_object_set (main_gui.gui_prefs, "current-rom", game_data->romname, NULL);
+ g_object_set (main_gui.gui_prefs, "current-rom", mame_rom_entry_get_romname (rom), NULL);
- select_game (game_data);
+ select_game (rom);
}
return FALSE;
}
-/* Main list */
-void
+static void
on_row_selected (GtkTreeSelection *selection,
gpointer data)
{
if (timeoutid)
g_source_remove (timeoutid);
+
timeoutid = g_timeout_add (SELECT_TIMEOUT,
(GSourceFunc) delayed_row_selected,
selection);
}
-gboolean
+static gboolean
on_list_keypress (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
g_return_val_if_fail (gui_prefs.current_game != NULL, FALSE);
- if (event && event->type == GDK_KEY_PRESS && (
- event->keyval == GDK_KP_Enter ||
- event->keyval == GDK_Return))
+ if (event && event->type == GDK_KEY_PRESS &&
+ (event->keyval == GDK_KP_Enter || event->keyval == GDK_Return))
play_game (gui_prefs.current_game);
return FALSE;
}
-gboolean
+static gboolean
on_list_clicked (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
+ GtkTreeModel *model;
GtkTreePath *path=NULL;
GtkTreeIter iter;
gboolean myclick=FALSE;
GValue val = { 0, };
- RomEntry *game_data;
+ MameRomEntry *game_data;
gint x,y;
/* Here we figure out which node was clicked */
- myclick = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), event->x, event->y, &path, NULL, &x, &y);
- if (path == NULL) {
- GMAMEUI_DEBUG ("PATH NULL");
- return FALSE;
- }
+ myclick = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
+ event->x, event->y,
+ &path, NULL,
+ &x, &y);
+ g_return_val_if_fail (path != NULL, FALSE);
/* We test here if we clicked between 2 columns
I know this will make double click on the row 0 col 0 not working
@@ -313,9 +1019,11 @@ on_list_clicked (GtkWidget *widget,
return FALSE;
}
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
+
/* Here we figure out which node was clicked */
- gtk_tree_model_get_iter (GTK_TREE_MODEL (main_gui.tree_model), &iter, path);
- gtk_tree_model_get_value (GTK_TREE_MODEL (main_gui.tree_model), &iter, ROMENTRY, &val);
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
+ gtk_tree_model_get_value (GTK_TREE_MODEL (model), &iter, ROMENTRY, &val);
game_data = g_value_get_pointer (&val);
if (path)
@@ -332,18 +1040,19 @@ on_list_clicked (GtkWidget *widget,
return FALSE;
}
-gboolean
+/* Event - invoked when the mouse is clicked on the column headers */
+static gboolean
on_column_click (GtkWidget *button,
GdkEventButton *event,
GtkTreeViewColumn *column)
{
- gchar *hide_column_menu_name;
- GtkWidget *hide_menu_item;
-
- GtkWidget *popup_menu;
/* Only right-mouse clicks are catered for */
- if (event->type == GDK_BUTTON_PRESS && ( (GdkEventButton*)event)->button == 3) {
+ if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *) event)->button == 3) {
+
+ GtkWidget *hide_menu_item;
+ GtkWidget *popup_menu;
+ gchar *hide_column_menu_name;
popup_menu = gtk_ui_manager_get_widget (main_gui.manager, "/ColumnPopup");
g_return_val_if_fail (popup_menu != NULL, FALSE);
@@ -362,27 +1071,120 @@ on_column_click (GtkWidget *button,
gtk_widget_set_sensitive (GTK_WIDGET (hide_menu_item),
!(ColumnHide_selected == GAMENAME));
- gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL,
+ gtk_menu_popup (GTK_MENU (popup_menu),
+ NULL, NULL,
NULL, NULL,
event->button, event->time);
}
+
return FALSE;
}
-/* Column Popup menu */
+/* Go through the model and update the display name of the ROM to reflect
+ the current value of theprefix */
+static gboolean
+foreach_update_prefix_in_store (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer user_data)
+{
+ MameRomEntry *rom;
+
+ gtk_tree_model_get (model, iter, ROMENTRY, &rom, -1);
+
+ g_return_val_if_fail (rom != NULL, FALSE);
+
+#ifdef TREESTORE
+ if (gtk_tree_model_get_flags (model) & GTK_TREE_MODEL_LIST_ONLY) {
+#endif
+ gtk_list_store_set (GTK_LIST_STORE (model), iter,
+ GAMENAME, mame_rom_entry_get_list_name (rom),
+ -1);
+#ifdef TREESTORE
+ } else {
+ gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+ GAMENAME, mame_rom_entry_get_list_name (rom),
+ -1);
+ }
+#endif
+ return FALSE; /* Do not stop walking the store, call us with next row */
+}
+
+/* Handler for when the columns in the GuiPrefs object are changed (usually via
+ the GUI Preferences dialog */
+static void
+on_prefs_column_shown_toggled (MameGuiPrefs *prefs, gpointer va_cols, gpointer user_data)
+{
+ guint i;
+
+ GValueArray *cols = (gpointer) va_cols;
+ GList *column_list = NULL;
+ GList *C = NULL;
+
+ g_return_if_fail (cols != NULL);
+
+ MameGamelistView *gamelist_view = (gpointer) user_data;
+ column_list = gtk_tree_view_get_columns (GTK_TREE_VIEW (gamelist_view));
+ i = 0;
+
+ for (C = g_list_first (column_list); C != NULL; C = g_list_next (C)) {
+ GtkTreeViewColumn *column = C->data;
+
+ if ((gtk_tree_view_column_get_visible (column)) &&
+ (g_value_get_int (g_value_array_get_nth (cols, i)) == 0)) {
+ /* Column is visible, but shouldn't be */
+ gtk_tree_view_column_set_visible (column, FALSE);
+ }
+
+ if ((!gtk_tree_view_column_get_visible (column)) &&
+ (g_value_get_int (g_value_array_get_nth (cols, i)) == 1)) {
+ /* Column is not visible, but should be */
+ gtk_tree_view_column_set_visible (column, TRUE);
+ }
+ i++;
+ }
+
+ g_list_free (column_list);
+}
+
+/* Handler for when the 'The' prefix in the GuiPrefs object is changed
+ (usually via the GUI Preferences dialog) */
+static void
+on_prefs_theprefix_toggled (MameGuiPrefs *prefs, gboolean theprefix, gpointer user_data)
+{
+ MameGamelistView *gamelist_view;
+
+ gamelist_view = (gpointer) user_data;
+
+ gtk_tree_model_foreach (GTK_TREE_MODEL (gamelist_view->priv->curr_model),
+ foreach_update_prefix_in_store,
+ (gpointer) theprefix);
+}
+
+/* FIXME TODO In future, should listen for signal emitted on the RomEntry that
+ that it has been audited */
+static void
+on_romset_audited (GmameuiAudit *audit, gchar *audit_line, gint type, gint auditresult, gpointer user_data)
+{
+ MameGamelistView *gamelist_view = (MameGamelistView *) user_data;
+
+ g_return_if_fail (gamelist_view != NULL);
+}
+
+/* Hide a column from the popup menu; changing the main_gui.gui_prefs setting
+ triggers the callback on_prefs_column_shown_toggled, so there is no need to
+ explicitly hide the column here */
void
on_column_hide_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- GList *column_list=NULL;
- GList *C=NULL;
+ GList *column_list = NULL;
+ GList *C = NULL;
GValueArray *va;
- g_object_get (main_gui.gui_prefs,
- "cols-shown", &va,
- NULL);
+ g_object_get (main_gui.gui_prefs, "cols-shown", &va, NULL);
- GMAMEUI_DEBUG ("Column Hide - %i",ColumnHide_selected);
+/* GMAMEUI_DEBUG ("Column Hide - %i",ColumnHide_selected);*/
column_list=gtk_tree_view_get_columns (GTK_TREE_VIEW (main_gui.displayed_list));
for (C = g_list_first (column_list) ; C != NULL ; C = g_list_next (C)) {
@@ -391,16 +1193,13 @@ on_column_hide_activate (GtkMenuItem *menuitem,
}
if (C->data) {
- gtk_tree_view_column_set_visible (C->data, FALSE);
g_value_set_int (g_value_array_get_nth (va, ColumnHide_selected), 0);
- g_object_set (main_gui.gui_prefs,
- "cols-shown", va,
- NULL);
- GMAMEUI_DEBUG ("Column Hidden - %i", ColumnHide_selected);
+ g_object_set (main_gui.gui_prefs, "cols-shown", va, NULL);
+/* GMAMEUI_DEBUG ("Column Hidden - %i", ColumnHide_selected);*/
}
}
-void
+static void
on_displayed_list_resize_column (GtkWidget *widget,
GtkRequisition *requisition,
gpointer user_data)
@@ -419,7 +1218,11 @@ GMAMEUI_DEBUG("Resizing columns");
"cols-width", &va,
NULL);
- if ((current_mode == DETAILS) || (current_mode == DETAILS_TREE)) {
+ if ((current_mode == DETAILS)
+#ifdef TREESTORE
+ || (current_mode == DETAILS_TREE)
+#endif
+ ) {
column_list = gtk_tree_view_get_columns (GTK_TREE_VIEW (widget));
for (pointer_list = g_list_first (column_list), i = 0;
@@ -432,23 +1235,22 @@ GMAMEUI_DEBUG("Resizing columns");
col_id, gtk_tree_view_column_get_title (col),
gtk_tree_view_column_get_width (col));*/
g_value_set_int (g_value_array_get_nth (va, col_id), gtk_tree_view_column_get_width (col));
- g_object_set (main_gui.gui_prefs,
- "cols-width", va,
- NULL);
+ g_object_set (main_gui.gui_prefs, "cols-width", va, NULL);
} else
- GMAMEUI_DEBUG ("Column %s is not visible", gtk_tree_view_column_get_title (col));
+ GMAMEUI_DEBUG (" Column %s is not visible", gtk_tree_view_column_get_title (col));
}
g_list_free (column_list);
g_list_free (pointer_list);
} else
- GMAMEUI_DEBUG ("Not in details mode - column sizing not allowed");
+ GMAMEUI_DEBUG (" Not in details mode - column sizing not allowed");
/* FIXME TODO
if (va)
g_value_array_free (va);*/
GMAMEUI_DEBUG("Resizing columns... done");
}
+#ifdef TREESTORE
void
on_displayed_list_row_collapsed (GtkTreeView *treeview,
GtkTreeIter *iter,
@@ -485,6 +1287,7 @@ on_displayed_list_row_collapsed (GtkTreeView *treeview,
g_free (current_rom_name);
}
+#endif
void
on_displayed_list_sort_column_changed (GtkTreeSortable *treesortable,
@@ -492,8 +1295,9 @@ on_displayed_list_sort_column_changed (GtkTreeSortable *treesortable,
{
gint sort_column_id;
GtkSortType order;
-GMAMEUI_DEBUG("Changing list sorting");
- if (gtk_tree_sortable_get_sort_column_id (treesortable, &sort_column_id, &order)) {
+
+ if (gtk_tree_sortable_get_sort_column_id (treesortable, &sort_column_id, &order)) {
+GMAMEUI_DEBUG ("Changing column %d to sort by %d", sort_column_id, order);
g_object_set (main_gui.gui_prefs,
"sort-col", sort_column_id,
"sort-col-direction", order,
@@ -501,415 +1305,248 @@ GMAMEUI_DEBUG("Changing list sorting");
}
}
-RomEntry *
+MameRomEntry *
gamelist_get_selected_game (void)
{
- RomEntry *game_data;
+ MameRomEntry *game_data;
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreeSelection *select;
game_data = NULL;
- if (!main_gui.displayed_list)
- return NULL;
+ g_return_val_if_fail (main_gui.displayed_list != NULL, NULL);
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (main_gui.displayed_list));
if (gtk_tree_selection_get_selected (select, &model, &iter))
- {
gtk_tree_model_get (model, &iter, ROMENTRY, &game_data, -1);
- }
return game_data;
}
-void
-create_gamelist (ListMode list_mode)
+/* Filters the GtkTreeModel by seeing if the text in the MameSearchEntry
+ is a case insensitive match for text in the first column */
+static gboolean
+filter_func (GtkTreeModel *model,
+ GtkTreeIter *iter,
+ GtkEntry *entry)
{
- gint i;
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
- GtkTreeSelection *select;
- GMAMEUI_DEBUG ("Creating gamelist structure");
+ const gchar *needle;
+ const gchar *haystack;
+ gint filtered;
- /* We Create the TreeView only if it is NULL (this will occur only once) */
- if (main_gui.displayed_list == NULL) {
- main_gui.displayed_list = gtk_tree_view_new ();
- for (i = 0; i < NUMBER_COLUMN; i++) {
- if (i == GAMENAME) {
- /* Game name column contains both the status icon and the name */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (GTK_TREE_VIEW_COLUMN (column), column_title (i));
- gtk_tree_view_column_set_sort_column_id (column, i);
-
- /* Pixbuf */
- renderer = gtk_cell_renderer_pixbuf_new ();
- gtk_tree_view_column_pack_start (GTK_TREE_VIEW_COLUMN (column),
- renderer,
- FALSE);
- gtk_tree_view_column_add_attribute (GTK_TREE_VIEW_COLUMN (column), renderer,
- "pixbuf", PIXBUF);
- g_object_set (renderer, "xalign", 1.0, "ypad", 0, NULL);
-
- /* TEXT */
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_end (GTK_TREE_VIEW_COLUMN (column),
- renderer,
- TRUE);
- gtk_tree_view_column_set_attributes (GTK_TREE_VIEW_COLUMN (column), renderer,
- "text", i,
- "foreground-gdk", TEXTCOLOR,
- NULL);
- g_object_set (renderer, "ypad", 0, "yalign", 0.5, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
-
- } else {
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (column_title (i), renderer,
- "text", i,
- "foreground-gdk", TEXTCOLOR,
- NULL);
- g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
- gtk_tree_view_column_set_sort_column_id (column, i);
- }
- gtk_tree_view_append_column (GTK_TREE_VIEW (main_gui.displayed_list), column);
- //gtk_tree_view_column_set_min_width (GTK_TREE_VIEW_COLUMN (column), 1);
-
- /* Set minimum width to the num of chars in the header TODO Also get sort directory size */
- gint font_size, title_len;
- title_len = g_utf8_strlen (gtk_tree_view_column_get_title (GTK_TREE_VIEW_COLUMN (column)), -1);
- font_size = PANGO_PIXELS (pango_font_description_get_size (GTK_WIDGET(main_gui.displayed_list)->style->font_desc));
- gtk_tree_view_column_set_min_width (GTK_TREE_VIEW_COLUMN (column), title_len*font_size);
-GMAMEUI_DEBUG ("Setting min width of column %s. title len is %d, font size is %d", gtk_tree_view_column_get_title (GTK_TREE_VIEW_COLUMN (column)), title_len, font_size);
-
- g_signal_connect (column->button, "event",
- G_CALLBACK (on_column_click),
- column);
- }
-
- gtk_container_add (GTK_CONTAINER (main_gui.scrolled_window_games), main_gui.displayed_list);
- gtk_widget_show_all (main_gui.scrolled_window_games);
-
- /* Callback - Row has been selected */
- select = gtk_tree_view_get_selection (GTK_TREE_VIEW (main_gui.displayed_list));
- gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
- g_signal_connect (G_OBJECT (select), "changed",
- G_CALLBACK (on_row_selected),
- NULL);
-
- /* Callback - Click on the list */
- g_signal_connect (G_OBJECT (main_gui.displayed_list), "button-press-event",
- G_CALLBACK (on_list_clicked),
- NULL);
- /* Callback - Keypress on the list */
- g_signal_connect (G_OBJECT (main_gui.displayed_list), "key-press-event",
- G_CALLBACK (on_list_keypress),
- NULL);
- /* Callback - Column size modified */
- g_signal_connect (G_OBJECT (main_gui.displayed_list), "size-request",
- G_CALLBACK (on_displayed_list_resize_column),
- NULL);
- /* Callback - Row has been collapsed */
- g_signal_connect (G_OBJECT (main_gui.displayed_list), "row-collapsed",
- G_CALLBACK (on_displayed_list_row_collapsed),
- NULL);
-
- }
-
- /* Header clickable Tree Model must exist. */
- if (main_gui.tree_model) {
- /* We sort the list */
- set_list_sortable_column();
-
- gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (main_gui.displayed_list),
- (list_mode == DETAILS) || (list_mode == DETAILS_TREE));
- }
-
- GValueArray *va_shown = NULL;
- GValueArray *va_width = NULL;
+ /* Get the gamename, and whether it is filtered by ROM, from the iter */
+ gtk_tree_model_get (model, iter,
+ GAMENAME, &haystack,
+ FILTERED, &filtered,
+ -1);
+ needle = gtk_entry_get_text (entry);
- g_object_get (main_gui.gui_prefs,
- "cols-shown", &va_shown,
- "cols-width", &va_width,
- NULL);
+ /*GMAMEUI_DEBUG ("Checking for filter on %s: %d", haystack, filtered);*/
- /* Update the columns */
- /* FIXME When switching from LIST mode to DETAILS, it puts a mess in the size of the
- GAMENAME column even if I block the callback?????? */
- g_signal_handlers_block_by_func (G_OBJECT (main_gui.displayed_list), (gpointer)on_displayed_list_resize_column, NULL);
- for (i = 0; i < NUMBER_COLUMN; i++) {
- /* Iterate over the columns */
- column = gtk_tree_view_get_column (GTK_TREE_VIEW (main_gui.displayed_list), i);
+ /* If no text has been entered in the MameSearchEntry, don't do a string
+ comparison (which will segfault), but instead just check whether the
+ ROM has been filtered */
+ if (haystack == NULL)
+ return filtered;
+
+ /*GMAMEUI_DEBUG ("Comparing search criteria %s against %s", needle, haystack);*/
+ if ((strcasestr (haystack, needle) != NULL) && filtered) {
+ return TRUE;
+ visible_games++;
+ } else
+ return FALSE;
- /* Columns visible, Column size,... */
- if ( (list_mode == DETAILS) || (list_mode == DETAILS_TREE)) { /* COLUMNS */
- if (g_value_get_int (g_value_array_get_nth (va_shown, i)) == FALSE) {
- gtk_tree_view_column_set_visible (column, FALSE);
- } else {
- gint col_width;
-
- col_width = g_value_get_int (g_value_array_get_nth (va_width, i));
- gtk_tree_view_column_set_visible (column, TRUE);
- if (col_width == 0) {
- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
- } else {
- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
- gtk_tree_view_column_set_fixed_width (column, col_width);
- }
- gtk_tree_view_column_set_resizable (column, TRUE);
-
-
- }
- } else { /* NO COLUMNS */
- if (i == GAMENAME) {
- gtk_tree_view_column_set_visible (column, TRUE);
- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
- gtk_tree_view_column_set_resizable (column, FALSE);
- } else {
- gtk_tree_view_column_set_visible (column, FALSE);
- }
- }
- /* Reordering columns is disabled because it conflicts with
- 'column popup menu' and 'sort on click header' */
- gtk_tree_view_column_set_reorderable (GTK_TREE_VIEW_COLUMN (column), FALSE);
- }
- g_signal_handlers_unblock_by_func (G_OBJECT (main_gui.displayed_list), (gpointer)on_displayed_list_resize_column, NULL);
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (main_gui.displayed_list), TRUE);
+}
+
+/* Callback handler for when data is entered in the search criteria field.
+ It asks the GtkTreeView to refilter itself, invoking the callback registered
+ in the call to gtk_tree_model_filter_set_visible_func () */
+static void
+on_search_changed (GtkEntry *entry, gchar *criteria, gpointer user_data)
+{
+ GtkTreeModelSort *sort;
+
+ /*
+ The model structure is set as:
+ Sortable
+ +- Filter
+ +- Store
+ So, we need to first get the model from the main_gui.displayed_list, which
+ returns the Sortable, then get the model from the Sortable, which yields the
+ Filter. We can then perform the refilter on this.
+ */
- dirty_icon_cache = FALSE;
+ sort = GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (GTK_TREE_VIEW (main_gui.displayed_list)));
- GMAMEUI_DEBUG ("Creating gamelist structure... done");
+ gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (gtk_tree_model_sort_get_model (sort)));
}
-void
-create_gamelist_content (void)
+static void
+populate_model_from_gamelist (MameGamelistView *gamelist_view, GtkTreeModel *model)
{
GList *listpointer;
- RomEntry *tmprom;
+ MameRomEntry *tmprom;
gchar *my_romname_root = NULL;
gchar *my_hassamples;
- GdkColor my_txtcolor;
GtkTreeIter iter;
+#ifdef TREESTORE
GtkTreeIter iter_root;
- GtkTreeModel *store;
- gboolean tree_store; /* If the model is a tree or a list */
gboolean is_root;
- gint j = 0;
- gchar *message;
- ListMode current_mode;
- gchar *current_rom_name;
- gchar *clone_color;
+#endif
gint rom_filter_opt;
+ const gchar *name_in_list;
- g_return_if_fail (gui_prefs.gl != NULL);
-
- GMAMEUI_DEBUG ("POPULATE GAME LIST");
-GTimer *timer = g_timer_new ();
-g_timer_start (timer);
+ g_return_if_fail (model != NULL);
- g_object_get (main_gui.gui_prefs,
- "current-mode", ¤t_mode,
- "current-rom", ¤t_rom_name,
- "clone-color", &clone_color,
- NULL);
-
- /* Status Bar Message */
- gtk_statusbar_pop (main_gui.statusbar3, 1);
- gtk_statusbar_push (main_gui.statusbar3, 1, _("Wait..."));
-
- /* Unset the tree model until it has been filled */
- if ((main_gui.displayed_list) && (main_gui.tree_model)) {
- gtk_tree_view_set_model (GTK_TREE_VIEW (main_gui.displayed_list), NULL);
- }
-
- /* Whether the Tree Model will a tree or a list */
- tree_store = ((current_mode == LIST_TREE) || (current_mode == DETAILS_TREE));
-
- /* Get the status icon */
- get_status_icons ();
-
/* Get the current ROM filter setting */
g_object_get (main_gui.gui_prefs, "current-rom-filter", &rom_filter_opt, NULL);
GMAMEUI_DEBUG ("ROM filter is %d", rom_filter_opt);
- /* Create a model. */
- if (tree_store)
- store = (GtkTreeModel *) gtk_tree_store_new (NUMBER_COLUMN + 3,
- G_TYPE_STRING, /* Name */
- G_TYPE_STRING, /* Has samples */
- G_TYPE_STRING, /* ROM name */
- G_TYPE_INT, /* Times played */
- G_TYPE_STRING, /* Manu */
- G_TYPE_STRING, /* Year */
- G_TYPE_STRING, /* Clone of */
- G_TYPE_STRING, /* Driver */
- G_TYPE_STRING, /* Ver added */
- G_TYPE_STRING, /* Category */
- G_TYPE_POINTER, /* Rom Entry */
- GDK_TYPE_COLOR, /* Text Color */
- GDK_TYPE_PIXBUF); /* Pixbuf */
- else
- store = (GtkTreeModel *) gtk_list_store_new (NUMBER_COLUMN + 3,
- G_TYPE_STRING, /* Name */
- G_TYPE_STRING, /* Has samples */
- G_TYPE_STRING, /* ROM name */
- G_TYPE_INT, /* Times played */
- G_TYPE_STRING, /* Manu */
- G_TYPE_STRING, /* Year */
- G_TYPE_STRING, /* Clone of */
- G_TYPE_STRING, /* Driver */
- G_TYPE_STRING, /* Ver added */
- G_TYPE_STRING, /* Category */
- G_TYPE_POINTER, /* Rom Entry */
- GDK_TYPE_COLOR, /* Text Color */
- GDK_TYPE_PIXBUF); /* Pixbuf */
-
+ /* Always clear and repopulate, since we call from numerous instances */
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
/* Fill the model with data */
for (listpointer = g_list_first (mame_gamelist_get_roms_glist (gui_prefs.gl));
(listpointer);
- listpointer= g_list_next (listpointer)) {
- tmprom = (RomEntry *) listpointer->data;
- if (game_filtered (tmprom, rom_filter_opt)) {
- GdkPixbuf *pixbuf = NULL;
+ listpointer = g_list_next (listpointer)) {
- rom_entry_get_list_name (tmprom);
+ tmprom = (MameRomEntry *) listpointer->data;
- /* Has Samples */
- if (tmprom->nb_samples == 0)
- my_hassamples = NULL;
- else
- my_hassamples = (tmprom->has_samples == CORRECT) ? _("Yes") : _("No");
+ PangoStyle pangostyle;
+ GdkPixbuf *pixbuf = NULL;
+
+ name_in_list = mame_rom_entry_get_list_name (tmprom);
+
+ /* Has Samples */
+ if (!mame_rom_entry_has_samples (tmprom))
+ my_hassamples = NULL;
+ else
+ my_hassamples = (mame_rom_entry_get_sample_status (tmprom) == CORRECT) ? _("Yes") : _("No");
- /* Clone Color + Pixbuf width */
- if (g_ascii_strcasecmp (tmprom->cloneof, "-") != 0) {
- /* Clone */
- gdk_color_parse (clone_color, &my_txtcolor);
- } else {
- /* Original */
- gdk_color_parse ("black", &my_txtcolor);
- }
+ if (mame_rom_entry_is_clone (tmprom)) {
+ pangostyle = PANGO_STYLE_ITALIC; /* Clone */
+ } else {
+ pangostyle = PANGO_STYLE_NORMAL; /* Original */
+ }
- /* Set the pixbuf for the status icon */
- pixbuf = Status_Icons [tmprom->has_roms];
+ /* Set the pixbuf for the status icon */
+ pixbuf = Status_Icons [mame_rom_entry_get_rom_status (tmprom)];
- /* Determine if the row is a root */
- if ((j == 0) ||
- (g_ascii_strcasecmp (tmprom->cloneof, "-") == 0) ||
- !my_romname_root ||
- (g_ascii_strcasecmp (tmprom->cloneof, my_romname_root) != 0)) {
+#ifdef TREESTORE
+ /* Determine if the row is a root */
+ if ((j == 0) ||
+ (g_ascii_strcasecmp (tmprom->cloneof, "-") == 0) ||
+ !my_romname_root ||
+ (g_ascii_strcasecmp (tmprom->cloneof, my_romname_root) != 0)) {
is_root = TRUE;
} else {
is_root = FALSE;
}
+#endif
+ /* Memorize the original names */
+/* if (!(g_ascii_strcasecmp (tmprom->cloneof, "-"))) {
+ if (my_romname_root)
+ g_free (my_romname_root);
+
+ my_romname_root= g_strdup (tmprom->romname);
+ }*/
+ gchar *romname, *manu, *year, *cloneof, *driver, *category, *version;
+ gint timesplayed;
+
+ g_object_get (tmprom,
+ "romname", &romname,
+ "times-played", ×played,
+ "manufacturer", &manu,
+ "year", &year,
+ "cloneof", &cloneof,
+ "driver", &driver,
+ "category", &category,
+ "version-added", &version,
+ NULL);
+
+#ifdef TREESTORE
+ if (gamelist_view->priv->is_tree_mode) {
- /* Memorize the original names */
- if (!(g_ascii_strcasecmp (tmprom->cloneof, "-"))) {
- if (my_romname_root)
- g_free (my_romname_root);
-
- my_romname_root= g_strdup (tmprom->romname);
- }
-
- if (tree_store) {
- if (is_root)
- gtk_tree_store_append (GTK_TREE_STORE (store), &iter, NULL); /* Acquire an iterator */
- else
- gtk_tree_store_append (GTK_TREE_STORE (store), &iter, &iter_root); /* Acquire an iterator */
-
- gtk_tree_store_set (GTK_TREE_STORE (store), &iter,
- GAMENAME, tmprom->name_in_list,
- HAS_SAMPLES, my_hassamples,
- ROMNAME, tmprom->romname,
- TIMESPLAYED, tmprom->timesplayed,
- MANU, tmprom->manu,
- YEAR, tmprom->year,
- CLONE, tmprom->cloneof,
- DRIVER, tmprom->driver,
- MAMEVER, tmprom->mame_ver_added,
- CATEGORY, tmprom->category,
- ROMENTRY, tmprom, /* rom entry */
- TEXTCOLOR, &my_txtcolor, /* text color */
- PIXBUF, pixbuf, /* pixbuf */
- -1);
- if (is_root)
- iter_root = iter;
+ if (is_root)
+ gtk_tree_store_append (GTK_TREE_STORE (model),
+ &iter, NULL); /* Acquire an iterator */
+ else
+ gtk_tree_store_append (GTK_TREE_STORE (model),
+ &iter, &iter_root); /* Acquire an iterator */
+
+ gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
+ GAMENAME, name_in_list,
+ HAS_SAMPLES, my_hassamples,
+ ROMNAME, romname,
+ TIMESPLAYED, timesplayed,
+ MANU, manu,
+ YEAR, year,
+ CLONE, cloneof,
+ DRIVER, driver,
+ MAMEVER, version,
+ CATEGORY, category,
+ ROMENTRY, tmprom,
+ TEXTSTYLE, pangostyle,
+ FILTERED, game_filtered (tmprom, rom_filter_opt),
+ PIXBUF, pixbuf,
+ -1);
+
+ if (is_root)
+ iter_root = iter;
} else {
- gtk_list_store_append (GTK_LIST_STORE (store), &iter); /* Acquire an iterator */
- gtk_list_store_set (GTK_LIST_STORE (store), &iter,
- GAMENAME, tmprom->name_in_list,
- HAS_SAMPLES, my_hassamples,
- ROMNAME, tmprom->romname,
- TIMESPLAYED, tmprom->timesplayed,
- MANU, tmprom->manu,
- YEAR, tmprom->year,
- CLONE, tmprom->cloneof,
- DRIVER, tmprom->driver,
- MAMEVER, tmprom->mame_ver_added,
- CATEGORY, tmprom->category,
- ROMENTRY, tmprom, /* rom entry */
- TEXTCOLOR, &my_txtcolor, /* text color */
- PIXBUF, pixbuf, /* pixbuf */
- -1);
- }
- tmprom->position = iter;
- tmprom->is_in_list = TRUE;
- j++;
- } else {
- tmprom->is_in_list = FALSE;
+#endif
+
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter); /* Acquire an iterator */
+
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ GAMENAME, name_in_list,
+ HAS_SAMPLES, my_hassamples,
+ ROMNAME, romname,
+ TIMESPLAYED, timesplayed,
+ MANU, manu,
+ YEAR, year,
+ CLONE, cloneof,
+ DRIVER, driver,
+ MAMEVER, version,
+ CATEGORY, category,
+ ROMENTRY, tmprom,
+ TEXTSTYLE, pangostyle,
+ FILTERED, game_filtered (tmprom, rom_filter_opt),
+ PIXBUF, pixbuf,
+ -1);
+
+#ifdef TREESTORE
}
- }
- visible_games = j;
-
- /* Callbacks - Sorting order has changed */
- main_gui.tree_model = GTK_TREE_MODEL (store);
- if (main_gui.tree_model != NULL) {
- g_signal_connect (G_OBJECT (main_gui.tree_model), "sort-column-changed",
- G_CALLBACK (on_displayed_list_sort_column_changed),
- NULL);
- }
-
- /* Update the corresponding tree view */
- if (main_gui.displayed_list) {
- /* Link the view with the model */
- gtk_tree_view_set_model (GTK_TREE_VIEW (main_gui.displayed_list), GTK_TREE_MODEL (main_gui.tree_model));
-
- /* Sort the list */
- set_list_sortable_column ();
+#endif
+ mame_rom_entry_set_position (tmprom, iter);
+
+ g_free (romname);
+ g_free (manu);
+ g_free (year);
+ g_free (cloneof);
+ g_free (driver);
+ g_free (category);
+ g_free (version);
- /* Find the selected game in the gamelist, and scroll to it, opening any expanders */
- if (visible_games > 0) {
- /* Scroll to the game specified from the preferences */
- gtk_tree_model_foreach (GTK_TREE_MODEL (main_gui.tree_model), foreach_find_rom_in_store, current_rom_name);
- }
- /* Header clickable. */
- gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (main_gui.displayed_list),
- (current_mode == DETAILS) ||
- (current_mode == DETAILS_TREE));
-
}
- /* Status Bar Message */
- message = g_strdup_printf ("%d %s", visible_games, visible_games > 1 ? _("games") : _("game"));
- gtk_statusbar_pop (main_gui.statusbar3, 1);
- gtk_statusbar_push (main_gui.statusbar3, 1, message);
+ /* Count the number of rows displayed in the filter model */
+ visible_games = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (gamelist_view->priv->filter_model), NULL);
+
+ set_status_bar_game_count (visible_games);
- /* Free Memory */
- if (message)
- g_free (message);
- if (my_romname_root)
- g_free (my_romname_root);
- if (clone_color)
- g_free (clone_color);
+}
- if (visible_games == 0)
- select_game (NULL);
- else
- select_game (gui_prefs.current_game);
+void
+mame_gamelist_view_repopulate_contents (MameGamelistView *gamelist_view)
+{
+ g_return_if_fail (gamelist_view != NULL);
- GMAMEUI_DEBUG ("Time taken to create_gamelist_content is %.2f", g_timer_elapsed (timer, NULL));
- g_timer_destroy (timer);
+ populate_model_from_gamelist (gamelist_view, gamelist_view->priv->curr_model);
}
void
@@ -926,8 +1563,174 @@ gmameui_gamelist_rebuild ()
load_games_ini ();
load_catver_ini ();
- create_gamelist_content ();
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
gtk_widget_set_sensitive (main_gui.scrolled_window_games, TRUE);
GMAMEUI_DEBUG ("Done rebuilding gamelist");
}
+
+/* This function is to set the game icon from the zip file for each visible game;
+ it is called as a timeout whenever the scrolled window changes (gamelist scrolled up or down) */
+gboolean
+adjustment_scrolled_delayed (MameGamelistView *gamelist_view)
+{
+ GtkTreeIter iter;
+#ifdef TREESTORE
+ GtkTreeIter iter_child;
+#endif
+ GtkTreePath *tree_path;
+ guint i;
+ ZIP *zip;
+ gchar *zipfile;
+ gboolean valid;
+ GtkAdjustment *vadj;
+ gchar *icon_dir;
+
+ g_return_val_if_fail (main_gui.gui_prefs != NULL, FALSE);
+
+GMAMEUI_DEBUG ("Entering adjustment_scrolled_delayed");
+ g_object_get (main_gui.gui_prefs,
+ "dir-icons", &icon_dir,
+#ifdef TREESTORE
+ "current-mode", ¤t_mode,
+#endif
+ NULL);
+
+ g_return_val_if_fail (visible_games > 0, FALSE);
+
+ /* Open the zip file only at the begining */
+ zipfile = g_build_filename (icon_dir, "icons.zip", NULL);
+ zip = openzip (zipfile);
+
+ /* Getting the vertical window area */
+ vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (main_gui.scrolled_window_games));
+
+ /* Disable the callback */
+ g_signal_handlers_block_by_func (G_OBJECT (vadj),
+ adjustment_scrolled,
+ gamelist_view);
+
+ /* Get the first iter from the model */
+ valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (gamelist_view->priv->sort_model), &iter);
+
+#ifdef TREESTORE
+ set_game_pixbuff_from_iter (gamelist_view, &iter,zip, (gint) (vadj->page_size));
+ i = 0;
+ while ((i < visible_games) && valid) {
+ tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
+
+ * Set the icon for all children if the parent row is expanded *
+
+ if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (main_gui.displayed_list), tree_path)) {
+ if (gtk_tree_model_iter_children (GTK_TREE_MODEL (model), &iter_child, &iter)) {
+ set_game_pixbuff_from_iter (gamelist_view, &iter_child,zip, (gint) (vadj->page_size));
+ while ((i < visible_games) && (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter_child)) ) {
+ set_game_pixbuff_from_iter (gamelist_view, &iter_child, zip, (gint) (vadj->page_size));
+ i++;
+ }
+ }
+ }
+
+ gtk_tree_path_free (tree_path);
+ if (i < visible_games) {
+ valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter);
+ if (valid) {
+ set_game_pixbuff_from_iter (gamelist_view, &iter,zip, (gint) (vadj->page_size));
+ i++;
+ }
+ }
+ }
+#endif
+ i = 0;
+
+ MameRomEntry *tmprom;
+
+ while ((i < visible_games) && valid) {
+ GtkTreeIter filter_iter;
+ GtkTreeIter model_iter;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (gamelist_view->priv->sort_model),
+ &iter,
+ ROMENTRY, &tmprom,
+ -1);
+ /*GMAMEUI_DEBUG ("Updating icon for %s - the value of icon_pixbuf is %d",
+ tmprom->romname,
+ !tmprom->icon_pixbuf);*/
+
+ /* Get the path so we can get the new iter after the store is updated */
+ tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (gamelist_view->priv->sort_model), &iter);
+
+ /* Get the position of the current iter's path so we can see
+ whether it falls within the visible area */
+ GdkRectangle rect;
+ gtk_tree_view_get_cell_area (GTK_TREE_VIEW (main_gui.displayed_list),
+ tree_path,
+ NULL, &rect);
+
+ /* Only update the pixbuf if it is in the viewable area
+ (defined by the rect), the ROM is correct, and the
+ pixbuf is not already set */
+ if ((rect.y + rect.height) > 0 && (rect.y < vadj->page_size) &&
+ (mame_rom_entry_get_rom_status (tmprom) == CORRECT) &&
+ !mame_rom_entry_get_icon (tmprom)) {
+ GdkPixbuf *icon;
+ icon = get_icon_for_rom (tmprom, ROM_ICON_SIZE, zip);
+
+ mame_rom_entry_set_icon (tmprom, icon);
+
+ /* Sort +- Filter +- Model, so need to convert the iter
+ on the sort to get to the base before we can update the base model */
+
+ /* Get the filter model and iter */
+ gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (gamelist_view->priv->sort_model),
+ &filter_iter,
+ &iter);
+
+ /* Get the base model and iter from the filter */
+ gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (gamelist_view->priv->filter_model),
+ &model_iter,
+ &filter_iter);
+#ifdef TREESTORE
+ if ((current_mode == LIST_TREE) || (current_mode == DETAILS_TREE))
+ gtk_tree_store_set (GTK_TREE_STORE (gamelist_view->priv->curr_model),
+ &model_iter,
+ PIXBUF, tmprom->icon_pixbuf,
+ -1);
+ else
+#endif
+
+ /* Update the ROM in the list store with the icon from the zip file */
+ if (icon) {
+ gtk_list_store_set (GTK_LIST_STORE (gamelist_view->priv->curr_model),
+ &model_iter,
+ PIXBUF, icon,
+ -1);
+ /* After the list store has been updated, the iterator
+ is lost, so we need to get it from the updated model */
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (gamelist_view->priv->sort_model),
+ &iter, tree_path);
+
+ }
+ }
+
+ /* Move to the next item in the list */
+ valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (gamelist_view->priv->sort_model), &iter);
+
+ gtk_tree_path_free (tree_path);
+
+ i++;
+ }
+
+ /* Re-Enable the callback */
+ g_signal_handlers_unblock_by_func (G_OBJECT (vadj),
+ adjustment_scrolled,
+ gamelist_view);
+
+ if (zip)
+ closezip (zip);
+
+ g_free (zipfile);
+ g_free (icon_dir);
+GMAMEUI_DEBUG ("Leaving adjustment_scrolled_delayed");
+ return FALSE;
+}
diff --git a/src/gmameui-gamelist-view.h b/src/gmameui-gamelist-view.h
index 83bdb06..6ce14b1 100644
--- a/src/gmameui-gamelist-view.h
+++ b/src/gmameui-gamelist-view.h
@@ -21,52 +21,73 @@
*
*/
+
#ifndef __GMAMEUI_GAMELIST_VIEW_H__
#define __GMAMEUI_GAMELIST_VIEW_H__
-#include "common.h"
-//#include "callbacks.h"
-#include "interface.h"
-#include "gmameui.h"
+#include <gtk/gtk.h>
+
+#include "rom_entry.h" /* For MameRomEntry */
+#include "gmameui.h" /* For ListMode */
+
+G_BEGIN_DECLS
+
+/* Preferences dialog object */
+#define MAME_TYPE_GAMELIST_VIEW (mame_gamelist_view_get_type ())
+#define MAME_GAMELIST_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAME_TYPE_GAMELIST_VIEW, MameGamelistView))
+#define MAME_GAMELIST_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MAME_TYPE_GAMELIST_VIEW, MameGamelistViewClass))
+#define MAME_IS_GAMELIST_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAME_TYPE_GAMELIST_VIEW))
+#define MAME_IS_GAMELIST_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAME_TYPE_GAMELIST_VIEW))
+#define MAME_GAMELIST_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MAME_TYPE_GAMELIST_VIEW, MameGamelistViewClass))
+
+typedef struct _MameGamelistView MameGamelistView;
+typedef struct _MameGamelistViewClass MameGamelistViewClass;
+typedef struct _MameGamelistViewPrivate MameGamelistViewPrivate;
+
+struct _MameGamelistView {
+ GtkTreeView parent;
+
+ MameGamelistViewPrivate *priv;
+};
+
+struct _MameGamelistViewClass {
+ GtkTreeViewClass parent_class;
+
+};
+
+GType mame_gamelist_view_get_type (void);
+MameGamelistView *mame_gamelist_view_new (void);
guint visible_games;
+#ifdef TREESTORE
+void mame_gamelist_view_change_model (MameGamelistView *gamelist_view);
+#endif
+void mame_gamelist_view_select_random_game (MameGamelistView *gamelist_view,
+ gint i);
+void mame_gamelist_view_update_game_in_list (MameGamelistView *gamelist_view,
+ MameRomEntry *tmprom);
+/*GtkTreeModel *
+mame_gamelist_view_get_data_model (MameGamelistView *gamelist_view);*/
+void
+mame_gamelist_view_change_views (MameGamelistView *gamelist_view);
+#ifdef TREESTORE
+void on_collapse_all_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+void on_expand_all_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+#endif
+void on_column_hide_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
-void create_gamelist_content (void);
-void create_gamelist (ListMode list_mode);
-
-gboolean foreach_find_random_rom_in_store (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data);
-gboolean foreach_find_rom_in_store (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer user_data);
-void on_collapse_all_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-void on_expand_all_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-void on_displayed_list_resize_column (GtkWidget *widget,
- GtkRequisition *requisition,
- gpointer user_data);
-void on_displayed_list_sort_column_changed (GtkTreeSortable *treesortable,
- gpointer user_data);
-void on_displayed_list_row_collapsed (GtkTreeView *treeview,
- GtkTreeIter *arg1,
- GtkTreePath *arg2,
- gpointer user_data);
-/* Main list */
-void on_row_selected (GtkTreeSelection *selection, gpointer data);
-
-gboolean on_list_keypress (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
-gboolean on_list_clicked (GtkWidget *widget, GdkEventButton *event, gpointer user_data);
-gboolean on_column_click (GtkWidget *button, GdkEventButton *event, GtkTreeViewColumn* column);
-
-/* Column Popup menu */
-void on_column_hide_activate (GtkMenuItem *menuitem, gpointer user_data);
-
-RomEntry * gamelist_get_selected_game (void);
+MameRomEntry* gamelist_get_selected_game (void);
void gmameui_gamelist_rebuild ();
+gboolean adjustment_scrolled_delayed (MameGamelistView *gamelist_view);
+
+void mame_gamelist_view_scroll_to_selected_game (MameGamelistView *gamelist_view);
+
+void mame_gamelist_view_repopulate_contents (MameGamelistView *gamelist_view);
+
+G_END_DECLS
#endif /* __GMAMEUI_GAMELIST_VIEW_H__ */
diff --git a/src/gmameui-marshaller.c b/src/gmameui-marshaller.c
index 7a6a38e..129d3db 100644
--- a/src/gmameui-marshaller.c
+++ b/src/gmameui-marshaller.c
@@ -87,3 +87,11 @@ gmameui_marshaller_VOID__STRING_INT_INT (GClosure *closure,
data2);
}
+/* VOID:STRING (gmameui-marshallers.list:3) */
+
+/* VOID:INT (gmameui-marshallers.list:4) */
+
+/* VOID:BOOLEAN (gmameui-marshallers.list:5) */
+
+/* VOID:POINTER (gmameui-marshallers.list:6) */
+
diff --git a/src/gmameui-marshaller.h b/src/gmameui-marshaller.h
index 178e067..f790333 100644
--- a/src/gmameui-marshaller.h
+++ b/src/gmameui-marshaller.h
@@ -14,6 +14,18 @@ extern void gmameui_marshaller_VOID__STRING_INT_INT (GClosure *closure,
gpointer invocation_hint,
gpointer marshal_data);
+/* VOID:STRING (gmameui-marshallers.list:3) */
+#define gmameui_marshaller_VOID__STRING g_cclosure_marshal_VOID__STRING
+
+/* VOID:INT (gmameui-marshallers.list:4) */
+#define gmameui_marshaller_VOID__INT g_cclosure_marshal_VOID__INT
+
+/* VOID:BOOLEAN (gmameui-marshallers.list:5) */
+#define gmameui_marshaller_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN
+
+/* VOID:POINTER (gmameui-marshallers.list:6) */
+#define gmameui_marshaller_VOID__POINTER g_cclosure_marshal_VOID__POINTER
+
G_END_DECLS
#endif /* __gmameui_marshaller_MARSHAL_H__ */
diff --git a/src/gmameui-marshallers.list b/src/gmameui-marshallers.list
index 8c6e174..c658397 100644
--- a/src/gmameui-marshallers.list
+++ b/src/gmameui-marshallers.list
@@ -1,3 +1,6 @@
# These marshallers are generated with glib-genmarshal(1)
VOID:STRING,INT,INT
-
+VOID:STRING
+VOID:INT
+VOID:BOOLEAN
+VOID:POINTER
diff --git a/src/gmameui-rominfo-dlg.c b/src/gmameui-rominfo-dlg.c
index c713378..cfff6fc 100644
--- a/src/gmameui-rominfo-dlg.c
+++ b/src/gmameui-rominfo-dlg.c
@@ -44,7 +44,7 @@ struct _MameRomInfoDialogPrivate {
GtkWidget *sample_check_result;
GtkWidget *rom_check_result;
- RomEntry *rom;
+ MameRomEntry *rom;
};
#define MAME_ROMINFO_DIALOG_GET_PRIVATE(o) (MAME_ROMINFO_DIALOG (o)->priv)
@@ -67,7 +67,8 @@ audit_game (MameRomInfoDialog *dialog)
if (!mame_exec_list_has_current_executable (main_gui.exec_list)) {
gtk_label_set_text (GTK_LABEL (dialog->priv->rom_check_result), _("Can't audit game"));
- if (dialog->priv->rom->nb_samples > 0) {
+
+ if (mame_rom_entry_has_samples (dialog->priv->rom)) {
gtk_label_set_text (GTK_LABEL (dialog->priv->sample_check_result), _("Can't audit game"));
} else {
gtk_label_set_text (GTK_LABEL (dialog->priv->sample_check_result), _("None required"));
@@ -78,7 +79,7 @@ audit_game (MameRomInfoDialog *dialog)
g_return_if_fail (dialog != NULL);
g_return_if_fail (dialog->priv->rom != NULL);
- mame_audit_start_single (dialog->priv->rom->romname);
+ mame_audit_start_single (mame_rom_entry_get_romname (dialog->priv->rom));
}
@@ -90,84 +91,6 @@ audit_idle (gpointer data)
return FALSE;
}
-static char *
-get_rom_clone_name (RomEntry *rom)
-{
- char *value = NULL;
-
- /* find the clone name if there is a clone */
- if (strcmp (rom->cloneof, "-")) {
- RomEntry *tmprom;
-
- tmprom = get_rom_from_gamelist_by_name (gui_prefs.gl, rom->cloneof);
- if (tmprom) {
- value = g_strdup_printf ("%s - \"%s\"", rom_entry_get_list_name (tmprom), rom->cloneof);
- } else {
- value = g_strdup_printf (" - \"%s\"", rom->cloneof);
- }
- }
-
- return value;
-}
-
-static char *
-get_rom_cpu_value (RomEntry *rom)
-{
- char *value = NULL;
- char *values [NB_CPU + 1];
- gint i, j;
-
- j = 0;
- values[j] = NULL;
- for (i = 0; i < NB_CPU; i++) {
- if (strcmp (rom->cpu_info[i].name, "-")
- && rom->cpu_info[i].name[0] != '\0') {
- values[j++] = g_strdup_printf ("%s %f MHz%s",
- rom->cpu_info[i].name,
- rom->cpu_info[i].clock / 1000000.0,
- rom->cpu_info[i].sound_flag ? _(" (sound)") : " ");
- }
- }
- values[j++] = NULL;
-
- value = g_strjoinv ("\n", values);
-
- for (i = 0; i < j; i++)
- g_free (values[i]);
-
- return value;
-}
-
-static char *
-get_rom_sound_value (RomEntry *rom)
-{
- char *value = NULL;
- char *values [NB_CPU + 1];
- gint i, j;
-
- j = 0;
- values[j] = NULL;
- for (i = 0; i < NB_CPU; i++) {
- if (strcmp (rom->sound_info[i].name, "-")
- && rom->sound_info[i].name[0]) {
- if (rom->sound_info[i].clock == 0)
- values[j++] = g_strdup_printf ("%s", rom->sound_info[i].name);
- else
- values[j++] = g_strdup_printf ("%s %f MHz",
- rom->sound_info[i].name,
- rom->sound_info[i].clock / 1000000.0);
- }
- }
- values[j++] = NULL;
-
- value = g_strjoinv ("\n", values);
-
- for (i = 0; i < j; i++)
- g_free (values[i]);
-
- return value;
-}
-
static void
on_romset_audited (GmameuiAudit *audit, gchar *audit_line, gint type, gint auditresult, gpointer user_data)
{
@@ -192,15 +115,19 @@ on_romset_audited (GmameuiAudit *audit, gchar *audit_line, gint type, gint audit
if (auditresult != NOTROMSET) {
title = rom_status_desc[auditresult];
if (type == AUDIT_TYPE_ROM) {
- dialog->priv->rom->has_roms = auditresult;
+ g_object_set (dialog->priv->rom, "has-roms", auditresult, NULL);
+
gtk_label_set_text (GTK_LABEL (dialog->priv->rom_check_result), title);
} else {
- dialog->priv->rom->has_samples = auditresult;
+ g_object_set (dialog->priv->rom, "has-samples", auditresult, NULL);
+
gtk_label_set_text (GTK_LABEL (dialog->priv->sample_check_result), title);
}
- update_game_in_list (dialog->priv->rom);
- } else if (g_str_has_prefix (audit_line, dialog->priv->rom->romname)) {
+ /* Update the game in the MameGamelistView */
+ mame_gamelist_view_update_game_in_list (main_gui.displayed_list, dialog->priv->rom);
+
+ } else if (g_str_has_prefix (audit_line, mame_rom_entry_get_romname (dialog->priv->rom))) {
/* Line relates to a ROM within the ROM set */
gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (dialog->priv->details_audit_result_buffer), &text_iter);
gtk_text_buffer_insert (GTK_TEXT_BUFFER (dialog->priv->details_audit_result_buffer), &text_iter, audit_line, -1);
@@ -271,7 +198,6 @@ mame_rominfo_dialog_init (MameRomInfoDialog *dialog)
dialog->priv = priv;
/* Initialise private variables */
-
priv->rom = gui_prefs.current_game;
g_return_if_fail (priv->rom != NULL);
@@ -294,18 +220,18 @@ mame_rominfo_dialog_init (MameRomInfoDialog *dialog)
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
- gtk_window_set_title (GTK_WINDOW (dialog), rom_entry_get_list_name (priv->rom));
+ gtk_window_set_title (GTK_WINDOW (dialog), mame_rom_entry_get_list_name (priv->rom));
- value = g_strdup_printf("<b>%s</b>", rom_entry_get_list_name (priv->rom));
+ value = g_strdup_printf("<b>%s</b>", mame_rom_entry_get_list_name (priv->rom));
label = glade_xml_get_widget (priv->xml, "rom_name_lbl");
gtk_label_set_markup (GTK_LABEL (label), value);
-
+
label = glade_xml_get_widget (priv->xml, "year_result");
- gtk_label_set_text (GTK_LABEL (label), priv->rom->year);
+ gtk_label_set_text (GTK_LABEL (label), mame_rom_entry_get_year (priv->rom));
label = glade_xml_get_widget (priv->xml, "manufacturer_result");
- gtk_label_set_text (GTK_LABEL (label), priv->rom->manu);
-
+ gtk_label_set_text (GTK_LABEL (label), mame_rom_entry_get_manufacturer (priv->rom));
+
title = get_rom_cpu_value (priv->rom);
label = glade_xml_get_widget (priv->xml, "cpu_result");
gtk_label_set_text (GTK_LABEL (label), title);
@@ -315,32 +241,41 @@ mame_rominfo_dialog_init (MameRomInfoDialog *dialog)
label = glade_xml_get_widget (priv->xml, "sound_result");
gtk_label_set_text (GTK_LABEL (label), title);
g_free (title);
+gboolean horizontal;
+gint num_colours;
+gfloat freq;
+ g_object_get (priv->rom,
+ "is-horizontal", &horizontal,
+ "screen-freq", &freq,
+ "num-colours", &num_colours,
+ NULL);
+
/* Don't display resolution if this is a vector game */
- if (!priv->rom->vector)
- value = g_strdup_printf ("%i \303\227 %i ", priv->rom->screen_x, priv->rom->screen_y);
+ if (!mame_rom_entry_is_vector (priv->rom))
+ value = mame_rom_entry_get_resolution (priv->rom);
else
value = g_strdup_printf ("");
title = g_strdup_printf ("%s%s %.2f Hz",
value,
- priv->rom->horizontal ? "Horizontal" : "Vertical",
- priv->rom->screen_freq);
+ horizontal ? "Horizontal" : "Vertical",
+ freq);
g_free (value);
label = glade_xml_get_widget (priv->xml, "screen_result");
gtk_label_set_text (GTK_LABEL (label), title);
g_free (title);
- title = g_strdup_printf (_("%i colors"), priv->rom->colors);
+ title = g_strdup_printf (_("%i colors"), num_colours);
label = glade_xml_get_widget (priv->xml, "colors_result");
gtk_label_set_text (GTK_LABEL (label), title);
g_free (title);
label = glade_xml_get_widget (priv->xml, "clone_result");
GtkWidget *clone_label = glade_xml_get_widget (priv->xml, "clone_label");
- if (strcmp (priv->rom->cloneof, "-")) {
+ if (mame_rom_entry_is_clone (priv->rom)) {
/* Get the title of the original ROM */
- title = get_rom_clone_name (priv->rom);
+ title = mame_rom_entry_get_parent_romname (priv->rom);
gtk_label_set_text (GTK_LABEL (label), title);
g_free (title);
} else {
@@ -412,9 +347,8 @@ mame_rominfo_dialog_response (GtkDialog *dialog, gint response)
case GTK_RESPONSE_CLOSE:
/* Close button clicked */
gtk_widget_destroy (GTK_WIDGET (dialog));
-
- //create_gamelist_content ();
break;
+
case GTK_RESPONSE_DELETE_EVENT:
/* Dialog closed */
@@ -422,8 +356,6 @@ mame_rominfo_dialog_response (GtkDialog *dialog, gint response)
//mame_audit_stop_full_audit (gui_prefs.audit);
gtk_widget_destroy (GTK_WIDGET (dialog));
-
- //create_gamelist_content ();
break;
default:
g_assert_not_reached ();
diff --git a/src/gmameui-search-entry.c b/src/gmameui-search-entry.c
new file mode 100644
index 0000000..cf3f9b1
--- /dev/null
+++ b/src/gmameui-search-entry.c
@@ -0,0 +1,212 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * GMAMEUI
+ *
+ * Copyright 2009 Andrew Burton <adb at iinet.net.au>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#include <glade/glade.h>
+
+#include "common.h"
+#include "gmameui-search-entry.h"
+#include "gmameui-marshaller.h"
+
+struct _MameSearchEntryPrivate {
+
+};
+
+G_DEFINE_TYPE (MameSearchEntry, mame_search_entry, GTK_TYPE_ENTRY)
+
+#define MAME_SEARCH_ENTRY_GET_PRIVATE(o) (MAME_SEARCH_ENTRY (o)->priv)
+
+/* Signals enumeration */
+enum
+{
+ SEARCH_TEXT_CHANGED, /* Emitted when the search criteria changes */
+ LAST_SEARCH_SIGNAL
+};
+static guint signals[LAST_SEARCH_SIGNAL] = { 0 };
+
+/* Function prototypes */
+static void
+mame_search_entry_finalize (GObject *object);
+
+static void
+search_entry_changed (MameSearchEntry *entry, gpointer user_data);
+static gboolean
+search_entry_changed_timeout (GtkWidget *widget);
+
+#if GTK_CHECK_VERSION(2,16,0)
+static void
+search_entry_clear (GtkEntry *entry, GtkEntryIconPosition icon_pos,
+ GdkEvent *event, MameSearchEntry *search_entry);
+#endif
+
+/* Boilerplate functions */
+static GObject *
+mame_search_entry_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_properties)
+{
+ GObject *obj;
+ MameSearchEntry *entry;
+
+ obj = G_OBJECT_CLASS (mame_search_entry_parent_class)->constructor (type,
+ n_construct_properties,
+ construct_properties);
+
+ entry = MAME_SEARCH_ENTRY (obj);
+
+ return obj;
+}
+
+static void
+mame_search_entry_class_init (MameSearchEntryClass *class)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (class);
+ GtkEntryClass *gtkentry_class = GTK_ENTRY_CLASS (class);
+
+ gobject_class->constructor = mame_search_entry_constructor;
+/* gobject_class->get_property = mame_search_entry_get_property;
+ gobject_class->set_property = mame_search_entry_set_property;*/
+
+ gobject_class->finalize = mame_search_entry_finalize;
+
+ g_type_class_add_private (class,
+ sizeof (MameSearchEntryPrivate));
+
+ /* Signals and properties go here */
+
+ /* Signal emitted when search criteria changes */
+ signals[SEARCH_TEXT_CHANGED] = g_signal_new ("search-changed",
+ G_OBJECT_CLASS_TYPE (gobject_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (MameSearchEntryClass, search),
+ NULL, NULL, /* Accumulator and accumulator data */
+ gmameui_marshaller_VOID__STRING,
+ G_TYPE_NONE, /* Return type */
+ 1, G_TYPE_STRING);
+
+}
+
+static void
+mame_search_entry_init (MameSearchEntry *entry)
+{
+ MameSearchEntryPrivate *priv;
+
+
+ priv = G_TYPE_INSTANCE_GET_PRIVATE (entry,
+ MAME_TYPE_SEARCH_ENTRY,
+ MameSearchEntryPrivate);
+
+ entry->priv = priv;
+
+ /* Initialise private variables */
+
+ /* Add a 'clear' icon if GTK supports it; Rhythmbox uses libsexy if the
+ version is less than 2.16 */
+ #if GTK_CHECK_VERSION(2,16,0)
+ gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ GTK_STOCK_CLEAR);
+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ _("Clear the search text"));
+ g_signal_connect_object (GTK_ENTRY (entry), "icon-press",
+ G_CALLBACK (search_entry_clear), entry, 0);
+ #endif
+
+ g_signal_connect (G_OBJECT (entry), "changed",
+ G_CALLBACK (search_entry_changed), NULL);
+}
+
+MameSearchEntry *
+mame_search_entry_new (void)
+{
+ MameSearchEntry *entry;
+
+ entry = MAME_SEARCH_ENTRY (g_object_new (MAME_TYPE_SEARCH_ENTRY, NULL));
+
+ return entry;
+
+}
+
+static void
+mame_search_entry_finalize (GObject *object)
+{
+ MameSearchEntry *entry;
+
+GMAMEUI_DEBUG ("Destroying mame search entry...");
+ entry = MAME_SEARCH_ENTRY (object);
+
+
+ g_object_unref (entry->priv);
+
+ G_OBJECT_CLASS (mame_search_entry_parent_class)->finalize (object);
+
+/* GTK_OBJECT_CLASS (mame_search_entry_parent_class)->destroy (object);*/
+
+GMAMEUI_DEBUG ("Destroying mame search entry... done");
+}
+
+
+gint search_timeout;
+
+static gboolean
+search_entry_changed_timeout (GtkWidget *widget)
+{
+ /* Emit the signal so that the gmameui-gamelist-view can handle it. */
+ gdk_threads_enter ();
+
+ g_signal_emit (G_OBJECT (widget), signals[SEARCH_TEXT_CHANGED], 0,
+ gtk_entry_get_text (GTK_EDITABLE (widget)));
+ search_timeout = 0;
+
+ gdk_threads_leave ();
+
+ return FALSE;
+}
+
+/* Callback for when the MameSearchEntry field is changed; this adds a
+ timeout to fire every 300ms to reduce the frequency of the refresh */
+static void
+search_entry_changed (MameSearchEntry *entry, gpointer user_data)
+{
+ GtkTreeModelFilter *filter;
+
+ if (search_timeout != 0) {
+ g_source_remove (search_timeout);
+ search_timeout = 0;
+ }
+
+ /* emit it now if we're clearing the entry */
+ if (gtk_entry_get_text (GTK_ENTRY (entry)))
+ search_timeout = g_timeout_add (300, (GSourceFunc) search_entry_changed_timeout, entry);
+ else
+ search_entry_changed_timeout (entry);
+
+}
+
+#if GTK_CHECK_VERSION(2,16,0)
+static void
+search_entry_clear (GtkEntry *entry, GtkEntryIconPosition icon_pos,
+ GdkEvent *event, MameSearchEntry *search_entry)
+{
+ gtk_entry_set_text (GTK_ENTRY (search_entry), "");
+}
+#endif
\ No newline at end of file
diff --git a/src/gmameui-search-entry.h b/src/gmameui-search-entry.h
new file mode 100644
index 0000000..6a95262
--- /dev/null
+++ b/src/gmameui-search-entry.h
@@ -0,0 +1,58 @@
+/*
+ * GMAMEUI
+ *
+ * Copyright 2009 Andrew Burton <adb at iinet.net.au>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __GMAMEUI_SEARCH_ENTRY_H__
+#define __GMAMEUI_SEARCH_ENTRY_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+/* Preferences dialog object */
+#define MAME_TYPE_SEARCH_ENTRY (mame_search_entry_get_type ())
+#define MAME_SEARCH_ENTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAME_TYPE_SEARCH_ENTRY, MameSearchEntry))
+#define MAME_SEARCH_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MAME_TYPE_SEARCH_ENTRY, MameSearchEntryClass))
+#define MAME_IS_SEARCH_ENTRY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAME_TYPE_SEARCH_ENTRY))
+#define MAME_IS_SEARCH_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAME_TYPE_SEARCH_ENTRY))
+#define MAME_SEARCH_ENTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MAME_TYPE_SEARCH_ENTRY, MameSearchEntryClass))
+
+typedef struct _MameSearchEntry MameSearchEntry;
+typedef struct _MameSearchEntryClass MameSearchEntryClass;
+typedef struct _MameSearchEntryPrivate MameSearchEntryPrivate;
+
+struct _MameSearchEntry {
+ GtkEntry parent;
+
+ MameSearchEntryPrivate *priv;
+};
+
+struct _MameSearchEntryClass {
+ GtkEntryClass parent_class;
+
+ void (*search) (MameSearchEntry *entry, const char *text);
+};
+
+GType mame_search_entry_get_type (void);
+MameSearchEntry *mame_search_entry_new (void);
+
+G_END_DECLS
+
+#endif /* __GMAMEUI_SEARCH_ENTRY_H__ */
diff --git a/src/gmameui-sidebar.c b/src/gmameui-sidebar.c
index 8dc0fc5..b65c8da 100644
--- a/src/gmameui-sidebar.c
+++ b/src/gmameui-sidebar.c
@@ -32,6 +32,7 @@
static void gmameui_sidebar_class_init (GMAMEUISidebarClass *class);
static void gmameui_sidebar_init (GMAMEUISidebar *dlg);
+static gboolean gmameui_sidebar_set_history (GMAMEUISidebar *sidebar, MameRomEntry *rom);
G_DEFINE_TYPE (GMAMEUISidebar, gmameui_sidebar, GTK_TYPE_FRAME)
@@ -183,19 +184,16 @@ set_history (const gchar *entry_name,
}
static gboolean
-set_game_history (const RomEntry *rom,
- GtkTextBuffer *text_buffer)
+set_game_history (MameRomEntry *rom, GtkTextBuffer *text_buffer)
{
const gchar *entry_name;
- if (!rom || !rom->romname)
- return FALSE;
-
+ g_return_val_if_fail (rom != NULL, FALSE);
- if (rom->cloneof && (rom->cloneof[0] != '-'))
- entry_name = rom->cloneof;
+ if (mame_rom_entry_is_clone (rom))
+ entry_name = mame_rom_entry_get_parent_romname (rom);
else
- entry_name = rom->romname;
+ entry_name = mame_rom_entry_get_romname (rom);
return set_history (entry_name, text_buffer);
}
@@ -286,19 +284,18 @@ set_info (const gchar *entry_name,
}
static gboolean
-set_game_info (const RomEntry *rom,
+set_game_info (const MameRomEntry *rom,
GtkTextBuffer *text_buffer)
{
const gchar *entry_name;
- if (!rom || !rom->romname)
- return FALSE;
-
- if (rom->cloneof && (rom->cloneof[0] != '-'))
- entry_name = rom->cloneof;
+ g_return_val_if_fail (rom != NULL, FALSE);
+
+ if (mame_rom_entry_is_clone (rom))
+ entry_name = mame_rom_entry_get_parent_romname (rom);
else
- entry_name = rom->romname;
+ entry_name = mame_rom_entry_get_romname (rom);
return set_info (entry_name, text_buffer);
}
@@ -378,7 +375,7 @@ get_pixbuf_from_zip_file (ZIP *zip, gchar *romname, gchar *parent_romname)
/* Returns a GtkWidget representing a GtkImage */
static GtkWidget *
-get_pixbuf (RomEntry *rom,
+get_pixbuf (MameRomEntry *tmprom,
screenshot_type sctype,
int wwidth,
int wheight)
@@ -394,8 +391,7 @@ get_pixbuf (RomEntry *rom,
GMAMEUI_DEBUG ("width:%i height:%i", wwidth, wheight);
- if (!rom)
- return NULL;
+ g_return_val_if_fail (tmprom != NULL, NULL);
/* Prevent a strange bug where wwidth=wheight=1 */
if (wwidth < 20)
@@ -432,8 +428,10 @@ get_pixbuf (RomEntry *rom,
directory_prefs[dir_num].name, &directory_name,
NULL);
- filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.png", directory_name, rom->romname);
- filename_parent = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.png", directory_name, rom->cloneof);
+ filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.png",
+ directory_name, mame_rom_entry_get_romname (tmprom));
+ filename_parent = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.png",
+ directory_name, mame_rom_entry_get_parent_romname (tmprom));
GMAMEUI_DEBUG ("Looking for image %s", filename);
pixbuf = gdk_pixbuf_new_from_file (filename, error);
@@ -441,7 +439,7 @@ get_pixbuf (RomEntry *rom,
g_free (filename);
/* no picture found try parent game if any*/
- if ( (!pixbuf) && strcmp (rom->cloneof,"-")) {
+ if ( (!pixbuf) && mame_rom_entry_is_clone (tmprom)) {
GMAMEUI_DEBUG ("Looking for image from parent set %s", filename_parent);
pixbuf = gdk_pixbuf_new_from_file (filename_parent,error);
}
@@ -457,14 +455,16 @@ get_pixbuf (RomEntry *rom,
/* Since MAME 0.111, snapshots are now in a subdirectory per game
with numeric names 0000.png, 0001.png, etc. */
- filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "0000.png", snapshot_dir, rom->romname);
+ filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "0000.png",
+ snapshot_dir, mame_rom_entry_get_romname (tmprom));
GMAMEUI_DEBUG ("Looking for image %s", filename);
pixbuf = gdk_pixbuf_new_from_file (filename,error);
g_free (filename);
/* If not found, look in parent folder */
- if ((!pixbuf) && strcmp (rom->cloneof,"-")) {
- filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "0000.png", snapshot_dir, rom->cloneof);
+ if ((!pixbuf) && mame_rom_entry_is_clone (tmprom)) {
+ filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "0000.png",
+ snapshot_dir, mame_rom_entry_get_parent_romname (tmprom));
GMAMEUI_DEBUG ("Looking for parent image %s", filename);
pixbuf = gdk_pixbuf_new_from_file (filename,error);
g_free (filename);
@@ -483,7 +483,9 @@ get_pixbuf (RomEntry *rom,
if (zip) {
GMAMEUI_DEBUG ("Looking for image in zip file %s", zipfile);
- pixbuf = get_pixbuf_from_zip_file (zip, rom->romname, rom->cloneof);
+ pixbuf = get_pixbuf_from_zip_file (zip,
+ mame_rom_entry_get_romname (tmprom),
+ mame_rom_entry_get_parent_romname (tmprom));
closezip (zip);
} else
GMAMEUI_DEBUG (_("Error - cannot open zip file %s"), zipfile);
@@ -552,7 +554,7 @@ on_screenshot_notebook_switch_page (GtkNotebook *notebook,
NULL);
gmameui_sidebar_set_with_rom (GMAMEUI_SIDEBAR (main_gui.screenshot_hist_frame),
- gui_prefs.current_game);
+ gui_prefs.current_game);
}
static void
@@ -755,7 +757,7 @@ gmameui_sidebar_new (void)
}
void
-gmameui_sidebar_set_with_rom (GMAMEUISidebar *sidebar, RomEntry *rom)
+gmameui_sidebar_set_with_rom (GMAMEUISidebar *sidebar, MameRomEntry *rom)
{
g_return_if_fail (sidebar != NULL);
@@ -810,8 +812,8 @@ gmameui_sidebar_set_with_rom (GMAMEUISidebar *sidebar, RomEntry *rom)
GMAMEUI_DEBUG ("Setting page - done");
}
-gboolean
-gmameui_sidebar_set_history (GMAMEUISidebar *sidebar, RomEntry *rom)
+static gboolean
+gmameui_sidebar_set_history (GMAMEUISidebar *sidebar, MameRomEntry *rom)
{
GtkTextIter text_iter;
diff --git a/src/gmameui-sidebar.h b/src/gmameui-sidebar.h
index 7365519..dbd89c1 100644
--- a/src/gmameui-sidebar.h
+++ b/src/gmameui-sidebar.h
@@ -60,13 +60,7 @@ GType gmameui_sidebar_get_type (void);
GtkWidget *gmameui_sidebar_new (void);
-/*DELETEstatic void
-gmameui_sidebar_set_page (GMAMEUISidebar *sidebar, RomEntry *rom, screenshot_type page);*/
-/*DELETE
-*/
-
-gboolean gmameui_sidebar_set_history (GMAMEUISidebar *sidebar, RomEntry *rom);
-void gmameui_sidebar_set_with_rom (GMAMEUISidebar *sidebar, RomEntry *rom);
+void gmameui_sidebar_set_with_rom (GMAMEUISidebar *sidebar, MameRomEntry *rom);
void gmameui_sidebar_set_current_page (GMAMEUISidebar *sidebar, int page);
GdkPixbuf *
diff --git a/src/gmameui-ui.xml b/src/gmameui-ui.xml
index 0e637b2..e5f1be2 100644
--- a/src/gmameui-ui.xml
+++ b/src/gmameui-ui.xml
@@ -27,12 +27,16 @@
<menuitem name="ViewSidebarPanelMenu" action="ViewSidebarPanel"/>
<separator/>
<menuitem name="ViewListViewMenu" action="ViewListView"/>
+<!--
<menuitem name="ViewTreeViewMenu" action="ViewTreeView"/>
+-->
<menuitem name="ViewDetailsListViewMenu" action="ViewDetailsListView"/>
+<!--
<menuitem name="ViewDetailsTreeViewMenu" action="ViewDetailsTreeView"/>
<separator/>
<menuitem name="ViewExpandAllMenu" action="ViewExpandAll"/>
<menuitem name="ViewCollapseAllMenu" action="ViewCollapseAll"/>
+-->
<separator/>
<menuitem name="ViewRefreshMenu" action="ViewRefresh"/>
</menu>
@@ -62,9 +66,13 @@
<toolitem action="ViewSidebarPanel"/>
<separator/>
<toolitem action="ViewListView"/>
+<!--
<toolitem action="ViewTreeView"/>
+-->
<toolitem action="ViewDetailsListView"/>
+<!--
<toolitem action="ViewDetailsTreeView"/>
+-->
</toolbar>
<popup name="GameListPopup" action="GameListPopupAction">
diff --git a/src/gmameui.c b/src/gmameui.c
index 9285f07..c69682d 100644
--- a/src/gmameui.c
+++ b/src/gmameui.c
@@ -200,19 +200,18 @@ g_message (_("Time to initialise: %.02f seconds"), g_timer_elapsed (mytimer, NUL
/* Create a new audit object */
gui_prefs.audit = gmameui_audit_new ();
- /* Initialise the current game */
- gui_prefs.current_game = NULL;
-
+ /* Initialise the gamelist */
gui_prefs.gl = mame_gamelist_new ();
if (!mame_gamelist_load (gui_prefs.gl)) {
g_message (_("gamelist not found, need to rebuild one"));
} else {
-
+
#ifdef ENABLE_DEBUG
g_message (_("Time to load gamelist: %.02f seconds"), g_timer_elapsed (mytimer, NULL));
#endif
if (!load_games_ini ())
g_message (_("games.ini not loaded, using default values"));
+
#ifdef ENABLE_DEBUG
g_message (_("Time to load games ini: %.02f seconds"), g_timer_elapsed (mytimer, NULL));
#endif
@@ -250,9 +249,9 @@ g_message (_("Time to load games ini: %.02f seconds"), g_timer_elapsed (mytimer,
}
gboolean
-game_filtered (RomEntry * rom, gint rom_filter_opt)
+game_filtered (MameRomEntry * rom, gint rom_filter_opt)
{
- gchar **manufacturer;
+ /* gchar **manufacturer; */
gboolean is;
Columns_type type;
@@ -260,7 +259,14 @@ game_filtered (RomEntry * rom, gint rom_filter_opt)
gint int_value;
gboolean retval;
+ /* ROM information */
+ gboolean is_bios;
+ gboolean is_favourite;
+ gboolean is_clone;
+ gboolean is_vector;
+
g_return_val_if_fail (selected_filter != NULL, FALSE);
+ g_return_val_if_fail (rom != NULL, FALSE);
retval = FALSE;
@@ -271,84 +277,116 @@ game_filtered (RomEntry * rom, gint rom_filter_opt)
"int_value", &int_value,
NULL);
+ is_bios = mame_rom_entry_is_bios (rom);
+
/* Only display a BIOS rom if the BIOS filter is explicitly stated */
- if (rom->is_bios) {
+ if (is_bios) {
if (type == IS_BIOS) {
- retval = ( (is && rom->is_bios) ||
- (!is && !rom->is_bios));
+ retval = ( (is && is_bios) ||
+ (!is && !is_bios));
} else
retval = FALSE;
} else {
switch (type) {
+
+ gchar *driver, *ver_added, *category;
+ DriverStatus driver_status;
+ DriverStatus driver_status_colour;
+ DriverStatus driver_status_sound;
+ DriverStatus driver_status_graphics;
+ gint timesplayed, num_channels;
+ RomStatus rom_status;
+ ControlType control;
+
case DRIVER:
- retval = ( (is && !g_strcasecmp (rom->driver,value)) ||
- (!is && g_strcasecmp (rom->driver,value)));
+ g_object_get (rom, "driver", &driver, NULL);
+ retval = ((is && !g_strcasecmp (driver,value)) ||
+ (!is && g_strcasecmp (driver,value)));
+ g_free (driver);
break;
case CLONE:
- retval = ( (is && !g_strcasecmp (rom->cloneof,value)) ||
- (!is && g_strcasecmp (rom->cloneof,value)));
+ is_clone = mame_rom_entry_is_clone (rom);
+ retval = ((is && !is_clone) || (!is && is_clone));
break;
case CONTROL:
- retval = ( (is && (rom->control == (ControlType)int_value)) ||
- (!is && ! (rom->control == (ControlType)int_value)));
+ g_object_get (rom, "control-type", &control, NULL);
+ retval = ((is && (control == (ControlType) int_value)) ||
+ (!is && !(control == (ControlType) int_value)));
break;
- case MAMEVER:
- if (rom->mame_ver_added)
- retval = (g_ascii_strcasecmp (rom->mame_ver_added, value) == 0);
+ case MAMEVER:
+ g_object_get (rom, "version-added", &ver_added, NULL);
+ if (ver_added)
+ retval = (g_ascii_strcasecmp (ver_added, value) == 0);
+ g_free (ver_added);
break;
case CATEGORY:
- if (rom->category)
- retval = (g_ascii_strcasecmp (rom->category, value) == 0);
+ g_object_get (rom, "category", &category, NULL);
+ if (category)
+ retval = (g_ascii_strcasecmp (category, value) == 0);
+ g_free (category);
break;
case FAVORITE:
- retval = ( (is && rom->favourite) ||
- (!is && !rom->favourite));
+ is_favourite = mame_rom_entry_is_favourite (rom);
+ retval = ( (is && is_favourite) ||
+ (!is && !is_favourite));
break;
case VECTOR:
- retval = ( (is && rom->vector) ||
- (!is && !rom->vector));
+ is_vector = mame_rom_entry_is_vector (rom);
+ retval = ( (is && is_vector) ||
+ (!is && !is_vector));
break;
- case STATUS:
- retval = ( (is && rom->status == (DriverStatus)int_value) ||
- (!is && !rom->status == (DriverStatus)int_value));
+ case DRIVER_STATUS:
+ /* This is a summary of imperfect colour, sound, graphic
+ and emulation */
+ g_object_get (rom, "driver-status", &driver_status, NULL);
+ retval = ( (is && driver_status == (DriverStatus)int_value) ||
+ (!is && !driver_status == (DriverStatus)int_value));
break;
case COLOR_STATUS:
- retval = ( (is && (rom->driver_status_color == (DriverStatus)int_value)) ||
- (!is && ! (rom->driver_status_color == (DriverStatus)int_value)));
+ g_object_get (rom, "driver-status-colour", &driver_status_colour, NULL);
+ retval = ( (is && (driver_status_colour == (DriverStatus)int_value)) ||
+ (!is && ! (driver_status_colour == (DriverStatus)int_value)));
break;
case SOUND_STATUS:
- retval = ( (is && (rom->driver_status_sound == (DriverStatus)int_value)) ||
- (!is && ! (rom->driver_status_sound == (DriverStatus)int_value)));
+ g_object_get (rom, "driver-status-sound", &driver_status_sound, NULL);
+ retval = ( (is && (driver_status_sound == (DriverStatus)int_value)) ||
+ (!is && ! (driver_status_sound == (DriverStatus)int_value)));
break;
case GRAPHIC_STATUS:
- retval = ( (is && (rom->driver_status_graphic == (DriverStatus)int_value)) ||
- (!is && ! (rom->driver_status_graphic == (DriverStatus)int_value)));
+ g_object_get (rom, "driver-status-graphics", &driver_status_graphics, NULL);
+ retval = ( (is && (driver_status_graphics == (DriverStatus)int_value)) ||
+ (!is && ! (driver_status_graphics == (DriverStatus)int_value)));
break;
case HAS_ROMS:
- retval = ( (is && (rom->has_roms == (RomStatus)int_value)) ||
- (!is && ! (rom->has_roms == (RomStatus)int_value)));
+ rom_status = mame_rom_entry_get_rom_status (rom);
+ retval = ((is && (rom_status == (RomStatus) int_value)) ||
+ (!is && !(rom_status == (RomStatus) int_value)));
break;
case HAS_SAMPLES:
- retval = ( (is && (rom->nb_samples == int_value)) ||
- (!is && ! (rom->nb_samples == int_value)));
+ retval = ( (is && (mame_rom_entry_has_samples (rom) == int_value)) ||
+ (!is && ! (mame_rom_entry_has_samples (rom) == int_value)));
break;
case TIMESPLAYED:
- retval = ( (is && (rom->timesplayed == int_value)) ||
- (!is && ! (rom->timesplayed == int_value)));
+ g_object_get (rom, "times-played", ×played, NULL);
+ retval = ( (is && (timesplayed == int_value)) ||
+ (!is && ! (timesplayed == int_value)));
break;
case CHANNELS:
- retval = ( (is && (rom->channels == int_value)) ||
- (!is && (rom->channels != int_value)));
+ g_object_get (rom, "num-channels", &num_channels, NULL);
+ retval = ( (is && (num_channels == int_value)) ||
+ (!is && (num_channels != int_value)));
break;
- /* Comparing text and int */
+ /* We are not currently supporting the YEAR and MANUFACTURER filters
+ since it makes the LHS filter list too long
+
case YEAR:
retval = ( (is && (rom->year == value)) ||
(!is && (rom->year != value)));
break;
- /* comparing parsed text and text */
+ * comparing parsed text and text *
case MANU:
manufacturer = rom_entry_get_manufacturers (rom);
- /* we have now one or two clean manufacturer (s) we still need to differentiates sub companies*/
+ * we have now one or two clean manufacturer (s) we still need to differentiates sub companies*
if (manufacturer[1] != NULL) {
if ( (is && !g_strncasecmp (manufacturer[0], value, 5)) ||
(!is && g_strncasecmp (manufacturer[0], value, 5)) ||
@@ -368,7 +406,7 @@ game_filtered (RomEntry * rom, gint rom_filter_opt)
}
}
g_strfreev (manufacturer);
- break;
+ break;*/
default:
GMAMEUI_DEBUG ("Trying to filter, but filter type %d is not handled", type);
retval = FALSE;
@@ -381,12 +419,14 @@ game_filtered (RomEntry * rom, gint rom_filter_opt)
if (retval) {
if (rom_filter_opt == 1) {
/* Only show Available */
- retval = (rom->has_roms != NOT_AVAIL) ? TRUE : FALSE;
+ retval = (mame_rom_entry_get_rom_status (rom) != NOT_AVAIL) ? TRUE : FALSE;
} else if (rom_filter_opt == 2) {
/* Only show Unavailable */
- retval = (rom->has_roms == NOT_AVAIL) ? TRUE : FALSE;
- }
+ retval = (mame_rom_entry_get_rom_status (rom) == NOT_AVAIL) ? TRUE : FALSE;
+ } else {
/* No need to process for All ROMs */
+
+ }
}
return retval;
@@ -395,7 +435,7 @@ game_filtered (RomEntry * rom, gint rom_filter_opt)
/* launch following the commandline prepared by play_game, playback_game and record_game
then test if the game is launched, detect error and update game status */
void
-launch_emulation (RomEntry *rom,
+launch_emulation (MameRomEntry *rom,
const gchar *options)
{
FILE *xmame_pipe;
@@ -403,6 +443,7 @@ launch_emulation (RomEntry *rom,
gchar *p, *p2;
gfloat done = 0;
gint nb_loaded = 0;
+ gint num_roms;
GList *extra_output = NULL;
gboolean error_rom, error_mame; /* Error with the load */
@@ -416,10 +457,12 @@ launch_emulation (RomEntry *rom,
joydata = NULL;
#endif
+ g_object_get (rom, "num-roms", &num_roms, NULL);
+
/* FIXME Progress of loading ROMs is not reported in newer versions of MAME
(e.g. SDLMame), so there is no way of updating a progress window */
progress_window = progress_window_new (TRUE);
- progress_window_set_title (progress_window, _("Loading %s:"), rom_entry_get_list_name (rom));
+ progress_window_set_title (progress_window, _("Loading %s:"), mame_rom_entry_get_list_name (rom));
progress_window_show (progress_window);
gtk_widget_hide (MainWindow);
@@ -427,7 +470,7 @@ launch_emulation (RomEntry *rom,
/* need to use printf otherwise, with GMAMEUI_DEBUG, we dont see the complete command line */
GMAMEUI_DEBUG ("Message: running command %s\n", options);
xmame_pipe = popen (options, "r");
- GMAMEUI_DEBUG (_("Loading %s:"), rom->gamename);
+ GMAMEUI_DEBUG (_("Loading %s:"), mame_rom_entry_get_gamename (rom));
/* Loading */
@@ -456,7 +499,7 @@ launch_emulation (RomEntry *rom,
svgalib: Failed to initialize mouse
*/
- error_rom = error_mame = FALSE;
+ error_rom = error_mame = warning_rom = FALSE;
while (fgets (line, BUFFER_SIZE, xmame_pipe)) {
/* remove the last \n */
for (p = line; (*p && (*p != '\n')); p++);
@@ -474,8 +517,8 @@ launch_emulation (RomEntry *rom,
p = p + 2;
for (p2 = p; (*p2 && (*p2 != '\n')); p2++);
p2 = '\0';
-
- done = (gfloat) (nb_loaded / rom->nb_roms);
+
+ done = (gfloat) (nb_loaded / num_roms);
progress_window_set_value (progress_window, done);
progress_window_set_text (progress_window, p);
@@ -562,30 +605,19 @@ launch_emulation (RomEntry *rom,
g_free (title);
g_free (secmessage);
-
- /* Update game information if there was a ROM problem */
- if (error_rom) rom->has_roms = INCORRECT;
- } else {
- /* Game was successfully loaded */
- GMAMEUI_DEBUG ("game over");
-
- /* Update game informations */
- /* FIXME TODO Set g_object rom info, which triggers signal to update game in list.
- This will then replace update_game_in_list call below */
- rom->timesplayed++;
-
- /* Update game information if there was a ROM warning, otherwise set to correct */
- warning_rom ? rom->has_roms = BEST_AVAIL : CORRECT;
}
+ /* Update game information */
+ mame_rom_entry_rom_played (rom, warning_rom, error_rom);
+
g_list_foreach (extra_output, (GFunc)g_free, NULL);
g_list_free (extra_output);
gtk_widget_show (MainWindow);
/* Update the ROM with the times played or status if there was any error */
- update_game_in_list (rom);
+ mame_gamelist_view_update_game_in_list (main_gui.displayed_list, rom);
#ifdef ENABLE_JOYSTICK
gchar *joystick_device;
@@ -625,7 +657,7 @@ gchar *legacy_categories[] = {
};
static gchar*
-generate_command_line_options_string (MameExec *exec, RomEntry *rom)
+generate_command_line_options_string (MameExec *exec, MameRomEntry *rom)
{
gchar *cl_opts;
gchar *tmp_str;
@@ -646,7 +678,7 @@ generate_command_line_options_string (MameExec *exec, RomEntry *rom)
}
/* Add Vector-specific string */
- if (rom->vector)
+ if (mame_rom_entry_is_vector (rom))
tmp_str = g_strconcat (tmp_str,
mame_options_get_option_string (main_gui.options,
"Vector"),
@@ -663,7 +695,7 @@ generate_command_line_options_string (MameExec *exec, RomEntry *rom)
}
/* Add Vector-specific string */
- if (rom->vector)
+ if (mame_rom_entry_is_vector (rom))
tmp_str = g_strconcat (tmp_str,
mame_options_legacy_get_option_string (main_gui.legacy_options,
"Vector"),
@@ -686,7 +718,7 @@ generate_command_line_options_string (MameExec *exec, RomEntry *rom)
/* Prepare the commandline to use to play a game */
void
-play_game (RomEntry *rom)
+play_game (MameRomEntry *rom)
{
MameExec *exec;
gchar *current_rom_name;
@@ -706,7 +738,9 @@ play_game (RomEntry *rom)
if (use_xmame_options) {
GMAMEUI_DEBUG ("Using MAME options, ignoring GMAMEUI-specified options");
- opt = g_strdup_printf ("%s %s 2>&1", mame_exec_get_path (exec), rom->romname);
+ opt = g_strdup_printf ("%s %s 2>&1",
+ mame_exec_get_path (exec),
+ mame_rom_entry_get_romname (rom));
launch_emulation (rom, opt);
g_free (opt);
return;
@@ -714,18 +748,22 @@ play_game (RomEntry *rom)
opts_string = generate_command_line_options_string (exec, rom);
- opt = g_strdup_printf ("%s %s 2>&1", opts_string, rom->romname);
+ opt = g_strdup_printf ("%s %s 2>&1",
+ opts_string,
+ mame_rom_entry_get_romname (rom));
launch_emulation (rom, opt);
g_free (opts_string);
g_free (opt);
}
-void process_inp_function (RomEntry *rom, gchar *file, int action)
+void process_inp_function (MameRomEntry *rom, gchar *file, int action)
{
MameExec *exec;
char *filename;
gchar *opt, *opts_string;
+
+ g_return_if_fail (rom != NULL);
exec = mame_exec_list_get_current_executable (main_gui.exec_list);
@@ -791,6 +829,7 @@ exit_gmameui (void)
joystick_close (joydata);
joydata = NULL;
+ /* Clear the gamelist (which clears all the romset GObjects) */
g_object_unref (gui_prefs.gl);
gui_prefs.gl = NULL;
@@ -800,6 +839,10 @@ exit_gmameui (void)
g_object_unref (main_gui.exec_list);
main_gui.exec_list = NULL;
xmame_options_free ();
+
+ /* Clear the gamelist view */
+ g_object_unref (main_gui.displayed_list);
+ main_gui.displayed_list = NULL;
g_object_unref (main_gui.options);
main_gui.options = NULL;
diff --git a/src/gmameui.h b/src/gmameui.h
index 86b7dc7..527fc43 100644
--- a/src/gmameui.h
+++ b/src/gmameui.h
@@ -56,12 +56,13 @@ typedef enum {
/* Those are also columns. The only difference is that they are hidden */
typedef enum {
ROMENTRY = NUMBER_COLUMN,
- TEXTCOLOR,
+TEXTSTYLE,
+FILTERED,
PIXBUF,
HAS_ROMS,
ROMOF,
STATUS,
- DRIVERSTATUS, /* Good | Imperfect | Preliminary */
+ DRIVER_STATUS, /* Good | Imperfect | Preliminary */
COLOR_STATUS, /* Good | Imperfect | Preliminary */
SOUND_STATUS, /* Good | Imperfect | Preliminary */
GRAPHIC_STATUS, /* Good | Imperfect | Preliminary */
@@ -112,6 +113,7 @@ typedef enum {
FILTER_ARCH_SEGAM2,
FILTER_ARCH_BIOS,
/* TODO IMPERFECT, * i.e. imperfect color/sound/graphics */
+ FILTER_IMPERFECT_DRIVER,
FILTER_IMPERFECT_COLORS,
FILTER_IMPERFECT_SOUND,
FILTER_IMPERFECT_GRAPHIC,
@@ -145,14 +147,18 @@ typedef enum {
typedef enum {
LIST,
+#ifdef TREESTORE
LIST_TREE,
+#endif
DETAILS,
+#ifdef TREESTORE
DETAILS_TREE
+#endif
} ListMode;
/* FIXME TODO Try and get rid of this struct */
struct gui_prefs_struct {
- RomEntry *current_game;
+ MameRomEntry *current_game;
MameGamelist *gl;
GmameuiAudit *audit;
};
@@ -167,20 +173,15 @@ GdkPixbuf *Status_Icons[NUMBER_STATUS];
gboolean dirty_icon_cache;
/* Others Functions */
-gboolean
-game_filtered (RomEntry * rom, gint rom_filter_opt);
+gboolean game_filtered (MameRomEntry * rom, gint rom_filter_opt);
-void
-process_inp_function (RomEntry *rom, gchar *file, int action);
+void process_inp_function (MameRomEntry *rom, gchar *file, int action);
-void
-launch_emulation (RomEntry *rom, const gchar *command_line);
+void launch_emulation (MameRomEntry *rom, const gchar *command_line);
-void
-play_game (RomEntry *rom);
+void play_game (MameRomEntry *rom);
-void
-exit_gmameui (void);
+void exit_gmameui (void);
#if 0
GList*
diff --git a/src/gtkjoy.c b/src/gtkjoy.c
index 0f040c2..4bc22a0 100644
--- a/src/gtkjoy.c
+++ b/src/gtkjoy.c
@@ -228,10 +228,13 @@ move_up (int val)
GtkTreePath *tree_path;
GtkTreeIter iter1;
GtkTreeIter iter2;
+ GtkTreeModel *model;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (main_gui.displayed_list));
gtk_tree_view_get_cursor (GTK_TREE_VIEW (main_gui.displayed_list), &path, NULL);
- if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (main_gui.tree_model), &iter1, path))
+ if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter1, path))
return;
for (i = 0; i < val; i++) {
@@ -239,25 +242,25 @@ move_up (int val)
if (!gtk_tree_path_up (path)) {
break;
} else {
- if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (main_gui.tree_model), &iter1, path))
+ if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter1, path))
break;
}
} else {
if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (main_gui.displayed_list), path)) {
gtk_tree_path_down (path);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (main_gui.tree_model), &iter2, path);
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter2, path);
iter1 = iter2;
- while (gtk_tree_model_iter_next (GTK_TREE_MODEL (main_gui.tree_model), &iter2)) {
+ while (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter2)) {
iter1 = iter2;
}
} else {
- if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (main_gui.tree_model), &iter1, path))
+ if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter1, path))
break;
}
}
}
- tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (main_gui.tree_model), &iter1);
+ tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter1);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (main_gui.displayed_list), tree_path, NULL, FALSE);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list), tree_path, NULL, TRUE, 0.5, 0);
gtk_tree_path_free (tree_path);
@@ -274,20 +277,23 @@ move_down (int val)
GtkTreePath *tree_path;
GtkTreeIter iter1;
GtkTreeIter iter2;
-
+ GtkTreeModel *model;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (main_gui.displayed_list));
+
gtk_tree_view_get_cursor (GTK_TREE_VIEW (main_gui.displayed_list), &path, NULL);
- if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (main_gui.tree_model), &iter1, path))
+ if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter1, path))
return;
for (i = 0; i < val; i++) {
if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (main_gui.displayed_list), path)) {
- gtk_tree_model_iter_children (GTK_TREE_MODEL (main_gui.tree_model), &iter2, &iter1);
+ gtk_tree_model_iter_children (GTK_TREE_MODEL (model), &iter2, &iter1);
iter1 = iter2;
} else {
iter2 = iter1;
- if (!gtk_tree_model_iter_next (GTK_TREE_MODEL (main_gui.tree_model), &iter1)) {
- if (gtk_tree_model_iter_parent (GTK_TREE_MODEL (main_gui.tree_model), &iter1, &iter2)) {
- if (!gtk_tree_model_iter_next (GTK_TREE_MODEL (main_gui.tree_model), &iter1)) {
+ if (!gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter1)) {
+ if (gtk_tree_model_iter_parent (GTK_TREE_MODEL (model), &iter1, &iter2)) {
+ if (!gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter1)) {
iter1 = iter2;
break;
}
@@ -297,10 +303,10 @@ move_down (int val)
}
}
}
- path=gtk_tree_model_get_path (GTK_TREE_MODEL (main_gui.tree_model), &iter1);
+ path=gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter1);
}
- tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (main_gui.tree_model), &iter1);
+ tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter1);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (main_gui.displayed_list), tree_path, NULL, FALSE);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (main_gui.displayed_list), tree_path, NULL, TRUE, 0.5, 0);
gtk_tree_path_free (tree_path);
@@ -312,15 +318,17 @@ static void toggle_expand (void)
{
GtkTreePath *path;
GtkTreeIter iter1;
-
+ GtkTreeModel *model;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (main_gui.displayed_list));
gtk_tree_view_get_cursor (GTK_TREE_VIEW (main_gui.displayed_list), &path, NULL);
- if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (main_gui.tree_model), &iter1, path))
+ if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter1, path))
return;
if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (main_gui.displayed_list), path)) {
gtk_tree_view_collapse_row (GTK_TREE_VIEW (main_gui.displayed_list), path);
} else {
- if (gtk_tree_model_iter_has_child (GTK_TREE_MODEL (main_gui.tree_model), &iter1))
+ if (gtk_tree_model_iter_has_child (GTK_TREE_MODEL (model), &iter1))
gtk_tree_view_expand_row (GTK_TREE_VIEW (main_gui.displayed_list), path, TRUE);
}
diff --git a/src/gui.c b/src/gui.c
index 5073dbb..a92af90 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -33,128 +33,25 @@
#include "gmameui.h"
#include "gui.h"
#include "io.h"
-
-const int ROM_ICON_SIZE = 16;
+#include "gmameui-gamelist-view.h"
+#include "gmameui-sidebar.h"
static guint timeout_icon;
-static void
-set_game_pixbuff_from_iter (GtkTreeIter *iter,
- ZIP *zip,
- gint page_size)
-{
- RomEntry *tmprom;
- GdkRectangle rect;
- GtkTreePath *tree_path;
- ListMode current_mode;
-
- gtk_tree_model_get (GTK_TREE_MODEL (main_gui.tree_model), iter, ROMENTRY, &tmprom, -1);
- tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (main_gui.tree_model), iter);
- gtk_tree_view_get_cell_area (GTK_TREE_VIEW (main_gui.displayed_list),
- tree_path,
- NULL, &rect);
- gtk_tree_path_free (tree_path);
-
- if (tmprom->has_roms == CORRECT
- && tmprom->status
- && (rect.y + rect.height) > 0
- && (rect.y < page_size)
- && !tmprom->icon_pixbuf) {
- g_object_get (main_gui.gui_prefs, "current-mode", ¤t_mode, NULL);
-
- tmprom->icon_pixbuf = get_icon_for_rom (tmprom, ROM_ICON_SIZE, zip);
-
- if (tmprom->icon_pixbuf) {
- if ((current_mode == LIST_TREE) || (current_mode == DETAILS_TREE))
- gtk_tree_store_set (GTK_TREE_STORE (main_gui.tree_model), iter,
- PIXBUF, tmprom->icon_pixbuf,
- -1);
- else
- gtk_list_store_set (GTK_LIST_STORE (main_gui.tree_model), iter,
- PIXBUF, tmprom->icon_pixbuf,
- -1);
- }
- }
-}
-
-/* This function is to set the game icon from the zip file for each visible game */
-static gboolean
-adjustment_scrolled_delayed (void)
-{
- GtkTreeIter iter;
- GtkTreeIter iter_child;
- GtkTreePath *tree_path;
- guint i;
- ZIP *zip;
- gchar *zipfile;
- gboolean valid;
- GtkAdjustment *vadj;
- gchar *icon_dir;
-
- g_object_get (main_gui.gui_prefs,
- "dir-icons", &icon_dir,
- NULL);
-
- /* open the zip file only at the begining */
- zipfile = g_build_filename (icon_dir, "icons.zip", NULL);
- zip = openzip (zipfile);
-
- /* Getting the vertical window area */
- vadj=gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (main_gui.scrolled_window_games));
-
- /* Disable the callback */
- g_signal_handlers_block_by_func (G_OBJECT (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (main_gui.scrolled_window_games))),
- (gpointer)adjustment_scrolled, NULL);
-/* FIXME TODO Use gtk_tree_model_foreach similar to callback for selecting random row */
- if (visible_games > 0) {
- valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (main_gui.tree_model), &iter);
- set_game_pixbuff_from_iter (&iter,zip, (gint) (vadj->page_size));
- i = 0;
- while ((i < visible_games) && valid) {
- tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (main_gui.tree_model), &iter);
- /* Set the icon for all children if the parent row is expanded */
- if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (main_gui.displayed_list), tree_path)) {
- if (gtk_tree_model_iter_children (GTK_TREE_MODEL (main_gui.tree_model), &iter_child, &iter)) {
- set_game_pixbuff_from_iter (&iter_child,zip, (gint) (vadj->page_size));
- while ((i < visible_games) && (gtk_tree_model_iter_next (GTK_TREE_MODEL (main_gui.tree_model), &iter_child)) ) {
- set_game_pixbuff_from_iter (&iter_child, zip, (gint) (vadj->page_size));
- i++;
- }
- }
- }
-
- gtk_tree_path_free (tree_path);
- if (i < visible_games) {
- valid=gtk_tree_model_iter_next (GTK_TREE_MODEL (main_gui.tree_model), &iter);
- if (valid) {
- set_game_pixbuff_from_iter (&iter,zip, (gint) (vadj->page_size));
- i++;
- }
- }
- }
- }
-
- /* Re-Enable the callback */
- g_signal_handlers_unblock_by_func (G_OBJECT (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (main_gui.scrolled_window_games))),
- (gpointer) adjustment_scrolled, NULL);
-
- if (zip)
- closezip (zip);
- g_free (zipfile);
- g_free (icon_dir);
-
- return FALSE;
-}
-
void
adjustment_scrolled (GtkAdjustment *adjustment,
gpointer user_data)
{
+ MameGamelistView *gamelist_view = (gpointer) user_data;
+
if (timeout_icon)
g_source_remove (timeout_icon);
+
+ else
timeout_icon =
g_timeout_add (ICON_TIMEOUT,
- (GSourceFunc) adjustment_scrolled_delayed, NULL);
+ (GSourceFunc) adjustment_scrolled_delayed, gamelist_view);
+ timeout_icon = 0;
}
void
@@ -196,14 +93,15 @@ g_message (_("Time to create main window, filters and gamelist: %.02f seconds"),
gtk_paned_set_position (main_gui.hpanedRight, xpos_gamelist);*/
/* Grab focus on the game list */
- gtk_widget_grab_focus (main_gui.displayed_list);
+ gtk_widget_grab_focus (GTK_WIDGET (main_gui.displayed_list));
g_signal_connect (G_OBJECT (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (main_gui.scrolled_window_games))), "changed",
G_CALLBACK (adjustment_scrolled),
- NULL);
+ main_gui.displayed_list);
+ /* Invoked whenever the gamelist is scrolled up or down */
g_signal_connect (G_OBJECT (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (main_gui.scrolled_window_games))), "value-changed",
G_CALLBACK (adjustment_scrolled),
- NULL);
+ main_gui.displayed_list);
/* Need to set the notebook page here otherwise it segfault */
g_object_get (main_gui.gui_prefs, "show-flyer", &show_flyer, NULL);
@@ -443,7 +341,7 @@ void gmameui_ui_set_items_sensitive () {
/* Set the Add/Remove Favourites depending whether the game is a favourite */
if (gui_prefs.current_game != NULL)
- gmameui_ui_set_favourites_sensitive (gui_prefs.current_game->favourite);
+ gmameui_ui_set_favourites_sensitive (mame_rom_entry_is_favourite (gui_prefs.current_game));
}
void
@@ -468,24 +366,27 @@ gamelist_popupmenu_show (GdkEventButton *event)
specified). Search first for the .ico file for the ROM, then for the parent
ROM, then for the icon zipfile */
GdkPixbuf *
-get_icon_for_rom (RomEntry *rom,
- guint size,
- ZIP *zip)
+get_icon_for_rom (MameRomEntry *rom, guint size, ZIP *zip)
{
GdkPixbuf *pixbuf, *scaled_pixbuf = NULL;
gchar *icon_filename;
gchar *icon_path;
gchar *icon_dir;
GError **error = NULL;
+
+ const gchar *romname;
+ const gchar *parent_romname;
+
+ g_return_val_if_fail (rom != NULL, NULL);
+
+ romname = mame_rom_entry_get_romname (rom);
+ parent_romname = mame_rom_entry_get_parent_romname (rom);
- if (!rom)
- return NULL;
-
- GMAMEUI_DEBUG ("Attempting to get icon for ROM %s", rom->romname);
+ GMAMEUI_DEBUG ("Attempting to get icon for ROM %s", romname);
g_object_get (main_gui.gui_prefs, "dir-icons", &icon_dir, NULL);
- icon_filename = g_strdup_printf ("%s.ico", rom->romname);
+ icon_filename = g_strdup_printf ("%s.ico", romname);
icon_path = g_build_filename (icon_dir, icon_filename, NULL);
pixbuf = gdk_pixbuf_new_from_file (icon_path, error);
@@ -493,9 +394,9 @@ get_icon_for_rom (RomEntry *rom,
g_free (icon_path);
/* If icon not found, try looking for parent's icon */
- if ((pixbuf == NULL) && strcmp (rom->cloneof, "-")) {
- GMAMEUI_DEBUG ("Attempting to get icon for ROM %s from parent %s", rom->romname, rom->cloneof);
- icon_filename = g_strdup_printf ("%s.ico", rom->cloneof);
+ if ((pixbuf == NULL) && mame_rom_entry_is_clone (rom)) {
+ GMAMEUI_DEBUG ("Attempting to get icon for ROM %s from parent %s", romname, parent_romname);
+ icon_filename = g_strdup_printf ("%s.ico", parent_romname);
icon_path = g_build_filename (icon_dir, icon_filename, NULL);
pixbuf = gdk_pixbuf_new_from_file (icon_path, error);
@@ -506,18 +407,18 @@ get_icon_for_rom (RomEntry *rom,
/* If icon not found, look in a zipfile */
if (pixbuf == NULL) {
if (zip != 0) {
- GMAMEUI_DEBUG ("Attempting to get icon for ROM %s from icon zipfile", rom->romname);
+ GMAMEUI_DEBUG ("Attempting to get icon for ROM %s from icon zipfile", romname);
rewindzip (zip);
- pixbuf = get_pixbuf_from_zip_file (zip, rom->romname, rom->cloneof);
+ pixbuf = get_pixbuf_from_zip_file (zip, romname, parent_romname);
}
}
if (pixbuf != NULL) {
- GMAMEUI_DEBUG ("Found icon for ROM %s, scaling to size %ix%i", rom->romname, size, size);
+ GMAMEUI_DEBUG ("Found icon for ROM %s, scaling to size %ix%i", romname, size, size);
scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, size, size, GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
} else
- GMAMEUI_DEBUG ("Could not find icon for %s", rom->romname);
+ GMAMEUI_DEBUG ("Could not find icon for %s", romname);
g_free (icon_dir);
@@ -841,14 +742,14 @@ get_status_icons (void)
}
void
-select_game (RomEntry *rom)
+select_game (MameRomEntry *rom)
{
gui_prefs.current_game = rom;
if (rom != NULL) {
/* update statusbar */
- set_status_bar (rom_entry_get_list_name (rom),
- _(rom_status_string_value [rom->has_roms]));
+ set_status_bar (mame_rom_entry_get_list_name (rom),
+ _(rom_status_string_value [mame_rom_entry_get_rom_status (rom)]));
/* update screenshot panel */
gmameui_sidebar_set_with_rom (GMAMEUI_SIDEBAR (main_gui.screenshot_hist_frame),
@@ -870,90 +771,13 @@ select_game (RomEntry *rom)
}
void
-update_game_in_list (RomEntry *tmprom)
-{
- const gchar *my_hassamples;
- GdkColor my_txtcolor;
- GdkPixbuf *pixbuf;
- gboolean is_tree_store;
- ListMode current_mode;
- gchar *clone_color;
-
- if (!tmprom)
- return;
-
- g_object_get (main_gui.gui_prefs,
- "current-mode", ¤t_mode,
- "clone-color", &clone_color,
- NULL);
-
- /* Whether the Tree Model will a tree or a list */
- is_tree_store = (current_mode == LIST_TREE) || (current_mode == DETAILS_TREE);
-
- rom_entry_get_list_name (tmprom);
-
- /* Has Samples */
- if (tmprom->nb_samples == 0)
- my_hassamples = "";
- else {
- my_hassamples = (tmprom->has_samples == CORRECT) ? _("Yes") : _("No");
- }
-
- /* Clone colour */
- if ((!strcmp (tmprom->cloneof, "-")) || (!clone_color)) {
- clone_color = g_strdup ("black");
- }
- gdk_color_parse (clone_color, &my_txtcolor);
-
-
- /* Set the pixbuf for the status icon */
- pixbuf = Status_Icons [tmprom->has_roms];
-
- if (is_tree_store) {
- gtk_tree_store_set (GTK_TREE_STORE (main_gui.tree_model), &tmprom->position,
- GAMENAME, tmprom->name_in_list,
- HAS_SAMPLES, my_hassamples,
- ROMNAME, tmprom->romname,
- TIMESPLAYED, tmprom->timesplayed,
- MANU, tmprom->manu,
- YEAR, tmprom->year,
- CLONE, tmprom->cloneof,
- DRIVER, tmprom->driver,
- MAMEVER, tmprom->mame_ver_added,
- CATEGORY, tmprom->category,
- TEXTCOLOR, &my_txtcolor, /* text color */
- PIXBUF, pixbuf, /* pixbuf */
- -1);
- } else {
- gtk_list_store_set (GTK_LIST_STORE (main_gui.tree_model), &tmprom->position,
- GAMENAME, tmprom->name_in_list,
- HAS_SAMPLES, my_hassamples,
- ROMNAME, tmprom->romname,
- TIMESPLAYED, tmprom->timesplayed,
- MANU, tmprom->manu,
- YEAR, tmprom->year,
- CLONE, tmprom->cloneof,
- DRIVER, tmprom->driver,
- MAMEVER, tmprom->mame_ver_added,
- CATEGORY, tmprom->category,
- TEXTCOLOR, &my_txtcolor, /* text color */
- PIXBUF, pixbuf, /* pixbuf */
- -1);
- }
-
- g_free (clone_color);
-
-}
-
-void
select_inp (gboolean play_record)
{
GtkWidget *inp_selection;
gchar *inp_dir;
gchar *current_rom_name;
-
- RomEntry *rom;
-
+ MameRomEntry *rom;
+
g_return_if_fail (mame_exec_list_has_current_executable (main_gui.exec_list));
joy_focus_off ();
@@ -1016,5 +840,3 @@ select_inp (gboolean play_record)
g_free (inp_dir);
g_free (current_rom_name);
}
-
-
diff --git a/src/gui.h b/src/gui.h
index 149826f..076f17d 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -47,6 +47,7 @@
#include "gmameui-sidebar.h"
#include "gmameui-gamelist-view.h"
#include "mame-exec-list.h"
+#include "gmameui-gamelist-view.h"
/* The following menu entries are always enabled */
static const GtkActionEntry gmameui_always_sensitive_menu_entries[] =
@@ -121,6 +122,7 @@ static const GtkActionEntry gmameui_favourite_menu_entries[] =
N_("Remove this game from your 'Favorites' game folder"), G_CALLBACK (on_remove_from_favorites_activate) },
};
+#ifdef TREESTORE
/* The following menu entries are enabled when the view is changed to a tree view */
static const GtkActionEntry gmameui_view_expand_menu_entries[] =
{
@@ -129,7 +131,7 @@ static const GtkActionEntry gmameui_view_expand_menu_entries[] =
{ "ViewCollapseAll", NULL, N_("Collapse All"), NULL,
N_("Collapse all rows"), G_CALLBACK (on_collapse_all_activate) },
};
-
+#endif
static const GtkToggleActionEntry gmameui_view_toggle_menu_entries[] =
{
{ "ViewToolbar", NULL, N_("_Toolbar"), "<alt>T",
@@ -150,12 +152,16 @@ static const GtkRadioActionEntry gmameui_view_radio_menu_entries[] =
{
{ "ViewListView", NULL, N_("_List"), NULL,
N_("Displays items in a list"), LIST },
+#ifdef TREESTORE
{ "ViewTreeView", NULL, N_("List _Tree"), NULL,
N_("Displays items in a tree list with clones indented"), LIST_TREE },
+#endif
{ "ViewDetailsListView", NULL, N_("_Details"), NULL,
N_("Displays detailed information about each item"), DETAILS },
+#ifdef TREESTORE
{ "ViewDetailsTreeView", NULL, N_("Detai_ls Tree"), NULL,
N_("Displays detailed information about each item with clones indented"), DETAILS_TREE },
+#endif
};
static const GtkActionEntry gmameui_column_entries[] =
@@ -186,9 +192,9 @@ struct main_gui_struct {
GtkWidget *scrolled_window_filters;
GMAMEUIFiltersList *filters_list;
- GtkWidget *scrolled_window_games;
- GtkWidget *displayed_list; /* Tree View */
- GtkTreeModel *tree_model;
+ GtkWidget *scrolled_window_games;
+ MameGamelistView *displayed_list; /* The GtkTreeView displaying the ROMs */
+ GtkWidget *search_entry; /* GtkEntry used for searching tree view */
GMAMEUISidebar *screenshot_hist_frame;
@@ -199,7 +205,9 @@ struct main_gui_struct {
GtkActionGroup *gmameui_rom_exec_action_group; /* Item entries that require both a ROM and an exec */
GtkActionGroup *gmameui_exec_action_group; /* Item entries that require an exec */
GtkActionGroup *gmameui_favourite_action_group;
+#ifdef TREESTORE
GtkActionGroup *gmameui_view_action_group;
+#endif
GtkActionGroup *gmameui_exec_radio_action_group; /* Executable radio buttons */
gint gmameui_exec_merge_id;
@@ -224,11 +232,11 @@ GtkWidget * gmameui_get_image_from_stock (const char *);
void add_exec_menu(void);
void init_gui(void);
-GdkPixbuf * get_icon_for_rom (RomEntry *rom, guint size, ZIP *zip);
+GdkPixbuf * get_icon_for_rom (MameRomEntry *rom, guint size, ZIP *zip);
GdkPixbuf * gmameui_get_icon_from_stock (const char *id);
GtkWidget * gmameui_get_image_from_stock (const char *id);
void get_status_icons (void);
-void gmameui_icons_init (void);
+void gmameui_icons_init (void);
void gamelist_popupmenu_show (GdkEventButton *event);
@@ -236,8 +244,7 @@ void gmameui_ui_set_favourites_sensitive (gboolean rom_is_favourite);
void gmameui_ui_set_items_sensitive (void);
void gmameui_menu_set_view_mode_check (gint view_mode, gboolean state);
-void update_game_in_list (RomEntry *rom);
void select_inp (gboolean play_record);
-void select_game (RomEntry *rom);
+void select_game (MameRomEntry *rom);
#endif /* __GUI_H__ */
diff --git a/src/gui_prefs.c b/src/gui_prefs.c
index 21bdef5..d8d9b87 100644
--- a/src/gui_prefs.c
+++ b/src/gui_prefs.c
@@ -39,6 +39,7 @@
#include "gui_prefs.h"
#include "rom_entry.h"
#include "io.h"
+#include "gmameui-marshaller.h"
/* Preferences */
static void mame_gui_prefs_class_init (MameGuiPrefsClass *klass);
@@ -63,6 +64,15 @@ static gchar* mame_gui_prefs_get_string_property_from_key_file (MameGuiPrefs *pr
G_DEFINE_TYPE (MameGuiPrefs, mame_gui_prefs, G_TYPE_OBJECT)
+/* Signals enumeration */
+enum
+{
+ GUI_PREFS_COL_TOGGLED, /* Emitted when a column is toggled */
+ GUI_PREFS_THEPREFIX_TOGGLED, /* Emitted when "The" as a prefix is toggled */
+ LAST_GUI_PREFS_SIGNAL
+};
+static guint signals[LAST_GUI_PREFS_SIGNAL] = { 0 };
+
struct _MameGuiPrefsPrivate {
/* References to the ini file that contains our prefs */
@@ -105,7 +115,7 @@ struct _MameGuiPrefsPrivate {
/* Miscellaneous option preferences */
gboolean theprefix;
- gchar *clone_color;
+
//RomEntry *current_rom;
gchar *current_rom_name;
gchar *current_executable_name;
@@ -186,9 +196,10 @@ mame_gui_prefs_set_property (GObject *object,
break;
case PROP_THEPREFIX:
prefs->priv->theprefix = g_value_get_boolean (value);
- break;
- case PROP_CLONECOLOR:
- prefs->priv->clone_color = g_strdup (g_value_get_string (value));
+
+ /* Emit the signal (so gamelist view can be changed */
+ g_signal_emit (G_OBJECT (prefs), signals[GUI_PREFS_THEPREFIX_TOGGLED], 0,
+ prefs->priv->theprefix);
break;
case PROP_CURRENT_ROM:
//prefs->priv->current_rom = g_value_get_object (value);
@@ -229,6 +240,10 @@ mame_gui_prefs_set_property (GObject *object,
if (prefs->priv->cols_shown)
g_value_array_free (prefs->priv->cols_shown);
prefs->priv->cols_shown = va != NULL ? g_value_array_copy (va) : NULL;
+
+ /* Emit the signal (so gamelist view can be changed */
+ g_signal_emit (G_OBJECT (prefs), signals[GUI_PREFS_COL_TOGGLED], 0,
+ prefs->priv->cols_shown);
break;
case PROP_COLS_WIDTH:
va = g_value_get_boxed (value);
@@ -332,9 +347,6 @@ mame_gui_prefs_get_property (GObject *object,
case PROP_THEPREFIX:
g_value_set_boolean (value, prefs->priv->theprefix);
break;
- case PROP_CLONECOLOR:
- g_value_set_string (value, prefs->priv->clone_color);
- break;
case PROP_CURRENT_ROM:
//g_value_set_object (value, prefs->priv->current_rom);
g_value_set_string (value, prefs->priv->current_rom_name);
@@ -394,9 +406,6 @@ mame_gui_prefs_finalize (GObject *obj)
if (pr->priv->joystick_name)
g_free (pr->priv->joystick_name);
- if (pr->priv->clone_color)
- g_free (pr->priv->clone_color);
-
if (pr->priv->cols_shown)
g_value_array_free (pr->priv->cols_shown);
if (pr->priv->cols_width)
@@ -466,10 +475,10 @@ mame_gui_prefs_class_init (MameGuiPrefsClass *klass)
g_param_spec_int ("current-rom-filter", "Current ROM filter", "Current ROM filter", 0, 2, 0, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_CURRENT_MODE,
- g_param_spec_int ("current-mode", "Current Mode", "Current Mode", LIST, DETAILS_TREE, DETAILS, G_PARAM_READWRITE));
+ g_param_spec_int ("current-mode", "Current Mode", "Current Mode", LIST, DETAILS, DETAILS, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_PREVIOUS_MODE,
- g_param_spec_int ("previous-mode", "Previous Mode", "Previous Mode", LIST, DETAILS_TREE, LIST, G_PARAM_READWRITE));
+ g_param_spec_int ("previous-mode", "Previous Mode", "Previous Mode", LIST, DETAILS, LIST, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_COLS_SHOWN,
g_param_spec_value_array ("cols-shown", "Columns Shown", "Which Columns Are Shown or Hidden", NULL, G_PARAM_READWRITE));
@@ -510,9 +519,7 @@ mame_gui_prefs_class_init (MameGuiPrefsClass *klass)
g_object_class_install_property (object_class,
PROP_THEPREFIX,
g_param_spec_boolean ("theprefix", "Display 'The'", "Display 'The' as a prefix in the gamelist", TRUE, G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_CLONECOLOR,
- g_param_spec_string ("clone-color", "Clone Color", "Clone Color", "##5F5F5F", G_PARAM_READWRITE)); /* Default to grey */
+
g_object_class_install_property (object_class,
PROP_CURRENT_ROM,
g_param_spec_string ("current-rom", "Current Rom", "The currently selected ROM", NULL, G_PARAM_READWRITE));
@@ -537,6 +544,27 @@ mame_gui_prefs_class_init (MameGuiPrefsClass *klass)
directory_prefs[i].prop_id,
g_param_spec_string (directory_prefs[i].name, "", "", "", G_PARAM_READWRITE));
}
+
+ /* Signal emitted when a column is toggled */
+ signals[GUI_PREFS_COL_TOGGLED] = g_signal_new ("col-toggled",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (MameGuiPrefsClass, col_toggled),
+ NULL, NULL, /* Accumulator and accumulator data */
+ gmameui_marshaller_VOID__POINTER,
+ G_TYPE_NONE, /* Return type */
+ 1, G_TYPE_INT);
+
+ /* Signal emitted when the prefix is toggled */
+ signals[GUI_PREFS_THEPREFIX_TOGGLED] = g_signal_new ("theprefix-toggled",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (MameGuiPrefsClass, theprefix_toggled),
+ NULL, NULL, /* Accumulator and accumulator data */
+ gmameui_marshaller_VOID__BOOLEAN,
+ G_TYPE_NONE, /* Return type */
+ 1, G_TYPE_BOOLEAN);
+
}
static void
@@ -622,9 +650,7 @@ mame_gui_prefs_init (MameGuiPrefs *pr)
/* Miscellaneous preferences */
pr->priv->theprefix = mame_gui_prefs_get_bool_property_from_key_file (pr, "theprefix");
- pr->priv->clone_color = mame_gui_prefs_get_string_property_from_key_file (pr, "clone-color");
- if (!pr->priv->clone_color)
- pr->priv->clone_color = g_strdup ("grey");
+
pr->priv->current_rom_name = mame_gui_prefs_get_string_property_from_key_file (pr, "current-rom");
pr->priv->current_executable_name = mame_gui_prefs_get_string_property_from_key_file (pr, "current-executable");
@@ -712,7 +738,6 @@ mame_gui_prefs_init (MameGuiPrefs *pr)
g_signal_connect (pr, "notify::usejoyingui", (GCallback) mame_gui_prefs_save_bool, NULL);
g_signal_connect (pr, "notify::joystick-name", (GCallback) mame_gui_prefs_save_string, NULL);
g_signal_connect (pr, "notify::theprefix", (GCallback) mame_gui_prefs_save_bool, NULL);
- g_signal_connect (pr, "notify::clone-color", (GCallback) mame_gui_prefs_save_string, NULL);
g_signal_connect (pr, "notify::current-rom", (GCallback) mame_gui_prefs_save_string, NULL);
g_signal_connect (pr, "notify::current-executable", (GCallback) mame_gui_prefs_save_string, NULL);
g_signal_connect (pr, "notify::executable-paths", (GCallback) mame_gui_prefs_save_string_arr, NULL);
diff --git a/src/gui_prefs.h b/src/gui_prefs.h
index 5520735..6cf5d43 100644
--- a/src/gui_prefs.h
+++ b/src/gui_prefs.h
@@ -56,6 +56,9 @@ struct _MameGuiPrefs {
struct _MameGuiPrefsClass {
GObjectClass parent;
/* define vtable methods and signals here */
+
+ void (*col_toggled) (MameGuiPrefs *prefs, GValueArray *cols);
+ void (*theprefix_toggled) (MameGuiPrefs *prefs, gboolean theprefix);
};
/* Preferences */
@@ -87,7 +90,6 @@ enum
PROP_JOYSTICKNAME,
/* Miscellaneous preferences */
PROP_THEPREFIX,
- PROP_CLONECOLOR,
PROP_CURRENT_ROM,
PROP_CURRENT_EXECUTABLE,
/* Executable, ROM and Sample paths - handled using GValueArrays, so
diff --git a/src/gui_prefs_dialog.c b/src/gui_prefs_dialog.c
index f9fc497..aa611fa 100644
--- a/src/gui_prefs_dialog.c
+++ b/src/gui_prefs_dialog.c
@@ -59,10 +59,7 @@ struct _MameGuiPrefsDialogPrivate {
/* Column layout preferences */
/* Miscellaneous option preferences *
- GtkWidget *theprefix_checkbutton;
- GtkWidget *theprefix_label;
- GtkWidget *clone_color_button;
- GtkWidget *clone_label;*/
+ GtkWidget *theprefix_checkbutton;*/
};
/* Preferences dialog */
@@ -71,8 +68,7 @@ static void mame_gui_prefs_dialog_init (MameGuiPrefsDialog *dlg);
static void on_prefs_entry_changed (GtkWidget *entry, gchar *widget_name);
static void on_prefs_checkbutton_toggled (GtkWidget *toggle, gchar *widget_name);
static void on_prefs_col_checkbutton_toggled (GtkWidget *toggle, gchar *widget_name);
-static void on_prefs_checkbutton_theprefix_toggled (GtkWidget *toggle, gpointer user_data);
-static void on_prefs_colour_button_toggled (GtkWidget *color, gpointer user_data);
+
static void on_mame_gui_prefs_dialog_destroyed (GtkWidget *prefs_dialog, gpointer user_data);
static gboolean on_mame_gui_prefs_dialog_deleted (GtkWidget *window,
GdkEventAny *event,
@@ -118,7 +114,6 @@ mame_gui_prefs_dialog_init (MameGuiPrefsDialog *dlg)
GtkWidget *clone_lbl;
GtkWidget *theprefix_label;
- GdkColor color;
GList *col_list; /* GList of column checkbutton widgets */
GList *node;
@@ -128,9 +123,7 @@ mame_gui_prefs_dialog_init (MameGuiPrefsDialog *dlg)
gboolean usejoyingui;
gchar *joystick_name;
gboolean theprefix;
-
- gchar *clone_color;
-
+
GValueArray *cols_shown;
GMAMEUI_DEBUG ("Initialising gui prefs dialog");
dlg->priv = g_new0 (MameGuiPrefsDialogPrivate, 1);
@@ -157,7 +150,6 @@ GMAMEUI_DEBUG ("Initialising gui prefs dialog");
"cols-shown", &cols_shown,
/* Miscellaneous options */
"theprefix", &theprefix,
- "clone-color", &clone_color,
NULL);
widget = glade_xml_get_widget (xml, "gamecheck");
@@ -215,24 +207,11 @@ GMAMEUI_DEBUG ("Initialising gui prefs dialog");
g_list_free (node);
/* Miscellaneous option widgets */
- theprefix_label = glade_xml_get_widget (xml, "theprefix_lbl");
-
widget = glade_xml_get_widget (xml, "theprefix");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), theprefix);
g_signal_connect (widget, "toggled",
- G_CALLBACK (on_prefs_checkbutton_theprefix_toggled), theprefix_label);
- /* Default value may be off, so need to manually trigger */
- on_prefs_checkbutton_theprefix_toggled (widget, theprefix_label);
+ G_CALLBACK (on_prefs_checkbutton_toggled), "theprefix");
- /* Set up colour button and example label */
- clone_lbl = glade_xml_get_widget (xml, "clone_label");
-
- widget = glade_xml_get_widget (xml, "clone_color");
- gdk_color_parse (clone_color, &color);
- g_signal_connect (widget, "color-set",
- G_CALLBACK (on_prefs_colour_button_toggled), clone_lbl);
- gtk_color_button_set_color (GTK_COLOR_BUTTON (widget), &color);
-
gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_CLOSE);
g_object_unref (xml);
@@ -324,69 +303,6 @@ on_prefs_col_checkbutton_toggled (GtkWidget *toggle,
GMAMEUI_DEBUG("Setting integer array... done");
}
-/* This callback is slightly different - we pass the GtkWidget representing
- the example label, and update it */
-static void
-on_prefs_checkbutton_theprefix_toggled (GtkWidget *toggle,
- gpointer user_data)
-{
- GtkWidget *example_lbl;
- gboolean active;
- gchar *text;
-
- example_lbl = (GtkWidget *) user_data;
-
- GMAMEUI_DEBUG ("theprefix toggled");
- active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
-
- /* Trigger the set, which causes a save in the mame_gui_prefs_set_property () function */
- g_object_set (main_gui.gui_prefs,
- "theprefix", active,
- NULL);
-
- /* Update the label to show the impact */
- if (active)
- text = g_strdup ("The King of Fighters 2001 (Set 1)");
- else
- text = g_strdup ("King of Fighters 2001, The (Set 1)");
-
- gtk_label_set_text (GTK_LABEL (example_lbl), text);
-
- g_free (text);
-}
-
-static void
-on_prefs_colour_button_toggled (GtkWidget *color,
- gpointer user_data)
-{
-
- GtkWidget *clone_lbl;
- gchar *color_string;
- GdkColor *newcolour = NULL;
-
- newcolour = g_malloc (sizeof (GdkColor));
-
- gtk_color_button_get_color (GTK_COLOR_BUTTON (color), newcolour);
- color_string = gdk_color_to_string (newcolour);
- GMAMEUI_DEBUG ("clone-color changed colour to %s", color_string);
-
- /* Trigger the set, which causes a save in the mame_gui_prefs_set_property () function */
- g_object_set (main_gui.gui_prefs,
- "clone-color", color_string,
- NULL);
-
- /* Set the colour of the example label */
- clone_lbl = (GtkWidget *) user_data;
- gtk_widget_modify_fg (clone_lbl, GTK_STATE_NORMAL, newcolour);
-
- if (color_string)
- g_free (color_string);
-/* if (newcolour)
- gdk_color_free (newcolour);*/
-
-}
-
-
static void
on_mame_gui_prefs_dialog_destroyed (GtkWidget *prefs_dialog,
gpointer user_data)
@@ -418,9 +334,5 @@ GMAMEUI_DEBUG("Response from gui prefs dialog");
if (response_id == GTK_RESPONSE_CLOSE)
gtk_widget_hide (GTK_WIDGET (dlg));
- /* Recreate gamelist so that clone color etc take effect */
- g_object_get (main_gui.gui_prefs, "current-mode", &mode, NULL);
- create_gamelist (mode);
- create_gamelist_content ();
GMAMEUI_DEBUG("Response from gui prefs dialog... done");
}
diff --git a/src/interface.c b/src/interface.c
index e0ecfc8..464538b 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -34,6 +34,7 @@
#include "gui.h"
#include "filters_list.h"
#include "gmameui.h" /* For gui_prefs */
+#include "gmameui-search-entry.h"
static void
on_filter_btn_toggled (GtkWidget *widget, gpointer user_data);
@@ -91,7 +92,8 @@ on_filter_btn_toggled (GtkWidget *widget, gpointer user_data)
} else if (g_ascii_strcasecmp (widgetname, "filter_btn_unavail") == 0) {
g_object_set (main_gui.gui_prefs, "current-rom-filter", 2, NULL);
}
- create_gamelist_content (); // !! FIXME TODO Probably need to put this in an idle loop! Or at least block UI
+
+ mame_gamelist_view_repopulate_contents (main_gui.displayed_list);
}
void
@@ -144,9 +146,7 @@ on_screen_shot_activate (GtkAction *action,
visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
- g_object_set (main_gui.gui_prefs,
- "show-screenshot", visible,
- NULL);
+ g_object_set (main_gui.gui_prefs, "show-screenshot", visible, NULL);
if (visible) {
/* Show snapshot */
@@ -179,8 +179,8 @@ on_status_bar_view_menu_activate (GtkAction *action,
}
/* This function is called when the radio option defining the list mode is changed. */
-void on_view_type_changed (GtkRadioAction *action,
- gpointer user_data)
+void
+on_view_type_changed (GtkRadioAction *action, gpointer user_data)
{
guint val;
ListMode current_mode;
@@ -201,22 +201,13 @@ void on_view_type_changed (GtkRadioAction *action,
"current-mode", current_mode,
"previous-mode", previous_mode,
NULL);
-
+#ifdef TREESTORE
gtk_action_group_set_sensitive (main_gui.gmameui_view_action_group,
(current_mode == LIST_TREE) ||
(current_mode == DETAILS_TREE));
+#endif
+ mame_gamelist_view_change_views (main_gui.displayed_list);
- /* Rebuild the UI */
- create_gamelist (current_mode);
-
- /* Rebuild the List only if we change from/to tree mode */
- if ((current_mode == DETAILS_TREE) || (current_mode == LIST_TREE)) {
- if ( (previous_mode != DETAILS_TREE) && (previous_mode != LIST_TREE))
- create_gamelist_content ();
- } else {
- if ((previous_mode == DETAILS_TREE) || (previous_mode == LIST_TREE))
- create_gamelist_content ();
- }
}
}
@@ -230,18 +221,22 @@ gmameui_menu_set_view_mode_check (gint view_mode, gboolean state)
widget = gtk_ui_manager_get_widget (main_gui.manager,
"/MenuBar/ViewMenu/ViewListViewMenu");
break;
+#ifdef TREESTORE
case (LIST_TREE):
widget = gtk_ui_manager_get_widget (main_gui.manager,
"/MenuBar/ViewMenu/ViewTreeViewMenu");
break;
+#endif
case (DETAILS):
widget = gtk_ui_manager_get_widget (main_gui.manager,
"/MenuBar/ViewMenu/ViewDetailsListViewMenu");
break;
+#ifdef TREESTORE
case (DETAILS_TREE):
widget = gtk_ui_manager_get_widget (main_gui.manager,
"/MenuBar/ViewMenu/ViewDetailsTreeViewMenu");
break;
+#endif
}
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), state);
}
@@ -447,7 +442,7 @@ create_MainWindow (void)
gtk_ui_manager_insert_action_group (main_gui.manager, action_group, 0);
g_object_unref (action_group);
main_gui.gmameui_favourite_action_group = action_group;
-
+#ifdef TREESTORE
action_group = gtk_action_group_new ("GmameuiWindowViewActions");
gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
gtk_action_group_add_actions (action_group,
@@ -457,7 +452,7 @@ create_MainWindow (void)
gtk_ui_manager_insert_action_group (main_gui.manager, action_group, 0);
g_object_unref (action_group);
main_gui.gmameui_view_action_group = action_group;
-
+#endif
action_group = gtk_action_group_new ("GmameuiWindowToggleActions");
gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
gtk_action_group_add_toggle_actions (action_group,
@@ -528,22 +523,46 @@ create_MainWindow (void)
main_gui.hpanedLeft = glade_xml_get_widget (xml, "hpanedLeft");
main_gui.hpanedRight = glade_xml_get_widget (xml, "hpanedRight");
+ /* Set up the search field */
+GMAMEUI_DEBUG ("Setting up search entry field...");
+ GtkWidget *search_box;
+ search_box = glade_xml_get_widget (xml, "filter_hbox");
+ main_gui.search_entry = mame_search_entry_new ();
+ /* In order to pack before the filter buttons, their pack must be set to End */
+ gtk_box_pack_start (GTK_BOX (search_box), main_gui.search_entry, FALSE, FALSE, 6);
+ gtk_widget_show (main_gui.search_entry);
+GMAMEUI_DEBUG ("Setting up search entry field... done");
+
/* Prepare the ROM availability filter buttons */
+GMAMEUI_DEBUG ("Setting up ROM availability filter buttons...");
GList *filter_btn_list, *list;
+
+ gint current_filter_btn;
filter_btn_list = glade_xml_get_widget_prefix (xml, "filter_btn_");
+ g_object_get (main_gui.gui_prefs, "current-rom-filter", ¤t_filter_btn, NULL);
+ i = 0;
+
for (list = g_list_first (filter_btn_list);
list != NULL;
- list = g_list_next (list)) {
+ list = g_list_next (list)) {
+
/* Hide the radio circle so only the button is visible */
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (list->data), FALSE);
+
+ /* Set the button based on the preference */
+ /* AAA FIXME TODO Not working */
+ if (i == current_filter_btn)
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (list->data), TRUE);
/* Set the signal callback */
g_signal_connect (G_OBJECT (list->data), "toggled",
G_CALLBACK (on_filter_btn_toggled), NULL);
+
+ i++;
}
+GMAMEUI_DEBUG ("Setting up ROM availability filter buttons... done");
/* End ROM availability filter buttons */
-
main_gui.filters_list = gmameui_filters_list_new ();
/* FIXME TODO
@@ -598,6 +617,7 @@ create_MainWindow (void)
{ IS_BIOS, FILTER_ARCH_BIOS, _("BIOS"), TRUE, NULL, TRUE, TRUE, NULL, _("Architecture") },
/* Imperfect filters */
+ { DRIVER_STATUS, FILTER_IMPERFECT_DRIVER, _("Driver"), FALSE, NULL, DRIVER_STATUS_GOOD, TRUE, "gmameui-emblem-not-working", _("Imperfect") },
{ COLOR_STATUS, FILTER_IMPERFECT_COLORS, _("Colors"), FALSE, NULL, DRIVER_STATUS_GOOD, TRUE, "gmameui-emblem-not-working", _("Imperfect") },
{ SOUND_STATUS, FILTER_IMPERFECT_SOUND, _("Sound"), FALSE, NULL, DRIVER_STATUS_GOOD, TRUE, "gmameui-emblem-not-working", _("Imperfect") },
{ GRAPHIC_STATUS, FILTER_IMPERFECT_GRAPHIC, _("Graphics"), FALSE, NULL, DRIVER_STATUS_GOOD, TRUE, "gmameui-emblem-not-working", _("Imperfect") },
@@ -741,27 +761,17 @@ create_MainWindow (void)
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (main_gui.manager,
"/MenuBar/ViewMenu/ViewToolbarMenu")),
show_toolbar);
-
+#ifdef TREESTORE
if (! ((current_mode == LIST_TREE) || (current_mode == DETAILS_TREE))) {
gtk_action_group_set_sensitive (main_gui.gmameui_view_action_group, FALSE);
}
-
- /* Show the main window and all its children */
- //gtk_widget_show_all (GTK_WIDGET (main_window));
-
- /* New stuff starts here */
-
- /* Create the UI of the Game List */
- create_gamelist (current_mode);
-#ifdef ENABLE_DEBUG
-//g_message (_("Time to create gamelist: %.02f seconds"), g_timer_elapsed (mytimer, NULL));
-#endif
- /* Feed the Game List */
- create_gamelist_content ();
-#ifdef ENABLE_DEBUG
-//g_message (_("Time to create gamelist content: %.02f seconds"), g_timer_elapsed (mytimer, NULL));
#endif
+ /* Create the UI of the Game List */
+ main_gui.displayed_list = mame_gamelist_view_new ();
+mame_gamelist_view_scroll_to_selected_game (main_gui.displayed_list);
+ gtk_container_add (GTK_CONTAINER (main_gui.scrolled_window_games), main_gui.displayed_list);
+ gtk_widget_show_all (main_gui.scrolled_window_games);
gtk_paned_set_position (GTK_PANED (main_gui.hpanedLeft), xpos_filters);
g_signal_connect (G_OBJECT (main_gui.hpanedLeft), "notify::position",
@@ -771,9 +781,6 @@ create_MainWindow (void)
g_signal_connect (G_OBJECT (main_gui.hpanedRight), "notify::position",
G_CALLBACK (on_hpaned_position_notify), NULL);
- /* New stuff finishes here */
-
-
/* Connect signals */
g_signal_connect (G_OBJECT (main_window), "delete_event",
G_CALLBACK (on_main_window_delete_event), NULL);
diff --git a/src/interface.h b/src/interface.h
index 739bbdb..89e87b0 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -75,4 +75,7 @@ static const toolbar_item toolbar_items [] = {
{ TOOLBAR_DETAILSTREEVIEW, "/ToolBar/ViewDetailsTreeView", "gmameui-view-tree", 0, N_("Details Tree") },
};
+/* Signal prototypes */
+void (* search_filter_changed) (GtkEditable *search_field);
+
#endif /* __INTERFACE_H__ */
diff --git a/src/io.c b/src/io.c
index 4ca778f..6dbc7ec 100644
--- a/src/io.c
+++ b/src/io.c
@@ -89,21 +89,22 @@ gboolean
load_games_ini (void)
{
gchar *filename;
- RomEntry *tmprom = NULL;
+ MameRomEntry *tmprom;
GList *romlist;
GMAMEUI_DEBUG ("Loading games.ini");
-
+
filename = g_build_filename (g_get_home_dir (), ".gmameui", "games.ini", NULL);
if (!filename)
return FALSE;
romlist = mame_gamelist_get_roms_glist (gui_prefs.gl);
-
+
GKeyFile *gameini_list = g_key_file_new ();
GError *error = NULL;
gboolean result = g_key_file_load_from_file (gameini_list, filename, G_KEY_FILE_KEEP_COMMENTS, &error);
g_free (filename);
+
if (!result) {
GMAMEUI_DEBUG ("Error loading games.ini file: %s", error->message);
g_error_free (error);
@@ -118,25 +119,39 @@ load_games_ini (void)
the key values; if the first cannot be found, assume the rest cannot be either */
gchar **gamelist = g_key_file_get_groups (gameini_list, NULL);
int i;
+
for (i = 0; gamelist[i] != NULL; i++) {
tmprom = get_rom_from_gamelist_by_name (gui_prefs.gl, gamelist[i]);
+
if (tmprom) {
- tmprom->timesplayed = g_key_file_get_integer (gameini_list, gamelist[i], "PlayCount", &error);
- if (!tmprom->timesplayed) tmprom->timesplayed = 0; /* Set default */
- tmprom->has_roms = g_key_file_get_integer (gameini_list, gamelist[i], "HasRoms", &error);
- tmprom->has_samples = g_key_file_get_integer (gameini_list, gamelist[i], "HasSamples", &error);
- tmprom->favourite = g_key_file_get_integer (gameini_list, gamelist[i], "Favorite", &error);
- if (!tmprom->favourite) tmprom->favourite = 0; /* Set default */
- /* TODO AutofireDelay */
+ gint timesplayed;
+ RomStatus has_roms;
+ RomStatus has_samples;
+ gboolean is_favourite;
+
+ timesplayed = g_key_file_get_integer (gameini_list, gamelist[i], "PlayCount", &error);
+ has_roms = g_key_file_get_integer (gameini_list, gamelist[i], "HasRoms", &error);
+ has_samples = g_key_file_get_integer (gameini_list, gamelist[i], "HasSamples", &error);
+ is_favourite = g_key_file_get_integer (gameini_list, gamelist[i], "Favorite", &error);
+
+ g_object_set (tmprom,
+ "times-played", timesplayed,
+ "has-roms", has_roms,
+ "has-samples", has_samples,
+ "is-favourite", is_favourite,
+ NULL);
+
#ifdef QUICK_CHECK_ENABLED
- if (((tmprom->has_roms == UNKNOWN) ||
- (tmprom->has_roms == NOT_AVAIL) ||
- (tmprom->has_roms == INCORRECT)) && gui_prefs.GameCheck)
+ if ((mame_rom_entry_get_rom_status (tmprom) == UNKNOWN || NOT_AVAIL || INCORRECT) &&
+ (gui_prefs.GameCheck))
{
game_list.not_checked_list = g_list_append (game_list.not_checked_list, tmprom);
}
#endif
+ } else {
+ GMAMEUI_DEBUG ("Could not find ROM in list for %s", gamelist[i]);
}
+
}
g_strfreev (gamelist);
@@ -151,7 +166,7 @@ save_games_ini (void)
{
FILE *game_ini_file;
gchar *filename;
- RomEntry *rom;
+ MameRomEntry *rom;
GList *romlist, *list_pointer;
@@ -172,13 +187,28 @@ save_games_ini (void)
(list_pointer != NULL);
list_pointer=g_list_next (list_pointer))
{
- rom = (RomEntry *)list_pointer->data;
- fprintf (game_ini_file, "[%s]\n", rom->romname);
- fprintf (game_ini_file, "PlayCount=%i\n", rom->timesplayed);
- fprintf (game_ini_file, "HasRoms=%i\n", rom->has_roms);
- fprintf (game_ini_file, "HasSamples=%i\n", rom->has_samples);
- fprintf (game_ini_file, "Favorite=%s\n", rom->favourite ? "1" : "0");
+ gchar *romname;
+ gint hasroms, hassamples, timesplayed;
+ gboolean favourite;
+
+ rom = (MameRomEntry *) list_pointer->data;
+
+ g_object_get (rom,
+ "romname", &romname,
+ "has-roms", &hasroms,
+ "has-samples", &hassamples,
+ "times-played", ×played,
+ "is-favourite", &favourite,
+ NULL);
+
+ fprintf (game_ini_file, "[%s]\n", romname);
+ fprintf (game_ini_file, "PlayCount=%i\n", timesplayed);
+ fprintf (game_ini_file, "HasRoms=%i\n", hasroms);
+ fprintf (game_ini_file, "HasSamples=%i\n", hassamples);
+ fprintf (game_ini_file, "Favorite=%s\n", favourite ? "1" : "0");
fputs ("\r\n", game_ini_file);
+
+ g_free (romname);
}
fclose (game_ini_file);
@@ -188,11 +218,11 @@ save_games_ini (void)
gboolean
load_catver_ini (void)
-{
+{
gchar *filename;
GList *romlist, *listpointer;
GList *catlist, *verlist;
- RomEntry *tmprom = NULL;
+ MameRomEntry *tmprom;
gchar *category;
gchar *version;
GError *error = NULL;
@@ -224,15 +254,6 @@ load_catver_ini (void)
version = g_strdup (_("Unknown"));
verlist = g_list_append (NULL, version);
- /* Set all roms to unknown */
- for (listpointer = g_list_first (romlist); (listpointer != NULL);
- listpointer = g_list_next (listpointer))
- {
- tmprom = (RomEntry *) listpointer->data;
- tmprom->category = category;
- tmprom->mame_ver_added = version;
- }
-
g_object_get (main_gui.gui_prefs, "file-catver", &filename, NULL);
if (!filename)
@@ -252,27 +273,31 @@ load_catver_ini (void)
version from the ini file, and add to the list of known categories/versions
for use in the custom filters */
for (listpointer = g_list_first (romlist); listpointer; listpointer = g_list_next (listpointer)) {
- tmprom = (RomEntry *)listpointer->data;
- /*GMAMEUI_DEBUG ("Parsing catver - %s", tmprom->romname);*/
- category = g_key_file_get_string (catver_file, "Category", tmprom->romname, &error);
+ const gchar *romname;
+
+ tmprom = (MameRomEntry *) listpointer->data;
+ romname = mame_rom_entry_get_romname (tmprom);
+
+ category = g_key_file_get_string (catver_file, "Category", romname, &error);
if (error) {
/*GMAMEUI_DEBUG ("Error parsing catver - %s", error->message);*/
g_error_free (error);
error = NULL;
}
- version = g_key_file_get_string (catver_file, "VerAdded", tmprom->romname, &error);
+
+ version = g_key_file_get_string (catver_file, "VerAdded", romname, &error);
if (error) {
/*GMAMEUI_DEBUG ("Error parsing catver - %s", error->message);*/
g_error_free (error);
error = NULL;
}
- tmprom->category = category;
- mame_gamelist_add_category (gui_prefs.gl, category);
- tmprom->mame_ver_added = version;
+ mame_gamelist_add_category (gui_prefs.gl, category);
mame_gamelist_add_version (gui_prefs.gl, version);
+ mame_rom_entry_set_category_version (tmprom, category, version);
}
+
g_key_file_free (catver_file);
g_free (category);
g_free (version);
@@ -345,7 +370,7 @@ quick_check (void)
GList *list_pointer;
gint nb_rom_not_checked;
gfloat done;
- RomEntry *rom;
+ MameRomEntry *rom;
#ifdef QUICK_CHECK_ENABLED
GMAMEUI_DEBUG ("Running quick check.");
if (game_list.num_games == 0)
@@ -368,37 +393,40 @@ quick_check (void)
(gpointer)adjustment_scrolled, NULL);
/* need to use the last or I can find the list anymore*/
- for (list_pointer = game_list.not_checked_list;list_pointer ;list_pointer = g_list_next (list_pointer))
+ for (list_pointer = game_list.not_checked_list;
+ list_pointer;
+ list_pointer = g_list_next (list_pointer))
{
- rom = (RomEntry *)list_pointer->data;
+ rom = (MameRomEntry *)list_pointer->data;
/* Check for the existence of the ROM; if the ROM is a clone, the
parent set must exist as well */
- if (strcmp (rom->cloneof, "-"))
- if ((check_rom_exists_as_file (rom->romname)) &&
- (check_rom_exists_as_file (rom->cloneof)))
- rom->has_roms = UNKNOWN;
+ if (mame_rom_entry_is_clone (rom))
+ if ((check_rom_exists_as_file (mame_rom_entry_get_romname (rom))) &&
+ (check_rom_exists_as_file (mame_rom_entry_get_parent_romname (rom))))
+ g_object_set (rom, "has-roms", UNKNOWN, NULL);
else
- rom->has_roms = NOT_AVAIL;
- else if (check_rom_exists_as_file (rom->romname))
- rom->has_roms = UNKNOWN;
+ g_object_set (rom, "has-roms", NOT_AVAIL, NULL);
+
+ else if (check_rom_exists_as_file (mame_rom_entry_get_romname (rom)))
+ g_object_set (rom, "has-roms", UNKNOWN, NULL);
else
- rom->has_roms = NOT_AVAIL;
+ g_object_set (rom, "has-roms", NOT_AVAIL, NULL);
/* Looking for samples */
rom->has_samples = 0;
- if (rom->nb_samples > 0)
+ if (mame_rom_entry_has_samples (rom))
{
/* Check for the existence of the samples; if the samples is a clone, the
parent set must exist as well */
if (strcmp (rom->sampleof, "-")) {
- if ((check_rom_exists_as_file (rom->romname)) &&
+ if ((check_rom_exists_as_file (mame_rom_entry_get_romname (rom))) &&
(check_rom_exists_as_file (rom->sampleof)))
- rom->has_samples = CORRECT;
- } else if (check_rom_exists_as_file (rom->romname))
- rom->has_samples = CORRECT;
+ g_object_set (rom, "has-samples", CORRECT, NULL);
+ } else if (check_rom_exists_as_file (mame_rom_entry_get_romname (rom)))
+ g_object_set (rom, "has-samples", CORRECT, NULL);
}
list_pointer->data = NULL;
@@ -413,7 +441,7 @@ quick_check (void)
/* if the game is in the list, update it */
if (rom->is_in_list)
- update_game_in_list (rom);
+ mame_gamelist_view_update_game_in_list (rom);
}
g_list_free(game_list.not_checked_list);
game_list.not_checked_list = NULL;
diff --git a/src/mameio.c b/src/mameio.c
index 872a367..7b53598 100644
--- a/src/mameio.c
+++ b/src/mameio.c
@@ -51,7 +51,8 @@ typedef struct
int game_count;
int total_games;
- RomEntry *current_rom;
+ MameRomEntry *current_rom;
+
int cpu_count;
int sound_count;
} TCreateGameList;
@@ -68,25 +69,30 @@ static void CreateGameListProgress(TCreateGameList *_this)
UPDATE_GUI;
}
-static void CreateGameListGame(TCreateGameList *_this)
+/* Create a new ROM from the XML handling */
+static void
+CreateGameListGame(TCreateGameList *_this)
{
- RomEntry *rom = _this->current_rom;
+ gchar *driver;
+
+ MameRomEntry *rom = _this->current_rom;
- if (!rom)
- return;
+ g_return_if_fail (rom != NULL);
++_this->game_count;
-
- if (rom->driver && rom->driver[0])
+
+ g_object_get (rom, "driver", &driver, NULL);
+
+ if (driver)
mame_gamelist_add (gui_prefs.gl, rom);
-
+
CreateGameListProgress(_this);
- _this->current_rom = NULL;
+ // g_object_unref (_this->current_rom); /* FIXME TODO Fails in compare_game_name */
}
-static const XML_Char *XMLGetAttrPtr(const XML_Char **atts,
- const XML_Char *name)
+static const
+XML_Char *XMLGetAttrPtr(const XML_Char **atts, const XML_Char *name)
{
for(; atts[0]; atts += 2) {
if(!strcmp(atts[0], name))
@@ -96,9 +102,8 @@ static const XML_Char *XMLGetAttrPtr(const XML_Char **atts,
return 0;
}
-static const XML_Char *XMLGetAttr(const XML_Char **atts,
- const XML_Char *name,
- const XML_Char *def)
+static const
+XML_Char *XMLGetAttr(const XML_Char **atts, const XML_Char *name, const XML_Char *def)
{
const XML_Char *ret = XMLGetAttrPtr(atts, name);
@@ -108,9 +113,9 @@ static const XML_Char *XMLGetAttr(const XML_Char **atts,
return def;
}
-static int read_int_attribute(const XML_Char **atts,
- const XML_Char *name,
- int def) {
+static int
+read_int_attribute (const XML_Char **atts, const XML_Char *name, int def)
+{
const XML_Char *ret = XMLGetAttrPtr(atts, name);
if (!ret)
@@ -119,9 +124,29 @@ static int read_int_attribute(const XML_Char **atts,
return atoi(ret);
}
-static void XMLDataHandler(TCreateGameList *_this,
- const XML_Char *s,
- int len)
+static gchar *
+read_string_attribute (const XML_Char **atts, const XML_Char *name)
+{
+ const XML_Char *ret = XMLGetAttrPtr(atts, name);
+
+ return (gchar *) ret;
+}
+
+static gboolean
+read_boolean_attribute (const XML_Char **atts, const XML_Char *name, const gchar* comparison)
+{
+ const XML_Char *ret = XMLGetAttrPtr(atts, name);
+
+ if (ret == NULL)
+ return FALSE;
+
+ return !strcmp(ret, comparison);
+
+}
+
+
+static void
+XMLDataHandler (TCreateGameList *_this, const XML_Char *s, int len)
{
char *p;
@@ -146,11 +171,10 @@ static void XMLDataHandler(TCreateGameList *_this,
}
}
-static void XMLStartHandler(TCreateGameList *_this,
- const XML_Char *name,
- const XML_Char **atts)
+static void
+XMLStartHandler (TCreateGameList *_this, const XML_Char *name, const XML_Char **atts)
{
- RomEntry *rom;
+ MameRomEntry *rom;
int i;
XML_SetCharacterDataHandler(_this->xmlParser, NULL);
@@ -159,26 +183,20 @@ static void XMLStartHandler(TCreateGameList *_this,
{
char *p;
char *tmp;
-
- _this->current_rom = rom_entry_new();
+ _this->current_rom = mame_rom_entry_new ();
_this->cpu_count = 0;
_this->sound_count = 0;
rom = _this->current_rom;
+ mame_rom_entry_set_romname (rom, g_strdup (read_string_attribute (atts, "name")));
+ mame_rom_entry_set_cloneof (rom, g_strdup (read_string_attribute (atts, "cloneof")));
+ mame_rom_entry_set_romof (rom, g_strdup (read_string_attribute (atts, "romof")));
+ mame_rom_entry_set_isbios (rom, read_boolean_attribute (atts, "isbios", "yes"));
+
for (i =0; atts[i]; i += 2) {
- if(!strcmp(atts[i], "name")) {
- g_strlcpy(rom->romname, atts[i+1], MAX_ROMNAME);
-
- } else if (!strcmp(atts[i], "cloneof")) {
- rom->cloneof = g_strdup(atts[i+1]);
-
- } else if (!strcmp(atts[i], "romof")) {
- rom->romof = g_strdup(atts[i+1]);
- } else if (!strcmp(atts[i], "isbios")) {
- rom->is_bios = !strcmp(atts[i+1], "yes");
- } else if (!strcmp(atts[i], "sourcefile")) {
+ if (!strcmp(atts[i], "sourcefile")) {
tmp = g_strdup(atts[i+1]);
@@ -186,19 +204,18 @@ static void XMLStartHandler(TCreateGameList *_this,
for (p = tmp; *p && *p != '.'; p++);
*p = 0;
- rom_entry_set_driver(rom, tmp);
-
+ mame_rom_entry_set_driver (rom, tmp);
g_free(tmp);
}
}
}
- else if(_this->current_rom)
+ else if (_this->current_rom)
{
rom = _this->current_rom;
-
+
if(!strcmp(name, "rom"))
{
- rom->nb_roms++;
+ mame_rom_entry_add_rom (rom);
}
else if(!strcmp(name, "chip"))
{
@@ -206,112 +223,88 @@ static void XMLStartHandler(TCreateGameList *_this,
if(!strcmp(type, "cpu"))
{
- //_this->cpu_count++;
-
if(_this->cpu_count <= NB_CPU) {
- CPUInfo *cpu;
+ CPUInfo *cpu = (CPUInfo *) g_malloc0 (sizeof (CPUInfo));
- cpu = &rom->cpu_info[_this->cpu_count];
cpu->sound_flag = FALSE;
+ cpu->name = "-";
+ cpu->clock = 0;
- for (i =0; atts[i]; i += 2) {
- if (!strcmp(atts[i], "name")) {
- cpu->name = g_strdup (atts[i+1]);
- } else if (!strcmp(atts[i], "clock")) {
- cpu->clock = atoi(atts[i+1]);
- } else if (!strcmp(atts[i], "soundonly")) {
- cpu->sound_flag = !strcmp(atts[i+1], "yes");
- }
- }
-_this->cpu_count++;
+ cpu->name = g_strdup (read_string_attribute (atts, "name"));
+ cpu->clock = read_int_attribute (atts, "clock", 0);
+ /* sound_flag doesn't appear to be in the
+ -listxml output anymore */
+ cpu->sound_flag = read_boolean_attribute (atts, "soundonly", "yes");
+
+ mame_rom_entry_add_cpu (rom, _this->cpu_count, cpu->name, cpu->clock);
+ _this->cpu_count++;
+
+ g_free (cpu);
}
}
else if(!strcmp(type, "audio"))
{
- //_this->sound_count++;
-
if(_this->sound_count <= NB_CPU) {
- SoundCPUInfo *cpu;
+ SoundCPUInfo *cpu = (SoundCPUInfo *) g_malloc0 (sizeof (SoundCPUInfo));
- cpu = &rom->sound_info[_this->sound_count];
+ cpu->name = "-";
+ cpu->clock = 0;
+
+ cpu->name = g_strdup (read_string_attribute (atts, "name"));
+ cpu->clock = read_int_attribute (atts, "clock", 0);
- for (i =0; atts[i]; i += 2) {
- if (!strcmp(atts[i], "name")) {
- cpu->name = g_strdup (atts[i+1]);
- } else if (!strcmp(atts[i], "clock")) {
- cpu->clock = atoi(atts[i+1]);
- }
- }
+ mame_rom_entry_add_soundcpu (rom, _this->sound_count, cpu->name, cpu->clock);
+ _this->sound_count++;
+ g_free (cpu);
}
-_this->sound_count++;
}
}
else if(!strcmp(name, "input"))
{
for (i =0; atts[i]; i += 2) {
- if (!strcmp(atts[i], "players")) {
- rom->num_players = atoi(atts[i+1]);
- } else if (!strcmp(atts[i], "control")) {
- rom->control = get_control_type (atts[i+1]);
- } else if (!strcmp(atts[i], "buttons")) {
- rom->num_buttons = atoi(atts[i+1]);
+ if (!strcmp(atts[i], "control")) {
+ g_object_set (rom, "control-type", get_control_type (atts[i+1]), NULL);
}
}
+ g_object_set (rom,
+ "num-players", read_int_attribute (atts, "players", 0),
+ "num-buttons", read_int_attribute (atts, "buttons", 0),
+ NULL);
}
else if(!strcmp(name, "control"))
{
/* Control is an element of input in later versions of the
XML output */
- for (i =0; atts[i]; i += 2) {
- if (!strcmp(atts[i], "type")) {
- rom->control = get_control_type (atts[i+1]);
- }
- }
+ g_object_set (rom, "control-type", get_control_type (read_string_attribute (atts, "type")), NULL);
+
}
else if(!strcmp(name, "driver"))
{
- for (i =0; atts[i]; i += 2) {
-
- if (!strcmp(atts[i], "status")) {
- rom->status = !strcmp(atts[i+1], "good");
- } else if (!strcmp(atts[i], "emulation")) {
- rom->driver_status_emulation = get_driver_status (atts[i+1]);
- } else if (!strcmp(atts[i], "color")) {
- rom->driver_status_color = get_driver_status (atts[i+1]);
- } else if (!strcmp(atts[i], "sound")) {
- rom->driver_status_sound = get_driver_status (atts[i+1]);
- } else if (!strcmp(atts[i], "graphic")) {
- rom->driver_status_graphic = get_driver_status (atts[i+1]);
- } else if (!strcmp(atts[i], "palettesize")) {
- rom->colors = atoi(atts[i+1]);
- }
-
- }
+ g_object_set (rom,
+ "driver-status", get_driver_status (read_string_attribute (atts, "status")),
+ "driver-status-emulation", get_driver_status (read_string_attribute (atts, "emulation")),
+ "driver-status-colour", get_driver_status (read_string_attribute (atts, "color")),
+ "driver-status-sound", get_driver_status (read_string_attribute (atts, "sound")),
+ "driver-status-graphics", get_driver_status (read_string_attribute (atts, "graphic")),
+ "num-colours", read_int_attribute (atts, "palettesize", 0),
+ NULL);
}
else if(!strcmp(name, "video"))
{
- for (i =0; atts[i]; i += 2) {
-
- if (!strcmp(atts[i], "screen")) {
- rom->vector = !strcmp(atts[i+1], "vector");
-
- } else if (!strcmp(atts[i], "orientation")) {
- rom->horizontal = !strcmp(atts[i+1], "horizontal");
-
- } else if (!strcmp(atts[i], "refresh")) {
- rom->screen_freq = g_ascii_strtod(atts[i+1], NULL);
-
- } else if (!strcmp(atts[i], "width")) {
- rom->screen_y = atoi(atts[i+1]);
-
- } else if (!strcmp(atts[i], "height")) {
- rom->screen_x = atoi(atts[i+1]);
-
+ for (i =0; atts[i]; i += 2) {
+ if (!strcmp(atts[i], "refresh")) {
+ g_object_set (rom, "screen-freq", g_ascii_strtod(atts[i+1], NULL), NULL);
}
}
+ g_object_set (rom,
+ "screenx", read_int_attribute (atts, "width", 0),
+ "screeny", read_int_attribute (atts, "height", 0),
+ "is-horizontal", read_boolean_attribute (atts, "orientation", "horizontal"),
+ "is-vector", read_boolean_attribute (atts, "screen", "vector"),
+ NULL);
}
else if (!strcmp(name, "display"))
{
@@ -321,23 +314,24 @@ _this->sound_count++;
<display type="vector" rotate="180" flipx="yes" refresh="38.000000" /> */
for (i =0; atts[i]; i += 2) {
if (!strcmp(atts[i], "type")) {
- rom->vector = !strcmp(atts[i+1], "vector");
- } else if (!strcmp(atts[i], "width")) {
- rom->screen_y = atoi(atts[i+1]);
- } else if (!strcmp(atts[i], "height")) {
- rom->screen_x = atoi(atts[i+1]);
+ g_object_set (rom, "is-vector", !strcmp(atts[i+1], "vector"), NULL);
} else if (!strcmp(atts[i], "refresh")) {
- rom->screen_freq = g_ascii_strtod(atts[i+1], NULL);
+ g_object_set (rom, "screen-freq", g_ascii_strtod(atts[i+1], NULL), NULL);
}
}
+
+ g_object_set (rom,
+ "screenx", read_int_attribute (atts, "width", 0),
+ "screeny", read_int_attribute (atts, "height", 0),
+ NULL);
}
else if(!strcmp(name, "sound"))
{
- rom->channels = read_int_attribute(atts, "channels", 0);
+ g_object_set (rom, "num-channels", read_int_attribute(atts, "channels", 0), NULL);
}
else if(!strcmp(name, "sample"))
{
- rom->nb_samples++;
+ mame_rom_entry_add_sample (rom);
}
else if(
@@ -363,24 +357,25 @@ static void XMLEndHandler(TCreateGameList *_this,
CreateGameListGame(_this);
}
else if (_this->text_buf[0] && name) {
- RomEntry *rom = _this->current_rom;
-
- if (rom) {
-
- if (!strcmp(name, "year")) {
- rom_entry_set_year(rom, _this->text_buf);
- } else if (!strcmp(name, "manufacturer")) {
- rom->manu = g_strdup(_this->text_buf);
- } else if (!strcmp(name, "description")) {
- rom_entry_set_name(rom, _this->text_buf);
- }
+ MameRomEntry *rom = _this->current_rom;
+
+ g_return_if_fail (rom != NULL);
+
+ if (!strcmp(name, "year")) {
+ mame_rom_entry_set_year (rom, _this->text_buf);
+ } else if (!strcmp(name, "manufacturer")) {
+ mame_rom_entry_set_manufacturer (rom, _this->text_buf);
+ } else if (!strcmp(name, "description")) {
+ mame_rom_entry_set_name (rom, _this->text_buf);
}
+
}
}
#define XML_BUFFER_SIZE (4096)
-static gboolean CreateGameListRun(TCreateGameList *_this)
+static gboolean
+CreateGameListRun (TCreateGameList *_this)
{
int len;
int final;
@@ -477,7 +472,8 @@ static gboolean CreateGameListRun(TCreateGameList *_this)
return TRUE;
}
-static gboolean create_gamelist_xmlinfo(MameExec *exec)
+static gboolean
+create_gamelist_xmlinfo (MameExec *exec)
{
gboolean res;
TCreateGameList _this;
@@ -538,11 +534,14 @@ static gboolean create_gamelist_xmlinfo(MameExec *exec)
* Listinfo parser
*/
+#ifdef OBSOLETE_XMAME
/**
* Gets a hash table with all supported drivers
* Updates game count;
*/
-static GHashTable *get_driver_table(MameExec *exec, int *total_games) {
+static GHashTable *
+get_driver_table (MameExec *exec, int *total_games)
+{
FILE *xmame_pipe;
gchar line[BUFFER_SIZE];
GHashTable *driver_htable;
@@ -613,11 +612,12 @@ static GHashTable *get_driver_table(MameExec *exec, int *total_games) {
return driver_htable;
}
-static gboolean create_gamelist_listinfo(MameExec *exec)
+static gboolean
+create_gamelist_listinfo (MameExec *exec)
{
FILE *xmame_pipe;
gchar line[BUFFER_SIZE];
- RomEntry *rom;
+ MameRomEntry *rom;
char term_char;
gchar *p = NULL;
@@ -680,7 +680,7 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
{
/*the game begin here*/
if (!strncmp(line, "game (", 6)) {
- rom = rom_entry_new();
+ rom = mame_rom_entry_new ();
cpu_count = 0;
sound_count = 0;
@@ -735,29 +735,28 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
*(p-1) = 0;
if (!strcmp(keyword, "name")) {
- g_strlcpy(rom->romname, value, MAX_ROMNAME);
-
+ mame_rom_entry_set_romname (rom, value);
} else if (!strcmp(keyword, "description"))
{
- rom_entry_set_name(rom, value);
+ mame_rom_entry_set_name (rom, value);
}
else if (!strcmp(keyword, "year"))
- rom_entry_set_year(rom, value);
+ mame_rom_entry_set_year (rom, value);
else if (!strcmp(keyword, "manufacturer"))
{
if(strncmp(value, "???", 3))
- rom->manu = g_strdup(value);
+ mame_rom_entry_set_manufacturer (rom, value);
}
else if (!strcmp(keyword, "rom"))
- rom->nb_roms++;
+ mame_rom_entry_add_rom (rom);
else if (!strcmp(keyword, "sample"))
- rom->nb_samples++;
+ mame_rom_entry_add_sample (rom);
else if (!strcmp(keyword, "cloneof"))
- rom->cloneof = g_strdup(value);
+ mame_rom_entry_set_cloneof (rom, value);
else if (!strcmp(keyword, "romof"))
- rom->romof = g_strdup(value);
- else if (!strcmp(keyword, "sampleof"))
- rom->sampleof = g_strdup(value);
+ mame_rom_entry_set_romof (rom, value);
+ /* FIXME TODO else if (!strcmp(keyword, "sampleof"))
+ rom->sampleof = g_strdup(value);*/
else if (!strcmp(keyword, "chip")) {
gboolean is_sound;
@@ -771,7 +770,7 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
while (tmp_array[tmp_counter]) {
- if (!strcmp(tmp_array[tmp_counter], "name")) {
+ /* FIXME TODO if (!strcmp(tmp_array[tmp_counter], "name")) {
if (is_sound)
rom->sound_info[sound_count].name = g_strdup (tmp_array[tmp_counter+1]);
else
@@ -791,7 +790,7 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
if (!is_sound)
rom->cpu_info[cpu_count].sound_flag = TRUE;
- }
+ }*/
tmp_counter++;
@@ -809,16 +808,16 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
line_key = tmp_array[tmp_counter];
if (!strcmp(line_key, "screen")) {
- rom->vector = !strncmp(tmp_array[tmp_counter+1], "vector", 6);
+ g_object_set (rom, "is-vector", !strncmp(tmp_array[tmp_counter+1], "vector", 6), NULL);
tmp_counter++;
} else if (!strcmp(line_key, "orientation")) {
- rom->horizontal = !strncmp(tmp_array[tmp_counter+1], "h", 1);
+ g_object_set (rom, "is-vector", !strncmp(tmp_array[tmp_counter+1], "h", 1), NULL);
tmp_counter++;
} else if (!strcmp(line_key, "x")) {
- rom->screen_x = atoi(tmp_array[tmp_counter+1]);
+ g_object_set (rom, "screenx", atoi(tmp_array[tmp_counter+1]), NULL);
tmp_counter++;
} else if (!strcmp(line_key, "y")) {
- rom->screen_y = atoi(tmp_array[tmp_counter+1]);
+ g_object_set (rom, "screeny", atoi(tmp_array[tmp_counter+1]), NULL);
}
tmp_counter++;
@@ -835,20 +834,25 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
while ((tmp_array[tmp_counter] != NULL)) {
- if (!strcmp
- (tmp_array[tmp_counter], "players")) {
-
- rom->num_players = atoi(tmp_array[tmp_counter + 1]);
+ if (!strcmp (tmp_array[tmp_counter], "players")) {
+ g_object_set (rom,
+ "num-players",
+ atoi(tmp_array[tmp_counter + 1]),
+ NULL);
}
- else if (!strcmp
- (tmp_array[tmp_counter], "control")) {
- rom->control = get_control_type (tmp_array[tmp_counter + 1]);
- tmp_counter++;
- }else if (!strcmp
- (tmp_array[tmp_counter], "buttons")) {
+ else if (!strcmp (tmp_array[tmp_counter], "control")) {
+ g_object_set (rom,
+ "control",
+ get_control_type (tmp_array[tmp_counter + 1]),
+ NULL);
- rom->num_buttons = atoi(tmp_array[tmp_counter + 1]);
+ tmp_counter++;
+ }else if (!strcmp (tmp_array[tmp_counter], "buttons")) {
+ g_object_set (rom,
+ "num-buttons",
+ atoi(tmp_array[tmp_counter + 1]),
+ NULL);
tmp_counter++;
}
tmp_counter++;
@@ -864,11 +868,14 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
while ((tmp_array[tmp_counter] != NULL)) {
if (!strcmp(tmp_array[tmp_counter], "status")) {
- rom->status = !strcmp(tmp_array[tmp_counter+1], "good");
+ /* FIXME TODO rom->status = !strcmp(tmp_array[tmp_counter+1], "good");*/
tmp_counter++;
}
else if (!strcmp(tmp_array[tmp_counter], "palettesize")) {
- rom->colors = atoi(tmp_array[tmp_counter+1]);
+ g_object_set (rom,
+ "num-colours",
+ atoi(tmp_array[tmp_counter+1]),
+ NULL);
tmp_counter++;
}
@@ -881,18 +888,21 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
{
tmp_array = g_strsplit(value, " ",3);
if (!strcmp(tmp_array[0], "channels"))
- rom->channels = atoi(tmp_array[1]);
+ g_object_set (rom,
+ "num-channels",
+ atoi(tmp_array[1]),
+ NULL);
g_strfreev(tmp_array);
}
}
- driver = g_hash_table_lookup(driver_htable, rom->romname);
+ driver = g_hash_table_lookup(driver_htable, mame_rom_entry_get_romname (rom));
if (!driver)
- rom_entry_set_driver(rom, "Unknown");
+ mame_rom_entry_set_driver (rom, "Unknown");
else
- rom_entry_set_driver(rom, driver);
+ mame_rom_entry_set_driver (rom, driver);
mame_gamelist_add (gui_prefs.gl, rom);
@@ -912,9 +922,10 @@ static gboolean create_gamelist_listinfo(MameExec *exec)
progress_window_destroy(progress_window);
g_object_set (gui_prefs.gl, "num-games", num_games, NULL);
-
+
return TRUE;
}
+#endif
gboolean gamelist_parse(MameExec *exec)
{
@@ -928,15 +939,20 @@ gboolean gamelist_parse(MameExec *exec)
mame_get_options(exec);
- /* Check if we will use listinfo or listxml */
+ /* Check if we will use listinfo or listxml. Later versions of XMAME and
+ all versions of SDLMAME use listxml. */
if (mame_has_option(exec, "listinfo")) {
- GMAMEUI_DEBUG("Recreating gamelist using -listinfo\n");
- ret = create_gamelist_listinfo(exec);
+#ifdef OBSOLETE_XMAME
+ GMAMEUI_DEBUG ("Recreating gamelist using -listinfo\n");
+ ret = create_gamelist_listinfo (exec);
+#else
+ GMAMEUI_DEBUG ("GMAMEUI does not support the obsolete option -listinfo");
+#endif
} else if (mame_has_option(exec, "listxml")) {
GMAMEUI_DEBUG("Recreating gamelist using -listxml\n");
- ret = create_gamelist_xmlinfo(exec);
+ ret = create_gamelist_xmlinfo (exec);
} else {
- gmameui_message(ERROR, NULL, _("I don't know how to generate a gamelist for this version of xmame!"));
+ gmameui_message(ERROR, NULL, _("I don't know how to generate a gamelist for this version of MAME!"));
ret = FALSE;
}
diff --git a/src/rom_entry.c b/src/rom_entry.c
index 67d0b16..26adf8b 100644
--- a/src/rom_entry.c
+++ b/src/rom_entry.c
@@ -27,82 +27,594 @@
#include "rom_entry.h"
#include "gui.h" /* For main_gui.gui_prefs */
-RomEntry *
-rom_entry_new (void)
+static void
+mame_rom_entry_save_int (MameRomEntry *rom, GParamSpec *param, gpointer user_data);
+
+ControlType get_control_type (gchar *control_type)
{
- RomEntry *rom;
- int i;
+ ControlType type;
+
+ g_return_val_if_fail (control_type != NULL, 0);
- rom = (RomEntry*) g_malloc0 (sizeof (RomEntry));
+ /* FIXME TODO There are additional types to add */
+ if (g_ascii_strcasecmp (control_type, "trackball") == 0)
+ type = TRACKBALL;
+ else if (g_ascii_strcasecmp (control_type, "lightgun") == 0)
+ type = LIGHTGUN;
+ else
+ type = JOYSTICK;
+
+ return type;
+}
- for (i = 0; i < NB_CPU; i++) {
- rom->cpu_info[i].name = g_strdup ("-");
- rom->sound_info[i].name = g_strdup ("-");
- }
+DriverStatus get_driver_status (gchar *driver_status)
+{
+ DriverStatus status;
- /* fill the some fields with default value if we have problems */
- rom->timesplayed = 0;
- rom->has_roms = UNKNOWN;
- rom->has_samples = UNKNOWN;
- rom->favourite = FALSE;
+ g_return_val_if_fail (driver_status != NULL, 0);
- return rom;
+ /* FIXME TODO There are additional types to add */
+ if (g_ascii_strcasecmp (driver_status, "good") == 0)
+ status = DRIVER_STATUS_GOOD;
+ else if (g_ascii_strcasecmp (driver_status, "imperfect") == 0)
+ status = DRIVER_STATUS_IMPERFECT;
+ else if (g_ascii_strcasecmp (driver_status, "preliminary") == 0)
+ status = DRIVER_STATUS_PRELIMINARY;
+ else
+ status = DRIVER_STATUS_UNKNOWN;
+
+ return status;
}
-void
-rom_entry_free (RomEntry *rom)
-{
- int i;
+
+static void mame_rom_entry_class_init (MameRomEntryClass *klass);
+static void mame_rom_entry_init (MameRomEntry *pr);
+static void mame_rom_entry_finalize (GObject *obj);
+static void mame_rom_entry_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void mame_rom_entry_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+G_DEFINE_TYPE (MameRomEntry, mame_rom_entry, G_TYPE_OBJECT)
+
+struct _MameRomEntryPrivate {
+
+ gchar *romname;
+
+ gchar *name_in_list; /* Used to present full name in the listview */
+ gchar *gamename;
+ gchar *gamenameext; /* e.g. (rev 1) or (World) */
- if (!rom)
- return;
+ /** The year for the game.
+ * This is a pointer to a string in the game_list.years g_list
+ */
+ const gchar *year;
+ gchar *manu;
+ gchar *cloneof;
+ gchar *romof; /* This appears to be the same as cloneof in the XML output */
+ gchar *sampleof;
+ /** The driver for the game.
+ This is a pointer to a string in the game_list.drivers g_list
+ */
+ const gchar *driver;
+ gboolean is_bios;
+
+ /** The category for the game.
+ This is a pointer to a string in the game_list.categories g_list
+ */
+ /*const */gchar *category;
+ /*const */gchar *mame_ver_added;
+
+ gint num_players;
+ gint num_buttons;
+ ControlType control;
+ gint num_channels;
+ gboolean is_vector;
- g_free (rom->romname);
+ gboolean is_horizontal;
+ guint screen_x;
+ guint screen_y;
+ guint num_colours; /* AKA palettesize */
+ gfloat screen_freq;
- /* optimization: clonesort points to romname
- * if original. See: gamelist_add ()
+ gint num_roms;
+ gint num_samples;
+
+ CPUInfo cpu_info[NB_CPU];
+ SoundCPUInfo sound_info[NB_CPU];
+
+ /* Local information (stored in games.ini) */
+ gint timesplayed;
+ RomStatus has_roms;
+ RomStatus has_samples;
+ gboolean is_favourite;
+
+ /** Driver status
+ Recent versions of MAME have good | imperfect or | preliminary
*/
- if (rom->clonesort != rom->romname)
- g_free (rom->clonesort);
+ DriverStatus driver_status;
+ DriverStatus driver_status_emulation;
+ DriverStatus driver_status_color;
+ DriverStatus driver_status_sound;
+ DriverStatus driver_status_graphics;
+
+ /* String to sort the clones next to the original (will be original-clone) */
+ gchar *clonesort;
+
+ gboolean the_trailer;
+
+ /* Status icon or from icons.zip */
+ /* FIXME TODO Have both? */
+ GdkPixbuf *icon_pixbuf;
+
+ GtkTreeIter position;
+};
+
+static void
+mame_rom_entry_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ MameRomEntry *rom = MAME_ROM_ENTRY (object);
+
+ switch (prop_id) {
+ case PROP_ROM_ROMNAME:
+ rom->priv->romname = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_GAMENAME:
+ rom->priv->gamename = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_GAMENAMEEXT:
+ rom->priv->gamenameext = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_MANUFACTURER:
+ rom->priv->manu = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_YEAR:
+ rom->priv->year = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_CLONEOF:
+ rom->priv->cloneof = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_ROMOF:
+ rom->priv->romof = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_SAMPLEOF:
+ rom->priv->sampleof = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_DRIVER:
+ rom->priv->driver = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_DRIVER_STATUS:
+ rom->priv->driver_status = g_value_get_int (value);
+ break;
+ case PROP_ROM_DRIVER_STATUS_EMULATION:
+ rom->priv->driver_status_emulation = g_value_get_int (value);
+ break;
+ case PROP_ROM_DRIVER_STATUS_COLOUR:
+ rom->priv->driver_status_color = g_value_get_int (value);
+ break;
+ case PROP_ROM_DRIVER_STATUS_SOUND:
+ rom->priv->driver_status_sound = g_value_get_int (value);
+ break;
+ case PROP_ROM_DRIVER_STATUS_GRAPHICS:
+ rom->priv->driver_status_graphics = g_value_get_int (value);
+ break;
+
+ case PROP_ROM_NUMPLAYERS:
+ rom->priv->num_players = g_value_get_int (value);
+ break;
+ case PROP_ROM_NUMBUTTONS:
+ rom->priv->num_buttons = g_value_get_int (value);
+ break;
+ case PROP_ROM_CONTROLTYPE:
+ rom->priv->control = g_value_get_int (value);
+ break;
+ case PROP_ROM_CHANNELS:
+ rom->priv->num_channels = g_value_get_int (value);
+ break;
+ case PROP_ROM_TIMESPLAYED:
+ rom->priv->timesplayed = g_value_get_int (value);
+ break;
+ case PROP_ROM_HAS_ROMS:
+ rom->priv->has_roms = g_value_get_int (value);
+ break;
+ case PROP_ROM_HAS_SAMPLES:
+ rom->priv->has_samples = g_value_get_int (value);
+ break;
+ case PROP_ROM_IS_VECTOR:
+ rom->priv->is_vector = g_value_get_boolean (value);
+ break;
+ case PROP_ROM_IS_HORIZONTAL:
+ rom->priv->is_horizontal = g_value_get_boolean (value);
+ break;
+ case PROP_ROM_SCREEN_X:
+ rom->priv->screen_x = g_value_get_int (value);
+ break;
+ case PROP_ROM_SCREEN_Y:
+ rom->priv->screen_y = g_value_get_int (value);
+ break;
+ case PROP_ROM_NUM_COLOURS:
+ rom->priv->num_colours = g_value_get_int (value);
+ break;
+ case PROP_ROM_SCREEN_FREQ:
+ rom->priv->screen_freq = g_value_get_float (value);
+ break;
+ case PROP_ROM_IS_FAVOURITE:
+ rom->priv->is_favourite = g_value_get_boolean (value);
+ break;
+ case PROP_ROM_NUM_ROMS:
+ rom->priv->num_roms = g_value_get_int (value);
+ break;
+ case PROP_ROM_NUM_SAMPLES:
+ rom->priv->num_samples = g_value_get_int (value);
+ break;
+ case PROP_ROM_THE_TRAILER:
+ rom->priv->the_trailer = g_value_get_boolean (value);
+ break;
+
+ case PROP_ROM_CATEGORY:
+ rom->priv->category = g_strdup (g_value_get_string (value));
+ break;
+ case PROP_ROM_VER_ADDED:
+ rom->priv->mame_ver_added = g_strdup (g_value_get_string (value));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+
+}
- for (i = 0; i < NB_CPU; i++) {
- if (rom->cpu_info[i].name) g_free (rom->cpu_info[i].name);
- if (rom->sound_info[i].name) g_free (rom->sound_info[i].name);
+static void
+mame_rom_entry_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ MameRomEntry *rom = MAME_ROM_ENTRY (object);
+
+ switch (prop_id) {
+ case PROP_ROM_ROMNAME:
+ g_value_set_string (value, rom->priv->romname);
+ break;
+ case PROP_ROM_GAMENAME:
+ g_value_set_string (value, rom->priv->gamename);
+ break;
+ case PROP_ROM_GAMENAMEEXT:
+ g_value_set_string (value, rom->priv->gamenameext);
+ break;
+ case PROP_ROM_MANUFACTURER:
+ g_value_set_string (value, rom->priv->manu);
+ break;
+ case PROP_ROM_YEAR:
+ g_value_set_string (value, rom->priv->year);
+ break;
+ case PROP_ROM_CLONEOF:
+ g_value_set_string (value, rom->priv->cloneof);
+ break;
+ case PROP_ROM_ROMOF:
+ g_value_set_string (value, rom->priv->romof);
+ break;
+ case PROP_ROM_SAMPLEOF:
+ g_value_set_string (value, rom->priv->sampleof);
+ break;
+ case PROP_ROM_DRIVER:
+ g_value_set_string (value, rom->priv->driver);
+ break;
+ case PROP_ROM_DRIVER_STATUS:
+ g_value_set_int (value, rom->priv->driver_status);
+ break;
+ case PROP_ROM_DRIVER_STATUS_EMULATION:
+ g_value_set_int (value, rom->priv->driver_status_emulation);
+ break;
+ case PROP_ROM_DRIVER_STATUS_COLOUR:
+ g_value_set_int (value, rom->priv->driver_status_color);
+ break;
+ case PROP_ROM_DRIVER_STATUS_SOUND:
+ g_value_set_int (value, rom->priv->driver_status_sound);
+ break;
+ case PROP_ROM_DRIVER_STATUS_GRAPHICS:
+ g_value_set_int (value, rom->priv->driver_status_graphics);
+ break;
+
+ case PROP_ROM_NUMPLAYERS:
+ g_value_set_int (value, rom->priv->num_players);
+ break;
+ case PROP_ROM_NUMBUTTONS:
+ g_value_set_int (value, rom->priv->num_buttons);
+ break;
+ case PROP_ROM_CONTROLTYPE:
+ g_value_set_int (value, rom->priv->control);
+ break;
+ case PROP_ROM_CHANNELS:
+ g_value_set_int (value, rom->priv->num_channels);
+ break;
+
+ case PROP_ROM_TIMESPLAYED:
+ g_value_set_int (value, rom->priv->timesplayed);
+ break;
+ case PROP_ROM_HAS_ROMS:
+ g_value_set_int (value, rom->priv->has_roms);
+ break;
+ case PROP_ROM_HAS_SAMPLES:
+ g_value_set_int (value, rom->priv->has_samples);
+ break;
+ case PROP_ROM_IS_VECTOR:
+ g_value_set_boolean (value, rom->priv->is_vector);
+ break;
+ case PROP_ROM_IS_HORIZONTAL:
+ g_value_set_boolean (value, rom->priv->is_horizontal);
+ break;
+ case PROP_ROM_SCREEN_X:
+ g_value_set_int (value, rom->priv->screen_x);
+ break;
+ case PROP_ROM_SCREEN_Y:
+ g_value_set_int (value, rom->priv->screen_y);
+ break;
+ case PROP_ROM_NUM_COLOURS:
+ g_value_set_int (value, rom->priv->num_colours);
+ break;
+ case PROP_ROM_SCREEN_FREQ:
+ g_value_set_float (value, rom->priv->screen_freq);
+ break;
+ case PROP_ROM_IS_FAVOURITE:
+ g_value_set_boolean (value, rom->priv->is_favourite);
+ break;
+ case PROP_ROM_NUM_ROMS:
+ g_value_set_int (value, rom->priv->num_roms);
+ break;
+ case PROP_ROM_NUM_SAMPLES:
+ g_value_set_int (value, rom->priv->num_samples);
+ break;
+ case PROP_ROM_THE_TRAILER:
+ g_value_set_boolean (value, rom->priv->the_trailer);
+ break;
+
+ case PROP_ROM_CATEGORY:
+ g_value_set_string (value, rom->priv->category);
+ break;
+ case PROP_ROM_VER_ADDED:
+ g_value_set_string (value, rom->priv->mame_ver_added);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
}
+}
+
+static void
+mame_rom_entry_finalize (GObject *obj)
+{
+
+ MameRomEntry *rom = MAME_ROM_ENTRY (obj);
+
+ g_return_if_fail (rom != NULL);
+
+ /* Clear all ROM fields */
+ g_free (rom->priv->romname);
+ g_free (rom->priv->name_in_list);
+ g_free (rom->priv->gamename);
+ g_free (rom->priv->gamenameext);
+
+ g_free (rom->priv->manu);
+ g_free (rom->priv->cloneof);
+ g_free (rom->priv->romof);
+ g_free (rom->priv->sampleof);
+
+ g_free (rom->priv->category);
+ g_free (rom->priv->mame_ver_added);
+
+ /* FIXME TODO
+ cpu_info
+ sound_info
+ position
+ */
+
+ /* clonesort may point to previously free'd romname */
+ if (rom->priv->clonesort != rom->priv->romname)
+ g_free (rom->priv->clonesort);
+
+ if (rom->priv->icon_pixbuf)
+ g_object_unref (rom->priv->icon_pixbuf);
+
+// FIXME TODO g_free (pr->priv);
+
+}
+
+static void
+mame_rom_entry_class_init (MameRomEntryClass *klass)
+{
- if (rom->gamename) g_free (rom->gamename);
- if (rom->gamenameext) g_free (rom->gamenameext);
+/*
+ FIXME TODO
+
+ When the following properties change, update games.ini keyfile:
+
+ PlayCount
+ HasRoms
+ HasSamples
+ Favorite
+ in save_games_ini and load_games_ini
+*/
+
+ /* Use G_PARAM_CONSTRUCT to set default values when object is constructed */
+
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->set_property = mame_rom_entry_set_property;
+ object_class->get_property = mame_rom_entry_get_property;
+ object_class->finalize = mame_rom_entry_finalize;
- if (rom->manu) g_free (rom->manu);
- if (rom->cloneof) g_free (rom->cloneof);
- if (rom->romof) g_free (rom->romof);
- if (rom->sampleof) g_free (rom->sampleof);
+ g_object_class_install_property (object_class,
+ PROP_ROM_TIMESPLAYED,
+ g_param_spec_int ("times-played", "", "", 0, G_MAXINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_HAS_ROMS,
+ g_param_spec_int ("has-roms", "", "", 0, NUMBER_STATUS, UNKNOWN, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_HAS_SAMPLES,
+ g_param_spec_int ("has-samples", "", "", 0, NUMBER_STATUS, UNKNOWN, G_PARAM_READWRITE));
+
+ /* Information about the ROM */
+ g_object_class_install_property (object_class,
+ PROP_ROM_ROMNAME,
+ g_param_spec_string ("romname", "", "", "", G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_GAMENAME,
+ g_param_spec_string ("gamename", "", "", "", G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_GAMENAMEEXT,
+ g_param_spec_string ("gamenameext", "", "", "", G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_ROM_MANUFACTURER,
+ g_param_spec_string ("manufacturer", "", "", _("Unknown"), G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_ROM_YEAR,
+ g_param_spec_string ("year", "", "", _("Unknown"), G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_ROM_CLONEOF,
+ g_param_spec_string ("cloneof", "", "", "-", G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_ROM_SAMPLEOF,
+ g_param_spec_string ("sampleof", "", "", "-", G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_ROM_ROMOF,
+ g_param_spec_string ("romof", "", "", "-", G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_ROM_DRIVER,
+ g_param_spec_string ("driver", "", "", "", G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_ROM_DRIVER_STATUS,
+ g_param_spec_int ("driver-status", "", "", 0, NUM_DRIVER_STATUS, DRIVER_STATUS_UNKNOWN, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_DRIVER_STATUS_EMULATION,
+ g_param_spec_int ("driver-status-emulation", "", "", 0, NUM_DRIVER_STATUS, DRIVER_STATUS_UNKNOWN, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_DRIVER_STATUS_COLOUR,
+ g_param_spec_int ("driver-status-colour", "", "", 0, NUM_DRIVER_STATUS, DRIVER_STATUS_UNKNOWN, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_DRIVER_STATUS_SOUND,
+ g_param_spec_int ("driver-status-sound", "", "", 0, NUM_DRIVER_STATUS, DRIVER_STATUS_UNKNOWN, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_DRIVER_STATUS_GRAPHICS,
+ g_param_spec_int ("driver-status-graphics", "", "", 0, NUM_DRIVER_STATUS, DRIVER_STATUS_UNKNOWN, G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_ROM_NUMPLAYERS,
+ g_param_spec_int ("num-players", "", "", 0, 8, 1, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_NUMBUTTONS,
+ g_param_spec_int ("num-buttons", "", "", 0, 16, 1, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_CONTROLTYPE,
+ g_param_spec_int ("control-type", "", "", 0, NUM_CONTROL_TYPE, JOYSTICK, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_CHANNELS,
+ g_param_spec_int ("num-channels", "", "", 0, 4, 0, G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_ROM_IS_VECTOR,
+ g_param_spec_boolean ("is-vector", "", "", FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_IS_HORIZONTAL,
+ g_param_spec_boolean ("is-horizontal", "", "", FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_SCREEN_X,
+ g_param_spec_int ("screenx", "", "", 0, 1024, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_SCREEN_Y,
+ g_param_spec_int ("screeny", "", "", 0, 1024, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_NUM_COLOURS,
+ g_param_spec_int ("num-colours", "", "", 0, 65536, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_SCREEN_FREQ,
+ g_param_spec_float ("screen-freq", "", "", 0, 90, 0, G_PARAM_READWRITE));
- /* if (rom->clonesort) g_free (rom->clonesort); points to romname, which has been free'd */
+ g_object_class_install_property (object_class,
+ PROP_ROM_IS_FAVOURITE,
+ g_param_spec_boolean ("is-favourite", "", "", FALSE, G_PARAM_READWRITE));
- if (rom->icon_pixbuf) g_object_unref (rom->icon_pixbuf);
+ g_object_class_install_property (object_class,
+ PROP_ROM_NUM_ROMS,
+ g_param_spec_int ("num-roms", "", "", 0, 128, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_NUM_SAMPLES,
+ g_param_spec_int ("num-samples", "", "", 0, 128, 0, G_PARAM_READWRITE));
- if (rom->name_in_list) g_free (rom->name_in_list);
+ g_object_class_install_property (object_class,
+ PROP_ROM_THE_TRAILER,
+ g_param_spec_boolean ("the-trailer", "", "", FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ROM_CATEGORY,
+ g_param_spec_string ("category", "", "", _("Unknown"), G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_ROM_VER_ADDED,
+ g_param_spec_string ("version-added", "", "", _("Unknown"), G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+}
+
+static void
+mame_rom_entry_init (MameRomEntry *rom)
+{
+
+ rom->priv = g_new0 (MameRomEntryPrivate, 1);
+
+ /* Set the details for the games.ini file
+ don't keep this within each rom!!
+ pr->priv->filename = g_build_filename (g_get_home_dir (), ".gmameui", "games.ini", NULL);
+
+ pr->priv->rom_ini_file = g_key_file_new ();
+ GError *error = NULL;*/
+
+/* FIXME TODO
+ for (i = 0; i < NB_CPU; i++) {
+ rom->priv->cpu_info[i].name = g_strdup ("-");
+ rom->priv->sound_info[i].name = g_strdup ("-");
+ }*/
+
+ /* Set handlers so that whenever the values are changed (from anywhere), the signal handler
+ is invoked; the callback then saves to the g_key_file */
+ g_signal_connect (rom, "notify::has-roms", (GCallback) mame_rom_entry_save_int, NULL);
+ g_signal_connect (rom, "notify::has-samples", (GCallback) mame_rom_entry_save_int, NULL);
+ g_signal_connect (rom, "notify::is-favourite", (GCallback) mame_rom_entry_save_int, NULL);
+
+}
- rom = NULL;
+MameRomEntry* mame_rom_entry_new (void)
+{
+ return g_object_new (MAME_TYPE_ROM_ENTRY, NULL);
+}
+
+static void
+mame_rom_entry_save_int (MameRomEntry *rom, GParamSpec *param, gpointer user_data)
+{
+/* FIXME TODO Save to GKeyFile for games.ini */
}
void
-rom_entry_set_name (RomEntry *rom,
- gchar *value)
+mame_rom_entry_set_name (MameRomEntry *rom, gchar *value)
{
char *p;
- if (!rom)
- return;
+ g_return_if_fail (rom != NULL);
if (!g_strncasecmp (value, "The ",4))
{
value += 4;
- rom->the_trailer = TRUE;
- rom->name_in_list = NULL;
+ rom->priv->the_trailer = TRUE;
+ rom->priv->name_in_list = NULL;
} else {
- rom->name_in_list = g_strdup (value);
+ rom->priv->name_in_list = g_strdup (value);
}
for (p = value; *p && (*p != '/') && (*p != '(');p++);
@@ -112,86 +624,243 @@ rom_entry_set_name (RomEntry *rom,
/*Fix for F/A (Japan)*/
if (!strncmp ((p - 1), "F/A", 3))
{
- rom->gamenameext = g_strdup (p + 2);
+ rom->priv->gamenameext = g_strdup (p + 2);
*(p + 2) = '\0';
}
else {
- rom->gamenameext = g_strdup (p + 1);
+ rom->priv->gamenameext = g_strdup (p + 1);
*p = '\0';
}
} else if (*p =='(') {
- rom->gamenameext = g_strdup (p);
+ rom->priv->gamenameext = g_strdup (p);
*p = 0;
}
- if (!rom->gamenameext)
- rom->gamenameext = g_strdup ("");
+ if (!rom->priv->gamenameext)
+ rom->priv->gamenameext = g_strdup ("");
+
+ rom->priv->gamename = g_strdup (value);
+}
+
+/* FIXME The strdups below should not be replicated in the calling function */
+void
+mame_rom_entry_set_romname (MameRomEntry *rom, gchar *romname)
+{
+ rom->priv->romname = g_strdup (romname);
+}
+
+void
+mame_rom_entry_set_gamename (MameRomEntry *rom, gchar *gamename)
+{
+ rom->priv->gamename = g_strdup (gamename);
+}
+
+void
+mame_rom_entry_set_gamenameext (MameRomEntry *rom, gchar *gamenameext)
+{
+ rom->priv->gamenameext = g_strdup (gamenameext);
+}
+
+void
+mame_rom_entry_set_category_version (MameRomEntry *rom, gchar *category, gchar *version)
+{
+ /* These are pointers to the values, rather than copies, since there
+ are so many duplicated instances */
+ rom->priv->category = g_strdup (category);
+ rom->priv->mame_ver_added = g_strdup (version);
+}
+
+void mame_rom_entry_set_cloneof (MameRomEntry *rom, gchar *clone)
+{
+ if (clone)
+ rom->priv->cloneof = g_strdup (clone);
+}
- rom->gamename = g_strdup (value);
+void mame_rom_entry_set_romof (MameRomEntry *rom, gchar *romof)
+{
+ if (romof)
+ rom->priv->romof = g_strdup (romof);
+}
+
+void mame_rom_entry_set_isbios (MameRomEntry *rom, gboolean isbios)
+{
+ rom->priv->is_bios = isbios;
}
void
-rom_entry_set_driver (RomEntry *rom,
+mame_rom_entry_set_driver (MameRomEntry *rom,
const gchar *driver)
{
- rom->driver = g_strdup (driver);
+ rom->priv->driver = g_strdup (driver);
mame_gamelist_add_driver (gui_prefs.gl, driver);
}
void
-rom_entry_set_year (RomEntry *rom,
+mame_rom_entry_set_year (MameRomEntry *rom,
const gchar *year)
{
- rom->year = g_strdup (year);
+ rom->priv->year = g_strdup (year);
mame_gamelist_add_year (gui_prefs.gl, year);
}
-ControlType get_control_type (gchar *control_type)
+void
+mame_rom_entry_set_manufacturer (MameRomEntry *rom, const gchar *manufacturer)
{
- ControlType type;
-
- g_return_val_if_fail (control_type != NULL, 0);
+ rom->priv->manu = g_strdup (manufacturer);
+}
- /* FIXME TODO There are additional types to add */
- if (g_ascii_strcasecmp (control_type, "trackball") == 0)
- type = TRACKBALL;
- else if (g_ascii_strcasecmp (control_type, "lightgun") == 0)
- type = LIGHTGUN;
- else
- type = JOYSTICK;
-
- return type;
+void
+mame_rom_entry_set_position (MameRomEntry *rom, GtkTreeIter position)
+{
+ rom->priv->position = position;
}
-DriverStatus get_driver_status (gchar *driver_status)
+void
+mame_rom_entry_set_icon (MameRomEntry *rom, GdkPixbuf *icon_pixbuf)
{
- DriverStatus status;
-
- g_return_val_if_fail (driver_status != NULL, 0);
+ rom->priv->icon_pixbuf = icon_pixbuf;
+}
- /* FIXME TODO There are additional types to add */
- if (g_ascii_strcasecmp (driver_status, "good") == 0)
- status = DRIVER_STATUS_GOOD;
- else if (g_ascii_strcasecmp (driver_status, "imperfect") == 0)
- status = DRIVER_STATUS_IMPERFECT;
- else if (g_ascii_strcasecmp (driver_status, "preliminary") == 0)
- status = DRIVER_STATUS_PRELIMINARY;
+void
+mame_rom_entry_set_default_fields (MameRomEntry *rom)
+{
+ if (g_ascii_strcasecmp (rom->priv->cloneof, "-") == 0) {
+ /* original. Point to romname */
+ rom->priv->clonesort = rom->priv->romname;
+
+ } else {
+ rom->priv->clonesort = g_strdup_printf ("%s-%s",
+ rom->priv->cloneof , rom->priv->romname);
+ }
+
+}
+
+
+gchar *
+mame_rom_entry_get_clonesort (MameRomEntry *rom)
+{
+ return rom->priv->clonesort;
+}
+
+gboolean
+mame_rom_entry_has_samples (MameRomEntry *rom)
+{
+ return (rom->priv->num_samples > 0);
+}
+
+gboolean
+mame_rom_entry_is_bios (MameRomEntry *rom)
+{
+ return (rom->priv->is_bios);
+}
+
+gboolean
+mame_rom_entry_is_favourite (MameRomEntry *rom)
+{
+ return (rom->priv->is_favourite);
+}
+
+gboolean
+mame_rom_entry_is_vector (MameRomEntry *rom)
+{
+ return (rom->priv->is_vector);
+}
+
+gboolean
+mame_rom_entry_is_clone (MameRomEntry *rom)
+{
+ if (g_ascii_strcasecmp (rom->priv->cloneof, "-") == 0) //not working - default values stuffed
+ return FALSE;
else
- status = DRIVER_STATUS_UNKNOWN;
+ return TRUE;
+}
+
+RomStatus
+mame_rom_entry_get_rom_status (MameRomEntry *rom)
+{
+ g_return_val_if_fail ((rom->priv->has_roms >= 0) &&
+ (rom->priv->has_roms < NUMBER_STATUS),
+ INCORRECT);
+
+ return (rom->priv->has_roms);
+}
+
+RomStatus
+mame_rom_entry_get_sample_status (MameRomEntry *rom)
+{
+ return (rom->priv->has_samples);
+}
+
+const gchar *
+mame_rom_entry_get_list_name (MameRomEntry *rom)
+{
+ gboolean the_prefix;
- return status;
+ g_object_get (main_gui.gui_prefs, "theprefix", &the_prefix, NULL);
+
+ if (rom->priv->name_in_list != NULL)
+ return rom->priv->name_in_list;
+
+ if (!rom->priv->the_trailer) {
+ if (!rom->priv->name_in_list) {
+ rom->priv->name_in_list = g_strdup_printf ("%s %s", rom->priv->gamename, rom->priv->gamenameext);
+ }
+ } else {
+ if (the_prefix) {
+ if (!rom->priv->name_in_list || strncmp (rom->priv->name_in_list, "The", 3)) {
+ g_free (rom->priv->name_in_list);
+ rom->priv->name_in_list = g_strdup_printf ("The %s %s", rom->priv->gamename, rom->priv->gamenameext);
+ }
+ } else {
+ if (!rom->priv->name_in_list || !strncmp (rom->priv->name_in_list, "The", 3)) {
+ g_free (rom->priv->name_in_list);
+ rom->priv->name_in_list = g_strdup_printf ("%s, The %s", rom->priv->gamename, rom->priv->gamenameext);
+ }
+ }
+ }
+
+ return rom->priv->name_in_list;
+}
+
+const gchar *
+mame_rom_entry_get_romname (MameRomEntry *rom)
+{
+ return rom->priv->romname;
+}
+
+const gchar *
+mame_rom_entry_get_gamename (MameRomEntry *rom)
+{
+ return rom->priv->gamename;
+}
+
+const gchar *
+mame_rom_entry_get_parent_romname (MameRomEntry *rom)
+{
+ return rom->priv->cloneof;
+}
+
+const gchar *
+mame_rom_entry_get_year (MameRomEntry *rom)
+{
+ return rom->priv->year;
+}
+
+const gchar *
+mame_rom_entry_get_manufacturer (MameRomEntry *rom)
+{
+ return rom->priv->manu;
}
gchar **
-rom_entry_get_manufacturers (RomEntry * rom)
+mame_rom_entry_get_manufacturers (MameRomEntry *rom)
{
gchar **manufacturer_fields;
- if (!rom->manu)
- return NULL;
+ g_return_val_if_fail (rom->priv->manu != NULL, NULL);
- manufacturer_fields = g_strsplit (rom->manu, "]", 0);
+ manufacturer_fields = g_strsplit (rom->priv->manu, "]", 0);
if (!manufacturer_fields[0])
return NULL;
@@ -203,7 +872,7 @@ rom_entry_get_manufacturers (RomEntry * rom)
} else
{
g_strfreev (manufacturer_fields);
- manufacturer_fields = g_strsplit (rom->manu, "+", 0);
+ manufacturer_fields = g_strsplit (rom->priv->manu, "+", 0);
if (manufacturer_fields[1] != NULL)
{
/* we have two winners Company1+Company2*/
@@ -212,7 +881,7 @@ rom_entry_get_manufacturers (RomEntry * rom)
} else
{
g_strfreev (manufacturer_fields);
- manufacturer_fields = g_strsplit (rom->manu, "/", 0);
+ manufacturer_fields = g_strsplit (rom->priv->manu, "/", 0);
if (manufacturer_fields[1] != NULL)
{
/* we have two winners Company1/Company2*/
@@ -222,7 +891,7 @@ rom_entry_get_manufacturers (RomEntry * rom)
else
{
g_strfreev (manufacturer_fields);
- manufacturer_fields = g_strsplit (rom->manu, "(", 0);
+ manufacturer_fields = g_strsplit (rom->priv->manu, "(", 0);
if (manufacturer_fields[1] != NULL)
{
/* we have two winners Company1/Company2*/
@@ -235,37 +904,208 @@ rom_entry_get_manufacturers (RomEntry * rom)
return manufacturer_fields;
}
-/* FIXME This function should either set or return. Do we need to do both? See
- where it is called and use the most appropriate (pref. return, not set) */
-const gchar *
-rom_entry_get_list_name (RomEntry *rom)
+void
+mame_rom_entry_add_cpu (MameRomEntry *rom, int i, gchar *name, gint clock)
{
- gboolean the_prefix;
+ g_return_if_fail (i <= NB_CPU);
- g_return_val_if_fail (rom != NULL, NULL);
+ if (!strncmp (name, "(sound)", 7)) {
+ gchar *p;
+ p = name;
+ p += 7;
+ rom->priv->cpu_info[i].name = g_strdup (p);
+ rom->priv->cpu_info[i].sound_flag = TRUE;
+ } else {
+ rom->priv->cpu_info[i].name = g_strdup (name);
+ rom->priv->cpu_info[i].sound_flag = FALSE;
+ }
+
+ rom->priv->cpu_info[i].clock = clock;
+
+ /*GMAMEUI_DEBUG ("Adding rom %s with clock %d to romset %s",
+ rom->priv->cpu_info[i].name,
+ rom->priv->cpu_info[i].clock,
+ rom->priv->romname);*/
+
+}
+
+void
+mame_rom_entry_add_soundcpu (MameRomEntry *rom, int i, gchar *name, gint clock)
+{
+ g_return_if_fail (i <= NB_CPU);
+
+ if (strcmp (name, "")) {
+ rom->priv->sound_info[i].name = g_strdup (name);
+ }
+ rom->priv->sound_info[i].clock = clock;
+
+/* GMAMEUI_DEBUG ("Adding sound rom %s with clock %d to romset %s",
+ rom->priv->sound_info[i].name,
+ rom->priv->sound_info[i].clock,
+ rom->priv->romname);*/
+}
+
+void
+mame_rom_entry_add_rom (MameRomEntry *rom)
+{
+ g_return_if_fail (rom != NULL);
+ g_return_if_fail (rom->priv != NULL);
+
+ rom->priv->num_roms++;
+}
+
+void
+mame_rom_entry_add_sample (MameRomEntry *rom)
+{
+ rom->priv->num_samples++;
+}
+
+void
+mame_rom_entry_rom_played (MameRomEntry *rom, gboolean warning, gboolean error)
+{
+ g_return_if_fail (rom != NULL);
+
+ /* FIXME TODO Set g_object rom info, which triggers signal to update game in list.
+ This will then replace update_game_in_list call below */
+ rom->priv->timesplayed++;
+
+ /* Update game information if there was a ROM error or warning,
+ otherwise set to correct (if it wasn't already) */
+ if (error)
+ rom->priv->has_roms = INCORRECT;
+ else if (warning)
+ rom->priv->has_roms = BEST_AVAIL;
+ else
+ rom->priv->has_roms = CORRECT;
+}
- g_object_get (main_gui.gui_prefs,
- "theprefix", &the_prefix,
- NULL);
+gchar *
+get_rom_clone_name (MameRomEntry *rom)
+{
+ gchar *value;
- if (!rom->the_trailer) {
- if (!rom->name_in_list) {
- rom->name_in_list = g_strdup_printf ("%s %s", rom->gamename, rom->gamenameext);
+ g_return_val_if_fail (mame_rom_entry_is_clone (rom), NULL);
+
+ /* find the clone name if there is a clone */
+ MameRomEntry *tmprom;
+
+ tmprom = get_rom_from_gamelist_by_name (gui_prefs.gl, rom->priv->cloneof);
+ if (tmprom) {
+ value = g_strdup_printf ("%s - \"%s\"", mame_rom_entry_get_list_name (rom), rom->priv->cloneof);
+ } else {
+ value = g_strdup_printf (" - \"%s\"", rom->priv->cloneof);
+ }
+
+ return value;
+}
+
+CPUInfo *
+get_rom_cpu (MameRomEntry *rom, int i)
+{
+ if (!rom->priv->cpu_info[i].name) {
+ rom->priv->cpu_info[i].name = "-";
+ rom->priv->cpu_info[i].clock = 0;
+ }
+ return &rom->priv->cpu_info[i];
+}
+
+SoundCPUInfo *
+get_sound_cpu (MameRomEntry *rom, int i)
+{
+ if (!rom->priv->sound_info[i].name) {
+ rom->priv->sound_info[i].name = "-";
+ rom->priv->sound_info[i].clock = 0;
+ }
+ return &rom->priv->sound_info[i];
+}
+
+gchar *
+get_rom_cpu_value (MameRomEntry *rom)
+{
+ char *value = NULL;
+ char *values [NB_CPU + 1];
+ gint i, j;
+
+ j = 0;
+ values[j] = NULL;
+
+ for (i = 0; (i < NB_CPU) && (rom->priv->cpu_info[i].name); i++) {
+ /* There is an array of CPUInfo structs; games that have less
+ less than NB_CPU CPUs will have the names of the non-present
+ CPUs set to "-", i.e. empty */
+ if (g_ascii_strcasecmp (rom->priv->cpu_info[i].name, "-")) {
+ values[j++] = g_strdup_printf ("%s %f MHz%s",
+ rom->priv->cpu_info[i].name,
+ rom->priv->cpu_info[i].clock / 1000000.0,
+ rom->priv->cpu_info[i].sound_flag ? _(" (sound)") : " ");
}
- } else {
- if (the_prefix) {
- if (!rom->name_in_list || strncmp (rom->name_in_list, "The", 3)) {
- g_free (rom->name_in_list);
- rom->name_in_list = g_strdup_printf ("The %s %s", rom->gamename, rom->gamenameext);
- }
- } else {
- if (!rom->name_in_list || !strncmp (rom->name_in_list, "The", 3)) {
- g_free (rom->name_in_list);
- rom->name_in_list = g_strdup_printf ("%s, The %s", rom->gamename, rom->gamenameext);
- }
+ }
+ values[j++] = NULL;
+
+ value = g_strjoinv ("\n", values);
+
+ for (i = 0; i < j; i++)
+ g_free (values[i]);
+
+ return value;
+}
+
+gchar *
+get_rom_sound_value (MameRomEntry *rom)
+{
+ char *value = NULL;
+ char *values [NB_CPU + 1];
+ gint i, j;
+
+ j = 0;
+ values[j] = NULL;
+ for (i = 0; (i < NB_CPU) && (rom->priv->sound_info[i].name); i++) {
+ /* There is an array of SoundCPUInfo structs; games that have less
+ less than NB_CPU CPUs will have the names of the non-present
+ CPUs set to "-", i.e. empty */
+ if (g_ascii_strcasecmp (rom->priv->sound_info[i].name, "-")) {
+ if (rom->priv->sound_info[i].clock == 0)
+ values[j++] = g_strdup_printf ("%s", rom->priv->sound_info[i].name);
+ else
+ values[j++] = g_strdup_printf ("%s %f MHz",
+ rom->priv->sound_info[i].name,
+ rom->priv->sound_info[i].clock / 1000000.0);
}
+ }
+ values[j++] = NULL;
+
+ value = g_strjoinv ("\n", values);
- }
+ for (i = 0; i < j; i++)
+ g_free (values[i]);
- return rom->name_in_list;
+ return value;
}
+
+gchar*
+mame_rom_entry_get_resolution (MameRomEntry *rom)
+{
+ gchar *res;
+ res = g_strdup_printf ("%i \303\227 %i ", rom->priv->screen_x, rom->priv->screen_y);
+ return res;
+}
+
+gfloat
+mame_rom_entry_get_screen_freq (MameRomEntry *rom)
+{
+ return rom->priv->screen_freq;
+}
+
+GdkPixbuf *
+mame_rom_entry_get_icon (MameRomEntry *rom)
+{
+ return rom->priv->icon_pixbuf;
+}
+
+GtkTreeIter
+mame_rom_entry_get_position (MameRomEntry *rom)
+{
+ return rom->priv->position;
+}
+
+
diff --git a/src/rom_entry.h b/src/rom_entry.h
index 7e668a3..b05e19f 100644
--- a/src/rom_entry.h
+++ b/src/rom_entry.h
@@ -26,6 +26,8 @@
#include "common.h"
+G_BEGIN_DECLS
+
#define MAX_ROMNAME 20
#define MAX_CPU 20
#define MAX_CONTROL 20
@@ -38,7 +40,7 @@ changing this will break the gamelist compatibility
typedef struct {
gchar *name;
guint clock;
- gboolean sound_flag;
+ gboolean sound_flag; /* This seems to be a deprecated option */
} CPUInfo;
typedef struct {
@@ -60,7 +62,8 @@ typedef enum {
typedef enum {
JOYSTICK,
TRACKBALL,
- LIGHTGUN
+ LIGHTGUN,
+ NUM_CONTROL_TYPE
} ControlType;
typedef enum {
@@ -89,105 +92,141 @@ static gchar* rom_status_string_value[NUMBER_STATUS] = {
N_("Not a valid set")
};
-/**
-* Information for a loaded game.
-* A RomEntry is invalid when the gamelist changes because there
-* are several pointers to the list.
-*
-*/
-typedef struct {
- gchar romname[MAX_ROMNAME];
- gchar *gamename;
- gchar *gamenameext;
-
- /** The year for the game.
- * This is a pointer to a string in the game_list.years g_list
- */
- const gchar *year;
- gchar *manu;
- gchar *cloneof;
- gchar *romof; /* This appears to be the same as cloneof in the XML output */
- gchar *sampleof;
-
- gboolean is_bios;
-
- /** The driver for the game.
- This is a pointer to a string in the game_list.drivers g_list
- */
- const gchar *driver;
- CPUInfo cpu_info[NB_CPU];
- SoundCPUInfo sound_info[NB_CPU];
- ControlType control;
-
- /** The category for the game.
- This is a pointer to a string in the game_list.categories g_list
- */
- const gchar *category;
- const gchar *mame_ver_added;
- gint num_players;
- gint num_buttons;
- gint channels;
- gboolean vector;
- DriverStatus status;
-
- /** Driver status
- Recent versions of MAME have good | imperfect or | preliminary
- */
- DriverStatus driver_status_emulation;
- DriverStatus driver_status_color;
- DriverStatus driver_status_sound;
- DriverStatus driver_status_graphic;
+/* Preferences object */
+#define MAME_TYPE_ROM_ENTRY (mame_rom_entry_get_type ())
+#define MAME_ROM_ENTRY(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MAME_TYPE_ROM_ENTRY, MameRomEntry))
+#define MAME_ROM_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), MAME_TYPE_ROM_ENTRY, MameRomEntryClass))
+#define MAME_IS_ROM_ENTRY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAME_TYPE_ROM_ENTRY))
+#define MAME_IS_ROM_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAME_TYPE_ROM_ENTRY))
+#define MAME_ROM_ENTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MAME_TYPE_ROM_ENTRY, MameRomEntryClass))
+
+typedef struct _MameRomEntry MameRomEntry;
+typedef struct _MameRomEntryClass MameRomEntryClass;
+typedef struct _MameRomEntryPrivate MameRomEntryPrivate;
+
+struct _MameRomEntry {
+ GObject parent;
- gboolean horizontal;
- guint screen_x;
- guint screen_y;
- gfloat screen_freq;
- guint colors;
-
- gint nb_roms;
- gint nb_samples;
- gboolean the_trailer;
-
- /* gmameui information
- (from game.ini)
- */
- gint timesplayed;
- RomStatus has_roms;
- RomStatus has_samples;
- gboolean favourite;
-
- /* Runtime information */
-
- /** position of the game in the GTKTreeView */
- GtkTreeIter position;
- gboolean is_in_list;
- /** string in order to sort the clones with the original */
- gchar *clonesort;
- /** store the icon of the game in the RomEntry struct
- when game is visible on the list, used as cache */
- GdkPixbuf *icon_pixbuf;
- /** Name in list */
- gchar *name_in_list;
-} RomEntry;
-
-/**
-* Frees a rom entry.
-*/
-void rom_entry_free (RomEntry *rom_entry);
+ MameRomEntryPrivate *priv;
+ /* define public instance variables here */
+};
-/**
-* Creates a new rom entry.
-* Use rom_entry_free () to free this.
-*/
-RomEntry * rom_entry_new (void);
+struct _MameRomEntryClass {
+ GObjectClass parent;
+ /* define vtable methods and signals here */
+};
+/* Preferences */
+enum
+{
+ PROP_ROM_0,
+
+ /* ROM properties */
+ PROP_ROM_ROMNAME,
+ PROP_ROM_GAMENAME,
+ PROP_ROM_GAMENAMEEXT,
+ PROP_ROM_CLONESORT,
+
+ PROP_ROM_YEAR,
+ PROP_ROM_MANUFACTURER,
+ PROP_ROM_CLONEOF,
+ PROP_ROM_ROMOF,
+ PROP_ROM_SAMPLEOF,
+ PROP_ROM_DRIVER,
+ PROP_ROM_IS_BIOS,
+
+ PROP_ROM_NUMPLAYERS,
+ PROP_ROM_NUMBUTTONS,
+ PROP_ROM_CONTROLTYPE,
+ PROP_ROM_CHANNELS,
+
+ PROP_ROM_TIMESPLAYED,
+ PROP_ROM_HAS_ROMS,
+ PROP_ROM_HAS_SAMPLES,
+
+ PROP_ROM_DRIVER_STATUS,
+ PROP_ROM_DRIVER_STATUS_EMULATION,
+ PROP_ROM_DRIVER_STATUS_COLOUR,
+ PROP_ROM_DRIVER_STATUS_SOUND,
+ PROP_ROM_DRIVER_STATUS_GRAPHICS,
+
+ PROP_ROM_IS_VECTOR,
+ PROP_ROM_IS_HORIZONTAL,
+ PROP_ROM_SCREEN_X,
+ PROP_ROM_SCREEN_Y,
+ PROP_ROM_NUM_COLOURS,
+ PROP_ROM_SCREEN_FREQ,
+
+ PROP_ROM_IS_FAVOURITE,
+
+ PROP_ROM_NUM_ROMS,
+ PROP_ROM_NUM_SAMPLES,
+ PROP_ROM_THE_TRAILER,
+
+ PROP_ROM_CATEGORY,
+ PROP_ROM_VER_ADDED,
+
+ NUM_ROM_ENTRY_PROPERTIES
+};
+
+
+GType mame_rom_entry_get_type (void);
+MameRomEntry* mame_rom_entry_new (void);
+
+void mame_rom_entry_set_name (MameRomEntry *rom, gchar *value);
+void mame_rom_entry_set_romname (MameRomEntry *rom, gchar *romname);
+void mame_rom_entry_set_gamename (MameRomEntry *rom, gchar *gamename);
+void mame_rom_entry_set_gamenameext (MameRomEntry *rom, gchar *gamenameext);
+void mame_rom_entry_set_category_version (MameRomEntry *rom, gchar *category, gchar *version);
+void mame_rom_entry_set_cloneof (MameRomEntry *rom, gchar *clone);
+void mame_rom_entry_set_romof (MameRomEntry *rom, gchar *romof);
+void mame_rom_entry_set_isbios (MameRomEntry *rom, gboolean isbios);
+void mame_rom_entry_set_driver (MameRomEntry *rom, const gchar *driver);
+void mame_rom_entry_set_year (MameRomEntry *rom, const gchar *year);
+void mame_rom_entry_set_manufacturer (MameRomEntry *rom, const gchar *manufacturer);
+void mame_rom_entry_set_default_fields (MameRomEntry *rom);
+void mame_rom_entry_set_icon (MameRomEntry *rom, GdkPixbuf *icon_pixbuf);
+void mame_rom_entry_set_position (MameRomEntry *rom, GtkTreeIter iter);
+
+gchar* mame_rom_entry_get_clonesort (MameRomEntry *rom);
+gboolean mame_rom_entry_is_bios (MameRomEntry *rom);
+gboolean mame_rom_entry_is_favourite (MameRomEntry *rom);
+gboolean mame_rom_entry_is_vector (MameRomEntry *rom);
+gboolean mame_rom_entry_is_clone (MameRomEntry *rom);
+
+gboolean mame_rom_entry_has_samples (MameRomEntry *rom);
+const gchar * mame_rom_entry_get_list_name (MameRomEntry *rom);
+const gchar * mame_rom_entry_get_gamename (MameRomEntry *rom);
+const gchar * mame_rom_entry_get_romname (MameRomEntry *rom);
+const gchar * mame_rom_entry_get_parent_romname (MameRomEntry *rom);
+const gchar * mame_rom_entry_get_year (MameRomEntry *rom);
+const gchar * mame_rom_entry_get_manufacturer (MameRomEntry *rom);
+RomStatus mame_rom_entry_get_rom_status (MameRomEntry *rom);
+RomStatus mame_rom_entry_get_sample_status (MameRomEntry *rom);
+gchar* mame_rom_entry_get_resolution (MameRomEntry *rom);
+gfloat mame_rom_entry_get_screen_freq (MameRomEntry *rom);
+GdkPixbuf * mame_rom_entry_get_icon (MameRomEntry *rom);
+GtkTreeIter mame_rom_entry_get_position (MameRomEntry *rom);
+
+gchar **mame_rom_entry_get_manufacturers (MameRomEntry * rom);
+
+void mame_rom_entry_add_rom (MameRomEntry *rom);
+void mame_rom_entry_add_sample (MameRomEntry *rom);
+void mame_rom_entry_add_cpu (MameRomEntry *rom, int i, gchar *name, gint clock);
+void mame_rom_entry_add_soundcpu (MameRomEntry *rom, int i, gchar *name, gint clock);
+
+void mame_rom_entry_rom_played (MameRomEntry *rom, gboolean warning, gboolean error);
+
+gchar* get_rom_clone_name (MameRomEntry *rom);
+gchar* get_rom_cpu_value (MameRomEntry *rom);
+gchar* get_rom_sound_value (MameRomEntry *rom);
+
+CPUInfo * get_rom_cpu (MameRomEntry *rom, int i);
+SoundCPUInfo * get_sound_cpu (MameRomEntry *rom, int i);
-void rom_entry_set_name (RomEntry *rom, gchar *value);
-void rom_entry_set_driver (RomEntry *rom, const gchar *driver);
-void rom_entry_set_year (RomEntry *rom, const gchar *year);
-gchar **rom_entry_get_manufacturers (RomEntry * rom);
-const gchar *rom_entry_get_list_name(RomEntry *rom);
ControlType get_control_type (gchar *control_type);
DriverStatus get_driver_status (gchar *driver_status);
-#endif
+G_END_DECLS
+
+#endif /* __ROM_ENTRY_H__ */
--
front-end for the arcade games emulator MAME
More information about the Pkg-games-commits
mailing list