4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "automation.inc"
26 #include "condition.inc"
27 #include "colorpicker.h"
29 #include "gwindowgui.inc"
30 #include "mwindow.inc"
33 NONAUTOTOGGLES_ASSETS,
34 NONAUTOTOGGLES_TITLES,
35 NONAUTOTOGGLES_TRANSITIONS,
36 NONAUTOTOGGLES_PLUGIN_AUTOS,
37 NONAUTOTOGGLES_HARD_EDGES,
38 NONAUTOTOGGLES_CAMERA_XYZ,
39 NONAUTOTOGGLES_PROJECTOR_XYZ,
50 class GWindowGUI : public BC_Window
53 GWindowGUI(MWindow *mwindow, int w, int h);
55 static void calculate_extents(BC_WindowBase *gui, int *w, int *h);
56 void create_objects();
57 int translation_event();
60 void update_toggles(int use_lock);
61 void toggle_camera_xyz();
62 void toggle_projector_xyz();
63 void update_mwindow(int toggles, int overlays);
66 int *get_main_value(toggleinfo *info);
67 int check_xyz(int group);
68 void xyz_check(int group, int v);
69 void set_cool(int reset, int all=0);
70 void set_hot(GWindowToggle *toggle);
72 static const char *non_auto_text[];
73 static const char *auto_text[];
74 static const char *non_auto_help[];
75 static const char *auto_help[];
76 static const char *xyz_group[];
77 static const char *xyz_accel[];
78 static int auto_colors[];
79 static const char *toggle_text(toggleinfo *tp);
80 static const char *toggle_help(toggleinfo *tp);
83 GWindowToggle *toggles[NONAUTOTOGGLES_COUNT + AUTOMATION_TOTAL];
84 GWindowToggle *camera_xyz, *projector_xyz, *hard_edges;
87 class GWindowToggle : public BC_CheckBox
90 GWindowToggle(GWindowGUI *gui, int x, int y,
91 const char *text, int color, toggleinfo *info);
96 void update_gui(int color);
97 int draw_face(int flash, int flush);
103 GWindowColorButton *color_button;
106 class GWindowColorButton : public ColorCircleButton
109 GWindowColorButton(GWindowToggle *auto_toggle,
110 int x, int y, int w, int color);
111 ~GWindowColorButton();
112 int handle_new_color(int color, int alpha);
113 void handle_done_event(int result);
115 GWindowToggle *auto_toggle;