diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-11-20 21:01:10 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-11-20 21:01:10 +0000 |
| commit | 5883ee6487832da502dd004bf6a06085d50c30ed (patch) | |
| tree | cc2dbb4bdeeab95122d625d15c33a3a93f5f9851 /plugins/dfinput | |
| parent | aae41a8f9e07d449dc3bce6f9b8d1e7ad54025d1 (diff) | |
gtk3 (thanks to Rafał Mużyło);
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@81326 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfinput')
| -rw-r--r-- | plugins/dfinput/Makefile.am | 4 | ||||
| -rwxr-xr-x | plugins/dfinput/cfg-gtk2.c | 32 | ||||
| -rw-r--r-- | plugins/dfinput/dfinput.ui | 329 |
3 files changed, 163 insertions, 202 deletions
diff --git a/plugins/dfinput/Makefile.am b/plugins/dfinput/Makefile.am index f4926905..55016cb0 100644 --- a/plugins/dfinput/Makefile.am +++ b/plugins/dfinput/Makefile.am @@ -9,12 +9,12 @@ libDFInput_la_LIBADD = -lpthread -lX11 $(SDL_LIBS) AM_CPPFLAGS = -DLOCALE_DIR=\"${datadir}/locale/\" \ -DDATADIR=\"${datadir}/psemu/\" \ - $(GTK2_CFLAGS) \ + $(GTK3_CFLAGS) \ -I../../include -I../../libpcsxcore $(SDL_CFLAGS) bin_PROGRAMS = cfgDFInput cfgDFInput_SOURCES = cfg-gtk2.c pad.h -cfgDFInput_LDADD = $(GTK2_LIBS) $(SDL_LIBS) -lX11 +cfgDFInput_LDADD = $(GTK3_LIBS) $(SDL_LIBS) -lX11 glade_DATA = dfinput.ui gladedir = $(datadir)/psemu/ diff --git a/plugins/dfinput/cfg-gtk2.c b/plugins/dfinput/cfg-gtk2.c index 18f746d3..941d7848 100755 --- a/plugins/dfinput/cfg-gtk2.c +++ b/plugins/dfinput/cfg-gtk2.c @@ -261,7 +261,7 @@ static void OnConfigExit(GtkWidget *widget, gpointer user_data) { SDL_Quit(); XCloseDisplay(g.Disp); - gtk_exit(0); + exit(0); } static void TreeSelectionChanged(GtkTreeSelection *selection, gpointer user_data) { @@ -663,11 +663,11 @@ long PADconfigure() { G_CALLBACK(TreeSelectionChanged), (gpointer)1, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "CfgWnd"); - g_signal_connect_data(GTK_OBJECT(widget), "delete_event", + g_signal_connect_data(G_OBJECT(widget), "delete_event", G_CALLBACK(OnConfigExit), NULL, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "btnclose"); - g_signal_connect_data(GTK_OBJECT(widget), "clicked", + g_signal_connect_data(G_OBJECT(widget), "clicked", G_CALLBACK(OnConfigExit), NULL, NULL, G_CONNECT_AFTER); PopulateDevList(); @@ -675,7 +675,7 @@ long PADconfigure() { widget = gtk_builder_get_object(xml, "checkmt"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), g.cfg.Threaded); - g_signal_connect_data(GTK_OBJECT(widget), "toggled", + g_signal_connect_data(G_OBJECT(widget), "toggled", G_CALLBACK(OnThreadedToggled), NULL, NULL, G_CONNECT_AFTER); /* @@ -685,11 +685,11 @@ long PADconfigure() { G_CALLBACK(OnHideCursorToggled), NULL, NULL, G_CONNECT_AFTER); */ widget = gtk_builder_get_object(xml, "combodev1"); - g_signal_connect_data(GTK_OBJECT(widget), "changed", + g_signal_connect_data(G_OBJECT(widget), "changed", G_CALLBACK(OnDeviceChanged), (gpointer)0, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "combodev2"); - g_signal_connect_data(GTK_OBJECT(widget), "changed", + g_signal_connect_data(G_OBJECT(widget), "changed", G_CALLBACK(OnDeviceChanged), (gpointer)1, NULL, G_CONNECT_AFTER); int padTypeList[] = { @@ -706,43 +706,43 @@ long PADconfigure() { widget = gtk_builder_get_object(xml, "combotype1"); gtk_combo_box_set_active(GTK_COMBO_BOX(widget), padTypeList[g.cfg.PadDef[0].Type]); - g_signal_connect_data(GTK_OBJECT(widget), "changed", + g_signal_connect_data(G_OBJECT(widget), "changed", G_CALLBACK(OnTypeChanged), (gpointer)0, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "combotype2"); gtk_combo_box_set_active(GTK_COMBO_BOX(widget), padTypeList[g.cfg.PadDef[1].Type]); - g_signal_connect_data(GTK_OBJECT(widget), "changed", + g_signal_connect_data(G_OBJECT(widget), "changed", G_CALLBACK(OnTypeChanged), (gpointer)1, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "checkvv1"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), g.cfg.PadDef[0].VisualVibration); - g_signal_connect_data(GTK_OBJECT(widget), "toggled", + g_signal_connect_data(G_OBJECT(widget), "toggled", G_CALLBACK(OnVisualVibration1Toggled), NULL, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "checkvv2"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), g.cfg.PadDef[1].VisualVibration); - g_signal_connect_data(GTK_OBJECT(widget), "toggled", + g_signal_connect_data(G_OBJECT(widget), "toggled", G_CALLBACK(OnVisualVibration2Toggled), NULL, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "btnchange1"); gtk_widget_set_sensitive(widget, FALSE); - g_signal_connect_data(GTK_OBJECT(widget), "clicked", + g_signal_connect_data(G_OBJECT(widget), "clicked", G_CALLBACK(OnChangeClicked), (gpointer)0, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "btnreset1"); gtk_widget_set_sensitive(widget, FALSE); - g_signal_connect_data(GTK_OBJECT(widget), "clicked", + g_signal_connect_data(G_OBJECT(widget), "clicked", G_CALLBACK(OnResetClicked), (gpointer)0, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "btnchange2"); gtk_widget_set_sensitive(widget, FALSE); - g_signal_connect_data(GTK_OBJECT(widget), "clicked", + g_signal_connect_data(G_OBJECT(widget), "clicked", G_CALLBACK(OnChangeClicked), (gpointer)1, NULL, G_CONNECT_AFTER); widget = gtk_builder_get_object(xml, "btnreset2"); gtk_widget_set_sensitive(widget, FALSE); - g_signal_connect_data(GTK_OBJECT(widget), "clicked", + g_signal_connect_data(G_OBJECT(widget), "clicked", G_CALLBACK(OnResetClicked), (gpointer)1, NULL, G_CONNECT_AFTER); gtk_widget_show(MainWindow); @@ -756,7 +756,7 @@ void PADabout() { GtkWidget *widget; widget = gtk_about_dialog_new(); - gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(widget), "Gamepad/Keyboard Input"); + gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(widget), "Gamepad/Keyboard Input"); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(widget), "1.1"); gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(widget), authors); gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(widget), "http://www.codeplex.com/pcsxr/"); @@ -773,7 +773,6 @@ int main(int argc, char *argv[]) { textdomain(GETTEXT_PACKAGE); #endif - gtk_set_locale(); gtk_init(&argc, &argv); if (argc > 1 && !strcmp(argv[1], "-about")) { @@ -782,6 +781,5 @@ int main(int argc, char *argv[]) { PADconfigure(); } - gtk_exit(0); return 0; } diff --git a/plugins/dfinput/dfinput.ui b/plugins/dfinput/dfinput.ui index 8151622a..7adb6277 100644 --- a/plugins/dfinput/dfinput.ui +++ b/plugins/dfinput/dfinput.ui @@ -1,41 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> - <requires lib="gtk+" version="2.16"/> - <!-- interface-naming-policy project-wide --> - <object class="GtkListStore" id="liststore1"> - <columns> - <!-- column-name item --> - <column type="gchararray"/> - </columns> - <data> - <row> - <col id="0" translatable="yes">Digital Pad</col> - </row> - <row> - <col id="0" translatable="yes">Analog Pad</col> - </row> - <row> - <col id="0" translatable="yes">Mouse</col> - </row> - </data> - </object> - <object class="GtkListStore" id="liststore2"> - <columns> - <!-- column-name item --> - <column type="gchararray"/> - </columns> - <data> - <row> - <col id="0" translatable="yes">Digital Pad</col> - </row> - <row> - <col id="0" translatable="yes">Analog Pad</col> - </row> - <row> - <col id="0" translatable="yes">Mouse</col> - </row> - </data> - </object> + <!-- interface-requires gtk+ 3.0 --> <object class="GtkWindow" id="CfgWnd"> <property name="can_focus">False</property> <child> @@ -52,104 +17,87 @@ <object class="GtkVBox" id="vbox1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="border_width">5</property> <property name="spacing">2</property> <child> - <object class="GtkHButtonBox" id="hbuttonbox1"> + <object class="GtkGrid" id="grid1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="row_spacing">5</property> + <property name="column_spacing">5</property> <child> - <object class="GtkHBox" id="hbox6"> + <object class="GtkLabel" id="label10"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">10</property> - <child> - <object class="GtkLabel" id="label10"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Device:</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="combodev1"> - <property name="width_request">150</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> + <property name="xalign">0</property> + <property name="label" translatable="yes">Device:</property> </object> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> - <object class="GtkHBox" id="hbox5"> + <object class="GtkComboBox" id="combodev1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">10</property> - <child> - <object class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Type:</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Type:</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="combotype1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="model">liststore2</property> <child> - <object class="GtkComboBox" id="combotype1"> - <property name="width_request">200</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="model">liststore2</property> - <child> - <object class="GtkCellRendererText" id="cellrenderertext2"/> - <attributes> - <attribute name="text">0</attribute> - </attributes> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> + <object class="GtkCellRendererText" id="cellrenderertext2"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> </object> <packing> <property name="expand">False</property> - <property name="fill">False</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkCheckButton" id="checkvv1"> <property name="label" translatable="yes">Visual vibration</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> <packing> @@ -160,19 +108,20 @@ </child> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="width_request">500</property> + <property name="height_request">275</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="border_width">5</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> <property name="window_placement_set">True</property> <property name="shadow_type">etched-in</property> <child> <object class="GtkTreeView" id="treeview1"> - <property name="width_request">500</property> - <property name="height_request">275</property> <property name="visible">True</property> <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> </object> </child> </object> @@ -190,7 +139,6 @@ <property name="layout_style">center</property> <child> <object class="GtkButton" id="btnchange1"> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -234,7 +182,6 @@ </child> <child> <object class="GtkButton" id="btnreset1"> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -278,7 +225,7 @@ </child> </object> <packing> - <property name="expand">True</property> + <property name="expand">False</property> <property name="fill">True</property> <property name="position">3</property> </packing> @@ -299,104 +246,87 @@ <object class="GtkVBox" id="vbox2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="border_width">5</property> <property name="spacing">2</property> <child> - <object class="GtkHButtonBox" id="hbuttonbox4"> + <object class="GtkGrid" id="grid2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="row_spacing">5</property> + <property name="column_spacing">5</property> <child> - <object class="GtkHBox" id="hbox8"> + <object class="GtkLabel" id="label11"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">10</property> - <child> - <object class="GtkLabel" id="label11"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Device:</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="combodev2"> - <property name="width_request">150</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> + <property name="xalign">0</property> + <property name="label" translatable="yes">Device:</property> </object> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> <child> - <object class="GtkHBox" id="hbox7"> + <object class="GtkComboBox" id="combodev2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">10</property> - <child> - <object class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Type:</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Type:</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="combotype2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="model">liststore1</property> <child> - <object class="GtkComboBox" id="combotype2"> - <property name="width_request">200</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="model">liststore1</property> - <child> - <object class="GtkCellRendererText" id="cellrenderertext1"/> - <attributes> - <attribute name="text">0</attribute> - </attributes> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> + <object class="GtkCellRendererText" id="cellrenderertext1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> </packing> </child> </object> <packing> <property name="expand">False</property> - <property name="fill">False</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkCheckButton" id="checkvv2"> <property name="label" translatable="yes">Visual vibration</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> <packing> @@ -407,19 +337,20 @@ </child> <child> <object class="GtkScrolledWindow" id="scrolledwindow2"> + <property name="width_request">500</property> + <property name="height_request">275</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="border_width">5</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> <property name="window_placement_set">True</property> <property name="shadow_type">etched-in</property> <child> <object class="GtkTreeView" id="treeview2"> - <property name="width_request">500</property> - <property name="height_request">275</property> <property name="visible">True</property> <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection2"/> + </child> </object> </child> </object> @@ -437,7 +368,6 @@ <property name="layout_style">center</property> <child> <object class="GtkButton" id="btnchange2"> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -481,7 +411,6 @@ </child> <child> <object class="GtkButton" id="btnreset2"> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -555,10 +484,10 @@ <child> <object class="GtkCheckButton" id="checkmt"> <property name="label" translatable="yes">Multi-Threaded (Recommended)</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> <packing> @@ -593,7 +522,6 @@ <child> <object class="GtkButton" id="btnclose"> <property name="label">gtk-close</property> - <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -609,9 +537,44 @@ <packing> <property name="top_attach">1</property> <property name="bottom_attach">2</property> + <property name="y_options">GTK_FILL</property> </packing> </child> </object> </child> </object> + <object class="GtkListStore" id="liststore1"> + <columns> + <!-- column-name item --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">Digital Pad</col> + </row> + <row> + <col id="0" translatable="yes">Analog Pad</col> + </row> + <row> + <col id="0" translatable="yes">Mouse</col> + </row> + </data> + </object> + <object class="GtkListStore" id="liststore2"> + <columns> + <!-- column-name item --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">Digital Pad</col> + </row> + <row> + <col id="0" translatable="yes">Analog Pad</col> + </row> + <row> + <col id="0" translatable="yes">Mouse</col> + </row> + </data> + </object> </interface> |
