gtk-quartz-engine r7 - in trunk: . src



Author: rhult
Date: Tue Apr  8 18:03:53 2008
New Revision: 7
URL: http://svn.gnome.org/viewvc/gtk-quartz-engine?rev=7&view=rev

Log:
2008-04-08  Richard Hult  <richard imendio com>

	* src/*: More style cleanups, make all the rc style definitions
	use the macros. Add copyright information and header guards.


Modified:
   trunk/ChangeLog
   trunk/src/quartz-draw.c
   trunk/src/quartz-draw.h
   trunk/src/quartz-rc-style.c
   trunk/src/quartz-rc-style.h
   trunk/src/quartz-style.c
   trunk/src/quartz-style.h
   trunk/src/quartz-theme-main.c

Modified: trunk/src/quartz-draw.c
==============================================================================
--- trunk/src/quartz-draw.c	(original)
+++ trunk/src/quartz-draw.c	Tue Apr  8 18:03:53 2008
@@ -1,4 +1,8 @@
-/* This library is free software; you can redistribute it and/or
+/* GTK+ theme engine for the Quartz backend
+ *
+ * Copyright (C) 2007-2008 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.

Modified: trunk/src/quartz-draw.h
==============================================================================
--- trunk/src/quartz-draw.h	(original)
+++ trunk/src/quartz-draw.h	Tue Apr  8 18:03:53 2008
@@ -1,3 +1,26 @@
+/* GTK+ theme engine for the Quartz backend
+ *
+ * Copyright (C) 2007-2008 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef QUARTZ_DRAW_H
+#define QUARTZ_DRAW_H
+
 void quartz_draw_button (GtkStyle        *style,
                          GdkWindow       *window,
                          GtkStateType     state_type,
@@ -10,4 +33,4 @@
                          gint             width,
                          gint             height);
 
-//void quartz_measure_button (ThemeButtonKind kind);
+#endif /* QUARTZ_DRAW_H */

Modified: trunk/src/quartz-rc-style.c
==============================================================================
--- trunk/src/quartz-rc-style.c	(original)
+++ trunk/src/quartz-rc-style.c	Tue Apr  8 18:03:53 2008
@@ -1,4 +1,8 @@
-/* This library is free software; you can redistribute it and/or
+/* GTK+ theme engine for the Quartz backend
+ *
+ * Copyright (C) 2007-2008 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
@@ -19,9 +23,9 @@
 #include "quartz-style.h"
 #include "quartz-rc-style.h"
 
-static void quartz_rc_style_init (QuartzRcStyle * style);
-static void quartz_rc_style_class_init (QuartzRcStyleClass * klass);
-static GtkStyle *quartz_rc_style_create_style (GtkRcStyle * rc_style);
+static void      quartz_rc_style_init         (QuartzRcStyle      *style);
+static void      quartz_rc_style_class_init   (QuartzRcStyleClass *klass);
+static GtkStyle *quartz_rc_style_create_style (GtkRcStyle         *rc_style);
 
 static GtkRcStyleClass *parent_class;
 

Modified: trunk/src/quartz-rc-style.h
==============================================================================
--- trunk/src/quartz-rc-style.h	(original)
+++ trunk/src/quartz-rc-style.h	Tue Apr  8 18:03:53 2008
@@ -1,4 +1,8 @@
-/* This library is free software; you can redistribute it and/or
+/* GTK+ theme engine for the Quartz backend
+ *
+ * Copyright (C) 2007-2008 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
@@ -34,8 +38,6 @@
 struct _QuartzRcStyle
 {
   GtkRcStyle parent_instance;
-
-        //GList *img_list;
 };
 
 struct _QuartzRcStyleClass

Modified: trunk/src/quartz-style.c
==============================================================================
--- trunk/src/quartz-style.c	(original)
+++ trunk/src/quartz-style.c	Tue Apr  8 18:03:53 2008
@@ -1,4 +1,8 @@
-/* This library is free software; you can redistribute it and/or
+/* GTK+ theme engine for the Quartz backend
+ *
+ * Copyright (C) 2007-2008 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
@@ -171,7 +175,6 @@
 static void
 style_setup_rc_styles (void)
 {
-  gchar *str;
   gchar buf[1024];
 
 #define RC_WIDGET(name,match,body,...)                                  \
@@ -238,26 +241,20 @@
              "Lucida Grande 9");
 
   /* TreeView column header (button). */
