You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

102 line
3.9 KiB

  1. /* GTK - The GIMP Toolkit
  2. * gtkpapersize.h: Paper Size
  3. * Copyright (C) 2006, Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. */
  20. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  21. #error "Only <gtk/gtk.h> can be included directly."
  22. #endif
  23. #ifndef __GTK_PAPER_SIZE_H__
  24. #define __GTK_PAPER_SIZE_H__
  25. #include <gtk/gtkenums.h>
  26. G_BEGIN_DECLS
  27. typedef struct _GtkPaperSize GtkPaperSize;
  28. #define GTK_TYPE_PAPER_SIZE (gtk_paper_size_get_type ())
  29. /* Common names, from PWG 5101.1-2002 PWG: Standard for Media Standardized Names */
  30. #define GTK_PAPER_NAME_A3 "iso_a3"
  31. #define GTK_PAPER_NAME_A4 "iso_a4"
  32. #define GTK_PAPER_NAME_A5 "iso_a5"
  33. #define GTK_PAPER_NAME_B5 "iso_b5"
  34. #define GTK_PAPER_NAME_LETTER "na_letter"
  35. #define GTK_PAPER_NAME_EXECUTIVE "na_executive"
  36. #define GTK_PAPER_NAME_LEGAL "na_legal"
  37. GType gtk_paper_size_get_type (void) G_GNUC_CONST;
  38. GtkPaperSize *gtk_paper_size_new (const gchar *name);
  39. GtkPaperSize *gtk_paper_size_new_from_ppd (const gchar *ppd_name,
  40. const gchar *ppd_display_name,
  41. gdouble width,
  42. gdouble height);
  43. GtkPaperSize *gtk_paper_size_new_custom (const gchar *name,
  44. const gchar *display_name,
  45. gdouble width,
  46. gdouble height,
  47. GtkUnit unit);
  48. GtkPaperSize *gtk_paper_size_copy (GtkPaperSize *other);
  49. void gtk_paper_size_free (GtkPaperSize *size);
  50. gboolean gtk_paper_size_is_equal (GtkPaperSize *size1,
  51. GtkPaperSize *size2);
  52. GList *gtk_paper_size_get_paper_sizes (gboolean include_custom);
  53. /* The width is always the shortest side, measure in mm */
  54. G_CONST_RETURN gchar *gtk_paper_size_get_name (GtkPaperSize *size);
  55. G_CONST_RETURN gchar *gtk_paper_size_get_display_name (GtkPaperSize *size);
  56. G_CONST_RETURN gchar *gtk_paper_size_get_ppd_name (GtkPaperSize *size);
  57. gdouble gtk_paper_size_get_width (GtkPaperSize *size, GtkUnit unit);
  58. gdouble gtk_paper_size_get_height (GtkPaperSize *size, GtkUnit unit);
  59. gboolean gtk_paper_size_is_custom (GtkPaperSize *size);
  60. /* Only for custom sizes: */
  61. void gtk_paper_size_set_size (GtkPaperSize *size,
  62. gdouble width,
  63. gdouble height,
  64. GtkUnit unit);
  65. gdouble gtk_paper_size_get_default_top_margin (GtkPaperSize *size,
  66. GtkUnit unit);
  67. gdouble gtk_paper_size_get_default_bottom_margin (GtkPaperSize *size,
  68. GtkUnit unit);
  69. gdouble gtk_paper_size_get_default_left_margin (GtkPaperSize *size,
  70. GtkUnit unit);
  71. gdouble gtk_paper_size_get_default_right_margin (GtkPaperSize *size,
  72. GtkUnit unit);
  73. G_CONST_RETURN gchar *gtk_paper_size_get_default (void);
  74. GtkPaperSize *gtk_paper_size_new_from_key_file (GKeyFile *key_file,
  75. const gchar *group_name,
  76. GError **error);
  77. void gtk_paper_size_to_key_file (GtkPaperSize *size,
  78. GKeyFile *key_file,
  79. const gchar *group_name);
  80. G_END_DECLS
  81. #endif /* __GTK_PAPER_SIZE_H__ */