diff --git a/desmume/src/frontend/posix/gtk/desmume.gresource.xml b/desmume/src/frontend/posix/gtk/desmume.gresource.xml index d26c2f730..7d02489f2 100644 --- a/desmume/src/frontend/posix/gtk/desmume.gresource.xml +++ b/desmume/src/frontend/posix/gtk/desmume.gresource.xml @@ -3,6 +3,7 @@ org.desmume.DeSmuME.svg main.ui + menu.ui graphics.ui diff --git a/desmume/src/frontend/posix/gtk/main.cpp b/desmume/src/frontend/posix/gtk/main.cpp index 3c8a25633..57a0db6a6 100644 --- a/desmume/src/frontend/posix/gtk/main.cpp +++ b/desmume/src/frontend/posix/gtk/main.cpp @@ -193,860 +193,6 @@ static void JITMaxBlockSizeChanged(GtkAdjustment* adj,void *); #endif static void GraphicsSettingsDialog(GSimpleAction *action, GVariant *parameter, gpointer user_data); -static const char *menu_builder = -"" -"" -" " -" " -" _File" -"
" -" " -" _Open" -" app.open" -" <Control>o" -" " -" " -" Open _recent" -" " -"
" -"
" -" " -" _Run" -" app.run" -" Pause" -" " -" " -" _Pause" -" app.pause" -" Pause" -" " -" " -" Re_set" -" app.reset" -" " -"
" -"
" -" " -" Save state _to…" -" app.save_state_to" -" " -" " -" Load state _from…" -" app.load_state_from" -" " -" " -" _Save state" -"
" -" " -" _1" -" app.savestate" -" 1" -" <Shift>F1" -" " -" " -" _2" -" app.savestate" -" 2" -" <Shift>F2" -" " -" " -" _3" -" app.savestate" -" 3" -" <Shift>F3" -" " -" " -" _4" -" app.savestate" -" 4" -" <Shift>F4" -" " -" " -" _5" -" app.savestate" -" 5" -" <Shift>F5" -" " -" " -" _6" -" app.savestate" -" 6" -" <Shift>F6" -" " -" " -" _7" -" app.savestate" -" 7" -" <Shift>F7" -" " -" " -" _8" -" app.savestate" -" 8" -" <Shift>F8" -" " -" " -" _9" -" app.savestate" -" 9" -" <Shift>F9" -" " -" " -" 1_0" -" app.savestate" -" 0" -" <Shift>F10" -" " -"
" -"
" -" " -" _Load state" -"
" -" " -" _1" -" app.loadstate" -" 1" -" F1" -" " -" " -" _2" -" app.loadstate" -" 2" -" F2" -" " -" " -" _3" -" app.loadstate" -" 3" -" F3" -" " -" " -" _4" -" app.loadstate" -" 4" -" F4" -" " -" " -" _5" -" app.loadstate" -" 5" -" F5" -" " -" " -" _6" -" app.loadstate" -" 6" -" F6" -" " -" " -" _7" -" app.loadstate" -" 7" -" F7" -" " -" " -" _8" -" app.loadstate" -" 8" -" F8" -" " -" " -" _9" -" app.loadstate" -" 9" -" F9" -" " -" " -" 1_0" -" app.loadstate" -" 0" -" F10" -" " -"
" -"
" -"
" -"
" -" " -" _Import backup memory…" -" app.importbackup" -" " -" " -" _Export backup memory…" -" app.exportbackup" -" " -"
" -"
" -" " -" Record movie _to…" -" app.record_movie_to" -" " -" " -" Play movie _from…" -" app.play_movie_from" -" " -" " -" Stop movie" -" app.stop_movie" -" " -"
" -"
" -" " -" Record _video/audio" -"
" -" " -" Record lossless H._264 (video only)…" -" app.record_x264" -" " -" " -" Record _FLAC (audio only)…" -" app.record_flac" -" " -" " -" _Stop recording" -" app.stop_recording" -" " -"
" -"
" -#ifdef DESMUME_GTK_FIRMWARE_BROKEN -" " -" Load Firm_ware file" -" app.loadfirmware" -" " -#endif -" " -" Take a screenshot" -" app.printscreen" -" <Control>s" -" " -"
" -"
" -" " -" _Quit" -" app.quit" -" <Control>q" -" " -"
" -"
" -" " -" _View" -"
" -" " -" LCDs _Layout" -"
" -" " -" _Vertical" -" app.orient" -" vertical" -" <Control>1" -" " -" " -" _Horizontal" -" app.orient" -" horizontal" -" <Control>2" -" " -" " -" _Single screen" -" app.orient" -" single" -" <Control>0" -" " -"
" -"
" -" " -" S_wap screens" -" app.swapscreens" -" space" -" " -"
" -"
" -" " -" _Rotation" -"
" -" " -" _0°" -" app.rotate" -" 0" -" " -" " -" _90°" -" app.rotate" -" 90" -" " -" " -" _180°" -" app.rotate" -" 180" -" " -" " -" _270°" -" app.rotate" -" 270" -" " -"
" -"
" -" " -" _Window Size" -"
" -" " -" 0_.5×" -" app.winsize" -" 0.5" -" " -" " -" _1×" -" app.winsize" -" 1" -" " -" " -" 1.5×" -" app.winsize" -" 1.5" -" " -" " -" _2×" -" app.winsize" -" 2" -" " -" " -" 2.5×" -" app.winsize" -" 2.5" -" " -" " -" _3×" -" app.winsize" -" 3" -" " -" " -" _4×" -" app.winsize" -" 4" -" " -" " -" _5×" -" app.winsize" -" 5" -" " -" " -" _Scale to window" -" app.winsize" -" scale" -" " -"
" -"
" -" " -" _Fullscreen" -" app.fullscreen" -" F11" -" " -"
" -"
" -" " -" Screen _Gap" -" app.gap" -" " -" " -" Video _Filter" -"
" -" " -" _None" -" app.pri_interpolation" -" none" -" " -" " -" _LQ2X" -" app.pri_interpolation" -" lq2x" -" " -" " -" _LQ2XS" -" app.pri_interpolation" -" lq2xs" -" " -" " -" _HQ2X" -" app.pri_interpolation" -" hq2x" -" " -" " -" _HQ2XS" -" app.pri_interpolation" -" hq2xs" -" " -" " -" _HQ3X" -" app.pri_interpolation" -" hq3x" -" " -" " -" _HQ3XS" -" app.pri_interpolation" -" hq3xs" -" " -" " -" _HQ4X" -" app.pri_interpolation" -" hq4x" -" " -" " -" _HQ4XS" -" app.pri_interpolation" -" hq4xs" -" " -" " -" _2xSaI" -" app.pri_interpolation" -" 2xsai" -" " -" " -" _Super2xSaI" -" app.pri_interpolation" -" super2xsai" -" " -" " -" _SuperEagle" -" app.pri_interpolation" -" supereagle" -" " -" " -" _Scanline" -" app.pri_interpolation" -" scanline" -" " -" " -" _Bilinear" -" app.pri_interpolation" -" bilinear" -" " -" " -" _Nearest2X" -" app.pri_interpolation" -" nearest2x" -" " -" " -" _Nearest1_5X" -" app.pri_interpolation" -" nearest_1point5x" -" " -" " -" _NearestPlus1_5X" -" app.pri_interpolation" -" nearestplus_1point5x" -" " -" " -" _EPX" -" app.pri_interpolation" -" epx" -" " -" " -" _EPXPlus" -" app.pri_interpolation" -" epxplus" -" " -" " -" _EPX1_5X" -" app.pri_interpolation" -" epx_1point5x" -" " -" " -" _EPXPlus1_5X" -" app.pri_interpolation" -" epxplus_1point5x" -" " -" " -" _2xBRZ" -" app.pri_interpolation" -" 2xbrz" -" " -" " -" _3xBRZ" -" app.pri_interpolation" -" 3xbrz" -" " -" " -" _4xBRZ" -" app.pri_interpolation" -" 4xbrz" -" " -" " -" _5xBRZ" -" app.pri_interpolation" -" 5xbrz" -" " -"
" -"
" -" " -" S_econdary Video Filter" -"
" -" " -" _Fast" -" app.interpolation" -" fast" -" " -" " -" _Nearest-neighbor" -" app.interpolation" -" nearest" -" " -" " -" _Good" -" app.interpolation" -" good" -" " -" " -" B_ilinear" -" app.interpolation" -" bilinear" -" " -" " -" B_est" -" app.interpolation" -" best" -" " -//" " -//" G_aussian" -//" app.interpolation" -//" gaussian" -//" " -"
" -"
" -" " -" _HUD" -#ifdef HAVE_LIBAGG -"
" -" " -" Display _fps" -" app.hud_fps" -" " -" " -" Display _Input" -" app.hud_input" -" " -" " -" Display _Graphical Input" -" app.hud_graphicalinput" -" " -" " -" Display Frame _Counter" -" app.hud_framecounter" -" " -" " -" Display _Lag Counter" -" app.hud_lagcounter" -" " -" " -" Display _RTC" -" app.hud_rtc" -" " -" " -" Display _Mic" -" app.hud_mic" -" " -"
" -"
" -" " -" _Editor mode" -" app.hud_editor" -" " -"
" -#else -" " -" HUD support not compiled" -" app.hud_notsupported" -" " -#endif -"
" -"
" -"
" -" " -" Show _menu" -" app.view_menu" -" " -" " -" Show _toolbar" -" app.view_toolbar" -" " -" " -" Show _statusbar" -" app.view_statusbar" -" " -"
" -"
" -" " -" _Config" -"
" -" " -" _Frameskip" -"
" -" " -" _Limit framerate" -" app.enablefpslimiter" -" " -"
" -"
" -" " -" _Auto-minimize skipping" -" app.frameskipA" -" " -"
" -"
" -" " -" _0 (never skip)" -" app.frameskip" -" 0" -" " -" " -" _1" -" app.frameskip" -" 1" -" " -" " -" _2" -" app.frameskip" -" 2" -" " -" " -" _3" -" app.frameskip" -" 3" -" " -" " -" _4" -" app.frameskip" -" 4" -" " -" " -" _5" -" app.frameskip" -" 5" -" " -" " -" _6" -" app.frameskip" -" 6" -" " -" " -" _7" -" app.frameskip" -" 7" -" " -" " -" _8" -" app.frameskip" -" 8" -" " -" " -" _9" -" app.frameskip" -" 9" -" " -"
" -"
" -#ifdef HAVE_JIT -" " -" Em_ulation Settings" -" app.emulationsettings" -" " -#endif -" " -" _Graphics settings" -" app.graphics_settings" -" " -" " -" _Enable audio" -" app.enableaudio" -" " -#ifdef FAKE_MIC -" " -" Fake mic _noise" -" app.micnoise" -" " -#endif -" " -" Audio _Synchronization" -"
" -" " -" _Dual Asynchronous" -" app.spu_mode" -" dual-async" -" " -" " -" Synchronous (_N)" -" app.spu_mode" -" sync-n" -" " -" " -" Synchronous (_Z)" -" app.spu_mode" -" sync-z" -" " -#ifdef HAVE_LIBSOUNDTOUCH -" " -" Synchronous (_P)" -" app.spu_mode" -" sync-p" -" " -#endif -"
" -"
" -" " -" Audio _Interpolation" -"
" -" " -" _None" -" app.spu_interpolation" -" none" -" " -" " -" _Linear" -" app.spu_interpolation" -" linear" -" " -" " -" _Cosine" -" app.spu_interpolation" -" cosine" -" " -"
" -"
" -" " -" _Cheat" -"
" -" " -" _Search" -" app.cheatsearch" -" " -" " -" _List" -" app.cheatlist" -" " -"
" -"
" -" " -" _Saves" -"
" -" " -" _0 Autodetect" -" app.savetype" -" autodetect" -" " -" " -" _1 EEPROM 4kbit" -" app.savetype" -" eeprom-4k" -" " -" " -" _2 EEPROM 64kbit" -" app.savetype" -" eeprom-64k" -" " -" " -" _3 EEPROM 512kbit" -" app.savetype" -" eeprom-512k" -" " -" " -" _4 FRAM 256kbit" -" app.savetype" -" fram-256k" -" " -" " -" _5 FLASH 2mbit" -" app.savetype" -" flash-2m" -" " -" " -" _6 FLASH 4mbit" -" app.savetype" -" flash-4m" -" " -"
" -"
" -" " -" Set audio _volume" -" app.setaudiovolume" -" " -" " -" Set firmware _language" -" app.setfirmwarelanguage" -" " -" " -" _Edit controls" -" app.editctrls" -" " -" " -" Edit _Joystick controls" -" app.editjoyctrls" -" " -"
" -"
" -" " -" _Tools" -"
" -" " -" _IO regs view" -" app.ioregs" -" " -" " -" View _Layers" -"
" -" " -" _0 Main BG 0" -" app.layermainbg0" -" " -" " -" _1 Main BG 1" -" app.layermainbg1" -" " -" " -" _2 Main BG 2" -" app.layermainbg2" -" " -" " -" _3 Main BG 3" -" app.layermainbg3" -" " -" " -" _4 Main OBJ" -" app.layermainobj" -" " -" " -" _5 SUB BG 0" -" app.layersubbg0" -" " -" " -" _6 SUB BG 1" -" app.layersubbg1" -" " -" " -" _7 SUB BG 2" -" app.layersubbg2" -" " -" " -" _8 SUB BG 3" -" app.layersubbg3" -" " -" " -" _9 SUB OBJ" -" app.layersubobj" -" " -"
" -"
" -"
" -"
" -" " -" _Help" -"
" -" " -" _About" -" app.about" -" " -"
" -"
" -"
" -"
"; - static const GActionEntry app_entries[] = { // File { "open", OpenNdsDialog }, @@ -4190,14 +3336,42 @@ common_gtk_main(GApplication *app, gpointer user_data) nds_screen.swap = config.view_swap; g_simple_action_set_state(G_SIMPLE_ACTION(g_action_map_lookup_action(G_ACTION_MAP(app), "swapscreens")), g_variant_new_boolean(config.view_swap)); - builder = gtk_builder_new_from_string(menu_builder, -1); + builder = gtk_builder_new_from_resource("/org/desmume/DeSmuME/menu.ui"); GMenuModel *menubar = G_MENU_MODEL(gtk_builder_get_object(builder, "menubar")); GMenuModel *open_recent_menu = G_MENU_MODEL(gtk_builder_get_object(builder, "open_recent")); savestates_menu = G_MENU_MODEL(gtk_builder_get_object(builder, "savestates")); loadstates_menu = G_MENU_MODEL(gtk_builder_get_object(builder, "loadstates")); + GMenu *config_menu = G_MENU(gtk_builder_get_object(builder, "config")); + +#ifdef FAKE_MIC + GMenuItem *mic_noise = g_menu_item_new("Fake mic _noise", "app.micnoise"); + g_menu_insert_item(config_menu, 3, mic_noise); +#endif + +#ifdef HAVE_JIT + GMenuItem *emulation_settings = g_menu_item_new("Em_ulation Settings", "app.emulationsettings"); + g_menu_insert_item(config_menu, 1, emulation_settings); +#endif + +#ifdef HAVE_LIBSOUNDTOUCH + GMenu *audio_sync_menu = G_MENU(gtk_builder_get_object(builder, "audio-synchronisation")); + GMenuItem *sync_p = g_menu_item_new("Synchronous (_P)", "app.spu_mode(\"sync-p\")"); + g_menu_append_item(audio_sync_menu, sync_p); +#endif + + GMenu *view_menu = G_MENU(gtk_builder_get_object(builder, "view")); + GMenuModel *hud = G_MENU_MODEL(gtk_builder_get_object(builder, +#ifdef HAVE_LIBAGG + "hud_supported" +#else + "hud_unsupported" +#endif + )); + g_menu_append_submenu(view_menu, "_HUD", hud); + gtk_application_set_menubar(GTK_APPLICATION(app), menubar); g_object_unref(builder); - pApp = GTK_APPLICATION(app); + pApp = GTK_APPLICATION(app); GtkRecentManager *manager = gtk_recent_manager_get_default(); GList *items = gtk_recent_manager_get_items(manager); diff --git a/desmume/src/frontend/posix/gtk/menu.ui b/desmume/src/frontend/posix/gtk/menu.ui new file mode 100644 index 000000000..c640ff149 --- /dev/null +++ b/desmume/src/frontend/posix/gtk/menu.ui @@ -0,0 +1,845 @@ + + + + + _File +
+ + _Open + app.open + <Control>o + + + Open _recent + +
+
+ + _Run + app.run + Pause + + + _Pause + app.pause + Pause + + + Re_set + app.reset + +
+
+ + Save state _to… + app.save_state_to + + + Load state _from… + app.load_state_from + + + _Save state +
+ + _1 + app.savestate + 1 + <Shift>F1 + + + _2 + app.savestate + 2 + <Shift>F2 + + + _3 + app.savestate + 3 + <Shift>F3 + + + _4 + app.savestate + 4 + <Shift>F4 + + + _5 + app.savestate + 5 + <Shift>F5 + + + _6 + app.savestate + 6 + <Shift>F6 + + + _7 + app.savestate + 7 + <Shift>F7 + + + _8 + app.savestate + 8 + <Shift>F8 + + + _9 + app.savestate + 9 + <Shift>F9 + + + 1_0 + app.savestate + 0 + <Shift>F10 + +
+
+ + _Load state +
+ + _1 + app.loadstate + 1 + F1 + + + _2 + app.loadstate + 2 + F2 + + + _3 + app.loadstate + 3 + F3 + + + _4 + app.loadstate + 4 + F4 + + + _5 + app.loadstate + 5 + F5 + + + _6 + app.loadstate + 6 + F6 + + + _7 + app.loadstate + 7 + F7 + + + _8 + app.loadstate + 8 + F8 + + + _9 + app.loadstate + 9 + F9 + + + 1_0 + app.loadstate + 0 + F10 + +
+
+
+
+ + _Import backup memory… + app.importbackup + + + _Export backup memory… + app.exportbackup + +
+
+ + Record movie _to… + app.record_movie_to + + + Play movie _from… + app.play_movie_from + + + Stop movie + app.stop_movie + +
+
+ + Record _video/audio +
+ + Record lossless H._264 (video only)… + app.record_x264 + + + Record _FLAC (audio only)… + app.record_flac + + + _Stop recording + app.stop_recording + +
+
+ + + Take a screenshot + app.printscreen + <Control>s + +
+
+ + _Quit + app.quit + <Control>q + +
+
+ + _View +
+ + LCDs _Layout +
+ + _Vertical + app.orient + vertical + <Control>1 + + + _Horizontal + app.orient + horizontal + <Control>2 + + + _Single screen + app.orient + single + <Control>0 + +
+
+ + S_wap screens + app.swapscreens + space + +
+
+ + _Rotation +
+ + _0° + app.rotate + 0 + + + _90° + app.rotate + 90 + + + _180° + app.rotate + 180 + + + _270° + app.rotate + 270 + +
+
+ + _Window Size +
+ + 0_.5× + app.winsize + 0.5 + + + _1× + app.winsize + 1 + + + 1.5× + app.winsize + 1.5 + + + _2× + app.winsize + 2 + + + 2.5× + app.winsize + 2.5 + + + _3× + app.winsize + 3 + + + _4× + app.winsize + 4 + + + _5× + app.winsize + 5 + + + _Scale to window + app.winsize + scale + +
+
+ + _Fullscreen + app.fullscreen + F11 + +
+
+ + Screen _Gap + app.gap + + + Video _Filter +
+ + _None + app.pri_interpolation + none + + + _LQ2X + app.pri_interpolation + lq2x + + + _LQ2XS + app.pri_interpolation + lq2xs + + + _HQ2X + app.pri_interpolation + hq2x + + + _HQ2XS + app.pri_interpolation + hq2xs + + + _HQ3X + app.pri_interpolation + hq3x + + + _HQ3XS + app.pri_interpolation + hq3xs + + + _HQ4X + app.pri_interpolation + hq4x + + + _HQ4XS + app.pri_interpolation + hq4xs + + + _2xSaI + app.pri_interpolation + 2xsai + + + _Super2xSaI + app.pri_interpolation + super2xsai + + + _SuperEagle + app.pri_interpolation + supereagle + + + _Scanline + app.pri_interpolation + scanline + + + _Bilinear + app.pri_interpolation + bilinear + + + _Nearest2X + app.pri_interpolation + nearest2x + + + _Nearest1_5X + app.pri_interpolation + nearest_1point5x + + + _NearestPlus1_5X + app.pri_interpolation + nearestplus_1point5x + + + _EPX + app.pri_interpolation + epx + + + _EPXPlus + app.pri_interpolation + epxplus + + + _EPX1_5X + app.pri_interpolation + epx_1point5x + + + _EPXPlus1_5X + app.pri_interpolation + epxplus_1point5x + + + _2xBRZ + app.pri_interpolation + 2xbrz + + + _3xBRZ + app.pri_interpolation + 3xbrz + + + _4xBRZ + app.pri_interpolation + 4xbrz + + + _5xBRZ + app.pri_interpolation + 5xbrz + +
+
+ + S_econdary Video Filter +
+ + _Fast + app.interpolation + fast + + + _Nearest-neighbor + app.interpolation + nearest + + + _Good + app.interpolation + good + + + B_ilinear + app.interpolation + bilinear + + + B_est + app.interpolation + best + +
+
+
+
+ + Show _menu + app.view_menu + + + Show _toolbar + app.view_toolbar + + + Show _statusbar + app.view_statusbar + +
+
+ + _Config +
+ + _Frameskip +
+ + _Limit framerate + app.enablefpslimiter + +
+
+ + _Auto-minimize skipping + app.frameskipA + +
+
+ + _0 (never skip) + app.frameskip + 0 + + + _1 + app.frameskip + 1 + + + _2 + app.frameskip + 2 + + + _3 + app.frameskip + 3 + + + _4 + app.frameskip + 4 + + + _5 + app.frameskip + 5 + + + _6 + app.frameskip + 6 + + + _7 + app.frameskip + 7 + + + _8 + app.frameskip + 8 + + + _9 + app.frameskip + 9 + +
+
+ + + _Graphics settings + app.graphics_settings + + + _Enable audio + app.enableaudio + + + + Audio _Synchronization +
+ + _Dual Asynchronous + app.spu_mode + dual-async + + + Synchronous (_N) + app.spu_mode + sync-n + + + Synchronous (_Z) + app.spu_mode + sync-z + + +
+
+ + Audio _Interpolation +
+ + _None + app.spu_interpolation + none + + + _Linear + app.spu_interpolation + linear + + + _Cosine + app.spu_interpolation + cosine + +
+
+ + _Cheat +
+ + _Search + app.cheatsearch + + + _List + app.cheatlist + +
+
+ + _Saves +
+ + _0 Autodetect + app.savetype + autodetect + + + _1 EEPROM 4kbit + app.savetype + eeprom-4k + + + _2 EEPROM 64kbit + app.savetype + eeprom-64k + + + _3 EEPROM 512kbit + app.savetype + eeprom-512k + + + _4 FRAM 256kbit + app.savetype + fram-256k + + + _5 FLASH 2mbit + app.savetype + flash-2m + + + _6 FLASH 4mbit + app.savetype + flash-4m + +
+
+ + Set audio _volume + app.setaudiovolume + + + Set firmware _language + app.setfirmwarelanguage + + + _Edit controls + app.editctrls + + + Edit _Joystick controls + app.editjoyctrls + +
+
+ + _Tools +
+ + _IO regs view + app.ioregs + + + View _Layers +
+ + _0 Main BG 0 + app.layermainbg0 + + + _1 Main BG 1 + app.layermainbg1 + + + _2 Main BG 2 + app.layermainbg2 + + + _3 Main BG 3 + app.layermainbg3 + + + _4 Main OBJ + app.layermainobj + + + _5 SUB BG 0 + app.layersubbg0 + + + _6 SUB BG 1 + app.layersubbg1 + + + _7 SUB BG 2 + app.layersubbg2 + + + _8 SUB BG 3 + app.layersubbg3 + + + _9 SUB OBJ + app.layersubobj + +
+
+
+
+ + _Help +
+ + _About + app.about + +
+
+
+ +
+ + Display _fps + app.hud_fps + + + Display _Input + app.hud_input + + + Display _Graphical Input + app.hud_graphicalinput + + + Display Frame _Counter + app.hud_framecounter + + + Display _Lag Counter + app.hud_lagcounter + + + Display _RTC + app.hud_rtc + + + Display _Mic + app.hud_mic + +
+
+ + _Editor mode + app.hud_editor + +
+
+ + + HUD support not compiled + app.hud_unsupported + + +