gtk-css-engine r207 - in trunk: . src



Author: robsta
Date: Thu Dec 11 17:38:35 2008
New Revision: 207
URL: http://svn.gnome.org/viewvc/gtk-css-engine?rev=207&view=rev

Log:
* configure.in:
* src/Makefile.am:
* src/css2gtkrc.c (main):
* src/gce-functions.h:
* src/gce-node.c:
* src/gce-properties.c:
* src/gce-properties.h:
* src/gce-rc-style.c (parse):
* src/gce-rc-style.h:
* src/gce-serialize.c:
* src/gce-serialize.h:
* src/gce-style.h:
Use ccss-gtk on top of ccss-cairo.

* src/gce-theme.c (theme_init), (theme_exit): no more need to init()
and shutdown() ccss.



Removed:
   trunk/src/gce-properties.c
   trunk/src/gce-properties.h
   trunk/src/gce-serialize.c
   trunk/src/gce-serialize.h
Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/Makefile.am
   trunk/src/css2gtkrc.c
   trunk/src/gce-functions.h
   trunk/src/gce-node.c
   trunk/src/gce-rc-style.c
   trunk/src/gce-rc-style.h
   trunk/src/gce-style.h
   trunk/src/gce-theme.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Thu Dec 11 17:38:35 2008
@@ -77,8 +77,11 @@
 
 ### Checks for libraries. ######################################################
 
+GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
+AC_SUBST(GTK_VERSION) 
+
 # Maybe it would work with gtk+-2.8, the first sporting cairo, right?
-pkgs='gtk+-2.0 >= 2.10 libccss-cairo-1 >= 0.2'
+pkgs='libccss-gtk-1 >= 0.2'
 
 AC_MSG_CHECKING([for SVG support in libccss-cairo])
 with_rsvg=`$PKG_CONFIG --variable=ccss_with_rsvg libccss-cairo-1`

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Thu Dec 11 17:38:35 2008
@@ -30,12 +30,8 @@
 	gce-maps.h \
 	gce-node.c \
 	gce-node.h \
-	gce-properties.c \
-	gce-properties.h \
 	gce-rc-style.c \
 	gce-rc-style.h \
-	gce-serialize.c \
-	gce-serialize.h \
 	gce-style.c \
 	gce-style.h \
 	gce-theme.c
@@ -45,11 +41,7 @@
 css2gtkrc_CPPFLAGS = $(_cppflags)
 
 css2gtkrc_SOURCES = \
-	css2gtkrc.c \
-	gce-properties.c \
-	gce-properties.h \
-	gce-serialize.c \
-	gce-serialize.h
+	css2gtkrc.c
 
 css2gtkrc_LDADD = \
 	$(GCE_LIBS)

Modified: trunk/src/css2gtkrc.c
==============================================================================
--- trunk/src/css2gtkrc.c	(original)
+++ trunk/src/css2gtkrc.c	Thu Dec 11 17:38:35 2008
@@ -20,8 +20,7 @@
 #include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include "gce-properties.h"
-#include "gce-serialize.h"
+#include <ccss-gtk/ccss-gtk.h>
 #include "config.h"
 
 int
@@ -31,29 +30,28 @@
 	ccss_grammar_t			*grammar;
 	ccss_stylesheet_t		*stylesheet;
 	char				*gtkrc;
+	int				 ret = EXIT_FAILURE;
 
 	if (argc <= 1) {
 		fprintf (stderr, "Need filename.\n");
 		return EXIT_FAILURE;
 	}
 
-	ccss_cairo_init ();
-
-	grammar = ccss_cairo_grammar_create ();
-//	ccss_grammar_add_properties (grammar, gce_properties_get_ptable ());
-//	ccss_grammar_add_functions (grammar, gce_functions_get_vtable ());
-
+	grammar = ccss_gtk_grammar_create ();
 	stylesheet = ccss_grammar_create_stylesheet_from_file (grammar, argv[1],
 							       NULL);
-	g_assert (stylesheet);
+	ccss_grammar_destroy (grammar), grammar = NULL;
+
+	if (NULL == stylesheet) {
+		goto bail;
+	}
 
-	gtkrc = gce_serialize (stylesheet);
+	gtkrc = ccss_gtk_stylesheet_to_gtkrc (stylesheet);
 	ccss_stylesheet_destroy (stylesheet), stylesheet = NULL;
-	ccss_grammar_destroy (grammar), grammar = NULL;
 
 	if (NULL == gtkrc) {
 		fprintf (stderr, "Conversion failed.\n");
-		return EXIT_FAILURE;
+		goto bail;
 	}
 
 	puts (gtkrc);
