GwyGLLabel: Gwyddion Widgets Library Reference Manual

## GwyGLLabel GwyGLLabel — Information on label on GwyGLView |

## Functions

GwyGLLabel * | gwy_gl_label_new ()
void | gwy_gl_label_set_text ()
const gchar * | gwy_gl_label_get_text ()
gchar * | gwy_gl_label_expand_text ()
void | gwy_gl_label_reset ()
void | gwy_gl_label_reset_text ()
gdouble | gwy_gl_label_user_size ()
gdouble | gwy_gl_label_get_delta_x ()
gdouble | gwy_gl_label_get_delta_y ()
gdouble | gwy_gl_label_get_rotation ()
gdouble | gwy_gl_label_get_size ()
gboolean | gwy_gl_label_get_fixed_size ()

## Properties

char * | default-text | Read / Write / Construct Only
double | delta-x | Read / Write
double | delta-y | Read / Write
gboolean | fixed-size | Read / Write
double | rotation | Read / Write
double | size | Read / Write
char * | text | Read / Write

## Types and Values

struct | GwyGLLabel
struct | GwyGLLabelClass

## Object Hierarchy

        GObject
        ╰── GwyGLLabel

## Implemented Interfaces

GwyGLLabel implements GwySerializable.

## Includes

    #include <libgwyui/gwyui.h>

## Description

## Functions

### gwy_gl_label_new()

    GwyGLLabel *
    gwy_gl_label_new (const gchar *default_text);

Creates a new 3D view label.

#### Parameters

default_text | Label default text. |

#### Returns

A newly created 3D label.

### gwy_gl_label_set_text()

    void
    gwy_gl_label_set_text (GwyGLLabel *label,
                           const gchar *text);

Sets the text of an OpenGL view label.

#### Parameters

label | An OpenGL view label. |
text | New label text. |

### gwy_gl_label_get_text()

    const gchar *
    gwy_gl_label_get_text (GwyGLLabel *label);

Gets the text of an OpenGL view label.

#### Parameters

label | An OpenGL view label. |

#### Returns

The label text. The returned string is owned by label and must no be modified or freed.

### gwy_gl_label_expand_text()

    gchar *
    gwy_gl_label_expand_text (GwyGLLabel *label,
                              GHashTable *variables);

Substitutes variables in label text.

#### Parameters

label | An OpenGL view label. |
variables | Hash table with variable values. |

#### Returns

A newly allocated string with variables from `variables` substituted with values.

### gwy_gl_label_reset()

    void
    gwy_gl_label_reset (GwyGLLabel *label);

Resets all 3D label properties and text to default values.

#### Parameters

label | An OpenGL view label. |

### gwy_gl_label_reset_text()

    void
    gwy_gl_label_reset_text (GwyGLLabel *label);

Resets 3D label text to default values.

#### Parameters

label | An OpenGL view label. |

### gwy_gl_label_user_size()

    gdouble
    gwy_gl_label_user_size (GwyGLLabel *label,
                            gdouble user_size);

Possibly sets size of an OpenGL view label.

If label size is fixed, the function does not change and it is simply returned. Otherwise label size is changed and `user_size` itself is returned.

#### Parameters

label | An OpenGL view label. |
user_size | Size of the text to be set. |

#### Returns

Size of label.

### gwy_gl_label_get_delta_x()

    gdouble
    gwy_gl_label_get_delta_x (GwyGLLabel *label);

Gets the horizontal offset of an OpenGL view label.

#### Parameters

label | An OpenGL view label. |

#### Returns

The horizontal offset in pixels.

### gwy_gl_label_get_delta_y()

    gdouble
    gwy_gl_label_get_delta_y (GwyGLLabel *label);

Gets the vertical offset of an OpenGL view label.

#### Parameters

label | An OpenGL view label. |

#### Returns

The vertical offset in pixels.

### gwy_gl_label_get_rotation()

    gdouble
    gwy_gl_label_get_rotation (GwyGLLabel *label);

Gets the rotation of an OpenGL view label.

#### Parameters

label | An OpenGL view label. |

#### Returns

The rotation angle in radians.

### gwy_gl_label_get_size()

    gdouble
    gwy_gl_label_get_size (GwyGLLabel *label);

Gets the font size of an OpenGL view label.

#### Parameters

label | An OpenGL view label. |

#### Returns

The font size.

### gwy_gl_label_get_fixed_size()

    gboolean
    gwy_gl_label_get_fixed_size (GwyGLLabel *label);

Gets whether an OpenGL view label used a fixed user-sed size.

#### Parameters

label | An OpenGL view label. |

#### Returns

`TRUE` if font size is user-set, `FALSE` if it is automatic.

## Types and Values

### struct GwyGLLabel

    struct GwyGLLabel;

### struct GwyGLLabelClass

    struct GwyGLLabelClass {
        GObjectClass parent_class;

        void (*reserved1)(void);
        void (*reserved2)(void);
    };

## Property Details

### The `“default-text”` property

      “default-text”             char *

Default label text.

Owner: GwyGLLabel

Flags: Read / Write / Construct Only

Default value: ""

### The `“delta-x”` property

      “delta-x”                  double

The :delta-x property represents horizontal label offset in pixels (in screen coordinates after mapping from 3D to 2D).

Owner: GwyGLLabel

Flags: Read / Write

Allowed values: [-1000,1000]

Default value: 0

### The `“delta-y”` property

      “delta-y”                  double

The :delta-y property represents vertical label offset in pixels (in screen coordinates after mapping from 3D to 2D).

Owner: GwyGLLabel

Flags: Read / Write

Allowed values: [-1000,1000]

Default value: 0

### The `“fixed-size”` property

      “fixed-size”               gboolean

The :fixed-size property controls whether the :size property is kept and honoured, or conversely ignored and overwritten with automatic size.

Owner: GwyGLLabel

Flags: Read / Write

Default value: FALSE

### The `“rotation”` property

      “rotation”                 double

The :rotation property represents label rotation in radians, counterclokwise (on screen, after mapping from 3D to 2D).

Owner: GwyGLLabel

Flags: Read / Write

Allowed values: [-3.14159,3.14159]

Default value: 0

### The `“size”` property

      “size”                     double

The :size property represents label size in pixels. When :fixed_size is `FALSE`, its value is overwritten with automatic size.

Owner: GwyGLLabel

Flags: Read / Write

Allowed values: [1,100]

Default value: 14

### The `“text”` property

      “text”                     char *

The label text template.

Owner: GwyGLLabel

Flags: Read / Write

Default value: ""