2007-10-12 04:17:00 -04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2007-07-06 09:56:01 -04:00
|
|
|
#include "config.h"
|
2007-10-12 04:17:00 -04:00
|
|
|
#endif
|
2007-07-06 09:56:01 -04:00
|
|
|
|
|
|
|
#include "clutter-stage-egl.h"
|
|
|
|
#include "clutter-egl.h"
|
2008-04-25 09:37:36 -04:00
|
|
|
#include "clutter-backend-egl.h"
|
2007-07-06 09:56:01 -04:00
|
|
|
|
|
|
|
#include "../clutter-main.h"
|
|
|
|
#include "../clutter-feature.h"
|
|
|
|
#include "../clutter-color.h"
|
|
|
|
#include "../clutter-util.h"
|
|
|
|
#include "../clutter-event.h"
|
|
|
|
#include "../clutter-enum-types.h"
|
|
|
|
#include "../clutter-private.h"
|
|
|
|
#include "../clutter-debug.h"
|
|
|
|
#include "../clutter-units.h"
|
2008-04-23 13:20:59 -04:00
|
|
|
#include "../clutter-stage.h"
|
|
|
|
#include "../clutter-stage-window.h"
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
|
|
|
|
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (ClutterStageEGL,
|
|
|
|
clutter_stage_egl,
|
2010-02-27 04:42:42 -05:00
|
|
|
G_TYPE_OBJECT,
|
2008-04-23 13:20:59 -04:00
|
|
|
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
|
|
|
|
clutter_stage_window_iface_init));
|
2007-07-06 09:56:01 -04:00
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_class_init (ClutterStageEGLClass *klass)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_set_fullscreen (ClutterStageWindow *stage_window,
|
|
|
|
gboolean fullscreen)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
g_warning ("Stage of type '%s' do not support ClutterStage::set_fullscreen",
|
|
|
|
G_OBJECT_TYPE_NAME (stage_window));
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_set_title (ClutterStageWindow *stage_window,
|
|
|
|
const gchar *title)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
g_warning ("Stage of type '%s' do not support ClutterStage::set_title",
|
|
|
|
G_OBJECT_TYPE_NAME (stage_window));
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_set_cursor_visible (ClutterStageWindow *stage_window,
|
|
|
|
gboolean cursor_visible)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
g_warning ("Stage of type '%s' do not support ClutterStage::set_cursor_visible",
|
|
|
|
G_OBJECT_TYPE_NAME (stage_window));
|
|
|
|
}
|
2009-07-31 13:34:51 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
static ClutterActor *
|
|
|
|
clutter_stage_egl_get_wrapper (ClutterStageWindow *stage_window)
|
|
|
|
{
|
|
|
|
return CLUTTER_ACTOR (CLUTTER_STAGE_EGL (stage_window)->wrapper);
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_show (ClutterStageWindow *stage_window,
|
|
|
|
gboolean do_raise)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (stage_window);
|
2008-06-11 06:19:02 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_actor_map (CLUTTER_ACTOR (stage_egl->wrapper));
|
2008-06-11 06:19:02 -04:00
|
|
|
}
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_hide (ClutterStageWindow *stage_window)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (stage_window);
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_actor_unmap (CLUTTER_ACTOR (stage_egl->wrapper));
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_unrealize (ClutterStageWindow *stage_window)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
}
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
static gboolean
|
|
|
|
clutter_stage_egl_realize (ClutterStageWindow *stage_window)
|
|
|
|
{
|
|
|
|
/* the EGL surface is created by the backend */
|
|
|
|
return TRUE;
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_get_geometry (ClutterStageWindow *stage_window,
|
|
|
|
ClutterGeometry *geometry)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (stage_window);
|
|
|
|
ClutterBackendEGL *backend_egl = stage_egl->backend;
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
if (geometry)
|
|
|
|
{
|
|
|
|
geometry->x = geometry->y = 0;
|
2008-04-23 13:20:59 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
geometry->width = backend_egl->surface_width;
|
|
|
|
geometry->height = backend_egl->surface_height;
|
|
|
|
}
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_stage_egl_resize (ClutterStageWindow *stage_window,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2008-04-25 09:37:36 -04:00
|
|
|
}
|
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
static void
|
|
|
|
clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
|
|
|
|
{
|
|
|
|
iface->set_fullscreen = clutter_stage_egl_set_fullscreen;
|
2010-02-27 04:42:42 -05:00
|
|
|
iface->set_title = clutter_stage_egl_set_title;
|
|
|
|
iface->set_cursor_visible = clutter_stage_egl_set_cursor_visible;
|
2008-04-25 09:37:36 -04:00
|
|
|
iface->get_wrapper = clutter_stage_egl_get_wrapper;
|
2010-02-27 04:42:42 -05:00
|
|
|
iface->realize = clutter_stage_egl_realize;
|
|
|
|
iface->unrealize = clutter_stage_egl_unrealize;
|
|
|
|
iface->get_geometry = clutter_stage_egl_get_geometry;
|
|
|
|
iface->resize = clutter_stage_egl_resize;
|
2008-04-23 13:20:59 -04:00
|
|
|
}
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
static void
|
|
|
|
clutter_stage_egl_init (ClutterStageEGL *stage)
|
|
|
|
{
|
|
|
|
}
|