Search
lxdream.org :: lxdream/src/cocoaui/cocoaui.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoaui.h
changeset 770:429ff505c450
prev765:4cd066048203
next780:4e4ea322cb84
author nkeynes
date Mon Jul 28 03:41:25 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Implement key-binding configuration pane for Cocoa UI
Minor tweaks for consistency and static-correctness
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@681
    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@681
    37
NSWindow *cocoa_gui_create_main_window();
nkeynes@691
    38
NSMenu *cocoa_gdrom_menu_new();
nkeynes@681
    39
NSView *video_osx_create_drawable();
nkeynes@765
    40
void cocoa_gui_show_preferences();
nkeynes@770
    41
NSView *cocoa_gui_create_prefs_controller_pane();
nkeynes@770
    42
NSView *cocoa_gui_create_prefs_path_pane();
nkeynes@770
    43
nkeynes@770
    44
/**
nkeynes@770
    45
 * Convenience method to create a new text label in the specified parent.
nkeynes@770
    46
 */
nkeynes@770
    47
NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
nkeynes@681
    48
nkeynes@681
    49
@interface LxdreamMainWindow : NSWindow 
nkeynes@681
    50
{
nkeynes@681
    51
    NSView *video;
nkeynes@681
    52
    NSTextField *status;
nkeynes@681
    53
    BOOL isGrabbed;
nkeynes@681
    54
}
nkeynes@681
    55
- (id)initWithContentRect:(NSRect)contentRect;
nkeynes@681
    56
- (void)setStatusText:(const gchar *)text;
nkeynes@681
    57
- (void)setRunning:(BOOL)isRunning;
nkeynes@681
    58
- (BOOL)isGrabbed;
nkeynes@681
    59
- (void)setIsGrabbed:(BOOL)grab;
nkeynes@681
    60
@end
nkeynes@681
    61
nkeynes@765
    62
@interface LxdreamPrefsPane : NSView
nkeynes@765
    63
{
nkeynes@765
    64
    int headerHeight;
nkeynes@765
    65
}
nkeynes@765
    66
- (id)initWithFrame: (NSRect)frameRect title:(NSString *)title;
nkeynes@765
    67
- (int)contentHeight;
nkeynes@765
    68
@end
nkeynes@765
    69
nkeynes@770
    70
@interface KeyBindingEditor: NSTextView
nkeynes@770
    71
{
nkeynes@770
    72
    BOOL isPrimed;
nkeynes@770
    73
    NSString *lastValue;
nkeynes@770
    74
}
nkeynes@770
    75
@end
nkeynes@770
    76
nkeynes@770
    77
@interface KeyBindingField : NSTextField
nkeynes@770
    78
{
nkeynes@770
    79
}
nkeynes@770
    80
@end
nkeynes@770
    81
nkeynes@725
    82
@interface LxdreamPrefsPanel : NSPanel
nkeynes@725
    83
{
nkeynes@765
    84
    NSArray *toolbar_ids;
nkeynes@765
    85
    NSArray *toolbar_defaults;
nkeynes@765
    86
    NSDictionary *toolbar_items;
nkeynes@765
    87
    NSView *path_pane, *ctrl_pane;
nkeynes@770
    88
    KeyBindingEditor *binding_editor;
nkeynes@725
    89
}
nkeynes@725
    90
- (id)initWithContentRect:(NSRect)contentRect;
nkeynes@725
    91
@end
nkeynes@681
    92
nkeynes@736
    93
#ifdef __cplusplus
nkeynes@736
    94
}
nkeynes@736
    95
#endif
nkeynes@736
    96
    
nkeynes@681
    97
#endif /* lxdream_cocoaui_H */
.