Module: Gtk::RC
- Defined in:
- ext/gtk2/rbgtkrc.c
Class Method Summary collapse
- .add_default_file(filename) ⇒ Object
- .default_files ⇒ Object
-
.find_module_in_path(module_file) ⇒ Object
guint gtk_rc_parse_color (GScanner *scanner, GdkColor *color); guint gtk_rc_parse_color_full (GScanner *scanner, GtkRcStyle *style, GdkColor *color); guint gtk_rc_parse_state (GScanner *scanner, GtkStateType *state); guint gtk_rc_parse_priority (GScanner *scanner, GtkPathPriorityType *priority);.
-
.get_style(widget) ⇒ Object
static VALUE rc_scanner_new(VALUE self) { return BOXED2RVAL(gtk_rc_scanner_new(), GTK_TYPE_GSCANNER); }.
- .get_style_by_paths(*args) ⇒ Object
- .im_module_file ⇒ Object
- .im_module_path ⇒ Object
-
.module_dir ⇒ Object
gchar* gtk_rc_find_pixmap_in_path (GtkSettings *settings, GScanner *scanner, const gchar *pixmap_file);.
- .parse(filename) ⇒ Object
- .parse_string(rc_string) ⇒ Object
- .reparse_all ⇒ Object
- .reparse_all_for_settings(settings, force_load) ⇒ Object
- .reset_styles(settings) ⇒ Object
- .set_default_files(filenames) ⇒ Object
- .theme_dir ⇒ Object
Class Method Details
.add_default_file(filename) ⇒ Object
99 100 101 102 103 104 |
# File 'ext/gtk2/rbgtkrc.c', line 99
static VALUE
rc_add_default_file(VALUE self, VALUE filename)
{
gtk_rc_add_default_file(RVAL2CSTR(filename));
return filename;
}
|
.default_files ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 |
# File 'ext/gtk2/rbgtkrc.c', line 106
static VALUE
rc_get_default_files(VALUE self)
{
gchar** files = gtk_rc_get_default_files();
VALUE ary = rb_ary_new();
while(*files){
rb_ary_push(ary, CSTR2RVAL(*files));
files++;
}
return ary;
}
|
.find_module_in_path(module_file) ⇒ Object
guint gtk_rc_parse_color (GScanner *scanner,
GdkColor *color);
guint gtk_rc_parse_color_full (GScanner *scanner,
GtkRcStyle *style,
GdkColor *color);
guint gtk_rc_parse_state (GScanner *scanner,
GtkStateType *state);
guint gtk_rc_parse_priority (GScanner *scanner,
GtkPathPriorityType *priority);
142 143 144 145 146 |
# File 'ext/gtk2/rbgtkrc.c', line 142
static VALUE
rc_find_module_in_path(VALUE self, VALUE module_file)
{
return CSTR2RVAL_FREE(gtk_rc_find_module_in_path(RVAL2CSTR(module_file)));
}
|
.get_style(widget) ⇒ Object
static VALUE rc_scanner_new(VALUE self)
return BOXED2RVAL(gtk_rc_scanner_new(), GTK_TYPE_GSCANNER);
25 26 27 28 29 30 31 32 33 34 35 |
# File 'ext/gtk2/rbgtkrc.c', line 25
static VALUE
rc_get_style(VALUE self, VALUE widget)
{
GtkStyle* style = gtk_rc_get_style(GTK_WIDGET(RVAL2GOBJ(widget)));
GType gtype = G_OBJECT_TYPE(style);
const gchar* name = G_OBJECT_TYPE_NAME(style);
if (! rb_const_defined_at(mGtk, rb_intern(name))){
G_DEF_CLASS(gtype, (gchar*)name, mGtk);
}
return GOBJ2RVAL(gtk_rc_get_style(GTK_WIDGET(RVAL2GOBJ(widget))));
}
|
.get_style_by_paths(*args) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'ext/gtk2/rbgtkrc.c', line 37
static VALUE
rc_get_style_by_paths(int argc, VALUE *argv, VALUE self)
{
VALUE settings, widget_path, class_path, klass;
GtkStyle* style;
GType gtype;
const gchar* name;
rb_scan_args(argc, argv, "13", &settings, &widget_path, &class_path, &klass);
style = gtk_rc_get_style_by_paths(GTK_SETTINGS(RVAL2GOBJ(settings)),
NIL_P(widget_path) ? NULL : RVAL2CSTR(widget_path),
NIL_P(class_path) ? NULL : RVAL2CSTR(class_path),
NIL_P(klass) ? G_TYPE_NONE : CLASS2GTYPE(klass));
if (style){
gtype = G_OBJECT_TYPE(style);
name = G_OBJECT_TYPE_NAME(style);
if (! rb_const_defined_at(mGtk, rb_intern(name))){
G_DEF_CLASS(gtype, (gchar*)name, mGtk);
}
return GOBJ2RVAL(style);
}
return Qnil;
}
|
.im_module_file ⇒ Object
166 167 168 169 170 |
# File 'ext/gtk2/rbgtkrc.c', line 166
static VALUE
rc_get_im_module_file(VALUE self)
{
return CSTR2RVAL(gtk_rc_get_im_module_file());
}
|
.im_module_path ⇒ Object
160 161 162 163 164 |
# File 'ext/gtk2/rbgtkrc.c', line 160
static VALUE
rc_get_im_module_path(VALUE self)
{
return CSTR2RVAL(gtk_rc_get_im_module_path());
}
|
.module_dir ⇒ Object
gchar* gtk_rc_find_pixmap_in_path (GtkSettings *settings,
GScanner *scanner,
const gchar *pixmap_file);
154 155 156 157 158 |
# File 'ext/gtk2/rbgtkrc.c', line 154
static VALUE
rc_get_module_dir(VALUE self)
{
return CSTR2RVAL_FREE(gtk_rc_get_module_dir());
}
|
.parse(filename) ⇒ Object
63 64 65 66 67 68 |
# File 'ext/gtk2/rbgtkrc.c', line 63
static VALUE
rc_parse(VALUE self, VALUE filename)
{
gtk_rc_parse(RVAL2CSTR(filename));
return filename;
}
|
.parse_string(rc_string) ⇒ Object
70 71 72 73 74 75 |
# File 'ext/gtk2/rbgtkrc.c', line 70
static VALUE
rc_parse_string(VALUE self, VALUE rc_string)
{
gtk_rc_parse_string(RVAL2CSTR(rc_string));
return rc_string;
}
|
.reparse_all ⇒ Object
77 78 79 80 81 |
# File 'ext/gtk2/rbgtkrc.c', line 77
static VALUE
rc_reparse_all(VALUE self)
{
return CBOOL2RVAL(gtk_rc_reparse_all());
}
|
.reparse_all_for_settings(settings, force_load) ⇒ Object
83 84 85 86 87 88 |
# File 'ext/gtk2/rbgtkrc.c', line 83
static VALUE
rc_reparse_all_for_settings(VALUE self, VALUE settings, VALUE force_load)
{
return CBOOL2RVAL(gtk_rc_reparse_all_for_settings(GTK_SETTINGS(RVAL2GOBJ(settings)),
RVAL2CBOOL(force_load)));
}
|
.reset_styles(settings) ⇒ Object
91 92 93 94 95 96 |
# File 'ext/gtk2/rbgtkrc.c', line 91
static VALUE
rc_reset_styles(VALUE self, VALUE settings)
{
gtk_rc_reset_styles(GTK_SETTINGS(RVAL2GOBJ(settings)));
return settings;
}
|
.set_default_files(filenames) ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'ext/gtk2/rbgtkrc.c', line 118
static VALUE
rc_set_default_files(VALUE self, VALUE filenames)
{
int i;
gchar** gfiles = g_new(gchar*, RARRAY_LEN(filenames) + 1);
for (i = 0; i < RARRAY_LEN(filenames); i++) {
gfiles[i] = RVAL2CSTR(RARRAY_PTR(filenames)[i]);
}
gfiles[RARRAY_LEN(filenames)] = NULL;
gtk_rc_set_default_files(gfiles);
return filenames;
}
|
.theme_dir ⇒ Object
172 173 174 175 176 |
# File 'ext/gtk2/rbgtkrc.c', line 172
static VALUE
rc_get_theme_dir(VALUE self)
{
return CSTR2RVAL_FREE(gtk_rc_get_theme_dir());
}
|