File: clutter-stage-osx.c

package info (click to toggle)
clutter-1.0 1.26.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 34,352 kB
  • sloc: ansic: 128,533; sh: 5,580; xml: 1,641; makefile: 1,613; ruby: 149; perl: 142; sed: 16
file content (715 lines) | stat: -rw-r--r-- 20,155 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
/* Clutter -  An OpenGL based 'interactive canvas' library.
 * OSX backend - integration with NSWindow and NSView
 *
 * Copyright (C) 2007-2008  Tommi Komulainen <tommi.komulainen@iki.fi>
 * Copyright (C) 2007  OpenedHand Ltd.
 * Copyright (C) 2011  Crystalnix  <vgachkaylo@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 */
#include "config.h"

#import "clutter-osx.h"
#import "clutter-stage-osx.h"
#import "clutter-backend-osx.h"

#include "clutter-debug.h"
#include "clutter-private.h"
#include "clutter-stage-private.h"

enum
{
  PROP_0,

  PROP_BACKEND,
  PROP_WRAPPER
};

static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);

#define clutter_stage_osx_get_type      _clutter_stage_osx_get_type

G_DEFINE_TYPE_WITH_CODE (ClutterStageOSX,
                         clutter_stage_osx,
                         G_TYPE_OBJECT,
                         G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
                                                clutter_stage_window_iface_init))

static ClutterActor *
clutter_stage_osx_get_wrapper (ClutterStageWindow *stage_window);

#define CLUTTER_OSX_FULLSCREEN_WINDOW_LEVEL (NSMainMenuWindowLevel + 1)

/*************************************************************************/
@implementation ClutterGLWindow
- (id)initWithView:(NSView *)aView UTF8Title:(const char *)aTitle stage:(ClutterStageOSX *)aStage
{
  if ((self = [super initWithContentRect: [aView frame]
                               styleMask: NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
                                 backing: NSBackingStoreBuffered
                                   defer: NO]) != nil)
    {
      [self setDelegate: self];
      [self useOptimizedDrawing: YES];
      [self setAcceptsMouseMovedEvents:YES];
      [self setContentView: aView];
      [self setTitle:[NSString stringWithUTF8String: aTitle ? aTitle : ""]];
      self->stage_osx = aStage;
    }
  return self;
}

- (BOOL) windowShouldClose: (id) sender
{
  ClutterEvent event;

  CLUTTER_NOTE (BACKEND, "[%p] windowShouldClose", self->stage_osx);

  event.type = CLUTTER_DELETE;
  event.any.stage = self->stage_osx->wrapper;
  clutter_event_put (&event);

  return NO;
}

- (NSRect) constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)aScreen
{
  /* in fullscreen mode we don't want to be constrained by menubar or dock
   * FIXME: calculate proper constraints depending on fullscreen mode
   */

  return frameRect;
}

- (void) windowDidBecomeKey:(NSNotification*)aNotification
{
  ClutterStage *stage;

  CLUTTER_NOTE (BACKEND, "[%p] windowDidBecomeKey", self->stage_osx);

  stage = self->stage_osx->wrapper;

  if (_clutter_stage_is_fullscreen (stage))
    [self setLevel: CLUTTER_OSX_FULLSCREEN_WINDOW_LEVEL];

  _clutter_stage_update_state (stage, 0, CLUTTER_STAGE_STATE_ACTIVATED);
}

- (void) windowDidResignKey:(NSNotification*)aNotification
{
  ClutterStage *stage;

  CLUTTER_NOTE (BACKEND, "[%p] windowDidResignKey", self->stage_osx);

  stage = self->stage_osx->wrapper;

  if (_clutter_stage_is_fullscreen (stage))
    {
      [self setLevel: NSNormalWindowLevel];
      if (!self->stage_osx->isHiding)
        [self orderBack: nil];
    }

  _clutter_stage_update_state (stage, CLUTTER_STAGE_STATE_ACTIVATED, 0);
}

