--- np2/x11/gtk2/gtk_menu.c 2007/01/21 00:24:24 1.8
+++ np2/x11/gtk2/gtk_menu.c 2007/02/04 11:51:14 1.10
@@ -1,4 +1,4 @@
-/* $Id: gtk_menu.c,v 1.8 2007/01/21 00:24:24 monaka Exp $ */
+/* $Id: gtk_menu.c,v 1.10 2007/02/04 11:51:14 monaka Exp $ */
/*
* Copyright (c) 2004 NONAKA Kimihiro (aw9k-nnk@asahi-net.or.jp)
@@ -108,6 +108,7 @@ static GtkActionEntry menu_entries[] = {
{ "SASI1Menu", NULL, "SASI-_1", NULL, NULL, NULL },
{ "SASI2Menu", NULL, "SASI-_2", NULL, NULL, NULL },
#endif
+{ "ScrnSizeMenu", NULL, "Size", NULL, NULL, NULL },
{ "SoundMenu", NULL, "_Sound", NULL, NULL, NULL },
/* MenuItem */
@@ -263,6 +264,16 @@ static GtkRadioActionEntry rotate_entrie
};
static const guint n_rotate_entries = G_N_ELEMENTS(rotate_entries);
+static GtkRadioActionEntry screensize_entries[] = {
+{ "320x200", NULL, "320x200", NULL, NULL, 4 },
+{ "480x300", NULL, "480x300", NULL, NULL, 6 },
+{ "640x400", NULL, "640x400", NULL, NULL, 8 },
+{ "800x500", NULL, "800x500", NULL, NULL, 10 },
+{ "960x600", NULL, "960x600", NULL, NULL, 12 },
+{ "1280x800", NULL, "1280x800", NULL, NULL, 16 },
+};
+static const guint n_screensize_entries = G_N_ELEMENTS(screensize_entries);
+
static void cb_beepvol(gint idx);
static void cb_f12key(gint idx);
static void cb_framerate(gint idx);
@@ -270,6 +281,7 @@ static void cb_joykey(gint idx);
static void cb_memory(gint idx);
static void cb_rotate(gint idx);
static void cb_screenmode(gint idx);
+static void cb_screensize(gint idx);
static void cb_soundboard(gint idx);
static const struct {
@@ -284,6 +296,7 @@ static const struct {
{ memory_entries, G_N_ELEMENTS(memory_entries), cb_memory },
{ rotate_entries, G_N_ELEMENTS(rotate_entries), cb_rotate },
{ screenmode_entries, G_N_ELEMENTS(screenmode_entries), cb_screenmode },
+ { screensize_entries, G_N_ELEMENTS(screensize_entries), cb_screensize },
{ soundboard_entries, G_N_ELEMENTS(soundboard_entries), cb_soundboard },
};
static const guint n_radiomenu_entries = G_N_ELEMENTS(radiomenu_entries);
@@ -298,7 +311,6 @@ static const gchar *ui_info =
" \n"
" \n"
" \n"
-" \n"
" \n"
" \n"
" \n"
@@ -340,11 +352,22 @@ static const gchar *ui_info =
" \n"
" \n"
" \n"
-" \n"
+" \n"
" \n"
" \n"
" \n"
" \n"
+#if defined(SUPPORT_SCREENSIZE)
+" \n"
+"
\n"
+#endif
" \n"
" \n"
" \n"
@@ -486,6 +509,8 @@ xmenu_select_item_by_index(MENU_HDL hdl,
xmenu_select_item_by_index(NULL, rotate_entries, n_rotate_entries, v);
#define xmenu_select_screenmode(v) \
xmenu_select_item_by_index(NULL, screenmode_entries, n_screenmode_entries, v);
+#define xmenu_select_screensize(v) \
+ xmenu_select_item_by_index(NULL, screensize_entries, n_screensize_entries, v);
#define xmenu_select_soundboard(v) \
xmenu_select_item_by_index(NULL, soundboard_entries, n_soundboard_entries, v);
@@ -524,9 +549,13 @@ cb_bmpsave(GtkAction *action, gpointer u
g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ if (strlen(bmpfilefolder) == 0) {
+ g_strlcpy(bmpfilefolder, modulefile, sizeof(bmpfilefolder));
+ file_cutname(bmpfilefolder);
+ }
utf8 = g_filename_to_utf8(bmpfilefolder, -1, NULL, NULL, NULL);
if (utf8) {
- gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), utf8);
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
g_free(utf8);
}
@@ -996,6 +1025,10 @@ cb_newdisk(GtkAction *action, gpointer u
g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ if (strlen(fddfolder) == 0) {
+ g_strlcpy(fddfolder, modulefile, sizeof(fddfolder));
+ file_cutname(fddfolder);
+ }
utf8 = g_filename_to_utf8(fddfolder, -1, NULL, NULL, NULL);
if (utf8) {
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), utf8);
@@ -1646,6 +1679,19 @@ cb_screenmode(gint idx)
}
static void
+cb_screensize(gint idx)
+{
+ guint value;
+
+ if (idx >= 0) {
+ value = screensize_entries[idx].value;
+ } else {
+ value = 0;
+ }
+ scrnmng_setmultiple(value);
+}
+
+static void
cb_soundboard(gint idx)
{
guint value;
@@ -1691,7 +1737,7 @@ cb_radio(GtkRadioAction *action, GtkRadi
static GtkWidget *menubar;
static guint menubar_timerid;
-#define EVENT_MASK (GDK_LEAVE_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK)
+#define EVENT_MASK (GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK)
static gboolean
menubar_timeout(gpointer p)
@@ -1844,6 +1890,7 @@ create_menu(void)
xmenu_select_memory(np2cfg.EXTMEM);
xmenu_select_rotate(scrnmode & SCRNMODE_ROTATEMASK);
xmenu_select_screenmode(scrnmode & SCRNMODE_FULLSCREEN);
+ xmenu_select_screensize(SCREEN_DEFMUL);
xmenu_select_soundboard(np2cfg.SOUND_SW);
if (np2cfg.fddequip) {