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
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 struct maple_device;
    34 #define NS_(x) [NSString stringWithUTF8String: _(x)]
    36 /* Standard sizing */
    37 #define TEXT_HEIGHT 22
    38 #define LABEL_HEIGHT 17
    39 #define TEXT_GAP 10
    41 /**
    42  * Convenience method to create a new text label in the specified parent.
    43  */
    44 NSTextField *cocoa_gui_add_label(NSView *parent, NSString *title, NSRect frame);
    46 @interface LxdreamVideoView : NSView
    47 {
    48     BOOL isGrabbed;
    49     id delegate;
    50 }
    51 - (void) setDelegate: (id)other;
    52 - (id)delegate;
    53 - (void) setIsGrabbed: (BOOL)grabbed;
    54 @end
    56 @interface LxdreamMainWindow : NSWindow 
    57 {
    58     LxdreamVideoView *video;
    59     NSTextField *status;
    60     BOOL isGrabbed;
    61     BOOL useGrab;
    62     BOOL isFullscreen;
    63     NSRect savedFrame;
    64 }
    65 - (id)initWithContentRect:(NSRect)contentRect;
    66 - (void)setStatusText:(const gchar *)text;
    67 - (void)updateTitle;
    68 - (void)setRunning:(BOOL)isRunning;
    69 - (BOOL)isGrabbed;
    70 - (void)setIsGrabbed:(BOOL)grab;
    71 - (void)setUseGrab: (BOOL)grab;
    72 - (BOOL)isFullscreen;
    73 - (void)setFullscreen: (BOOL)fs;
    74 @end
    76 @interface LxdreamPrefsPane : NSView
    77 {
    78     int headerHeight;
    79 }
    80 - (id)initWithFrame: (NSRect)frameRect title:(NSString *)title;
    81 - (id)initWithFrame: (NSRect)frameRect title:(NSString *)title configGroup: (lxdream_config_group_t)group scrollable: (BOOL)scroll;
    82 - (int)contentHeight;
    83 @end
    85 @interface KeyBindingEditor: NSTextView
    86 {
    87     BOOL isPrimed;
    88     NSString *lastValue;
    89 }
    90 @end
    92 @interface KeyBindingField : NSTextField
    93 {
    94 }
    95 @end
    98 @interface ConfigurationView : NSView
    99 {
   100     lxdream_config_group_t group;
   101     int labelWidth;
   102     NSTextField *fields[CONFIG_MAX_KEYS][2];
   103 }
   104 - (id)initWithFrame: (NSRect)frameRect;
   105 - (id)initWithFrame: (NSRect)frameRect configGroup: (lxdream_config_group_t)group;
   106 - (void)setLabelWidth: (int)width;
   107 - (void)setConfigGroup: (lxdream_config_group_t)group;
   108 - (void)setDevice: (struct maple_device *)device;
   109 @end
   112 @interface LxdreamPrefsPanel : NSPanel
   113 {
   114     NSArray *toolbar_ids;
   115     NSArray *toolbar_defaults;
   116     NSView *config_panes[3];
   117     NSDictionary *toolbar_items;
   118     KeyBindingEditor *binding_editor;
   119 }
   120 - (id)initWithContentRect:(NSRect)contentRect;
   121 @end
   124 LxdreamMainWindow *cocoa_gui_create_main_window();
   125 NSMenu *cocoa_gdrom_menu_new();
   126 NSView *video_osx_create_drawable();
   127 void cocoa_gui_show_preferences();
   128 NSView *cocoa_gui_create_prefs_controller_pane();
   131 #ifdef __cplusplus
   132 }
   133 #endif
   135 #endif /* lxdream_cocoaui_H */
.