shumate/shumate-vector-value.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (C) 2025 James Westman <james@jwestman.net> | ||
| 3 | * | ||
| 4 | * This library is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU Lesser General Public | ||
| 6 | * License as published by the Free Software Foundation; either | ||
| 7 | * version 2.1 of the License, or (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This library is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 12 | * Lesser General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU Lesser General Public | ||
| 15 | * License along with this library; if not, see <https://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #pragma once | ||
| 19 | |||
| 20 | #include <glib-object.h> | ||
| 21 | #include <gdk/gdk.h> | ||
| 22 | #include <shumate/shumate-version.h> | ||
| 23 | |||
| 24 | G_BEGIN_DECLS | ||
| 25 | |||
| 26 | |||
| 27 | /** | ||
| 28 | * ShumateVectorValueType: | ||
| 29 | * @SHUMATE_VECTOR_VALUE_TYPE_NULL: Null value | ||
| 30 | * @SHUMATE_VECTOR_VALUE_TYPE_NUMBER: Number value | ||
| 31 | * @SHUMATE_VECTOR_VALUE_TYPE_BOOLEAN: Boolean value | ||
| 32 | * @SHUMATE_VECTOR_VALUE_TYPE_STRING: String value | ||
| 33 | * @SHUMATE_VECTOR_VALUE_TYPE_COLOR: Color value | ||
| 34 | * @SHUMATE_VECTOR_VALUE_TYPE_ARRAY: Array value | ||
| 35 | * @SHUMATE_VECTOR_VALUE_TYPE_RESOLVED_IMAGE: Resolved image value | ||
| 36 | * @SHUMATE_VECTOR_VALUE_TYPE_FORMATTED_STRING: Formatted string value | ||
| 37 | * @SHUMATE_VECTOR_VALUE_TYPE_COLLATOR: Collator value | ||
| 38 | * | ||
| 39 | * Type of a [struct@VectorValue]. | ||
| 40 | * | ||
| 41 | * Since: 1.6 | ||
| 42 | */ | ||
| 43 | SHUMATE_AVAILABLE_TYPE_IN_1_6 | ||
| 44 | typedef enum { | ||
| 45 | SHUMATE_VECTOR_VALUE_TYPE_NULL, | ||
| 46 | SHUMATE_VECTOR_VALUE_TYPE_NUMBER, | ||
| 47 | SHUMATE_VECTOR_VALUE_TYPE_BOOLEAN, | ||
| 48 | SHUMATE_VECTOR_VALUE_TYPE_STRING, | ||
| 49 | SHUMATE_VECTOR_VALUE_TYPE_COLOR, | ||
| 50 | SHUMATE_VECTOR_VALUE_TYPE_ARRAY, | ||
| 51 | SHUMATE_VECTOR_VALUE_TYPE_RESOLVED_IMAGE, | ||
| 52 | SHUMATE_VECTOR_VALUE_TYPE_FORMATTED_STRING, | ||
| 53 | SHUMATE_VECTOR_VALUE_TYPE_COLLATOR, | ||
| 54 | } ShumateVectorValueType; | ||
| 55 | |||
| 56 | SHUMATE_AVAILABLE_TYPE_IN_1_6 | ||
| 57 | typedef struct _ShumateVectorValue ShumateVectorValue; | ||
| 58 | |||
| 59 | SHUMATE_AVAILABLE_MACRO_IN_1_6 | ||
| 60 | #define SHUMATE_TYPE_VECTOR_VALUE shumate_vector_value_get_type() | ||
| 61 | |||
| 62 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 63 | GType shumate_vector_value_get_type (void); | ||
| 64 | |||
| 65 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 66 | ShumateVectorValue *shumate_vector_value_new (void); | ||
| 67 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 68 | ShumateVectorValue *shumate_vector_value_new_from_value (const GValue *value); | ||
| 69 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 70 | ShumateVectorValue *shumate_vector_value_new_string (const char *string); | ||
| 71 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 72 | ShumateVectorValue *shumate_vector_value_new_number (double number); | ||
| 73 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 74 | ShumateVectorValue *shumate_vector_value_new_boolean (gboolean boolean); | ||
| 75 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 76 | ShumateVectorValue *shumate_vector_value_new_color (const GdkRGBA *color); | ||
| 77 | |||
| 78 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 79 | void shumate_vector_value_free (ShumateVectorValue *self); | ||
| 80 |
0/8✗ Branch 5 → 8 not taken.
✗ Branch 5 → 9 not taken.
✗ Branch 102 → 103 not taken.
✗ Branch 102 → 117 not taken.
✗ Branch 111 → 112 not taken.
✗ Branch 111 → 117 not taken.
✗ Branch 117 → 118 not taken.
✗ Branch 117 → 256 not taken.
|
240 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShumateVectorValue, shumate_vector_value_free) |
| 81 | |||
| 82 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 83 | ShumateVectorValue *shumate_vector_value_dup (ShumateVectorValue *self); | ||
| 84 | |||
| 85 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 86 | ShumateVectorValueType shumate_vector_value_get_value_type (ShumateVectorValue *self); | ||
| 87 | |||
| 88 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 89 | gboolean shumate_vector_value_is_null (ShumateVectorValue *self); | ||
| 90 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 91 | void shumate_vector_value_unset (ShumateVectorValue *self); | ||
| 92 | |||
| 93 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 94 | void shumate_vector_value_set_number (ShumateVectorValue *self, double number); | ||
| 95 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 96 | gboolean shumate_vector_value_get_number (ShumateVectorValue *self, double *number); | ||
| 97 | |||
| 98 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 99 | void shumate_vector_value_set_string (ShumateVectorValue *self, const char *string); | ||
| 100 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 101 | gboolean shumate_vector_value_get_string (ShumateVectorValue *self, const char **string); | ||
| 102 | |||
| 103 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 104 | void shumate_vector_value_set_boolean (ShumateVectorValue *self, gboolean boolean); | ||
| 105 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 106 | gboolean shumate_vector_value_get_boolean (ShumateVectorValue *self, gboolean *boolean); | ||
| 107 | |||
| 108 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 109 | void shumate_vector_value_set_color (ShumateVectorValue *self, const GdkRGBA *color); | ||
| 110 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 111 | gboolean shumate_vector_value_get_color (ShumateVectorValue *self, GdkRGBA *color); | ||
| 112 | |||
| 113 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 114 | void shumate_vector_value_start_array (ShumateVectorValue *self); | ||
| 115 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 116 | void shumate_vector_value_array_append (ShumateVectorValue *self, ShumateVectorValue *element); | ||
| 117 | |||
| 118 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 119 | gboolean shumate_vector_value_equal (ShumateVectorValue *a, ShumateVectorValue *b); | ||
| 120 | SHUMATE_AVAILABLE_IN_1_6 | ||
| 121 | gint shumate_vector_value_hash (ShumateVectorValue *self); | ||
| 122 | |||
| 123 | G_END_DECLS | ||
| 124 |