search fixes, preset fixes, ladspa icon logging, igor pref theme, drag btn rollover
[goodguy/history.git] / cinelerra-5.1 / cinelerra / gwindowgui.h
index 86045eb9aabb802c0764560106bd274ca462bbfc..1687e037eedba05dec428e69bfb5e58da372e159 100644 (file)
 #define GWINDOWGUI_H
 
 #include "automation.inc"
+#include "condition.inc"
+#include "colorpicker.h"
 #include "guicast.h"
+#include "gwindowgui.inc"
 #include "mwindow.inc"
 
-class GWindowToggle;
-
 enum {
        NONAUTOTOGGLES_ASSETS,
        NONAUTOTOGGLES_TITLES,
        NONAUTOTOGGLES_TRANSITIONS,
        NONAUTOTOGGLES_PLUGIN_AUTOS,
-       NONAUTOTOGGLES_BAR,
+       NONAUTOTOGGLES_BAR1,
+       NONAUTOTOGGLES_BAR2,
        NONAUTOTOGGLES_COUNT
 };
 
-struct toggleinfo
-{
-       int isauto;
-       int ref;
+struct toggleinfo {
+       int isauto, ref;
 };
 
 class GWindowGUI : public BC_Window
 {
 public:
        GWindowGUI(MWindow *mwindow, int w, int h);
+       ~GWindowGUI();
        static void calculate_extents(BC_WindowBase *gui, int *w, int *h);
        void create_objects();
        int translation_event();
        int close_event();
        int keypress_event();
+       void start_color_thread(GWindowColorButton *color_button);
        void update_toggles(int use_lock);
        void update_mwindow();
+       void load_defaults();
+       void save_defaults();
 
        static const char *other_text[];
        static const char *auto_text[];
@@ -61,24 +65,72 @@ public:
 
        MWindow *mwindow;
        GWindowToggle *toggles[NONAUTOTOGGLES_COUNT + AUTOMATION_TOTAL];
+       GWindowColorThread *color_thread;
 };
 
 class GWindowToggle : public BC_CheckBox
 {
 public:
-       GWindowToggle(MWindow *mwindow,
-               GWindowGUI *gui,
-               int x,
-               int y,
-               toggleinfo toggleinf);
+       GWindowToggle(MWindow *mwindow, GWindowGUI *gui, int x, int y,
+               const char *text, int color, toggleinfo *info);
+       ~GWindowToggle();
+
        int handle_event();
        void update();
+       void update_gui(int color);
 
-       static int* get_main_value(MWindow *mwindow, toggleinfo toggleinf);
+       static int* get_main_value(MWindow *mwindow, toggleinfo *info);
 
+       int color;
        MWindow *mwindow;
        GWindowGUI *gui;
-       toggleinfo toggleinf;
+       toggleinfo *info;
+       GWindowColorButton *color_button;
+};
+
+class GWindowColorButton : public BC_Button
+{
+public:
+       GWindowColorButton(GWindowToggle *auto_toggle, int x, int y, int w);
+       ~GWindowColorButton();
+
+       void set_color(int color);
+       void update_gui(int color);
+       int handle_event();
+
+       int color;
+       VFrame *vframes[3];
+       GWindowToggle *auto_toggle;
+};
+
+class GWindowColorThread : public ColorPicker
+{
+public:
+       GWindowColorThread(GWindowColorButton *color_button);
+       ~GWindowColorThread();
+       void start(int color);
+       int handle_new_color(int color, int alpha);
+       void update_gui();
+       void handle_done_event(int result);
+
+       int color;
+       GWindowColorButton *color_button;
+       GWindowColorUpdate *color_update;
+};
+
+class GWindowColorUpdate : public Thread
+{
+public:
+       GWindowColorUpdate(GWindowColorThread *color_thread);
+       ~GWindowColorUpdate();
+
+       void start();
+       void stop();
+       void run();
+
+       int done;
+       Condition *update_lock;
+       GWindowColorThread *color_thread;
 };
 
 #endif