Exemplo n.º 1
0
ClutterFeatureFlags
clutter_backend_win32_get_features (ClutterBackend *backend)
{
  ClutterBackendClass *parent_class;
  ClutterFeatureFlags flags;

  parent_class = CLUTTER_BACKEND_CLASS (clutter_backend_win32_parent_class);

  flags = CLUTTER_FEATURE_STAGE_USER_RESIZE | CLUTTER_FEATURE_STAGE_CURSOR;

  if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_MULTIPLE_ONSCREEN))
    {
      CLUTTER_NOTE (BACKEND, "Cogl supports multiple onscreen framebuffers");
      flags |= CLUTTER_FEATURE_STAGE_MULTIPLE;
    }
  else
    {
      CLUTTER_NOTE (BACKEND, "Cogl only supports one onscreen framebuffer");
      flags |= CLUTTER_FEATURE_STAGE_STATIC;
    }

  if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
    {
      CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
      flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
    }
  else
    CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");

  CLUTTER_NOTE (BACKEND, "backend features checked");

  return flags;
}
Exemplo n.º 2
0
static ClutterFeatureFlags
clutter_backend_x11_get_features (ClutterBackend *backend)
{
  ClutterFeatureFlags flags = CLUTTER_FEATURE_STAGE_USER_RESIZE
                            | CLUTTER_FEATURE_STAGE_CURSOR;

  flags |= CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->get_features (backend);

  return flags;
}
Exemplo n.º 3
0
ClutterFeatureFlags
clutter_backend_win32_get_features (ClutterBackend *backend)
{
  ClutterBackendClass *parent_class;

  parent_class = CLUTTER_BACKEND_CLASS (clutter_backend_win32_parent_class);

  return parent_class->get_features (backend)
    | CLUTTER_FEATURE_STAGE_USER_RESIZE
    | CLUTTER_FEATURE_STAGE_CURSOR;
}
Exemplo n.º 4
0
static void
clutter_backend_cex100_class_init (ClutterBackendCex100Class *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);

  gobject_class->dispose = clutter_backend_cex100_dispose;

  backend_class->stage_window_type = CLUTTER_TYPE_STAGE_COGL;

  backend_class->get_display = clutter_backend_cex100_get_display;
}
Exemplo n.º 5
0
static void
clutter_backend_wayland_class_init (ClutterBackendWaylandClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);

  gobject_class->dispose = clutter_backend_wayland_dispose;

  backend_class->stage_window_type = CLUTTER_TYPE_STAGE_WAYLAND;

  backend_class->post_parse = clutter_backend_wayland_post_parse;
  backend_class->get_renderer = clutter_backend_wayland_get_renderer;
  backend_class->get_display = clutter_backend_wayland_get_display;
}
static void
clutter_backend_win32_class_init (ClutterBackendWin32Class *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);

  gobject_class->constructor = clutter_backend_win32_constructor;
  gobject_class->dispose = clutter_backend_win32_dispose;
  gobject_class->finalize = clutter_backend_win32_finalize;

  backend_class->stage_window_type = CLUTTER_TYPE_STAGE_WIN32;

  backend_class->init_events = clutter_backend_win32_init_events;
  backend_class->get_features = clutter_backend_win32_get_features;
}
Exemplo n.º 7
0
static gboolean
clutter_backend_x11_translate_event (ClutterBackend *backend,
                                     gpointer        native,
                                     ClutterEvent   *event)
{
  ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
  ClutterBackendClass *parent_class;
  XEvent *xevent = native;

  /* X11 filter functions have a higher priority */
  if (backend_x11->event_filters != NULL)
    {
      GSList *node = backend_x11->event_filters;

      while (node != NULL)
        {
          ClutterX11EventFilter *filter = node->data;

          switch (filter->func (xevent, event, filter->data))
            {
            case CLUTTER_X11_FILTER_CONTINUE:
              break;

            case CLUTTER_X11_FILTER_TRANSLATE:
              return TRUE;

            case CLUTTER_X11_FILTER_REMOVE:
              return FALSE;

            default:
              break;
            }

          node = node->next;
        }
    }

  /* we update the event time only for events that can
   * actually reach Clutter's event queue
   */
  update_last_event_time (backend_x11, xevent);

  /* chain up to the parent implementation, which will handle
   * event translators
   */
  parent_class = CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class);
  return parent_class->translate_event (backend, native, event);
}
Exemplo n.º 8
0
static void
clutter_backend_egl_class_init (ClutterBackendEGLClass *klass)
{
    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
    ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);

    gobject_class->constructor = clutter_backend_egl_constructor;
    gobject_class->dispose = clutter_backend_egl_dispose;
    gobject_class->finalize = clutter_backend_egl_finalize;

    backend_class->pre_parse        = clutter_backend_egl_pre_parse;
    backend_class->post_parse       = clutter_backend_egl_post_parse;
    backend_class->init_events      = clutter_backend_egl_init_events;
    backend_class->create_stage     = clutter_backend_egl_create_stage;
    backend_class->ensure_context   = clutter_backend_egl_ensure_context;
    backend_class->redraw           = clutter_backend_egl_redraw;
    backend_class->get_features     = clutter_backend_egl_get_features;
}
Exemplo n.º 9
0
static void
clutter_backend_win32_class_init (ClutterBackendWin32Class *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);

  gobject_class->constructor = clutter_backend_win32_constructor;
  gobject_class->dispose = clutter_backend_win32_dispose;
  gobject_class->finalize = clutter_backend_win32_finalize;

  backend_class->pre_parse        = clutter_backend_win32_pre_parse;
  backend_class->init_events      = clutter_backend_win32_init_events;
  backend_class->create_stage     = clutter_backend_win32_create_stage;
  backend_class->add_options      = clutter_backend_win32_add_options;
  backend_class->get_features     = clutter_backend_win32_get_features;
  backend_class->create_context   = clutter_backend_win32_create_context;
  backend_class->ensure_context   = clutter_backend_win32_ensure_context;
  backend_class->get_device_manager = clutter_backend_win32_get_device_manager;
}
static void
clutter_backend_gdk_class_init (ClutterBackendGdkClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);

  gobject_class->dispose = clutter_backend_gdk_dispose;
  gobject_class->finalize = clutter_backend_gdk_finalize;

  backend_class->stage_window_type = CLUTTER_TYPE_STAGE_GDK;

  backend_class->post_parse = _clutter_backend_gdk_post_parse;

  backend_class->get_features = clutter_backend_gdk_get_features;
  backend_class->copy_event_data = clutter_backend_gdk_copy_event_data;
  backend_class->free_event_data = clutter_backend_gdk_free_event_data;

  backend_class->get_renderer = clutter_backend_gdk_get_renderer;
  backend_class->get_display = clutter_backend_gdk_get_display;
}
Exemplo n.º 11
0
static void
clutter_backend_glx_class_init (ClutterBackendGLXClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);
  ClutterBackendX11Class *backendx11_class = CLUTTER_BACKEND_X11_CLASS (klass);

  gobject_class->constructor = clutter_backend_glx_constructor;
  gobject_class->dispose     = clutter_backend_glx_dispose;
  gobject_class->finalize    = clutter_backend_glx_finalize;

  backend_class->pre_parse      = clutter_backend_glx_pre_parse;
  backend_class->post_parse     = clutter_backend_glx_post_parse;
  backend_class->create_stage   = clutter_backend_glx_create_stage;
  backend_class->add_options    = clutter_backend_glx_add_options;
  backend_class->get_features   = clutter_backend_glx_get_features;
  backend_class->redraw         = clutter_backend_glx_redraw;
  backend_class->create_context = clutter_backend_glx_create_context;
  backend_class->ensure_context = clutter_backend_glx_ensure_context;

  backendx11_class->get_visual_info = clutter_backend_glx_get_visual_info;
}
Exemplo n.º 12
0
static gboolean
clutter_backend_glx_post_parse (ClutterBackend  *backend,
                                GError         **error)
{
  ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
  ClutterBackendGLX *backend_glx = CLUTTER_BACKEND_GLX (backend);
  ClutterBackendClass *backend_class =
    CLUTTER_BACKEND_CLASS (clutter_backend_glx_parent_class);
  int glx_major, glx_minor;

  if (!backend_class->post_parse (backend, error))
    return FALSE;

  if (!glXQueryExtension (backend_x11->xdpy,
                          &backend_glx->error_base,
                          &backend_glx->event_base))
    {
      g_set_error (error, CLUTTER_INIT_ERROR,
                   CLUTTER_INIT_ERROR_BACKEND,
                   "XServer appears to lack required GLX support");

      return FALSE;
    }

  /* XXX: Technically we should require >= GLX 1.3 support but for a long
   * time Mesa has exported a hybrid GLX, exporting extensions specified
   * to require GLX 1.3, but still reporting 1.2 via glXQueryVersion. */
  if (!glXQueryVersion (backend_x11->xdpy, &glx_major, &glx_minor)
      || !(glx_major == 1 && glx_minor >= 2))
    {
      g_set_error (error, CLUTTER_INIT_ERROR,
                   CLUTTER_INIT_ERROR_BACKEND,
                   "XServer appears to lack required GLX 1.2 support");
      return FALSE;
    }

  return TRUE;
}
Exemplo n.º 13
0
static void
clutter_backend_x11_class_init (ClutterBackendX11Class *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);

  gobject_class->dispose = clutter_backend_x11_dispose;
  gobject_class->finalize = clutter_backend_x11_finalize;

  backend_class->stage_window_type = CLUTTER_TYPE_STAGE_X11;

  backend_class->pre_parse = clutter_backend_x11_pre_parse;
  backend_class->post_parse = clutter_backend_x11_post_parse;
  backend_class->add_options = clutter_backend_x11_add_options;
  backend_class->get_features = clutter_backend_x11_get_features;

  backend_class->translate_event = clutter_backend_x11_translate_event;

  backend_class->get_renderer = clutter_backend_x11_get_renderer;
  backend_class->get_display = clutter_backend_x11_get_display;
  backend_class->create_stage = clutter_backend_x11_create_stage;

  backend_class->get_keymap_direction = clutter_backend_x11_get_keymap_direction;
}