4 * Core Cocoa-based user interface
6 * Copyright (c) 2008 Nathan Keynes.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 #ifndef lxdream_cocoaui_H
20 #define lxdream_cocoaui_H
22 #import <AppKit/AppKit.h>
34 #define NS_(x) [NSString stringWithUTF8String: _(x)]
37 #define TEXT_HEIGHT 22
38 #define LABEL_HEIGHT 17
42 * Convenience method to create a new text label in the specified parent.
44 NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
46 @interface LxdreamVideoView : NSView
51 - (void) setDelegate: (id)other;
53 - (void) setIsGrabbed: (BOOL)grabbed;
56 @interface LxdreamMainWindow : NSWindow
58 LxdreamVideoView *video;
65 - (id)initWithContentRect:(NSRect)contentRect;
66 - (void)setStatusText:(const gchar *)text;
68 - (void)setRunning:(BOOL)isRunning;
70 - (void)setIsGrabbed:(BOOL)grab;
71 - (void)setUseGrab: (BOOL)grab;
73 - (void)setFullscreen: (BOOL)fs;
76 @interface LxdreamPrefsPane : NSView
80 - (id)initWithFrame: (NSRect)frameRect title:(NSString *)title;
81 - (id)initWithFrame: (NSRect)frameRect title:(NSString *)title configGroup: (lxdream_config_group_t)group scrollable: (BOOL)scroll;
85 @interface KeyBindingEditor: NSTextView
92 @interface KeyBindingField : NSTextField
98 @interface ConfigurationView : NSView
100 lxdream_config_group_t group;
102 NSTextField *fields[CONFIG_MAX_KEYS][2];
104 - (id)initWithFrame: (NSRect)frameRect;
105 - (id)initWithFrame: (NSRect)frameRect configGroup: (lxdream_config_group_t)group;
106 - (void)setLabelWidth: (int)width;
107 - (void)setConfigGroup: (lxdream_config_group_t)group;
108 - (void)setDevice: (struct maple_device *)device;
112 @interface LxdreamPrefsPanel : NSPanel
114 NSArray *toolbar_ids;
115 NSArray *toolbar_defaults;
116 NSView *config_panes[3];
117 NSDictionary *toolbar_items;
118 KeyBindingEditor *binding_editor;
120 - (id)initWithContentRect:(NSRect)contentRect;
124 LxdreamMainWindow *cocoa_gui_create_main_window();
125 NSMenu *cocoa_gdrom_menu_new();
126 NSView *video_osx_create_drawable();
127 void cocoa_gui_show_preferences();
128 NSView *cocoa_gui_create_prefs_controller_pane();
135 #endif /* lxdream_cocoaui_H */
.