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__
32 class CriKeyDrawModeItem;
33 class CriKeyThreshold;
35 class CriKeyPointList;
43 class CriKeyNum : public BC_TumbleTextBox
48 CriKeyNum(CriKeyWindow *gui, int x, int y, float output);
51 class CriKeyPointX : public CriKeyNum
54 CriKeyPointX(CriKeyWindow *gui, int x, int y, float output)
55 : CriKeyNum(gui, x, y, output) {}
60 class CriKeyPointY : public CriKeyNum
63 CriKeyPointY(CriKeyWindow *gui, int x, int y, float output)
64 : CriKeyNum(gui, x, y, output) {}
70 class CriKeyDrawMode : public BC_PopupMenu
72 const char *draw_modes[DRAW_MODES];
74 CriKeyDrawMode(CriKeyWindow *gui, int x, int y);
76 void create_objects();
77 void update(int mode, int send=1);
81 class CriKeyDrawModeItem : public BC_MenuItem
84 CriKeyDrawModeItem(const char *txt, int id)
85 : BC_MenuItem(txt) { this->id = id; }
92 class CriKeyThreshold : public BC_FSlider
95 CriKeyThreshold(CriKeyWindow *gui, int x, int y, int w);
97 int wheel_event(int v);
101 class CriKeyDrag : public BC_CheckBox
104 CriKeyDrag(CriKeyWindow *gui, int x, int y);
110 class CriKeyPointList : public BC_ListBox
113 CriKeyPointList(CriKeyWindow *gui, CriKey *plugin, int x, int y);
117 int selection_changed();
118 int column_resize_event();
119 ArrayList<BC_ListBoxItem*> cols[PT_SZ];
121 void new_point(const char *ep, const char *xp, const char *yp,
122 const char *tp, const char *tag);
123 void del_point(int i);
124 void set_point(int i, int c, float v);
125 void set_point(int i, int c, const char *cp);
126 int set_selected(int k);
128 void update_list(int k);
133 const char *titles[PT_SZ];
137 class CriKeyNewPoint : public BC_GenericButton
140 CriKeyNewPoint(CriKeyWindow *gui, CriKey *plugin, int x, int y);
149 class CriKeyDelPoint : public BC_GenericButton
152 CriKeyDelPoint(CriKeyWindow *gui, CriKey *plugin, int x, int y);
161 class CriKeyPointUp : public BC_GenericButton
164 CriKeyPointUp(CriKeyWindow *gui, int x, int y);
172 class CriKeyPointDn : public BC_GenericButton
175 CriKeyPointDn(CriKeyWindow *gui, int x, int y);
183 class CriKeyReset : public BC_GenericButton
186 CriKeyReset(CriKeyWindow *gui, CriKey *plugin, int x, int y);
196 class CriKeyWindow : public PluginClientWindow
199 CriKeyWindow(CriKey *plugin);
202 void create_objects();
204 void start_color_thread();
205 int grab_event(XEvent *event);
206 int do_grab_event(XEvent *event);
207 void done_event(int result);
208 void send_configure_change();
211 CriKeyThreshold *threshold;
212 CriKeyDrawMode *draw_mode;
214 BC_Title *title_x, *title_y;
215 CriKeyPointX *point_x;
216 CriKeyPointY *point_y;
217 CriKeyNewPoint *new_point;
218 CriKeyDelPoint *del_point;
219 CriKeyPointUp *point_up;
220 CriKeyPointDn *point_dn;
221 int dragging, pending_config;
222 float last_x, last_y;
224 CriKeyPointList *point_list;