| 1 |
/* |
| 2 |
* Copyright 2019 Google Inc. |
| 3 |
* |
| 4 |
* Use of this source code is governed by a BSD-style license that can be |
| 5 |
* found in the LICENSE file. |
| 6 |
*/ |
| 7 |
|
| 8 |
#include <Carbon/Carbon.h> |
| 9 |
|
| 10 |
#include "include/core/SkTypes.h" |
| 11 |
#include "tools/sk_app/mac/Window_mac.h" |
| 12 |
#include "tools/skui/ModifierKey.h" |
| 13 |
#include "tools/window/DisplayParams.h" |
| 14 |
#include "tools/window/WindowContext.h" |
| 15 |
#include "tools/window/mac/MacWindowInfo.h" |
| 16 |
|
| 17 |
#if defined(SK_GANESH) && defined(SK_ANGLE) |
| 18 |
#include "tools/window/mac/GaneshANGLEWindowContext_mac.h" |
| 19 |
#endif |
| 20 |
|
| 21 |
#if defined(SK_GANESH) && defined(SK_GL) |
| 22 |
#include "tools/window/mac/GaneshGLWindowContext_mac.h" |
| 23 |
#include "tools/window/mac/RasterWindowContext_mac.h" |
| 24 |
#endif |
| 25 |
|
| 26 |
#if defined(SK_GANESH) && defined(SK_METAL) |
| 27 |
#include "tools/window/mac/GaneshMetalWindowContext_mac.h" |
| 28 |
#endif |
| 29 |
|
| 30 |
#if defined(SK_GRAPHITE) && defined(SK_METAL) |
| 31 |
#include "tools/window/mac/GraphiteNativeMetalWindowContext_mac.h" |
| 32 |
#endif |
| 33 |
|
| 34 |
#if defined(SK_GRAPHITE) && defined(SK_DAWN) |
| 35 |
#include "tools/window/mac/GraphiteDawnMetalWindowContext_mac.h" |
| 36 |
#endif |
| 37 |
|
| 38 |
@interface WindowDelegate : NSObject<NSWindowDelegate> |
| 39 |
|
| 40 |
- (WindowDelegate*)initWithWindow:(sk_app::Window_mac*)initWindow; |
| 41 |
|
| 42 |
@end |
| 43 |
|
| 44 |
@interface MainView : NSView |
| 45 |
|
| 46 |
- (MainView*)initWithWindow:(sk_app::Window_mac*)initWindow; |
| 47 |
|
| 48 |
@end |
| 49 |
|
| 50 |
/////////////////////////////////////////////////////////////////////////////// |
| 51 |
|
| 52 |
using sk_app::Window; |
| 53 |
using skwindow::DisplayParams; |
| 54 |
|
| 55 |
namespace sk_app { |
| 56 |
|
| 57 |
SkTDynamicHash<Window_mac, NSInteger> Window_mac::gWindowMap; |
| 58 |
|
| 59 |
Window* Windows::CreateNativeWindow(void*) { |
| 60 |
Window_mac* window = new Window_mac(); |
| 61 |
if (!window->initWindow()) { |
| 62 |
delete window; |
| 63 |
return nullptr; |
| 64 |
} |
| 65 |
|
| 66 |
return window; |
| 67 |
} |
| 68 |
|
| 69 |
bool Window_mac::initWindow() { |
| 70 |
// we already have a window |
| 71 |
if (fWindow) { |
| 72 |
return true; |
| 73 |
} |
| 74 |
|
| 75 |
// Create a delegate to track certain events |
| 76 |
WindowDelegate* delegate = [[WindowDelegate alloc] initWithWindow:this]; |
| 77 |
if (nil == delegate) { |
| 78 |
return false; |
| 79 |
} |
| 80 |
|
| 81 |
// Create Cocoa window |
| 82 |
constexpr int initialWidth = 1280; |
| 83 |
constexpr int initialHeight = 960; |
| 84 |
NSRect windowRect = NSMakeRect(100, 100, initialWidth, initialHeight); |
| 85 |
|
| 86 |
NSUInteger windowStyle = (NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | |
| 87 |
NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable); |
| 88 |
|
| 89 |
fWindow = [[NSWindow alloc] initWithContentRect:windowRect styleMask:windowStyle |
| 90 |
backing:NSBackingStoreBuffered defer:NO]; |
| 91 |
if (nil == fWindow) { |
| 92 |
[delegate release]; |
| 93 |
return false; |
| 94 |
} |
| 95 |
|
| 96 |
// create view |
| 97 |
MainView* view = [[MainView alloc] initWithWindow:this]; |
| 98 |
if (nil == view) { |
| 99 |
[fWindow release]; |
| 100 |
[delegate release]; |
| 101 |
return false; |
| 102 |
} |
| 103 |
|
| 104 |
[fWindow setContentView:view]; |
| 105 |
[fWindow makeFirstResponder:view]; |
| 106 |
[fWindow setDelegate:delegate]; |
| 107 |
[fWindow setAcceptsMouseMovedEvents:YES]; |
| 108 |
[fWindow setRestorable:NO]; |
| 109 |
|
| 110 |
// Should be retained by window now |
| 111 |
[view release]; |
| 112 |
|
| 113 |
fWindowNumber = fWindow.windowNumber; |
| 114 |
gWindowMap.add(this); |
| 115 |
|
| 116 |
return true; |
| 117 |
} |
| 118 |
|
| 119 |
void Window_mac::closeWindow() { |
| 120 |
if (nil != fWindow) { |
| 121 |
gWindowMap.remove(fWindowNumber); |
| 122 |
if (sk_app::Window_mac::gWindowMap.count() < 1) { |
| 123 |
[NSApp terminate:fWindow]; |
| 124 |
} |
| 125 |
[fWindow close]; |
| 126 |
fWindow = nil; |
| 127 |
} |
| 128 |
} |
| 129 |
|
| 130 |
void Window_mac::setTitle(const char* title) { |
| 131 |
if (NSString* titleStr = [NSString stringWithUTF8String:title]) { |
| 132 |
[fWindow setTitle:titleStr]; |
| 133 |
} |
| 134 |
} |
| 135 |
|
| 136 |
void Window_mac::show() { |
| 137 |
[fWindow orderFront:nil]; |
| 138 |
|
| 139 |
[NSApp activateIgnoringOtherApps:YES]; |
| 140 |
[fWindow makeKeyAndOrderFront:NSApp]; |
| 141 |
} |
| 142 |
|
| 143 |
bool Window_mac::attach(BackendType attachType) { |
| 144 |
this->initWindow(); |
| 145 |
|
| 146 |
skwindow::MacWindowInfo info; |
| 147 |
info.fMainView = [fWindow contentView]; |
| 148 |
switch (attachType) { |
| 149 |
#if defined(SK_GANESH) && defined(SK_ANGLE) |
| 150 |
case BackendType::kANGLE: |
| 151 |
fWindowContext = |
| 152 |
skwindow::MakeGaneshANGLEForMac(info, fRequestedDisplayParams->clone()); |
| 153 |
break; |
| 154 |
#endif |
| 155 |
#if defined(SK_GRAPHITE) && defined(SK_DAWN) |
| 156 |
case BackendType::kGraphiteDawnMetal: |
| 157 |
fWindowContext = MakeGraphiteDawnMetalForMac(info, fRequestedDisplayParams->clone()); |
| 158 |
break; |
| 159 |
#endif |
| 160 |
#if defined(SK_GANESH) && defined(SK_METAL) |
| 161 |
case BackendType::kMetal: |
| 162 |
fWindowContext = MakeGaneshMetalForMac(info, fRequestedDisplayParams->clone()); |
| 163 |
break; |
| 164 |
#endif |
| 165 |
#if defined(SK_GRAPHITE) && defined(SK_METAL) |
| 166 |
case BackendType::kGraphiteMetal: |
| 167 |
fWindowContext = MakeGraphiteNativeMetalForMac(info, fRequestedDisplayParams->clone()); |
| 168 |
break; |
| 169 |
#endif |
| 170 |
#if defined(SK_GANESH) && defined(SK_GL) |
| 171 |
case BackendType::kNativeGL: |
| 172 |
fWindowContext = MakeGaneshGLForMac(info, fRequestedDisplayParams->clone()); |
| 173 |
break; |
| 174 |
case BackendType::kRaster: |
| 175 |
// The Raster IMPL requires GL |
| 176 |
fWindowContext = MakeRasterForMac(info, fRequestedDisplayParams->clone()); |
| 177 |
break; |
| 178 |
#endif |
| 179 |
default: |
| 180 |
SK_ABORT("Unknown backend"); |
| 181 |
} |
| 182 |
this->onBackendCreated(); |
| 183 |
|
| 184 |
return SkToBool(fWindowContext); |
| 185 |
} |
| 186 |
|
| 187 |
float Window_mac::scaleFactor() const { |
| 188 |
return skwindow::GetBackingScaleFactor(fWindow.contentView); |
| 189 |
} |
| 190 |
|
| 191 |
void Window_mac::PaintWindows() { |
| 192 |
gWindowMap.foreach([&](Window_mac* window) { |
| 193 |
if (window->fIsContentInvalidated) { |
| 194 |
window->onPaint(); |
| 195 |
} |
| 196 |
}); |
| 197 |
} |
| 198 |
|
| 199 |
} // namespace sk_app |
| 200 |
|
| 201 |
/////////////////////////////////////////////////////////////////////////////// |
| 202 |
|
| 203 |
@implementation WindowDelegate { |
| 204 |
sk_app::Window_mac* fWindow; |
| 205 |
} |
| 206 |
|
| 207 |
- (WindowDelegate*)initWithWindow:(sk_app::Window_mac *)initWindow { |
| 208 |
fWindow = initWindow; |
| 209 |
|
| 210 |
return self; |
| 211 |
} |
| 212 |
|
| 213 |
- (void)windowDidResize:(NSNotification *)notification { |
| 214 |
NSView* view = fWindow->window().contentView; |
| 215 |
CGFloat scale = skwindow::GetBackingScaleFactor(view); |
| 216 |
fWindow->onResize(view.bounds.size.width * scale, view.bounds.size.height * scale); |
| 217 |
fWindow->inval(); |
| 218 |
} |
| 219 |
|
| 220 |
- (void)windowDidChangeScreen:(NSNotification *)notification { |
| 221 |
NSView* view = fWindow->window().contentView; |
| 222 |
CGFloat scale = skwindow::GetBackingScaleFactor(view); |
| 223 |
fWindow->onResize(view.bounds.size.width * scale, view.bounds.size.height * scale); |
| 224 |
fWindow->inval(); |
| 225 |
} |
| 226 |
|
| 227 |
- (BOOL)windowShouldClose:(NSWindow*)sender { |
| 228 |
fWindow->closeWindow(); |
| 229 |
|
| 230 |
return FALSE; |
| 231 |
} |
| 232 |
|
| 233 |
@end |
| 234 |
|
| 235 |
/////////////////////////////////////////////////////////////////////////////// |
| 236 |
|
| 237 |
static skui::Key get_key(unsigned short vk) { |
| 238 |
// This will work with an ANSI QWERTY keyboard. |
| 239 |
// Something more robust would be needed to support alternate keyboards. |
| 240 |
static const struct { |
| 241 |
unsigned short fVK; |
| 242 |
skui::Key fKey; |
| 243 |
} gPair[] = { |
| 244 |
{ kVK_Delete, skui::Key::kBack }, |
| 245 |
{ kVK_Return, skui::Key::kOK }, |
| 246 |
{ kVK_UpArrow, skui::Key::kUp }, |
| 247 |
{ kVK_DownArrow, skui::Key::kDown }, |
| 248 |
{ kVK_LeftArrow, skui::Key::kLeft }, |
| 249 |
{ kVK_RightArrow, skui::Key::kRight }, |
| 250 |
{ kVK_Tab, skui::Key::kTab }, |
| 251 |
{ kVK_PageUp, skui::Key::kPageUp }, |
| 252 |
{ kVK_PageDown, skui::Key::kPageDown }, |
| 253 |
{ kVK_Home, skui::Key::kHome }, |
| 254 |
{ kVK_End, skui::Key::kEnd }, |
| 255 |
{ kVK_ForwardDelete, skui::Key::kDelete }, |
| 256 |
{ kVK_Escape, skui::Key::kEscape }, |
| 257 |
{ kVK_Shift, skui::Key::kShift }, |
| 258 |
{ kVK_RightShift, skui::Key::kShift }, |
| 259 |
{ kVK_Control, skui::Key::kCtrl }, |
| 260 |
{ kVK_RightControl, skui::Key::kCtrl }, |
| 261 |
{ kVK_Option, skui::Key::kOption }, |
| 262 |
{ kVK_RightOption, skui::Key::kOption }, |
| 263 |
{ kVK_Command, skui::Key::kSuper }, |
| 264 |
{ kVK_RightCommand, skui::Key::kSuper }, |
| 265 |
{ kVK_ANSI_A, skui::Key::kA }, |
| 266 |
{ kVK_ANSI_C, skui::Key::kC }, |
| 267 |
{ kVK_ANSI_V, skui::Key::kV }, |
| 268 |
{ kVK_ANSI_X, skui::Key::kX }, |
| 269 |
{ kVK_ANSI_Y, skui::Key::kY }, |
| 270 |
{ kVK_ANSI_Z, skui::Key::kZ }, |
| 271 |
}; |
| 272 |
|
| 273 |
for (size_t i = 0; i < std::size(gPair); i++) { |
| 274 |
if (gPair[i].fVK == vk) { |
| 275 |
return gPair[i].fKey; |
| 276 |
} |
| 277 |
} |
| 278 |
|
| 279 |
return skui::Key::kNONE; |
| 280 |
} |
| 281 |
|
| 282 |
static skui::ModifierKey get_modifiers(const NSEvent* event) { |
| 283 |
NSUInteger modifierFlags = [event modifierFlags]; |
| 284 |
skui::ModifierKey modifiers = skui::ModifierKey::kNone; |
| 285 |
|
| 286 |
if (modifierFlags & NSEventModifierFlagCommand) { |
| 287 |
modifiers |= skui::ModifierKey::kCommand; |
| 288 |
} |
| 289 |
if (modifierFlags & NSEventModifierFlagShift) { |
| 290 |
modifiers |= skui::ModifierKey::kShift; |
| 291 |
} |
| 292 |
if (modifierFlags & NSEventModifierFlagControl) { |
| 293 |
modifiers |= skui::ModifierKey::kControl; |
| 294 |
} |
| 295 |
if (modifierFlags & NSEventModifierFlagOption) { |
| 296 |
modifiers |= skui::ModifierKey::kOption; |
| 297 |
} |
| 298 |
|
| 299 |
if ((NSEventTypeKeyDown == [event type] || NSEventTypeKeyUp == [event type]) && |
| 300 |
![event isARepeat]) |
| 301 |
{ |
| 302 |
modifiers |= skui::ModifierKey::kFirstPress; |
| 303 |
} |
| 304 |
|
| 305 |
return modifiers; |
| 306 |
} |
| 307 |
|
| 308 |
@implementation MainView { |
| 309 |
sk_app::Window_mac* fWindow; |
| 310 |
// A TrackingArea prevents us from capturing events outside the view |
| 311 |
NSTrackingArea* fTrackingArea; |
| 312 |
// We keep track of the state of the modifier keys on each event in order to synthesize |
| 313 |
// key-up/down events for each modifier. |
| 314 |
skui::ModifierKey fLastModifiers; |
| 315 |
} |
| 316 |
|
| 317 |
- (MainView*)initWithWindow:(sk_app::Window_mac *)initWindow { |
| 318 |
self = [super init]; |
| 319 |
|
| 320 |
fWindow = initWindow; |
| 321 |
fTrackingArea = nil; |
| 322 |
|
| 323 |
[self updateTrackingAreas]; |
| 324 |
|
| 325 |
return self; |
| 326 |
} |
| 327 |
|
| 328 |
- (void)dealloc |
| 329 |
{ |
| 330 |
[fTrackingArea release]; |
| 331 |
[super dealloc]; |
| 332 |
} |
| 333 |
|
| 334 |
- (BOOL)isOpaque { |
| 335 |
return YES; |
| 336 |
} |
| 337 |
|
| 338 |
- (BOOL)canBecomeKeyView { |
| 339 |
return YES; |
| 340 |
} |
| 341 |
|
| 342 |
- (BOOL)acceptsFirstResponder { |
| 343 |
return YES; |
| 344 |
} |
| 345 |
|
| 346 |
- (void)updateTrackingAreas { |
| 347 |
if (fTrackingArea != nil) { |
| 348 |
[self removeTrackingArea:fTrackingArea]; |
| 349 |
[fTrackingArea release]; |
| 350 |
} |
| 351 |
|
| 352 |
const NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited | |
| 353 |
NSTrackingActiveInKeyWindow | |
| 354 |
NSTrackingEnabledDuringMouseDrag | |
| 355 |
NSTrackingCursorUpdate | |
| 356 |
NSTrackingInVisibleRect | |
| 357 |
NSTrackingAssumeInside; |
| 358 |
|
| 359 |
fTrackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] |
| 360 |
options:options |
| 361 |
owner:self |
| 362 |
userInfo:nil]; |
| 363 |
|
| 364 |
[self addTrackingArea:fTrackingArea]; |
| 365 |
[super updateTrackingAreas]; |
| 366 |
} |
| 367 |
|
| 368 |
- (skui::ModifierKey) updateModifierKeys:(NSEvent*) event { |
| 369 |
using sknonstd::Any; |
| 370 |
|
| 371 |
skui::ModifierKey modifiers = get_modifiers(event); |
| 372 |
skui::ModifierKey changed = modifiers ^ fLastModifiers; |
| 373 |
fLastModifiers = modifiers; |
| 374 |
|
| 375 |
struct ModMap { |
| 376 |
skui::ModifierKey modifier; |
| 377 |
skui::Key key; |
| 378 |
}; |
| 379 |
|
| 380 |
// Map each modifier bit to the equivalent skui Key and send key-up/down events. |
| 381 |
for (const ModMap& cur : {ModMap{skui::ModifierKey::kCommand, skui::Key::kSuper}, |
| 382 |
ModMap{skui::ModifierKey::kShift, skui::Key::kShift}, |
| 383 |
ModMap{skui::ModifierKey::kControl, skui::Key::kCtrl}, |
| 384 |
ModMap{skui::ModifierKey::kOption, skui::Key::kOption}}) { |
| 385 |
if (Any(changed & cur.modifier)) { |
| 386 |
const skui::InputState state = Any(modifiers & cur.modifier) ? skui::InputState::kDown |
| 387 |
: skui::InputState::kUp; |
| 388 |
(void) fWindow->onKey(cur.key, state, modifiers); |
| 389 |
} |
| 390 |
} |
| 391 |
|
| 392 |
return modifiers; |
| 393 |
} |
| 394 |
|
| 395 |
- (BOOL)performKeyEquivalent:(NSEvent *)event { |
| 396 |
[self updateModifierKeys:event]; |
| 397 |
|
| 398 |
// By default, unhandled key equivalents send -keyDown events; unfortunately, they do not send |
| 399 |
// a matching -keyUp. In other words, we can claim that we didn't handle the event and OS X will |
| 400 |
// turn this event into a -keyDown automatically, but we need to synthesize a matching -keyUp on |
| 401 |
// a later frame. Since we only read the modifiers and key code from the event, we can reuse |
| 402 |
// this "key-equivalent" event as a "key up". |
| 403 |
[self performSelector:@selector(keyUp:) withObject:event afterDelay:0.1]; |
| 404 |
return NO; |
| 405 |
} |
| 406 |
|
| 407 |
- (void)keyDown:(NSEvent *)event { |
| 408 |
skui::ModifierKey modifiers = [self updateModifierKeys:event]; |
| 409 |
|
| 410 |
skui::Key key = get_key([event keyCode]); |
| 411 |
if (key != skui::Key::kNONE) { |
| 412 |
if (!fWindow->onKey(key, skui::InputState::kDown, modifiers)) { |
| 413 |
if (skui::Key::kEscape == key) { |
| 414 |
[NSApp terminate:fWindow->window()]; |
| 415 |
} |
| 416 |
} |
| 417 |
} |
| 418 |
|
| 419 |
NSString* characters = [event charactersIgnoringModifiers]; |
| 420 |
NSUInteger len = [characters length]; |
| 421 |
if (len > 0) { |
| 422 |
unichar* charBuffer = new unichar[len+1]; |
| 423 |
[characters getCharacters:charBuffer range:NSMakeRange(0, len)]; |
| 424 |
for (NSUInteger i = 0; i < len; ++i) { |
| 425 |
(void) fWindow->onChar((SkUnichar) charBuffer[i], modifiers); |
| 426 |
} |
| 427 |
delete [] charBuffer; |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
- (void)keyUp:(NSEvent *)event { |
| 432 |
skui::ModifierKey modifiers = [self updateModifierKeys:event]; |
| 433 |
|
| 434 |
skui::Key key = get_key([event keyCode]); |
| 435 |
if (key != skui::Key::kNONE) { |
| 436 |
(void) fWindow->onKey(key, skui::InputState::kUp, modifiers); |
| 437 |
} |
| 438 |
} |
| 439 |
|
| 440 |
-(void)flagsChanged:(NSEvent *)event { |
| 441 |
[self updateModifierKeys:event]; |
| 442 |
} |
| 443 |
|
| 444 |
- (void)mouseDown:(NSEvent *)event { |
| 445 |
NSView* view = fWindow->window().contentView; |
| 446 |
CGFloat backingScaleFactor = skwindow::GetBackingScaleFactor(view); |
| 447 |
|
| 448 |
skui::ModifierKey modifiers = [self updateModifierKeys:event]; |
| 449 |
|
| 450 |
const NSPoint pos = [event locationInWindow]; |
| 451 |
const NSRect rect = [view frame]; |
| 452 |
fWindow->onMouse(pos.x * backingScaleFactor, (rect.size.height - pos.y) * backingScaleFactor, |
| 453 |
skui::InputState::kDown, modifiers); |
| 454 |
} |
| 455 |
|
| 456 |
- (void)mouseUp:(NSEvent *)event { |
| 457 |
NSView* view = fWindow->window().contentView; |
| 458 |
CGFloat backingScaleFactor = skwindow::GetBackingScaleFactor(view); |
| 459 |
|
| 460 |
skui::ModifierKey modifiers = [self updateModifierKeys:event]; |
| 461 |
|
| 462 |
const NSPoint pos = [event locationInWindow]; |
| 463 |
const NSRect rect = [view frame]; |
| 464 |
fWindow->onMouse(pos.x * backingScaleFactor, (rect.size.height - pos.y) * backingScaleFactor, |
| 465 |
skui::InputState::kUp, modifiers); |
| 466 |
} |
| 467 |
|
| 468 |
- (void)mouseDragged:(NSEvent *)event { |
| 469 |
[self updateModifierKeys:event]; |
| 470 |
[self mouseMoved:event]; |
| 471 |
} |
| 472 |
|
| 473 |
- (void)mouseMoved:(NSEvent *)event { |
| 474 |
NSView* view = fWindow->window().contentView; |
| 475 |
CGFloat backingScaleFactor = skwindow::GetBackingScaleFactor(view); |
| 476 |
|
| 477 |
skui::ModifierKey modifiers = [self updateModifierKeys:event]; |
| 478 |
|
| 479 |
const NSPoint pos = [event locationInWindow]; |
| 480 |
const NSRect rect = [view frame]; |
| 481 |
fWindow->onMouse(pos.x * backingScaleFactor, (rect.size.height - pos.y) * backingScaleFactor, |
| 482 |
skui::InputState::kMove, modifiers); |
| 483 |
} |
| 484 |
|
| 485 |
- (void)scrollWheel:(NSEvent *)event { |
| 486 |
NSView* view = fWindow->window().contentView; |
| 487 |
CGFloat backingScaleFactor = skwindow::GetBackingScaleFactor(view); |
| 488 |
|
| 489 |
skui::ModifierKey modifiers = [self updateModifierKeys:event]; |
| 490 |
|
| 491 |
// TODO: support hasPreciseScrollingDeltas? |
| 492 |
const NSPoint pos = [event locationInWindow]; |
| 493 |
const NSRect rect = [view frame]; |
| 494 |
fWindow->onMouseWheel([event scrollingDeltaY], |
| 495 |
pos.x * backingScaleFactor, |
| 496 |
(rect.size.height - pos.y) * backingScaleFactor, |
| 497 |
modifiers); |
| 498 |
} |
| 499 |
|
| 500 |
- (void)drawRect:(NSRect)rect { |
| 501 |
fWindow->onPaint(); |
| 502 |
} |
| 503 |
|
| 504 |
@end |