Remove anything saying Playground from the Linux version. Minor change to the Linux cpu code.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@435 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-02-06 22:46:05 +00:00
parent 3fa8c34a8d
commit b16a122e9f
10 changed files with 12673 additions and 12668 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 245 KiB

View File

@ -74,6 +74,6 @@ extern TESTRUNARGS g_TestRun;
//#include "Misc.h"
#include "Patch.h"
#define PCSX2_VERSION "Playground (beta)"
#define PCSX2_VERSION "(beta)"
#endif /* __COMMON_H__ */

View File

@ -18,7 +18,6 @@
#include "DebugDlg.h"
using namespace R5900;
//using namespace Dynarec;
void UpdateDebugger() {

View File

@ -36,9 +36,9 @@ void StartGui() {
MainWindow = create_MainWindow();
if (SVN_REV != 0)
gtk_window_set_title(GTK_WINDOW(MainWindow), "PCSX2 "PCSX2_VERSION" "SVN_REV" Playground");
gtk_window_set_title(GTK_WINDOW(MainWindow), "PCSX2 "PCSX2_VERSION" "SVN_REV);
else
gtk_window_set_title(GTK_WINDOW(MainWindow), "PCSX2 "PCSX2_VERSION" Playground");
gtk_window_set_title(GTK_WINDOW(MainWindow), "PCSX2 "PCSX2_VERSION);
// status bar
pStatusBar = gtk_statusbar_new ();
@ -605,11 +605,17 @@ void OnCpu_Ok(GtkButton *button, gpointer user_data) {
{
SysRestorableReset();
if( (Config.Options&PCSX2_GSMULTITHREAD) ^ (newopts&PCSX2_GSMULTITHREAD) )
if ((Config.Options&PCSX2_GSMULTITHREAD) ^ (newopts&PCSX2_GSMULTITHREAD))
{
// gotta shut down *all* the plugins.
ResetPlugins();
// Need the MTGS setting to take effect, so close out the plugins:
PluginsResetGS();
if (CHECK_MULTIGS)
Console::Notice( "MTGS mode disabled.\n\tEnjoy the fruits of single-threaded simpicity." );
else
Console::Notice( "MTGS mode enabled.\n\tWelcome to multi-threaded awesomeness. And random crashes." );
}
Config.Options = newopts;
}
else
@ -731,10 +737,10 @@ void OnHelp_About(GtkMenuItem *menuitem, gpointer user_data) {
// Include the SVN revision
if (SVN_REV !=0)
sprintf(str, _("PCSX2 Playground For Linux\nVersion %s %s\n"), PCSX2_VERSION, SVN_REV);
sprintf(str, _("PCSX2 For Linux\nVersion %s %s\n"), PCSX2_VERSION, SVN_REV);
else
//Use this instead for a non-svn version
sprintf(str, _("PCSX2 Playground For Linux\nVersion %s\n"), PCSX2_VERSION);
sprintf(str, _("PCSX2 For Linux\nVersion %s\n"), PCSX2_VERSION);
gtk_label_set_text(GTK_LABEL(Label), str);

View File

@ -1,387 +1,387 @@
#include <gtk/gtk.h>
void
on_Advanced_Defaults (GtkButton *button,
gpointer user_data);
void
on_Advanced_OK (GtkButton *button,
gpointer user_data);
void
On_Dialog_Cancelled (GtkButton *button,
gpointer user_data);
void
on_Speed_Hack_OK (GtkButton *button,
gpointer user_data);
void
on_Game_Fix_OK (GtkButton *button,
gpointer user_data);
void
OnMemWrite32_Ok (GtkButton *button,
gpointer user_data);
void
OnArguments_Ok (GtkButton *button,
gpointer user_data);
void
OnDumpR_Ok (GtkButton *button,
gpointer user_data);
void
OnDumpC_Ok (GtkButton *button,
gpointer user_data);
void
OnSetBPC_Ok (GtkButton *button,
gpointer user_data);
void
OnSetBPA_Ok (GtkButton *button,
gpointer user_data);
void
OnSetBPA_Cancel (GtkButton *button,
gpointer user_data);
void
OnSetPC_Ok (GtkButton *button,
gpointer user_data);
void
OnDebug_EEMode (GtkToggleButton *togglebutton,
gpointer user_data);
void
OnDebug_IOPMode (GtkToggleButton *togglebutton,
gpointer user_data);
void
OnDebug_Step (GtkButton *button,
gpointer user_data);
void
OnDebug_Skip (GtkButton *button,
gpointer user_data);
void
OnDebug_Go (GtkButton *button,
gpointer user_data);
void
OnDebug_Log (GtkButton *button,
gpointer user_data);
void
OnDebug_SetPC (GtkButton *button,
gpointer user_data);
void
OnDebug_SetBPA (GtkButton *button,
gpointer user_data);
void
OnDebug_SetBPC (GtkButton *button,
gpointer user_data);
void
OnDebug_ClearBPs (GtkButton *button,
gpointer user_data);
void
OnDebug_DumpCode (GtkButton *button,
gpointer user_data);
void
OnDebug_RawDump (GtkButton *button,
gpointer user_data);
void
OnDebug_Close (GtkButton *button,
gpointer user_data);
void
OnDebug_memWrite32 (GtkButton *button,
gpointer user_data);
void
OnConfConf_FWConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_FWTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_FWAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_UsbConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_UsbTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_UsbAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_CdvdConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_CdvdTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_CdvdAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_Dev9Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Dev9Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Dev9About (GtkButton *button,
gpointer user_data);
void
OnConfConf_Spu2Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Spu2Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Spu2About (GtkButton *button,
gpointer user_data);
void
OnConfConf_GsConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_GsTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_GsAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad1Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad1Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad1About (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad2Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad2Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad2About (GtkButton *button,
gpointer user_data);
void
OnConfConf_PluginsPath (GtkButton *button,
gpointer user_data);
void
OnConfConf_BiosPath (GtkButton *button,
gpointer user_data);
void
OnConfConf_Ok (GtkButton *button,
gpointer user_data);
void
OnHelpAbout_Ok (GtkButton *button,
gpointer user_data);
void
OnDestroy (GtkObject *object,
gpointer user_data);
gboolean
OnDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void
OnFile_RunCD (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_LoadElf (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load1 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load2 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load3 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load4 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load5 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_LoadOther (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save1 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save2 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save3 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save4 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save5 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_SaveOther (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_Exit (GtkMenuItem *menuitem,
gpointer user_data);
void
OnEmu_Run (GtkMenuItem *menuitem,
gpointer user_data);
void
OnEmu_Reset (GtkMenuItem *menuitem,
gpointer user_data);
void
OnEmu_Arguments (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Conf (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Gs (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Pads (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Spu2 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Cdvd (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Dev9 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Usb (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Fw (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Cpu (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Game_Fixes (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Speed_Hacks (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Advanced (GtkMenuItem *menuitem,
gpointer user_data);
void
on_patch_browser1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_patch_finder2_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_enable_console1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_enable_patches1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
OnDebug_Debugger (GtkMenuItem *menuitem,
gpointer user_data);
void
OnDebug_Logging (GtkMenuItem *menuitem,
gpointer user_data);
void
OnHelp_About (GtkMenuItem *menuitem,
gpointer user_data);
void
OnCpu_Ok (GtkButton *button,
gpointer user_data);
void
OnLogging_Ok (GtkButton *button,
gpointer user_data);
#include <gtk/gtk.h>
void
on_Advanced_Defaults (GtkButton *button,
gpointer user_data);
void
on_Advanced_OK (GtkButton *button,
gpointer user_data);
void
On_Dialog_Cancelled (GtkButton *button,
gpointer user_data);
void
on_Speed_Hack_OK (GtkButton *button,
gpointer user_data);
void
on_Game_Fix_OK (GtkButton *button,
gpointer user_data);
void
OnMemWrite32_Ok (GtkButton *button,
gpointer user_data);
void
OnArguments_Ok (GtkButton *button,
gpointer user_data);
void
OnDumpR_Ok (GtkButton *button,
gpointer user_data);
void
OnDumpC_Ok (GtkButton *button,
gpointer user_data);
void
OnSetBPC_Ok (GtkButton *button,
gpointer user_data);
void
OnSetBPA_Ok (GtkButton *button,
gpointer user_data);
void
OnSetBPA_Cancel (GtkButton *button,
gpointer user_data);
void
OnSetPC_Ok (GtkButton *button,
gpointer user_data);
void
OnDebug_EEMode (GtkToggleButton *togglebutton,
gpointer user_data);
void
OnDebug_IOPMode (GtkToggleButton *togglebutton,
gpointer user_data);
void
OnDebug_Step (GtkButton *button,
gpointer user_data);
void
OnDebug_Skip (GtkButton *button,
gpointer user_data);
void
OnDebug_Go (GtkButton *button,
gpointer user_data);
void
OnDebug_Log (GtkButton *button,
gpointer user_data);
void
OnDebug_SetPC (GtkButton *button,
gpointer user_data);
void
OnDebug_SetBPA (GtkButton *button,
gpointer user_data);
void
OnDebug_SetBPC (GtkButton *button,
gpointer user_data);
void
OnDebug_ClearBPs (GtkButton *button,
gpointer user_data);
void
OnDebug_DumpCode (GtkButton *button,
gpointer user_data);
void
OnDebug_RawDump (GtkButton *button,
gpointer user_data);
void
OnDebug_Close (GtkButton *button,
gpointer user_data);
void
OnDebug_memWrite32 (GtkButton *button,
gpointer user_data);
void
OnConfConf_FWConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_FWTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_FWAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_UsbConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_UsbTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_UsbAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_CdvdConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_CdvdTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_CdvdAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_Dev9Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Dev9Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Dev9About (GtkButton *button,
gpointer user_data);
void
OnConfConf_Spu2Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Spu2Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Spu2About (GtkButton *button,
gpointer user_data);
void
OnConfConf_GsConf (GtkButton *button,
gpointer user_data);
void
OnConfConf_GsTest (GtkButton *button,
gpointer user_data);
void
OnConfConf_GsAbout (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad1Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad1Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad1About (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad2Conf (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad2Test (GtkButton *button,
gpointer user_data);
void
OnConfConf_Pad2About (GtkButton *button,
gpointer user_data);
void
OnConfConf_PluginsPath (GtkButton *button,
gpointer user_data);
void
OnConfConf_BiosPath (GtkButton *button,
gpointer user_data);
void
OnConfConf_Ok (GtkButton *button,
gpointer user_data);
void
OnHelpAbout_Ok (GtkButton *button,
gpointer user_data);
void
OnDestroy (GtkObject *object,
gpointer user_data);
gboolean
OnDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void
OnFile_RunCD (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_LoadElf (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load1 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load2 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load3 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load4 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Load5 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_LoadOther (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save1 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save2 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save3 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save4 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_Save5 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnStates_SaveOther (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_Exit (GtkMenuItem *menuitem,
gpointer user_data);
void
OnEmu_Run (GtkMenuItem *menuitem,
gpointer user_data);
void
OnEmu_Reset (GtkMenuItem *menuitem,
gpointer user_data);
void
OnEmu_Arguments (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Conf (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Gs (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Pads (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Spu2 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Cdvd (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Dev9 (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Usb (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Fw (GtkMenuItem *menuitem,
gpointer user_data);
void
OnConf_Cpu (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Game_Fixes (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Speed_Hacks (GtkMenuItem *menuitem,
gpointer user_data);
void
on_Advanced (GtkMenuItem *menuitem,
gpointer user_data);
void
on_patch_browser1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_patch_finder2_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_enable_console1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_enable_patches1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
OnDebug_Debugger (GtkMenuItem *menuitem,
gpointer user_data);
void
OnDebug_Logging (GtkMenuItem *menuitem,
gpointer user_data);
void
OnHelp_About (GtkMenuItem *menuitem,
gpointer user_data);
void
OnCpu_Ok (GtkButton *button,
gpointer user_data);
void
OnLogging_Ok (GtkButton *button,
gpointer user_data);

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,22 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
GtkWidget* create_AdvDlg (void);
GtkWidget* create_SpeedHacksDlg (void);
GtkWidget* create_GameFixDlg (void);
GtkWidget* create_MemWrite32 (void);
GtkWidget* create_CmdLine (void);
GtkWidget* create_DumpRDlg (void);
GtkWidget* create_DumpCDlg (void);
GtkWidget* create_SetBPCDlg (void);
GtkWidget* create_SetBPADlg (void);
GtkWidget* create_SetPCDlg (void);
GtkWidget* create_DebugWnd (void);
GtkWidget* create_ConfDlg (void);
GtkWidget* create_AboutDlg (void);
GtkWidget* create_MainWindow (void);
GtkWidget* create_PatchBrowserWindow (void);
GtkWidget* create_PatchFinderWindow (void);
GtkWidget* create_CpuDlg (void);
GtkWidget* create_Logging (void);
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
GtkWidget* create_AdvDlg (void);
GtkWidget* create_SpeedHacksDlg (void);
GtkWidget* create_GameFixDlg (void);
GtkWidget* create_MemWrite32 (void);
GtkWidget* create_CmdLine (void);
GtkWidget* create_DumpRDlg (void);
GtkWidget* create_DumpCDlg (void);
GtkWidget* create_SetBPCDlg (void);
GtkWidget* create_SetBPADlg (void);
GtkWidget* create_SetPCDlg (void);
GtkWidget* create_DebugWnd (void);
GtkWidget* create_ConfDlg (void);
GtkWidget* create_AboutDlg (void);
GtkWidget* create_MainWindow (void);
GtkWidget* create_PatchBrowserWindow (void);
GtkWidget* create_PatchFinderWindow (void);
GtkWidget* create_CpuDlg (void);
GtkWidget* create_Logging (void);

File diff suppressed because it is too large Load Diff

View File

@ -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);
}
}

View File

@ -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);