3 * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __CRIKEYWINDOW_H__
22 #define __CRIKEYWINDOW_H__
25 #include "colorpicker.h"
30 class CriKeyColorButton;
31 class CriKeyColorPicker;
33 class CriKeyDrawModeItem;
35 class CriKeyKeyModeItem;
36 class CriKeyThreshold;
38 class CriKeyNum : public BC_TumbleTextBox
45 CriKeyNum(CriKeyWindow *gui, int x, int y, float &output);
49 class CriKeyColorButton : public BC_GenericButton
52 CriKeyColorButton(CriKeyWindow *gui, int x, int y);
58 class CriKeyColorPicker : public ColorPicker
61 CriKeyColorPicker(CriKeyColorButton *color_button);
63 void start(int color);
64 int handle_new_color(int color, int alpha);
65 void handle_done_event(int result);
67 CriKeyColorButton *color_button;
71 class CriKeyDrawMode : public BC_PopupMenu
73 const char *draw_modes[DRAW_MODES];
75 CriKeyDrawMode(CriKeyWindow *gui, int x, int y);
77 void create_objects();
78 void update(int mode);
82 class CriKeyDrawModeItem : public BC_MenuItem
85 CriKeyDrawModeItem(const char *txt, int id)
86 : BC_MenuItem(txt) { this->id = id; }
93 class CriKeyKeyMode : public BC_PopupMenu
95 const char *key_modes[KEY_MODES];
97 CriKeyKeyMode(CriKeyWindow *gui, int x, int y);
99 void create_objects();
100 void update(int mode);
104 class CriKeyKeyModeItem : public BC_MenuItem
107 CriKeyKeyModeItem(const char *text, int id)
108 : BC_MenuItem(text) { this->id = id; }
115 class CriKeyThreshold : public BC_FSlider
118 CriKeyThreshold(CriKeyWindow *gui, int x, int y, int w);
123 class CriKeyDrag : public BC_CheckBox
126 CriKeyDrag(CriKeyWindow *gui, int x, int y);
132 class CriKeyWindow : public PluginClientWindow
135 CriKeyWindow(CriKey *plugin);
138 void create_objects();
139 void draw_key(int mode);
140 void update_color(int color);
142 void start_color_thread();
143 int grab_event(XEvent *event);
144 void done_event(int result);
147 CriKeyThreshold *threshold;
148 CriKeyDrawMode *draw_mode;
149 CriKeyKeyMode *key_mode;
151 CriKeyColorButton *color_button;
152 CriKeyColorPicker *color_picker;
153 int color_x, color_y, key_x, key_y;
154 BC_Title *title_x, *title_y;
155 CriKeyNum *point_x, *point_y;