34G_DEFINE_TYPE(
LibCellRenderer, lib_cell_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
51 G_OBJECT_CLASS(lib_cell_renderer_parent_class)->constructed(obj);
72 color->red = (double)61.0/(
double)255.0;
73 color->green = (double)152.0/(
double)255.0;
83 GValue val = G_VALUE_INIT;
88 g_value_init(&val, G_TYPE_STRING);
89 g_value_set_string(&val, ((
struct gds_library *)g_value_get_pointer(value))->name);
90 g_object_set_property(
object,
"text", &val);
94 g_value_init(&val, G_TYPE_STRING);
95 g_value_set_string(&val, ((
struct gds_cell *)g_value_get_pointer(value))->name);
96 g_object_set_property(
object,
"text", &val);
101 g_value_init(&val, GDK_TYPE_RGBA);
103 g_value_set_boxed(&val, &color);
104 g_object_set_property(
object,
"foreground-rgba", &val);
108 G_OBJECT_WARN_INVALID_PROPERTY_ID(
object, param_id, pspec);
122 G_OBJECT_WARN_INVALID_PROPERTY_ID(
object, param_id, pspec);
131 GObjectClass *oclass = G_OBJECT_CLASS(klass);
138 "Library reference to be displayed",
141 "Cell reference to be displayed",
144 "Error level of this cell", 0, 255, 0, G_PARAM_WRITABLE);
Defines types and macros used by the GDS-Parser.
#define TYPE_LIB_CELL_RENDERER
static void lib_cell_renderer_set_property(GObject *object, guint param_id, const GValue *value, GParamSpec *pspec)
static GParamSpec * properties[PROP_COUNT]
static void convert_error_level_to_color(GdkRGBA *color, unsigned int error_level)
void lib_cell_renderer_init(LibCellRenderer *self)
GtkCellRenderer * lib_cell_renderer_new()
Create a new renderer for renderering gds_cell and gds_library elements.
#define LIB_CELL_RENDERER_ERROR_ERR
static void lib_cell_renderer_get_property(GObject *object, guint param_id, GValue *value, GParamSpec *pspec)
void lib_cell_renderer_class_init(LibCellRendererClass *klass)
static void lib_cell_renderer_constructed(GObject *obj)
#define LIB_CELL_RENDERER_ERROR_WARN
@ PROP_LIB
Library to display the name of.
@ PROP_ERROR_LEVEL
Error level of cell/library for coloring.
@ PROP_CELL
Cell to display the name of.
Header file for the LibCellRenderer GObject Class.
A Cell inside a gds_library.