| version 1.1, 2004/07/15 14:24:33 | version 1.6, 2011/01/15 16:01:52 | 
| Line 12 | Line 12 | 
 | * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | 
 | *    notice, this list of conditions and the following disclaimer in the | *    notice, this list of conditions and the following disclaimer in the | 
 | *    documentation and/or other materials provided with the distribution. | *    documentation and/or other materials provided with the distribution. | 
 | * 3. The name of the author may not be used to endorse or promote products |  | 
 | *    derived from this software without specific prior written permission. |  | 
 | * | * | 
 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 
 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 
| Line 83  static BYTE mpuopt; | Line 81  static BYTE mpuopt; | 
 | static void | static void | 
 | ok_button_clicked(GtkButton *b, gpointer d) | ok_button_clicked(GtkButton *b, gpointer d) | 
 | { | { | 
| const gchar *p; | const gchar *utf8; | 
|  | gchar *p; | 
 | BOOL enable; | BOOL enable; | 
 | UINT update; | UINT update; | 
 | int i; | int i; | 
 |  |  | 
 | UNUSED(b); |  | 
 |  |  | 
 | update = 0; | update = 0; | 
 | if (np2cfg.mpuopt != mpuopt) { | if (np2cfg.mpuopt != mpuopt) { | 
 | update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | 
 | } | } | 
| p = gtk_entry_get_text(GTK_ENTRY(mpu98_midiout_entry)); | utf8 = gtk_entry_get_text(GTK_ENTRY(mpu98_midiout_entry)); | 
| if (p != NULL) { | if (utf8 != NULL) { | 
| if (milstr_cmp(np2oscfg.mpu.mout, p)) { | p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
| milstr_ncpy(np2oscfg.mpu.mout, p, sizeof(np2oscfg.mpu.mout)); | if (p != NULL) { | 
| update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | if (milstr_cmp(np2oscfg.mpu.mout, p)) { | 
| } | milstr_ncpy(np2oscfg.mpu.mout, p, sizeof(np2oscfg.mpu.mout)); | 
| } | update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | 
| p = gtk_entry_get_text(GTK_ENTRY(mpu98_midiin_entry)); | } | 
| if (p != NULL) { | g_free(p); | 
| if (milstr_cmp(np2oscfg.mpu.min, p)) { | } | 
| milstr_ncpy(np2oscfg.mpu.min, p, sizeof(np2oscfg.mpu.min)); | } | 
| update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | utf8 = gtk_entry_get_text(GTK_ENTRY(mpu98_midiin_entry)); | 
| } | if (utf8 != NULL) { | 
| } | p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
| p = gtk_entry_get_text(GTK_ENTRY(mpu98_module_entry)); | if (p != NULL) { | 
| if (p != NULL) { | if (milstr_cmp(np2oscfg.mpu.min, p)) { | 
| if (milstr_cmp(np2oscfg.mpu.mdl, p)) { | milstr_ncpy(np2oscfg.mpu.min, p, sizeof(np2oscfg.mpu.min)); | 
| milstr_ncpy(np2oscfg.mpu.mdl, p, sizeof(np2oscfg.mpu.mdl)); | update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | 
| update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | } | 
|  | g_free(p); | 
|  | } | 
|  | } | 
|  | utf8 = gtk_entry_get_text(GTK_ENTRY(mpu98_module_entry)); | 
|  | if (utf8 != NULL) { | 
|  | p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
|  | if (p != NULL) { | 
|  | if (milstr_cmp(np2oscfg.mpu.mdl, p)) { | 
|  | milstr_ncpy(np2oscfg.mpu.mdl, p, sizeof(np2oscfg.mpu.mdl)); | 
|  | update |= SYS_UPDATECFG | SYS_UPDATEMIDI; | 
|  | } | 
|  | g_free(p); | 
 | } | } | 
 | } | } | 
 |  |  | 
 | /* MIMPI def enable/file */ | /* MIMPI def enable/file */ | 
| enable = GTK_TOGGLE_BUTTON(mpu98_mimpi_def_checkbutton)->active ? 1 : 0; | enable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mpu98_mimpi_def_checkbutton)) ? 1 : 0; | 
 | if (np2oscfg.mpu.def_en != enable) { | if (np2oscfg.mpu.def_en != enable) { | 
 | np2oscfg.mpu.def_en = enable; | np2oscfg.mpu.def_en = enable; | 
 | if (cm_mpu98) { | if (cm_mpu98) { | 
| Line 125  ok_button_clicked(GtkButton *b, gpointer | Line 134  ok_button_clicked(GtkButton *b, gpointer | 
 | } | } | 
 | update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; | 
 | } | } | 
| p = gtk_entry_get_text(GTK_ENTRY(mpu98_mimpi_def_entry)); | utf8 = gtk_entry_get_text(GTK_ENTRY(mpu98_mimpi_def_entry)); | 
| if (p != NULL) { | if (utf8 != NULL) { | 
| if (milstr_cmp(np2oscfg.mpu.def, p)) { | p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
| milstr_ncpy(np2oscfg.mpu.def, p, sizeof(np2oscfg.mpu.def)); | if (p != NULL) { | 
| if (cm_mpu98) { | if (milstr_cmp(np2oscfg.mpu.def, p)) { | 
| (*cm_mpu98->msg)(cm_mpu98, COMMSG_MIMPIDEFFILE, (long)p); | milstr_ncpy(np2oscfg.mpu.def, p, sizeof(np2oscfg.mpu.def)); | 
|  | if (cm_mpu98) { | 
|  | (*cm_mpu98->msg)(cm_mpu98, COMMSG_MIMPIDEFFILE, (long)p); | 
|  | } | 
|  | update |= SYS_UPDATEOSCFG; | 
 | } | } | 
| update |= SYS_UPDATEOSCFG; | g_free(p); | 
 | } | } | 
 | } | } | 
 |  |  | 
 | /* MIDI-IN/OUT device */ | /* MIDI-IN/OUT device */ | 
 | for (i = 0; i < NELEMENTS(mpu98_devname_str); i++) { | for (i = 0; i < NELEMENTS(mpu98_devname_str); i++) { | 
| p = gtk_entry_get_text(GTK_ENTRY(mpu98_devname_entry[i])); | utf8 = gtk_entry_get_text(GTK_ENTRY(mpu98_devname_entry[i])); | 
| if (p != NULL) { | if (utf8 != NULL) { | 
| if (milstr_cmp(np2oscfg.MIDIDEV[i], p)) { | p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
| milstr_ncpy(np2oscfg.MIDIDEV[i], p, sizeof(np2oscfg.MIDIDEV[0])); | if (p != NULL) { | 
| update |= SYS_UPDATEOSCFG; | if (milstr_cmp(np2oscfg.MIDIDEV[i], p)) { | 
|  | milstr_ncpy(np2oscfg.MIDIDEV[i], p, sizeof(np2oscfg.MIDIDEV[0])); | 
|  | update |= SYS_UPDATEOSCFG; | 
|  | } | 
|  | g_free(p); | 
 | } | } | 
 | } | } | 
 | } | } | 
| Line 158  static void | Line 175  static void | 
 | dialog_destroy(GtkWidget *w, GtkWidget **wp) | dialog_destroy(GtkWidget *w, GtkWidget **wp) | 
 | { | { | 
 |  |  | 
 | UNUSED(wp); |  | 
 |  |  | 
 | install_idle_process(); | install_idle_process(); | 
 | gtk_widget_destroy(w); | gtk_widget_destroy(w); | 
 | } | } | 
| Line 167  dialog_destroy(GtkWidget *w, GtkWidget * | Line 182  dialog_destroy(GtkWidget *w, GtkWidget * | 
 | static void | static void | 
 | mpu98_ioport_entry_changed(GtkEditable *e, gpointer d) | mpu98_ioport_entry_changed(GtkEditable *e, gpointer d) | 
 | { | { | 
| const gchar *p; | const gchar *utf8; | 
|  | gchar *p; | 
 | BYTE val; | BYTE val; | 
 |  |  | 
| UNUSED(d); | utf8 = gtk_entry_get_text(GTK_ENTRY(e)); | 
| p = gtk_entry_get_text(GTK_ENTRY(e)); | if (utf8 != NULL) { | 
| if ((p != NULL) && (strlen(p) >= 4)) { | p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
| val = (milstr_solveHEX(p) >> 6) & 0xf0; | if (p != NULL) { | 
| mpuopt &= ~0xf0; | if (strlen(p) >= 4) { | 
| mpuopt |= val; | val = (milstr_solveHEX(p) >> 6) & 0xf0; | 
|  | mpuopt &= ~0xf0; | 
|  | mpuopt |= val; | 
|  | } | 
|  | g_free(p); | 
|  | } | 
 | } | } | 
 | } | } | 
 |  |  | 
 | static void | static void | 
 | mpu98_intr_entry_changed(GtkEditable *e, gpointer d) | mpu98_intr_entry_changed(GtkEditable *e, gpointer d) | 
 | { | { | 
| const gchar *p; | const gchar *utf8; | 
|  | gchar *p; | 
 | BYTE val; | BYTE val; | 
 |  |  | 
| UNUSED(d); | utf8 = gtk_entry_get_text(GTK_ENTRY(e)); | 
|  | if (utf8 != NULL) { | 
| p = gtk_entry_get_text(GTK_ENTRY(e)); | p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
| if ((p != NULL) && (strlen(p) >= 4)) { | if (p != NULL) { | 
| val = p[3] - '0'; | if (strlen(p) >= 4) { | 
| if (val >= 3) | val = p[3] - '0'; | 
| val = 3; | if (val >= 3) | 
| mpuopt &= ~0x03; | val = 3; | 
| mpuopt |= val; | mpuopt &= ~0x03; | 
|  | mpuopt |= val; | 
|  | } | 
|  | g_free(p); | 
|  | } | 
 | } | } | 
 | } | } | 
 |  |  | 
| Line 201  static void | Line 227  static void | 
 | mpu98_default_button_clicked(GtkButton *b, gpointer d) | mpu98_default_button_clicked(GtkButton *b, gpointer d) | 
 | { | { | 
 |  |  | 
 | UNUSED(b); |  | 
 | UNUSED(d); |  | 
 |  |  | 
 | gtk_entry_set_text(GTK_ENTRY(mpu98_ioport_entry), "E0D0"); | gtk_entry_set_text(GTK_ENTRY(mpu98_ioport_entry), "E0D0"); | 
 | gtk_entry_set_text(GTK_ENTRY(mpu98_intr_entry), "INT2"); | gtk_entry_set_text(GTK_ENTRY(mpu98_intr_entry), "INT2"); | 
 | } | } | 
| Line 216  mpu98_mimpi_def_button_clicked(GtkButton | Line 239  mpu98_mimpi_def_button_clicked(GtkButton | 
 | gchar *utf8, *path; | gchar *utf8, *path; | 
 | struct stat sb; | struct stat sb; | 
 |  |  | 
 | UNUSED(b); |  | 
 | UNUSED(d); |  | 
 |  |  | 
 | dialog = gtk_file_chooser_dialog_new("Open MIMPI define file", | dialog = gtk_file_chooser_dialog_new("Open MIMPI define file", | 
 | GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_OPEN, | GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_OPEN, | 
 | GTK_STOCK_OPEN, GTK_RESPONSE_OK, | GTK_STOCK_OPEN, GTK_RESPONSE_OK, | 
 | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 
 | NULL); | NULL); | 
 | if (dialog == NULL) | if (dialog == NULL) | 
| return; | goto end; | 
 |  |  | 
 | g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL); | 
 | gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); | 
| utf8 = g_filename_to_utf8(np2oscfg.mpu.def, -1, NULL, NULL, NULL); | if (np2oscfg.mpu.def[0] != '\0') { | 
| if (utf8) { | utf8 = g_filename_to_utf8(np2oscfg.mpu.def, -1, NULL, NULL, NULL); | 
| gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); | if (utf8) { | 
| g_free(utf8); | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8); | 
|  | g_free(utf8); | 
|  | } | 
 | } | } | 
 |  |  | 
 | filter = gtk_file_filter_new(); | filter = gtk_file_filter_new(); | 
| Line 249  mpu98_mimpi_def_button_clicked(GtkButton | Line 271  mpu98_mimpi_def_button_clicked(GtkButton | 
 | gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); | gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); | 
 | } | } | 
 |  |  | 
