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>
32 #define NS_(x) [NSString stringWithUTF8String: _(x)]
35 #define TEXT_HEIGHT 22
36 #define LABEL_HEIGHT 17
40 * Convenience method to create a new text label in the specified parent.
42 NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
44 @interface LxdreamVideoView : NSView
49 - (void) setDelegate: (id)other;
51 - (void) setIsGrabbed: (BOOL)grabbed;
54 @interface LxdreamMainWindow : NSWindow
56 LxdreamVideoView *video;
63 - (id)initWithContentRect:(NSRect)contentRect;
64 - (void)setStatusText:(const gchar *)text;
66 - (void)setRunning:(BOOL)isRunning;
68 - (void)setIsGrabbed:(BOOL)grab;
69 - (void)setUseGrab: (BOOL)grab;
71 - (void)setFullscreen: (BOOL)fs;
74 @interface LxdreamPrefsPane : NSView
78 - (id)initWithFrame: (NSRect)frameRect title:(NSString *)title;
79 - (id)initWithFrame: (NSRect)frameRect title:(NSString *)title configGroup: (lxdream_config_group_t)group scrollable: (BOOL)scroll;
83 @interface KeyBindingEditor: NSTextView
90 @interface KeyBindingField : NSTextField
96 @interface ConfigurationView : NSView
98 lxdream_config_group_t group;
100 NSTextField *fields[CONFIG_MAX_KEYS][2];
102 - (id)initWithFrame: (NSRect)frameRect;
103 - (id)initWithFrame: (NSRect)frameRect configGroup: (lxdream_config_group_t)group;
104 - (void)setLabelWidth: (int)width;
105 - (void)setConfigGroup: (lxdream_config_group_t)group;
106 - (void)setDevice: (struct maple_device *)device;
110 @interface LxdreamPrefsPanel : NSPanel
112 NSArray *toolbar_ids;
113 NSArray *toolbar_defaults;
114 NSView *config_panes[3];
115 NSDictionary *toolbar_items;
116 KeyBindingEditor *binding_editor;
118 - (id)initWithContentRect:(NSRect)contentRect;
122 LxdreamMainWindow *cocoa_gui_create_main_window();
123 NSMenu *cocoa_gdrom_menu_new();
124 NSView *video_osx_create_drawable();
125 void cocoa_gui_show_preferences();
126 NSView *cocoa_gui_create_prefs_controller_pane();
133 #endif /* lxdream_cocoaui_H */
.