@@ -61,7 +59,9 @@
 
 	g_free (gtkrc), gtkrc = NULL;
 
-	ccss_cairo_shutdown ();
+	ret = EXIT_SUCCESS;
 
-	return EXIT_SUCCESS;
+bail:
+	return ret;
 }
+

Modified: trunk/src/gce-functions.h
==============================================================================
--- trunk/src/gce-functions.h	(original)
+++ trunk/src/gce-functions.h	Thu Dec 11 17:38:35 2008
@@ -20,7 +20,7 @@
 #ifndef GCE_FUNCTIONS_H
 #define GCE_FUNCTIONS_H
 
-#include <ccss-cairo/ccss-cairo.h>
+#include <ccss-gtk/ccss-gtk.h>
 
 G_BEGIN_DECLS
 

Modified: trunk/src/gce-node.c
==============================================================================
--- trunk/src/gce-node.c	(original)
+++ trunk/src/gce-node.c	Thu Dec 11 17:38:35 2008
@@ -18,7 +18,7 @@
  */
 
 #include <string.h>
-#include <ccss-cairo/ccss-cairo.h>
+#include <ccss-gtk/ccss-gtk.h>
 #include "gce-maps.h"
 #include "gce-node.h"
 #include "config.h"

Modified: trunk/src/gce-rc-style.c
==============================================================================
--- trunk/src/gce-rc-style.c	(original)
+++ trunk/src/gce-rc-style.c	Thu Dec 11 17:38:35 2008
@@ -20,9 +20,7 @@
 #include <gtk/gtk.h>
 #include <string.h>
 #include "gce-functions.h"
-#include "gce-properties.h"
 #include "gce-rc-style.h"
-#include "gce-serialize.h"
 #include "gce-style.h"
 #include "config.h"
 
@@ -93,8 +91,7 @@
 		gce_file = gtk_rc_find_pixmap_in_path (gtk_settings_get_default (), 
 				scanner, scanner->value.v_string);
 
-		grammar = ccss_cairo_grammar_create ();
-		ccss_grammar_add_properties (grammar, gce_properties_get_ptable ());
+		grammar = ccss_gtk_grammar_create ();
 		ccss_grammar_add_functions (grammar, gce_functions_get_vtable ());
 		stylesheet = ccss_grammar_create_stylesheet_from_file (grammar,
 								gce_file, NULL);
@@ -124,7 +121,7 @@
 
 		if (g_getenv ("GCE_PREVIEW") != NULL) {
 			char *rc_string;
-			rc_string = gce_serialize (stylesheet);
+			rc_string = ccss_gtk_stylesheet_to_gtkrc (stylesheet);
 			if (rc_string) {
 				gtk_rc_parse_string (rc_string);
 				g_free (rc_string), rc_string = NULL;

Modified: trunk/src/gce-rc-style.h
==============================================================================
--- trunk/src/gce-rc-style.h	(original)
+++ trunk/src/gce-rc-style.h	Thu Dec 11 17:38:35 2008
@@ -20,7 +20,7 @@
 #ifndef GCE_RC_STYLE_H
 #define GCE_RC_STYLE_H
 
-#include <ccss-cairo/ccss-cairo.h>
+#include <ccss-gtk/ccss-gtk.h>
 #include <glib.h>
 #include <glib-object.h>
 

Modified: trunk/src/gce-style.h
==============================================================================
--- trunk/src/gce-style.h	(original)
+++ trunk/src/gce-style.h	Thu Dec 11 17:38:35 2008
@@ -20,7 +20,7 @@
 #ifndef GCE_STYLE_H
 #define GCE_STYLE_H
 
-#include <ccss-cairo/ccss-cairo.h>
+#include <ccss-gtk/ccss-gtk.h>
 #include <glib.h>
 #include <glib-object.h>
 

Modified: trunk/src/gce-theme.c
==============================================================================
--- trunk/src/gce-theme.c	(original)
+++ trunk/src/gce-theme.c	Thu Dec 11 17:38:35 2008
@@ -17,7 +17,6 @@
  * MA 02110-1301, USA.
  */
 
-#include <ccss-cairo/ccss-cairo.h>
 #include <gmodule.h>
 #include <gtk/gtk.h>
 #include "gce-style.h"
@@ -35,14 +34,12 @@
 {
 	gce_rc_style_register_type (module);
 	gce_style_register_type (module);
-
-	ccss_cairo_init ();
 }
 
 G_MODULE_EXPORT void 
 theme_exit (void)
 {
-	ccss_cairo_shutdown ();
+	/* Nothing to do. */
 }
 
 G_MODULE_EXPORT GtkRcStyle*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]