| if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { | if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK) | 
| utf8 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); | goto end; | 
| if (utf8) { |  | 
| path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | utf8 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); | 
| if (path) { | if (utf8) { | 
| if ((stat(path, &sb) == 0) && S_ISREG(sb.st_mode) && (sb.st_mode & S_IRUSR)) { | path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); | 
| gtk_entry_set_text(GTK_ENTRY(mpu98_mimpi_def_entry), utf8); | if (path) { | 
| } | if ((stat(path, &sb) == 0) && S_ISREG(sb.st_mode) && (sb.st_mode & S_IRUSR)) { | 
| g_free(path); | gtk_entry_set_text(GTK_ENTRY(mpu98_mimpi_def_entry), utf8); | 
 | } | } | 
| g_free(utf8); | g_free(path); | 
 | } | } | 
 |  | g_free(utf8); | 
 | } | } | 
| gtk_widget_destroy(dialog); |  | 
|  | end: | 
|  | if (dialog) | 
|  | gtk_widget_destroy(dialog); | 
 | } | } | 
 |  |  | 
 | void | void | 
| Line 290  create_midi_dialog(void) | Line 316  create_midi_dialog(void) | 
 | GtkWidget *ok_button; | GtkWidget *ok_button; | 
 | GtkWidget *cancel_button; | GtkWidget *cancel_button; | 
 | GtkWidget *mpu98_default_button; | GtkWidget *mpu98_default_button; | 
 |  | gchar *utf8; | 
 | int i; | int i; | 
 |  |  | 
 | uninstall_idle_process(); | uninstall_idle_process(); | 
