Initial GNOME2 port.

2001-12-01  Richard Hestilow  <hestilow@ximian.com>

	* Initial GNOME2 port.
This commit is contained in:
Richard Hestilow 2001-12-02 04:54:32 +00:00 committed by Rachel Hestilow
parent bafad73d36
commit 478912430c
21 changed files with 1145 additions and 1067 deletions

View file

@ -1,3 +1,7 @@
2001-12-01 Richard Hestilow <hestilow@ximian.com>
* Initial GNOME2 port.
2001-08-18 Abel Cheung <maddog@linux.org.hk> 2001-08-18 Abel Cheung <maddog@linux.org.hk>
* interface.c (edit_create): Fixed a string (cut 'n paste is source * interface.c (edit_create): Fixed a string (cut 'n paste is source

View file

@ -2,7 +2,7 @@ cappletname = default-applications
cappletgroup = cappletgroup =
bin_PROGRAMS = default-applications-properties bin_PROGRAMS = default-applications-properties
default_applications_properties_LDADD = $(GNOMECC_CAPPLETS_LIBS) default_applications_properties_LDADD = @OLD_CAPPLET_LIBS@
default_applications_properties_SOURCES = \ default_applications_properties_SOURCES = \
default-application-properties.c \ default-application-properties.c \
interface.c interface.h \ interface.c interface.h \
@ -28,7 +28,7 @@ install-data-local:
install-data-am: install-data-local install-data-am: install-data-local
####@###GNOMECC_CAPPLETS_DESKTOP_IN_RULE@ ####@###GNOMECC_CAPPLETS_DESKTOP_IN_RULE@
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) @OLD_CAPPLET_CFLAGS@
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
EXTRA_DIST = $(GNOMECC_CAPPLETS_EXTRA_DIST) EXTRA_DIST = $(GNOMECC_CAPPLETS_EXTRA_DIST)
iconsdir = $(GNOMECC_ICONS_DIR) iconsdir = $(GNOMECC_ICONS_DIR)

View file

@ -124,23 +124,3 @@ create_pixmap (GtkWidget *widget,
gdk_bitmap_unref (mask); gdk_bitmap_unref (mask);
return pixmap; return pixmap;
} }
/* This is an internally used function to create imlib images. */
GdkImlibImage*
create_image (const gchar *filename)
{
GdkImlibImage *image;
gchar *pathname;
pathname = gnome_pixmap_file (filename);
if (!pathname)
{
g_warning (_("Couldn't find pixmap file: %s"), filename);
return NULL;
}
image = gdk_imlib_load_image (pathname);
g_free (pathname);
return image;
}

View file

@ -30,5 +30,3 @@ GtkWidget* create_pixmap (GtkWidget *widget,
const gchar *filename, const gchar *filename,
gboolean gnome_pixmap); gboolean gnome_pixmap);
GdkImlibImage* create_image (const gchar *filename);

View file

@ -1,3 +1,7 @@
2001-12-01 Richard Hestilow <hestilow@ximian.com>
* Initial GNOME2 port.
2001-10-18 Jakub Steiner <jimmac@ximian.com> 2001-10-18 Jakub Steiner <jimmac@ximian.com>
* screensaver-capplet.png: fix the icon (bug #61522) * screensaver-capplet.png: fix the icon (bug #61522)

View file

@ -4,7 +4,7 @@ cappletname = screensaver
cappletgroup = cappletgroup =
bin_PROGRAMS = screensaver-properties-capplet bin_PROGRAMS = screensaver-properties-capplet
screensaver_properties_capplet_LDADD = $(GNOMECC_CAPPLETS_LIBS) -lXt screensaver_properties_capplet_LDADD = @OLD_CAPPLET_LIBS@ -lXt
screensaver_properties_capplet_SOURCES = \ screensaver_properties_capplet_SOURCES = \
main.c \ main.c \
prefs-widget.c prefs-widget.h\ prefs-widget.c prefs-widget.h\
@ -17,6 +17,7 @@ screensaver_properties_capplet_SOURCES = \
daemon.c daemon.h\ daemon.c daemon.h\
rc-parse.c rc-parse.h\ rc-parse.c rc-parse.h\
resources.c resources.h\ resources.c resources.h\
gnome-startup.c gnome-startup.h \
XScreenSaver_ad.h XScreenSaver_ad.h
pixmaps_DATA = no-hack.png blank-screen.png pixmaps_DATA = no-hack.png blank-screen.png
@ -37,7 +38,7 @@ install-data-local:
install-data-am: install-data-local install-data-am: install-data-local
####@###GNOMECC_CAPPLETS_DESKTOP_IN_RULE@ ####@###GNOMECC_CAPPLETS_DESKTOP_IN_RULE@
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) @OLD_CAPPLET_CFLAGS@
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
EXTRA_DIST = $(GNOMECC_CAPPLETS_EXTRA_DIST) $(pixmaps_DATA) EXTRA_DIST = $(GNOMECC_CAPPLETS_EXTRA_DIST) $(pixmaps_DATA)
iconsdir = $(GNOMECC_ICONS_DIR) iconsdir = $(GNOMECC_ICONS_DIR)

View file

@ -0,0 +1,45 @@
/* gnome-startup.c - Functions for handling one-time startups in sessions.
Written by Tom Tromey <tromey@cygnus.com>. */
#include <config.h>
#include "gnome-startup.h"
#include <string.h>
#include <gdk/gdkx.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
gboolean
gnome_startup_acquire_token (const char *property,
const char *session_id)
{
Atom atom, actual;
unsigned long nitems, nbytes;
unsigned char *current;
int len, format;
gboolean result;
atom = XInternAtom (GDK_DISPLAY (), property, False);
len = strlen (session_id);
/* Append our session id to the property. We do this to avoid a
race condition: if two clients run this code, we want to make
sure that only one client can acquire the lock. */
XChangeProperty (GDK_DISPLAY (), DefaultRootWindow (GDK_DISPLAY ()), atom,
XA_STRING, 8, PropModeAppend, session_id, len);
if (XGetWindowProperty (GDK_DISPLAY (), DefaultRootWindow (GDK_DISPLAY ()),
atom, 0, len, False, XA_STRING,
&actual, &format,
&nitems, &nbytes, &current) != Success)
current = NULL;
if (! current)
return 0;
result = ! strncmp (current, session_id, len);
XFree (current);
return result;
}

View file

@ -0,0 +1,27 @@
/* gnome-startup.h - Functions for handling one-time startups in sessions.
Written by Tom Tromey <tromey@cygnus.com>. */
#ifndef GNOME_STARTUP_H
#define GNOME_STARTUP_H
#include <libgnome/gnome-defs.h>
#include <glib.h>
BEGIN_GNOME_DECLS
/* This function is used by configurator programs that set some global
X server state. The general idea is that such a program can be run
in an `initialization' mode, where it sets the server state
according to some saved state. This function implements a mutex
for such programs. The mutex a property on the root window. Call
this function with the session manager's session id. If it returns
false, then do nothing. If it returns true, then the caller has
obtained the mutex and should proceed with initialization. The
property name is generally of the form GNOME_<PROGRAM>_PROPERTY. */
gboolean gnome_startup_acquire_token (const gchar *property_name,
const gchar *sm_id);
END_GNOME_DECLS
#endif /* GNOME_STARTUP_H */

View file

@ -28,9 +28,9 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gnome.h> #include <gnome.h>
#include <libgnomeui/gnome-window-icon.h> #include <libgnomeui/gnome-window-icon.h>
#include <tree.h> #include <libxml/tree.h>
#include <parser.h> #include <libxml/parser.h>
#include <xmlIO.h> #include <libxml/xmlIO.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>

View file

