Search
lxdream.org :: lxdream/src/cocoaui/cocoaui.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoaui.h
changeset 874:e3007b8799f3
prev839:51f1c4195790
next1028:f99eeaf084c2
author nkeynes
date Tue Oct 14 08:43:01 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Save the main window in a global rather than using [NSApp mainWindow]. This has
the advantage of working properly when the window isn't actually main at the time
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 "gettext.h"
    26 #ifdef __cplusplus
    27 extern "C" {
    28 #endif
    30 #define NS_(x) [NSString stringWithUTF8String: _(x)]
    32 /* Standard sizing */
    33 #define TEXT_HEIGHT 22
    34 #define LABEL_HEIGHT 17
    35 #define TEXT_GAP 10
    37 /**
    38  * Convenience method to create a new text label in the specified parent.
    39  */
    40 NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
    42 @interface LxdreamVideoView : NSView
    43 {
    44     BOOL isGrabbed;
    45     id delegate;
    46 }
    47 - (void) setDelegate: (id)other;
    48 - (id)delegate;
    49 - (void) setIsGrabbed: (BOOL)grabbed;
    50 @end
    52 @interface LxdreamMainWindow : NSWindow 
    53 {
    54     LxdreamVideoView *video;
    55     NSTextField *status;
    56     BOOL isGrabbed;
    57     BOOL useGrab;
    58 }
    59 - (id)initWithContentRect:(NSRect)contentRect;
    60 - (void)setStatusText:(const gchar *)text;
    61 - (void)updateTitle;
    62 - (void)setRunning:(BOOL)isRunning;
    63 - (BOOL)isGrabbed;
    64 - (void)setIsGrabbed:(BOOL)grab;
    65 - (void)setUseGrab: (BOOL)grab;
    66 @end
    68 @interface LxdreamPrefsPane : NSView
    69 {
    70     int headerHeight;
    71 }
    72 - (id)initWithFrame: (NSRect)frameRect title:(NSString *)title;
    73 - (int)contentHeight;
    74 @end
    76 @interface KeyBindingEditor: NSTextView
    77 {
    78     BOOL isPrimed;
    79     NSString *lastValue;
    80 }
    81 @end
    83 @interface KeyBindingField : NSTextField
    84 {
    85 }
    86 @end
    88 @interface LxdreamPrefsPanel : NSPanel
    89 {
    90     NSArray *toolbar_ids;
    91     NSArray *toolbar_defaults;
    92     NSDictionary *toolbar_items;
    93     NSView *path_pane, *ctrl_pane;
    94     KeyBindingEditor *binding_editor;
    95 }
    96 - (id)initWithContentRect:(NSRect)contentRect;
    97 @end
   100 LxdreamMainWindow *cocoa_gui_create_main_window();
   101 NSMenu *cocoa_gdrom_menu_new();
   102 NSView *video_osx_create_drawable();
   103 void cocoa_gui_show_preferences();
   104 NSView *cocoa_gui_create_prefs_controller_pane();
   105 NSView *cocoa_gui_create_prefs_path_pane();
   108 #ifdef __cplusplus
   109 }
   110 #endif
   112 #endif /* lxdream_cocoaui_H */
.