Make desmume_config.* frontend agnostic

Remvoe references to gdk and gtk frontend specific
configurations.
This commit is contained in:
riccardom 2010-01-26 15:31:33 +00:00
parent 6c996f8993
commit 3b9af24780
3 changed files with 21 additions and 22 deletions

View File

@ -19,31 +19,13 @@
*/
#include <glib.h>
#include <gdk/gdkkeysyms.h>
#include "ctrlssdl.h"
#include "desmume_config.h"
static const gchar *desmume_config_file = ".desmume.ini";
static const u16 gtk_kb_cfg[NB_KEYS] = {
GDK_x, // A
GDK_z, // B
GDK_Shift_R, // select
GDK_Return, // start
GDK_Right, // Right
GDK_Left, // Left
GDK_Up, // Up
GDK_Down, // Down
GDK_w, // R
GDK_q, // L
GDK_s, // X
GDK_a, // Y
GDK_p, // DEBUG
GDK_o // BOOST
};
GKeyFile *desmume_config_read_file()
GKeyFile *desmume_config_read_file(const u16 *kb_cfg)
{
gchar *config_file;
GKeyFile *keyfile;
@ -59,7 +41,7 @@ GKeyFile *desmume_config_read_file()
g_free(config_file);
load_default_config(gtk_kb_cfg);
load_default_config(kb_cfg);
desmume_config_read_keys(keyfile);
desmume_config_read_joykeys(keyfile);

View File

@ -21,7 +21,7 @@
#ifndef _DESMUME_GTK_CONFIG
#define _DESMUME_GTK_CONFIG
GKeyFile *desmume_config_read_file();
GKeyFile *desmume_config_read_file(const u16 *);
void desmume_config_dispose(GKeyFile *);
gboolean desmume_config_update_keys(GKeyFile*);

View File

@ -379,6 +379,23 @@ GPU3DInterface *core3DList[] = {
#endif
};
static const u16 gtk_kb_cfg[NB_KEYS] = {
GDK_x, // A
GDK_z, // B
GDK_Shift_R, // select
GDK_Return, // start
GDK_Right, // Right
GDK_Left, // Left
GDK_Up, // Up
GDK_Down, // Down
GDK_w, // R
GDK_q, // L
GDK_s, // X
GDK_a, // Y
GDK_p, // DEBUG
GDK_o // BOOST
};
GKeyFile *keyfile;
struct modify_key_ctx {
@ -1944,7 +1961,7 @@ common_gtk_main( struct configured_features *my_config)
if (dTools_running != NULL)
memset(dTools_running, FALSE, sizeof(BOOL) * dTools_list_size);
keyfile = desmume_config_read_file();
keyfile = desmume_config_read_file(gtk_kb_cfg);
/* Create the window */
pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);