lipgloss 0.1.0-arm-linux-musl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +461 -0
- data/ext/lipgloss/extconf.rb +61 -0
- data/ext/lipgloss/extension.c +150 -0
- data/ext/lipgloss/extension.h +76 -0
- data/ext/lipgloss/list.c +147 -0
- data/ext/lipgloss/style.c +398 -0
- data/ext/lipgloss/style_border.c +209 -0
- data/ext/lipgloss/style_spacing.c +97 -0
- data/ext/lipgloss/style_unset.c +151 -0
- data/ext/lipgloss/table.c +242 -0
- data/ext/lipgloss/tree.c +192 -0
- data/go/build/linux_arm/liblipgloss.a +0 -0
- data/go/build/linux_arm/liblipgloss.h +227 -0
- data/go/go.mod +20 -0
- data/go/go.sum +34 -0
- data/go/layout.go +71 -0
- data/go/lipgloss.go +78 -0
- data/go/list.go +118 -0
- data/go/style.go +281 -0
- data/go/style_border.go +197 -0
- data/go/style_spacing.go +94 -0
- data/go/style_unset.go +129 -0
- data/go/table.go +218 -0
- data/go/tree.go +138 -0
- data/lib/lipgloss/3.2/lipgloss.so +0 -0
- data/lib/lipgloss/3.3/lipgloss.so +0 -0
- data/lib/lipgloss/3.4/lipgloss.so +0 -0
- data/lib/lipgloss/border.rb +48 -0
- data/lib/lipgloss/color.rb +97 -0
- data/lib/lipgloss/position.rb +27 -0
- data/lib/lipgloss/table.rb +63 -0
- data/lib/lipgloss/version.rb +6 -0
- data/lib/lipgloss.rb +27 -0
- data/lipgloss.gemspec +34 -0
- metadata +82 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
#include "extension.h"
|
|
2
|
+
|
|
3
|
+
static int symbol_to_border_type(VALUE symbol) {
|
|
4
|
+
if (symbol == ID2SYM(rb_intern("normal"))) return BORDER_NORMAL;
|
|
5
|
+
if (symbol == ID2SYM(rb_intern("rounded"))) return BORDER_ROUNDED;
|
|
6
|
+
if (symbol == ID2SYM(rb_intern("thick"))) return BORDER_THICK;
|
|
7
|
+
if (symbol == ID2SYM(rb_intern("double"))) return BORDER_DOUBLE;
|
|
8
|
+
if (symbol == ID2SYM(rb_intern("hidden"))) return BORDER_HIDDEN;
|
|
9
|
+
if (symbol == ID2SYM(rb_intern("block"))) return BORDER_BLOCK;
|
|
10
|
+
if (symbol == ID2SYM(rb_intern("outer_half_block"))) return BORDER_OUTER_HALF_BLOCK;
|
|
11
|
+
if (symbol == ID2SYM(rb_intern("inner_half_block"))) return BORDER_INNER_HALF_BLOCK;
|
|
12
|
+
if (symbol == ID2SYM(rb_intern("ascii"))) return BORDER_ASCII;
|
|
13
|
+
|
|
14
|
+
return BORDER_NORMAL;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static VALUE style_border(int argc, VALUE *argv, VALUE self) {
|
|
18
|
+
GET_STYLE(self, style);
|
|
19
|
+
|
|
20
|
+
if (argc == 0) {
|
|
21
|
+
rb_raise(rb_eArgError, "wrong number of arguments (given 0, expected 1+)");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
int border_type = symbol_to_border_type(argv[0]);
|
|
25
|
+
|
|
26
|
+
if (argc == 1) {
|
|
27
|
+
unsigned long long new_handle = lipgloss_style_border(style->handle, border_type, NULL, 0);
|
|
28
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
int sides[4];
|
|
32
|
+
int sides_count = argc - 1;
|
|
33
|
+
if (sides_count > 4) sides_count = 4;
|
|
34
|
+
|
|
35
|
+
for (int index = 0; index < sides_count; index++) {
|
|
36
|
+
sides[index] = RTEST(argv[index + 1]) ? 1 : 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
unsigned long long new_handle = lipgloss_style_border(style->handle, border_type, sides, sides_count);
|
|
40
|
+
|
|
41
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static VALUE style_border_style(VALUE self, VALUE border_sym) {
|
|
45
|
+
GET_STYLE(self, style);
|
|
46
|
+
int border_type = symbol_to_border_type(border_sym);
|
|
47
|
+
unsigned long long new_handle = lipgloss_style_border_style(style->handle, border_type);
|
|
48
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static VALUE style_border_foreground(VALUE self, VALUE color) {
|
|
52
|
+
GET_STYLE(self, style);
|
|
53
|
+
Check_Type(color, T_STRING);
|
|
54
|
+
unsigned long long new_handle = lipgloss_style_border_foreground(style->handle, StringValueCStr(color));
|
|
55
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static VALUE style_border_background(VALUE self, VALUE color) {
|
|
59
|
+
GET_STYLE(self, style);
|
|
60
|
+
Check_Type(color, T_STRING);
|
|
61
|
+
unsigned long long new_handle = lipgloss_style_border_background(style->handle, StringValueCStr(color));
|
|
62
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static VALUE style_border_top(VALUE self, VALUE value) {
|
|
66
|
+
GET_STYLE(self, style);
|
|
67
|
+
unsigned long long new_handle = lipgloss_style_border_top(style->handle, RTEST(value) ? 1 : 0);
|
|
68
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static VALUE style_border_right(VALUE self, VALUE value) {
|
|
72
|
+
GET_STYLE(self, style);
|
|
73
|
+
unsigned long long new_handle = lipgloss_style_border_right(style->handle, RTEST(value) ? 1 : 0);
|
|
74
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static VALUE style_border_bottom(VALUE self, VALUE value) {
|
|
78
|
+
GET_STYLE(self, style);
|
|
79
|
+
unsigned long long new_handle = lipgloss_style_border_bottom(style->handle, RTEST(value) ? 1 : 0);
|
|
80
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static VALUE style_border_left(VALUE self, VALUE value) {
|
|
84
|
+
GET_STYLE(self, style);
|
|
85
|
+
unsigned long long new_handle = lipgloss_style_border_left(style->handle, RTEST(value) ? 1 : 0);
|
|
86
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static VALUE style_border_top_foreground(VALUE self, VALUE color) {
|
|
90
|
+
GET_STYLE(self, style);
|
|
91
|
+
Check_Type(color, T_STRING);
|
|
92
|
+
unsigned long long new_handle = lipgloss_style_border_top_foreground(style->handle, StringValueCStr(color));
|
|
93
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static VALUE style_border_right_foreground(VALUE self, VALUE color) {
|
|
97
|
+
GET_STYLE(self, style);
|
|
98
|
+
Check_Type(color, T_STRING);
|
|
99
|
+
unsigned long long new_handle = lipgloss_style_border_right_foreground(style->handle, StringValueCStr(color));
|
|
100
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static VALUE style_border_bottom_foreground(VALUE self, VALUE color) {
|
|
104
|
+
GET_STYLE(self, style);
|
|
105
|
+
Check_Type(color, T_STRING);
|
|
106
|
+
unsigned long long new_handle = lipgloss_style_border_bottom_foreground(style->handle, StringValueCStr(color));
|
|
107
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static VALUE style_border_left_foreground(VALUE self, VALUE color) {
|
|
111
|
+
GET_STYLE(self, style);
|
|
112
|
+
Check_Type(color, T_STRING);
|
|
113
|
+
unsigned long long new_handle = lipgloss_style_border_left_foreground(style->handle, StringValueCStr(color));
|
|
114
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static VALUE style_border_top_background(VALUE self, VALUE color) {
|
|
118
|
+
GET_STYLE(self, style);
|
|
119
|
+
Check_Type(color, T_STRING);
|
|
120
|
+
unsigned long long new_handle = lipgloss_style_border_top_background(style->handle, StringValueCStr(color));
|
|
121
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static VALUE style_border_right_background(VALUE self, VALUE color) {
|
|
125
|
+
GET_STYLE(self, style);
|
|
126
|
+
Check_Type(color, T_STRING);
|
|
127
|
+
unsigned long long new_handle = lipgloss_style_border_right_background(style->handle, StringValueCStr(color));
|
|
128
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
static VALUE style_border_bottom_background(VALUE self, VALUE color) {
|
|
132
|
+
GET_STYLE(self, style);
|
|
133
|
+
Check_Type(color, T_STRING);
|
|
134
|
+
unsigned long long new_handle = lipgloss_style_border_bottom_background(style->handle, StringValueCStr(color));
|
|
135
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
static VALUE style_border_left_background(VALUE self, VALUE color) {
|
|
139
|
+
GET_STYLE(self, style);
|
|
140
|
+
Check_Type(color, T_STRING);
|
|
141
|
+
unsigned long long new_handle = lipgloss_style_border_left_background(style->handle, StringValueCStr(color));
|
|
142
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static VALUE style_border_custom(int argc, VALUE *argv, VALUE self) {
|
|
146
|
+
GET_STYLE(self, style);
|
|
147
|
+
|
|
148
|
+
VALUE opts;
|
|
149
|
+
rb_scan_args(argc, argv, "0:", &opts);
|
|
150
|
+
|
|
151
|
+
if (NIL_P(opts)) {
|
|
152
|
+
rb_raise(rb_eArgError, "keyword arguments required");
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
VALUE top = rb_hash_aref(opts, ID2SYM(rb_intern("top")));
|
|
156
|
+
VALUE bottom = rb_hash_aref(opts, ID2SYM(rb_intern("bottom")));
|
|
157
|
+
VALUE left = rb_hash_aref(opts, ID2SYM(rb_intern("left")));
|
|
158
|
+
VALUE right = rb_hash_aref(opts, ID2SYM(rb_intern("right")));
|
|
159
|
+
VALUE top_left = rb_hash_aref(opts, ID2SYM(rb_intern("top_left")));
|
|
160
|
+
VALUE top_right = rb_hash_aref(opts, ID2SYM(rb_intern("top_right")));
|
|
161
|
+
VALUE bottom_left = rb_hash_aref(opts, ID2SYM(rb_intern("bottom_left")));
|
|
162
|
+
VALUE bottom_right = rb_hash_aref(opts, ID2SYM(rb_intern("bottom_right")));
|
|
163
|
+
VALUE middle_left = rb_hash_aref(opts, ID2SYM(rb_intern("middle_left")));
|
|
164
|
+
VALUE middle_right = rb_hash_aref(opts, ID2SYM(rb_intern("middle_right")));
|
|
165
|
+
VALUE middle = rb_hash_aref(opts, ID2SYM(rb_intern("middle")));
|
|
166
|
+
VALUE middle_top = rb_hash_aref(opts, ID2SYM(rb_intern("middle_top")));
|
|
167
|
+
VALUE middle_bottom = rb_hash_aref(opts, ID2SYM(rb_intern("middle_bottom")));
|
|
168
|
+
|
|
169
|
+
unsigned long long new_handle = lipgloss_style_border_custom(
|
|
170
|
+
style->handle,
|
|
171
|
+
NIL_P(top) ? "" : StringValueCStr(top),
|
|
172
|
+
NIL_P(bottom) ? "" : StringValueCStr(bottom),
|
|
173
|
+
NIL_P(left) ? "" : StringValueCStr(left),
|
|
174
|
+
NIL_P(right) ? "" : StringValueCStr(right),
|
|
175
|
+
NIL_P(top_left) ? "" : StringValueCStr(top_left),
|
|
176
|
+
NIL_P(top_right) ? "" : StringValueCStr(top_right),
|
|
177
|
+
NIL_P(bottom_left) ? "" : StringValueCStr(bottom_left),
|
|
178
|
+
NIL_P(bottom_right) ? "" : StringValueCStr(bottom_right),
|
|
179
|
+
NIL_P(middle_left) ? "" : StringValueCStr(middle_left),
|
|
180
|
+
NIL_P(middle_right) ? "" : StringValueCStr(middle_right),
|
|
181
|
+
NIL_P(middle) ? "" : StringValueCStr(middle),
|
|
182
|
+
NIL_P(middle_top) ? "" : StringValueCStr(middle_top),
|
|
183
|
+
NIL_P(middle_bottom) ? "" : StringValueCStr(middle_bottom)
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
void register_style_border_methods(void) {
|
|
190
|
+
rb_define_method(cStyle, "border", style_border, -1);
|
|
191
|
+
rb_define_method(cStyle, "border_style", style_border_style, 1);
|
|
192
|
+
rb_define_method(cStyle, "border_foreground", style_border_foreground, 1);
|
|
193
|
+
rb_define_method(cStyle, "border_background", style_border_background, 1);
|
|
194
|
+
rb_define_method(cStyle, "border_top", style_border_top, 1);
|
|
195
|
+
rb_define_method(cStyle, "border_right", style_border_right, 1);
|
|
196
|
+
rb_define_method(cStyle, "border_bottom", style_border_bottom, 1);
|
|
197
|
+
rb_define_method(cStyle, "border_left", style_border_left, 1);
|
|
198
|
+
|
|
199
|
+
rb_define_method(cStyle, "border_top_foreground", style_border_top_foreground, 1);
|
|
200
|
+
rb_define_method(cStyle, "border_right_foreground", style_border_right_foreground, 1);
|
|
201
|
+
rb_define_method(cStyle, "border_bottom_foreground", style_border_bottom_foreground, 1);
|
|
202
|
+
rb_define_method(cStyle, "border_left_foreground", style_border_left_foreground, 1);
|
|
203
|
+
rb_define_method(cStyle, "border_top_background", style_border_top_background, 1);
|
|
204
|
+
rb_define_method(cStyle, "border_right_background", style_border_right_background, 1);
|
|
205
|
+
rb_define_method(cStyle, "border_bottom_background", style_border_bottom_background, 1);
|
|
206
|
+
rb_define_method(cStyle, "border_left_background", style_border_left_background, 1);
|
|
207
|
+
|
|
208
|
+
rb_define_method(cStyle, "border_custom", style_border_custom, -1);
|
|
209
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#include "extension.h"
|
|
2
|
+
|
|
3
|
+
static VALUE style_padding(int argc, VALUE *argv, VALUE self) {
|
|
4
|
+
GET_STYLE(self, style);
|
|
5
|
+
|
|
6
|
+
if (argc == 0 || argc > 4) {
|
|
7
|
+
rb_raise(rb_eArgError, "wrong number of arguments (given %d, expected 1..4)", argc);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
int values[4];
|
|
11
|
+
for (int index = 0; index < argc; index++) {
|
|
12
|
+
values[index] = NUM2INT(argv[index]);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
unsigned long long new_handle = lipgloss_style_padding(style->handle, values, argc);
|
|
16
|
+
|
|
17
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static VALUE style_padding_top(VALUE self, VALUE value) {
|
|
21
|
+
GET_STYLE(self, style);
|
|
22
|
+
unsigned long long new_handle = lipgloss_style_padding_top(style->handle, NUM2INT(value));
|
|
23
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static VALUE style_padding_right(VALUE self, VALUE value) {
|
|
27
|
+
GET_STYLE(self, style);
|
|
28
|
+
unsigned long long new_handle = lipgloss_style_padding_right(style->handle, NUM2INT(value));
|
|
29
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static VALUE style_padding_bottom(VALUE self, VALUE value) {
|
|
33
|
+
GET_STYLE(self, style);
|
|
34
|
+
unsigned long long new_handle = lipgloss_style_padding_bottom(style->handle, NUM2INT(value));
|
|
35
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static VALUE style_padding_left(VALUE self, VALUE value) {
|
|
39
|
+
GET_STYLE(self, style);
|
|
40
|
+
unsigned long long new_handle = lipgloss_style_padding_left(style->handle, NUM2INT(value));
|
|
41
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static VALUE style_margin(int argc, VALUE *argv, VALUE self) {
|
|
45
|
+
GET_STYLE(self, style);
|
|
46
|
+
|
|
47
|
+
if (argc == 0 || argc > 4) {
|
|
48
|
+
rb_raise(rb_eArgError, "wrong number of arguments (given %d, expected 1..4)", argc);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
int values[4];
|
|
52
|
+
for (int index = 0; index < argc; index++) {
|
|
53
|
+
values[index] = NUM2INT(argv[index]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
unsigned long long new_handle = lipgloss_style_margin(style->handle, values, argc);
|
|
57
|
+
|
|
58
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static VALUE style_margin_top(VALUE self, VALUE value) {
|
|
62
|
+
GET_STYLE(self, style);
|
|
63
|
+
unsigned long long new_handle = lipgloss_style_margin_top(style->handle, NUM2INT(value));
|
|
64
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static VALUE style_margin_right(VALUE self, VALUE value) {
|
|
68
|
+
GET_STYLE(self, style);
|
|
69
|
+
unsigned long long new_handle = lipgloss_style_margin_right(style->handle, NUM2INT(value));
|
|
70
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static VALUE style_margin_bottom(VALUE self, VALUE value) {
|
|
74
|
+
GET_STYLE(self, style);
|
|
75
|
+
unsigned long long new_handle = lipgloss_style_margin_bottom(style->handle, NUM2INT(value));
|
|
76
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static VALUE style_margin_left(VALUE self, VALUE value) {
|
|
80
|
+
GET_STYLE(self, style);
|
|
81
|
+
unsigned long long new_handle = lipgloss_style_margin_left(style->handle, NUM2INT(value));
|
|
82
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
void register_style_spacing_methods(void) {
|
|
86
|
+
rb_define_method(cStyle, "padding", style_padding, -1);
|
|
87
|
+
rb_define_method(cStyle, "padding_top", style_padding_top, 1);
|
|
88
|
+
rb_define_method(cStyle, "padding_right", style_padding_right, 1);
|
|
89
|
+
rb_define_method(cStyle, "padding_bottom", style_padding_bottom, 1);
|
|
90
|
+
rb_define_method(cStyle, "padding_left", style_padding_left, 1);
|
|
91
|
+
|
|
92
|
+
rb_define_method(cStyle, "margin", style_margin, -1);
|
|
93
|
+
rb_define_method(cStyle, "margin_top", style_margin_top, 1);
|
|
94
|
+
rb_define_method(cStyle, "margin_right", style_margin_right, 1);
|
|
95
|
+
rb_define_method(cStyle, "margin_bottom", style_margin_bottom, 1);
|
|
96
|
+
rb_define_method(cStyle, "margin_left", style_margin_left, 1);
|
|
97
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#include "extension.h"
|
|
2
|
+
|
|
3
|
+
static VALUE style_unset_bold(VALUE self) {
|
|
4
|
+
GET_STYLE(self, style);
|
|
5
|
+
unsigned long long new_handle = lipgloss_style_unset_bold(style->handle);
|
|
6
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
static VALUE style_unset_italic(VALUE self) {
|
|
10
|
+
GET_STYLE(self, style);
|
|
11
|
+
unsigned long long new_handle = lipgloss_style_unset_italic(style->handle);
|
|
12
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static VALUE style_unset_underline(VALUE self) {
|
|
16
|
+
GET_STYLE(self, style);
|
|
17
|
+
unsigned long long new_handle = lipgloss_style_unset_underline(style->handle);
|
|
18
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static VALUE style_unset_strikethrough(VALUE self) {
|
|
22
|
+
GET_STYLE(self, style);
|
|
23
|
+
unsigned long long new_handle = lipgloss_style_unset_strikethrough(style->handle);
|
|
24
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static VALUE style_unset_reverse(VALUE self) {
|
|
28
|
+
GET_STYLE(self, style);
|
|
29
|
+
unsigned long long new_handle = lipgloss_style_unset_reverse(style->handle);
|
|
30
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static VALUE style_unset_blink(VALUE self) {
|
|
34
|
+
GET_STYLE(self, style);
|
|
35
|
+
unsigned long long new_handle = lipgloss_style_unset_blink(style->handle);
|
|
36
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static VALUE style_unset_faint(VALUE self) {
|
|
40
|
+
GET_STYLE(self, style);
|
|
41
|
+
unsigned long long new_handle = lipgloss_style_unset_faint(style->handle);
|
|
42
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static VALUE style_unset_foreground(VALUE self) {
|
|
46
|
+
GET_STYLE(self, style);
|
|
47
|
+
unsigned long long new_handle = lipgloss_style_unset_foreground(style->handle);
|
|
48
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static VALUE style_unset_background(VALUE self) {
|
|
52
|
+
GET_STYLE(self, style);
|
|
53
|
+
unsigned long long new_handle = lipgloss_style_unset_background(style->handle);
|
|
54
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static VALUE style_unset_width(VALUE self) {
|
|
58
|
+
GET_STYLE(self, style);
|
|
59
|
+
unsigned long long new_handle = lipgloss_style_unset_width(style->handle);
|
|
60
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static VALUE style_unset_height(VALUE self) {
|
|
64
|
+
GET_STYLE(self, style);
|
|
65
|
+
unsigned long long new_handle = lipgloss_style_unset_height(style->handle);
|
|
66
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static VALUE style_unset_padding_top(VALUE self) {
|
|
70
|
+
GET_STYLE(self, style);
|
|
71
|
+
unsigned long long new_handle = lipgloss_style_unset_padding_top(style->handle);
|
|
72
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static VALUE style_unset_padding_right(VALUE self) {
|
|
76
|
+
GET_STYLE(self, style);
|
|
77
|
+
unsigned long long new_handle = lipgloss_style_unset_padding_right(style->handle);
|
|
78
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static VALUE style_unset_padding_bottom(VALUE self) {
|
|
82
|
+
GET_STYLE(self, style);
|
|
83
|
+
unsigned long long new_handle = lipgloss_style_unset_padding_bottom(style->handle);
|
|
84
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static VALUE style_unset_padding_left(VALUE self) {
|
|
88
|
+
GET_STYLE(self, style);
|
|
89
|
+
unsigned long long new_handle = lipgloss_style_unset_padding_left(style->handle);
|
|
90
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
static VALUE style_unset_margin_top(VALUE self) {
|
|
94
|
+
GET_STYLE(self, style);
|
|
95
|
+
unsigned long long new_handle = lipgloss_style_unset_margin_top(style->handle);
|
|
96
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
static VALUE style_unset_margin_right(VALUE self) {
|
|
100
|
+
GET_STYLE(self, style);
|
|
101
|
+
unsigned long long new_handle = lipgloss_style_unset_margin_right(style->handle);
|
|
102
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static VALUE style_unset_margin_bottom(VALUE self) {
|
|
106
|
+
GET_STYLE(self, style);
|
|
107
|
+
unsigned long long new_handle = lipgloss_style_unset_margin_bottom(style->handle);
|
|
108
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
static VALUE style_unset_margin_left(VALUE self) {
|
|
112
|
+
GET_STYLE(self, style);
|
|
113
|
+
unsigned long long new_handle = lipgloss_style_unset_margin_left(style->handle);
|
|
114
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static VALUE style_unset_border_style(VALUE self) {
|
|
118
|
+
GET_STYLE(self, style);
|
|
119
|
+
unsigned long long new_handle = lipgloss_style_unset_border_style(style->handle);
|
|
120
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
static VALUE style_unset_inline(VALUE self) {
|
|
124
|
+
GET_STYLE(self, style);
|
|
125
|
+
unsigned long long new_handle = lipgloss_style_unset_inline(style->handle);
|
|
126
|
+
return style_wrap(rb_class_of(self), new_handle);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
void register_style_unset_methods(void) {
|
|
130
|
+
rb_define_method(cStyle, "unset_bold", style_unset_bold, 0);
|
|
131
|
+
rb_define_method(cStyle, "unset_italic", style_unset_italic, 0);
|
|
132
|
+
rb_define_method(cStyle, "unset_underline", style_unset_underline, 0);
|
|
133
|
+
rb_define_method(cStyle, "unset_strikethrough", style_unset_strikethrough, 0);
|
|
134
|
+
rb_define_method(cStyle, "unset_reverse", style_unset_reverse, 0);
|
|
135
|
+
rb_define_method(cStyle, "unset_blink", style_unset_blink, 0);
|
|
136
|
+
rb_define_method(cStyle, "unset_faint", style_unset_faint, 0);
|
|
137
|
+
rb_define_method(cStyle, "unset_foreground", style_unset_foreground, 0);
|
|
138
|
+
rb_define_method(cStyle, "unset_background", style_unset_background, 0);
|
|
139
|
+
rb_define_method(cStyle, "unset_width", style_unset_width, 0);
|
|
140
|
+
rb_define_method(cStyle, "unset_height", style_unset_height, 0);
|
|
141
|
+
rb_define_method(cStyle, "unset_padding_top", style_unset_padding_top, 0);
|
|
142
|
+
rb_define_method(cStyle, "unset_padding_right", style_unset_padding_right, 0);
|
|
143
|
+
rb_define_method(cStyle, "unset_padding_bottom", style_unset_padding_bottom, 0);
|
|
144
|
+
rb_define_method(cStyle, "unset_padding_left", style_unset_padding_left, 0);
|
|
145
|
+
rb_define_method(cStyle, "unset_margin_top", style_unset_margin_top, 0);
|
|
146
|
+
rb_define_method(cStyle, "unset_margin_right", style_unset_margin_right, 0);
|
|
147
|
+
rb_define_method(cStyle, "unset_margin_bottom", style_unset_margin_bottom, 0);
|
|
148
|
+
rb_define_method(cStyle, "unset_margin_left", style_unset_margin_left, 0);
|
|
149
|
+
rb_define_method(cStyle, "unset_border_style", style_unset_border_style, 0);
|
|
150
|
+
rb_define_method(cStyle, "unset_inline", style_unset_inline, 0);
|
|
151
|
+
}
|