X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fawindowgui.h;h=35fdb9231c796a80ea5b5fd9e0e62d3fd41dc21f;hp=d15e19f5d30a87607f2651749c9f7f9ee9e2239c;hb=e8453fdab4d5ed7b384279a5b37c92010ac13295;hpb=b2dfd8318ea57bbe38e2c61ffd8cda30fb7465c3 diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index d15e19f5..35fdb923 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -44,6 +44,7 @@ #include "mwindow.inc" #include "mutex.inc" #include "pluginserver.inc" +#include "preferences.inc" #include "proxypopup.inc" #include "renderengine.inc" #include "samples.inc" @@ -53,8 +54,22 @@ #define SELECT_USED 1 #define SELECT_UNUSED 2 #define SELECT_NONE 3 + +// in percent view_h #define VIEW_POPUP_BAR_H 15 +#define ASSET_VIEW_NONE 0 +#define ASSET_VIEW_ICON 1 +#define ASSET_VIEW_MEDIA 2 +#define ASSET_VIEW_MEDIA_MAP 3 +#define ASSET_VIEW_FULL 4 + +#define AVICON_FULL_PLAY 0 +#define AVICON_MOUSE_OVER 1 +#define AVICON_SRC_TARGET 2 +#define AVICON_NO_PLAY 3 +#define AVICON_PLAY_MODES 4 + class AWindowFolderItem : public BC_ListBoxItem { public: @@ -160,17 +175,42 @@ public: ~AssetVIcon(); }; +class AssetViewPopup : public ViewPopup +{ +public: + AssetViewPopup(VIconThread *vt, int draw_mode, + int x, int y, int w, int h); + ~AssetViewPopup(); + + int button_press_event(); + int button_release_event(); + int cursor_motion_event(); + int keypress_event(); + + void draw_vframe(VFrame *frame); + + int bar_h; + int draw_mode; + int dragging; +}; + class AssetVIconThread : public VIconThread { public: - AssetVIconThread(AWindowAssets *asset_list); + AssetVIconThread(AWindowGUI *gui, Preferences *preferences); ~AssetVIconThread(); - int popup_button_press(int x, int y); - int popup_button_release(int x, int y); - int popup_cursor_motion(int x, int y); + void set_view_popup(AssetVIcon *v, int draw_mode); + void set_view_popup(AssetVIcon *v); + ViewPopup *new_view_window(); + void drawing_started(); + void drawing_stopped(); + void close_view_popup(); - int popup_dragging; + AWindowGUI *gui; + int draw_mode; + int vicon_cmodel; + Mutex *draw_lock; }; @@ -243,7 +283,8 @@ public: int save_defaults(BC_Hash *defaults); int load_defaults(BC_Hash *defaults); void start_vicon_drawing(); - void stop_vicon_drawing(); + int stop_vicon_drawing(); + void close_view_popup(); void update_picon(Indexable *indexable); int cycle_assetlist_format(); @@ -319,14 +360,15 @@ public: AddTools *add_tools; // Temporary for reading picons from files VFrame *temp_picon; - VIconThread *vicon_thread; + AssetVIconThread *vicon_thread; AssetVIconAudio *vicon_audio; int64_t plugin_visibility; AWindowRemovePlugin *remove_plugin; AVIconDrawing *avicon_drawing; - int avicon_w, avicon_h, vicon_drawing; + int avicon_w, avicon_h; + int vicon_drawing; int allow_iconlisting; // Create custom atoms to be used for async messages between windows @@ -362,12 +404,8 @@ 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); - static VIconDrawVFrame draw_vframe; - VIconDrawVFrame *draw_func; MWindow *mwindow; AWindowGUI *gui; @@ -539,16 +577,26 @@ public: int idx; }; -class AVIconDrawing : public BC_Toggle +class AVIconDrawingItem : public BC_MenuItem { public: - AWindowGUI *agui; - + AVIconDrawingItem(AVIconDrawing *avicon, const char *text, int id); int handle_event(); - static void calculate_geometry(AWindowGUI *agui, VFrame **images, int *ww, int *hh); - AVIconDrawing(AWindowGUI *agui, int x, int y, VFrame **images); + AVIconDrawing *avicon; + int id; +}; + +class AVIconDrawing : public BC_PopupMenu +{ +public: + AVIconDrawing(AWindowGUI *agui, int x, int y, int w, const char *text); ~AVIconDrawing(); + + void create_objects(); + static const char *avicon_names[]; + + AWindowGUI *agui; };