Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 236062
Collapse All | Expand All

(-)src-old/choices.c (-3 / +3 lines)
Lines 89-95 Link Here
89
89
90
	while (*cdir)
90
	while (*cdir)
91
	{
91
	{
92
		guchar	*path;
92
		gchar	*path;
93
93
94
		path = g_strconcat(*cdir, "/", dir, NULL);
94
		path = g_strconcat(*cdir, "/", dir, NULL);
95
		if (exists(path))
95
		if (exists(path))
Lines 123-129 Link Here
123
 * The return values may be NULL - use built-in defaults.
123
 * The return values may be NULL - use built-in defaults.
124
 * g_free() the result.
124
 * g_free() the result.
125
 */
125
 */
126
guchar *choices_find_path_load(char *leaf, char *dir)
126
gchar *choices_find_path_load(char *leaf, char *dir)
127
{
127
{
128
	gchar	**cdir = dir_list;
128
	gchar	**cdir = dir_list;
129
129
Lines 153-159 Link Here
153
 *
153
 *
154
 * g_free() the result.
154
 * g_free() the result.
155
 */
155
 */
156
guchar *choices_find_path_save(char *leaf, char *dir, gboolean create)
156
gchar *choices_find_path_save(char *leaf, char *dir, gboolean create)
157
{
157
{
158
	gchar	*path, *retval;
158
	gchar	*path, *retval;
159
	
159
	
(-)src-old/choices.h (-2 / +2 lines)
Lines 12-18 Link Here
12
void 		choices_init	       (void);
12
void 		choices_init	       (void);
13
GPtrArray	*choices_list_dirs     (char *dir);
13
GPtrArray	*choices_list_dirs     (char *dir);
14
void		choices_free_list      (GPtrArray *list);
14
void		choices_free_list      (GPtrArray *list);
15
guchar 		*choices_find_path_load(char *leaf, char *dir);
15
gchar 		*choices_find_path_load(char *leaf, char *dir);
16
guchar	   	*choices_find_path_save(char *leaf, char *dir, gboolean create);
16
gchar	   	*choices_find_path_save(char *leaf, char *dir, gboolean create);
17
17
18
#endif /* _CHOICES_H */
18
#endif /* _CHOICES_H */
(-)src-old/dpms.c (-7 / +7 lines)
Lines 32-43 Link Here
32
32
33
	if (!DPMSQueryExtension(dpy, &event, &error))
33
	if (!DPMSQueryExtension(dpy, &event, &error))
34
	{
34
	{
35
		g_warning(_("DPMS extension not supported"));
35
		g_warning("%s", _("DPMS extension not supported"));
36
		return FALSE;
36
		return FALSE;
37
	}
37
	}
38
	if (!DPMSCapable(dpy))
38
	if (!DPMSCapable(dpy))
39
	{
39
	{
40
		g_warning(_("Display not capable of DPMS"));
40
		g_warning("%s", _("Display not capable of DPMS"));
41
		return FALSE;
41
		return FALSE;
42
	}
42
	}
43
	return TRUE;
43
	return TRUE;
Lines 52-71 Link Here
52
52
53
	if (standby < 10 || suspend < 10 || off < 10)
53
	if (standby < 10 || suspend < 10 || off < 10)
54
	{
54
	{
55
		g_warning(_("DPMS timeout under 10 seconds, rounding up"));
55
		g_warning("%s", _("DPMS timeout under 10 seconds, rounding up"));
56
		if (standby < 10) standby = 10;
56
		if (standby < 10) standby = 10;
57
		if (suspend < 10) suspend = 10;
57
		if (suspend < 10) suspend = 10;
58
		if (off < 10) off = 10;
58
		if (off < 10) off = 10;
59
	}
59
	}
60
	if (!DPMSGetTimeouts(dpy, &old_standby, &old_suspend, &old_off))
60
	if (!DPMSGetTimeouts(dpy, &old_standby, &old_suspend, &old_off))
61
	{
61
	{
62
		g_warning(_("Unable to read previous DPMS timeouts"));
62
		g_warning("%s", _("Unable to read previous DPMS timeouts"));
63
		old_standby = old_suspend = old_off = 0;
63
		old_standby = old_suspend = old_off = 0;
64
	}
64
	}
65
	if (old_standby != standby || old_suspend != suspend || old_off != off)
65
	if (old_standby != standby || old_suspend != suspend || old_off != off)
66
	{
66
	{
67
		if (!DPMSSetTimeouts(dpy, standby, suspend, off))
67
		if (!DPMSSetTimeouts(dpy, standby, suspend, off))
68
			g_warning(_("Unable to set DPMS timeouts"));
68
			g_warning("%s", _("Unable to set DPMS timeouts"));
69
	}
69
	}
70
}
70
}
71
71
Lines 78-90 Link Here
78
		return;
78
		return;
79
	if (!DPMSInfo(dpy, &old_power, &old_enabled))
79
	if (!DPMSInfo(dpy, &old_power, &old_enabled))
80
	{
80
	{
81
		g_warning(_("Unable to get DPMS state"));
81
		g_warning("%s", _("Unable to get DPMS state"));
82
		old_enabled = ! enable;
82
		old_enabled = ! enable;
83
	}
83
	}
84
	if (old_enabled != enable)
84
	if (old_enabled != enable)
85
	{
85
	{
86
		if (!(enable ? DPMSEnable(dpy) : DPMSDisable(dpy)))
86
		if (!(enable ? DPMSEnable(dpy) : DPMSDisable(dpy)))
87
			g_warning(_("Unable to set DPMS state"));
87
			g_warning("%s", _("Unable to set DPMS state"));
88
	}
88
	}
89
}
89
}
90
90
(-)src-old/i18n.c (-5 / +5 lines)
Lines 46-54 Link Here
46
static GtkWidget *i18n_message = NULL;
46
static GtkWidget *i18n_message = NULL;
47
47
48
/* Static Prototypes */
48
/* Static Prototypes */
49
static void set_trans(const guchar *lang);
49
static void set_trans(const gchar *lang);
50
static void trans_changed(void);
50
static void trans_changed(void);
51
static GList *build_i18n_message(Option *option, xmlNode *node, guchar *label);
51
static GList *build_i18n_message(Option *option, xmlNode *node, gchar *label);
52
52
53
/****************************************************************
53
/****************************************************************
54
 *			EXTERNAL INTERFACE			*
54
 *			EXTERNAL INTERFACE			*
Lines 88-97 Link Here
88
/* Load the 'Messages/<name>.gmo' translation.
88
/* Load the 'Messages/<name>.gmo' translation.
89
 * Special values 'None' and 'From LANG' are also allowed.
89
 * Special values 'None' and 'From LANG' are also allowed.
90
 */
90
 */
91
static void set_trans(const guchar *lang)
91
static void set_trans(const gchar *lang)
92
{
92
{
93
	struct stat info;
93
	struct stat info;
94
	guchar	*path;
94
	gchar	*path;
95
	gchar	*lang2 = NULL;
95
	gchar	*lang2 = NULL;
96
96
97
	g_return_if_fail(lang != NULL);
97
	g_return_if_fail(lang != NULL);
Lines 124-130 Link Here
124
	g_free(path);
124
	g_free(path);
125
}
125
}
126
126
127
static GList *build_i18n_message(Option *option, xmlNode *node, guchar *label)
127
static GList *build_i18n_message(Option *option, xmlNode *node, gchar *label)
128
{
128
{
129
	GtkWidget *hbox, *image, *align;
129
	GtkWidget *hbox, *image, *align;
130
130
(-)src-old/log.c (-4 / +4 lines)
Lines 75-81 Link Here
75
			 GdkInputCondition condition);
75
			 GdkInputCondition condition);
76
static gint log_clicked(GtkWidget *text, GdkEventButton *bev, gpointer data);
76
static gint log_clicked(GtkWidget *text, GdkEventButton *bev, gpointer data);
77
static void log_msg(const gchar *text, gint len);
77
static void log_msg(const gchar *text, gint len);
78
static GList *show_log(Option *option, xmlNode *node, guchar *label);
78
static GList *show_log(Option *option, xmlNode *node, gchar *label);
79
void show_message_log(void);
79
void show_message_log(void);
80
static void log_own_errors(const gchar *log_domain,
80
static void log_own_errors(const gchar *log_domain,
81
			   GLogLevelFlags log_level,
81
			   GLogLevelFlags log_level,
Lines 366-372 Link Here
366
	g_print("%s\n", message);
366
	g_print("%s\n", message);
367
}
367
}
368
368
369
static void write_stderr(guchar *buffer, int len)
369
static void write_stderr(gchar *buffer, int len)
370
{
370
{
371
	int	pos = 0, sent;
371
	int	pos = 0, sent;
372
372
Lines 391-397 Link Here
391
			 gint source,
391
			 gint source,
392
			 GdkInputCondition condition)
392
			 GdkInputCondition condition)
393
{
393
{
394
	guchar	buffer[BUFFER_SIZE];
394
	gchar	buffer[BUFFER_SIZE];
395
	int	got;
395
	int	got;
396
396
397
	got = read(source, buffer, BUFFER_SIZE);
397
	got = read(source, buffer, BUFFER_SIZE);
Lines 503-509 Link Here
503
	return 1;
503
	return 1;
504
}
504
}
505
505
506
static GList *show_log(Option *option, xmlNode *node, guchar *label)
506
static GList *show_log(Option *option, xmlNode *node, gchar *label)
507
{
507
{
508
	GtkWidget *button, *align;
508
	GtkWidget *button, *align;
509
509
(-)src-old/main.c (-3 / +3 lines)
Lines 103-116 Link Here
103
};
103
};
104
#endif
104
#endif
105
105
106
guchar *app_dir;
106
gchar *app_dir;
107
107
108
int main(int argc, char **argv)
108
int main(int argc, char **argv)
109
{
109
{
110
	gboolean		wait_mode = FALSE;
110
	gboolean		wait_mode = FALSE;
111
	gboolean		messages = FALSE;
111
	gboolean		messages = FALSE;
112
	gboolean		no_xkb = FALSE;
112
	gboolean		no_xkb = FALSE;
113
	guchar			*rc_file;
113
	gchar			*rc_file;
114
114
115
	app_dir = g_strdup(getenv("APP_DIR"));
115
	app_dir = g_strdup(getenv("APP_DIR"));
116
116
Lines 227-233 Link Here
227
void login_failure(int error)
227
void login_failure(int error)
228
{
228
{
229
	GString		*message;
229
	GString		*message;
230
	guchar		*login;
230
	gchar		*login;
231
231
232
	login = choices_find_path_load("Login", "ROX-Session");
232
	login = choices_find_path_load("Login", "ROX-Session");
233
	if (!login)
233
	if (!login)
(-)src-old/main.h (-1 / +1 lines)
Lines 9-15 Link Here
9
#define _MAIN_H
9
#define _MAIN_H
10
10
11
extern int number_of_windows;
11
extern int number_of_windows;
12
extern guchar *app_dir;
12
extern gchar *app_dir;
13
extern gboolean test_mode;
13
extern gboolean test_mode;
14
14
15
/* Prototypes */
15
/* Prototypes */
(-)src-old/options.c (-77 / +79 lines)
Lines 132-149 Link Here
132
static void load_options(xmlDoc *doc);
132
static void load_options(xmlDoc *doc);
133
static gboolean check_anything_changed(void);
133
static gboolean check_anything_changed(void);
134
134
135
static GList *build_label(Option *option, xmlNode *node, guchar *label);
135
static GList *build_label(Option *option, xmlNode *node, gchar *label);
136
static GList *build_spacer(Option *option, xmlNode *node, guchar *label);
136
static GList *build_spacer(Option *option, xmlNode *node, gchar *label);
137
static GList *build_frame(Option *option, xmlNode *node, guchar *label);
137
static GList *build_frame(Option *option, xmlNode *node, gchar *label);
138
138
139
static GList *build_toggle(Option *option, xmlNode *node, guchar *label);
139
static GList *build_toggle(Option *option, xmlNode *node, gchar *label);
140
static GList *build_slider(Option *option, xmlNode *node, guchar *label);
140
static GList *build_slider(Option *option, xmlNode *node, gchar *label);
141
static GList *build_entry(Option *option, xmlNode *node, guchar *label);
141
static GList *build_entry(Option *option, xmlNode *node, gchar *label);
142
static GList *build_numentry(Option *option, xmlNode *node, guchar *label);
142
static GList *build_numentry(Option *option, xmlNode *node, gchar *label);
143
static GList *build_radio_group(Option *option, xmlNode *node, guchar *label);
143
static GList *build_radio_group(Option *option, xmlNode *node, gchar *label);
144
static GList *build_colour(Option *option, xmlNode *node, guchar *label);
144
static GList *build_colour(Option *option, xmlNode *node, gchar *label);
145
static GList *build_menu(Option *option, xmlNode *node, guchar *label);
145
static GList *build_menu(Option *option, xmlNode *node, gchar *label);
146
static GList *build_font(Option *option, xmlNode *node, guchar *label);
146
static GList *build_font(Option *option, xmlNode *node, gchar *label);
147
147
148
/****************************************************************
148
/****************************************************************
149
 *			EXTERNAL INTERFACE			*
149
 *			EXTERNAL INTERFACE			*
Lines 210-216 Link Here
210
 */
210
 */
211
void option_check_widget(Option *option)
211
void option_check_widget(Option *option)
212
{
212
{
213
	guchar		*new = NULL;
213
	gchar		*new = NULL;
214
214
215
	if (updating_widgets)
215
	if (updating_widgets)
216
		return;		/* Not caused by the user... */
216
		return;		/* Not caused by the user... */
Lines 493-503 Link Here
493
/* These are used during parsing... */
493
/* These are used during parsing... */
494
static xmlDocPtr options_doc = NULL;
494
static xmlDocPtr options_doc = NULL;
495
495
496
#define DATA(node) (xmlNodeListGetString(options_doc, node->xmlChildrenNode, 1))
496
#define DATA(node) (gchar*)(xmlNodeListGetString(options_doc, node->xmlChildrenNode, 1))
497
497
498
static void may_add_tip(GtkWidget *widget, xmlNode *element)
498
static void may_add_tip(GtkWidget *widget, xmlNode *element)
499
{
499
{
500
	guchar	*data, *tip;
500
	gchar	*data, *tip;
501
501
502
	data = DATA(element);
502
	data = DATA(element);
503
	if (!data)
503
	if (!data)
Lines 511-522 Link Here
511
}
511
}
512
512
513
/* Returns zero if attribute is not present */
513
/* Returns zero if attribute is not present */
514
static int get_int(xmlNode *node, guchar *attr)
514
static int get_int(xmlNode *node, gchar *attr)
515
{
515
{
516
	guchar *txt;
516
	gchar *txt;
517
	int	retval;
517
	int	retval;
518
	guchar* my_attr = (guchar *)attr;
518
519
519
	txt = xmlGetProp(node, attr);
520
	txt = (gchar*)xmlGetProp(node, my_attr);
520
	if (!txt)
521
	if (!txt)
521
		return 0;
522
		return 0;
522
523
Lines 541-547 Link Here
541
	g_return_if_fail(node != NULL);
542
	g_return_if_fail(node != NULL);
542
	g_return_if_fail(widget != NULL);
543
	g_return_if_fail(widget != NULL);
543
544
544
	name = xmlGetProp(node, "sizegroup");
545
	name = xmlGetProp(node, (xmlChar*)"sizegroup");
545
	if (!name)
546
	if (!name)
546
		return;
547
		return;
547
548
Lines 570-578 Link Here
570
{
571
{
571
	GtkWidget	*button;
572
	GtkWidget	*button;
572
	GtkRadioButton	*prev_button = (GtkRadioButton *) prev;
573
	GtkRadioButton	*prev_button = (GtkRadioButton *) prev;
573
	guchar		*label;
574
	gchar		*label;
574
575
575
	label = xmlGetProp(radio, "label");
576
	label = (gchar*)xmlGetProp(radio, (xmlChar*)"label");
576
577
577
	button = gtk_radio_button_new_with_label(
578
	button = gtk_radio_button_new_with_label(
578
			prev_button ? gtk_radio_button_get_group(prev_button)
579
			prev_button ? gtk_radio_button_get_group(prev_button)
Lines 583-589 Link Here
583
	may_add_tip(button, radio);
584
	may_add_tip(button, radio);
584
585
585
	g_object_set_data(G_OBJECT(button), "value",
586
	g_object_set_data(G_OBJECT(button), "value",
586
			  xmlGetProp(radio, "value"));
587
			  xmlGetProp(radio, (xmlChar*)"value"));
587
588
588
	return button;
589
	return button;
589
}
590
}
Lines 591-601 Link Here
591
static void build_menu_item(xmlNode *node, GtkWidget *option_menu)
592
static void build_menu_item(xmlNode *node, GtkWidget *option_menu)
592
{
593
{
593
	GtkWidget	*item, *menu;
594
	GtkWidget	*item, *menu;
594
	guchar		*label;
595
	gchar		*label;
595
596
596
	g_return_if_fail(strcmp(node->name, "item") == 0);
597
	g_return_if_fail(strcmp((gchar*)node->name, "item") == 0);
597
598
598
	label = xmlGetProp(node, "label");
599
	label = (gchar*)xmlGetProp(node, (xmlChar*)"label");
599
	item = gtk_menu_item_new_with_label(_(label));
600
	item = gtk_menu_item_new_with_label(_(label));
600
	g_free(label);
601
	g_free(label);
601
602
Lines 603-620 Link Here
603
	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
604
	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
604
	gtk_widget_show_all(menu);
605
	gtk_widget_show_all(menu);
605
606
606
	g_object_set_data(G_OBJECT(item), "value", xmlGetProp(node, "value"));
607
	g_object_set_data(G_OBJECT(item), "value", xmlGetProp(node, (xmlChar*)"value"));
607
}
608
}
608
609
609
static void build_widget(xmlNode *widget, GtkWidget *box)
610
static void build_widget(xmlNode *widget, GtkWidget *box)
610
{
611
{
611
	const char *name = widget->name;
612
	const char *name = (gchar*)widget->name;
612
	OptionBuildFn builder;
613
	OptionBuildFn builder;
613
	guchar	*oname;
614
	gchar	*oname;
614
	Option	*option;
615
	Option	*option;
615
	guchar	*label;
616
	gchar	*label;
616
617
617
	label = xmlGetProp(widget, "label");
618
	label = (gchar*)xmlGetProp(widget, (xmlChar*)"label");
618
619
619
	if (strcmp(name, "hbox") == 0 || strcmp(name, "vbox") == 0)
620
	if (strcmp(name, "hbox") == 0 || strcmp(name, "vbox") == 0)
620
	{
621
	{
Lines 641-647 Link Here
641
		return;
642
		return;
642
	}
643
	}
643
644
644
	oname = xmlGetProp(widget, "name");
645
	oname = (gchar*)xmlGetProp(widget, (xmlChar*)"name");
645
646
646
	if (oname)
647
	if (oname)
647
	{
648
	{
Lines 685-696 Link Here
685
static void build_section(xmlNode *section, GtkWidget *notebook,
686
static void build_section(xmlNode *section, GtkWidget *notebook,
686
			  GtkTreeStore *tree_store, GtkTreeIter *parent)
687
			  GtkTreeStore *tree_store, GtkTreeIter *parent)
687
{
688
{
688
	guchar 		*title = NULL;
689
	gchar 		*title = NULL;
689
	GtkWidget   	*page;
690
	GtkWidget   	*page;
690
	GtkTreeIter	iter;
691
	GtkTreeIter	iter;
691
	xmlNode		*widget;
692
	xmlNode		*widget;
692
693
693
	title = xmlGetProp(section, "title");
694
	title = (gchar*)xmlGetProp(section, (xmlChar*)"title");
694
	page = gtk_vbox_new(FALSE, 4);
695
	page = gtk_vbox_new(FALSE, 4);
695
	gtk_container_set_border_width(GTK_CONTAINER(page), 4);
696
	gtk_container_set_border_width(GTK_CONTAINER(page), 4);
696
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, NULL);
697
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, NULL);
Lines 704-710 Link Here
704
	{
705
	{
705
		if (widget->type == XML_ELEMENT_NODE)
706
		if (widget->type == XML_ELEMENT_NODE)
706
		{
707
		{
707
			if (strcmp(widget->name, "section") == 0)
708
			if (strcmp((gchar*)widget->name, "section") == 0)
708
				build_section(widget, notebook,
709
				build_section(widget, notebook,
709
						tree_store, &iter);
710
						tree_store, &iter);
710
			else
711
			else
Lines 740-746 Link Here
740
	g_free(path);
741
	g_free(path);
741
742
742
	options = xmlDocGetRootElement(options_doc);
743
	options = xmlDocGetRootElement(options_doc);
743
	if (strcmp(options->name, "options") == 0)
744
	if (strcmp((gchar*)options->name, "options") == 0)
744
	{
745
	{
745
		GtkTreePath *treepath;
746
		GtkTreePath *treepath;
746
747
Lines 928-941 Link Here
928
/* Given the last radio button in the group, select whichever
929
/* Given the last radio button in the group, select whichever
929
 * radio button matches the given value.
930
 * radio button matches the given value.
930
 */
931
 */
931
static void radio_group_set_value(GtkRadioButton *last, guchar *value)
932
static void radio_group_set_value(GtkRadioButton *last, gchar *value)
932
{	
933
{	
933
	GSList	*next;
934
	GSList	*next;
934
935
935
	for (next = gtk_radio_button_get_group(last); next; next = next->next)
936
	for (next = gtk_radio_button_get_group(last); next; next = next->next)
936
	{
937
	{
937
		GtkToggleButton *button = (GtkToggleButton *) next->data;
938
		GtkToggleButton *button = (GtkToggleButton *) next->data;
938
		guchar	*val;
939
		gchar	*val;
939
940
940
		val = g_object_get_data(G_OBJECT(button), "value");
941
		val = g_object_get_data(G_OBJECT(button), "value");
941
		g_return_if_fail(val != NULL);
942
		g_return_if_fail(val != NULL);
Lines 953-959 Link Here
953
/* Given the last radio button in the group, return a copy of the
954
/* Given the last radio button in the group, return a copy of the
954
 * value for the selected radio item.
955
 * value for the selected radio item.
955
 */
956
 */
956
static guchar *radio_group_get_value(GtkRadioButton *last)
957
static gchar *radio_group_get_value(GtkRadioButton *last)
957
{
958
{
958
	GSList	*next;
959
	GSList	*next;
959
960
Lines 963-969 Link Here
963
964
964
		if (gtk_toggle_button_get_active(button))
965
		if (gtk_toggle_button_get_active(button))
965
		{
966
		{
966
			guchar	*val;
967
			gchar	*val;
967
968
968
			val = g_object_get_data(G_OBJECT(button), "value");
969
			val = g_object_get_data(G_OBJECT(button), "value");
969
			g_return_val_if_fail(val != NULL, NULL);
970
			g_return_val_if_fail(val != NULL, NULL);
Lines 976-982 Link Here
976
}
977
}
977
978
978
/* Select this item with this value */
979
/* Select this item with this value */
979
static void option_menu_set(GtkOptionMenu *om, guchar *value)
980
static void option_menu_set(GtkOptionMenu *om, gchar *value)
980
{
981
{
981
	GtkWidget *menu;
982
	GtkWidget *menu;
982
	GList	  *list, *next;
983
	GList	  *list, *next;
Lines 988-994 Link Here
988
	for (next = list; next; next = next->next)
989
	for (next = list; next; next = next->next)
989
	{
990
	{
990
		GObject	*item = (GObject *) next->data;
991
		GObject	*item = (GObject *) next->data;
991
		guchar	*data;
992
		gchar	*data;
992
993
993
		data = g_object_get_data(item, "value");
994
		data = g_object_get_data(item, "value");
994
		g_return_if_fail(data != NULL);
995
		g_return_if_fail(data != NULL);
Lines 1006-1012 Link Here
1006
}
1007
}
1007
1008
1008
/* Get the value (static) of the selected item */
1009
/* Get the value (static) of the selected item */
1009
static guchar *option_menu_get(GtkOptionMenu *om)
1010
static gchar *option_menu_get(GtkOptionMenu *om)
1010
{
1011
{
1011
	GtkWidget *menu, *item;
1012
	GtkWidget *menu, *item;
1012
1013
Lines 1067-1081 Link Here
1067
	Option *option = (Option *) value;
1068
	Option *option = (Option *) value;
1068
	xmlNodePtr tree;
1069
	xmlNodePtr tree;
1069
1070
1070
	tree = xmlNewTextChild(doc, NULL, "Option", option->value);
1071
	tree = xmlNewTextChild(doc, NULL, (xmlChar*)"Option", (xmlChar*)option->value);
1071
	xmlSetProp(tree, "name", (gchar *) key);
1072
	xmlSetProp(tree, (xmlChar*)"name", (guchar *) key);
1072
}
1073
}
1073
1074
1074
static void save_options(void)
1075
static void save_options(void)
1075
{
1076
{
1076
	xmlDoc	*doc;
1077
	xmlDoc	*doc;
1077
	GList	*next;
1078
	GList	*next;
1078
	guchar	*save, *save_new;
1079
	gchar	*save, *save_new;
1079
1080
1080
	save = choices_find_path_save("Options", PROJECT, TRUE);
1081
	save = choices_find_path_save("Options", PROJECT, TRUE);
1081
	if (!save)
1082
	if (!save)
Lines 1083-1090 Link Here
1083
1084
1084
	save_new = g_strconcat(save, ".new", NULL);
1085
	save_new = g_strconcat(save, ".new", NULL);
1085
1086
1086
	doc = xmlNewDoc("1.0");
1087
	doc = xmlNewDoc((xmlChar*)"1.0");
1087
	xmlDocSetRootElement(doc, xmlNewDocNode(doc, NULL, "Options", NULL));
1088
	xmlDocSetRootElement(doc, xmlNewDocNode(doc, NULL, (xmlChar*)"Options", NULL));
1088
1089
1089
	g_hash_table_foreach(option_hash, write_option,
1090
	g_hash_table_foreach(option_hash, write_option,
1090
				xmlDocGetRootElement(doc));
1091
				xmlDocGetRootElement(doc));
Lines 1184-1190 Link Here
1184
	
1185
	
1185
	gtk_label_set_text(GTK_LABEL(option->widget),
1186
	gtk_label_set_text(GTK_LABEL(option->widget),
1186
			   have_font ? option->value
1187
			   have_font ? option->value
1187
				     : (guchar *) _("(use default)"));
1188
				     : _("(use default)"));
1188
}
1189
}
1189
1190
1190
static void update_colour(Option *option)
1191
static void update_colour(Option *option)
Lines 1199-1239 Link Here
1199
 * from the widget.
1200
 * from the widget.
1200
 */
1201
 */
1201
1202
1202
static guchar *read_toggle(Option *option)
1203
static gchar *read_toggle(Option *option)
1203
{
1204
{
1204
	GtkToggleButton *toggle = GTK_TOGGLE_BUTTON(option->widget);
1205
	GtkToggleButton *toggle = GTK_TOGGLE_BUTTON(option->widget);
1205
1206
1206
	return g_strdup_printf("%d", gtk_toggle_button_get_active(toggle));
1207
	return g_strdup_printf("%d", gtk_toggle_button_get_active(toggle));
1207
}
1208
}
1208
1209
1209
static guchar *read_entry(Option *option)
1210
static gchar *read_entry(Option *option)
1210
{
1211
{
1211
	return gtk_editable_get_chars(GTK_EDITABLE(option->widget), 0, -1);
1212
	return gtk_editable_get_chars(GTK_EDITABLE(option->widget), 0, -1);
1212
}
1213
}
1213
1214
1214
static guchar *read_numentry(Option *option)
1215
static gchar *read_numentry(Option *option)
1215
{
1216
{
1216
	return g_strdup_printf("%d", (int)
1217
	return g_strdup_printf("%d", (int)
1217
		gtk_spin_button_get_value(GTK_SPIN_BUTTON(option->widget)));
1218
		gtk_spin_button_get_value(GTK_SPIN_BUTTON(option->widget)));
1218
}
1219
}
1219
1220
1220
static guchar *read_slider(Option *option)
1221
static gchar *read_slider(Option *option)
1221
{
1222
{
1222
	return g_strdup_printf("%d", (int)
1223
	return g_strdup_printf("%d", (int)
1223
		gtk_range_get_adjustment(GTK_RANGE(option->widget))->value);
1224
		gtk_range_get_adjustment(GTK_RANGE(option->widget))->value);
1224
}
1225
}
1225
1226
1226
static guchar *read_radio_group(Option *option)
1227
static gchar *read_radio_group(Option *option)
1227
{
1228
{
1228
	return radio_group_get_value(GTK_RADIO_BUTTON(option->widget));
1229
	return radio_group_get_value(GTK_RADIO_BUTTON(option->widget));
1229
}
1230
}
1230
1231
1231
static guchar *read_menu(Option *option)
1232
static gchar *read_menu(Option *option)
1232
{
1233
{
1233
	return g_strdup(option_menu_get(GTK_OPTION_MENU(option->widget)));
1234
	return g_strdup(option_menu_get(GTK_OPTION_MENU(option->widget)));
1234
}
1235
}
1235
1236
1236
static guchar *read_font(Option *option)
1237
static gchar *read_font(Option *option)
1237
{
1238
{
1238
	GtkToggleButton *active;
1239
	GtkToggleButton *active;
1239
1240
Lines 1244-1250 Link Here
1244
	return g_strdup(gtk_label_get_text(GTK_LABEL(option->widget)));
1245
	return g_strdup(gtk_label_get_text(GTK_LABEL(option->widget)));
1245
}
1246
}
1246
1247
1247
static guchar *read_colour(Option *option)
1248
static gchar *read_colour(Option *option)
1248
{
1249
{
1249
	GtkStyle *style = GTK_BIN(option->widget)->child->style;
1250
	GtkStyle *style = GTK_BIN(option->widget)->child->style;
1250
1251
Lines 1263-1272 Link Here
1263
1264
1264
/* Builders for decorations (no corresponding option) */
1265
/* Builders for decorations (no corresponding option) */
1265
1266
1266
static GList *build_label(Option *option, xmlNode *node, guchar *label)
1267
static GList *build_label(Option *option, xmlNode *node, gchar *label)
1267
{
1268
{
1268
	GtkWidget *widget;
1269
	GtkWidget *widget;
1269
	guchar *text;
1270
	gchar *text;
1270
	int help;
1271
	int help;
1271
1272
1272
	g_return_val_if_fail(option == NULL, NULL);
1273
	g_return_val_if_fail(option == NULL, NULL);
Lines 1304-1310 Link Here
1304
	return g_list_append(NULL, widget);
1305
	return g_list_append(NULL, widget);
1305
}
1306
}
1306
1307
1307
static GList *build_spacer(Option *option, xmlNode *node, guchar *label)
1308
static GList *build_spacer(Option *option, xmlNode *node, gchar *label)
1308
{
1309
{
1309
	GtkWidget *eb;
1310
	GtkWidget *eb;
1310
1311
Lines 1317-1323 Link Here
1317
	return g_list_append(NULL, eb);
1318
	return g_list_append(NULL, eb);
1318
}
1319
}
1319
1320
1320
static GList *build_frame(Option *option, xmlNode *node, guchar *label)
1321
static GList *build_frame(Option *option, xmlNode *node, gchar *label)
1321
{
1322
{
1322
	GtkWidget *nbox, *frame, *label_widget;
1323
	GtkWidget *nbox, *frame, *label_widget;
1323
	xmlNode	  *hw;
1324
	xmlNode	  *hw;
Lines 1355-1361 Link Here
1355
 * callbacks.
1356
 * callbacks.
1356
 */
1357
 */
1357
1358
1358
static GList *build_toggle(Option *option, xmlNode *node, guchar *label)
1359
static GList *build_toggle(Option *option, xmlNode *node, gchar *label)
1359
{
1360
{
1360
	GtkWidget	*toggle;
1361
	GtkWidget	*toggle;
1361
1362
Lines 1375-1388 Link Here
1375
	return g_list_append(NULL, toggle);
1376
	return g_list_append(NULL, toggle);
1376
}
1377
}
1377
1378
1378
static GList *build_slider(Option *option, xmlNode *node, guchar *label)
1379
static GList *build_slider(Option *option, xmlNode *node, gchar *label)
1379
{
1380
{
1380
	GtkAdjustment *adj;
1381
	GtkAdjustment *adj;
1381
	GtkWidget *hbox, *slide, *label_wid;
1382
	GtkWidget *hbox, *slide, *label_wid;
1382
	int	min, max;
1383
	int	min, max;
1383
	int	fixed;
1384
	int	fixed;
1384
	int	showvalue;
1385
	int	showvalue;
1385
	guchar	*end;
1386
	gchar	*end;
1386
1387
1387
	g_return_val_if_fail(option != NULL, NULL);
1388
	g_return_val_if_fail(option != NULL, NULL);
1388
1389
Lines 1404-1410 Link Here
1404
		add_to_size_group(node, label_wid);
1405
		add_to_size_group(node, label_wid);
1405
	}
1406
	}
1406
1407
1407
	end = xmlGetProp(node, "end");
1408
	end = (gchar*)xmlGetProp(node, (xmlChar*)"end");
1408
	if (end)
1409
	if (end)
1409
	{
1410
	{
1410
		gtk_box_pack_end(GTK_BOX(hbox), gtk_label_new(_(end)),
1411
		gtk_box_pack_end(GTK_BOX(hbox), gtk_label_new(_(end)),
Lines 1441-1447 Link Here
1441
	return g_list_append(NULL, hbox);
1442
	return g_list_append(NULL, hbox);
1442
}
1443
}
1443
1444
1444
static GList *build_entry(Option *option, xmlNode *node, guchar *label)
1445
static GList *build_entry(Option *option, xmlNode *node, gchar *label)
1445
{
1446
{
1446
	GtkWidget	*hbox;
1447
	GtkWidget	*hbox;
1447
	GtkWidget	*entry;
1448
	GtkWidget	*entry;
Lines 1474-1485 Link Here
1474
	return g_list_append(NULL, hbox);
1475
	return g_list_append(NULL, hbox);
1475
}
1476
}
1476
1477
1477
static GList *build_numentry(Option *option, xmlNode *node, guchar *label)
1478
static GList *build_numentry(Option *option, xmlNode *node, gchar *label)
1478
{
1479
{
1479
	GtkWidget	*hbox;
1480
	GtkWidget	*hbox;
1480
	GtkWidget	*spin;
1481
	GtkWidget	*spin;
1481
	GtkWidget	*label_wid;
1482
	GtkWidget	*label_wid;
1482
	guchar		*unit;
1483
	gchar		*unit;
1483
	int		min, max, step, width;
1484
	int		min, max, step, width;
1484
1485
1485
	g_return_val_if_fail(option != NULL, NULL);
1486
	g_return_val_if_fail(option != NULL, NULL);
Lines 1488-1494 Link Here
1488
	max = get_int(node, "max");
1489
	max = get_int(node, "max");
1489
	step = get_int(node, "step");
1490
	step = get_int(node, "step");
1490
	width = get_int(node, "width");
1491
	width = get_int(node, "width");
1491
	unit = xmlGetProp(node, "unit");
1492
	unit = (gchar*)xmlGetProp(node, (xmlChar*)"unit");
1492
	
1493
	
1493
	hbox = gtk_hbox_new(FALSE, 4);
1494
	hbox = gtk_hbox_new(FALSE, 4);
1494
1495
Lines 1522-1528 Link Here
1522
	return g_list_append(NULL, hbox);
1523
	return g_list_append(NULL, hbox);
1523
}
1524
}
1524
1525
1525
static GList *build_radio_group(Option *option, xmlNode *node, guchar *label)
1526
static GList *build_radio_group(Option *option, xmlNode *node, gchar *label)
1526
{
1527
{
1527
	GList		*list = NULL;
1528
	GList		*list = NULL;
1528
	GtkWidget	*button = NULL;
1529
	GtkWidget	*button = NULL;
Lines 1579-1585 Link Here
1579
	return list;
1580
	return list;
1580
}
1581
}
1581
1582
1582
static GList *build_colour(Option *option, xmlNode *node, guchar *label)
1583
static GList *build_colour(Option *option, xmlNode *node, gchar *label)
1583
{
1584
{
1584
	GtkWidget	*hbox, *da, *button, *label_wid;
1585
	GtkWidget	*hbox, *da, *button, *label_wid;
1585
	
1586
	
Lines 1611-1617 Link Here
1611
	return g_list_append(NULL, hbox);
1612
	return g_list_append(NULL, hbox);
1612
}
1613
}
1613
1614
1614
static GList *build_menu(Option *option, xmlNode *node, guchar *label)
1615
static GList *build_menu(Option *option, xmlNode *node, gchar *label)
1615
{
1616
{
1616
	GtkWidget	*hbox, *om, *option_menu, *label_wid;
1617
	GtkWidget	*hbox, *om, *option_menu, *label_wid;
1617
	xmlNode		*item;
1618
	xmlNode		*item;
Lines 1649-1655 Link Here
1649
	return g_list_append(NULL, hbox);
1650
	return g_list_append(NULL, hbox);
1650
}
1651
}
1651
1652
1652
static GList *build_font(Option *option, xmlNode *node, guchar *label)
1653
static GList *build_font(Option *option, xmlNode *node, gchar *label)
1653
{
1654
{
1654
	GtkWidget	*hbox, *button;
1655
	GtkWidget	*hbox, *button;
1655
	GtkWidget	*active = NULL;
1656
	GtkWidget	*active = NULL;
Lines 1714-1734 Link Here
1714
1715
1715
	root = xmlDocGetRootElement(doc);
1716
	root = xmlDocGetRootElement(doc);
1716
	
1717
	
1717
	g_return_if_fail(strcmp(root->name, "Options") == 0);
1718
	g_return_if_fail(strcmp((const gchar*)root->name, "Options") == 0);
1718
1719
1719
	for (node = root->xmlChildrenNode; node; node = node->next)
1720
	for (node = root->xmlChildrenNode; node; node = node->next)
1720
	{
1721
	{
1721
		gchar *value, *name;
1722
		gchar *name;
1723
		gchar *value;
1722
1724
1723
		if (node->type != XML_ELEMENT_NODE)
1725
		if (node->type != XML_ELEMENT_NODE)
1724
			continue;
1726
			continue;
1725
		if (strcmp(node->name, "Option") != 0)
1727
		if (strcmp((gchar*)node->name, "Option") != 0)
1726
			continue;
1728
			continue;
1727
		name = xmlGetProp(node, "name");
1729
		name = (gchar*)xmlGetProp(node, (xmlChar*)"name");
1728
		if (!name)
1730
		if (!name)
1729
			continue;
1731
			continue;
1730
1732
1731
		value = xmlNodeGetContent(node);
1733
		value = (gchar*)xmlNodeGetContent(node);
1732
1734
1733
		if (g_hash_table_lookup(loading, name))
1735
		if (g_hash_table_lookup(loading, name))
1734
			g_warning("Duplicate option found!");
1736
			g_warning("Duplicate option found!");
(-)src-old/options.h (-4 / +4 lines)
Lines 11-28 Link Here
11
#include <gtk/gtk.h>
11
#include <gtk/gtk.h>
12
12
13
typedef void OptionNotify(void);
13
typedef void OptionNotify(void);
14
typedef GList * (*OptionBuildFn)(Option *option, xmlNode *node, guchar *label);
14
typedef GList * (*OptionBuildFn)(Option *option, xmlNode *node, gchar *label);
15
15
16
struct _Option {
16
struct _Option {
17
	guchar		*value;
17
	gchar		*value;
18
	long		int_value;
18
	long		int_value;
19
	gboolean	has_changed;
19
	gboolean	has_changed;
20
20
21
	guchar		*backup;	/* Copy of value to Revert to */
21
	gchar		*backup;	/* Copy of value to Revert to */
22
22
23
	GtkWidget	*widget;		/* NULL => No UI yet */
23
	GtkWidget	*widget;		/* NULL => No UI yet */
24
	void		(*update_widget)(Option *option);
24
	void		(*update_widget)(Option *option);
25
	guchar *	(*read_widget)(Option *option);
25
	gchar *		(*read_widget)(Option *option);
26
};
26
};
27
27
28
/* Prototypes */
28
/* Prototypes */
(-)src-old/settings.c (-19 / +19 lines)
Lines 159-165 Link Here
159
		{
159
		{
160
			if (child->type != XML_ELEMENT_NODE)
160
			if (child->type != XML_ELEMENT_NODE)
161
				continue;
161
				continue;
162
			if (strcmp(child->name, "Setting") != 0)
162
			if (strcmp((gchar*)child->name, "Setting") != 0)
163
				continue;
163
				continue;
164
164
165
			set_from_xml(child);
165
			set_from_xml(child);
Lines 167-175 Link Here
167
	}
167
	}
168
	else
168
	else
169
	{
169
	{
170
		settings_doc = xmlNewDoc("1.0");
170
		settings_doc = xmlNewDoc((xmlChar*)"1.0");
171
		xmlDocSetRootElement(settings_doc,
171
		xmlDocSetRootElement(settings_doc,
172
				xmlNewDocNode(settings_doc, NULL, "Settings", NULL));
172
				xmlNewDocNode(settings_doc, NULL, (xmlChar*)"Settings", NULL));
173
		if (manage_xsettings.int_value)
173
		if (manage_xsettings.int_value)
174
		{
174
		{
175
			/* Override annoying defaults... */
175
			/* Override annoying defaults... */
Lines 188-195 Link Here
188
	xmlNode *node;
188
	xmlNode *node;
189
189
190
	node = get_node(name, TRUE);
190
	node = get_node(name, TRUE);
191
	xmlSetProp(node, "value", value);
191
	xmlSetProp(node, (xmlChar*)"value", (xmlChar*)value);
192
	xmlSetProp(node, "type", "string");
192
	xmlSetProp(node, (xmlChar*)"type", (xmlChar*)"string");
193
193
194
	set_from_xml(node);
194
	set_from_xml(node);
195
	activate_changes();
195
	activate_changes();
Lines 461-469 Link Here
461
461
462
		if (child->type != XML_ELEMENT_NODE)
462
		if (child->type != XML_ELEMENT_NODE)
463
			continue;
463
			continue;
464
		if (strcmp(child->name, "Setting") != 0)
464
		if (strcmp((gchar*)child->name, "Setting") != 0)
465
			continue;
465
			continue;
466
		attr_name = xmlGetProp(child, "name");
466
		attr_name = (gchar*)xmlGetProp(child, (xmlChar*)"name");
467
		if (!attr_name)
467
		if (!attr_name)
468
		{
468
		{
469
			g_warning("Malformed <Setting>");
469
			g_warning("Malformed <Setting>");
Lines 479-486 Link Here
479
	if (!create_if_missing)
479
	if (!create_if_missing)
480
		return NULL;
480
		return NULL;
481
481
482
	child = xmlNewDocNode(settings_doc, NULL, "Setting", NULL);
482
	child = xmlNewDocNode(settings_doc, NULL, (xmlChar*)"Setting", NULL);
483
	xmlSetProp(child, "name", name);
483
	xmlSetProp(child, (xmlChar*)"name", (xmlChar*)name);
484
	xmlAddChild(root, child);
484
	xmlAddChild(root, child);
485
	return child;
485
	return child;
486
}
486
}
Lines 509-516 Link Here
509
	str = g_strdup_printf("%d", value);
509
	str = g_strdup_printf("%d", value);
510
510
511
	node = get_node(name, TRUE);
511
	node = get_node(name, TRUE);
512
	xmlSetProp(node, "value", str);
512
	xmlSetProp(node, (xmlChar*)"value", (xmlChar*)str);
513
	xmlSetProp(node, "type", "int");
513
	xmlSetProp(node, (xmlChar*)"type", (xmlChar*)"int");
514
514
515
	g_free(str);
515
	g_free(str);
516
	
516
	
Lines 583-589 Link Here
583
				ROX_XSETTINGS_NS, "GetSetting"))
583
				ROX_XSETTINGS_NS, "GetSetting"))
584
	{
584
	{
585
		DBusMessage *reply;
585
		DBusMessage *reply;
586
		char *type, *value;
586
		guchar *type, *value;
587
		xmlNode *node;
587
		xmlNode *node;
588
588
589
		if (!dbus_message_get_args(message, error,
589
		if (!dbus_message_get_args(message, error,
Lines 597-604 Link Here
597
			return dbus_message_new_error(message, MISSING_SETTING_ERROR,
597
			return dbus_message_new_error(message, MISSING_SETTING_ERROR,
598
					"Missing setting");
598
					"Missing setting");
599
599
600
		type = xmlGetProp(node, "type");
600
		type = xmlGetProp(node, (xmlChar*)"type");
601
		value = xmlGetProp(node, "value");
601
		value = xmlGetProp(node, (xmlChar*)"value");
602
		if (type && value)
602
		if (type && value)
603
		{
603
		{
604
			reply = dbus_message_new_method_return(message);
604
			reply = dbus_message_new_method_return(message);
Lines 628-634 Link Here
628
	g_warning("ROX-Session is no longer the XSETTINGS manager!");
628
	g_warning("ROX-Session is no longer the XSETTINGS manager!");
629
}
629
}
630
630
631
static void set_setting(char *name, char *value, char *type)
631
static void set_setting(gchar *name, gchar *value, gchar *type)
632
{
632
{
633
	g_return_if_fail(name && type && value);
633
	g_return_if_fail(name && type && value);
634
634
Lines 665-677 Link Here
665
665
666
static void set_from_xml(xmlNode *setting)
666
static void set_from_xml(xmlNode *setting)
667
{
667
{
668
	char *name, *value, *type;
668
	gchar *name, *value, *type;
669
669
670
	g_return_if_fail(!manage_xsettings.int_value || xsettings_manager != NULL);
670
	g_return_if_fail(!manage_xsettings.int_value || xsettings_manager != NULL);
671
671
672
	name = xmlGetProp(setting, "name");
672
	name = (gchar*)xmlGetProp(setting, (xmlChar*)"name");
673
	type = xmlGetProp(setting, "type");
673
	type = (gchar*)xmlGetProp(setting, (xmlChar*)"type");
674
	value = xmlGetProp(setting, "value");
674
	value = (gchar*)xmlGetProp(setting, (xmlChar*)"value");
675
675
676
	set_setting(name, value, type);
676
	set_setting(name, value, type);
677
677
(-)src-old/xkb.c (-3 / +3 lines)
Lines 112-118 Link Here
112
		if (delay <= 0) delay = 1;
112
		if (delay <= 0) delay = 1;
113
		if (!XkbSetAutoRepeatRate(GDK_DISPLAY(), XkbUseCoreKbd,
113
		if (!XkbSetAutoRepeatRate(GDK_DISPLAY(), XkbUseCoreKbd,
114
					delay, interval))
114
					delay, interval))
115
			g_warning(_("Failed to set auto repeat rate/interval"));
115
			g_warning("%s", _("Failed to set auto repeat rate/interval"));
116
	}
116
	}
117
	else
117
	else
118
	{
118
	{
Lines 131-137 Link Here
131
131
132
	/* get key state using XKB */
132
	/* get key state using XKB */
133
	if (XkbGetIndicatorState (GDK_DISPLAY(), XkbUseCoreKbd, &states) != Success)
133
	if (XkbGetIndicatorState (GDK_DISPLAY(), XkbUseCoreKbd, &states) != Success)
134
		g_warning (_("error in reading keyboard indicator states"));
134
		g_warning ("%s", _("error in reading keyboard indicator states"));
135
135
136
	return (states & code) ? TRUE : FALSE;
136
	return (states & code) ? TRUE : FALSE;
137
}
137
}
Lines 145-151 Link Here
145
		KeyCode code = XKeysymToKeycode(GDK_DISPLAY(), keysym);
145
		KeyCode code = XKeysymToKeycode(GDK_DISPLAY(), keysym);
146
		if (!XTestFakeKeyEvent (GDK_DISPLAY(), code, True, CurrentTime) ||
146
		if (!XTestFakeKeyEvent (GDK_DISPLAY(), code, True, CurrentTime) ||
147
			!XTestFakeKeyEvent (GDK_DISPLAY(), code, False, CurrentTime)) 
147
			!XTestFakeKeyEvent (GDK_DISPLAY(), code, False, CurrentTime)) 
148
			g_warning (_("error while sending fake key events"));
148
			g_warning ("%s", _("error while sending fake key events"));
149
	}
149
	}
150
}
150
}
151
151

Return to bug 236062