backends: Get rid of meta-cursor-private.h

There is nothing special about the private API which only consists of
getters for renderer specific backing buffer. Lets them to the regular
.h file and treat them as part of the normal API.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
This commit is contained in:
Jonas Ådahl 2015-03-10 14:41:12 +08:00
parent 68279e8a08
commit 165050f8f9
8 changed files with 37 additions and 74 deletions

View File

@ -68,7 +68,6 @@ libmutter_la_SOURCES = \
backends/meta-barrier-private.h \ backends/meta-barrier-private.h \
backends/meta-cursor.c \ backends/meta-cursor.c \
backends/meta-cursor.h \ backends/meta-cursor.h \
backends/meta-cursor-private.h \
backends/meta-cursor-tracker.c \ backends/meta-cursor-tracker.c \
backends/meta-cursor-tracker-private.h \ backends/meta-cursor-tracker-private.h \
backends/meta-cursor-renderer.c \ backends/meta-cursor-renderer.c \

View File

@ -1,68 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright 2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Giovanni Campagna <gcampagn@redhat.com>
*/
#ifndef META_CURSOR_PRIVATE_H
#define META_CURSOR_PRIVATE_H
#include "meta-cursor.h"
#include <X11/Xcursor/Xcursor.h>
#include <cogl/cogl.h>
#ifdef HAVE_NATIVE_BACKEND
#include <gbm.h>
#endif
typedef struct
{
CoglTexture2D *texture;
int hot_x, hot_y;
#ifdef HAVE_NATIVE_BACKEND
struct gbm_bo *bo;
#endif
} MetaCursorImage;
struct _MetaCursorSprite
{
GObject parent;
int current_frame;
XcursorImages *xcursor_images;
MetaCursor cursor;
MetaCursorImage image;
};
CoglTexture *meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *self,
int *hot_x,
int *hot_y);
#ifdef HAVE_NATIVE_BACKEND
struct gbm_bo *meta_cursor_sprite_get_gbm_bo (MetaCursorSprite *self,
int *hot_x,
int *hot_y);
#endif
gboolean meta_cursor_sprite_is_animated (MetaCursorSprite *self);
void meta_cursor_sprite_tick_frame (MetaCursorSprite *self);
guint meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *self);
#endif /* META_CURSOR_PRIVATE_H */

View File

@ -25,7 +25,6 @@
#include "config.h" #include "config.h"
#include "meta-cursor-renderer.h" #include "meta-cursor-renderer.h"
#include "meta-cursor-private.h"
#include <meta/meta-backend.h> #include <meta/meta-backend.h>
#include <meta/util.h> #include <meta/util.h>

View File

@ -43,7 +43,6 @@
#include <X11/extensions/Xfixes.h> #include <X11/extensions/Xfixes.h>
#include "meta-backend-private.h" #include "meta-backend-private.h"
#include "meta-cursor-private.h"
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT); G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);

View File

@ -21,7 +21,7 @@
#include "config.h" #include "config.h"
#include "meta-cursor-private.h" #include "meta-cursor.h"
#include <meta/errors.h> #include <meta/errors.h>
@ -30,6 +30,7 @@
#include "meta-backend-private.h" #include "meta-backend-private.h"
#ifdef HAVE_NATIVE_BACKEND #ifdef HAVE_NATIVE_BACKEND
#include <gbm.h>
#include "backends/native/meta-cursor-renderer-native.h" #include "backends/native/meta-cursor-renderer-native.h"
#endif #endif
@ -43,6 +44,27 @@
#include <cogl/cogl-wayland-server.h> #include <cogl/cogl-wayland-server.h>
#endif #endif
typedef struct
{
CoglTexture2D *texture;
int hot_x, hot_y;
#ifdef HAVE_NATIVE_BACKEND
struct gbm_bo *bo;
#endif
} MetaCursorImage;
struct _MetaCursorSprite
{
GObject parent;
MetaCursor cursor;
MetaCursorImage image;
int current_frame;
XcursorImages *xcursor_images;
};
GType meta_cursor_sprite_get_type (void) G_GNUC_CONST; GType meta_cursor_sprite_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (MetaCursorSprite, meta_cursor_sprite, G_TYPE_OBJECT) G_DEFINE_TYPE (MetaCursorSprite, meta_cursor_sprite, G_TYPE_OBJECT)

View File

@ -50,4 +50,18 @@ MetaCursorSprite * meta_cursor_sprite_from_texture (CoglTexture2D *texture,
Cursor meta_cursor_create_x_cursor (Display *xdisplay, Cursor meta_cursor_create_x_cursor (Display *xdisplay,
MetaCursor cursor); MetaCursor cursor);
CoglTexture *meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *self,
int *hot_x,
int *hot_y);
#ifdef HAVE_NATIVE_BACKEND
struct gbm_bo *meta_cursor_sprite_get_gbm_bo (MetaCursorSprite *self,
int *hot_x,
int *hot_y);
#endif
gboolean meta_cursor_sprite_is_animated (MetaCursorSprite *self);
void meta_cursor_sprite_tick_frame (MetaCursorSprite *self);
guint meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *self);
#endif /* META_CURSOR_H */ #endif /* META_CURSOR_H */

View File

@ -24,7 +24,6 @@
#include "meta-stage.h" #include "meta-stage.h"
#include "meta-cursor-private.h"
#include <meta/meta-backend.h> #include <meta/meta-backend.h>
#include <meta/util.h> #include <meta/util.h>

View File

@ -29,7 +29,6 @@
#include <gbm.h> #include <gbm.h>
#include <xf86drm.h> #include <xf86drm.h>
#include "meta-cursor-private.h"
#include "meta-monitor-manager-private.h" #include "meta-monitor-manager-private.h"
#ifndef DRM_CAP_CURSOR_WIDTH #ifndef DRM_CAP_CURSOR_WIDTH