Settings

Settings — Sharing settings between applications

Synopsis


#include <gtk/gtk.h>


                    GtkSettings;
                    GtkSettingsValue;
GtkSettings*        gtk_settings_get_default            (void);
GtkSettings*        gtk_settings_get_for_screen         (GdkScreen *screen);
void                gtk_settings_install_property       (GParamSpec *pspec);
void                gtk_settings_install_property_parser
                                                        (GParamSpec *pspec,
                                                         GtkRcPropertyParser parser);
gboolean            gtk_rc_property_parse_color         (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);
gboolean            gtk_rc_property_parse_enum          (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);
gboolean            gtk_rc_property_parse_flags         (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);
gboolean            gtk_rc_property_parse_requisition   (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);
gboolean            gtk_rc_property_parse_border        (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);
void                gtk_settings_set_property_value     (GtkSettings *settings,
                                                         const gchar *name,
                                                         const GtkSettingsValue *svalue);
void                gtk_settings_set_string_property    (GtkSettings *settings,
                                                         const gchar *name,
                                                         const gchar *v_string,
                                                         const gchar *origin);
void                gtk_settings_set_long_property      (GtkSettings *settings,
                                                         const gchar *name,
                                                         glong v_long,
                                                         const gchar *origin);
void                gtk_settings_set_double_property    (GtkSettings *settings,
                                                         const gchar *name,
                                                         gdouble v_double,
                                                         const gchar *origin);


Description

Details

GtkSettings

typedef struct {
  GObject parent_instance;

  GData  *queued_settings;	/* of type GtkSettingsValue* */
  GtkSettingsPropertyValue *property_values;

  GtkRcContext *rc_context;
  GdkScreen    *screen;
} GtkSettings;


GtkSettingsValue

typedef struct {
  /* origin should be something like "filename:linenumber" for rc files,
   * or e.g. "XProperty" for other sources
   */
  gchar *origin;

  /* valid types are LONG, DOUBLE and STRING corresponding to the token parsed,
   * or a GSTRING holding an unparsed statement
   */
  GValue value;
} GtkSettingsValue;


gtk_settings_get_default ()

GtkSettings*        gtk_settings_get_default            (void);

Gets the GtkSettings object for the default GDK screen, creating it if necessary. See gtk_settings_get_for_screen().

Returns :

a GtkSettings object. If there is no default screen, then returns NULL.

gtk_settings_get_for_screen ()

GtkSettings*        gtk_settings_get_for_screen         (GdkScreen *screen);

Gets the GtkSettings object for screen, creating it if necessary.

screen :

a GdkScreen.

Returns :

a GtkSettings object.

Since 2.2


gtk_settings_install_property ()

void                gtk_settings_install_property       (GParamSpec *pspec);

pspec :


gtk_settings_install_property_parser ()

void                gtk_settings_install_property_parser
                                                        (GParamSpec *pspec,
                                                         GtkRcPropertyParser parser);

pspec :

parser :


gtk_rc_property_parse_color ()

gboolean            gtk_rc_property_parse_color         (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);

A GtkRcPropertyParser for use with gtk_settings_install_property_parser() or gtk_widget_class_install_style_property_parser() which parses a color given either by its name or in the form { red, green, blue } where red, green and blue are integers between 0 and 65535 or floating-point numbers between 0 and 1.

pspec :

a GParamSpec

gstring :

the GString to be parsed

property_value :

a GValue which must hold GdkColor values.

Returns :

TRUE if gstring could be parsed and property_value has been set to the resulting GdkColor.

gtk_rc_property_parse_enum ()

gboolean            gtk_rc_property_parse_enum          (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);

A GtkRcPropertyParser for use with gtk_settings_install_property_parser() or gtk_widget_class_install_style_property_parser() which parses a single enumeration value.

The enumeration value can be specified by its name, its nickname or its numeric value. For consistency with flags parsing, the value may be surrounded by parentheses.

pspec :

a GParamSpec

gstring :

the GString to be parsed

property_value :

a GValue which must hold enum values.

Returns :

TRUE if gstring could be parsed and property_value has been set to the resulting GEnumValue.

gtk_rc_property_parse_flags ()

gboolean            gtk_rc_property_parse_flags         (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);

A GtkRcPropertyParser for use with gtk_settings_install_property_parser() or gtk_widget_class_install_style_property_parser() which parses flags.

Flags can be specified by their name, their nickname or numerically. Multiple flags can be specified in the form "( flag1 | flag2 | ... )".

pspec :

a GParamSpec

gstring :

the GString to be parsed

property_value :

a GValue which must hold flags values.

Returns :

TRUE if gstring could be parsed and property_value has been set to the resulting flags value.

gtk_rc_property_parse_requisition ()

gboolean            gtk_rc_property_parse_requisition   (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);

A GtkRcPropertyParser for use with gtk_settings_install_property_parser() or gtk_widget_class_install_style_property_parser() which parses a requisition in the form "{ width, height }" for integers width and height.

pspec :

a GParamSpec

gstring :

the GString to be parsed

property_value :

a GValue which must hold boxed values.

Returns :

TRUE if gstring could be parsed and property_value has been set to the resulting GtkRequisition.

gtk_rc_property_parse_border ()

gboolean            gtk_rc_property_parse_border        (const GParamSpec *pspec,
                                                         const GString *gstring,
                                                         GValue *property_value);

A GtkRcPropertyParser for use with gtk_settings_install_property_parser() or gtk_widget_class_install_style_property_parser() which parses borders in the form "{ left, right, top, bottom }" for integers left, right, top and bottom.

pspec :

a GParamSpec

gstring :

the GString to be parsed

property_value :

a GValue which must hold boxed values.

Returns :

TRUE if gstring could be parsed and property_value has been set to the resulting GtkBorder.

gtk_settings_set_property_value ()

void                gtk_settings_set_property_value     (GtkSettings *settings,
                                                         const gchar *name,
                                                         const GtkSettingsValue *svalue);

settings :

name :

svalue :


gtk_settings_set_string_property ()

void                gtk_settings_set_string_property    (GtkSettings *settings,
                                                         const gchar *name,
                                                         const gchar *v_string,
                                                         const gchar *origin);

settings :

name :

v_string :

origin :


gtk_settings_set_long_property ()

void                gtk_settings_set_long_property      (GtkSettings *settings,
                                                         const gchar *name,
                                                         glong v_long,
                                                         const gchar *origin);

settings :

name :

v_long :

origin :


gtk_settings_set_double_property ()

void                gtk_settings_set_double_property    (GtkSettings *settings,
                                                         const gchar *name,
                                                         gdouble v_double,
                                                         const gchar *origin);

settings :

name :

v_double :

origin :