mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
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:
parent
5c44a5e6f4
commit
b9072a5e21
@ -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;
|
||||
}
|
||||
|
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user