M4DEFS+= -DGAME_CONF_PATH=$(GAME_CONF_PATH) -DGAME_BIN_PATH=$(GAME_BIN_PATH)
M4DEFS+= -DGAME_GAME_PATH=$(GAME_GAME_PATH) -DGAME_BANNER_PATH=$(GAME_BANNER_PATH)
+OBJS := plugin.o state.o save.o controls.o
+
DATA_FILES:=drnoksnes.conf drnoksnes.desktop drnoksnes.game
DATA_FILES+=drnoksnes.service drnoksnes.startup.service
all: drnoksnes_plugin.so data
-drnoksnes_plugin.so: plugin.o state.o save.o
+drnoksnes_plugin.so: $(OBJS)
$(CC) $(LDFLAGS) $^ $(LDLIBS)-o $@
clean:
--- /dev/null
+/*
+* This file is part of DrNokSnes
+*
+* Copyright (C) 2009 Javier S. Pedro <maemo@javispedro.com>
+*
+* This software is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public License
+* as published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA
+*
+*/
+
+#include <gtk/gtk.h>
+#include <gconf/gconf.h>
+#include <gconf/gconf-client.h>
+
+#include "../platform/hgw.h"
+#include "plugin.h"
+
+static GtkDialog* dialog;
+static GtkTreeView* list;
+
+static void cb_dialog_response(GtkWidget * button, gpointer data)
+{
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+}
+
+void controls_dialog(GtkWindow* parent)
+{
+ dialog = GTK_DIALOG(gtk_dialog_new_with_buttons("Controls",
+ parent, GTK_DIALOG_MODAL,
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL));
+
+ list = GTK_TREE_VIEW(gtk_tree_view_new());
+
+ gtk_box_pack_start_defaults(GTK_BOX(dialog->vbox), GTK_WIDGET(list));
+
+ g_signal_connect(G_OBJECT(dialog), "response",
+ G_CALLBACK (cb_dialog_response), NULL);
+
+ gtk_window_resize(GTK_WINDOW(dialog), 600, 300);
+ gtk_widget_show_all(GTK_WIDGET(dialog));
+}
+
static void update_menu(void);
static void plugin_callback(GtkWidget * menu_item, gpointer data);
-GConfClient *gcc = NULL;
+GConfClient * gcc = NULL;
static GameStartupInfo gs;
-GtkWidget *menu_items[2];
+static GtkWidget * menu_items[1];
static StartupPluginInfo plugin_info = {
load_plugin,
}
}
+static void controls_item_callback(GtkWidget * button, gpointer data)
+{
+ controls_dialog(get_parent_window());
+}
+
static void auto_framerate_callback(GtkWidget * button, gpointer data)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_framerate_check))) {
static GtkWidget **load_menu(guint *nitems)
{
- *nitems = 0;
+ menu_items[0] = gtk_menu_item_new_with_label("Settings");
+ *nitems = 1;
+
+ GtkMenu* settings_menu = GTK_MENU(gtk_menu_new());
+ GtkMenuItem* controls_item =
+ GTK_MENU_ITEM(gtk_menu_item_new_with_label("Controls..."));
- return NULL;
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_items[0]),
+ GTK_WIDGET(settings_menu));
+ gtk_menu_append(GTK_MENU(settings_menu), GTK_WIDGET(controls_item));
+
+ g_signal_connect(G_OBJECT(controls_item), "activate",
+ G_CALLBACK(controls_item_callback), NULL);
+
+ return menu_items;
}
static void update_menu(void)
{
-
+ // Nothing to update in the current menu
}
static void plugin_callback(GtkWidget * menu_item, gpointer data)
void save_save(GtkWindow* parent);
void save_save_as(GtkWindow* parent);
+/* controls.c */
+void controls_dialog(GtkWindow* parent);
+
#endif