- (NSSize) windowWillResize:(NSWindow *) sender toSize:(NSSize) frameSize
{
  if (clutter_stage_get_user_resizable (self->stage_osx->wrapper))
    {
      guint min_width, min_height;
      clutter_stage_get_minimum_size (self->stage_osx->wrapper,
                                      &min_width,
                                      &min_height);
      [self setContentMinSize:NSMakeSize(min_width, min_height)];
      return frameSize;
    }
  else 
    return [self frame].size;
}

- (void)windowDidChangeScreen:(NSNotification *)notification
{
  clutter_stage_ensure_redraw (self->stage_osx->wrapper);
}
@end

/*************************************************************************/
@interface ClutterGLView : NSOpenGLView
{
  ClutterStageOSX *stage_osx;

  NSTrackingRectTag trackingRect;
}
- (void) drawRect: (NSRect) bounds;
@end

@implementation ClutterGLView
- (id) initWithFrame: (NSRect)aFrame pixelFormat:(NSOpenGLPixelFormat*)aFormat stage:(ClutterStageOSX*)aStage
{
  if ((self = [super initWithFrame:aFrame pixelFormat:aFormat]) != nil)
    {
      self->stage_osx = aStage;
      trackingRect = [self addTrackingRect:[self bounds]
                                     owner:self
                                  userData:NULL
                              assumeInside:NO];
    }

  return self;
}

- (void) dealloc
{
  if (trackingRect)
    {
      [self removeTrackingRect:trackingRect];
      trackingRect = 0;
    }

  [super dealloc];
}

- (NSTrackingRectTag) trackingRect
{
  return trackingRect;
}

- (ClutterActor *) clutterStage
{
  return (ClutterActor *) stage_osx->wrapper;
}

- (void) drawRect: (NSRect) bounds
{
  ClutterActor *stage = [self clutterStage];

  _clutter_stage_do_paint (CLUTTER_STAGE (stage), NULL);

  cogl_flush ();

  [[self openGLContext] flushBuffer];
}

/* In order to receive key events */
- (BOOL) acceptsFirstResponder
{
  return YES;
}

/* We want 0,0 top left */
- (BOOL) isFlipped
{
  return YES;
}

- (BOOL) isOpaque
{
  ClutterActor *stage = [self clutterStage];

  if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
   return YES;

  if (clutter_stage_get_use_alpha (CLUTTER_STAGE (stage)))
    return NO;

  return YES;
}

- (void) reshape
{
  ClutterActor *stage;

  stage_osx->requisition_width = [self bounds].size.width;
  stage_osx->requisition_height = [self bounds].size.height;

  stage = [self clutterStage];
  clutter_actor_set_size (stage,
                          stage_osx->requisition_width,
                          stage_osx->requisition_height);

  [self removeTrackingRect:trackingRect];
  trackingRect = [self addTrackingRect:[self bounds]
                                 owner:self
                              userData:NULL
                          assumeInside:NO];
}

/* Simply forward all events that reach our view to clutter. */

#define EVENT_HANDLER(event) \
-(void)event:(NSEvent *) theEvent { \
  _clutter_event_osx_put (theEvent, stage_osx->wrapper);  \
}

EVENT_HANDLER(mouseDown)
EVENT_HANDLER(mouseDragged)
EVENT_HANDLER(mouseUp)
EVENT_HANDLER(mouseMoved)
EVENT_HANDLER(mouseEntered)
EVENT_HANDLER(mouseExited)
EVENT_HANDLER(rightMouseDown)
EVENT_HANDLER(rightMouseDragged)
EVENT_HANDLER(rightMouseUp)
EVENT_HANDLER(otherMouseDown)
EVENT_HANDLER(otherMouseDragged)
EVENT_HANDLER(otherMouseUp)
EVENT_HANDLER(scrollWheel)
EVENT_HANDLER(keyDown)
EVENT_HANDLER(keyUp)
EVENT_HANDLER(flagsChanged)
EVENT_HANDLER(helpRequested)
EVENT_HANDLER(tabletPoint)
EVENT_HANDLER(tabletProximity)

