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.
 
 
 
 
 
 

139 lines
4.7 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. #if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_LIST_C__)
  26. #ifndef __GTK_LIST_H__
  27. #define __GTK_LIST_H__
  28. #include <gtk/gtk.h>
  29. G_BEGIN_DECLS
  30. #define GTK_TYPE_LIST (gtk_list_get_type ())
  31. #define GTK_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST, GtkList))
  32. #define GTK_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass))
  33. #define GTK_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST))
  34. #define GTK_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST))
  35. #define GTK_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST, GtkListClass))
  36. typedef struct _GtkList GtkList;
  37. typedef struct _GtkListClass GtkListClass;
  38. struct _GtkList
  39. {
  40. GtkContainer container;
  41. GList *children;
  42. GList *selection;
  43. GList *undo_selection;
  44. GList *undo_unselection;
  45. GtkWidget *last_focus_child;
  46. GtkWidget *undo_focus_child;
  47. guint htimer;
  48. guint vtimer;
  49. gint anchor;
  50. gint drag_pos;
  51. GtkStateType anchor_state;
  52. guint selection_mode : 2;
  53. guint drag_selection:1;
  54. guint add_mode:1;
  55. };
  56. struct _GtkListClass
  57. {
  58. GtkContainerClass parent_class;
  59. void (* selection_changed) (GtkList *list);
  60. void (* select_child) (GtkList *list,
  61. GtkWidget *child);
  62. void (* unselect_child) (GtkList *list,
  63. GtkWidget *child);
  64. };
  65. GType gtk_list_get_type (void) G_GNUC_CONST;
  66. GtkWidget* gtk_list_new (void);
  67. void gtk_list_insert_items (GtkList *list,
  68. GList *items,
  69. gint position);
  70. void gtk_list_append_items (GtkList *list,
  71. GList *items);
  72. void gtk_list_prepend_items (GtkList *list,
  73. GList *items);
  74. void gtk_list_remove_items (GtkList *list,
  75. GList *items);
  76. void gtk_list_remove_items_no_unref (GtkList *list,
  77. GList *items);
  78. void gtk_list_clear_items (GtkList *list,
  79. gint start,
  80. gint end);
  81. void gtk_list_select_item (GtkList *list,
  82. gint item);
  83. void gtk_list_unselect_item (GtkList *list,
  84. gint item);
  85. void gtk_list_select_child (GtkList *list,
  86. GtkWidget *child);
  87. void gtk_list_unselect_child (GtkList *list,
  88. GtkWidget *child);
  89. gint gtk_list_child_position (GtkList *list,
  90. GtkWidget *child);
  91. void gtk_list_set_selection_mode (GtkList *list,
  92. GtkSelectionMode mode);
  93. void gtk_list_extend_selection (GtkList *list,
  94. GtkScrollType scroll_type,
  95. gfloat position,
  96. gboolean auto_start_selection);
  97. void gtk_list_start_selection (GtkList *list);
  98. void gtk_list_end_selection (GtkList *list);
  99. void gtk_list_select_all (GtkList *list);
  100. void gtk_list_unselect_all (GtkList *list);
  101. void gtk_list_scroll_horizontal (GtkList *list,
  102. GtkScrollType scroll_type,
  103. gfloat position);
  104. void gtk_list_scroll_vertical (GtkList *list,
  105. GtkScrollType scroll_type,
  106. gfloat position);
  107. void gtk_list_toggle_add_mode (GtkList *list);
  108. void gtk_list_toggle_focus_row (GtkList *list);
  109. void gtk_list_toggle_row (GtkList *list,
  110. GtkWidget *item);
  111. void gtk_list_undo_selection (GtkList *list);
  112. void gtk_list_end_drag_selection (GtkList *list);
  113. G_END_DECLS
  114. #endif /* __GTK_LIST_H__ */
  115. #endif /* GTK_DISABLE_DEPRECATED */