| Line 301  create_midi_dialog(void) | Line 328  create_midi_dialog(void) | 
 | gtk_window_set_resizable(GTK_WINDOW(midi_dialog), FALSE); | gtk_window_set_resizable(GTK_WINDOW(midi_dialog), FALSE); | 
 |  |  | 
 | g_signal_connect(GTK_OBJECT(midi_dialog), "destroy", | g_signal_connect(GTK_OBJECT(midi_dialog), "destroy", | 
| GTK_SIGNAL_FUNC(dialog_destroy), NULL); | G_CALLBACK(dialog_destroy), NULL); | 
 |  |  | 
 | main_widget = gtk_table_new(10, 6, FALSE); | main_widget = gtk_table_new(10, 6, FALSE); | 
 | gtk_container_set_border_width(GTK_CONTAINER(main_widget), 5); | gtk_container_set_border_width(GTK_CONTAINER(main_widget), 5); | 
| Line 317  create_midi_dialog(void) | Line 344  create_midi_dialog(void) | 
 | 0, 1, 0, 1); | 0, 1, 0, 1); | 
 |  |  | 
 | ioport_combo = gtk_combo_box_entry_new_text(); | ioport_combo = gtk_combo_box_entry_new_text(); | 
 | gtk_widget_set_size_request(ioport_combo, 80, -1); |  | 
 | gtk_widget_show(ioport_combo); | gtk_widget_show(ioport_combo); | 
 | gtk_table_attach_defaults(GTK_TABLE(main_widget), ioport_combo, | gtk_table_attach_defaults(GTK_TABLE(main_widget), ioport_combo, | 
 | 1, 2, 0, 1); | 1, 2, 0, 1); | 
