stage-window: Add scaling factor accessors

We'll need to set and get the scaling factor of a ClutterStage from its
StageWindow implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=705915
This commit is contained in:
Emmanuele Bassi 2013-08-14 11:17:09 +01:00
parent 5c44a5e6f4
commit b9072a5e21
2 changed files with 35 additions and 0 deletions

View File

@ -333,3 +333,30 @@ _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
return FALSE;
}
void
_clutter_stage_window_set_scale_factor (ClutterStageWindow *window,
int factor)
{
ClutterStageWindowIface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_scale_factor != NULL)
iface->set_scale_factor (window, factor);
}
int
_clutter_stage_window_get_scale_factor (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 1);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->get_scale_factor != NULL)
return iface->get_scale_factor (window);
return 1;
}

View File

@ -84,6 +84,10 @@ struct _ClutterStageWindowIface
CoglFramebuffer *(* get_active_framebuffer) (ClutterStageWindow *stage_window);
gboolean (* can_clip_redraws) (ClutterStageWindow *stage_window);
void (* set_scale_factor) (ClutterStageWindow *stage_window,
int factor);
int (* get_scale_factor) (ClutterStageWindow *stage_window);
};
GType _clutter_stage_window_get_type (void) G_GNUC_CONST;
@ -137,6 +141,10 @@ CoglFramebuffer *_clutter_stage_window_get_active_framebuffer (ClutterStageWin
gboolean _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window);
void _clutter_stage_window_set_scale_factor (ClutterStageWindow *window,
int factor);
int _clutter_stage_window_get_scale_factor (ClutterStageWindow *window);
G_END_DECLS
#endif /* __CLUTTER_STAGE_WINDOW_H__ */