filename | src/cocoaui/cocoaui.h |
changeset | 1072:d82e04e6d497 |
prev | 1036:af7b0c5905dd |
next | 1298:d0eb2307b847 |
author | nkeynes |
date | Fri Sep 10 08:48:34 2010 +1000 (13 years ago) |
permissions | -rw-r--r-- |
last change | Run the eventq at the end of the time-slice rather than the beginning, so that it runs for the correct period of time when the time-slice finishes early |
view | annotate | diff | log | raw |
1 /**
2 * $Id$
3 *
4 * Core Cocoa-based user interface
5 *
6 * Copyright (c) 2008 Nathan Keynes.
7 *
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.
12 *
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.
17 */
19 #ifndef lxdream_cocoaui_H
20 #define lxdream_cocoaui_H
22 #import <AppKit/AppKit.h>
23 #include "lxdream.h"
24 #include "config.h"
25 #include "gui.h"
26 #include "gettext.h"
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
32 #define NS_(x) [NSString stringWithUTF8String: _(x)]
34 /* Standard sizing */
35 #define TEXT_HEIGHT 22
36 #define LABEL_HEIGHT 17
37 #define TEXT_GAP 10
39 /**
40 * Convenience method to create a new text label in the specified parent.
41 */
42 NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
44 @interface LxdreamVideoView : NSView
45 {
46 BOOL isGrabbed;
47 id delegate;
48 }
49 - (void) setDelegate: (id)other;
50 - (id)delegate;
51 - (void) setIsGrabbed: (BOOL)grabbed;
52 @end
54 @interface LxdreamMainWindow : NSWindow
55 {
56 LxdreamVideoView *video;
57 NSTextField *status;
58 BOOL isGrabbed;
59 BOOL useGrab;
60 BOOL isFullscreen;
61 NSRect savedFrame;
62 }
63 - (id)initWithContentRect:(NSRect)contentRect;
64 - (void)setStatusText:(const gchar *)text;
65 - (void)updateTitle;
66 - (void)setRunning:(BOOL)isRunning;
67 - (BOOL)isGrabbed;
68 - (void)setIsGrabbed:(BOOL)grab;
69 - (void)setUseGrab: (BOOL)grab;
70 - (BOOL)isFullscreen;
71 - (void)setFullscreen: (BOOL)fs;
72 @end
74 @interface LxdreamPrefsPane : NSView
75 {
76 int headerHeight;
77 }
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;
80 - (int)contentHeight;
81 @end
83 @interface KeyBindingEditor: NSTextView
84 {
85 BOOL isPrimed;
86 NSString *lastValue;
87 }
88 @end
90 @interface KeyBindingField : NSTextField
91 {
92 }
93 @end
96 @interface ConfigurationView : NSView
97 {
98 lxdream_config_group_t group;
99 int labelWidth;
100 NSTextField *fields[CONFIG_MAX_KEYS][2];
101 }
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;
107 @end
110 @interface LxdreamPrefsPanel : NSPanel
111 {
112 NSArray *toolbar_ids;
113 NSArray *toolbar_defaults;
114 NSView *config_panes[3];
115 NSDictionary *toolbar_items;
116 KeyBindingEditor *binding_editor;
117 }
118 - (id)initWithContentRect:(NSRect)contentRect;
119 @end
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();
129 #ifdef __cplusplus
130 }
131 #endif
133 #endif /* lxdream_cocoaui_H */
.