add resource wdw folder expanders, fix plugin close deadlock detect
[goodguy/history.git] / cinelerra-5.1 / cinelerra / awindowgui.h
index b941e18da58d0428605c8edc8b1f0cefa9f25eaf..6cab2a6d2c45bd3b432c44b86e436e7b0a6f0c9c 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "arraylist.h"
 #include "bcdialog.h"
+#include "binfolder.inc"
 #include "assetpopup.inc"
 #include "asset.inc"
 #include "assets.inc"
 #include "indexable.inc"
 #include "mwindow.inc"
 #include "mutex.inc"
-#include "newfolder.inc"
 #include "pluginserver.inc"
 #include "proxypopup.inc"
 #include "renderengine.inc"
 #include "samples.inc"
 #include "vicon.h"
 
-class AssetPicon : public BC_ListBoxItem
+class AWindowFolderItem : public BC_ListBoxItem
+{
+public:
+       AWindowFolderItem();
+       AWindowFolderItem(const char *text, int color = -1);
+       AWindowFolderItem(const char *text, BC_Pixmap *icon, int color = -1);
+
+       AssetPicon *get_picon();
+       int matches(const char *text);
+
+       AWindowFolderItem *parent;
+};
+
+class AssetPicon : public AWindowFolderItem
 {
 public:
        AssetPicon(MWindow *mwindow, AWindowGUI *gui, Indexable *indexable);
@@ -56,6 +69,7 @@ public:
        AssetPicon(MWindow *mwindow, AWindowGUI *gui, PluginServer *plugin);
        AssetPicon(MWindow *mwindow, AWindowGUI *gui, Label *plugin);
        AssetPicon(MWindow *mwindow, AWindowGUI *gui, int folder, int persist);
+       AssetPicon(MWindow *mwindow, AWindowGUI *gui, int folder, const char *title);
        virtual ~AssetPicon();
 
        void create_objects();
@@ -67,12 +81,17 @@ public:
        void close_render_engine();
        void render_video(int64_t pos, VFrame *vfrm);
        void render_audio(int64_t pos, Samples **samples, int len);
+       VFrame *get_vicon_frame();
 
        MWindow *mwindow;
        AWindowGUI *gui;
        BC_Pixmap *icon;
        VFrame *icon_vframe;
+       VFrame *vicon_frame;
        int foldernum;
+// sublist items if set
+       AWindowFolderSubItems *sub_items;
+
 // ID of thing pointed to
        int id;
 
@@ -83,9 +102,9 @@ public:
        EDL *edl;
 
        int in_use;
-       time_t mtime;
-
        int persistent;
+       time_t comments_time;
+       double sort_key;
        PluginServer *plugin;
        Label *label;
        VIcon *vicon;
@@ -173,10 +192,9 @@ public:
        int keypress_event();
        void async_update_assets();     // Sends update asset event
        void update_effects();
-       void sort_assets(int use_mtime);
+       void sort_assets();
        void sort_folders();
        void reposition_objects();
-       static int folder_number(const char *name);
 // Call back for MWindow entry point
        int drag_motion();
        int drag_stop();
@@ -191,7 +209,7 @@ public:
        void create_label_folder();
        void copy_picons(ArrayList<BC_ListBoxItem*> *dst,
                ArrayList<BC_ListBoxItem*> *src, int folder);
-       void sort_picons(ArrayList<BC_ListBoxItem*> *src, int use_mtime=0);
+       void sort_picons(ArrayList<BC_ListBoxItem*> *src);
 // Return the selected asset in asset_list
        Indexable* selected_asset();
        PluginServer* selected_plugin();
@@ -202,6 +220,7 @@ public:
        void start_vicon_drawing();
        void stop_vicon_drawing();
        void update_picon(Indexable *indexable);
+       int cycle_assetlist_format();
 
        VFrame *get_picon(const char *name, const char *plugin_icons);
        VFrame *get_picon(const char *name);
@@ -261,8 +280,6 @@ public:
        BC_Pixmap *ff_aud_icon;       VFrame *ff_aud_vframe;
        BC_Pixmap *ff_vid_icon;       VFrame *ff_vid_vframe;
 
-       NewFolderThread *newfolder_thread;
-
 // Popup menus
        AssetPopup *asset_menu;
        ClipPopup *clip_menu;
@@ -289,9 +306,11 @@ public:
 
 // Create custom atoms to be used for async messages between windows
        int create_custom_xatoms();
-// Function to overload to recieve customly defined atoms
-       virtual int recieve_custom_xatoms(xatom_event *event);
+// Function to overload to receive customly defined atoms
+       virtual int receive_custom_xatoms(xatom_event *event);
        static const char *folder_names[];
+       NewFolderThread *new_folder_thread;
+       ModifyFolderThread *modify_folder_thread;
 
 private:
        void update_folder_list();
@@ -318,6 +337,10 @@ public:
        int column_resize_event();
        int focus_in_event();
        int focus_out_event();
+       int cursor_enter_event();
+       int cursor_leave_event();
+       void update_vicon_area();
+       int mouse_over_event(int no);
 
        MWindow *mwindow;
        AWindowGUI *gui;
@@ -337,6 +360,22 @@ public:
        AWindowGUI *gui;
 };
 
+class AWindowSubFolderNames : public ArrayList<const char *>
+{
+public:
+       AWindowSubFolderNames() { set_array_delete(); }
+       ~AWindowSubFolderNames() { remove_all_objects(); }
+};
+
+class AWindowFolderSubItems : public AWindowFolderItem
+{
+public:
+       AWindowFolderSubItems(AWindowFolderItem *parent, const char *text);
+       int matches(const char *text);
+
+       AWindowSubFolderNames names;
+};
+
 class AWindowFolders : public BC_ListBox
 {
 public:
@@ -345,9 +384,13 @@ public:
 
        int selection_changed();
        int button_press_event();
+       int drag_stop();
+       int load_expanders();
 
        MWindow *mwindow;
        AWindowGUI *gui;
+// last selection
+       AWindowFolderItem *last_item0, *last_item1;
 };
 
 class AWindowSearchTextBox : public BC_TextBox
@@ -379,36 +422,6 @@ public:
        BC_TextBox *text_box;
 };
 
-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: