GtkSourceStyle: libgedit-gtksourceview 300 Reference Manual

## GtkSourceStyle GtkSourceStyle — Represents a style |

## Functions

GtkSourceStyleData * | gtk_source_style_get_data ()
GtkSourceStyle * | gtk_source_style_copy ()
void | gtk_source_style_apply ()

## Types and Values

| GtkSourceStyle
struct | GtkSourceStyleData

## Object Hierarchy

        GObject
        ╰── GtkSourceStyle

## Includes

    #include <gtksourceview/gtksource.h>

## Description

The GtkSourceStyle structure is used to describe text attributes which are set when the given style is used.

## Functions

### gtk_source_style_get_data ()

    GtkSourceStyleData *
    gtk_source_style_get_data (GtkSourceStyle *style);

[skip]

#### Parameters

style | a GtkSourceStyle. |

#### Returns

a new GtkSourceStyleData. Free with `g_free()` when no longer needed.

[transfer full]

Since: 300.0

### gtk_source_style_copy ()

    GtkSourceStyle *
    gtk_source_style_copy (const GtkSourceStyle *style);

Creates a copy of `style` , that is a new GtkSourceStyle instance which has the same attributes set.

#### Parameters

style | a GtkSourceStyle structure to copy. |

#### Returns

copy of `style` , call `g_object_unref()` when you are done with it.

[transfer full]

Since: 2.0

### gtk_source_style_apply ()

    void
    gtk_source_style_apply (GtkSourceStyle *style,
                            GtkTextTag *tag);

This function modifies the GtkTextTag properties that are related to the GtkSourceStyle attributes. Other GtkTextTag properties are left untouched.

If `style` is non-`NULL`, applies `style` to `tag` .

If `style` is `NULL`, the related *-set properties of GtkTextTag are set to `FALSE`.

#### Parameters

style | a GtkSourceStyle to apply, or `NULL`. | [nullable]
tag | a GtkTextTag to apply styles to. |

Since: 3.22

## Types and Values

### GtkSourceStyle

    typedef struct _GtkSourceStyle GtkSourceStyle;

### struct GtkSourceStyleData

    struct GtkSourceStyleData {
    	GdkRGBA foreground_color;
    	GdkRGBA background_color;
    	GdkRGBA underline_color;
    	GdkRGBA paragraph_background_color;
    	gdouble scale;
    	PangoUnderline underline;
    	guint italic : 1;
    	guint bold : 1;
    	guint strikethrough : 1;

    	guint use_foreground_color : 1;
    	guint use_background_color : 1;
    	guint use_underline_color : 1;
    	guint use_paragraph_background_color : 1;
    	guint use_scale : 1;
    	guint use_underline : 1;
    	guint use_italic : 1;
    	guint use_bold : 1;
    	guint use_strikethrough : 1;
    };

The data of a GtkSourceStyle object.

Before using the value of a certain field, check the boolean value of the corresponding "use_" field.

#### Members

GdkRGBA `foreground_color`; | Equivalent to “foreground-rgba”. |
GdkRGBA `background_color`; | Equivalent to “background-rgba”. |
GdkRGBA `underline_color`; | Equivalent to “underline-rgba”. |
GdkRGBA `paragraph_background_color`; | Equivalent to “paragraph-background-rgba”. |
gdouble `scale`; | Equivalent to “scale”. |
PangoUnderline `underline`; | Equivalent to “underline”. |
guint `italic` : 1; | For “style”. |
guint `bold` : 1; | For “weight”. |
guint `strikethrough` : 1; | Equivalent to “strikethrough”. |
guint `use_foreground_color` : 1; | Whether `foreground_color` can be taken into account. |
guint `use_background_color` : 1; | Whether `background_color` can be taken into account. |
guint `use_underline_color` : 1; | Whether `underline_color` can be taken into account. |
guint `use_paragraph_background_color` : 1; | Whether `paragraph_background_color` can be taken into account. |
guint `use_scale` : 1; | Whether `scale` can be taken into account. |
guint `use_underline` : 1; | Whether `underline` can be taken into account. |
guint `use_italic` : 1; | Whether `italic` can be taken into account. |
guint `use_bold` : 1; | Whether `bold` can be taken into account. |
guint `use_strikethrough` : 1; | Whether `strikethrough` can be taken into account. |

Since: 300.0