dragcheckbox rework, boxblur create can grab
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / nbodycuda / nbodywindow.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2008-2014 Adam Williams <broadcast at earthling dot net>
4  * 
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.
9  * 
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.
14  * 
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
18  * 
19  */
20
21 #ifndef NBODYCUDAWINDOW_H
22 #define NBODYCUDAWINDOW_H
23
24
25 #include "guicast.h"
26 #include "nbody.h"
27
28 class N_BodyDrag;
29 class N_BodyReset;
30 class NBodyModeItems;
31 class N_BodySetMode;
32 class NBodyDemoItems;
33 class N_BodySetDemo;
34 class NBodyNumBodyItems;
35 class N_BodyNumBodies;
36 class N_BodyWindow;
37
38 class N_BodyDrag : public BC_CheckBox
39 {
40 public:
41         N_BodyDrag(N_BodyWindow *gui, int x, int y);
42
43         int handle_event();
44         int handle_ungrab();
45         N_BodyWindow *gui;
46 };
47
48 class N_BodyReset : public BC_GenericButton
49 {
50 public:
51         N_BodyReset(N_BodyWindow *gui, int x, int y);
52         ~N_BodyReset();
53         int handle_event();
54
55         N_BodyWindow *gui;
56 };
57
58 class NBodyModeItems : public ArrayList<BC_ListBoxItem*>
59 {
60 public:
61         NBodyModeItems() {} 
62         ~NBodyModeItems() { remove_all_objects(); }
63 };
64
65 class N_BodySetMode : public BC_PopupTextBox
66 {
67 public:
68         N_BodySetMode(N_BodyWindow *gui, int x, int y, const char *text);
69         void create_objects();
70         int handle_event();
71
72         N_BodyWindow *gui;
73         NBodyModeItems mode_items;
74 };
75
76 class NBodyDemoItems : public ArrayList<BC_ListBoxItem*>
77 {
78 public:
79         NBodyDemoItems() {} 
80         ~NBodyDemoItems() { remove_all_objects(); }
81 };
82
83 class N_BodySetDemo : public BC_PopupTextBox
84 {
85 public:
86         N_BodySetDemo(N_BodyWindow *gui, int x, int y, const char *text);
87         void create_objects();
88         int handle_event();
89
90         N_BodyWindow *gui;
91         NBodyDemoItems demo_items;
92 };
93
94 class NBodyNumBodyItems : public ArrayList<BC_ListBoxItem*>
95 {
96 public:
97         NBodyNumBodyItems() {} 
98         ~NBodyNumBodyItems() { remove_all_objects(); }
99 };
100
101 class N_BodyNumBodies : public BC_PopupTextBox
102 {
103 public:
104         N_BodyNumBodies(N_BodyWindow *gui, int x, int y, const char *text);
105         void create_objects();
106         int handle_event();
107
108         N_BodyWindow *gui;
109         NBodyNumBodyItems num_body_items;
110 };
111
112
113 class N_BodyWindow : public PluginClientWindow
114 {
115 public:
116         N_BodyWindow(N_BodyMain *plugin);
117         ~N_BodyWindow();
118
119         void create_objects();
120         void update_gui();
121
122         int grab_event(XEvent *event);
123         int do_grab_event(XEvent *event);
124         void done_event(int result);
125         void send_configure_change();
126
127         N_BodyMain *plugin;
128         N_BodySetMode *set_mode;
129         N_BodySetDemo *set_demo;
130         N_BodyNumBodies *num_bodies;
131         N_BodyDrag *drag;
132         N_BodyReset *reset;
133
134         int press_x, press_y;
135         int button_no, pending_config;
136 };
137
138 #endif