Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

115 рядки
4.1 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * GtkAccelLabel: GtkLabel with accelerator monitoring facilities.
  5. * Copyright (C) 1998 Tim Janik
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20. * Boston, MA 02111-1307, USA.
  21. */
  22. /*
  23. * Modified by the GTK+ Team and others 1997-2001. See the AUTHORS
  24. * file for a list of people on the GTK+ Team. See the ChangeLog
  25. * files for a list of changes. These files are distributed with
  26. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  27. */
  28. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  29. #error "Only <gtk/gtk.h> can be included directly."
  30. #endif
  31. #ifndef __GTK_ACCEL_LABEL_H__
  32. #define __GTK_ACCEL_LABEL_H__
  33. #include <gtk/gtklabel.h>
  34. G_BEGIN_DECLS
  35. #define GTK_TYPE_ACCEL_LABEL (gtk_accel_label_get_type ())
  36. #define GTK_ACCEL_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabel))
  37. #define GTK_ACCEL_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
  38. #define GTK_IS_ACCEL_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACCEL_LABEL))
  39. #define GTK_IS_ACCEL_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_LABEL))
  40. #define GTK_ACCEL_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
  41. typedef struct _GtkAccelLabel GtkAccelLabel;
  42. typedef struct _GtkAccelLabelClass GtkAccelLabelClass;
  43. /**
  44. * GtkAccelLabel:
  45. *
  46. * The #GtkAccelLabel-struct struct contains private data only, and
  47. * should be accessed using the functions below.
  48. */
  49. struct _GtkAccelLabel
  50. {
  51. GtkLabel label;
  52. guint GSEAL (gtk_reserved);
  53. guint GSEAL (accel_padding); /* should be style property? */
  54. GtkWidget *GSEAL (accel_widget); /* done*/
  55. GClosure *GSEAL (accel_closure); /* has set function */
  56. GtkAccelGroup *GSEAL (accel_group); /* set by set_accel_closure() */
  57. gchar *GSEAL (accel_string); /* has set function */
  58. guint16 GSEAL (accel_string_width); /* seems to be private */
  59. };
  60. struct _GtkAccelLabelClass
  61. {
  62. GtkLabelClass parent_class;
  63. gchar *signal_quote1;
  64. gchar *signal_quote2;
  65. gchar *mod_name_shift;
  66. gchar *mod_name_control;
  67. gchar *mod_name_alt;
  68. gchar *mod_separator;
  69. gchar *accel_seperator;
  70. guint latin1_to_char : 1;
  71. /* Padding for future expansion */
  72. void (*_gtk_reserved1) (void);
  73. void (*_gtk_reserved2) (void);
  74. void (*_gtk_reserved3) (void);
  75. void (*_gtk_reserved4) (void);
  76. };
  77. #ifndef GTK_DISABLE_DEPRECATED
  78. #define gtk_accel_label_accelerator_width gtk_accel_label_get_accel_width
  79. #endif /* GTK_DISABLE_DEPRECATED */
  80. GType gtk_accel_label_get_type (void) G_GNUC_CONST;
  81. GtkWidget* gtk_accel_label_new (const gchar *string);
  82. GtkWidget* gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label);
  83. guint gtk_accel_label_get_accel_width (GtkAccelLabel *accel_label);
  84. void gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
  85. GtkWidget *accel_widget);
  86. void gtk_accel_label_set_accel_closure (GtkAccelLabel *accel_label,
  87. GClosure *accel_closure);
  88. gboolean gtk_accel_label_refetch (GtkAccelLabel *accel_label);
  89. /* private */
  90. gchar * _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
  91. guint accelerator_key,
  92. GdkModifierType accelerator_mods);
  93. G_END_DECLS
  94. #endif /* __GTK_ACCEL_LABEL_H__ */