/*
 * Method: get_mark_category_background(category)
 * category: a category (as a string).
 *
 * Gets the background color which is associated with the given category.
 *
 * Returns: a Gdk::Color object if found, or nil if not found.
 */
static VALUE
rg_get_mark_category_background(VALUE self, VALUE category)
{
    GdkColor color;
    gboolean found;
    found = gtk_source_view_get_mark_category_background(_SELF (self),
                                                         RVAL2CSTR(category),
                                                         &color);
    if (found) {
        return GDKCOLOR2RVAL(&color);
    } else {
        return Qnil;
    }
}
Exemple #2
0
CAMLprim value ml_gtk_source_view_get_mark_category_background
(value sv, value s, value c) {
     CAMLparam3(sv, s, c);
     CAMLlocal2(color, result);
     GdkColor dest;

     if (gtk_source_view_get_mark_category_background(
	      GtkSourceView_val(sv), String_val(s), &dest)) {
	  color = Val_copy(dest);
	  result = alloc_small(1, 0);
	  Field(result, 0) = color;
     }
     else
	  result = Val_unit;

     CAMLreturn(result);
}