No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

138 líneas
4.3 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. /*
  20. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #ifndef GTK_DISABLE_DEPRECATED
  26. #ifndef __GTK_PREVIEW_H__
  27. #define __GTK_PREVIEW_H__
  28. #include <gtk/gtk.h>
  29. G_BEGIN_DECLS
  30. #define GTK_TYPE_PREVIEW (gtk_preview_get_type ())
  31. #define GTK_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PREVIEW, GtkPreview))
  32. #define GTK_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PREVIEW, GtkPreviewClass))
  33. #define GTK_IS_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PREVIEW))
  34. #define GTK_IS_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PREVIEW))
  35. #define GTK_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PREVIEW, GtkPreviewClass))
  36. typedef struct _GtkPreview GtkPreview;
  37. typedef struct _GtkPreviewInfo GtkPreviewInfo;
  38. typedef union _GtkDitherInfo GtkDitherInfo;
  39. typedef struct _GtkPreviewClass GtkPreviewClass;
  40. struct _GtkPreview
  41. {
  42. GtkWidget widget;
  43. guchar *buffer;
  44. guint16 buffer_width;
  45. guint16 buffer_height;
  46. guint16 bpp;
  47. guint16 rowstride;
  48. GdkRgbDither dither;
  49. guint type : 1;
  50. guint expand : 1;
  51. };
  52. struct _GtkPreviewInfo
  53. {
  54. guchar *lookup;
  55. gdouble gamma;
  56. };
  57. union _GtkDitherInfo
  58. {
  59. gushort s[2];
  60. guchar c[4];
  61. };
  62. struct _GtkPreviewClass
  63. {
  64. GtkWidgetClass parent_class;
  65. GtkPreviewInfo info;
  66. };
  67. GType gtk_preview_get_type (void) G_GNUC_CONST;
  68. void gtk_preview_uninit (void);
  69. GtkWidget* gtk_preview_new (GtkPreviewType type);
  70. void gtk_preview_size (GtkPreview *preview,
  71. gint width,
  72. gint height);
  73. void gtk_preview_put (GtkPreview *preview,
  74. GdkWindow *window,
  75. GdkGC *gc,
  76. gint srcx,
  77. gint srcy,
  78. gint destx,
  79. gint desty,
  80. gint width,
  81. gint height);
  82. void gtk_preview_draw_row (GtkPreview *preview,
  83. guchar *data,
  84. gint x,
  85. gint y,
  86. gint w);
  87. void gtk_preview_set_expand (GtkPreview *preview,
  88. gboolean expand);
  89. void gtk_preview_set_gamma (double gamma_);
  90. void gtk_preview_set_color_cube (guint nred_shades,
  91. guint ngreen_shades,
  92. guint nblue_shades,
  93. guint ngray_shades);
  94. void gtk_preview_set_install_cmap (gint install_cmap);
  95. void gtk_preview_set_reserved (gint nreserved);
  96. void gtk_preview_set_dither (GtkPreview *preview,
  97. GdkRgbDither dither);
  98. GdkVisual* gtk_preview_get_visual (void);
  99. GdkColormap* gtk_preview_get_cmap (void);
  100. GtkPreviewInfo* gtk_preview_get_info (void);
  101. /* This function reinitializes the preview colormap and visual from
  102. * the current gamma/color_cube/install_cmap settings. It must only
  103. * be called if there are no previews or users's of the preview
  104. * colormap in existence.
  105. */
  106. void gtk_preview_reset (void);
  107. G_END_DECLS
  108. #endif /* __GTK_PREVIEW_H__ */
  109. #endif /* GTK_DISABLE_DEPRECATED */