## GcmDdcControl

GcmDdcControl — For managing different i2c controls

## Synopsis

    #define             GCM_DDC_CONTROL_ERROR
    #define             GCM_DDC_CONTROL_TYPE_ERROR
    enum                GcmDdcControlError;
    struct              GcmDdcControl;
    struct              GcmDdcControlClass;
                        GcmDdcControlCap;
    #define             GCM_DDC_CONTROL_ID_BRIGHTNESS
    GQuark              gcm_ddc_control_error_quark         (void);
    GcmDdcControl *     gcm_ddc_control_new                 (void);
    void                gcm_ddc_control_parse               (GcmDdcControl *control,
                                                             guchar id,
                                                             const gchar *values);
    void                gcm_ddc_control_set_device          (GcmDdcControl *control,
                                                             GcmDdcDevice *device);
    void                gcm_ddc_control_set_verbose         (GcmDdcControl *control,
                                                             GcmVerbose verbose);
    gboolean            gcm_ddc_control_run                 (GcmDdcControl *control,
                                                             GError **error);
    gboolean            gcm_ddc_control_request             (GcmDdcControl *control,
                                                             guint16 *value,
                                                             guint16 *maximum,
                                                             GError **error);
    gboolean            gcm_ddc_control_set                 (GcmDdcControl *control,
                                                             guint16 value,
                                                             GError **error);
    gboolean            gcm_ddc_control_reset               (GcmDdcControl *control,
                                                             GError **error);
    guchar              gcm_ddc_control_get_id              (GcmDdcControl *control);
    const gchar *       gcm_ddc_control_get_description     (GcmDdcControl *control);
    GArray *            gcm_ddc_control_get_values          (GcmDdcControl *control);
                        GcmDdcControlPrivate;

## Object Hierarchy

      GObject
       +----GcmDdcControl

## Properties

      "supported"                gboolean              : Read

## Description

A GObject to use for accessing controls.

## Details

### GCM_DDC_CONTROL_ERROR

    #define GCM_DDC_CONTROL_ERROR		(gcm_ddc_control_error_quark ())

### GCM_DDC_CONTROL_TYPE_ERROR

    #define GCM_DDC_CONTROL_TYPE_ERROR (gcm_ddc_control_error_get_type ())

### enum GcmDdcControlError

    typedef enum
    {
    	GCM_DDC_CONTROL_ERROR_FAILED
    } GcmDdcControlError;

Errors that can be thrown

`GCM_DDC_CONTROL_ERROR_FAILED` | the transaction failed for an unknown reason

### struct GcmDdcControl

    struct GcmDdcControl;

### struct GcmDdcControlClass

    struct GcmDdcControlClass {
    	GObjectClass parent_class;
    	/* padding for future expansion */
    	void (*_gcm_reserved1) (void);
    	void (*_gcm_reserved2) (void);
    	void (*_gcm_reserved3) (void);
    	void (*_gcm_reserved4) (void);
    	void (*_gcm_reserved5) (void);
    };

### GcmDdcControlCap

    typedef struct {
    	guint			 id;
    	GPtrArray		*int_values;
    } GcmDdcControlCap;

### GCM_DDC_CONTROL_ID_BRIGHTNESS

    #define GCM_DDC_CONTROL_ID_BRIGHTNESS			0x10

### gcm_ddc_control_error_quark ()

    GQuark              gcm_ddc_control_error_quark         (void);

Returns : | Our personal error quark.

Since 2.91.1

### gcm_ddc_control_new ()

    GcmDdcControl *     gcm_ddc_control_new                 (void);

Get a control objects.

Returns : | A new `GcmDdcControl` instance

Since 2.91.1

### gcm_ddc_control_parse ()

    void                gcm_ddc_control_parse               (GcmDdcControl *control,
                                                             guchar id,
                                                             const gchar *values);

Parses a control string for permissable values.

`control` : | A valid GcmDdcControl
`id` : | the control ID, e.g. `GCM_DDC_CONTROL_ID_BRIGHTNESS`
`values` : | a string of permissible values, e.g. "1 3 5 7 8 9" or `NULL`

Since 2.91.1

### gcm_ddc_control_set_device ()

    void                gcm_ddc_control_set_device          (GcmDdcControl *control,
                                                             GcmDdcDevice *device);

Set the device that this control belongs to.

`control` : | A valid GcmDdcControl
`device` : | the device that owns this control.

Since 2.91.1

### gcm_ddc_control_set_verbose ()

    void                gcm_ddc_control_set_verbose         (GcmDdcControl *control,
                                                             GcmVerbose verbose);

Set the control verbosity.

`control` : | A valid GcmDdcControl
`verbose` : | if the control should log to stderr.

Since 2.91.1

### gcm_ddc_control_run ()

    gboolean            gcm_ddc_control_run                 (GcmDdcControl *control,
                                                             GError **error);

Runs the control. Note, this only makes sense for true controls like 'degauss' rather than other VCP values such as 'contrast'.

`control` : | A valid GcmDdcControl
`error` : | a GError, or `NULL`
Returns : | `TRUE` for success

Since 2.91.1

### gcm_ddc_control_request ()

    gboolean            gcm_ddc_control_request             (GcmDdcControl *control,
                                                             guint16 *value,
                                                             guint16 *maximum,
                                                             GError **error);

Get the value of this control.

`control` : | A valid GcmDdcControl
`value` : | the value location to write into
`maximum` : | the value maximum location to write into
`error` : | a GError, or `NULL`
Returns : | `TRUE` for success

Since 2.91.1

### gcm_ddc_control_set ()

    gboolean            gcm_ddc_control_set                 (GcmDdcControl *control,
                                                             guint16 value,
                                                             GError **error);

Sets the control value.

`control` : | A valid GcmDdcControl
`value` : | the value to write
`error` : | a GError, or `NULL`
Returns : | `TRUE` for success

Since 2.91.1

### gcm_ddc_control_reset ()

    gboolean            gcm_ddc_control_reset               (GcmDdcControl *control,
                                                             GError **error);

Resets the control to it's default value.

`control` : | A valid GcmDdcControl
`error` : | a GError, or `NULL`
Returns : | `TRUE` for success

Since 2.91.1

### gcm_ddc_control_get_id ()

    guchar              gcm_ddc_control_get_id              (GcmDdcControl *control);

Gets the ID for this control.

`control` : | A valid GcmDdcControl
Returns : | The control ID, e.g. GCM_DDC_CONTROL_ID_BRIGHTNESS

Since 2.91.1

### gcm_ddc_control_get_description ()

    const gchar *       gcm_ddc_control_get_description     (GcmDdcControl *control);

Gets the string description for the control.

`control` : | A valid GcmDdcControl
Returns : | A string value, or `NULL`

Since 2.91.1

### gcm_ddc_control_get_values ()

    GArray *            gcm_ddc_control_get_values          (GcmDdcControl *control);

Gets the permissible values of this control.

`control` : | A valid GcmDdcControl
Returns : | A GArray of guint16 values, free with `g_array_unref()`.

Since 2.91.1

### GcmDdcControlPrivate

    typedef struct _GcmDdcControlPrivate GcmDdcControlPrivate;

Private GcmDdcControl data

## Property Details

### The `"supported"` property

      "supported"                gboolean              : Read

if there are no transactions in progress on this control.

Default value: TRUE

Since 2.91.1