#undef EVENT_HANDLER
@end

/*************************************************************************/

static void
clutter_stage_osx_save_frame (ClutterStageOSX *self)
{
  g_assert (self->window != NULL);

  self->normalFrame = [self->window frame];
  self->haveNormalFrame = TRUE;
}

static void
clutter_stage_osx_set_frame (ClutterStageOSX *self)
{
  g_assert (self->window != NULL);

  if (_clutter_stage_is_fullscreen (self->wrapper))
    {
      /* Raise above the menubar (and dock) covering the whole screen.
       *
       * NOTE: This effectively breaks Option-Tabbing as our window covers
       * all other applications completely. However we deal with the situation
       * by lowering the window to the bottom of the normal level stack on
       * windowDidResignKey notification.
       */
      [self->window setLevel: CLUTTER_OSX_FULLSCREEN_WINDOW_LEVEL];

      [self->window setFrame: [self->window frameRectForContentRect: [[self->window screen] frame]]
                                                            display: NO];
    }
  else
    {
      [self->window setLevel: NSNormalWindowLevel];

      if (self->haveNormalFrame)
        [self->window setFrame: self->normalFrame display: NO];
      else
        {
          /* looks better than positioning to 0,0 (bottom right) */
          [self->window center];
        }
    }
}

/*************************************************************************/
static gboolean
clutter_stage_osx_realize (ClutterStageWindow *stage_window)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);
  gfloat width, height;
  NSRect rect;

  CLUTTER_OSX_POOL_ALLOC();

  CLUTTER_NOTE (BACKEND, "[%p] realize", self);

  if (!self->haveRealized)
    {
      ClutterBackendOSX *backend_osx;

      backend_osx = CLUTTER_BACKEND_OSX (self->backend);

      /* Call get_size - this will either get the geometry size (which
       * before we create the window is set to 640x480), or if a size
       * is set, it will get that. This lets you set a size on the
       * stage before it's realized.
       */
      clutter_actor_get_size (CLUTTER_ACTOR (self->wrapper), &width, &height);
      self->requisition_width = width;
      self->requisition_height= height;

      rect = NSMakeRect (0, 0, self->requisition_width, self->requisition_height);

      self->view = [[ClutterGLView alloc]
                    initWithFrame: rect
                      pixelFormat: backend_osx->pixel_format
                            stage: self];
      [self->view setOpenGLContext:backend_osx->context];

      self->window = [[ClutterGLWindow alloc]
                      initWithView: self->view
                         UTF8Title: clutter_stage_get_title (CLUTTER_STAGE (self->wrapper))
                             stage: self];
      /* looks better than positioning to 0,0 (bottom right) */
      [self->window center];
      self->haveRealized = true;

      CLUTTER_NOTE (BACKEND, "Stage successfully realized");
    }

  CLUTTER_OSX_POOL_RELEASE();

  return TRUE;
}