| Line 328  create_midi_dialog(void) | Line 354  create_midi_dialog(void) | 
 | mpu98_ioport_entry = GTK_BIN(ioport_combo)->child; | mpu98_ioport_entry = GTK_BIN(ioport_combo)->child; | 
 | gtk_widget_show(mpu98_ioport_entry); | gtk_widget_show(mpu98_ioport_entry); | 
 | g_signal_connect(GTK_OBJECT(mpu98_ioport_entry), "changed", | g_signal_connect(GTK_OBJECT(mpu98_ioport_entry), "changed", | 
| GTK_SIGNAL_FUNC(mpu98_ioport_entry_changed), NULL); | G_CALLBACK(mpu98_ioport_entry_changed), NULL); | 
 | gtk_editable_set_editable(GTK_EDITABLE(mpu98_ioport_entry), FALSE); | gtk_editable_set_editable(GTK_EDITABLE(mpu98_ioport_entry), FALSE); | 
 | gtk_entry_set_text(GTK_ENTRY(mpu98_ioport_entry), | gtk_entry_set_text(GTK_ENTRY(mpu98_ioport_entry), | 
 | mpu98_ioport_str[(np2cfg.mpuopt >> 4) & 0x0f]); | mpu98_ioport_str[(np2cfg.mpuopt >> 4) & 0x0f]); | 
