Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

145 řádky
7.5 KiB

  1. /* GtkToolPalette -- A tool palette with categories and DnD support
  2. * Copyright (C) 2008 Openismus GmbH
  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.1 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 Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. *
  18. * Authors:
  19. * Mathias Hasselmann
  20. */
  21. #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  22. #error "Only <gtk/gtk.h> can be included directly."
  23. #endif
  24. #ifndef __GTK_TOOL_PALETTE_H__
  25. #define __GTK_TOOL_PALETTE_H__
  26. #include <gtk/gtkcontainer.h>
  27. #include <gtk/gtkdnd.h>
  28. #include <gtk/gtktoolitem.h>
  29. G_BEGIN_DECLS
  30. #define GTK_TYPE_TOOL_PALETTE (gtk_tool_palette_get_type ())
  31. #define GTK_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_TOOL_PALETTE, GtkToolPalette))
  32. #define GTK_TOOL_PALETTE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
  33. #define GTK_IS_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
  34. #define GTK_IS_TOOL_PALETTE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_TOOL_PALETTE))
  35. #define GTK_TOOL_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOL_PALETTE, GtkToolPaletteClass))
  36. typedef struct _GtkToolPalette GtkToolPalette;
  37. typedef struct _GtkToolPaletteClass GtkToolPaletteClass;
  38. typedef struct _GtkToolPalettePrivate GtkToolPalettePrivate;
  39. /**
  40. * GtkToolPaletteDragTargets:
  41. * @GTK_TOOL_PALETTE_DRAG_ITEMS: Support drag of items.
  42. * @GTK_TOOL_PALETTE_DRAG_GROUPS: Support drag of groups.
  43. *
  44. * Flags used to specify the supported drag targets.
  45. */
  46. typedef enum /*< flags >*/
  47. {
  48. GTK_TOOL_PALETTE_DRAG_ITEMS = (1 << 0),
  49. GTK_TOOL_PALETTE_DRAG_GROUPS = (1 << 1)
  50. }
  51. GtkToolPaletteDragTargets;
  52. /**
  53. * GtkToolPalette:
  54. *
  55. * This should not be accessed directly. Use the accessor functions below.
  56. */
  57. struct _GtkToolPalette
  58. {
  59. GtkContainer parent_instance;
  60. GtkToolPalettePrivate *priv;
  61. };
  62. struct _GtkToolPaletteClass
  63. {
  64. GtkContainerClass parent_class;
  65. void (*set_scroll_adjustments) (GtkWidget *widget,
  66. GtkAdjustment *hadjustment,
  67. GtkAdjustment *vadjustment);
  68. /* Padding for future expansion */
  69. void (*_gtk_reserved1) (void);
  70. void (*_gtk_reserved2) (void);
  71. void (*_gtk_reserved3) (void);
  72. void (*_gtk_reserved4) (void);
  73. void (*_gtk_reserved5) (void);
  74. void (*_gtk_reserved6) (void);
  75. };
  76. GType gtk_tool_palette_get_type (void) G_GNUC_CONST;
  77. GtkWidget* gtk_tool_palette_new (void);
  78. void gtk_tool_palette_set_group_position (GtkToolPalette *palette,
  79. GtkToolItemGroup *group,
  80. gint position);
  81. void gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
  82. GtkToolItemGroup *group,
  83. gboolean exclusive);
  84. void gtk_tool_palette_set_expand (GtkToolPalette *palette,
  85. GtkToolItemGroup *group,
  86. gboolean expand);
  87. gint gtk_tool_palette_get_group_position (GtkToolPalette *palette,
  88. GtkToolItemGroup *group);
  89. gboolean gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
  90. GtkToolItemGroup *group);
  91. gboolean gtk_tool_palette_get_expand (GtkToolPalette *palette,
  92. GtkToolItemGroup *group);
  93. void gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
  94. GtkIconSize icon_size);
  95. void gtk_tool_palette_unset_icon_size (GtkToolPalette *palette);
  96. void gtk_tool_palette_set_style (GtkToolPalette *palette,
  97. GtkToolbarStyle style);
  98. void gtk_tool_palette_unset_style (GtkToolPalette *palette);
  99. GtkIconSize gtk_tool_palette_get_icon_size (GtkToolPalette *palette);
  100. GtkToolbarStyle gtk_tool_palette_get_style (GtkToolPalette *palette);
  101. GtkToolItem* gtk_tool_palette_get_drop_item (GtkToolPalette *palette,
  102. gint x,
  103. gint y);
  104. GtkToolItemGroup* gtk_tool_palette_get_drop_group (GtkToolPalette *palette,
  105. gint x,
  106. gint y);
  107. GtkWidget* gtk_tool_palette_get_drag_item (GtkToolPalette *palette,
  108. const GtkSelectionData *selection);
  109. void gtk_tool_palette_set_drag_source (GtkToolPalette *palette,
  110. GtkToolPaletteDragTargets targets);
  111. void gtk_tool_palette_add_drag_dest (GtkToolPalette *palette,
  112. GtkWidget *widget,
  113. GtkDestDefaults flags,
  114. GtkToolPaletteDragTargets targets,
  115. GdkDragAction actions);
  116. GtkAdjustment* gtk_tool_palette_get_hadjustment (GtkToolPalette *palette);
  117. GtkAdjustment* gtk_tool_palette_get_vadjustment (GtkToolPalette *palette);
  118. G_CONST_RETURN GtkTargetEntry* gtk_tool_palette_get_drag_target_item (void) G_GNUC_CONST;
  119. G_CONST_RETURN GtkTargetEntry* gtk_tool_palette_get_drag_target_group (void) G_GNUC_CONST;
  120. G_END_DECLS
  121. #endif /* __GTK_TOOL_PALETTE_H__ */