SOURCES: gtk+2-bug344743.patch (NEW), gtk+2-bug344765.patch (NEW), ...

freetz freetz at pld-linux.org
Thu Jun 15 09:33:06 CEST 2006


Author: freetz                       Date: Thu Jun 15 07:33:06 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- http://bugzilla.gnome.org/show_bug.cgi?id=344743
  http://bugzilla.gnome.org/show_bug.cgi?id=344765
  http://bugzilla.gnome.org/show_bug.cgi?id=344867
  http://bugzilla.gnome.org/show_bug.cgi?id=344891

---- Files affected:
SOURCES:
   gtk+2-bug344743.patch (NONE -> 1.1)  (NEW), gtk+2-bug344765.patch (NONE -> 1.1)  (NEW), gtk+2-bug344867.patch (NONE -> 1.1)  (NEW), gtk+2-bug344891.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/gtk+2-bug344743.patch
diff -u /dev/null SOURCES/gtk+2-bug344743.patch:1.1
--- /dev/null	Thu Jun 15 09:33:06 2006
+++ SOURCES/gtk+2-bug344743.patch	Thu Jun 15 09:33:00 2006
@@ -0,0 +1,36 @@
+Index: gtk/gtkselection.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gtk/gtkselection.c,v
+retrieving revision 1.108
+diff -u -r1.108 gtkselection.c
+--- gtk/gtkselection.c	7 Mar 2006 13:45:55 -0000	1.108
++++ gtk/gtkselection.c	13 Jun 2006 07:48:01 -0000
+@@ -1700,6 +1700,9 @@
+ 
+   /* Keep in sync with gtk_target_list_add_text_targets()
+    */
++
++  init_atoms();
++
+   for (i = 0; i < n_targets; i++)
+     {
+       if (targets[i] == utf8_atom ||
+@@ -1744,6 +1747,8 @@
+ 
+   g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE);
+ 
++  init_atoms();
++
+   rich_targets = gtk_text_buffer_get_deserialize_formats (buffer,
+                                                           &n_rich_targets);
+ 
+@@ -1930,6 +1935,9 @@
+ 
+   /* Keep in sync with gtk_target_list_add_uri_targets()
+    */
++
++  init_atoms();
++
+   for (i = 0; i < n_targets; i++)
+     {
+       if (targets[i] == text_uri_list_atom)

================================================================
Index: SOURCES/gtk+2-bug344765.patch
diff -u /dev/null SOURCES/gtk+2-bug344765.patch:1.1
--- /dev/null	Thu Jun 15 09:33:06 2006
+++ SOURCES/gtk+2-bug344765.patch	Thu Jun 15 09:33:00 2006
@@ -0,0 +1,25 @@
+Index: gtk/gtkprintjob.h
+===================================================================
+RCS file: /cvs/gnome/gtk+/gtk/gtkprintjob.h,v
+retrieving revision 1.8
+diff -p -u -u -p -r1.8 gtkprintjob.h
+--- gtk/gtkprintjob.h	12 Jun 2006 16:47:41 -0000	1.8
++++ gtk/gtkprintjob.h	13 Jun 2006 14:19:32 -0000
+@@ -66,13 +66,13 @@ struct _GtkPrintJob
+   GtkPrintPages print_pages;
+   GtkPageRange *page_ranges;
+   gint num_page_ranges;
+-  gboolean rotate_to_orientation;
+   
+   GtkPageSet page_set;
+   gint num_copies;
+-  gboolean collate;
+-  gboolean reverse;
+-  gdouble scale;
++  double scale;
++  guint rotate_to_orientation : 1;
++  guint collate : 1;
++  guint reverse : 1;
+ };
+ 
+ struct _GtkPrintJobClass

================================================================
Index: SOURCES/gtk+2-bug344867.patch
diff -u /dev/null SOURCES/gtk+2-bug344867.patch:1.1
--- /dev/null	Thu Jun 15 09:33:06 2006
+++ SOURCES/gtk+2-bug344867.patch	Thu Jun 15 09:33:00 2006
@@ -0,0 +1,254 @@
+Index: gtk/gtkpagesetupunixdialog.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gtk/gtkpagesetupunixdialog.c,v
+retrieving revision 1.15
+diff -p -u -u -p -U8 -r1.15 gtkpagesetupunixdialog.c
+--- gtk/gtkpagesetupunixdialog.c	12 Jun 2006 04:39:55 -0000	1.15
++++ gtk/gtkpagesetupunixdialog.c	14 Jun 2006 12:58:43 -0000
+@@ -175,164 +169,139 @@ custom_paper_get_filename (void)
+   gchar *filename;
+ 
+   filename = g_build_filename (g_get_home_dir (), 
+ 			       CUSTOM_PAPER_FILENAME, NULL);
+   g_assert (filename != NULL);
+   return filename;
+ }
+ 
+-static gboolean
+-scan_double (gchar   **text, 
+-	     gdouble  *value, 
+-	     gboolean  last)
+-{
+-  gchar *p, *e;
+-
+-  p = *text;
+-  
+-  *value = g_ascii_strtod (p, &e);
+-  if (p == e)
+-    return FALSE;
+-
+-  p = e;
+-  if (!last)
+-    {
+-      while (g_ascii_isspace (*p))
+-	p++;
+-      if (*p++ != ',')
+-	return FALSE;
+-    }
+-  *text = p;
+-  return TRUE;
+-}
+-
+ static void
+ load_custom_papers (GtkListStore *store)
+ {
++  GKeyFile *keyfile;
+   gchar *filename;
+-  gchar *contents;
+-  
++  gchar **groups;
++  gsize n_groups, i;
++  gboolean load_ok;
++
+   filename = custom_paper_get_filename ();
+ 
+-  if (g_file_get_contents (filename, &contents, NULL, NULL))
++  keyfile = g_key_file_new ();
++  load_ok = g_key_file_load_from_file (keyfile, filename, 0, NULL);
++  g_free (filename);
++  if (!load_ok)
++    {
++      g_key_file_free (keyfile);
++      return;
++    }
++
++  groups = g_key_file_get_groups (keyfile, &n_groups);
++  for (i = 0; i < n_groups; ++i)
+     {
+-      gchar **lines = g_strsplit (contents, "\n", -1);
++      GError *error = NULL;
+       gdouble w, h, top, bottom, left, right;
+       GtkPaperSize *paper_size;
+       GtkPageSetup *page_setup;
+-      gchar *name, *p;
++      gchar *name;
+       GtkTreeIter iter;
+-      gint i;
+-
+-      for (i = 0; lines[i]; i++)
+-	{
+-	  name = lines[i];
+-	  p = strchr (lines[i], ':');
+-	  if (p == NULL)
+-	    continue;
+-	  *p++ = 0;
+ 
+-	  while (g_ascii_isspace (*p))
+-	    p++;
+-	  
+-	  if (!scan_double (&p, &w, FALSE))
+-	    continue;
+-	  if (!scan_double (&p, &h, FALSE))
+-	    continue;
+-	  if (!scan_double (&p, &top, FALSE))
+-	    continue;
+-	  if (!scan_double (&p, &bottom, FALSE))
+-	    continue;
+-	  if (!scan_double (&p, &left, FALSE))
+-	    continue;
+-	  if (!scan_double (&p, &right, TRUE))
+-	    continue;
++      name = g_key_file_get_value (keyfile, groups[i], "Name", NULL);
++      if (!name)
++        continue;
++
++#define GET_DOUBLE(kf, name, v) \
++      v = g_key_file_get_double (kf, groups[i], name, &error); \
++      if (error != NULL) \
++        {\
++          g_error_free (error);\
++          continue;\
++        }
++
++      GET_DOUBLE (keyfile, "Width", w);
++      GET_DOUBLE (keyfile, "Height", h);
++      GET_DOUBLE (keyfile, "MarginTop", top);
++      GET_DOUBLE (keyfile, "MarginBottom", bottom);
++      GET_DOUBLE (keyfile, "MarginLeft", left);
++      GET_DOUBLE (keyfile, "MarginRight", right);
++
++#undef GET_DOUBLE
++
++      page_setup = gtk_page_setup_new ();
++      paper_size = gtk_paper_size_new_custom (name, name, w, h, GTK_UNIT_MM);
++      gtk_page_setup_set_paper_size (page_setup, paper_size);
++      gtk_paper_size_free (paper_size);
+ 
+-	  page_setup = gtk_page_setup_new ();
+-	  paper_size = gtk_paper_size_new_custom (name, name, w, h, GTK_UNIT_MM);
+-	  gtk_page_setup_set_paper_size (page_setup, paper_size);
+-	  gtk_paper_size_free (paper_size);
++      gtk_page_setup_set_top_margin (page_setup, top, GTK_UNIT_MM);
++      gtk_page_setup_set_bottom_margin (page_setup, bottom, GTK_UNIT_MM);
++      gtk_page_setup_set_left_margin (page_setup, left, GTK_UNIT_MM);
++      gtk_page_setup_set_right_margin (page_setup, right, GTK_UNIT_MM);
+ 
+-	  gtk_page_setup_set_top_margin (page_setup, top, GTK_UNIT_MM);
+-	  gtk_page_setup_set_bottom_margin (page_setup, bottom, GTK_UNIT_MM);
+-	  gtk_page_setup_set_left_margin (page_setup, left, GTK_UNIT_MM);
+-	  gtk_page_setup_set_right_margin (page_setup, right, GTK_UNIT_MM);
+-
+-	  gtk_list_store_append (store, &iter);
+-	  gtk_list_store_set (store, &iter,
+-			      0, page_setup, 
+-			      -1);
++      gtk_list_store_append (store, &iter);
++      gtk_list_store_set (store, &iter,
++			  0, page_setup, 
++			  -1);
+ 
+-	  g_object_unref (page_setup);
+-	}
+-      
+-      g_free (contents);
+-      g_strfreev (lines);
++      g_object_unref (page_setup);
++      g_free (name);
+     }
+-  g_free (filename);
++ 
++  g_strfreev (groups);
++  g_key_file_free (keyfile);
+ }
+ 
+ static void
+ save_custom_papers (GtkListStore *store)
+ {
+   GtkTreeModel *model = GTK_TREE_MODEL (store);
+   GtkTreeIter iter;
+-  GString *string;
+-  gchar *filename;
++  GKeyFile *keyfile;
++  gchar *filename, *data;
++  gsize len;
++  gint i = 0;
+ 
+-  string = g_string_new ("");
++  keyfile = g_key_file_new ();
+   
+   if (gtk_tree_model_get_iter_first (model, &iter))
+     {
+       do
+ 	{
+ 	  GtkPaperSize *paper_size;
+ 	  GtkPageSetup *page_setup;
+-	  gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
+-	  
++	  gchar group[32];
++
++	  g_snprintf (group, sizeof (group), "Paper%u", i);
++
+ 	  gtk_tree_model_get (model, &iter, 0, &page_setup, -1);
+ 
+ 	  paper_size = gtk_page_setup_get_paper_size (page_setup);
+-	  g_string_append_printf (string, "%s: ", gtk_paper_size_get_name (paper_size));
+-	  
+-	  g_ascii_dtostr (buffer, G_ASCII_DTOSTR_BUF_SIZE,
+-			  gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_MM));
+-	  g_string_append (string, buffer);
+-	  g_string_append (string, ", ");
+-	  g_ascii_dtostr (buffer, G_ASCII_DTOSTR_BUF_SIZE,
+-			  gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_MM));
+-	  g_string_append (string, buffer);
+-	  g_string_append (string, ", ");
+-	  g_ascii_dtostr (buffer, G_ASCII_DTOSTR_BUF_SIZE,
+-			  gtk_page_setup_get_top_margin (page_setup, GTK_UNIT_MM));
+-	  g_string_append (string, buffer);
+-	  g_string_append (string, ", ");
+-	  g_ascii_dtostr (buffer, G_ASCII_DTOSTR_BUF_SIZE, 
+-			  gtk_page_setup_get_bottom_margin (page_setup, GTK_UNIT_MM));
+-	  g_string_append (string, buffer);
+-	  g_string_append (string, ", ");
+-	  g_ascii_dtostr (buffer, G_ASCII_DTOSTR_BUF_SIZE,
+-			  gtk_page_setup_get_left_margin (page_setup, GTK_UNIT_MM));
+-	  g_string_append (string, buffer);
+-	  g_string_append (string, ", ");
+-	  g_ascii_dtostr (buffer, G_ASCII_DTOSTR_BUF_SIZE,
+-			  gtk_page_setup_get_right_margin (page_setup, GTK_UNIT_MM));
+-	  g_string_append (string, buffer);
++	  g_key_file_set_string (keyfile, group, "Name", gtk_paper_size_get_name (paper_size));
+ 
+-	  g_string_append (string, "\n");
++	  g_key_file_set_double (keyfile, group, "Width",
++				 gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_MM));
++	  g_key_file_set_double (keyfile, group, "Height",
++				 gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_MM));
++	  g_key_file_set_double (keyfile, group, "MarginTop",
++				 gtk_page_setup_get_top_margin (page_setup, GTK_UNIT_MM));
++	  g_key_file_set_double (keyfile, group, "MarginBottom",
++				 gtk_page_setup_get_bottom_margin (page_setup, GTK_UNIT_MM));
++	  g_key_file_set_double (keyfile, group, "MarginLeft",
++				 gtk_page_setup_get_left_margin (page_setup, GTK_UNIT_MM));
++	  g_key_file_set_double (keyfile, group, "MarginRight",
++				 gtk_page_setup_get_right_margin (page_setup, GTK_UNIT_MM));
+ 	  
++	  ++i;
+ 	} while (gtk_tree_model_iter_next (model, &iter));
+     }
+ 
+   filename = custom_paper_get_filename ();
+-  g_file_set_contents (filename, string->str, -1, NULL);
++  data = g_key_file_to_data (keyfile, &len, NULL);
++  g_file_set_contents (filename, data, len, NULL);
++  g_free (data);
+   g_free (filename);
+-  
+-  g_string_free (string, TRUE);
+ }
+ 
+ static void
+ gtk_page_setup_unix_dialog_class_init (GtkPageSetupUnixDialogClass *class)
+ {
+   GObjectClass *object_class;
+   GtkWidgetClass *widget_class;
+ 

================================================================
Index: SOURCES/gtk+2-bug344891.patch
diff -u /dev/null SOURCES/gtk+2-bug344891.patch:1.1
--- /dev/null	Thu Jun 15 09:33:06 2006
+++ SOURCES/gtk+2-bug344891.patch	Thu Jun 15 09:33:00 2006
@@ -0,0 +1,22 @@
+Index: gtk/gtkprintoperationpreview.c
+===================================================================
+RCS file: /cvs/gnome/gtk+/gtk/gtkprintoperationpreview.c,v
+retrieving revision 1.2
+diff -u -p -r1.2 gtkprintoperationpreview.c
+--- gtk/gtkprintoperationpreview.c	5 Jun 2006 18:39:20 -0000	1.2
++++ gtk/gtkprintoperationpreview.c	14 Jun 2006 16:49:54 -0000
+@@ -72,12 +72,12 @@ gtk_print_operation_preview_base_init (g
+ 		    NULL, NULL,
+ 		    g_cclosure_marshal_VOID__OBJECT,
+ 		    G_TYPE_NONE, 1,
+-		    G_TYPE_OBJECT);
++		    GTK_TYPE_PRINT_CONTEXT);
+ 
+       g_signal_new (I_("got-page-size"),
+ 		    GTK_TYPE_PRINT_OPERATION_PREVIEW,
+ 		    G_SIGNAL_RUN_LAST,
+-		    G_STRUCT_OFFSET (GtkPrintOperationPreviewIface, ready),
++		    G_STRUCT_OFFSET (GtkPrintOperationPreviewIface, got_page_size),
+ 		    NULL, NULL,
+ 		    _gtk_marshal_VOID__OBJECT_OBJECT,
+ 		    G_TYPE_NONE, 2,
================================================================


More information about the pld-cvs-commit mailing list