Blob Blame History Raw
diff -rup soundtracker-0.6.8/app/Makefile.am soundtracker-0.6.8-no-gdk-pixbuf/app/Makefile.am
--- soundtracker-0.6.8/app/Makefile.am	2006-02-25 13:30:54.000000000 +0100
+++ soundtracker-0.6.8-no-gdk-pixbuf/app/Makefile.am	2011-02-12 19:54:21.775747321 +0100
@@ -42,9 +42,7 @@ soundtracker_SOURCES = \
 	xm-player.c xm-player.h \
 	tracer.c tracer.h
 
-if !NO_GDK_PIXBUF
-  soundtracker_SOURCES += scalablepic.c scalablepic.h
-endif
+soundtracker_SOURCES += scalablepic.c scalablepic.h
 
 if DRIVER_ALSA_050
   soundtracker_SOURCES += midi-050.c midi-utils-050.c midi-settings-050.c \
diff -rup soundtracker-0.6.8/app/Makefile.in soundtracker-0.6.8-no-gdk-pixbuf/app/Makefile.in
--- soundtracker-0.6.8/app/Makefile.in	2006-02-25 13:32:35.030737059 +0100
+++ soundtracker-0.6.8-no-gdk-pixbuf/app/Makefile.in	2011-02-12 20:10:01.341939139 +0100
@@ -36,7 +36,7 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 host_triplet = @host@
-@NO_GDK_PIXBUF_FALSE@am__append_1 = scalablepic.c scalablepic.h
+am__append_1 = scalablepic.c scalablepic.h
 @DRIVER_ALSA_050_TRUE@am__append_2 = midi-050.c midi-utils-050.c midi-settings-050.c \
 @DRIVER_ALSA_050_TRUE@	midi.h midi-settings.h midi-utils.h
 
@@ -266,7 +266,7 @@ am__soundtracker_SOURCES_DIST = audio.c 
 	midi-050.c midi-utils-050.c midi-settings-050.c midi.h \
 	midi-settings.h midi-utils.h midi-09x.c midi-utils-09x.c \
 	midi-settings-09x.c
-@NO_GDK_PIXBUF_FALSE@am__objects_1 = scalablepic.$(OBJEXT)
+am__objects_1 = scalablepic.$(OBJEXT)
 @DRIVER_ALSA_050_TRUE@am__objects_2 = midi-050.$(OBJEXT) \
 @DRIVER_ALSA_050_TRUE@	midi-utils-050.$(OBJEXT) \
 @DRIVER_ALSA_050_TRUE@	midi-settings-050.$(OBJEXT)
diff -rup soundtracker-0.6.8/app/scalablepic.c soundtracker-0.6.8-no-gdk-pixbuf/app/scalablepic.c
--- soundtracker-0.6.8/app/scalablepic.c	2003-03-02 14:54:05.000000000 +0100
+++ soundtracker-0.6.8-no-gdk-pixbuf/app/scalablepic.c	2011-02-12 19:54:21.776747325 +0100
@@ -54,20 +54,22 @@ guint scalable_pic_get_type (void)
     return (scalable_pic_type);
 }
 
-GtkWidget *scalable_pic_new (GdkPixbuf *pic)
+GtkWidget *scalable_pic_new (void)
 {
     ScalablePic *sp;
     
     GtkWidget *widget = GTK_WIDGET (gtk_type_new (scalable_pic_get_type ()));
     sp = SCALABLE_PIC (widget);
 
+#ifndef NO_GDK_PIXBUF
     sp->pic = pic;
     if(pic != NULL) {
 	sp->maxwidth = 1.414 * (gfloat)(sp->pic_width = gdk_pixbuf_get_width(sp->pic));
 	sp->maxheight = 1.414 * (gfloat)(sp->pic_height = gdk_pixbuf_get_height(sp->pic));
 	sp->copy = NULL;
     }
-    
+#endif
+
     return (widget);    
 }
 
