display-config: Expose the supported scales as a reffed GArray

It's just a nicer api and allows us to avoid having to count all the
elements around or to expose the size via an out value.

Given this is a private API anyway there's no risk for modifying the
array, so it's something safe to use anyways.
This commit is contained in:
Marco Trevisan (Treviño) 2021-05-28 23:11:57 +02:00 committed by Georges Basile Stavracas Neto
parent 89cb1d99cb
commit a3392176a9
4 changed files with 16 additions and 13 deletions

View file

@ -78,7 +78,7 @@ struct _CcDisplayModeClass
GObjectClass parent_class;
void (*get_resolution) (CcDisplayMode *self, int *w, int *h);
const double* (*get_supported_scales) (CcDisplayMode *self);
GArray* (*get_supported_scales) (CcDisplayMode *self);
double (*get_preferred_scale) (CcDisplayMode *self);
gboolean (*is_interlaced) (CcDisplayMode *self);
int (*get_freq) (CcDisplayMode *self);
@ -244,7 +244,7 @@ char* cc_display_monitor_dup_ui_number_name (CcDisplayMonitor *
void cc_display_mode_get_resolution (CcDisplayMode *mode,
int *width,
int *height);
const double* cc_display_mode_get_supported_scales (CcDisplayMode *self);
GArray* cc_display_mode_get_supported_scales (CcDisplayMode *self);
double cc_display_mode_get_preferred_scale (CcDisplayMode *self);
gboolean cc_display_mode_is_interlaced (CcDisplayMode *mode);
int cc_display_mode_get_freq (CcDisplayMode *mode);