summaryrefslogtreecommitdiff
path: root/plugins/dfcdrom/cdrcfg-0.1df
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-26 06:41:17 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-26 06:41:17 +0000
commitacd164d56c60efd57a87c0cbe53fe6aee3be6696 (patch)
treef9de10a5ff2039170952a910920496a77ac825da /plugins/dfcdrom/cdrcfg-0.1df
parent9b9ad9958e1e373fa8804e5866e77d9f40b5d624 (diff)
downloadpcsxr-acd164d56c60efd57a87c0cbe53fe6aee3be6696.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@38248 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfcdrom/cdrcfg-0.1df')
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/callbacks.c210
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/callbacks.h18
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/cfg-gtk2.c62
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/cfgCdr.glade386
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/interface.c340
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/interface.h6
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/main.c43
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/support.c147
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/support.h44
9 files changed, 1256 insertions, 0 deletions
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/callbacks.c b/plugins/dfcdrom/cdrcfg-0.1df/callbacks.c
new file mode 100644
index 00000000..8330cd77
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/callbacks.c
@@ -0,0 +1,210 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef __linux__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <linux/cdrom.h>
+
+#include <gtk/gtk.h>
+
+#include "../cdr.h"
+#include "callbacks.h"
+#include "interface.h"
+#include "support.h"
+
+/* list of drives */
+GList * driveslist = NULL;
+
+/* private functions prototypes */
+void fill_drives_list(void);
+int is_cdrom(char *device);
+
+
+/***************************************************************************
+ * Config Dialog.
+ ***************************************************************************/
+
+void on_cfg_dialog_show (GtkWidget *widget, gpointer user_data)
+{
+ GtkWidget *devcombo;
+ GtkWidget *rmmenu;
+ GtkWidget *subQbtn;
+ GtkWidget *spinC;
+ GtkWidget *spinS;
+
+ LoadConf();
+ fill_drives_list();
+
+ devcombo = lookup_widget (GTK_WIDGET (widget), "cddev_combo");
+ rmmenu = lookup_widget (GTK_WIDGET (widget), "readmode_optionmenu");
+ subQbtn = lookup_widget (GTK_WIDGET (widget), "subQ_button");
+ spinC = lookup_widget (GTK_WIDGET (widget), "spinCacheSize");
+ spinS = lookup_widget (GTK_WIDGET (widget), "spinCdrSpeed");
+
+ /* show values */
+ gtk_combo_set_popdown_strings (GTK_COMBO (devcombo), driveslist);
+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (devcombo)->entry), CdromDev);
+ gtk_option_menu_set_history (GTK_OPTION_MENU (rmmenu), ReadMode);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (subQbtn), UseSubQ);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(spinC), (float)CacheSize);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(spinS), (float)CdrSpeed);
+
+ /* ??? is correct to free? it's a global... */
+ g_list_free(driveslist);
+}
+
+
+void on_cfg_cancelbutton_clicked (GtkButton *button, gpointer user_data)
+{
+ gtk_widget_destroy (gtk_widget_get_toplevel (GTK_WIDGET (button)));
+ gtk_main_quit();
+}
+
+
+void on_cfg_okbutton_clicked (GtkButton *button, gpointer user_data)
+{
+ GtkWidget *deventry;
+ GtkWidget *rmmenu;
+ GtkWidget *subQbtn;
+ GtkWidget *spinC;
+ GtkWidget *spinS;
+ char *tmp;
+
+ deventry = lookup_widget (GTK_WIDGET (button), "cddev_entry");
+ rmmenu = lookup_widget (GTK_WIDGET (button), "readmode_optionmenu");
+ subQbtn = lookup_widget (GTK_WIDGET (button), "subQ_button");
+ spinC = lookup_widget (GTK_WIDGET (button), "spinCacheSize");
+ spinS = lookup_widget (GTK_WIDGET (button), "spinCdrSpeed");
+
+ tmp = gtk_entry_get_text (GTK_ENTRY (deventry));
+ strcpy(CdromDev, tmp);
+ ReadMode = gtk_option_menu_get_history (GTK_OPTION_MENU(rmmenu));
+ UseSubQ = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(subQbtn));
+ CacheSize= gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(spinC));
+ CdrSpeed = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON(spinS));
+
+ SaveConf();
+
+ gtk_widget_destroy(gtk_widget_get_toplevel (GTK_WIDGET (button)));
+ gtk_main_quit();
+}
+
+
+/***************************************************************************
+ * About Dialog.
+ ***************************************************************************/
+
+void on_abt_okbutton_clicked (GtkButton *button, gpointer user_data)
+{
+ gtk_widget_destroy (gtk_widget_get_toplevel (GTK_WIDGET (button)));
+ gtk_main_quit();
+}
+
+
+/***************************************************************************
+ * Private functions.
+ ***************************************************************************/
+
+/*
+ * get_drives_list: retrieves available cd drives. At the moment it use a quite
+ * ugly "brute force" method: we check for the most common location for cdrom
+ * in /dev and chech if they are cdrom devices.
+ * If your cdrom path is not listed here you'll have to type it in the dialog
+ * entry yourself (or add it here and recompile).
+ * Are there any other common entry to add to the list? (especially scsi, I
+ * deliberately ignored old non standard cdroms... )
+ * If you come up with a better method let me know!!
+ */
+
+void fill_drives_list(void)
+{
+ int i = 0;
+ static char *cdrom_devices[]={
+ "/dev/cdrom",
+ "/dev/cdroms/cdrom0",
+ "/dev/cdroms/cdrom1",
+ "/dev/cdroms/cdrom2",
+ "/dev/cdroms/cdrom3",
+ "/dev/hda",
+ "/dev/hdb",
+ "/dev/hdc",
+ "/dev/hdd",
+ "/dev/scd0",
+ "/dev/scd1",
+ "/dev/scd2",
+ "/dev/scd3",
+ "/dev/optcd",
+ NULL};
+
+ /* fisrt we put our current drive */
+ driveslist = g_list_append(driveslist, CdromDev);
+
+ /* scan cdrom_devices for real cdrom and add them to driveslist */
+ while(cdrom_devices[i] != NULL){
+
+ /* check that is not our current dev (already in list) */
+ if (strcmp(cdrom_devices[i], CdromDev) != 0){
+
+ /* check that is a cdrom device */
+ if (is_cdrom(cdrom_devices[i])){
+ driveslist = g_list_append(driveslist, cdrom_devices[i]);
+ }
+ }
+ ++i;
+ }
+
+ return;
+}
+
+
+/* function to check if the device is a cdrom */
+int is_cdrom(char *device){
+ struct stat st;
+ int fd = -1;
+
+ /* check if the file exist */
+ if (stat(device, &st) <0) return 0;
+
+ /* check if is a block or char device */
+ if (!S_ISCHR(st.st_mode) && !S_ISBLK(st.st_mode)) return 0;
+
+ /* try to open the device file descriptor */
+ if ((fd = open(device, O_RDONLY | O_NONBLOCK)) < 0) return 0;
+
+ /* I need a method to check is a device is really a cdrom.
+ some problems/ideas are:
+ - different protocls (ide, scsi, old proprietary...)
+ - maybe we can use major number (see linux/major.h) to do some check.
+ major number can be retrieved with (st.st_rdev>>8)
+ scsi has SCSI_CDROM_MAJOR but does this cover all scsi drives?
+ beside IDE major is the same for hard disks and cdroms...
+ and DVDs?
+ - another idea is to parse /proc, but again IDE, scsi etc have
+ different files... I've not found a way to query "which cd drives
+ are available?"
+
+ Now I use this ioctl which works also if the drive is empty,
+ I hope that is implemented for all the drives... here works
+ fine: at least doesn't let me to select my HD as cds ;)
+ */
+ /* try a ioctl to see if it's a cdrom device */
+ if (ioctl(fd, CDROM_GET_CAPABILITY, NULL) < 0){
+ close(fd);
+ return 0;
+ }
+
+ close(fd);
+
+ /* yes, it seems a cd drive! */
+ return 1;
+}
+
+#endif
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/callbacks.h b/plugins/dfcdrom/cdrcfg-0.1df/callbacks.h
new file mode 100644
index 00000000..622914d9
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/callbacks.h
@@ -0,0 +1,18 @@
+#include <gtk/gtk.h>
+
+
+void
+on_cfg_dialog_show (GtkWidget *widget,
+ gpointer user_data);
+
+void
+on_cfg_cancelbutton_clicked (GtkButton *button,
+ gpointer user_data);
+
+void
+on_cfg_okbutton_clicked (GtkButton *button,
+ gpointer user_data);
+
+void
+on_abt_okbutton_clicked (GtkButton *button,
+ gpointer user_data);
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/cfg-gtk2.c b/plugins/dfcdrom/cdrcfg-0.1df/cfg-gtk2.c
new file mode 100644
index 00000000..4d9314e2
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/cfg-gtk2.c
@@ -0,0 +1,62 @@
+/*
+ * Cdrom for Psemu Pro like Emulators
+ *
+ * By: linuzappz <linuzappz@hotmail.com>
+ *
+ */
+
+#ifdef __linux__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <time.h>
+#include <string.h>
+
+#include "../cdr.h"
+
+void LoadConf() {
+ FILE *f;
+ char cfg[255];
+
+ strcpy(CdromDev, DEV_DEF);
+ ReadMode = THREADED;
+ UseSubQ = 0;
+ CacheSize = 64;
+ CdrSpeed = 0;
+
+ sprintf(cfg, "dfcdrom.cfg");
+ f = fopen(cfg, "r");
+ if (f == NULL) return;
+
+ fscanf(f, "CdromDev = %s\n", CdromDev);
+ fscanf(f, "ReadMode = %ld\n", &ReadMode);
+ fscanf(f, "UseSubQ = %ld\n", &UseSubQ);
+ fscanf(f, "CacheSize = %ld\n", &CacheSize);
+ fscanf(f, "CdrSpeed = %ld\n", &CdrSpeed);
+ fclose(f);
+
+ if (ReadMode >= READ_MODES) ReadMode = THREADED;
+ if (CacheSize <= 0) CacheSize = 32;
+ if (CacheSize > 2048) CacheSize = 2048;
+}
+
+void SaveConf() {
+ FILE *f;
+ char cfg[255];
+
+ sprintf(cfg, "dfcdrom.cfg");
+ f = fopen(cfg, "w");
+ if (f == NULL)
+ return;
+ fprintf(f, "CdromDev = %s\n", CdromDev);
+ fprintf(f, "ReadMode = %ld\n", ReadMode);
+ fprintf(f, "UseSubQ = %ld\n", UseSubQ);
+ fprintf(f, "CacheSize = %ld\n", CacheSize);
+ fprintf(f, "CdrSpeed = %ld\n", CdrSpeed);
+ fclose(f);
+}
+
+#endif
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/cfgCdr.glade b/plugins/dfcdrom/cdrcfg-0.1df/cfgCdr.glade
new file mode 100644
index 00000000..c926cf08
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/cfgCdr.glade
@@ -0,0 +1,386 @@
+<?xml version="1.0"?>
+<glade-interface>
+ <!-- interface-requires gtk+ 2.6 -->
+ <!-- interface-naming-policy toplevel-contextual -->
+ <widget class="GtkDialog" id="cfg_dialog">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">CDR configuration</property>
+ <property name="modal">True</property>
+ <property name="window_position">center</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <signal name="show" handler="on_cfg_dialog_show"/>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <widget class="GtkCombo" id="cddev_combo">
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <property name="enable_arrows_always">False</property>
+ <child internal-child="entry">
+ <widget class="GtkEntry" id="cddev_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">chose yor cdrom device or type its path if it's not listed</property>
+ <property name="activates_default">True</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child internal-child="list">
+ <widget class="GtkList" id="combo-list1">
+ <property name="visible">True</property>
+ <property name="selection_mode">browse</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="cdr_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Select cdrom device</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <child>
+ <widget class="GtkLabel" id="readmode_label">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="ypad">5</property>
+ <property name="label" translatable="yes">Select read mode:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkOptionMenu" id="readmode_optionmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="border_width">5</property>
+ </widget>
+ <packing>
+ <property name="padding">1</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator1">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="spacing">5</property>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Cache Size (Def. 64): </property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spinCacheSize">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">32 32 2048 1 16 16</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator2">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="spacing">5</property>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Cdrom Speed (Def. 0 = MAX): </property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spinCdrSpeed">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">0 0 100 1 4 4</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="cfg_hseparator">
+ <property name="visible">True</property>
+ <accessibility>
+ <atkproperty name="AtkObject::accessible-name" translatable="yes">hseparator</atkproperty>
+ </accessibility>
+ </widget>
+ <packing>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="subQ_button">
+ <property name="label" translatable="yes">Enable subchannel read</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="border_width">10</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="options_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Options</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="cfg_dialog-action_area">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <widget class="GtkButton" id="cfg_cancelbutton">
+ <property name="label">gtk-cancel</property>
+ <property name="response_id">-6</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_cfg_cancelbutton_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="cfg_okbutton">
+ <property name="label">gtk-ok</property>
+ <property name="response_id">-5</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_cfg_okbutton_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkDialog" id="abt_dialog">
+ <property name="width_request">300</property>
+ <property name="height_request">200</property>
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <property name="title" translatable="yes">About CDR</property>
+ <property name="window_position">center</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">normal</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="abt_dialog-vbox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="ypad">5</property>
+ <property name="label" translatable="yes">&lt;span size="xx-large"&gt;&lt;b&gt;CDR plugin&lt;/b&gt;&lt;/span&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="ypad">5</property>
+ <property name="label" translatable="yes">linux CDR plugin for Pcsx
+
+</property>
+ <property name="justify">fill</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xpad">5</property>
+ <property name="ypad">5</property>
+ <property name="label" translatable="yes">&lt;small&gt;(c) linuzappz linuzappz@hotmail.com
+ xobro _xobro_@tin.it&lt;/small&gt;
+</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="abt_dialog-action_area">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <widget class="GtkButton" id="abt_okbutton">
+ <property name="label">gtk-ok</property>
+ <property name="response_id">-5</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_abt_okbutton_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/interface.c b/plugins/dfcdrom/cdrcfg-0.1df/interface.c
new file mode 100644
index 00000000..3bb08af6
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/interface.c
@@ -0,0 +1,340 @@
+#include "config.h"
+
+#ifdef __linux__
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+
+#include "callbacks.h"
+#include "interface.h"
+#include "support.h"
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#define _(x) gettext(x)
+#else
+#define _(x) (x)
+#endif
+
+#define GLADE_HOOKUP_OBJECT(component,widget,name) \
+ g_object_set_data_full (G_OBJECT (component), name, \
+ gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
+
+#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
+ g_object_set_data (G_OBJECT (component), name, widget)
+
+GtkWidget*
+create_cfg_dialog (void)
+{
+ GtkWidget *cfg_dialog;
+ GtkWidget *dialog_vbox1;
+ GtkWidget *vbox1;
+ GtkWidget *frame1;
+ GtkWidget *cddev_combo;
+ GtkWidget *cddev_entry;
+ GtkWidget *cdr_label;
+ GtkWidget *frame2;
+ GtkWidget *vbox2;
+ GtkWidget *hbox1;
+ GtkWidget *readmode_label;
+ GtkWidget *readmode_optionmenu;
+ GtkWidget *menu1;
+ GtkWidget *normal;
+ GtkWidget *threaded;
+ GtkWidget *hseparator1;
+ GtkWidget *hbox2;
+ GtkWidget *label4;
+ GtkObject *spinCacheSize_adj;
+ GtkWidget *spinCacheSize;
+ GtkWidget *hseparator2;
+ GtkWidget *hbox3;
+ GtkWidget *label5;
+ GtkObject *spinCdrSpeed_adj;
+ GtkWidget *spinCdrSpeed;
+ GtkWidget *cfg_hseparator;
+ AtkObject *atko;
+ GtkWidget *subQ_button;
+ GtkWidget *options_label;
+ GtkWidget *cfg_dialog_action_area;
+ GtkWidget *cfg_cancelbutton;
+ GtkWidget *cfg_okbutton;
+ GtkTooltips *tooltips;
+
+ tooltips = gtk_tooltips_new ();
+
+ cfg_dialog = gtk_dialog_new ();
+ gtk_container_set_border_width (GTK_CONTAINER (cfg_dialog), 5);
+ gtk_window_set_title (GTK_WINDOW (cfg_dialog), _("CDR configuration"));
+ gtk_window_set_position (GTK_WINDOW (cfg_dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_modal (GTK_WINDOW (cfg_dialog), TRUE);
+ gtk_dialog_set_has_separator (GTK_DIALOG (cfg_dialog), FALSE);
+
+ dialog_vbox1 = GTK_DIALOG (cfg_dialog)->vbox;
+ gtk_widget_show (dialog_vbox1);
+
+ vbox1 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox1);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
+
+ frame1 = gtk_frame_new (NULL);
+ gtk_widget_show (frame1);
+ gtk_box_pack_start (GTK_BOX (vbox1), frame1, TRUE, TRUE, 0);
+
+ cddev_combo = gtk_combo_new ();
+ g_object_set_data (G_OBJECT (GTK_COMBO (cddev_combo)->popwin),
+ "GladeParentKey", cddev_combo);
+ gtk_widget_show (cddev_combo);
+ gtk_container_add (GTK_CONTAINER (frame1), cddev_combo);
+ gtk_container_set_border_width (GTK_CONTAINER (cddev_combo), 10);
+
+ cddev_entry = GTK_COMBO (cddev_combo)->entry;
+ gtk_widget_show (cddev_entry);
+ gtk_tooltips_set_tip (tooltips, cddev_entry, _("Choose your CD-ROM device or type its path if it's not listed"), NULL);
+ gtk_entry_set_activates_default (GTK_ENTRY (cddev_entry), TRUE);
+
+ cdr_label = gtk_label_new (_("Select CD-ROM device"));
+ gtk_widget_show (cdr_label);
+ gtk_frame_set_label_widget (GTK_FRAME (frame1), cdr_label);
+ gtk_label_set_justify (GTK_LABEL (cdr_label), GTK_JUSTIFY_LEFT);
+
+ frame2 = gtk_frame_new (NULL);
+ gtk_widget_show (frame2);
+ gtk_box_pack_start (GTK_BOX (vbox1), frame2, TRUE, TRUE, 0);
+
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox2);
+ gtk_container_add (GTK_CONTAINER (frame2), vbox2);
+
+ hbox1 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox1);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox1), 5);
+
+ readmode_label = gtk_label_new (_("Select read mode:"));
+ gtk_widget_show (readmode_label);
+ gtk_box_pack_start (GTK_BOX (hbox1), readmode_label, FALSE, FALSE, 0);
+ gtk_label_set_justify (GTK_LABEL (readmode_label), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_padding (GTK_MISC (readmode_label), 5, 5);
+
+ readmode_optionmenu = gtk_option_menu_new ();
+ gtk_widget_show (readmode_optionmenu);
+ gtk_box_pack_start (GTK_BOX (hbox1), readmode_optionmenu, TRUE, TRUE, 1);
+ gtk_container_set_border_width (GTK_CONTAINER (readmode_optionmenu), 5);
+
+ menu1 = gtk_menu_new ();
+
+ normal = gtk_menu_item_new_with_mnemonic (_("Normal (No Cache)"));
+ gtk_widget_show (normal);
+ gtk_container_add (GTK_CONTAINER (menu1), normal);
+
+ threaded = gtk_menu_item_new_with_mnemonic (_("Threaded - Faster (With Cache)"));
+ gtk_widget_show (threaded);
+ gtk_container_add (GTK_CONTAINER (menu1), threaded);
+
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (readmode_optionmenu), menu1);
+
+ hseparator1 = gtk_hseparator_new ();
+ gtk_widget_show (hseparator1);
+ gtk_box_pack_start (GTK_BOX (vbox2), hseparator1, TRUE, TRUE, 0);
+
+ hbox2 = gtk_hbox_new (FALSE, 5);
+ gtk_widget_show (hbox2);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox2), 5);
+
+ label4 = gtk_label_new (_("Cache Size (Def. 64): "));
+ gtk_widget_show (label4);
+ gtk_box_pack_start (GTK_BOX (hbox2), label4, FALSE, FALSE, 0);
+ gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
+
+// spinCacheSize_adj = gtk_adjustment_new (32, 32, 2048, 1, 16, 16);
+ spinCacheSize_adj = gtk_adjustment_new (32, 32, 2048, 1, 16, 0);
+ spinCacheSize = gtk_spin_button_new (GTK_ADJUSTMENT (spinCacheSize_adj), 1, 0);
+ gtk_widget_show (spinCacheSize);
+ gtk_box_pack_start (GTK_BOX (hbox2), spinCacheSize, TRUE, TRUE, 0);
+ gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinCacheSize), TRUE);
+
+ hseparator2 = gtk_hseparator_new ();
+ gtk_widget_show (hseparator2);
+ gtk_box_pack_start (GTK_BOX (vbox2), hseparator2, TRUE, TRUE, 0);
+
+ hbox3 = gtk_hbox_new (FALSE, 5);
+ gtk_widget_show (hbox3);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox3, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox3), 5);
+
+ label5 = gtk_label_new (_("Cdrom Speed (Def. 0 = MAX): "));
+ gtk_widget_show (label5);
+ gtk_box_pack_start (GTK_BOX (hbox3), label5, FALSE, FALSE, 0);
+ gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
+
+// spinCdrSpeed_adj = gtk_adjustment_new (0, 0, 100, 1, 4, 4);
+ spinCdrSpeed_adj = gtk_adjustment_new (0, 0, 100, 1, 4, 0);
+ spinCdrSpeed = gtk_spin_button_new (GTK_ADJUSTMENT (spinCdrSpeed_adj), 1, 0);
+ gtk_widget_show (spinCdrSpeed);
+ gtk_box_pack_start (GTK_BOX (hbox3), spinCdrSpeed, TRUE, TRUE, 0);
+ gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinCdrSpeed), TRUE);
+
+ cfg_hseparator = gtk_hseparator_new ();
+ gtk_widget_show (cfg_hseparator);
+ gtk_box_pack_start (GTK_BOX (vbox2), cfg_hseparator, TRUE, TRUE, 0);
+
+ subQ_button = gtk_check_button_new_with_mnemonic (_("Enable Subchannel read"));
+ gtk_widget_show (subQ_button);
+ gtk_box_pack_start (GTK_BOX (vbox2), subQ_button, FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (subQ_button), 10);
+
+ options_label = gtk_label_new (_("Options"));
+ gtk_widget_show (options_label);
+ gtk_frame_set_label_widget (GTK_FRAME (frame2), options_label);
+ gtk_label_set_justify (GTK_LABEL (options_label), GTK_JUSTIFY_LEFT);
+
+ cfg_dialog_action_area = GTK_DIALOG (cfg_dialog)->action_area;
+ gtk_widget_show (cfg_dialog_action_area);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (cfg_dialog_action_area), GTK_BUTTONBOX_END);
+
+ cfg_cancelbutton = gtk_button_new_from_stock ("gtk-cancel");
+ gtk_widget_show (cfg_cancelbutton);
+ gtk_dialog_add_action_widget (GTK_DIALOG (cfg_dialog), cfg_cancelbutton, GTK_RESPONSE_CANCEL);
+ GTK_WIDGET_SET_FLAGS (cfg_cancelbutton, GTK_CAN_DEFAULT);
+
+ cfg_okbutton = gtk_button_new_from_stock ("gtk-ok");
+ gtk_widget_show (cfg_okbutton);
+ gtk_dialog_add_action_widget (GTK_DIALOG (cfg_dialog), cfg_okbutton, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (cfg_okbutton, GTK_CAN_DEFAULT);
+
+ g_signal_connect ((gpointer) cfg_dialog, "show",
+ G_CALLBACK (on_cfg_dialog_show),
+ NULL);
+ g_signal_connect ((gpointer) cfg_cancelbutton, "clicked",
+ G_CALLBACK (on_cfg_cancelbutton_clicked),
+ NULL);
+ g_signal_connect ((gpointer) cfg_dialog, "delete_event",
+ G_CALLBACK (on_cfg_cancelbutton_clicked),
+ NULL);
+ g_signal_connect ((gpointer) cfg_okbutton, "clicked",
+ G_CALLBACK (on_cfg_okbutton_clicked),
+ NULL);
+
+ atko = gtk_widget_get_accessible (cfg_hseparator);
+ atk_object_set_name (atko, "hseparator");
+
+ /* Store pointers to all widgets, for use by lookup_widget(). */
+ GLADE_HOOKUP_OBJECT_NO_REF (cfg_dialog, cfg_dialog, "cfg_dialog");
+ GLADE_HOOKUP_OBJECT_NO_REF (cfg_dialog, dialog_vbox1, "dialog_vbox1");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, vbox1, "vbox1");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, frame1, "frame1");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, cddev_combo, "cddev_combo");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, cddev_entry, "cddev_entry");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, cdr_label, "cdr_label");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, frame2, "frame2");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, vbox2, "vbox2");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, hbox1, "hbox1");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, readmode_label, "readmode_label");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, readmode_optionmenu, "readmode_optionmenu");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, menu1, "menu1");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, normal, "normal");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, threaded, "threaded");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, hseparator1, "hseparator1");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, hbox2, "hbox2");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, label4, "label4");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, spinCacheSize, "spinCacheSize");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, hseparator2, "hseparator2");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, hbox3, "hbox3");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, label5, "label5");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, spinCdrSpeed, "spinCdrSpeed");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, cfg_hseparator, "cfg_hseparator");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, subQ_button, "subQ_button");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, options_label, "options_label");
+ GLADE_HOOKUP_OBJECT_NO_REF (cfg_dialog, cfg_dialog_action_area, "cfg_dialog_action_area");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, cfg_cancelbutton, "cfg_cancelbutton");
+ GLADE_HOOKUP_OBJECT (cfg_dialog, cfg_okbutton, "cfg_okbutton");
+ GLADE_HOOKUP_OBJECT_NO_REF (cfg_dialog, tooltips, "tooltips");
+
+ return cfg_dialog;
+}
+
+GtkWidget*
+create_abt_dialog (void)
+{
+ GtkWidget *abt_dialog;
+ GtkWidget *abt_dialog_vbox;
+ GtkWidget *vbox3;
+ GtkWidget *label3;
+ GtkWidget *label1;
+ GtkWidget *label2;
+ GtkWidget *abt_dialog_action_area;
+ GtkWidget *abt_okbutton;
+
+ abt_dialog = gtk_dialog_new ();
+ gtk_widget_set_size_request (abt_dialog, 300, 200);
+ gtk_container_set_border_width (GTK_CONTAINER (abt_dialog), 10);
+ gtk_window_set_title (GTK_WINDOW (abt_dialog), "About CDR");
+ gtk_window_set_position (GTK_WINDOW (abt_dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (abt_dialog), TRUE);
+
+ abt_dialog_vbox = GTK_DIALOG (abt_dialog)->vbox;
+ gtk_widget_show (abt_dialog_vbox);
+
+ vbox3 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox3);
+ gtk_box_pack_start (GTK_BOX (abt_dialog_vbox), vbox3, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox3), 10);
+
+ label3 = gtk_label_new ("<span size=\"xx-large\"><b>CDR plugin</b></span>");
+ gtk_widget_show (label3);
+ gtk_box_pack_start (GTK_BOX (vbox3), label3, FALSE, FALSE, 0);
+ gtk_label_set_use_markup (GTK_LABEL (label3), TRUE);
+ gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_padding (GTK_MISC (label3), 5, 5);
+
+ label1 = gtk_label_new ("linux CDR plugin for Pcsx\n\n");
+ gtk_widget_show (label1);
+ gtk_box_pack_start (GTK_BOX (vbox3), label1, FALSE, FALSE, 0);
+ gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_FILL);
+ gtk_misc_set_padding (GTK_MISC (label1), 5, 5);
+
+ label2 = gtk_label_new ("<small>(c) linuzappz linuzappz@hotmail.com\n xobro _xobro_@tin.it</small>\n");
+ gtk_widget_show (label2);
+ gtk_box_pack_start (GTK_BOX (vbox3), label2, FALSE, FALSE, 0);
+ gtk_label_set_use_markup (GTK_LABEL (label2), TRUE);
+ gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_padding (GTK_MISC (label2), 5, 5);
+
+ abt_dialog_action_area = GTK_DIALOG (abt_dialog)->action_area;
+ gtk_widget_show (abt_dialog_action_area);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (abt_dialog_action_area), GTK_BUTTONBOX_END);
+
+ abt_okbutton = gtk_button_new_from_stock ("gtk-ok");
+ gtk_widget_show (abt_okbutton);
+ gtk_dialog_add_action_widget (GTK_DIALOG (abt_dialog), abt_okbutton, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (abt_okbutton, GTK_CAN_DEFAULT);
+
+ g_signal_connect ((gpointer) abt_okbutton, "clicked",
+ G_CALLBACK (on_abt_okbutton_clicked),
+ NULL);
+ g_signal_connect ((gpointer) abt_dialog, "delete_event",
+ G_CALLBACK (on_abt_okbutton_clicked),
+ NULL);
+
+ /* Store pointers to all widgets, for use by lookup_widget(). */
+ GLADE_HOOKUP_OBJECT_NO_REF (abt_dialog, abt_dialog, "abt_dialog");
+ GLADE_HOOKUP_OBJECT_NO_REF (abt_dialog, abt_dialog_vbox, "abt_dialog_vbox");
+ GLADE_HOOKUP_OBJECT (abt_dialog, vbox3, "vbox3");
+ GLADE_HOOKUP_OBJECT (abt_dialog, label3, "label3");
+ GLADE_HOOKUP_OBJECT (abt_dialog, label1, "label1");
+ GLADE_HOOKUP_OBJECT (abt_dialog, label2, "label2");
+ GLADE_HOOKUP_OBJECT_NO_REF (abt_dialog, abt_dialog_action_area, "abt_dialog_action_area");
+ GLADE_HOOKUP_OBJECT (abt_dialog, abt_okbutton, "abt_okbutton");
+
+ return abt_dialog;
+}
+
+#endif
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/interface.h b/plugins/dfcdrom/cdrcfg-0.1df/interface.h
new file mode 100644
index 00000000..e23e1adb
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/interface.h
@@ -0,0 +1,6 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+GtkWidget* create_cfg_dialog (void);
+GtkWidget* create_abt_dialog (void);
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/main.c b/plugins/dfcdrom/cdrcfg-0.1df/main.c
new file mode 100644
index 00000000..3241561e
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/main.c
@@ -0,0 +1,43 @@
+#include <string.h>
+#include <gtk/gtk.h>
+
+#include "config.h"
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#endif
+
+#include "interface.h"
+#include "support.h"
+
+int main (int argc, char *argv[])
+{
+#ifdef __linux__
+ GtkWidget *cfg_dialog;
+ GtkWidget *abt_dialog;
+
+#ifdef ENABLE_NLS
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+#endif
+
+ gtk_set_locale ();
+ gtk_init (&argc, &argv);
+
+ if (argc != 2) return 0;
+
+ if (!strcmp(argv[1], "configure")) {
+ cfg_dialog = create_cfg_dialog ();
+ gtk_widget_show (cfg_dialog);
+ gtk_main ();
+ } else {
+ abt_dialog = create_abt_dialog ();
+ gtk_widget_show (abt_dialog);
+ gtk_main ();
+ }
+#endif
+ return 0;
+}
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/support.c b/plugins/dfcdrom/cdrcfg-0.1df/support.c
new file mode 100644
index 00000000..9da69992
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/support.c
@@ -0,0 +1,147 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef __linux__
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <gtk/gtk.h>
+
+#include "support.h"
+
+GtkWidget*
+lookup_widget (GtkWidget *widget,
+ const gchar *widget_name)
+{
+ GtkWidget *parent, *found_widget;
+
+ for (;;)
+ {
+ if (GTK_IS_MENU (widget))
+ parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
+ else
+ parent = widget->parent;
+ if (!parent)
+ parent = g_object_get_data (G_OBJECT (widget), "GladeParentKey");
+ if (parent == NULL)
+ break;
+ widget = parent;
+ }
+
+ found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
+ widget_name);
+ if (!found_widget)
+ g_warning ("Widget not found: %s", widget_name);
+ return found_widget;
+}
+
+static GList *pixmaps_directories = NULL;
+
+/* Use this function to set the directory containing installed pixmaps. */
+void
+add_pixmap_directory (const gchar *directory)
+{
+ pixmaps_directories = g_list_prepend (pixmaps_directories,
+ g_strdup (directory));
+}
+
+/* This is an internally used function to find pixmap files. */
+static gchar*
+find_pixmap_file (const gchar *filename)
+{
+ GList *elem;
+
+ /* We step through each of the pixmaps directory to find it. */
+ elem = pixmaps_directories;
+ while (elem)
+ {
+ gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
+ G_DIR_SEPARATOR_S, filename);
+ if (g_file_test (pathname, G_FILE_TEST_EXISTS))
+ return pathname;
+ g_free (pathname);
+ elem = elem->next;
+ }
+ return NULL;
+}
+
+/* This is an internally used function to create pixmaps. */
+GtkWidget*
+create_pixmap (GtkWidget *widget,
+ const gchar *filename)
+{
+ gchar *pathname = NULL;
+ GtkWidget *pixmap;
+
+ if (!filename || !filename[0])
+ return gtk_image_new ();
+
+ pathname = find_pixmap_file (filename);
+
+ if (!pathname)
+ {
+ g_warning ("Couldn't find pixmap file: %s", filename);
+ return gtk_image_new ();
+ }
+
+ pixmap = gtk_image_new_from_file (pathname);
+ g_free (pathname);
+ return pixmap;
+}
+
+/* This is an internally used function to create pixmaps. */
+GdkPixbuf*
+create_pixbuf (const gchar *filename)
+{
+ gchar *pathname = NULL;
+ GdkPixbuf *pixbuf;
+ GError *error = NULL;
+
+ if (!filename || !filename[0])
+ return NULL;
+
+ pathname = find_pixmap_file (filename);
+
+ if (!pathname)
+ {
+ g_warning ("Couldn't find pixmap file: %s", filename);
+ return NULL;
+ }
+
+ pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
+ if (!pixbuf)
+ {
+ fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
+ pathname, error->message);
+ g_error_free (error);
+ }
+ g_free (pathname);
+ return pixbuf;
+}
+
+/* This is used to set ATK action descriptions. */
+void
+glade_set_atk_action_description (AtkAction *action,
+ const gchar *action_name,
+ const gchar *description)
+{
+ gint n_actions, i;
+
+ n_actions = atk_action_get_n_actions (action);
+ for (i = 0; i < n_actions; i++)
+ {
+ if (!strcmp (atk_action_get_name (action, i), action_name))
+ atk_action_set_description (action, i, description);
+ }
+}
+
+#endif
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/support.h b/plugins/dfcdrom/cdrcfg-0.1df/support.h
new file mode 100644
index 00000000..2dea079c
--- /dev/null
+++ b/plugins/dfcdrom/cdrcfg-0.1df/support.h
@@ -0,0 +1,44 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+/*
+ * Public Functions.
+ */
+
+/*
+ * This function returns a widget in a component created by Glade.
+ * Call it with the toplevel widget in the component (i.e. a window/dialog),
+ * or alternatively any widget in the component, and the name of the widget
+ * you want returned.
+ */
+GtkWidget* lookup_widget (GtkWidget *widget,
+ const gchar *widget_name);
+
+
+/* Use this function to set the directory containing installed pixmaps. */
+void add_pixmap_directory (const gchar *directory);
+
+
+/*
+ * Private Functions.
+ */
+
+/* This is used to create the pixmaps used in the interface. */
+GtkWidget* create_pixmap (GtkWidget *widget,
+ const gchar *filename);
+
+/* This is used to create the pixbufs used in the interface. */
+GdkPixbuf* create_pixbuf (const gchar *filename);
+
+/* This is used to set ATK action descriptions. */
+void glade_set_atk_action_description (AtkAction *action,
+ const gchar *action_name,
+ const gchar *description);
+