@@ -137,7 +139,9 @@ static void scalable_pic_destroy (GtkObj
     g_return_if_fail (IS_SCALABLE_PIC (object));
     
     sp = SCALABLE_PIC (object);
+#ifndef NO_GDK_PIXBUF
     if (sp->copy != NULL) gdk_pixbuf_unref (sp->copy);
+#endif
     
     klass = gtk_type_class (gtk_widget_get_type ());
     if (GTK_OBJECT_CLASS (klass)->destroy)
@@ -146,7 +150,9 @@ static void scalable_pic_destroy (GtkObj
 
 static void scalable_pic_draw (GtkWidget *widget, GdkRectangle *area)
 {
-    gboolean need_resize = FALSE;    
+#ifndef NO_GDK_PIXBUF
+    gboolean need_resize = FALSE;
+#endif
 
     ScalablePic *sp;
     
@@ -155,6 +161,17 @@ static void scalable_pic_draw (GtkWidget
     
     sp = SCALABLE_PIC (widget);
 
+#ifdef NO_GDK_PIXBUF
+    const gint w = widget->allocation.width;
+    const gint h = widget->allocation.height;
+    gdk_window_clear_area (widget->window,
+			   0, 0, w, h);
+    GdkGC *gc = widget->style->fg_gc[widget->state];
+    gdk_draw_line (widget->window, gc,
+		   0, 0, w, h);
+    gdk_draw_line (widget->window, gc,
+		   0, h, w, 0);
+#else
     if(sp->pic == NULL)
 	return;
 
@@ -189,6 +206,7 @@ static void scalable_pic_draw (GtkWidget
     gdk_pixbuf_render_to_drawable (sp->copy, widget->window,
 	    widget->style->black_gc, area->x, area->y, area->x, area->y,
 	    area->width, area->height, GDK_RGB_DITHER_NORMAL, 0, 0);
+#endif
 }
 
 static void scalable_pic_size_request (GtkWidget *widget,
diff -rup soundtracker-0.6.8/app/scalablepic.h soundtracker-0.6.8-no-gdk-pixbuf/app/scalablepic.h
--- soundtracker-0.6.8/app/scalablepic.h	2003-03-02 14:54:11.000000000 +0100
+++ soundtracker-0.6.8-no-gdk-pixbuf/app/scalablepic.h	2011-02-12 19:54:21.777747329 +0100
@@ -24,9 +24,13 @@
 #ifndef __SCALABLE_PIC_H
 #define __SCALABLE_PIC_H
 
+#include <config.h>
+
 #include <gtk/gtk.h>
 #include <gtk/gtkwidget.h>
+#ifndef NO_GDK_PIXBUF
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -41,7 +45,9 @@ extern "C" {
 
 typedef struct _ScalablePic {
     GtkWidget widget;
+#ifndef NO_GDK_PIXBUF
     GdkPixbuf *pic, *copy;
+#endif
     gint maxwidth, maxheight, former_width, former_height, pic_width, pic_height;
 } ScalablePic;
 
@@ -49,8 +55,14 @@ typedef struct _ScalablePicClass {
     GtkWidgetClass parent_class;
 } ScalablePicClass;
 
-/* create a widget containing GdkPixbuf image */
+/* create a widget containing a scalable "x" drawn white on black,
+ * either with gdk-pixbuf or without
+ */
+#ifndef NO_GDK_PIXBUF
 GtkWidget *scalable_pic_new (GdkPixbuf *pic);
+#else
+GtkWidget *scalable_pic_new (void);
+#endif
 guint scalable_pic_get_type (void);
 
 #ifdef __cplusplus
diff -rup soundtracker-0.6.8/app/scope-group.c soundtracker-0.6.8-no-gdk-pixbuf/app/scope-group.c
--- soundtracker-0.6.8/app/scope-group.c	2003-05-17 13:16:36.000000000 +0200
+++ soundtracker-0.6.8-no-gdk-pixbuf/app/scope-group.c	2011-02-12 19:54:21.778747333 +0100
@@ -33,8 +33,8 @@
 
 #ifndef NO_GDK_PIXBUF
 #include <gdk-pixbuf/gdk-pixbuf.h>
-#include "scalablepic.h"
 #endif
+#include "scalablepic.h"
 
 #include "scope-group.h"
 #include "sample-display.h"
@@ -58,14 +58,12 @@ button_toggled (GtkWidget *widget,
 	s = SCOPE_GROUP(w->parent); /* button<-table<-scope_group */
 	s->on_mask = (s->on_mask & (~(1 << n))) | (on ? 1 << n : 0);/* set mask */
 
-#ifndef NO_GDK_PIXBUF
 	if (s->scopes_on) {
 	    gtk_widget_hide (on ? s->mutedpic[n] : GTK_WIDGET(s->scopes[n]));
 	    gtk_widget_show (on ? GTK_WIDGET(s->scopes[n]) : s->mutedpic[n]);
 	} else {
 	    (on ? gtk_widget_hide : gtk_widget_show)(GTK_WIDGET(s->mutedpic[n]));
 	}
-#endif
     }
 }
 
@@ -92,10 +90,8 @@ scope_group_set_num_channels (ScopeGroup
     // Reset all buttons (enable all channels)
     for(i = 0; i < 32; i++) {
 	gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(s->scopebuttons[i]), 1);
-#ifndef NO_GDK_PIXBUF
 	gtk_widget_hide (s->mutedpic[i]);
 	if (s->scopes_on) gtk_widget_show (GTK_WIDGET(s->scopes[i]));
-#endif
     }
 
     s->numchan = num_channels;
@@ -111,12 +107,8 @@ scope_group_enable_scopes (ScopeGroup *s
     s->scopes_on = enable;
 
     for(i = 0; i < 32; i++) {
-#ifdef NO_GDK_PIXBUF
-	(enable ? gtk_widget_show : gtk_widget_hide)(GTK_WIDGET(s->scopes[i]));
-#else
 	if (GTK_TOGGLE_BUTTON(s->scopebuttons[i])->active)
 	    (enable ? gtk_widget_show : gtk_widget_hide)(GTK_WIDGET(s->scopes[i]));
-#endif
     }
 }
 
@@ -298,9 +290,11 @@ scope_group_new (void)
 
 #ifndef NO_GDK_PIXBUF
 	thing = scalable_pic_new (mutedpic);
+#else
+	thing = scalable_pic_new ();
+#endif
 	gtk_box_pack_start(GTK_BOX(box), thing, TRUE, TRUE, 0);
 	s->mutedpic[i] = thing;
-#endif
 
 
 	thing = sample_display_new(FALSE);
diff -rup soundtracker-0.6.8/app/scope-group.h soundtracker-0.6.8-no-gdk-pixbuf/app/scope-group.h
--- soundtracker-0.6.8/app/scope-group.h	2003-03-02 15:18:42.000000000 +0100
+++ soundtracker-0.6.8-no-gdk-pixbuf/app/scope-group.h	2011-02-12 19:54:21.778747333 +0100
@@ -44,9 +44,7 @@ struct _ScopeGroup
     GtkWidget *table;
     SampleDisplay *scopes[32];
     GtkWidget *scopebuttons[32];
-#ifndef NO_GDK_PIXBUF
     GtkWidget *mutedpic[32];
-#endif
     int numchan;
     int scopes_on;
     int update_freq;