$(srcdir)/osx/clutter-backend-osx.h \
$(srcdir)/osx/clutter-event-loop-osx.h \
$(srcdir)/osx/clutter-stage-osx.h \
+ $(srcdir)/osx/clutter-device-manager-osx.h \
$(NULL)
osx_source_c_priv = \
$(srcdir)/osx/clutter-event-loop-osx.c \
$(srcdir)/osx/clutter-event-osx.c \
+ $(srcdir)/osx/clutter-device-manager-osx.c \
$(NULL)
if SUPPORT_OSX
*
* Copyright (C) 2007-2008 Tommi Komulainen <tommi.komulainen@iki.fi>
* Copyright (C) 2007 OpenedHand Ltd.
+ * Copyright (C) 2011 Crystalnix <vgachkaylo@crystalnix.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
return;
backend_osx->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_OSX,
- "backend", backend,
+ "backend", CLUTTER_BACKEND(backend_osx),
NULL);
}
*
* Copyright (C) 2007 Tommi Komulainen <tommi.komulainen@iki.fi>
* Copyright (C) 2007 OpenedHand Ltd.
+ * Copyright (C) 2011 Crystalnix <vgachkaylo@crystalnix.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#define __CLUTTER_BACKEND_OSX_H__
#include "clutter-backend-private.h"
+#include "clutter-device-manager.h"
@class NSOpenGLPixelFormat, NSOpenGLContext;
{
ClutterBackend parent;
- NSOpenGLPixelFormat *pixel_format;
- NSOpenGLContext *context;
+ NSOpenGLPixelFormat *pixel_format;
+ NSOpenGLContext *context;
+ ClutterDeviceManager *device_manager;
};
struct _ClutterBackendOSXClass
{
ClutterDeviceManager parent_instance;
+ GSList *devices;
+
ClutterInputDevice *core_pointer;
ClutterInputDevice *core_keyboard;
};
#include "clutter-stage-osx.h"
#import <AppKit/AppKit.h>
-#include <glib/gmain.h>
+#include <glib.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/uio.h>
stage_osx = CLUTTER_STAGE_OSX (impl);
manager_osx = CLUTTER_DEVICE_MANAGER_OSX (clutter_device_manager_get_default ());
+ event->any.time = [nsevent clutterTime];
+
switch ([nsevent type])
{
case NSLeftMouseDown:
[nsevent clutterX:&(event->crossing.x) y:&(event->crossing.y)];
event->crossing.related = NULL;
- event->crossing.actor = CLUTTER_ACTOR (stage);
+ event->crossing.source = CLUTTER_ACTOR (stage);
clutter_event_set_device (event, manager_osx->core_pointer);
_clutter_stage_add_device (stage, manager_osx->core_pointer);
[nsevent clutterX:&(event->crossing.x) y:&(event->crossing.y)];
event->crossing.related = NULL;
- event->crossing.actor = CLUTTER_ACTOR (stage);
+ event->crossing.source = CLUTTER_ACTOR (stage);
clutter_event_set_device (event, manager_osx->core_pointer);
_clutter_stage_remove_device (stage, manager_osx->core_pointer);
event->any.stage = wrapper;
event->any.time = [nsevent clutterTime];
- if (clutter_event_osx_translate (nsevent, &event))
+ if (clutter_event_osx_translate (nsevent, event))
{
- g_assert (event.type != CLUTTER_NOTHING);
+ g_assert (event->type != CLUTTER_NOTHING);
_clutter_event_push (event, FALSE);
}
*
* 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
@interface ClutterGLView : NSOpenGLView
{
ClutterStageOSX *stage_osx;
+ NSTrackingRectTag tracking_rect;
}
- (void) drawRect: (NSRect) bounds;
@end
if ((self = [super initWithFrame:aFrame pixelFormat:aFormat]) != nil)
{
self->stage_osx = aStage;
+ tracking_rect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO];
}
return self;
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);
+
+ [self removeTrackingRect:tracking_rect];
+ tracking_rect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NO];
}
/* Simply forward all events that reach our view to clutter. */