27#include <pango/pangocairo.h>
34 GtkStyleContext *context = gtk_widget_get_style_context(widget);
35 if(!gtk_style_context_has_class(context, class_name))
37 gtk_style_context_add_class(context, class_name);
38 gtk_widget_queue_draw(widget);
44 GtkStyleContext *context = gtk_widget_get_style_context(widget);
45 if(gtk_style_context_has_class(context, class_name))
47 gtk_style_context_remove_class(context, class_name);
48 gtk_widget_queue_draw(widget);
54 if(!text || !text[0])
return;
58 if(*
p ==
'_' &&
p[1])
p++;
66 gunichar c = g_utf8_get_char_validated(
p, -1);
67 if(c == (gunichar)-1 || c == (gunichar)-2)
return;
69 gunichar upper = g_unichar_toupper(c);
70 if(upper == c)
return;
72 gchar utf8_buf[6] = { 0 };
73 gint
n = g_unichar_to_utf8(upper, utf8_buf);
74 gint orig_len = g_utf8_next_char(
p) -
p;
90 const cairo_font_options_t *fo = NULL;
94 PangoContext *pc = gtk_widget_get_pango_context(widget);
95 if(pc) fo = pango_cairo_context_get_font_options(pc);
102 PangoContext *pc = gtk_widget_get_pango_context(root);
103 if(pc) fo = pango_cairo_context_get_font_options(pc);
108 GdkScreen *screen = gdk_screen_get_default();
109 if(screen) fo = gdk_screen_get_font_options(screen);
113 if(fo) cairo_set_font_options(cr, fo);
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
memcpy(roundtrip, origin, sizeof(roundtrip))
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...