-  str = g_strdup_printf ("style \"quartz-tree-header\" = \"quartz-default\"\n"
-                         "{\n"
-                         "font_name = \"%s\"\n"
-                         "GtkWidget::focus-line-width = 0\n"
-                         "GtkWidget::draw-border = { 1, 1, 1, 1 }\n"
-                         "GtkButton::inner-border = { 3, 3, 1, 3 }\n"
-                         "}widget_class \"*.GtkTreeView.*Button*\" style \"quartz-tree-header\"\n"
-                         "widget_class \"*.GtkCTree.*Button*\" style \"quartz-tree-header\"\n",
-                         "Lucida Grande 11");
-  gtk_rc_parse_string (str);
-  g_free (str);
+  RC_WIDGET_CLASS ("quartz-tree-header", "*.GtkTreeView.*Button*",
+                   "font_name = \"%s\"\n"
+                   "GtkWidget::focus-line-width = 0\n"
+                   "GtkWidget::draw-border = { 1, 1, 1, 1 }\n"
+                   "GtkButton::inner-border = { 3, 3, 1, 3 }\n",
+                   "Lucida Grande 11");
+
+  /* Also apply to ctree headers. */
+  gtk_rc_parse_string ("widget_class \"*.GtkCTree.*Button*\" style \"quartz-tree-header\"\n");
 
   /* TreeView font. */
-  str = g_strdup_printf ("style \"quartz-tree-row\" = \"quartz-default\"\n"
-                         "{\n"
-                         "font_name = \"%s\"\n"
-                         "}widget_class \"*.GtkTreeView\" style \"quartz-tree-row\"\n",
-                         "Lucida Grande 11");
-  gtk_rc_parse_string (str);
-  g_free (str);
+  RC_WIDGET_CLASS ("quartz-tree-row", "*.GtkTreeView",
+                   "font_name = \"%s\"\n",
+                   "Lucida Grande 11");
 
   /* Entry. FIXME: This has some problems, we have to use exterior
    * focus to get any expose events at all for widget->window and not
@@ -280,15 +277,11 @@
                    "%s", "");
 
   /* MenuItem. */
-  str = g_strdup_printf ("style \"quartz-menu\" = \"quartz-default\"\n"
-                         "{\n"
-                         "font_name = \"%s\"\n"
-                         "xthickness = 0\n"
-                         "ythickness = 2\n"
-                         "}widget_class \"*MenuItem*\" style \"quartz-menu\"\n",
-                         "Lucida Grande 14");
-  gtk_rc_parse_string (str);
-  g_free (str);
+  RC_WIDGET_CLASS ("quartz-menu", "*MenuItem*",
+                   "font_name = \"%s\"\n"
+                   "xthickness = 0\n"
+                   "ythickness = 2\n",
+                   "Lucida Grande 14");
 
   /* ComboBox. We have to use thickness since the text isn't actually
    * a child of the button. This doesn't work perfectly, we get a

Modified: trunk/src/quartz-style.h
==============================================================================
--- trunk/src/quartz-style.h	(original)
+++ trunk/src/quartz-style.h	Tue Apr  8 18:03:53 2008
@@ -1,4 +1,8 @@
-/* This library is free software; you can redistribute it and/or
+/* GTK+ theme engine for the Quartz backend
+ *
+ * Copyright (C) 2007-2008 Imendio AB
+ *
+ * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.

Modified: trunk/src/quartz-theme-main.c
==============================================================================
--- trunk/src/quartz-theme-main.c	(original)
+++ trunk/src/quartz-theme-main.c	Tue Apr  8 18:03:53 2008
@@ -1,4 +1,8 @@
-/* This library is free software; you can redistribute it and/or
+/* GTK+ theme engine for the Quartz backend
+ *
+ * Copyright (C) 2007-2008 Imendio AB
+ * 
+ * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
@@ -15,8 +19,9 @@
  */
 
 #include <config.h>
+
 #include <gmodule.h>
-#include "gtk/gtk.h"
+#include <gtk/gtk.h>
 
 #include "quartz-style.h"
 #include "quartz-rc-style.h"



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