mirror of https://github.com/PCSX2/pcsx2.git
CDVDiso: Add the ability to create block dumps to the Linux port.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@449 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
5ad9f85500
commit
d0490889d4
|
@ -179,13 +179,14 @@ EXPORT_C(s32) CDVDopen(const char* pTitle)
|
|||
if (BlockDump)
|
||||
{
|
||||
char fname_only[MAX_PATH];
|
||||
char* p, *plast;
|
||||
|
||||
#ifdef _WIN32
|
||||
char fname[MAX_PATH], ext[MAX_PATH];
|
||||
_splitpath(IsoFile, NULL, NULL, fname, ext);
|
||||
_makepath(fname_only, NULL, NULL, fname, NULL);
|
||||
#else
|
||||
char* p, *plast;
|
||||
|
||||
plast = p = strchr(IsoFile, '/');
|
||||
while (p != NULL)
|
||||
{
|
||||
|
@ -193,11 +194,13 @@ EXPORT_C(s32) CDVDopen(const char* pTitle)
|
|||
p = strchr(p + 1, '/');
|
||||
}
|
||||
|
||||
// Lets not create dumps in the plugin directory.
|
||||
strcpy(fname_only, "../");
|
||||
if (plast != NULL)
|
||||
strcpy(fname_only, plast + 1);
|
||||
strcat(fname_only, plast + 1);
|
||||
else
|
||||
strcpy(fname_only, IsoFile);
|
||||
|
||||
strcat(fname_only, IsoFile);
|
||||
|
||||
plast = p = strchr(fname_only, '.');
|
||||
|
||||
while (p != NULL)
|
||||
|
|
|
@ -358,6 +358,25 @@
|
|||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkBlockDump">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Create a dump of the running iso</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -48,7 +48,7 @@ void LoadConf()
|
|||
|
||||
fscanf(f, "IsoFile = %[^\n]\n", IsoFile);
|
||||
fscanf(f, "CdDev = %[^\n]\n", CdDev);
|
||||
fscanf(f, "BlockDump = %[^\n]\n", &BlockDump);
|
||||
fscanf(f, "BlockDump = %d\n", &BlockDump);
|
||||
|
||||
if (!strncmp(IsoFile, "CdDev =", 9)) *IsoFile = 0; // quick fix
|
||||
if (*CdDev == 0) strcpy(CdDev, CDDEV_DEF);
|
||||
|
@ -76,7 +76,7 @@ void SaveConf()
|
|||
|
||||
fprintf(f, "IsoFile = %s\n", IsoFile);
|
||||
fprintf(f, "CdDev = %s\n", CdDev);
|
||||
fprintf(f, "BlockDump = %s\n", &BlockDump);
|
||||
fprintf(f, "BlockDump = %d\n", BlockDump);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,74 +1,74 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
|
||||
|
||||
void
|
||||
OnFileSel (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnStop (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCompress (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnDecompress (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCreate (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCreateZ (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnOk (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCancel (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
|
||||
|
||||
void
|
||||
OnFileSel (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnStop (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCompress (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnDecompress (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCreate (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCreateZ (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnOk (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
OnCancel (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
void
|
||||
OnFileSel (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnStop (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCompress (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnDecompress (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCreate (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCreateZ (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnOk (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCancel (GtkButton *button,
|
||||
gpointer user_data);
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
void
|
||||
OnFileSel (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnStop (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCompress (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnDecompress (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCreate (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCreateZ (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnOk (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
OnCancel (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
|
|
@ -35,6 +35,11 @@
|
|||
#include "CDVDiso.h"
|
||||
#include "Config.h"
|
||||
|
||||
|
||||
// Make it easier to check and set checkmarks in the gui
|
||||
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
||||
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
||||
|
||||
unsigned char Zbuf[CD_FRAMESIZE_RAW * 10 * 2];
|
||||
|
||||
extern char *LibName;
|
||||
|
@ -162,6 +167,12 @@ void OnOk(GtkMenuItem * menuitem, gpointer userdata)
|
|||
strcpy(IsoFile, tmp);
|
||||
tmp = gtk_entry_get_text(GTK_ENTRY(CdEdit));
|
||||
strcpy(CdDev, tmp);
|
||||
|
||||
if is_checked(ConfDlg, "checkBlockDump")
|
||||
BlockDump = 1;
|
||||
else
|
||||
BlockDump = 0;
|
||||
|
||||
SaveConf();
|
||||
gtk_widget_destroy(ConfDlg);
|
||||
gtk_main_quit();
|
||||
|
@ -323,8 +334,12 @@ void OnDecompress()
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (Zmode == 1) c = s = buf.st_size / 6;
|
||||
else c = s = (buf.st_size / 4) - 1;
|
||||
|
||||
if (Zmode == 1)
|
||||
c = s = buf.st_size / 6;
|
||||
else
|
||||
c = s = (buf.st_size / 4) - 1;
|
||||
|
||||
f = fopen(table, "rb");
|
||||
Ztable = (char*)malloc(buf.st_size);
|
||||
fread(Ztable, 1, buf.st_size, f);
|
||||
|
@ -336,8 +351,10 @@ void OnDecompress()
|
|||
return;
|
||||
}
|
||||
|
||||
if (Zmode == 1) IsoFile[strlen(IsoFile) - 2] = 0;
|
||||
else IsoFile[strlen(IsoFile) - 3] = 0;
|
||||
if (Zmode == 1)
|
||||
IsoFile[strlen(IsoFile) - 2] = 0;
|
||||
else
|
||||
IsoFile[strlen(IsoFile) - 3] = 0;
|
||||
|
||||
f = fopen(IsoFile, "wb");
|
||||
if (f == NULL)
|
||||
|
@ -383,16 +400,20 @@ void OnDecompress()
|
|||
}
|
||||
|
||||
size = CD_FRAMESIZE_RAW * blocks;
|
||||
if (Zmode == 1) uncompress(cdbuffer, &size, Zbuf, ssize);
|
||||
else BZ2_bzBuffToBuffDecompress(cdbuffer, (unsigned int*)&size, Zbuf, ssize, 0, 0);
|
||||
if (Zmode == 1)
|
||||
uncompress(cdbuffer, &size, Zbuf, ssize);
|
||||
else
|
||||
BZ2_bzBuffToBuffDecompress(cdbuffer, (unsigned int*)&size, Zbuf, ssize, 0, 0);
|
||||
|
||||
fwrite(cdbuffer, 1, size, f);
|
||||
|
||||
p++;
|
||||
|
||||
per = ((float)p / s);
|
||||
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(Progress), per);
|
||||
while (gtk_events_pending()) gtk_main_iteration();
|
||||
|
||||
if (stop) break;
|
||||
}
|
||||
if (!stop) gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile);
|
||||
|
@ -860,12 +881,16 @@ long CDRconfigure(void)
|
|||
methodlist = NULL;
|
||||
for (i = 0; i < 2; i++)
|
||||
methodlist = g_list_append(methodlist, methods[i]);
|
||||
|
||||
Method = lookup_widget(ConfDlg, "GtkCombo_Method");
|
||||
gtk_combo_set_popdown_strings(GTK_COMBO(Method), methodlist);
|
||||
if (strstr(IsoFile, ".Z") != NULL)
|
||||
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[0]);
|
||||
else gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[1]);
|
||||
|
||||
else
|
||||
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[1]);
|
||||
|
||||
set_checked(ConfDlg, "checkBlockDump", (BlockDump == 1));
|
||||
|
||||
gtk_widget_show_all(ConfDlg);
|
||||
gtk_main();
|
||||
|
||||
|
|
|
@ -1,220 +1,226 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#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"
|
||||
|
||||
#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_Config (void)
|
||||
{
|
||||
GtkWidget *Config;
|
||||
GtkWidget *vbox1;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *GtkEntry_Iso;
|
||||
GtkWidget *button5;
|
||||
GtkWidget *hbox2;
|
||||
GtkWidget *GtkProgressBar_Progress;
|
||||
GtkWidget *button6;
|
||||
GtkWidget *hbox4;
|
||||
GtkWidget *label2;
|
||||
GtkWidget *GtkCombo_Method;
|
||||
GList *GtkCombo_Method_items = NULL;
|
||||
GtkWidget *combo_entry1;
|
||||
GtkWidget *hbuttonbox2;
|
||||
GtkWidget *GtkButton_Compress;
|
||||
GtkWidget *GtkButton_Decompress;
|
||||
GtkWidget *hbox3;
|
||||
GtkWidget *label1;
|
||||
GtkWidget *GtkEntry_CdDev;
|
||||
GtkWidget *hbuttonbox3;
|
||||
GtkWidget *GtkButton_Create;
|
||||
GtkWidget *GtkButton_CreateZ;
|
||||
GtkWidget *hbuttonbox1;
|
||||
GtkWidget *button1;
|
||||
GtkWidget *button2;
|
||||
|
||||
Config = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (Config), 5);
|
||||
gtk_window_set_title (GTK_WINDOW (Config), _("CDVD Config Dialog"));
|
||||
|
||||
vbox1 = gtk_vbox_new (FALSE, 5);
|
||||
gtk_widget_show (vbox1);
|
||||
gtk_container_add (GTK_CONTAINER (Config), vbox1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
|
||||
|
||||
hbox1 = gtk_hbox_new (FALSE, 10);
|
||||
gtk_widget_show (hbox1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
|
||||
|
||||
GtkEntry_Iso = gtk_entry_new ();
|
||||
gtk_widget_show (GtkEntry_Iso);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), GtkEntry_Iso, TRUE, TRUE, 0);
|
||||
|
||||
button5 = gtk_button_new_with_mnemonic (_("Select Iso"));
|
||||
gtk_widget_show (button5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), button5, FALSE, FALSE, 0);
|
||||
|
||||
hbox2 = gtk_hbox_new (FALSE, 10);
|
||||
gtk_widget_show (hbox2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 0);
|
||||
|
||||
GtkProgressBar_Progress = gtk_progress_bar_new ();
|
||||
gtk_widget_show (GtkProgressBar_Progress);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), GtkProgressBar_Progress, TRUE, FALSE, 0);
|
||||
|
||||
button6 = gtk_button_new_with_mnemonic (_("Stop"));
|
||||
gtk_widget_show (button6);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button6, FALSE, FALSE, 0);
|
||||
|
||||
hbox4 = gtk_hbox_new (FALSE, 5);
|
||||
gtk_widget_show (hbox4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox4, TRUE, TRUE, 0);
|
||||
|
||||
label2 = gtk_label_new (_("Compression Method:"));
|
||||
gtk_widget_show (label2);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), label2, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER);
|
||||
|
||||
GtkCombo_Method = gtk_combo_new ();
|
||||
g_object_set_data (G_OBJECT (GTK_COMBO (GtkCombo_Method)->popwin),
|
||||
"GladeParentKey", GtkCombo_Method);
|
||||
gtk_widget_show (GtkCombo_Method);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), GtkCombo_Method, TRUE, FALSE, 0);
|
||||
GtkCombo_Method_items = g_list_append (GtkCombo_Method_items, (gpointer) "");
|
||||
gtk_combo_set_popdown_strings (GTK_COMBO (GtkCombo_Method), GtkCombo_Method_items);
|
||||
g_list_free (GtkCombo_Method_items);
|
||||
|
||||
combo_entry1 = GTK_COMBO (GtkCombo_Method)->entry;
|
||||
gtk_widget_show (combo_entry1);
|
||||
|
||||
hbuttonbox2 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox2, TRUE, TRUE, 0);
|
||||
|
||||
GtkButton_Compress = gtk_button_new_with_mnemonic (_("Compress Iso"));
|
||||
gtk_widget_show (GtkButton_Compress);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Compress);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_Compress, GTK_CAN_DEFAULT);
|
||||
|
||||
GtkButton_Decompress = gtk_button_new_with_mnemonic (_("Decompress Iso"));
|
||||
gtk_widget_show (GtkButton_Decompress);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Decompress);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_Decompress, GTK_CAN_DEFAULT);
|
||||
|
||||
hbox3 = gtk_hbox_new (FALSE, 5);
|
||||
gtk_widget_show (hbox3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox3, FALSE, FALSE, 0);
|
||||
|
||||
label1 = gtk_label_new (_("Cdrom Device: "));
|
||||
gtk_widget_show (label1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox3), label1, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);
|
||||
|
||||
GtkEntry_CdDev = gtk_entry_new ();
|
||||
gtk_widget_show (GtkEntry_CdDev);
|
||||
gtk_box_pack_start (GTK_BOX (hbox3), GtkEntry_CdDev, TRUE, TRUE, 0);
|
||||
|
||||
hbuttonbox3 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox3, TRUE, TRUE, 0);
|
||||
|
||||
GtkButton_Create = gtk_button_new_with_mnemonic (_("Create Iso"));
|
||||
gtk_widget_show (GtkButton_Create);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_Create);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_Create, GTK_CAN_DEFAULT);
|
||||
|
||||
GtkButton_CreateZ = gtk_button_new_with_mnemonic (_("Create Compressed Iso"));
|
||||
gtk_widget_show (GtkButton_CreateZ);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_CreateZ);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_CreateZ, GTK_CAN_DEFAULT);
|
||||
|
||||
hbuttonbox1 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
|
||||
|
||||
button1 = gtk_button_new_from_stock ("gtk-ok");
|
||||
gtk_widget_show (button1);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1);
|
||||
GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
|
||||
|
||||
button2 = gtk_button_new_from_stock ("gtk-cancel");
|
||||
gtk_widget_show (button2);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
|
||||
GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
|
||||
|
||||
g_signal_connect ((gpointer) button5, "clicked",
|
||||
G_CALLBACK (OnFileSel),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) button6, "clicked",
|
||||
G_CALLBACK (OnStop),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_Compress, "clicked",
|
||||
G_CALLBACK (OnCompress),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_Decompress, "clicked",
|
||||
G_CALLBACK (OnDecompress),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_Create, "clicked",
|
||||
G_CALLBACK (OnCreate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_CreateZ, "clicked",
|
||||
G_CALLBACK (OnCreateZ),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) button1, "clicked",
|
||||
G_CALLBACK (OnOk),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) button2, "clicked",
|
||||
G_CALLBACK (OnCancel),
|
||||
NULL);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config");
|
||||
GLADE_HOOKUP_OBJECT (Config, vbox1, "vbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox1, "hbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkEntry_Iso, "GtkEntry_Iso");
|
||||
GLADE_HOOKUP_OBJECT (Config, button5, "button5");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox2, "hbox2");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkProgressBar_Progress, "GtkProgressBar_Progress");
|
||||
GLADE_HOOKUP_OBJECT (Config, button6, "button6");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox4, "hbox4");
|
||||
GLADE_HOOKUP_OBJECT (Config, label2, "label2");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkCombo_Method, "GtkCombo_Method");
|
||||
GLADE_HOOKUP_OBJECT (Config, combo_entry1, "combo_entry1");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox2, "hbuttonbox2");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Compress, "GtkButton_Compress");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Decompress, "GtkButton_Decompress");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox3, "hbox3");
|
||||
GLADE_HOOKUP_OBJECT (Config, label1, "label1");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkEntry_CdDev, "GtkEntry_CdDev");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox3, "hbuttonbox3");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Create, "GtkButton_Create");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_CreateZ, "GtkButton_CreateZ");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox1, "hbuttonbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, button1, "button1");
|
||||
GLADE_HOOKUP_OBJECT (Config, button2, "button2");
|
||||
|
||||
return Config;
|
||||
}
|
||||
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#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"
|
||||
|
||||
#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_Config (void)
|
||||
{
|
||||
GtkWidget *Config;
|
||||
GtkWidget *vbox1;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *GtkEntry_Iso;
|
||||
GtkWidget *button5;
|
||||
GtkWidget *hbox2;
|
||||
GtkWidget *GtkProgressBar_Progress;
|
||||
GtkWidget *button6;
|
||||
GtkWidget *hbox4;
|
||||
GtkWidget *label2;
|
||||
GtkWidget *GtkCombo_Method;
|
||||
GList *GtkCombo_Method_items = NULL;
|
||||
GtkWidget *combo_entry1;
|
||||
GtkWidget *hbuttonbox2;
|
||||
GtkWidget *GtkButton_Compress;
|
||||
GtkWidget *GtkButton_Decompress;
|
||||
GtkWidget *hbox3;
|
||||
GtkWidget *label1;
|
||||
GtkWidget *GtkEntry_CdDev;
|
||||
GtkWidget *hbuttonbox3;
|
||||
GtkWidget *GtkButton_Create;
|
||||
GtkWidget *GtkButton_CreateZ;
|
||||
GtkWidget *checkBlockDump;
|
||||
GtkWidget *hbuttonbox1;
|
||||
GtkWidget *button1;
|
||||
GtkWidget *button2;
|
||||
|
||||
Config = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (Config), 5);
|
||||
gtk_window_set_title (GTK_WINDOW (Config), _("CDVD Config Dialog"));
|
||||
|
||||
vbox1 = gtk_vbox_new (FALSE, 5);
|
||||
gtk_widget_show (vbox1);
|
||||
gtk_container_add (GTK_CONTAINER (Config), vbox1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
|
||||
|
||||
hbox1 = gtk_hbox_new (FALSE, 10);
|
||||
gtk_widget_show (hbox1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
|
||||
|
||||
GtkEntry_Iso = gtk_entry_new ();
|
||||
gtk_widget_show (GtkEntry_Iso);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), GtkEntry_Iso, TRUE, TRUE, 0);
|
||||
|
||||
button5 = gtk_button_new_with_mnemonic (_("Select Iso"));
|
||||
gtk_widget_show (button5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox1), button5, FALSE, FALSE, 0);
|
||||
|
||||
hbox2 = gtk_hbox_new (FALSE, 10);
|
||||
gtk_widget_show (hbox2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 0);
|
||||
|
||||
GtkProgressBar_Progress = gtk_progress_bar_new ();
|
||||
gtk_widget_show (GtkProgressBar_Progress);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), GtkProgressBar_Progress, TRUE, FALSE, 0);
|
||||
|
||||
button6 = gtk_button_new_with_mnemonic (_("Stop"));
|
||||
gtk_widget_show (button6);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button6, FALSE, FALSE, 0);
|
||||
|
||||
hbox4 = gtk_hbox_new (FALSE, 5);
|
||||
gtk_widget_show (hbox4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox4, TRUE, TRUE, 0);
|
||||
|
||||
label2 = gtk_label_new (_("Compression Method:"));
|
||||
gtk_widget_show (label2);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), label2, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER);
|
||||
|
||||
GtkCombo_Method = gtk_combo_new ();
|
||||
g_object_set_data (G_OBJECT (GTK_COMBO (GtkCombo_Method)->popwin),
|
||||
"GladeParentKey", GtkCombo_Method);
|
||||
gtk_widget_show (GtkCombo_Method);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), GtkCombo_Method, TRUE, FALSE, 0);
|
||||
GtkCombo_Method_items = g_list_append (GtkCombo_Method_items, (gpointer) "");
|
||||
gtk_combo_set_popdown_strings (GTK_COMBO (GtkCombo_Method), GtkCombo_Method_items);
|
||||
g_list_free (GtkCombo_Method_items);
|
||||
|
||||
combo_entry1 = GTK_COMBO (GtkCombo_Method)->entry;
|
||||
gtk_widget_show (combo_entry1);
|
||||
|
||||
hbuttonbox2 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox2, TRUE, TRUE, 0);
|
||||
|
||||
GtkButton_Compress = gtk_button_new_with_mnemonic (_("Compress Iso"));
|
||||
gtk_widget_show (GtkButton_Compress);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Compress);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_Compress, GTK_CAN_DEFAULT);
|
||||
|
||||
GtkButton_Decompress = gtk_button_new_with_mnemonic (_("Decompress Iso"));
|
||||
gtk_widget_show (GtkButton_Decompress);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Decompress);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_Decompress, GTK_CAN_DEFAULT);
|
||||
|
||||
hbox3 = gtk_hbox_new (FALSE, 5);
|
||||
gtk_widget_show (hbox3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox3, FALSE, FALSE, 0);
|
||||
|
||||
label1 = gtk_label_new (_("Cdrom Device: "));
|
||||
gtk_widget_show (label1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox3), label1, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);
|
||||
|
||||
GtkEntry_CdDev = gtk_entry_new ();
|
||||
gtk_widget_show (GtkEntry_CdDev);
|
||||
gtk_box_pack_start (GTK_BOX (hbox3), GtkEntry_CdDev, TRUE, TRUE, 0);
|
||||
|
||||
hbuttonbox3 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox3, TRUE, TRUE, 0);
|
||||
|
||||
GtkButton_Create = gtk_button_new_with_mnemonic (_("Create Iso"));
|
||||
gtk_widget_show (GtkButton_Create);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_Create);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_Create, GTK_CAN_DEFAULT);
|
||||
|
||||
GtkButton_CreateZ = gtk_button_new_with_mnemonic (_("Create Compressed Iso"));
|
||||
gtk_widget_show (GtkButton_CreateZ);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_CreateZ);
|
||||
GTK_WIDGET_SET_FLAGS (GtkButton_CreateZ, GTK_CAN_DEFAULT);
|
||||
|
||||
checkBlockDump = gtk_check_button_new_with_mnemonic (_("Create a dump of the running iso"));
|
||||
gtk_widget_show (checkBlockDump);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), checkBlockDump, FALSE, FALSE, 0);
|
||||
|
||||
hbuttonbox1 = gtk_hbutton_box_new ();
|
||||
gtk_widget_show (hbuttonbox1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
|
||||
|
||||
button1 = gtk_button_new_from_stock ("gtk-ok");
|
||||
gtk_widget_show (button1);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1);
|
||||
GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
|
||||
|
||||
button2 = gtk_button_new_from_stock ("gtk-cancel");
|
||||
gtk_widget_show (button2);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
|
||||
GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
|
||||
|
||||
g_signal_connect ((gpointer) button5, "clicked",
|
||||
G_CALLBACK (OnFileSel),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) button6, "clicked",
|
||||
G_CALLBACK (OnStop),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_Compress, "clicked",
|
||||
G_CALLBACK (OnCompress),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_Decompress, "clicked",
|
||||
G_CALLBACK (OnDecompress),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_Create, "clicked",
|
||||
G_CALLBACK (OnCreate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) GtkButton_CreateZ, "clicked",
|
||||
G_CALLBACK (OnCreateZ),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) button1, "clicked",
|
||||
G_CALLBACK (OnOk),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) button2, "clicked",
|
||||
G_CALLBACK (OnCancel),
|
||||
NULL);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config");
|
||||
GLADE_HOOKUP_OBJECT (Config, vbox1, "vbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox1, "hbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkEntry_Iso, "GtkEntry_Iso");
|
||||
GLADE_HOOKUP_OBJECT (Config, button5, "button5");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox2, "hbox2");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkProgressBar_Progress, "GtkProgressBar_Progress");
|
||||
GLADE_HOOKUP_OBJECT (Config, button6, "button6");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox4, "hbox4");
|
||||
GLADE_HOOKUP_OBJECT (Config, label2, "label2");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkCombo_Method, "GtkCombo_Method");
|
||||
GLADE_HOOKUP_OBJECT (Config, combo_entry1, "combo_entry1");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox2, "hbuttonbox2");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Compress, "GtkButton_Compress");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Decompress, "GtkButton_Decompress");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbox3, "hbox3");
|
||||
GLADE_HOOKUP_OBJECT (Config, label1, "label1");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkEntry_CdDev, "GtkEntry_CdDev");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox3, "hbuttonbox3");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Create, "GtkButton_Create");
|
||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_CreateZ, "GtkButton_CreateZ");
|
||||
GLADE_HOOKUP_OBJECT (Config, checkBlockDump, "checkBlockDump");
|
||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox1, "hbuttonbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, button1, "button1");
|
||||
GLADE_HOOKUP_OBJECT (Config, button2, "button2");
|
||||
|
||||
return Config;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
GtkWidget* create_Config (void);
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
GtkWidget* create_Config (void);
|
||||
|
|
|
@ -1,144 +1,144 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#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 = (GtkWidget*) 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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#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 = (GtkWidget*) 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,69 +1,69 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/*
|
||||
* Standard gettext macros.
|
||||
*/
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# undef _
|
||||
# define _(String) dgettext (PACKAGE, String)
|
||||
# define Q_(String) g_strip_context ((String), gettext (String))
|
||||
# ifdef gettext_noop
|
||||
# define N_(String) gettext_noop (String)
|
||||
# else
|
||||
# define N_(String) (String)
|
||||
# endif
|
||||
#else
|
||||
# define textdomain(String) (String)
|
||||
# define gettext(String) (String)
|
||||
# define dgettext(Domain,Message) (Message)
|
||||
# define dcgettext(Domain,Message,Type) (Message)
|
||||
# define bindtextdomain(Domain,Directory) (Domain)
|
||||
# define _(String) (String)
|
||||
# define Q_(String) g_strip_context ((String), (String))
|
||||
# define N_(String) (String)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/*
|
||||
* Standard gettext macros.
|
||||
*/
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# undef _
|
||||
# define _(String) dgettext (PACKAGE, String)
|
||||
# define Q_(String) g_strip_context ((String), gettext (String))
|
||||
# ifdef gettext_noop
|
||||
# define N_(String) gettext_noop (String)
|
||||
# else
|
||||
# define N_(String) (String)
|
||||
# endif
|
||||
#else
|
||||
# define textdomain(String) (String)
|
||||
# define gettext(String) (String)
|
||||
# define dgettext(Domain,Message) (Message)
|
||||
# define dcgettext(Domain,Message,Type) (Message)
|
||||
# define bindtextdomain(Domain,Directory) (Domain)
|
||||
# define _(String) (String)
|
||||
# define Q_(String) g_strip_context ((String), (String))
|
||||
# define N_(String) (String)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue