summaryrefslogtreecommitdiffstats
path: root/src/module.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-25 03:55:02 +0000
committerDavid Robillard <d@drobilla.net>2012-04-25 03:55:02 +0000
commitf10ce40c6a382f8f2721e2b7a4cbf8ad379c8826 (patch)
tree38664d1569d6ab28c6cd471b0e9643e0c1661531 /src/module.c
parente18aa5cf1c13ddc3bbcb8c007d85b8556baa7d85 (diff)
downloadganv-f10ce40c6a382f8f2721e2b7a4cbf8ad379c8826.tar.gz
ganv-f10ce40c6a382f8f2721e2b7a4cbf8ad379c8826.tar.bz2
ganv-f10ce40c6a382f8f2721e2b7a4cbf8ad379c8826.zip
Remove icon stuff.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4273 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/module.c')
-rw-r--r--src/module.c85
1 files changed, 15 insertions, 70 deletions
diff --git a/src/module.c b/src/module.c
index bb1e832..ba16fd7 100644
--- a/src/module.c
+++ b/src/module.c
@@ -57,13 +57,12 @@ ganv_module_init(GanvModule* module)
GANV_NODE(module)->impl->can_tail = FALSE;
impl->ports = g_ptr_array_new();
- impl->icon_box = NULL;
- impl->embed_item = NULL;
- impl->embed_width = 0;
- impl->embed_height = 0;
- impl->widest_input = 0.0;
- impl->widest_output = 0.0;
- impl->must_resize = TRUE;
+ impl->embed_item = NULL;
+ impl->embed_width = 0;
+ impl->embed_height = 0;
+ impl->widest_input = 0.0;
+ impl->widest_output = 0.0;
+ impl->must_resize = TRUE;
}
static void
@@ -161,9 +160,6 @@ measure(GanvModule* module, Metrics* m)
if (canvas_title) {
contents_width += title_w;
}
- if (impl->icon_box) {
- contents_width += MODULE_ICON_SIZE + PAD;
- }
m->embed_x = 0;
m->input_width = ganv_module_get_empty_port_breadth(module);
@@ -184,9 +180,6 @@ measure(GanvModule* module, Metrics* m)
? title_w + 10.0
: 1.0;
- if (impl->icon_box)
- m->width += MODULE_ICON_SIZE + 2;
-
// Title is wide, put inputs and outputs beside each other
m->horiz = (impl->widest_input + impl->widest_output + 10.0
< MAX(m->width, impl->embed_width));
@@ -234,9 +227,8 @@ measure(GanvModule* module, Metrics* m)
static void
place_title(GanvModule* module, GanvDirection dir)
{
- GanvBox* box = GANV_BOX(module);
- GanvText* canvas_title = GANV_NODE(module)->impl->label;
- GanvModuleImpl* impl = module->impl;
+ GanvBox* box = GANV_BOX(module);
+ GanvText* canvas_title = GANV_NODE(module)->impl->label;
double title_w, title_h;
title_size(module, &title_w, &title_h);
@@ -244,18 +236,11 @@ place_title(GanvModule* module, GanvDirection dir)
if (!canvas_title) {
return;
} else if (dir == GANV_DIRECTION_RIGHT) {
- if (impl->icon_box) {
- ganv_item_set(GANV_ITEM(canvas_title),
- "x", MODULE_ICON_SIZE + 1.0,
- "y", 2.0,
- NULL);
- } else {
- ganv_item_set(GANV_ITEM(canvas_title),
- "x", ((ganv_box_get_width(box) / 2.0)
- - (title_w / 2.0)),
- "y", 2.0,
- NULL);
- }
+ ganv_item_set(GANV_ITEM(canvas_title),
+ "x", ((ganv_box_get_width(box) / 2.0)
+ - (title_w / 2.0)),
+ "y", 2.0,
+ NULL);
} else {
ganv_item_set(GANV_ITEM(canvas_title),
"x", ((ganv_box_get_width(box) / 2.0)
@@ -277,10 +262,9 @@ resize_horiz(GanvModule* module)
double title_w, title_h;
title_size(module, &title_w, &title_h);
- // Basic height contains title, icon
+ // Basic height contains title
double header_height = 2.0 + title_h;
-
- double height = header_height;
+ double height = header_height;
if (impl->embed_item) {
ganv_item_set(impl->embed_item,
@@ -757,45 +741,6 @@ ganv_module_get_empty_port_depth(const GanvModule* module)
return ganv_canvas_get_font_size(canvas);
}
-void
-ganv_module_set_icon(GanvModule* module,
- GdkPixbuf* icon)
-{
- fprintf(stderr, "FIXME: icon\n");
- return;
-#if 0
- GanvModuleImpl* impl = module->impl;
-
- if (impl->icon_box) {
- gtk_object_destroy(GTK_OBJECT(impl->icon_box));
- impl->icon_box = NULL;
- }
-
- if (icon) {
- impl->icon_box = ganv_item_new(module,
- ganv_canvas_base_pixbuf_get_type(),
- "x", 8.0,
- "y", 10.0,
- "pixbuf", icon,
- NULL);
-
- const double icon_w = gdk_pixbuf_get_width(icon);
- const double icon_h = gdk_pixbuf_get_height(icon);
- const double scale = MODULE_ICON_SIZE / ((icon_w > icon_h)
- ? icon_w : icon_h);
- const double scale_trans[6] = {
- scale, 0.0, 0.0,
- scale, 0.0, 0.0
- };
-
- ganv_item_affine_relative(impl->icon_box, scale_trans);
- ganv_item_raise_to_top(impl->icon_box);
- ganv_item_show(impl->icon_box);
- }
- impl->must_resize = TRUE;
-#endif
-}
-
static void
on_embed_size_request(GtkWidget* widget,
GtkRequisition* r,