[xiph-commits] r12306 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Jan 4 16:37:00 PST 2007


Author: xiphmont
Date: 2007-01-04 16:36:55 -0800 (Thu, 04 Jan 2007)
New Revision: 12306

Added:
   trunk/sushivision/sushi-gtkrc.in
Removed:
   trunk/sushivision/sushi-gtkrc
Modified:
   trunk/sushivision/Makefile
   trunk/sushivision/main.c
   trunk/sushivision/panel-1d.c
   trunk/sushivision/panel-2d.c
Log:
Internalize the default gtk style settings



Modified: trunk/sushivision/Makefile
===================================================================
--- trunk/sushivision/Makefile	2007-01-04 23:21:30 UTC (rev 12305)
+++ trunk/sushivision/Makefile	2007-01-05 00:36:55 UTC (rev 12306)
@@ -60,7 +60,7 @@
 	$(MAKE) examples CFLAGS='-pg -g -O2 $(GCF) $(ADD_DEF)' LIBS='-lgprof-helper'
 
 clean:
-	rm -f *.o *.d *.d.* *.pc gmon.out $(TARGET) sushivision_*
+	rm -f *.o *.d *.d.* *.pc gmon.out $(TARGET) sushivision_* sushi-gtkrc.h
 
 distclean: clean
 	rm -f *~
@@ -68,6 +68,8 @@
 %.d: %.c
 	$(CC) -M $(CFLAGS) $< > $@.$$$$; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$
 
+main.o: sushi-gtkrc.h
+
 ifeq ($(MAKECMDGOALS),target)
 include $(SRC:.c=.d)
 endif
@@ -85,6 +87,13 @@
 	echo "cairover = $(CAIROVER)" >> sushivision.pc
 	cat sushivision.pc.in >> sushivision.pc	
 
+sushi-gtkrc.h: sushi-gtkrc.in
+	rm -f sushi-gtkrc.h
+	touch sushi-gtkrc.h
+	echo "static char *_SUSHI_GTKRC_STRING=" >> sushi-gtkrc.h
+	sed -e 's/\(\"\)/\\\"/g' -e 's/^\(.*\)$$/"\1\\n"/' sushi-gtkrc.in >> sushi-gtkrc.h
+	echo "\"\";" >> sushi-gtkrc.h
+
 target:  $(OBJ) examples sushivision.pc
 	$(LD) $(OBJ) $(CFLAGS) $(SOLDFLAGS) -o $(TARGET) $(LIBS) $(LDF)
 

Modified: trunk/sushivision/main.c
===================================================================
--- trunk/sushivision/main.c	2007-01-04 23:21:30 UTC (rev 12305)
+++ trunk/sushivision/main.c	2007-01-05 00:36:55 UTC (rev 12306)
@@ -33,8 +33,8 @@
 #include <pthread.h>
 #include <dlfcn.h>
 #include "internal.h"
+#include "sushi-gtkrc.h"
 
-
 static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t mc = PTHREAD_COND_INITIALIZER;
 sig_atomic_t _sushiv_exiting=0;
@@ -194,8 +194,7 @@
 }
 
 static char * gtkrc_string(){
-
-  return "";
+  return _SUSHI_GTKRC_STRING;
 }
 
 static void sushiv_realize_instance(sushiv_instance_t *s){

Modified: trunk/sushivision/panel-1d.c
===================================================================
--- trunk/sushivision/panel-1d.c	2007-01-04 23:21:30 UTC (rev 12305)
+++ trunk/sushivision/panel-1d.c	2007-01-05 00:36:55 UTC (rev 12306)
@@ -1315,12 +1315,10 @@
 
     /* label */
     {
-      char *buf;
-      asprintf(&buf,"%s range",p1->range_scale->legend);
-      GtkWidget *label = gtk_label_new(buf);
+      GtkWidget *label = gtk_label_new("range");
+      gtk_misc_set_alignment(GTK_MISC(label),1.,.5);
       gtk_table_attach(GTK_TABLE(p1->top_table),label,0,1,1,2,
-		       0,0,10,0);
-      free(buf);
+		       GTK_FILL,0,10,0);
     }
 
     /* the range slices/slider */ 
