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



Author: rhult
Date: Mon Apr  7 20:09:31 2008
New Revision: 6
URL: http://svn.gnome.org/viewvc/gtk-quartz-engine?rev=6&view=rev

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

	* src/quartz-rc-style.h:
	* src/quartz-style.c:
	* src/quartz-style.h:
	* src/test.c: More style fixes.


Modified:
   trunk/ChangeLog
   trunk/src/quartz-rc-style.h
   trunk/src/quartz-style.c
   trunk/src/quartz-style.h
   trunk/src/test.c

Modified: trunk/src/quartz-rc-style.h
==============================================================================
--- trunk/src/quartz-rc-style.h	(original)
+++ trunk/src/quartz-rc-style.h	Mon Apr  7 20:09:31 2008
@@ -1,48 +1,48 @@
-/* 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_RC_STYLE_H
-#define QUARTZ_RC_STYLE_H
-
-#include <gtk/gtkrc.h>
-
-typedef struct _QuartzRcStyle QuartzRcStyle;
-typedef struct _QuartzRcStyleClass QuartzRcStyleClass;
-
-extern GType quartz_type_rc_style;
-
-#define QUARTZ_TYPE_RC_STYLE              quartz_type_rc_style
-#define QUARTZ_RC_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), QUARTZ_TYPE_RC_STYLE, QuartzRcStyle))
-#define QUARTZ_RC_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), QUARTZ_TYPE_RC_STYLE, QuartzRcStyleClass))
-#define QUARTZ_IS_RC_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), QUARTZ_TYPE_RC_STYLE))
-#define QUARTZ_IS_RC_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), QUARTZ_TYPE_RC_STYLE))
-#define QUARTZ_RC_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), QUARTZ_TYPE_RC_STYLE, QuartzRcStyleClass))
-
-struct _QuartzRcStyle
-{
-  GtkRcStyle parent_instance;
-  
-	//GList *img_list;
-};
-
-struct _QuartzRcStyleClass
-{
-  GtkRcStyleClass parent_class;
-};
-
-void quartz_rc_style_register_type (GTypeModule *module);
-
-#endif /* QUARTZ_RC_STYLE_H */
+/* 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_RC_STYLE_H
+#define QUARTZ_RC_STYLE_H
+
+#include <gtk/gtkrc.h>
+
+typedef struct _QuartzRcStyle QuartzRcStyle;
+typedef struct _QuartzRcStyleClass QuartzRcStyleClass;
+
+extern GType quartz_type_rc_style;
+
+#define QUARTZ_TYPE_RC_STYLE              quartz_type_rc_style
+#define QUARTZ_RC_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), QUARTZ_TYPE_RC_STYLE, QuartzRcStyle))
+#define QUARTZ_RC_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), QUARTZ_TYPE_RC_STYLE, QuartzRcStyleClass))
+#define QUARTZ_IS_RC_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), QUARTZ_TYPE_RC_STYLE))
+#define QUARTZ_IS_RC_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), QUARTZ_TYPE_RC_STYLE))
+#define QUARTZ_RC_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), QUARTZ_TYPE_RC_STYLE, QuartzRcStyleClass))
+
+struct _QuartzRcStyle
+{
+  GtkRcStyle parent_instance;
+
+        //GList *img_list;
+};
+
+struct _QuartzRcStyleClass
+{
+  GtkRcStyleClass parent_class;
+};
+
+void quartz_rc_style_register_type (GTypeModule *module);
+
+#endif /* QUARTZ_RC_STYLE_H */

Modified: trunk/src/quartz-style.c
==============================================================================
--- trunk/src/quartz-style.c	(original)
+++ trunk/src/quartz-style.c	Mon Apr  7 20:09:31 2008
@@ -239,23 +239,23 @@
 
   /* 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");
+                         "{\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);
 
   /* 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");
+                         "{\n"
+                         "font_name = \"%s\"\n"
+                         "}widget_class \"*.GtkTreeView\" style \"quartz-tree-row\"\n",
+                         "Lucida Grande 11");
   gtk_rc_parse_string (str);
   g_free (str);
 
@@ -550,10 +550,10 @@
         return;
 
       HIThemeDrawButton (&rect,
-			 &draw_info,
-			 context,
-			 kHIThemeOrientationNormal,
-			 NULL);
+                         &draw_info,
+                         context,
+                         kHIThemeOrientationNormal,
+                         NULL);
 
       gdk_quartz_drawable_release_context (GDK_WINDOW_OBJECT (window)->impl, context);
 
@@ -562,7 +562,7 @@
   else if (IS_DETAIL (detail, "button") || IS_DETAIL (detail, "buttondefault"))
     {
       if (GTK_IS_TREE_VIEW (widget->parent) || GTK_IS_CLIST (widget->parent))
-	{
+        {
           /* FIXME: refactor so that we can share this code with
            * normal buttons.
            */
