Search
lxdream.org :: lxdream/src/cocoaui/cocoaui.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoaui.h
changeset 1298:d0eb2307b847
prev1072:d82e04e6d497
author nkeynes
date Wed Feb 04 08:38:23 2015 +1000 (5 years ago)
permissions -rw-r--r--
last change Fix assorted compile warnings reported by Clang
file annotate diff log raw
nkeynes@681
     1
/**
nkeynes@681
     2
 * $Id$
nkeynes@681
     3
 *
nkeynes@681
     4
 * Core Cocoa-based user interface
nkeynes@681
     5
 *
nkeynes@681
     6
 * Copyright (c) 2008 Nathan Keynes.
nkeynes@681
     7
 *
nkeynes@681
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@681
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@681
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@681
    11
 * (at your option) any later version.
nkeynes@681
    12
 *
nkeynes@681
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@681
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@681
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@681
    16
 * GNU General Public License for more details.
nkeynes@681
    17
 */
nkeynes@780
    18
 
nkeynes@736
    19
#ifndef lxdream_cocoaui_H
nkeynes@736
    20
#define lxdream_cocoaui_H
nkeynes@736
    21
nkeynes@681
    22
#import <AppKit/AppKit.h>
nkeynes@755
    23
#include "lxdream.h"
nkeynes@1072
    24
#include "config.h"
nkeynes@1036
    25
#include "gui.h"
nkeynes@755
    26
#include "gettext.h"
nkeynes@681
    27
nkeynes@736
    28
#ifdef __cplusplus
nkeynes@736
    29
extern "C" {
nkeynes@736
    30
#endif
nkeynes@1298
    31
nkeynes@1298
    32
struct maple_device;
nkeynes@736
    33
    
nkeynes@681
    34
#define NS_(x) [NSString stringWithUTF8String: _(x)]
nkeynes@681
    35
nkeynes@765
    36
/* Standard sizing */
nkeynes@765
    37
#define TEXT_HEIGHT 22
nkeynes@765
    38
#define LABEL_HEIGHT 17
nkeynes@765
    39
#define TEXT_GAP 10
nkeynes@765
    40
    
nkeynes@770
    41
/**
nkeynes@770
    42
 * Convenience method to create a new text label in the specified parent.
nkeynes@770
    43
 */
nkeynes@770
    44
NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
nkeynes@681
    45
nkeynes@780
    46
@interface LxdreamVideoView : NSView
nkeynes@780
    47
{
nkeynes@780
    48
    BOOL isGrabbed;
nkeynes@780
    49
    id delegate;
nkeynes@780
    50
}
nkeynes@780
    51
- (void) setDelegate: (id)other;
nkeynes@780
    52
- (id)delegate;
nkeynes@780
    53
- (void) setIsGrabbed: (BOOL)grabbed;
nkeynes@780
    54
@end
nkeynes@780
    55
nkeynes@681
    56
@interface LxdreamMainWindow : NSWindow 
nkeynes@681
    57
{
nkeynes@780
    58
    LxdreamVideoView *video;
nkeynes@681
    59
    NSTextField *status;
nkeynes@681
    60
    BOOL isGrabbed;
nkeynes@839
    61
    BOOL useGrab;
nkeynes@1028
    62
    BOOL isFullscreen;
nkeynes@1028
    63
    NSRect savedFrame;
nkeynes@681
    64
}
nkeynes@681
    65
- (id)initWithContentRect:(NSRect)contentRect;
nkeynes@681
    66
- (void)setStatusText:(const gchar *)text;
nkeynes@837
    67
- (void)updateTitle;
nkeynes@681
    68
- (void)setRunning:(BOOL)isRunning;
nkeynes@681
    69
- (BOOL)isGrabbed;
nkeynes@681
    70
- (void)setIsGrabbed:(BOOL)grab;
nkeynes@839
    71
- (void)setUseGrab: (BOOL)grab;
nkeynes@1028
    72
- (BOOL)isFullscreen;
nkeynes@1028
    73
- (void)setFullscreen: (BOOL)fs;
nkeynes@681
    74
@end
nkeynes@681
    75
nkeynes@765
    76
@interface LxdreamPrefsPane : NSView
nkeynes@765
    77
{
nkeynes@765
    78
    int headerHeight;
nkeynes@765
    79
}
nkeynes@765
    80
- (id)initWithFrame: (NSRect)frameRect title:(NSString *)title;
nkeynes@1072
    81
- (id)initWithFrame: (NSRect)frameRect title:(NSString *)title configGroup: (lxdream_config_group_t)group scrollable: (BOOL)scroll;
nkeynes@765
    82
- (int)contentHeight;
nkeynes@765
    83
@end
nkeynes@765
    84
nkeynes@770
    85
@interface KeyBindingEditor: NSTextView
nkeynes@770
    86
{
nkeynes@770
    87
    BOOL isPrimed;
nkeynes@770
    88
    NSString *lastValue;
nkeynes@770
    89
}
nkeynes@770
    90
@end
nkeynes@770
    91
nkeynes@770
    92
@interface KeyBindingField : NSTextField
nkeynes@770
    93
{
nkeynes@770
    94
}
nkeynes@770
    95
@end
nkeynes@770
    96
nkeynes@1072
    97
nkeynes@1072
    98
@interface ConfigurationView : NSView
nkeynes@1072
    99
{
nkeynes@1072
   100
    lxdream_config_group_t group;
nkeynes@1072
   101
    int labelWidth;
nkeynes@1072
   102
    NSTextField *fields[CONFIG_MAX_KEYS][2];
nkeynes@1072
   103
}
nkeynes@1072
   104
- (id)initWithFrame: (NSRect)frameRect;
nkeynes@1072
   105
- (id)initWithFrame: (NSRect)frameRect configGroup: (lxdream_config_group_t)group;
nkeynes@1072
   106
- (void)setLabelWidth: (int)width;
nkeynes@1072
   107
- (void)setConfigGroup: (lxdream_config_group_t)group;
nkeynes@1072
   108
- (void)setDevice: (struct maple_device *)device;
nkeynes@1072
   109
@end
nkeynes@1072
   110
nkeynes@1072
   111
nkeynes@725
   112
@interface LxdreamPrefsPanel : NSPanel
nkeynes@725
   113
{
nkeynes@765
   114
    NSArray *toolbar_ids;
nkeynes@765
   115
    NSArray *toolbar_defaults;
nkeynes@1072
   116
    NSView *config_panes[3];
nkeynes@765
   117
    NSDictionary *toolbar_items;
nkeynes@770
   118
    KeyBindingEditor *binding_editor;
nkeynes@725
   119
}
nkeynes@725
   120
- (id)initWithContentRect:(NSRect)contentRect;
nkeynes@725
   121
@end
nkeynes@681
   122
nkeynes@874
   123
nkeynes@874
   124
LxdreamMainWindow *cocoa_gui_create_main_window();
nkeynes@874
   125
NSMenu *cocoa_gdrom_menu_new();
nkeynes@874
   126
NSView *video_osx_create_drawable();
nkeynes@874
   127
void cocoa_gui_show_preferences();
nkeynes@874
   128
NSView *cocoa_gui_create_prefs_controller_pane();
nkeynes@874
   129
nkeynes@874
   130
nkeynes@736
   131
#ifdef __cplusplus
nkeynes@736
   132
}
nkeynes@736
   133
#endif
nkeynes@736
   134
    
nkeynes@1072
   135
#endif /* lxdream_cocoaui_H */
.