|
|
| version 1.14, 2008/04/03 13:53:25 | version 1.28, 2012/01/23 04:57:24 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ */ | |
| /* | /* |
| * Copyright (c) 2004 NONAKA Kimihiro (aw9k-nnk@asahi-net.or.jp) | * Copyright (c) 2004-2011 NONAKA Kimihiro |
| * All rights reserved. | * All rights reserved. |
| * | * |
| * Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without |
| Line 243 static GtkRadioActionEntry f12key_entrie | Line 241 static GtkRadioActionEntry f12key_entrie |
| { "f12mouse", NULL, "F12 = _Mouse", NULL, NULL, 0 }, | { "f12mouse", NULL, "F12 = _Mouse", NULL, NULL, 0 }, |
| { "f12copy", NULL, "F12 = Co_py", NULL, NULL, 1 }, | { "f12copy", NULL, "F12 = Co_py", NULL, NULL, 1 }, |
| { "f12stop", NULL, "F12 = S_top", NULL, NULL, 2 }, | { "f12stop", NULL, "F12 = S_top", NULL, NULL, 2 }, |
| { "f12help", NULL, "F12 = _Help", NULL, NULL, 7 }, | |
| { "f12equal", NULL, "F12 = tenkey [=]", NULL, NULL, 4 }, | { "f12equal", NULL, "F12 = tenkey [=]", NULL, NULL, 4 }, |
| { "f12comma", NULL, "F12 = tenkey [,]", NULL, NULL, 3 }, | { "f12comma", NULL, "F12 = tenkey [,]", NULL, NULL, 3 }, |
| }; | }; |
| Line 418 static const gchar *ui_info = | Line 417 static const gchar *ui_info = |
| " <menuitem action='f12mouse'/>\n" | " <menuitem action='f12mouse'/>\n" |
| " <menuitem action='f12copy'/>\n" | " <menuitem action='f12copy'/>\n" |
| " <menuitem action='f12stop'/>\n" | " <menuitem action='f12stop'/>\n" |
| " <menuitem action='f12help'/>\n" | |
| " <menuitem action='f12equal'/>\n" | " <menuitem action='f12equal'/>\n" |
| " <menuitem action='f12comma'/>\n" | " <menuitem action='f12comma'/>\n" |
| " </menu>\n" | " </menu>\n" |
| Line 564 cb_bmpsave(GtkAction *action, gpointer u | Line 564 cb_bmpsave(GtkAction *action, gpointer u |
| SCRNBMP bmp = NULL; | SCRNBMP bmp = NULL; |
| FILEH fh; | FILEH fh; |
| UNUSED(action); | |
| UNUSED(user_data); | |
| uninstall_idle_process(); | uninstall_idle_process(); |
| bmp = scrnbmp(); | bmp = scrnbmp(); |
| Line 581 cb_bmpsave(GtkAction *action, gpointer u | Line 578 cb_bmpsave(GtkAction *action, gpointer u |
| if (dialog == NULL) | if (dialog == NULL) |
| goto end; | goto end; |
| g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); |
| gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | #if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 8 |
| gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), | |
| TRUE); | |
| #endif | |
| if (strlen(bmpfilefolder) == 0) { | if (strlen(bmpfilefolder) == 0) { |
| g_strlcpy(bmpfilefolder, modulefile, sizeof(bmpfilefolder)); | g_strlcpy(bmpfilefolder, modulefile, sizeof(bmpfilefolder)); |
| file_cutname(bmpfilefolder); | file_cutname(bmpfilefolder); |
| Line 614 cb_bmpsave(GtkAction *action, gpointer u | Line 614 cb_bmpsave(GtkAction *action, gpointer u |
| if (utf8) { | if (utf8) { |
| path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); |
| if (path) { | if (path) { |
| gchar *ext = file_getext(path); | |
| if (strlen(ext) != 3 || file_cmpname(ext, "bmp")) { | |
| gchar *tmp = g_strjoin(".", path, "bmp", NULL); | |
| g_free(path); | |
| path = tmp; | |
| } | |
| file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder)); | file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder)); |
| sysmng_update(SYS_UPDATEOSCFG); | sysmng_update(SYS_UPDATEOSCFG); |
| fh = file_create(path); | fh = file_create(path); |
| Line 642 cb_change_font(GtkAction *action, gpoint | Line 648 cb_change_font(GtkAction *action, gpoint |
| gchar *utf8, *path; | gchar *utf8, *path; |
| struct stat sb; | struct stat sb; |
| UNUSED(action); | |
| UNUSED(user_data); | |
| uninstall_idle_process(); | uninstall_idle_process(); |
| dialog = gtk_file_chooser_dialog_new("Open a font file", | dialog = gtk_file_chooser_dialog_new("Open a font file", |
| Line 655 cb_change_font(GtkAction *action, gpoint | Line 658 cb_change_font(GtkAction *action, gpoint |
| if (dialog == NULL) | if (dialog == NULL) |
| goto end; | goto end; |
| g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); |
| gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | |
| utf8 = g_filename_to_utf8(np2cfg.fontfile, -1, NULL, NULL, NULL); | utf8 = g_filename_to_utf8(np2cfg.fontfile, -1, NULL, NULL, NULL); |
| if (utf8) { | if (utf8) { |
| gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); |
| Line 708 cb_diskeject(GtkAction *action, gpointer | Line 710 cb_diskeject(GtkAction *action, gpointer |
| const gchar *name = gtk_action_get_name(action); | const gchar *name = gtk_action_get_name(action); |
| guint drive; | guint drive; |
| UNUSED(user_data); | |
| /* name = "disk?eject" */ | /* name = "disk?eject" */ |
| if ((strlen(name) >= 5) && (g_ascii_isdigit(name[4]))) { | if ((strlen(name) >= 5) && (g_ascii_isdigit(name[4]))) { |
| drive = g_ascii_digit_value(name[4]) - 1; | drive = g_ascii_digit_value(name[4]) - 1; |
| Line 730 cb_diskopen(GtkAction *action, gpointer | Line 730 cb_diskopen(GtkAction *action, gpointer |
| const gchar *name = gtk_action_get_name(action); | const gchar *name = gtk_action_get_name(action); |
| guint drive; | guint drive; |
| UNUSED(user_data); | |
| if ((strlen(name) < 5) || (!g_ascii_isdigit(name[4]))) | if ((strlen(name) < 5) || (!g_ascii_isdigit(name[4]))) |
| return; | return; |
| drive = g_ascii_digit_value(name[4]) - 1; | drive = g_ascii_digit_value(name[4]) - 1; |
| Line 746 cb_diskopen(GtkAction *action, gpointer | Line 744 cb_diskopen(GtkAction *action, gpointer |
| if (dialog == NULL) | if (dialog == NULL) |
| goto end; | goto end; |
| g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); |
| gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | |
| utf8 = g_filename_to_utf8(fddfolder, -1, NULL, NULL, NULL); | utf8 = g_filename_to_utf8(fddfolder, -1, NULL, NULL, NULL); |
| if (utf8) { | if (utf8) { |
| gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); |
| Line 773 cb_diskopen(GtkAction *action, gpointer | Line 770 cb_diskopen(GtkAction *action, gpointer |
| gtk_file_filter_add_pattern(filter, "*.2[hH][dD]"); | gtk_file_filter_add_pattern(filter, "*.2[hH][dD]"); |
| gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]"); | gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]"); |
| gtk_file_filter_add_pattern(filter, "*.[fF][sS]"); | gtk_file_filter_add_pattern(filter, "*.[fF][sS]"); |
| gtk_file_filter_add_pattern(filter, "*.[fF][lL][pP]"); | |
| gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); | gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); |
| } | } |
| filter = gtk_file_filter_new(); | filter = gtk_file_filter_new(); |
| Line 789 cb_diskopen(GtkAction *action, gpointer | Line 787 cb_diskopen(GtkAction *action, gpointer |
| gtk_file_filter_add_pattern(filter, "*.2[hH][dD]"); | gtk_file_filter_add_pattern(filter, "*.2[hH][dD]"); |
| gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]"); | gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]"); |
| gtk_file_filter_add_pattern(filter, "*.[fF][sS]"); | gtk_file_filter_add_pattern(filter, "*.[fF][sS]"); |
| gtk_file_filter_add_pattern(filter, "*.[fF][lL][pP]"); | |
| gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); | gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); |
| } | } |
| gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter); | gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter); |
| Line 833 cb_ataopen(GtkAction *action, gpointer u | Line 832 cb_ataopen(GtkAction *action, gpointer u |
| const gchar *name = gtk_action_get_name(action); | const gchar *name = gtk_action_get_name(action); |
| guint channel, drive; | guint channel, drive; |
| UNUSED(user_data); | |
| /* "ata??open" */ | /* "ata??open" */ |
| if ((strlen(name) < 5) | if ((strlen(name) < 5) |
| || (!g_ascii_isdigit(name[3])) | || (!g_ascii_isdigit(name[3])) |
| Line 857 cb_ataopen(GtkAction *action, gpointer u | Line 854 cb_ataopen(GtkAction *action, gpointer u |
| if (dialog == NULL) | if (dialog == NULL) |
| goto end; | goto end; |
| g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); |
| gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | |
| utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL); | utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL); |
| if (utf8) { | if (utf8) { |
| gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); |
| Line 910 cb_ataremove(GtkAction *action, gpointer | Line 906 cb_ataremove(GtkAction *action, gpointer |
| const gchar *name = gtk_action_get_name(GTK_ACTION(action)); | const gchar *name = gtk_action_get_name(GTK_ACTION(action)); |
| guint channel, drive; | guint channel, drive; |
| UNUSED(user_data); | |
| /* "ata??open" */ | /* "ata??open" */ |
| if ((strlen(name) < 5) | if ((strlen(name) < 5) |
| || (!g_ascii_isdigit(name[3])) | || (!g_ascii_isdigit(name[3])) |
| Line 936 cb_atapiopen(GtkAction *action, gpointer | Line 930 cb_atapiopen(GtkAction *action, gpointer |
| gchar *utf8, *path; | gchar *utf8, *path; |
| struct stat sb; | struct stat sb; |
| UNUSED(action); | |
| UNUSED(user_data); | |
| uninstall_idle_process(); | uninstall_idle_process(); |
| dialog = gtk_file_chooser_dialog_new("Open a ATAPI CD-ROM image", | dialog = gtk_file_chooser_dialog_new("Open a ATAPI CD-ROM image", |
| Line 949 cb_atapiopen(GtkAction *action, gpointer | Line 940 cb_atapiopen(GtkAction *action, gpointer |
| if (dialog == NULL) | if (dialog == NULL) |
| goto end; | goto end; |
| g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); |
| gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | |
| utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL); | utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL); |
| if (utf8) { | if (utf8) { |
| gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); |
| Line 1004 static void | Line 994 static void |
| cb_atapiremove(GtkAction *action, gpointer user_data) | cb_atapiremove(GtkAction *action, gpointer user_data) |
| { | { |
| UNUSED(action); | |
| UNUSED(user_data); | |
| sxsi_devclose(0x02); | sxsi_devclose(0x02); |
| } | } |
| #endif /* SUPPORT_IDEIO */ | #endif /* SUPPORT_IDEIO */ |
| Line 1015 static void | Line 1002 static void |
| cb_midipanic(GtkAction *action, gpointer user_data) | cb_midipanic(GtkAction *action, gpointer user_data) |
| { | { |
| UNUSED(action); | |
| UNUSED(user_data); | |
| rs232c_midipanic(); | rs232c_midipanic(); |
| mpu98ii_midipanic(); | mpu98ii_midipanic(); |
| pc9861k_midipanic(); | pc9861k_midipanic(); |
| Line 1046 cb_newdisk(GtkAction *action, gpointer u | Line 1030 cb_newdisk(GtkAction *action, gpointer u |
| int kind; | int kind; |
| int i; | int i; |
| UNUSED(action); | |
| UNUSED(user_data); | |
| uninstall_idle_process(); | uninstall_idle_process(); |
| dialog = gtk_file_chooser_dialog_new("Create new disk image file", | dialog = gtk_file_chooser_dialog_new("Create new disk image file", |
| Line 1059 cb_newdisk(GtkAction *action, gpointer u | Line 1040 cb_newdisk(GtkAction *action, gpointer u |
| if (dialog == NULL) | if (dialog == NULL) |
| goto end; | goto end; |
| g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); |
| gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | #if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 8 |
| gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), | |
| TRUE); | |
| #endif | |
| if (strlen(fddfolder) == 0) { | if (strlen(fddfolder) == 0) { |
| g_strlcpy(fddfolder, modulefile, sizeof(fddfolder)); | g_strlcpy(fddfolder, modulefile, sizeof(fddfolder)); |
| file_cutname(fddfolder); | file_cutname(fddfolder); |
| Line 1172 static void | Line 1156 static void |
| cb_reset(GtkAction *action, gpointer user_data) | cb_reset(GtkAction *action, gpointer user_data) |
| { | { |
| UNUSED(action); | |
| UNUSED(user_data); | |
| pccore_cfgupdate(); | pccore_cfgupdate(); |
| pccore_reset(); | pccore_reset(); |
| } | } |
| Line 1190 cb_sasiopen(GtkAction *action, gpointer | Line 1171 cb_sasiopen(GtkAction *action, gpointer |
| const gchar *name = gtk_action_get_name(action); | const gchar *name = gtk_action_get_name(action); |
| guint drive; | guint drive; |
| UNUSED(user_data); | |
| if ((strlen(name) < 5) || (!g_ascii_isdigit(name[4]))) | if ((strlen(name) < 5) || (!g_ascii_isdigit(name[4]))) |
| return; | return; |
| drive = g_ascii_digit_value(name[4]) - 1; | drive = g_ascii_digit_value(name[4]) - 1; |
| Line 1206 cb_sasiopen(GtkAction *action, gpointer | Line 1185 cb_sasiopen(GtkAction *action, gpointer |
| if (dialog == NULL) | if (dialog == NULL) |
| goto end; | goto end; |
| g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); |
| gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | |
| utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL); | utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL); |
| if (utf8) { | if (utf8) { |
| gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); |
| Line 1259 cb_sasiremove(GtkAction *action, gpointe | Line 1237 cb_sasiremove(GtkAction *action, gpointe |
| const gchar *name = gtk_action_get_name(GTK_ACTION(action)); | const gchar *name = gtk_action_get_name(GTK_ACTION(action)); |
| guint drive; | guint drive; |
| UNUSED(user_data); | |
| /* name = "sasi?eject" */ | /* name = "sasi?eject" */ |
| if ((strlen(name) >= 5) && (g_ascii_isdigit(name[4]))) { | if ((strlen(name) >= 5) && (g_ascii_isdigit(name[4]))) { |
| drive = g_ascii_digit_value(name[4]) - 1; | drive = g_ascii_digit_value(name[4]) - 1; |
| Line 1279 cb_statsave(GtkAction *action, gpointer | Line 1255 cb_statsave(GtkAction *action, gpointer |
| char ext[4]; | char ext[4]; |
| guint n; | guint n; |
| UNUSED(user_data); | |
| /* name = "stat??save" */ | /* name = "stat??save" */ |
| if ((strlen(name) >= 6) | if ((strlen(name) >= 6) |
| && (g_ascii_isdigit(name[4])) | && (g_ascii_isdigit(name[4])) |
| Line 1299 cb_statload(GtkAction *action, gpointer | Line 1273 cb_statload(GtkAction *action, gpointer |
| char ext[4]; | char ext[4]; |
| guint n; | guint n; |
| UNUSED(user_data); | |
| /* name = "stat??load" */ | /* name = "stat??load" */ |
| if ((strlen(name) >= 6) | if ((strlen(name) >= 6) |
| && (g_ascii_isdigit(name[4])) | && (g_ascii_isdigit(name[4])) |
| Line 1318 cb_dialog(GtkAction *action, gpointer us | Line 1290 cb_dialog(GtkAction *action, gpointer us |
| { | { |
| const gchar *name = gtk_action_get_name(action); | const gchar *name = gtk_action_get_name(action); |
| UNUSED(user_data); | |
| if (g_ascii_strcasecmp(name, "configure") == 0) { | if (g_ascii_strcasecmp(name, "configure") == 0) { |
| create_configure_dialog(); | create_configure_dialog(); |
| } else if (g_ascii_strcasecmp(name, "soundopt") == 0) { | } else if (g_ascii_strcasecmp(name, "soundopt") == 0) { |
| Line 1346 cb_clockdisp(GtkToggleAction *action, gp | Line 1316 cb_clockdisp(GtkToggleAction *action, gp |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.DISPCLK & 1) ^ (b ? 1 : 0); | f = (np2oscfg.DISPCLK & 1) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2oscfg.DISPCLK ^= 1; | np2oscfg.DISPCLK ^= 1; |
| Line 1363 cb_dispvsync(GtkToggleAction *action, gp | Line 1331 cb_dispvsync(GtkToggleAction *action, gp |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.DISPSYNC ? 1 : 0) ^ (b ? 1 : 0); | f = (np2cfg.DISPSYNC ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2cfg.DISPSYNC = !np2cfg.DISPSYNC; | np2cfg.DISPSYNC = !np2cfg.DISPSYNC; |
| Line 1378 cb_framedisp(GtkToggleAction *action, gp | Line 1344 cb_framedisp(GtkToggleAction *action, gp |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.DISPCLK & 2) ^ (b ? 2 : 0); | f = (np2oscfg.DISPCLK & 2) ^ (b ? 2 : 0); |
| if (f) { | if (f) { |
| np2oscfg.DISPCLK ^= 2; | np2oscfg.DISPCLK ^= 2; |
| Line 1395 cb_jastsound(GtkToggleAction *action, gp | Line 1359 cb_jastsound(GtkToggleAction *action, gp |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.jastsnd ? 1 : 0) ^ (b ? 1 : 0); | f = (np2oscfg.jastsnd ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2oscfg.jastsnd = !np2oscfg.jastsnd; | np2oscfg.jastsnd = !np2oscfg.jastsnd; |
| Line 1410 cb_joyrapid(GtkToggleAction *action, gpo | Line 1372 cb_joyrapid(GtkToggleAction *action, gpo |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.BTN_RAPID ? 1 : 0) ^ (b ? 1 : 0); | f = (np2cfg.BTN_RAPID ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2cfg.BTN_RAPID = !np2cfg.BTN_RAPID; | np2cfg.BTN_RAPID = !np2cfg.BTN_RAPID; |
| Line 1425 cb_joyreverse(GtkToggleAction *action, g | Line 1385 cb_joyreverse(GtkToggleAction *action, g |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.BTN_MODE ? 1 : 0) ^ (b ? 1 : 0); | f = (np2cfg.BTN_MODE ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2cfg.BTN_MODE = !np2cfg.BTN_MODE; | np2cfg.BTN_MODE = !np2cfg.BTN_MODE; |
| Line 1440 cb_keydisplay(GtkToggleAction *action, g | Line 1398 cb_keydisplay(GtkToggleAction *action, g |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.keydisp ? 1 : 0) ^ (b ? 1 : 0); | f = (np2oscfg.keydisp ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2oscfg.keydisp = !np2oscfg.keydisp; | np2oscfg.keydisp = !np2oscfg.keydisp; |
| Line 1460 cb_mousemode(GtkToggleAction *action, gp | Line 1416 cb_mousemode(GtkToggleAction *action, gp |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.MOUSE_SW ? 1 : 0) ^ (b ? 1 : 0); | f = (np2oscfg.MOUSE_SW ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| mouse_running(MOUSE_XOR); | mouse_running(MOUSE_XOR); |
| Line 1476 cb_mouserapid(GtkToggleAction *action, g | Line 1430 cb_mouserapid(GtkToggleAction *action, g |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.MOUSERAPID ? 1 : 0) ^ (b ? 1 : 0); | f = (np2cfg.MOUSERAPID ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2cfg.MOUSERAPID = !np2cfg.MOUSERAPID; | np2cfg.MOUSERAPID = !np2cfg.MOUSERAPID; |
| Line 1491 cb_nowait(GtkToggleAction *action, gpoin | Line 1443 cb_nowait(GtkToggleAction *action, gpoin |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.NOWAIT ? 1 : 0) ^ (b ? 1 : 0); | f = (np2oscfg.NOWAIT ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2oscfg.NOWAIT = !np2oscfg.NOWAIT; | np2oscfg.NOWAIT = !np2oscfg.NOWAIT; |
| Line 1506 cb_realpalettes(GtkToggleAction *action, | Line 1456 cb_realpalettes(GtkToggleAction *action, |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.RASTER ? 1 : 0) ^ (b ? 1 : 0); | f = (np2cfg.RASTER ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2cfg.RASTER = !np2cfg.RASTER; | np2cfg.RASTER = !np2cfg.RASTER; |
| Line 1523 cb_s98logging(GtkToggleAction *action, g | Line 1471 cb_s98logging(GtkToggleAction *action, g |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (s98logging ? 1 : 0) ^ (b ? 1 : 0); | f = (s98logging ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| s98logging = !s98logging; | s98logging = !s98logging; |
| Line 1546 cb_seeksound(GtkToggleAction *action, gp | Line 1492 cb_seeksound(GtkToggleAction *action, gp |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.MOTOR ? 1 : 0) ^ (b ? 1 : 0); | f = (np2cfg.MOTOR ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2cfg.MOTOR = !np2cfg.MOTOR; | np2cfg.MOTOR = !np2cfg.MOTOR; |
| Line 1561 cb_softkeyboard(GtkToggleAction *action, | Line 1505 cb_softkeyboard(GtkToggleAction *action, |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.softkbd ? 1 : 0) ^ (b ? 1 : 0); | f = (np2oscfg.softkbd ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2oscfg.softkbd = !np2oscfg.softkbd; | np2oscfg.softkbd = !np2oscfg.softkbd; |
| Line 1581 cb_toolwindow(GtkToggleAction *action, g | Line 1523 cb_toolwindow(GtkToggleAction *action, g |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2oscfg.toolwin ? 1 : 0) ^ (b ? 1 : 0); | f = (np2oscfg.toolwin ? 1 : 0) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2oscfg.toolwin = !np2oscfg.toolwin; | np2oscfg.toolwin = !np2oscfg.toolwin; |
| Line 1601 cb_xctrlkey(GtkToggleAction *action, gpo | Line 1541 cb_xctrlkey(GtkToggleAction *action, gpo |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.XSHIFT & 2) ^ (b ? 2 : 0); | f = (np2cfg.XSHIFT & 2) ^ (b ? 2 : 0); |
| if (f) { | if (f) { |
| np2cfg.XSHIFT ^= 2; | np2cfg.XSHIFT ^= 2; |
| Line 1617 cb_xgrphkey(GtkToggleAction *action, gpo | Line 1555 cb_xgrphkey(GtkToggleAction *action, gpo |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.XSHIFT & 4) ^ (b ? 4 : 0); | f = (np2cfg.XSHIFT & 4) ^ (b ? 4 : 0); |
| if (f) { | if (f) { |
| np2cfg.XSHIFT ^= 4; | np2cfg.XSHIFT ^= 4; |
| Line 1633 cb_xshiftkey(GtkToggleAction *action, gp | Line 1569 cb_xshiftkey(GtkToggleAction *action, gp |
| gboolean b = gtk_toggle_action_get_active(action); | gboolean b = gtk_toggle_action_get_active(action); |
| gboolean f; | gboolean f; |
| UNUSED(user_data); | |
| f = (np2cfg.XSHIFT & 1) ^ (b ? 1 : 0); | f = (np2cfg.XSHIFT & 1) ^ (b ? 1 : 0); |
| if (f) { | if (f) { |
| np2cfg.XSHIFT ^= 1; | np2cfg.XSHIFT ^= 1; |
| Line 1788 cb_soundboard(gint idx) | Line 1722 cb_soundboard(gint idx) |
| static void | static void |
| cb_radio(GtkRadioAction *action, GtkRadioAction *current, gpointer user_data) | cb_radio(GtkRadioAction *action, GtkRadioAction *current, gpointer user_data) |
| { | { |
| guint value = (guint)gtk_radio_action_get_current_value(action); | gint value = gtk_radio_action_get_current_value(action); |
| guint menu_idx = (guint)GPOINTER_TO_INT(user_data); | guint menu_idx = (guint)GPOINTER_TO_INT(user_data); |
| gint i; | gint i; |
| UNUSED(current); /* emitted item */ | |
| if (menu_idx < n_radiomenu_entries) { | if (menu_idx < n_radiomenu_entries) { |
| for (i = 0; i < radiomenu_entries[menu_idx].count; i++) { | for (i = 0; i < radiomenu_entries[menu_idx].count; i++) { |
| if (radiomenu_entries[menu_idx].entry[i].value == value) | if (radiomenu_entries[menu_idx].entry[i].value == value) |
| Line 1821 static gboolean | Line 1753 static gboolean |
| menubar_timeout(gpointer p) | menubar_timeout(gpointer p) |
| { | { |
| UNUSED(p); | |
| if (menubar_timerid) { | if (menubar_timerid) { |
| g_source_remove(menubar_timerid); | g_source_remove(menubar_timerid); |
| menubar_timerid = 0; | menubar_timerid = 0; |
| Line 1843 static gboolean | Line 1773 static gboolean |
| enter_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p) | enter_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p) |
| { | { |
| UNUSED(w); | |
| UNUSED(ev); | |
| UNUSED(p); | |
| if (menubar_timerid) { | if (menubar_timerid) { |
| g_source_remove(menubar_timerid); | g_source_remove(menubar_timerid); |
| menubar_timerid = 0; | menubar_timerid = 0; |
| Line 1863 static gboolean | Line 1789 static gboolean |
| leave_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p) | leave_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p) |
| { | { |
| UNUSED(w); | |
| UNUSED(ev); | |
| UNUSED(p); | |
| if (menubar_timerid) { | if (menubar_timerid) { |
| g_source_remove(menubar_timerid); | g_source_remove(menubar_timerid); |
| menubar_timerid = 0; | menubar_timerid = 0; |
| Line 2037 create_menu(void) | Line 1959 create_menu(void) |
| gtk_widget_add_events(menubar, EVENT_MASK); | gtk_widget_add_events(menubar, EVENT_MASK); |
| g_signal_connect(GTK_OBJECT(menubar), "enter_notify_event", | g_signal_connect(GTK_OBJECT(menubar), "enter_notify_event", |
| GTK_SIGNAL_FUNC(enter_notify_evhandler), NULL); | G_CALLBACK(enter_notify_evhandler), NULL); |
| g_signal_connect(GTK_OBJECT(menubar), "leave_notify_event", | g_signal_connect(GTK_OBJECT(menubar), "leave_notify_event", |
| GTK_SIGNAL_FUNC(leave_notify_evhandler), NULL); | G_CALLBACK(leave_notify_evhandler), NULL); |
| return menubar; | return menubar; |
| } | } |
| Line 2062 void | Line 1984 void |
| xmenu_toggle_menu(void) | xmenu_toggle_menu(void) |
| { | { |
| if (GTK_WIDGET_VISIBLE(menubar)) | if (gtk_widget_get_visible(menubar)) |
| xmenu_hide(); | xmenu_hide(); |
| else | else |
| xmenu_show(); | xmenu_show(); |