@ -206,7 +206,7 @@ parse_config_file (const char *file_name)
gint line_no; gint line_no;
char *line, *key, *value; char *line, *key, *value;
if (!g_file_test (file_name, G_FILE_TEST_ISFILE)) if (!g_file_test (file_name, G_FILE_TEST_IS_REGULAR))
return NULL; return NULL;
in = fopen (file_name, "r"); in = fopen (file_name, "r");
@ -562,7 +562,7 @@ preferences_save_to_file (Preferences *prefs)
be world-readable (so that the daemon, running as "nobody", will be world-readable (so that the daemon, running as "nobody", will
still be able to read it.) still be able to read it.)
*/ */
if (g_file_test (name, G_FILE_TEST_ISFILE)) { if (g_file_test (name, G_FILE_TEST_IS_REGULAR)) {
mode_t mode = st.st_mode; mode_t mode = st.st_mode;
mode |= S_IRUSR | S_IWUSR; /* read/write by user */ mode |= S_IRUSR | S_IWUSR; /* read/write by user */
mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH); /* executable by none */ mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH); /* executable by none */

View file

@ -34,7 +34,7 @@
#include <dirent.h> #include <dirent.h>
#include <gnome.h> #include <gnome.h>
#include <parser.h> #include <libxml/parser.h>
#include "preferences.h" #include "preferences.h"
#include "preview.h" #include "preview.h"
@ -435,7 +435,7 @@ xml_get_programs_list (xmlNodePtr programs_node)
Screensaver *saver; Screensaver *saver;
gint id = 0; gint id = 0;
for (node = programs_node->childs; node; node = node->next) { for (node = programs_node->children; node; node = node->next) {
saver = screensaver_read_xml (node); saver = screensaver_read_xml (node);
if (!saver) continue; if (!saver) continue;
saver->id = id++; saver->id = id++;
@ -462,7 +462,7 @@ preferences_read_xml (xmlDocPtr xml_doc)
if (strcmp (root_node->name, "screensaver-prefs")) if (strcmp (root_node->name, "screensaver-prefs"))
return NULL; return NULL;
for (node = root_node->childs; node; node = node->next) { for (node = root_node->children; node; node = node->next) {
if (!strcmp (node->name, "verbose")) if (!strcmp (node->name, "verbose"))
prefs->verbose = xml_read_bool (node); prefs->verbose = xml_read_bool (node);
else if (!strcmp (node->name, "lock")) else if (!strcmp (node->name, "lock"))
@ -657,7 +657,7 @@ parse_arg_default (GString *s, xmlNodePtr node)
g_string_append_c (s, ' '); g_string_append_c (s, ' ');
g_string_append (s, arr[0]); g_string_append (s, arr[0]);
g_string_append (s, val); g_string_append (s, val);
if (arr[1] && arg[2]) if (arr[1] && arr[2])
g_string_append (s, arr[2]); g_string_append (s, arr[2]);
} }
@ -680,7 +680,7 @@ screensaver_read_xml (xmlNodePtr saver_node)
args = g_string_new (saver->name); args = g_string_new (saver->name);
for (node = saver_node->childs; node; node = node->next) { for (node = saver_node->children; node; node = node->next) {
if (!strcmp (node->name, "command-line")) if (!strcmp (node->name, "command-line"))
saver->command_line = saver->command_line =
g_strdup (xmlNodeGetContent (node)); g_strdup (xmlNodeGetContent (node));
@ -757,7 +757,7 @@ screensaver_new_from_file (const gchar *filename)
if (!doc) if (!doc)
return NULL; return NULL;
node = doc->root; node = doc->children;
if (!node) if (!node)
{ {
xmlFreeDoc (doc); xmlFreeDoc (doc);

View file

@ -26,7 +26,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <tree.h> #include <libxml/tree.h>
enum _SelectionMode { enum _SelectionMode {
SM_DISABLE_SCREENSAVER, SM_DISABLE_SCREENSAVER,

View file

@ -149,8 +149,8 @@ guint prefs_widget_get_type (void)
sizeof (PrefsWidgetClass), sizeof (PrefsWidgetClass),
(GtkClassInitFunc) prefs_widget_class_init, (GtkClassInitFunc) prefs_widget_class_init,
(GtkObjectInitFunc) prefs_widget_init, (GtkObjectInitFunc) prefs_widget_init,
(GtkArgSetFunc) NULL, NULL,
(GtkArgGetFunc) NULL, NULL,
}; };
prefs_widget_type = prefs_widget_type =
@ -194,7 +194,7 @@ prefs_widget_init (PrefsWidget *prefs_widget)
prefs_widget->priv = g_new0 (PrefsWidgetPrivate, 1); prefs_widget->priv = g_new0 (PrefsWidgetPrivate, 1);
prefs_widget->priv->xml = prefs_widget->priv->xml =
glade_xml_new (GNOMECC_GLADE_DIR "/screensaver-properties.glade", glade_xml_new (GNOMECC_GLADE_DIR "/screensaver-properties.glade",
NULL); NULL, NULL);
if (!prefs_widget->priv->xml) if (!prefs_widget->priv->xml)
return; return;
@ -328,7 +328,7 @@ prefs_widget_class_init (PrefsWidgetClass *class)
prefs_widget_signals[STATE_CHANGED_SIGNAL] = prefs_widget_signals[STATE_CHANGED_SIGNAL] =
gtk_signal_new ("pref-changed", GTK_RUN_FIRST, gtk_signal_new ("pref-changed", GTK_RUN_FIRST,
object_class->type, G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (PrefsWidgetClass, GTK_SIGNAL_OFFSET (PrefsWidgetClass,
state_changed), state_changed),
gtk_signal_default_marshaller, gtk_signal_default_marshaller,
@ -336,15 +336,12 @@ prefs_widget_class_init (PrefsWidgetClass *class)
prefs_widget_signals[ACTIVATE_DEMO_SIGNAL] = prefs_widget_signals[ACTIVATE_DEMO_SIGNAL] =
gtk_signal_new ("activate_demo", GTK_RUN_FIRST, gtk_signal_new ("activate_demo", GTK_RUN_FIRST,
object_class->type, G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (PrefsWidgetClass, GTK_SIGNAL_OFFSET (PrefsWidgetClass,
activate_demo), activate_demo),
gtk_signal_default_marshaller, gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0); GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, prefs_widget_signals,
LAST_SIGNAL);
class->state_changed = NULL; class->state_changed = NULL;
object_class->destroy = prefs_widget_destroy; object_class->destroy = prefs_widget_destroy;

View file

@ -263,7 +263,7 @@ show_screensaver_timeout (void)
gdk_pixbuf_unref (pixbuf); gdk_pixbuf_unref (pixbuf);
pixbuf = gdk_pixbuf_new_from_file pixbuf = gdk_pixbuf_new_from_file
(GNOMECC_PIXMAPS_DIR "/no-hack.png"); (GNOMECC_PIXMAPS_DIR "/no-hack.png", NULL);
gdk_pixbuf_render_to_drawable gdk_pixbuf_render_to_drawable
(pixbuf, (GdkDrawable *) preview_window->window, (pixbuf, (GdkDrawable *) preview_window->window,
preview_window->style->fg_gc[0], 0, 0, 0, 0, preview_window->style->fg_gc[0], 0, 0, 0, 0,
@ -291,7 +291,7 @@ show_preview (Screensaver *saver)
if (saver->fakepreview) if (saver->fakepreview)
{ {
pixbuf = gdk_pixbuf_new_from_file (saver->fakepreview); pixbuf = gdk_pixbuf_new_from_file (saver->fakepreview, NULL);
gdk_pixbuf_render_to_drawable gdk_pixbuf_render_to_drawable
(pixbuf, (GdkDrawable *) preview_window->window, (pixbuf, (GdkDrawable *) preview_window->window,
preview_window->style->fg_gc[0], 0, 0, 0, 0, preview_window->style->fg_gc[0], 0, 0, 0, 0,
@ -332,7 +332,7 @@ show_blank_preview (void)
if (pixbuf) if (pixbuf)
gdk_pixbuf_unref (pixbuf); gdk_pixbuf_unref (pixbuf);
pixbuf = gdk_pixbuf_new_from_file (GNOMECC_PIXMAPS_DIR "/blank-screen.png"); pixbuf = gdk_pixbuf_new_from_file (GNOMECC_PIXMAPS_DIR "/blank-screen.png", NULL);
gdk_pixbuf_render_to_drawable gdk_pixbuf_render_to_drawable
(pixbuf, (GdkDrawable *) preview_window->window, (pixbuf, (GdkDrawable *) preview_window->window,
preview_window->style->fg_gc[0], 0, 0, 0, 0, preview_window->style->fg_gc[0], 0, 0, 0, 0,
@ -344,16 +344,7 @@ show_blank_preview (void)
static GdkWindow * static GdkWindow *
gdk_window_new_from_xwindow (Window xwindow) gdk_window_new_from_xwindow (Window xwindow)
{ {
GdkWindow *window; return gdk_window_foreign_new (xwindow);
GdkWindowPrivate *window_priv;
window_priv = g_new0 (GdkWindowPrivate, 1);
window = (GdkWindow *) window_priv;
window_priv->xdisplay = gdk_display;
window_priv->xwindow = xwindow;
window_priv->destroyed = FALSE;
return window;
} }
static GdkWindow * static GdkWindow *

View file

@ -230,7 +230,7 @@ get_screensaver_dir_list (void)
while (fgets (buffer, 1024, in)) { while (fgets (buffer, 1024, in)) {
buffer[strlen(buffer) - 1] = '\0'; buffer[strlen(buffer) - 1] = '\0';
if (g_file_test (buffer, G_FILE_TEST_ISDIR)) { if (g_file_test (buffer, G_FILE_TEST_IS_DIR)) {
list_tail = g_list_append (NULL, g_strdup (buffer)); list_tail = g_list_append (NULL, g_strdup (buffer));
if (screensaver_dir_list == NULL) if (screensaver_dir_list == NULL)
screensaver_dir_list = list_tail; screensaver_dir_list = list_tail;
@ -264,7 +264,7 @@ rc_command_exists (char *command)
/* If this is a complete path, then just stat it */ /* If this is a complete path, then just stat it */
if (strchr (program, '/')) { if (strchr (program, '/')) {
if (g_file_test (program, G_FILE_TEST_ISFILE)) if (g_file_test (program, G_FILE_TEST_IS_REGULAR))
ret = TRUE; ret = TRUE;
else else
ret = FALSE; ret = FALSE;
@ -280,7 +280,7 @@ rc_command_exists (char *command)
for (node = screensaver_dir_list; node; node = node->next) { for (node = screensaver_dir_list; node; node = node->next) {
fullpath = g_concat_dir_and_file ((gchar *) node->data, fullpath = g_concat_dir_and_file ((gchar *) node->data,
program); program);
if (g_file_test (fullpath, G_FILE_TEST_ISFILE)) { if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR)) {
g_free (program); g_free (program);
g_free (fullpath); g_free (fullpath);
return TRUE; return TRUE;

View file

@ -30,7 +30,7 @@
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include <X11/Shell.h> #include <X11/Shell.h>
#include <gdk/gdkprivate.h> #include <gdk/gdkx.h>
#include "resources.h" #include "resources.h"
#include "rc-parse.h" #include "rc-parse.h"

View file

@ -26,12 +26,12 @@
#endif #endif
#include <gnome.h> #include <gnome.h>
#include <parser.h> #include <libxml/parser.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <tree.h> #include <libxml/tree.h>
#include "screensaver-prefs-dialog.h" #include "screensaver-prefs-dialog.h"
#include "preferences.h" #include "preferences.h"
@ -157,8 +157,8 @@ screensaver_prefs_dialog_get_type (void)
sizeof (ScreensaverPrefsDialogClass), sizeof (ScreensaverPrefsDialogClass),
(GtkClassInitFunc) screensaver_prefs_dialog_class_init, (GtkClassInitFunc) screensaver_prefs_dialog_class_init,
(GtkObjectInitFunc) screensaver_prefs_dialog_init, (GtkObjectInitFunc) screensaver_prefs_dialog_init,
(GtkArgSetFunc) NULL, NULL,
(GtkArgGetFunc) NULL NULL
}; };
screensaver_prefs_dialog_type = screensaver_prefs_dialog_type =
@ -233,7 +233,7 @@ screensaver_prefs_dialog_class_init (ScreensaverPrefsDialogClass *class)
screensaver_prefs_dialog_signals[OK_CLICKED_SIGNAL] = screensaver_prefs_dialog_signals[OK_CLICKED_SIGNAL] =
gtk_signal_new ("ok-clicked", GTK_RUN_FIRST, gtk_signal_new ("ok-clicked", GTK_RUN_FIRST,
object_class->type, G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET GTK_SIGNAL_OFFSET
(ScreensaverPrefsDialogClass, ok_clicked), (ScreensaverPrefsDialogClass, ok_clicked),
gtk_signal_default_marshaller, gtk_signal_default_marshaller,
@ -241,16 +241,12 @@ screensaver_prefs_dialog_class_init (ScreensaverPrefsDialogClass *class)
screensaver_prefs_dialog_signals[DEMO_SIGNAL] = screensaver_prefs_dialog_signals[DEMO_SIGNAL] =
gtk_signal_new ("demo", GTK_RUN_FIRST, gtk_signal_new ("demo", GTK_RUN_FIRST,
object_class->type, G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET GTK_SIGNAL_OFFSET
(ScreensaverPrefsDialogClass, demo), (ScreensaverPrefsDialogClass, demo),
gtk_signal_default_marshaller, gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0); GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class,
screensaver_prefs_dialog_signals,
LAST_SIGNAL);
object_class->destroy = object_class->destroy =
(void (*) (GtkObject *)) screensaver_prefs_dialog_destroy; (void (*) (GtkObject *)) screensaver_prefs_dialog_destroy;
@ -285,7 +281,7 @@ screensaver_prefs_dialog_new (Screensaver *saver)
xmlDocGetRootElement (dialog->argument_doc); xmlDocGetRootElement (dialog->argument_doc);
} }
if (dialog->cli_args_db && dialog->argument_data && dialog->argument_data->childs && dialog->argument_data->childs->next) { if (dialog->cli_args_db && dialog->argument_data && dialog->argument_data->children && dialog->argument_data->children->next) {
settings_widget = settings_widget =
get_screensaver_widget (dialog); get_screensaver_widget (dialog);
} else { } else {
@ -408,7 +404,7 @@ activate_option_cb (GtkWidget *widget)
option_def = gtk_object_get_data (GTK_OBJECT (widget), "option_def"); option_def = gtk_object_get_data (GTK_OBJECT (widget), "option_def");
select_data = gtk_object_get_data (GTK_OBJECT (widget), "select_data"); select_data = gtk_object_get_data (GTK_OBJECT (widget), "select_data");
node = select_data->childs; node = select_data->children;
while (node) { while (node) {
if (node != option_def) if (node != option_def)
@ -533,7 +529,7 @@ write_select (xmlNodePtr argument_data, GTree *widget_db)
menu_item = GTK_MENU_SHELL (menu)->children; menu_item = GTK_MENU_SHELL (menu)->children;
active = gtk_menu_get_active (GTK_MENU (menu)); active = gtk_menu_get_active (GTK_MENU (menu));
for (node = argument_data->childs; node && menu_item; for (node = argument_data->children; node && menu_item;
node = node->next) node = node->next)
{ {
if (!xmlGetProp (node, "id")) continue; if (!xmlGetProp (node, "id")) continue;
@ -593,9 +589,9 @@ write_command_line (gchar *name, xmlNodePtr argument_data, GTree *widget_db)
gboolean free_v = FALSE; gboolean free_v = FALSE;
line = g_string_new (name); line = g_string_new (name);
node = argument_data->childs; node = argument_data->children;
for (node = argument_data->childs; node; node = node->next) { for (node = argument_data->children; node; node = node->next) {
if (!strcmp (node->name, "boolean")) { if (!strcmp (node->name, "boolean")) {
arg = write_boolean (node, widget_db); arg = write_boolean (node, widget_db);
free_v = FALSE; free_v = FALSE;
@ -751,13 +747,13 @@ get_argument_data (Screensaver *saver)
if (!doc) if (!doc)
return NULL; return NULL;
if (!(doc->root && doc->root->childs)) if (!(doc->children && doc->children->children))
{ {
xmlFreeDoc (doc); xmlFreeDoc (doc);
return NULL; return NULL;
} }
for (node = doc->root->childs; node != NULL; node = node->next) for (node = doc->children->children; node != NULL; node = node->next)
{ {
if (!strcmp (node->name, "select") if (!strcmp (node->name, "select")
|| !strcmp (node->name, "number") || !strcmp (node->name, "number")
@ -903,7 +899,7 @@ get_select_widget (ScreensaverPrefsDialog *dialog, xmlNodePtr select_data,
gtk_object_set_data (GTK_OBJECT (option_menu), "option_def", gtk_object_set_data (GTK_OBJECT (option_menu), "option_def",
select_data); select_data);
for (node = select_data->childs; node; node = node->next) { for (node = select_data->children; node; node = node->next) {
option_str = xmlGetProp (node, "_label"); option_str = xmlGetProp (node, "_label");
if (!option_str) continue; if (!option_str) continue;
@ -1186,7 +1182,7 @@ place_hgroup (ScreensaverPrefsDialog *dialog,
hbox = gtk_hbox_new (FALSE, 5); hbox = gtk_hbox_new (FALSE, 5);
for (node = hgroup_data->childs; node; node = node->next) { for (node = hgroup_data->children; node; node = node->next) {
id = xmlGetProp (node, "id"); id = xmlGetProp (node, "id");
if (!id) continue; if (!id) continue;
@ -1296,7 +1292,7 @@ populate_table (ScreensaverPrefsDialog *dialog, GtkTable *table)
g_return_if_fail (table != NULL); g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table)); g_return_if_fail (GTK_IS_TABLE (table));
for (node = dialog->argument_data->childs; node; node = node->next) { for (node = dialog->argument_data->children; node; node = node->next) {
id = xmlGetProp (node, "id"); id = xmlGetProp (node, "id");
if (!id && strcmp (node->name, "hgroup")) continue; if (!id && strcmp (node->name, "hgroup")) continue;
@ -1568,7 +1564,7 @@ read_select (GTree *widget_db, xmlNodePtr argument_data,
/* Get the index of the selected option */ /* Get the index of the selected option */
for (node = argument_data->childs; node; node = node->next) { for (node = argument_data->children; node; node = node->next) {
if (!xmlGetProp (node, "id")) continue; if (!xmlGetProp (node, "id")) continue;
found = arg_is_set (node, cli_db); found = arg_is_set (node, cli_db);
@ -1588,7 +1584,7 @@ read_select (GTree *widget_db, xmlNodePtr argument_data,
i = 0; i = 0;
for (node = argument_data->childs; node; node = node->next) { for (node = argument_data->children; node; node = node->next) {
if (!xmlGetProp (node, "id")) continue; if (!xmlGetProp (node, "id")) continue;
if (i != set_idx) if (i != set_idx)
@ -1600,7 +1596,7 @@ read_select (GTree *widget_db, xmlNodePtr argument_data,
i = 0; i = 0;
for (node = argument_data->childs; node; node = node->next) { for (node = argument_data->children; node; node = node->next) {
if (!xmlGetProp (node, "id")) continue; if (!xmlGetProp (node, "id")) continue;
if (i == set_idx) { if (i == set_idx) {
@ -1656,7 +1652,7 @@ place_screensaver_properties (ScreensaverPrefsDialog *dialog,
{ {
xmlNodePtr node; xmlNodePtr node;
for (node = argument_data->childs; node; node = node->next) { for (node = argument_data->children; node; node = node->next) {
if (!strcmp (node->name, "boolean")) if (!strcmp (node->name, "boolean"))
read_boolean (dialog->widget_db, node, read_boolean (dialog->widget_db, node,
dialog->cli_args_db); dialog->cli_args_db);
@ -1738,6 +1734,8 @@ demo_cb (GtkWidget *widget, ScreensaverPrefsDialog *dialog)
static void static void
help_cb (GtkWidget *widget, ScreensaverPrefsDialog *dialog) help_cb (GtkWidget *widget, ScreensaverPrefsDialog *dialog)
{ {
/* I can't even find the current help... */
#if 0
GnomeHelpMenuEntry entry; GnomeHelpMenuEntry entry;
gchar *url; gchar *url;
@ -1756,6 +1754,7 @@ help_cb (GtkWidget *widget, ScreensaverPrefsDialog *dialog)
gnome_url_show (url); gnome_url_show (url);
g_free (url); g_free (url);
} }
#endif
} }
static void static void

View file

@ -25,7 +25,7 @@
#define __SCREENSAVER_PREFS_DIALOG_H #define __SCREENSAVER_PREFS_DIALOG_H
#include <gnome.h> #include <gnome.h>
#include <tree.h> #include <libxml/tree.h>
#include <glade/glade.h> #include <glade/glade.h>
#include "preferences.h" #include "preferences.h"

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,7 @@
#include <ctype.h> #include <ctype.h>
#include <gnome.h> #include <gnome.h>
#include <parser.h> #include <libxml/parser.h>
#include "selection-dialog.h" #include "selection-dialog.h"
#include "preferences.h" #include "preferences.h"
@ -78,8 +78,8 @@ selection_dialog_get_type (void)
sizeof (SelectionDialogClass), sizeof (SelectionDialogClass),
(GtkClassInitFunc) selection_dialog_class_init, (GtkClassInitFunc) selection_dialog_class_init,
(GtkObjectInitFunc) selection_dialog_init, (GtkObjectInitFunc) selection_dialog_init,
(GtkArgSetFunc) NULL, NULL,
(GtkArgGetFunc) NULL NULL
}; };
selection_dialog_type = selection_dialog_type =
@ -143,16 +143,12 @@ selection_dialog_class_init (SelectionDialogClass *class)
selection_dialog_signals[OK_CLICKED_SIGNAL] = selection_dialog_signals[OK_CLICKED_SIGNAL] =
gtk_signal_new ("ok-clicked", GTK_RUN_FIRST, gtk_signal_new ("ok-clicked", GTK_RUN_FIRST,
object_class->type, G_OBJECT_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (SelectionDialogClass, GTK_SIGNAL_OFFSET (SelectionDialogClass,
ok_clicked), ok_clicked),
gtk_marshal_NONE__POINTER, gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
gtk_object_class_add_signals (object_class,
selection_dialog_signals,
LAST_SIGNAL);
known_savers = get_known_savers (); known_savers = get_known_savers ();
class->ok_clicked = NULL; class->ok_clicked = NULL;

View file

@ -26,7 +26,7 @@
#define __SELECTION_DIALOG_H #define __SELECTION_DIALOG_H
#include <gnome.h> #include <gnome.h>
#include <tree.h> #include <libxml/tree.h>
#include "prefs-widget.h" #include "prefs-widget.h"