/* * CINELERRA * Copyright (C) 2008 Adam Williams * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef AWINDOWGUI_H #define AWINDOWGUI_H #include "arraylist.h" #include "bcdialog.h" #include "assetpopup.inc" #include "asset.inc" #include "assets.inc" #include "awindow.inc" #include "awindowmenu.inc" #include "edl.inc" #include "guicast.h" #include "indexable.inc" #include "mwindow.inc" #include "newfolder.inc" #include "pluginserver.inc" class AWindowAssets; class AWindowFolders; class AWindowNewFolder; class AWindowDeleteFolder; class AWindowRenameFolder; class AWindowDeleteDisk; class AWindowDeleteProject; class AWindowDivider; class AWindowInfo; class AWindowRedrawIndex; class AWindowPaste; class AWindowAppend; class AWindowView; class AddTools; class AddPluginsMenu; class AddPluginItem; class AWindowGUI; class AssetPicon : public BC_ListBoxItem { public: AssetPicon(MWindow *mwindow, AWindowGUI *gui, Indexable *indexable); AssetPicon(MWindow *mwindow, AWindowGUI *gui, EDL *edl); AssetPicon(MWindow *mwindow, AWindowGUI *gui, PluginServer *plugin); AssetPicon(MWindow *mwindow, AWindowGUI *gui, const char *folder); virtual ~AssetPicon(); void create_objects(); void reset(); MWindow *mwindow; AWindowGUI *gui; BC_Pixmap *icon; VFrame *icon_vframe; // ID of thing pointed to int id; // Check ID first. Update these next before dereferencing // Asset if asset Indexable *indexable; // EDL if clip EDL *edl; int in_use; int persistent; PluginServer *plugin; }; class AWindowRemovePlugin; class AWindowRemovePluginGUI : public BC_Window { public: AWindow *awindow; AWindowRemovePlugin *thread; PluginServer *plugin; ArrayList plugin_list; BC_Pixmap *icon; VFrame *icon_vframe; BC_ListBox *list; void create_objects(); AWindowRemovePluginGUI(AWindow *awindow, AWindowRemovePlugin *thread, int x, int y, PluginServer *plugin); ~AWindowRemovePluginGUI(); }; class AWindowRemovePlugin : public BC_DialogThread { public: AWindow *awindow; PluginServer *plugin; BC_Window* new_gui(); void handle_close_event(int result); int remove_plugin(PluginServer *plugin, ArrayList &folder); AWindowRemovePlugin(AWindow *awindow, PluginServer *plugin); ~AWindowRemovePlugin(); }; class AWindowGUI : public BC_Window { public: AWindowGUI(MWindow *mwindow, AWindow *awindow); ~AWindowGUI(); void create_objects(); int resize_event(int w, int h); int translation_event(); int close_event(); int keypress_event(); void update_assets(); void update_effects(); void sort_assets(); void reposition_objects(); int current_folder_number(); // Call back for MWindow entry point int drag_motion(); int drag_stop(); // Collect items into the drag vectors of MainSession void collect_assets(); void create_persistent_folder(ArrayList *output, int do_audio, int do_video, int is_realtime, int is_transition); void copy_picons(ArrayList *dst, ArrayList *src, char *folder); void sort_picons(ArrayList *src, char *folder); // Return the selected asset in asset_list Indexable* selected_asset(); PluginServer* selected_plugin(); AssetPicon* selected_folder(); bool protected_pixmap(BC_Pixmap *pixmap); MWindow *mwindow; AWindow *awindow; AWindowAssets *asset_list; AWindowFolders *folder_list; AWindowDivider *divider; uint32_t plugin_visibility; // Store data to speed up responses // Persistant data for listboxes // All assets in current EDL ArrayList assets; ArrayList folders; ArrayList aeffects; ArrayList veffects; ArrayList atransitions; ArrayList vtransitions; // Currently displayed data for listboxes // Currently displayed assets + comments ArrayList displayed_assets[2]; const char *asset_titles[ASSET_COLUMNS]; // Persistent icons BC_Pixmap *folder_icon; BC_Pixmap *file_icon; BC_Pixmap *audio_icon; BC_Pixmap *video_icon; BC_Pixmap *clip_icon; VFrame *clip_vframe; BC_Pixmap *atransition_icon; VFrame *atransition_vframe; BC_Pixmap *vtransition_icon; VFrame *vtransition_vframe; BC_Pixmap *aeffect_icon; VFrame *aeffect_vframe; BC_Pixmap *ladspa_icon; VFrame *ladspa_vframe; BC_Pixmap *veffect_icon; VFrame *veffect_vframe; NewFolderThread *newfolder_thread; // Popup menus AssetPopup *asset_menu; AssetListMenu *assetlist_menu; FolderListMenu *folderlist_menu; AddTools *add_tools; // Temporary for reading picons from files VFrame *temp_picon; AWindowRemovePlugin *remove_plugin; private: void update_folder_list(); void update_asset_list(); void filter_displayed_assets(); }; class AWindowAssets : public BC_ListBox { public: AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h); ~AWindowAssets(); int handle_event(); int selection_changed(); void draw_background(); int drag_start_event(); int drag_motion_event(); int drag_stop_event(); int button_press_event(); int column_resize_event(); MWindow *mwindow; AWindowGUI *gui; }; class AWindowDivider : public BC_SubWindow { public: AWindowDivider(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h); ~AWindowDivider(); int button_press_event(); int cursor_motion_event(); int button_release_event(); MWindow *mwindow; AWindowGUI *gui; }; class AWindowFolders : public BC_ListBox { public: AWindowFolders(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h); ~AWindowFolders(); int selection_changed(); int button_press_event(); MWindow *mwindow; AWindowGUI *gui; }; class AWindowNewFolder : public BC_Button { public: AWindowNewFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowDeleteFolder : public BC_Button { public: AWindowDeleteFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowRenameFolder : public BC_Button { public: AWindowRenameFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowDeleteDisk : public BC_Button { public: AWindowDeleteDisk(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowDeleteProject : public BC_Button { public: AWindowDeleteProject(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowInfo : public BC_Button { public: AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowRedrawIndex : public BC_Button { public: AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowPaste : public BC_Button { public: AWindowPaste(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowAppend : public BC_Button { public: AWindowAppend(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AWindowView : public BC_Button { public: AWindowView(MWindow *mwindow, AWindowGUI *gui, int x, int y); int handle_event(); MWindow *mwindow; AWindowGUI *gui; int x, y; }; class AddTools : public BC_MenuBar { public: AddTools(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w); void create_objects(); MWindow *mwindow; AWindowGUI *gui; AddPluginsMenu *add_plugins; }; class AddPluginsMenu : public BC_Menu { public: AddPluginsMenu(MWindow *mwindow, AWindowGUI *gui); void create_objects(); MWindow *mwindow; AWindowGUI *gui; }; class AddPluginItem : public BC_MenuItem { public: AddPluginItem(AddPluginsMenu *menu, const char *text, int idx); int handle_event(); AddPluginsMenu *menu; int idx; }; #endif