colinf's patch to make the cursor be the dbl vertical arrow when over the track resiz...
[ardour2.git] / gtk2_ardour / au_pluginui.h
blob36c7226e728427626ead5791ed0a8a627a1e4c4a
1 #ifndef __gtk2_ardour_auplugin_ui_h__
2 #define __gtk2_ardour_auplugin_ui_h__
4 #include <vector>
5 #include <string>
7 #include <AppKit/AppKit.h>
8 #include <Carbon/Carbon.h>
9 #include <AudioUnit/AudioUnitCarbonView.h>
10 #include <AudioUnit/AudioUnit.h>
12 /* fix up stupid apple macros */
14 #undef check
15 #undef require
16 #undef verify
18 #include <gtkmm/box.h>
19 #include <gtkmm/combobox.h>
20 #include <gtkmm/button.h>
21 #include <gtkmm/label.h>
23 #include "plugin_ui.h"
25 namespace ARDOUR {
26 class AUPlugin;
27 class PluginInsert;
28 class Redirect;
31 class AUPluginUI;
33 @interface NotificationObject : NSObject {
34 @private
35 AUPluginUI* plugin_ui;
36 NSWindow* cocoa_parent;
37 NSWindow* top_level_parent;
39 @end
41 class AUPluginUI : public PlugUIBase, public Gtk::VBox
43 public:
44 AUPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>);
45 ~AUPluginUI ();
47 gint get_preferred_height () { return prefheight; }
48 gint get_preferred_width () { return prefwidth; }
49 bool start_updating(GdkEventAny*);
50 bool stop_updating(GdkEventAny*);
52 void activate ();
53 void deactivate ();
55 bool on_window_show (const Glib::ustring&);
56 void on_window_hide ();
58 void lower_box_realized ();
59 void on_realize ();
60 bool on_map_event (GdkEventAny*);
61 bool on_focus_in_event (GdkEventFocus*);
62 bool on_focus_out_event (GdkEventFocus*);
64 OSStatus carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event);
66 private:
67 boost::shared_ptr<ARDOUR::AUPlugin> au;
68 int prefheight;
69 int prefwidth;
71 Gtk::HBox top_box;
72 Gtk::EventBox low_box;
73 Gtk::VBox vpacker;
74 Gtk::Label automation_mode_label;
75 Gtk::ComboBoxText automation_mode_selector;
76 Gtk::Label preset_label;
78 static std::vector<std::string> automation_mode_strings;
80 /* Cocoa */
82 NSWindow* cocoa_window;
83 NSView* au_view;
85 /* Carbon */
87 NSWindow* cocoa_parent;
88 ComponentDescription carbon_descriptor;
89 AudioUnitCarbonView editView;
90 WindowRef carbon_window;
91 EventHandlerRef carbon_event_handler;
92 bool _activating_from_app;
93 NSView* packView;
94 NotificationObject* _notify;
96 bool test_cocoa_view_support ();
97 bool test_carbon_view_support ();
98 int create_carbon_view ();
99 int create_cocoa_view ();
101 int parent_carbon_window ();
102 int parent_cocoa_window ();
103 NSWindow* get_nswindow();
105 bool plugin_class_valid (Class pluginClass);
108 #endif /* __gtk2_ardour_auplugin_ui_h__ */