Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

118 lignes
5.5 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_PRIVATE_H__
  26. #define __GTK_PRIVATE_H__
  27. #include <gtk/gtkwidget.h>
  28. G_BEGIN_DECLS
  29. /* The private flags that are used in the private_flags member of GtkWidget.
  30. */
  31. typedef enum
  32. {
  33. PRIVATE_GTK_USER_STYLE = 1 << 0,
  34. PRIVATE_GTK_RESIZE_PENDING = 1 << 2,
  35. PRIVATE_GTK_HAS_POINTER = 1 << 3, /* If the pointer is above a window belonging to the widget */
  36. PRIVATE_GTK_SHADOWED = 1 << 4, /* If there is a grab in effect shadowing the widget */
  37. PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5,
  38. PRIVATE_GTK_IN_REPARENT = 1 << 6,
  39. PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */
  40. PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */
  41. PRIVATE_GTK_ANCHORED = 1 << 9, /* If widget has a GtkWindow ancestor */
  42. PRIVATE_GTK_CHILD_VISIBLE = 1 << 10, /* If widget should be mapped when parent is mapped */
  43. PRIVATE_GTK_REDRAW_ON_ALLOC = 1 << 11, /* If we should queue a draw on the entire widget when it is reallocated */
  44. PRIVATE_GTK_ALLOC_NEEDED = 1 << 12, /* If we we should allocate even if the allocation is the same */
  45. PRIVATE_GTK_REQUEST_NEEDED = 1 << 13 /* Whether we need to call gtk_widget_size_request */
  46. } GtkPrivateFlags;
  47. /* Macros for extracting a widgets private_flags from GtkWidget.
  48. */
  49. #define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags)
  50. #define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0)
  51. #define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0)
  52. #define GTK_WIDGET_HAS_POINTER(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_POINTER) != 0)
  53. #define GTK_WIDGET_SHADOWED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_SHADOWED) != 0)
  54. #define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0)
  55. #define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0)
  56. #define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0)
  57. #define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0)
  58. #define GTK_WIDGET_ANCHORED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ANCHORED) != 0)
  59. #define GTK_WIDGET_CHILD_VISIBLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_CHILD_VISIBLE) != 0)
  60. #define GTK_WIDGET_REDRAW_ON_ALLOC(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_ON_ALLOC) != 0)
  61. #define GTK_WIDGET_ALLOC_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ALLOC_NEEDED) != 0)
  62. #define GTK_WIDGET_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REQUEST_NEEDED) != 0)
  63. /* Macros for setting and clearing private widget flags.
  64. * we use a preprocessor string concatenation here for a clear
  65. * flags/private_flags distinction at the cost of single flag operations.
  66. */
  67. #define GTK_PRIVATE_SET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) |= (PRIVATE_ ## flag)); }G_STMT_END
  68. #define GTK_PRIVATE_UNSET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) &= ~(PRIVATE_ ## flag)); }G_STMT_END
  69. #ifdef G_OS_WIN32
  70. const gchar *_gtk_get_datadir ();
  71. const gchar *_gtk_get_libdir ();
  72. const gchar *_gtk_get_sysconfdir ();
  73. const gchar *_gtk_get_localedir ();
  74. const gchar *_gtk_get_data_prefix ();
  75. #undef GTK_DATADIR
  76. #define GTK_DATADIR _gtk_get_datadir ()
  77. #undef GTK_LIBDIR
  78. #define GTK_LIBDIR _gtk_get_libdir ()
  79. #undef GTK_LOCALEDIR
  80. #define GTK_LOCALEDIR _gtk_get_localedir ()
  81. #undef GTK_SYSCONFDIR
  82. #define GTK_SYSCONFDIR _gtk_get_sysconfdir ()
  83. #undef GTK_DATA_PREFIX
  84. #define GTK_DATA_PREFIX _gtk_get_data_prefix ()
  85. #endif /* G_OS_WIN32 */
  86. gboolean _gtk_fnmatch (const char *pattern,
  87. const char *string,
  88. gboolean no_leading_period);
  89. #define GTK_PARAM_READABLE G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
  90. #define GTK_PARAM_WRITABLE G_PARAM_WRITABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
  91. #define GTK_PARAM_READWRITE G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
  92. /* Many keyboard shortcuts for Mac are the same as for X
  93. * except they use Command key instead of Control (e.g. Cut,
  94. * Copy, Paste). This symbol is for those simple cases. */
  95. #ifndef GDK_WINDOWING_QUARTZ
  96. #define GTK_DEFAULT_ACCEL_MOD_MASK GDK_CONTROL_MASK
  97. #else
  98. #define GTK_DEFAULT_ACCEL_MOD_MASK GDK_META_MASK
  99. #endif
  100. G_END_DECLS
  101. #endif /* __GTK_PRIVATE_H__ */