static void
clutter_stage_osx_unrealize (ClutterStageWindow *stage_window)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  CLUTTER_OSX_POOL_ALLOC();

  CLUTTER_NOTE (BACKEND, "[%p] unrealize", self);

  /* ensure we get realize+unrealize properly paired */
  g_return_if_fail (self->view != NULL && self->window != NULL);

  [self->view release];
  [self->window close];

  self->view = NULL;
  self->window = NULL;
  self->haveRealized = false;

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_osx_show (ClutterStageWindow *stage_window,
                        gboolean            do_raise)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);
  BOOL isViewHidden;
  NSPoint nspoint;

  CLUTTER_OSX_POOL_ALLOC();

  CLUTTER_NOTE (BACKEND, "[%p] show", self);

  clutter_stage_osx_realize (stage_window);
  clutter_actor_map (CLUTTER_ACTOR (self->wrapper));

  clutter_stage_osx_set_frame (self);

  /* Draw view should be avoided and it is the reason why
   * we should hide OpenGL view while we showing the stage.
   */
  isViewHidden = [self->view isHidden];
  if (isViewHidden == NO)
    [self->view setHidden:YES];

  if (self->acceptFocus)
    [self->window makeKeyAndOrderFront: nil];
  else
    [self->window orderFront: nil];

  /* If the window is placed directly under the mouse pointer, Quartz will
   * not send a NSMouseEntered event; we can easily synthesize one ourselves
   * though.
   */
  nspoint = [self->window mouseLocationOutsideOfEventStream];
  if ([self->view mouse:nspoint inRect:[self->view frame]])
    {
      NSEvent *event;

      event = [NSEvent enterExitEventWithType: NSMouseEntered
                                     location: NSMakePoint(0, 0)
                                modifierFlags: 0
                                    timestamp: 0
                                 windowNumber: [self->window windowNumber]
                                      context: NULL
                                  eventNumber: 0
                               trackingNumber: [self->view trackingRect]
                                     userData: nil];

      [NSApp postEvent:event atStart:NO];
    }

  [self->view setHidden:isViewHidden];
  [self->window setExcludedFromWindowsMenu:NO];

  /*
   * After hiding we cease to be first responder.
   */
  [self->window makeFirstResponder: self->view];

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_osx_hide (ClutterStageWindow *stage_window)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  CLUTTER_OSX_POOL_ALLOC();

  CLUTTER_NOTE (BACKEND, "[%p] hide", self);

  self->isHiding = true;
  [self->window orderOut: nil];
  [self->window setExcludedFromWindowsMenu:YES];

  clutter_actor_unmap (CLUTTER_ACTOR (self->wrapper));

  self->isHiding = false;

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_osx_get_geometry (ClutterStageWindow    *stage_window,
                                cairo_rectangle_int_t *geometry)
{
  ClutterBackend *backend = clutter_get_default_backend ();
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  g_return_if_fail (CLUTTER_IS_BACKEND_OSX (backend));

  geometry->width = self->requisition_width;
  geometry->height = self->requisition_height;
}

static void
clutter_stage_osx_resize (ClutterStageWindow *stage_window,
                          gint                width,
                          gint                height)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);
  ClutterActor *actor = clutter_stage_osx_get_wrapper (stage_window);
  guint min_width, min_height;
  NSSize size;

  CLUTTER_OSX_POOL_ALLOC ();

  clutter_stage_get_minimum_size (CLUTTER_STAGE (actor),
                                  &min_width,
                                  &min_height);

  [self->window setContentMinSize: NSMakeSize (min_width, min_height)];
  
  width = width < min_width ? min_width : width;
  height = height < min_height ? min_height : height;

  self->requisition_width = width;
  self->requisition_height = height;

  size = NSMakeSize (self->requisition_width, self->requisition_height);
  [self->window setContentSize: size];

  CLUTTER_OSX_POOL_RELEASE ();
}

/*************************************************************************/
static ClutterActor *
clutter_stage_osx_get_wrapper (ClutterStageWindow *stage_window)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  return CLUTTER_ACTOR (self->wrapper);
}

