summaryrefslogtreecommitdiff
path: root/plugins/dfinput
diff options
context:
space:
mode:
authorStelios Tsampas <loathingkernel@gmail.com>2017-07-17 17:32:35 +0300
committerStelios Tsampas <loathingkernel@gmail.com>2017-07-17 17:32:35 +0300
commita96eefdf0f10a9a051e65f6e88a24dc3abe40fc5 (patch)
treec12847ff994c574a588f7b79a5720f322b9133ef /plugins/dfinput
parentaa295feb0d95d75f10f4ac097fdb1139428e1220 (diff)
downloadpcsxr-a96eefdf0f10a9a051e65f6e88a24dc3abe40fc5.tar.gz
* Bring pluing Linux(gtk) interfaces up to date.
Diffstat (limited to 'plugins/dfinput')
-rw-r--r--plugins/dfinput/Makefile.am26
-rwxr-xr-xplugins/dfinput/cfg-gtk.c4
-rw-r--r--plugins/dfinput/dfinput.ui160
3 files changed, 98 insertions, 92 deletions
diff --git a/plugins/dfinput/Makefile.am b/plugins/dfinput/Makefile.am
index 70f86fd1..11eee3eb 100644
--- a/plugins/dfinput/Makefile.am
+++ b/plugins/dfinput/Makefile.am
@@ -13,9 +13,29 @@ AM_CPPFLAGS = -DLOCALE_DIR=\"${datadir}/locale/\" \
-I../../include -I$(top_srcdir)/libpcsxcore $(SDL2_CFLAGS) $(SDL_CFLAGS)
bin_PROGRAMS = cfgDFInput
-cfgDFInput_SOURCES = cfg-gtk.c pad.h
+cfgDFInput_SOURCES = cfg-gtk.c pad.h GtkResources.c GtkResources.h
cfgDFInput_LDADD = $(GTK3_LIBS) $(SDL2_LIBS) $(SDL_LIBS) -lX11
-glade_DATA = dfinput.ui
-gladedir = $(datadir)/psemu/
+# gresource.xml is dynamically generated in CMake. Mirror that here in a static way.
+define gresource_xml =
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/pcsxr/dfinput">
+ <file>dfinput.ui</file>
+ </gresource>
+</gresources>
+endef
+
+dfinput.gresource.xml:
+ $(file >$@,$(gresource_xml))
+dfinput_gresource: dfinput.gresource.xml
+ $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/$<)
+GtkResources.c: dfinput.gresource.xml $(dfinput_gresource)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name dfinput $<
+GtkResources.h: dfinput.gresource.xml $(dfinput_gresource)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header --c-name dfinput $<
+
+
+#glade_DATA = dfinput.ui
+#gladedir = $(datadir)/psemu/
EXTRA_DIST = $(glade_DATA)
diff --git a/plugins/dfinput/cfg-gtk.c b/plugins/dfinput/cfg-gtk.c
index 5f26040f..61218cea 100755
--- a/plugins/dfinput/cfg-gtk.c
+++ b/plugins/dfinput/cfg-gtk.c
@@ -246,7 +246,6 @@ static void UpdateKeyList() {
gtk_tree_view_set_model(GTK_TREE_VIEW(widget), GTK_TREE_MODEL(store));
g_object_unref(G_OBJECT(store));
- gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(widget), TRUE);
gtk_widget_show(widget);
}
}
@@ -655,7 +654,7 @@ long PADconfigure() {
xml = gtk_builder_new();
- if (!gtk_builder_add_from_file(xml, DATADIR "dfinput.ui", NULL)) {
+ if (!gtk_builder_add_from_resource(xml, "/org/pcsxr/dfinput/dfinput.ui", NULL)) {
g_warning("We could not load the interface!");
return -1;
}
@@ -837,6 +836,7 @@ void PADabout() {
GtkWidget *widget;
widget = gtk_about_dialog_new();
+ gtk_about_dialog_set_logo_icon_name (GTK_ABOUT_DIALOG(widget), "help-about");
gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(widget), "Gamepad/Keyboard Input");
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(widget), "1.2");
gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(widget), authors);
diff --git a/plugins/dfinput/dfinput.ui b/plugins/dfinput/dfinput.ui
index 17dfbdb9..f189d8b3 100644
--- a/plugins/dfinput/dfinput.ui
+++ b/plugins/dfinput/dfinput.ui
@@ -1,23 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.19.0 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
+ <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>
<object class="GtkWindow" id="CfgWnd">
<property name="can_focus">False</property>
<child>
- <object class="GtkTable" id="table1">
+ <object class="GtkGrid" id="table1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
- <property name="n_rows">2</property>
<child>
<object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkGrid" id="grid1">
@@ -29,14 +64,12 @@
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Device:</property>
+ <property name="xalign">0</property>
</object>
<packing>
<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>
@@ -47,22 +80,18 @@
<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>
+ <property name="xalign">0</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>
@@ -80,8 +109,6 @@
<packing>
<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>
@@ -113,7 +140,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">5</property>
- <property name="window_placement_set">True</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTreeView" id="treeview1">
@@ -132,7 +158,7 @@
</packing>
</child>
<child>
- <object class="GtkHButtonBox" id="hbuttonbox2">
+ <object class="GtkButtonBox" id="hbuttonbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">20</property>
@@ -143,7 +169,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -151,7 +177,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-edit</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -186,7 +212,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -194,7 +220,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-undo</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -243,10 +269,11 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox2">
+ <object class="GtkBox" id="vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkGrid" id="grid2">
@@ -258,14 +285,12 @@
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Device:</property>
+ <property name="xalign">0</property>
</object>
<packing>
<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>
@@ -276,22 +301,18 @@
<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>
+ <property name="xalign">0</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>
@@ -309,8 +330,6 @@
<packing>
<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>
@@ -342,7 +361,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">5</property>
- <property name="window_placement_set">True</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTreeView" id="treeview2">
@@ -361,7 +379,7 @@
</packing>
</child>
<child>
- <object class="GtkHButtonBox" id="hbuttonbox3">
+ <object class="GtkButtonBox" id="hbuttonbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">20</property>
@@ -372,7 +390,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
- <object class="GtkHBox" id="hbox3">
+ <object class="GtkBox" id="hbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -380,7 +398,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-edit</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -415,7 +433,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
- <object class="GtkHBox" id="hbox4">
+ <object class="GtkBox" id="hbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -423,7 +441,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-undo</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -471,14 +489,16 @@
<property name="label" translatable="yes">Controller 2</property>
</object>
<packing>
+ <property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox_e">
+ <object class="GtkBox" id="vbox_e">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkGrid" id="grid_e">
@@ -490,14 +510,12 @@
<object class="GtkLabel" id="label_e2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Device:</property>
+ <property name="xalign">0</property>
</object>
<packing>
<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>
@@ -508,8 +526,6 @@
<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>
</object>
@@ -526,7 +542,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">5</property>
- <property name="window_placement_set">True</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTreeView" id="treeview_e">
@@ -545,7 +560,7 @@
</packing>
</child>
<child>
- <object class="GtkHButtonBox" id="hbuttonbox_e">
+ <object class="GtkButtonBox" id="hbuttonbox_e">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">20</property>
@@ -556,7 +571,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
- <object class="GtkHBox" id="hbox_e1">
+ <object class="GtkBox" id="hbox_e1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -564,7 +579,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-edit</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -599,7 +614,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
- <object class="GtkHBox" id="hbox_e2">
+ <object class="GtkBox" id="hbox_e2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -607,7 +622,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-undo</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -655,14 +670,16 @@
<property name="label" translatable="yes">Emulator keys</property>
</object>
<packing>
+ <property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkBox" id="vbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
+ <property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkCheckButton" id="checkmt">
@@ -726,9 +743,13 @@
</packing>
</child>
</object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
<child>
- <object class="GtkHButtonBox" id="dialog-action_area1">
+ <object class="GtkButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
@@ -748,46 +769,11 @@
</child>
</object>
<packing>
+ <property name="left_attach">0</property>
<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>