1
0
Fork 0

settings: Clean up property installation code

Use g_object_class_install_properties().

http://bugzilla.clutter-project.org/show_bug.cgi?id=2583
This commit is contained in:
Emmanuele Bassi 2011-02-28 16:40:07 +00:00
parent ed27da6abe
commit 6d653fb6dd

View file

@ -310,12 +310,6 @@ static void
clutter_settings_class_init (ClutterSettingsClass *klass) clutter_settings_class_init (ClutterSettingsClass *klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GParamSpec *pspec;
gobject_class->set_property = clutter_settings_set_property;
gobject_class->get_property = clutter_settings_get_property;
gobject_class->notify = clutter_settings_notify;
gobject_class->finalize = clutter_settings_finalize;
/** /**
* ClutterSettings:backend: * ClutterSettings:backend:
@ -324,14 +318,12 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_object ("backend", obj_props[PROP_BACKEND] =
g_param_spec_object ("backend",
"Backend", "Backend",
"A pointer to the backend", "A pointer to the backend",
CLUTTER_TYPE_BACKEND, CLUTTER_TYPE_BACKEND,
CLUTTER_PARAM_WRITABLE | CLUTTER_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
G_PARAM_CONSTRUCT_ONLY);
obj_props[PROP_BACKEND] = pspec;
g_object_class_install_property (gobject_class, PROP_BACKEND, pspec);
/** /**
* ClutterSettings:double-click-time: * ClutterSettings:double-click-time:
@ -341,17 +333,13 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_int ("double-click-time", obj_props[PROP_DOUBLE_CLICK_TIME] =
"Double Click Time", g_param_spec_int ("double-click-time",
"The time between clicks necessary to detect " P_("Double Click Time"),
"a multiple click", P_("The time between clicks necessary to detect a multiple click"),
0, G_MAXINT, 0, G_MAXINT,
250, 250,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_DOUBLE_CLICK_TIME] = pspec;
g_object_class_install_property (gobject_class,
PROP_DOUBLE_CLICK_TIME,
pspec);
/** /**
* ClutterSettings:double-click-distance: * ClutterSettings:double-click-distance:
@ -361,17 +349,13 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_int ("double-click-distance", obj_props[PROP_DOUBLE_CLICK_DISTANCE] =
"Double Click Distance", g_param_spec_int ("double-click-distance",
"The distance between clicks necessary to detect " P_("Double Click Distance"),
"a multiple click", P_("The distance between clicks necessary to detect a multiple click"),
0, G_MAXINT, 0, G_MAXINT,
5, 5,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_DOUBLE_CLICK_DISTANCE] = pspec;
g_object_class_install_property (gobject_class,
PROP_DOUBLE_CLICK_DISTANCE,
pspec);
/** /**
* ClutterSettings:font-name: * ClutterSettings:font-name:
@ -381,16 +365,12 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_string ("font-name", obj_props[PROP_FONT_NAME] =
"Font Name", g_param_spec_string ("font-name",
"The description of the default font, as " P_("Font Name"),
"one that could be parsed by Pango", P_("The description of the default font, as one that could be parsed by Pango"),
NULL, NULL,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_FONT_NAME] = pspec;
g_object_class_install_property (gobject_class,
PROP_FONT_NAME,
pspec);
/** /**
* ClutterSettings:font-antialias: * ClutterSettings:font-antialias:
@ -401,17 +381,13 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_int ("font-antialias", obj_props[PROP_FONT_ANTIALIAS] =
"Font Antialias", g_param_spec_int ("font-antialias",
"Whether to use antialiasing (1 to enable, 0 to " P_("Font Antialias"),
"disable, and -1 to use the default)", P_("Whether to use antialiasing (1 to enable, 0 to disable, and -1 to use the default)"),
-1, 1, -1, 1,
-1, -1,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_FONT_ANTIALIAS] = pspec;
g_object_class_install_property (gobject_class,
PROP_FONT_ANTIALIAS,
pspec);
/** /**
* ClutterSettings:font-dpi: * ClutterSettings:font-dpi:
@ -422,17 +398,13 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_int ("font-dpi", obj_props[PROP_FONT_DPI] =
"Font DPI", g_param_spec_int ("font-dpi",
"The resolution of the font, in 1024 * dots/inch, " P_("Font DPI"),
"or -1 to use the default", P_("The resolution of the font, in 1024 * dots/inch, or -1 to use the default"),
-1, 1024 * 1024, -1, 1024 * 1024,
-1, -1,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_FONT_DPI] = pspec;
g_object_class_install_property (gobject_class,
PROP_FONT_DPI,
pspec);
/** /**
* ClutterSettings:font-hinting: * ClutterSettings:font-hinting:
@ -443,17 +415,13 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_int ("font-hinting", obj_props[PROP_FONT_HINTING] =
"Font Hinting", g_param_spec_int ("font-hinting",
"Whether to use hinting (1 to enable, 0 to disable " P_("Font Hinting"),
"and -1 to use the default)", P_("Whether to use hinting (1 to enable, 0 to disable and -1 to use the default)"),
-1, 1, -1, 1,
-1, -1,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_FONT_HINTING] = pspec;
g_object_class_install_property (gobject_class,
PROP_FONT_HINTING,
pspec);
/** /**
* ClutterSettings:font-hint-style: * ClutterSettings:font-hint-style:
@ -469,16 +437,12 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_string ("font-hint-style", obj_props[PROP_FONT_HINT_STYLE] =
"Font Hint Style", g_param_spec_string ("font-hint-style",
"The style of hinting (hintnone, hintslight, " P_("Font Hint Style"),
"hintmedium, hintfull)", P_("The style of hinting (hintnone, hintslight, hintmedium, hintfull)"),
NULL, NULL,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_FONT_HINT_STYLE] = pspec;
g_object_class_install_property (gobject_class,
PROP_FONT_HINT_STYLE,
pspec);
/** /**
* ClutterSettings:font-subpixel-order: * ClutterSettings:font-subpixel-order:
@ -495,16 +459,18 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
* *
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_string ("font-subpixel-order", obj_props[PROP_FONT_RGBA] =
"Font Subpixel Order", g_param_spec_string ("font-subpixel-order",
"The type of subpixel antialiasing (none, rgb, " P_("Font Subpixel Order"),
"bgr, vrgb, vbgr)", P_("The type of subpixel antialiasing (none, rgb, bgr, vrgb, vbgr)"),
NULL, NULL,
CLUTTER_PARAM_READWRITE); CLUTTER_PARAM_READWRITE);
obj_props[PROP_FONT_RGBA] = pspec;
g_object_class_install_property (gobject_class, gobject_class->set_property = clutter_settings_set_property;
PROP_FONT_RGBA, gobject_class->get_property = clutter_settings_get_property;
pspec); gobject_class->notify = clutter_settings_notify;
gobject_class->finalize = clutter_settings_finalize;
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
} }
static void static void