| Line 342  create_midi_dialog(void) | Line 368  create_midi_dialog(void) | 
 | 0, 1, 1, 2); | 0, 1, 1, 2); | 
 |  |  | 
 | intr_combo = gtk_combo_box_entry_new_text(); | intr_combo = gtk_combo_box_entry_new_text(); | 
 | gtk_widget_set_size_request(intr_combo, 80, -1); |  | 
 | gtk_widget_show(intr_combo); | gtk_widget_show(intr_combo); | 
 | gtk_table_attach_defaults(GTK_TABLE(main_widget), intr_combo, | gtk_table_attach_defaults(GTK_TABLE(main_widget), intr_combo, | 
 | 1, 2, 1, 2); | 1, 2, 1, 2); | 
| Line 353  create_midi_dialog(void) | Line 378  create_midi_dialog(void) | 
 | mpu98_intr_entry = GTK_BIN(intr_combo)->child; | mpu98_intr_entry = GTK_BIN(intr_combo)->child; | 
 | gtk_widget_show(mpu98_intr_entry); | gtk_widget_show(mpu98_intr_entry); | 
 | g_signal_connect(GTK_OBJECT(mpu98_intr_entry), "changed", | g_signal_connect(GTK_OBJECT(mpu98_intr_entry), "changed", | 
| GTK_SIGNAL_FUNC(mpu98_intr_entry_changed), NULL); | G_CALLBACK(mpu98_intr_entry_changed), NULL); | 
 | gtk_editable_set_editable(GTK_EDITABLE(mpu98_intr_entry), FALSE); | gtk_editable_set_editable(GTK_EDITABLE(mpu98_intr_entry), FALSE); | 
 | gtk_entry_set_text(GTK_ENTRY(mpu98_intr_entry), | gtk_entry_set_text(GTK_ENTRY(mpu98_intr_entry), | 
 | mpu98_intr_str[np2cfg.mpuopt & 0x03]); | mpu98_intr_str[np2cfg.mpuopt & 0x03]); | 
| Line 385  create_midi_dialog(void) | Line 410  create_midi_dialog(void) | 
 | gtk_table_attach_defaults(GTK_TABLE(deviceframe_widget), | gtk_table_attach_defaults(GTK_TABLE(deviceframe_widget), | 
 | mpu98_devname_entry[i], 1, 6, i, i + 1); | mpu98_devname_entry[i], 1, 6, i, i + 1); | 
 |  |  | 
| gtk_entry_set_text(GTK_ENTRY(mpu98_devname_entry[i]), | if (np2oscfg.MIDIDEV[i][0] != '\0') { | 
| np2oscfg.MIDIDEV[i]); | utf8 = g_filename_to_utf8(np2oscfg.MIDIDEV[i], -1, NULL, NULL, NULL); | 
|  | if (utf8 != NULL) { | 
|  | gtk_entry_set_text(GTK_ENTRY(mpu98_devname_entry[i]), np2oscfg.MIDIDEV[i]); | 
|  | g_free(utf8); | 
|  | } | 
|  | } | 
 | } | } | 
 | /* MIDI-IN disable */ | /* MIDI-IN disable */ | 
 | gtk_widget_set_sensitive(mpu98_devname_entry[1], FALSE); | gtk_widget_set_sensitive(mpu98_devname_entry[1], FALSE); | 
| Line 512  create_midi_dialog(void) | Line 542  create_midi_dialog(void) | 
 | gtk_table_attach(GTK_TABLE(assignframe_widget), mpu98_mimpi_def_entry, | gtk_table_attach(GTK_TABLE(assignframe_widget), mpu98_mimpi_def_entry, | 
 | 0, 5, 4, 5, GTK_FILL, GTK_FILL, 3, 3); | 0, 5, 4, 5, GTK_FILL, GTK_FILL, 3, 3); | 
 | gtk_widget_set_sensitive(mpu98_mimpi_def_entry, FALSE); | gtk_widget_set_sensitive(mpu98_mimpi_def_entry, FALSE); | 
