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);
100 class CriKeyDrag : public BC_CheckBox
103 CriKeyDrag(CriKeyWindow *gui, int x, int y);
109 class CriKeyPointList : public BC_ListBox
112 CriKeyPointList(CriKeyWindow *gui, CriKey *plugin, int x, int y);
116 int selection_changed();
117 int column_resize_event();
118 ArrayList<BC_ListBoxItem*> cols[PT_SZ];
120 void new_point(const char *ep, const char *xp, const char *yp,
121 const char *tp, const char *tag);
122 void del_point(int i);
123 void set_point(int i, int c, float v);
124 void set_point(int i, int c, const char *cp);
125 int set_selected(int k);
127 void update_list(int k);
132 const char *titles[PT_SZ];
136 class CriKeyNewPoint : public BC_GenericButton
139 CriKeyNewPoint(CriKeyWindow *gui, CriKey *plugin, int x, int y);
148 class CriKeyDelPoint : public BC_GenericButton
151 CriKeyDelPoint(CriKeyWindow *gui, CriKey *plugin, int x, int y);
160 class CriKeyPointUp : public BC_GenericButton
163 CriKeyPointUp(CriKeyWindow *gui, int x, int y);
171 class CriKeyPointDn : public BC_GenericButton
174 CriKeyPointDn(CriKeyWindow *gui, int x, int y);
182 class CriKeyReset : public BC_GenericButton
185 CriKeyReset(CriKeyWindow *gui, CriKey *plugin, int x, int y);
195 class CriKeyWindow : public PluginClientWindow
198 CriKeyWindow(CriKey *plugin);
201 void create_objects();
203 void start_color_thread();
204 int grab_event(XEvent *event);
205 void done_event(int result);
206 int check_configure_change(int ret);
207 void send_configure_change();
210 CriKeyThreshold *threshold;
211 CriKeyDrawMode *draw_mode;
213 BC_Title *title_x, *title_y;
214 CriKeyPointX *point_x;
215 CriKeyPointY *point_y;
216 CriKeyNewPoint *new_point;
217 CriKeyDelPoint *del_point;
218 CriKeyPointUp *point_up;
219 CriKeyPointDn *point_dn;
220 int dragging, pending_config;
221 float last_x, last_y;
223 CriKeyPointList *point_list;