mirror of
https://github.com/brl/mutter.git
synced 2024-12-28 13:52:15 +00:00
6988744db7
Instead of using ClutterActor for the base class of the Stage implementation we should extend the StageWindow interface with the required bits (geometry, realization) and use a simple object class. This require a wee bit of changes across Backend, Stage and StageWindow, even though it's mostly re-shuffling. First of all, StageWindow should get new virtual functions: * geometry: - resize() - get_geometry() * realization - realize() - unrealize() This covers all the bits that we use from ClutterActor currently inside the stage implementations. The ClutterBackend::create_stage() virtual function should create a StageWindow, and not an Actor (it should always have been; the fact that it returned an Actor was a leak of the black magic going on underneath). Since we never guaranteed ABI compatibility for the Backend class, this is not a problem. Internally to ClutterStage we can finally drop the shenanigans of setting/unsetting actor flags on the implementation: if the realization succeeds, for instance, we set the REALIZED flag on the Stage and we're done. As an initial proof of concept, the X11 and GLX stage implementations have been ported to the New World Order(tm) and show no regressions.
74 lines
3.8 KiB
C
74 lines
3.8 KiB
C
#ifndef __CLUTTER_STAGE_WINDOW_H__
|
|
#define __CLUTTER_STAGE_WINDOW_H__
|
|
|
|
#include <clutter/clutter-actor.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define CLUTTER_TYPE_STAGE_WINDOW (clutter_stage_window_get_type ())
|
|
#define CLUTTER_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindow))
|
|
#define CLUTTER_IS_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_WINDOW))
|
|
#define CLUTTER_STAGE_WINDOW_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindowIface))
|
|
|
|
typedef struct _ClutterStageWindow ClutterStageWindow; /* dummy */
|
|
typedef struct _ClutterStageWindowIface ClutterStageWindowIface;
|
|
|
|
struct _ClutterStageWindowIface
|
|
{
|
|
GTypeInterface parent_iface;
|
|
|
|
ClutterActor *(* get_wrapper) (ClutterStageWindow *stage_window);
|
|
|
|
void (* set_title) (ClutterStageWindow *stage_window,
|
|
const gchar *title);
|
|
void (* set_fullscreen) (ClutterStageWindow *stage_window,
|
|
gboolean is_fullscreen);
|
|
void (* set_cursor_visible) (ClutterStageWindow *stage_window,
|
|
gboolean cursor_visible);
|
|
void (* set_user_resizable) (ClutterStageWindow *stage_window,
|
|
gboolean is_resizable);
|
|
|
|
gboolean (* realize) (ClutterStageWindow *stage_window);
|
|
void (* unrealize) (ClutterStageWindow *stage_window);
|
|
|
|
void (* show) (ClutterStageWindow *stage_window,
|
|
gboolean do_raise);
|
|
void (* hide) (ClutterStageWindow *stage_window);
|
|
|
|
void (* resize) (ClutterStageWindow *stage_window,
|
|
gint width,
|
|
gint height);
|
|
void (* get_geometry) (ClutterStageWindow *stage_window,
|
|
ClutterGeometry *geometry);
|
|
};
|
|
|
|
GType clutter_stage_window_get_type (void) G_GNUC_CONST;
|
|
|
|
ClutterActor *_clutter_stage_window_get_wrapper (ClutterStageWindow *window);
|
|
|
|
void _clutter_stage_window_set_title (ClutterStageWindow *window,
|
|
const gchar *title);
|
|
void _clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
|
|
gboolean is_fullscreen);
|
|
void _clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
|
|
gboolean is_visible);
|
|
void _clutter_stage_window_set_user_resizable (ClutterStageWindow *window,
|
|
gboolean is_resizable);
|
|
|
|
gboolean _clutter_stage_window_realize (ClutterStageWindow *window);
|
|
void _clutter_stage_window_unrealize (ClutterStageWindow *window);
|
|
|
|
void _clutter_stage_window_show (ClutterStageWindow *window,
|
|
gboolean do_raise);
|
|
void _clutter_stage_window_hide (ClutterStageWindow *window);
|
|
|
|
void _clutter_stage_window_resize (ClutterStageWindow *window,
|
|
gint width,
|
|
gint height);
|
|
void _clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
|
ClutterGeometry *geometry);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __CLUTTER_STAGE_WINDOW_H__ */
|