1 #ifndef __gtk2_ardour_auplugin_ui_h__
2 #define __gtk2_ardour_auplugin_ui_h__
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 */
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"
33 @interface NotificationObject
: NSObject
{
35 AUPluginUI
* plugin_ui
;
36 NSWindow
* cocoa_parent
;
37 NSWindow
* top_level_parent
;
41 class AUPluginUI
: public PlugUIBase
, public Gtk::VBox
44 AUPluginUI (boost::shared_ptr
<ARDOUR::PluginInsert
>);
47 gint
get_preferred_height () { return prefheight
; }
48 gint
get_preferred_width () { return prefwidth
; }
49 bool start_updating(GdkEventAny
*);
50 bool stop_updating(GdkEventAny
*);
55 bool on_window_show (const Glib::ustring
&);
56 void on_window_hide ();
58 bool non_gtk_gui() const { return true; }
60 void lower_box_realized ();
61 void cocoa_view_resized ();
63 bool on_map_event (GdkEventAny
*);
64 bool on_focus_in_event (GdkEventFocus
*);
65 bool on_focus_out_event (GdkEventFocus
*);
66 void forward_key_event (GdkEventKey
*);
68 OSStatus
carbon_event (EventHandlerCallRef nextHandlerRef
, EventRef event
);
71 boost::shared_ptr
<ARDOUR::AUPlugin
> au
;
78 Gtk::Label automation_mode_label
;
79 Gtk::ComboBoxText automation_mode_selector
;
80 Gtk::Label preset_label
;
82 static std::vector
<std::string
> automation_mode_strings
;
86 NSWindow
* cocoa_window
;
91 NSWindow
* cocoa_parent
;
92 ComponentDescription carbon_descriptor
;
93 AudioUnitCarbonView editView
;
94 WindowRef carbon_window
;
95 EventHandlerRef carbon_event_handler
;
96 bool _activating_from_app
;
97 NotificationObject
* _notify
;
99 bool test_cocoa_view_support ();
100 bool test_carbon_view_support ();
101 int create_carbon_view ();
102 int create_cocoa_view ();
104 int parent_carbon_window ();
105 int parent_cocoa_window ();
106 NSWindow
* get_nswindow();
108 bool plugin_class_valid (Class pluginClass
);
111 #endif /* __gtk2_ardour_auplugin_ui_h__ */