@@ -1355,8 +1353,9 @@
 
     /* label */
     GtkWidget *label = gtk_label_new(o->name);
+    gtk_misc_set_alignment(GTK_MISC(label),1.,.5);
     gtk_table_attach(GTK_TABLE(p1->obj_table),label,0,1,i,i+1,
-		     0,0,10,0);
+		     GTK_FILL,0,10,0);
     
     /* mapping pulldown */
     {
@@ -1430,8 +1429,9 @@
       
       /* label */
       GtkWidget *label = gtk_label_new(d->name);
+      gtk_misc_set_alignment(GTK_MISC(label),1.,.5);
       gtk_table_attach(GTK_TABLE(p1->dim_table),label,0,1,i,i+1,
-		       0,0,10,0);
+		       GTK_FILL,0,10,0);
       
       /* x radio buttons */
       if(!(d->flags & SUSHIV_DIM_NO_X) && !p1->link_x && !p1->link_y){

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2007-01-04 23:21:30 UTC (rev 12305)
+++ trunk/sushivision/panel-2d.c	2007-01-05 00:36:55 UTC (rev 12306)
@@ -1189,8 +1189,9 @@
 
     /* label */
     GtkWidget *label = gtk_label_new(o->name);
+    gtk_misc_set_alignment(GTK_MISC(label),1.,.5);
     gtk_table_attach(GTK_TABLE(p2->top_table),label,0,1,i+1,i+2,
-		     0,0,10,0);
+		     GTK_FILL,0,10,0);
     
     /* mapping pulldown */
     {
@@ -1239,8 +1240,9 @@
 
     /* label */
     GtkWidget *label = gtk_label_new(d->name);
+    gtk_misc_set_alignment(GTK_MISC(label),1.,.5);
     gtk_table_attach(GTK_TABLE(p2->dim_table),label,0,1,i,i+1,
-		     0,0,10,0);
+		     GTK_FILL,0,10,0);
     
     /* x/y radio buttons */
     if(!(d->flags & SUSHIV_DIM_NO_X)){

Deleted: trunk/sushivision/sushi-gtkrc
===================================================================
--- trunk/sushivision/sushi-gtkrc	2007-01-04 23:21:30 UTC (rev 12305)
+++ trunk/sushivision/sushi-gtkrc	2007-01-05 00:36:55 UTC (rev 12306)
@@ -1,202 +0,0 @@
-style "button-poppy" {
-	bg[NORMAL]="#80a0ff" 
-	bg[ACTIVE]="#c0f0ff" 
-	bg[PRELIGHT]="#c0f0ff" 
-
-	text[NORMAL]="#000000"
-	text[ACTIVE]="#000000"
-	text[PRELIGHT]="#000000" 
-
-	fg[NORMAL]="#000000"
-	fg[ACTIVE]="#000000"
-	fg[PRELIGHT]="#000000" 
-
-	font_name = "sans 8"
-
-	GtkWidget::focus_line_width       = 1
-	GtkWidget::focus_padding                     = 0 
-	GtkWidget::interior_focus                    = 0 
-	GtkWidget::internal_padding                  = 0 
-
-}
-
-style "panel-label" {
-	font_name = "sans bold 11"
-}
-
-style "panel-text" {
-	font_name = "sans 9"
-}
-
-style "small-marker" {
-        fg[NORMAL]="#905050" 
-	font_name = "sans 6"
-}
-
-style "scale-marker" {
-	font_name = "sans 7"
-}
-
-style "frame-label" {
-	font_name = "sans bold 10"
-}
-
-style "frame-text" {
-	font_name = "sans 9"
-}
-
-style "check-poppy" {
-	bg[NORMAL]="#80a0ff" 
-
-	font_name = "sans 8"	
-	GtkButton::focus-padding = 0
-	GtkButton::focus-line-width = 1
-	GtkButton::interior-focus = 0
-}
-
-style "slider" {
-	bg[NORMAL]="#80a0ff" 
-	bg[PRELIGHT]="#c0f0ff" 
-	GtkWidget::focus-padding = 0
-	GtkWidget::focus-line-width = 1
-	GtkWidget::interior-focus = 0
-}
-
-style "multibar" {
-        bg[NORMAL]="#80a0ff" 
-        bg[ACTIVE]="#b0b0b0" 
-        bg[PRELIGHT]="#c0f0ff" 
-
-        fg[NORMAL]="#000000" 
-        fg[ACTIVE]="#ff8080" 
-        fg[PRELIGHT]="#f0f080" 
-
-        text[NORMAL]="#c0c0d0" 
-        text[ACTIVE]="#ffb0b0" 
-        font_name = "sans 7"    
-}
-
-style "multislide" {
-        bg[NORMAL]="#80a0ff" 
-        bg[ACTIVE]="#b0b0b0" 
-        bg[PRELIGHT]="#c0f0ff" 
-
-        fg[NORMAL]="#000000" 
-        fg[ACTIVE]="#ff8080" 
-        fg[PRELIGHT]="#f0f080" 
-
-        text[NORMAL]="#707070" 
-        text[ACTIVE]="#905050" 
-        font_name = "sans 7"    
-}
-
-style "clipbar" {
-	fg[NORMAL]="#404040" 
-	fg[ACTIVE]="#ff8080" 
-	text[NORMAL]="#c0c0d0" 
-	text[ACTIVE]="#c0c0d0" 
-	font_name = "sans 8"	
-}
-
-style "readout" {
-	base[NORMAL]="#ffffff" 
-	base[ACTIVE]="#ffffff" 
-	bg[NORMAL]="#ffffff" 
-	bg[ACTIVE]="#ffffff" 
-
-	font_name = "Fixed, Nimbus Mono L, Courier, Monospace 10"	
-}
-
-style "small-readout" {
-	base[NORMAL]="#ffffff" 
-	base[ACTIVE]="#ffffff" 
-	bg[NORMAL]="#ffffff" 
-	bg[ACTIVE]="#ffffff" 
-	text[NORMAL]="#606060"
-	font_name = "Fixed, Nimbus Mono L, Courier, Monospace 8"	
-}
-
-style "darkpanel" {
-	bg[NORMAL]="#b0b0b0" 
-	bg[INSENSITIVE]="#b0b0b0" 
-}
-
-style "quitbutton" {
-	bg[NORMAL]="#d0d0d0"
-	bg[PRELIGHT]="#ffc0c0"
-	bg[ACTIVE]="#ffc0c0"
-	font_name = "sans 8"	
-	GtkButton::focus-padding = 0
-	GtkButton::focus-line-width = 1
-	GtkButton::interior-focus = 0
-}
-
-style "left" {
-	text[NORMAL] = "#606060"
-	text[ACTIVE] = "#606060"
-	text[SELECTED] = "#606060"
-	text[PRELIGHT] = "#606060"
-	fg[ACTIVE] = "#606060"
-	bg[NORMAL]="#80a0ff" 
-}
-style "right" {
-	text[NORMAL] = "#cc0000"
-	text[ACTIVE] = "#cc0000"
-	text[SELECTED] = "#cc0000"
-	text[PRELIGHT] = "#cc0000"
-	bg[NORMAL]="#80a0ff" 
-}
-style "mid" {
-	text[NORMAL] = "#0000fc"
-	text[ACTIVE] = "#0000fc"
-	text[SELECTED] = "#0000fc"
-	text[PRELIGHT] = "#0000fc"
-	bg[NORMAL]="#80a0ff" 
-}
-style "side" {
-	text[NORMAL] = "#00B200"
-	text[ACTIVE] = "#00B200"
-	text[SELECTED] = "#00B200"
-	text[PRELIGHT] = "#00B200"
-	bg[NORMAL]="#80a0ff" 
-}
-
-widget "*.GtkLabel" style "panel-text"
-widget "*.scalemarker" style "scale-marker"
-widget "*.smallmarker" style "small-marker"
-
-widget "*.color0" style "left"
-widget "*.color1" style "right"
-widget "*.color2" style "mid"
-widget "*.color3" style "side"
-
-widget "*.panelbox*" style "darkpanel"
-widget "*.winpanel*" style "darkpanel"
-
-widget "*.choiceframe.*" style "frame-text"
-widget "*.GtkFrame.GtkLabel" style "frame-label"
-widget "*.GtkFrame.GtkHBox.GtkLabel" style "frame-label"
-widget "*.framelabel" style "frame-label"
-
-widget "*.Readout*" style "readout"
-widget "*.smallreadout" style "small-readout"
-widget "*.GtkEntry" style "readout"
-widget "*.GtkHScale" style "slider"
-widget "*.GtkMenu*" style "button-poppy"
-widget "*.GtkComboBox*" style "button-poppy"
-widget "*.GtkToggleButton*" style "button-poppy"
-widget "*.GtkButton*" style "button-poppy"
-widget "*.GtkCheckButton" style "check-poppy"
-widget "*.Windowbutton*" style "button-poppy"
-widget "*.windowbuttonlike" style "button-poppy"
-widget "*.quitbutton" style "quitbutton"
-widget "*.quitbutton.GtkLabel" style "quitbutton"
-
-widget "*.panelbutton*" style "button-poppy"
-widget "*.panelbutton*.GtkLabel" style "panel-label"
-widget "*.Multibar*" style "multibar"
-widget "*.Multislide*" style "multislide"
-
-widget "*.clipbar*" style "clipbar"
-
-widget "*.Slider" style "button-poppy"

Added: trunk/sushivision/sushi-gtkrc.in
===================================================================
--- trunk/sushivision/sushi-gtkrc.in	2007-01-04 23:21:30 UTC (rev 12305)
+++ trunk/sushivision/sushi-gtkrc.in	2007-01-05 00:36:55 UTC (rev 12306)
@@ -0,0 +1,48 @@
+style "button-poppy" {
+	bg[NORMAL]="#80a0ff" 
+	bg[ACTIVE]="#c0f0ff" 
+	bg[PRELIGHT]="#c0f0ff" 
+
+	text[NORMAL]="#000000"
+	text[ACTIVE]="#000000"
+	text[PRELIGHT]="#000000" 
+
+	fg[NORMAL]="#000000"
+	fg[ACTIVE]="#000000"
+	fg[PRELIGHT]="#000000" 
+
+	font_name = "sans 8"
+
+	GtkWidget::focus_line_width = 1
+	GtkWidget::focus_padding = 0 
+	GtkWidget::interior_focus = 0 
+	GtkWidget::internal_padding = 0 
+
+}
+
+style "panel-text" {
+	font_name = "sans 9"
+}
+
+style "frame-label" {
+	font_name = "sans bold 10"
+}
+
+style "readout" {
+	base[NORMAL]="#ffffff" 
+	base[ACTIVE]="#ffffff" 
+	bg[NORMAL]="#ffffff" 
+	bg[ACTIVE]="#ffffff" 
+
+	font_name = "Fixed, Nimbus Mono L, Courier, Monospace 10"	
+}
+
+widget "*.GtkLabel" style "panel-text"
+widget "*.GtkFrame.GtkLabel" style "frame-label"
+widget "*.GtkFrame.GtkHBox.GtkLabel" style "frame-label"
+widget "*.GtkEntry" style "readout"
+widget "*.GtkMenu*" style "button-poppy"
+widget "*.GtkComboBox*" style "button-poppy"
+widget "*.GtkToggleButton*" style "button-poppy"
+widget "*.GtkButton*" style "button-poppy"
+widget "*.Slider" style "button-poppy"



More information about the commits mailing list