x11: Clean up TexturePixmap header and private data structure
Align the header file and use bitfields instead of booleans.
This commit is contained in:
parent
0e80747a68
commit
8538e1bf58
@ -73,6 +73,7 @@ enum
|
||||
{
|
||||
UPDATE_AREA,
|
||||
QUEUE_DAMAGE_REDRAW,
|
||||
|
||||
/* FIXME: Pixmap lost signal? */
|
||||
LAST_SIGNAL
|
||||
};
|
||||
@ -100,23 +101,22 @@ struct _ClutterX11TexturePixmapPrivate
|
||||
guint pixmap_width, pixmap_height;
|
||||
guint depth;
|
||||
|
||||
gboolean automatic_updates;
|
||||
Damage damage;
|
||||
|
||||
/* FIXME: lots of gbooleans. coalesce into bitfields */
|
||||
gboolean window_redirect_automatic;
|
||||
gboolean window_mapped;
|
||||
gboolean destroyed;
|
||||
gboolean owns_pixmap;
|
||||
gboolean override_redirect;
|
||||
gint window_x, window_y;
|
||||
|
||||
guint window_redirect_automatic : 1;
|
||||
guint window_mapped : 1;
|
||||
guint destroyed : 1;
|
||||
guint owns_pixmap : 1;
|
||||
guint override_redirect : 1;
|
||||
guint automatic_updates : 1;
|
||||
};
|
||||
|
||||
static int _damage_event_base = 0;
|
||||
|
||||
/* FIXME: Ultimatly with current cogl we should subclass clutter actor */
|
||||
G_DEFINE_TYPE (ClutterX11TexturePixmap, \
|
||||
clutter_x11_texture_pixmap, \
|
||||
G_DEFINE_TYPE (ClutterX11TexturePixmap,
|
||||
clutter_x11_texture_pixmap,
|
||||
CLUTTER_TYPE_TEXTURE);
|
||||
|
||||
static gboolean
|
||||
@ -1161,6 +1161,7 @@ clutter_x11_texture_pixmap_set_automatic (ClutterX11TexturePixmap *texture,
|
||||
|
||||
priv = texture->priv;
|
||||
|
||||
setting = !!setting;
|
||||
if (setting == priv->automatic_updates)
|
||||
return;
|
||||
|
||||
@ -1173,4 +1174,3 @@ clutter_x11_texture_pixmap_set_automatic (ClutterX11TexturePixmap *texture,
|
||||
|
||||
priv->automatic_updates = setting;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
@ -44,27 +45,6 @@ typedef struct _ClutterX11TexturePixmap ClutterX11TexturePixmap;
|
||||
typedef struct _ClutterX11TexturePixmapClass ClutterX11TexturePixmapClass;
|
||||
typedef struct _ClutterX11TexturePixmapPrivate ClutterX11TexturePixmapPrivate;
|
||||
|
||||
/**
|
||||
* ClutterX11TexturePixmapClass:
|
||||
* @update_area: virtual function for updating the area of the texture
|
||||
*
|
||||
* The #ClutterX11TexturePixmapClass structure contains only private data
|
||||
*
|
||||
* Since: 0.8
|
||||
*/
|
||||
struct _ClutterX11TexturePixmapClass
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterTextureClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
void (*update_area) (ClutterX11TexturePixmap *texture,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterX11TexturePixmap:
|
||||
*
|
||||
@ -80,30 +60,48 @@ struct _ClutterX11TexturePixmap
|
||||
ClutterX11TexturePixmapPrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterX11TexturePixmapClass:
|
||||
* @update_area: virtual function for updating the area of the texture
|
||||
*
|
||||
* The #ClutterX11TexturePixmapClass structure contains only private data
|
||||
*
|
||||
* Since: 0.8
|
||||
*/
|
||||
struct _ClutterX11TexturePixmapClass
|
||||
{
|
||||
/*< private >*/
|
||||
ClutterTextureClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
void (* update_area) (ClutterX11TexturePixmap *texture,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
};
|
||||
|
||||
GType clutter_x11_texture_pixmap_get_type (void) G_GNUC_CONST;
|
||||
ClutterActor * clutter_x11_texture_pixmap_new (void);
|
||||
|
||||
ClutterActor * clutter_x11_texture_pixmap_new_with_pixmap (Pixmap pixmap);
|
||||
|
||||
ClutterActor * clutter_x11_texture_pixmap_new_with_window (Window window);
|
||||
ClutterActor *clutter_x11_texture_pixmap_new (void);
|
||||
ClutterActor *clutter_x11_texture_pixmap_new_with_pixmap (Pixmap pixmap);
|
||||
ClutterActor *clutter_x11_texture_pixmap_new_with_window (Window window);
|
||||
|
||||
void clutter_x11_texture_pixmap_set_automatic (ClutterX11TexturePixmap *texture,
|
||||
gboolean setting);
|
||||
void clutter_x11_texture_pixmap_set_pixmap (ClutterX11TexturePixmap *texture,
|
||||
Pixmap pixmap);
|
||||
|
||||
void clutter_x11_texture_pixmap_set_window (ClutterX11TexturePixmap *texture,
|
||||
Window window,
|
||||
gboolean automatic);
|
||||
void clutter_x11_texture_pixmap_sync_window (ClutterX11TexturePixmap *texture);
|
||||
|
||||
void clutter_x11_texture_pixmap_sync_window (ClutterX11TexturePixmap *texture);
|
||||
void clutter_x11_texture_pixmap_update_area (ClutterX11TexturePixmap *texture,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
void clutter_x11_texture_pixmap_set_automatic (ClutterX11TexturePixmap *texture,
|
||||
gboolean setting);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user