#endif
backend_osx->pixel_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
- backend_osx->context = [[NSOpenGLContext alloc]
- initWithFormat: backend_osx->pixel_format
- shareContext: nil];
+
+ backend_osx->context = [[NSOpenGLContext alloc] initWithFormat: backend_osx->pixel_format
+ shareContext: nil];
+
/* Enable vblank sync - http://developer.apple.com/qa/qa2007/qa1521.html */
[backend_osx->context setValues:&sw forParameter: NSOpenGLCPSwapInterval];
+
+ CLUTTER_NOTE (BACKEND, "Context was created");
}
[backend_osx->context makeCurrentContext];
- CLUTTER_NOTE (BACKEND, "Context was created");
-
CLUTTER_OSX_POOL_RELEASE();
return TRUE;
if ((self = [super initWithFrame:aFrame pixelFormat:aFormat]) != nil)
{
self->stage_osx = aStage;
- tracking_rect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO];
+ tracking_rect = [self addTrackingRect:[self bounds]
+ owner:self
+ userData:NULL
+ assumeInside:NO];
}
return self;
return YES;
}
+- (BOOL) isOpaque
+{
+ if (clutter_stage_get_use_alpha (CLUTTER_STAGE (self->stage_osx->wrapper)))
+ return NO;
+
+ return YES;
+}
+
- (void) reshape
{
stage_osx->requisition_width = [self bounds].size.width;
stage_osx->requisition_height = [self bounds].size.height;
clutter_actor_set_size (CLUTTER_ACTOR (self->stage_osx->wrapper),
- (int)[self bounds].size.width, (int)[self bounds].size.height);
+ (int)[self bounds].size.width,
+ (int)[self bounds].size.height);
[self removeTrackingRect:tracking_rect];
- tracking_rect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO];
+ tracking_rect = [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 { \
+#define EVENT_HANDLER(event) \
+-(void)event:(NSEvent *) theEvent { \
_clutter_event_osx_put (theEvent, self->stage_osx->wrapper); \
}
+
EVENT_HANDLER(mouseDown)
EVENT_HANDLER(mouseDragged)
EVENT_HANDLER(mouseUp)
*/
[self->window setLevel: CLUTTER_OSX_FULLSCREEN_WINDOW_LEVEL];
- [self->window setFrame: [self->window frameRectForContentRect: [[self->window screen] frame]] display: NO];
+ [self->window setFrame: [self->window frameRectForContentRect: [[self->window screen] frame]]
+ display: NO];
}
else
{
if (self->haveNormalFrame)
[self->window setFrame: self->normalFrame display: NO];
else
- /* looks better than positioning to 0,0 (bottom right) */
- [self->window center];
+ {
+ /* looks better than positioning to 0,0 (bottom right) */
+ [self->window center];
+ }
}
}
CLUTTER_NOTE (BACKEND, "[%p] realize", self);
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
*/
clutter_actor_get_size (CLUTTER_ACTOR (self->wrapper), &width, &height);
self->requisition_width = width;
- self->requisition_height= height;
+ self->requisition_height = height;
rect = NSMakeRect(0, 0, self->requisition_width, self->requisition_height);
initWithFrame: rect
pixelFormat: backend_osx->pixel_format
stage: self];
- [self->view setOpenGLContext:backend_osx->context];
+ [self->view setOpenGLContext: backend_osx->context];
self->window = [[ClutterGLWindow alloc]
initWithView: self->view
clutter_stage_get_minimum_size (CLUTTER_STAGE (actor),
&min_width,
&min_height);
- [self->window setContentMinSize:NSMakeSize(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;