@@ -603,9 +603,9 @@
           gdk_quartz_drawable_release_context (GDK_WINDOW_OBJECT (window)->impl, context);
 
           return;
-	}
+        }
       else /* Normal button. */
-	{
+        {
           ThemeButtonKind kind;
 
           if (is_path_bar_button (widget) || is_icon_only_button (widget))
@@ -631,7 +631,7 @@
                               x, y,
                               width, height);
           return;
-	}
+        }
     }
   else if (IS_DETAIL (detail, "toolbar"))
     {
@@ -742,11 +742,11 @@
       draw_info.itemType |= kThemeMenuItemPopUpBackground;
 
       if (state_type == GTK_STATE_INSENSITIVE)
-	draw_info.state = kThemeMenuDisabled;
+        draw_info.state = kThemeMenuDisabled;
       else if (state_type == GTK_STATE_PRELIGHT)
-	draw_info.state = kThemeMenuSelected;
+        draw_info.state = kThemeMenuSelected;
       else
-	draw_info.state = kThemeMenuActive;
+        draw_info.state = kThemeMenuActive;
 
       item_rect = CGRectMake (x, y, width, height);
 
@@ -1038,22 +1038,22 @@
       // FIXME: might want this? kThemeAdornmentDrawIndicatorOnly
 
       if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
-	draw_info.value = kThemeButtonOn;
+        draw_info.value = kThemeButtonOn;
       else
-	draw_info.value = kThemeButtonOff;
+        draw_info.value = kThemeButtonOff;
 
       if (state_type == GTK_STATE_ACTIVE)
-	draw_info.state = kThemeStatePressed;
+        draw_info.state = kThemeStatePressed;
       else if (state_type == GTK_STATE_INSENSITIVE)
-	draw_info.state = kThemeStateInactive;
+        draw_info.state = kThemeStateInactive;
       else
-	draw_info.state = kThemeStateActive;
+        draw_info.state = kThemeStateActive;
 
       if (GTK_WIDGET_HAS_FOCUS (widget))
-	draw_info.adornment |= kThemeAdornmentFocus;
+        draw_info.adornment |= kThemeAdornmentFocus;
 
       if (IS_DETAIL (detail, "buttondefault"))
-	draw_info.adornment |= kThemeAdornmentDefault;
+        draw_info.adornment |= kThemeAdornmentDefault;
 
       rect = CGRectMake (x, y+1, width, height);
 
@@ -1062,10 +1062,10 @@
         return;
 
       HIThemeDrawButton (&rect,
-			 &draw_info,
-			 context,
-			 kHIThemeOrientationNormal,
-			 NULL);
+                         &draw_info,
+                         context,
+                         kHIThemeOrientationNormal,
+                         NULL);
 
       gdk_quartz_drawable_release_context (GDK_WINDOW_OBJECT (window)->impl, context);
 
@@ -1102,22 +1102,22 @@
       draw_info.adornment = kThemeAdornmentNone;
 
       if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
-	draw_info.value = kThemeButtonOn;
+        draw_info.value = kThemeButtonOn;
       else
-	draw_info.value = kThemeButtonOff;
+        draw_info.value = kThemeButtonOff;
 
       if (state_type == GTK_STATE_ACTIVE)
-	draw_info.state = kThemeStatePressed;
+        draw_info.state = kThemeStatePressed;
       else if (state_type == GTK_STATE_INSENSITIVE)
-	draw_info.state = kThemeStateInactive;
+        draw_info.state = kThemeStateInactive;
       else
-	draw_info.state = kThemeStateActive;
+        draw_info.state = kThemeStateActive;
 
       if (GTK_WIDGET_HAS_FOCUS (widget))
-	draw_info.adornment |= kThemeAdornmentFocus;
+        draw_info.adornment |= kThemeAdornmentFocus;
 
       if (IS_DETAIL (detail, "buttondefault"))
-	draw_info.adornment |= kThemeAdornmentDefault;
+        draw_info.adornment |= kThemeAdornmentDefault;
 
       rect = CGRectMake (x, y, width, height);
 
@@ -1126,10 +1126,10 @@
         return;
 
       HIThemeDrawButton (&rect,
-			 &draw_info,
-			 context,
-			 kHIThemeOrientationNormal,
-			 NULL);
+                         &draw_info,
+                         context,
+                         kHIThemeOrientationNormal,
+                         NULL);
 
       gdk_quartz_drawable_release_context (GDK_WINDOW_OBJECT (window)->impl, context);
 