| gtk_entry_set_text(GTK_ENTRY(mpu98_mimpi_def_entry), np2oscfg.mpu.def); | if (np2oscfg.mpu.def[0] != '\0') { | 
|  | utf8 = g_filename_to_utf8(np2oscfg.mpu.def, -1, NULL, NULL, NULL); | 
|  | if (utf8 != NULL) { | 
|  | gtk_entry_set_text(GTK_ENTRY(mpu98_mimpi_def_entry), np2oscfg.mpu.def); | 
|  | g_free(utf8); | 
|  | } | 
|  | } | 
 |  |  | 
 | mimpi_button = gtk_button_new_with_label("..."); | mimpi_button = gtk_button_new_with_label("..."); | 
 | gtk_widget_show(mimpi_button); | gtk_widget_show(mimpi_button); | 
 | gtk_table_attach(GTK_TABLE(assignframe_widget), mimpi_button, | gtk_table_attach(GTK_TABLE(assignframe_widget), mimpi_button, | 
 | 5, 6, 4, 5, GTK_FILL, GTK_FILL, 3, 3); | 5, 6, 4, 5, GTK_FILL, GTK_FILL, 3, 3); | 
 | g_signal_connect(GTK_OBJECT(mimpi_button), "clicked", | g_signal_connect(GTK_OBJECT(mimpi_button), "clicked", | 
| GTK_SIGNAL_FUNC(mpu98_mimpi_def_button_clicked), 0); | G_CALLBACK(mpu98_mimpi_def_button_clicked), midi_dialog); | 
 |  |  | 
 | /* | /* | 
 | * "Default" button | * "Default" button | 
| Line 529  create_midi_dialog(void) | Line 565  create_midi_dialog(void) | 
 | gtk_table_attach(GTK_TABLE(main_widget), mpu98_default_button, | gtk_table_attach(GTK_TABLE(main_widget), mpu98_default_button, | 
 | 2, 3, 1, 2, GTK_SHRINK, GTK_SHRINK, 5, 5); | 2, 3, 1, 2, GTK_SHRINK, GTK_SHRINK, 5, 5); | 
 | g_signal_connect_swapped(GTK_OBJECT(mpu98_default_button), "clicked", | g_signal_connect_swapped(GTK_OBJECT(mpu98_default_button), "clicked", | 
| GTK_SIGNAL_FUNC(mpu98_default_button_clicked), NULL); | G_CALLBACK(mpu98_default_button_clicked), NULL); | 
 |  |  | 
 | /* | /* | 
 | * OK, Cancel button | * OK, Cancel button | 
| Line 544  create_midi_dialog(void) | Line 580  create_midi_dialog(void) | 
 | ok_button = gtk_button_new_from_stock(GTK_STOCK_OK); | ok_button = gtk_button_new_from_stock(GTK_STOCK_OK); | 
 | gtk_widget_show(ok_button); | gtk_widget_show(ok_button); | 
 | gtk_container_add(GTK_CONTAINER(confirm_widget), ok_button); | gtk_container_add(GTK_CONTAINER(confirm_widget), ok_button); | 
| GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT); | gtk_widget_set_can_default(ok_button, TRUE); | 
| GTK_WIDGET_SET_FLAGS(ok_button, GTK_HAS_DEFAULT); | gtk_widget_has_default(ok_button); | 
 | g_signal_connect(GTK_OBJECT(ok_button), "clicked", | g_signal_connect(GTK_OBJECT(ok_button), "clicked", | 
| GTK_SIGNAL_FUNC(ok_button_clicked), (gpointer)midi_dialog); | G_CALLBACK(ok_button_clicked), (gpointer)midi_dialog); | 
 | gtk_widget_grab_default(ok_button); | gtk_widget_grab_default(ok_button); | 
 |  |  | 
 | cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | 
 | gtk_widget_show(cancel_button); | gtk_widget_show(cancel_button); | 
 | gtk_container_add(GTK_CONTAINER(confirm_widget), cancel_button); | gtk_container_add(GTK_CONTAINER(confirm_widget), cancel_button); | 
| GTK_WIDGET_SET_FLAGS(cancel_button, GTK_CAN_DEFAULT); | gtk_widget_set_can_default(cancel_button, TRUE); | 
 | g_signal_connect_swapped(GTK_OBJECT(cancel_button), "clicked", | g_signal_connect_swapped(GTK_OBJECT(cancel_button), "clicked", | 
| GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(midi_dialog)); | G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(midi_dialog)); | 
 |  |  | 
 | gtk_widget_show_all(midi_dialog); | gtk_widget_show_all(midi_dialog); | 
 | } | } |