--- np2/x11/gtk2/dialog_midi.c 2004/07/15 15:46:24 1.2 +++ np2/x11/gtk2/dialog_midi.c 2011/01/15 18:43:13 1.7 @@ -1,5 +1,3 @@ -/* $Id: dialog_midi.c,v 1.2 2004/07/15 15:46:24 monaka Exp $ */ - /* * Copyright (c) 2003 NONAKA Kimihiro * All rights reserved. @@ -12,8 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * 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 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -89,8 +85,6 @@ ok_button_clicked(GtkButton *b, gpointer UINT update; int i; - UNUSED(b); - update = 0; if (np2cfg.mpuopt != mpuopt) { update |= SYS_UPDATECFG | SYS_UPDATEMIDI; @@ -179,8 +173,6 @@ static void dialog_destroy(GtkWidget *w, GtkWidget **wp) { - UNUSED(wp); - install_idle_process(); gtk_widget_destroy(w); } @@ -192,8 +184,6 @@ mpu98_ioport_entry_changed(GtkEditable * gchar *p; BYTE val; - UNUSED(d); - utf8 = gtk_entry_get_text(GTK_ENTRY(e)); if (utf8 != NULL) { p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); @@ -215,8 +205,6 @@ mpu98_intr_entry_changed(GtkEditable *e, gchar *p; BYTE val; - UNUSED(d); - utf8 = gtk_entry_get_text(GTK_ENTRY(e)); if (utf8 != NULL) { p = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL); @@ -237,9 +225,6 @@ static void 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_intr_entry), "INT2"); } @@ -252,9 +237,6 @@ mpu98_mimpi_def_button_clicked(GtkButton gchar *utf8, *path; struct stat sb; - UNUSED(b); - UNUSED(d); - dialog = gtk_file_chooser_dialog_new("Open MIMPI define file", GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_OPEN, GTK_RESPONSE_OK, @@ -344,7 +326,7 @@ create_midi_dialog(void) gtk_window_set_resizable(GTK_WINDOW(midi_dialog), FALSE); 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); gtk_container_set_border_width(GTK_CONTAINER(main_widget), 5); @@ -370,7 +352,7 @@ create_midi_dialog(void) mpu98_ioport_entry = GTK_BIN(ioport_combo)->child; gtk_widget_show(mpu98_ioport_entry); 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_entry_set_text(GTK_ENTRY(mpu98_ioport_entry), mpu98_ioport_str[(np2cfg.mpuopt >> 4) & 0x0f]); @@ -394,7 +376,7 @@ create_midi_dialog(void) mpu98_intr_entry = GTK_BIN(intr_combo)->child; gtk_widget_show(mpu98_intr_entry); 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_entry_set_text(GTK_ENTRY(mpu98_intr_entry), mpu98_intr_str[np2cfg.mpuopt & 0x03]); @@ -571,7 +553,7 @@ create_midi_dialog(void) gtk_table_attach(GTK_TABLE(assignframe_widget), mimpi_button, 5, 6, 4, 5, GTK_FILL, GTK_FILL, 3, 3); g_signal_connect(GTK_OBJECT(mimpi_button), "clicked", - GTK_SIGNAL_FUNC(mpu98_mimpi_def_button_clicked), midi_dialog); + G_CALLBACK(mpu98_mimpi_def_button_clicked), midi_dialog); /* * "Default" button @@ -581,7 +563,7 @@ create_midi_dialog(void) gtk_table_attach(GTK_TABLE(main_widget), mpu98_default_button, 2, 3, 1, 2, GTK_SHRINK, GTK_SHRINK, 5, 5); 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 @@ -596,18 +578,18 @@ create_midi_dialog(void) ok_button = gtk_button_new_from_stock(GTK_STOCK_OK); gtk_widget_show(ok_button); gtk_container_add(GTK_CONTAINER(confirm_widget), ok_button); - GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT); - GTK_WIDGET_SET_FLAGS(ok_button, GTK_HAS_DEFAULT); + gtk_widget_set_can_default(ok_button, TRUE); + gtk_widget_has_default(ok_button); 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); cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); gtk_widget_show(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", - 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); }