@@ -1156,17 +1156,17 @@
 
 static void
 draw_extension (GtkStyle        *style,
-		GdkWindow       *window,
-		GtkStateType     state_type,
-		GtkShadowType    shadow_type,
-		GdkRectangle    *area,
-		GtkWidget       *widget,
-		const gchar     *detail,
-		gint             x,
-		gint             y,
-		gint             width,
-		gint             height,
-		GtkPositionType  gap_side)
+                GdkWindow       *window,
+                GtkStateType     state_type,
+                GtkShadowType    shadow_type,
+                GdkRectangle    *area,
+                GtkWidget       *widget,
+                const gchar     *detail,
+                gint             x,
+                gint             y,
+                gint             width,
+                gint             height,
+                GtkPositionType  gap_side)
 {
   DEBUG_DRAW;
   if (widget
@@ -1233,8 +1233,8 @@
 
   return;
   parent_class->draw_extension (style, window, state_type,
-				shadow_type, area, widget, detail,
-				x, y, width, height, gap_side);
+                                shadow_type, area, widget, detail,
+                                x, y, width, height, gap_side);
 }
 
 static void
@@ -1315,9 +1315,9 @@
       draw_info.version = 0;
       draw_info.kind = kHIThemeFrameTextFieldSquare;
       if (state_type == GTK_STATE_INSENSITIVE)
-	draw_info.state = kThemeStateInactive;
+        draw_info.state = kThemeStateInactive;
       else
-	draw_info.state = kThemeStateActive;
+        draw_info.state = kThemeStateActive;
       draw_info.isFocused = GTK_WIDGET_HAS_FOCUS (widget);
 
       gtk_widget_style_get (widget,
@@ -1332,9 +1332,9 @@
         return;
 
       HIThemeDrawFrame (&rect,
-			&draw_info,
-			context,
-			kHIThemeOrientationNormal);
+                        &draw_info,
+                        context,
+                        kHIThemeOrientationNormal);
 
       gdk_quartz_drawable_release_context (GDK_WINDOW_OBJECT (window)->impl, context);
 
@@ -1449,9 +1449,9 @@
       draw_info.version = 0;
       draw_info.kind = kHIThemeFrameListBox;
       if (state_type == GTK_STATE_INSENSITIVE)
-	draw_info.state = kThemeStateInactive;
+        draw_info.state = kThemeStateInactive;
       else
-	draw_info.state = kThemeStateActive;
+        draw_info.state = kThemeStateActive;
       draw_info.isFocused = GTK_WIDGET_HAS_FOCUS (widget);
 
       rect = CGRectMake (x, y, width, height);
@@ -1461,9 +1461,9 @@
         return;
 
       HIThemeDrawFrame (&rect,
-			&draw_info,
-			context,
-			kHIThemeOrientationNormal);
+                        &draw_info,
+                        context,
+                        kHIThemeOrientationNormal);
 
       gdk_quartz_drawable_release_context (GDK_WINDOW_OBJECT (window)->impl, context);
 
@@ -1479,9 +1479,9 @@
       draw_info.version = 0;
       draw_info.kind = kHIThemeFrameListBox;
       if (state_type == GTK_STATE_INSENSITIVE)
-	draw_info.state = kThemeStateInactive;
+        draw_info.state = kThemeStateInactive;
       else
-	draw_info.state = kThemeStateActive;
+        draw_info.state = kThemeStateActive;
       draw_info.isFocused = GTK_WIDGET_HAS_FOCUS (widget);
 
       rect = CGRectMake (x, y, width, height);
@@ -1491,9 +1491,9 @@
         return;
 
       HIThemeDrawFrame (&rect,
-			&draw_info,
-			context,
-			kHIThemeOrientationNormal);
+                        &draw_info,
+                        context,
+                        kHIThemeOrientationNormal);
 
       gdk_quartz_drawable_release_context (GDK_WINDOW_OBJECT (window)->impl, context);
 