static void
clutter_stage_osx_set_title (ClutterStageWindow *stage_window,
                             const char         *title)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  CLUTTER_OSX_POOL_ALLOC();

  CLUTTER_NOTE (BACKEND, "[%p] set_title: %s", self, title);

  [self->window setTitle:[NSString stringWithUTF8String: title ? title : ""]];

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_osx_set_fullscreen (ClutterStageWindow *stage_window,
                                  gboolean            fullscreen)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  CLUTTER_OSX_POOL_ALLOC();

  CLUTTER_NOTE (BACKEND, "[%p] set_fullscreen: %u", self, fullscreen);

  /* Make sure to update the state before clutter_stage_osx_set_frame.
   *
   * Toggling fullscreen isn't atomic, there's two "events" involved:
   *  - stage state change (via state_update)
   *  - stage size change (via set_frame -> setFrameSize / set_size)
   *
   * We do state change first. Not sure there's any difference.
   */
  if (fullscreen)
    {
      _clutter_stage_update_state (CLUTTER_STAGE (self->wrapper),
                                   0,
                                   CLUTTER_STAGE_STATE_FULLSCREEN);
      clutter_stage_osx_save_frame (self);
    }
  else
    {
      _clutter_stage_update_state (CLUTTER_STAGE (self->wrapper),
                                   CLUTTER_STAGE_STATE_FULLSCREEN,
                                   0);
    }

  clutter_stage_osx_set_frame (self);

  CLUTTER_OSX_POOL_RELEASE();
}
static void
clutter_stage_osx_set_cursor_visible (ClutterStageWindow *stage_window,
                                      gboolean            cursor_visible)
{
  CLUTTER_OSX_POOL_ALLOC();

  if (cursor_visible)
    [NSCursor unhide];
  else
    [NSCursor hide];

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_osx_set_user_resizable (ClutterStageWindow *stage_window,
                                      gboolean            is_resizable)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  CLUTTER_OSX_POOL_ALLOC();

  [self->window setShowsResizeIndicator:is_resizable];

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_osx_set_accept_focus (ClutterStageWindow *stage_window,
                                    gboolean            accept_focus)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

  CLUTTER_OSX_POOL_ALLOC();

  self->acceptFocus = !!accept_focus;

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_osx_redraw (ClutterStageWindow *stage_window)
{
  ClutterStageOSX *stage_osx = CLUTTER_STAGE_OSX (stage_window);

  CLUTTER_OSX_POOL_ALLOC();

  if (stage_osx->view != NULL)
    [stage_osx->view setNeedsDisplay: YES];

  CLUTTER_OSX_POOL_RELEASE();
}

static void
clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
{
  iface->get_wrapper    = clutter_stage_osx_get_wrapper;
  iface->set_title      = clutter_stage_osx_set_title;
  iface->set_fullscreen = clutter_stage_osx_set_fullscreen;
  iface->show           = clutter_stage_osx_show;
  iface->hide           = clutter_stage_osx_hide;
  iface->realize        = clutter_stage_osx_realize;
  iface->unrealize      = clutter_stage_osx_unrealize;
  iface->get_geometry   = clutter_stage_osx_get_geometry;
  iface->resize         = clutter_stage_osx_resize;
  iface->set_cursor_visible = clutter_stage_osx_set_cursor_visible;
  iface->set_user_resizable = clutter_stage_osx_set_user_resizable;
  iface->set_accept_focus   = clutter_stage_osx_set_accept_focus;
  iface->redraw             = clutter_stage_osx_redraw;
}

/*************************************************************************/
static void
clutter_stage_osx_init (ClutterStageOSX *self)
{
  self->requisition_width  = 640;
  self->requisition_height = 480;
  self->acceptFocus = TRUE;

  self->isHiding = false;
  self->haveRealized = false;
  self->view = NULL;
  self->window = NULL;
}

static void
clutter_stage_osx_set_property (GObject      *gobject,
                                guint         prop_id,
                                const GValue *value,
                                GParamSpec   *pspec)
{
  ClutterStageOSX *self = CLUTTER_STAGE_OSX (gobject);

  switch (prop_id)
    {
    case PROP_BACKEND:
      self->backend = g_value_get_object (value);
      break;

    case PROP_WRAPPER:
      self->wrapper = g_value_get_object (value);
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
      break;
    }
}

static void
clutter_stage_osx_finalize (GObject *gobject)
{
  G_OBJECT_CLASS (clutter_stage_osx_parent_class)->finalize (gobject);
}

static void
clutter_stage_osx_dispose (GObject *gobject)
{
  G_OBJECT_CLASS (clutter_stage_osx_parent_class)->dispose (gobject);
}

static void
clutter_stage_osx_class_init (ClutterStageOSXClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->set_property = clutter_stage_osx_set_property;
  gobject_class->finalize = clutter_stage_osx_finalize;
  gobject_class->dispose = clutter_stage_osx_dispose;

  g_object_class_override_property (gobject_class, PROP_BACKEND, "backend");
  g_object_class_override_property (gobject_class, PROP_WRAPPER, "wrapper");
}