r370: Heroine Virutal's official release 1.2.1
[cinelerra_cv/mob.git] / hvirtual / cinelerra / awindowgui.h
blob5e884b3023ed49e8103d40f22ac99ac43a844453
1 #ifndef AWINDOWGUI_H
2 #define AWINDOWGUI_H
4 #include "arraylist.h"
5 #include "assetpopup.inc"
6 #include "asset.inc"
7 #include "assets.inc"
8 #include "awindow.inc"
9 #include "awindowmenu.inc"
10 #include "edl.inc"
11 #include "guicast.h"
12 #include "mwindow.inc"
13 #include "newfolder.inc"
14 #include "pluginserver.inc"
16 class AWindowAssets;
17 class AWindowFolders;
18 class AWindowNewFolder;
19 class AWindowDeleteFolder;
20 class AWindowRenameFolder;
21 class AWindowDeleteDisk;
22 class AWindowDeleteProject;
23 class AWindowDivider;
24 class AWindowInfo;
25 class AWindowRedrawIndex;
26 class AWindowPaste;
27 class AWindowAppend;
28 class AWindowView;
31 class AWindowGUI;
33 class AssetPicon : public BC_ListBoxItem
35 public:
36 AssetPicon(MWindow *mwindow, AWindowGUI *gui, Asset *asset);
37 AssetPicon(MWindow *mwindow, AWindowGUI *gui, EDL *edl);
38 AssetPicon(MWindow *mwindow, AWindowGUI *gui, PluginServer *plugin);
39 AssetPicon(MWindow *mwindow, AWindowGUI *gui, char *folder);
40 virtual ~AssetPicon();
42 void create_objects();
43 void reset();
45 MWindow *mwindow;
46 AWindowGUI *gui;
47 BC_Pixmap *icon;
48 VFrame *icon_vframe;
49 // ID of thing pointed to
50 int id;
52 // Check ID first. Update these next before dereferencing
53 // Asset if asset
54 Asset *asset;
55 // EDL if clip
56 EDL *edl;
58 int in_use;
61 int persistent;
62 PluginServer *plugin;
66 class AWindowGUI : public BC_Window
68 public:
69 AWindowGUI(MWindow *mwindow, AWindow *awindow);
70 ~AWindowGUI();
72 int create_objects();
73 int resize_event(int w, int h);
74 int translation_event();
75 int close_event();
76 int keypress_event();
77 void update_assets();
78 void sort_assets();
79 void reposition_objects();
80 int current_folder_number();
81 // Call back for MWindow entry point
82 int drag_motion();
83 int drag_stop();
84 // Collect items into the drag vectors of MainSession
85 void collect_assets();
86 void create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
87 int do_audio,
88 int do_video,
89 int is_realtime,
90 int is_transition);
91 void copy_picons(ArrayList<BC_ListBoxItem*> *dst,
92 ArrayList<BC_ListBoxItem*> *src,
93 char *folder);
94 void sort_picons(ArrayList<BC_ListBoxItem*> *src,
95 char *folder);
96 // Return the selected asset in asset_list
97 Asset* selected_asset();
98 PluginServer* selected_plugin();
99 AssetPicon* selected_folder();
101 MWindow *mwindow;
102 AWindow *awindow;
104 AWindowAssets *asset_list;
105 AWindowFolders *folder_list;
106 AWindowDivider *divider;
108 // Store data to speed up responses
109 // Persistant data for listboxes
110 // All assets in current EDL
111 ArrayList<BC_ListBoxItem*> assets;
112 ArrayList<BC_ListBoxItem*> folders;
113 ArrayList<BC_ListBoxItem*> aeffects;
114 ArrayList<BC_ListBoxItem*> veffects;
115 ArrayList<BC_ListBoxItem*> atransitions;
116 ArrayList<BC_ListBoxItem*> vtransitions;
118 // Currently displayed data for listboxes
119 // Currently displayed assets + comments
120 ArrayList<BC_ListBoxItem*> displayed_assets[2];
122 char *asset_titles[ASSET_COLUMNS];
124 // Persistent icons
125 BC_Pixmap *folder_icon;
126 BC_Pixmap *file_icon;
127 BC_Pixmap *audio_icon;
128 BC_Pixmap *video_icon;
129 BC_Pixmap *clip_icon;
130 NewFolderThread *newfolder_thread;
132 // Popup menus
133 AssetPopup *asset_menu;
134 AssetListMenu *assetlist_menu;
135 FolderListMenu *folderlist_menu;
136 // Temporary for reading picons from files
137 VFrame *temp_picon;
139 private:
140 void update_folder_list();
141 void update_asset_list();
142 void filter_displayed_assets();
145 class AWindowAssets : public BC_ListBox
147 public:
148 AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
149 ~AWindowAssets();
151 int handle_event();
152 int selection_changed();
153 void draw_background();
154 int drag_start_event();
155 int drag_motion_event();
156 int drag_stop_event();
157 int button_press_event();
158 int column_resize_event();
160 MWindow *mwindow;
161 AWindowGUI *gui;
164 class AWindowDivider : public BC_SubWindow
166 public:
167 AWindowDivider(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
168 ~AWindowDivider();
170 int button_press_event();
171 int cursor_motion_event();
172 int button_release_event();
174 MWindow *mwindow;
175 AWindowGUI *gui;
178 class AWindowFolders : public BC_ListBox
180 public:
181 AWindowFolders(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
182 ~AWindowFolders();
184 int selection_changed();
185 int button_press_event();
187 MWindow *mwindow;
188 AWindowGUI *gui;
191 class AWindowNewFolder : public BC_Button
193 public:
194 AWindowNewFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
195 int handle_event();
196 MWindow *mwindow;
197 AWindowGUI *gui;
198 int x, y;
201 class AWindowDeleteFolder : public BC_Button
203 public:
204 AWindowDeleteFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
205 int handle_event();
206 MWindow *mwindow;
207 AWindowGUI *gui;
208 int x, y;
211 class AWindowRenameFolder : public BC_Button
213 public:
214 AWindowRenameFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
215 int handle_event();
216 MWindow *mwindow;
217 AWindowGUI *gui;
218 int x, y;
221 class AWindowDeleteDisk : public BC_Button
223 public:
224 AWindowDeleteDisk(MWindow *mwindow, AWindowGUI *gui, int x, int y);
225 int handle_event();
226 MWindow *mwindow;
227 AWindowGUI *gui;
228 int x, y;
231 class AWindowDeleteProject : public BC_Button
233 public:
234 AWindowDeleteProject(MWindow *mwindow, AWindowGUI *gui, int x, int y);
235 int handle_event();
236 MWindow *mwindow;
237 AWindowGUI *gui;
238 int x, y;
241 class AWindowInfo : public BC_Button
243 public:
244 AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y);
245 int handle_event();
246 MWindow *mwindow;
247 AWindowGUI *gui;
248 int x, y;
251 class AWindowRedrawIndex : public BC_Button
253 public:
254 AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y);
255 int handle_event();
256 MWindow *mwindow;
257 AWindowGUI *gui;
258 int x, y;
261 class AWindowPaste : public BC_Button
263 public:
264 AWindowPaste(MWindow *mwindow, AWindowGUI *gui, int x, int y);
265 int handle_event();
266 MWindow *mwindow;
267 AWindowGUI *gui;
268 int x, y;
271 class AWindowAppend : public BC_Button
273 public:
274 AWindowAppend(MWindow *mwindow, AWindowGUI *gui, int x, int y);
275 int handle_event();
276 MWindow *mwindow;
277 AWindowGUI *gui;
278 int x, y;
281 class AWindowView : public BC_Button
283 public:
284 AWindowView(MWindow *mwindow, AWindowGUI *gui, int x, int y);
285 int handle_event();
286 MWindow *mwindow;
287 AWindowGUI *gui;
288 int x, y;
291 #endif