Make level meter colors user definable. Base, Mid, Top, and Clip colors are defined...
[ardour.git] / gtk2_ardour / cocoacarbon.cc
1 /*
2     Copyright (C) 2007 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #include <Carbon/Carbon.h>
20 #undef check // stupid, stupid carbon
21
22 #include "ardour_ui.h"
23 #include "actions.h"
24 #include "sync-menu.h"
25
26 /* Called for clicks on the dock icon. Can be used to unminimize or
27  * create a new window for example.
28  */
29
30 static OSErr
31 handle_reopen_application (const AppleEvent *inAppleEvent, 
32                            AppleEvent       *outAppleEvent, 
33                            long              inHandlerRefcon)
34 {
35         cerr << "reopen app\n";
36         return noErr;
37 }
38
39 static OSErr
40 handle_quit_application (const AppleEvent *inAppleEvent, 
41                          AppleEvent       *outAppleEvent, 
42                          long              inHandlerRefcon)
43 {
44         cerr << "quit app\n";
45         ARDOUR_UI::instance()->quit ();
46
47         return noErr;
48 }
49
50 void
51 ARDOUR_UI::platform_specific ()
52 {
53         AEInstallEventHandler (kCoreEventClass, kAEReopenApplication, 
54                                handle_reopen_application, 0, true);
55
56         AEInstallEventHandler (kCoreEventClass, kAEQuitApplication, 
57                                handle_quit_application, 0, true);
58
59         Gtk::Widget* widget = ActionManager::get_widget ("/ui/Main/Session/Quit");
60         if (widget) {
61                 ige_mac_menu_set_quit_menu_item ((GtkMenuItem*) widget->gobj());
62         }
63
64         IgeMacMenuGroup* group = ige_mac_menu_add_app_menu_group ();
65
66         widget = ActionManager::get_widget ("/ui/Main/Session/About");
67         if (widget) {
68                 ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
69         }
70         widget = ActionManager::get_widget ("/ui/Main/Session/ToggleOptionsEditor");
71         if (widget) {
72                 ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
73         }
74 }
75