Search
lxdream.org :: lxdream/src/cocoaui/cocoaui.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoaui.h
changeset 1028:f99eeaf084c2
prev874:e3007b8799f3
next1036:af7b0c5905dd
author nkeynes
date Sun Jun 14 11:44:19 2009 +0000 (13 years ago)
permissions -rw-r--r--
last change Add fullscreen support
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@755
    24
#include "gettext.h"
nkeynes@681
    25
nkeynes@736
    26
#ifdef __cplusplus
nkeynes@736
    27
extern "C" {
nkeynes@736
    28
#endif
nkeynes@736
    29
    
nkeynes@681
    30
#define NS_(x) [NSString stringWithUTF8String: _(x)]
nkeynes@681
    31
nkeynes@765
    32
/* Standard sizing */
nkeynes@765
    33
#define TEXT_HEIGHT 22
nkeynes@765
    34
#define LABEL_HEIGHT 17
nkeynes@765
    35
#define TEXT_GAP 10
nkeynes@765
    36
    
nkeynes@770
    37
/**
nkeynes@770
    38
 * Convenience method to create a new text label in the specified parent.
nkeynes@770
    39
 */
nkeynes@770
    40
NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
nkeynes@681
    41
nkeynes@780
    42
@interface LxdreamVideoView : NSView
nkeynes@780
    43
{
nkeynes@780
    44
    BOOL isGrabbed;
nkeynes@780
    45
    id delegate;
nkeynes@780
    46
}
nkeynes@780
    47
- (void) setDelegate: (id)other;
nkeynes@780
    48
- (id)delegate;
nkeynes@780
    49
- (void) setIsGrabbed: (BOOL)grabbed;
nkeynes@780
    50
@end
nkeynes@780
    51
nkeynes@681
    52
@interface LxdreamMainWindow : NSWindow 
nkeynes@681
    53
{
nkeynes@780
    54
    LxdreamVideoView *video;
nkeynes@681
    55
    NSTextField *status;
nkeynes@681
    56
    BOOL isGrabbed;
nkeynes@839
    57
    BOOL useGrab;
nkeynes@1028
    58
    BOOL isFullscreen;
nkeynes@1028
    59
    NSRect savedFrame;
nkeynes@681
    60
}
nkeynes@681
    61
- (id)initWithContentRect:(NSRect)contentRect;
nkeynes@681
    62
- (void)setStatusText:(const gchar *)text;
nkeynes@837
    63
- (void)updateTitle;
nkeynes@681
    64
- (void)setRunning:(BOOL)isRunning;
nkeynes@681
    65
- (BOOL)isGrabbed;
nkeynes@681
    66
- (void)setIsGrabbed:(BOOL)grab;
nkeynes@839
    67
- (void)setUseGrab: (BOOL)grab;
nkeynes@1028
    68
- (BOOL)isFullscreen;
nkeynes@1028
    69
- (void)setFullscreen: (BOOL)fs;
nkeynes@681
    70
@end
nkeynes@681
    71
nkeynes@765
    72
@interface LxdreamPrefsPane : NSView
nkeynes@765
    73
{
nkeynes@765
    74
    int headerHeight;
nkeynes@765
    75
}
nkeynes@765
    76
- (id)initWithFrame: (NSRect)frameRect title:(NSString *)title;
nkeynes@765
    77
- (int)contentHeight;
nkeynes@765
    78
@end
nkeynes@765
    79
nkeynes@770
    80
@interface KeyBindingEditor: NSTextView
nkeynes@770
    81
{
nkeynes@770
    82
    BOOL isPrimed;
nkeynes@770
    83
    NSString *lastValue;
nkeynes@770
    84
}
nkeynes@770
    85
@end
nkeynes@770
    86
nkeynes@770
    87
@interface KeyBindingField : NSTextField
nkeynes@770
    88
{
nkeynes@770
    89
}
nkeynes@770
    90
@end
nkeynes@770
    91
nkeynes@725
    92
@interface LxdreamPrefsPanel : NSPanel
nkeynes@725
    93
{
nkeynes@765
    94
    NSArray *toolbar_ids;
nkeynes@765
    95
    NSArray *toolbar_defaults;
nkeynes@765
    96
    NSDictionary *toolbar_items;
nkeynes@765
    97
    NSView *path_pane, *ctrl_pane;
nkeynes@770
    98
    KeyBindingEditor *binding_editor;
nkeynes@725
    99
}
nkeynes@725
   100
- (id)initWithContentRect:(NSRect)contentRect;
nkeynes@725
   101
@end
nkeynes@681
   102
nkeynes@874
   103
nkeynes@874
   104
LxdreamMainWindow *cocoa_gui_create_main_window();
nkeynes@874
   105
NSMenu *cocoa_gdrom_menu_new();
nkeynes@874
   106
NSView *video_osx_create_drawable();
nkeynes@874
   107
void cocoa_gui_show_preferences();
nkeynes@874
   108
NSView *cocoa_gui_create_prefs_controller_pane();
nkeynes@874
   109
NSView *cocoa_gui_create_prefs_path_pane();
nkeynes@874
   110
nkeynes@874
   111
nkeynes@736
   112
#ifdef __cplusplus
nkeynes@736
   113
}
nkeynes@736
   114
#endif
nkeynes@736
   115
    
nkeynes@681
   116
#endif /* lxdream_cocoaui_H */
.