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)
|
if (BlockDump)
|
||||||
{
|
{
|
||||||
char fname_only[MAX_PATH];
|
char fname_only[MAX_PATH];
|
||||||
char* p, *plast;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char fname[MAX_PATH], ext[MAX_PATH];
|
char fname[MAX_PATH], ext[MAX_PATH];
|
||||||
_splitpath(IsoFile, NULL, NULL, fname, ext);
|
_splitpath(IsoFile, NULL, NULL, fname, ext);
|
||||||
_makepath(fname_only, NULL, NULL, fname, NULL);
|
_makepath(fname_only, NULL, NULL, fname, NULL);
|
||||||
#else
|
#else
|
||||||
|
char* p, *plast;
|
||||||
|
|
||||||
plast = p = strchr(IsoFile, '/');
|
plast = p = strchr(IsoFile, '/');
|
||||||
while (p != NULL)
|
while (p != NULL)
|
||||||
{
|
{
|
||||||
|
@ -193,11 +194,13 @@ EXPORT_C(s32) CDVDopen(const char* pTitle)
|
||||||
p = strchr(p + 1, '/');
|
p = strchr(p + 1, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lets not create dumps in the plugin directory.
|
||||||
|
strcpy(fname_only, "../");
|
||||||
if (plast != NULL)
|
if (plast != NULL)
|
||||||
strcpy(fname_only, plast + 1);
|
strcat(fname_only, plast + 1);
|
||||||
else
|
else
|
||||||
strcpy(fname_only, IsoFile);
|
strcat(fname_only, IsoFile);
|
||||||
|
|
||||||
plast = p = strchr(fname_only, '.');
|
plast = p = strchr(fname_only, '.');
|
||||||
|
|
||||||
while (p != NULL)
|
while (p != NULL)
|
||||||
|
|
|
@ -358,6 +358,25 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</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>
|
<child>
|
||||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|
|
@ -48,7 +48,7 @@ void LoadConf()
|
||||||
|
|
||||||
fscanf(f, "IsoFile = %[^\n]\n", IsoFile);
|
fscanf(f, "IsoFile = %[^\n]\n", IsoFile);
|
||||||
fscanf(f, "CdDev = %[^\n]\n", CdDev);
|
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 (!strncmp(IsoFile, "CdDev =", 9)) *IsoFile = 0; // quick fix
|
||||||
if (*CdDev == 0) strcpy(CdDev, CDDEV_DEF);
|
if (*CdDev == 0) strcpy(CdDev, CDDEV_DEF);
|
||||||
|
@ -76,7 +76,7 @@ void SaveConf()
|
||||||
|
|
||||||
fprintf(f, "IsoFile = %s\n", IsoFile);
|
fprintf(f, "IsoFile = %s\n", IsoFile);
|
||||||
fprintf(f, "CdDev = %s\n", CdDev);
|
fprintf(f, "CdDev = %s\n", CdDev);
|
||||||
fprintf(f, "BlockDump = %s\n", &BlockDump);
|
fprintf(f, "BlockDump = %d\n", BlockDump);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,74 +1,74 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "callbacks.h"
|
#include "callbacks.h"
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
#include "support.h"
|
#include "support.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnFileSel (GtkButton *button,
|
OnFileSel (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnStop (GtkButton *button,
|
OnStop (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCompress (GtkButton *button,
|
OnCompress (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnDecompress (GtkButton *button,
|
OnDecompress (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCreate (GtkButton *button,
|
OnCreate (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCreateZ (GtkButton *button,
|
OnCreateZ (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnOk (GtkButton *button,
|
OnOk (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCancel (GtkButton *button,
|
OnCancel (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OnFileSel (GtkButton *button,
|
OnFileSel (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
OnStop (GtkButton *button,
|
OnStop (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCompress (GtkButton *button,
|
OnCompress (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
OnDecompress (GtkButton *button,
|
OnDecompress (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCreate (GtkButton *button,
|
OnCreate (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCreateZ (GtkButton *button,
|
OnCreateZ (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
OnOk (GtkButton *button,
|
OnOk (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
void
|
void
|
||||||
OnCancel (GtkButton *button,
|
OnCancel (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
|
@ -35,6 +35,11 @@
|
||||||
#include "CDVDiso.h"
|
#include "CDVDiso.h"
|
||||||
#include "Config.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];
|
unsigned char Zbuf[CD_FRAMESIZE_RAW * 10 * 2];
|
||||||
|
|
||||||
extern char *LibName;
|
extern char *LibName;
|
||||||
|
@ -162,6 +167,12 @@ void OnOk(GtkMenuItem * menuitem, gpointer userdata)
|
||||||
strcpy(IsoFile, tmp);
|
strcpy(IsoFile, tmp);
|
||||||
tmp = gtk_entry_get_text(GTK_ENTRY(CdEdit));
|
tmp = gtk_entry_get_text(GTK_ENTRY(CdEdit));
|
||||||
strcpy(CdDev, tmp);
|
strcpy(CdDev, tmp);
|
||||||
|
|
||||||
|
if is_checked(ConfDlg, "checkBlockDump")
|
||||||
|
BlockDump = 1;
|
||||||
|
else
|
||||||
|
BlockDump = 0;
|
||||||
|
|
||||||
SaveConf();
|
SaveConf();
|
||||||
gtk_widget_destroy(ConfDlg);
|
gtk_widget_destroy(ConfDlg);
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
|
@ -323,8 +334,12 @@ void OnDecompress()
|
||||||
{
|
{
|
||||||
return;
|
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");
|
f = fopen(table, "rb");
|
||||||
Ztable = (char*)malloc(buf.st_size);
|
Ztable = (char*)malloc(buf.st_size);
|
||||||
fread(Ztable, 1, buf.st_size, f);
|
fread(Ztable, 1, buf.st_size, f);
|
||||||
|
@ -336,8 +351,10 @@ void OnDecompress()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Zmode == 1) IsoFile[strlen(IsoFile) - 2] = 0;
|
if (Zmode == 1)
|
||||||
else IsoFile[strlen(IsoFile) - 3] = 0;
|
IsoFile[strlen(IsoFile) - 2] = 0;
|
||||||
|
else
|
||||||
|
IsoFile[strlen(IsoFile) - 3] = 0;
|
||||||
|
|
||||||
f = fopen(IsoFile, "wb");
|
f = fopen(IsoFile, "wb");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
|
@ -383,16 +400,20 @@ void OnDecompress()
|
||||||
}
|
}
|
||||||
|
|
||||||
size = CD_FRAMESIZE_RAW * blocks;
|
size = CD_FRAMESIZE_RAW * blocks;
|
||||||
if (Zmode == 1) uncompress(cdbuffer, &size, Zbuf, ssize);
|
if (Zmode == 1)
|
||||||
else BZ2_bzBuffToBuffDecompress(cdbuffer, (unsigned int*)&size, Zbuf, ssize, 0, 0);
|
uncompress(cdbuffer, &size, Zbuf, ssize);
|
||||||
|
else
|
||||||
|
BZ2_bzBuffToBuffDecompress(cdbuffer, (unsigned int*)&size, Zbuf, ssize, 0, 0);
|
||||||
|
|
||||||
fwrite(cdbuffer, 1, size, f);
|
fwrite(cdbuffer, 1, size, f);
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
per = ((float)p / s);
|
per = ((float)p / s);
|
||||||
|
|
||||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(Progress), per);
|
gtk_progress_bar_update(GTK_PROGRESS_BAR(Progress), per);
|
||||||
while (gtk_events_pending()) gtk_main_iteration();
|
while (gtk_events_pending()) gtk_main_iteration();
|
||||||
|
|
||||||
if (stop) break;
|
if (stop) break;
|
||||||
}
|
}
|
||||||
if (!stop) gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile);
|
if (!stop) gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile);
|
||||||
|
@ -860,12 +881,16 @@ long CDRconfigure(void)
|
||||||
methodlist = NULL;
|
methodlist = NULL;
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
methodlist = g_list_append(methodlist, methods[i]);
|
methodlist = g_list_append(methodlist, methods[i]);
|
||||||
|
|
||||||
Method = lookup_widget(ConfDlg, "GtkCombo_Method");
|
Method = lookup_widget(ConfDlg, "GtkCombo_Method");
|
||||||
gtk_combo_set_popdown_strings(GTK_COMBO(Method), methodlist);
|
gtk_combo_set_popdown_strings(GTK_COMBO(Method), methodlist);
|
||||||
if (strstr(IsoFile, ".Z") != NULL)
|
if (strstr(IsoFile, ".Z") != NULL)
|
||||||
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[0]);
|
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_widget_show_all(ConfDlg);
|
||||||
gtk_main();
|
gtk_main();
|
||||||
|
|
||||||
|
|
|
@ -1,220 +1,226 @@
|
||||||
/*
|
/*
|
||||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "callbacks.h"
|
#include "callbacks.h"
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
#include "support.h"
|
#include "support.h"
|
||||||
|
|
||||||
#define GLADE_HOOKUP_OBJECT(component,widget,name) \
|
#define GLADE_HOOKUP_OBJECT(component,widget,name) \
|
||||||
g_object_set_data_full (G_OBJECT (component), name, \
|
g_object_set_data_full (G_OBJECT (component), name, \
|
||||||
gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
|
gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
|
||||||
|
|
||||||
#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
|
#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
|
||||||
g_object_set_data (G_OBJECT (component), name, widget)
|
g_object_set_data (G_OBJECT (component), name, widget)
|
||||||
|
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
create_Config (void)
|
create_Config (void)
|
||||||
{
|
{
|
||||||
GtkWidget *Config;
|
GtkWidget *Config;
|
||||||
GtkWidget *vbox1;
|
GtkWidget *vbox1;
|
||||||
GtkWidget *hbox1;
|
GtkWidget *hbox1;
|
||||||
GtkWidget *GtkEntry_Iso;
|
GtkWidget *GtkEntry_Iso;
|
||||||
GtkWidget *button5;
|
GtkWidget *button5;
|
||||||
GtkWidget *hbox2;
|
GtkWidget *hbox2;
|
||||||
GtkWidget *GtkProgressBar_Progress;
|
GtkWidget *GtkProgressBar_Progress;
|
||||||
GtkWidget *button6;
|
GtkWidget *button6;
|
||||||
GtkWidget *hbox4;
|
GtkWidget *hbox4;
|
||||||
GtkWidget *label2;
|
GtkWidget *label2;
|
||||||
GtkWidget *GtkCombo_Method;
|
GtkWidget *GtkCombo_Method;
|
||||||
GList *GtkCombo_Method_items = NULL;
|
GList *GtkCombo_Method_items = NULL;
|
||||||
GtkWidget *combo_entry1;
|
GtkWidget *combo_entry1;
|
||||||
GtkWidget *hbuttonbox2;
|
GtkWidget *hbuttonbox2;
|
||||||
GtkWidget *GtkButton_Compress;
|
GtkWidget *GtkButton_Compress;
|
||||||
GtkWidget *GtkButton_Decompress;
|
GtkWidget *GtkButton_Decompress;
|
||||||
GtkWidget *hbox3;
|
GtkWidget *hbox3;
|
||||||
GtkWidget *label1;
|
GtkWidget *label1;
|
||||||
GtkWidget *GtkEntry_CdDev;
|
GtkWidget *GtkEntry_CdDev;
|
||||||
GtkWidget *hbuttonbox3;
|
GtkWidget *hbuttonbox3;
|
||||||
GtkWidget *GtkButton_Create;
|
GtkWidget *GtkButton_Create;
|
||||||
GtkWidget *GtkButton_CreateZ;
|
GtkWidget *GtkButton_CreateZ;
|
||||||
GtkWidget *hbuttonbox1;
|
GtkWidget *checkBlockDump;
|
||||||
GtkWidget *button1;
|
GtkWidget *hbuttonbox1;
|
||||||
GtkWidget *button2;
|
GtkWidget *button1;
|
||||||
|
GtkWidget *button2;
|
||||||
Config = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (Config), 5);
|
Config = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
gtk_window_set_title (GTK_WINDOW (Config), _("CDVD Config Dialog"));
|
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);
|
vbox1 = gtk_vbox_new (FALSE, 5);
|
||||||
gtk_container_add (GTK_CONTAINER (Config), vbox1);
|
gtk_widget_show (vbox1);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
|
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);
|
hbox1 = gtk_hbox_new (FALSE, 10);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
|
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);
|
GtkEntry_Iso = gtk_entry_new ();
|
||||||
gtk_box_pack_start (GTK_BOX (hbox1), GtkEntry_Iso, TRUE, TRUE, 0);
|
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);
|
button5 = gtk_button_new_with_mnemonic (_("Select Iso"));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox1), button5, FALSE, FALSE, 0);
|
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);
|
hbox2 = gtk_hbox_new (FALSE, 10);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 0);
|
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);
|
GtkProgressBar_Progress = gtk_progress_bar_new ();
|
||||||
gtk_box_pack_start (GTK_BOX (hbox2), GtkProgressBar_Progress, TRUE, FALSE, 0);
|
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);
|
button6 = gtk_button_new_with_mnemonic (_("Stop"));
|
||||||
gtk_box_pack_end (GTK_BOX (hbox2), button6, FALSE, FALSE, 0);
|
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);
|
hbox4 = gtk_hbox_new (FALSE, 5);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox4, TRUE, TRUE, 0);
|
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);
|
label2 = gtk_label_new (_("Compression Method:"));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox4), label2, FALSE, FALSE, 0);
|
gtk_widget_show (label2);
|
||||||
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER);
|
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),
|
GtkCombo_Method = gtk_combo_new ();
|
||||||
"GladeParentKey", GtkCombo_Method);
|
g_object_set_data (G_OBJECT (GTK_COMBO (GtkCombo_Method)->popwin),
|
||||||
gtk_widget_show (GtkCombo_Method);
|
"GladeParentKey", GtkCombo_Method);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox4), GtkCombo_Method, TRUE, FALSE, 0);
|
gtk_widget_show (GtkCombo_Method);
|
||||||
GtkCombo_Method_items = g_list_append (GtkCombo_Method_items, (gpointer) "");
|
gtk_box_pack_start (GTK_BOX (hbox4), GtkCombo_Method, TRUE, FALSE, 0);
|
||||||
gtk_combo_set_popdown_strings (GTK_COMBO (GtkCombo_Method), GtkCombo_Method_items);
|
GtkCombo_Method_items = g_list_append (GtkCombo_Method_items, (gpointer) "");
|
||||||
g_list_free (GtkCombo_Method_items);
|
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);
|
combo_entry1 = GTK_COMBO (GtkCombo_Method)->entry;
|
||||||
|
gtk_widget_show (combo_entry1);
|
||||||
hbuttonbox2 = gtk_hbutton_box_new ();
|
|
||||||
gtk_widget_show (hbuttonbox2);
|
hbuttonbox2 = gtk_hbutton_box_new ();
|
||||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox2, TRUE, TRUE, 0);
|
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);
|
GtkButton_Compress = gtk_button_new_with_mnemonic (_("Compress Iso"));
|
||||||
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Compress);
|
gtk_widget_show (GtkButton_Compress);
|
||||||
GTK_WIDGET_SET_FLAGS (GtkButton_Compress, GTK_CAN_DEFAULT);
|
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);
|
GtkButton_Decompress = gtk_button_new_with_mnemonic (_("Decompress Iso"));
|
||||||
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Decompress);
|
gtk_widget_show (GtkButton_Decompress);
|
||||||
GTK_WIDGET_SET_FLAGS (GtkButton_Decompress, GTK_CAN_DEFAULT);
|
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);
|
hbox3 = gtk_hbox_new (FALSE, 5);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox1), hbox3, FALSE, FALSE, 0);
|
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);
|
label1 = gtk_label_new (_("Cdrom Device: "));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox3), label1, FALSE, FALSE, 0);
|
gtk_widget_show (label1);
|
||||||
gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);
|
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);
|
GtkEntry_CdDev = gtk_entry_new ();
|
||||||
gtk_box_pack_start (GTK_BOX (hbox3), GtkEntry_CdDev, TRUE, TRUE, 0);
|
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);
|
hbuttonbox3 = gtk_hbutton_box_new ();
|
||||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox3, TRUE, TRUE, 0);
|
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);
|
GtkButton_Create = gtk_button_new_with_mnemonic (_("Create Iso"));
|
||||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_Create);
|
gtk_widget_show (GtkButton_Create);
|
||||||
GTK_WIDGET_SET_FLAGS (GtkButton_Create, GTK_CAN_DEFAULT);
|
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);
|
GtkButton_CreateZ = gtk_button_new_with_mnemonic (_("Create Compressed Iso"));
|
||||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_CreateZ);
|
gtk_widget_show (GtkButton_CreateZ);
|
||||||
GTK_WIDGET_SET_FLAGS (GtkButton_CreateZ, GTK_CAN_DEFAULT);
|
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);
|
checkBlockDump = gtk_check_button_new_with_mnemonic (_("Create a dump of the running iso"));
|
||||||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
|
gtk_widget_show (checkBlockDump);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox1), checkBlockDump, FALSE, FALSE, 0);
|
||||||
button1 = gtk_button_new_from_stock ("gtk-ok");
|
|
||||||
gtk_widget_show (button1);
|
hbuttonbox1 = gtk_hbutton_box_new ();
|
||||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1);
|
gtk_widget_show (hbuttonbox1);
|
||||||
GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
|
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
|
||||||
|
|
||||||
button2 = gtk_button_new_from_stock ("gtk-cancel");
|
button1 = gtk_button_new_from_stock ("gtk-ok");
|
||||||
gtk_widget_show (button2);
|
gtk_widget_show (button1);
|
||||||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
|
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1);
|
||||||
GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
|
GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
|
||||||
|
|
||||||
g_signal_connect ((gpointer) button5, "clicked",
|
button2 = gtk_button_new_from_stock ("gtk-cancel");
|
||||||
G_CALLBACK (OnFileSel),
|
gtk_widget_show (button2);
|
||||||
NULL);
|
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
|
||||||
g_signal_connect ((gpointer) button6, "clicked",
|
GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
|
||||||
G_CALLBACK (OnStop),
|
|
||||||
NULL);
|
g_signal_connect ((gpointer) button5, "clicked",
|
||||||
g_signal_connect ((gpointer) GtkButton_Compress, "clicked",
|
G_CALLBACK (OnFileSel),
|
||||||
G_CALLBACK (OnCompress),
|
NULL);
|
||||||
NULL);
|
g_signal_connect ((gpointer) button6, "clicked",
|
||||||
g_signal_connect ((gpointer) GtkButton_Decompress, "clicked",
|
G_CALLBACK (OnStop),
|
||||||
G_CALLBACK (OnDecompress),
|
NULL);
|
||||||
NULL);
|
g_signal_connect ((gpointer) GtkButton_Compress, "clicked",
|
||||||
g_signal_connect ((gpointer) GtkButton_Create, "clicked",
|
G_CALLBACK (OnCompress),
|
||||||
G_CALLBACK (OnCreate),
|
NULL);
|
||||||
NULL);
|
g_signal_connect ((gpointer) GtkButton_Decompress, "clicked",
|
||||||
g_signal_connect ((gpointer) GtkButton_CreateZ, "clicked",
|
G_CALLBACK (OnDecompress),
|
||||||
G_CALLBACK (OnCreateZ),
|
NULL);
|
||||||
NULL);
|
g_signal_connect ((gpointer) GtkButton_Create, "clicked",
|
||||||
g_signal_connect ((gpointer) button1, "clicked",
|
G_CALLBACK (OnCreate),
|
||||||
G_CALLBACK (OnOk),
|
NULL);
|
||||||
NULL);
|
g_signal_connect ((gpointer) GtkButton_CreateZ, "clicked",
|
||||||
g_signal_connect ((gpointer) button2, "clicked",
|
G_CALLBACK (OnCreateZ),
|
||||||
G_CALLBACK (OnCancel),
|
NULL);
|
||||||
NULL);
|
g_signal_connect ((gpointer) button1, "clicked",
|
||||||
|
G_CALLBACK (OnOk),
|
||||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
NULL);
|
||||||
GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config");
|
g_signal_connect ((gpointer) button2, "clicked",
|
||||||
GLADE_HOOKUP_OBJECT (Config, vbox1, "vbox1");
|
G_CALLBACK (OnCancel),
|
||||||
GLADE_HOOKUP_OBJECT (Config, hbox1, "hbox1");
|
NULL);
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkEntry_Iso, "GtkEntry_Iso");
|
|
||||||
GLADE_HOOKUP_OBJECT (Config, button5, "button5");
|
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||||
GLADE_HOOKUP_OBJECT (Config, hbox2, "hbox2");
|
GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config");
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkProgressBar_Progress, "GtkProgressBar_Progress");
|
GLADE_HOOKUP_OBJECT (Config, vbox1, "vbox1");
|
||||||
GLADE_HOOKUP_OBJECT (Config, button6, "button6");
|
GLADE_HOOKUP_OBJECT (Config, hbox1, "hbox1");
|
||||||
GLADE_HOOKUP_OBJECT (Config, hbox4, "hbox4");
|
GLADE_HOOKUP_OBJECT (Config, GtkEntry_Iso, "GtkEntry_Iso");
|
||||||
GLADE_HOOKUP_OBJECT (Config, label2, "label2");
|
GLADE_HOOKUP_OBJECT (Config, button5, "button5");
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkCombo_Method, "GtkCombo_Method");
|
GLADE_HOOKUP_OBJECT (Config, hbox2, "hbox2");
|
||||||
GLADE_HOOKUP_OBJECT (Config, combo_entry1, "combo_entry1");
|
GLADE_HOOKUP_OBJECT (Config, GtkProgressBar_Progress, "GtkProgressBar_Progress");
|
||||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox2, "hbuttonbox2");
|
GLADE_HOOKUP_OBJECT (Config, button6, "button6");
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Compress, "GtkButton_Compress");
|
GLADE_HOOKUP_OBJECT (Config, hbox4, "hbox4");
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Decompress, "GtkButton_Decompress");
|
GLADE_HOOKUP_OBJECT (Config, label2, "label2");
|
||||||
GLADE_HOOKUP_OBJECT (Config, hbox3, "hbox3");
|
GLADE_HOOKUP_OBJECT (Config, GtkCombo_Method, "GtkCombo_Method");
|
||||||
GLADE_HOOKUP_OBJECT (Config, label1, "label1");
|
GLADE_HOOKUP_OBJECT (Config, combo_entry1, "combo_entry1");
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkEntry_CdDev, "GtkEntry_CdDev");
|
GLADE_HOOKUP_OBJECT (Config, hbuttonbox2, "hbuttonbox2");
|
||||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox3, "hbuttonbox3");
|
GLADE_HOOKUP_OBJECT (Config, GtkButton_Compress, "GtkButton_Compress");
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_Create, "GtkButton_Create");
|
GLADE_HOOKUP_OBJECT (Config, GtkButton_Decompress, "GtkButton_Decompress");
|
||||||
GLADE_HOOKUP_OBJECT (Config, GtkButton_CreateZ, "GtkButton_CreateZ");
|
GLADE_HOOKUP_OBJECT (Config, hbox3, "hbox3");
|
||||||
GLADE_HOOKUP_OBJECT (Config, hbuttonbox1, "hbuttonbox1");
|
GLADE_HOOKUP_OBJECT (Config, label1, "label1");
|
||||||
GLADE_HOOKUP_OBJECT (Config, button1, "button1");
|
GLADE_HOOKUP_OBJECT (Config, GtkEntry_CdDev, "GtkEntry_CdDev");
|
||||||
GLADE_HOOKUP_OBJECT (Config, button2, "button2");
|
GLADE_HOOKUP_OBJECT (Config, hbuttonbox3, "hbuttonbox3");
|
||||||
|
GLADE_HOOKUP_OBJECT (Config, GtkButton_Create, "GtkButton_Create");
|
||||||
return Config;
|
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.
|
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GtkWidget* create_Config (void);
|
GtkWidget* create_Config (void);
|
||||||
|
|
|
@ -1,144 +1,144 @@
|
||||||
/*
|
/*
|
||||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "support.h"
|
#include "support.h"
|
||||||
|
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
lookup_widget (GtkWidget *widget,
|
lookup_widget (GtkWidget *widget,
|
||||||
const gchar *widget_name)
|
const gchar *widget_name)
|
||||||
{
|
{
|
||||||
GtkWidget *parent, *found_widget;
|
GtkWidget *parent, *found_widget;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (GTK_IS_MENU (widget))
|
if (GTK_IS_MENU (widget))
|
||||||
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
|
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
|
||||||
else
|
else
|
||||||
parent = widget->parent;
|
parent = widget->parent;
|
||||||
if (!parent)
|
if (!parent)
|
||||||
parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
|
parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
|
||||||
if (parent == NULL)
|
if (parent == NULL)
|
||||||
break;
|
break;
|
||||||
widget = parent;
|
widget = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
|
found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
|
||||||
widget_name);
|
widget_name);
|
||||||
if (!found_widget)
|
if (!found_widget)
|
||||||
g_warning ("Widget not found: %s", widget_name);
|
g_warning ("Widget not found: %s", widget_name);
|
||||||
return found_widget;
|
return found_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GList *pixmaps_directories = NULL;
|
static GList *pixmaps_directories = NULL;
|
||||||
|
|
||||||
/* Use this function to set the directory containing installed pixmaps. */
|
/* Use this function to set the directory containing installed pixmaps. */
|
||||||
void
|
void
|
||||||
add_pixmap_directory (const gchar *directory)
|
add_pixmap_directory (const gchar *directory)
|
||||||
{
|
{
|
||||||
pixmaps_directories = g_list_prepend (pixmaps_directories,
|
pixmaps_directories = g_list_prepend (pixmaps_directories,
|
||||||
g_strdup (directory));
|
g_strdup (directory));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is an internally used function to find pixmap files. */
|
/* This is an internally used function to find pixmap files. */
|
||||||
static gchar*
|
static gchar*
|
||||||
find_pixmap_file (const gchar *filename)
|
find_pixmap_file (const gchar *filename)
|
||||||
{
|
{
|
||||||
GList *elem;
|
GList *elem;
|
||||||
|
|
||||||
/* We step through each of the pixmaps directory to find it. */
|
/* We step through each of the pixmaps directory to find it. */
|
||||||
elem = pixmaps_directories;
|
elem = pixmaps_directories;
|
||||||
while (elem)
|
while (elem)
|
||||||
{
|
{
|
||||||
gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
|
gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
|
||||||
G_DIR_SEPARATOR_S, filename);
|
G_DIR_SEPARATOR_S, filename);
|
||||||
if (g_file_test (pathname, G_FILE_TEST_EXISTS))
|
if (g_file_test (pathname, G_FILE_TEST_EXISTS))
|
||||||
return pathname;
|
return pathname;
|
||||||
g_free (pathname);
|
g_free (pathname);
|
||||||
elem = elem->next;
|
elem = elem->next;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is an internally used function to create pixmaps. */
|
/* This is an internally used function to create pixmaps. */
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
create_pixmap (GtkWidget *widget,
|
create_pixmap (GtkWidget *widget,
|
||||||
const gchar *filename)
|
const gchar *filename)
|
||||||
{
|
{
|
||||||
gchar *pathname = NULL;
|
gchar *pathname = NULL;
|
||||||
GtkWidget *pixmap;
|
GtkWidget *pixmap;
|
||||||
|
|
||||||
if (!filename || !filename[0])
|
if (!filename || !filename[0])
|
||||||
return gtk_image_new ();
|
return gtk_image_new ();
|
||||||
|
|
||||||
pathname = find_pixmap_file (filename);
|
pathname = find_pixmap_file (filename);
|
||||||
|
|
||||||
if (!pathname)
|
if (!pathname)
|
||||||
{
|
{
|
||||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||||
return gtk_image_new ();
|
return gtk_image_new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
pixmap = gtk_image_new_from_file (pathname);
|
pixmap = gtk_image_new_from_file (pathname);
|
||||||
g_free (pathname);
|
g_free (pathname);
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is an internally used function to create pixmaps. */
|
/* This is an internally used function to create pixmaps. */
|
||||||
GdkPixbuf*
|
GdkPixbuf*
|
||||||
create_pixbuf (const gchar *filename)
|
create_pixbuf (const gchar *filename)
|
||||||
{
|
{
|
||||||
gchar *pathname = NULL;
|
gchar *pathname = NULL;
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!filename || !filename[0])
|
if (!filename || !filename[0])
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
pathname = find_pixmap_file (filename);
|
pathname = find_pixmap_file (filename);
|
||||||
|
|
||||||
if (!pathname)
|
if (!pathname)
|
||||||
{
|
{
|
||||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
|
pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
|
||||||
if (!pixbuf)
|
if (!pixbuf)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
|
fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
|
||||||
pathname, error->message);
|
pathname, error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
g_free (pathname);
|
g_free (pathname);
|
||||||
return pixbuf;
|
return pixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is used to set ATK action descriptions. */
|
/* This is used to set ATK action descriptions. */
|
||||||
void
|
void
|
||||||
glade_set_atk_action_description (AtkAction *action,
|
glade_set_atk_action_description (AtkAction *action,
|
||||||
const gchar *action_name,
|
const gchar *action_name,
|
||||||
const gchar *description)
|
const gchar *description)
|
||||||
{
|
{
|
||||||
gint n_actions, i;
|
gint n_actions, i;
|
||||||
|
|
||||||
n_actions = atk_action_get_n_actions (action);
|
n_actions = atk_action_get_n_actions (action);
|
||||||
for (i = 0; i < n_actions; i++)
|
for (i = 0; i < n_actions; i++)
|
||||||
{
|
{
|
||||||
if (!strcmp (atk_action_get_name (action, i), action_name))
|
if (!strcmp (atk_action_get_name (action, i), action_name))
|
||||||
atk_action_set_description (action, i, description);
|
atk_action_set_description (action, i, description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,69 +1,69 @@
|
||||||
/*
|
/*
|
||||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Standard gettext macros.
|
* Standard gettext macros.
|
||||||
*/
|
*/
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
# include <libintl.h>
|
# include <libintl.h>
|
||||||
# undef _
|
# undef _
|
||||||
# define _(String) dgettext (PACKAGE, String)
|
# define _(String) dgettext (PACKAGE, String)
|
||||||
# define Q_(String) g_strip_context ((String), gettext (String))
|
# define Q_(String) g_strip_context ((String), gettext (String))
|
||||||
# ifdef gettext_noop
|
# ifdef gettext_noop
|
||||||
# define N_(String) gettext_noop (String)
|
# define N_(String) gettext_noop (String)
|
||||||
# else
|
# else
|
||||||
# define N_(String) (String)
|
# define N_(String) (String)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# define textdomain(String) (String)
|
# define textdomain(String) (String)
|
||||||
# define gettext(String) (String)
|
# define gettext(String) (String)
|
||||||
# define dgettext(Domain,Message) (Message)
|
# define dgettext(Domain,Message) (Message)
|
||||||
# define dcgettext(Domain,Message,Type) (Message)
|
# define dcgettext(Domain,Message,Type) (Message)
|
||||||
# define bindtextdomain(Domain,Directory) (Domain)
|
# define bindtextdomain(Domain,Directory) (Domain)
|
||||||
# define _(String) (String)
|
# define _(String) (String)
|
||||||
# define Q_(String) g_strip_context ((String), (String))
|
# define Q_(String) g_strip_context ((String), (String))
|
||||||
# define N_(String) (String)
|
# define N_(String) (String)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public Functions.
|
* Public Functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function returns a widget in a component created by Glade.
|
* 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),
|
* 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
|
* or alternatively any widget in the component, and the name of the widget
|
||||||
* you want returned.
|
* you want returned.
|
||||||
*/
|
*/
|
||||||
GtkWidget* lookup_widget (GtkWidget *widget,
|
GtkWidget* lookup_widget (GtkWidget *widget,
|
||||||
const gchar *widget_name);
|
const gchar *widget_name);
|
||||||
|
|
||||||
|
|
||||||
/* Use this function to set the directory containing installed pixmaps. */
|
/* Use this function to set the directory containing installed pixmaps. */
|
||||||
void add_pixmap_directory (const gchar *directory);
|
void add_pixmap_directory (const gchar *directory);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Private Functions.
|
* Private Functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This is used to create the pixmaps used in the interface. */
|
/* This is used to create the pixmaps used in the interface. */
|
||||||
GtkWidget* create_pixmap (GtkWidget *widget,
|
GtkWidget* create_pixmap (GtkWidget *widget,
|
||||||
const gchar *filename);
|
const gchar *filename);
|
||||||
|
|
||||||
/* This is used to create the pixbufs used in the interface. */
|
/* This is used to create the pixbufs used in the interface. */
|
||||||
GdkPixbuf* create_pixbuf (const gchar *filename);
|
GdkPixbuf* create_pixbuf (const gchar *filename);
|
||||||
|
|
||||||
/* This is used to set ATK action descriptions. */
|
/* This is used to set ATK action descriptions. */
|
||||||
void glade_set_atk_action_description (AtkAction *action,
|
void glade_set_atk_action_description (AtkAction *action,
|
||||||
const gchar *action_name,
|
const gchar *action_name,
|
||||||
const gchar *description);
|
const gchar *description);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue