annotate src/iris/config.c @ 144:5dfc0e491ad3 trunk

[svn] Null output plugin added; original code by Christian Birchinger <joker -at- gentoo.org>
author kiyoshi
date Mon, 30 Oct 2006 17:40:00 -0800
parents a578bf9b2851
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
116
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1 /* Iris - visualization plugin for XMMS
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
2 * Copyright (C) 2000-2002 Cédric DELFOSSE (cdelfosse@free.fr)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
3 *
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
7 * (at your option) any later version.
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
8 *
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
12 * GNU General Public License for more details.
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
13 *
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
17 */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
18
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
19 #include <stdio.h>
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
20 #include <stdlib.h>
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
21 #include <gtk/gtk.h>
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
22 #include <audacious/configdb.h>
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
23 #include <GL/gl.h>
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
24 #include "iris.h"
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
25 #include "config.h"
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
26
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
27 iris_config config;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
28 iris_config newconfig;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
29 GLWindow GLWin;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
30
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
31 static char section_name[] = "iris";
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
32
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
33 GtkWidget *config_window;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
34
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
35 GtkWidget *preview_color_one_color;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
36 GtkWidget *preview_color_two_colors_1;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
37 GtkWidget *preview_color_two_colors_2;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
38 GtkWidget *preview_background;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
39 GtkWidget *preview_flash;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
40
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
41 static GtkWidget *config_ctree;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
42 static GtkWidget *config_notebook;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
43 static gint config_page;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
44
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
45 static gboolean
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
46 check_cfg_version (ConfigDb * db)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
47 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
48 char *vstr;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
49
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
50 if (bmp_cfg_db_get_string (db, "iris", "version", &vstr))
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
51 if (!strcmp (vstr, VERSION))
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
52 return FALSE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
53 return TRUE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
54 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
55
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
56
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
57 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
58 iris_set_default_prefs (void)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
59 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
60 int i;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
61
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
62 for (i = 0; i < THEME_NUMBER; i++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
63 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
64 theme_config_global_default (i);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
65 if (theme[i].config_default != NULL)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
66 theme[i].config_default ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
67 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
68
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
69 config.bgc_red = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
70 config.bgc_green = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
71 config.bgc_blue = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
72
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
73 config.bgc_random = FALSE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
74
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
75 config.color_red = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
76 config.color_green = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
77 config.color_blue = 1.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
78
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
79 config.color_random = TRUE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
80
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
81 config.color1_red = 1.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
82 config.color1_green = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
83 config.color1_blue = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
84
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
85 config.color2_red = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
86 config.color2_green = 1.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
87 config.color2_blue = 0.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
88
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
89 config.color12_random = TRUE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
90
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
91 config.color_flash_red = 1.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
92 config.color_flash_green = 1.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
93 config.color_flash_blue = 1.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
94
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
95 config.color_mode = 1;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
96
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
97 config.color_beat = TRUE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
98
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
99 config.flash_speed = 5;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
100
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
101 config.fps = 50;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
102
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
103 config.change_theme_on_beat = FALSE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
104
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
105 config.fs_width = 640;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
106 config.fs_height = 480;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
107
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
108 config.window_width = 640;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
109 config.window_height = 480;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
110
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
111 config.fullscreen = FALSE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
112
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
113 config.transition = TRUE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
114 config.trans_duration = 10.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
115 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
116
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
117
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
118 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
119 iris_config_read (void)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
120 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
121 ConfigDb *db;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
122
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
123 db = bmp_cfg_db_open();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
124
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
125 /* Check the config version string. If the string is too old, default values
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
126 * are installed. If the string returns NULL, iris has not been run before,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
127 * and default values are installed. */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
128 if (check_cfg_version (db))
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
129 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
130 printf("Bad iris plugin version detected in config, using default configuration\n");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
131 iris_set_default_prefs ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
132 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
133 else
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
134 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
135 int i;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
136
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
137 /* load config of all the theme */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
138 for (i = 0; i < THEME_NUMBER; i++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
139 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
140 theme_config_global_read (db, section_name, i);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
141 if (theme[i].config_read != NULL)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
142 theme[i].config_read (db, section_name);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
143 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
144
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
145 bmp_cfg_db_get_float (db, section_name, "bgc_red", &config.bgc_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
146 bmp_cfg_db_get_float (db, section_name, "bgc_green", &config.bgc_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
147 bmp_cfg_db_get_float (db, section_name, "bgc_blue", &config.bgc_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
148 bmp_cfg_db_get_bool (db, section_name, "bgc_random", &config.bgc_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
149 bmp_cfg_db_get_float (db, section_name, "color_red", &config.color_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
150 bmp_cfg_db_get_float (db, section_name, "color_green", &config.color_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
151 bmp_cfg_db_get_float (db, section_name, "color_blue", &config.color_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
152 bmp_cfg_db_get_bool (db, section_name, "color_random", &config.color_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
153 bmp_cfg_db_get_float (db, section_name, "color1_red", &config.color1_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
154 bmp_cfg_db_get_float (db, section_name, "color1_green", &config.color1_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
155 bmp_cfg_db_get_float (db, section_name, "color1_blue", &config.color1_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
156 bmp_cfg_db_get_float (db, section_name, "color2_red", &config.color2_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
157 bmp_cfg_db_get_float (db, section_name, "color2_green", &config.color2_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
158 bmp_cfg_db_get_float (db, section_name, "color2_blue", &config.color2_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
159 bmp_cfg_db_get_bool (db, section_name, "color12_random", &config.color12_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
160 bmp_cfg_db_get_float (db, section_name, "color_flash_red", &config.color_flash_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
161 bmp_cfg_db_get_float (db, section_name, "color_flash_green", &config.color_flash_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
162 bmp_cfg_db_get_float (db, section_name, "color_flash_blue", &config.color_flash_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
163 bmp_cfg_db_get_int (db, section_name, "color_mode", &config.color_mode);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
164 bmp_cfg_db_get_bool (db, section_name, "color_beat", &config.color_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
165 bmp_cfg_db_get_int (db, section_name, "flash_speed", &config.flash_speed);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
166 bmp_cfg_db_get_int (db, section_name, "fps", &config.fps);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
167 bmp_cfg_db_get_bool (db, section_name, "change_theme_on_beat", &config.change_theme_on_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
168 bmp_cfg_db_get_int (db, section_name, "fs_width", &config.fs_width);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
169 bmp_cfg_db_get_int (db, section_name, "fs_height", &config.fs_height);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
170 bmp_cfg_db_get_int (db, section_name, "window_width", &config.window_width);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
171 bmp_cfg_db_get_int (db, section_name, "window_height", &config.window_height);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
172 bmp_cfg_db_get_bool (db, section_name, "fullscreen", &config.fullscreen);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
173 bmp_cfg_db_get_bool (db, section_name, "transition", &config.transition);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
174 bmp_cfg_db_get_float (db, section_name, "trans_duration", &config.trans_duration);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
175 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
176 bmp_cfg_db_close(db);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
177 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
178
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
179
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
180 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
181 iris_config_write (iris_config * config)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
182 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
183 ConfigDb *db;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
184 int i;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
185
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
186 db = bmp_cfg_db_open();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
187
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
188 /* save config of all the theme */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
189 for (i = 0; i < THEME_NUMBER; i++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
190 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
191 theme_config_global_write (db, section_name, i);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
192 if (theme[i].config_write != NULL)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
193 theme[i].config_write (db, section_name);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
194 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
195
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
196 /* Save the current configuration in the "iris" section */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
197 bmp_cfg_db_set_string (db, section_name, "version", VERSION);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
198 bmp_cfg_db_set_float (db, section_name, "bgc_red", config->bgc_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
199 bmp_cfg_db_set_float (db, section_name, "bgc_green", config->bgc_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
200 bmp_cfg_db_set_float (db, section_name, "bgc_blue", config->bgc_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
201 bmp_cfg_db_set_bool (db, section_name, "bgc_random", config->bgc_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
202 bmp_cfg_db_set_float (db, section_name, "color_red", config->color_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
203 bmp_cfg_db_set_float (db, section_name, "color_green", config->color_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
204 bmp_cfg_db_set_float (db, section_name, "color_blue", config->color_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
205 bmp_cfg_db_set_bool (db, section_name, "color_random", config->color_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
206 bmp_cfg_db_set_float (db, section_name, "color1_red", config->color1_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
207 bmp_cfg_db_set_float (db, section_name, "color1_green", config->color1_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
208 bmp_cfg_db_set_float (db, section_name, "color1_blue", config->color1_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
209 bmp_cfg_db_set_float (db, section_name, "color2_red", config->color2_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
210 bmp_cfg_db_set_float (db, section_name, "color2_green", config->color2_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
211 bmp_cfg_db_set_float (db, section_name, "color2_blue", config->color2_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
212 bmp_cfg_db_set_bool (db, section_name, "color12_random", config->color12_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
213 bmp_cfg_db_set_float (db, section_name, "color_flash_red", config->color_flash_red);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
214 bmp_cfg_db_set_float (db, section_name, "color_flash_green", config->color_flash_green);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
215 bmp_cfg_db_set_float (db, section_name, "color_flash_blue", config->color_flash_blue);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
216 bmp_cfg_db_set_int (db, section_name, "color_mode", config->color_mode);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
217 bmp_cfg_db_set_bool (db, section_name, "color_beat", config->color_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
218 bmp_cfg_db_set_int (db, section_name, "flash_speed", config->flash_speed);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
219 bmp_cfg_db_set_int (db, section_name, "fps", config->fps);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
220 bmp_cfg_db_set_bool (db, section_name, "change_theme_on_beat", config->change_theme_on_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
221 bmp_cfg_db_set_int (db, section_name, "fs_width", config->fs_width);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
222 bmp_cfg_db_set_int (db, section_name, "fs_height", config->fs_height);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
223 bmp_cfg_db_set_int (db, section_name, "window_width", config->window_width);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
224 bmp_cfg_db_set_int (db, section_name, "window_height", config->window_height);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
225 bmp_cfg_db_set_bool (db, section_name, "fullscreen", config->fullscreen);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
226 bmp_cfg_db_set_bool (db, section_name, "transition", config->transition);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
227 bmp_cfg_db_set_float (db, section_name, "trans_duration", config->trans_duration);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
228
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
229 /* write out the XMMS config file */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
230 bmp_cfg_db_close(db);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
231 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
232
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
233
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
234 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
235 set_color_preview (GLfloat red, GLfloat green, GLfloat blue,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
236 GtkWidget * preview)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
237 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
238 unsigned int a;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
239 guchar buf[3 * 32];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
240 char r, g, b;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
241 char s[3];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
242
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
243 // how to convert a float into a char ?
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
244 sprintf (s, "%.0f", red * 255);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
245 r = (unsigned char) atoi (s);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
246 sprintf (s, "%.0f", green * 255);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
247 g = (unsigned char) atoi (s);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
248 sprintf (s, "%.0f", blue * 255);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
249 b = (unsigned char) atoi (s);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
250
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
251 for (a = 0; a < 32; a++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
252 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
253 buf[3 * a] = (char) r;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
254 buf[3 * a + 1] = (char) g;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
255 buf[3 * a + 2] = (char) b;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
256 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
257
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
258 for (a = 0; a < 16; a++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
259 gtk_preview_draw_row (GTK_PREVIEW (preview), buf, 0, a, 32);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
260
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
261 gtk_widget_draw (preview, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
262 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
263
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
264
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
265 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
266 csel_ok (GtkWidget * w, GtkWidget * csel)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
267 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
268 gdouble a[3];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
269
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
270 gtk_color_selection_get_color (GTK_COLOR_SELECTION
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
271 (GTK_COLOR_SELECTION_DIALOG (csel)->
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
272 colorsel), &a[0]);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
273
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
274 gtk_widget_destroy (csel);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
275 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
276
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
277
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
278 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
279 csel_ok2 (GtkWidget * csel, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
280 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
281 gdouble a[3];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
282
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
283 gtk_color_selection_get_color (GTK_COLOR_SELECTION
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
284 (GTK_COLOR_SELECTION_DIALOG (csel)->
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
285 colorsel), &a[0]);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
286
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
287 switch ((int) data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
288 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
289 case 0:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
290 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
291 newconfig.color_red = (GLfloat) a[0];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
292 newconfig.color_green = (GLfloat) a[1];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
293 newconfig.color_blue = (GLfloat) a[2];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
294 set_color_preview (newconfig.color_red, newconfig.color_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
295 newconfig.color_blue, preview_color_one_color);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
296 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
297 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
298 case 1:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
299 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
300 newconfig.color1_red = (GLfloat) a[0];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
301 newconfig.color1_green = (GLfloat) a[1];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
302 newconfig.color1_blue = (GLfloat) a[2];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
303 set_color_preview (newconfig.color1_red, newconfig.color1_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
304 newconfig.color1_blue, preview_color_two_colors_1);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
305 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
306 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
307 case 2:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
308 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
309 newconfig.color2_red = (GLfloat) a[0];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
310 newconfig.color2_green = (GLfloat) a[1];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
311 newconfig.color2_blue = (GLfloat) a[2];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
312 set_color_preview (newconfig.color2_red, newconfig.color2_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
313 newconfig.color2_blue, preview_color_two_colors_2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
314 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
315 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
316 case 3:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
317 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
318 newconfig.bgc_red = (GLfloat) a[0];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
319 newconfig.bgc_green = (GLfloat) a[1];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
320 newconfig.bgc_blue = (GLfloat) a[2];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
321 set_color_preview (newconfig.bgc_red, newconfig.bgc_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
322 newconfig.bgc_blue, preview_background);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
323 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
324 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
325 case 4:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
326 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
327 newconfig.color_flash_red = (GLfloat) a[0];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
328 newconfig.color_flash_green = (GLfloat) a[1];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
329 newconfig.color_flash_blue = (GLfloat) a[2];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
330 set_color_preview (newconfig.color_flash_red,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
331 newconfig.color_flash_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
332 newconfig.color_flash_blue, preview_flash);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
333 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
334 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
335 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
336
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
337 gtk_widget_destroy (csel);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
338 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
339
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
340
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
341 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
342 apply_clicked (void)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
343 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
344 gint i;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
345
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
346 memcpy (&config, &newconfig, sizeof (iris_config));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
347 for (i = 0; i < THEME_NUMBER; i++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
348 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
349 memcpy (theme[i].config->global, theme[i].config_new->global,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
350 sizeof (config_global));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
351 theme_config_apply (i);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
352 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
353 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
354
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
355
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
356 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
357 cancel_clicked (GtkWidget * w, GtkWidget * window)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
358 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
359 gtk_widget_destroy (window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
360 config_window = NULL;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
361 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
362
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
363
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
364 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
365 csel_deleteevent (GtkWidget * w, GtkWidget * csel)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
366 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
367 gtk_widget_destroy (csel);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
368 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
369
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
370
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
371 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
372 ok_clicked (GtkWidget * w, GtkWidget * window)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
373 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
374 apply_clicked ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
375 iris_config_write (&newconfig);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
376 cancel_clicked (w, window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
377 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
378
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
379
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
380 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
381 color_clicked (GtkWidget * w, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
382 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
383 GtkWidget *csel;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
384 gdouble a[3];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
385
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
386 switch ((int) data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
387 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
388 case 0:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
389 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
390 a[0] = (gdouble) newconfig.color_red;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
391 a[1] = (gdouble) newconfig.color_green;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
392 a[2] = (gdouble) newconfig.color_blue;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
393 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
394 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
395 case 1:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
396 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
397 a[0] = (gdouble) newconfig.color1_red;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
398 a[1] = (gdouble) newconfig.color1_green;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
399 a[2] = (gdouble) newconfig.color1_blue;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
400 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
401 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
402 case 2:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
403 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
404 a[0] = (gdouble) newconfig.color2_red;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
405 a[1] = (gdouble) newconfig.color2_green;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
406 a[2] = (gdouble) newconfig.color2_blue;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
407 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
408 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
409 case 3:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
410 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
411 a[0] = (gdouble) newconfig.bgc_red;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
412 a[1] = (gdouble) newconfig.bgc_green;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
413 a[2] = (gdouble) newconfig.bgc_blue;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
414 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
415 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
416 case 4:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
417 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
418 a[0] = (gdouble) newconfig.color_flash_red;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
419 a[1] = (gdouble) newconfig.color_flash_green;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
420 a[2] = (gdouble) newconfig.color_flash_blue;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
421 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
422 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
423 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
424
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
425 csel = gtk_color_selection_dialog_new ("Please choose a color");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
426 /*gtk_window_set_modal (GTK_WINDOW
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
427 (&(GTK_COLOR_SELECTION_DIALOG (csel)->window)), TRUE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
428 gtk_window_set_transient_for (GTK_WINDOW
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
429 (&
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
430 (GTK_COLOR_SELECTION_DIALOG (csel)->window)),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
431 GTK_WINDOW (config_window)); */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
432 gtk_widget_hide (GTK_COLOR_SELECTION_DIALOG (csel)->help_button);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
433 gtk_widget_hide (GTK_COLOR_SELECTION_DIALOG (csel)->cancel_button);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
434 gtk_color_selection_set_color (GTK_COLOR_SELECTION
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
435 (GTK_COLOR_SELECTION_DIALOG (csel)->
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
436 colorsel), &a[0]);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
437 gtk_widget_show (csel);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
438
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
439 gtk_signal_connect (GTK_OBJECT
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
440 (GTK_COLOR_SELECTION_DIALOG (csel)->ok_button),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
441 "clicked", GTK_SIGNAL_FUNC (csel_ok), csel);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
442 gtk_signal_connect (GTK_OBJECT (csel), "delete_event",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
443 GTK_SIGNAL_FUNC (csel_deleteevent), csel);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
444 gtk_signal_connect (GTK_OBJECT (csel), "destroy",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
445 GTK_SIGNAL_FUNC (csel_ok2), data);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
446 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
447
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
448
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
449 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
450 colormode_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
451 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
452 newconfig.color_mode = (unsigned int) data;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
453 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
454
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
455
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
456 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
457 colorbeat_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
458 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
459 newconfig.color_beat = !newconfig.color_beat;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
460 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
461
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
462
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
463 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
464 theme_beat_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
465 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
466 newconfig.change_theme_on_beat = !newconfig.change_theme_on_beat;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
467 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
468
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
469
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
470 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
471 color_random_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
472 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
473 newconfig.color_random = !newconfig.color_random;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
474 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
475
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
476
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
477 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
478 color12_random_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
479 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
480 newconfig.color12_random = !newconfig.color12_random;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
481 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
482
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
483
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
484 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
485 bgc_random_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
486 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
487 newconfig.bgc_random = !newconfig.bgc_random;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
488 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
489
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
490
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
491 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
492 wireframe_toggled (GtkWidget * widget, gpointer * data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
493 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
494 newconfig.wireframe = !newconfig.wireframe;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
495 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
496
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
497
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
498 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
499 fullscreen_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
500 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
501 newconfig.fullscreen = !newconfig.fullscreen;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
502 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
503
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
504 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
505 transition_toggled (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
506 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
507 newconfig.transition = !newconfig.transition;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
508 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
509
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
510 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
511 combo_fs_activated (GtkWidget * widget, gpointer data)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
512 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
513 sscanf (gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (data)->entry)), "%dx%d",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
514 &newconfig.fs_width, &newconfig.fs_height);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
515 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
516
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
517
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
518 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
519 value_flash_speed (GtkAdjustment * adj)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
520 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
521 newconfig.flash_speed = (int) adj->value;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
522 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
523
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
524 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
525 value_trans_duration (GtkAdjustment * adj)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
526 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
527 newconfig.trans_duration = (int) adj->value;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
528 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
529
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
530 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
531 conf_closed (GtkWidget * w, GdkEvent * e, GtkWidget ** window)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
532 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
533 gtk_widget_destroy (*window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
534 *window = NULL;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
535 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
536
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
537
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
538 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
539 priority_value_changed (GtkAdjustment * adj, gint i)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
540 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
541 theme[i].config_new->global->priority = adj->value / 100.0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
542 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
543
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
544
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
545 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
546 create_config_color (GtkWidget * vbox_container)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
547 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
548 GtkWidget *frame;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
549 GtkWidget *vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
550 GtkWidget *hbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
551 GSList *group;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
552
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
553 GtkWidget *radio_button_one_color;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
554 GtkWidget *button_color_one_color;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
555 // GtkWidget *preview_color_one_color; must be static
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
556
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
557 GtkWidget *radio_button_two_colors;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
558 GtkWidget *button_color_two_colors_1;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
559 GtkWidget *button_color_two_colors_2;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
560 // GtkWidget *preview_color_two_colors_1; must be static
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
561 // GtkWidget *preview_color_two_colors_2; must be static
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
562
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
563 GtkWidget *check_button;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
564
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
565 GtkWidget *hseparator;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
566
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
567 GtkWidget *label;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
568 GtkWidget *button_background;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
569 // GtkWidget *preview_background; static
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
570
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
571 frame = gtk_frame_new ("color");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
572 gtk_box_pack_start (GTK_BOX (vbox_container), frame, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
573 vbox = gtk_vbox_new (TRUE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
574 gtk_container_add (GTK_CONTAINER (frame), vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
575
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
576 /* the first hbox: a radio button and a color selection/preview button */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
577
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
578 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
579 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
580 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
581
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
582 radio_button_one_color =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
583 gtk_radio_button_new_with_label (NULL, "one color");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
584 gtk_box_pack_start (GTK_BOX (hbox), radio_button_one_color, FALSE, FALSE,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
585 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
586 gtk_widget_set_usize (radio_button_one_color, 100, 20);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
587 gtk_widget_show (radio_button_one_color);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
588
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
589 button_color_one_color = gtk_button_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
590 gtk_box_pack_start (GTK_BOX (hbox), button_color_one_color, FALSE, FALSE,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
591 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
592 gtk_widget_show (button_color_one_color);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
593 preview_color_one_color = gtk_preview_new (GTK_PREVIEW_COLOR);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
594 gtk_preview_size (GTK_PREVIEW (preview_color_one_color), 32, 16);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
595 gtk_widget_show (preview_color_one_color);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
596 gtk_container_add (GTK_CONTAINER (button_color_one_color),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
597 preview_color_one_color);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
598 set_color_preview (newconfig.color_red, newconfig.color_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
599 newconfig.color_blue, preview_color_one_color);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
600 gtk_widget_set_usize (button_color_one_color, 50, 20);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
601 gtk_signal_connect (GTK_OBJECT (button_color_one_color), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
602 GTK_SIGNAL_FUNC (color_clicked), (gpointer) 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
603
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
604 /* the second hbox: a radio button and two color selection/preview buttons */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
605
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
606 hbox = gtk_hbox_new (FALSE, 3);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
607 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
608 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
609
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
610 group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button_one_color));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
611 radio_button_two_colors =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
612 gtk_radio_button_new_with_label (group, "two colors");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
613 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button_two_colors),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
614 TRUE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
615 gtk_box_pack_start (GTK_BOX (hbox), radio_button_two_colors, FALSE, FALSE,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
616 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
617 gtk_widget_set_usize (radio_button_two_colors, 100, 20);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
618 gtk_widget_show (radio_button_two_colors);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
619
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
620 button_color_two_colors_1 = gtk_button_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
621 gtk_box_pack_start (GTK_BOX (hbox), button_color_two_colors_1, FALSE, FALSE,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
622 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
623 gtk_widget_show (button_color_two_colors_1);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
624 preview_color_two_colors_1 = gtk_preview_new (GTK_PREVIEW_COLOR);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
625 gtk_preview_size (GTK_PREVIEW (preview_color_two_colors_1), 32, 16);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
626 gtk_widget_show (preview_color_two_colors_1);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
627 gtk_container_add (GTK_CONTAINER (button_color_two_colors_1),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
628 preview_color_two_colors_1);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
629 set_color_preview (newconfig.color1_red, newconfig.color1_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
630 newconfig.color1_blue, preview_color_two_colors_1);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
631 gtk_widget_set_usize (button_color_two_colors_1, 50, 20);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
632
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
633 gtk_signal_connect (GTK_OBJECT (button_color_two_colors_1), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
634 GTK_SIGNAL_FUNC (color_clicked), (gpointer) 1);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
635
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
636 button_color_two_colors_2 = gtk_button_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
637 gtk_box_pack_start (GTK_BOX (hbox), button_color_two_colors_2, FALSE, FALSE,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
638 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
639 gtk_widget_show (button_color_two_colors_2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
640 preview_color_two_colors_2 = gtk_preview_new (GTK_PREVIEW_COLOR);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
641 gtk_preview_size (GTK_PREVIEW (preview_color_two_colors_2), 32, 16);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
642 gtk_widget_show (preview_color_two_colors_2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
643 gtk_container_add (GTK_CONTAINER (button_color_two_colors_2),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
644 preview_color_two_colors_2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
645 set_color_preview (newconfig.color2_red, newconfig.color2_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
646 newconfig.color2_blue, preview_color_two_colors_2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
647 gtk_widget_set_usize (button_color_two_colors_2, 50, 20);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
648
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
649 gtk_signal_connect (GTK_OBJECT (button_color_two_colors_2), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
650 GTK_SIGNAL_FUNC (color_clicked), (gpointer) 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
651
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
652 switch (newconfig.color_mode)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
653 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
654 case 0:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
655 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
656 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
657 (radio_button_one_color), TRUE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
658 break;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
659 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
660 case 1:
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
661 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
662 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
663 (radio_button_two_colors), TRUE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
664 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
665 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
666
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
667 gtk_signal_connect (GTK_OBJECT (radio_button_one_color), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
668 GTK_SIGNAL_FUNC (colormode_toggled), (gpointer) 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
669 gtk_signal_connect (GTK_OBJECT (radio_button_two_colors), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
670 GTK_SIGNAL_FUNC (colormode_toggled), (gpointer) 1);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
671
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
672 check_button = gtk_check_button_new_with_label ("Random on beat");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
673 gtk_widget_show (check_button);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
674 gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
675 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
676 newconfig.color12_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
677 gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
678 GTK_SIGNAL_FUNC (color12_random_toggled), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
679
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
680 hseparator = gtk_hseparator_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
681 gtk_widget_show (hseparator);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
682 gtk_box_pack_start (GTK_BOX (vbox), hseparator, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
683
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
684 /* the third hbox: a color selection/preview button */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
685
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
686 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
687 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
688 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
689
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
690 label = gtk_label_new ("Background color");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
691 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
692 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
693
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
694 button_background = gtk_button_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
695 gtk_box_pack_start (GTK_BOX (hbox), button_background, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
696 gtk_widget_show (button_background);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
697 preview_background = gtk_preview_new (GTK_PREVIEW_COLOR);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
698 gtk_preview_size (GTK_PREVIEW (preview_background), 32, 16);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
699 gtk_widget_show (preview_background);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
700 gtk_container_add (GTK_CONTAINER (button_background), preview_background);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
701 set_color_preview (newconfig.bgc_red, newconfig.bgc_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
702 newconfig.bgc_blue, preview_background);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
703 gtk_widget_set_usize (button_background, 50, 20);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
704
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
705 gtk_signal_connect (GTK_OBJECT (button_background), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
706 GTK_SIGNAL_FUNC (color_clicked), (gpointer) 3);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
707
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
708 check_button = gtk_check_button_new_with_label ("Random on beat");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
709 gtk_widget_show (check_button);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
710 gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
711 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
712 newconfig.bgc_random);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
713 gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
714 GTK_SIGNAL_FUNC (bgc_random_toggled), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
715 /*
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
716 check_button = gtk_check_button_new_with_label ("Wireframe");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
717 gtk_widget_show (check_button);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
718 gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
719 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
720 newconfig.wireframe);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
721 gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
722 GTK_SIGNAL_FUNC (wireframe_toggled), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
723 */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
724 /* end */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
725
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
726 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
727
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
728
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
729 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
730 create_config_beat (GtkWidget * vbox_container)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
731 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
732 GtkWidget *frame;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
733 GtkWidget *vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
734 GtkWidget *hbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
735
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
736 GtkWidget *button_beat;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
737 GtkWidget *button_theme_beat;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
738
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
739 GtkWidget *label;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
740 GtkWidget *button_flash;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
741 GtkWidget *preview_flash;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
742
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
743 GtkObject *adjustment;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
744 GtkWidget *hscale;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
745
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
746 frame = gtk_frame_new ("beat");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
747 gtk_box_pack_start (GTK_BOX (vbox_container), frame, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
748 vbox = gtk_vbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
749 gtk_container_add (GTK_CONTAINER (frame), vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
750
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
751 /* the first hbox: two buttons */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
752
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
753 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
754 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
755 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
756
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
757 button_beat = gtk_check_button_new_with_label ("Flash on beat");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
758 gtk_widget_show (button_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
759 gtk_box_pack_start (GTK_BOX (hbox), button_beat, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
760 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_beat),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
761 newconfig.color_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
762 gtk_signal_connect (GTK_OBJECT (button_beat), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
763 GTK_SIGNAL_FUNC (colorbeat_toggled), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
764
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
765 button_theme_beat =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
766 gtk_check_button_new_with_label ("Change theme on beat");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
767 gtk_widget_show (button_theme_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
768 gtk_box_pack_start (GTK_BOX (hbox), button_theme_beat, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
769 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_theme_beat),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
770 newconfig.change_theme_on_beat);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
771 gtk_signal_connect (GTK_OBJECT (button_theme_beat), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
772 GTK_SIGNAL_FUNC (theme_beat_toggled), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
773
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
774 /* the second hbox: a label and a color selection/preview button */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
775
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
776 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
777 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
778 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
779
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
780 label = gtk_label_new ("Flash color");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
781 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
782 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
783
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
784 button_flash = gtk_button_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
785 gtk_box_pack_start (GTK_BOX (hbox), button_flash, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
786 gtk_widget_show (button_flash);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
787 preview_flash = gtk_preview_new (GTK_PREVIEW_COLOR);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
788 gtk_preview_size (GTK_PREVIEW (preview_flash), 32, 16);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
789 gtk_widget_show (preview_flash);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
790 gtk_container_add (GTK_CONTAINER (button_flash), preview_flash);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
791 set_color_preview (newconfig.color_flash_red, newconfig.color_flash_green,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
792 newconfig.color_flash_blue, preview_flash);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
793 gtk_widget_set_usize (button_flash, 50, 20);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
794 gtk_signal_connect (GTK_OBJECT (button_flash), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
795 GTK_SIGNAL_FUNC (color_clicked), (gpointer) 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
796
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
797 /* the third hbox: a label and a horizontal scale */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
798
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
799 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
800 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
801 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
802
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
803 label = gtk_label_new ("Flash duration (in frames)");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
804 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
805 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
806
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
807 adjustment = gtk_adjustment_new (newconfig.flash_speed, 1, 50, 1, 5, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
808 hscale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
809 gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_LEFT);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
810 gtk_scale_set_digits (GTK_SCALE (hscale), 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
811 gtk_widget_set_usize (GTK_WIDGET (hscale), 200, 25);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
812 gtk_box_pack_start (GTK_BOX (hbox), hscale, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
813 gtk_widget_show (hscale);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
814 gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
815 GTK_SIGNAL_FUNC (value_flash_speed), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
816
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
817 label =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
818 gtk_label_new
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
819 ("Image are drawn at a rate of 50 frames per second.\n So a flash of 50 frames lasts 1 second.");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
820 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
821 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
822 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
823
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
824
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
825 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
826 create_config_fs (GtkWidget * vbox_container)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
827 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
828 GtkWidget *frame;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
829 GtkWidget *vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
830 GtkWidget *hbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
831
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
832 GtkWidget *button_fs;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
833 GtkWidget *combobox_fs;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
834
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
835 GtkWidget *label;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
836
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
837 char str[10];
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
838
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
839 frame = gtk_frame_new ("fullscreen");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
840 gtk_box_pack_start (GTK_BOX (vbox_container), frame, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
841 vbox = gtk_vbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
842 gtk_container_add (GTK_CONTAINER (frame), vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
843
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
844 /* the first hbox: a button */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
845
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
846 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
847 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
848 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
849
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
850 button_fs = gtk_check_button_new_with_label ("Start in fullscreen mode");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
851 gtk_widget_show (button_fs);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
852 gtk_box_pack_start (GTK_BOX (hbox), button_fs, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
853 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_fs),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
854 newconfig.fullscreen);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
855 gtk_signal_connect (GTK_OBJECT (button_fs), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
856 GTK_SIGNAL_FUNC (fullscreen_toggled), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
857
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
858 /* the second hbox: a label combobox */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
859
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
860 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
861 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
862 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
863
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
864 label = gtk_label_new ("Fullscreen resolution");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
865 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
866 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
867
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
868 combobox_fs = gtk_combo_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
869
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
870 gtk_combo_set_popdown_strings (GTK_COMBO (combobox_fs), GLWin.glist);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
871
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
872 gtk_box_pack_start (GTK_BOX (hbox), combobox_fs, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
873 gtk_widget_show (combobox_fs);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
874
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
875 gtk_signal_connect (GTK_OBJECT (GTK_COMBO (combobox_fs)->entry), "changed",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
876 GTK_SIGNAL_FUNC (combo_fs_activated), combobox_fs);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
877 gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combobox_fs)->entry), FALSE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
878 sprintf (str, "%dx%d", newconfig.fs_width, newconfig.fs_height);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
879 gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (combobox_fs)->entry), str);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
880
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
881 label = gtk_label_new
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
882 ("Use the f key in the GL window\nto switch to fullscreen and back.\n\
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
883 Use the esc key to quit the plugin.\n\
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
884 \n\
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
885 If you use the sawfish window manager,\n\
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
886 you may have problem going fullscreen.\n\
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
887 In this case, switch to a console and\n\
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
888 type \'killall xmms\'.");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
889 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
890 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
891 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
892
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
893 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
894 create_config_transition (GtkWidget * vbox_container)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
895 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
896 GtkWidget *frame;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
897 GtkWidget *vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
898 GtkWidget *hbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
899
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
900 GtkWidget *button_ts;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
901 GtkWidget *label;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
902
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
903 GtkObject *adjustment;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
904 GtkWidget *hscale;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
905
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
906 frame = gtk_frame_new ("transition");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
907 gtk_box_pack_start (GTK_BOX (vbox_container), frame, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
908 vbox = gtk_vbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
909 gtk_container_add (GTK_CONTAINER (frame), vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
910
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
911 /* the first hbox: a button */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
912
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
913 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
914 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
915 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
916
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
917 button_ts =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
918 gtk_check_button_new_with_label ("Use transitions on theme change");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
919 gtk_widget_show (button_ts);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
920 gtk_box_pack_start (GTK_BOX (hbox), button_ts, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
921 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_ts),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
922 newconfig.transition);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
923 gtk_signal_connect (GTK_OBJECT (button_ts), "toggled",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
924 GTK_SIGNAL_FUNC (transition_toggled), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
925
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
926 label = gtk_label_new ("Chooses a random transition for now");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
927 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
928 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
929
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
930 /* the second hbox: a label and a horizontal scale */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
931
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
932 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
933 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
934 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
935
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
936 label = gtk_label_new ("Transition duration (in miliseconds)");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
937 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
938 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
939
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
940 adjustment =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
941 gtk_adjustment_new (newconfig.trans_duration, 1.0, 50.0, 1.0, 1.0, 1.0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
942 hscale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
943 gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_LEFT);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
944 gtk_scale_set_digits (GTK_SCALE (hscale), 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
945 gtk_widget_set_usize (GTK_WIDGET (hscale), 200, 25);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
946 gtk_box_pack_start (GTK_BOX (hbox), hscale, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
947 gtk_widget_show (hscale);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
948 gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
949 GTK_SIGNAL_FUNC (value_trans_duration), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
950 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
951
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
952 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
953 create_config_glx_info (GtkWidget * vbox_container)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
954 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
955 GtkWidget *frame;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
956 GtkWidget *vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
957 GtkWidget *hbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
958
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
959 GtkWidget *label;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
960
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
961 frame = gtk_frame_new ("GLX informations");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
962 gtk_box_pack_start (GTK_BOX (vbox_container), frame, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
963 vbox = gtk_vbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
964 gtk_container_add (GTK_CONTAINER (frame), vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
965
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
966 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
967 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
968 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
969
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
970 if (GLWin.ctx == NULL)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
971 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
972 label = gtk_label_new ("Launch the plugin and reopen the configure window to see\n\
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
973 informations about your GL setup.");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
974 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
975 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
976 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
977 else
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
978 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
979 char *string;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
980 string = g_strconcat ("GLX version: ", g_strdup_printf ("%d.%d", GLWin.glxMajorVersion, GLWin.glxMinorVersion), NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
981 label = gtk_label_new (string);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
982 free(string);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
983 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
984 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
985
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
986 if (GLWin.DRI)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
987 string = g_strconcat ("Use DRI: ", "yes", NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
988 else
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
989 string = g_strconcat ("Use DRI: ", "no", NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
990 label = gtk_label_new (string);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
991 free(string);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
992 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
993 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
994
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
995 if (GLWin.DoubleBuffered)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
996 string = g_strconcat ("Double buffered rendering: ", "yes", NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
997 else
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
998 string = g_strconcat ("Double buffered rendering: : ", "no", NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
999 label = gtk_label_new (string);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1000 free(string);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1001 gtk_widget_show (label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1002 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1003 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1004 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1005
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1006 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1007 create_config_theme (GtkWidget * vbox_container)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1008 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1009 GtkWidget *frame;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1010 GtkWidget *hbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1011 GtkWidget *table;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1012 GtkWidget *label;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1013 gint i, y;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1014
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1015 frame = gtk_frame_new ("Themes priorities");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1016 gtk_box_pack_start (GTK_BOX (vbox_container), frame, TRUE, TRUE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1017
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1018 hbox = gtk_hbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1019 gtk_widget_show (hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1020 gtk_container_add (GTK_CONTAINER (frame), hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1021
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1022 table = gtk_table_new (2, THEME_NUMBER, FALSE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1023 gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 12);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1024
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1025 for (i = 0, y = 0; i < THEME_NUMBER; i++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1026 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1027 GtkObject *adjustment;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1028 GtkWidget *hscale;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1029
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1030 label = gtk_label_new (theme[i].name);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1031 gtk_table_attach (GTK_TABLE (table), label, 0, 1, y, y + 1, GTK_EXPAND,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1032 0, 0, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1033 adjustment =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1034 gtk_adjustment_new (theme[i].config->global->priority * 100.0, 0.0,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1035 100.0, 1.0, 10.0, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1036 hscale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1037 gtk_scale_set_digits (GTK_SCALE (hscale), 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1038 gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_LEFT);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1039 gtk_table_attach (GTK_TABLE (table), hscale, 1, 2, y, y + 1,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1040 GTK_EXPAND | GTK_FILL, 0, 0, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1041 gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1042 GTK_SIGNAL_FUNC (priority_value_changed),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1043 (void *) i);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1044
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1045 y++;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1046 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1047
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1048 gtk_widget_show (frame);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1049 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1050
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1051
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1052 static void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1053 cb_select_monitor_config (GtkWidget * ctree, GtkCTreeNode * node)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1054 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1055 gint row;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1056
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1057 if (!GTK_CLIST (ctree)->selection)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1058 return;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1059 row =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1060 GPOINTER_TO_INT (gtk_ctree_node_get_row_data (GTK_CTREE (ctree), node));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1061 gtk_notebook_set_page (GTK_NOTEBOOK (config_notebook), row);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1062 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1063
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1064
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1065 static GtkWidget *
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1066 create_config_page (GtkNotebook * notebook, gchar * text, GtkCTree * ctree,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1067 GtkCTreeNode * node_parent, GtkCTreeNode ** node_result)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1068 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1069 GtkWidget *vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1070 GtkCTreeNode *node;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1071 gchar *title[1] = { text };
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1072
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1073 vbox = gtk_vbox_new (FALSE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1074 node = gtk_ctree_insert_node (ctree, node_parent, NULL, title, 0,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1075 NULL, NULL, NULL, NULL, FALSE, FALSE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1076 gtk_ctree_node_set_row_data (ctree, node, GINT_TO_POINTER (config_page++));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1077 gtk_notebook_append_page (notebook, vbox, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1078 if (node_result)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1079 *node_result = node;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1080 return vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1081 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1082
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1083
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1084 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1085 iris_first_init (void)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1086 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1087 static gboolean init;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1088 int i;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1089
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1090 if (!init)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1091 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1092 theme_register ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1093 theme_config_init ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1094 /* here we collect information about resolutions supported by the display */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1095 /* get a connection */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1096 GLWin.dpy = XOpenDisplay (0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1097 GLWin.screen = DefaultScreen (GLWin.dpy);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1098 XF86VidModeQueryVersion (GLWin.dpy, &GLWin.vidModeMajorVersion,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1099 &GLWin.vidModeMinorVersion);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1100 XF86VidModeGetAllModeLines (GLWin.dpy, GLWin.screen, &GLWin.modeNum,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1101 &GLWin.modes);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1102 /* save desktop-resolution before switching modes */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1103 GLWin.deskMode = *(GLWin.modes[0]);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1104
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1105 /* fill an array of string for the config combo box */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1106 for (i = 0; i < GLWin.modeNum; i++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1107 GLWin.glist =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1108 g_list_append (GLWin.glist,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1109 g_strdup_printf ("%dx%d", GLWin.modes[i]->hdisplay,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1110 GLWin.modes[i]->vdisplay));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1111
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1112 init = TRUE;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1113 XCloseDisplay (GLWin.dpy);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1114 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1115 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1116
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1117 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1118 iris_configure (void)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1119 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1120 GtkWidget *config_vbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1121
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1122 GtkWidget *vbox, *buttonbox, *ok, *apply, *cancel;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1123 GtkWidget *config_hbox;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1124 GtkWidget *config_scrolled;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1125
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1126 gchar *title[1] = { "iris config" };
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1127 GtkCTreeNode *node;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1128 GtkCTreeNode *node_themes;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1129 gint i;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1130
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1131 if (config_window)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1132 return;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1133 config_page = 0;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1134
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1135 iris_first_init ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1136 iris_config_read ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1137 memcpy (&newconfig, &config, sizeof (iris_config));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1138
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1139 config_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1140 gtk_signal_connect (GTK_OBJECT (config_window), "delete_event",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1141 GTK_SIGNAL_FUNC (conf_closed), &config_window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1142 gtk_container_set_border_width (GTK_CONTAINER (config_window), 6);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1143 gtk_window_set_title (GTK_WINDOW (config_window), "iris configuration");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1144
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1145 config_hbox = gtk_hbox_new (FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1146 gtk_container_add (GTK_CONTAINER (config_window), config_hbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1147
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1148 config_scrolled = gtk_scrolled_window_new (NULL, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1149 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (config_scrolled),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1150 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1151 gtk_box_pack_start (GTK_BOX (config_hbox), config_scrolled, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1152
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1153 config_vbox = gtk_vbox_new (FALSE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1154 gtk_box_pack_start (GTK_BOX (config_hbox), config_vbox, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1155
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1156 config_ctree = gtk_ctree_new_with_titles (1, 0, title);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1157 gtk_ctree_set_indent (GTK_CTREE (config_ctree), 16);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1158 gtk_clist_column_titles_passive (GTK_CLIST (config_ctree));
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1159 gtk_widget_set_usize (config_ctree, 150, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1160 gtk_container_add (GTK_CONTAINER (config_scrolled), config_ctree);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1161 gtk_signal_connect (GTK_OBJECT (config_ctree), "tree_select_row",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1162 (GtkSignalFunc) cb_select_monitor_config, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1163 config_notebook = gtk_notebook_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1164 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (config_notebook), FALSE);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1165 gtk_box_pack_start (GTK_BOX (config_vbox), config_notebook, TRUE, TRUE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1166
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1167 vbox = create_config_page (GTK_NOTEBOOK (config_notebook), "Color",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1168 GTK_CTREE (config_ctree), NULL, &node);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1169 create_config_color (vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1170 gtk_ctree_select (GTK_CTREE (config_ctree), node);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1171
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1172 vbox = create_config_page (GTK_NOTEBOOK (config_notebook), "Beat",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1173 GTK_CTREE (config_ctree), NULL, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1174 create_config_beat (vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1175
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1176 vbox = create_config_page (GTK_NOTEBOOK (config_notebook),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1177 "Transition", GTK_CTREE (config_ctree),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1178 NULL, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1179 create_config_transition (vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1180
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1181 vbox = create_config_page (GTK_NOTEBOOK (config_notebook),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1182 "Fullscreen", GTK_CTREE (config_ctree),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1183 NULL, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1184 create_config_fs (vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1185
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1186 vbox = create_config_page (GTK_NOTEBOOK (config_notebook), "Themes",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1187 GTK_CTREE (config_ctree), NULL, &node_themes);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1188 create_config_theme (vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1189
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1190 for (i = 0; i < THEME_NUMBER; i++)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1191 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1192 GtkWidget *tabs;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1193 GtkWidget *vbox_1, *vbox_2, *vbox_3;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1194 GtkWidget *label;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1195 vbox =
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1196 create_config_page (GTK_NOTEBOOK (config_notebook),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1197 theme[i].name,
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1198 GTK_CTREE (config_ctree), node_themes, &node);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1199
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1200 tabs = gtk_notebook_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1201 gtk_box_pack_start (GTK_BOX (vbox), tabs, TRUE, TRUE, 4);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1202
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1203 /* first tab : global conf tab */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1204 vbox_1 = gtk_vbox_new (FALSE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1205 gtk_container_border_width (GTK_CONTAINER (vbox_1), 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1206 theme_config_global_widgets (vbox_1, i);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1207
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1208 label = gtk_label_new ("global settings");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1209 gtk_notebook_append_page (GTK_NOTEBOOK (tabs), vbox_1, label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1210
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1211 /* second tab : specific theme tab */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1212 if (theme[i].config_create != NULL)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1213 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1214 vbox_2 = gtk_vbox_new (FALSE, 2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1215 theme[i].config_create (vbox_2);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1216
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1217 label = gtk_label_new ("theme settings");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1218 gtk_notebook_append_page (GTK_NOTEBOOK (tabs), vbox_2, label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1219 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1220
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1221 /* third tab : info tab */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1222 vbox_3 = gtk_vbox_new (FALSE, 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1223 gtk_container_border_width (GTK_CONTAINER (vbox_3), 0);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1224 theme_about (vbox_3, i);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1225
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1226 label = gtk_label_new ("theme info");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1227 gtk_notebook_append_page (GTK_NOTEBOOK (tabs), vbox_3, label);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1228
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1229 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1230
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1231 vbox = create_config_page (GTK_NOTEBOOK (config_notebook),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1232 "GLX infos", GTK_CTREE (config_ctree),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1233 NULL, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1234 create_config_glx_info (vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1235
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1236 // vbox = create_config_page(GTK_NOTEBOOK(config_notebook), _("About"),
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1237 // GTK_CTREE(config_ctree), NULL, NULL);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1238 // create_config_about(vbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1239
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1240 /* this is the box where are Ok, Cancel and Apply */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1241 buttonbox = gtk_hbutton_box_new ();
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1242 gtk_box_pack_end (GTK_BOX (config_vbox), buttonbox, FALSE, FALSE, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1243 gtk_hbutton_box_set_layout_default (GTK_BUTTONBOX_END);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1244 gtk_widget_show (buttonbox);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1245
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1246 ok = gtk_button_new_with_label ("Quit\nand save");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1247 GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1248 gtk_box_pack_end (GTK_BOX (buttonbox), ok, FALSE, FALSE, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1249 gtk_widget_show (ok);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1250
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1251 cancel = gtk_button_new_with_label ("Quit\nwithout saving");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1252 GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1253 gtk_box_pack_end (GTK_BOX (buttonbox), cancel, FALSE, FALSE, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1254 gtk_widget_show (cancel);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1255
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1256 apply = gtk_button_new_with_label ("Apply");
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1257 GTK_WIDGET_SET_FLAGS (apply, GTK_CAN_DEFAULT);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1258 gtk_box_pack_end (GTK_BOX (buttonbox), apply, FALSE, FALSE, 8);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1259 gtk_widget_show (apply);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1260
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1261 gtk_window_set_default (GTK_WINDOW (config_window), ok);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1262
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1263 gtk_signal_connect (GTK_OBJECT (cancel), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1264 GTK_SIGNAL_FUNC (cancel_clicked), config_window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1265 gtk_signal_connect (GTK_OBJECT (ok), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1266 GTK_SIGNAL_FUNC (ok_clicked), config_window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1267 gtk_signal_connect (GTK_OBJECT (apply), "clicked",
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1268 GTK_SIGNAL_FUNC (apply_clicked), config_window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1269
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1270 gtk_widget_show_all (config_window);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1271 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1272
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1273 /*
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1274 ** Saves all window attributes (goal)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1275 ** saves only non-fullscreen window sizes for now
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1276 ** ADDME : window position
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1277 */
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1278 void
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1279 iris_save_window_attributes (void)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1280 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1281 XWindowAttributes attr;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1282 if (!GLWin.fs)
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1283 {
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1284 XGetWindowAttributes (GLWin.dpy, GLWin.window, &attr);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1285 config.window_width = attr.width;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1286 config.window_height = attr.height;
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1287 iris_config_write (&config);
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1288 }
a578bf9b2851 [svn] - iris vis plugin port
nenolod
parents:
diff changeset
1289 }