]> Pileus Git - ~andy/gtk/blob - gtk/gtkclist.h
Remove unused draw_spin_entry_shadow(). (#80229)
[~andy/gtk] / gtk / gtkclist.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald
3  * Copyright (C) 1997-1998 Jay Painter <jpaint@serv.net><jpaint@gimp.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 /*
22  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
23  * file for a list of people on the GTK+ Team.  See the ChangeLog
24  * files for a list of changes.  These files are distributed with
25  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
26  */
27
28 #ifndef GTK_DISABLE_DEPRECATED
29
30 #ifndef __GTK_CLIST_H__
31 #define __GTK_CLIST_H__
32
33 #include <gdk/gdk.h>
34 #include <gtk/gtksignal.h>
35 #include <gtk/gtkalignment.h>
36 #include <gtk/gtklabel.h>
37 #include <gtk/gtkbutton.h>
38 #include <gtk/gtkhscrollbar.h>
39 #include <gtk/gtkvscrollbar.h>
40 #include <gtk/gtkenums.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45
46 /* clist flags */
47 enum {
48   GTK_CLIST_IN_DRAG             = 1 <<  0,
49   GTK_CLIST_ROW_HEIGHT_SET      = 1 <<  1,
50   GTK_CLIST_SHOW_TITLES         = 1 <<  2,
51   /* Unused */
52   GTK_CLIST_ADD_MODE            = 1 <<  4,
53   GTK_CLIST_AUTO_SORT           = 1 <<  5,
54   GTK_CLIST_AUTO_RESIZE_BLOCKED = 1 <<  6,
55   GTK_CLIST_REORDERABLE         = 1 <<  7,
56   GTK_CLIST_USE_DRAG_ICONS      = 1 <<  8,
57   GTK_CLIST_DRAW_DRAG_LINE      = 1 <<  9,
58   GTK_CLIST_DRAW_DRAG_RECT      = 1 << 10
59 }; 
60
61 /* cell types */
62 typedef enum
63 {
64   GTK_CELL_EMPTY,
65   GTK_CELL_TEXT,
66   GTK_CELL_PIXMAP,
67   GTK_CELL_PIXTEXT,
68   GTK_CELL_WIDGET
69 } GtkCellType;
70
71 typedef enum
72 {
73   GTK_CLIST_DRAG_NONE,
74   GTK_CLIST_DRAG_BEFORE,
75   GTK_CLIST_DRAG_INTO,
76   GTK_CLIST_DRAG_AFTER
77 } GtkCListDragPos;
78
79 typedef enum
80 {
81   GTK_BUTTON_IGNORED = 0,
82   GTK_BUTTON_SELECTS = 1 << 0,
83   GTK_BUTTON_DRAGS   = 1 << 1,
84   GTK_BUTTON_EXPANDS = 1 << 2
85 } GtkButtonAction;
86
87 #define GTK_TYPE_CLIST            (gtk_clist_get_type ())
88 #define GTK_CLIST(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_CLIST, GtkCList))
89 #define GTK_CLIST_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CLIST, GtkCListClass))
90 #define GTK_IS_CLIST(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_CLIST))
91 #define GTK_IS_CLIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CLIST))
92 #define GTK_CLIST_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CLIST, GtkCListClass))
93
94
95 #define GTK_CLIST_FLAGS(clist)             (GTK_CLIST (clist)->flags)
96 #define GTK_CLIST_SET_FLAG(clist,flag)     (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag))
97 #define GTK_CLIST_UNSET_FLAG(clist,flag)   (GTK_CLIST_FLAGS (clist) &= ~(GTK_ ## flag))
98
99 #define GTK_CLIST_IN_DRAG(clist)           (GTK_CLIST_FLAGS (clist) & GTK_CLIST_IN_DRAG)
100 #define GTK_CLIST_ROW_HEIGHT_SET(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ROW_HEIGHT_SET)
101 #define GTK_CLIST_SHOW_TITLES(clist)       (GTK_CLIST_FLAGS (clist) & GTK_CLIST_SHOW_TITLES)
102 #define GTK_CLIST_ADD_MODE(clist)          (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ADD_MODE)
103 #define GTK_CLIST_AUTO_SORT(clist)         (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_SORT)
104 #define GTK_CLIST_AUTO_RESIZE_BLOCKED(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_RESIZE_BLOCKED)
105 #define GTK_CLIST_REORDERABLE(clist)       (GTK_CLIST_FLAGS (clist) & GTK_CLIST_REORDERABLE)
106 #define GTK_CLIST_USE_DRAG_ICONS(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_USE_DRAG_ICONS)
107 #define GTK_CLIST_DRAW_DRAG_LINE(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_LINE)
108 #define GTK_CLIST_DRAW_DRAG_RECT(clist)    (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_RECT)
109
110 #define GTK_CLIST_ROW(_glist_) ((GtkCListRow *)((_glist_)->data))
111
112 /* pointer casting for cells */
113 #define GTK_CELL_TEXT(cell)     (((GtkCellText *) &(cell)))
114 #define GTK_CELL_PIXMAP(cell)   (((GtkCellPixmap *) &(cell)))
115 #define GTK_CELL_PIXTEXT(cell)  (((GtkCellPixText *) &(cell)))
116 #define GTK_CELL_WIDGET(cell)   (((GtkCellWidget *) &(cell)))
117
118 typedef struct _GtkCList GtkCList;
119 typedef struct _GtkCListClass GtkCListClass;
120 typedef struct _GtkCListColumn GtkCListColumn;
121 typedef struct _GtkCListRow GtkCListRow;
122
123 typedef struct _GtkCell GtkCell;
124 typedef struct _GtkCellText GtkCellText;
125 typedef struct _GtkCellPixmap GtkCellPixmap;
126 typedef struct _GtkCellPixText GtkCellPixText;
127 typedef struct _GtkCellWidget GtkCellWidget;
128
129 typedef gint (*GtkCListCompareFunc) (GtkCList     *clist,
130                                      gconstpointer ptr1,
131                                      gconstpointer ptr2);
132
133 typedef struct _GtkCListCellInfo GtkCListCellInfo;
134 typedef struct _GtkCListDestInfo GtkCListDestInfo;
135
136 struct _GtkCListCellInfo
137 {
138   gint row;
139   gint column;
140 };
141
142 struct _GtkCListDestInfo
143 {
144   GtkCListCellInfo cell;
145   GtkCListDragPos  insert_pos;
146 };
147
148 struct _GtkCList
149 {
150   GtkContainer container;
151   
152   guint16 flags;
153   
154   /* mem chunks */
155   GMemChunk *row_mem_chunk;
156   GMemChunk *cell_mem_chunk;
157
158   guint freeze_count;
159   
160   /* allocation rectangle after the conatiner_border_width
161    * and the width of the shadow border */
162   GdkRectangle internal_allocation;
163   
164   /* rows */
165   gint rows;
166   gint row_height;
167   GList *row_list;
168   GList *row_list_end;
169   
170   /* columns */
171   gint columns;
172   GdkRectangle column_title_area;
173   GdkWindow *title_window;
174   
175   /* dynamicly allocated array of column structures */
176   GtkCListColumn *column;
177   
178   /* the scrolling window and its height and width to
179    * make things a little speedier */
180   GdkWindow *clist_window;
181   gint clist_window_width;
182   gint clist_window_height;
183   
184   /* offsets for scrolling */
185   gint hoffset;
186   gint voffset;
187   
188   /* border shadow style */
189   GtkShadowType shadow_type;
190   
191   /* the list's selection mode (gtkenums.h) */
192   GtkSelectionMode selection_mode;
193   
194   /* list of selected rows */
195   GList *selection;
196   GList *selection_end;
197   
198   GList *undo_selection;
199   GList *undo_unselection;
200   gint undo_anchor;
201   
202   /* mouse buttons */
203   guint8 button_actions[5];
204
205   guint8 drag_button;
206
207   /* dnd */
208   GtkCListCellInfo click_cell;
209
210   /* scroll adjustments */
211   GtkAdjustment *hadjustment;
212   GtkAdjustment *vadjustment;
213   
214   /* xor GC for the vertical drag line */
215   GdkGC *xor_gc;
216   
217   /* gc for drawing unselected cells */
218   GdkGC *fg_gc;
219   GdkGC *bg_gc;
220   
221   /* cursor used to indicate dragging */
222   GdkCursor *cursor_drag;
223   
224   /* the current x-pixel location of the xor-drag line */
225   gint x_drag;
226   
227   /* focus handling */
228   gint focus_row;
229
230   gint focus_header_column;
231   
232   /* dragging the selection */
233   gint anchor;
234   GtkStateType anchor_state;
235   gint drag_pos;
236   gint htimer;
237   gint vtimer;
238   
239   GtkSortType sort_type;
240   GtkCListCompareFunc compare;
241   gint sort_column;
242
243   gint drag_highlight_row;
244   GtkCListDragPos drag_highlight_pos;
245 };
246
247 struct _GtkCListClass
248 {
249   GtkContainerClass parent_class;
250   
251   void  (*set_scroll_adjustments) (GtkCList       *clist,
252                                    GtkAdjustment  *hadjustment,
253                                    GtkAdjustment  *vadjustment);
254   void   (*refresh)             (GtkCList       *clist);
255   void   (*select_row)          (GtkCList       *clist,
256                                  gint            row,
257                                  gint            column,
258                                  GdkEvent       *event);
259   void   (*unselect_row)        (GtkCList       *clist,
260                                  gint            row,
261                                  gint            column,
262                                  GdkEvent       *event);
263   void   (*row_move)            (GtkCList       *clist,
264                                  gint            source_row,
265                                  gint            dest_row);
266   void   (*click_column)        (GtkCList       *clist,
267                                  gint            column);
268   void   (*resize_column)       (GtkCList       *clist,
269                                  gint            column,
270                                  gint            width);
271   void   (*toggle_focus_row)    (GtkCList       *clist);
272   void   (*select_all)          (GtkCList       *clist);
273   void   (*unselect_all)        (GtkCList       *clist);
274   void   (*undo_selection)      (GtkCList       *clist);
275   void   (*start_selection)     (GtkCList       *clist);
276   void   (*end_selection)       (GtkCList       *clist);
277   void   (*extend_selection)    (GtkCList       *clist,
278                                  GtkScrollType   scroll_type,
279                                  gfloat          position,
280                                  gboolean        auto_start_selection);
281   void   (*scroll_horizontal)   (GtkCList       *clist,
282                                  GtkScrollType   scroll_type,
283                                  gfloat          position);
284   void   (*scroll_vertical)     (GtkCList       *clist,
285                                  GtkScrollType   scroll_type,
286                                  gfloat          position);
287   void   (*toggle_add_mode)     (GtkCList       *clist);
288   void   (*abort_column_resize) (GtkCList       *clist);
289   void   (*resync_selection)    (GtkCList       *clist,
290                                  GdkEvent       *event);
291   GList* (*selection_find)      (GtkCList       *clist,
292                                  gint            row_number,
293                                  GList          *row_list_element);
294   void   (*draw_row)            (GtkCList       *clist,
295                                  GdkRectangle   *area,
296                                  gint            row,
297                                  GtkCListRow    *clist_row);
298   void   (*draw_drag_highlight) (GtkCList        *clist,
299                                  GtkCListRow     *target_row,
300                                  gint             target_row_number,
301                                  GtkCListDragPos  drag_pos);
302   void   (*clear)               (GtkCList       *clist);
303   void   (*fake_unselect_all)   (GtkCList       *clist,
304                                  gint            row);
305   void   (*sort_list)           (GtkCList       *clist);
306   gint   (*insert_row)          (GtkCList       *clist,
307                                  gint            row,
308                                  gchar          *text[]);
309   void   (*remove_row)          (GtkCList       *clist,
310                                  gint            row);
311   void   (*set_cell_contents)   (GtkCList       *clist,
312                                  GtkCListRow    *clist_row,
313                                  gint            column,
314                                  GtkCellType     type,
315                                  const gchar    *text,
316                                  guint8          spacing,
317                                  GdkPixmap      *pixmap,
318                                  GdkBitmap      *mask);
319   void   (*cell_size_request)   (GtkCList       *clist,
320                                  GtkCListRow    *clist_row,
321                                  gint            column,
322                                  GtkRequisition *requisition);
323
324 };
325
326 struct _GtkCListColumn
327 {
328   gchar *title;
329   GdkRectangle area;
330   
331   GtkWidget *button;
332   GdkWindow *window;
333   
334   gint width;
335   gint min_width;
336   gint max_width;
337   GtkJustification justification;
338   
339   guint visible        : 1;  
340   guint width_set      : 1;
341   guint resizeable     : 1;
342   guint auto_resize    : 1;
343   guint button_passive : 1;
344 };
345
346 struct _GtkCListRow
347 {
348   GtkCell *cell;
349   GtkStateType state;
350   
351   GdkColor foreground;
352   GdkColor background;
353   
354   GtkStyle *style;
355
356   gpointer data;
357   GtkDestroyNotify destroy;
358   
359   guint fg_set     : 1;
360   guint bg_set     : 1;
361   guint selectable : 1;
362 };
363
364 /* Cell Structures */
365 struct _GtkCellText
366 {
367   GtkCellType type;
368   
369   gint16 vertical;
370   gint16 horizontal;
371   
372   GtkStyle *style;
373
374   gchar *text;
375 };
376
377 struct _GtkCellPixmap
378 {
379   GtkCellType type;
380   
381   gint16 vertical;
382   gint16 horizontal;
383   
384   GtkStyle *style;
385
386   GdkPixmap *pixmap;
387   GdkBitmap *mask;
388 };
389
390 struct _GtkCellPixText
391 {
392   GtkCellType type;
393   
394   gint16 vertical;
395   gint16 horizontal;
396   
397   GtkStyle *style;
398
399   gchar *text;
400   guint8 spacing;
401   GdkPixmap *pixmap;
402   GdkBitmap *mask;
403 };
404
405 struct _GtkCellWidget
406 {
407   GtkCellType type;
408   
409   gint16 vertical;
410   gint16 horizontal;
411   
412   GtkStyle *style;
413
414   GtkWidget *widget;
415 };
416
417 struct _GtkCell
418 {
419   GtkCellType type;
420   
421   gint16 vertical;
422   gint16 horizontal;
423   
424   GtkStyle *style;
425
426   union {
427     gchar *text;
428     
429     struct {
430       GdkPixmap *pixmap;
431       GdkBitmap *mask;
432     } pm;
433     
434     struct {
435       gchar *text;
436       guint8 spacing;
437       GdkPixmap *pixmap;
438       GdkBitmap *mask;
439     } pt;
440     
441     GtkWidget *widget;
442   } u;
443 };
444
445 GtkType gtk_clist_get_type (void) G_GNUC_CONST;
446
447 /* create a new GtkCList */
448 GtkWidget* gtk_clist_new             (gint   columns);
449 GtkWidget* gtk_clist_new_with_titles (gint   columns,
450                                       gchar *titles[]);
451
452 /* set adjustments of clist */
453 void gtk_clist_set_hadjustment (GtkCList      *clist,
454                                 GtkAdjustment *adjustment);
455 void gtk_clist_set_vadjustment (GtkCList      *clist,
456                                 GtkAdjustment *adjustment);
457
458 /* get adjustments of clist */
459 GtkAdjustment* gtk_clist_get_hadjustment (GtkCList *clist);
460 GtkAdjustment* gtk_clist_get_vadjustment (GtkCList *clist);
461
462 /* set the border style of the clist */
463 void gtk_clist_set_shadow_type (GtkCList      *clist,
464                                 GtkShadowType  type);
465
466 /* set the clist's selection mode */
467 void gtk_clist_set_selection_mode (GtkCList         *clist,
468                                    GtkSelectionMode  mode);
469
470 /* enable clists reorder ability */
471 void gtk_clist_set_reorderable (GtkCList *clist,
472                                 gboolean  reorderable);
473 void gtk_clist_set_use_drag_icons (GtkCList *clist,
474                                    gboolean  use_icons);
475 void gtk_clist_set_button_actions (GtkCList *clist,
476                                    guint     button,
477                                    guint8    button_actions);
478
479 /* freeze all visual updates of the list, and then thaw the list after
480  * you have made a number of changes and the updates wil occure in a
481  * more efficent mannor than if you made them on a unfrozen list
482  */
483 void gtk_clist_freeze (GtkCList *clist);
484 void gtk_clist_thaw   (GtkCList *clist);
485
486 /* show and hide the column title buttons */
487 void gtk_clist_column_titles_show (GtkCList *clist);
488 void gtk_clist_column_titles_hide (GtkCList *clist);
489
490 /* set the column title to be a active title (responds to button presses, 
491  * prelights, and grabs keyboard focus), or passive where it acts as just
492  * a title
493  */
494 void gtk_clist_column_title_active   (GtkCList *clist,
495                                       gint      column);
496 void gtk_clist_column_title_passive  (GtkCList *clist,
497                                       gint      column);
498 void gtk_clist_column_titles_active  (GtkCList *clist);
499 void gtk_clist_column_titles_passive (GtkCList *clist);
500
501 /* set the title in the column title button */
502 void gtk_clist_set_column_title (GtkCList    *clist,
503                                  gint         column,
504                                  const gchar *title);
505
506 /* returns the title of column. Returns NULL if title is not set */
507 gchar * gtk_clist_get_column_title (GtkCList *clist,
508                                     gint      column);
509
510 /* set a widget instead of a title for the column title button */
511 void gtk_clist_set_column_widget (GtkCList  *clist,
512                                   gint       column,
513                                   GtkWidget *widget);
514
515 /* returns the column widget */
516 GtkWidget * gtk_clist_get_column_widget (GtkCList *clist,
517                                          gint      column);
518
519 /* set the justification on a column */
520 void gtk_clist_set_column_justification (GtkCList         *clist,
521                                          gint              column,
522                                          GtkJustification  justification);
523
524 /* set visibility of a column */
525 void gtk_clist_set_column_visibility (GtkCList *clist,
526                                       gint      column,
527                                       gboolean  visible);
528
529 /* enable/disable column resize operations by mouse */
530 void gtk_clist_set_column_resizeable (GtkCList *clist,
531                                       gint      column,
532                                       gboolean  resizeable);
533
534 /* resize column automatically to its optimal width */
535 void gtk_clist_set_column_auto_resize (GtkCList *clist,
536                                        gint      column,
537                                        gboolean  auto_resize);
538
539 gint gtk_clist_columns_autosize (GtkCList *clist);
540
541 /* return the optimal column width, i.e. maximum of all cell widths */
542 gint gtk_clist_optimal_column_width (GtkCList *clist,
543                                      gint      column);
544
545 /* set the pixel width of a column; this is a necessary step in
546  * creating a CList because otherwise the column width is chozen from
547  * the width of the column title, which will never be right
548  */
549 void gtk_clist_set_column_width (GtkCList *clist,
550                                  gint      column,
551                                  gint      width);
552
553 /* set column minimum/maximum width. min/max_width < 0 => no restriction */
554 void gtk_clist_set_column_min_width (GtkCList *clist,
555                                      gint      column,
556                                      gint      min_width);
557 void gtk_clist_set_column_max_width (GtkCList *clist,
558                                      gint      column,
559                                      gint      max_width);
560
561 /* change the height of the rows, the default (height=0) is
562  * the hight of the current font.
563  */
564 void gtk_clist_set_row_height (GtkCList *clist,
565                                guint     height);
566
567 /* scroll the viewing area of the list to the given column and row;
568  * row_align and col_align are between 0-1 representing the location the
569  * row should appear on the screnn, 0.0 being top or left, 1.0 being
570  * bottom or right; if row or column is -1 then then there is no change
571  */
572 void gtk_clist_moveto (GtkCList *clist,
573                        gint      row,
574                        gint      column,
575                        gfloat    row_align,
576                        gfloat    col_align);
577
578 /* returns whether the row is visible */
579 GtkVisibility gtk_clist_row_is_visible (GtkCList *clist,
580                                         gint      row);
581
582 /* returns the cell type */
583 GtkCellType gtk_clist_get_cell_type (GtkCList *clist,
584                                      gint      row,
585                                      gint      column);
586
587 /* sets a given cell's text, replacing its current contents */
588 void gtk_clist_set_text (GtkCList    *clist,
589                          gint         row,
590                          gint         column,
591                          const gchar *text);
592
593 /* for the "get" functions, any of the return pointer can be
594  * NULL if you are not interested
595  */
596 gint gtk_clist_get_text (GtkCList  *clist,
597                          gint       row,
598                          gint       column,
599                          gchar    **text);
600
601 /* sets a given cell's pixmap, replacing its current contents */
602 void gtk_clist_set_pixmap (GtkCList  *clist,
603                            gint       row,
604                            gint       column,
605                            GdkPixmap *pixmap,
606                            GdkBitmap *mask);
607
608 gint gtk_clist_get_pixmap (GtkCList   *clist,
609                            gint        row,
610                            gint        column,
611                            GdkPixmap **pixmap,
612                            GdkBitmap **mask);
613
614 /* sets a given cell's pixmap and text, replacing its current contents */
615 void gtk_clist_set_pixtext (GtkCList    *clist,
616                             gint         row,
617                             gint         column,
618                             const gchar *text,
619                             guint8       spacing,
620                             GdkPixmap   *pixmap,
621                             GdkBitmap   *mask);
622
623 gint gtk_clist_get_pixtext (GtkCList   *clist,
624                             gint        row,
625                             gint        column,
626                             gchar     **text,
627                             guint8     *spacing,
628                             GdkPixmap **pixmap,
629                             GdkBitmap **mask);
630
631 /* sets the foreground color of a row, the color must already
632  * be allocated
633  */
634 void gtk_clist_set_foreground (GtkCList *clist,
635                                gint      row,
636                                GdkColor *color);
637
638 /* sets the background color of a row, the color must already
639  * be allocated
640  */
641 void gtk_clist_set_background (GtkCList *clist,
642                                gint      row,
643                                GdkColor *color);
644
645 /* set / get cell styles */
646 void gtk_clist_set_cell_style (GtkCList *clist,
647                                gint      row,
648                                gint      column,
649                                GtkStyle *style);
650
651 GtkStyle *gtk_clist_get_cell_style (GtkCList *clist,
652                                     gint      row,
653                                     gint      column);
654
655 void gtk_clist_set_row_style (GtkCList *clist,
656                               gint      row,
657                               GtkStyle *style);
658
659 GtkStyle *gtk_clist_get_row_style (GtkCList *clist,
660                                    gint      row);
661
662 /* this sets a horizontal and vertical shift for drawing
663  * the contents of a cell; it can be positive or negitive;
664  * this is particulary useful for indenting items in a column
665  */
666 void gtk_clist_set_shift (GtkCList *clist,
667                           gint      row,
668                           gint      column,
669                           gint      vertical,
670                           gint      horizontal);
671
672 /* set/get selectable flag of a single row */
673 void gtk_clist_set_selectable (GtkCList *clist,
674                                gint      row,
675                                gboolean  selectable);
676 gboolean gtk_clist_get_selectable (GtkCList *clist,
677                                    gint      row);
678
679 /* prepend/append returns the index of the row you just added,
680  * making it easier to append and modify a row
681  */
682 gint gtk_clist_prepend (GtkCList    *clist,
683                         gchar       *text[]);
684 gint gtk_clist_append  (GtkCList    *clist,
685                         gchar       *text[]);
686
687 /* inserts a row at index row and returns the row where it was
688  * actually inserted (may be different from "row" in auto_sort mode)
689  */
690 gint gtk_clist_insert (GtkCList    *clist,
691                        gint         row,
692                        gchar       *text[]);
693
694 /* removes row at index row */
695 void gtk_clist_remove (GtkCList *clist,
696                        gint      row);
697
698 /* sets a arbitrary data pointer for a given row */
699 void gtk_clist_set_row_data (GtkCList *clist,
700                              gint      row,
701                              gpointer  data);
702
703 /* sets a data pointer for a given row with destroy notification */
704 void gtk_clist_set_row_data_full (GtkCList         *clist,
705                                   gint              row,
706                                   gpointer          data,
707                                   GtkDestroyNotify  destroy);
708
709 /* returns the data set for a row */
710 gpointer gtk_clist_get_row_data (GtkCList *clist,
711                                  gint      row);
712
713 /* givin a data pointer, find the first (and hopefully only!)
714  * row that points to that data, or -1 if none do
715  */
716 gint gtk_clist_find_row_from_data (GtkCList *clist,
717                                    gpointer  data);
718
719 /* force selection of a row */
720 void gtk_clist_select_row (GtkCList *clist,
721                            gint      row,
722                            gint      column);
723
724 /* force unselection of a row */
725 void gtk_clist_unselect_row (GtkCList *clist,
726                              gint      row,
727                              gint      column);
728
729 /* undo the last select/unselect operation */
730 void gtk_clist_undo_selection (GtkCList *clist);
731
732 /* clear the entire list -- this is much faster than removing
733  * each item with gtk_clist_remove
734  */
735 void gtk_clist_clear (GtkCList *clist);
736
737 /* return the row column corresponding to the x and y coordinates,
738  * the returned values are only valid if the x and y coordinates
739  * are respectively to a window == clist->clist_window
740  */
741 gint gtk_clist_get_selection_info (GtkCList *clist,
742                                    gint      x,
743                                    gint      y,
744                                    gint     *row,
745                                    gint     *column);
746
747 /* in multiple or extended mode, select all rows */
748 void gtk_clist_select_all (GtkCList *clist);
749
750 /* in all modes except browse mode, deselect all rows */
751 void gtk_clist_unselect_all (GtkCList *clist);
752
753 /* swap the position of two rows */
754 void gtk_clist_swap_rows (GtkCList *clist,
755                           gint      row1,
756                           gint      row2);
757
758 /* move row from source_row position to dest_row position */
759 void gtk_clist_row_move (GtkCList *clist,
760                          gint      source_row,
761                          gint      dest_row);
762
763 /* sets a compare function different to the default */
764 void gtk_clist_set_compare_func (GtkCList            *clist,
765                                  GtkCListCompareFunc  cmp_func);
766
767 /* the column to sort by */
768 void gtk_clist_set_sort_column (GtkCList *clist,
769                                 gint      column);
770
771 /* how to sort : ascending or descending */
772 void gtk_clist_set_sort_type (GtkCList    *clist,
773                               GtkSortType  sort_type);
774
775 /* sort the list with the current compare function */
776 void gtk_clist_sort (GtkCList *clist);
777
778 /* Automatically sort upon insertion */
779 void gtk_clist_set_auto_sort (GtkCList *clist,
780                               gboolean  auto_sort);
781
782 /* Private function for clist, ctree */
783
784 PangoLayout *_gtk_clist_create_cell_layout (GtkCList       *clist,
785                                             GtkCListRow    *clist_row,
786                                             gint            column);
787
788 #ifdef __cplusplus
789 }
790 #endif                          /* __cplusplus */
791
792 #endif                          /* __GTK_CLIST_H__ */
793
794 #endif /* GTK_DISABLE_DEPRECATED */