@@ -1535,19 +1535,19 @@
 
 static void
 draw_shadow_gap (GtkStyle        *style,
-		 GdkWindow       *window,
-		 GtkStateType     state_type,
-		 GtkShadowType    shadow_type,
-		 GdkRectangle    *area,
-		 GtkWidget       *widget,
-		 const gchar     *detail,
-		 gint             x,
-		 gint             y,
-		 gint             width,
-		 gint             height,
-		 GtkPositionType  gap_side,
-		 gint             gap_x,
-		 gint             gap_width)
+                 GdkWindow       *window,
+                 GtkStateType     state_type,
+                 GtkShadowType    shadow_type,
+                 GdkRectangle    *area,
+                 GtkWidget       *widget,
+                 const gchar     *detail,
+                 gint             x,
+                 gint             y,
+                 gint             width,
+                 gint             height,
+                 GtkPositionType  gap_side,
+                 gint             gap_x,
+                 gint             gap_width)
 {
   DEBUG_DRAW;
 
@@ -1586,11 +1586,11 @@
       draw_info.itemType |= kThemeMenuItemPopUpBackground;
 
       if (state_type == GTK_STATE_INSENSITIVE)
-	draw_info.state = kThemeMenuDisabled;
+        draw_info.state = kThemeMenuDisabled;
       else if (state_type == GTK_STATE_PRELIGHT)
-	draw_info.state = kThemeMenuSelected;
+        draw_info.state = kThemeMenuSelected;
       else
-	draw_info.state = kThemeMenuActive;
+        draw_info.state = kThemeMenuActive;
 
       item_rect = CGRectMake (x1, y, x2-x1, height);
 
@@ -1877,10 +1877,10 @@
     (GBaseInitFunc) NULL,
     (GBaseFinalizeFunc) NULL,
     (GClassInitFunc) quartz_style_class_init,
-    NULL,			/* class_finalize */
-    NULL,			/* class_data */
+    NULL,                       /* class_finalize */
+    NULL,                       /* class_data */
     sizeof (QuartzStyle),
-    0,			/* n_preallocs */
+    0,                  /* n_preallocs */
     (GInstanceInitFunc) NULL,
   };
 

Modified: trunk/src/quartz-style.h
==============================================================================
--- trunk/src/quartz-style.h	(original)
+++ trunk/src/quartz-style.h	Mon Apr  7 20:09:31 2008
@@ -1,47 +1,47 @@
-/* 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_STYLE_H
-#define QUARTZ_STYLE_H
-
-#include <gtk/gtkstyle.h>
-
-typedef struct _QuartzStyle QuartzStyle;
-typedef struct _QuartzStyleClass QuartzStyleClass;
-
-extern GType quartz_type_style;
-
-#define QUARTZ_TYPE_STYLE              quartz_type_style
-#define QUARTZ_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), QUARTZ_TYPE_STYLE, QuartzStyle))
-#define QUARTZ_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), QUARTZ_TYPE_STYLE, QuartzStyleClass))
-#define QUARTZ_IS_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), QUARTZ_TYPE_STYLE))
-#define QUARTZ_IS_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), QUARTZ_TYPE_STYLE))
-#define QUARTZ_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), QUARTZ_TYPE_STYLE, QuartzStyleClass))
-
-struct _QuartzStyle
-{
-  GtkStyle parent_instance;
-};
-
-struct _QuartzStyleClass
-{
-  GtkStyleClass parent_class;
-};
-
-void quartz_style_register_type (GTypeModule *module);
-void quartz_style_init (void);
-
-#endif /* QUARTZ_STYLE_H */
+/* 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_STYLE_H
+#define QUARTZ_STYLE_H
+
+#include <gtk/gtkstyle.h>
+
+typedef struct _QuartzStyle QuartzStyle;
+typedef struct _QuartzStyleClass QuartzStyleClass;
+
+extern GType quartz_type_style;
+
+#define QUARTZ_TYPE_STYLE              quartz_type_style
+#define QUARTZ_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), QUARTZ_TYPE_STYLE, QuartzStyle))
+#define QUARTZ_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), QUARTZ_TYPE_STYLE, QuartzStyleClass))
+#define QUARTZ_IS_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), QUARTZ_TYPE_STYLE))
+#define QUARTZ_IS_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), QUARTZ_TYPE_STYLE))
+#define QUARTZ_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), QUARTZ_TYPE_STYLE, QuartzStyleClass))
+
+struct _QuartzStyle
+{
+  GtkStyle parent_instance;
+};
+
+struct _QuartzStyleClass
+{
+  GtkStyleClass parent_class;
+};
+
+void quartz_style_register_type (GTypeModule *module);
+void quartz_style_init          (void);
+
+#endif /* QUARTZ_STYLE_H */

Modified: trunk/src/test.c
==============================================================================
--- trunk/src/test.c	(original)
+++ trunk/src/test.c	Mon Apr  7 20:09:31 2008
@@ -9,9 +9,9 @@
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   g_signal_connect (window,
-		    "destroy",
-		    G_CALLBACK (gtk_main_quit),
-		    NULL);
+                    "destroy",
+                    G_CALLBACK (gtk_main_quit),
+                    NULL);
 
   if (1)
     {
@@ -23,7 +23,7 @@
       gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
 
       button = gtk_button_new_with_label ("Quit");
-      g_signal_connect (button, 
+      g_signal_connect (button,
                         "clicked",
                         G_CALLBACK (gtk_main_quit),
                         NULL);



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